From 95afb8058e824bcff5598c708345a1e185883dfd Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sun, 17 Nov 2024 18:58:39 +0100 Subject: [PATCH 01/38] feat(api): support for new Jellyfin API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔧 wip ... Signed-off-by: Patrik Gfeller --- .gitignore | 2 + .../org.openhab.binding.jellyfin/.directory | 2 + .../org.openhab.binding.jellyfin/.gitignore | 4 + .../.openapi-generator-ignore | 27 + .../org.openhab.binding.jellyfin/README.md | 1 + bundles/org.openhab.binding.jellyfin/pom.xml | 102 +- ...rConfiguration.java => Configuration.java} | 5 +- ...inBindingConstants.java => Constants.java} | 5 +- ...rFactory.java => JellyfinHandlerFactory._} | 37 - .../internal/api/generated/ApiClient.java | 475 + .../internal/api/generated/ApiException.java | 94 + .../internal/api/generated/ApiResponse.java | 60 + .../internal/api/generated/Configuration.java | 63 + .../jellyfin/internal/api/generated/JSON.java | 262 + .../jellyfin/internal/api/generated/Pair.java | 57 + .../api/generated/RFC3339DateFormat.java | 56 + .../generated/RFC3339InstantDeserializer.java | 73 + .../api/generated/RFC3339JavaTimeModule.java | 32 + .../api/generated/ServerConfiguration.java | 74 + .../api/generated/ServerVariable.java | 37 + .../api/generated/current/ActivityLogApi.java | 189 + .../api/generated/current/ApiKeyApi.java | 304 + .../api/generated/current/ArtistsApi.java | 855 + .../api/generated/current/AudioApi.java | 1917 + .../api/generated/current/BrandingApi.java | 285 + .../api/generated/current/ChannelsApi.java | 642 + .../api/generated/current/ClientLogApi.java | 154 + .../api/generated/current/CollectionApi.java | 375 + .../generated/current/ConfigurationApi.java | 458 + .../api/generated/current/DashboardApi.java | 258 + .../api/generated/current/DevicesApi.java | 546 + .../current/DisplayPreferencesApi.java | 313 + .../api/generated/current/DynamicHlsApi.java | 4444 ++ .../api/generated/current/EnvironmentApi.java | 589 + .../api/generated/current/FilterApi.java | 342 + .../api/generated/current/GenresApi.java | 403 + .../api/generated/current/HlsSegmentApi.java | 551 + .../api/generated/current/ImageApi.java | 6278 ++ .../api/generated/current/InstantMixApi.java | 1229 + .../api/generated/current/ItemLookupApi.java | 1133 + .../api/generated/current/ItemRefreshApi.java | 199 + .../api/generated/current/ItemUpdateApi.java | 334 + .../api/generated/current/ItemsApi.java | 1259 + .../api/generated/current/LibraryApi.java | 2573 + .../current/LibraryStructureApi.java | 794 + .../api/generated/current/LiveTvApi.java | 4272 + .../generated/current/LocalizationApi.java | 365 + .../api/generated/current/LyricsApi.java | 595 + .../api/generated/current/MediaInfoApi.java | 750 + .../generated/current/MediaSegmentsApi.java | 177 + .../api/generated/current/MoviesApi.java | 198 + .../api/generated/current/MusicGenresApi.java | 408 + .../api/generated/current/PackageApi.java | 572 + .../api/generated/current/PersonsApi.java | 358 + .../api/generated/current/PlaylistsApi.java | 1167 + .../api/generated/current/PlaystateApi.java | 1006 + .../api/generated/current/PluginsApi.java | 785 + .../generated/current/QuickConnectApi.java | 418 + .../api/generated/current/RemoteImageApi.java | 387 + .../generated/current/ScheduledTasksApi.java | 482 + .../api/generated/current/SearchApi.java | 289 + .../api/generated/current/SessionApi.java | 1568 + .../api/generated/current/StartupApi.java | 584 + .../api/generated/current/StudiosApi.java | 394 + .../api/generated/current/SubtitleApi.java | 1158 + .../api/generated/current/SuggestionsApi.java | 202 + .../api/generated/current/SyncPlayApi.java | 1683 + .../api/generated/current/SystemApi.java | 810 + .../api/generated/current/TimeSyncApi.java | 141 + .../api/generated/current/TmdbApi.java | 140 + .../api/generated/current/TrailersApi.java | 823 + .../api/generated/current/TrickplayApi.java | 299 + .../api/generated/current/TvShowsApi.java | 782 + .../generated/current/UniversalAudioApi.java | 520 + .../api/generated/current/UserApi.java | 1310 + .../api/generated/current/UserLibraryApi.java | 1138 + .../api/generated/current/UserViewsApi.java | 284 + .../current/VideoAttachmentsApi.java | 168 + .../api/generated/current/VideosApi.java | 2232 + .../api/generated/current/YearsApi.java | 379 + .../current/model/AbstractOpenApiSchema.java | 146 + .../current/model/AccessSchedule.java | 351 + .../current/model/ActivityLogEntry.java | 562 + .../model/ActivityLogEntryMessage.java | 285 + .../model/ActivityLogEntryQueryResult.java | 289 + .../model/ActivityLogEntryStartMessage.java | 229 + .../model/ActivityLogEntryStopMessage.java | 188 + .../current/model/AddVirtualFolderDto.java | 189 + .../generated/current/model/AlbumInfo.java | 772 + .../model/AlbumInfoRemoteSearchQuery.java | 317 + .../current/model/AllThemeMediaResult.java | 272 + .../generated/current/model/ArtistInfo.java | 671 + .../model/ArtistInfoRemoteSearchQuery.java | 318 + .../current/model/AudioSpatialFormat.java | 69 + .../current/model/AuthenticateUserByName.java | 232 + .../current/model/AuthenticationInfo.java | 643 + .../model/AuthenticationInfoQueryResult.java | 290 + .../current/model/AuthenticationResult.java | 312 + .../generated/current/model/BaseItemDto.java | 6695 ++ .../model/BaseItemDtoImageBlurHashes.java | 829 + .../current/model/BaseItemDtoQueryResult.java | 288 + .../generated/current/model/BaseItemKind.java | 137 + .../current/model/BaseItemPerson.java | 394 + .../model/BaseItemPersonImageBlurHashes.java | 830 + .../api/generated/current/model/BookInfo.java | 654 + .../model/BookInfoRemoteSearchQuery.java | 316 + .../generated/current/model/BoxSetInfo.java | 617 + .../model/BoxSetInfoRemoteSearchQuery.java | 318 + .../current/model/BrandingOptions.java | 274 + .../current/model/BufferRequestDto.java | 316 + .../model/CastReceiverApplication.java | 232 + .../current/model/ChannelFeatures.java | 687 + .../current/model/ChannelItemSortField.java | 77 + .../model/ChannelMappingOptionsDto.java | 357 + .../model/ChannelMediaContentType.java | 79 + .../current/model/ChannelMediaType.java | 69 + .../generated/current/model/ChannelType.java | 67 + .../generated/current/model/ChapterInfo.java | 355 + .../current/model/ClientCapabilitiesDto.java | 474 + .../model/ClientLogDocumentResponseDto.java | 192 + .../generated/current/model/CodecProfile.java | 422 + .../generated/current/model/CodecType.java | 69 + .../model/CollectionCreationResult.java | 193 + .../current/model/CollectionType.java | 89 + .../current/model/CollectionTypeOptions.java | 79 + .../current/model/ConfigImageTypes.java | 494 + .../current/model/ConfigurationPageInfo.java | 397 + .../current/model/ContainerProfile.java | 328 + .../generated/current/model/CountryInfo.java | 315 + .../current/model/CreatePlaylistDto.java | 422 + .../current/model/CreateUserByName.java | 232 + .../generated/current/model/CultureDto.java | 370 + .../generated/current/model/DayOfWeek.java | 77 + .../generated/current/model/DayPattern.java | 69 + .../model/DefaultDirectoryBrowserInfoDto.java | 192 + .../current/model/DeinterlaceMethod.java | 67 + .../current/model/DeviceInfoDto.java | 602 + .../model/DeviceInfoDtoQueryResult.java | 288 + .../current/model/DeviceOptionsDto.java | 272 + .../current/model/DeviceProfile.java | 685 + .../current/model/DirectPlayProfile.java | 314 + .../current/model/DisplayPreferencesDto.java | 738 + .../current/model/DlnaProfileType.java | 73 + .../model/DownMixStereoAlgorithms.java | 73 + .../current/model/DynamicDayOfWeek.java | 83 + .../model/EmbeddedSubtitleOptions.java | 71 + .../current/model/EncoderPreset.java | 85 + .../current/model/EncodingContext.java | 67 + .../current/model/EncodingOptions.java | 2171 + .../generated/current/model/EndPointInfo.java | 232 + .../current/model/ExternalIdInfo.java | 317 + .../current/model/ExternalIdMediaType.java | 89 + .../generated/current/model/ExternalUrl.java | 231 + .../generated/current/model/ExtraType.java | 87 + .../current/model/FileSystemEntryInfo.java | 273 + .../current/model/FileSystemEntryType.java | 71 + .../api/generated/current/model/FontFile.java | 314 + .../current/model/ForceKeepAliveMessage.java | 271 + .../current/model/ForgotPasswordAction.java | 69 + .../current/model/ForgotPasswordDto.java | 192 + .../current/model/ForgotPasswordPinDto.java | 192 + .../current/model/ForgotPasswordResult.java | 276 + .../current/model/GeneralCommand.java | 289 + .../current/model/GeneralCommandMessage.java | 270 + .../current/model/GeneralCommandType.java | 149 + .../current/model/GetProgramsDto.java | 1349 + .../generated/current/model/GroupInfoDto.java | 370 + .../model/GroupInfoDtoGroupUpdate.java | 269 + .../current/model/GroupQueueMode.java | 67 + .../current/model/GroupRepeatMode.java | 69 + .../current/model/GroupShuffleMode.java | 67 + .../current/model/GroupStateType.java | 71 + .../current/model/GroupStateUpdate.java | 232 + .../model/GroupStateUpdateGroupUpdate.java | 269 + .../generated/current/model/GroupUpdate.java | 453 + .../current/model/GroupUpdateType.java | 85 + .../generated/current/model/GuideInfo.java | 232 + .../model/HardwareAccelerationType.java | 79 + .../api/generated/current/model/IPlugin.java | 376 + .../current/model/IgnoreWaitRequestDto.java | 192 + .../generated/current/model/ImageFormat.java | 75 + .../generated/current/model/ImageInfo.java | 472 + .../generated/current/model/ImageOption.java | 272 + .../current/model/ImageOrientation.java | 79 + .../current/model/ImageProviderInfo.java | 247 + .../current/model/ImageResolution.java | 81 + .../current/model/ImageSavingConvention.java | 67 + .../generated/current/model/ImageType.java | 89 + .../model/InboundKeepAliveMessage.java | 188 + .../model/InboundWebSocketMessage.java | 656 + .../current/model/InstallationInfo.java | 436 + .../api/generated/current/model/IsoType.java | 67 + .../generated/current/model/ItemCounts.java | 642 + .../generated/current/model/ItemFields.java | 183 + .../generated/current/model/ItemFilter.java | 81 + .../generated/current/model/ItemSortBy.java | 127 + .../current/model/JoinGroupRequestDto.java | 193 + .../generated/current/model/KeepUntil.java | 71 + .../current/model/LibraryChangedMessage.java | 270 + .../current/model/LibraryOptionInfoDto.java | 232 + .../current/model/LibraryOptions.java | 2119 + .../model/LibraryOptionsResultDto.java | 426 + .../current/model/LibraryTypeOptionsDto.java | 414 + .../current/model/LibraryUpdateInfo.java | 502 + .../current/model/ListingsProviderInfo.java | 958 + .../current/model/LiveStreamResponse.java | 189 + .../generated/current/model/LiveTvInfo.java | 299 + .../current/model/LiveTvOptions.java | 819 + .../current/model/LiveTvServiceInfo.java | 490 + .../current/model/LiveTvServiceStatus.java | 67 + .../current/model/LocalizationOption.java | 232 + .../generated/current/model/LocationType.java | 71 + .../api/generated/current/model/LogFile.java | 314 + .../api/generated/current/model/LogLevel.java | 77 + .../api/generated/current/model/LyricDto.java | 242 + .../generated/current/model/LyricLine.java | 231 + .../current/model/LyricMetadata.java | 554 + .../current/model/MediaAttachment.java | 436 + .../generated/current/model/MediaPathDto.java | 271 + .../current/model/MediaPathInfo.java | 192 + .../current/model/MediaProtocol.java | 77 + .../current/model/MediaSegmentDto.java | 355 + .../model/MediaSegmentDtoQueryResult.java | 289 + .../current/model/MediaSegmentType.java | 75 + .../current/model/MediaSourceInfo.java | 2063 + .../current/model/MediaSourceType.java | 69 + .../generated/current/model/MediaStream.java | 2670 + .../current/model/MediaStreamProtocol.java | 67 + .../current/model/MediaStreamType.java | 75 + .../generated/current/model/MediaType.java | 73 + .../current/model/MediaUpdateInfoDto.java | 204 + .../current/model/MediaUpdateInfoPathDto.java | 232 + .../api/generated/current/model/MediaUrl.java | 231 + .../current/model/MessageCommand.java | 272 + .../current/model/MetadataConfiguration.java | 197 + .../current/model/MetadataEditorInfo.java | 467 + .../current/model/MetadataField.java | 81 + .../current/model/MetadataOptions.java | 511 + .../current/model/MetadataRefreshMode.java | 71 + .../model/MovePlaylistItemRequestDto.java | 234 + .../generated/current/model/MovieInfo.java | 614 + .../model/MovieInfoRemoteSearchQuery.java | 317 + .../current/model/MusicVideoInfo.java | 670 + .../MusicVideoInfoRemoteSearchQuery.java | 319 + .../generated/current/model/NameGuidPair.java | 232 + .../generated/current/model/NameIdPair.java | 231 + .../current/model/NameValuePair.java | 231 + .../current/model/NetworkConfiguration.java | 1188 + .../current/model/NewGroupRequestDto.java | 192 + .../current/model/NextItemRequestDto.java | 193 + .../current/model/OpenLiveStreamDto.java | 755 + .../model/OutboundKeepAliveMessage.java | 230 + .../model/OutboundWebSocketMessage.java | 2079 + .../generated/current/model/PackageInfo.java | 489 + .../current/model/ParentalRating.java | 231 + .../current/model/PathSubstitution.java | 231 + .../generated/current/model/PersonKind.java | 113 + .../current/model/PersonLookupInfo.java | 617 + .../PersonLookupInfoRemoteSearchQuery.java | 320 + .../current/model/PinRedeemResult.java | 245 + .../current/model/PingRequestDto.java | 192 + .../generated/current/model/PlayAccess.java | 67 + .../generated/current/model/PlayCommand.java | 73 + .../generated/current/model/PlayMessage.java | 268 + .../generated/current/model/PlayMethod.java | 69 + .../current/model/PlayQueueUpdate.java | 493 + .../model/PlayQueueUpdateGroupUpdate.java | 269 + .../current/model/PlayQueueUpdateReason.java | 83 + .../generated/current/model/PlayRequest.java | 495 + .../current/model/PlayRequestDto.java | 290 + .../current/model/PlaybackErrorCode.java | 69 + .../current/model/PlaybackInfoDto.java | 821 + .../current/model/PlaybackInfoResponse.java | 289 + .../current/model/PlaybackOrder.java | 67 + .../current/model/PlaybackProgressInfo.java | 1027 + .../current/model/PlaybackRequestType.java | 97 + .../current/model/PlaybackStartInfo.java | 1026 + .../current/model/PlaybackStopInfo.java | 615 + .../current/model/PlayerStateInfo.java | 642 + .../current/model/PlaylistCreationResult.java | 192 + .../generated/current/model/PlaylistDto.java | 300 + .../model/PlaylistUserPermissions.java | 233 + .../current/model/PlaystateCommand.java | 81 + .../current/model/PlaystateMessage.java | 269 + .../current/model/PlaystateRequest.java | 274 + .../generated/current/model/PluginInfo.java | 475 + .../PluginInstallationCancelledMessage.java | 272 + .../PluginInstallationCompletedMessage.java | 272 + .../PluginInstallationFailedMessage.java | 271 + .../model/PluginInstallingMessage.java | 270 + .../generated/current/model/PluginStatus.java | 77 + .../model/PluginUninstalledMessage.java | 270 + .../current/model/PreviousItemRequestDto.java | 193 + .../current/model/ProblemDetails.java | 408 + .../current/model/ProcessPriorityClass.java | 75 + .../current/model/ProfileCondition.java | 314 + .../current/model/ProfileConditionType.java | 73 + .../current/model/ProfileConditionValue.java | 111 + .../generated/current/model/ProgramAudio.java | 75 + .../current/model/PublicSystemInfo.java | 440 + .../generated/current/model/QueryFilters.java | 256 + .../current/model/QueryFiltersLegacy.java | 360 + .../generated/current/model/QueueItem.java | 232 + .../current/model/QueueRequestDto.java | 247 + .../current/model/QuickConnectDto.java | 192 + .../current/model/QuickConnectResult.java | 478 + .../generated/current/model/RatingType.java | 67 + .../current/model/ReadyRequestDto.java | 316 + .../current/model/RecommendationDto.java | 330 + .../current/model/RecommendationType.java | 75 + .../current/model/RecordingStatus.java | 77 + .../current/model/RefreshProgressMessage.java | 284 + .../current/model/RemoteImageInfo.java | 560 + .../current/model/RemoteImageResult.java | 299 + .../current/model/RemoteLyricInfoDto.java | 272 + .../current/model/RemoteSearchResult.java | 670 + .../current/model/RemoteSubtitleInfo.java | 809 + .../model/RemoveFromPlaylistRequestDto.java | 293 + .../generated/current/model/RepeatMode.java | 69 + .../current/model/RepositoryInfo.java | 272 + .../current/model/RestartRequiredMessage.java | 230 + .../model/ScheduledTaskEndedMessage.java | 270 + .../model/ScheduledTasksInfoMessage.java | 285 + .../model/ScheduledTasksInfoStartMessage.java | 229 + .../model/ScheduledTasksInfoStopMessage.java | 188 + .../current/model/ScrollDirection.java | 67 + .../generated/current/model/SearchHint.java | 1349 + .../current/model/SearchHintResult.java | 247 + .../current/model/SeekRequestDto.java | 192 + .../generated/current/model/SendCommand.java | 397 + .../current/model/SendCommandType.java | 71 + .../generated/current/model/SeriesInfo.java | 617 + .../model/SeriesInfoRemoteSearchQuery.java | 318 + .../generated/current/model/SeriesStatus.java | 69 + .../model/SeriesTimerCancelledMessage.java | 270 + .../model/SeriesTimerCreatedMessage.java | 270 + .../current/model/SeriesTimerInfoDto.java | 1634 + .../model/SeriesTimerInfoDtoQueryResult.java | 290 + .../current/model/ServerConfiguration.java | 2577 + .../current/model/ServerDiscoveryInfo.java | 314 + .../model/ServerRestartingMessage.java | 230 + .../model/ServerShuttingDownMessage.java | 230 + .../current/model/SessionInfoDto.java | 1408 + .../current/model/SessionMessageType.java | 131 + .../current/model/SessionUserInfo.java | 233 + .../current/model/SessionsMessage.java | 284 + .../current/model/SessionsStartMessage.java | 228 + .../current/model/SessionsStopMessage.java | 188 + .../current/model/SetChannelMappingDto.java | 274 + .../model/SetPlaylistItemRequestDto.java | 193 + .../model/SetRepeatModeRequestDto.java | 192 + .../model/SetShuffleModeRequestDto.java | 192 + .../api/generated/current/model/SongInfo.java | 758 + .../generated/current/model/SortOrder.java | 67 + .../current/model/SpecialViewOptionDto.java | 231 + .../model/StartupConfigurationDto.java | 277 + .../current/model/StartupRemoteAccessDto.java | 235 + .../current/model/StartupUserDto.java | 231 + .../current/model/StringGroupUpdate.java | 270 + .../current/model/SubtitleDeliveryMethod.java | 73 + .../current/model/SubtitleOptions.java | 546 + .../current/model/SubtitlePlaybackMode.java | 73 + .../current/model/SubtitleProfile.java | 355 + .../current/model/SyncPlayCommandMessage.java | 270 + .../SyncPlayGroupUpdateCommandMessage.java | 271 + .../current/model/SyncPlayQueueItem.java | 229 + .../current/model/SyncPlayUserAccessType.java | 69 + .../generated/current/model/SystemInfo.java | 1308 + .../current/model/TaskCompletionStatus.java | 71 + .../api/generated/current/model/TaskInfo.java | 571 + .../generated/current/model/TaskResult.java | 476 + .../generated/current/model/TaskState.java | 69 + .../current/model/TaskTriggerInfo.java | 355 + .../current/model/ThemeMediaResult.java | 329 + .../current/model/TimerCancelledMessage.java | 270 + .../current/model/TimerCreatedMessage.java | 270 + .../current/model/TimerEventInfo.java | 232 + .../generated/current/model/TimerInfoDto.java | 1312 + .../model/TimerInfoDtoQueryResult.java | 288 + .../current/model/TonemappingAlgorithm.java | 79 + .../current/model/TonemappingMode.java | 73 + .../current/model/TonemappingRange.java | 69 + .../generated/current/model/TrailerInfo.java | 617 + .../model/TrailerInfoRemoteSearchQuery.java | 318 + .../current/model/TranscodeReason.java | 115 + .../current/model/TranscodeSeekInfo.java | 67 + .../current/model/TranscodingInfo.java | 701 + .../current/model/TranscodingProfile.java | 867 + .../model/TransportStreamTimestamp.java | 69 + .../current/model/TrickplayInfo.java | 436 + .../current/model/TrickplayOptions.java | 661 + .../current/model/TrickplayScanBehavior.java | 67 + .../current/model/TunerChannelMapping.java | 314 + .../current/model/TunerHostInfo.java | 772 + .../generated/current/model/TypeOptions.java | 456 + .../generated/current/model/UnratedItem.java | 81 + .../model/UpdateLibraryOptionsDto.java | 232 + .../model/UpdateMediaPathRequestDto.java | 231 + .../current/model/UpdatePlaylistDto.java | 340 + .../current/model/UpdatePlaylistUserDto.java | 192 + .../current/model/UpdateUserItemDataDto.java | 602 + .../current/model/UpdateUserPassword.java | 314 + .../current/model/UploadSubtitleDto.java | 355 + .../current/model/UserConfiguration.java | 877 + .../current/model/UserDataChangeInfo.java | 248 + .../current/model/UserDataChangedMessage.java | 270 + .../current/model/UserDeletedMessage.java | 270 + .../api/generated/current/model/UserDto.java | 725 + .../current/model/UserItemDataDto.java | 602 + .../generated/current/model/UserPolicy.java | 2074 + .../current/model/UserUpdatedMessage.java | 269 + .../current/model/UtcTimeResponse.java | 238 + .../current/model/ValidatePathDto.java | 274 + .../generated/current/model/VersionInfo.java | 514 + .../current/model/Video3DFormat.java | 73 + .../generated/current/model/VideoRange.java | 69 + .../current/model/VideoRangeType.java | 81 + .../generated/current/model/VideoType.java | 71 + .../current/model/VirtualFolderInfo.java | 491 + .../current/model/WakeOnLanInfo.java | 232 + .../current/model/WebSocketMessage.java | 338 + .../current/model/XbmcMetadataOptions.java | 362 + .../jellyfin/internal/client/Jellyfin._ | 137 + .../internal/client/JellyfinClientFactory._ | 106 + .../internal/client/JellyfinOptions._ | 156 + .../internal/client/api/client/ApiClient._ | 155 + .../client/api/client/ApiClientFactory._ | 38 + .../client/api/client/HttpClientOptions._ | 115 + .../internal/client/api/client/HttpMethod._ | 27 + .../internal/client/api/client/RawResponse._ | 86 + .../api/client/exception/ApiClientException._ | 43 + .../exception/MissingBaseUrlException._ | 31 + .../client/api/client/impl/JettyApiClient._ | 237 + .../api/client/impl/JettyApiClientFactory._ | 48 + .../client/discovery/DiscoveryService._ | 94 + .../client/discovery/ServerDiscoveryInfo._ | 90 + .../internal/client/model/ClientInfo._ | 77 + .../internal/client/model/DeviceInfo._ | 78 + .../internal/client/model/ServerVersion._ | 161 + ....java => JellyfinClientDiscoveryService._} | 5 +- ....java => JellyfinServerDiscoveryService._} | 16 +- .../discovery/ServerDiscoveryHelper.java | 111 + .../discovery/ServerDiscoveryResult.java | 71 + .../discovery/ServerDiscoveryService.java | 93 + .../exceptions/JellyfinException.java | 30 + .../internal/handler/HandlerFactory.java | 53 + ...ntHandler.java => JellyfinClientHandler._} | 8 +- ...erHandler.java => JellyfinServerHandler._} | 30 +- .../internal/handler/ServerHandler.java | 114 + .../internal/i18n/ResourceHelper.java | 44 + .../servlet/JellyfinBridgeServlet.java | 125 - .../JellyfinExceptionHandler.java} | 13 +- .../jellyfin/internal/util/SyncCallback.java | 85 - .../jellyfin/internal/util/SyncResponse.java | 45 - .../resources/OH-INF/i18n/jellyfin.properties | 4 +- .../generate-sources/scripts/environment.ini | 1 + .../generate-sources/scripts/generate.sh | 134 + .../generate-sources/scripts/java.config.json | 19 + .../json/jellyfin-openapi-10.10.7.json | 59316 ++++++++++++++ .../json/jellyfin-openapi-10.11.0.json | 66652 ++++++++++++++++ .../json/jellyfin-openapi-10.8.13.json | 55485 +++++++++++++ .../yaml/jellyfin-openapi-10.10.7.yaml | 39350 +++++++++ .../yaml/jellyfin-openapi-10.11.0.yaml | 0 .../yaml/jellyfin-openapi-10.8.13.yaml | 35824 +++++++++ .../templates/generatedAnnotation.mustache | 1 + .../scripts/templates/licenseInfo.mustache | 12 + .../nullable_var_annotations.mustache | 1 + pom.xml | 7 +- .../checkstyle/suppressions.xml | 3 +- .../spotbugs/suppressions.xml | 3 + 470 files changed, 439415 insertions(+), 461 deletions(-) create mode 100644 bundles/org.openhab.binding.jellyfin/.directory create mode 100644 bundles/org.openhab.binding.jellyfin/.gitignore create mode 100644 bundles/org.openhab.binding.jellyfin/.openapi-generator-ignore rename bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/{JellyfinServerConfiguration.java => Configuration.java} (84%) rename bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/{JellyfinBindingConstants.java => Constants.java} (93%) rename bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/{JellyfinHandlerFactory.java => JellyfinHandlerFactory._} (62%) create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ApiClient.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ApiException.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ApiResponse.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/Configuration.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/JSON.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/Pair.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/RFC3339DateFormat.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/RFC3339InstantDeserializer.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/RFC3339JavaTimeModule.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ServerConfiguration.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ServerVariable.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ActivityLogApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ApiKeyApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ArtistsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/AudioApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/BrandingApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ChannelsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ClientLogApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/CollectionApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ConfigurationApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DashboardApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DevicesApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DisplayPreferencesApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DynamicHlsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/EnvironmentApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/FilterApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/GenresApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/HlsSegmentApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ImageApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/InstantMixApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemLookupApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemRefreshApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemUpdateApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LibraryApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LibraryStructureApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LiveTvApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LocalizationApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LyricsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MediaInfoApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MediaSegmentsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MoviesApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MusicGenresApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PackageApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PersonsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PlaylistsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PlaystateApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PluginsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/QuickConnectApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/RemoteImageApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ScheduledTasksApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SearchApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SessionApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/StartupApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/StudiosApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SubtitleApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SuggestionsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SyncPlayApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SystemApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TimeSyncApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TmdbApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TrailersApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TrickplayApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TvShowsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UniversalAudioApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserLibraryApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserViewsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/VideoAttachmentsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/VideosApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/YearsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AbstractOpenApiSchema.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AccessSchedule.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntry.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntryMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntryQueryResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntryStartMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntryStopMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AddVirtualFolderDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AlbumInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AlbumInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AllThemeMediaResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ArtistInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ArtistInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AudioSpatialFormat.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AuthenticateUserByName.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AuthenticationInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AuthenticationInfoQueryResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AuthenticationResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemDtoImageBlurHashes.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemDtoQueryResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemKind.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemPerson.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemPersonImageBlurHashes.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BookInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BookInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BoxSetInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BoxSetInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BrandingOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BufferRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CastReceiverApplication.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelFeatures.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelItemSortField.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelMappingOptionsDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelMediaContentType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelMediaType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChapterInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ClientCapabilitiesDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ClientLogDocumentResponseDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CodecProfile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CodecType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CollectionCreationResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CollectionType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CollectionTypeOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ConfigImageTypes.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ConfigurationPageInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ContainerProfile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CountryInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CreatePlaylistDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CreateUserByName.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CultureDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DayOfWeek.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DayPattern.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DefaultDirectoryBrowserInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeinterlaceMethod.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeviceInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeviceInfoDtoQueryResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeviceOptionsDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeviceProfile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DirectPlayProfile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DisplayPreferencesDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DlnaProfileType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DownMixStereoAlgorithms.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DynamicDayOfWeek.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EmbeddedSubtitleOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EncoderPreset.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EncodingContext.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EncodingOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EndPointInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ExternalIdInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ExternalIdMediaType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ExternalUrl.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ExtraType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/FileSystemEntryInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/FileSystemEntryType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/FontFile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForceKeepAliveMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForgotPasswordAction.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForgotPasswordDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForgotPasswordPinDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForgotPasswordResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GeneralCommand.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GeneralCommandMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GeneralCommandType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GetProgramsDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupInfoDtoGroupUpdate.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupQueueMode.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupRepeatMode.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupShuffleMode.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupStateType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupStateUpdate.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupStateUpdateGroupUpdate.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupUpdate.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupUpdateType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GuideInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/HardwareAccelerationType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/IPlugin.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/IgnoreWaitRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageFormat.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageOption.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageOrientation.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageProviderInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageResolution.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageSavingConvention.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/InboundKeepAliveMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/InboundWebSocketMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/InstallationInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/IsoType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ItemCounts.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ItemFields.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ItemFilter.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ItemSortBy.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/JoinGroupRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/KeepUntil.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryChangedMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryOptionInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryOptionsResultDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryTypeOptionsDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryUpdateInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ListingsProviderInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveStreamResponse.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveTvInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveTvOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveTvServiceInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveTvServiceStatus.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LocalizationOption.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LocationType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LogFile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LogLevel.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LyricDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LyricLine.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LyricMetadata.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaAttachment.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaPathDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaPathInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaProtocol.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSegmentDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSegmentDtoQueryResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSegmentType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSourceInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSourceType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaStream.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaStreamProtocol.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaStreamType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaUpdateInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaUpdateInfoPathDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaUrl.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MessageCommand.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataConfiguration.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataEditorInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataField.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataRefreshMode.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MovePlaylistItemRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MovieInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MovieInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MusicVideoInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MusicVideoInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NameGuidPair.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NameIdPair.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NameValuePair.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NetworkConfiguration.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NewGroupRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NextItemRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/OpenLiveStreamDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/OutboundKeepAliveMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/OutboundWebSocketMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PackageInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ParentalRating.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PathSubstitution.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PersonKind.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PersonLookupInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PersonLookupInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PinRedeemResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PingRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayAccess.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayCommand.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayMethod.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayQueueUpdate.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayQueueUpdateGroupUpdate.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayQueueUpdateReason.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayRequest.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackErrorCode.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackInfoResponse.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackOrder.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackProgressInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackRequestType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackStartInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackStopInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayerStateInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaylistCreationResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaylistDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaylistUserPermissions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaystateCommand.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaystateMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaystateRequest.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInstallationCancelledMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInstallationCompletedMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInstallationFailedMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInstallingMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginStatus.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginUninstalledMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PreviousItemRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProblemDetails.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProcessPriorityClass.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProfileCondition.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProfileConditionType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProfileConditionValue.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProgramAudio.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PublicSystemInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QueryFilters.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QueryFiltersLegacy.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QueueItem.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QueueRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QuickConnectDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QuickConnectResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RatingType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ReadyRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RecommendationDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RecommendationType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RecordingStatus.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RefreshProgressMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteImageInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteImageResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteLyricInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteSearchResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteSubtitleInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoveFromPlaylistRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RepeatMode.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RepositoryInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RestartRequiredMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScheduledTaskEndedMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScheduledTasksInfoMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScheduledTasksInfoStartMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScheduledTasksInfoStopMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScrollDirection.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SearchHint.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SearchHintResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeekRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SendCommand.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SendCommandType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesStatus.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesTimerCancelledMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesTimerCreatedMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesTimerInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesTimerInfoDtoQueryResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ServerConfiguration.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ServerDiscoveryInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ServerRestartingMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ServerShuttingDownMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionMessageType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionUserInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionsMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionsStartMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionsStopMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SetChannelMappingDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SetPlaylistItemRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SetRepeatModeRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SetShuffleModeRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SongInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SortOrder.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SpecialViewOptionDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/StartupConfigurationDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/StartupRemoteAccessDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/StartupUserDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/StringGroupUpdate.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SubtitleDeliveryMethod.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SubtitleOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SubtitlePlaybackMode.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SubtitleProfile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SyncPlayCommandMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SyncPlayGroupUpdateCommandMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SyncPlayQueueItem.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SyncPlayUserAccessType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SystemInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskCompletionStatus.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskState.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskTriggerInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ThemeMediaResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerCancelledMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerCreatedMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerEventInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerInfoDtoQueryResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TonemappingAlgorithm.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TonemappingMode.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TonemappingRange.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrailerInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrailerInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TranscodeReason.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TranscodeSeekInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TranscodingInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TranscodingProfile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TransportStreamTimestamp.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrickplayInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrickplayOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrickplayScanBehavior.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TunerChannelMapping.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TunerHostInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TypeOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UnratedItem.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdateLibraryOptionsDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdateMediaPathRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdatePlaylistDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdatePlaylistUserDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdateUserItemDataDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdateUserPassword.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UploadSubtitleDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserConfiguration.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserDataChangeInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserDataChangedMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserDeletedMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserItemDataDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserPolicy.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserUpdatedMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UtcTimeResponse.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ValidatePathDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VersionInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/Video3DFormat.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VideoRange.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VideoRangeType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VideoType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VirtualFolderInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/WakeOnLanInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/WebSocketMessage.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/XbmcMetadataOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/Jellyfin._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/JellyfinClientFactory._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/JellyfinOptions._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/ApiClient._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/ApiClientFactory._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/HttpClientOptions._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/HttpMethod._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/RawResponse._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/exception/ApiClientException._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/exception/MissingBaseUrlException._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/impl/JettyApiClient._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/impl/JettyApiClientFactory._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/discovery/DiscoveryService._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/discovery/ServerDiscoveryInfo._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/ClientInfo._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/DeviceInfo._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/ServerVersion._ rename bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/{JellyfinClientDiscoveryService.java => JellyfinClientDiscoveryService._} (94%) rename bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/{JellyfinServerDiscoveryService.java => JellyfinServerDiscoveryService._} (87%) create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryHelper.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/JellyfinException.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java rename bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/{JellyfinClientHandler.java => JellyfinClientHandler._} (98%) rename bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/{JellyfinServerHandler.java => JellyfinServerHandler._} (93%) create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/i18n/ResourceHelper.java delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/servlet/JellyfinBridgeServlet.java rename bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/{util/EmptySyncResponse.java => types/JellyfinExceptionHandler.java} (62%) delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/util/SyncCallback.java delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/util/SyncResponse.java create mode 100644 bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/environment.ini create mode 100755 bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/generate.sh create mode 100644 bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/java.config.json create mode 100644 bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/json/jellyfin-openapi-10.10.7.json create mode 100644 bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/json/jellyfin-openapi-10.11.0.json create mode 100644 bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/json/jellyfin-openapi-10.8.13.json create mode 100644 bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/yaml/jellyfin-openapi-10.10.7.yaml create mode 100644 bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/yaml/jellyfin-openapi-10.11.0.yaml create mode 100644 bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/yaml/jellyfin-openapi-10.8.13.yaml create mode 100644 bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/templates/generatedAnnotation.mustache create mode 100644 bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/templates/licenseInfo.mustache create mode 100644 bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/templates/nullable_var_annotations.mustache diff --git a/.gitignore b/.gitignore index 95de5ec9f4da2..00b44a09a5118 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .antlr* .classpath +.directory .idea .project .DS_Store @@ -30,3 +31,4 @@ pom.xml.versionsBackup .vim shell.nix tags +bundles/org.openhab.binding.jellyfin/.directory diff --git a/bundles/org.openhab.binding.jellyfin/.directory b/bundles/org.openhab.binding.jellyfin/.directory new file mode 100644 index 0000000000000..2b71eb83a21e7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/.directory @@ -0,0 +1,2 @@ +[Desktop Entry] +Icon=/home/pgfeller/ownCloud@midas.hopto.org/Dokumente/Linux/Icons/jellyfin.svg diff --git a/bundles/org.openhab.binding.jellyfin/.gitignore b/bundles/org.openhab.binding.jellyfin/.gitignore new file mode 100644 index 0000000000000..29ef8b4a102fc --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/.gitignore @@ -0,0 +1,4 @@ +node_modules +package-lock.json +package.json +logs \ No newline at end of file diff --git a/bundles/org.openhab.binding.jellyfin/.openapi-generator-ignore b/bundles/org.openhab.binding.jellyfin/.openapi-generator-ignore new file mode 100644 index 0000000000000..21f25fecf8700 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/.openapi-generator-ignore @@ -0,0 +1,27 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator +.github/**/* +.gitignore +.travis.yml + +# src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/**/* + +api/openapi.yaml + +build.gradle +build.sbt + +pom.xml + +gradle/**/* +gradle.properties +gradlew +gradlew.bat + +**/*/AndroidManifest.xml + +settings.gradle + +git_push.sh + +README.md \ No newline at end of file diff --git a/bundles/org.openhab.binding.jellyfin/README.md b/bundles/org.openhab.binding.jellyfin/README.md index 5265a434d4318..8077080a3d969 100644 --- a/bundles/org.openhab.binding.jellyfin/README.md +++ b/bundles/org.openhab.binding.jellyfin/README.md @@ -7,6 +7,7 @@ It is compatible with Jellyfin servers from version `10.8.1`, recommended is `10 ## Discovery To discover clients, you must first configure a server (bridge). +Servers will be discovered automatically, or can be added manually. After that, device discovery will detect controllable clients. ## Thing Types diff --git a/bundles/org.openhab.binding.jellyfin/pom.xml b/bundles/org.openhab.binding.jellyfin/pom.xml index f508f4ecf05cf..d8d328f28ac4b 100644 --- a/bundles/org.openhab.binding.jellyfin/pom.xml +++ b/bundles/org.openhab.binding.jellyfin/pom.xml @@ -7,106 +7,14 @@ org.openhab.addons.reactor.bundles 5.0.2-SNAPSHOT + org.openhab.binding.jellyfin openHAB Add-ons :: Bundles :: Jellyfin Binding + - !android.*,!com.android.*,!kotlin.internal.jdk7,!kotlin.internal.jdk8,!kotlin.reflect.*,!okhttp3.*,!okio.* - 1.4.7 + UTF-8 + UTF-8 - - - org.jellyfin.sdk - jellyfin-core-jvm - ${jellyfin.sdk} - - - org.jellyfin.sdk - jellyfin-api-jvm - ${jellyfin.sdk} - - - org.jellyfin.sdk - jellyfin-model-jvm - ${jellyfin.sdk} - - - io.ktor - ktor-client-core-jvm - 1.6.8 - compile - - - io.ktor - ktor-client-cio-jvm - 1.6.8 - compile - - - io.ktor - ktor-http-jvm - 1.6.8 - compile - - - io.ktor - ktor-http-cio-jvm - 1.6.8 - compile - - - io.ktor - ktor-network-jvm - 1.6.8 - compile - - - io.ktor - ktor-utils-jvm - 1.6.8 - compile - - - io.ktor - ktor-io-jvm - 1.6.8 - compile - - - io.ktor - ktor-network-tls-jvm - 1.6.8 - compile - - - org.jetbrains.kotlin - kotlin-stdlib - ${kotlin.version} - compile - - - org.jetbrains.kotlinx - kotlinx-coroutines-core-jvm - 1.8.0 - compile - - - org.jetbrains.kotlinx - kotlinx-serialization-core-jvm - 1.6.3 - compile - - - org.jetbrains.kotlinx - kotlinx-serialization-json-jvm - 1.6.3 - compile - - - io.github.microutils - kotlin-logging-jvm - 3.0.5 - compile - - + diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/JellyfinServerConfiguration.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Configuration.java similarity index 84% rename from bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/JellyfinServerConfiguration.java rename to bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Configuration.java index 8be5f168f9ddc..b8a2b32cdaa29 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/JellyfinServerConfiguration.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Configuration.java @@ -15,12 +15,13 @@ import org.eclipse.jdt.annotation.NonNullByDefault; /** - * The {@link JellyfinServerConfiguration} class contains fields mapping thing configuration parameters. + * The {@link Configuration} class contains fields mapping thing configuration parameters. * * @author Miguel Álvarez - Initial contribution + * @author Patrik Gfeller - Adjustments to work independently of the Android SDK and respective runtime */ @NonNullByDefault -public class JellyfinServerConfiguration { +public class Configuration { /** * Server hostname */ diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/JellyfinBindingConstants.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Constants.java similarity index 93% rename from bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/JellyfinBindingConstants.java rename to bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Constants.java index 35db9209cb219..b9c9eea6e52ad 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/JellyfinBindingConstants.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Constants.java @@ -18,13 +18,14 @@ import org.openhab.core.thing.ThingTypeUID; /** - * The {@link JellyfinBindingConstants} class defines common constants, which are + * The {@link Constants} class defines common constants, which are * used across the whole binding. * * @author Miguel Álvarez - Initial contribution + * @author Patrik Gfeller - Adjustments to work independently of the Android SDK and respective runtime */ @NonNullByDefault -public class JellyfinBindingConstants { +public class Constants { static final String BINDING_ID = "jellyfin"; diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/JellyfinHandlerFactory.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/JellyfinHandlerFactory._ similarity index 62% rename from bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/JellyfinHandlerFactory.java rename to bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/JellyfinHandlerFactory._ index 6c131833158f3..f3aa10fd53479 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/JellyfinHandlerFactory.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/JellyfinHandlerFactory._ @@ -12,25 +12,17 @@ */ package org.openhab.binding.jellyfin.internal; -import static org.openhab.binding.jellyfin.internal.JellyfinBindingConstants.BINDING_ID; import static org.openhab.binding.jellyfin.internal.JellyfinBindingConstants.SUPPORTED_THING_TYPES; import static org.openhab.binding.jellyfin.internal.JellyfinBindingConstants.THING_TYPE_CLIENT; import static org.openhab.binding.jellyfin.internal.JellyfinBindingConstants.THING_TYPE_SERVER; -import java.util.HashMap; -import java.util.Map; - -import javax.servlet.ServletException; - import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.jellyfin.internal.handler.JellyfinClientHandler; import org.openhab.binding.jellyfin.internal.handler.JellyfinServerHandler; -import org.openhab.binding.jellyfin.internal.servlet.JellyfinBridgeServlet; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.Thing; import org.openhab.core.thing.ThingTypeUID; -import org.openhab.core.thing.ThingUID; import org.openhab.core.thing.binding.BaseThingHandlerFactory; import org.openhab.core.thing.binding.ThingHandler; import org.openhab.core.thing.binding.ThingHandlerFactory; @@ -38,7 +30,6 @@ import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; import org.osgi.service.http.HttpService; -import org.osgi.service.http.NamespaceException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -53,7 +44,6 @@ public class JellyfinHandlerFactory extends BaseThingHandlerFactory { private final HttpService httpService; private final Logger logger = LoggerFactory.getLogger(JellyfinHandlerFactory.class); - private final Map servletRegistrations = new HashMap<>(); @Activate public JellyfinHandlerFactory(@Reference HttpService httpService) { @@ -70,7 +60,6 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { ThingTypeUID thingTypeUID = thing.getThingTypeUID(); if (THING_TYPE_SERVER.equals(thingTypeUID)) { var serverHandler = new JellyfinServerHandler((Bridge) thing); - registerAuthenticationServlet(serverHandler); return serverHandler; } if (THING_TYPE_CLIENT.equals(thingTypeUID)) { @@ -81,32 +70,6 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { @Override protected synchronized void removeHandler(ThingHandler thingHandler) { - if (thingHandler instanceof JellyfinServerHandler serverHandler) { - unregisterAuthenticationServlet(serverHandler); - } super.removeHandler(thingHandler); } - - private synchronized void registerAuthenticationServlet(JellyfinServerHandler bridgeHandler) { - var auth = new JellyfinBridgeServlet(bridgeHandler); - try { - httpService.registerServlet(getAuthenticationServletPath(bridgeHandler), auth, null, - httpService.createDefaultHttpContext()); - } catch (NamespaceException | ServletException e) { - logger.warn("Register servlet fails", e); - } - servletRegistrations.put(bridgeHandler.getThing().getUID(), auth); - } - - private synchronized void unregisterAuthenticationServlet(JellyfinServerHandler bridgeHandler) { - var loginServlet = servletRegistrations.get(bridgeHandler.getThing().getUID()); - if (loginServlet != null) { - httpService.unregister(getAuthenticationServletPath(bridgeHandler)); - } - } - - private String getAuthenticationServletPath(JellyfinServerHandler bridgeHandler) { - return new StringBuilder().append("/").append(BINDING_ID).append("/") - .append(bridgeHandler.getThing().getUID().getId()).toString(); - } } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ApiClient.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ApiClient.java new file mode 100644 index 0000000000000..b46a36250c058 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ApiClient.java @@ -0,0 +1,475 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated; + +import static java.nio.charset.StandardCharsets.UTF_8; + +import java.io.InputStream; +import java.net.URI; +import java.net.URLEncoder; +import java.net.http.HttpClient; +import java.net.http.HttpConnectTimeoutException; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.StringJoiner; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; + +/** + * Configuration and utility class for API clients. + * + *

+ * This class can be constructed and modified, then used to instantiate the + * various API classes. The API classes use the settings in this class to + * configure themselves, but otherwise do not store a link to this class. + *

+ * + *

+ * This class is mutable and not synchronized, so it is not thread-safe. + * The API classes generated from this are immutable and thread-safe. + *

+ * + *

+ * The setter methods of this class return the current object to facilitate + * a fluent style of configuration. + *

+ */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ApiClient { + + protected HttpClient.Builder builder; + protected ObjectMapper mapper; + protected String scheme; + protected String host; + protected int port; + protected String basePath; + protected Consumer interceptor; + protected Consumer> responseInterceptor; + protected Consumer> asyncResponseInterceptor; + protected Duration readTimeout; + protected Duration connectTimeout; + + public static String valueToString(Object value) { + if (value == null) { + return ""; + } + if (value instanceof OffsetDateTime) { + return ((OffsetDateTime) value).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + return value.toString(); + } + + /** + * URL encode a string in the UTF-8 encoding. + * + * @param s String to encode. + * @return URL-encoded representation of the input string. + */ + public static String urlEncode(String s) { + return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%20"); + } + + /** + * Convert a URL query name/value parameter to a list of encoded {@link Pair} + * objects. + * + *

+ * The value can be null, in which case an empty list is returned. + *

+ * + * @param name The query name parameter. + * @param value The query value, which may not be a collection but may be + * null. + * @return A singleton list of the {@link Pair} objects representing the input + * parameters, which is encoded for use in a URL. If the value is null, an + * empty list is returned. + */ + public static List parameterToPairs(String name, Object value) { + if (name == null || name.isEmpty() || value == null) { + return Collections.emptyList(); + } + return Collections.singletonList(new Pair(urlEncode(name), urlEncode(valueToString(value)))); + } + + /** + * Convert a URL query name/collection parameter to a list of encoded + * {@link Pair} objects. + * + * @param collectionFormat The swagger collectionFormat string (csv, tsv, etc). + * @param name The query name parameter. + * @param values A collection of values for the given query name, which may be + * null. + * @return A list of {@link Pair} objects representing the input parameters, + * which is encoded for use in a URL. If the values collection is null, an + * empty list is returned. + */ + public static List parameterToPairs(String collectionFormat, String name, Collection values) { + if (name == null || name.isEmpty() || values == null || values.isEmpty()) { + return Collections.emptyList(); + } + + // get the collection format (default: csv) + String format = collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat; + + // create the params based on the collection format + if ("multi".equals(format)) { + return values.stream().map(value -> new Pair(urlEncode(name), urlEncode(valueToString(value)))) + .collect(Collectors.toList()); + } + + String delimiter; + switch (format) { + case "csv": + delimiter = urlEncode(","); + break; + case "ssv": + delimiter = urlEncode(" "); + break; + case "tsv": + delimiter = urlEncode("\t"); + break; + case "pipes": + delimiter = urlEncode("|"); + break; + default: + throw new IllegalArgumentException("Illegal collection format: " + collectionFormat); + } + + StringJoiner joiner = new StringJoiner(delimiter); + for (Object value : values) { + joiner.add(urlEncode(valueToString(value))); + } + + return Collections.singletonList(new Pair(urlEncode(name), joiner.toString())); + } + + /** + * Create an instance of ApiClient. + */ + public ApiClient() { + this.builder = createDefaultHttpClientBuilder(); + this.mapper = createDefaultObjectMapper(); + updateBaseUri(getDefaultBaseUri()); + interceptor = null; + readTimeout = null; + connectTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; + } + + /** + * Create an instance of ApiClient. + * + * @param builder Http client builder. + * @param mapper Object mapper. + * @param baseUri Base URI + */ + public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { + this.builder = builder; + this.mapper = mapper; + updateBaseUri(baseUri != null ? baseUri : getDefaultBaseUri()); + interceptor = null; + readTimeout = null; + connectTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; + } + + public static ObjectMapper createDefaultObjectMapper() { + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); + mapper.registerModule(new JavaTimeModule()); + mapper.registerModule(new RFC3339JavaTimeModule()); + return mapper; + } + + protected String getDefaultBaseUri() { + return "http://localhost"; + } + + public static HttpClient.Builder createDefaultHttpClientBuilder() { + return HttpClient.newBuilder(); + } + + public final void updateBaseUri(String baseUri) { + URI uri = URI.create(baseUri); + scheme = uri.getScheme(); + host = uri.getHost(); + port = uri.getPort(); + basePath = uri.getRawPath(); + } + + /** + * Set a custom {@link HttpClient.Builder} object to use when creating the + * {@link HttpClient} that is used by the API client. + * + * @param builder Custom client builder. + * @return This object. + */ + public ApiClient setHttpClientBuilder(HttpClient.Builder builder) { + this.builder = builder; + return this; + } + + /** + * Get an {@link HttpClient} based on the current {@link HttpClient.Builder}. + * + *

+ * The returned object is immutable and thread-safe. + *

+ * + * @return The HTTP client. + */ + public HttpClient getHttpClient() { + return builder.build(); + } + + /** + * Set a custom {@link ObjectMapper} to serialize and deserialize the request + * and response bodies. + * + * @param mapper Custom object mapper. + * @return This object. + */ + public ApiClient setObjectMapper(ObjectMapper mapper) { + this.mapper = mapper; + return this; + } + + /** + * Get a copy of the current {@link ObjectMapper}. + * + * @return A copy of the current object mapper. + */ + public ObjectMapper getObjectMapper() { + return mapper.copy(); + } + + /** + * Set a custom host name for the target service. + * + * @param host The host name of the target service. + * @return This object. + */ + public ApiClient setHost(String host) { + this.host = host; + return this; + } + + /** + * Set a custom port number for the target service. + * + * @param port The port of the target service. Set this to -1 to reset the + * value to the default for the scheme. + * @return This object. + */ + public ApiClient setPort(int port) { + this.port = port; + return this; + } + + /** + * Set a custom base path for the target service, for example '/v2'. + * + * @param basePath The base path against which the rest of the path is + * resolved. + * @return This object. + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get the base URI to resolve the endpoint paths against. + * + * @return The complete base URI that the rest of the API parameters are + * resolved against. + */ + public String getBaseUri() { + return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath; + } + + /** + * Set a custom scheme for the target service, for example 'https'. + * + * @param scheme The scheme of the target service + * @return This object. + */ + public ApiClient setScheme(String scheme) { + this.scheme = scheme; + return this; + } + + /** + * Set a custom request interceptor. + * + *

+ * A request interceptor is a mechanism for altering each request before it + * is sent. After the request has been fully configured but not yet built, the + * request builder is passed into this function for further modification, + * after which it is sent out. + *

+ * + *

+ * This is useful for altering the requests in a custom manner, such as + * adding headers. It could also be used for logging and monitoring. + *

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. + */ + public ApiClient setRequestInterceptor(Consumer interceptor) { + this.interceptor = interceptor; + return this; + } + + /** + * Get the custom interceptor. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer getRequestInterceptor() { + return interceptor; + } + + /** + * Set a custom response interceptor. + * + *

+ * This is useful for logging, monitoring or extraction of header variables + *

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. + */ + public ApiClient setResponseInterceptor(Consumer> interceptor) { + this.responseInterceptor = interceptor; + return this; + } + + /** + * Get the custom response interceptor. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer> getResponseInterceptor() { + return responseInterceptor; + } + + /** + * Set a custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. + * + *

+ * This is useful for logging, monitoring or extraction of header variables + *

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. + */ + public ApiClient setAsyncResponseInterceptor(Consumer> interceptor) { + this.asyncResponseInterceptor = interceptor; + return this; + } + + /** + * Get the custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer> getAsyncResponseInterceptor() { + return asyncResponseInterceptor; + } + + /** + * Set the read timeout for the http client. + * + *

+ * This is the value used by default for each request, though it can be + * overridden on a per-request basis with a request interceptor. + *

+ * + * @param readTimeout The read timeout used by default by the http client. + * Setting this value to null resets the timeout to an + * effectively infinite value. + * @return This object. + */ + public ApiClient setReadTimeout(Duration readTimeout) { + this.readTimeout = readTimeout; + return this; + } + + /** + * Get the read timeout that was set. + * + * @return The read timeout, or null if no timeout was set. Null represents + * an infinite wait time. + */ + public Duration getReadTimeout() { + return readTimeout; + } + + /** + * Sets the connect timeout (in milliseconds) for the http client. + * + *

+ * In the case where a new connection needs to be established, if + * the connection cannot be established within the given {@code + * duration}, then {@link HttpClient#send(HttpRequest,BodyHandler) + * HttpClient::send} throws an {@link HttpConnectTimeoutException}, or + * {@link HttpClient#sendAsync(HttpRequest,BodyHandler) + * HttpClient::sendAsync} completes exceptionally with an + * {@code HttpConnectTimeoutException}. If a new connection does not + * need to be established, for example if a connection can be reused + * from a previous request, then this timeout duration has no effect. + * + * @param connectTimeout connection timeout in milliseconds + * + * @return This object. + */ + public ApiClient setConnectTimeout(Duration connectTimeout) { + this.connectTimeout = connectTimeout; + this.builder.connectTimeout(connectTimeout); + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public Duration getConnectTimeout() { + return connectTimeout; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ApiException.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ApiException.java new file mode 100644 index 0000000000000..f47b9dfb9240a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ApiException.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated; + +import java.net.http.HttpHeaders; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private int code = 0; + private HttpHeaders responseHeaders = null; + private String responseBody = null; + + public ApiException() { + } + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders, + String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, HttpHeaders responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, HttpHeaders responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, HttpHeaders responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return Headers as an HttpHeaders object + */ + public HttpHeaders getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ApiResponse.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ApiResponse.java new file mode 100644 index 0000000000000..5a070fa9c358a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ApiResponse.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + public int getStatusCode() { + return statusCode; + } + + public Map> getHeaders() { + return headers; + } + + public T getData() { + return data; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/Configuration.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/Configuration.java new file mode 100644 index 0000000000000..384ae4e218e24 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/Configuration.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated; + +import java.util.Objects; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class Configuration { + public static final String VERSION = "10.10.7"; + + private static final AtomicReference defaultApiClient = new AtomicReference<>(); + private static volatile Supplier apiClientFactory = ApiClient::new; + + /** + * Get the default API client, which would be used when creating API instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + ApiClient client = defaultApiClient.get(); + if (client == null) { + client = defaultApiClient.updateAndGet(val -> { + if (val != null) { // changed by another thread + return val; + } + return apiClientFactory.get(); + }); + } + return client; + } + + /** + * Set the default API client, which would be used when creating API instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient.set(apiClient); + } + + /** + * set the callback used to create new ApiClient objects + */ + public static void setApiClientFactory(Supplier factory) { + apiClientFactory = Objects.requireNonNull(factory); + } + + private Configuration() { + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/JSON.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/JSON.java new file mode 100644 index 0000000000000..ef7dacc9219b8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/JSON.java @@ -0,0 +1,262 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated; + +import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.openhab.binding.jellyfin.internal.api.generated.current.model.*; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.json.JsonMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class JSON { + private ObjectMapper mapper; + + public JSON() { + mapper = JsonMapper.builder().serializationInclusion(JsonInclude.Include.NON_NULL) + .disable(MapperFeature.ALLOW_COERCION_OF_SCALARS) + .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .enable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING).defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()).build(); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { + return mapper; + } + + /** + * Returns the target model class that should be used to deserialize the input data. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + * + * @return the target model class. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet>()); + } + return null; + } + + /** + * Helper class to register the discriminator mappings. + */ + @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. + * This function can be invoked for anyOf/oneOf composed models with discriminator mappings. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + * + * @return the target model class. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + * The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, + * so it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + * @param visitedClasses The set of classes that have already been visited. + * + * @return true if inst is an instance of modelClass in the OpenAPI model hierarchy. + */ + public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map> descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (Class childType : descendants.values()) { + if (isInstanceOf(childType, inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** + * A map of discriminators for all model classes. + */ + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); + + /** + * A map of oneOf/anyOf descendants for each model class. + */ + private static Map, Map>> modelDescendants = new HashMap<>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator(Class modelClass, String discriminatorPropertyName, + Map> mappings) { + ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants(Class modelClass, Map> descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/Pair.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/Pair.java new file mode 100644 index 0000000000000..e1fdc6ef3e5f1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/Pair.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair(String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/RFC3339DateFormat.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/RFC3339DateFormat.java new file mode 100644 index 0000000000000..2ded96e563212 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/RFC3339DateFormat.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated; + +import java.text.DateFormat; +import java.text.DecimalFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat().withTimeZone(TIMEZONE_Z).withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/RFC3339InstantDeserializer.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/RFC3339InstantDeserializer.java new file mode 100644 index 0000000000000..b382231aa7e29 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/RFC3339InstantDeserializer.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated; + +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.time.temporal.Temporal; +import java.time.temporal.TemporalAccessor; +import java.util.function.BiFunction; +import java.util.function.Function; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature; +import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RFC3339InstantDeserializer extends InstantDeserializer { + private static final long serialVersionUID = 1L; + private final static boolean DEFAULT_NORMALIZE_ZONE_ID = JavaTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID + .enabledByDefault(); + private final static boolean DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS = JavaTimeFeature.ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS + .enabledByDefault(); + + public static final RFC3339InstantDeserializer INSTANT = new RFC3339InstantDeserializer<>(Instant.class, + DateTimeFormatter.ISO_INSTANT, Instant::from, a -> Instant.ofEpochMilli(a.value), + a -> Instant.ofEpochSecond(a.integer, a.fraction), null, true, // yes, replace zero offset with Z + DEFAULT_NORMALIZE_ZONE_ID, DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS); + + public static final RFC3339InstantDeserializer OFFSET_DATE_TIME = new RFC3339InstantDeserializer<>( + OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, OffsetDateTime::from, + a -> OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId), + a -> OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId), + (d, z) -> (d.isEqual(OffsetDateTime.MIN) || d.isEqual(OffsetDateTime.MAX) ? d + : d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime()))), + true, // yes, replace zero offset with Z + DEFAULT_NORMALIZE_ZONE_ID, DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS); + + public static final RFC3339InstantDeserializer ZONED_DATE_TIME = new RFC3339InstantDeserializer<>( + ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, ZonedDateTime::from, + a -> ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId), + a -> ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId), + ZonedDateTime::withZoneSameInstant, false, // keep zero offset and Z separate since zones explicitly + // supported + DEFAULT_NORMALIZE_ZONE_ID, DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS); + + protected RFC3339InstantDeserializer(Class supportedType, DateTimeFormatter formatter, + Function parsedToValue, Function fromMilliseconds, + Function fromNanoseconds, BiFunction adjust, + boolean replaceZeroOffsetAsZ, boolean normalizeZoneId, boolean readNumericStringsAsTimestamp) { + super(supportedType, formatter, parsedToValue, fromMilliseconds, fromNanoseconds, adjust, replaceZeroOffsetAsZ, + normalizeZoneId, readNumericStringsAsTimestamp); + } + + @Override + protected T _fromString(JsonParser p, DeserializationContext ctxt, String string0) throws IOException { + return super._fromString(p, ctxt, string0.replace(' ', 'T')); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/RFC3339JavaTimeModule.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/RFC3339JavaTimeModule.java new file mode 100644 index 0000000000000..055687a8975f0 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/RFC3339JavaTimeModule.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated; + +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZonedDateTime; + +import com.fasterxml.jackson.databind.module.SimpleModule; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RFC3339JavaTimeModule extends SimpleModule { + private static final long serialVersionUID = 1L; + + public RFC3339JavaTimeModule() { + super("RFC3339JavaTimeModule"); + + addDeserializer(Instant.class, RFC3339InstantDeserializer.INSTANT); + addDeserializer(OffsetDateTime.class, RFC3339InstantDeserializer.OFFSET_DATE_TIME); + addDeserializer(ZonedDateTime.class, RFC3339InstantDeserializer.ZONED_DATE_TIME); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ServerConfiguration.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ServerConfiguration.java new file mode 100644 index 0000000000000..cac89c46131ba --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ServerConfiguration.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's + * URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable : this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException( + "The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ServerVariable.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ServerVariable.java new file mode 100644 index 0000000000000..06f3b3607f553 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ServerVariable.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ActivityLogApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ActivityLogApi.java new file mode 100644 index 0000000000000..636d46b286fa9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ActivityLogApi.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ActivityLogEntryQueryResult; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ActivityLogApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ActivityLogApi() { + this(Configuration.getDefaultApiClient()); + } + + public ActivityLogApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets activity log entries. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param minDate Optional. The minimum date. Format = ISO. (optional) + * @param hasUserId Optional. Filter log entries if it has user id, or not. (optional) + * @return ActivityLogEntryQueryResult + * @throws ApiException if fails to make API call + */ + public ActivityLogEntryQueryResult getLogEntries(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasUserId) throws ApiException { + ApiResponse localVarResponse = getLogEntriesWithHttpInfo(startIndex, limit, + minDate, hasUserId); + return localVarResponse.getData(); + } + + /** + * Gets activity log entries. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param minDate Optional. The minimum date. Format = ISO. (optional) + * @param hasUserId Optional. Filter log entries if it has user id, or not. (optional) + * @return ApiResponse<ActivityLogEntryQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLogEntriesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasUserId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLogEntriesRequestBuilder(startIndex, limit, minDate, hasUserId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLogEntries", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLogEntriesRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasUserId) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/ActivityLog/Entries"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "minDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minDate", minDate)); + localVarQueryParameterBaseName = "hasUserId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasUserId", hasUserId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ApiKeyApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ApiKeyApi.java new file mode 100644 index 0000000000000..ee396868ac17b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ApiKeyApi.java @@ -0,0 +1,304 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.AuthenticationInfoQueryResult; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ApiKeyApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ApiKeyApi() { + this(Configuration.getDefaultApiClient()); + } + + public ApiKeyApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Create a new api key. + * + * @param app Name of the app using the authentication key. (required) + * @throws ApiException if fails to make API call + */ + public void createKey(@org.eclipse.jdt.annotation.Nullable String app) throws ApiException { + createKeyWithHttpInfo(app); + } + + /** + * Create a new api key. + * + * @param app Name of the app using the authentication key. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createKeyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String app) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createKeyRequestBuilder(app); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createKey", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createKeyRequestBuilder(@org.eclipse.jdt.annotation.Nullable String app) + throws ApiException { + // verify the required parameter 'app' is set + if (app == null) { + throw new ApiException(400, "Missing the required parameter 'app' when calling createKey"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Auth/Keys"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "app"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("app", app)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get all keys. + * + * @return AuthenticationInfoQueryResult + * @throws ApiException if fails to make API call + */ + public AuthenticationInfoQueryResult getKeys() throws ApiException { + ApiResponse localVarResponse = getKeysWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Get all keys. + * + * @return ApiResponse<AuthenticationInfoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getKeysWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getKeysRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getKeys", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getKeysRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Auth/Keys"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Remove an api key. + * + * @param key The access token to delete. (required) + * @throws ApiException if fails to make API call + */ + public void revokeKey(@org.eclipse.jdt.annotation.Nullable String key) throws ApiException { + revokeKeyWithHttpInfo(key); + } + + /** + * Remove an api key. + * + * @param key The access token to delete. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse revokeKeyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String key) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = revokeKeyRequestBuilder(key); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("revokeKey", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder revokeKeyRequestBuilder(@org.eclipse.jdt.annotation.Nullable String key) + throws ApiException { + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException(400, "Missing the required parameter 'key' when calling revokeKey"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Auth/Keys/{key}".replace("{key}", ApiClient.urlEncode(key.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ArtistsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ArtistsApi.java new file mode 100644 index 0000000000000..487ad7daddfc8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ArtistsApi.java @@ -0,0 +1,855 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFilter; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemSortBy; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MediaType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SortOrder; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ArtistsApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ArtistsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ArtistsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets all album artists from a given item, folder, or the entire library. + * + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person ids. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getAlbumArtists(@org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + ApiResponse localVarResponse = getAlbumArtistsWithHttpInfo(minCommunityRating, + startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, filters, + isFavorite, mediaTypes, genres, genreIds, officialRatings, tags, years, enableUserData, imageTypeLimit, + enableImageTypes, person, personIds, personTypes, studios, studioIds, userId, nameStartsWithOrGreater, + nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount); + return localVarResponse.getData(); + } + + /** + * Gets all album artists from a given item, folder, or the entire library. + * + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person ids. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAlbumArtistsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAlbumArtistsRequestBuilder(minCommunityRating, startIndex, + limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, filters, isFavorite, + mediaTypes, genres, genreIds, officialRatings, tags, years, enableUserData, imageTypeLimit, + enableImageTypes, person, personIds, personTypes, studios, studioIds, userId, nameStartsWithOrGreater, + nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getAlbumArtists", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAlbumArtistsRequestBuilder( + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Artists/AlbumArtists"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "minCommunityRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minCommunityRating", minCommunityRating)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "filters"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "filters", filters)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + localVarQueryParameterBaseName = "genres"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genres", genres)); + localVarQueryParameterBaseName = "genreIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genreIds", genreIds)); + localVarQueryParameterBaseName = "officialRatings"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "officialRatings", officialRatings)); + localVarQueryParameterBaseName = "tags"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "tags", tags)); + localVarQueryParameterBaseName = "years"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "years", years)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "person"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("person", person)); + localVarQueryParameterBaseName = "personIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personIds", personIds)); + localVarQueryParameterBaseName = "personTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personTypes", personTypes)); + localVarQueryParameterBaseName = "studios"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studios", studios)); + localVarQueryParameterBaseName = "studioIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studioIds", studioIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "nameStartsWithOrGreater"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWithOrGreater", nameStartsWithOrGreater)); + localVarQueryParameterBaseName = "nameStartsWith"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWith", nameStartsWith)); + localVarQueryParameterBaseName = "nameLessThan"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameLessThan", nameLessThan)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an artist by name. + * + * @param name Studio name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getArtistByName(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = getArtistByNameWithHttpInfo(name, userId); + return localVarResponse.getData(); + } + + /** + * Gets an artist by name. + * + * @param name Studio name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getArtistByNameWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getArtistByNameRequestBuilder(name, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getArtistByName", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getArtistByNameRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getArtistByName"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Artists/{name}".replace("{name}", ApiClient.urlEncode(name.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all artists from a given item, folder, or the entire library. + * + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person ids. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getArtists(@org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + ApiResponse localVarResponse = getArtistsWithHttpInfo(minCommunityRating, startIndex, + limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, filters, isFavorite, + mediaTypes, genres, genreIds, officialRatings, tags, years, enableUserData, imageTypeLimit, + enableImageTypes, person, personIds, personTypes, studios, studioIds, userId, nameStartsWithOrGreater, + nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount); + return localVarResponse.getData(); + } + + /** + * Gets all artists from a given item, folder, or the entire library. + * + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person ids. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getArtistsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getArtistsRequestBuilder(minCommunityRating, startIndex, limit, + searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, + genres, genreIds, officialRatings, tags, years, enableUserData, imageTypeLimit, enableImageTypes, + person, personIds, personTypes, studios, studioIds, userId, nameStartsWithOrGreater, nameStartsWith, + nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getArtists", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getArtistsRequestBuilder(@org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Artists"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "minCommunityRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minCommunityRating", minCommunityRating)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "filters"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "filters", filters)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + localVarQueryParameterBaseName = "genres"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genres", genres)); + localVarQueryParameterBaseName = "genreIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genreIds", genreIds)); + localVarQueryParameterBaseName = "officialRatings"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "officialRatings", officialRatings)); + localVarQueryParameterBaseName = "tags"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "tags", tags)); + localVarQueryParameterBaseName = "years"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "years", years)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "person"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("person", person)); + localVarQueryParameterBaseName = "personIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personIds", personIds)); + localVarQueryParameterBaseName = "personTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personTypes", personTypes)); + localVarQueryParameterBaseName = "studios"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studios", studios)); + localVarQueryParameterBaseName = "studioIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studioIds", studioIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "nameStartsWithOrGreater"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWithOrGreater", nameStartsWithOrGreater)); + localVarQueryParameterBaseName = "nameStartsWith"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWith", nameStartsWith)); + localVarQueryParameterBaseName = "nameLessThan"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameLessThan", nameLessThan)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/AudioApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/AudioApi.java new file mode 100644 index 0000000000000..8ab2592d4fc1b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/AudioApi.java @@ -0,0 +1,1917 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.EncodingContext; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SubtitleDeliveryMethod; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AudioApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public AudioApi() { + this(Configuration.getDefaultApiClient()); + } + + public AudioApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File getAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + ApiResponse localVarResponse = getAudioStreamWithHttpInfo(itemId, container, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding); + return localVarResponse.getData(); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAudioStreamRequestBuilder(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getAudioStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAudioStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getAudioStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/stream".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "container"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("container", container)); + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "audio/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamporphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File getAudioStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + ApiResponse localVarResponse = getAudioStreamByContainerWithHttpInfo(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding); + return localVarResponse.getData(); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamporphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAudioStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAudioStreamByContainerRequestBuilder(itemId, container, _static, + params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getAudioStreamByContainer", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAudioStreamByContainerRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getAudioStreamByContainer"); + } + // verify the required parameter 'container' is set + if (container == null) { + throw new ApiException(400, + "Missing the required parameter 'container' when calling getAudioStreamByContainer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/stream.{container}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{container}", ApiClient.urlEncode(container.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "audio/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File headAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + ApiResponse localVarResponse = headAudioStreamWithHttpInfo(itemId, container, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding); + return localVarResponse.getData(); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headAudioStreamRequestBuilder(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headAudioStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headAudioStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling headAudioStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/stream".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "container"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("container", container)); + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "audio/*"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamporphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File headAudioStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + ApiResponse localVarResponse = headAudioStreamByContainerWithHttpInfo(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding); + return localVarResponse.getData(); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamporphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headAudioStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headAudioStreamByContainerRequestBuilder(itemId, container, + _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headAudioStreamByContainer", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headAudioStreamByContainerRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling headAudioStreamByContainer"); + } + // verify the required parameter 'container' is set + if (container == null) { + throw new ApiException(400, + "Missing the required parameter 'container' when calling headAudioStreamByContainer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/stream.{container}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{container}", ApiClient.urlEncode(container.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "audio/*"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/BrandingApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/BrandingApi.java new file mode 100644 index 0000000000000..03cd7ff6355b2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/BrandingApi.java @@ -0,0 +1,285 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BrandingOptions; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BrandingApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public BrandingApi() { + this(Configuration.getDefaultApiClient()); + } + + public BrandingApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets branding css. + * + * @return String + * @throws ApiException if fails to make API call + */ + public String getBrandingCss() throws ApiException { + ApiResponse localVarResponse = getBrandingCssWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets branding css. + * + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getBrandingCssWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBrandingCssRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getBrandingCss", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getBrandingCssRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Branding/Css"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "text/css, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets branding css. + * + * @return String + * @throws ApiException if fails to make API call + */ + public String getBrandingCss2() throws ApiException { + ApiResponse localVarResponse = getBrandingCss2WithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets branding css. + * + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getBrandingCss2WithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBrandingCss2RequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getBrandingCss2", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getBrandingCss2RequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Branding/Css.css"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "text/css, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets branding configuration. + * + * @return BrandingOptions + * @throws ApiException if fails to make API call + */ + public BrandingOptions getBrandingOptions() throws ApiException { + ApiResponse localVarResponse = getBrandingOptionsWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets branding configuration. + * + * @return ApiResponse<BrandingOptions> + * @throws ApiException if fails to make API call + */ + public ApiResponse getBrandingOptionsWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBrandingOptionsRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getBrandingOptions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getBrandingOptionsRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Branding/Configuration"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ChannelsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ChannelsApi.java new file mode 100644 index 0000000000000..3f3689770bb6d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ChannelsApi.java @@ -0,0 +1,642 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ChannelFeatures; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFilter; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemSortBy; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SortOrder; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ChannelsApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ChannelsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ChannelsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Get all channel features. + * + * @return List<ChannelFeatures> + * @throws ApiException if fails to make API call + */ + public List getAllChannelFeatures() throws ApiException { + ApiResponse> localVarResponse = getAllChannelFeaturesWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Get all channel features. + * + * @return ApiResponse<List<ChannelFeatures>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getAllChannelFeaturesWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAllChannelFeaturesRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getAllChannelFeatures", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAllChannelFeaturesRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Channels/Features"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get channel features. + * + * @param channelId Channel id. (required) + * @return ChannelFeatures + * @throws ApiException if fails to make API call + */ + public ChannelFeatures getChannelFeatures(@org.eclipse.jdt.annotation.Nullable UUID channelId) throws ApiException { + ApiResponse localVarResponse = getChannelFeaturesWithHttpInfo(channelId); + return localVarResponse.getData(); + } + + /** + * Get channel features. + * + * @param channelId Channel id. (required) + * @return ApiResponse<ChannelFeatures> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelFeaturesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID channelId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getChannelFeaturesRequestBuilder(channelId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getChannelFeatures", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getChannelFeaturesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID channelId) + throws ApiException { + // verify the required parameter 'channelId' is set + if (channelId == null) { + throw new ApiException(400, "Missing the required parameter 'channelId' when calling getChannelFeatures"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Channels/{channelId}/Features".replace("{channelId}", + ApiClient.urlEncode(channelId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get channel items. + * + * @param channelId Channel Id. (required) + * @param folderId Optional. Folder Id. (optional) + * @param userId Optional. User Id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortOrder Optional. Sort Order - Ascending,Descending. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getChannelItems(@org.eclipse.jdt.annotation.Nullable UUID channelId, + @org.eclipse.jdt.annotation.NonNull UUID folderId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + ApiResponse localVarResponse = getChannelItemsWithHttpInfo(channelId, folderId, userId, + startIndex, limit, sortOrder, filters, sortBy, fields); + return localVarResponse.getData(); + } + + /** + * Get channel items. + * + * @param channelId Channel Id. (required) + * @param folderId Optional. Folder Id. (optional) + * @param userId Optional. User Id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortOrder Optional. Sort Order - Ascending,Descending. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelItemsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID channelId, @org.eclipse.jdt.annotation.NonNull UUID folderId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getChannelItemsRequestBuilder(channelId, folderId, userId, + startIndex, limit, sortOrder, filters, sortBy, fields); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getChannelItems", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getChannelItemsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID channelId, + @org.eclipse.jdt.annotation.NonNull UUID folderId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + // verify the required parameter 'channelId' is set + if (channelId == null) { + throw new ApiException(400, "Missing the required parameter 'channelId' when calling getChannelItems"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Channels/{channelId}/Items".replace("{channelId}", + ApiClient.urlEncode(channelId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "folderId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("folderId", folderId)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "filters"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "filters", filters)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available channels. + * + * @param userId User Id to filter by. Use System.Guid.Empty to not filter by user. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param supportsLatestItems Optional. Filter by channels that support getting latest items. (optional) + * @param supportsMediaDeletion Optional. Filter by channels that support media deletion. (optional) + * @param isFavorite Optional. Filter by channels that are favorite. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getChannels(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean supportsLatestItems, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaDeletion, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite) throws ApiException { + ApiResponse localVarResponse = getChannelsWithHttpInfo(userId, startIndex, limit, + supportsLatestItems, supportsMediaDeletion, isFavorite); + return localVarResponse.getData(); + } + + /** + * Gets available channels. + * + * @param userId User Id to filter by. Use System.Guid.Empty to not filter by user. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param supportsLatestItems Optional. Filter by channels that support getting latest items. (optional) + * @param supportsMediaDeletion Optional. Filter by channels that support media deletion. (optional) + * @param isFavorite Optional. Filter by channels that are favorite. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean supportsLatestItems, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaDeletion, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getChannelsRequestBuilder(userId, startIndex, limit, + supportsLatestItems, supportsMediaDeletion, isFavorite); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getChannels", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getChannelsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean supportsLatestItems, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaDeletion, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Channels"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "supportsLatestItems"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("supportsLatestItems", supportsLatestItems)); + localVarQueryParameterBaseName = "supportsMediaDeletion"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("supportsMediaDeletion", supportsMediaDeletion)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets latest channel items. + * + * @param userId Optional. User Id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param channelIds Optional. Specify one or more channel id's, comma delimited. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getLatestChannelItems(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List channelIds) throws ApiException { + ApiResponse localVarResponse = getLatestChannelItemsWithHttpInfo(userId, startIndex, + limit, filters, fields, channelIds); + return localVarResponse.getData(); + } + + /** + * Gets latest channel items. + * + * @param userId Optional. User Id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param channelIds Optional. Specify one or more channel id's, comma delimited. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLatestChannelItemsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List channelIds) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLatestChannelItemsRequestBuilder(userId, startIndex, limit, + filters, fields, channelIds); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLatestChannelItems", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLatestChannelItemsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List channelIds) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Channels/Items/Latest"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "filters"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "filters", filters)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "channelIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "channelIds", channelIds)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ClientLogApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ClientLogApi.java new file mode 100644 index 0000000000000..7435629ee392d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ClientLogApi.java @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ClientLogDocumentResponseDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ClientLogApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ClientLogApi() { + this(Configuration.getDefaultApiClient()); + } + + public ClientLogApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Upload a document. + * + * @param body (optional) + * @return ClientLogDocumentResponseDto + * @throws ApiException if fails to make API call + */ + public ClientLogDocumentResponseDto logFile(@org.eclipse.jdt.annotation.NonNull File body) throws ApiException { + ApiResponse localVarResponse = logFileWithHttpInfo(body); + return localVarResponse.getData(); + } + + /** + * Upload a document. + * + * @param body (optional) + * @return ApiResponse<ClientLogDocumentResponseDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse logFileWithHttpInfo(@org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = logFileRequestBuilder(body); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("logFile", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder logFileRequestBuilder(@org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/ClientLog/Document"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "text/plain"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/CollectionApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/CollectionApi.java new file mode 100644 index 0000000000000..7e06e09cea5af --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/CollectionApi.java @@ -0,0 +1,375 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.CollectionCreationResult; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class CollectionApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public CollectionApi() { + this(Configuration.getDefaultApiClient()); + } + + public CollectionApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Adds items to a collection. + * + * @param collectionId The collection id. (required) + * @param ids Item ids, comma delimited. (required) + * @throws ApiException if fails to make API call + */ + public void addToCollection(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { + addToCollectionWithHttpInfo(collectionId, ids); + } + + /** + * Adds items to a collection. + * + * @param collectionId The collection id. (required) + * @param ids Item ids, comma delimited. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addToCollectionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addToCollectionRequestBuilder(collectionId, ids); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("addToCollection", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder addToCollectionRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new ApiException(400, "Missing the required parameter 'collectionId' when calling addToCollection"); + } + // verify the required parameter 'ids' is set + if (ids == null) { + throw new ApiException(400, "Missing the required parameter 'ids' when calling addToCollection"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Collections/{collectionId}/Items".replace("{collectionId}", + ApiClient.urlEncode(collectionId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates a new collection. + * + * @param name The name of the collection. (optional) + * @param ids Item Ids to add to the collection. (optional) + * @param parentId Optional. Create the collection within a specific folder. (optional) + * @param isLocked Whether or not to lock the new collection. (optional, default to false) + * @return CollectionCreationResult + * @throws ApiException if fails to make API call + */ + public CollectionCreationResult createCollection(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked) throws ApiException { + ApiResponse localVarResponse = createCollectionWithHttpInfo(name, ids, parentId, + isLocked); + return localVarResponse.getData(); + } + + /** + * Creates a new collection. + * + * @param name The name of the collection. (optional) + * @param ids Item Ids to add to the collection. (optional) + * @param parentId Optional. Create the collection within a specific folder. (optional) + * @param isLocked Whether or not to lock the new collection. (optional, default to false) + * @return ApiResponse<CollectionCreationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse createCollectionWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean isLocked) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createCollectionRequestBuilder(name, ids, parentId, isLocked); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createCollection", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createCollectionRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Collections"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "isLocked"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isLocked", isLocked)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Removes items from a collection. + * + * @param collectionId The collection id. (required) + * @param ids Item ids, comma delimited. (required) + * @throws ApiException if fails to make API call + */ + public void removeFromCollection(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { + removeFromCollectionWithHttpInfo(collectionId, ids); + } + + /** + * Removes items from a collection. + * + * @param collectionId The collection id. (required) + * @param ids Item ids, comma delimited. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeFromCollectionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeFromCollectionRequestBuilder(collectionId, ids); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("removeFromCollection", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder removeFromCollectionRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID collectionId, @org.eclipse.jdt.annotation.Nullable List ids) + throws ApiException { + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new ApiException(400, + "Missing the required parameter 'collectionId' when calling removeFromCollection"); + } + // verify the required parameter 'ids' is set + if (ids == null) { + throw new ApiException(400, "Missing the required parameter 'ids' when calling removeFromCollection"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Collections/{collectionId}/Items".replace("{collectionId}", + ApiClient.urlEncode(collectionId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ConfigurationApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ConfigurationApi.java new file mode 100644 index 0000000000000..cd66c43921765 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ConfigurationApi.java @@ -0,0 +1,458 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MetadataOptions; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ServerConfiguration; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ConfigurationApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ConfigurationApi() { + this(Configuration.getDefaultApiClient()); + } + + public ConfigurationApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets application configuration. + * + * @return ServerConfiguration + * @throws ApiException if fails to make API call + */ + public ServerConfiguration getConfiguration() throws ApiException { + ApiResponse localVarResponse = getConfigurationWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets application configuration. + * + * @return ApiResponse<ServerConfiguration> + * @throws ApiException if fails to make API call + */ + public ApiResponse getConfigurationWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getConfigurationRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getConfiguration", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getConfigurationRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Configuration"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a default MetadataOptions object. + * + * @return MetadataOptions + * @throws ApiException if fails to make API call + */ + public MetadataOptions getDefaultMetadataOptions() throws ApiException { + ApiResponse localVarResponse = getDefaultMetadataOptionsWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets a default MetadataOptions object. + * + * @return ApiResponse<MetadataOptions> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultMetadataOptionsWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDefaultMetadataOptionsRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDefaultMetadataOptions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDefaultMetadataOptionsRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Configuration/MetadataOptions/Default"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a named configuration. + * + * @param key Configuration key. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getNamedConfiguration(@org.eclipse.jdt.annotation.Nullable String key) throws ApiException { + ApiResponse localVarResponse = getNamedConfigurationWithHttpInfo(key); + return localVarResponse.getData(); + } + + /** + * Gets a named configuration. + * + * @param key Configuration key. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getNamedConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String key) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getNamedConfigurationRequestBuilder(key); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getNamedConfiguration", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getNamedConfigurationRequestBuilder(@org.eclipse.jdt.annotation.Nullable String key) + throws ApiException { + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException(400, "Missing the required parameter 'key' when calling getNamedConfiguration"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Configuration/{key}".replace("{key}", ApiClient.urlEncode(key.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates application configuration. + * + * @param serverConfiguration Configuration. (required) + * @throws ApiException if fails to make API call + */ + public void updateConfiguration(@org.eclipse.jdt.annotation.Nullable ServerConfiguration serverConfiguration) + throws ApiException { + updateConfigurationWithHttpInfo(serverConfiguration); + } + + /** + * Updates application configuration. + * + * @param serverConfiguration Configuration. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateConfigurationWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ServerConfiguration serverConfiguration) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateConfigurationRequestBuilder(serverConfiguration); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateConfiguration", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateConfigurationRequestBuilder( + @org.eclipse.jdt.annotation.Nullable ServerConfiguration serverConfiguration) throws ApiException { + // verify the required parameter 'serverConfiguration' is set + if (serverConfiguration == null) { + throw new ApiException(400, + "Missing the required parameter 'serverConfiguration' when calling updateConfiguration"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Configuration"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(serverConfiguration); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates named configuration. + * + * @param key Configuration key. (required) + * @param body Configuration. (required) + * @throws ApiException if fails to make API call + */ + public void updateNamedConfiguration(@org.eclipse.jdt.annotation.Nullable String key, + @org.eclipse.jdt.annotation.Nullable Object body) throws ApiException { + updateNamedConfigurationWithHttpInfo(key, body); + } + + /** + * Updates named configuration. + * + * @param key Configuration key. (required) + * @param body Configuration. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateNamedConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String key, + @org.eclipse.jdt.annotation.Nullable Object body) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateNamedConfigurationRequestBuilder(key, body); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateNamedConfiguration", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateNamedConfigurationRequestBuilder(@org.eclipse.jdt.annotation.Nullable String key, + @org.eclipse.jdt.annotation.Nullable Object body) throws ApiException { + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException(400, "Missing the required parameter 'key' when calling updateNamedConfiguration"); + } + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling updateNamedConfiguration"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Configuration/{key}".replace("{key}", ApiClient.urlEncode(key.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DashboardApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DashboardApi.java new file mode 100644 index 0000000000000..2cc90f62913f7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DashboardApi.java @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ConfigurationPageInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DashboardApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public DashboardApi() { + this(Configuration.getDefaultApiClient()); + } + + public DashboardApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets the configuration pages. + * + * @param enableInMainMenu Whether to enable in the main menu. (optional) + * @return List<ConfigurationPageInfo> + * @throws ApiException if fails to make API call + */ + public List getConfigurationPages( + @org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu) throws ApiException { + ApiResponse> localVarResponse = getConfigurationPagesWithHttpInfo(enableInMainMenu); + return localVarResponse.getData(); + } + + /** + * Gets the configuration pages. + * + * @param enableInMainMenu Whether to enable in the main menu. (optional) + * @return ApiResponse<List<ConfigurationPageInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getConfigurationPagesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getConfigurationPagesRequestBuilder(enableInMainMenu); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getConfigurationPages", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getConfigurationPagesRequestBuilder( + @org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/web/ConfigurationPages"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "enableInMainMenu"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableInMainMenu", enableInMainMenu)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a dashboard configuration page. + * + * @param name The name of the page. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getDashboardConfigurationPage(@org.eclipse.jdt.annotation.NonNull String name) throws ApiException { + ApiResponse localVarResponse = getDashboardConfigurationPageWithHttpInfo(name); + return localVarResponse.getData(); + } + + /** + * Gets a dashboard configuration page. + * + * @param name The name of the page. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDashboardConfigurationPageWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDashboardConfigurationPageRequestBuilder(name); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDashboardConfigurationPage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDashboardConfigurationPageRequestBuilder( + @org.eclipse.jdt.annotation.NonNull String name) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/web/ConfigurationPage"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "text/html, application/x-javascript, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DevicesApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DevicesApi.java new file mode 100644 index 0000000000000..4dde001c6dad2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DevicesApi.java @@ -0,0 +1,546 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.DeviceInfoDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.DeviceInfoDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.DeviceOptionsDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DevicesApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public DevicesApi() { + this(Configuration.getDefaultApiClient()); + } + + public DevicesApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Deletes a device. + * + * @param id Device Id. (required) + * @throws ApiException if fails to make API call + */ + public void deleteDevice(@org.eclipse.jdt.annotation.Nullable String id) throws ApiException { + deleteDeviceWithHttpInfo(id); + } + + /** + * Deletes a device. + * + * @param id Device Id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteDeviceWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteDeviceRequestBuilder(id); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteDevice", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteDeviceRequestBuilder(@org.eclipse.jdt.annotation.Nullable String id) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling deleteDevice"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Devices"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get info for a device. + * + * @param id Device Id. (required) + * @return DeviceInfoDto + * @throws ApiException if fails to make API call + */ + public DeviceInfoDto getDeviceInfo(@org.eclipse.jdt.annotation.Nullable String id) throws ApiException { + ApiResponse localVarResponse = getDeviceInfoWithHttpInfo(id); + return localVarResponse.getData(); + } + + /** + * Get info for a device. + * + * @param id Device Id. (required) + * @return ApiResponse<DeviceInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDeviceInfoWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDeviceInfoRequestBuilder(id); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDeviceInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDeviceInfoRequestBuilder(@org.eclipse.jdt.annotation.Nullable String id) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getDeviceInfo"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Devices/Info"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get options for a device. + * + * @param id Device Id. (required) + * @return DeviceOptionsDto + * @throws ApiException if fails to make API call + */ + public DeviceOptionsDto getDeviceOptions(@org.eclipse.jdt.annotation.Nullable String id) throws ApiException { + ApiResponse localVarResponse = getDeviceOptionsWithHttpInfo(id); + return localVarResponse.getData(); + } + + /** + * Get options for a device. + * + * @param id Device Id. (required) + * @return ApiResponse<DeviceOptionsDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDeviceOptionsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDeviceOptionsRequestBuilder(id); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDeviceOptions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDeviceOptionsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String id) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getDeviceOptions"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Devices/Options"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get Devices. + * + * @param userId Gets or sets the user identifier. (optional) + * @return DeviceInfoDtoQueryResult + * @throws ApiException if fails to make API call + */ + public DeviceInfoDtoQueryResult getDevices(@org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = getDevicesWithHttpInfo(userId); + return localVarResponse.getData(); + } + + /** + * Get Devices. + * + * @param userId Gets or sets the user identifier. (optional) + * @return ApiResponse<DeviceInfoDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDevicesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDevicesRequestBuilder(userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDevices", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDevicesRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Devices"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update device options. + * + * @param id Device Id. (required) + * @param deviceOptionsDto Device Options. (required) + * @throws ApiException if fails to make API call + */ + public void updateDeviceOptions(@org.eclipse.jdt.annotation.Nullable String id, + @org.eclipse.jdt.annotation.Nullable DeviceOptionsDto deviceOptionsDto) throws ApiException { + updateDeviceOptionsWithHttpInfo(id, deviceOptionsDto); + } + + /** + * Update device options. + * + * @param id Device Id. (required) + * @param deviceOptionsDto Device Options. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateDeviceOptionsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id, + @org.eclipse.jdt.annotation.Nullable DeviceOptionsDto deviceOptionsDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateDeviceOptionsRequestBuilder(id, deviceOptionsDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateDeviceOptions", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateDeviceOptionsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String id, + @org.eclipse.jdt.annotation.Nullable DeviceOptionsDto deviceOptionsDto) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling updateDeviceOptions"); + } + // verify the required parameter 'deviceOptionsDto' is set + if (deviceOptionsDto == null) { + throw new ApiException(400, + "Missing the required parameter 'deviceOptionsDto' when calling updateDeviceOptions"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Devices/Options"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(deviceOptionsDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DisplayPreferencesApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DisplayPreferencesApi.java new file mode 100644 index 0000000000000..249c92ee0e6fe --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DisplayPreferencesApi.java @@ -0,0 +1,313 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.DisplayPreferencesDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DisplayPreferencesApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public DisplayPreferencesApi() { + this(Configuration.getDefaultApiClient()); + } + + public DisplayPreferencesApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Get Display Preferences. + * + * @param displayPreferencesId Display preferences id. (required) + * @param client Client. (required) + * @param userId User id. (optional) + * @return DisplayPreferencesDto + * @throws ApiException if fails to make API call + */ + public DisplayPreferencesDto getDisplayPreferences(@org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable String client, @org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + ApiResponse localVarResponse = getDisplayPreferencesWithHttpInfo(displayPreferencesId, + client, userId); + return localVarResponse.getData(); + } + + /** + * Get Display Preferences. + * + * @param displayPreferencesId Display preferences id. (required) + * @param client Client. (required) + * @param userId User id. (optional) + * @return ApiResponse<DisplayPreferencesDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDisplayPreferencesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable String client, @org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDisplayPreferencesRequestBuilder(displayPreferencesId, client, + userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDisplayPreferences", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDisplayPreferencesRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable String client, @org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + // verify the required parameter 'displayPreferencesId' is set + if (displayPreferencesId == null) { + throw new ApiException(400, + "Missing the required parameter 'displayPreferencesId' when calling getDisplayPreferences"); + } + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling getDisplayPreferences"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/DisplayPreferences/{displayPreferencesId}".replace("{displayPreferencesId}", + ApiClient.urlEncode(displayPreferencesId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "client"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("client", client)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update Display Preferences. + * + * @param displayPreferencesId Display preferences id. (required) + * @param client Client. (required) + * @param displayPreferencesDto New Display Preferences object. (required) + * @param userId User Id. (optional) + * @throws ApiException if fails to make API call + */ + public void updateDisplayPreferences(@org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable String client, + @org.eclipse.jdt.annotation.Nullable DisplayPreferencesDto displayPreferencesDto, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + updateDisplayPreferencesWithHttpInfo(displayPreferencesId, client, displayPreferencesDto, userId); + } + + /** + * Update Display Preferences. + * + * @param displayPreferencesId Display preferences id. (required) + * @param client Client. (required) + * @param displayPreferencesDto New Display Preferences object. (required) + * @param userId User Id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateDisplayPreferencesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable String client, + @org.eclipse.jdt.annotation.Nullable DisplayPreferencesDto displayPreferencesDto, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateDisplayPreferencesRequestBuilder(displayPreferencesId, + client, displayPreferencesDto, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateDisplayPreferences", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateDisplayPreferencesRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable String client, + @org.eclipse.jdt.annotation.Nullable DisplayPreferencesDto displayPreferencesDto, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'displayPreferencesId' is set + if (displayPreferencesId == null) { + throw new ApiException(400, + "Missing the required parameter 'displayPreferencesId' when calling updateDisplayPreferences"); + } + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, + "Missing the required parameter 'client' when calling updateDisplayPreferences"); + } + // verify the required parameter 'displayPreferencesDto' is set + if (displayPreferencesDto == null) { + throw new ApiException(400, + "Missing the required parameter 'displayPreferencesDto' when calling updateDisplayPreferences"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/DisplayPreferences/{displayPreferencesId}".replace("{displayPreferencesId}", + ApiClient.urlEncode(displayPreferencesId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "client"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("client", client)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(displayPreferencesDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DynamicHlsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DynamicHlsApi.java new file mode 100644 index 0000000000000..3993fb2c6aec2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DynamicHlsApi.java @@ -0,0 +1,4444 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.EncodingContext; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SubtitleDeliveryMethod; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DynamicHlsApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public DynamicHlsApi() { + this(Configuration.getDefaultApiClient()); + } + + public DynamicHlsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param runtimeTicks The position of the requested segment in ticks. (required) + * @param actualSegmentLengthTicks The length of the requested segment in ticks. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsAudioSegment(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + ApiResponse localVarResponse = getHlsAudioSegmentWithHttpInfo(itemId, playlistId, segmentId, container, + runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding); + return localVarResponse.getData(); + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param runtimeTicks The position of the requested segment in ticks. (required) + * @param actualSegmentLengthTicks The length of the requested segment in ticks. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsAudioSegmentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsAudioSegmentRequestBuilder(itemId, playlistId, segmentId, + container, runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getHlsAudioSegment", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getHlsAudioSegmentRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getHlsAudioSegment"); + } + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling getHlsAudioSegment"); + } + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException(400, "Missing the required parameter 'segmentId' when calling getHlsAudioSegment"); + } + // verify the required parameter 'container' is set + if (container == null) { + throw new ApiException(400, "Missing the required parameter 'container' when calling getHlsAudioSegment"); + } + // verify the required parameter 'runtimeTicks' is set + if (runtimeTicks == null) { + throw new ApiException(400, + "Missing the required parameter 'runtimeTicks' when calling getHlsAudioSegment"); + } + // verify the required parameter 'actualSegmentLengthTicks' is set + if (actualSegmentLengthTicks == null) { + throw new ApiException(400, + "Missing the required parameter 'actualSegmentLengthTicks' when calling getHlsAudioSegment"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/hls1/{playlistId}/{segmentId}.{container}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{playlistId}", ApiClient.urlEncode(playlistId.toString())) + .replace("{segmentId}", ApiClient.urlEncode(segmentId.toString())) + .replace("{container}", ApiClient.urlEncode(container.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "runtimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("runtimeTicks", runtimeTicks)); + localVarQueryParameterBaseName = "actualSegmentLengthTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("actualSegmentLengthTicks", actualSegmentLengthTicks)); + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "maxStreamingBitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStreamingBitrate", maxStreamingBitrate)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "audio/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param runtimeTicks The position of the requested segment in ticks. (required) + * @param actualSegmentLengthTicks The length of the requested segment in ticks. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The desired segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsVideoSegment(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + ApiResponse localVarResponse = getHlsVideoSegmentWithHttpInfo(itemId, playlistId, segmentId, container, + runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding); + return localVarResponse.getData(); + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param runtimeTicks The position of the requested segment in ticks. (required) + * @param actualSegmentLengthTicks The length of the requested segment in ticks. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The desired segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsVideoSegmentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsVideoSegmentRequestBuilder(itemId, playlistId, segmentId, + container, runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getHlsVideoSegment", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getHlsVideoSegmentRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getHlsVideoSegment"); + } + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling getHlsVideoSegment"); + } + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException(400, "Missing the required parameter 'segmentId' when calling getHlsVideoSegment"); + } + // verify the required parameter 'container' is set + if (container == null) { + throw new ApiException(400, "Missing the required parameter 'container' when calling getHlsVideoSegment"); + } + // verify the required parameter 'runtimeTicks' is set + if (runtimeTicks == null) { + throw new ApiException(400, + "Missing the required parameter 'runtimeTicks' when calling getHlsVideoSegment"); + } + // verify the required parameter 'actualSegmentLengthTicks' is set + if (actualSegmentLengthTicks == null) { + throw new ApiException(400, + "Missing the required parameter 'actualSegmentLengthTicks' when calling getHlsVideoSegment"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/hls1/{playlistId}/{segmentId}.{container}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{playlistId}", ApiClient.urlEncode(playlistId.toString())) + .replace("{segmentId}", ApiClient.urlEncode(segmentId.toString())) + .replace("{container}", ApiClient.urlEncode(container.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "runtimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("runtimeTicks", runtimeTicks)); + localVarQueryParameterBaseName = "actualSegmentLengthTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("actualSegmentLengthTicks", actualSegmentLengthTicks)); + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + localVarQueryParameterBaseName = "alwaysBurnInSubtitleWhenTranscoding"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("alwaysBurnInSubtitleWhenTranscoding", alwaysBurnInSubtitleWhenTranscoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "video/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a hls live stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param maxWidth Optional. The max width. (optional) + * @param maxHeight Optional. The max height. (optional) + * @param enableSubtitlesInManifest Optional. Whether to enable subtitles in the manifest. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @return File + * @throws ApiException if fails to make API call + */ + public File getLiveHlsStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + ApiResponse localVarResponse = getLiveHlsStreamWithHttpInfo(itemId, container, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + maxWidth, maxHeight, enableSubtitlesInManifest, enableAudioVbrEncoding, + alwaysBurnInSubtitleWhenTranscoding); + return localVarResponse.getData(); + } + + /** + * Gets a hls live stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param maxWidth Optional. The max width. (optional) + * @param maxHeight Optional. The max height. (optional) + * @param enableSubtitlesInManifest Optional. Whether to enable subtitles in the manifest. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveHlsStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLiveHlsStreamRequestBuilder(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + maxWidth, maxHeight, enableSubtitlesInManifest, enableAudioVbrEncoding, + alwaysBurnInSubtitleWhenTranscoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLiveHlsStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLiveHlsStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getLiveHlsStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/live.m3u8".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "container"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("container", container)); + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "enableSubtitlesInManifest"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableSubtitlesInManifest", enableSubtitlesInManifest)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + localVarQueryParameterBaseName = "alwaysBurnInSubtitleWhenTranscoding"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("alwaysBurnInSubtitleWhenTranscoding", alwaysBurnInSubtitleWhenTranscoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an audio hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File getMasterHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + ApiResponse localVarResponse = getMasterHlsAudioPlaylistWithHttpInfo(itemId, mediaSourceId, _static, + params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, enableAudioVbrEncoding); + return localVarResponse.getData(); + } + + /** + * Gets an audio hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMasterHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMasterHlsAudioPlaylistRequestBuilder(itemId, mediaSourceId, + _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, + audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, enableAdaptiveBitrateStreaming, + enableAudioVbrEncoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMasterHlsAudioPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMasterHlsAudioPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getMasterHlsAudioPlaylist"); + } + // verify the required parameter 'mediaSourceId' is set + if (mediaSourceId == null) { + throw new ApiException(400, + "Missing the required parameter 'mediaSourceId' when calling getMasterHlsAudioPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/master.m3u8".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "maxStreamingBitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStreamingBitrate", maxStreamingBitrate)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAdaptiveBitrateStreaming"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("enableAdaptiveBitrateStreaming", enableAdaptiveBitrateStreaming)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param enableTrickplay Enable trickplay image playlists being added to master playlist. (optional, default to + * true) + * @param enableAudioVbrEncoding Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @return File + * @throws ApiException if fails to make API call + */ + public File getMasterHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplay, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + ApiResponse localVarResponse = getMasterHlsVideoPlaylistWithHttpInfo(itemId, mediaSourceId, _static, + params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, + videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, + deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAdaptiveBitrateStreaming, enableTrickplay, enableAudioVbrEncoding, + alwaysBurnInSubtitleWhenTranscoding); + return localVarResponse.getData(); + } + + /** + * Gets a video hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param enableTrickplay Enable trickplay image playlists being added to master playlist. (optional, default to + * true) + * @param enableAudioVbrEncoding Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMasterHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplay, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMasterHlsVideoPlaylistRequestBuilder(itemId, mediaSourceId, + _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAdaptiveBitrateStreaming, enableTrickplay, enableAudioVbrEncoding, + alwaysBurnInSubtitleWhenTranscoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMasterHlsVideoPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMasterHlsVideoPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplay, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getMasterHlsVideoPlaylist"); + } + // verify the required parameter 'mediaSourceId' is set + if (mediaSourceId == null) { + throw new ApiException(400, + "Missing the required parameter 'mediaSourceId' when calling getMasterHlsVideoPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/master.m3u8".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAdaptiveBitrateStreaming"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("enableAdaptiveBitrateStreaming", enableAdaptiveBitrateStreaming)); + localVarQueryParameterBaseName = "enableTrickplay"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTrickplay", enableTrickplay)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + localVarQueryParameterBaseName = "alwaysBurnInSubtitleWhenTranscoding"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("alwaysBurnInSubtitleWhenTranscoding", alwaysBurnInSubtitleWhenTranscoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an audio stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File getVariantHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + ApiResponse localVarResponse = getVariantHlsAudioPlaylistWithHttpInfo(itemId, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding); + return localVarResponse.getData(); + } + + /** + * Gets an audio stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVariantHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getVariantHlsAudioPlaylistRequestBuilder(itemId, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, + audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, enableAudioVbrEncoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getVariantHlsAudioPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getVariantHlsAudioPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getVariantHlsAudioPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/main.m3u8".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "maxStreamingBitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStreamingBitrate", maxStreamingBitrate)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @return File + * @throws ApiException if fails to make API call + */ + public File getVariantHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + ApiResponse localVarResponse = getVariantHlsVideoPlaylistWithHttpInfo(itemId, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, + videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, + deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding); + return localVarResponse.getData(); + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVariantHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getVariantHlsVideoPlaylistRequestBuilder(itemId, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getVariantHlsVideoPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getVariantHlsVideoPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getVariantHlsVideoPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/main.m3u8".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + localVarQueryParameterBaseName = "alwaysBurnInSubtitleWhenTranscoding"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("alwaysBurnInSubtitleWhenTranscoding", alwaysBurnInSubtitleWhenTranscoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an audio hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File headMasterHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + ApiResponse localVarResponse = headMasterHlsAudioPlaylistWithHttpInfo(itemId, mediaSourceId, _static, + params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, enableAudioVbrEncoding); + return localVarResponse.getData(); + } + + /** + * Gets an audio hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headMasterHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headMasterHlsAudioPlaylistRequestBuilder(itemId, mediaSourceId, + _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, + audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, enableAdaptiveBitrateStreaming, + enableAudioVbrEncoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headMasterHlsAudioPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headMasterHlsAudioPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling headMasterHlsAudioPlaylist"); + } + // verify the required parameter 'mediaSourceId' is set + if (mediaSourceId == null) { + throw new ApiException(400, + "Missing the required parameter 'mediaSourceId' when calling headMasterHlsAudioPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/master.m3u8".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "maxStreamingBitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStreamingBitrate", maxStreamingBitrate)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAdaptiveBitrateStreaming"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("enableAdaptiveBitrateStreaming", enableAdaptiveBitrateStreaming)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param enableTrickplay Enable trickplay image playlists being added to master playlist. (optional, default to + * true) + * @param enableAudioVbrEncoding Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @return File + * @throws ApiException if fails to make API call + */ + public File headMasterHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplay, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + ApiResponse localVarResponse = headMasterHlsVideoPlaylistWithHttpInfo(itemId, mediaSourceId, _static, + params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, + videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, + deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAdaptiveBitrateStreaming, enableTrickplay, enableAudioVbrEncoding, + alwaysBurnInSubtitleWhenTranscoding); + return localVarResponse.getData(); + } + + /** + * Gets a video hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param enableTrickplay Enable trickplay image playlists being added to master playlist. (optional, default to + * true) + * @param enableAudioVbrEncoding Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headMasterHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplay, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headMasterHlsVideoPlaylistRequestBuilder(itemId, mediaSourceId, + _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAdaptiveBitrateStreaming, enableTrickplay, enableAudioVbrEncoding, + alwaysBurnInSubtitleWhenTranscoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headMasterHlsVideoPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headMasterHlsVideoPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplay, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling headMasterHlsVideoPlaylist"); + } + // verify the required parameter 'mediaSourceId' is set + if (mediaSourceId == null) { + throw new ApiException(400, + "Missing the required parameter 'mediaSourceId' when calling headMasterHlsVideoPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/master.m3u8".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAdaptiveBitrateStreaming"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("enableAdaptiveBitrateStreaming", enableAdaptiveBitrateStreaming)); + localVarQueryParameterBaseName = "enableTrickplay"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTrickplay", enableTrickplay)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + localVarQueryParameterBaseName = "alwaysBurnInSubtitleWhenTranscoding"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("alwaysBurnInSubtitleWhenTranscoding", alwaysBurnInSubtitleWhenTranscoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/EnvironmentApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/EnvironmentApi.java new file mode 100644 index 0000000000000..c7a922a6e9546 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/EnvironmentApi.java @@ -0,0 +1,589 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.DefaultDirectoryBrowserInfoDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.FileSystemEntryInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ValidatePathDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class EnvironmentApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public EnvironmentApi() { + this(Configuration.getDefaultApiClient()); + } + + public EnvironmentApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Get Default directory browser. + * + * @return DefaultDirectoryBrowserInfoDto + * @throws ApiException if fails to make API call + */ + public DefaultDirectoryBrowserInfoDto getDefaultDirectoryBrowser() throws ApiException { + ApiResponse localVarResponse = getDefaultDirectoryBrowserWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Get Default directory browser. + * + * @return ApiResponse<DefaultDirectoryBrowserInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultDirectoryBrowserWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDefaultDirectoryBrowserRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDefaultDirectoryBrowser", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDefaultDirectoryBrowserRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Environment/DefaultDirectoryBrowser"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the contents of a given directory in the file system. + * + * @param path The path. (required) + * @param includeFiles An optional filter to include or exclude files from the results. true/false. (optional, + * default to false) + * @param includeDirectories An optional filter to include or exclude folders from the results. true/false. + * (optional, default to false) + * @return List<FileSystemEntryInfo> + * @throws ApiException if fails to make API call + */ + public List getDirectoryContents(@org.eclipse.jdt.annotation.Nullable String path, + @org.eclipse.jdt.annotation.NonNull Boolean includeFiles, + @org.eclipse.jdt.annotation.NonNull Boolean includeDirectories) throws ApiException { + ApiResponse> localVarResponse = getDirectoryContentsWithHttpInfo(path, includeFiles, + includeDirectories); + return localVarResponse.getData(); + } + + /** + * Gets the contents of a given directory in the file system. + * + * @param path The path. (required) + * @param includeFiles An optional filter to include or exclude files from the results. true/false. (optional, + * default to false) + * @param includeDirectories An optional filter to include or exclude folders from the results. true/false. + * (optional, default to false) + * @return ApiResponse<List<FileSystemEntryInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getDirectoryContentsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String path, @org.eclipse.jdt.annotation.NonNull Boolean includeFiles, + @org.eclipse.jdt.annotation.NonNull Boolean includeDirectories) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDirectoryContentsRequestBuilder(path, includeFiles, + includeDirectories); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDirectoryContents", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDirectoryContentsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String path, + @org.eclipse.jdt.annotation.NonNull Boolean includeFiles, + @org.eclipse.jdt.annotation.NonNull Boolean includeDirectories) throws ApiException { + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException(400, "Missing the required parameter 'path' when calling getDirectoryContents"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Environment/DirectoryContents"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "path"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("path", path)); + localVarQueryParameterBaseName = "includeFiles"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeFiles", includeFiles)); + localVarQueryParameterBaseName = "includeDirectories"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeDirectories", includeDirectories)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available drives from the server's file system. + * + * @return List<FileSystemEntryInfo> + * @throws ApiException if fails to make API call + */ + public List getDrives() throws ApiException { + ApiResponse> localVarResponse = getDrivesWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets available drives from the server's file system. + * + * @return ApiResponse<List<FileSystemEntryInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getDrivesWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDrivesRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDrives", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDrivesRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Environment/Drives"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets network paths. + * + * @return List<FileSystemEntryInfo> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public List getNetworkShares() throws ApiException { + ApiResponse> localVarResponse = getNetworkSharesWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets network paths. + * + * @return ApiResponse<List<FileSystemEntryInfo>> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse> getNetworkSharesWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getNetworkSharesRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getNetworkShares", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getNetworkSharesRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Environment/NetworkShares"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the parent path of a given path. + * + * @param path The path. (required) + * @return String + * @throws ApiException if fails to make API call + */ + public String getParentPath(@org.eclipse.jdt.annotation.Nullable String path) throws ApiException { + ApiResponse localVarResponse = getParentPathWithHttpInfo(path); + return localVarResponse.getData(); + } + + /** + * Gets the parent path of a given path. + * + * @param path The path. (required) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getParentPathWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String path) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getParentPathRequestBuilder(path); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getParentPath", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getParentPathRequestBuilder(@org.eclipse.jdt.annotation.Nullable String path) + throws ApiException { + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException(400, "Missing the required parameter 'path' when calling getParentPath"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Environment/ParentPath"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "path"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("path", path)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Validates path. + * + * @param validatePathDto Validate request object. (required) + * @throws ApiException if fails to make API call + */ + public void validatePath(@org.eclipse.jdt.annotation.Nullable ValidatePathDto validatePathDto) throws ApiException { + validatePathWithHttpInfo(validatePathDto); + } + + /** + * Validates path. + * + * @param validatePathDto Validate request object. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse validatePathWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ValidatePathDto validatePathDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = validatePathRequestBuilder(validatePathDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("validatePath", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder validatePathRequestBuilder( + @org.eclipse.jdt.annotation.Nullable ValidatePathDto validatePathDto) throws ApiException { + // verify the required parameter 'validatePathDto' is set + if (validatePathDto == null) { + throw new ApiException(400, "Missing the required parameter 'validatePathDto' when calling validatePath"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Environment/ValidatePath"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(validatePathDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/FilterApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/FilterApi.java new file mode 100644 index 0000000000000..fbacaf7766dcf --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/FilterApi.java @@ -0,0 +1,342 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MediaType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.QueryFilters; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.QueryFiltersLegacy; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class FilterApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public FilterApi() { + this(Configuration.getDefaultApiClient()); + } + + public FilterApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets query filters. + * + * @param userId Optional. User id. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isAiring Optional. Is item airing. (optional) + * @param isMovie Optional. Is item movie. (optional) + * @param isSports Optional. Is item sports. (optional) + * @param isKids Optional. Is item kids. (optional) + * @param isNews Optional. Is item news. (optional) + * @param isSeries Optional. Is item series. (optional) + * @param recursive Optional. Search recursive. (optional) + * @return QueryFilters + * @throws ApiException if fails to make API call + */ + public QueryFilters getQueryFilters(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean recursive) throws ApiException { + ApiResponse localVarResponse = getQueryFiltersWithHttpInfo(userId, parentId, includeItemTypes, + isAiring, isMovie, isSports, isKids, isNews, isSeries, recursive); + return localVarResponse.getData(); + } + + /** + * Gets query filters. + * + * @param userId Optional. User id. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isAiring Optional. Is item airing. (optional) + * @param isMovie Optional. Is item movie. (optional) + * @param isSports Optional. Is item sports. (optional) + * @param isKids Optional. Is item kids. (optional) + * @param isNews Optional. Is item news. (optional) + * @param isSeries Optional. Is item series. (optional) + * @param recursive Optional. Search recursive. (optional) + * @return ApiResponse<QueryFilters> + * @throws ApiException if fails to make API call + */ + public ApiResponse getQueryFiltersWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean recursive) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getQueryFiltersRequestBuilder(userId, parentId, includeItemTypes, + isAiring, isMovie, isSports, isKids, isNews, isSeries, recursive); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getQueryFilters", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getQueryFiltersRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean recursive) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/Filters2"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "isAiring"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isAiring", isAiring)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "recursive"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("recursive", recursive)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets legacy query filters. + * + * @param userId Optional. User id. (optional) + * @param parentId Optional. Parent id. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @return QueryFiltersLegacy + * @throws ApiException if fails to make API call + */ + public QueryFiltersLegacy getQueryFiltersLegacy(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes) throws ApiException { + ApiResponse localVarResponse = getQueryFiltersLegacyWithHttpInfo(userId, parentId, + includeItemTypes, mediaTypes); + return localVarResponse.getData(); + } + + /** + * Gets legacy query filters. + * + * @param userId Optional. User id. (optional) + * @param parentId Optional. Parent id. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @return ApiResponse<QueryFiltersLegacy> + * @throws ApiException if fails to make API call + */ + public ApiResponse getQueryFiltersLegacyWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getQueryFiltersLegacyRequestBuilder(userId, parentId, + includeItemTypes, mediaTypes); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getQueryFiltersLegacy", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getQueryFiltersLegacyRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/Filters"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/GenresApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/GenresApi.java new file mode 100644 index 0000000000000..ee257685973d9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/GenresApi.java @@ -0,0 +1,403 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemSortBy; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SortOrder; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class GenresApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public GenresApi() { + this(Configuration.getDefaultApiClient()); + } + + public GenresApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets a genre, by name. + * + * @param genreName The genre name. (required) + * @param userId The user id. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getGenre(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = getGenreWithHttpInfo(genreName, userId); + return localVarResponse.getData(); + } + + /** + * Gets a genre, by name. + * + * @param genreName The genre name. (required) + * @param userId The user id. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenreWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGenreRequestBuilder(genreName, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getGenre", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getGenreRequestBuilder(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'genreName' is set + if (genreName == null) { + throw new ApiException(400, "Missing the required parameter 'genreName' when calling getGenre"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Genres/{genreName}".replace("{genreName}", ApiClient.urlEncode(genreName.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all genres from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered in based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Optional. Include total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getGenres(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + ApiResponse localVarResponse = getGenresWithHttpInfo(startIndex, limit, searchTerm, + parentId, fields, excludeItemTypes, includeItemTypes, isFavorite, imageTypeLimit, enableImageTypes, + userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, + enableTotalRecordCount); + return localVarResponse.getData(); + } + + /** + * Gets all genres from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered in based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Optional. Include total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenresWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGenresRequestBuilder(startIndex, limit, searchTerm, parentId, + fields, excludeItemTypes, includeItemTypes, isFavorite, imageTypeLimit, enableImageTypes, userId, + nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, + enableTotalRecordCount); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getGenres", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getGenresRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Genres"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "nameStartsWithOrGreater"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWithOrGreater", nameStartsWithOrGreater)); + localVarQueryParameterBaseName = "nameStartsWith"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWith", nameStartsWith)); + localVarQueryParameterBaseName = "nameLessThan"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameLessThan", nameLessThan)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/HlsSegmentApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/HlsSegmentApi.java new file mode 100644 index 0000000000000..f7bc54c222bc7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/HlsSegmentApi.java @@ -0,0 +1,551 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class HlsSegmentApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public HlsSegmentApi() { + this(Configuration.getDefaultApiClient()); + } + + public HlsSegmentApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets the specified audio segment for an audio item. + * + * @param itemId The item id. (required) + * @param segmentId The segment id. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsAudioSegmentLegacyAac(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String segmentId) throws ApiException { + ApiResponse localVarResponse = getHlsAudioSegmentLegacyAacWithHttpInfo(itemId, segmentId); + return localVarResponse.getData(); + } + + /** + * Gets the specified audio segment for an audio item. + * + * @param itemId The item id. (required) + * @param segmentId The segment id. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsAudioSegmentLegacyAacWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String segmentId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsAudioSegmentLegacyAacRequestBuilder(itemId, segmentId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getHlsAudioSegmentLegacyAac", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getHlsAudioSegmentLegacyAacRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String segmentId) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getHlsAudioSegmentLegacyAac"); + } + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException(400, + "Missing the required parameter 'segmentId' when calling getHlsAudioSegmentLegacyAac"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/hls/{segmentId}/stream.aac" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{segmentId}", ApiClient.urlEncode(segmentId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "audio/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the specified audio segment for an audio item. + * + * @param itemId The item id. (required) + * @param segmentId The segment id. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsAudioSegmentLegacyMp3(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String segmentId) throws ApiException { + ApiResponse localVarResponse = getHlsAudioSegmentLegacyMp3WithHttpInfo(itemId, segmentId); + return localVarResponse.getData(); + } + + /** + * Gets the specified audio segment for an audio item. + * + * @param itemId The item id. (required) + * @param segmentId The segment id. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsAudioSegmentLegacyMp3WithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String segmentId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsAudioSegmentLegacyMp3RequestBuilder(itemId, segmentId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getHlsAudioSegmentLegacyMp3", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getHlsAudioSegmentLegacyMp3RequestBuilder( + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String segmentId) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getHlsAudioSegmentLegacyMp3"); + } + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException(400, + "Missing the required parameter 'segmentId' when calling getHlsAudioSegmentLegacyMp3"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/hls/{segmentId}/stream.mp3" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{segmentId}", ApiClient.urlEncode(segmentId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "audio/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a hls video playlist. + * + * @param itemId The video id. (required) + * @param playlistId The playlist id. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsPlaylistLegacy(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId) throws ApiException { + ApiResponse localVarResponse = getHlsPlaylistLegacyWithHttpInfo(itemId, playlistId); + return localVarResponse.getData(); + } + + /** + * Gets a hls video playlist. + * + * @param itemId The video id. (required) + * @param playlistId The playlist id. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsPlaylistLegacyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsPlaylistLegacyRequestBuilder(itemId, playlistId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getHlsPlaylistLegacy", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getHlsPlaylistLegacyRequestBuilder(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getHlsPlaylistLegacy"); + } + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, + "Missing the required parameter 'playlistId' when calling getHlsPlaylistLegacy"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/hls/{playlistId}/stream.m3u8" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{playlistId}", ApiClient.urlEncode(playlistId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a hls video segment. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param segmentContainer The segment container. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsVideoSegmentLegacy(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String segmentId, + @org.eclipse.jdt.annotation.Nullable String segmentContainer) throws ApiException { + ApiResponse localVarResponse = getHlsVideoSegmentLegacyWithHttpInfo(itemId, playlistId, segmentId, + segmentContainer); + return localVarResponse.getData(); + } + + /** + * Gets a hls video segment. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param segmentContainer The segment container. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsVideoSegmentLegacyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String segmentId, + @org.eclipse.jdt.annotation.Nullable String segmentContainer) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsVideoSegmentLegacyRequestBuilder(itemId, playlistId, + segmentId, segmentContainer); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getHlsVideoSegmentLegacy", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getHlsVideoSegmentLegacyRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String segmentId, + @org.eclipse.jdt.annotation.Nullable String segmentContainer) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getHlsVideoSegmentLegacy"); + } + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, + "Missing the required parameter 'playlistId' when calling getHlsVideoSegmentLegacy"); + } + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException(400, + "Missing the required parameter 'segmentId' when calling getHlsVideoSegmentLegacy"); + } + // verify the required parameter 'segmentContainer' is set + if (segmentContainer == null) { + throw new ApiException(400, + "Missing the required parameter 'segmentContainer' when calling getHlsVideoSegmentLegacy"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/hls/{playlistId}/{segmentId}.{segmentContainer}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{playlistId}", ApiClient.urlEncode(playlistId.toString())) + .replace("{segmentId}", ApiClient.urlEncode(segmentId.toString())) + .replace("{segmentContainer}", ApiClient.urlEncode(segmentContainer.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "video/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Stops an active encoding. + * + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (required) + * @param playSessionId The play session id. (required) + * @throws ApiException if fails to make API call + */ + public void stopEncodingProcess(@org.eclipse.jdt.annotation.Nullable String deviceId, + @org.eclipse.jdt.annotation.Nullable String playSessionId) throws ApiException { + stopEncodingProcessWithHttpInfo(deviceId, playSessionId); + } + + /** + * Stops an active encoding. + * + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (required) + * @param playSessionId The play session id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse stopEncodingProcessWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String deviceId, + @org.eclipse.jdt.annotation.Nullable String playSessionId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = stopEncodingProcessRequestBuilder(deviceId, playSessionId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("stopEncodingProcess", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder stopEncodingProcessRequestBuilder(@org.eclipse.jdt.annotation.Nullable String deviceId, + @org.eclipse.jdt.annotation.Nullable String playSessionId) throws ApiException { + // verify the required parameter 'deviceId' is set + if (deviceId == null) { + throw new ApiException(400, "Missing the required parameter 'deviceId' when calling stopEncodingProcess"); + } + // verify the required parameter 'playSessionId' is set + if (playSessionId == null) { + throw new ApiException(400, + "Missing the required parameter 'playSessionId' when calling stopEncodingProcess"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/ActiveEncodings"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ImageApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ImageApi.java new file mode 100644 index 0000000000000..57188e967b803 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ImageApi.java @@ -0,0 +1,6278 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageFormat; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageType; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ImageApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ImageApi() { + this(Configuration.getDefaultApiClient()); + } + + public ImageApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Delete a custom splashscreen. + * + * @throws ApiException if fails to make API call + */ + public void deleteCustomSplashscreen() throws ApiException { + deleteCustomSplashscreenWithHttpInfo(); + } + + /** + * Delete a custom splashscreen. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteCustomSplashscreenWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteCustomSplashscreenRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteCustomSplashscreen", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteCustomSplashscreenRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Branding/Splashscreen"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete an item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex The image index. (optional) + * @throws ApiException if fails to make API call + */ + public void deleteItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + deleteItemImageWithHttpInfo(itemId, imageType, imageIndex); + } + + /** + * Delete an item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex The image index. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteItemImageRequestBuilder(itemId, imageType, imageIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteItemImage", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteItemImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteItemImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling deleteItemImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete an item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex The image index. (required) + * @throws ApiException if fails to make API call + */ + public void deleteItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex) throws ApiException { + deleteItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex); + } + + /** + * Delete an item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex The image index. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteItemImageByIndexRequestBuilder(itemId, imageType, + imageIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteItemImageByIndex", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteItemImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteItemImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling deleteItemImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling deleteItemImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}/{imageIndex}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete the user's image. + * + * @param userId User Id. (optional) + * @throws ApiException if fails to make API call + */ + public void deleteUserImage(@org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + deleteUserImageWithHttpInfo(userId); + } + + /** + * Delete the user's image. + * + * @param userId User Id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserImageWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteUserImageRequestBuilder(userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteUserImage", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteUserImageRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/UserImage"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get artist image by name. + * + * @param name Artist name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getArtistImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + ApiResponse localVarResponse = getArtistImageWithHttpInfo(name, imageType, imageIndex, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer); + return localVarResponse.getData(); + } + + /** + * Get artist image by name. + * + * @param name Artist name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getArtistImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getArtistImageRequestBuilder(name, imageType, imageIndex, tag, + format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, blur, backgroundColor, foregroundLayer); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getArtistImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getArtistImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getArtistImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getArtistImage"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, "Missing the required parameter 'imageIndex' when calling getArtistImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Artists/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + ApiResponse localVarResponse = getGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + return localVarResponse.getData(); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGenreImageRequestBuilder(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getGenreImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getGenreImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getGenreImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getGenreImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Genres/{name}/Images/{imageType}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + ApiResponse localVarResponse = getGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer); + return localVarResponse.getData(); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGenreImageByIndexRequestBuilder(name, imageType, imageIndex, + tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, blur, backgroundColor, foregroundLayer); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getGenreImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getGenreImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getGenreImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getGenreImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling getGenreImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Genres/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + ApiResponse localVarResponse = getItemImageWithHttpInfo(itemId, imageType, maxWidth, maxHeight, width, + height, quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, blur, + backgroundColor, foregroundLayer, imageIndex); + return localVarResponse.getData(); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemImageRequestBuilder(itemId, imageType, maxWidth, maxHeight, + width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, blur, + backgroundColor, foregroundLayer, imageIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItemImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getItemImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (required) + * @param maxHeight The maximum image height to return. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (required) + * @param format Determines the output format of the image - original,gif,jpg,png. (required) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (required) + * @param unplayedCount Optional. Unplayed count overlay to render. (required) + * @param imageIndex Image index. (required) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getItemImage2(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + ApiResponse localVarResponse = getItemImage2WithHttpInfo(itemId, imageType, maxWidth, maxHeight, tag, + format, percentPlayed, unplayedCount, imageIndex, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer); + return localVarResponse.getData(); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (required) + * @param maxHeight The maximum image height to return. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (required) + * @param format Determines the output format of the image - original,gif,jpg,png. (required) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (required) + * @param unplayedCount Optional. Unplayed count overlay to render. (required) + * @param imageIndex Image index. (required) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemImage2WithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemImage2RequestBuilder(itemId, imageType, maxWidth, maxHeight, + tag, format, percentPlayed, unplayedCount, imageIndex, width, height, quality, fillWidth, fillHeight, + blur, backgroundColor, foregroundLayer); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItemImage2", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemImage2RequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemImage2"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getItemImage2"); + } + // verify the required parameter 'maxWidth' is set + if (maxWidth == null) { + throw new ApiException(400, "Missing the required parameter 'maxWidth' when calling getItemImage2"); + } + // verify the required parameter 'maxHeight' is set + if (maxHeight == null) { + throw new ApiException(400, "Missing the required parameter 'maxHeight' when calling getItemImage2"); + } + // verify the required parameter 'tag' is set + if (tag == null) { + throw new ApiException(400, "Missing the required parameter 'tag' when calling getItemImage2"); + } + // verify the required parameter 'format' is set + if (format == null) { + throw new ApiException(400, "Missing the required parameter 'format' when calling getItemImage2"); + } + // verify the required parameter 'percentPlayed' is set + if (percentPlayed == null) { + throw new ApiException(400, "Missing the required parameter 'percentPlayed' when calling getItemImage2"); + } + // verify the required parameter 'unplayedCount' is set + if (unplayedCount == null) { + throw new ApiException(400, "Missing the required parameter 'unplayedCount' when calling getItemImage2"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, "Missing the required parameter 'imageIndex' when calling getItemImage2"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{maxWidth}", ApiClient.urlEncode(maxWidth.toString())) + .replace("{maxHeight}", ApiClient.urlEncode(maxHeight.toString())) + .replace("{tag}", ApiClient.urlEncode(tag.toString())) + .replace("{format}", ApiClient.urlEncode(format.toString())) + .replace("{percentPlayed}", ApiClient.urlEncode(percentPlayed.toString())) + .replace("{unplayedCount}", ApiClient.urlEncode(unplayedCount.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + ApiResponse localVarResponse = getItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, maxWidth, + maxHeight, width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, + blur, backgroundColor, foregroundLayer); + return localVarResponse.getData(); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemImageByIndexRequestBuilder(itemId, imageType, imageIndex, + maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, + unplayedCount, blur, backgroundColor, foregroundLayer); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItemImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getItemImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, "Missing the required parameter 'imageIndex' when calling getItemImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}/{imageIndex}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get item image infos. + * + * @param itemId Item id. (required) + * @return List<ImageInfo> + * @throws ApiException if fails to make API call + */ + public List getItemImageInfos(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + ApiResponse> localVarResponse = getItemImageInfosWithHttpInfo(itemId); + return localVarResponse.getData(); + } + + /** + * Get item image infos. + * + * @param itemId Item id. (required) + * @return ApiResponse<List<ImageInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getItemImageInfosWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemImageInfosRequestBuilder(itemId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItemImageInfos", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemImageInfosRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemImageInfos"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getMusicGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + ApiResponse localVarResponse = getMusicGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + return localVarResponse.getData(); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMusicGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMusicGenreImageRequestBuilder(name, imageType, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMusicGenreImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMusicGenreImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getMusicGenreImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getMusicGenreImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MusicGenres/{name}/Images/{imageType}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getMusicGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + ApiResponse localVarResponse = getMusicGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, + format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, blur, backgroundColor, foregroundLayer); + return localVarResponse.getData(); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMusicGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMusicGenreImageByIndexRequestBuilder(name, imageType, + imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, + fillWidth, fillHeight, blur, backgroundColor, foregroundLayer); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMusicGenreImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMusicGenreImageByIndexRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getMusicGenreImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling getMusicGenreImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling getMusicGenreImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MusicGenres/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getPersonImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + ApiResponse localVarResponse = getPersonImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + return localVarResponse.getData(); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPersonImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPersonImageRequestBuilder(name, imageType, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPersonImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPersonImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getPersonImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getPersonImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Persons/{name}/Images/{imageType}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getPersonImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + ApiResponse localVarResponse = getPersonImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer); + return localVarResponse.getData(); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPersonImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPersonImageByIndexRequestBuilder(name, imageType, imageIndex, + tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, blur, backgroundColor, foregroundLayer); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPersonImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPersonImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getPersonImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling getPersonImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling getPersonImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Persons/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Generates or gets the splashscreen. + * + * @param tag Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Blur image. (optional) + * @param backgroundColor Apply a background color for transparent images. (optional) + * @param foregroundLayer Apply a foreground layer on top of the image. (optional) + * @param quality Quality setting, from 0-100. (optional, default to 90) + * @return File + * @throws ApiException if fails to make API call + */ + public File getSplashscreen(@org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer quality) throws ApiException { + ApiResponse localVarResponse = getSplashscreenWithHttpInfo(tag, format, maxWidth, maxHeight, width, + height, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, quality); + return localVarResponse.getData(); + } + + /** + * Generates or gets the splashscreen. + * + * @param tag Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Blur image. (optional) + * @param backgroundColor Apply a background color for transparent images. (optional) + * @param foregroundLayer Apply a foreground layer on top of the image. (optional) + * @param quality Quality setting, from 0-100. (optional, default to 90) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSplashscreenWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer quality) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSplashscreenRequestBuilder(tag, format, maxWidth, maxHeight, + width, height, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, quality); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSplashscreen", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSplashscreenRequestBuilder(@org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer quality) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Branding/Splashscreen"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "image/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getStudioImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + ApiResponse localVarResponse = getStudioImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + return localVarResponse.getData(); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStudioImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getStudioImageRequestBuilder(name, imageType, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getStudioImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getStudioImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getStudioImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getStudioImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Studios/{name}/Images/{imageType}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getStudioImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + ApiResponse localVarResponse = getStudioImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer); + return localVarResponse.getData(); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStudioImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getStudioImageByIndexRequestBuilder(name, imageType, imageIndex, + tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, blur, backgroundColor, foregroundLayer); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getStudioImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getStudioImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getStudioImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling getStudioImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling getStudioImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Studios/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get user profile image. + * + * @param userId User id. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getUserImage(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + ApiResponse localVarResponse = getUserImageWithHttpInfo(userId, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, + foregroundLayer, imageIndex); + return localVarResponse.getData(); + } + + /** + * Get user profile image. + * + * @param userId User id. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserImageWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUserImageRequestBuilder(userId, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getUserImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUserImageRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/UserImage"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get artist image by name. + * + * @param name Artist name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headArtistImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + ApiResponse localVarResponse = headArtistImageWithHttpInfo(name, imageType, imageIndex, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer); + return localVarResponse.getData(); + } + + /** + * Get artist image by name. + * + * @param name Artist name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headArtistImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headArtistImageRequestBuilder(name, imageType, imageIndex, tag, + format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, blur, backgroundColor, foregroundLayer); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headArtistImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headArtistImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling headArtistImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headArtistImage"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, "Missing the required parameter 'imageIndex' when calling headArtistImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Artists/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + ApiResponse localVarResponse = headGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + return localVarResponse.getData(); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headGenreImageRequestBuilder(name, imageType, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headGenreImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headGenreImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling headGenreImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headGenreImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Genres/{name}/Images/{imageType}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + ApiResponse localVarResponse = headGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer); + return localVarResponse.getData(); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headGenreImageByIndexRequestBuilder(name, imageType, imageIndex, + tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, blur, backgroundColor, foregroundLayer); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headGenreImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headGenreImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling headGenreImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling headGenreImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling headGenreImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Genres/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + ApiResponse localVarResponse = headItemImageWithHttpInfo(itemId, imageType, maxWidth, maxHeight, width, + height, quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, blur, + backgroundColor, foregroundLayer, imageIndex); + return localVarResponse.getData(); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headItemImageRequestBuilder(itemId, imageType, maxWidth, maxHeight, + width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, blur, + backgroundColor, foregroundLayer, imageIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headItemImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headItemImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling headItemImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headItemImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (required) + * @param maxHeight The maximum image height to return. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (required) + * @param format Determines the output format of the image - original,gif,jpg,png. (required) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (required) + * @param unplayedCount Optional. Unplayed count overlay to render. (required) + * @param imageIndex Image index. (required) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headItemImage2(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + ApiResponse localVarResponse = headItemImage2WithHttpInfo(itemId, imageType, maxWidth, maxHeight, tag, + format, percentPlayed, unplayedCount, imageIndex, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer); + return localVarResponse.getData(); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (required) + * @param maxHeight The maximum image height to return. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (required) + * @param format Determines the output format of the image - original,gif,jpg,png. (required) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (required) + * @param unplayedCount Optional. Unplayed count overlay to render. (required) + * @param imageIndex Image index. (required) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headItemImage2WithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headItemImage2RequestBuilder(itemId, imageType, maxWidth, + maxHeight, tag, format, percentPlayed, unplayedCount, imageIndex, width, height, quality, fillWidth, + fillHeight, blur, backgroundColor, foregroundLayer); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headItemImage2", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headItemImage2RequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling headItemImage2"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headItemImage2"); + } + // verify the required parameter 'maxWidth' is set + if (maxWidth == null) { + throw new ApiException(400, "Missing the required parameter 'maxWidth' when calling headItemImage2"); + } + // verify the required parameter 'maxHeight' is set + if (maxHeight == null) { + throw new ApiException(400, "Missing the required parameter 'maxHeight' when calling headItemImage2"); + } + // verify the required parameter 'tag' is set + if (tag == null) { + throw new ApiException(400, "Missing the required parameter 'tag' when calling headItemImage2"); + } + // verify the required parameter 'format' is set + if (format == null) { + throw new ApiException(400, "Missing the required parameter 'format' when calling headItemImage2"); + } + // verify the required parameter 'percentPlayed' is set + if (percentPlayed == null) { + throw new ApiException(400, "Missing the required parameter 'percentPlayed' when calling headItemImage2"); + } + // verify the required parameter 'unplayedCount' is set + if (unplayedCount == null) { + throw new ApiException(400, "Missing the required parameter 'unplayedCount' when calling headItemImage2"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, "Missing the required parameter 'imageIndex' when calling headItemImage2"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{maxWidth}", ApiClient.urlEncode(maxWidth.toString())) + .replace("{maxHeight}", ApiClient.urlEncode(maxHeight.toString())) + .replace("{tag}", ApiClient.urlEncode(tag.toString())) + .replace("{format}", ApiClient.urlEncode(format.toString())) + .replace("{percentPlayed}", ApiClient.urlEncode(percentPlayed.toString())) + .replace("{unplayedCount}", ApiClient.urlEncode(unplayedCount.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + ApiResponse localVarResponse = headItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, maxWidth, + maxHeight, width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, + blur, backgroundColor, foregroundLayer); + return localVarResponse.getData(); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headItemImageByIndexRequestBuilder(itemId, imageType, imageIndex, + maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, + unplayedCount, blur, backgroundColor, foregroundLayer); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headItemImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headItemImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling headItemImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headItemImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling headItemImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}/{imageIndex}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headMusicGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + ApiResponse localVarResponse = headMusicGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + return localVarResponse.getData(); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headMusicGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headMusicGenreImageRequestBuilder(name, imageType, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headMusicGenreImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headMusicGenreImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling headMusicGenreImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headMusicGenreImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MusicGenres/{name}/Images/{imageType}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headMusicGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + ApiResponse localVarResponse = headMusicGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, + format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, blur, backgroundColor, foregroundLayer); + return localVarResponse.getData(); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headMusicGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headMusicGenreImageByIndexRequestBuilder(name, imageType, + imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, + fillWidth, fillHeight, blur, backgroundColor, foregroundLayer); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headMusicGenreImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headMusicGenreImageByIndexRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, + "Missing the required parameter 'name' when calling headMusicGenreImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling headMusicGenreImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling headMusicGenreImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MusicGenres/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headPersonImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + ApiResponse localVarResponse = headPersonImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + return localVarResponse.getData(); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headPersonImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headPersonImageRequestBuilder(name, imageType, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headPersonImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headPersonImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling headPersonImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headPersonImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Persons/{name}/Images/{imageType}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headPersonImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + ApiResponse localVarResponse = headPersonImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, + format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, blur, backgroundColor, foregroundLayer); + return localVarResponse.getData(); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headPersonImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headPersonImageByIndexRequestBuilder(name, imageType, imageIndex, + tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, blur, backgroundColor, foregroundLayer); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headPersonImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headPersonImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling headPersonImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling headPersonImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling headPersonImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Persons/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headStudioImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + ApiResponse localVarResponse = headStudioImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + return localVarResponse.getData(); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headStudioImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headStudioImageRequestBuilder(name, imageType, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headStudioImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headStudioImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling headStudioImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headStudioImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Studios/{name}/Images/{imageType}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headStudioImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + ApiResponse localVarResponse = headStudioImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, + format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, blur, backgroundColor, foregroundLayer); + return localVarResponse.getData(); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headStudioImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headStudioImageByIndexRequestBuilder(name, imageType, imageIndex, + tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, blur, backgroundColor, foregroundLayer); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headStudioImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headStudioImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling headStudioImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling headStudioImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling headStudioImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Studios/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get user profile image. + * + * @param userId User id. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headUserImage(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + ApiResponse localVarResponse = headUserImageWithHttpInfo(userId, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, + foregroundLayer, imageIndex); + return localVarResponse.getData(); + } + + /** + * Get user profile image. + * + * @param userId User id. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headUserImageWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headUserImageRequestBuilder(userId, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headUserImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headUserImageRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/UserImage"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sets the user image. + * + * @param userId User Id. (optional) + * @param body (optional) + * @throws ApiException if fails to make API call + */ + public void postUserImage(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull File body) throws ApiException { + postUserImageWithHttpInfo(userId, body); + } + + /** + * Sets the user image. + * + * @param userId User Id. (optional) + * @param body (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUserImageWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull File body) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postUserImageRequestBuilder(userId, body); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postUserImage", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postUserImageRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull File body) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/UserImage"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "image/*"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param body (optional) + * @throws ApiException if fails to make API call + */ + public void setItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + setItemImageWithHttpInfo(itemId, imageType, body); + } + + /** + * Set item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param body (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = setItemImageRequestBuilder(itemId, imageType, body); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("setItemImage", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder setItemImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling setItemImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling setItemImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "image/*"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex (Unused) Image index. (required) + * @param body (optional) + * @throws ApiException if fails to make API call + */ + public void setItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + setItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, body); + } + + /** + * Set item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex (Unused) Image index. (required) + * @param body (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = setItemImageByIndexRequestBuilder(itemId, imageType, imageIndex, + body); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("setItemImageByIndex", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder setItemImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling setItemImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling setItemImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, "Missing the required parameter 'imageIndex' when calling setItemImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}/{imageIndex}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "image/*"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates the index for an item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Old image index. (required) + * @param newIndex New image index. (required) + * @throws ApiException if fails to make API call + */ + public void updateItemImageIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.Nullable Integer newIndex) throws ApiException { + updateItemImageIndexWithHttpInfo(itemId, imageType, imageIndex, newIndex); + } + + /** + * Updates the index for an item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Old image index. (required) + * @param newIndex New image index. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateItemImageIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.Nullable Integer newIndex) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateItemImageIndexRequestBuilder(itemId, imageType, imageIndex, + newIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateItemImageIndex", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateItemImageIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.Nullable Integer newIndex) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling updateItemImageIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling updateItemImageIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling updateItemImageIndex"); + } + // verify the required parameter 'newIndex' is set + if (newIndex == null) { + throw new ApiException(400, "Missing the required parameter 'newIndex' when calling updateItemImageIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}/{imageIndex}/Index" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "newIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("newIndex", newIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Uploads a custom splashscreen. The body is expected to the image contents base64 encoded. + * + * @param body (optional) + * @throws ApiException if fails to make API call + */ + public void uploadCustomSplashscreen(@org.eclipse.jdt.annotation.NonNull File body) throws ApiException { + uploadCustomSplashscreenWithHttpInfo(body); + } + + /** + * Uploads a custom splashscreen. The body is expected to the image contents base64 encoded. + * + * @param body (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse uploadCustomSplashscreenWithHttpInfo(@org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uploadCustomSplashscreenRequestBuilder(body); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("uploadCustomSplashscreen", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uploadCustomSplashscreenRequestBuilder(@org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Branding/Splashscreen"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "image/*"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/InstantMixApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/InstantMixApi.java new file mode 100644 index 0000000000000..298641a76fb24 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/InstantMixApi.java @@ -0,0 +1,1229 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFields; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class InstantMixApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public InstantMixApi() { + this(Configuration.getDefaultApiClient()); + } + + public InstantMixApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Creates an instant playlist based on a given album. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromAlbum(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + ApiResponse localVarResponse = getInstantMixFromAlbumWithHttpInfo(itemId, userId, limit, + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + return localVarResponse.getData(); + } + + /** + * Creates an instant playlist based on a given album. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromAlbumWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInstantMixFromAlbumRequestBuilder(itemId, userId, limit, fields, + enableImages, enableUserData, imageTypeLimit, enableImageTypes); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInstantMixFromAlbum", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInstantMixFromAlbumRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getInstantMixFromAlbum"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Albums/{itemId}/InstantMix".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates an instant playlist based on a given artist. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromArtists(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + ApiResponse localVarResponse = getInstantMixFromArtistsWithHttpInfo(itemId, userId, + limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + return localVarResponse.getData(); + } + + /** + * Creates an instant playlist based on a given artist. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromArtistsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInstantMixFromArtistsRequestBuilder(itemId, userId, limit, + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInstantMixFromArtists", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInstantMixFromArtistsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getInstantMixFromArtists"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Artists/{itemId}/InstantMix".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates an instant playlist based on a given artist. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getInstantMixFromArtists2(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + ApiResponse localVarResponse = getInstantMixFromArtists2WithHttpInfo(id, userId, limit, + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + return localVarResponse.getData(); + } + + /** + * Creates an instant playlist based on a given artist. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getInstantMixFromArtists2WithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInstantMixFromArtists2RequestBuilder(id, userId, limit, fields, + enableImages, enableUserData, imageTypeLimit, enableImageTypes); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInstantMixFromArtists2", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInstantMixFromArtists2RequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getInstantMixFromArtists2"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Artists/InstantMix"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates an instant playlist based on a given item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + ApiResponse localVarResponse = getInstantMixFromItemWithHttpInfo(itemId, userId, limit, + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + return localVarResponse.getData(); + } + + /** + * Creates an instant playlist based on a given item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInstantMixFromItemRequestBuilder(itemId, userId, limit, fields, + enableImages, enableUserData, imageTypeLimit, enableImageTypes); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInstantMixFromItem", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInstantMixFromItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getInstantMixFromItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/InstantMix".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates an instant playlist based on a given genre. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromMusicGenreById(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + ApiResponse localVarResponse = getInstantMixFromMusicGenreByIdWithHttpInfo(id, userId, + limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + return localVarResponse.getData(); + } + + /** + * Creates an instant playlist based on a given genre. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromMusicGenreByIdWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInstantMixFromMusicGenreByIdRequestBuilder(id, userId, limit, + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInstantMixFromMusicGenreById", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInstantMixFromMusicGenreByIdRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, + "Missing the required parameter 'id' when calling getInstantMixFromMusicGenreById"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MusicGenres/InstantMix"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates an instant playlist based on a given genre. + * + * @param name The genre name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromMusicGenreByName(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + ApiResponse localVarResponse = getInstantMixFromMusicGenreByNameWithHttpInfo(name, + userId, limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + return localVarResponse.getData(); + } + + /** + * Creates an instant playlist based on a given genre. + * + * @param name The genre name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromMusicGenreByNameWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInstantMixFromMusicGenreByNameRequestBuilder(name, userId, + limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInstantMixFromMusicGenreByName", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInstantMixFromMusicGenreByNameRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, + "Missing the required parameter 'name' when calling getInstantMixFromMusicGenreByName"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MusicGenres/{name}/InstantMix".replace("{name}", ApiClient.urlEncode(name.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates an instant playlist based on a given playlist. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + ApiResponse localVarResponse = getInstantMixFromPlaylistWithHttpInfo(itemId, userId, + limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + return localVarResponse.getData(); + } + + /** + * Creates an instant playlist based on a given playlist. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromPlaylistWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInstantMixFromPlaylistRequestBuilder(itemId, userId, limit, + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInstantMixFromPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInstantMixFromPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getInstantMixFromPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists/{itemId}/InstantMix".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates an instant playlist based on a given song. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromSong(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + ApiResponse localVarResponse = getInstantMixFromSongWithHttpInfo(itemId, userId, limit, + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + return localVarResponse.getData(); + } + + /** + * Creates an instant playlist based on a given song. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromSongWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInstantMixFromSongRequestBuilder(itemId, userId, limit, fields, + enableImages, enableUserData, imageTypeLimit, enableImageTypes); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInstantMixFromSong", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInstantMixFromSongRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getInstantMixFromSong"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Songs/{itemId}/InstantMix".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemLookupApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemLookupApi.java new file mode 100644 index 0000000000000..1090be48b6e47 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemLookupApi.java @@ -0,0 +1,1133 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.AlbumInfoRemoteSearchQuery; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ArtistInfoRemoteSearchQuery; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BookInfoRemoteSearchQuery; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BoxSetInfoRemoteSearchQuery; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ExternalIdInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MovieInfoRemoteSearchQuery; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MusicVideoInfoRemoteSearchQuery; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PersonLookupInfoRemoteSearchQuery; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.RemoteSearchResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SeriesInfoRemoteSearchQuery; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.TrailerInfoRemoteSearchQuery; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ItemLookupApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ItemLookupApi() { + this(Configuration.getDefaultApiClient()); + } + + public ItemLookupApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Applies search criteria to an item and refreshes metadata. + * + * @param itemId Item id. (required) + * @param remoteSearchResult The remote search result. (required) + * @param replaceAllImages Optional. Whether or not to replace all images. Default: True. (optional, default to + * true) + * @throws ApiException if fails to make API call + */ + public void applySearchCriteria(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable RemoteSearchResult remoteSearchResult, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages) throws ApiException { + applySearchCriteriaWithHttpInfo(itemId, remoteSearchResult, replaceAllImages); + } + + /** + * Applies search criteria to an item and refreshes metadata. + * + * @param itemId Item id. (required) + * @param remoteSearchResult The remote search result. (required) + * @param replaceAllImages Optional. Whether or not to replace all images. Default: True. (optional, default to + * true) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse applySearchCriteriaWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable RemoteSearchResult remoteSearchResult, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = applySearchCriteriaRequestBuilder(itemId, remoteSearchResult, + replaceAllImages); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("applySearchCriteria", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder applySearchCriteriaRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable RemoteSearchResult remoteSearchResult, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling applySearchCriteria"); + } + // verify the required parameter 'remoteSearchResult' is set + if (remoteSearchResult == null) { + throw new ApiException(400, + "Missing the required parameter 'remoteSearchResult' when calling applySearchCriteria"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/Apply/{itemId}".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "replaceAllImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("replaceAllImages", replaceAllImages)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(remoteSearchResult); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get book remote search. + * + * @param bookInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getBookRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable BookInfoRemoteSearchQuery bookInfoRemoteSearchQuery) + throws ApiException { + ApiResponse> localVarResponse = getBookRemoteSearchResultsWithHttpInfo( + bookInfoRemoteSearchQuery); + return localVarResponse.getData(); + } + + /** + * Get book remote search. + * + * @param bookInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getBookRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable BookInfoRemoteSearchQuery bookInfoRemoteSearchQuery) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBookRemoteSearchResultsRequestBuilder( + bookInfoRemoteSearchQuery); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getBookRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getBookRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable BookInfoRemoteSearchQuery bookInfoRemoteSearchQuery) + throws ApiException { + // verify the required parameter 'bookInfoRemoteSearchQuery' is set + if (bookInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'bookInfoRemoteSearchQuery' when calling getBookRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/Book"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(bookInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get box set remote search. + * + * @param boxSetInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getBoxSetRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable BoxSetInfoRemoteSearchQuery boxSetInfoRemoteSearchQuery) + throws ApiException { + ApiResponse> localVarResponse = getBoxSetRemoteSearchResultsWithHttpInfo( + boxSetInfoRemoteSearchQuery); + return localVarResponse.getData(); + } + + /** + * Get box set remote search. + * + * @param boxSetInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getBoxSetRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable BoxSetInfoRemoteSearchQuery boxSetInfoRemoteSearchQuery) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBoxSetRemoteSearchResultsRequestBuilder( + boxSetInfoRemoteSearchQuery); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getBoxSetRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getBoxSetRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable BoxSetInfoRemoteSearchQuery boxSetInfoRemoteSearchQuery) + throws ApiException { + // verify the required parameter 'boxSetInfoRemoteSearchQuery' is set + if (boxSetInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'boxSetInfoRemoteSearchQuery' when calling getBoxSetRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/BoxSet"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(boxSetInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get the item's external id info. + * + * @param itemId Item id. (required) + * @return List<ExternalIdInfo> + * @throws ApiException if fails to make API call + */ + public List getExternalIdInfos(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + ApiResponse> localVarResponse = getExternalIdInfosWithHttpInfo(itemId); + return localVarResponse.getData(); + } + + /** + * Get the item's external id info. + * + * @param itemId Item id. (required) + * @return ApiResponse<List<ExternalIdInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getExternalIdInfosWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getExternalIdInfosRequestBuilder(itemId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getExternalIdInfos", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getExternalIdInfosRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getExternalIdInfos"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/ExternalIdInfos".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get movie remote search. + * + * @param movieInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getMovieRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable MovieInfoRemoteSearchQuery movieInfoRemoteSearchQuery) + throws ApiException { + ApiResponse> localVarResponse = getMovieRemoteSearchResultsWithHttpInfo( + movieInfoRemoteSearchQuery); + return localVarResponse.getData(); + } + + /** + * Get movie remote search. + * + * @param movieInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMovieRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MovieInfoRemoteSearchQuery movieInfoRemoteSearchQuery) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMovieRemoteSearchResultsRequestBuilder( + movieInfoRemoteSearchQuery); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMovieRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMovieRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable MovieInfoRemoteSearchQuery movieInfoRemoteSearchQuery) + throws ApiException { + // verify the required parameter 'movieInfoRemoteSearchQuery' is set + if (movieInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'movieInfoRemoteSearchQuery' when calling getMovieRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/Movie"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(movieInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get music album remote search. + * + * @param albumInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getMusicAlbumRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable AlbumInfoRemoteSearchQuery albumInfoRemoteSearchQuery) + throws ApiException { + ApiResponse> localVarResponse = getMusicAlbumRemoteSearchResultsWithHttpInfo( + albumInfoRemoteSearchQuery); + return localVarResponse.getData(); + } + + /** + * Get music album remote search. + * + * @param albumInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMusicAlbumRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable AlbumInfoRemoteSearchQuery albumInfoRemoteSearchQuery) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMusicAlbumRemoteSearchResultsRequestBuilder( + albumInfoRemoteSearchQuery); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMusicAlbumRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMusicAlbumRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable AlbumInfoRemoteSearchQuery albumInfoRemoteSearchQuery) + throws ApiException { + // verify the required parameter 'albumInfoRemoteSearchQuery' is set + if (albumInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'albumInfoRemoteSearchQuery' when calling getMusicAlbumRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/MusicAlbum"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(albumInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get music artist remote search. + * + * @param artistInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getMusicArtistRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable ArtistInfoRemoteSearchQuery artistInfoRemoteSearchQuery) + throws ApiException { + ApiResponse> localVarResponse = getMusicArtistRemoteSearchResultsWithHttpInfo( + artistInfoRemoteSearchQuery); + return localVarResponse.getData(); + } + + /** + * Get music artist remote search. + * + * @param artistInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMusicArtistRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ArtistInfoRemoteSearchQuery artistInfoRemoteSearchQuery) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMusicArtistRemoteSearchResultsRequestBuilder( + artistInfoRemoteSearchQuery); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMusicArtistRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMusicArtistRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable ArtistInfoRemoteSearchQuery artistInfoRemoteSearchQuery) + throws ApiException { + // verify the required parameter 'artistInfoRemoteSearchQuery' is set + if (artistInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'artistInfoRemoteSearchQuery' when calling getMusicArtistRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/MusicArtist"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(artistInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get music video remote search. + * + * @param musicVideoInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getMusicVideoRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable MusicVideoInfoRemoteSearchQuery musicVideoInfoRemoteSearchQuery) + throws ApiException { + ApiResponse> localVarResponse = getMusicVideoRemoteSearchResultsWithHttpInfo( + musicVideoInfoRemoteSearchQuery); + return localVarResponse.getData(); + } + + /** + * Get music video remote search. + * + * @param musicVideoInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMusicVideoRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MusicVideoInfoRemoteSearchQuery musicVideoInfoRemoteSearchQuery) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMusicVideoRemoteSearchResultsRequestBuilder( + musicVideoInfoRemoteSearchQuery); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMusicVideoRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMusicVideoRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable MusicVideoInfoRemoteSearchQuery musicVideoInfoRemoteSearchQuery) + throws ApiException { + // verify the required parameter 'musicVideoInfoRemoteSearchQuery' is set + if (musicVideoInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'musicVideoInfoRemoteSearchQuery' when calling getMusicVideoRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/MusicVideo"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(musicVideoInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get person remote search. + * + * @param personLookupInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getPersonRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable PersonLookupInfoRemoteSearchQuery personLookupInfoRemoteSearchQuery) + throws ApiException { + ApiResponse> localVarResponse = getPersonRemoteSearchResultsWithHttpInfo( + personLookupInfoRemoteSearchQuery); + return localVarResponse.getData(); + } + + /** + * Get person remote search. + * + * @param personLookupInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPersonRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable PersonLookupInfoRemoteSearchQuery personLookupInfoRemoteSearchQuery) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPersonRemoteSearchResultsRequestBuilder( + personLookupInfoRemoteSearchQuery); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPersonRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPersonRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable PersonLookupInfoRemoteSearchQuery personLookupInfoRemoteSearchQuery) + throws ApiException { + // verify the required parameter 'personLookupInfoRemoteSearchQuery' is set + if (personLookupInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'personLookupInfoRemoteSearchQuery' when calling getPersonRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/Person"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(personLookupInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get series remote search. + * + * @param seriesInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getSeriesRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable SeriesInfoRemoteSearchQuery seriesInfoRemoteSearchQuery) + throws ApiException { + ApiResponse> localVarResponse = getSeriesRemoteSearchResultsWithHttpInfo( + seriesInfoRemoteSearchQuery); + return localVarResponse.getData(); + } + + /** + * Get series remote search. + * + * @param seriesInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getSeriesRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SeriesInfoRemoteSearchQuery seriesInfoRemoteSearchQuery) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSeriesRemoteSearchResultsRequestBuilder( + seriesInfoRemoteSearchQuery); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSeriesRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSeriesRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable SeriesInfoRemoteSearchQuery seriesInfoRemoteSearchQuery) + throws ApiException { + // verify the required parameter 'seriesInfoRemoteSearchQuery' is set + if (seriesInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'seriesInfoRemoteSearchQuery' when calling getSeriesRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/Series"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(seriesInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get trailer remote search. + * + * @param trailerInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getTrailerRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable TrailerInfoRemoteSearchQuery trailerInfoRemoteSearchQuery) + throws ApiException { + ApiResponse> localVarResponse = getTrailerRemoteSearchResultsWithHttpInfo( + trailerInfoRemoteSearchQuery); + return localVarResponse.getData(); + } + + /** + * Get trailer remote search. + * + * @param trailerInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getTrailerRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable TrailerInfoRemoteSearchQuery trailerInfoRemoteSearchQuery) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTrailerRemoteSearchResultsRequestBuilder( + trailerInfoRemoteSearchQuery); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getTrailerRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getTrailerRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable TrailerInfoRemoteSearchQuery trailerInfoRemoteSearchQuery) + throws ApiException { + // verify the required parameter 'trailerInfoRemoteSearchQuery' is set + if (trailerInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'trailerInfoRemoteSearchQuery' when calling getTrailerRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/Trailer"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(trailerInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemRefreshApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemRefreshApi.java new file mode 100644 index 0000000000000..347f6de5b7353 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemRefreshApi.java @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MetadataRefreshMode; + +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ItemRefreshApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ItemRefreshApi() { + this(Configuration.getDefaultApiClient()); + } + + public ItemRefreshApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Refreshes metadata for an item. + * + * @param itemId Item id. (required) + * @param metadataRefreshMode (Optional) Specifies the metadata refresh mode. (optional, default to None) + * @param imageRefreshMode (Optional) Specifies the image refresh mode. (optional, default to None) + * @param replaceAllMetadata (Optional) Determines if metadata should be replaced. Only applicable if mode is + * FullRefresh. (optional, default to false) + * @param replaceAllImages (Optional) Determines if images should be replaced. Only applicable if mode is + * FullRefresh. (optional, default to false) + * @param regenerateTrickplay (Optional) Determines if trickplay images should be replaced. Only applicable if mode + * is FullRefresh. (optional, default to false) + * @throws ApiException if fails to make API call + */ + public void refreshItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode metadataRefreshMode, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode imageRefreshMode, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllMetadata, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, + @org.eclipse.jdt.annotation.NonNull Boolean regenerateTrickplay) throws ApiException { + refreshItemWithHttpInfo(itemId, metadataRefreshMode, imageRefreshMode, replaceAllMetadata, replaceAllImages, + regenerateTrickplay); + } + + /** + * Refreshes metadata for an item. + * + * @param itemId Item id. (required) + * @param metadataRefreshMode (Optional) Specifies the metadata refresh mode. (optional, default to None) + * @param imageRefreshMode (Optional) Specifies the image refresh mode. (optional, default to None) + * @param replaceAllMetadata (Optional) Determines if metadata should be replaced. Only applicable if mode is + * FullRefresh. (optional, default to false) + * @param replaceAllImages (Optional) Determines if images should be replaced. Only applicable if mode is + * FullRefresh. (optional, default to false) + * @param regenerateTrickplay (Optional) Determines if trickplay images should be replaced. Only applicable if mode + * is FullRefresh. (optional, default to false) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse refreshItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode metadataRefreshMode, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode imageRefreshMode, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllMetadata, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, + @org.eclipse.jdt.annotation.NonNull Boolean regenerateTrickplay) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = refreshItemRequestBuilder(itemId, metadataRefreshMode, + imageRefreshMode, replaceAllMetadata, replaceAllImages, regenerateTrickplay); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("refreshItem", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder refreshItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode metadataRefreshMode, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode imageRefreshMode, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllMetadata, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, + @org.eclipse.jdt.annotation.NonNull Boolean regenerateTrickplay) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling refreshItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Refresh".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "metadataRefreshMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("metadataRefreshMode", metadataRefreshMode)); + localVarQueryParameterBaseName = "imageRefreshMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageRefreshMode", imageRefreshMode)); + localVarQueryParameterBaseName = "replaceAllMetadata"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("replaceAllMetadata", replaceAllMetadata)); + localVarQueryParameterBaseName = "replaceAllImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("replaceAllImages", replaceAllImages)); + localVarQueryParameterBaseName = "regenerateTrickplay"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("regenerateTrickplay", regenerateTrickplay)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemUpdateApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemUpdateApi.java new file mode 100644 index 0000000000000..9df7d350a88b7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemUpdateApi.java @@ -0,0 +1,334 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MetadataEditorInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ItemUpdateApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ItemUpdateApi() { + this(Configuration.getDefaultApiClient()); + } + + public ItemUpdateApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets metadata editor info for an item. + * + * @param itemId The item id. (required) + * @return MetadataEditorInfo + * @throws ApiException if fails to make API call + */ + public MetadataEditorInfo getMetadataEditorInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + ApiResponse localVarResponse = getMetadataEditorInfoWithHttpInfo(itemId); + return localVarResponse.getData(); + } + + /** + * Gets metadata editor info for an item. + * + * @param itemId The item id. (required) + * @return ApiResponse<MetadataEditorInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMetadataEditorInfoWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMetadataEditorInfoRequestBuilder(itemId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMetadataEditorInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMetadataEditorInfoRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getMetadataEditorInfo"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/MetadataEditor".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates an item. + * + * @param itemId The item id. (required) + * @param baseItemDto The new item properties. (required) + * @throws ApiException if fails to make API call + */ + public void updateItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable BaseItemDto baseItemDto) throws ApiException { + updateItemWithHttpInfo(itemId, baseItemDto); + } + + /** + * Updates an item. + * + * @param itemId The item id. (required) + * @param baseItemDto The new item properties. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable BaseItemDto baseItemDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateItemRequestBuilder(itemId, baseItemDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateItem", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable BaseItemDto baseItemDto) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling updateItem"); + } + // verify the required parameter 'baseItemDto' is set + if (baseItemDto == null) { + throw new ApiException(400, "Missing the required parameter 'baseItemDto' when calling updateItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(baseItemDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates an item's content type. + * + * @param itemId The item id. (required) + * @param contentType The content type of the item. (optional) + * @throws ApiException if fails to make API call + */ + public void updateItemContentType(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String contentType) throws ApiException { + updateItemContentTypeWithHttpInfo(itemId, contentType); + } + + /** + * Updates an item's content type. + * + * @param itemId The item id. (required) + * @param contentType The content type of the item. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateItemContentTypeWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String contentType) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateItemContentTypeRequestBuilder(itemId, contentType); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateItemContentType", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateItemContentTypeRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String contentType) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling updateItemContentType"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/ContentType".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "contentType"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("contentType", contentType)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemsApi.java new file mode 100644 index 0000000000000..f93d08ecd6110 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemsApi.java @@ -0,0 +1,1259 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFilter; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemSortBy; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.LocationType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MediaType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SeriesStatus; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SortOrder; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UpdateUserItemDataDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UserItemDataDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.VideoType; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ItemsApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ItemsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ItemsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Get Item User Data. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto getItemUserData(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = getItemUserDataWithHttpInfo(itemId, userId); + return localVarResponse.getData(); + } + + /** + * Get Item User Data. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemUserDataWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemUserDataRequestBuilder(itemId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItemUserData", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemUserDataRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemUserData"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/UserItems/{itemId}/UserData".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets items based on a query. + * + * @param userId The user id supplied as query parameter; this is required when not using an API key. (optional) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param indexNumber Optional filter by index number. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an IMDb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a TMDb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a TVDb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending, Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getItems(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer indexNumber, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + ApiResponse localVarResponse = getItemsWithHttpInfo(userId, maxOfficialRating, + hasThemeSong, hasThemeVideo, hasSubtitles, hasSpecialFeature, hasTrailer, adjacentTo, indexNumber, + parentIndexNumber, hasParentalRating, isHd, is4K, locationTypes, excludeLocationTypes, isMissing, + isUnaired, minCommunityRating, minCriticRating, minPremiereDate, minDateLastSaved, + minDateLastSavedForUser, maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, hasTvdbId, isMovie, + isSeries, isNews, isKids, isSports, excludeItemIds, startIndex, limit, recursive, searchTerm, sortOrder, + parentId, fields, excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, imageTypes, + sortBy, isPlayed, genres, officialRatings, tags, years, enableUserData, imageTypeLimit, + enableImageTypes, person, personIds, personTypes, studios, artists, excludeArtistIds, artistIds, + albumArtistIds, contributingArtistIds, albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, + isPlaceHolder, hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, + seriesStatus, nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, + enableTotalRecordCount, enableImages); + return localVarResponse.getData(); + } + + /** + * Gets items based on a query. + * + * @param userId The user id supplied as query parameter; this is required when not using an API key. (optional) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param indexNumber Optional filter by index number. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an IMDb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a TMDb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a TVDb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending, Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer indexNumber, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemsRequestBuilder(userId, maxOfficialRating, hasThemeSong, + hasThemeVideo, hasSubtitles, hasSpecialFeature, hasTrailer, adjacentTo, indexNumber, parentIndexNumber, + hasParentalRating, isHd, is4K, locationTypes, excludeLocationTypes, isMissing, isUnaired, + minCommunityRating, minCriticRating, minPremiereDate, minDateLastSaved, minDateLastSavedForUser, + maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, hasTvdbId, isMovie, isSeries, isNews, isKids, + isSports, excludeItemIds, startIndex, limit, recursive, searchTerm, sortOrder, parentId, fields, + excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, imageTypes, sortBy, isPlayed, + genres, officialRatings, tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, + personIds, personTypes, studios, artists, excludeArtistIds, artistIds, albumArtistIds, + contributingArtistIds, albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, isPlaceHolder, + hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, seriesStatus, + nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, enableTotalRecordCount, + enableImages); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItems", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer indexNumber, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "maxOfficialRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxOfficialRating", maxOfficialRating)); + localVarQueryParameterBaseName = "hasThemeSong"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasThemeSong", hasThemeSong)); + localVarQueryParameterBaseName = "hasThemeVideo"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasThemeVideo", hasThemeVideo)); + localVarQueryParameterBaseName = "hasSubtitles"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasSubtitles", hasSubtitles)); + localVarQueryParameterBaseName = "hasSpecialFeature"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasSpecialFeature", hasSpecialFeature)); + localVarQueryParameterBaseName = "hasTrailer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasTrailer", hasTrailer)); + localVarQueryParameterBaseName = "adjacentTo"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("adjacentTo", adjacentTo)); + localVarQueryParameterBaseName = "indexNumber"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("indexNumber", indexNumber)); + localVarQueryParameterBaseName = "parentIndexNumber"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentIndexNumber", parentIndexNumber)); + localVarQueryParameterBaseName = "hasParentalRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasParentalRating", hasParentalRating)); + localVarQueryParameterBaseName = "isHd"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isHd", isHd)); + localVarQueryParameterBaseName = "is4K"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("is4K", is4K)); + localVarQueryParameterBaseName = "locationTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "locationTypes", locationTypes)); + localVarQueryParameterBaseName = "excludeLocationTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeLocationTypes", excludeLocationTypes)); + localVarQueryParameterBaseName = "isMissing"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMissing", isMissing)); + localVarQueryParameterBaseName = "isUnaired"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isUnaired", isUnaired)); + localVarQueryParameterBaseName = "minCommunityRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minCommunityRating", minCommunityRating)); + localVarQueryParameterBaseName = "minCriticRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minCriticRating", minCriticRating)); + localVarQueryParameterBaseName = "minPremiereDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minPremiereDate", minPremiereDate)); + localVarQueryParameterBaseName = "minDateLastSaved"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minDateLastSaved", minDateLastSaved)); + localVarQueryParameterBaseName = "minDateLastSavedForUser"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minDateLastSavedForUser", minDateLastSavedForUser)); + localVarQueryParameterBaseName = "maxPremiereDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxPremiereDate", maxPremiereDate)); + localVarQueryParameterBaseName = "hasOverview"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasOverview", hasOverview)); + localVarQueryParameterBaseName = "hasImdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasImdbId", hasImdbId)); + localVarQueryParameterBaseName = "hasTmdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasTmdbId", hasTmdbId)); + localVarQueryParameterBaseName = "hasTvdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasTvdbId", hasTvdbId)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "excludeItemIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemIds", excludeItemIds)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "recursive"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("recursive", recursive)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "filters"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "filters", filters)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + localVarQueryParameterBaseName = "imageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "imageTypes", imageTypes)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "isPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isPlayed", isPlayed)); + localVarQueryParameterBaseName = "genres"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genres", genres)); + localVarQueryParameterBaseName = "officialRatings"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "officialRatings", officialRatings)); + localVarQueryParameterBaseName = "tags"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "tags", tags)); + localVarQueryParameterBaseName = "years"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "years", years)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "person"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("person", person)); + localVarQueryParameterBaseName = "personIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personIds", personIds)); + localVarQueryParameterBaseName = "personTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personTypes", personTypes)); + localVarQueryParameterBaseName = "studios"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studios", studios)); + localVarQueryParameterBaseName = "artists"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "artists", artists)); + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "artistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "artistIds", artistIds)); + localVarQueryParameterBaseName = "albumArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "albumArtistIds", albumArtistIds)); + localVarQueryParameterBaseName = "contributingArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "contributingArtistIds", contributingArtistIds)); + localVarQueryParameterBaseName = "albums"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "albums", albums)); + localVarQueryParameterBaseName = "albumIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "albumIds", albumIds)); + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + localVarQueryParameterBaseName = "videoTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "videoTypes", videoTypes)); + localVarQueryParameterBaseName = "minOfficialRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minOfficialRating", minOfficialRating)); + localVarQueryParameterBaseName = "isLocked"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isLocked", isLocked)); + localVarQueryParameterBaseName = "isPlaceHolder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isPlaceHolder", isPlaceHolder)); + localVarQueryParameterBaseName = "hasOfficialRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasOfficialRating", hasOfficialRating)); + localVarQueryParameterBaseName = "collapseBoxSetItems"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("collapseBoxSetItems", collapseBoxSetItems)); + localVarQueryParameterBaseName = "minWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minWidth", minWidth)); + localVarQueryParameterBaseName = "minHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minHeight", minHeight)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "is3D"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("is3D", is3D)); + localVarQueryParameterBaseName = "seriesStatus"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "seriesStatus", seriesStatus)); + localVarQueryParameterBaseName = "nameStartsWithOrGreater"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWithOrGreater", nameStartsWithOrGreater)); + localVarQueryParameterBaseName = "nameStartsWith"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWith", nameStartsWith)); + localVarQueryParameterBaseName = "nameLessThan"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameLessThan", nameLessThan)); + localVarQueryParameterBaseName = "studioIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studioIds", studioIds)); + localVarQueryParameterBaseName = "genreIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genreIds", genreIds)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets items based on a query. + * + * @param userId The user id. (optional) + * @param startIndex The start index. (optional) + * @param limit The item limit. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional. Include image information in output. (optional, default to true) + * @param excludeActiveSessions Optional. Whether to exclude the currently active sessions. (optional, default to + * false) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getResumeItems(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean excludeActiveSessions) throws ApiException { + ApiResponse localVarResponse = getResumeItemsWithHttpInfo(userId, startIndex, limit, + searchTerm, parentId, fields, mediaTypes, enableUserData, imageTypeLimit, enableImageTypes, + excludeItemTypes, includeItemTypes, enableTotalRecordCount, enableImages, excludeActiveSessions); + return localVarResponse.getData(); + } + + /** + * Gets items based on a query. + * + * @param userId The user id. (optional) + * @param startIndex The start index. (optional) + * @param limit The item limit. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional. Include image information in output. (optional, default to true) + * @param excludeActiveSessions Optional. Whether to exclude the currently active sessions. (optional, default to + * false) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getResumeItemsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean excludeActiveSessions) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getResumeItemsRequestBuilder(userId, startIndex, limit, searchTerm, + parentId, fields, mediaTypes, enableUserData, imageTypeLimit, enableImageTypes, excludeItemTypes, + includeItemTypes, enableTotalRecordCount, enableImages, excludeActiveSessions); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getResumeItems", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getResumeItemsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean excludeActiveSessions) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/UserItems/Resume"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "excludeActiveSessions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("excludeActiveSessions", excludeActiveSessions)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update Item User Data. + * + * @param itemId The item id. (required) + * @param updateUserItemDataDto New user data object. (required) + * @param userId The user id. (optional) + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto updateItemUserData(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UpdateUserItemDataDto updateUserItemDataDto, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = updateItemUserDataWithHttpInfo(itemId, updateUserItemDataDto, + userId); + return localVarResponse.getData(); + } + + /** + * Update Item User Data. + * + * @param itemId The item id. (required) + * @param updateUserItemDataDto New user data object. (required) + * @param userId The user id. (optional) + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateItemUserDataWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UpdateUserItemDataDto updateUserItemDataDto, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateItemUserDataRequestBuilder(itemId, updateUserItemDataDto, + userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateItemUserData", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateItemUserDataRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UpdateUserItemDataDto updateUserItemDataDto, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling updateItemUserData"); + } + // verify the required parameter 'updateUserItemDataDto' is set + if (updateUserItemDataDto == null) { + throw new ApiException(400, + "Missing the required parameter 'updateUserItemDataDto' when calling updateItemUserData"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/UserItems/{itemId}/UserData".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(updateUserItemDataDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LibraryApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LibraryApi.java new file mode 100644 index 0000000000000..f168164b90a21 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LibraryApi.java @@ -0,0 +1,2573 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.AllThemeMediaResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.CollectionType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemCounts; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemSortBy; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.LibraryOptionsResultDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MediaUpdateInfoDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SortOrder; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ThemeMediaResult; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LibraryApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public LibraryApi() { + this(Configuration.getDefaultApiClient()); + } + + public LibraryApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Deletes an item from the library and filesystem. + * + * @param itemId The item id. (required) + * @throws ApiException if fails to make API call + */ + public void deleteItem(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + deleteItemWithHttpInfo(itemId); + } + + /** + * Deletes an item from the library and filesystem. + * + * @param itemId The item id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteItemRequestBuilder(itemId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteItem", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Deletes items from the library and filesystem. + * + * @param ids The item ids. (optional) + * @throws ApiException if fails to make API call + */ + public void deleteItems(@org.eclipse.jdt.annotation.NonNull List ids) throws ApiException { + deleteItemsWithHttpInfo(ids); + } + + /** + * Deletes items from the library and filesystem. + * + * @param ids The item ids. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteItemsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull List ids) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteItemsRequestBuilder(ids); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteItems", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteItemsRequestBuilder(@org.eclipse.jdt.annotation.NonNull List ids) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all parents of an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return List<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public List getAncestors(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse> localVarResponse = getAncestorsWithHttpInfo(itemId, userId); + return localVarResponse.getData(); + } + + /** + * Gets all parents of an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return ApiResponse<List<BaseItemDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getAncestorsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAncestorsRequestBuilder(itemId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getAncestors", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAncestorsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getAncestors"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Ancestors".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets critic review for an item. + * + * @param itemId (required) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getCriticReviews(@org.eclipse.jdt.annotation.Nullable String itemId) + throws ApiException { + ApiResponse localVarResponse = getCriticReviewsWithHttpInfo(itemId); + return localVarResponse.getData(); + } + + /** + * Gets critic review for an item. + * + * @param itemId (required) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getCriticReviewsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String itemId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getCriticReviewsRequestBuilder(itemId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getCriticReviews", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getCriticReviewsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String itemId) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getCriticReviews"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/CriticReviews".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Downloads item media. + * + * @param itemId The item id. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getDownload(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + ApiResponse localVarResponse = getDownloadWithHttpInfo(itemId); + return localVarResponse.getData(); + } + + /** + * Downloads item media. + * + * @param itemId The item id. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDownloadWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDownloadRequestBuilder(itemId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDownload", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDownloadRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getDownload"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Download".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "video/*, audio/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get the original file of an item. + * + * @param itemId The item id. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getFile(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + ApiResponse localVarResponse = getFileWithHttpInfo(itemId); + return localVarResponse.getData(); + } + + /** + * Get the original file of an item. + * + * @param itemId The item id. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFileRequestBuilder(itemId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getFile", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getFileRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getFile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/File".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "video/*, audio/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get item counts. + * + * @param userId Optional. Get counts from a specific user's library. (optional) + * @param isFavorite Optional. Get counts of favorite items. (optional) + * @return ItemCounts + * @throws ApiException if fails to make API call + */ + public ItemCounts getItemCounts(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite) throws ApiException { + ApiResponse localVarResponse = getItemCountsWithHttpInfo(userId, isFavorite); + return localVarResponse.getData(); + } + + /** + * Get item counts. + * + * @param userId Optional. Get counts from a specific user's library. (optional) + * @param isFavorite Optional. Get counts of favorite items. (optional) + * @return ApiResponse<ItemCounts> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemCountsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemCountsRequestBuilder(userId, isFavorite); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItemCounts", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemCountsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/Counts"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the library options info. + * + * @param libraryContentType Library content type. (optional) + * @param isNewLibrary Whether this is a new library. (optional, default to false) + * @return LibraryOptionsResultDto + * @throws ApiException if fails to make API call + */ + public LibraryOptionsResultDto getLibraryOptionsInfo( + @org.eclipse.jdt.annotation.NonNull CollectionType libraryContentType, + @org.eclipse.jdt.annotation.NonNull Boolean isNewLibrary) throws ApiException { + ApiResponse localVarResponse = getLibraryOptionsInfoWithHttpInfo(libraryContentType, + isNewLibrary); + return localVarResponse.getData(); + } + + /** + * Gets the library options info. + * + * @param libraryContentType Library content type. (optional) + * @param isNewLibrary Whether this is a new library. (optional, default to false) + * @return ApiResponse<LibraryOptionsResultDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLibraryOptionsInfoWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull CollectionType libraryContentType, + @org.eclipse.jdt.annotation.NonNull Boolean isNewLibrary) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLibraryOptionsInfoRequestBuilder(libraryContentType, + isNewLibrary); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLibraryOptionsInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLibraryOptionsInfoRequestBuilder( + @org.eclipse.jdt.annotation.NonNull CollectionType libraryContentType, + @org.eclipse.jdt.annotation.NonNull Boolean isNewLibrary) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Libraries/AvailableOptions"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "libraryContentType"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("libraryContentType", libraryContentType)); + localVarQueryParameterBaseName = "isNewLibrary"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNewLibrary", isNewLibrary)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all user media folders. + * + * @param isHidden Optional. Filter by folders that are marked hidden, or not. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getMediaFolders(@org.eclipse.jdt.annotation.NonNull Boolean isHidden) + throws ApiException { + ApiResponse localVarResponse = getMediaFoldersWithHttpInfo(isHidden); + return localVarResponse.getData(); + } + + /** + * Gets all user media folders. + * + * @param isHidden Optional. Filter by folders that are marked hidden, or not. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMediaFoldersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean isHidden) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMediaFoldersRequestBuilder(isHidden); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMediaFolders", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMediaFoldersRequestBuilder(@org.eclipse.jdt.annotation.NonNull Boolean isHidden) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/MediaFolders"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "isHidden"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isHidden", isHidden)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of physical paths from virtual folders. + * + * @return List<String> + * @throws ApiException if fails to make API call + */ + public List getPhysicalPaths() throws ApiException { + ApiResponse> localVarResponse = getPhysicalPathsWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets a list of physical paths from virtual folders. + * + * @return ApiResponse<List<String>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPhysicalPathsWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPhysicalPathsRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPhysicalPaths", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPhysicalPathsRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/PhysicalPaths"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarAlbums(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + ApiResponse localVarResponse = getSimilarAlbumsWithHttpInfo(itemId, excludeArtistIds, + userId, limit, fields); + return localVarResponse.getData(); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarAlbumsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSimilarAlbumsRequestBuilder(itemId, excludeArtistIds, userId, + limit, fields); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSimilarAlbums", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSimilarAlbumsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarAlbums"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Albums/{itemId}/Similar".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarArtists(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + ApiResponse localVarResponse = getSimilarArtistsWithHttpInfo(itemId, excludeArtistIds, + userId, limit, fields); + return localVarResponse.getData(); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarArtistsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSimilarArtistsRequestBuilder(itemId, excludeArtistIds, userId, + limit, fields); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSimilarArtists", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSimilarArtistsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarArtists"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Artists/{itemId}/Similar".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarItems(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + ApiResponse localVarResponse = getSimilarItemsWithHttpInfo(itemId, excludeArtistIds, + userId, limit, fields); + return localVarResponse.getData(); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarItemsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSimilarItemsRequestBuilder(itemId, excludeArtistIds, userId, + limit, fields); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSimilarItems", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSimilarItemsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarItems"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Similar".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarMovies(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + ApiResponse localVarResponse = getSimilarMoviesWithHttpInfo(itemId, excludeArtistIds, + userId, limit, fields); + return localVarResponse.getData(); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarMoviesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSimilarMoviesRequestBuilder(itemId, excludeArtistIds, userId, + limit, fields); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSimilarMovies", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSimilarMoviesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarMovies"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Movies/{itemId}/Similar".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarShows(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + ApiResponse localVarResponse = getSimilarShowsWithHttpInfo(itemId, excludeArtistIds, + userId, limit, fields); + return localVarResponse.getData(); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarShowsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSimilarShowsRequestBuilder(itemId, excludeArtistIds, userId, + limit, fields); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSimilarShows", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSimilarShowsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarShows"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Shows/{itemId}/Similar".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarTrailers(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + ApiResponse localVarResponse = getSimilarTrailersWithHttpInfo(itemId, excludeArtistIds, + userId, limit, fields); + return localVarResponse.getData(); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarTrailersWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSimilarTrailersRequestBuilder(itemId, excludeArtistIds, userId, + limit, fields); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSimilarTrailers", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSimilarTrailersRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarTrailers"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Trailers/{itemId}/Similar".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get theme songs and videos for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param sortOrder Optional. Sort Order - Ascending, Descending. (optional) + * @return AllThemeMediaResult + * @throws ApiException if fails to make API call + */ + public AllThemeMediaResult getThemeMedia(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + ApiResponse localVarResponse = getThemeMediaWithHttpInfo(itemId, userId, inheritFromParent, + sortBy, sortOrder); + return localVarResponse.getData(); + } + + /** + * Get theme songs and videos for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param sortOrder Optional. Sort Order - Ascending, Descending. (optional) + * @return ApiResponse<AllThemeMediaResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getThemeMediaWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getThemeMediaRequestBuilder(itemId, userId, inheritFromParent, + sortBy, sortOrder); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getThemeMedia", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getThemeMediaRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getThemeMedia"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/ThemeMedia".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "inheritFromParent"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("inheritFromParent", inheritFromParent)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get theme songs for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param sortOrder Optional. Sort Order - Ascending, Descending. (optional) + * @return ThemeMediaResult + * @throws ApiException if fails to make API call + */ + public ThemeMediaResult getThemeSongs(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + ApiResponse localVarResponse = getThemeSongsWithHttpInfo(itemId, userId, inheritFromParent, + sortBy, sortOrder); + return localVarResponse.getData(); + } + + /** + * Get theme songs for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param sortOrder Optional. Sort Order - Ascending, Descending. (optional) + * @return ApiResponse<ThemeMediaResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getThemeSongsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getThemeSongsRequestBuilder(itemId, userId, inheritFromParent, + sortBy, sortOrder); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getThemeSongs", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getThemeSongsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getThemeSongs"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/ThemeSongs".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "inheritFromParent"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("inheritFromParent", inheritFromParent)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get theme videos for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param sortOrder Optional. Sort Order - Ascending, Descending. (optional) + * @return ThemeMediaResult + * @throws ApiException if fails to make API call + */ + public ThemeMediaResult getThemeVideos(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + ApiResponse localVarResponse = getThemeVideosWithHttpInfo(itemId, userId, inheritFromParent, + sortBy, sortOrder); + return localVarResponse.getData(); + } + + /** + * Get theme videos for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param sortOrder Optional. Sort Order - Ascending, Descending. (optional) + * @return ApiResponse<ThemeMediaResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getThemeVideosWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getThemeVideosRequestBuilder(itemId, userId, inheritFromParent, + sortBy, sortOrder); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getThemeVideos", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getThemeVideosRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getThemeVideos"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/ThemeVideos".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "inheritFromParent"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("inheritFromParent", inheritFromParent)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that new movies have been added by an external source. + * + * @param tmdbId The tmdbId. (optional) + * @param imdbId The imdbId. (optional) + * @throws ApiException if fails to make API call + */ + public void postAddedMovies(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId) throws ApiException { + postAddedMoviesWithHttpInfo(tmdbId, imdbId); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param tmdbId The tmdbId. (optional) + * @param imdbId The imdbId. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postAddedMoviesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postAddedMoviesRequestBuilder(tmdbId, imdbId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postAddedMovies", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postAddedMoviesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/Movies/Added"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tmdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tmdbId", tmdbId)); + localVarQueryParameterBaseName = "imdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imdbId", imdbId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that new episodes of a series have been added by an external source. + * + * @param tvdbId The tvdbId. (optional) + * @throws ApiException if fails to make API call + */ + public void postAddedSeries(@org.eclipse.jdt.annotation.NonNull String tvdbId) throws ApiException { + postAddedSeriesWithHttpInfo(tvdbId); + } + + /** + * Reports that new episodes of a series have been added by an external source. + * + * @param tvdbId The tvdbId. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postAddedSeriesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tvdbId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postAddedSeriesRequestBuilder(tvdbId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postAddedSeries", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postAddedSeriesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String tvdbId) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/Series/Added"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tvdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tvdbId", tvdbId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that new movies have been added by an external source. + * + * @param mediaUpdateInfoDto The update paths. (required) + * @throws ApiException if fails to make API call + */ + public void postUpdatedMedia(@org.eclipse.jdt.annotation.Nullable MediaUpdateInfoDto mediaUpdateInfoDto) + throws ApiException { + postUpdatedMediaWithHttpInfo(mediaUpdateInfoDto); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param mediaUpdateInfoDto The update paths. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUpdatedMediaWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MediaUpdateInfoDto mediaUpdateInfoDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postUpdatedMediaRequestBuilder(mediaUpdateInfoDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postUpdatedMedia", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postUpdatedMediaRequestBuilder( + @org.eclipse.jdt.annotation.Nullable MediaUpdateInfoDto mediaUpdateInfoDto) throws ApiException { + // verify the required parameter 'mediaUpdateInfoDto' is set + if (mediaUpdateInfoDto == null) { + throw new ApiException(400, + "Missing the required parameter 'mediaUpdateInfoDto' when calling postUpdatedMedia"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/Media/Updated"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(mediaUpdateInfoDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that new movies have been added by an external source. + * + * @param tmdbId The tmdbId. (optional) + * @param imdbId The imdbId. (optional) + * @throws ApiException if fails to make API call + */ + public void postUpdatedMovies(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId) throws ApiException { + postUpdatedMoviesWithHttpInfo(tmdbId, imdbId); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param tmdbId The tmdbId. (optional) + * @param imdbId The imdbId. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUpdatedMoviesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postUpdatedMoviesRequestBuilder(tmdbId, imdbId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postUpdatedMovies", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postUpdatedMoviesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/Movies/Updated"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tmdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tmdbId", tmdbId)); + localVarQueryParameterBaseName = "imdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imdbId", imdbId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that new episodes of a series have been added by an external source. + * + * @param tvdbId The tvdbId. (optional) + * @throws ApiException if fails to make API call + */ + public void postUpdatedSeries(@org.eclipse.jdt.annotation.NonNull String tvdbId) throws ApiException { + postUpdatedSeriesWithHttpInfo(tvdbId); + } + + /** + * Reports that new episodes of a series have been added by an external source. + * + * @param tvdbId The tvdbId. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUpdatedSeriesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tvdbId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postUpdatedSeriesRequestBuilder(tvdbId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postUpdatedSeries", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postUpdatedSeriesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String tvdbId) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/Series/Updated"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tvdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tvdbId", tvdbId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Starts a library scan. + * + * @throws ApiException if fails to make API call + */ + public void refreshLibrary() throws ApiException { + refreshLibraryWithHttpInfo(); + } + + /** + * Starts a library scan. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse refreshLibraryWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = refreshLibraryRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("refreshLibrary", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder refreshLibraryRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/Refresh"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LibraryStructureApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LibraryStructureApi.java new file mode 100644 index 0000000000000..34ff9732f3222 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LibraryStructureApi.java @@ -0,0 +1,794 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.AddVirtualFolderDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.CollectionTypeOptions; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MediaPathDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UpdateLibraryOptionsDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UpdateMediaPathRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.VirtualFolderInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LibraryStructureApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public LibraryStructureApi() { + this(Configuration.getDefaultApiClient()); + } + + public LibraryStructureApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Add a media path to a library. + * + * @param mediaPathDto The media path dto. (required) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @throws ApiException if fails to make API call + */ + public void addMediaPath(@org.eclipse.jdt.annotation.Nullable MediaPathDto mediaPathDto, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + addMediaPathWithHttpInfo(mediaPathDto, refreshLibrary); + } + + /** + * Add a media path to a library. + * + * @param mediaPathDto The media path dto. (required) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addMediaPathWithHttpInfo(@org.eclipse.jdt.annotation.Nullable MediaPathDto mediaPathDto, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addMediaPathRequestBuilder(mediaPathDto, refreshLibrary); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("addMediaPath", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder addMediaPathRequestBuilder( + @org.eclipse.jdt.annotation.Nullable MediaPathDto mediaPathDto, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + // verify the required parameter 'mediaPathDto' is set + if (mediaPathDto == null) { + throw new ApiException(400, "Missing the required parameter 'mediaPathDto' when calling addMediaPath"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/VirtualFolders/Paths"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "refreshLibrary"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("refreshLibrary", refreshLibrary)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(mediaPathDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Adds a virtual folder. + * + * @param name The name of the virtual folder. (optional) + * @param collectionType The type of the collection. (optional) + * @param paths The paths of the virtual folder. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param addVirtualFolderDto The library options. (optional) + * @throws ApiException if fails to make API call + */ + public void addVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull CollectionTypeOptions collectionType, + @org.eclipse.jdt.annotation.NonNull List paths, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, + @org.eclipse.jdt.annotation.NonNull AddVirtualFolderDto addVirtualFolderDto) throws ApiException { + addVirtualFolderWithHttpInfo(name, collectionType, paths, refreshLibrary, addVirtualFolderDto); + } + + /** + * Adds a virtual folder. + * + * @param name The name of the virtual folder. (optional) + * @param collectionType The type of the collection. (optional) + * @param paths The paths of the virtual folder. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param addVirtualFolderDto The library options. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addVirtualFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull CollectionTypeOptions collectionType, + @org.eclipse.jdt.annotation.NonNull List paths, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, + @org.eclipse.jdt.annotation.NonNull AddVirtualFolderDto addVirtualFolderDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addVirtualFolderRequestBuilder(name, collectionType, paths, + refreshLibrary, addVirtualFolderDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("addVirtualFolder", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder addVirtualFolderRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull CollectionTypeOptions collectionType, + @org.eclipse.jdt.annotation.NonNull List paths, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, + @org.eclipse.jdt.annotation.NonNull AddVirtualFolderDto addVirtualFolderDto) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/VirtualFolders"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + localVarQueryParameterBaseName = "collectionType"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("collectionType", collectionType)); + localVarQueryParameterBaseName = "paths"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "paths", paths)); + localVarQueryParameterBaseName = "refreshLibrary"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("refreshLibrary", refreshLibrary)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(addVirtualFolderDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all virtual folders. + * + * @return List<VirtualFolderInfo> + * @throws ApiException if fails to make API call + */ + public List getVirtualFolders() throws ApiException { + ApiResponse> localVarResponse = getVirtualFoldersWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets all virtual folders. + * + * @return ApiResponse<List<VirtualFolderInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getVirtualFoldersWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getVirtualFoldersRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getVirtualFolders", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getVirtualFoldersRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/VirtualFolders"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Remove a media path. + * + * @param name The name of the library. (optional) + * @param path The path to remove. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @throws ApiException if fails to make API call + */ + public void removeMediaPath(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String path, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) + throws ApiException { + removeMediaPathWithHttpInfo(name, path, refreshLibrary); + } + + /** + * Remove a media path. + * + * @param name The name of the library. (optional) + * @param path The path to remove. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeMediaPathWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String path, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeMediaPathRequestBuilder(name, path, refreshLibrary); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("removeMediaPath", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder removeMediaPathRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String path, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/VirtualFolders/Paths"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + localVarQueryParameterBaseName = "path"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("path", path)); + localVarQueryParameterBaseName = "refreshLibrary"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("refreshLibrary", refreshLibrary)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Removes a virtual folder. + * + * @param name The name of the folder. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @throws ApiException if fails to make API call + */ + public void removeVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + removeVirtualFolderWithHttpInfo(name, refreshLibrary); + } + + /** + * Removes a virtual folder. + * + * @param name The name of the folder. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeVirtualFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeVirtualFolderRequestBuilder(name, refreshLibrary); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("removeVirtualFolder", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder removeVirtualFolderRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/VirtualFolders"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + localVarQueryParameterBaseName = "refreshLibrary"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("refreshLibrary", refreshLibrary)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Renames a virtual folder. + * + * @param name The name of the virtual folder. (optional) + * @param newName The new name. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @throws ApiException if fails to make API call + */ + public void renameVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String newName, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + renameVirtualFolderWithHttpInfo(name, newName, refreshLibrary); + } + + /** + * Renames a virtual folder. + * + * @param name The name of the virtual folder. (optional) + * @param newName The new name. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse renameVirtualFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String newName, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = renameVirtualFolderRequestBuilder(name, newName, refreshLibrary); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("renameVirtualFolder", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder renameVirtualFolderRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String newName, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/VirtualFolders/Name"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + localVarQueryParameterBaseName = "newName"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("newName", newName)); + localVarQueryParameterBaseName = "refreshLibrary"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("refreshLibrary", refreshLibrary)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update library options. + * + * @param updateLibraryOptionsDto The library name and options. (optional) + * @throws ApiException if fails to make API call + */ + public void updateLibraryOptions( + @org.eclipse.jdt.annotation.NonNull UpdateLibraryOptionsDto updateLibraryOptionsDto) throws ApiException { + updateLibraryOptionsWithHttpInfo(updateLibraryOptionsDto); + } + + /** + * Update library options. + * + * @param updateLibraryOptionsDto The library name and options. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateLibraryOptionsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UpdateLibraryOptionsDto updateLibraryOptionsDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateLibraryOptionsRequestBuilder(updateLibraryOptionsDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateLibraryOptions", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateLibraryOptionsRequestBuilder( + @org.eclipse.jdt.annotation.NonNull UpdateLibraryOptionsDto updateLibraryOptionsDto) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/VirtualFolders/LibraryOptions"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(updateLibraryOptionsDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a media path. + * + * @param updateMediaPathRequestDto The name of the library and path infos. (required) + * @throws ApiException if fails to make API call + */ + public void updateMediaPath( + @org.eclipse.jdt.annotation.Nullable UpdateMediaPathRequestDto updateMediaPathRequestDto) + throws ApiException { + updateMediaPathWithHttpInfo(updateMediaPathRequestDto); + } + + /** + * Updates a media path. + * + * @param updateMediaPathRequestDto The name of the library and path infos. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateMediaPathWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UpdateMediaPathRequestDto updateMediaPathRequestDto) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateMediaPathRequestBuilder(updateMediaPathRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateMediaPath", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateMediaPathRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UpdateMediaPathRequestDto updateMediaPathRequestDto) + throws ApiException { + // verify the required parameter 'updateMediaPathRequestDto' is set + if (updateMediaPathRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'updateMediaPathRequestDto' when calling updateMediaPath"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/VirtualFolders/Paths/Update"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(updateMediaPathRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LiveTvApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LiveTvApi.java new file mode 100644 index 0000000000000..e5c5e3a35f21a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LiveTvApi.java @@ -0,0 +1,4272 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ChannelMappingOptionsDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ChannelType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.GetProgramsDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.GuideInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemSortBy; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ListingsProviderInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.LiveTvInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.NameIdPair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.RecordingStatus; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SeriesTimerInfoDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SeriesTimerInfoDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SetChannelMappingDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SortOrder; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.TimerInfoDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.TimerInfoDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.TunerChannelMapping; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.TunerHostInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LiveTvApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public LiveTvApi() { + this(Configuration.getDefaultApiClient()); + } + + public LiveTvApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Adds a listings provider. + * + * @param pw Password. (optional) + * @param validateListings Validate listings. (optional, default to false) + * @param validateLogin Validate login. (optional, default to false) + * @param listingsProviderInfo New listings info. (optional) + * @return ListingsProviderInfo + * @throws ApiException if fails to make API call + */ + public ListingsProviderInfo addListingProvider(@org.eclipse.jdt.annotation.NonNull String pw, + @org.eclipse.jdt.annotation.NonNull Boolean validateListings, + @org.eclipse.jdt.annotation.NonNull Boolean validateLogin, + @org.eclipse.jdt.annotation.NonNull ListingsProviderInfo listingsProviderInfo) throws ApiException { + ApiResponse localVarResponse = addListingProviderWithHttpInfo(pw, validateListings, + validateLogin, listingsProviderInfo); + return localVarResponse.getData(); + } + + /** + * Adds a listings provider. + * + * @param pw Password. (optional) + * @param validateListings Validate listings. (optional, default to false) + * @param validateLogin Validate login. (optional, default to false) + * @param listingsProviderInfo New listings info. (optional) + * @return ApiResponse<ListingsProviderInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse addListingProviderWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String pw, @org.eclipse.jdt.annotation.NonNull Boolean validateListings, + @org.eclipse.jdt.annotation.NonNull Boolean validateLogin, + @org.eclipse.jdt.annotation.NonNull ListingsProviderInfo listingsProviderInfo) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addListingProviderRequestBuilder(pw, validateListings, + validateLogin, listingsProviderInfo); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("addListingProvider", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder addListingProviderRequestBuilder(@org.eclipse.jdt.annotation.NonNull String pw, + @org.eclipse.jdt.annotation.NonNull Boolean validateListings, + @org.eclipse.jdt.annotation.NonNull Boolean validateLogin, + @org.eclipse.jdt.annotation.NonNull ListingsProviderInfo listingsProviderInfo) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/ListingProviders"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "pw"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("pw", pw)); + localVarQueryParameterBaseName = "validateListings"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("validateListings", validateListings)); + localVarQueryParameterBaseName = "validateLogin"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("validateLogin", validateLogin)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(listingsProviderInfo); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Adds a tuner host. + * + * @param tunerHostInfo New tuner host. (optional) + * @return TunerHostInfo + * @throws ApiException if fails to make API call + */ + public TunerHostInfo addTunerHost(@org.eclipse.jdt.annotation.NonNull TunerHostInfo tunerHostInfo) + throws ApiException { + ApiResponse localVarResponse = addTunerHostWithHttpInfo(tunerHostInfo); + return localVarResponse.getData(); + } + + /** + * Adds a tuner host. + * + * @param tunerHostInfo New tuner host. (optional) + * @return ApiResponse<TunerHostInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse addTunerHostWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull TunerHostInfo tunerHostInfo) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addTunerHostRequestBuilder(tunerHostInfo); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("addTunerHost", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder addTunerHostRequestBuilder( + @org.eclipse.jdt.annotation.NonNull TunerHostInfo tunerHostInfo) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/TunerHosts"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(tunerHostInfo); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Cancels a live tv series timer. + * + * @param timerId Timer id. (required) + * @throws ApiException if fails to make API call + */ + public void cancelSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { + cancelSeriesTimerWithHttpInfo(timerId); + } + + /** + * Cancels a live tv series timer. + * + * @param timerId Timer id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse cancelSeriesTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = cancelSeriesTimerRequestBuilder(timerId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("cancelSeriesTimer", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder cancelSeriesTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId) + throws ApiException { + // verify the required parameter 'timerId' is set + if (timerId == null) { + throw new ApiException(400, "Missing the required parameter 'timerId' when calling cancelSeriesTimer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/SeriesTimers/{timerId}".replace("{timerId}", + ApiClient.urlEncode(timerId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Cancels a live tv timer. + * + * @param timerId Timer id. (required) + * @throws ApiException if fails to make API call + */ + public void cancelTimer(@org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { + cancelTimerWithHttpInfo(timerId); + } + + /** + * Cancels a live tv timer. + * + * @param timerId Timer id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse cancelTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = cancelTimerRequestBuilder(timerId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("cancelTimer", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder cancelTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId) + throws ApiException { + // verify the required parameter 'timerId' is set + if (timerId == null) { + throw new ApiException(400, "Missing the required parameter 'timerId' when calling cancelTimer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Timers/{timerId}".replace("{timerId}", ApiClient.urlEncode(timerId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates a live tv series timer. + * + * @param seriesTimerInfoDto New series timer info. (optional) + * @throws ApiException if fails to make API call + */ + public void createSeriesTimer(@org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto) + throws ApiException { + createSeriesTimerWithHttpInfo(seriesTimerInfoDto); + } + + /** + * Creates a live tv series timer. + * + * @param seriesTimerInfoDto New series timer info. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createSeriesTimerWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createSeriesTimerRequestBuilder(seriesTimerInfoDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createSeriesTimer", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createSeriesTimerRequestBuilder( + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/SeriesTimers"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(seriesTimerInfoDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates a live tv timer. + * + * @param timerInfoDto New timer info. (optional) + * @throws ApiException if fails to make API call + */ + public void createTimer(@org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto) throws ApiException { + createTimerWithHttpInfo(timerInfoDto); + } + + /** + * Creates a live tv timer. + * + * @param timerInfoDto New timer info. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createTimerWithHttpInfo(@org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createTimerRequestBuilder(timerInfoDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createTimer", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createTimerRequestBuilder(@org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Timers"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(timerInfoDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete listing provider. + * + * @param id Listing provider id. (optional) + * @throws ApiException if fails to make API call + */ + public void deleteListingProvider(@org.eclipse.jdt.annotation.NonNull String id) throws ApiException { + deleteListingProviderWithHttpInfo(id); + } + + /** + * Delete listing provider. + * + * @param id Listing provider id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteListingProviderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteListingProviderRequestBuilder(id); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteListingProvider", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteListingProviderRequestBuilder(@org.eclipse.jdt.annotation.NonNull String id) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/ListingProviders"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Deletes a live tv recording. + * + * @param recordingId Recording id. (required) + * @throws ApiException if fails to make API call + */ + public void deleteRecording(@org.eclipse.jdt.annotation.Nullable UUID recordingId) throws ApiException { + deleteRecordingWithHttpInfo(recordingId); + } + + /** + * Deletes a live tv recording. + * + * @param recordingId Recording id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteRecordingWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID recordingId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteRecordingRequestBuilder(recordingId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteRecording", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteRecordingRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID recordingId) + throws ApiException { + // verify the required parameter 'recordingId' is set + if (recordingId == null) { + throw new ApiException(400, "Missing the required parameter 'recordingId' when calling deleteRecording"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Recordings/{recordingId}".replace("{recordingId}", + ApiClient.urlEncode(recordingId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Deletes a tuner host. + * + * @param id Tuner host id. (optional) + * @throws ApiException if fails to make API call + */ + public void deleteTunerHost(@org.eclipse.jdt.annotation.NonNull String id) throws ApiException { + deleteTunerHostWithHttpInfo(id); + } + + /** + * Deletes a tuner host. + * + * @param id Tuner host id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteTunerHostWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteTunerHostRequestBuilder(id); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteTunerHost", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteTunerHostRequestBuilder(@org.eclipse.jdt.annotation.NonNull String id) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/TunerHosts"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Discover tuners. + * + * @param newDevicesOnly Only discover new tuners. (optional, default to false) + * @return List<TunerHostInfo> + * @throws ApiException if fails to make API call + */ + public List discoverTuners(@org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly) + throws ApiException { + ApiResponse> localVarResponse = discoverTunersWithHttpInfo(newDevicesOnly); + return localVarResponse.getData(); + } + + /** + * Discover tuners. + * + * @param newDevicesOnly Only discover new tuners. (optional, default to false) + * @return ApiResponse<List<TunerHostInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> discoverTunersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = discoverTunersRequestBuilder(newDevicesOnly); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("discoverTuners", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder discoverTunersRequestBuilder(@org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Tuners/Discover"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "newDevicesOnly"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("newDevicesOnly", newDevicesOnly)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Discover tuners. + * + * @param newDevicesOnly Only discover new tuners. (optional, default to false) + * @return List<TunerHostInfo> + * @throws ApiException if fails to make API call + */ + public List discvoverTuners(@org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly) + throws ApiException { + ApiResponse> localVarResponse = discvoverTunersWithHttpInfo(newDevicesOnly); + return localVarResponse.getData(); + } + + /** + * Discover tuners. + * + * @param newDevicesOnly Only discover new tuners. (optional, default to false) + * @return ApiResponse<List<TunerHostInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> discvoverTunersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = discvoverTunersRequestBuilder(newDevicesOnly); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("discvoverTuners", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder discvoverTunersRequestBuilder( + @org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Tuners/Discvover"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "newDevicesOnly"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("newDevicesOnly", newDevicesOnly)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a live tv channel. + * + * @param channelId Channel id. (required) + * @param userId Optional. Attach user data. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getChannel(@org.eclipse.jdt.annotation.Nullable UUID channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = getChannelWithHttpInfo(channelId, userId); + return localVarResponse.getData(); + } + + /** + * Gets a live tv channel. + * + * @param channelId Channel id. (required) + * @param userId Optional. Attach user data. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getChannelRequestBuilder(channelId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getChannel", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getChannelRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'channelId' is set + if (channelId == null) { + throw new ApiException(400, "Missing the required parameter 'channelId' when calling getChannel"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Channels/{channelId}".replace("{channelId}", + ApiClient.urlEncode(channelId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get channel mapping options. + * + * @param providerId Provider id. (optional) + * @return ChannelMappingOptionsDto + * @throws ApiException if fails to make API call + */ + public ChannelMappingOptionsDto getChannelMappingOptions(@org.eclipse.jdt.annotation.NonNull String providerId) + throws ApiException { + ApiResponse localVarResponse = getChannelMappingOptionsWithHttpInfo(providerId); + return localVarResponse.getData(); + } + + /** + * Get channel mapping options. + * + * @param providerId Provider id. (optional) + * @return ApiResponse<ChannelMappingOptionsDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelMappingOptionsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String providerId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getChannelMappingOptionsRequestBuilder(providerId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getChannelMappingOptions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getChannelMappingOptionsRequestBuilder( + @org.eclipse.jdt.annotation.NonNull String providerId) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/ChannelMappingOptions"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "providerId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("providerId", providerId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets default listings provider info. + * + * @return ListingsProviderInfo + * @throws ApiException if fails to make API call + */ + public ListingsProviderInfo getDefaultListingProvider() throws ApiException { + ApiResponse localVarResponse = getDefaultListingProviderWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets default listings provider info. + * + * @return ApiResponse<ListingsProviderInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultListingProviderWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDefaultListingProviderRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDefaultListingProvider", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDefaultListingProviderRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/ListingProviders/Default"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the default values for a new timer. + * + * @param programId Optional. To attach default values based on a program. (optional) + * @return SeriesTimerInfoDto + * @throws ApiException if fails to make API call + */ + public SeriesTimerInfoDto getDefaultTimer(@org.eclipse.jdt.annotation.NonNull String programId) + throws ApiException { + ApiResponse localVarResponse = getDefaultTimerWithHttpInfo(programId); + return localVarResponse.getData(); + } + + /** + * Gets the default values for a new timer. + * + * @param programId Optional. To attach default values based on a program. (optional) + * @return ApiResponse<SeriesTimerInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultTimerWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String programId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDefaultTimerRequestBuilder(programId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDefaultTimer", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDefaultTimerRequestBuilder(@org.eclipse.jdt.annotation.NonNull String programId) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Timers/Defaults"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "programId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("programId", programId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get guid info. + * + * @return GuideInfo + * @throws ApiException if fails to make API call + */ + public GuideInfo getGuideInfo() throws ApiException { + ApiResponse localVarResponse = getGuideInfoWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Get guid info. + * + * @return ApiResponse<GuideInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGuideInfoWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGuideInfoRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getGuideInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getGuideInfoRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/GuideInfo"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available lineups. + * + * @param id Provider id. (optional) + * @param type Provider type. (optional) + * @param location Location. (optional) + * @param country Country. (optional) + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getLineups(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull String type, @org.eclipse.jdt.annotation.NonNull String location, + @org.eclipse.jdt.annotation.NonNull String country) throws ApiException { + ApiResponse> localVarResponse = getLineupsWithHttpInfo(id, type, location, country); + return localVarResponse.getData(); + } + + /** + * Gets available lineups. + * + * @param id Provider id. (optional) + * @param type Provider type. (optional) + * @param location Location. (optional) + * @param country Country. (optional) + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getLineupsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull String type, @org.eclipse.jdt.annotation.NonNull String location, + @org.eclipse.jdt.annotation.NonNull String country) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLineupsRequestBuilder(id, type, location, country); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLineups", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLineupsRequestBuilder(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull String type, @org.eclipse.jdt.annotation.NonNull String location, + @org.eclipse.jdt.annotation.NonNull String country) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/ListingProviders/Lineups"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + localVarQueryParameterBaseName = "type"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("type", type)); + localVarQueryParameterBaseName = "location"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("location", location)); + localVarQueryParameterBaseName = "country"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("country", country)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a live tv recording stream. + * + * @param recordingId Recording id. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getLiveRecordingFile(@org.eclipse.jdt.annotation.Nullable String recordingId) throws ApiException { + ApiResponse localVarResponse = getLiveRecordingFileWithHttpInfo(recordingId); + return localVarResponse.getData(); + } + + /** + * Gets a live tv recording stream. + * + * @param recordingId Recording id. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveRecordingFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String recordingId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLiveRecordingFileRequestBuilder(recordingId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLiveRecordingFile", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLiveRecordingFileRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String recordingId) throws ApiException { + // verify the required parameter 'recordingId' is set + if (recordingId == null) { + throw new ApiException(400, + "Missing the required parameter 'recordingId' when calling getLiveRecordingFile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/LiveRecordings/{recordingId}/stream".replace("{recordingId}", + ApiClient.urlEncode(recordingId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "video/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a live tv channel stream. + * + * @param streamId Stream id. (required) + * @param container Container type. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getLiveStreamFile(@org.eclipse.jdt.annotation.Nullable String streamId, + @org.eclipse.jdt.annotation.Nullable String container) throws ApiException { + ApiResponse localVarResponse = getLiveStreamFileWithHttpInfo(streamId, container); + return localVarResponse.getData(); + } + + /** + * Gets a live tv channel stream. + * + * @param streamId Stream id. (required) + * @param container Container type. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveStreamFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String streamId, + @org.eclipse.jdt.annotation.Nullable String container) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLiveStreamFileRequestBuilder(streamId, container); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLiveStreamFile", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLiveStreamFileRequestBuilder(@org.eclipse.jdt.annotation.Nullable String streamId, + @org.eclipse.jdt.annotation.Nullable String container) throws ApiException { + // verify the required parameter 'streamId' is set + if (streamId == null) { + throw new ApiException(400, "Missing the required parameter 'streamId' when calling getLiveStreamFile"); + } + // verify the required parameter 'container' is set + if (container == null) { + throw new ApiException(400, "Missing the required parameter 'container' when calling getLiveStreamFile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/LiveStreamFiles/{streamId}/stream.{container}" + .replace("{streamId}", ApiClient.urlEncode(streamId.toString())) + .replace("{container}", ApiClient.urlEncode(container.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "video/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available live tv channels. + * + * @param type Optional. Filter by channel type. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param isFavorite Optional. Filter by channels that are favorites, or not. (optional) + * @param isLiked Optional. Filter by channels that are liked, or not. (optional) + * @param isDisliked Optional. Filter by channels that are disliked, or not. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes \"Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param sortBy Optional. Key to sort by. (optional) + * @param sortOrder Optional. Sort order. (optional) + * @param enableFavoriteSorting Optional. Incorporate favorite and like status into channel sorting. (optional, + * default to false) + * @param addCurrentProgram Optional. Adds current program info to each channel. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getLiveTvChannels(@org.eclipse.jdt.annotation.NonNull ChannelType type, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, @org.eclipse.jdt.annotation.NonNull Boolean isLiked, + @org.eclipse.jdt.annotation.NonNull Boolean isDisliked, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableFavoriteSorting, + @org.eclipse.jdt.annotation.NonNull Boolean addCurrentProgram) throws ApiException { + ApiResponse localVarResponse = getLiveTvChannelsWithHttpInfo(type, userId, startIndex, + isMovie, isSeries, isNews, isKids, isSports, limit, isFavorite, isLiked, isDisliked, enableImages, + imageTypeLimit, enableImageTypes, fields, enableUserData, sortBy, sortOrder, enableFavoriteSorting, + addCurrentProgram); + return localVarResponse.getData(); + } + + /** + * Gets available live tv channels. + * + * @param type Optional. Filter by channel type. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param isFavorite Optional. Filter by channels that are favorites, or not. (optional) + * @param isLiked Optional. Filter by channels that are liked, or not. (optional) + * @param isDisliked Optional. Filter by channels that are disliked, or not. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes \"Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param sortBy Optional. Key to sort by. (optional) + * @param sortOrder Optional. Sort order. (optional) + * @param enableFavoriteSorting Optional. Incorporate favorite and like status into channel sorting. (optional, + * default to false) + * @param addCurrentProgram Optional. Adds current program info to each channel. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveTvChannelsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull ChannelType type, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean isLiked, @org.eclipse.jdt.annotation.NonNull Boolean isDisliked, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableFavoriteSorting, + @org.eclipse.jdt.annotation.NonNull Boolean addCurrentProgram) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLiveTvChannelsRequestBuilder(type, userId, startIndex, isMovie, + isSeries, isNews, isKids, isSports, limit, isFavorite, isLiked, isDisliked, enableImages, + imageTypeLimit, enableImageTypes, fields, enableUserData, sortBy, sortOrder, enableFavoriteSorting, + addCurrentProgram); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLiveTvChannels", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLiveTvChannelsRequestBuilder(@org.eclipse.jdt.annotation.NonNull ChannelType type, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, @org.eclipse.jdt.annotation.NonNull Boolean isLiked, + @org.eclipse.jdt.annotation.NonNull Boolean isDisliked, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableFavoriteSorting, + @org.eclipse.jdt.annotation.NonNull Boolean addCurrentProgram) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Channels"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "type"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("type", type)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "isLiked"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isLiked", isLiked)); + localVarQueryParameterBaseName = "isDisliked"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isDisliked", isDisliked)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sortOrder", sortOrder)); + localVarQueryParameterBaseName = "enableFavoriteSorting"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableFavoriteSorting", enableFavoriteSorting)); + localVarQueryParameterBaseName = "addCurrentProgram"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addCurrentProgram", addCurrentProgram)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available live tv services. + * + * @return LiveTvInfo + * @throws ApiException if fails to make API call + */ + public LiveTvInfo getLiveTvInfo() throws ApiException { + ApiResponse localVarResponse = getLiveTvInfoWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets available live tv services. + * + * @return ApiResponse<LiveTvInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveTvInfoWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLiveTvInfoRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLiveTvInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLiveTvInfoRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Info"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available live tv epgs. + * + * @param channelIds The channels to return guide information for. (optional) + * @param userId Optional. Filter by user id. (optional) + * @param minStartDate Optional. The minimum premiere start date. (optional) + * @param hasAired Optional. Filter by programs that have completed airing, or not. (optional) + * @param isAiring Optional. Filter by programs that are currently airing, or not. (optional) + * @param maxStartDate Optional. The maximum premiere start date. (optional) + * @param minEndDate Optional. The minimum premiere end date. (optional) + * @param maxEndDate Optional. The maximum premiere end date. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param genres The genres to return guide information for. (optional) + * @param genreIds The genre ids to return guide information for. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param seriesTimerId Optional. Filter by series timer id. (optional) + * @param librarySeriesId Optional. Filter by library series id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getLiveTvPrograms(@org.eclipse.jdt.annotation.NonNull List channelIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minStartDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasAired, @org.eclipse.jdt.annotation.NonNull Boolean isAiring, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxStartDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minEndDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxEndDate, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull UUID librarySeriesId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + ApiResponse localVarResponse = getLiveTvProgramsWithHttpInfo(channelIds, userId, + minStartDate, hasAired, isAiring, maxStartDate, minEndDate, maxEndDate, isMovie, isSeries, isNews, + isKids, isSports, startIndex, limit, sortBy, sortOrder, genres, genreIds, enableImages, imageTypeLimit, + enableImageTypes, enableUserData, seriesTimerId, librarySeriesId, fields, enableTotalRecordCount); + return localVarResponse.getData(); + } + + /** + * Gets available live tv epgs. + * + * @param channelIds The channels to return guide information for. (optional) + * @param userId Optional. Filter by user id. (optional) + * @param minStartDate Optional. The minimum premiere start date. (optional) + * @param hasAired Optional. Filter by programs that have completed airing, or not. (optional) + * @param isAiring Optional. Filter by programs that are currently airing, or not. (optional) + * @param maxStartDate Optional. The maximum premiere start date. (optional) + * @param minEndDate Optional. The minimum premiere end date. (optional) + * @param maxEndDate Optional. The maximum premiere end date. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param genres The genres to return guide information for. (optional) + * @param genreIds The genre ids to return guide information for. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param seriesTimerId Optional. Filter by series timer id. (optional) + * @param librarySeriesId Optional. Filter by library series id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveTvProgramsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull List channelIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minStartDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasAired, @org.eclipse.jdt.annotation.NonNull Boolean isAiring, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxStartDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minEndDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxEndDate, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull UUID librarySeriesId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLiveTvProgramsRequestBuilder(channelIds, userId, minStartDate, + hasAired, isAiring, maxStartDate, minEndDate, maxEndDate, isMovie, isSeries, isNews, isKids, isSports, + startIndex, limit, sortBy, sortOrder, genres, genreIds, enableImages, imageTypeLimit, enableImageTypes, + enableUserData, seriesTimerId, librarySeriesId, fields, enableTotalRecordCount); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLiveTvPrograms", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLiveTvProgramsRequestBuilder( + @org.eclipse.jdt.annotation.NonNull List channelIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minStartDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasAired, @org.eclipse.jdt.annotation.NonNull Boolean isAiring, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxStartDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minEndDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxEndDate, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull UUID librarySeriesId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Programs"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "channelIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "channelIds", channelIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "minStartDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minStartDate", minStartDate)); + localVarQueryParameterBaseName = "hasAired"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasAired", hasAired)); + localVarQueryParameterBaseName = "isAiring"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isAiring", isAiring)); + localVarQueryParameterBaseName = "maxStartDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStartDate", maxStartDate)); + localVarQueryParameterBaseName = "minEndDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minEndDate", minEndDate)); + localVarQueryParameterBaseName = "maxEndDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxEndDate", maxEndDate)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "genres"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genres", genres)); + localVarQueryParameterBaseName = "genreIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genreIds", genreIds)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "seriesTimerId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("seriesTimerId", seriesTimerId)); + localVarQueryParameterBaseName = "librarySeriesId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("librarySeriesId", librarySeriesId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a live tv program. + * + * @param programId Program id. (required) + * @param userId Optional. Attach user data. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getProgram(@org.eclipse.jdt.annotation.Nullable String programId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = getProgramWithHttpInfo(programId, userId); + return localVarResponse.getData(); + } + + /** + * Gets a live tv program. + * + * @param programId Program id. (required) + * @param userId Optional. Attach user data. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getProgramWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String programId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getProgramRequestBuilder(programId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getProgram", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getProgramRequestBuilder(@org.eclipse.jdt.annotation.Nullable String programId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'programId' is set + if (programId == null) { + throw new ApiException(400, "Missing the required parameter 'programId' when calling getProgram"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Programs/{programId}".replace("{programId}", + ApiClient.urlEncode(programId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available live tv epgs. + * + * @param getProgramsDto Request body. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getPrograms(@org.eclipse.jdt.annotation.NonNull GetProgramsDto getProgramsDto) + throws ApiException { + ApiResponse localVarResponse = getProgramsWithHttpInfo(getProgramsDto); + return localVarResponse.getData(); + } + + /** + * Gets available live tv epgs. + * + * @param getProgramsDto Request body. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getProgramsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull GetProgramsDto getProgramsDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getProgramsRequestBuilder(getProgramsDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPrograms", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getProgramsRequestBuilder( + @org.eclipse.jdt.annotation.NonNull GetProgramsDto getProgramsDto) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Programs"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(getProgramsDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets recommended live tv epgs. + * + * @param userId Optional. filter by user id. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param isAiring Optional. Filter by programs that are currently airing, or not. (optional) + * @param hasAired Optional. Filter by programs that have completed airing, or not. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param genreIds The genres to return guide information for. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. include user data. (optional) + * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getRecommendedPrograms(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean isAiring, + @org.eclipse.jdt.annotation.NonNull Boolean hasAired, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + ApiResponse localVarResponse = getRecommendedProgramsWithHttpInfo(userId, limit, + isAiring, hasAired, isSeries, isMovie, isNews, isKids, isSports, enableImages, imageTypeLimit, + enableImageTypes, genreIds, fields, enableUserData, enableTotalRecordCount); + return localVarResponse.getData(); + } + + /** + * Gets recommended live tv epgs. + * + * @param userId Optional. filter by user id. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param isAiring Optional. Filter by programs that are currently airing, or not. (optional) + * @param hasAired Optional. Filter by programs that have completed airing, or not. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param genreIds The genres to return guide information for. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. include user data. (optional) + * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecommendedProgramsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean hasAired, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecommendedProgramsRequestBuilder(userId, limit, isAiring, + hasAired, isSeries, isMovie, isNews, isKids, isSports, enableImages, imageTypeLimit, enableImageTypes, + genreIds, fields, enableUserData, enableTotalRecordCount); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRecommendedPrograms", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRecommendedProgramsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean isAiring, + @org.eclipse.jdt.annotation.NonNull Boolean hasAired, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Programs/Recommended"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "isAiring"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isAiring", isAiring)); + localVarQueryParameterBaseName = "hasAired"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasAired", hasAired)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "genreIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genreIds", genreIds)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a live tv recording. + * + * @param recordingId Recording id. (required) + * @param userId Optional. Attach user data. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getRecording(@org.eclipse.jdt.annotation.Nullable UUID recordingId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = getRecordingWithHttpInfo(recordingId, userId); + return localVarResponse.getData(); + } + + /** + * Gets a live tv recording. + * + * @param recordingId Recording id. (required) + * @param userId Optional. Attach user data. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecordingWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID recordingId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecordingRequestBuilder(recordingId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRecording", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRecordingRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID recordingId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'recordingId' is set + if (recordingId == null) { + throw new ApiException(400, "Missing the required parameter 'recordingId' when calling getRecording"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Recordings/{recordingId}".replace("{recordingId}", + ApiClient.urlEncode(recordingId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets recording folders. + * + * @param userId Optional. Filter by user and attach user data. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getRecordingFolders(@org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + ApiResponse localVarResponse = getRecordingFoldersWithHttpInfo(userId); + return localVarResponse.getData(); + } + + /** + * Gets recording folders. + * + * @param userId Optional. Filter by user and attach user data. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecordingFoldersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecordingFoldersRequestBuilder(userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRecordingFolders", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRecordingFoldersRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Recordings/Folders"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get recording group. + * + * @param groupId Group id. (required) + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public void getRecordingGroup(@org.eclipse.jdt.annotation.Nullable UUID groupId) throws ApiException { + getRecordingGroupWithHttpInfo(groupId); + } + + /** + * Get recording group. + * + * @param groupId Group id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getRecordingGroupWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID groupId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecordingGroupRequestBuilder(groupId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRecordingGroup", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRecordingGroupRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID groupId) + throws ApiException { + // verify the required parameter 'groupId' is set + if (groupId == null) { + throw new ApiException(400, "Missing the required parameter 'groupId' when calling getRecordingGroup"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Recordings/Groups/{groupId}".replace("{groupId}", + ApiClient.urlEncode(groupId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets live tv recording groups. + * + * @param userId Optional. Filter by user and attach user data. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getRecordingGroups(@org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + ApiResponse localVarResponse = getRecordingGroupsWithHttpInfo(userId); + return localVarResponse.getData(); + } + + /** + * Gets live tv recording groups. + * + * @param userId Optional. Filter by user and attach user data. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getRecordingGroupsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecordingGroupsRequestBuilder(userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRecordingGroups", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRecordingGroupsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Recordings/Groups"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets live tv recordings. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param status Optional. Filter by recording status. (optional) + * @param isInProgress Optional. Filter by recordings that are in progress, or not. (optional) + * @param seriesTimerId Optional. Filter by recordings belonging to a series timer. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isLibraryItem Optional. Filter for is library item. (optional) + * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getRecordings(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isLibraryItem, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + ApiResponse localVarResponse = getRecordingsWithHttpInfo(channelId, userId, startIndex, + limit, status, isInProgress, seriesTimerId, enableImages, imageTypeLimit, enableImageTypes, fields, + enableUserData, isMovie, isSeries, isKids, isSports, isNews, isLibraryItem, enableTotalRecordCount); + return localVarResponse.getData(); + } + + /** + * Gets live tv recordings. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param status Optional. Filter by recording status. (optional) + * @param isInProgress Optional. Filter by recordings that are in progress, or not. (optional) + * @param seriesTimerId Optional. Filter by recordings belonging to a series timer. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isLibraryItem Optional. Filter for is library item. (optional) + * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecordingsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String channelId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isLibraryItem, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecordingsRequestBuilder(channelId, userId, startIndex, limit, + status, isInProgress, seriesTimerId, enableImages, imageTypeLimit, enableImageTypes, fields, + enableUserData, isMovie, isSeries, isKids, isSports, isNews, isLibraryItem, enableTotalRecordCount); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRecordings", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRecordingsRequestBuilder(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isLibraryItem, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Recordings"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "channelId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("channelId", channelId)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "status"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("status", status)); + localVarQueryParameterBaseName = "isInProgress"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isInProgress", isInProgress)); + localVarQueryParameterBaseName = "seriesTimerId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("seriesTimerId", seriesTimerId)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isLibraryItem"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isLibraryItem", isLibraryItem)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets live tv recording series. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param groupId Optional. Filter by recording group. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param status Optional. Filter by recording status. (optional) + * @param isInProgress Optional. Filter by recordings that are in progress, or not. (optional) + * @param seriesTimerId Optional. Filter by recordings belonging to a series timer. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getRecordingsSeries(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String groupId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + ApiResponse localVarResponse = getRecordingsSeriesWithHttpInfo(channelId, userId, + groupId, startIndex, limit, status, isInProgress, seriesTimerId, enableImages, imageTypeLimit, + enableImageTypes, fields, enableUserData, enableTotalRecordCount); + return localVarResponse.getData(); + } + + /** + * Gets live tv recording series. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param groupId Optional. Filter by recording group. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param status Optional. Filter by recording status. (optional) + * @param isInProgress Optional. Filter by recordings that are in progress, or not. (optional) + * @param seriesTimerId Optional. Filter by recordings belonging to a series timer. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getRecordingsSeriesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String channelId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String groupId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecordingsSeriesRequestBuilder(channelId, userId, groupId, + startIndex, limit, status, isInProgress, seriesTimerId, enableImages, imageTypeLimit, enableImageTypes, + fields, enableUserData, enableTotalRecordCount); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRecordingsSeries", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRecordingsSeriesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String groupId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Recordings/Series"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "channelId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("channelId", channelId)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "groupId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("groupId", groupId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "status"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("status", status)); + localVarQueryParameterBaseName = "isInProgress"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isInProgress", isInProgress)); + localVarQueryParameterBaseName = "seriesTimerId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("seriesTimerId", seriesTimerId)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available countries. + * + * @return File + * @throws ApiException if fails to make API call + */ + public File getSchedulesDirectCountries() throws ApiException { + ApiResponse localVarResponse = getSchedulesDirectCountriesWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets available countries. + * + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSchedulesDirectCountriesWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSchedulesDirectCountriesRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSchedulesDirectCountries", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSchedulesDirectCountriesRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/ListingProviders/SchedulesDirect/Countries"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a live tv series timer. + * + * @param timerId Timer id. (required) + * @return SeriesTimerInfoDto + * @throws ApiException if fails to make API call + */ + public SeriesTimerInfoDto getSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { + ApiResponse localVarResponse = getSeriesTimerWithHttpInfo(timerId); + return localVarResponse.getData(); + } + + /** + * Gets a live tv series timer. + * + * @param timerId Timer id. (required) + * @return ApiResponse<SeriesTimerInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSeriesTimerWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSeriesTimerRequestBuilder(timerId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSeriesTimer", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSeriesTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId) + throws ApiException { + // verify the required parameter 'timerId' is set + if (timerId == null) { + throw new ApiException(400, "Missing the required parameter 'timerId' when calling getSeriesTimer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/SeriesTimers/{timerId}".replace("{timerId}", + ApiClient.urlEncode(timerId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets live tv series timers. + * + * @param sortBy Optional. Sort by SortName or Priority. (optional) + * @param sortOrder Optional. Sort in Ascending or Descending order. (optional) + * @return SeriesTimerInfoDtoQueryResult + * @throws ApiException if fails to make API call + */ + public SeriesTimerInfoDtoQueryResult getSeriesTimers(@org.eclipse.jdt.annotation.NonNull String sortBy, + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder) throws ApiException { + ApiResponse localVarResponse = getSeriesTimersWithHttpInfo(sortBy, sortOrder); + return localVarResponse.getData(); + } + + /** + * Gets live tv series timers. + * + * @param sortBy Optional. Sort by SortName or Priority. (optional) + * @param sortOrder Optional. Sort in Ascending or Descending order. (optional) + * @return ApiResponse<SeriesTimerInfoDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSeriesTimersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String sortBy, @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSeriesTimersRequestBuilder(sortBy, sortOrder); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSeriesTimers", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSeriesTimersRequestBuilder(@org.eclipse.jdt.annotation.NonNull String sortBy, + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/SeriesTimers"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sortOrder", sortOrder)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a timer. + * + * @param timerId Timer id. (required) + * @return TimerInfoDto + * @throws ApiException if fails to make API call + */ + public TimerInfoDto getTimer(@org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { + ApiResponse localVarResponse = getTimerWithHttpInfo(timerId); + return localVarResponse.getData(); + } + + /** + * Gets a timer. + * + * @param timerId Timer id. (required) + * @return ApiResponse<TimerInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTimerRequestBuilder(timerId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getTimer", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId) + throws ApiException { + // verify the required parameter 'timerId' is set + if (timerId == null) { + throw new ApiException(400, "Missing the required parameter 'timerId' when calling getTimer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Timers/{timerId}".replace("{timerId}", ApiClient.urlEncode(timerId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the live tv timers. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param seriesTimerId Optional. Filter by timers belonging to a series timer. (optional) + * @param isActive Optional. Filter by timers that are active. (optional) + * @param isScheduled Optional. Filter by timers that are scheduled. (optional) + * @return TimerInfoDtoQueryResult + * @throws ApiException if fails to make API call + */ + public TimerInfoDtoQueryResult getTimers(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean isActive, + @org.eclipse.jdt.annotation.NonNull Boolean isScheduled) throws ApiException { + ApiResponse localVarResponse = getTimersWithHttpInfo(channelId, seriesTimerId, + isActive, isScheduled); + return localVarResponse.getData(); + } + + /** + * Gets the live tv timers. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param seriesTimerId Optional. Filter by timers belonging to a series timer. (optional) + * @param isActive Optional. Filter by timers that are active. (optional) + * @param isScheduled Optional. Filter by timers that are scheduled. (optional) + * @return ApiResponse<TimerInfoDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTimersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean isActive, + @org.eclipse.jdt.annotation.NonNull Boolean isScheduled) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTimersRequestBuilder(channelId, seriesTimerId, isActive, + isScheduled); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getTimers", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getTimersRequestBuilder(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean isActive, + @org.eclipse.jdt.annotation.NonNull Boolean isScheduled) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Timers"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "channelId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("channelId", channelId)); + localVarQueryParameterBaseName = "seriesTimerId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("seriesTimerId", seriesTimerId)); + localVarQueryParameterBaseName = "isActive"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isActive", isActive)); + localVarQueryParameterBaseName = "isScheduled"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isScheduled", isScheduled)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get tuner host types. + * + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getTunerHostTypes() throws ApiException { + ApiResponse> localVarResponse = getTunerHostTypesWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Get tuner host types. + * + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getTunerHostTypesWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTunerHostTypesRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getTunerHostTypes", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getTunerHostTypesRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/TunerHosts/Types"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Resets a tv tuner. + * + * @param tunerId Tuner id. (required) + * @throws ApiException if fails to make API call + */ + public void resetTuner(@org.eclipse.jdt.annotation.Nullable String tunerId) throws ApiException { + resetTunerWithHttpInfo(tunerId); + } + + /** + * Resets a tv tuner. + * + * @param tunerId Tuner id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse resetTunerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String tunerId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = resetTunerRequestBuilder(tunerId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("resetTuner", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder resetTunerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String tunerId) + throws ApiException { + // verify the required parameter 'tunerId' is set + if (tunerId == null) { + throw new ApiException(400, "Missing the required parameter 'tunerId' when calling resetTuner"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Tuners/{tunerId}/Reset".replace("{tunerId}", + ApiClient.urlEncode(tunerId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set channel mappings. + * + * @param setChannelMappingDto The set channel mapping dto. (required) + * @return TunerChannelMapping + * @throws ApiException if fails to make API call + */ + public TunerChannelMapping setChannelMapping( + @org.eclipse.jdt.annotation.Nullable SetChannelMappingDto setChannelMappingDto) throws ApiException { + ApiResponse localVarResponse = setChannelMappingWithHttpInfo(setChannelMappingDto); + return localVarResponse.getData(); + } + + /** + * Set channel mappings. + * + * @param setChannelMappingDto The set channel mapping dto. (required) + * @return ApiResponse<TunerChannelMapping> + * @throws ApiException if fails to make API call + */ + public ApiResponse setChannelMappingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SetChannelMappingDto setChannelMappingDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = setChannelMappingRequestBuilder(setChannelMappingDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("setChannelMapping", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder setChannelMappingRequestBuilder( + @org.eclipse.jdt.annotation.Nullable SetChannelMappingDto setChannelMappingDto) throws ApiException { + // verify the required parameter 'setChannelMappingDto' is set + if (setChannelMappingDto == null) { + throw new ApiException(400, + "Missing the required parameter 'setChannelMappingDto' when calling setChannelMapping"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/ChannelMappings"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(setChannelMappingDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a live tv series timer. + * + * @param timerId Timer id. (required) + * @param seriesTimerInfoDto New series timer info. (optional) + * @throws ApiException if fails to make API call + */ + public void updateSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto) throws ApiException { + updateSeriesTimerWithHttpInfo(timerId, seriesTimerInfoDto); + } + + /** + * Updates a live tv series timer. + * + * @param timerId Timer id. (required) + * @param seriesTimerInfoDto New series timer info. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateSeriesTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateSeriesTimerRequestBuilder(timerId, seriesTimerInfoDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateSeriesTimer", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateSeriesTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto) throws ApiException { + // verify the required parameter 'timerId' is set + if (timerId == null) { + throw new ApiException(400, "Missing the required parameter 'timerId' when calling updateSeriesTimer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/SeriesTimers/{timerId}".replace("{timerId}", + ApiClient.urlEncode(timerId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(seriesTimerInfoDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a live tv timer. + * + * @param timerId Timer id. (required) + * @param timerInfoDto New timer info. (optional) + * @throws ApiException if fails to make API call + */ + public void updateTimer(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto) throws ApiException { + updateTimerWithHttpInfo(timerId, timerInfoDto); + } + + /** + * Updates a live tv timer. + * + * @param timerId Timer id. (required) + * @param timerInfoDto New timer info. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateTimerRequestBuilder(timerId, timerInfoDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateTimer", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto) throws ApiException { + // verify the required parameter 'timerId' is set + if (timerId == null) { + throw new ApiException(400, "Missing the required parameter 'timerId' when calling updateTimer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Timers/{timerId}".replace("{timerId}", ApiClient.urlEncode(timerId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(timerInfoDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LocalizationApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LocalizationApi.java new file mode 100644 index 0000000000000..e3c56bb0ab51e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LocalizationApi.java @@ -0,0 +1,365 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.List; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.CountryInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.CultureDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.LocalizationOption; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ParentalRating; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LocalizationApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public LocalizationApi() { + this(Configuration.getDefaultApiClient()); + } + + public LocalizationApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets known countries. + * + * @return List<CountryInfo> + * @throws ApiException if fails to make API call + */ + public List getCountries() throws ApiException { + ApiResponse> localVarResponse = getCountriesWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets known countries. + * + * @return ApiResponse<List<CountryInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getCountriesWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getCountriesRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getCountries", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getCountriesRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Localization/Countries"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets known cultures. + * + * @return List<CultureDto> + * @throws ApiException if fails to make API call + */ + public List getCultures() throws ApiException { + ApiResponse> localVarResponse = getCulturesWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets known cultures. + * + * @return ApiResponse<List<CultureDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getCulturesWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getCulturesRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getCultures", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getCulturesRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Localization/Cultures"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets localization options. + * + * @return List<LocalizationOption> + * @throws ApiException if fails to make API call + */ + public List getLocalizationOptions() throws ApiException { + ApiResponse> localVarResponse = getLocalizationOptionsWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets localization options. + * + * @return ApiResponse<List<LocalizationOption>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getLocalizationOptionsWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLocalizationOptionsRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLocalizationOptions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLocalizationOptionsRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Localization/Options"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets known parental ratings. + * + * @return List<ParentalRating> + * @throws ApiException if fails to make API call + */ + public List getParentalRatings() throws ApiException { + ApiResponse> localVarResponse = getParentalRatingsWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets known parental ratings. + * + * @return ApiResponse<List<ParentalRating>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getParentalRatingsWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getParentalRatingsRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getParentalRatings", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getParentalRatingsRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Localization/ParentalRatings"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LyricsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LyricsApi.java new file mode 100644 index 0000000000000..a34c779857004 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LyricsApi.java @@ -0,0 +1,595 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.LyricDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.RemoteLyricInfoDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LyricsApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public LyricsApi() { + this(Configuration.getDefaultApiClient()); + } + + public LyricsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Deletes an external lyric file. + * + * @param itemId The item id. (required) + * @throws ApiException if fails to make API call + */ + public void deleteLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + deleteLyricsWithHttpInfo(itemId); + } + + /** + * Deletes an external lyric file. + * + * @param itemId The item id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteLyricsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteLyricsRequestBuilder(itemId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteLyrics", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteLyricsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteLyrics"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/Lyrics".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Downloads a remote lyric. + * + * @param itemId The item id. (required) + * @param lyricId The lyric id. (required) + * @return LyricDto + * @throws ApiException if fails to make API call + */ + public LyricDto downloadRemoteLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String lyricId) throws ApiException { + ApiResponse localVarResponse = downloadRemoteLyricsWithHttpInfo(itemId, lyricId); + return localVarResponse.getData(); + } + + /** + * Downloads a remote lyric. + * + * @param itemId The item id. (required) + * @param lyricId The lyric id. (required) + * @return ApiResponse<LyricDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse downloadRemoteLyricsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String lyricId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = downloadRemoteLyricsRequestBuilder(itemId, lyricId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("downloadRemoteLyrics", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder downloadRemoteLyricsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String lyricId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling downloadRemoteLyrics"); + } + // verify the required parameter 'lyricId' is set + if (lyricId == null) { + throw new ApiException(400, "Missing the required parameter 'lyricId' when calling downloadRemoteLyrics"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/RemoteSearch/Lyrics/{lyricId}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{lyricId}", ApiClient.urlEncode(lyricId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an item's lyrics. + * + * @param itemId Item id. (required) + * @return LyricDto + * @throws ApiException if fails to make API call + */ + public LyricDto getLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + ApiResponse localVarResponse = getLyricsWithHttpInfo(itemId); + return localVarResponse.getData(); + } + + /** + * Gets an item's lyrics. + * + * @param itemId Item id. (required) + * @return ApiResponse<LyricDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLyricsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLyricsRequestBuilder(itemId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLyrics", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLyricsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getLyrics"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/Lyrics".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the remote lyrics. + * + * @param lyricId The remote provider item id. (required) + * @return LyricDto + * @throws ApiException if fails to make API call + */ + public LyricDto getRemoteLyrics(@org.eclipse.jdt.annotation.Nullable String lyricId) throws ApiException { + ApiResponse localVarResponse = getRemoteLyricsWithHttpInfo(lyricId); + return localVarResponse.getData(); + } + + /** + * Gets the remote lyrics. + * + * @param lyricId The remote provider item id. (required) + * @return ApiResponse<LyricDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRemoteLyricsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String lyricId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRemoteLyricsRequestBuilder(lyricId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRemoteLyrics", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRemoteLyricsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String lyricId) + throws ApiException { + // verify the required parameter 'lyricId' is set + if (lyricId == null) { + throw new ApiException(400, "Missing the required parameter 'lyricId' when calling getRemoteLyrics"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Providers/Lyrics/{lyricId}".replace("{lyricId}", + ApiClient.urlEncode(lyricId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Search remote lyrics. + * + * @param itemId The item id. (required) + * @return List<RemoteLyricInfoDto> + * @throws ApiException if fails to make API call + */ + public List searchRemoteLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + ApiResponse> localVarResponse = searchRemoteLyricsWithHttpInfo(itemId); + return localVarResponse.getData(); + } + + /** + * Search remote lyrics. + * + * @param itemId The item id. (required) + * @return ApiResponse<List<RemoteLyricInfoDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> searchRemoteLyricsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = searchRemoteLyricsRequestBuilder(itemId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("searchRemoteLyrics", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder searchRemoteLyricsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling searchRemoteLyrics"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/RemoteSearch/Lyrics".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Upload an external lyric file. + * + * @param itemId The item the lyric belongs to. (required) + * @param fileName Name of the file being uploaded. (required) + * @param body (optional) + * @return LyricDto + * @throws ApiException if fails to make API call + */ + public LyricDto uploadLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String fileName, @org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + ApiResponse localVarResponse = uploadLyricsWithHttpInfo(itemId, fileName, body); + return localVarResponse.getData(); + } + + /** + * Upload an external lyric file. + * + * @param itemId The item the lyric belongs to. (required) + * @param fileName Name of the file being uploaded. (required) + * @param body (optional) + * @return ApiResponse<LyricDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse uploadLyricsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String fileName, @org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uploadLyricsRequestBuilder(itemId, fileName, body); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("uploadLyrics", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uploadLyricsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String fileName, @org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling uploadLyrics"); + } + // verify the required parameter 'fileName' is set + if (fileName == null) { + throw new ApiException(400, "Missing the required parameter 'fileName' when calling uploadLyrics"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/Lyrics".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "fileName"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fileName", fileName)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "text/plain"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MediaInfoApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MediaInfoApi.java new file mode 100644 index 0000000000000..ccaf84d58fed3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MediaInfoApi.java @@ -0,0 +1,750 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.LiveStreamResponse; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.OpenLiveStreamDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PlaybackInfoDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PlaybackInfoResponse; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaInfoApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public MediaInfoApi() { + this(Configuration.getDefaultApiClient()); + } + + public MediaInfoApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Closes a media source. + * + * @param liveStreamId The livestream id. (required) + * @throws ApiException if fails to make API call + */ + public void closeLiveStream(@org.eclipse.jdt.annotation.Nullable String liveStreamId) throws ApiException { + closeLiveStreamWithHttpInfo(liveStreamId); + } + + /** + * Closes a media source. + * + * @param liveStreamId The livestream id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse closeLiveStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String liveStreamId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = closeLiveStreamRequestBuilder(liveStreamId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("closeLiveStream", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder closeLiveStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable String liveStreamId) + throws ApiException { + // verify the required parameter 'liveStreamId' is set + if (liveStreamId == null) { + throw new ApiException(400, "Missing the required parameter 'liveStreamId' when calling closeLiveStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveStreams/Close"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Tests the network with a request with the size of the bitrate. + * + * @param size The bitrate. Defaults to 102400. (optional, default to 102400) + * @return File + * @throws ApiException if fails to make API call + */ + public File getBitrateTestBytes(@org.eclipse.jdt.annotation.NonNull Integer size) throws ApiException { + ApiResponse localVarResponse = getBitrateTestBytesWithHttpInfo(size); + return localVarResponse.getData(); + } + + /** + * Tests the network with a request with the size of the bitrate. + * + * @param size The bitrate. Defaults to 102400. (optional, default to 102400) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getBitrateTestBytesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Integer size) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBitrateTestBytesRequestBuilder(size); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getBitrateTestBytes", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getBitrateTestBytesRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer size) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playback/BitrateTest"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "size"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("size", size)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/octet-stream"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets live playback media info for an item. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @return PlaybackInfoResponse + * @throws ApiException if fails to make API call + */ + public PlaybackInfoResponse getPlaybackInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = getPlaybackInfoWithHttpInfo(itemId, userId); + return localVarResponse.getData(); + } + + /** + * Gets live playback media info for an item. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @return ApiResponse<PlaybackInfoResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPlaybackInfoWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPlaybackInfoRequestBuilder(itemId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPlaybackInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPlaybackInfoRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getPlaybackInfo"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/PlaybackInfo".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets live playback media info for an item. + * For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query + * parameters are obsolete. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @param maxStreamingBitrate The maximum streaming bitrate. (optional) + * @param startTimeTicks The start time in ticks. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param maxAudioChannels The maximum number of audio channels. (optional) + * @param mediaSourceId The media source id. (optional) + * @param liveStreamId The livestream id. (optional) + * @param autoOpenLiveStream Whether to auto open the livestream. (optional) + * @param enableDirectPlay Whether to enable direct play. Default: true. (optional) + * @param enableDirectStream Whether to enable direct stream. Default: true. (optional) + * @param enableTranscoding Whether to enable transcoding. Default: true. (optional) + * @param allowVideoStreamCopy Whether to allow to copy the video stream. Default: true. (optional) + * @param allowAudioStreamCopy Whether to allow to copy the audio stream. Default: true. (optional) + * @param playbackInfoDto The playback info. (optional) + * @return PlaybackInfoResponse + * @throws ApiException if fails to make API call + */ + public PlaybackInfoResponse getPostedPlaybackInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean autoOpenLiveStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableTranscoding, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull PlaybackInfoDto playbackInfoDto) throws ApiException { + ApiResponse localVarResponse = getPostedPlaybackInfoWithHttpInfo(itemId, userId, + maxStreamingBitrate, startTimeTicks, audioStreamIndex, subtitleStreamIndex, maxAudioChannels, + mediaSourceId, liveStreamId, autoOpenLiveStream, enableDirectPlay, enableDirectStream, + enableTranscoding, allowVideoStreamCopy, allowAudioStreamCopy, playbackInfoDto); + return localVarResponse.getData(); + } + + /** + * Gets live playback media info for an item. + * For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query + * parameters are obsolete. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @param maxStreamingBitrate The maximum streaming bitrate. (optional) + * @param startTimeTicks The start time in ticks. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param maxAudioChannels The maximum number of audio channels. (optional) + * @param mediaSourceId The media source id. (optional) + * @param liveStreamId The livestream id. (optional) + * @param autoOpenLiveStream Whether to auto open the livestream. (optional) + * @param enableDirectPlay Whether to enable direct play. Default: true. (optional) + * @param enableDirectStream Whether to enable direct stream. Default: true. (optional) + * @param enableTranscoding Whether to enable transcoding. Default: true. (optional) + * @param allowVideoStreamCopy Whether to allow to copy the video stream. Default: true. (optional) + * @param allowAudioStreamCopy Whether to allow to copy the audio stream. Default: true. (optional) + * @param playbackInfoDto The playback info. (optional) + * @return ApiResponse<PlaybackInfoResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPostedPlaybackInfoWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean autoOpenLiveStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableTranscoding, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull PlaybackInfoDto playbackInfoDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPostedPlaybackInfoRequestBuilder(itemId, userId, + maxStreamingBitrate, startTimeTicks, audioStreamIndex, subtitleStreamIndex, maxAudioChannels, + mediaSourceId, liveStreamId, autoOpenLiveStream, enableDirectPlay, enableDirectStream, + enableTranscoding, allowVideoStreamCopy, allowAudioStreamCopy, playbackInfoDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPostedPlaybackInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPostedPlaybackInfoRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean autoOpenLiveStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableTranscoding, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull PlaybackInfoDto playbackInfoDto) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getPostedPlaybackInfo"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/PlaybackInfo".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "maxStreamingBitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStreamingBitrate", maxStreamingBitrate)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "autoOpenLiveStream"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("autoOpenLiveStream", autoOpenLiveStream)); + localVarQueryParameterBaseName = "enableDirectPlay"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableDirectPlay", enableDirectPlay)); + localVarQueryParameterBaseName = "enableDirectStream"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableDirectStream", enableDirectStream)); + localVarQueryParameterBaseName = "enableTranscoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTranscoding", enableTranscoding)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(playbackInfoDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Opens a media source. + * + * @param openToken The open token. (optional) + * @param userId The user id. (optional) + * @param playSessionId The play session id. (optional) + * @param maxStreamingBitrate The maximum streaming bitrate. (optional) + * @param startTimeTicks The start time in ticks. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param maxAudioChannels The maximum number of audio channels. (optional) + * @param itemId The item id. (optional) + * @param enableDirectPlay Whether to enable direct play. Default: true. (optional) + * @param enableDirectStream Whether to enable direct stream. Default: true. (optional) + * @param alwaysBurnInSubtitleWhenTranscoding Always burn-in subtitle when transcoding. (optional) + * @param openLiveStreamDto The open live stream dto. (optional) + * @return LiveStreamResponse + * @throws ApiException if fails to make API call + */ + public LiveStreamResponse openLiveStream(@org.eclipse.jdt.annotation.NonNull String openToken, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + @org.eclipse.jdt.annotation.NonNull OpenLiveStreamDto openLiveStreamDto) throws ApiException { + ApiResponse localVarResponse = openLiveStreamWithHttpInfo(openToken, userId, playSessionId, + maxStreamingBitrate, startTimeTicks, audioStreamIndex, subtitleStreamIndex, maxAudioChannels, itemId, + enableDirectPlay, enableDirectStream, alwaysBurnInSubtitleWhenTranscoding, openLiveStreamDto); + return localVarResponse.getData(); + } + + /** + * Opens a media source. + * + * @param openToken The open token. (optional) + * @param userId The user id. (optional) + * @param playSessionId The play session id. (optional) + * @param maxStreamingBitrate The maximum streaming bitrate. (optional) + * @param startTimeTicks The start time in ticks. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param maxAudioChannels The maximum number of audio channels. (optional) + * @param itemId The item id. (optional) + * @param enableDirectPlay Whether to enable direct play. Default: true. (optional) + * @param enableDirectStream Whether to enable direct stream. Default: true. (optional) + * @param alwaysBurnInSubtitleWhenTranscoding Always burn-in subtitle when transcoding. (optional) + * @param openLiveStreamDto The open live stream dto. (optional) + * @return ApiResponse<LiveStreamResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse openLiveStreamWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String openToken, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + @org.eclipse.jdt.annotation.NonNull OpenLiveStreamDto openLiveStreamDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = openLiveStreamRequestBuilder(openToken, userId, playSessionId, + maxStreamingBitrate, startTimeTicks, audioStreamIndex, subtitleStreamIndex, maxAudioChannels, itemId, + enableDirectPlay, enableDirectStream, alwaysBurnInSubtitleWhenTranscoding, openLiveStreamDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("openLiveStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder openLiveStreamRequestBuilder(@org.eclipse.jdt.annotation.NonNull String openToken, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + @org.eclipse.jdt.annotation.NonNull OpenLiveStreamDto openLiveStreamDto) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveStreams/Open"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "openToken"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("openToken", openToken)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "maxStreamingBitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStreamingBitrate", maxStreamingBitrate)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "itemId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("itemId", itemId)); + localVarQueryParameterBaseName = "enableDirectPlay"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableDirectPlay", enableDirectPlay)); + localVarQueryParameterBaseName = "enableDirectStream"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableDirectStream", enableDirectStream)); + localVarQueryParameterBaseName = "alwaysBurnInSubtitleWhenTranscoding"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("alwaysBurnInSubtitleWhenTranscoding", alwaysBurnInSubtitleWhenTranscoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(openLiveStreamDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MediaSegmentsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MediaSegmentsApi.java new file mode 100644 index 0000000000000..ff7d3de5dde45 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MediaSegmentsApi.java @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MediaSegmentDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MediaSegmentType; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaSegmentsApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public MediaSegmentsApi() { + this(Configuration.getDefaultApiClient()); + } + + public MediaSegmentsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets all media segments based on an itemId. + * + * @param itemId The ItemId. (required) + * @param includeSegmentTypes Optional filter of requested segment types. (optional) + * @return MediaSegmentDtoQueryResult + * @throws ApiException if fails to make API call + */ + public MediaSegmentDtoQueryResult getItemSegments(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List includeSegmentTypes) throws ApiException { + ApiResponse localVarResponse = getItemSegmentsWithHttpInfo(itemId, + includeSegmentTypes); + return localVarResponse.getData(); + } + + /** + * Gets all media segments based on an itemId. + * + * @param itemId The ItemId. (required) + * @param includeSegmentTypes Optional filter of requested segment types. (optional) + * @return ApiResponse<MediaSegmentDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemSegmentsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List includeSegmentTypes) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemSegmentsRequestBuilder(itemId, includeSegmentTypes); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItemSegments", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemSegmentsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List includeSegmentTypes) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemSegments"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MediaSegments/{itemId}".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "includeSegmentTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeSegmentTypes", includeSegmentTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MoviesApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MoviesApi.java new file mode 100644 index 0000000000000..5b0bef1d634ea --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MoviesApi.java @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.RecommendationDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MoviesApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public MoviesApi() { + this(Configuration.getDefaultApiClient()); + } + + public MoviesApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets movie recommendations. + * + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. The fields to return. (optional) + * @param categoryLimit The max number of categories to return. (optional, default to 5) + * @param itemLimit The max number of items to return per category. (optional, default to 8) + * @return List<RecommendationDto> + * @throws ApiException if fails to make API call + */ + public List getMovieRecommendations(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer categoryLimit, + @org.eclipse.jdt.annotation.NonNull Integer itemLimit) throws ApiException { + ApiResponse> localVarResponse = getMovieRecommendationsWithHttpInfo(userId, parentId, + fields, categoryLimit, itemLimit); + return localVarResponse.getData(); + } + + /** + * Gets movie recommendations. + * + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. The fields to return. (optional) + * @param categoryLimit The max number of categories to return. (optional, default to 5) + * @param itemLimit The max number of items to return per category. (optional, default to 8) + * @return ApiResponse<List<RecommendationDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMovieRecommendationsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer categoryLimit, + @org.eclipse.jdt.annotation.NonNull Integer itemLimit) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMovieRecommendationsRequestBuilder(userId, parentId, fields, + categoryLimit, itemLimit); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMovieRecommendations", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMovieRecommendationsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer categoryLimit, + @org.eclipse.jdt.annotation.NonNull Integer itemLimit) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Movies/Recommendations"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "categoryLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("categoryLimit", categoryLimit)); + localVarQueryParameterBaseName = "itemLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("itemLimit", itemLimit)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MusicGenresApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MusicGenresApi.java new file mode 100644 index 0000000000000..d25b5082d3dd1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MusicGenresApi.java @@ -0,0 +1,408 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemSortBy; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SortOrder; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MusicGenresApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public MusicGenresApi() { + this(Configuration.getDefaultApiClient()); + } + + public MusicGenresApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets a music genre, by name. + * + * @param genreName The genre name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getMusicGenre(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = getMusicGenreWithHttpInfo(genreName, userId); + return localVarResponse.getData(); + } + + /** + * Gets a music genre, by name. + * + * @param genreName The genre name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMusicGenreWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMusicGenreRequestBuilder(genreName, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMusicGenre", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMusicGenreRequestBuilder(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'genreName' is set + if (genreName == null) { + throw new ApiException(400, "Missing the required parameter 'genreName' when calling getMusicGenre"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MusicGenres/{genreName}".replace("{genreName}", + ApiClient.urlEncode(genreName.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all music genres from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered in based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Optional. Include total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getMusicGenres(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + ApiResponse localVarResponse = getMusicGenresWithHttpInfo(startIndex, limit, searchTerm, + parentId, fields, excludeItemTypes, includeItemTypes, isFavorite, imageTypeLimit, enableImageTypes, + userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, + enableTotalRecordCount); + return localVarResponse.getData(); + } + + /** + * Gets all music genres from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered in based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Optional. Include total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getMusicGenresWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMusicGenresRequestBuilder(startIndex, limit, searchTerm, + parentId, fields, excludeItemTypes, includeItemTypes, isFavorite, imageTypeLimit, enableImageTypes, + userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, + enableTotalRecordCount); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMusicGenres", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMusicGenresRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MusicGenres"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "nameStartsWithOrGreater"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWithOrGreater", nameStartsWithOrGreater)); + localVarQueryParameterBaseName = "nameStartsWith"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWith", nameStartsWith)); + localVarQueryParameterBaseName = "nameLessThan"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameLessThan", nameLessThan)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PackageApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PackageApi.java new file mode 100644 index 0000000000000..4ab4fcf0158ba --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PackageApi.java @@ -0,0 +1,572 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PackageInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.RepositoryInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PackageApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public PackageApi() { + this(Configuration.getDefaultApiClient()); + } + + public PackageApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Cancels a package installation. + * + * @param packageId Installation Id. (required) + * @throws ApiException if fails to make API call + */ + public void cancelPackageInstallation(@org.eclipse.jdt.annotation.Nullable UUID packageId) throws ApiException { + cancelPackageInstallationWithHttpInfo(packageId); + } + + /** + * Cancels a package installation. + * + * @param packageId Installation Id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse cancelPackageInstallationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID packageId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = cancelPackageInstallationRequestBuilder(packageId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("cancelPackageInstallation", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder cancelPackageInstallationRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID packageId) throws ApiException { + // verify the required parameter 'packageId' is set + if (packageId == null) { + throw new ApiException(400, + "Missing the required parameter 'packageId' when calling cancelPackageInstallation"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Packages/Installing/{packageId}".replace("{packageId}", + ApiClient.urlEncode(packageId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a package by name or assembly GUID. + * + * @param name The name of the package. (required) + * @param assemblyGuid The GUID of the associated assembly. (optional) + * @return PackageInfo + * @throws ApiException if fails to make API call + */ + public PackageInfo getPackageInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid) throws ApiException { + ApiResponse localVarResponse = getPackageInfoWithHttpInfo(name, assemblyGuid); + return localVarResponse.getData(); + } + + /** + * Gets a package by name or assembly GUID. + * + * @param name The name of the package. (required) + * @param assemblyGuid The GUID of the associated assembly. (optional) + * @return ApiResponse<PackageInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPackageInfoWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPackageInfoRequestBuilder(name, assemblyGuid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPackageInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPackageInfoRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getPackageInfo"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Packages/{name}".replace("{name}", ApiClient.urlEncode(name.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "assemblyGuid"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("assemblyGuid", assemblyGuid)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available packages. + * + * @return List<PackageInfo> + * @throws ApiException if fails to make API call + */ + public List getPackages() throws ApiException { + ApiResponse> localVarResponse = getPackagesWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets available packages. + * + * @return ApiResponse<List<PackageInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPackagesWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPackagesRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPackages", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPackagesRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Packages"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all package repositories. + * + * @return List<RepositoryInfo> + * @throws ApiException if fails to make API call + */ + public List getRepositories() throws ApiException { + ApiResponse> localVarResponse = getRepositoriesWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets all package repositories. + * + * @return ApiResponse<List<RepositoryInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getRepositoriesWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRepositoriesRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRepositories", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRepositoriesRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Repositories"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Installs a package. + * + * @param name Package name. (required) + * @param assemblyGuid GUID of the associated assembly. (optional) + * @param version Optional version. Defaults to latest version. (optional) + * @param repositoryUrl Optional. Specify the repository to install from. (optional) + * @throws ApiException if fails to make API call + */ + public void installPackage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, @org.eclipse.jdt.annotation.NonNull String version, + @org.eclipse.jdt.annotation.NonNull String repositoryUrl) throws ApiException { + installPackageWithHttpInfo(name, assemblyGuid, version, repositoryUrl); + } + + /** + * Installs a package. + * + * @param name Package name. (required) + * @param assemblyGuid GUID of the associated assembly. (optional) + * @param version Optional version. Defaults to latest version. (optional) + * @param repositoryUrl Optional. Specify the repository to install from. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse installPackageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, @org.eclipse.jdt.annotation.NonNull String version, + @org.eclipse.jdt.annotation.NonNull String repositoryUrl) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = installPackageRequestBuilder(name, assemblyGuid, version, + repositoryUrl); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("installPackage", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder installPackageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, @org.eclipse.jdt.annotation.NonNull String version, + @org.eclipse.jdt.annotation.NonNull String repositoryUrl) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling installPackage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Packages/Installed/{name}".replace("{name}", ApiClient.urlEncode(name.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "assemblyGuid"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("assemblyGuid", assemblyGuid)); + localVarQueryParameterBaseName = "version"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("version", version)); + localVarQueryParameterBaseName = "repositoryUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("repositoryUrl", repositoryUrl)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sets the enabled and existing package repositories. + * + * @param repositoryInfo The list of package repositories. (required) + * @throws ApiException if fails to make API call + */ + public void setRepositories(@org.eclipse.jdt.annotation.Nullable List repositoryInfo) + throws ApiException { + setRepositoriesWithHttpInfo(repositoryInfo); + } + + /** + * Sets the enabled and existing package repositories. + * + * @param repositoryInfo The list of package repositories. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setRepositoriesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable List repositoryInfo) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = setRepositoriesRequestBuilder(repositoryInfo); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("setRepositories", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder setRepositoriesRequestBuilder( + @org.eclipse.jdt.annotation.Nullable List repositoryInfo) throws ApiException { + // verify the required parameter 'repositoryInfo' is set + if (repositoryInfo == null) { + throw new ApiException(400, "Missing the required parameter 'repositoryInfo' when calling setRepositories"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Repositories"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(repositoryInfo); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PersonsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PersonsApi.java new file mode 100644 index 0000000000000..f9d71feeb5729 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PersonsApi.java @@ -0,0 +1,358 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFilter; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PersonsApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public PersonsApi() { + this(Configuration.getDefaultApiClient()); + } + + public PersonsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Get person by name. + * + * @param name Person name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getPerson(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = getPersonWithHttpInfo(name, userId); + return localVarResponse.getData(); + } + + /** + * Get person by name. + * + * @param name Person name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPersonWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPersonRequestBuilder(name, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPerson", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPersonRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getPerson"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Persons/{name}".replace("{name}", ApiClient.urlEncode(name.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all persons. + * + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. userId is required. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param excludePersonTypes Optional. If specified results will be filtered to exclude those containing the + * specified PersonType. Allows multiple, comma-delimited. (optional) + * @param personTypes Optional. If specified results will be filtered to include only those containing the specified + * PersonType. Allows multiple, comma-delimited. (optional) + * @param appearsInItemId Optional. If specified, person results will be filtered on items related to said persons. + * (optional) + * @param userId User id. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getPersons(@org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludePersonTypes, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull UUID appearsInItemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + ApiResponse localVarResponse = getPersonsWithHttpInfo(limit, searchTerm, fields, + filters, isFavorite, enableUserData, imageTypeLimit, enableImageTypes, excludePersonTypes, personTypes, + appearsInItemId, userId, enableImages); + return localVarResponse.getData(); + } + + /** + * Gets all persons. + * + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. userId is required. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param excludePersonTypes Optional. If specified results will be filtered to exclude those containing the + * specified PersonType. Allows multiple, comma-delimited. (optional) + * @param personTypes Optional. If specified results will be filtered to include only those containing the specified + * PersonType. Allows multiple, comma-delimited. (optional) + * @param appearsInItemId Optional. If specified, person results will be filtered on items related to said persons. + * (optional) + * @param userId User id. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPersonsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludePersonTypes, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull UUID appearsInItemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPersonsRequestBuilder(limit, searchTerm, fields, filters, + isFavorite, enableUserData, imageTypeLimit, enableImageTypes, excludePersonTypes, personTypes, + appearsInItemId, userId, enableImages); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPersons", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPersonsRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludePersonTypes, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull UUID appearsInItemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Persons"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "filters"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "filters", filters)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "excludePersonTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludePersonTypes", excludePersonTypes)); + localVarQueryParameterBaseName = "personTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personTypes", personTypes)); + localVarQueryParameterBaseName = "appearsInItemId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("appearsInItemId", appearsInItemId)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PlaylistsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PlaylistsApi.java new file mode 100644 index 0000000000000..5fa5b93afb308 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PlaylistsApi.java @@ -0,0 +1,1167 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.CreatePlaylistDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MediaType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PlaylistCreationResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PlaylistDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PlaylistUserPermissions; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UpdatePlaylistDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UpdatePlaylistUserDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaylistsApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public PlaylistsApi() { + this(Configuration.getDefaultApiClient()); + } + + public PlaylistsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Adds items to a playlist. + * + * @param playlistId The playlist id. (required) + * @param ids Item id, comma delimited. (optional) + * @param userId The userId. (optional) + * @throws ApiException if fails to make API call + */ + public void addItemToPlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + addItemToPlaylistWithHttpInfo(playlistId, ids, userId); + } + + /** + * Adds items to a playlist. + * + * @param playlistId The playlist id. (required) + * @param ids Item id, comma delimited. (optional) + * @param userId The userId. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addItemToPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addItemToPlaylistRequestBuilder(playlistId, ids, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("addItemToPlaylist", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder addItemToPlaylistRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling addItemToPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists/{playlistId}/Items".replace("{playlistId}", + ApiClient.urlEncode(playlistId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates a new playlist. + * For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query + * parameters are obsolete. + * + * @param name The playlist name. (optional) + * @param ids The item ids. (optional) + * @param userId The user id. (optional) + * @param mediaType The media type. (optional) + * @param createPlaylistDto The create playlist payload. (optional) + * @return PlaylistCreationResult + * @throws ApiException if fails to make API call + */ + public PlaylistCreationResult createPlaylist(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull MediaType mediaType, + @org.eclipse.jdt.annotation.NonNull CreatePlaylistDto createPlaylistDto) throws ApiException { + ApiResponse localVarResponse = createPlaylistWithHttpInfo(name, ids, userId, mediaType, + createPlaylistDto); + return localVarResponse.getData(); + } + + /** + * Creates a new playlist. + * For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query + * parameters are obsolete. + * + * @param name The playlist name. (optional) + * @param ids The item ids. (optional) + * @param userId The user id. (optional) + * @param mediaType The media type. (optional) + * @param createPlaylistDto The create playlist payload. (optional) + * @return ApiResponse<PlaylistCreationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse createPlaylistWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull MediaType mediaType, + @org.eclipse.jdt.annotation.NonNull CreatePlaylistDto createPlaylistDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createPlaylistRequestBuilder(name, ids, userId, mediaType, + createPlaylistDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createPlaylistRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull MediaType mediaType, + @org.eclipse.jdt.annotation.NonNull CreatePlaylistDto createPlaylistDto) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "mediaType"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaType", mediaType)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createPlaylistDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get a playlist. + * + * @param playlistId The playlist id. (required) + * @return PlaylistDto + * @throws ApiException if fails to make API call + */ + public PlaylistDto getPlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlistId) throws ApiException { + ApiResponse localVarResponse = getPlaylistWithHttpInfo(playlistId); + return localVarResponse.getData(); + } + + /** + * Get a playlist. + * + * @param playlistId The playlist id. (required) + * @return ApiResponse<PlaylistDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPlaylistRequestBuilder(playlistId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPlaylistRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId) + throws ApiException { + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling getPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists/{playlistId}".replace("{playlistId}", + ApiClient.urlEncode(playlistId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the original items of a playlist. + * + * @param playlistId The playlist id. (required) + * @param userId User id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getPlaylistItems(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + ApiResponse localVarResponse = getPlaylistItemsWithHttpInfo(playlistId, userId, + startIndex, limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + return localVarResponse.getData(); + } + + /** + * Gets the original items of a playlist. + * + * @param playlistId The playlist id. (required) + * @param userId User id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPlaylistItemsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPlaylistItemsRequestBuilder(playlistId, userId, startIndex, + limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPlaylistItems", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPlaylistItemsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling getPlaylistItems"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists/{playlistId}/Items".replace("{playlistId}", + ApiClient.urlEncode(playlistId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get a playlist user. + * + * @param playlistId The playlist id. (required) + * @param userId The user id. (required) + * @return PlaylistUserPermissions + * @throws ApiException if fails to make API call + */ + public PlaylistUserPermissions getPlaylistUser(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + ApiResponse localVarResponse = getPlaylistUserWithHttpInfo(playlistId, userId); + return localVarResponse.getData(); + } + + /** + * Get a playlist user. + * + * @param playlistId The playlist id. (required) + * @param userId The user id. (required) + * @return ApiResponse<PlaylistUserPermissions> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPlaylistUserWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.Nullable UUID userId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPlaylistUserRequestBuilder(playlistId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPlaylistUser", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPlaylistUserRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling getPlaylistUser"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getPlaylistUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists/{playlistId}/Users/{userId}" + .replace("{playlistId}", ApiClient.urlEncode(playlistId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get a playlist's users. + * + * @param playlistId The playlist id. (required) + * @return List<PlaylistUserPermissions> + * @throws ApiException if fails to make API call + */ + public List getPlaylistUsers(@org.eclipse.jdt.annotation.Nullable UUID playlistId) + throws ApiException { + ApiResponse> localVarResponse = getPlaylistUsersWithHttpInfo(playlistId); + return localVarResponse.getData(); + } + + /** + * Get a playlist's users. + * + * @param playlistId The playlist id. (required) + * @return ApiResponse<List<PlaylistUserPermissions>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPlaylistUsersWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID playlistId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPlaylistUsersRequestBuilder(playlistId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPlaylistUsers", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPlaylistUsersRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId) + throws ApiException { + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling getPlaylistUsers"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists/{playlistId}/Users".replace("{playlistId}", + ApiClient.urlEncode(playlistId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Moves a playlist item. + * + * @param playlistId The playlist id. (required) + * @param itemId The item id. (required) + * @param newIndex The new index. (required) + * @throws ApiException if fails to make API call + */ + public void moveItem(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable Integer newIndex) + throws ApiException { + moveItemWithHttpInfo(playlistId, itemId, newIndex); + } + + /** + * Moves a playlist item. + * + * @param playlistId The playlist id. (required) + * @param itemId The item id. (required) + * @param newIndex The new index. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse moveItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable Integer newIndex) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = moveItemRequestBuilder(playlistId, itemId, newIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("moveItem", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder moveItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable Integer newIndex) + throws ApiException { + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling moveItem"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling moveItem"); + } + // verify the required parameter 'newIndex' is set + if (newIndex == null) { + throw new ApiException(400, "Missing the required parameter 'newIndex' when calling moveItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists/{playlistId}/Items/{itemId}/Move/{newIndex}" + .replace("{playlistId}", ApiClient.urlEncode(playlistId.toString())) + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{newIndex}", ApiClient.urlEncode(newIndex.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Removes items from a playlist. + * + * @param playlistId The playlist id. (required) + * @param entryIds The item ids, comma delimited. (optional) + * @throws ApiException if fails to make API call + */ + public void removeItemFromPlaylist(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.NonNull List entryIds) throws ApiException { + removeItemFromPlaylistWithHttpInfo(playlistId, entryIds); + } + + /** + * Removes items from a playlist. + * + * @param playlistId The playlist id. (required) + * @param entryIds The item ids, comma delimited. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeItemFromPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.NonNull List entryIds) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeItemFromPlaylistRequestBuilder(playlistId, entryIds); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("removeItemFromPlaylist", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder removeItemFromPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.NonNull List entryIds) throws ApiException { + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, + "Missing the required parameter 'playlistId' when calling removeItemFromPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists/{playlistId}/Items".replace("{playlistId}", + ApiClient.urlEncode(playlistId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "entryIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "entryIds", entryIds)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Remove a user from a playlist's users. + * + * @param playlistId The playlist id. (required) + * @param userId The user id. (required) + * @throws ApiException if fails to make API call + */ + public void removeUserFromPlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + removeUserFromPlaylistWithHttpInfo(playlistId, userId); + } + + /** + * Remove a user from a playlist's users. + * + * @param playlistId The playlist id. (required) + * @param userId The user id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeUserFromPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeUserFromPlaylistRequestBuilder(playlistId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("removeUserFromPlaylist", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder removeUserFromPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.Nullable UUID userId) + throws ApiException { + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, + "Missing the required parameter 'playlistId' when calling removeUserFromPlaylist"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling removeUserFromPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists/{playlistId}/Users/{userId}" + .replace("{playlistId}", ApiClient.urlEncode(playlistId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a playlist. + * + * @param playlistId The playlist id. (required) + * @param updatePlaylistDto The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistDto id. (required) + * @throws ApiException if fails to make API call + */ + public void updatePlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UpdatePlaylistDto updatePlaylistDto) throws ApiException { + updatePlaylistWithHttpInfo(playlistId, updatePlaylistDto); + } + + /** + * Updates a playlist. + * + * @param playlistId The playlist id. (required) + * @param updatePlaylistDto The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistDto id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updatePlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UpdatePlaylistDto updatePlaylistDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updatePlaylistRequestBuilder(playlistId, updatePlaylistDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updatePlaylist", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updatePlaylistRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UpdatePlaylistDto updatePlaylistDto) throws ApiException { + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling updatePlaylist"); + } + // verify the required parameter 'updatePlaylistDto' is set + if (updatePlaylistDto == null) { + throw new ApiException(400, + "Missing the required parameter 'updatePlaylistDto' when calling updatePlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists/{playlistId}".replace("{playlistId}", + ApiClient.urlEncode(playlistId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(updatePlaylistDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Modify a user of a playlist's users. + * + * @param playlistId The playlist id. (required) + * @param userId The user id. (required) + * @param updatePlaylistUserDto The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistUserDto. (required) + * @throws ApiException if fails to make API call + */ + public void updatePlaylistUser(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UpdatePlaylistUserDto updatePlaylistUserDto) throws ApiException { + updatePlaylistUserWithHttpInfo(playlistId, userId, updatePlaylistUserDto); + } + + /** + * Modify a user of a playlist's users. + * + * @param playlistId The playlist id. (required) + * @param userId The user id. (required) + * @param updatePlaylistUserDto The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistUserDto. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updatePlaylistUserWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UpdatePlaylistUserDto updatePlaylistUserDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updatePlaylistUserRequestBuilder(playlistId, userId, + updatePlaylistUserDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updatePlaylistUser", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updatePlaylistUserRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UpdatePlaylistUserDto updatePlaylistUserDto) throws ApiException { + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling updatePlaylistUser"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling updatePlaylistUser"); + } + // verify the required parameter 'updatePlaylistUserDto' is set + if (updatePlaylistUserDto == null) { + throw new ApiException(400, + "Missing the required parameter 'updatePlaylistUserDto' when calling updatePlaylistUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists/{playlistId}/Users/{userId}" + .replace("{playlistId}", ApiClient.urlEncode(playlistId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(updatePlaylistUserDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PlaystateApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PlaystateApi.java new file mode 100644 index 0000000000000..96044de897ac0 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PlaystateApi.java @@ -0,0 +1,1006 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PlayMethod; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PlaybackProgressInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PlaybackStartInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PlaybackStopInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.RepeatMode; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UserItemDataDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaystateApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public PlaystateApi() { + this(Configuration.getDefaultApiClient()); + } + + public PlaystateApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Marks an item as played for user. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param datePlayed Optional. The date the item was played. (optional) + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto markPlayedItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime datePlayed) throws ApiException { + ApiResponse localVarResponse = markPlayedItemWithHttpInfo(itemId, userId, datePlayed); + return localVarResponse.getData(); + } + + /** + * Marks an item as played for user. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param datePlayed Optional. The date the item was played. (optional) + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse markPlayedItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime datePlayed) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = markPlayedItemRequestBuilder(itemId, userId, datePlayed); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("markPlayedItem", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder markPlayedItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime datePlayed) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling markPlayedItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/UserPlayedItems/{itemId}".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "datePlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("datePlayed", datePlayed)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Marks an item as unplayed for user. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto markUnplayedItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = markUnplayedItemWithHttpInfo(itemId, userId); + return localVarResponse.getData(); + } + + /** + * Marks an item as unplayed for user. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse markUnplayedItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = markUnplayedItemRequestBuilder(itemId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("markUnplayedItem", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder markUnplayedItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling markUnplayedItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/UserPlayedItems/{itemId}".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports a session's playback progress. + * + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param positionTicks Optional. The current position, in ticks. 1 tick = 10000 ms. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param volumeLevel Scale of 0-100. (optional) + * @param playMethod The play method. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param repeatMode The repeat mode. (optional) + * @param isPaused Indicates if the player is paused. (optional, default to false) + * @param isMuted Indicates if the player is muted. (optional, default to false) + * @throws ApiException if fails to make API call + */ + public void onPlaybackProgress(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer volumeLevel, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode, + @org.eclipse.jdt.annotation.NonNull Boolean isPaused, @org.eclipse.jdt.annotation.NonNull Boolean isMuted) + throws ApiException { + onPlaybackProgressWithHttpInfo(itemId, mediaSourceId, positionTicks, audioStreamIndex, subtitleStreamIndex, + volumeLevel, playMethod, liveStreamId, playSessionId, repeatMode, isPaused, isMuted); + } + + /** + * Reports a session's playback progress. + * + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param positionTicks Optional. The current position, in ticks. 1 tick = 10000 ms. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param volumeLevel Scale of 0-100. (optional) + * @param playMethod The play method. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param repeatMode The repeat mode. (optional) + * @param isPaused Indicates if the player is paused. (optional, default to false) + * @param isMuted Indicates if the player is muted. (optional, default to false) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse onPlaybackProgressWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer volumeLevel, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode, + @org.eclipse.jdt.annotation.NonNull Boolean isPaused, @org.eclipse.jdt.annotation.NonNull Boolean isMuted) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = onPlaybackProgressRequestBuilder(itemId, mediaSourceId, + positionTicks, audioStreamIndex, subtitleStreamIndex, volumeLevel, playMethod, liveStreamId, + playSessionId, repeatMode, isPaused, isMuted); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("onPlaybackProgress", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder onPlaybackProgressRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer volumeLevel, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode, + @org.eclipse.jdt.annotation.NonNull Boolean isPaused, @org.eclipse.jdt.annotation.NonNull Boolean isMuted) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling onPlaybackProgress"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/PlayingItems/{itemId}/Progress".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "positionTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("positionTicks", positionTicks)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "volumeLevel"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("volumeLevel", volumeLevel)); + localVarQueryParameterBaseName = "playMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playMethod", playMethod)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "repeatMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("repeatMode", repeatMode)); + localVarQueryParameterBaseName = "isPaused"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isPaused", isPaused)); + localVarQueryParameterBaseName = "isMuted"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMuted", isMuted)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that a session has begun playing an item. + * + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param playMethod The play method. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param canSeek Indicates if the client can seek. (optional, default to false) + * @throws ApiException if fails to make API call + */ + public void onPlaybackStart(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Boolean canSeek) throws ApiException { + onPlaybackStartWithHttpInfo(itemId, mediaSourceId, audioStreamIndex, subtitleStreamIndex, playMethod, + liveStreamId, playSessionId, canSeek); + } + + /** + * Reports that a session has begun playing an item. + * + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param playMethod The play method. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param canSeek Indicates if the client can seek. (optional, default to false) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse onPlaybackStartWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Boolean canSeek) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = onPlaybackStartRequestBuilder(itemId, mediaSourceId, + audioStreamIndex, subtitleStreamIndex, playMethod, liveStreamId, playSessionId, canSeek); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("onPlaybackStart", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder onPlaybackStartRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Boolean canSeek) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling onPlaybackStart"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/PlayingItems/{itemId}".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "playMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playMethod", playMethod)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "canSeek"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("canSeek", canSeek)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that a session has stopped playing an item. + * + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param nextMediaType The next media type that will play. (optional) + * @param positionTicks Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @throws ApiException if fails to make API call + */ + public void onPlaybackStopped(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String nextMediaType, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId) throws ApiException { + onPlaybackStoppedWithHttpInfo(itemId, mediaSourceId, nextMediaType, positionTicks, liveStreamId, playSessionId); + } + + /** + * Reports that a session has stopped playing an item. + * + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param nextMediaType The next media type that will play. (optional) + * @param positionTicks Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse onPlaybackStoppedWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String nextMediaType, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = onPlaybackStoppedRequestBuilder(itemId, mediaSourceId, + nextMediaType, positionTicks, liveStreamId, playSessionId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("onPlaybackStopped", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder onPlaybackStoppedRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String nextMediaType, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling onPlaybackStopped"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/PlayingItems/{itemId}".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "nextMediaType"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nextMediaType", nextMediaType)); + localVarQueryParameterBaseName = "positionTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("positionTicks", positionTicks)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Pings a playback session. + * + * @param playSessionId Playback session id. (required) + * @throws ApiException if fails to make API call + */ + public void pingPlaybackSession(@org.eclipse.jdt.annotation.Nullable String playSessionId) throws ApiException { + pingPlaybackSessionWithHttpInfo(playSessionId); + } + + /** + * Pings a playback session. + * + * @param playSessionId Playback session id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse pingPlaybackSessionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String playSessionId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = pingPlaybackSessionRequestBuilder(playSessionId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("pingPlaybackSession", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder pingPlaybackSessionRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String playSessionId) throws ApiException { + // verify the required parameter 'playSessionId' is set + if (playSessionId == null) { + throw new ApiException(400, + "Missing the required parameter 'playSessionId' when calling pingPlaybackSession"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/Playing/Ping"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports playback progress within a session. + * + * @param playbackProgressInfo The playback progress info. (optional) + * @throws ApiException if fails to make API call + */ + public void reportPlaybackProgress(@org.eclipse.jdt.annotation.NonNull PlaybackProgressInfo playbackProgressInfo) + throws ApiException { + reportPlaybackProgressWithHttpInfo(playbackProgressInfo); + } + + /** + * Reports playback progress within a session. + * + * @param playbackProgressInfo The playback progress info. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportPlaybackProgressWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull PlaybackProgressInfo playbackProgressInfo) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = reportPlaybackProgressRequestBuilder(playbackProgressInfo); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("reportPlaybackProgress", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder reportPlaybackProgressRequestBuilder( + @org.eclipse.jdt.annotation.NonNull PlaybackProgressInfo playbackProgressInfo) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/Playing/Progress"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(playbackProgressInfo); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports playback has started within a session. + * + * @param playbackStartInfo The playback start info. (optional) + * @throws ApiException if fails to make API call + */ + public void reportPlaybackStart(@org.eclipse.jdt.annotation.NonNull PlaybackStartInfo playbackStartInfo) + throws ApiException { + reportPlaybackStartWithHttpInfo(playbackStartInfo); + } + + /** + * Reports playback has started within a session. + * + * @param playbackStartInfo The playback start info. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportPlaybackStartWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull PlaybackStartInfo playbackStartInfo) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = reportPlaybackStartRequestBuilder(playbackStartInfo); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("reportPlaybackStart", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder reportPlaybackStartRequestBuilder( + @org.eclipse.jdt.annotation.NonNull PlaybackStartInfo playbackStartInfo) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/Playing"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(playbackStartInfo); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports playback has stopped within a session. + * + * @param playbackStopInfo The playback stop info. (optional) + * @throws ApiException if fails to make API call + */ + public void reportPlaybackStopped(@org.eclipse.jdt.annotation.NonNull PlaybackStopInfo playbackStopInfo) + throws ApiException { + reportPlaybackStoppedWithHttpInfo(playbackStopInfo); + } + + /** + * Reports playback has stopped within a session. + * + * @param playbackStopInfo The playback stop info. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportPlaybackStoppedWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull PlaybackStopInfo playbackStopInfo) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = reportPlaybackStoppedRequestBuilder(playbackStopInfo); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("reportPlaybackStopped", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder reportPlaybackStoppedRequestBuilder( + @org.eclipse.jdt.annotation.NonNull PlaybackStopInfo playbackStopInfo) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/Playing/Stopped"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(playbackStopInfo); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PluginsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PluginsApi.java new file mode 100644 index 0000000000000..d8c2c3ddd5868 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PluginsApi.java @@ -0,0 +1,785 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.List; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PluginInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PluginsApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public PluginsApi() { + this(Configuration.getDefaultApiClient()); + } + + public PluginsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Disable a plugin. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @throws ApiException if fails to make API call + */ + public void disablePlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + disablePluginWithHttpInfo(pluginId, version); + } + + /** + * Disable a plugin. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse disablePluginWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = disablePluginRequestBuilder(pluginId, version); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("disablePlugin", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder disablePluginRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + // verify the required parameter 'pluginId' is set + if (pluginId == null) { + throw new ApiException(400, "Missing the required parameter 'pluginId' when calling disablePlugin"); + } + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException(400, "Missing the required parameter 'version' when calling disablePlugin"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins/{pluginId}/{version}/Disable" + .replace("{pluginId}", ApiClient.urlEncode(pluginId.toString())) + .replace("{version}", ApiClient.urlEncode(version.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Enables a disabled plugin. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @throws ApiException if fails to make API call + */ + public void enablePlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + enablePluginWithHttpInfo(pluginId, version); + } + + /** + * Enables a disabled plugin. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse enablePluginWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = enablePluginRequestBuilder(pluginId, version); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("enablePlugin", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder enablePluginRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + // verify the required parameter 'pluginId' is set + if (pluginId == null) { + throw new ApiException(400, "Missing the required parameter 'pluginId' when calling enablePlugin"); + } + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException(400, "Missing the required parameter 'version' when calling enablePlugin"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins/{pluginId}/{version}/Enable" + .replace("{pluginId}", ApiClient.urlEncode(pluginId.toString())) + .replace("{version}", ApiClient.urlEncode(version.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets plugin configuration. + * + * @param pluginId Plugin id. (required) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object getPluginConfiguration(@org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { + ApiResponse localVarResponse = getPluginConfigurationWithHttpInfo(pluginId); + return localVarResponse.getData(); + } + + /** + * Gets plugin configuration. + * + * @param pluginId Plugin id. (required) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPluginConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPluginConfigurationRequestBuilder(pluginId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPluginConfiguration", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPluginConfigurationRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId) + throws ApiException { + // verify the required parameter 'pluginId' is set + if (pluginId == null) { + throw new ApiException(400, + "Missing the required parameter 'pluginId' when calling getPluginConfiguration"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins/{pluginId}/Configuration".replace("{pluginId}", + ApiClient.urlEncode(pluginId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a plugin's image. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getPluginImage(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + ApiResponse localVarResponse = getPluginImageWithHttpInfo(pluginId, version); + return localVarResponse.getData(); + } + + /** + * Gets a plugin's image. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPluginImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPluginImageRequestBuilder(pluginId, version); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPluginImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPluginImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + // verify the required parameter 'pluginId' is set + if (pluginId == null) { + throw new ApiException(400, "Missing the required parameter 'pluginId' when calling getPluginImage"); + } + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException(400, "Missing the required parameter 'version' when calling getPluginImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins/{pluginId}/{version}/Image" + .replace("{pluginId}", ApiClient.urlEncode(pluginId.toString())) + .replace("{version}", ApiClient.urlEncode(version.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a plugin's manifest. + * + * @param pluginId Plugin id. (required) + * @throws ApiException if fails to make API call + */ + public void getPluginManifest(@org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { + getPluginManifestWithHttpInfo(pluginId); + } + + /** + * Gets a plugin's manifest. + * + * @param pluginId Plugin id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPluginManifestWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPluginManifestRequestBuilder(pluginId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPluginManifest", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPluginManifestRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId) + throws ApiException { + // verify the required parameter 'pluginId' is set + if (pluginId == null) { + throw new ApiException(400, "Missing the required parameter 'pluginId' when calling getPluginManifest"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins/{pluginId}/Manifest".replace("{pluginId}", + ApiClient.urlEncode(pluginId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of currently installed plugins. + * + * @return List<PluginInfo> + * @throws ApiException if fails to make API call + */ + public List getPlugins() throws ApiException { + ApiResponse> localVarResponse = getPluginsWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets a list of currently installed plugins. + * + * @return ApiResponse<List<PluginInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPluginsWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPluginsRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPlugins", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPluginsRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Uninstalls a plugin. + * + * @param pluginId Plugin id. (required) + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public void uninstallPlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { + uninstallPluginWithHttpInfo(pluginId); + } + + /** + * Uninstalls a plugin. + * + * @param pluginId Plugin id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse uninstallPluginWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uninstallPluginRequestBuilder(pluginId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("uninstallPlugin", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uninstallPluginRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId) + throws ApiException { + // verify the required parameter 'pluginId' is set + if (pluginId == null) { + throw new ApiException(400, "Missing the required parameter 'pluginId' when calling uninstallPlugin"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins/{pluginId}".replace("{pluginId}", ApiClient.urlEncode(pluginId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Uninstalls a plugin by version. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @throws ApiException if fails to make API call + */ + public void uninstallPluginByVersion(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + uninstallPluginByVersionWithHttpInfo(pluginId, version); + } + + /** + * Uninstalls a plugin by version. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse uninstallPluginByVersionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uninstallPluginByVersionRequestBuilder(pluginId, version); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("uninstallPluginByVersion", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uninstallPluginByVersionRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID pluginId, @org.eclipse.jdt.annotation.Nullable String version) + throws ApiException { + // verify the required parameter 'pluginId' is set + if (pluginId == null) { + throw new ApiException(400, + "Missing the required parameter 'pluginId' when calling uninstallPluginByVersion"); + } + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException(400, + "Missing the required parameter 'version' when calling uninstallPluginByVersion"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins/{pluginId}/{version}" + .replace("{pluginId}", ApiClient.urlEncode(pluginId.toString())) + .replace("{version}", ApiClient.urlEncode(version.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates plugin configuration. + * Accepts plugin configuration as JSON body. + * + * @param pluginId Plugin id. (required) + * @throws ApiException if fails to make API call + */ + public void updatePluginConfiguration(@org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { + updatePluginConfigurationWithHttpInfo(pluginId); + } + + /** + * Updates plugin configuration. + * Accepts plugin configuration as JSON body. + * + * @param pluginId Plugin id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updatePluginConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updatePluginConfigurationRequestBuilder(pluginId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updatePluginConfiguration", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updatePluginConfigurationRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { + // verify the required parameter 'pluginId' is set + if (pluginId == null) { + throw new ApiException(400, + "Missing the required parameter 'pluginId' when calling updatePluginConfiguration"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins/{pluginId}/Configuration".replace("{pluginId}", + ApiClient.urlEncode(pluginId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/QuickConnectApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/QuickConnectApi.java new file mode 100644 index 0000000000000..647bd3a2659e4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/QuickConnectApi.java @@ -0,0 +1,418 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.QuickConnectResult; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class QuickConnectApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public QuickConnectApi() { + this(Configuration.getDefaultApiClient()); + } + + public QuickConnectApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Authorizes a pending quick connect request. + * + * @param code Quick connect code to authorize. (required) + * @param userId The user the authorize. Access to the requested user is required. (optional) + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean authorizeQuickConnect(@org.eclipse.jdt.annotation.Nullable String code, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = authorizeQuickConnectWithHttpInfo(code, userId); + return localVarResponse.getData(); + } + + /** + * Authorizes a pending quick connect request. + * + * @param code Quick connect code to authorize. (required) + * @param userId The user the authorize. Access to the requested user is required. (optional) + * @return ApiResponse<Boolean> + * @throws ApiException if fails to make API call + */ + public ApiResponse authorizeQuickConnectWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String code, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = authorizeQuickConnectRequestBuilder(code, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("authorizeQuickConnect", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder authorizeQuickConnectRequestBuilder(@org.eclipse.jdt.annotation.Nullable String code, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'code' is set + if (code == null) { + throw new ApiException(400, "Missing the required parameter 'code' when calling authorizeQuickConnect"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/QuickConnect/Authorize"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "code"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("code", code)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the current quick connect state. + * + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean getQuickConnectEnabled() throws ApiException { + ApiResponse localVarResponse = getQuickConnectEnabledWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets the current quick connect state. + * + * @return ApiResponse<Boolean> + * @throws ApiException if fails to make API call + */ + public ApiResponse getQuickConnectEnabledWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getQuickConnectEnabledRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getQuickConnectEnabled", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getQuickConnectEnabledRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/QuickConnect/Enabled"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Attempts to retrieve authentication information. + * + * @param secret Secret previously returned from the Initiate endpoint. (required) + * @return QuickConnectResult + * @throws ApiException if fails to make API call + */ + public QuickConnectResult getQuickConnectState(@org.eclipse.jdt.annotation.Nullable String secret) + throws ApiException { + ApiResponse localVarResponse = getQuickConnectStateWithHttpInfo(secret); + return localVarResponse.getData(); + } + + /** + * Attempts to retrieve authentication information. + * + * @param secret Secret previously returned from the Initiate endpoint. (required) + * @return ApiResponse<QuickConnectResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getQuickConnectStateWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String secret) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getQuickConnectStateRequestBuilder(secret); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getQuickConnectState", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getQuickConnectStateRequestBuilder(@org.eclipse.jdt.annotation.Nullable String secret) + throws ApiException { + // verify the required parameter 'secret' is set + if (secret == null) { + throw new ApiException(400, "Missing the required parameter 'secret' when calling getQuickConnectState"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/QuickConnect/Connect"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "secret"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("secret", secret)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Initiate a new quick connect request. + * + * @return QuickConnectResult + * @throws ApiException if fails to make API call + */ + public QuickConnectResult initiateQuickConnect() throws ApiException { + ApiResponse localVarResponse = initiateQuickConnectWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Initiate a new quick connect request. + * + * @return ApiResponse<QuickConnectResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse initiateQuickConnectWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = initiateQuickConnectRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("initiateQuickConnect", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder initiateQuickConnectRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/QuickConnect/Initiate"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/RemoteImageApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/RemoteImageApi.java new file mode 100644 index 0000000000000..36ad675ebd225 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/RemoteImageApi.java @@ -0,0 +1,387 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageProviderInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.RemoteImageResult; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RemoteImageApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public RemoteImageApi() { + this(Configuration.getDefaultApiClient()); + } + + public RemoteImageApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Downloads a remote image for an item. + * + * @param itemId Item Id. (required) + * @param type The image type. (required) + * @param imageUrl The image url. (optional) + * @throws ApiException if fails to make API call + */ + public void downloadRemoteImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType type, @org.eclipse.jdt.annotation.NonNull String imageUrl) + throws ApiException { + downloadRemoteImageWithHttpInfo(itemId, type, imageUrl); + } + + /** + * Downloads a remote image for an item. + * + * @param itemId Item Id. (required) + * @param type The image type. (required) + * @param imageUrl The image url. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse downloadRemoteImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType type, @org.eclipse.jdt.annotation.NonNull String imageUrl) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = downloadRemoteImageRequestBuilder(itemId, type, imageUrl); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("downloadRemoteImage", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder downloadRemoteImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType type, @org.eclipse.jdt.annotation.NonNull String imageUrl) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling downloadRemoteImage"); + } + // verify the required parameter 'type' is set + if (type == null) { + throw new ApiException(400, "Missing the required parameter 'type' when calling downloadRemoteImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/RemoteImages/Download".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "type"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("type", type)); + localVarQueryParameterBaseName = "imageUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageUrl", imageUrl)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available remote image providers for an item. + * + * @param itemId Item Id. (required) + * @return List<ImageProviderInfo> + * @throws ApiException if fails to make API call + */ + public List getRemoteImageProviders(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + ApiResponse> localVarResponse = getRemoteImageProvidersWithHttpInfo(itemId); + return localVarResponse.getData(); + } + + /** + * Gets available remote image providers for an item. + * + * @param itemId Item Id. (required) + * @return ApiResponse<List<ImageProviderInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getRemoteImageProvidersWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRemoteImageProvidersRequestBuilder(itemId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRemoteImageProviders", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRemoteImageProvidersRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getRemoteImageProviders"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/RemoteImages/Providers".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available remote images for an item. + * + * @param itemId Item Id. (required) + * @param type The image type. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param providerName Optional. The image provider to use. (optional) + * @param includeAllLanguages Optional. Include all languages. (optional, default to false) + * @return RemoteImageResult + * @throws ApiException if fails to make API call + */ + public RemoteImageResult getRemoteImages(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull ImageType type, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String providerName, + @org.eclipse.jdt.annotation.NonNull Boolean includeAllLanguages) throws ApiException { + ApiResponse localVarResponse = getRemoteImagesWithHttpInfo(itemId, type, startIndex, limit, + providerName, includeAllLanguages); + return localVarResponse.getData(); + } + + /** + * Gets available remote images for an item. + * + * @param itemId Item Id. (required) + * @param type The image type. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param providerName Optional. The image provider to use. (optional) + * @param includeAllLanguages Optional. Include all languages. (optional, default to false) + * @return ApiResponse<RemoteImageResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRemoteImagesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull ImageType type, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String providerName, + @org.eclipse.jdt.annotation.NonNull Boolean includeAllLanguages) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRemoteImagesRequestBuilder(itemId, type, startIndex, limit, + providerName, includeAllLanguages); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRemoteImages", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRemoteImagesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull ImageType type, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String providerName, + @org.eclipse.jdt.annotation.NonNull Boolean includeAllLanguages) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getRemoteImages"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/RemoteImages".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "type"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("type", type)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "providerName"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("providerName", providerName)); + localVarQueryParameterBaseName = "includeAllLanguages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeAllLanguages", includeAllLanguages)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ScheduledTasksApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ScheduledTasksApi.java new file mode 100644 index 0000000000000..c1e4dd40b62e9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ScheduledTasksApi.java @@ -0,0 +1,482 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.TaskInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.TaskTriggerInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ScheduledTasksApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ScheduledTasksApi() { + this(Configuration.getDefaultApiClient()); + } + + public ScheduledTasksApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Get task by id. + * + * @param taskId Task Id. (required) + * @return TaskInfo + * @throws ApiException if fails to make API call + */ + public TaskInfo getTask(@org.eclipse.jdt.annotation.Nullable String taskId) throws ApiException { + ApiResponse localVarResponse = getTaskWithHttpInfo(taskId); + return localVarResponse.getData(); + } + + /** + * Get task by id. + * + * @param taskId Task Id. (required) + * @return ApiResponse<TaskInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTaskRequestBuilder(taskId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getTask", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getTaskRequestBuilder(@org.eclipse.jdt.annotation.Nullable String taskId) + throws ApiException { + // verify the required parameter 'taskId' is set + if (taskId == null) { + throw new ApiException(400, "Missing the required parameter 'taskId' when calling getTask"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/ScheduledTasks/{taskId}".replace("{taskId}", ApiClient.urlEncode(taskId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get tasks. + * + * @param isHidden Optional filter tasks that are hidden, or not. (optional) + * @param isEnabled Optional filter tasks that are enabled, or not. (optional) + * @return List<TaskInfo> + * @throws ApiException if fails to make API call + */ + public List getTasks(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isEnabled) throws ApiException { + ApiResponse> localVarResponse = getTasksWithHttpInfo(isHidden, isEnabled); + return localVarResponse.getData(); + } + + /** + * Get tasks. + * + * @param isHidden Optional filter tasks that are hidden, or not. (optional) + * @param isEnabled Optional filter tasks that are enabled, or not. (optional) + * @return ApiResponse<List<TaskInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getTasksWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isEnabled) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTasksRequestBuilder(isHidden, isEnabled); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getTasks", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getTasksRequestBuilder(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isEnabled) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/ScheduledTasks"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "isHidden"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isHidden", isHidden)); + localVarQueryParameterBaseName = "isEnabled"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isEnabled", isEnabled)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Start specified task. + * + * @param taskId Task Id. (required) + * @throws ApiException if fails to make API call + */ + public void startTask(@org.eclipse.jdt.annotation.Nullable String taskId) throws ApiException { + startTaskWithHttpInfo(taskId); + } + + /** + * Start specified task. + * + * @param taskId Task Id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse startTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = startTaskRequestBuilder(taskId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("startTask", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder startTaskRequestBuilder(@org.eclipse.jdt.annotation.Nullable String taskId) + throws ApiException { + // verify the required parameter 'taskId' is set + if (taskId == null) { + throw new ApiException(400, "Missing the required parameter 'taskId' when calling startTask"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/ScheduledTasks/Running/{taskId}".replace("{taskId}", + ApiClient.urlEncode(taskId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Stop specified task. + * + * @param taskId Task Id. (required) + * @throws ApiException if fails to make API call + */ + public void stopTask(@org.eclipse.jdt.annotation.Nullable String taskId) throws ApiException { + stopTaskWithHttpInfo(taskId); + } + + /** + * Stop specified task. + * + * @param taskId Task Id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse stopTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = stopTaskRequestBuilder(taskId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("stopTask", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder stopTaskRequestBuilder(@org.eclipse.jdt.annotation.Nullable String taskId) + throws ApiException { + // verify the required parameter 'taskId' is set + if (taskId == null) { + throw new ApiException(400, "Missing the required parameter 'taskId' when calling stopTask"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/ScheduledTasks/Running/{taskId}".replace("{taskId}", + ApiClient.urlEncode(taskId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update specified task triggers. + * + * @param taskId Task Id. (required) + * @param taskTriggerInfo Triggers. (required) + * @throws ApiException if fails to make API call + */ + public void updateTask(@org.eclipse.jdt.annotation.Nullable String taskId, + @org.eclipse.jdt.annotation.Nullable List taskTriggerInfo) throws ApiException { + updateTaskWithHttpInfo(taskId, taskTriggerInfo); + } + + /** + * Update specified task triggers. + * + * @param taskId Task Id. (required) + * @param taskTriggerInfo Triggers. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId, + @org.eclipse.jdt.annotation.Nullable List taskTriggerInfo) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateTaskRequestBuilder(taskId, taskTriggerInfo); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateTask", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateTaskRequestBuilder(@org.eclipse.jdt.annotation.Nullable String taskId, + @org.eclipse.jdt.annotation.Nullable List taskTriggerInfo) throws ApiException { + // verify the required parameter 'taskId' is set + if (taskId == null) { + throw new ApiException(400, "Missing the required parameter 'taskId' when calling updateTask"); + } + // verify the required parameter 'taskTriggerInfo' is set + if (taskTriggerInfo == null) { + throw new ApiException(400, "Missing the required parameter 'taskTriggerInfo' when calling updateTask"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/ScheduledTasks/{taskId}/Triggers".replace("{taskId}", + ApiClient.urlEncode(taskId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(taskTriggerInfo); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SearchApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SearchApi.java new file mode 100644 index 0000000000000..3a83976b8cbf1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SearchApi.java @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MediaType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SearchHintResult; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SearchApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public SearchApi() { + this(Configuration.getDefaultApiClient()); + } + + public SearchApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets the search hint result. + * + * @param searchTerm The search term to filter on. (required) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param userId Optional. Supply a user id to search within a user's library or omit to search all. (optional) + * @param includeItemTypes If specified, only results with the specified item types are returned. This allows + * multiple, comma delimited. (optional) + * @param excludeItemTypes If specified, results with these item types are filtered out. This allows multiple, comma + * delimited. (optional) + * @param mediaTypes If specified, only results with the specified media types are returned. This allows multiple, + * comma delimited. (optional) + * @param parentId If specified, only children of the parent are returned. (optional) + * @param isMovie Optional filter for movies. (optional) + * @param isSeries Optional filter for series. (optional) + * @param isNews Optional filter for news. (optional) + * @param isKids Optional filter for kids. (optional) + * @param isSports Optional filter for sports. (optional) + * @param includePeople Optional filter whether to include people. (optional, default to true) + * @param includeMedia Optional filter whether to include media. (optional, default to true) + * @param includeGenres Optional filter whether to include genres. (optional, default to true) + * @param includeStudios Optional filter whether to include studios. (optional, default to true) + * @param includeArtists Optional filter whether to include artists. (optional, default to true) + * @return SearchHintResult + * @throws ApiException if fails to make API call + */ + public SearchHintResult getSearchHints(@org.eclipse.jdt.annotation.Nullable String searchTerm, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean includePeople, + @org.eclipse.jdt.annotation.NonNull Boolean includeMedia, + @org.eclipse.jdt.annotation.NonNull Boolean includeGenres, + @org.eclipse.jdt.annotation.NonNull Boolean includeStudios, + @org.eclipse.jdt.annotation.NonNull Boolean includeArtists) throws ApiException { + ApiResponse localVarResponse = getSearchHintsWithHttpInfo(searchTerm, startIndex, limit, + userId, includeItemTypes, excludeItemTypes, mediaTypes, parentId, isMovie, isSeries, isNews, isKids, + isSports, includePeople, includeMedia, includeGenres, includeStudios, includeArtists); + return localVarResponse.getData(); + } + + /** + * Gets the search hint result. + * + * @param searchTerm The search term to filter on. (required) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param userId Optional. Supply a user id to search within a user's library or omit to search all. (optional) + * @param includeItemTypes If specified, only results with the specified item types are returned. This allows + * multiple, comma delimited. (optional) + * @param excludeItemTypes If specified, results with these item types are filtered out. This allows multiple, comma + * delimited. (optional) + * @param mediaTypes If specified, only results with the specified media types are returned. This allows multiple, + * comma delimited. (optional) + * @param parentId If specified, only children of the parent are returned. (optional) + * @param isMovie Optional filter for movies. (optional) + * @param isSeries Optional filter for series. (optional) + * @param isNews Optional filter for news. (optional) + * @param isKids Optional filter for kids. (optional) + * @param isSports Optional filter for sports. (optional) + * @param includePeople Optional filter whether to include people. (optional, default to true) + * @param includeMedia Optional filter whether to include media. (optional, default to true) + * @param includeGenres Optional filter whether to include genres. (optional, default to true) + * @param includeStudios Optional filter whether to include studios. (optional, default to true) + * @param includeArtists Optional filter whether to include artists. (optional, default to true) + * @return ApiResponse<SearchHintResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSearchHintsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String searchTerm, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean includePeople, + @org.eclipse.jdt.annotation.NonNull Boolean includeMedia, + @org.eclipse.jdt.annotation.NonNull Boolean includeGenres, + @org.eclipse.jdt.annotation.NonNull Boolean includeStudios, + @org.eclipse.jdt.annotation.NonNull Boolean includeArtists) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSearchHintsRequestBuilder(searchTerm, startIndex, limit, userId, + includeItemTypes, excludeItemTypes, mediaTypes, parentId, isMovie, isSeries, isNews, isKids, isSports, + includePeople, includeMedia, includeGenres, includeStudios, includeArtists); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSearchHints", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSearchHintsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String searchTerm, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean includePeople, + @org.eclipse.jdt.annotation.NonNull Boolean includeMedia, + @org.eclipse.jdt.annotation.NonNull Boolean includeGenres, + @org.eclipse.jdt.annotation.NonNull Boolean includeStudios, + @org.eclipse.jdt.annotation.NonNull Boolean includeArtists) throws ApiException { + // verify the required parameter 'searchTerm' is set + if (searchTerm == null) { + throw new ApiException(400, "Missing the required parameter 'searchTerm' when calling getSearchHints"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Search/Hints"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "includePeople"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includePeople", includePeople)); + localVarQueryParameterBaseName = "includeMedia"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeMedia", includeMedia)); + localVarQueryParameterBaseName = "includeGenres"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeGenres", includeGenres)); + localVarQueryParameterBaseName = "includeStudios"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeStudios", includeStudios)); + localVarQueryParameterBaseName = "includeArtists"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeArtists", includeArtists)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SessionApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SessionApi.java new file mode 100644 index 0000000000000..045df6b7226ae --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SessionApi.java @@ -0,0 +1,1568 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ClientCapabilitiesDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.GeneralCommand; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.GeneralCommandType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MediaType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MessageCommand; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.NameIdPair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PlayCommand; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PlaystateCommand; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SessionInfoDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SessionApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public SessionApi() { + this(Configuration.getDefaultApiClient()); + } + + public SessionApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Adds an additional user to a session. + * + * @param sessionId The session id. (required) + * @param userId The user id. (required) + * @throws ApiException if fails to make API call + */ + public void addUserToSession(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + addUserToSessionWithHttpInfo(sessionId, userId); + } + + /** + * Adds an additional user to a session. + * + * @param sessionId The session id. (required) + * @param userId The user id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addUserToSessionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addUserToSessionRequestBuilder(sessionId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("addUserToSession", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder addUserToSessionRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, "Missing the required parameter 'sessionId' when calling addUserToSession"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling addUserToSession"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/User/{userId}" + .replace("{sessionId}", ApiClient.urlEncode(sessionId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Instructs a session to browse to an item or view. + * + * @param sessionId The session Id. (required) + * @param itemType The type of item to browse to. (required) + * @param itemId The Id of the item. (required) + * @param itemName The name of the item. (required) + * @throws ApiException if fails to make API call + */ + public void displayContent(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable BaseItemKind itemType, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String itemName) + throws ApiException { + displayContentWithHttpInfo(sessionId, itemType, itemId, itemName); + } + + /** + * Instructs a session to browse to an item or view. + * + * @param sessionId The session Id. (required) + * @param itemType The type of item to browse to. (required) + * @param itemId The Id of the item. (required) + * @param itemName The name of the item. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse displayContentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable BaseItemKind itemType, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String itemName) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = displayContentRequestBuilder(sessionId, itemType, itemId, + itemName); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("displayContent", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder displayContentRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable BaseItemKind itemType, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String itemName) + throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, "Missing the required parameter 'sessionId' when calling displayContent"); + } + // verify the required parameter 'itemType' is set + if (itemType == null) { + throw new ApiException(400, "Missing the required parameter 'itemType' when calling displayContent"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling displayContent"); + } + // verify the required parameter 'itemName' is set + if (itemName == null) { + throw new ApiException(400, "Missing the required parameter 'itemName' when calling displayContent"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/Viewing".replace("{sessionId}", + ApiClient.urlEncode(sessionId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "itemType"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("itemType", itemType)); + localVarQueryParameterBaseName = "itemId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("itemId", itemId)); + localVarQueryParameterBaseName = "itemName"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("itemName", itemName)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get all auth providers. + * + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getAuthProviders() throws ApiException { + ApiResponse> localVarResponse = getAuthProvidersWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Get all auth providers. + * + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getAuthProvidersWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAuthProvidersRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getAuthProviders", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAuthProvidersRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Auth/Providers"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get all password reset providers. + * + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getPasswordResetProviders() throws ApiException { + ApiResponse> localVarResponse = getPasswordResetProvidersWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Get all password reset providers. + * + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPasswordResetProvidersWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPasswordResetProvidersRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPasswordResetProviders", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPasswordResetProvidersRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Auth/PasswordResetProviders"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of sessions. + * + * @param controllableByUserId Filter by sessions that a given user is allowed to remote control. (optional) + * @param deviceId Filter by device Id. (optional) + * @param activeWithinSeconds Optional. Filter by sessions that were active in the last n seconds. (optional) + * @return List<SessionInfoDto> + * @throws ApiException if fails to make API call + */ + public List getSessions(@org.eclipse.jdt.annotation.NonNull UUID controllableByUserId, + @org.eclipse.jdt.annotation.NonNull String deviceId, + @org.eclipse.jdt.annotation.NonNull Integer activeWithinSeconds) throws ApiException { + ApiResponse> localVarResponse = getSessionsWithHttpInfo(controllableByUserId, deviceId, + activeWithinSeconds); + return localVarResponse.getData(); + } + + /** + * Gets a list of sessions. + * + * @param controllableByUserId Filter by sessions that a given user is allowed to remote control. (optional) + * @param deviceId Filter by device Id. (optional) + * @param activeWithinSeconds Optional. Filter by sessions that were active in the last n seconds. (optional) + * @return ApiResponse<List<SessionInfoDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getSessionsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID controllableByUserId, + @org.eclipse.jdt.annotation.NonNull String deviceId, + @org.eclipse.jdt.annotation.NonNull Integer activeWithinSeconds) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSessionsRequestBuilder(controllableByUserId, deviceId, + activeWithinSeconds); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSessions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSessionsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID controllableByUserId, + @org.eclipse.jdt.annotation.NonNull String deviceId, + @org.eclipse.jdt.annotation.NonNull Integer activeWithinSeconds) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "controllableByUserId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("controllableByUserId", controllableByUserId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "activeWithinSeconds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("activeWithinSeconds", activeWithinSeconds)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Instructs a session to play an item. + * + * @param sessionId The session id. (required) + * @param playCommand The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet + * implemented play next and play last may play now. (required) + * @param itemIds The ids of the items to play, comma delimited. (required) + * @param startPositionTicks The starting position of the first item. (optional) + * @param mediaSourceId Optional. The media source id. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to play. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to play. (optional) + * @param startIndex Optional. The start index. (optional) + * @throws ApiException if fails to make API call + */ + public void play(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlayCommand playCommand, + @org.eclipse.jdt.annotation.Nullable List itemIds, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer startIndex) throws ApiException { + playWithHttpInfo(sessionId, playCommand, itemIds, startPositionTicks, mediaSourceId, audioStreamIndex, + subtitleStreamIndex, startIndex); + } + + /** + * Instructs a session to play an item. + * + * @param sessionId The session id. (required) + * @param playCommand The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet + * implemented play next and play last may play now. (required) + * @param itemIds The ids of the items to play, comma delimited. (required) + * @param startPositionTicks The starting position of the first item. (optional) + * @param mediaSourceId Optional. The media source id. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to play. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to play. (optional) + * @param startIndex Optional. The start index. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse playWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlayCommand playCommand, + @org.eclipse.jdt.annotation.Nullable List itemIds, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer startIndex) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = playRequestBuilder(sessionId, playCommand, itemIds, + startPositionTicks, mediaSourceId, audioStreamIndex, subtitleStreamIndex, startIndex); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("play", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder playRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlayCommand playCommand, + @org.eclipse.jdt.annotation.Nullable List itemIds, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer startIndex) throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, "Missing the required parameter 'sessionId' when calling play"); + } + // verify the required parameter 'playCommand' is set + if (playCommand == null) { + throw new ApiException(400, "Missing the required parameter 'playCommand' when calling play"); + } + // verify the required parameter 'itemIds' is set + if (itemIds == null) { + throw new ApiException(400, "Missing the required parameter 'itemIds' when calling play"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/Playing".replace("{sessionId}", + ApiClient.urlEncode(sessionId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "playCommand"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playCommand", playCommand)); + localVarQueryParameterBaseName = "itemIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "itemIds", itemIds)); + localVarQueryParameterBaseName = "startPositionTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startPositionTicks", startPositionTicks)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates capabilities for a device. + * + * @param id The session id. (optional) + * @param playableMediaTypes A list of playable media types, comma delimited. Audio, Video, Book, Photo. (optional) + * @param supportedCommands A list of supported remote control commands, comma delimited. (optional) + * @param supportsMediaControl Determines whether media can be played remotely.. (optional, default to false) + * @param supportsPersistentIdentifier Determines whether the device supports a unique identifier. (optional, + * default to true) + * @throws ApiException if fails to make API call + */ + public void postCapabilities(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull List playableMediaTypes, + @org.eclipse.jdt.annotation.NonNull List supportedCommands, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl, + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier) throws ApiException { + postCapabilitiesWithHttpInfo(id, playableMediaTypes, supportedCommands, supportsMediaControl, + supportsPersistentIdentifier); + } + + /** + * Updates capabilities for a device. + * + * @param id The session id. (optional) + * @param playableMediaTypes A list of playable media types, comma delimited. Audio, Video, Book, Photo. (optional) + * @param supportedCommands A list of supported remote control commands, comma delimited. (optional) + * @param supportsMediaControl Determines whether media can be played remotely.. (optional, default to false) + * @param supportsPersistentIdentifier Determines whether the device supports a unique identifier. (optional, + * default to true) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postCapabilitiesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull List playableMediaTypes, + @org.eclipse.jdt.annotation.NonNull List supportedCommands, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl, + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postCapabilitiesRequestBuilder(id, playableMediaTypes, + supportedCommands, supportsMediaControl, supportsPersistentIdentifier); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postCapabilities", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postCapabilitiesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull List playableMediaTypes, + @org.eclipse.jdt.annotation.NonNull List supportedCommands, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl, + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/Capabilities"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + localVarQueryParameterBaseName = "playableMediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "playableMediaTypes", playableMediaTypes)); + localVarQueryParameterBaseName = "supportedCommands"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "supportedCommands", supportedCommands)); + localVarQueryParameterBaseName = "supportsMediaControl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("supportsMediaControl", supportsMediaControl)); + localVarQueryParameterBaseName = "supportsPersistentIdentifier"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("supportsPersistentIdentifier", supportsPersistentIdentifier)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates capabilities for a device. + * + * @param clientCapabilitiesDto The MediaBrowser.Model.Session.ClientCapabilities. (required) + * @param id The session id. (optional) + * @throws ApiException if fails to make API call + */ + public void postFullCapabilities(@org.eclipse.jdt.annotation.Nullable ClientCapabilitiesDto clientCapabilitiesDto, + @org.eclipse.jdt.annotation.NonNull String id) throws ApiException { + postFullCapabilitiesWithHttpInfo(clientCapabilitiesDto, id); + } + + /** + * Updates capabilities for a device. + * + * @param clientCapabilitiesDto The MediaBrowser.Model.Session.ClientCapabilities. (required) + * @param id The session id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postFullCapabilitiesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ClientCapabilitiesDto clientCapabilitiesDto, + @org.eclipse.jdt.annotation.NonNull String id) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postFullCapabilitiesRequestBuilder(clientCapabilitiesDto, id); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postFullCapabilities", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postFullCapabilitiesRequestBuilder( + @org.eclipse.jdt.annotation.Nullable ClientCapabilitiesDto clientCapabilitiesDto, + @org.eclipse.jdt.annotation.NonNull String id) throws ApiException { + // verify the required parameter 'clientCapabilitiesDto' is set + if (clientCapabilitiesDto == null) { + throw new ApiException(400, + "Missing the required parameter 'clientCapabilitiesDto' when calling postFullCapabilities"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/Capabilities/Full"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(clientCapabilitiesDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Removes an additional user from a session. + * + * @param sessionId The session id. (required) + * @param userId The user id. (required) + * @throws ApiException if fails to make API call + */ + public void removeUserFromSession(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + removeUserFromSessionWithHttpInfo(sessionId, userId); + } + + /** + * Removes an additional user from a session. + * + * @param sessionId The session id. (required) + * @param userId The user id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeUserFromSessionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeUserFromSessionRequestBuilder(sessionId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("removeUserFromSession", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder removeUserFromSessionRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable UUID userId) + throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, + "Missing the required parameter 'sessionId' when calling removeUserFromSession"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling removeUserFromSession"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/User/{userId}" + .replace("{sessionId}", ApiClient.urlEncode(sessionId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that a session has ended. + * + * @throws ApiException if fails to make API call + */ + public void reportSessionEnded() throws ApiException { + reportSessionEndedWithHttpInfo(); + } + + /** + * Reports that a session has ended. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportSessionEndedWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = reportSessionEndedRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("reportSessionEnded", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder reportSessionEndedRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/Logout"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that a session is viewing an item. + * + * @param itemId The item id. (required) + * @param sessionId The session id. (optional) + * @throws ApiException if fails to make API call + */ + public void reportViewing(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.NonNull String sessionId) throws ApiException { + reportViewingWithHttpInfo(itemId, sessionId); + } + + /** + * Reports that a session is viewing an item. + * + * @param itemId The item id. (required) + * @param sessionId The session id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportViewingWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.NonNull String sessionId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = reportViewingRequestBuilder(itemId, sessionId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("reportViewing", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder reportViewingRequestBuilder(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.NonNull String sessionId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling reportViewing"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/Viewing"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "sessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sessionId", sessionId)); + localVarQueryParameterBaseName = "itemId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("itemId", itemId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Issues a full general command to a client. + * + * @param sessionId The session id. (required) + * @param generalCommand The MediaBrowser.Model.Session.GeneralCommand. (required) + * @throws ApiException if fails to make API call + */ + public void sendFullGeneralCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommand generalCommand) throws ApiException { + sendFullGeneralCommandWithHttpInfo(sessionId, generalCommand); + } + + /** + * Issues a full general command to a client. + * + * @param sessionId The session id. (required) + * @param generalCommand The MediaBrowser.Model.Session.GeneralCommand. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendFullGeneralCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommand generalCommand) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendFullGeneralCommandRequestBuilder(sessionId, generalCommand); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("sendFullGeneralCommand", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendFullGeneralCommandRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommand generalCommand) throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, + "Missing the required parameter 'sessionId' when calling sendFullGeneralCommand"); + } + // verify the required parameter 'generalCommand' is set + if (generalCommand == null) { + throw new ApiException(400, + "Missing the required parameter 'generalCommand' when calling sendFullGeneralCommand"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/Command".replace("{sessionId}", + ApiClient.urlEncode(sessionId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(generalCommand); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Issues a general command to a client. + * + * @param sessionId The session id. (required) + * @param command The command to send. (required) + * @throws ApiException if fails to make API call + */ + public void sendGeneralCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command) throws ApiException { + sendGeneralCommandWithHttpInfo(sessionId, command); + } + + /** + * Issues a general command to a client. + * + * @param sessionId The session id. (required) + * @param command The command to send. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendGeneralCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendGeneralCommandRequestBuilder(sessionId, command); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("sendGeneralCommand", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendGeneralCommandRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command) throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, "Missing the required parameter 'sessionId' when calling sendGeneralCommand"); + } + // verify the required parameter 'command' is set + if (command == null) { + throw new ApiException(400, "Missing the required parameter 'command' when calling sendGeneralCommand"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/Command/{command}" + .replace("{sessionId}", ApiClient.urlEncode(sessionId.toString())) + .replace("{command}", ApiClient.urlEncode(command.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Issues a command to a client to display a message to the user. + * + * @param sessionId The session id. (required) + * @param messageCommand The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and + * TimeoutMs. (required) + * @throws ApiException if fails to make API call + */ + public void sendMessageCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable MessageCommand messageCommand) throws ApiException { + sendMessageCommandWithHttpInfo(sessionId, messageCommand); + } + + /** + * Issues a command to a client to display a message to the user. + * + * @param sessionId The session id. (required) + * @param messageCommand The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and + * TimeoutMs. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendMessageCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable MessageCommand messageCommand) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendMessageCommandRequestBuilder(sessionId, messageCommand); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("sendMessageCommand", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendMessageCommandRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable MessageCommand messageCommand) throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, "Missing the required parameter 'sessionId' when calling sendMessageCommand"); + } + // verify the required parameter 'messageCommand' is set + if (messageCommand == null) { + throw new ApiException(400, + "Missing the required parameter 'messageCommand' when calling sendMessageCommand"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/Message".replace("{sessionId}", + ApiClient.urlEncode(sessionId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(messageCommand); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Issues a playstate command to a client. + * + * @param sessionId The session id. (required) + * @param command The MediaBrowser.Model.Session.PlaystateCommand. (required) + * @param seekPositionTicks The optional position ticks. (optional) + * @param controllingUserId The optional controlling user id. (optional) + * @throws ApiException if fails to make API call + */ + public void sendPlaystateCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlaystateCommand command, + @org.eclipse.jdt.annotation.NonNull Long seekPositionTicks, + @org.eclipse.jdt.annotation.NonNull String controllingUserId) throws ApiException { + sendPlaystateCommandWithHttpInfo(sessionId, command, seekPositionTicks, controllingUserId); + } + + /** + * Issues a playstate command to a client. + * + * @param sessionId The session id. (required) + * @param command The MediaBrowser.Model.Session.PlaystateCommand. (required) + * @param seekPositionTicks The optional position ticks. (optional) + * @param controllingUserId The optional controlling user id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendPlaystateCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlaystateCommand command, + @org.eclipse.jdt.annotation.NonNull Long seekPositionTicks, + @org.eclipse.jdt.annotation.NonNull String controllingUserId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendPlaystateCommandRequestBuilder(sessionId, command, + seekPositionTicks, controllingUserId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("sendPlaystateCommand", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendPlaystateCommandRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlaystateCommand command, + @org.eclipse.jdt.annotation.NonNull Long seekPositionTicks, + @org.eclipse.jdt.annotation.NonNull String controllingUserId) throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, "Missing the required parameter 'sessionId' when calling sendPlaystateCommand"); + } + // verify the required parameter 'command' is set + if (command == null) { + throw new ApiException(400, "Missing the required parameter 'command' when calling sendPlaystateCommand"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/Playing/{command}" + .replace("{sessionId}", ApiClient.urlEncode(sessionId.toString())) + .replace("{command}", ApiClient.urlEncode(command.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "seekPositionTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("seekPositionTicks", seekPositionTicks)); + localVarQueryParameterBaseName = "controllingUserId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("controllingUserId", controllingUserId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Issues a system command to a client. + * + * @param sessionId The session id. (required) + * @param command The command to send. (required) + * @throws ApiException if fails to make API call + */ + public void sendSystemCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command) throws ApiException { + sendSystemCommandWithHttpInfo(sessionId, command); + } + + /** + * Issues a system command to a client. + * + * @param sessionId The session id. (required) + * @param command The command to send. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendSystemCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendSystemCommandRequestBuilder(sessionId, command); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("sendSystemCommand", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendSystemCommandRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command) throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, "Missing the required parameter 'sessionId' when calling sendSystemCommand"); + } + // verify the required parameter 'command' is set + if (command == null) { + throw new ApiException(400, "Missing the required parameter 'command' when calling sendSystemCommand"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/System/{command}" + .replace("{sessionId}", ApiClient.urlEncode(sessionId.toString())) + .replace("{command}", ApiClient.urlEncode(command.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/StartupApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/StartupApi.java new file mode 100644 index 0000000000000..2a95121d4173e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/StartupApi.java @@ -0,0 +1,584 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.StartupConfigurationDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.StartupRemoteAccessDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.StartupUserDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class StartupApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public StartupApi() { + this(Configuration.getDefaultApiClient()); + } + + public StartupApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Completes the startup wizard. + * + * @throws ApiException if fails to make API call + */ + public void completeWizard() throws ApiException { + completeWizardWithHttpInfo(); + } + + /** + * Completes the startup wizard. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse completeWizardWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = completeWizardRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("completeWizard", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder completeWizardRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Startup/Complete"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the first user. + * + * @return StartupUserDto + * @throws ApiException if fails to make API call + */ + public StartupUserDto getFirstUser() throws ApiException { + ApiResponse localVarResponse = getFirstUserWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets the first user. + * + * @return ApiResponse<StartupUserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFirstUserWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFirstUserRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getFirstUser", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getFirstUserRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Startup/User"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the first user. + * + * @return StartupUserDto + * @throws ApiException if fails to make API call + */ + public StartupUserDto getFirstUser2() throws ApiException { + ApiResponse localVarResponse = getFirstUser2WithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets the first user. + * + * @return ApiResponse<StartupUserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFirstUser2WithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFirstUser2RequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getFirstUser2", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getFirstUser2RequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Startup/FirstUser"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the initial startup wizard configuration. + * + * @return StartupConfigurationDto + * @throws ApiException if fails to make API call + */ + public StartupConfigurationDto getStartupConfiguration() throws ApiException { + ApiResponse localVarResponse = getStartupConfigurationWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets the initial startup wizard configuration. + * + * @return ApiResponse<StartupConfigurationDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStartupConfigurationWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getStartupConfigurationRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getStartupConfiguration", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getStartupConfigurationRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Startup/Configuration"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sets remote access and UPnP. + * + * @param startupRemoteAccessDto The startup remote access dto. (required) + * @throws ApiException if fails to make API call + */ + public void setRemoteAccess(@org.eclipse.jdt.annotation.Nullable StartupRemoteAccessDto startupRemoteAccessDto) + throws ApiException { + setRemoteAccessWithHttpInfo(startupRemoteAccessDto); + } + + /** + * Sets remote access and UPnP. + * + * @param startupRemoteAccessDto The startup remote access dto. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setRemoteAccessWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable StartupRemoteAccessDto startupRemoteAccessDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = setRemoteAccessRequestBuilder(startupRemoteAccessDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("setRemoteAccess", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder setRemoteAccessRequestBuilder( + @org.eclipse.jdt.annotation.Nullable StartupRemoteAccessDto startupRemoteAccessDto) throws ApiException { + // verify the required parameter 'startupRemoteAccessDto' is set + if (startupRemoteAccessDto == null) { + throw new ApiException(400, + "Missing the required parameter 'startupRemoteAccessDto' when calling setRemoteAccess"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Startup/RemoteAccess"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(startupRemoteAccessDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sets the initial startup wizard configuration. + * + * @param startupConfigurationDto The updated startup configuration. (required) + * @throws ApiException if fails to make API call + */ + public void updateInitialConfiguration( + @org.eclipse.jdt.annotation.Nullable StartupConfigurationDto startupConfigurationDto) throws ApiException { + updateInitialConfigurationWithHttpInfo(startupConfigurationDto); + } + + /** + * Sets the initial startup wizard configuration. + * + * @param startupConfigurationDto The updated startup configuration. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateInitialConfigurationWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable StartupConfigurationDto startupConfigurationDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateInitialConfigurationRequestBuilder(startupConfigurationDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateInitialConfiguration", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateInitialConfigurationRequestBuilder( + @org.eclipse.jdt.annotation.Nullable StartupConfigurationDto startupConfigurationDto) throws ApiException { + // verify the required parameter 'startupConfigurationDto' is set + if (startupConfigurationDto == null) { + throw new ApiException(400, + "Missing the required parameter 'startupConfigurationDto' when calling updateInitialConfiguration"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Startup/Configuration"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(startupConfigurationDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sets the user name and password. + * + * @param startupUserDto The DTO containing username and password. (optional) + * @throws ApiException if fails to make API call + */ + public void updateStartupUser(@org.eclipse.jdt.annotation.NonNull StartupUserDto startupUserDto) + throws ApiException { + updateStartupUserWithHttpInfo(startupUserDto); + } + + /** + * Sets the user name and password. + * + * @param startupUserDto The DTO containing username and password. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateStartupUserWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull StartupUserDto startupUserDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateStartupUserRequestBuilder(startupUserDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateStartupUser", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateStartupUserRequestBuilder( + @org.eclipse.jdt.annotation.NonNull StartupUserDto startupUserDto) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Startup/User"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(startupUserDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/StudiosApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/StudiosApi.java new file mode 100644 index 0000000000000..8a22e8f421271 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/StudiosApi.java @@ -0,0 +1,394 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFields; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class StudiosApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public StudiosApi() { + this(Configuration.getDefaultApiClient()); + } + + public StudiosApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets a studio by name. + * + * @param name Studio name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getStudio(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = getStudioWithHttpInfo(name, userId); + return localVarResponse.getData(); + } + + /** + * Gets a studio by name. + * + * @param name Studio name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStudioWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getStudioRequestBuilder(name, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getStudio", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getStudioRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getStudio"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Studios/{name}".replace("{name}", ApiClient.urlEncode(name.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all studios from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getStudios(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + ApiResponse localVarResponse = getStudiosWithHttpInfo(startIndex, limit, searchTerm, + parentId, fields, excludeItemTypes, includeItemTypes, isFavorite, enableUserData, imageTypeLimit, + enableImageTypes, userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, enableImages, + enableTotalRecordCount); + return localVarResponse.getData(); + } + + /** + * Gets all studios from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStudiosWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getStudiosRequestBuilder(startIndex, limit, searchTerm, parentId, + fields, excludeItemTypes, includeItemTypes, isFavorite, enableUserData, imageTypeLimit, + enableImageTypes, userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, enableImages, + enableTotalRecordCount); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getStudios", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getStudiosRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Studios"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "nameStartsWithOrGreater"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWithOrGreater", nameStartsWithOrGreater)); + localVarQueryParameterBaseName = "nameStartsWith"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWith", nameStartsWith)); + localVarQueryParameterBaseName = "nameLessThan"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameLessThan", nameLessThan)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SubtitleApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SubtitleApi.java new file mode 100644 index 0000000000000..90b8857fea3ae --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SubtitleApi.java @@ -0,0 +1,1158 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.FontFile; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.RemoteSubtitleInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UploadSubtitleDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SubtitleApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public SubtitleApi() { + this(Configuration.getDefaultApiClient()); + } + + public SubtitleApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Deletes an external subtitle file. + * + * @param itemId The item id. (required) + * @param index The index of the subtitle file. (required) + * @throws ApiException if fails to make API call + */ + public void deleteSubtitle(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { + deleteSubtitleWithHttpInfo(itemId, index); + } + + /** + * Deletes an external subtitle file. + * + * @param itemId The item id. (required) + * @param index The index of the subtitle file. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteSubtitleWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteSubtitleRequestBuilder(itemId, index); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteSubtitle", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteSubtitleRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteSubtitle"); + } + // verify the required parameter 'index' is set + if (index == null) { + throw new ApiException(400, "Missing the required parameter 'index' when calling deleteSubtitle"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/Subtitles/{index}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{index}", ApiClient.urlEncode(index.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Downloads a remote subtitle. + * + * @param itemId The item id. (required) + * @param subtitleId The subtitle id. (required) + * @throws ApiException if fails to make API call + */ + public void downloadRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String subtitleId) throws ApiException { + downloadRemoteSubtitlesWithHttpInfo(itemId, subtitleId); + } + + /** + * Downloads a remote subtitle. + * + * @param itemId The item id. (required) + * @param subtitleId The subtitle id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse downloadRemoteSubtitlesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String subtitleId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = downloadRemoteSubtitlesRequestBuilder(itemId, subtitleId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("downloadRemoteSubtitles", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder downloadRemoteSubtitlesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String subtitleId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling downloadRemoteSubtitles"); + } + // verify the required parameter 'subtitleId' is set + if (subtitleId == null) { + throw new ApiException(400, + "Missing the required parameter 'subtitleId' when calling downloadRemoteSubtitles"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/RemoteSearch/Subtitles/{subtitleId}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{subtitleId}", ApiClient.urlEncode(subtitleId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a fallback font file. + * + * @param name The name of the fallback font file to get. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getFallbackFont(@org.eclipse.jdt.annotation.Nullable String name) throws ApiException { + ApiResponse localVarResponse = getFallbackFontWithHttpInfo(name); + return localVarResponse.getData(); + } + + /** + * Gets a fallback font file. + * + * @param name The name of the fallback font file to get. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFallbackFontWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFallbackFontRequestBuilder(name); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getFallbackFont", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getFallbackFontRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name) + throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getFallbackFont"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/FallbackFont/Fonts/{name}".replace("{name}", ApiClient.urlEncode(name.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "font/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of available fallback font files. + * + * @return List<FontFile> + * @throws ApiException if fails to make API call + */ + public List getFallbackFontList() throws ApiException { + ApiResponse> localVarResponse = getFallbackFontListWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets a list of available fallback font files. + * + * @return ApiResponse<List<FontFile>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getFallbackFontListWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFallbackFontListRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getFallbackFontList", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getFallbackFontListRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/FallbackFont/Fonts"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the remote subtitles. + * + * @param subtitleId The item id. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable String subtitleId) throws ApiException { + ApiResponse localVarResponse = getRemoteSubtitlesWithHttpInfo(subtitleId); + return localVarResponse.getData(); + } + + /** + * Gets the remote subtitles. + * + * @param subtitleId The item id. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRemoteSubtitlesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String subtitleId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRemoteSubtitlesRequestBuilder(subtitleId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRemoteSubtitles", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRemoteSubtitlesRequestBuilder(@org.eclipse.jdt.annotation.Nullable String subtitleId) + throws ApiException { + // verify the required parameter 'subtitleId' is set + if (subtitleId == null) { + throw new ApiException(400, "Missing the required parameter 'subtitleId' when calling getRemoteSubtitles"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Providers/Subtitles/Subtitles/{subtitleId}".replace("{subtitleId}", + ApiClient.urlEncode(subtitleId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets subtitles in a specified format. + * + * @param routeItemId The (route) item id. (required) + * @param routeMediaSourceId The (route) media source id. (required) + * @param routeIndex The (route) subtitle stream index. (required) + * @param routeFormat The (route) format of the returned subtitle. (required) + * @param itemId The item id. (optional) + * @param mediaSourceId The media source id. (optional) + * @param index The subtitle stream index. (optional) + * @param format The format of the returned subtitle. (optional) + * @param endPositionTicks Optional. The end position of the subtitle in ticks. (optional) + * @param copyTimestamps Optional. Whether to copy the timestamps. (optional, default to false) + * @param addVttTimeMap Optional. Whether to add a VTT time map. (optional, default to false) + * @param startPositionTicks The start position of the subtitle in ticks. (optional, default to 0) + * @return File + * @throws ApiException if fails to make API call + */ + public File getSubtitle(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks) throws ApiException { + ApiResponse localVarResponse = getSubtitleWithHttpInfo(routeItemId, routeMediaSourceId, routeIndex, + routeFormat, itemId, mediaSourceId, index, format, endPositionTicks, copyTimestamps, addVttTimeMap, + startPositionTicks); + return localVarResponse.getData(); + } + + /** + * Gets subtitles in a specified format. + * + * @param routeItemId The (route) item id. (required) + * @param routeMediaSourceId The (route) media source id. (required) + * @param routeIndex The (route) subtitle stream index. (required) + * @param routeFormat The (route) format of the returned subtitle. (required) + * @param itemId The item id. (optional) + * @param mediaSourceId The media source id. (optional) + * @param index The subtitle stream index. (optional) + * @param format The format of the returned subtitle. (optional) + * @param endPositionTicks Optional. The end position of the subtitle in ticks. (optional) + * @param copyTimestamps Optional. Whether to copy the timestamps. (optional, default to false) + * @param addVttTimeMap Optional. Whether to add a VTT time map. (optional, default to false) + * @param startPositionTicks The start position of the subtitle in ticks. (optional, default to 0) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSubtitleWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSubtitleRequestBuilder(routeItemId, routeMediaSourceId, + routeIndex, routeFormat, itemId, mediaSourceId, index, format, endPositionTicks, copyTimestamps, + addVttTimeMap, startPositionTicks); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSubtitle", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSubtitleRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks) throws ApiException { + // verify the required parameter 'routeItemId' is set + if (routeItemId == null) { + throw new ApiException(400, "Missing the required parameter 'routeItemId' when calling getSubtitle"); + } + // verify the required parameter 'routeMediaSourceId' is set + if (routeMediaSourceId == null) { + throw new ApiException(400, "Missing the required parameter 'routeMediaSourceId' when calling getSubtitle"); + } + // verify the required parameter 'routeIndex' is set + if (routeIndex == null) { + throw new ApiException(400, "Missing the required parameter 'routeIndex' when calling getSubtitle"); + } + // verify the required parameter 'routeFormat' is set + if (routeFormat == null) { + throw new ApiException(400, "Missing the required parameter 'routeFormat' when calling getSubtitle"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/Stream.{routeFormat}" + .replace("{routeItemId}", ApiClient.urlEncode(routeItemId.toString())) + .replace("{routeMediaSourceId}", ApiClient.urlEncode(routeMediaSourceId.toString())) + .replace("{routeIndex}", ApiClient.urlEncode(routeIndex.toString())) + .replace("{routeFormat}", ApiClient.urlEncode(routeFormat.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "itemId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("itemId", itemId)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "index"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("index", index)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "endPositionTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("endPositionTicks", endPositionTicks)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "addVttTimeMap"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addVttTimeMap", addVttTimeMap)); + localVarQueryParameterBaseName = "startPositionTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startPositionTicks", startPositionTicks)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "text/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an HLS subtitle playlist. + * + * @param itemId The item id. (required) + * @param index The subtitle stream index. (required) + * @param mediaSourceId The media source id. (required) + * @param segmentLength The subtitle segment length. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getSubtitlePlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer segmentLength) throws ApiException { + ApiResponse localVarResponse = getSubtitlePlaylistWithHttpInfo(itemId, index, mediaSourceId, + segmentLength); + return localVarResponse.getData(); + } + + /** + * Gets an HLS subtitle playlist. + * + * @param itemId The item id. (required) + * @param index The subtitle stream index. (required) + * @param mediaSourceId The media source id. (required) + * @param segmentLength The subtitle segment length. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSubtitlePlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer segmentLength) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSubtitlePlaylistRequestBuilder(itemId, index, mediaSourceId, + segmentLength); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSubtitlePlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSubtitlePlaylistRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer segmentLength) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSubtitlePlaylist"); + } + // verify the required parameter 'index' is set + if (index == null) { + throw new ApiException(400, "Missing the required parameter 'index' when calling getSubtitlePlaylist"); + } + // verify the required parameter 'mediaSourceId' is set + if (mediaSourceId == null) { + throw new ApiException(400, + "Missing the required parameter 'mediaSourceId' when calling getSubtitlePlaylist"); + } + // verify the required parameter 'segmentLength' is set + if (segmentLength == null) { + throw new ApiException(400, + "Missing the required parameter 'segmentLength' when calling getSubtitlePlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/{mediaSourceId}/Subtitles/{index}/subtitles.m3u8" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{index}", ApiClient.urlEncode(index.toString())) + .replace("{mediaSourceId}", ApiClient.urlEncode(mediaSourceId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/x-mpegURL, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets subtitles in a specified format. + * + * @param routeItemId The (route) item id. (required) + * @param routeMediaSourceId The (route) media source id. (required) + * @param routeIndex The (route) subtitle stream index. (required) + * @param routeStartPositionTicks The (route) start position of the subtitle in ticks. (required) + * @param routeFormat The (route) format of the returned subtitle. (required) + * @param itemId The item id. (optional) + * @param mediaSourceId The media source id. (optional) + * @param index The subtitle stream index. (optional) + * @param startPositionTicks The start position of the subtitle in ticks. (optional) + * @param format The format of the returned subtitle. (optional) + * @param endPositionTicks Optional. The end position of the subtitle in ticks. (optional) + * @param copyTimestamps Optional. Whether to copy the timestamps. (optional, default to false) + * @param addVttTimeMap Optional. Whether to add a VTT time map. (optional, default to false) + * @return File + * @throws ApiException if fails to make API call + */ + public File getSubtitleWithTicks(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable Long routeStartPositionTicks, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap) throws ApiException { + ApiResponse localVarResponse = getSubtitleWithTicksWithHttpInfo(routeItemId, routeMediaSourceId, + routeIndex, routeStartPositionTicks, routeFormat, itemId, mediaSourceId, index, startPositionTicks, + format, endPositionTicks, copyTimestamps, addVttTimeMap); + return localVarResponse.getData(); + } + + /** + * Gets subtitles in a specified format. + * + * @param routeItemId The (route) item id. (required) + * @param routeMediaSourceId The (route) media source id. (required) + * @param routeIndex The (route) subtitle stream index. (required) + * @param routeStartPositionTicks The (route) start position of the subtitle in ticks. (required) + * @param routeFormat The (route) format of the returned subtitle. (required) + * @param itemId The item id. (optional) + * @param mediaSourceId The media source id. (optional) + * @param index The subtitle stream index. (optional) + * @param startPositionTicks The start position of the subtitle in ticks. (optional) + * @param format The format of the returned subtitle. (optional) + * @param endPositionTicks Optional. The end position of the subtitle in ticks. (optional) + * @param copyTimestamps Optional. Whether to copy the timestamps. (optional, default to false) + * @param addVttTimeMap Optional. Whether to add a VTT time map. (optional, default to false) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSubtitleWithTicksWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable Long routeStartPositionTicks, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSubtitleWithTicksRequestBuilder(routeItemId, routeMediaSourceId, + routeIndex, routeStartPositionTicks, routeFormat, itemId, mediaSourceId, index, startPositionTicks, + format, endPositionTicks, copyTimestamps, addVttTimeMap); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSubtitleWithTicks", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSubtitleWithTicksRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable Long routeStartPositionTicks, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap) throws ApiException { + // verify the required parameter 'routeItemId' is set + if (routeItemId == null) { + throw new ApiException(400, + "Missing the required parameter 'routeItemId' when calling getSubtitleWithTicks"); + } + // verify the required parameter 'routeMediaSourceId' is set + if (routeMediaSourceId == null) { + throw new ApiException(400, + "Missing the required parameter 'routeMediaSourceId' when calling getSubtitleWithTicks"); + } + // verify the required parameter 'routeIndex' is set + if (routeIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'routeIndex' when calling getSubtitleWithTicks"); + } + // verify the required parameter 'routeStartPositionTicks' is set + if (routeStartPositionTicks == null) { + throw new ApiException(400, + "Missing the required parameter 'routeStartPositionTicks' when calling getSubtitleWithTicks"); + } + // verify the required parameter 'routeFormat' is set + if (routeFormat == null) { + throw new ApiException(400, + "Missing the required parameter 'routeFormat' when calling getSubtitleWithTicks"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/{routeStartPositionTicks}/Stream.{routeFormat}" + .replace("{routeItemId}", ApiClient.urlEncode(routeItemId.toString())) + .replace("{routeMediaSourceId}", ApiClient.urlEncode(routeMediaSourceId.toString())) + .replace("{routeIndex}", ApiClient.urlEncode(routeIndex.toString())) + .replace("{routeStartPositionTicks}", ApiClient.urlEncode(routeStartPositionTicks.toString())) + .replace("{routeFormat}", ApiClient.urlEncode(routeFormat.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "itemId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("itemId", itemId)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "index"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("index", index)); + localVarQueryParameterBaseName = "startPositionTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startPositionTicks", startPositionTicks)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "endPositionTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("endPositionTicks", endPositionTicks)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "addVttTimeMap"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addVttTimeMap", addVttTimeMap)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "text/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Search remote subtitles. + * + * @param itemId The item id. (required) + * @param language The language of the subtitles. (required) + * @param isPerfectMatch Optional. Only show subtitles which are a perfect match. (optional) + * @return List<RemoteSubtitleInfo> + * @throws ApiException if fails to make API call + */ + public List searchRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String language, + @org.eclipse.jdt.annotation.NonNull Boolean isPerfectMatch) throws ApiException { + ApiResponse> localVarResponse = searchRemoteSubtitlesWithHttpInfo(itemId, language, + isPerfectMatch); + return localVarResponse.getData(); + } + + /** + * Search remote subtitles. + * + * @param itemId The item id. (required) + * @param language The language of the subtitles. (required) + * @param isPerfectMatch Optional. Only show subtitles which are a perfect match. (optional) + * @return ApiResponse<List<RemoteSubtitleInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> searchRemoteSubtitlesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String language, + @org.eclipse.jdt.annotation.NonNull Boolean isPerfectMatch) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = searchRemoteSubtitlesRequestBuilder(itemId, language, + isPerfectMatch); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("searchRemoteSubtitles", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder searchRemoteSubtitlesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String language, + @org.eclipse.jdt.annotation.NonNull Boolean isPerfectMatch) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling searchRemoteSubtitles"); + } + // verify the required parameter 'language' is set + if (language == null) { + throw new ApiException(400, "Missing the required parameter 'language' when calling searchRemoteSubtitles"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/RemoteSearch/Subtitles/{language}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{language}", ApiClient.urlEncode(language.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "isPerfectMatch"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isPerfectMatch", isPerfectMatch)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Upload an external subtitle file. + * + * @param itemId The item the subtitle belongs to. (required) + * @param uploadSubtitleDto The request body. (required) + * @throws ApiException if fails to make API call + */ + public void uploadSubtitle(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UploadSubtitleDto uploadSubtitleDto) throws ApiException { + uploadSubtitleWithHttpInfo(itemId, uploadSubtitleDto); + } + + /** + * Upload an external subtitle file. + * + * @param itemId The item the subtitle belongs to. (required) + * @param uploadSubtitleDto The request body. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse uploadSubtitleWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UploadSubtitleDto uploadSubtitleDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uploadSubtitleRequestBuilder(itemId, uploadSubtitleDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("uploadSubtitle", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uploadSubtitleRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UploadSubtitleDto uploadSubtitleDto) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling uploadSubtitle"); + } + // verify the required parameter 'uploadSubtitleDto' is set + if (uploadSubtitleDto == null) { + throw new ApiException(400, + "Missing the required parameter 'uploadSubtitleDto' when calling uploadSubtitle"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/Subtitles".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(uploadSubtitleDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SuggestionsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SuggestionsApi.java new file mode 100644 index 0000000000000..e80d55ddd13a3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SuggestionsApi.java @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MediaType; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SuggestionsApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public SuggestionsApi() { + this(Configuration.getDefaultApiClient()); + } + + public SuggestionsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets suggestions. + * + * @param userId The user id. (optional) + * @param mediaType The media types. (optional) + * @param type The type. (optional) + * @param startIndex Optional. The start index. (optional) + * @param limit Optional. The limit. (optional) + * @param enableTotalRecordCount Whether to enable the total record count. (optional, default to false) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSuggestions(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List mediaType, + @org.eclipse.jdt.annotation.NonNull List type, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + ApiResponse localVarResponse = getSuggestionsWithHttpInfo(userId, mediaType, type, + startIndex, limit, enableTotalRecordCount); + return localVarResponse.getData(); + } + + /** + * Gets suggestions. + * + * @param userId The user id. (optional) + * @param mediaType The media types. (optional) + * @param type The type. (optional) + * @param startIndex Optional. The start index. (optional) + * @param limit Optional. The limit. (optional) + * @param enableTotalRecordCount Whether to enable the total record count. (optional, default to false) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSuggestionsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List mediaType, + @org.eclipse.jdt.annotation.NonNull List type, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSuggestionsRequestBuilder(userId, mediaType, type, startIndex, + limit, enableTotalRecordCount); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSuggestions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSuggestionsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List mediaType, + @org.eclipse.jdt.annotation.NonNull List type, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/Suggestions"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "mediaType"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaType", mediaType)); + localVarQueryParameterBaseName = "type"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "type", type)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SyncPlayApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SyncPlayApi.java new file mode 100644 index 0000000000000..35978f8d7b9e3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SyncPlayApi.java @@ -0,0 +1,1683 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.List; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BufferRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.GroupInfoDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.IgnoreWaitRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.JoinGroupRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MovePlaylistItemRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.NewGroupRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.NextItemRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PingRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PlayRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PreviousItemRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.QueueRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ReadyRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.RemoveFromPlaylistRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SeekRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SetPlaylistItemRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SetRepeatModeRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SetShuffleModeRequestDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SyncPlayApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public SyncPlayApi() { + this(Configuration.getDefaultApiClient()); + } + + public SyncPlayApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Notify SyncPlay group that member is buffering. + * + * @param bufferRequestDto The player status. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayBuffering(@org.eclipse.jdt.annotation.Nullable BufferRequestDto bufferRequestDto) + throws ApiException { + syncPlayBufferingWithHttpInfo(bufferRequestDto); + } + + /** + * Notify SyncPlay group that member is buffering. + * + * @param bufferRequestDto The player status. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayBufferingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable BufferRequestDto bufferRequestDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayBufferingRequestBuilder(bufferRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayBuffering", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayBufferingRequestBuilder( + @org.eclipse.jdt.annotation.Nullable BufferRequestDto bufferRequestDto) throws ApiException { + // verify the required parameter 'bufferRequestDto' is set + if (bufferRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'bufferRequestDto' when calling syncPlayBuffering"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Buffering"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(bufferRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a new SyncPlay group. + * + * @param newGroupRequestDto The settings of the new group. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayCreateGroup(@org.eclipse.jdt.annotation.Nullable NewGroupRequestDto newGroupRequestDto) + throws ApiException { + syncPlayCreateGroupWithHttpInfo(newGroupRequestDto); + } + + /** + * Create a new SyncPlay group. + * + * @param newGroupRequestDto The settings of the new group. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayCreateGroupWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable NewGroupRequestDto newGroupRequestDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayCreateGroupRequestBuilder(newGroupRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayCreateGroup", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayCreateGroupRequestBuilder( + @org.eclipse.jdt.annotation.Nullable NewGroupRequestDto newGroupRequestDto) throws ApiException { + // verify the required parameter 'newGroupRequestDto' is set + if (newGroupRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'newGroupRequestDto' when calling syncPlayCreateGroup"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/New"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(newGroupRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all SyncPlay groups. + * + * @return List<GroupInfoDto> + * @throws ApiException if fails to make API call + */ + public List syncPlayGetGroups() throws ApiException { + ApiResponse> localVarResponse = syncPlayGetGroupsWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets all SyncPlay groups. + * + * @return ApiResponse<List<GroupInfoDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> syncPlayGetGroupsWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayGetGroupsRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayGetGroups", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayGetGroupsRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/List"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Join an existing SyncPlay group. + * + * @param joinGroupRequestDto The group to join. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayJoinGroup(@org.eclipse.jdt.annotation.Nullable JoinGroupRequestDto joinGroupRequestDto) + throws ApiException { + syncPlayJoinGroupWithHttpInfo(joinGroupRequestDto); + } + + /** + * Join an existing SyncPlay group. + * + * @param joinGroupRequestDto The group to join. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayJoinGroupWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable JoinGroupRequestDto joinGroupRequestDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayJoinGroupRequestBuilder(joinGroupRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayJoinGroup", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayJoinGroupRequestBuilder( + @org.eclipse.jdt.annotation.Nullable JoinGroupRequestDto joinGroupRequestDto) throws ApiException { + // verify the required parameter 'joinGroupRequestDto' is set + if (joinGroupRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'joinGroupRequestDto' when calling syncPlayJoinGroup"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Join"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(joinGroupRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Leave the joined SyncPlay group. + * + * @throws ApiException if fails to make API call + */ + public void syncPlayLeaveGroup() throws ApiException { + syncPlayLeaveGroupWithHttpInfo(); + } + + /** + * Leave the joined SyncPlay group. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayLeaveGroupWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayLeaveGroupRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayLeaveGroup", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayLeaveGroupRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Leave"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request to move an item in the playlist in SyncPlay group. + * + * @param movePlaylistItemRequestDto The new position for the item. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayMovePlaylistItem( + @org.eclipse.jdt.annotation.Nullable MovePlaylistItemRequestDto movePlaylistItemRequestDto) + throws ApiException { + syncPlayMovePlaylistItemWithHttpInfo(movePlaylistItemRequestDto); + } + + /** + * Request to move an item in the playlist in SyncPlay group. + * + * @param movePlaylistItemRequestDto The new position for the item. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayMovePlaylistItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MovePlaylistItemRequestDto movePlaylistItemRequestDto) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayMovePlaylistItemRequestBuilder(movePlaylistItemRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayMovePlaylistItem", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayMovePlaylistItemRequestBuilder( + @org.eclipse.jdt.annotation.Nullable MovePlaylistItemRequestDto movePlaylistItemRequestDto) + throws ApiException { + // verify the required parameter 'movePlaylistItemRequestDto' is set + if (movePlaylistItemRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'movePlaylistItemRequestDto' when calling syncPlayMovePlaylistItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/MovePlaylistItem"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(movePlaylistItemRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request next item in SyncPlay group. + * + * @param nextItemRequestDto The current item information. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayNextItem(@org.eclipse.jdt.annotation.Nullable NextItemRequestDto nextItemRequestDto) + throws ApiException { + syncPlayNextItemWithHttpInfo(nextItemRequestDto); + } + + /** + * Request next item in SyncPlay group. + * + * @param nextItemRequestDto The current item information. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayNextItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable NextItemRequestDto nextItemRequestDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayNextItemRequestBuilder(nextItemRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayNextItem", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayNextItemRequestBuilder( + @org.eclipse.jdt.annotation.Nullable NextItemRequestDto nextItemRequestDto) throws ApiException { + // verify the required parameter 'nextItemRequestDto' is set + if (nextItemRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'nextItemRequestDto' when calling syncPlayNextItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/NextItem"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(nextItemRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request pause in SyncPlay group. + * + * @throws ApiException if fails to make API call + */ + public void syncPlayPause() throws ApiException { + syncPlayPauseWithHttpInfo(); + } + + /** + * Request pause in SyncPlay group. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayPauseWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayPauseRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayPause", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayPauseRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Pause"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update session ping. + * + * @param pingRequestDto The new ping. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayPing(@org.eclipse.jdt.annotation.Nullable PingRequestDto pingRequestDto) throws ApiException { + syncPlayPingWithHttpInfo(pingRequestDto); + } + + /** + * Update session ping. + * + * @param pingRequestDto The new ping. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayPingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable PingRequestDto pingRequestDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayPingRequestBuilder(pingRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayPing", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayPingRequestBuilder( + @org.eclipse.jdt.annotation.Nullable PingRequestDto pingRequestDto) throws ApiException { + // verify the required parameter 'pingRequestDto' is set + if (pingRequestDto == null) { + throw new ApiException(400, "Missing the required parameter 'pingRequestDto' when calling syncPlayPing"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Ping"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(pingRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request previous item in SyncPlay group. + * + * @param previousItemRequestDto The current item information. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayPreviousItem(@org.eclipse.jdt.annotation.Nullable PreviousItemRequestDto previousItemRequestDto) + throws ApiException { + syncPlayPreviousItemWithHttpInfo(previousItemRequestDto); + } + + /** + * Request previous item in SyncPlay group. + * + * @param previousItemRequestDto The current item information. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayPreviousItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable PreviousItemRequestDto previousItemRequestDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayPreviousItemRequestBuilder(previousItemRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayPreviousItem", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayPreviousItemRequestBuilder( + @org.eclipse.jdt.annotation.Nullable PreviousItemRequestDto previousItemRequestDto) throws ApiException { + // verify the required parameter 'previousItemRequestDto' is set + if (previousItemRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'previousItemRequestDto' when calling syncPlayPreviousItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/PreviousItem"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(previousItemRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request to queue items to the playlist of a SyncPlay group. + * + * @param queueRequestDto The items to add. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayQueue(@org.eclipse.jdt.annotation.Nullable QueueRequestDto queueRequestDto) + throws ApiException { + syncPlayQueueWithHttpInfo(queueRequestDto); + } + + /** + * Request to queue items to the playlist of a SyncPlay group. + * + * @param queueRequestDto The items to add. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayQueueWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable QueueRequestDto queueRequestDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayQueueRequestBuilder(queueRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayQueue", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayQueueRequestBuilder( + @org.eclipse.jdt.annotation.Nullable QueueRequestDto queueRequestDto) throws ApiException { + // verify the required parameter 'queueRequestDto' is set + if (queueRequestDto == null) { + throw new ApiException(400, "Missing the required parameter 'queueRequestDto' when calling syncPlayQueue"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Queue"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(queueRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Notify SyncPlay group that member is ready for playback. + * + * @param readyRequestDto The player status. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayReady(@org.eclipse.jdt.annotation.Nullable ReadyRequestDto readyRequestDto) + throws ApiException { + syncPlayReadyWithHttpInfo(readyRequestDto); + } + + /** + * Notify SyncPlay group that member is ready for playback. + * + * @param readyRequestDto The player status. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayReadyWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ReadyRequestDto readyRequestDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayReadyRequestBuilder(readyRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayReady", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayReadyRequestBuilder( + @org.eclipse.jdt.annotation.Nullable ReadyRequestDto readyRequestDto) throws ApiException { + // verify the required parameter 'readyRequestDto' is set + if (readyRequestDto == null) { + throw new ApiException(400, "Missing the required parameter 'readyRequestDto' when calling syncPlayReady"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Ready"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(readyRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request to remove items from the playlist in SyncPlay group. + * + * @param removeFromPlaylistRequestDto The items to remove. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayRemoveFromPlaylist( + @org.eclipse.jdt.annotation.Nullable RemoveFromPlaylistRequestDto removeFromPlaylistRequestDto) + throws ApiException { + syncPlayRemoveFromPlaylistWithHttpInfo(removeFromPlaylistRequestDto); + } + + /** + * Request to remove items from the playlist in SyncPlay group. + * + * @param removeFromPlaylistRequestDto The items to remove. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayRemoveFromPlaylistWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable RemoveFromPlaylistRequestDto removeFromPlaylistRequestDto) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayRemoveFromPlaylistRequestBuilder( + removeFromPlaylistRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayRemoveFromPlaylist", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayRemoveFromPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable RemoveFromPlaylistRequestDto removeFromPlaylistRequestDto) + throws ApiException { + // verify the required parameter 'removeFromPlaylistRequestDto' is set + if (removeFromPlaylistRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'removeFromPlaylistRequestDto' when calling syncPlayRemoveFromPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/RemoveFromPlaylist"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(removeFromPlaylistRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request seek in SyncPlay group. + * + * @param seekRequestDto The new playback position. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlaySeek(@org.eclipse.jdt.annotation.Nullable SeekRequestDto seekRequestDto) throws ApiException { + syncPlaySeekWithHttpInfo(seekRequestDto); + } + + /** + * Request seek in SyncPlay group. + * + * @param seekRequestDto The new playback position. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySeekWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SeekRequestDto seekRequestDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySeekRequestBuilder(seekRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlaySeek", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlaySeekRequestBuilder( + @org.eclipse.jdt.annotation.Nullable SeekRequestDto seekRequestDto) throws ApiException { + // verify the required parameter 'seekRequestDto' is set + if (seekRequestDto == null) { + throw new ApiException(400, "Missing the required parameter 'seekRequestDto' when calling syncPlaySeek"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Seek"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(seekRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request SyncPlay group to ignore member during group-wait. + * + * @param ignoreWaitRequestDto The settings to set. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlaySetIgnoreWait(@org.eclipse.jdt.annotation.Nullable IgnoreWaitRequestDto ignoreWaitRequestDto) + throws ApiException { + syncPlaySetIgnoreWaitWithHttpInfo(ignoreWaitRequestDto); + } + + /** + * Request SyncPlay group to ignore member during group-wait. + * + * @param ignoreWaitRequestDto The settings to set. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetIgnoreWaitWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable IgnoreWaitRequestDto ignoreWaitRequestDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySetIgnoreWaitRequestBuilder(ignoreWaitRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlaySetIgnoreWait", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlaySetIgnoreWaitRequestBuilder( + @org.eclipse.jdt.annotation.Nullable IgnoreWaitRequestDto ignoreWaitRequestDto) throws ApiException { + // verify the required parameter 'ignoreWaitRequestDto' is set + if (ignoreWaitRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'ignoreWaitRequestDto' when calling syncPlaySetIgnoreWait"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/SetIgnoreWait"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(ignoreWaitRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request to set new playlist in SyncPlay group. + * + * @param playRequestDto The new playlist to play in the group. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlaySetNewQueue(@org.eclipse.jdt.annotation.Nullable PlayRequestDto playRequestDto) + throws ApiException { + syncPlaySetNewQueueWithHttpInfo(playRequestDto); + } + + /** + * Request to set new playlist in SyncPlay group. + * + * @param playRequestDto The new playlist to play in the group. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetNewQueueWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable PlayRequestDto playRequestDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySetNewQueueRequestBuilder(playRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlaySetNewQueue", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlaySetNewQueueRequestBuilder( + @org.eclipse.jdt.annotation.Nullable PlayRequestDto playRequestDto) throws ApiException { + // verify the required parameter 'playRequestDto' is set + if (playRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'playRequestDto' when calling syncPlaySetNewQueue"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/SetNewQueue"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(playRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request to change playlist item in SyncPlay group. + * + * @param setPlaylistItemRequestDto The new item to play. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlaySetPlaylistItem( + @org.eclipse.jdt.annotation.Nullable SetPlaylistItemRequestDto setPlaylistItemRequestDto) + throws ApiException { + syncPlaySetPlaylistItemWithHttpInfo(setPlaylistItemRequestDto); + } + + /** + * Request to change playlist item in SyncPlay group. + * + * @param setPlaylistItemRequestDto The new item to play. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetPlaylistItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SetPlaylistItemRequestDto setPlaylistItemRequestDto) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySetPlaylistItemRequestBuilder(setPlaylistItemRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlaySetPlaylistItem", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlaySetPlaylistItemRequestBuilder( + @org.eclipse.jdt.annotation.Nullable SetPlaylistItemRequestDto setPlaylistItemRequestDto) + throws ApiException { + // verify the required parameter 'setPlaylistItemRequestDto' is set + if (setPlaylistItemRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'setPlaylistItemRequestDto' when calling syncPlaySetPlaylistItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/SetPlaylistItem"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(setPlaylistItemRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request to set repeat mode in SyncPlay group. + * + * @param setRepeatModeRequestDto The new repeat mode. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlaySetRepeatMode( + @org.eclipse.jdt.annotation.Nullable SetRepeatModeRequestDto setRepeatModeRequestDto) throws ApiException { + syncPlaySetRepeatModeWithHttpInfo(setRepeatModeRequestDto); + } + + /** + * Request to set repeat mode in SyncPlay group. + * + * @param setRepeatModeRequestDto The new repeat mode. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetRepeatModeWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SetRepeatModeRequestDto setRepeatModeRequestDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySetRepeatModeRequestBuilder(setRepeatModeRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlaySetRepeatMode", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlaySetRepeatModeRequestBuilder( + @org.eclipse.jdt.annotation.Nullable SetRepeatModeRequestDto setRepeatModeRequestDto) throws ApiException { + // verify the required parameter 'setRepeatModeRequestDto' is set + if (setRepeatModeRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'setRepeatModeRequestDto' when calling syncPlaySetRepeatMode"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/SetRepeatMode"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(setRepeatModeRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request to set shuffle mode in SyncPlay group. + * + * @param setShuffleModeRequestDto The new shuffle mode. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlaySetShuffleMode( + @org.eclipse.jdt.annotation.Nullable SetShuffleModeRequestDto setShuffleModeRequestDto) + throws ApiException { + syncPlaySetShuffleModeWithHttpInfo(setShuffleModeRequestDto); + } + + /** + * Request to set shuffle mode in SyncPlay group. + * + * @param setShuffleModeRequestDto The new shuffle mode. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetShuffleModeWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SetShuffleModeRequestDto setShuffleModeRequestDto) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySetShuffleModeRequestBuilder(setShuffleModeRequestDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlaySetShuffleMode", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlaySetShuffleModeRequestBuilder( + @org.eclipse.jdt.annotation.Nullable SetShuffleModeRequestDto setShuffleModeRequestDto) + throws ApiException { + // verify the required parameter 'setShuffleModeRequestDto' is set + if (setShuffleModeRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'setShuffleModeRequestDto' when calling syncPlaySetShuffleMode"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/SetShuffleMode"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(setShuffleModeRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request stop in SyncPlay group. + * + * @throws ApiException if fails to make API call + */ + public void syncPlayStop() throws ApiException { + syncPlayStopWithHttpInfo(); + } + + /** + * Request stop in SyncPlay group. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayStopWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayStopRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayStop", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayStopRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Stop"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request unpause in SyncPlay group. + * + * @throws ApiException if fails to make API call + */ + public void syncPlayUnpause() throws ApiException { + syncPlayUnpauseWithHttpInfo(); + } + + /** + * Request unpause in SyncPlay group. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayUnpauseWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayUnpauseRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayUnpause", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayUnpauseRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Unpause"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SystemApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SystemApi.java new file mode 100644 index 0000000000000..a4021fe6c5b45 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SystemApi.java @@ -0,0 +1,810 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.EndPointInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.LogFile; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PublicSystemInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SystemInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.WakeOnLanInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SystemApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public SystemApi() { + this(Configuration.getDefaultApiClient()); + } + + public SystemApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets information about the request endpoint. + * + * @return EndPointInfo + * @throws ApiException if fails to make API call + */ + public EndPointInfo getEndpointInfo() throws ApiException { + ApiResponse localVarResponse = getEndpointInfoWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets information about the request endpoint. + * + * @return ApiResponse<EndPointInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEndpointInfoWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getEndpointInfoRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getEndpointInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getEndpointInfoRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Endpoint"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a log file. + * + * @param name The name of the log file to get. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getLogFile(@org.eclipse.jdt.annotation.Nullable String name) throws ApiException { + ApiResponse localVarResponse = getLogFileWithHttpInfo(name); + return localVarResponse.getData(); + } + + /** + * Gets a log file. + * + * @param name The name of the log file to get. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLogFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLogFileRequestBuilder(name); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLogFile", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLogFileRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name) + throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getLogFile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Logs/Log"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "text/plain, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Pings the system. + * + * @return String + * @throws ApiException if fails to make API call + */ + public String getPingSystem() throws ApiException { + ApiResponse localVarResponse = getPingSystemWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Pings the system. + * + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPingSystemWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPingSystemRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPingSystem", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPingSystemRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Ping"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets public information about the server. + * + * @return PublicSystemInfo + * @throws ApiException if fails to make API call + */ + public PublicSystemInfo getPublicSystemInfo() throws ApiException { + ApiResponse localVarResponse = getPublicSystemInfoWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets public information about the server. + * + * @return ApiResponse<PublicSystemInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPublicSystemInfoWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPublicSystemInfoRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPublicSystemInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPublicSystemInfoRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Info/Public"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of available server log files. + * + * @return List<LogFile> + * @throws ApiException if fails to make API call + */ + public List getServerLogs() throws ApiException { + ApiResponse> localVarResponse = getServerLogsWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets a list of available server log files. + * + * @return ApiResponse<List<LogFile>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getServerLogsWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getServerLogsRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getServerLogs", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getServerLogsRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Logs"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets information about the server. + * + * @return SystemInfo + * @throws ApiException if fails to make API call + */ + public SystemInfo getSystemInfo() throws ApiException { + ApiResponse localVarResponse = getSystemInfoWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets information about the server. + * + * @return ApiResponse<SystemInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSystemInfoWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSystemInfoRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSystemInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSystemInfoRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Info"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets wake on lan information. + * + * @return List<WakeOnLanInfo> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public List getWakeOnLanInfo() throws ApiException { + ApiResponse> localVarResponse = getWakeOnLanInfoWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets wake on lan information. + * + * @return ApiResponse<List<WakeOnLanInfo>> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse> getWakeOnLanInfoWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getWakeOnLanInfoRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getWakeOnLanInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getWakeOnLanInfoRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/WakeOnLanInfo"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Pings the system. + * + * @return String + * @throws ApiException if fails to make API call + */ + public String postPingSystem() throws ApiException { + ApiResponse localVarResponse = postPingSystemWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Pings the system. + * + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse postPingSystemWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postPingSystemRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postPingSystem", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postPingSystemRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Ping"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Restarts the application. + * + * @throws ApiException if fails to make API call + */ + public void restartApplication() throws ApiException { + restartApplicationWithHttpInfo(); + } + + /** + * Restarts the application. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse restartApplicationWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = restartApplicationRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("restartApplication", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder restartApplicationRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Restart"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Shuts down the application. + * + * @throws ApiException if fails to make API call + */ + public void shutdownApplication() throws ApiException { + shutdownApplicationWithHttpInfo(); + } + + /** + * Shuts down the application. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse shutdownApplicationWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = shutdownApplicationRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("shutdownApplication", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder shutdownApplicationRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Shutdown"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TimeSyncApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TimeSyncApi.java new file mode 100644 index 0000000000000..2c616aaee4dca --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TimeSyncApi.java @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UtcTimeResponse; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TimeSyncApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public TimeSyncApi() { + this(Configuration.getDefaultApiClient()); + } + + public TimeSyncApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets the current UTC time. + * + * @return UtcTimeResponse + * @throws ApiException if fails to make API call + */ + public UtcTimeResponse getUtcTime() throws ApiException { + ApiResponse localVarResponse = getUtcTimeWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets the current UTC time. + * + * @return ApiResponse<UtcTimeResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUtcTimeWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUtcTimeRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getUtcTime", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUtcTimeRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/GetUtcTime"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TmdbApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TmdbApi.java new file mode 100644 index 0000000000000..3669cc8f127d8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TmdbApi.java @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ConfigImageTypes; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TmdbApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public TmdbApi() { + this(Configuration.getDefaultApiClient()); + } + + public TmdbApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets the TMDb image configuration options. + * + * @return ConfigImageTypes + * @throws ApiException if fails to make API call + */ + public ConfigImageTypes tmdbClientConfiguration() throws ApiException { + ApiResponse localVarResponse = tmdbClientConfigurationWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets the TMDb image configuration options. + * + * @return ApiResponse<ConfigImageTypes> + * @throws ApiException if fails to make API call + */ + public ApiResponse tmdbClientConfigurationWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = tmdbClientConfigurationRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("tmdbClientConfiguration", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder tmdbClientConfigurationRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Tmdb/ClientConfiguration"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TrailersApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TrailersApi.java new file mode 100644 index 0000000000000..cd311b8da360c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TrailersApi.java @@ -0,0 +1,823 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFilter; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemSortBy; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.LocationType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MediaType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SeriesStatus; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SortOrder; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.VideoType; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TrailersApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public TrailersApi() { + this(Configuration.getDefaultApiClient()); + } + + public TrailersApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Finds movies and trailers similar to a given trailer. + * + * @param userId The user id supplied as query parameter; this is required when not using an API key. (optional) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an IMDb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a TMDb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a TVDb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending, Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getTrailers(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + ApiResponse localVarResponse = getTrailersWithHttpInfo(userId, maxOfficialRating, + hasThemeSong, hasThemeVideo, hasSubtitles, hasSpecialFeature, hasTrailer, adjacentTo, parentIndexNumber, + hasParentalRating, isHd, is4K, locationTypes, excludeLocationTypes, isMissing, isUnaired, + minCommunityRating, minCriticRating, minPremiereDate, minDateLastSaved, minDateLastSavedForUser, + maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, hasTvdbId, isMovie, isSeries, isNews, isKids, + isSports, excludeItemIds, startIndex, limit, recursive, searchTerm, sortOrder, parentId, fields, + excludeItemTypes, filters, isFavorite, mediaTypes, imageTypes, sortBy, isPlayed, genres, + officialRatings, tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, personIds, + personTypes, studios, artists, excludeArtistIds, artistIds, albumArtistIds, contributingArtistIds, + albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, isPlaceHolder, hasOfficialRating, + collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, seriesStatus, + nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, enableTotalRecordCount, + enableImages); + return localVarResponse.getData(); + } + + /** + * Finds movies and trailers similar to a given trailer. + * + * @param userId The user id supplied as query parameter; this is required when not using an API key. (optional) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an IMDb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a TMDb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a TVDb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending, Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTrailersWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTrailersRequestBuilder(userId, maxOfficialRating, hasThemeSong, + hasThemeVideo, hasSubtitles, hasSpecialFeature, hasTrailer, adjacentTo, parentIndexNumber, + hasParentalRating, isHd, is4K, locationTypes, excludeLocationTypes, isMissing, isUnaired, + minCommunityRating, minCriticRating, minPremiereDate, minDateLastSaved, minDateLastSavedForUser, + maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, hasTvdbId, isMovie, isSeries, isNews, isKids, + isSports, excludeItemIds, startIndex, limit, recursive, searchTerm, sortOrder, parentId, fields, + excludeItemTypes, filters, isFavorite, mediaTypes, imageTypes, sortBy, isPlayed, genres, + officialRatings, tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, personIds, + personTypes, studios, artists, excludeArtistIds, artistIds, albumArtistIds, contributingArtistIds, + albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, isPlaceHolder, hasOfficialRating, + collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, seriesStatus, + nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, enableTotalRecordCount, + enableImages); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getTrailers", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getTrailersRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Trailers"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "maxOfficialRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxOfficialRating", maxOfficialRating)); + localVarQueryParameterBaseName = "hasThemeSong"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasThemeSong", hasThemeSong)); + localVarQueryParameterBaseName = "hasThemeVideo"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasThemeVideo", hasThemeVideo)); + localVarQueryParameterBaseName = "hasSubtitles"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasSubtitles", hasSubtitles)); + localVarQueryParameterBaseName = "hasSpecialFeature"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasSpecialFeature", hasSpecialFeature)); + localVarQueryParameterBaseName = "hasTrailer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasTrailer", hasTrailer)); + localVarQueryParameterBaseName = "adjacentTo"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("adjacentTo", adjacentTo)); + localVarQueryParameterBaseName = "parentIndexNumber"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentIndexNumber", parentIndexNumber)); + localVarQueryParameterBaseName = "hasParentalRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasParentalRating", hasParentalRating)); + localVarQueryParameterBaseName = "isHd"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isHd", isHd)); + localVarQueryParameterBaseName = "is4K"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("is4K", is4K)); + localVarQueryParameterBaseName = "locationTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "locationTypes", locationTypes)); + localVarQueryParameterBaseName = "excludeLocationTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeLocationTypes", excludeLocationTypes)); + localVarQueryParameterBaseName = "isMissing"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMissing", isMissing)); + localVarQueryParameterBaseName = "isUnaired"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isUnaired", isUnaired)); + localVarQueryParameterBaseName = "minCommunityRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minCommunityRating", minCommunityRating)); + localVarQueryParameterBaseName = "minCriticRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minCriticRating", minCriticRating)); + localVarQueryParameterBaseName = "minPremiereDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minPremiereDate", minPremiereDate)); + localVarQueryParameterBaseName = "minDateLastSaved"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minDateLastSaved", minDateLastSaved)); + localVarQueryParameterBaseName = "minDateLastSavedForUser"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minDateLastSavedForUser", minDateLastSavedForUser)); + localVarQueryParameterBaseName = "maxPremiereDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxPremiereDate", maxPremiereDate)); + localVarQueryParameterBaseName = "hasOverview"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasOverview", hasOverview)); + localVarQueryParameterBaseName = "hasImdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasImdbId", hasImdbId)); + localVarQueryParameterBaseName = "hasTmdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasTmdbId", hasTmdbId)); + localVarQueryParameterBaseName = "hasTvdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasTvdbId", hasTvdbId)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "excludeItemIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemIds", excludeItemIds)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "recursive"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("recursive", recursive)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "filters"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "filters", filters)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + localVarQueryParameterBaseName = "imageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "imageTypes", imageTypes)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "isPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isPlayed", isPlayed)); + localVarQueryParameterBaseName = "genres"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genres", genres)); + localVarQueryParameterBaseName = "officialRatings"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "officialRatings", officialRatings)); + localVarQueryParameterBaseName = "tags"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "tags", tags)); + localVarQueryParameterBaseName = "years"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "years", years)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "person"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("person", person)); + localVarQueryParameterBaseName = "personIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personIds", personIds)); + localVarQueryParameterBaseName = "personTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personTypes", personTypes)); + localVarQueryParameterBaseName = "studios"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studios", studios)); + localVarQueryParameterBaseName = "artists"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "artists", artists)); + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "artistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "artistIds", artistIds)); + localVarQueryParameterBaseName = "albumArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "albumArtistIds", albumArtistIds)); + localVarQueryParameterBaseName = "contributingArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "contributingArtistIds", contributingArtistIds)); + localVarQueryParameterBaseName = "albums"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "albums", albums)); + localVarQueryParameterBaseName = "albumIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "albumIds", albumIds)); + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + localVarQueryParameterBaseName = "videoTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "videoTypes", videoTypes)); + localVarQueryParameterBaseName = "minOfficialRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minOfficialRating", minOfficialRating)); + localVarQueryParameterBaseName = "isLocked"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isLocked", isLocked)); + localVarQueryParameterBaseName = "isPlaceHolder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isPlaceHolder", isPlaceHolder)); + localVarQueryParameterBaseName = "hasOfficialRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasOfficialRating", hasOfficialRating)); + localVarQueryParameterBaseName = "collapseBoxSetItems"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("collapseBoxSetItems", collapseBoxSetItems)); + localVarQueryParameterBaseName = "minWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minWidth", minWidth)); + localVarQueryParameterBaseName = "minHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minHeight", minHeight)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "is3D"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("is3D", is3D)); + localVarQueryParameterBaseName = "seriesStatus"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "seriesStatus", seriesStatus)); + localVarQueryParameterBaseName = "nameStartsWithOrGreater"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWithOrGreater", nameStartsWithOrGreater)); + localVarQueryParameterBaseName = "nameStartsWith"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWith", nameStartsWith)); + localVarQueryParameterBaseName = "nameLessThan"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameLessThan", nameLessThan)); + localVarQueryParameterBaseName = "studioIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studioIds", studioIds)); + localVarQueryParameterBaseName = "genreIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genreIds", genreIds)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TrickplayApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TrickplayApi.java new file mode 100644 index 0000000000000..8a24a184b1764 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TrickplayApi.java @@ -0,0 +1,299 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TrickplayApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public TrickplayApi() { + this(Configuration.getDefaultApiClient()); + } + + public TrickplayApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets an image tiles playlist for trickplay. + * + * @param itemId The item id. (required) + * @param width The width of a single tile. (required) + * @param mediaSourceId The media version id, if using an alternate version. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getTrickplayHlsPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId) + throws ApiException { + ApiResponse localVarResponse = getTrickplayHlsPlaylistWithHttpInfo(itemId, width, mediaSourceId); + return localVarResponse.getData(); + } + + /** + * Gets an image tiles playlist for trickplay. + * + * @param itemId The item id. (required) + * @param width The width of a single tile. (required) + * @param mediaSourceId The media version id, if using an alternate version. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTrickplayHlsPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTrickplayHlsPlaylistRequestBuilder(itemId, width, + mediaSourceId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getTrickplayHlsPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getTrickplayHlsPlaylistRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getTrickplayHlsPlaylist"); + } + // verify the required parameter 'width' is set + if (width == null) { + throw new ApiException(400, "Missing the required parameter 'width' when calling getTrickplayHlsPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/Trickplay/{width}/tiles.m3u8" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{width}", ApiClient.urlEncode(width.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/x-mpegURL, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a trickplay tile image. + * + * @param itemId The item id. (required) + * @param width The width of a single tile. (required) + * @param index The index of the desired tile. (required) + * @param mediaSourceId The media version id, if using an alternate version. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getTrickplayTileImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.Nullable Integer index, + @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId) throws ApiException { + ApiResponse localVarResponse = getTrickplayTileImageWithHttpInfo(itemId, width, index, mediaSourceId); + return localVarResponse.getData(); + } + + /** + * Gets a trickplay tile image. + * + * @param itemId The item id. (required) + * @param width The width of a single tile. (required) + * @param index The index of the desired tile. (required) + * @param mediaSourceId The media version id, if using an alternate version. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTrickplayTileImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.Nullable Integer index, + @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTrickplayTileImageRequestBuilder(itemId, width, index, + mediaSourceId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getTrickplayTileImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getTrickplayTileImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.Nullable Integer index, + @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getTrickplayTileImage"); + } + // verify the required parameter 'width' is set + if (width == null) { + throw new ApiException(400, "Missing the required parameter 'width' when calling getTrickplayTileImage"); + } + // verify the required parameter 'index' is set + if (index == null) { + throw new ApiException(400, "Missing the required parameter 'index' when calling getTrickplayTileImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/Trickplay/{width}/{index}.jpg" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{width}", ApiClient.urlEncode(width.toString())) + .replace("{index}", ApiClient.urlEncode(index.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TvShowsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TvShowsApi.java new file mode 100644 index 0000000000000..ae656a52bcf36 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TvShowsApi.java @@ -0,0 +1,782 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemSortBy; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TvShowsApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public TvShowsApi() { + this(Configuration.getDefaultApiClient()); + } + + public TvShowsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets episodes for a tv season. + * + * @param seriesId The series id. (required) + * @param userId The user id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param season Optional filter by season number. (optional) + * @param seasonId Optional. Filter by season id. (optional) + * @param isMissing Optional. Filter by items that are missing episodes or not. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param startItemId Optional. Skip through the list until a given item is found. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param enableImages Optional, include image information in output. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getEpisodes(@org.eclipse.jdt.annotation.Nullable UUID seriesId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer season, @org.eclipse.jdt.annotation.NonNull UUID seasonId, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull UUID startItemId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull ItemSortBy sortBy) throws ApiException { + ApiResponse localVarResponse = getEpisodesWithHttpInfo(seriesId, userId, fields, season, + seasonId, isMissing, adjacentTo, startItemId, startIndex, limit, enableImages, imageTypeLimit, + enableImageTypes, enableUserData, sortBy); + return localVarResponse.getData(); + } + + /** + * Gets episodes for a tv season. + * + * @param seriesId The series id. (required) + * @param userId The user id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param season Optional filter by season number. (optional) + * @param seasonId Optional. Filter by season id. (optional) + * @param isMissing Optional. Filter by items that are missing episodes or not. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param startItemId Optional. Skip through the list until a given item is found. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param enableImages Optional, include image information in output. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEpisodesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID seriesId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer season, @org.eclipse.jdt.annotation.NonNull UUID seasonId, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull UUID startItemId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull ItemSortBy sortBy) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getEpisodesRequestBuilder(seriesId, userId, fields, season, + seasonId, isMissing, adjacentTo, startItemId, startIndex, limit, enableImages, imageTypeLimit, + enableImageTypes, enableUserData, sortBy); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getEpisodes", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getEpisodesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID seriesId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer season, @org.eclipse.jdt.annotation.NonNull UUID seasonId, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull UUID startItemId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull ItemSortBy sortBy) throws ApiException { + // verify the required parameter 'seriesId' is set + if (seriesId == null) { + throw new ApiException(400, "Missing the required parameter 'seriesId' when calling getEpisodes"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Shows/{seriesId}/Episodes".replace("{seriesId}", + ApiClient.urlEncode(seriesId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "season"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("season", season)); + localVarQueryParameterBaseName = "seasonId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("seasonId", seasonId)); + localVarQueryParameterBaseName = "isMissing"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMissing", isMissing)); + localVarQueryParameterBaseName = "adjacentTo"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("adjacentTo", adjacentTo)); + localVarQueryParameterBaseName = "startItemId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startItemId", startItemId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sortBy", sortBy)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of next up episodes. + * + * @param userId The user id of the user to get the next up episodes for. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param seriesId Optional. Filter by series id. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param nextUpDateCutoff Optional. Starting date of shows to show in Next Up section. (optional) + * @param enableTotalRecordCount Whether to enable the total records count. Defaults to true. (optional, default to + * true) + * @param disableFirstEpisode Whether to disable sending the first episode in a series as next up. (optional, + * default to false) + * @param enableResumable Whether to include resumable episodes in next up results. (optional, default to true) + * @param enableRewatching Whether to include watched episodes in next up results. (optional, default to false) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getNextUp(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull UUID seriesId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime nextUpDateCutoff, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean disableFirstEpisode, + @org.eclipse.jdt.annotation.NonNull Boolean enableResumable, + @org.eclipse.jdt.annotation.NonNull Boolean enableRewatching) throws ApiException { + ApiResponse localVarResponse = getNextUpWithHttpInfo(userId, startIndex, limit, fields, + seriesId, parentId, enableImages, imageTypeLimit, enableImageTypes, enableUserData, nextUpDateCutoff, + enableTotalRecordCount, disableFirstEpisode, enableResumable, enableRewatching); + return localVarResponse.getData(); + } + + /** + * Gets a list of next up episodes. + * + * @param userId The user id of the user to get the next up episodes for. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param seriesId Optional. Filter by series id. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param nextUpDateCutoff Optional. Starting date of shows to show in Next Up section. (optional) + * @param enableTotalRecordCount Whether to enable the total records count. Defaults to true. (optional, default to + * true) + * @param disableFirstEpisode Whether to disable sending the first episode in a series as next up. (optional, + * default to false) + * @param enableResumable Whether to include resumable episodes in next up results. (optional, default to true) + * @param enableRewatching Whether to include watched episodes in next up results. (optional, default to false) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getNextUpWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull UUID seriesId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime nextUpDateCutoff, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean disableFirstEpisode, + @org.eclipse.jdt.annotation.NonNull Boolean enableResumable, + @org.eclipse.jdt.annotation.NonNull Boolean enableRewatching) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getNextUpRequestBuilder(userId, startIndex, limit, fields, + seriesId, parentId, enableImages, imageTypeLimit, enableImageTypes, enableUserData, nextUpDateCutoff, + enableTotalRecordCount, disableFirstEpisode, enableResumable, enableRewatching); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getNextUp", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getNextUpRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull UUID seriesId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime nextUpDateCutoff, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean disableFirstEpisode, + @org.eclipse.jdt.annotation.NonNull Boolean enableResumable, + @org.eclipse.jdt.annotation.NonNull Boolean enableRewatching) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Shows/NextUp"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "seriesId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("seriesId", seriesId)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "nextUpDateCutoff"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nextUpDateCutoff", nextUpDateCutoff)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + localVarQueryParameterBaseName = "disableFirstEpisode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("disableFirstEpisode", disableFirstEpisode)); + localVarQueryParameterBaseName = "enableResumable"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableResumable", enableResumable)); + localVarQueryParameterBaseName = "enableRewatching"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableRewatching", enableRewatching)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets seasons for a tv series. + * + * @param seriesId The series id. (required) + * @param userId The user id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param isSpecialSeason Optional. Filter by special season. (optional) + * @param isMissing Optional. Filter by items that are missing episodes or not. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSeasons(@org.eclipse.jdt.annotation.Nullable UUID seriesId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean isSpecialSeason, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData) throws ApiException { + ApiResponse localVarResponse = getSeasonsWithHttpInfo(seriesId, userId, fields, + isSpecialSeason, isMissing, adjacentTo, enableImages, imageTypeLimit, enableImageTypes, enableUserData); + return localVarResponse.getData(); + } + + /** + * Gets seasons for a tv series. + * + * @param seriesId The series id. (required) + * @param userId The user id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param isSpecialSeason Optional. Filter by special season. (optional) + * @param isMissing Optional. Filter by items that are missing episodes or not. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSeasonsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID seriesId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean isSpecialSeason, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSeasonsRequestBuilder(seriesId, userId, fields, isSpecialSeason, + isMissing, adjacentTo, enableImages, imageTypeLimit, enableImageTypes, enableUserData); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSeasons", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSeasonsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID seriesId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean isSpecialSeason, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData) throws ApiException { + // verify the required parameter 'seriesId' is set + if (seriesId == null) { + throw new ApiException(400, "Missing the required parameter 'seriesId' when calling getSeasons"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Shows/{seriesId}/Seasons".replace("{seriesId}", + ApiClient.urlEncode(seriesId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "isSpecialSeason"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSpecialSeason", isSpecialSeason)); + localVarQueryParameterBaseName = "isMissing"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMissing", isMissing)); + localVarQueryParameterBaseName = "adjacentTo"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("adjacentTo", adjacentTo)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of upcoming episodes. + * + * @param userId The user id of the user to get the upcoming episodes for. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getUpcomingEpisodes(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData) throws ApiException { + ApiResponse localVarResponse = getUpcomingEpisodesWithHttpInfo(userId, startIndex, + limit, fields, parentId, enableImages, imageTypeLimit, enableImageTypes, enableUserData); + return localVarResponse.getData(); + } + + /** + * Gets a list of upcoming episodes. + * + * @param userId The user id of the user to get the upcoming episodes for. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUpcomingEpisodesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUpcomingEpisodesRequestBuilder(userId, startIndex, limit, + fields, parentId, enableImages, imageTypeLimit, enableImageTypes, enableUserData); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getUpcomingEpisodes", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUpcomingEpisodesRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Shows/Upcoming"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UniversalAudioApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UniversalAudioApi.java new file mode 100644 index 0000000000000..579f59894fe0b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UniversalAudioApi.java @@ -0,0 +1,520 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MediaStreamProtocol; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UniversalAudioApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public UniversalAudioApi() { + this(Configuration.getDefaultApiClient()); + } + + public UniversalAudioApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container Optional. The audio container. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param userId Optional. The user id. (optional) + * @param audioCodec Optional. The audio codec to transcode to. (optional) + * @param maxAudioChannels Optional. The maximum number of audio channels. (optional) + * @param transcodingAudioChannels Optional. The number of how many audio channels to transcode to. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param transcodingContainer Optional. The container to transcode to. (optional) + * @param transcodingProtocol Optional. The transcoding protocol. (optional) + * @param maxAudioSampleRate Optional. The maximum audio sample rate. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param enableRemoteMedia Optional. Whether to enable remote media. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional, default to false) + * @param enableRedirection Whether to enable redirection. Defaults to true. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File getUniversalAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull MediaStreamProtocol transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection) throws ApiException { + ApiResponse localVarResponse = getUniversalAudioStreamWithHttpInfo(itemId, container, mediaSourceId, + deviceId, userId, audioCodec, maxAudioChannels, transcodingAudioChannels, maxStreamingBitrate, + audioBitRate, startTimeTicks, transcodingContainer, transcodingProtocol, maxAudioSampleRate, + maxAudioBitDepth, enableRemoteMedia, enableAudioVbrEncoding, breakOnNonKeyFrames, enableRedirection); + return localVarResponse.getData(); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container Optional. The audio container. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param userId Optional. The user id. (optional) + * @param audioCodec Optional. The audio codec to transcode to. (optional) + * @param maxAudioChannels Optional. The maximum number of audio channels. (optional) + * @param transcodingAudioChannels Optional. The number of how many audio channels to transcode to. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param transcodingContainer Optional. The container to transcode to. (optional) + * @param transcodingProtocol Optional. The transcoding protocol. (optional) + * @param maxAudioSampleRate Optional. The maximum audio sample rate. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param enableRemoteMedia Optional. Whether to enable remote media. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional, default to false) + * @param enableRedirection Whether to enable redirection. Defaults to true. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUniversalAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull MediaStreamProtocol transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUniversalAudioStreamRequestBuilder(itemId, container, + mediaSourceId, deviceId, userId, audioCodec, maxAudioChannels, transcodingAudioChannels, + maxStreamingBitrate, audioBitRate, startTimeTicks, transcodingContainer, transcodingProtocol, + maxAudioSampleRate, maxAudioBitDepth, enableRemoteMedia, enableAudioVbrEncoding, breakOnNonKeyFrames, + enableRedirection); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getUniversalAudioStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUniversalAudioStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull MediaStreamProtocol transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getUniversalAudioStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/universal".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "container"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "container", container)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "transcodingAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodingAudioChannels", transcodingAudioChannels)); + localVarQueryParameterBaseName = "maxStreamingBitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStreamingBitrate", maxStreamingBitrate)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "transcodingContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodingContainer", transcodingContainer)); + localVarQueryParameterBaseName = "transcodingProtocol"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodingProtocol", transcodingProtocol)); + localVarQueryParameterBaseName = "maxAudioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioSampleRate", maxAudioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "enableRemoteMedia"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableRemoteMedia", enableRemoteMedia)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "enableRedirection"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableRedirection", enableRedirection)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "audio/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container Optional. The audio container. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param userId Optional. The user id. (optional) + * @param audioCodec Optional. The audio codec to transcode to. (optional) + * @param maxAudioChannels Optional. The maximum number of audio channels. (optional) + * @param transcodingAudioChannels Optional. The number of how many audio channels to transcode to. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param transcodingContainer Optional. The container to transcode to. (optional) + * @param transcodingProtocol Optional. The transcoding protocol. (optional) + * @param maxAudioSampleRate Optional. The maximum audio sample rate. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param enableRemoteMedia Optional. Whether to enable remote media. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional, default to false) + * @param enableRedirection Whether to enable redirection. Defaults to true. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File headUniversalAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull MediaStreamProtocol transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection) throws ApiException { + ApiResponse localVarResponse = headUniversalAudioStreamWithHttpInfo(itemId, container, mediaSourceId, + deviceId, userId, audioCodec, maxAudioChannels, transcodingAudioChannels, maxStreamingBitrate, + audioBitRate, startTimeTicks, transcodingContainer, transcodingProtocol, maxAudioSampleRate, + maxAudioBitDepth, enableRemoteMedia, enableAudioVbrEncoding, breakOnNonKeyFrames, enableRedirection); + return localVarResponse.getData(); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container Optional. The audio container. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param userId Optional. The user id. (optional) + * @param audioCodec Optional. The audio codec to transcode to. (optional) + * @param maxAudioChannels Optional. The maximum number of audio channels. (optional) + * @param transcodingAudioChannels Optional. The number of how many audio channels to transcode to. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param transcodingContainer Optional. The container to transcode to. (optional) + * @param transcodingProtocol Optional. The transcoding protocol. (optional) + * @param maxAudioSampleRate Optional. The maximum audio sample rate. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param enableRemoteMedia Optional. Whether to enable remote media. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional, default to false) + * @param enableRedirection Whether to enable redirection. Defaults to true. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headUniversalAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull MediaStreamProtocol transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headUniversalAudioStreamRequestBuilder(itemId, container, + mediaSourceId, deviceId, userId, audioCodec, maxAudioChannels, transcodingAudioChannels, + maxStreamingBitrate, audioBitRate, startTimeTicks, transcodingContainer, transcodingProtocol, + maxAudioSampleRate, maxAudioBitDepth, enableRemoteMedia, enableAudioVbrEncoding, breakOnNonKeyFrames, + enableRedirection); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headUniversalAudioStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headUniversalAudioStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull MediaStreamProtocol transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling headUniversalAudioStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/universal".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "container"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "container", container)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "transcodingAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodingAudioChannels", transcodingAudioChannels)); + localVarQueryParameterBaseName = "maxStreamingBitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStreamingBitrate", maxStreamingBitrate)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "transcodingContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodingContainer", transcodingContainer)); + localVarQueryParameterBaseName = "transcodingProtocol"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodingProtocol", transcodingProtocol)); + localVarQueryParameterBaseName = "maxAudioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioSampleRate", maxAudioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "enableRemoteMedia"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableRemoteMedia", enableRemoteMedia)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "enableRedirection"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableRedirection", enableRedirection)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "audio/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserApi.java new file mode 100644 index 0000000000000..098db53b2c3b8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserApi.java @@ -0,0 +1,1310 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.AuthenticateUserByName; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.AuthenticationResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.CreateUserByName; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ForgotPasswordDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ForgotPasswordPinDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ForgotPasswordResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.PinRedeemResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.QuickConnectDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UpdateUserPassword; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UserConfiguration; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UserDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UserPolicy; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public UserApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Authenticates a user by name. + * + * @param authenticateUserByName The + * M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) + * request. (required) + * @return AuthenticationResult + * @throws ApiException if fails to make API call + */ + public AuthenticationResult authenticateUserByName( + @org.eclipse.jdt.annotation.Nullable AuthenticateUserByName authenticateUserByName) throws ApiException { + ApiResponse localVarResponse = authenticateUserByNameWithHttpInfo(authenticateUserByName); + return localVarResponse.getData(); + } + + /** + * Authenticates a user by name. + * + * @param authenticateUserByName The + * M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) + * request. (required) + * @return ApiResponse<AuthenticationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse authenticateUserByNameWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable AuthenticateUserByName authenticateUserByName) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = authenticateUserByNameRequestBuilder(authenticateUserByName); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("authenticateUserByName", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder authenticateUserByNameRequestBuilder( + @org.eclipse.jdt.annotation.Nullable AuthenticateUserByName authenticateUserByName) throws ApiException { + // verify the required parameter 'authenticateUserByName' is set + if (authenticateUserByName == null) { + throw new ApiException(400, + "Missing the required parameter 'authenticateUserByName' when calling authenticateUserByName"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/AuthenticateByName"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(authenticateUserByName); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Authenticates a user with quick connect. + * + * @param quickConnectDto The Jellyfin.Api.Models.UserDtos.QuickConnectDto request. (required) + * @return AuthenticationResult + * @throws ApiException if fails to make API call + */ + public AuthenticationResult authenticateWithQuickConnect( + @org.eclipse.jdt.annotation.Nullable QuickConnectDto quickConnectDto) throws ApiException { + ApiResponse localVarResponse = authenticateWithQuickConnectWithHttpInfo(quickConnectDto); + return localVarResponse.getData(); + } + + /** + * Authenticates a user with quick connect. + * + * @param quickConnectDto The Jellyfin.Api.Models.UserDtos.QuickConnectDto request. (required) + * @return ApiResponse<AuthenticationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse authenticateWithQuickConnectWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable QuickConnectDto quickConnectDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = authenticateWithQuickConnectRequestBuilder(quickConnectDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("authenticateWithQuickConnect", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder authenticateWithQuickConnectRequestBuilder( + @org.eclipse.jdt.annotation.Nullable QuickConnectDto quickConnectDto) throws ApiException { + // verify the required parameter 'quickConnectDto' is set + if (quickConnectDto == null) { + throw new ApiException(400, + "Missing the required parameter 'quickConnectDto' when calling authenticateWithQuickConnect"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/AuthenticateWithQuickConnect"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(quickConnectDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates a user. + * + * @param createUserByName The create user by name request body. (required) + * @return UserDto + * @throws ApiException if fails to make API call + */ + public UserDto createUserByName(@org.eclipse.jdt.annotation.Nullable CreateUserByName createUserByName) + throws ApiException { + ApiResponse localVarResponse = createUserByNameWithHttpInfo(createUserByName); + return localVarResponse.getData(); + } + + /** + * Creates a user. + * + * @param createUserByName The create user by name request body. (required) + * @return ApiResponse<UserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse createUserByNameWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable CreateUserByName createUserByName) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createUserByNameRequestBuilder(createUserByName); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createUserByName", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createUserByNameRequestBuilder( + @org.eclipse.jdt.annotation.Nullable CreateUserByName createUserByName) throws ApiException { + // verify the required parameter 'createUserByName' is set + if (createUserByName == null) { + throw new ApiException(400, + "Missing the required parameter 'createUserByName' when calling createUserByName"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/New"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createUserByName); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Deletes a user. + * + * @param userId The user id. (required) + * @throws ApiException if fails to make API call + */ + public void deleteUser(@org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + deleteUserWithHttpInfo(userId); + } + + /** + * Deletes a user. + * + * @param userId The user id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteUserRequestBuilder(userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteUser", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteUserRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId) + throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling deleteUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}".replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Initiates the forgot password process for a local user. + * + * @param forgotPasswordDto The forgot password request containing the entered username. (required) + * @return ForgotPasswordResult + * @throws ApiException if fails to make API call + */ + public ForgotPasswordResult forgotPassword(@org.eclipse.jdt.annotation.Nullable ForgotPasswordDto forgotPasswordDto) + throws ApiException { + ApiResponse localVarResponse = forgotPasswordWithHttpInfo(forgotPasswordDto); + return localVarResponse.getData(); + } + + /** + * Initiates the forgot password process for a local user. + * + * @param forgotPasswordDto The forgot password request containing the entered username. (required) + * @return ApiResponse<ForgotPasswordResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse forgotPasswordWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ForgotPasswordDto forgotPasswordDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = forgotPasswordRequestBuilder(forgotPasswordDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("forgotPassword", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder forgotPasswordRequestBuilder( + @org.eclipse.jdt.annotation.Nullable ForgotPasswordDto forgotPasswordDto) throws ApiException { + // verify the required parameter 'forgotPasswordDto' is set + if (forgotPasswordDto == null) { + throw new ApiException(400, + "Missing the required parameter 'forgotPasswordDto' when calling forgotPassword"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/ForgotPassword"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(forgotPasswordDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Redeems a forgot password pin. + * + * @param forgotPasswordPinDto The forgot password pin request containing the entered pin. (required) + * @return PinRedeemResult + * @throws ApiException if fails to make API call + */ + public PinRedeemResult forgotPasswordPin( + @org.eclipse.jdt.annotation.Nullable ForgotPasswordPinDto forgotPasswordPinDto) throws ApiException { + ApiResponse localVarResponse = forgotPasswordPinWithHttpInfo(forgotPasswordPinDto); + return localVarResponse.getData(); + } + + /** + * Redeems a forgot password pin. + * + * @param forgotPasswordPinDto The forgot password pin request containing the entered pin. (required) + * @return ApiResponse<PinRedeemResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse forgotPasswordPinWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ForgotPasswordPinDto forgotPasswordPinDto) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = forgotPasswordPinRequestBuilder(forgotPasswordPinDto); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("forgotPasswordPin", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder forgotPasswordPinRequestBuilder( + @org.eclipse.jdt.annotation.Nullable ForgotPasswordPinDto forgotPasswordPinDto) throws ApiException { + // verify the required parameter 'forgotPasswordPinDto' is set + if (forgotPasswordPinDto == null) { + throw new ApiException(400, + "Missing the required parameter 'forgotPasswordPinDto' when calling forgotPasswordPin"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/ForgotPassword/Pin"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(forgotPasswordPinDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the user based on auth token. + * + * @return UserDto + * @throws ApiException if fails to make API call + */ + public UserDto getCurrentUser() throws ApiException { + ApiResponse localVarResponse = getCurrentUserWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets the user based on auth token. + * + * @return ApiResponse<UserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getCurrentUserWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getCurrentUserRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getCurrentUser", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getCurrentUserRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/Me"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of publicly visible users for display on a login screen. + * + * @return List<UserDto> + * @throws ApiException if fails to make API call + */ + public List getPublicUsers() throws ApiException { + ApiResponse> localVarResponse = getPublicUsersWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Gets a list of publicly visible users for display on a login screen. + * + * @return ApiResponse<List<UserDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPublicUsersWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPublicUsersRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPublicUsers", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPublicUsersRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/Public"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a user by Id. + * + * @param userId The user id. (required) + * @return UserDto + * @throws ApiException if fails to make API call + */ + public UserDto getUserById(@org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + ApiResponse localVarResponse = getUserByIdWithHttpInfo(userId); + return localVarResponse.getData(); + } + + /** + * Gets a user by Id. + * + * @param userId The user id. (required) + * @return ApiResponse<UserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserByIdWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUserByIdRequestBuilder(userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getUserById", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUserByIdRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId) + throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getUserById"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}".replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of users. + * + * @param isHidden Optional filter by IsHidden=true or false. (optional) + * @param isDisabled Optional filter by IsDisabled=true or false. (optional) + * @return List<UserDto> + * @throws ApiException if fails to make API call + */ + public List getUsers(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isDisabled) throws ApiException { + ApiResponse> localVarResponse = getUsersWithHttpInfo(isHidden, isDisabled); + return localVarResponse.getData(); + } + + /** + * Gets a list of users. + * + * @param isHidden Optional filter by IsHidden=true or false. (optional) + * @param isDisabled Optional filter by IsDisabled=true or false. (optional) + * @return ApiResponse<List<UserDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getUsersWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isDisabled) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUsersRequestBuilder(isHidden, isDisabled); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getUsers", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUsersRequestBuilder(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isDisabled) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "isHidden"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isHidden", isHidden)); + localVarQueryParameterBaseName = "isDisabled"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isDisabled", isDisabled)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a user. + * + * @param userDto The updated user model. (required) + * @param userId The user id. (optional) + * @throws ApiException if fails to make API call + */ + public void updateUser(@org.eclipse.jdt.annotation.Nullable UserDto userDto, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + updateUserWithHttpInfo(userDto, userId); + } + + /** + * Updates a user. + * + * @param userDto The updated user model. (required) + * @param userId The user id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UserDto userDto, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserRequestBuilder(userDto, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateUser", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateUserRequestBuilder(@org.eclipse.jdt.annotation.Nullable UserDto userDto, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'userDto' is set + if (userDto == null) { + throw new ApiException(400, "Missing the required parameter 'userDto' when calling updateUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(userDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a user configuration. + * + * @param userConfiguration The new user configuration. (required) + * @param userId The user id. (optional) + * @throws ApiException if fails to make API call + */ + public void updateUserConfiguration(@org.eclipse.jdt.annotation.Nullable UserConfiguration userConfiguration, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + updateUserConfigurationWithHttpInfo(userConfiguration, userId); + } + + /** + * Updates a user configuration. + * + * @param userConfiguration The new user configuration. (required) + * @param userId The user id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserConfigurationWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UserConfiguration userConfiguration, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserConfigurationRequestBuilder(userConfiguration, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateUserConfiguration", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateUserConfigurationRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UserConfiguration userConfiguration, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'userConfiguration' is set + if (userConfiguration == null) { + throw new ApiException(400, + "Missing the required parameter 'userConfiguration' when calling updateUserConfiguration"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/Configuration"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(userConfiguration); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a user's password. + * + * @param updateUserPassword The + * M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Nullable{System.Guid},Jellyfin.Api.Models.UserDtos.UpdateUserPassword) + * request. (required) + * @param userId The user id. (optional) + * @throws ApiException if fails to make API call + */ + public void updateUserPassword(@org.eclipse.jdt.annotation.Nullable UpdateUserPassword updateUserPassword, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + updateUserPasswordWithHttpInfo(updateUserPassword, userId); + } + + /** + * Updates a user's password. + * + * @param updateUserPassword The + * M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Nullable{System.Guid},Jellyfin.Api.Models.UserDtos.UpdateUserPassword) + * request. (required) + * @param userId The user id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserPasswordWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UpdateUserPassword updateUserPassword, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserPasswordRequestBuilder(updateUserPassword, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateUserPassword", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateUserPasswordRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UpdateUserPassword updateUserPassword, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'updateUserPassword' is set + if (updateUserPassword == null) { + throw new ApiException(400, + "Missing the required parameter 'updateUserPassword' when calling updateUserPassword"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/Password"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(updateUserPassword); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a user policy. + * + * @param userId The user id. (required) + * @param userPolicy The new user policy. (required) + * @throws ApiException if fails to make API call + */ + public void updateUserPolicy(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserPolicy userPolicy) throws ApiException { + updateUserPolicyWithHttpInfo(userId, userPolicy); + } + + /** + * Updates a user policy. + * + * @param userId The user id. (required) + * @param userPolicy The new user policy. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserPolicyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserPolicy userPolicy) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserPolicyRequestBuilder(userId, userPolicy); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateUserPolicy", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateUserPolicyRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserPolicy userPolicy) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling updateUserPolicy"); + } + // verify the required parameter 'userPolicy' is set + if (userPolicy == null) { + throw new ApiException(400, "Missing the required parameter 'userPolicy' when calling updateUserPolicy"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Policy".replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(userPolicy); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserLibraryApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserLibraryApi.java new file mode 100644 index 0000000000000..9318661c87add --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserLibraryApi.java @@ -0,0 +1,1138 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UserItemDataDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserLibraryApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public UserLibraryApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserLibraryApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Deletes a user's saved personal rating for an item. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto deleteUserItemRating(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = deleteUserItemRatingWithHttpInfo(itemId, userId); + return localVarResponse.getData(); + } + + /** + * Deletes a user's saved personal rating for an item. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserItemRatingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteUserItemRatingRequestBuilder(itemId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteUserItemRating", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteUserItemRatingRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteUserItemRating"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/UserItems/{itemId}/Rating".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets intros to play before the main media item plays. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getIntros(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = getIntrosWithHttpInfo(itemId, userId); + return localVarResponse.getData(); + } + + /** + * Gets intros to play before the main media item plays. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getIntrosWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getIntrosRequestBuilder(itemId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getIntros", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getIntrosRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getIntros"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Intros".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an item from a user's library. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = getItemWithHttpInfo(itemId, userId); + return localVarResponse.getData(); + } + + /** + * Gets an item from a user's library. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemRequestBuilder(itemId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItem", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets latest media. + * + * @param userId User id. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isPlayed Filter by items that are played, or not. (optional) + * @param enableImages Optional. include image information in output. (optional) + * @param imageTypeLimit Optional. the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. include user data. (optional) + * @param limit Return item limit. (optional, default to 20) + * @param groupItems Whether or not to group items into a parent container. (optional, default to true) + * @return List<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public List getLatestMedia(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean groupItems) + throws ApiException { + ApiResponse> localVarResponse = getLatestMediaWithHttpInfo(userId, parentId, fields, + includeItemTypes, isPlayed, enableImages, imageTypeLimit, enableImageTypes, enableUserData, limit, + groupItems); + return localVarResponse.getData(); + } + + /** + * Gets latest media. + * + * @param userId User id. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isPlayed Filter by items that are played, or not. (optional) + * @param enableImages Optional. include image information in output. (optional) + * @param imageTypeLimit Optional. the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. include user data. (optional) + * @param limit Return item limit. (optional, default to 20) + * @param groupItems Whether or not to group items into a parent container. (optional, default to true) + * @return ApiResponse<List<BaseItemDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getLatestMediaWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean groupItems) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLatestMediaRequestBuilder(userId, parentId, fields, + includeItemTypes, isPlayed, enableImages, imageTypeLimit, enableImageTypes, enableUserData, limit, + groupItems); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLatestMedia", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLatestMediaRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean groupItems) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/Latest"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "isPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isPlayed", isPlayed)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "groupItems"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("groupItems", groupItems)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets local trailers for an item. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @return List<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public List getLocalTrailers(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse> localVarResponse = getLocalTrailersWithHttpInfo(itemId, userId); + return localVarResponse.getData(); + } + + /** + * Gets local trailers for an item. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @return ApiResponse<List<BaseItemDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getLocalTrailersWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLocalTrailersRequestBuilder(itemId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLocalTrailers", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLocalTrailersRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getLocalTrailers"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/LocalTrailers".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the root folder from a user's library. + * + * @param userId User id. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getRootFolder(@org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = getRootFolderWithHttpInfo(userId); + return localVarResponse.getData(); + } + + /** + * Gets the root folder from a user's library. + * + * @param userId User id. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRootFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRootFolderRequestBuilder(userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRootFolder", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRootFolderRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/Root"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets special features for an item. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @return List<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public List getSpecialFeatures(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse> localVarResponse = getSpecialFeaturesWithHttpInfo(itemId, userId); + return localVarResponse.getData(); + } + + /** + * Gets special features for an item. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @return ApiResponse<List<BaseItemDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getSpecialFeaturesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSpecialFeaturesRequestBuilder(itemId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSpecialFeatures", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSpecialFeaturesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSpecialFeatures"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/SpecialFeatures".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Marks an item as a favorite. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto markFavoriteItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = markFavoriteItemWithHttpInfo(itemId, userId); + return localVarResponse.getData(); + } + + /** + * Marks an item as a favorite. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse markFavoriteItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = markFavoriteItemRequestBuilder(itemId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("markFavoriteItem", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder markFavoriteItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling markFavoriteItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/UserFavoriteItems/{itemId}".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Unmarks item as a favorite. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto unmarkFavoriteItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = unmarkFavoriteItemWithHttpInfo(itemId, userId); + return localVarResponse.getData(); + } + + /** + * Unmarks item as a favorite. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse unmarkFavoriteItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = unmarkFavoriteItemRequestBuilder(itemId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("unmarkFavoriteItem", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder unmarkFavoriteItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling unmarkFavoriteItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/UserFavoriteItems/{itemId}".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a user's rating for an item. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param likes Whether this + * M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Nullable{System.Guid},System.Guid,System.Nullable{System.Boolean}) + * is likes. (optional) + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto updateUserItemRating(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean likes) + throws ApiException { + ApiResponse localVarResponse = updateUserItemRatingWithHttpInfo(itemId, userId, likes); + return localVarResponse.getData(); + } + + /** + * Updates a user's rating for an item. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param likes Whether this + * M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Nullable{System.Guid},System.Guid,System.Nullable{System.Boolean}) + * is likes. (optional) + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserItemRatingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean likes) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserItemRatingRequestBuilder(itemId, userId, likes); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateUserItemRating", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateUserItemRatingRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean likes) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling updateUserItemRating"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/UserItems/{itemId}/Rating".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "likes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("likes", likes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserViewsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserViewsApi.java new file mode 100644 index 0000000000000..e9cc4d3ed9cd7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserViewsApi.java @@ -0,0 +1,284 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.CollectionType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SpecialViewOptionDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserViewsApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public UserViewsApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserViewsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Get user view grouping options. + * + * @param userId User id. (optional) + * @return List<SpecialViewOptionDto> + * @throws ApiException if fails to make API call + */ + public List getGroupingOptions(@org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + ApiResponse> localVarResponse = getGroupingOptionsWithHttpInfo(userId); + return localVarResponse.getData(); + } + + /** + * Get user view grouping options. + * + * @param userId User id. (optional) + * @return ApiResponse<List<SpecialViewOptionDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getGroupingOptionsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGroupingOptionsRequestBuilder(userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getGroupingOptions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getGroupingOptionsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/UserViews/GroupingOptions"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get user views. + * + * @param userId User id. (optional) + * @param includeExternalContent Whether or not to include external views such as channels or live tv. (optional) + * @param presetViews Preset views. (optional) + * @param includeHidden Whether or not to include hidden content. (optional, default to false) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getUserViews(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean includeExternalContent, + @org.eclipse.jdt.annotation.NonNull List presetViews, + @org.eclipse.jdt.annotation.NonNull Boolean includeHidden) throws ApiException { + ApiResponse localVarResponse = getUserViewsWithHttpInfo(userId, includeExternalContent, + presetViews, includeHidden); + return localVarResponse.getData(); + } + + /** + * Get user views. + * + * @param userId User id. (optional) + * @param includeExternalContent Whether or not to include external views such as channels or live tv. (optional) + * @param presetViews Preset views. (optional) + * @param includeHidden Whether or not to include hidden content. (optional, default to false) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserViewsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean includeExternalContent, + @org.eclipse.jdt.annotation.NonNull List presetViews, + @org.eclipse.jdt.annotation.NonNull Boolean includeHidden) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUserViewsRequestBuilder(userId, includeExternalContent, + presetViews, includeHidden); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getUserViews", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUserViewsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean includeExternalContent, + @org.eclipse.jdt.annotation.NonNull List presetViews, + @org.eclipse.jdt.annotation.NonNull Boolean includeHidden) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/UserViews"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "includeExternalContent"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeExternalContent", includeExternalContent)); + localVarQueryParameterBaseName = "presetViews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "presetViews", presetViews)); + localVarQueryParameterBaseName = "includeHidden"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeHidden", includeHidden)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/VideoAttachmentsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/VideoAttachmentsApi.java new file mode 100644 index 0000000000000..fd7fc2b31d497 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/VideoAttachmentsApi.java @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class VideoAttachmentsApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public VideoAttachmentsApi() { + this(Configuration.getDefaultApiClient()); + } + + public VideoAttachmentsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Get video attachment. + * + * @param videoId Video ID. (required) + * @param mediaSourceId Media Source ID. (required) + * @param index Attachment Index. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getAttachment(@org.eclipse.jdt.annotation.Nullable UUID videoId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { + ApiResponse localVarResponse = getAttachmentWithHttpInfo(videoId, mediaSourceId, index); + return localVarResponse.getData(); + } + + /** + * Get video attachment. + * + * @param videoId Video ID. (required) + * @param mediaSourceId Media Source ID. (required) + * @param index Attachment Index. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAttachmentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID videoId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAttachmentRequestBuilder(videoId, mediaSourceId, index); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getAttachment", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAttachmentRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID videoId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { + // verify the required parameter 'videoId' is set + if (videoId == null) { + throw new ApiException(400, "Missing the required parameter 'videoId' when calling getAttachment"); + } + // verify the required parameter 'mediaSourceId' is set + if (mediaSourceId == null) { + throw new ApiException(400, "Missing the required parameter 'mediaSourceId' when calling getAttachment"); + } + // verify the required parameter 'index' is set + if (index == null) { + throw new ApiException(400, "Missing the required parameter 'index' when calling getAttachment"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{videoId}/{mediaSourceId}/Attachments/{index}" + .replace("{videoId}", ApiClient.urlEncode(videoId.toString())) + .replace("{mediaSourceId}", ApiClient.urlEncode(mediaSourceId.toString())) + .replace("{index}", ApiClient.urlEncode(index.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/octet-stream, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/VideosApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/VideosApi.java new file mode 100644 index 0000000000000..b485d7800468a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/VideosApi.java @@ -0,0 +1,2232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.EncodingContext; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SubtitleDeliveryMethod; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class VideosApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public VideosApi() { + this(Configuration.getDefaultApiClient()); + } + + public VideosApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Removes alternate video sources. + * + * @param itemId The item id. (required) + * @throws ApiException if fails to make API call + */ + public void deleteAlternateSources(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + deleteAlternateSourcesWithHttpInfo(itemId); + } + + /** + * Removes alternate video sources. + * + * @param itemId The item id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteAlternateSourcesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteAlternateSourcesRequestBuilder(itemId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteAlternateSources", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteAlternateSourcesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteAlternateSources"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/AlternateSources".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets additional parts for a video. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getAdditionalPart(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = getAdditionalPartWithHttpInfo(itemId, userId); + return localVarResponse.getData(); + } + + /** + * Gets additional parts for a video. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAdditionalPartWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAdditionalPartRequestBuilder(itemId, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getAdditionalPart", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAdditionalPartRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getAdditionalPart"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/AdditionalParts".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File getVideoStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + ApiResponse localVarResponse = getVideoStreamWithHttpInfo(itemId, container, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, + videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, + deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAudioVbrEncoding); + return localVarResponse.getData(); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVideoStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getVideoStreamRequestBuilder(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAudioVbrEncoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getVideoStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getVideoStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getVideoStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/stream".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "container"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("container", container)); + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "video/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File getVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + ApiResponse localVarResponse = getVideoStreamByContainerWithHttpInfo(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAudioVbrEncoding); + return localVarResponse.getData(); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVideoStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getVideoStreamByContainerRequestBuilder(itemId, container, _static, + params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAudioVbrEncoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getVideoStreamByContainer", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getVideoStreamByContainerRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getVideoStreamByContainer"); + } + // verify the required parameter 'container' is set + if (container == null) { + throw new ApiException(400, + "Missing the required parameter 'container' when calling getVideoStreamByContainer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/stream.{container}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{container}", ApiClient.urlEncode(container.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "video/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File headVideoStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + ApiResponse localVarResponse = headVideoStreamWithHttpInfo(itemId, container, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, + videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, + deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAudioVbrEncoding); + return localVarResponse.getData(); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headVideoStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headVideoStreamRequestBuilder(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAudioVbrEncoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headVideoStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headVideoStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling headVideoStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/stream".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "container"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("container", container)); + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "video/*"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File headVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + ApiResponse localVarResponse = headVideoStreamByContainerWithHttpInfo(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAudioVbrEncoding); + return localVarResponse.getData(); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headVideoStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headVideoStreamByContainerRequestBuilder(itemId, container, + _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAudioVbrEncoding); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headVideoStreamByContainer", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headVideoStreamByContainerRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling headVideoStreamByContainer"); + } + // verify the required parameter 'container' is set + if (container == null) { + throw new ApiException(400, + "Missing the required parameter 'container' when calling headVideoStreamByContainer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/stream.{container}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{container}", ApiClient.urlEncode(container.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "video/*"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Merges videos into a single record. + * + * @param ids Item id list. This allows multiple, comma delimited. (required) + * @throws ApiException if fails to make API call + */ + public void mergeVersions(@org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { + mergeVersionsWithHttpInfo(ids); + } + + /** + * Merges videos into a single record. + * + * @param ids Item id list. This allows multiple, comma delimited. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse mergeVersionsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable List ids) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = mergeVersionsRequestBuilder(ids); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("mergeVersions", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder mergeVersionsRequestBuilder(@org.eclipse.jdt.annotation.Nullable List ids) + throws ApiException { + // verify the required parameter 'ids' is set + if (ids == null) { + throw new ApiException(400, "Missing the required parameter 'ids' when calling mergeVersions"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/MergeVersions"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/YearsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/YearsApi.java new file mode 100644 index 0000000000000..78c3a5b874ae7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/YearsApi.java @@ -0,0 +1,379 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.current; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.ItemSortBy; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.MediaType; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SortOrder; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class YearsApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public YearsApi() { + this(Configuration.getDefaultApiClient()); + } + + public YearsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Gets a year. + * + * @param year The year. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getYear(@org.eclipse.jdt.annotation.Nullable Integer year, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + ApiResponse localVarResponse = getYearWithHttpInfo(year, userId); + return localVarResponse.getData(); + } + + /** + * Gets a year. + * + * @param year The year. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getYearWithHttpInfo(@org.eclipse.jdt.annotation.Nullable Integer year, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getYearRequestBuilder(year, userId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getYear", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getYearRequestBuilder(@org.eclipse.jdt.annotation.Nullable Integer year, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + // verify the required parameter 'year' is set + if (year == null) { + throw new ApiException(400, "Missing the required parameter 'year' when calling getYear"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Years/{year}".replace("{year}", ApiClient.urlEncode(year.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get years. + * + * @param startIndex Skips over a given number of items within the results. Use for paging. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be excluded based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be included based on item type. This allows + * multiple, comma delimited. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User Id. (optional) + * @param recursive Search recursively. (optional, default to true) + * @param enableImages Optional. Include image information in output. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getYears(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + ApiResponse localVarResponse = getYearsWithHttpInfo(startIndex, limit, sortOrder, + parentId, fields, excludeItemTypes, includeItemTypes, mediaTypes, sortBy, enableUserData, + imageTypeLimit, enableImageTypes, userId, recursive, enableImages); + return localVarResponse.getData(); + } + + /** + * Get years. + * + * @param startIndex Skips over a given number of items within the results. Use for paging. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be excluded based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be included based on item type. This allows + * multiple, comma delimited. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User Id. (optional) + * @param recursive Search recursively. (optional, default to true) + * @param enableImages Optional. Include image information in output. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getYearsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getYearsRequestBuilder(startIndex, limit, sortOrder, parentId, + fields, excludeItemTypes, includeItemTypes, mediaTypes, sortBy, enableUserData, imageTypeLimit, + enableImageTypes, userId, recursive, enableImages); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getYears", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + })); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getYearsRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Years"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "recursive"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("recursive", recursive)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AbstractOpenApiSchema.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000000..bb66e91ebb2a5 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AbstractOpenApiSchema.java @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Map; +import java.util.Objects; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + @JsonValue + public Object getActualInstance() { + return instance; + } + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) { + this.instance = instance; + } + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && Objects.equals(this.isNullable, a.isNullable) + && Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AccessSchedule.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AccessSchedule.java new file mode 100644 index 0000000000000..5430fac68b13c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AccessSchedule.java @@ -0,0 +1,351 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * An entity representing a user's access schedule. + */ +@JsonPropertyOrder({ AccessSchedule.JSON_PROPERTY_ID, AccessSchedule.JSON_PROPERTY_USER_ID, + AccessSchedule.JSON_PROPERTY_DAY_OF_WEEK, AccessSchedule.JSON_PROPERTY_START_HOUR, + AccessSchedule.JSON_PROPERTY_END_HOUR }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AccessSchedule { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private Integer id; + + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_DAY_OF_WEEK = "DayOfWeek"; + @org.eclipse.jdt.annotation.NonNull + private DynamicDayOfWeek dayOfWeek; + + public static final String JSON_PROPERTY_START_HOUR = "StartHour"; + @org.eclipse.jdt.annotation.NonNull + private Double startHour; + + public static final String JSON_PROPERTY_END_HOUR = "EndHour"; + @org.eclipse.jdt.annotation.NonNull + private Double endHour; + + public AccessSchedule() { + } + + @JsonCreator + public AccessSchedule(@JsonProperty(JSON_PROPERTY_ID) Integer id) { + this(); + this.id = id; + } + + /** + * Gets the id of this instance. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getId() { + return id; + } + + public AccessSchedule userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets the id of the associated user. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public AccessSchedule dayOfWeek(@org.eclipse.jdt.annotation.NonNull DynamicDayOfWeek dayOfWeek) { + this.dayOfWeek = dayOfWeek; + return this; + } + + /** + * Gets or sets the day of week. + * + * @return dayOfWeek + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DAY_OF_WEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DynamicDayOfWeek getDayOfWeek() { + return dayOfWeek; + } + + @JsonProperty(JSON_PROPERTY_DAY_OF_WEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDayOfWeek(@org.eclipse.jdt.annotation.NonNull DynamicDayOfWeek dayOfWeek) { + this.dayOfWeek = dayOfWeek; + } + + public AccessSchedule startHour(@org.eclipse.jdt.annotation.NonNull Double startHour) { + this.startHour = startHour; + return this; + } + + /** + * Gets or sets the start hour. + * + * @return startHour + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_HOUR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getStartHour() { + return startHour; + } + + @JsonProperty(JSON_PROPERTY_START_HOUR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartHour(@org.eclipse.jdt.annotation.NonNull Double startHour) { + this.startHour = startHour; + } + + public AccessSchedule endHour(@org.eclipse.jdt.annotation.NonNull Double endHour) { + this.endHour = endHour; + return this; + } + + /** + * Gets or sets the end hour. + * + * @return endHour + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_END_HOUR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getEndHour() { + return endHour; + } + + @JsonProperty(JSON_PROPERTY_END_HOUR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndHour(@org.eclipse.jdt.annotation.NonNull Double endHour) { + this.endHour = endHour; + } + + /** + * Return true if this AccessSchedule object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessSchedule accessSchedule = (AccessSchedule) o; + return Objects.equals(this.id, accessSchedule.id) && Objects.equals(this.userId, accessSchedule.userId) + && Objects.equals(this.dayOfWeek, accessSchedule.dayOfWeek) + && Objects.equals(this.startHour, accessSchedule.startHour) + && Objects.equals(this.endHour, accessSchedule.endHour); + } + + @Override + public int hashCode() { + return Objects.hash(id, userId, dayOfWeek, startHour, endHour); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessSchedule {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" dayOfWeek: ").append(toIndentedString(dayOfWeek)).append("\n"); + sb.append(" startHour: ").append(toIndentedString(startHour)).append("\n"); + sb.append(" endHour: ").append(toIndentedString(endHour)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `DayOfWeek` to the URL query string + if (getDayOfWeek() != null) { + joiner.add(String.format("%sDayOfWeek%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDayOfWeek())))); + } + + // add `StartHour` to the URL query string + if (getStartHour() != null) { + joiner.add(String.format("%sStartHour%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartHour())))); + } + + // add `EndHour` to the URL query string + if (getEndHour() != null) { + joiner.add(String.format("%sEndHour%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndHour())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AccessSchedule instance; + + public Builder() { + this(new AccessSchedule()); + } + + protected Builder(AccessSchedule instance) { + this.instance = instance; + } + + public AccessSchedule.Builder id(Integer id) { + this.instance.id = id; + return this; + } + + public AccessSchedule.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public AccessSchedule.Builder dayOfWeek(DynamicDayOfWeek dayOfWeek) { + this.instance.dayOfWeek = dayOfWeek; + return this; + } + + public AccessSchedule.Builder startHour(Double startHour) { + this.instance.startHour = startHour; + return this; + } + + public AccessSchedule.Builder endHour(Double endHour) { + this.instance.endHour = endHour; + return this; + } + + /** + * returns a built AccessSchedule instance. + * + * The builder is not reusable. + */ + public AccessSchedule build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AccessSchedule.Builder builder() { + return new AccessSchedule.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AccessSchedule.Builder toBuilder() { + return new AccessSchedule.Builder().id(getId()).userId(getUserId()).dayOfWeek(getDayOfWeek()) + .startHour(getStartHour()).endHour(getEndHour()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntry.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntry.java new file mode 100644 index 0000000000000..cb97f6aa6892d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntry.java @@ -0,0 +1,562 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * An activity log entry. + */ +@JsonPropertyOrder({ ActivityLogEntry.JSON_PROPERTY_ID, ActivityLogEntry.JSON_PROPERTY_NAME, + ActivityLogEntry.JSON_PROPERTY_OVERVIEW, ActivityLogEntry.JSON_PROPERTY_SHORT_OVERVIEW, + ActivityLogEntry.JSON_PROPERTY_TYPE, ActivityLogEntry.JSON_PROPERTY_ITEM_ID, + ActivityLogEntry.JSON_PROPERTY_DATE, ActivityLogEntry.JSON_PROPERTY_USER_ID, + ActivityLogEntry.JSON_PROPERTY_USER_PRIMARY_IMAGE_TAG, ActivityLogEntry.JSON_PROPERTY_SEVERITY }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ActivityLogEntry { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private Long id; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_OVERVIEW = "Overview"; + @org.eclipse.jdt.annotation.NonNull + private String overview; + + public static final String JSON_PROPERTY_SHORT_OVERVIEW = "ShortOverview"; + @org.eclipse.jdt.annotation.NonNull + private String shortOverview; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private String itemId; + + public static final String JSON_PROPERTY_DATE = "Date"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime date; + + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_USER_PRIMARY_IMAGE_TAG = "UserPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String userPrimaryImageTag; + + public static final String JSON_PROPERTY_SEVERITY = "Severity"; + @org.eclipse.jdt.annotation.NonNull + private LogLevel severity; + + public ActivityLogEntry() { + } + + public ActivityLogEntry id(@org.eclipse.jdt.annotation.NonNull Long id) { + this.id = id; + return this; + } + + /** + * Gets or sets the identifier. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull Long id) { + this.id = id; + } + + public ActivityLogEntry name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ActivityLogEntry overview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + return this; + } + + /** + * Gets or sets the overview. + * + * @return overview + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOverview() { + return overview; + } + + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOverview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + } + + public ActivityLogEntry shortOverview(@org.eclipse.jdt.annotation.NonNull String shortOverview) { + this.shortOverview = shortOverview; + return this; + } + + /** + * Gets or sets the short overview. + * + * @return shortOverview + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SHORT_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getShortOverview() { + return shortOverview; + } + + @JsonProperty(JSON_PROPERTY_SHORT_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShortOverview(@org.eclipse.jdt.annotation.NonNull String shortOverview) { + this.shortOverview = shortOverview; + } + + public ActivityLogEntry type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public ActivityLogEntry itemId(@org.eclipse.jdt.annotation.NonNull String itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item identifier. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull String itemId) { + this.itemId = itemId; + } + + public ActivityLogEntry date(@org.eclipse.jdt.annotation.NonNull OffsetDateTime date) { + this.date = date; + return this; + } + + /** + * Gets or sets the date. + * + * @return date + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDate() { + return date; + } + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime date) { + this.date = date; + } + + public ActivityLogEntry userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the user identifier. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public ActivityLogEntry userPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String userPrimaryImageTag) { + this.userPrimaryImageTag = userPrimaryImageTag; + return this; + } + + /** + * Gets or sets the user primary image tag. + * + * @return userPrimaryImageTag + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserPrimaryImageTag() { + return userPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_USER_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String userPrimaryImageTag) { + this.userPrimaryImageTag = userPrimaryImageTag; + } + + public ActivityLogEntry severity(@org.eclipse.jdt.annotation.NonNull LogLevel severity) { + this.severity = severity; + return this; + } + + /** + * Gets or sets the log severity. + * + * @return severity + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEVERITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LogLevel getSeverity() { + return severity; + } + + @JsonProperty(JSON_PROPERTY_SEVERITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeverity(@org.eclipse.jdt.annotation.NonNull LogLevel severity) { + this.severity = severity; + } + + /** + * Return true if this ActivityLogEntry object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActivityLogEntry activityLogEntry = (ActivityLogEntry) o; + return Objects.equals(this.id, activityLogEntry.id) && Objects.equals(this.name, activityLogEntry.name) + && Objects.equals(this.overview, activityLogEntry.overview) + && Objects.equals(this.shortOverview, activityLogEntry.shortOverview) + && Objects.equals(this.type, activityLogEntry.type) + && Objects.equals(this.itemId, activityLogEntry.itemId) + && Objects.equals(this.date, activityLogEntry.date) + && Objects.equals(this.userId, activityLogEntry.userId) + && Objects.equals(this.userPrimaryImageTag, activityLogEntry.userPrimaryImageTag) + && Objects.equals(this.severity, activityLogEntry.severity); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, overview, shortOverview, type, itemId, date, userId, userPrimaryImageTag, + severity); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActivityLogEntry {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" overview: ").append(toIndentedString(overview)).append("\n"); + sb.append(" shortOverview: ").append(toIndentedString(shortOverview)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" userPrimaryImageTag: ").append(toIndentedString(userPrimaryImageTag)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Overview` to the URL query string + if (getOverview() != null) { + joiner.add(String.format("%sOverview%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOverview())))); + } + + // add `ShortOverview` to the URL query string + if (getShortOverview() != null) { + joiner.add(String.format("%sShortOverview%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getShortOverview())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `Date` to the URL query string + if (getDate() != null) { + joiner.add(String.format("%sDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDate())))); + } + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `UserPrimaryImageTag` to the URL query string + if (getUserPrimaryImageTag() != null) { + joiner.add(String.format("%sUserPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserPrimaryImageTag())))); + } + + // add `Severity` to the URL query string + if (getSeverity() != null) { + joiner.add(String.format("%sSeverity%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeverity())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ActivityLogEntry instance; + + public Builder() { + this(new ActivityLogEntry()); + } + + protected Builder(ActivityLogEntry instance) { + this.instance = instance; + } + + public ActivityLogEntry.Builder id(Long id) { + this.instance.id = id; + return this; + } + + public ActivityLogEntry.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ActivityLogEntry.Builder overview(String overview) { + this.instance.overview = overview; + return this; + } + + public ActivityLogEntry.Builder shortOverview(String shortOverview) { + this.instance.shortOverview = shortOverview; + return this; + } + + public ActivityLogEntry.Builder type(String type) { + this.instance.type = type; + return this; + } + + public ActivityLogEntry.Builder itemId(String itemId) { + this.instance.itemId = itemId; + return this; + } + + public ActivityLogEntry.Builder date(OffsetDateTime date) { + this.instance.date = date; + return this; + } + + public ActivityLogEntry.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public ActivityLogEntry.Builder userPrimaryImageTag(String userPrimaryImageTag) { + this.instance.userPrimaryImageTag = userPrimaryImageTag; + return this; + } + + public ActivityLogEntry.Builder severity(LogLevel severity) { + this.instance.severity = severity; + return this; + } + + /** + * returns a built ActivityLogEntry instance. + * + * The builder is not reusable. + */ + public ActivityLogEntry build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ActivityLogEntry.Builder builder() { + return new ActivityLogEntry.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ActivityLogEntry.Builder toBuilder() { + return new ActivityLogEntry.Builder().id(getId()).name(getName()).overview(getOverview()) + .shortOverview(getShortOverview()).type(getType()).itemId(getItemId()).date(getDate()) + .userId(getUserId()).userPrimaryImageTag(getUserPrimaryImageTag()).severity(getSeverity()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntryMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntryMessage.java new file mode 100644 index 0000000000000..a33ff61f9a845 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntryMessage.java @@ -0,0 +1,285 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Activity log created message. + */ +@JsonPropertyOrder({ ActivityLogEntryMessage.JSON_PROPERTY_DATA, ActivityLogEntryMessage.JSON_PROPERTY_MESSAGE_ID, + ActivityLogEntryMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ActivityLogEntryMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private List data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.ACTIVITY_LOG_ENTRY; + + public ActivityLogEntryMessage() { + } + + @JsonCreator + public ActivityLogEntryMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public ActivityLogEntryMessage data(@org.eclipse.jdt.annotation.NonNull List data) { + this.data = data; + return this; + } + + public ActivityLogEntryMessage addDataItem(ActivityLogEntry dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull List data) { + this.data = data; + } + + public ActivityLogEntryMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this ActivityLogEntryMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActivityLogEntryMessage activityLogEntryMessage = (ActivityLogEntryMessage) o; + return Objects.equals(this.data, activityLogEntryMessage.data) + && Objects.equals(this.messageId, activityLogEntryMessage.messageId) + && Objects.equals(this.messageType, activityLogEntryMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActivityLogEntryMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + for (int i = 0; i < getData().size(); i++) { + if (getData().get(i) != null) { + joiner.add(getData().get(i).toUrlQueryString(String.format("%sData%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ActivityLogEntryMessage instance; + + public Builder() { + this(new ActivityLogEntryMessage()); + } + + protected Builder(ActivityLogEntryMessage instance) { + this.instance = instance; + } + + public ActivityLogEntryMessage.Builder data(List data) { + this.instance.data = data; + return this; + } + + public ActivityLogEntryMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public ActivityLogEntryMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built ActivityLogEntryMessage instance. + * + * The builder is not reusable. + */ + public ActivityLogEntryMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ActivityLogEntryMessage.Builder builder() { + return new ActivityLogEntryMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ActivityLogEntryMessage.Builder toBuilder() { + return new ActivityLogEntryMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntryQueryResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntryQueryResult.java new file mode 100644 index 0000000000000..ebfd7e5570fa8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntryQueryResult.java @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Query result container. + */ +@JsonPropertyOrder({ ActivityLogEntryQueryResult.JSON_PROPERTY_ITEMS, + ActivityLogEntryQueryResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, + ActivityLogEntryQueryResult.JSON_PROPERTY_START_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ActivityLogEntryQueryResult { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public ActivityLogEntryQueryResult() { + } + + public ActivityLogEntryQueryResult items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public ActivityLogEntryQueryResult addItemsItem(ActivityLogEntry itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Gets or sets the items. + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public ActivityLogEntryQueryResult totalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total number of records available. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public ActivityLogEntryQueryResult startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the index of the first record in Items. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + /** + * Return true if this ActivityLogEntryQueryResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActivityLogEntryQueryResult activityLogEntryQueryResult = (ActivityLogEntryQueryResult) o; + return Objects.equals(this.items, activityLogEntryQueryResult.items) + && Objects.equals(this.totalRecordCount, activityLogEntryQueryResult.totalRecordCount) + && Objects.equals(this.startIndex, activityLogEntryQueryResult.startIndex); + } + + @Override + public int hashCode() { + return Objects.hash(items, totalRecordCount, startIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActivityLogEntryQueryResult {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ActivityLogEntryQueryResult instance; + + public Builder() { + this(new ActivityLogEntryQueryResult()); + } + + protected Builder(ActivityLogEntryQueryResult instance) { + this.instance = instance; + } + + public ActivityLogEntryQueryResult.Builder items(List items) { + this.instance.items = items; + return this; + } + + public ActivityLogEntryQueryResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public ActivityLogEntryQueryResult.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + /** + * returns a built ActivityLogEntryQueryResult instance. + * + * The builder is not reusable. + */ + public ActivityLogEntryQueryResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ActivityLogEntryQueryResult.Builder builder() { + return new ActivityLogEntryQueryResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ActivityLogEntryQueryResult.Builder toBuilder() { + return new ActivityLogEntryQueryResult.Builder().items(getItems()).totalRecordCount(getTotalRecordCount()) + .startIndex(getStartIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntryStartMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntryStartMessage.java new file mode 100644 index 0000000000000..ae7df0bac263c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntryStartMessage.java @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Activity log entry start message. Data is the timing data encoded as \"$initialDelay,$interval\" in ms. + */ +@JsonPropertyOrder({ ActivityLogEntryStartMessage.JSON_PROPERTY_DATA, + ActivityLogEntryStartMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ActivityLogEntryStartMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private String data; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.ACTIVITY_LOG_ENTRY_START; + + public ActivityLogEntryStartMessage() { + } + + @JsonCreator + public ActivityLogEntryStartMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public ActivityLogEntryStartMessage data(@org.eclipse.jdt.annotation.NonNull String data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull String data) { + this.data = data; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this ActivityLogEntryStartMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActivityLogEntryStartMessage activityLogEntryStartMessage = (ActivityLogEntryStartMessage) o; + return Objects.equals(this.data, activityLogEntryStartMessage.data) + && Objects.equals(this.messageType, activityLogEntryStartMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActivityLogEntryStartMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(String.format("%sData%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getData())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ActivityLogEntryStartMessage instance; + + public Builder() { + this(new ActivityLogEntryStartMessage()); + } + + protected Builder(ActivityLogEntryStartMessage instance) { + this.instance = instance; + } + + public ActivityLogEntryStartMessage.Builder data(String data) { + this.instance.data = data; + return this; + } + + public ActivityLogEntryStartMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built ActivityLogEntryStartMessage instance. + * + * The builder is not reusable. + */ + public ActivityLogEntryStartMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ActivityLogEntryStartMessage.Builder builder() { + return new ActivityLogEntryStartMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ActivityLogEntryStartMessage.Builder toBuilder() { + return new ActivityLogEntryStartMessage.Builder().data(getData()).messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntryStopMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntryStopMessage.java new file mode 100644 index 0000000000000..92a1140433261 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ActivityLogEntryStopMessage.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Activity log entry stop message. + */ +@JsonPropertyOrder({ ActivityLogEntryStopMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ActivityLogEntryStopMessage { + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.ACTIVITY_LOG_ENTRY_STOP; + + public ActivityLogEntryStopMessage() { + } + + @JsonCreator + public ActivityLogEntryStopMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this ActivityLogEntryStopMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActivityLogEntryStopMessage activityLogEntryStopMessage = (ActivityLogEntryStopMessage) o; + return Objects.equals(this.messageType, activityLogEntryStopMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActivityLogEntryStopMessage {\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ActivityLogEntryStopMessage instance; + + public Builder() { + this(new ActivityLogEntryStopMessage()); + } + + protected Builder(ActivityLogEntryStopMessage instance) { + this.instance = instance; + } + + public ActivityLogEntryStopMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built ActivityLogEntryStopMessage instance. + * + * The builder is not reusable. + */ + public ActivityLogEntryStopMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ActivityLogEntryStopMessage.Builder builder() { + return new ActivityLogEntryStopMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ActivityLogEntryStopMessage.Builder toBuilder() { + return new ActivityLogEntryStopMessage.Builder().messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AddVirtualFolderDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AddVirtualFolderDto.java new file mode 100644 index 0000000000000..d65f956b90146 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AddVirtualFolderDto.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Add virtual folder dto. + */ +@JsonPropertyOrder({ AddVirtualFolderDto.JSON_PROPERTY_LIBRARY_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AddVirtualFolderDto { + public static final String JSON_PROPERTY_LIBRARY_OPTIONS = "LibraryOptions"; + @org.eclipse.jdt.annotation.NonNull + private LibraryOptions libraryOptions; + + public AddVirtualFolderDto() { + } + + public AddVirtualFolderDto libraryOptions(@org.eclipse.jdt.annotation.NonNull LibraryOptions libraryOptions) { + this.libraryOptions = libraryOptions; + return this; + } + + /** + * Gets or sets library options. + * + * @return libraryOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIBRARY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LibraryOptions getLibraryOptions() { + return libraryOptions; + } + + @JsonProperty(JSON_PROPERTY_LIBRARY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLibraryOptions(@org.eclipse.jdt.annotation.NonNull LibraryOptions libraryOptions) { + this.libraryOptions = libraryOptions; + } + + /** + * Return true if this AddVirtualFolderDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddVirtualFolderDto addVirtualFolderDto = (AddVirtualFolderDto) o; + return Objects.equals(this.libraryOptions, addVirtualFolderDto.libraryOptions); + } + + @Override + public int hashCode() { + return Objects.hash(libraryOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddVirtualFolderDto {\n"); + sb.append(" libraryOptions: ").append(toIndentedString(libraryOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `LibraryOptions` to the URL query string + if (getLibraryOptions() != null) { + joiner.add(getLibraryOptions().toUrlQueryString(prefix + "LibraryOptions" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private AddVirtualFolderDto instance; + + public Builder() { + this(new AddVirtualFolderDto()); + } + + protected Builder(AddVirtualFolderDto instance) { + this.instance = instance; + } + + public AddVirtualFolderDto.Builder libraryOptions(LibraryOptions libraryOptions) { + this.instance.libraryOptions = libraryOptions; + return this; + } + + /** + * returns a built AddVirtualFolderDto instance. + * + * The builder is not reusable. + */ + public AddVirtualFolderDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AddVirtualFolderDto.Builder builder() { + return new AddVirtualFolderDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AddVirtualFolderDto.Builder toBuilder() { + return new AddVirtualFolderDto.Builder().libraryOptions(getLibraryOptions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AlbumInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AlbumInfo.java new file mode 100644 index 0000000000000..5f36e9e2f4881 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AlbumInfo.java @@ -0,0 +1,772 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AlbumInfo + */ +@JsonPropertyOrder({ AlbumInfo.JSON_PROPERTY_NAME, AlbumInfo.JSON_PROPERTY_ORIGINAL_TITLE, AlbumInfo.JSON_PROPERTY_PATH, + AlbumInfo.JSON_PROPERTY_METADATA_LANGUAGE, AlbumInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, + AlbumInfo.JSON_PROPERTY_PROVIDER_IDS, AlbumInfo.JSON_PROPERTY_YEAR, AlbumInfo.JSON_PROPERTY_INDEX_NUMBER, + AlbumInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, AlbumInfo.JSON_PROPERTY_PREMIERE_DATE, + AlbumInfo.JSON_PROPERTY_IS_AUTOMATED, AlbumInfo.JSON_PROPERTY_ALBUM_ARTISTS, + AlbumInfo.JSON_PROPERTY_ARTIST_PROVIDER_IDS, AlbumInfo.JSON_PROPERTY_SONG_INFOS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AlbumInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public static final String JSON_PROPERTY_ALBUM_ARTISTS = "AlbumArtists"; + @org.eclipse.jdt.annotation.NonNull + private List albumArtists = new ArrayList<>(); + + public static final String JSON_PROPERTY_ARTIST_PROVIDER_IDS = "ArtistProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map artistProviderIds = new HashMap<>(); + + public static final String JSON_PROPERTY_SONG_INFOS = "SongInfos"; + @org.eclipse.jdt.annotation.NonNull + private List songInfos = new ArrayList<>(); + + public AlbumInfo() { + } + + public AlbumInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public AlbumInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public AlbumInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public AlbumInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public AlbumInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public AlbumInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public AlbumInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public AlbumInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public AlbumInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public AlbumInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public AlbumInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public AlbumInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + public AlbumInfo albumArtists(@org.eclipse.jdt.annotation.NonNull List albumArtists) { + this.albumArtists = albumArtists; + return this; + } + + public AlbumInfo addAlbumArtistsItem(String albumArtistsItem) { + if (this.albumArtists == null) { + this.albumArtists = new ArrayList<>(); + } + this.albumArtists.add(albumArtistsItem); + return this; + } + + /** + * Gets or sets the album artist. + * + * @return albumArtists + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAlbumArtists() { + return albumArtists; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumArtists(@org.eclipse.jdt.annotation.NonNull List albumArtists) { + this.albumArtists = albumArtists; + } + + public AlbumInfo artistProviderIds(@org.eclipse.jdt.annotation.NonNull Map artistProviderIds) { + this.artistProviderIds = artistProviderIds; + return this; + } + + public AlbumInfo putArtistProviderIdsItem(String key, String artistProviderIdsItem) { + if (this.artistProviderIds == null) { + this.artistProviderIds = new HashMap<>(); + } + this.artistProviderIds.put(key, artistProviderIdsItem); + return this; + } + + /** + * Gets or sets the artist provider ids. + * + * @return artistProviderIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTIST_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getArtistProviderIds() { + return artistProviderIds; + } + + @JsonProperty(JSON_PROPERTY_ARTIST_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setArtistProviderIds(@org.eclipse.jdt.annotation.NonNull Map artistProviderIds) { + this.artistProviderIds = artistProviderIds; + } + + public AlbumInfo songInfos(@org.eclipse.jdt.annotation.NonNull List songInfos) { + this.songInfos = songInfos; + return this; + } + + public AlbumInfo addSongInfosItem(SongInfo songInfosItem) { + if (this.songInfos == null) { + this.songInfos = new ArrayList<>(); + } + this.songInfos.add(songInfosItem); + return this; + } + + /** + * Get songInfos + * + * @return songInfos + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SONG_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSongInfos() { + return songInfos; + } + + @JsonProperty(JSON_PROPERTY_SONG_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSongInfos(@org.eclipse.jdt.annotation.NonNull List songInfos) { + this.songInfos = songInfos; + } + + /** + * Return true if this AlbumInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlbumInfo albumInfo = (AlbumInfo) o; + return Objects.equals(this.name, albumInfo.name) && Objects.equals(this.originalTitle, albumInfo.originalTitle) + && Objects.equals(this.path, albumInfo.path) + && Objects.equals(this.metadataLanguage, albumInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, albumInfo.metadataCountryCode) + && Objects.equals(this.providerIds, albumInfo.providerIds) && Objects.equals(this.year, albumInfo.year) + && Objects.equals(this.indexNumber, albumInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, albumInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, albumInfo.premiereDate) + && Objects.equals(this.isAutomated, albumInfo.isAutomated) + && Objects.equals(this.albumArtists, albumInfo.albumArtists) + && Objects.equals(this.artistProviderIds, albumInfo.artistProviderIds) + && Objects.equals(this.songInfos, albumInfo.songInfos); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated, albumArtists, artistProviderIds, songInfos); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlbumInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append(" albumArtists: ").append(toIndentedString(albumArtists)).append("\n"); + sb.append(" artistProviderIds: ").append(toIndentedString(artistProviderIds)).append("\n"); + sb.append(" songInfos: ").append(toIndentedString(songInfos)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + // add `AlbumArtists` to the URL query string + if (getAlbumArtists() != null) { + for (int i = 0; i < getAlbumArtists().size(); i++) { + joiner.add(String.format("%sAlbumArtists%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getAlbumArtists().get(i))))); + } + } + + // add `ArtistProviderIds` to the URL query string + if (getArtistProviderIds() != null) { + for (String _key : getArtistProviderIds().keySet()) { + joiner.add(String.format("%sArtistProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getArtistProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getArtistProviderIds().get(_key))))); + } + } + + // add `SongInfos` to the URL query string + if (getSongInfos() != null) { + for (int i = 0; i < getSongInfos().size(); i++) { + if (getSongInfos().get(i) != null) { + joiner.add(getSongInfos().get(i).toUrlQueryString(String.format("%sSongInfos%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private AlbumInfo instance; + + public Builder() { + this(new AlbumInfo()); + } + + protected Builder(AlbumInfo instance) { + this.instance = instance; + } + + public AlbumInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public AlbumInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public AlbumInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public AlbumInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public AlbumInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public AlbumInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public AlbumInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public AlbumInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public AlbumInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public AlbumInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public AlbumInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + public AlbumInfo.Builder albumArtists(List albumArtists) { + this.instance.albumArtists = albumArtists; + return this; + } + + public AlbumInfo.Builder artistProviderIds(Map artistProviderIds) { + this.instance.artistProviderIds = artistProviderIds; + return this; + } + + public AlbumInfo.Builder songInfos(List songInfos) { + this.instance.songInfos = songInfos; + return this; + } + + /** + * returns a built AlbumInfo instance. + * + * The builder is not reusable. + */ + public AlbumInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AlbumInfo.Builder builder() { + return new AlbumInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AlbumInfo.Builder toBuilder() { + return new AlbumInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()).isAutomated(getIsAutomated()) + .albumArtists(getAlbumArtists()).artistProviderIds(getArtistProviderIds()).songInfos(getSongInfos()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AlbumInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AlbumInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..2a274feb2a035 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AlbumInfoRemoteSearchQuery.java @@ -0,0 +1,317 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AlbumInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ AlbumInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + AlbumInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, AlbumInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + AlbumInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AlbumInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private AlbumInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public AlbumInfoRemoteSearchQuery() { + } + + public AlbumInfoRemoteSearchQuery searchInfo(@org.eclipse.jdt.annotation.NonNull AlbumInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AlbumInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull AlbumInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public AlbumInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public AlbumInfoRemoteSearchQuery searchProviderName( + @org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public AlbumInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this AlbumInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlbumInfoRemoteSearchQuery albumInfoRemoteSearchQuery = (AlbumInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, albumInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, albumInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, albumInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, albumInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlbumInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AlbumInfoRemoteSearchQuery instance; + + public Builder() { + this(new AlbumInfoRemoteSearchQuery()); + } + + protected Builder(AlbumInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public AlbumInfoRemoteSearchQuery.Builder searchInfo(AlbumInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public AlbumInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public AlbumInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public AlbumInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built AlbumInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public AlbumInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AlbumInfoRemoteSearchQuery.Builder builder() { + return new AlbumInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AlbumInfoRemoteSearchQuery.Builder toBuilder() { + return new AlbumInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AllThemeMediaResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AllThemeMediaResult.java new file mode 100644 index 0000000000000..cbfa7f0a07dd0 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AllThemeMediaResult.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AllThemeMediaResult + */ +@JsonPropertyOrder({ AllThemeMediaResult.JSON_PROPERTY_THEME_VIDEOS_RESULT, + AllThemeMediaResult.JSON_PROPERTY_THEME_SONGS_RESULT, + AllThemeMediaResult.JSON_PROPERTY_SOUNDTRACK_SONGS_RESULT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AllThemeMediaResult { + public static final String JSON_PROPERTY_THEME_VIDEOS_RESULT = "ThemeVideosResult"; + @org.eclipse.jdt.annotation.NonNull + private ThemeMediaResult themeVideosResult; + + public static final String JSON_PROPERTY_THEME_SONGS_RESULT = "ThemeSongsResult"; + @org.eclipse.jdt.annotation.NonNull + private ThemeMediaResult themeSongsResult; + + public static final String JSON_PROPERTY_SOUNDTRACK_SONGS_RESULT = "SoundtrackSongsResult"; + @org.eclipse.jdt.annotation.NonNull + private ThemeMediaResult soundtrackSongsResult; + + public AllThemeMediaResult() { + } + + public AllThemeMediaResult themeVideosResult( + @org.eclipse.jdt.annotation.NonNull ThemeMediaResult themeVideosResult) { + this.themeVideosResult = themeVideosResult; + return this; + } + + /** + * Class ThemeMediaResult. + * + * @return themeVideosResult + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THEME_VIDEOS_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ThemeMediaResult getThemeVideosResult() { + return themeVideosResult; + } + + @JsonProperty(JSON_PROPERTY_THEME_VIDEOS_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThemeVideosResult(@org.eclipse.jdt.annotation.NonNull ThemeMediaResult themeVideosResult) { + this.themeVideosResult = themeVideosResult; + } + + public AllThemeMediaResult themeSongsResult(@org.eclipse.jdt.annotation.NonNull ThemeMediaResult themeSongsResult) { + this.themeSongsResult = themeSongsResult; + return this; + } + + /** + * Class ThemeMediaResult. + * + * @return themeSongsResult + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THEME_SONGS_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ThemeMediaResult getThemeSongsResult() { + return themeSongsResult; + } + + @JsonProperty(JSON_PROPERTY_THEME_SONGS_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThemeSongsResult(@org.eclipse.jdt.annotation.NonNull ThemeMediaResult themeSongsResult) { + this.themeSongsResult = themeSongsResult; + } + + public AllThemeMediaResult soundtrackSongsResult( + @org.eclipse.jdt.annotation.NonNull ThemeMediaResult soundtrackSongsResult) { + this.soundtrackSongsResult = soundtrackSongsResult; + return this; + } + + /** + * Class ThemeMediaResult. + * + * @return soundtrackSongsResult + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SOUNDTRACK_SONGS_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ThemeMediaResult getSoundtrackSongsResult() { + return soundtrackSongsResult; + } + + @JsonProperty(JSON_PROPERTY_SOUNDTRACK_SONGS_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSoundtrackSongsResult(@org.eclipse.jdt.annotation.NonNull ThemeMediaResult soundtrackSongsResult) { + this.soundtrackSongsResult = soundtrackSongsResult; + } + + /** + * Return true if this AllThemeMediaResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllThemeMediaResult allThemeMediaResult = (AllThemeMediaResult) o; + return Objects.equals(this.themeVideosResult, allThemeMediaResult.themeVideosResult) + && Objects.equals(this.themeSongsResult, allThemeMediaResult.themeSongsResult) + && Objects.equals(this.soundtrackSongsResult, allThemeMediaResult.soundtrackSongsResult); + } + + @Override + public int hashCode() { + return Objects.hash(themeVideosResult, themeSongsResult, soundtrackSongsResult); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllThemeMediaResult {\n"); + sb.append(" themeVideosResult: ").append(toIndentedString(themeVideosResult)).append("\n"); + sb.append(" themeSongsResult: ").append(toIndentedString(themeSongsResult)).append("\n"); + sb.append(" soundtrackSongsResult: ").append(toIndentedString(soundtrackSongsResult)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ThemeVideosResult` to the URL query string + if (getThemeVideosResult() != null) { + joiner.add(getThemeVideosResult().toUrlQueryString(prefix + "ThemeVideosResult" + suffix)); + } + + // add `ThemeSongsResult` to the URL query string + if (getThemeSongsResult() != null) { + joiner.add(getThemeSongsResult().toUrlQueryString(prefix + "ThemeSongsResult" + suffix)); + } + + // add `SoundtrackSongsResult` to the URL query string + if (getSoundtrackSongsResult() != null) { + joiner.add(getSoundtrackSongsResult().toUrlQueryString(prefix + "SoundtrackSongsResult" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private AllThemeMediaResult instance; + + public Builder() { + this(new AllThemeMediaResult()); + } + + protected Builder(AllThemeMediaResult instance) { + this.instance = instance; + } + + public AllThemeMediaResult.Builder themeVideosResult(ThemeMediaResult themeVideosResult) { + this.instance.themeVideosResult = themeVideosResult; + return this; + } + + public AllThemeMediaResult.Builder themeSongsResult(ThemeMediaResult themeSongsResult) { + this.instance.themeSongsResult = themeSongsResult; + return this; + } + + public AllThemeMediaResult.Builder soundtrackSongsResult(ThemeMediaResult soundtrackSongsResult) { + this.instance.soundtrackSongsResult = soundtrackSongsResult; + return this; + } + + /** + * returns a built AllThemeMediaResult instance. + * + * The builder is not reusable. + */ + public AllThemeMediaResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AllThemeMediaResult.Builder builder() { + return new AllThemeMediaResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AllThemeMediaResult.Builder toBuilder() { + return new AllThemeMediaResult.Builder().themeVideosResult(getThemeVideosResult()) + .themeSongsResult(getThemeSongsResult()).soundtrackSongsResult(getSoundtrackSongsResult()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ArtistInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ArtistInfo.java new file mode 100644 index 0000000000000..16565be1121c8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ArtistInfo.java @@ -0,0 +1,671 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ArtistInfo + */ +@JsonPropertyOrder({ ArtistInfo.JSON_PROPERTY_NAME, ArtistInfo.JSON_PROPERTY_ORIGINAL_TITLE, + ArtistInfo.JSON_PROPERTY_PATH, ArtistInfo.JSON_PROPERTY_METADATA_LANGUAGE, + ArtistInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, ArtistInfo.JSON_PROPERTY_PROVIDER_IDS, + ArtistInfo.JSON_PROPERTY_YEAR, ArtistInfo.JSON_PROPERTY_INDEX_NUMBER, + ArtistInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, ArtistInfo.JSON_PROPERTY_PREMIERE_DATE, + ArtistInfo.JSON_PROPERTY_IS_AUTOMATED, ArtistInfo.JSON_PROPERTY_SONG_INFOS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ArtistInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public static final String JSON_PROPERTY_SONG_INFOS = "SongInfos"; + @org.eclipse.jdt.annotation.NonNull + private List songInfos = new ArrayList<>(); + + public ArtistInfo() { + } + + public ArtistInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ArtistInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public ArtistInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public ArtistInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public ArtistInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public ArtistInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public ArtistInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public ArtistInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public ArtistInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public ArtistInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public ArtistInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public ArtistInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + public ArtistInfo songInfos(@org.eclipse.jdt.annotation.NonNull List songInfos) { + this.songInfos = songInfos; + return this; + } + + public ArtistInfo addSongInfosItem(SongInfo songInfosItem) { + if (this.songInfos == null) { + this.songInfos = new ArrayList<>(); + } + this.songInfos.add(songInfosItem); + return this; + } + + /** + * Get songInfos + * + * @return songInfos + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SONG_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSongInfos() { + return songInfos; + } + + @JsonProperty(JSON_PROPERTY_SONG_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSongInfos(@org.eclipse.jdt.annotation.NonNull List songInfos) { + this.songInfos = songInfos; + } + + /** + * Return true if this ArtistInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArtistInfo artistInfo = (ArtistInfo) o; + return Objects.equals(this.name, artistInfo.name) + && Objects.equals(this.originalTitle, artistInfo.originalTitle) + && Objects.equals(this.path, artistInfo.path) + && Objects.equals(this.metadataLanguage, artistInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, artistInfo.metadataCountryCode) + && Objects.equals(this.providerIds, artistInfo.providerIds) + && Objects.equals(this.year, artistInfo.year) + && Objects.equals(this.indexNumber, artistInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, artistInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, artistInfo.premiereDate) + && Objects.equals(this.isAutomated, artistInfo.isAutomated) + && Objects.equals(this.songInfos, artistInfo.songInfos); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated, songInfos); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArtistInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append(" songInfos: ").append(toIndentedString(songInfos)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + // add `SongInfos` to the URL query string + if (getSongInfos() != null) { + for (int i = 0; i < getSongInfos().size(); i++) { + if (getSongInfos().get(i) != null) { + joiner.add(getSongInfos().get(i).toUrlQueryString(String.format("%sSongInfos%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private ArtistInfo instance; + + public Builder() { + this(new ArtistInfo()); + } + + protected Builder(ArtistInfo instance) { + this.instance = instance; + } + + public ArtistInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ArtistInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public ArtistInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public ArtistInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public ArtistInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public ArtistInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public ArtistInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public ArtistInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public ArtistInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public ArtistInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public ArtistInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + public ArtistInfo.Builder songInfos(List songInfos) { + this.instance.songInfos = songInfos; + return this; + } + + /** + * returns a built ArtistInfo instance. + * + * The builder is not reusable. + */ + public ArtistInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ArtistInfo.Builder builder() { + return new ArtistInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ArtistInfo.Builder toBuilder() { + return new ArtistInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()).isAutomated(getIsAutomated()) + .songInfos(getSongInfos()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ArtistInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ArtistInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..365b29d4071c4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ArtistInfoRemoteSearchQuery.java @@ -0,0 +1,318 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ArtistInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ ArtistInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + ArtistInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, + ArtistInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + ArtistInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ArtistInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private ArtistInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public ArtistInfoRemoteSearchQuery() { + } + + public ArtistInfoRemoteSearchQuery searchInfo(@org.eclipse.jdt.annotation.NonNull ArtistInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ArtistInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull ArtistInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public ArtistInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public ArtistInfoRemoteSearchQuery searchProviderName( + @org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public ArtistInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this ArtistInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArtistInfoRemoteSearchQuery artistInfoRemoteSearchQuery = (ArtistInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, artistInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, artistInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, artistInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, artistInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArtistInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ArtistInfoRemoteSearchQuery instance; + + public Builder() { + this(new ArtistInfoRemoteSearchQuery()); + } + + protected Builder(ArtistInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public ArtistInfoRemoteSearchQuery.Builder searchInfo(ArtistInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public ArtistInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public ArtistInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public ArtistInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built ArtistInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public ArtistInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ArtistInfoRemoteSearchQuery.Builder builder() { + return new ArtistInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ArtistInfoRemoteSearchQuery.Builder toBuilder() { + return new ArtistInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AudioSpatialFormat.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AudioSpatialFormat.java new file mode 100644 index 0000000000000..2668773767d3d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AudioSpatialFormat.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * An enum representing formats of spatial audio. + */ +public enum AudioSpatialFormat { + + NONE("None"), + + DOLBY_ATMOS("DolbyAtmos"), + + DTSX("DTSX"); + + private String value; + + AudioSpatialFormat(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static AudioSpatialFormat fromValue(String value) { + for (AudioSpatialFormat b : AudioSpatialFormat.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AuthenticateUserByName.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AuthenticateUserByName.java new file mode 100644 index 0000000000000..b0653d9f01357 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AuthenticateUserByName.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The authenticate user by name request body. + */ +@JsonPropertyOrder({ AuthenticateUserByName.JSON_PROPERTY_USERNAME, AuthenticateUserByName.JSON_PROPERTY_PW }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AuthenticateUserByName { + public static final String JSON_PROPERTY_USERNAME = "Username"; + @org.eclipse.jdt.annotation.NonNull + private String username; + + public static final String JSON_PROPERTY_PW = "Pw"; + @org.eclipse.jdt.annotation.NonNull + private String pw; + + public AuthenticateUserByName() { + } + + public AuthenticateUserByName username(@org.eclipse.jdt.annotation.NonNull String username) { + this.username = username; + return this; + } + + /** + * Gets or sets the username. + * + * @return username + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; + } + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(@org.eclipse.jdt.annotation.NonNull String username) { + this.username = username; + } + + public AuthenticateUserByName pw(@org.eclipse.jdt.annotation.NonNull String pw) { + this.pw = pw; + return this; + } + + /** + * Gets or sets the plain text password. + * + * @return pw + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPw() { + return pw; + } + + @JsonProperty(JSON_PROPERTY_PW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPw(@org.eclipse.jdt.annotation.NonNull String pw) { + this.pw = pw; + } + + /** + * Return true if this AuthenticateUserByName object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthenticateUserByName authenticateUserByName = (AuthenticateUserByName) o; + return Objects.equals(this.username, authenticateUserByName.username) + && Objects.equals(this.pw, authenticateUserByName.pw); + } + + @Override + public int hashCode() { + return Objects.hash(username, pw); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthenticateUserByName {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" pw: ").append(toIndentedString(pw)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Username` to the URL query string + if (getUsername() != null) { + joiner.add(String.format("%sUsername%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUsername())))); + } + + // add `Pw` to the URL query string + if (getPw() != null) { + joiner.add( + String.format("%sPw%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPw())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AuthenticateUserByName instance; + + public Builder() { + this(new AuthenticateUserByName()); + } + + protected Builder(AuthenticateUserByName instance) { + this.instance = instance; + } + + public AuthenticateUserByName.Builder username(String username) { + this.instance.username = username; + return this; + } + + public AuthenticateUserByName.Builder pw(String pw) { + this.instance.pw = pw; + return this; + } + + /** + * returns a built AuthenticateUserByName instance. + * + * The builder is not reusable. + */ + public AuthenticateUserByName build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AuthenticateUserByName.Builder builder() { + return new AuthenticateUserByName.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AuthenticateUserByName.Builder toBuilder() { + return new AuthenticateUserByName.Builder().username(getUsername()).pw(getPw()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AuthenticationInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AuthenticationInfo.java new file mode 100644 index 0000000000000..023f55284967e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AuthenticationInfo.java @@ -0,0 +1,643 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AuthenticationInfo + */ +@JsonPropertyOrder({ AuthenticationInfo.JSON_PROPERTY_ID, AuthenticationInfo.JSON_PROPERTY_ACCESS_TOKEN, + AuthenticationInfo.JSON_PROPERTY_DEVICE_ID, AuthenticationInfo.JSON_PROPERTY_APP_NAME, + AuthenticationInfo.JSON_PROPERTY_APP_VERSION, AuthenticationInfo.JSON_PROPERTY_DEVICE_NAME, + AuthenticationInfo.JSON_PROPERTY_USER_ID, AuthenticationInfo.JSON_PROPERTY_IS_ACTIVE, + AuthenticationInfo.JSON_PROPERTY_DATE_CREATED, AuthenticationInfo.JSON_PROPERTY_DATE_REVOKED, + AuthenticationInfo.JSON_PROPERTY_DATE_LAST_ACTIVITY, AuthenticationInfo.JSON_PROPERTY_USER_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AuthenticationInfo { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private Long id; + + public static final String JSON_PROPERTY_ACCESS_TOKEN = "AccessToken"; + @org.eclipse.jdt.annotation.NonNull + private String accessToken; + + public static final String JSON_PROPERTY_DEVICE_ID = "DeviceId"; + @org.eclipse.jdt.annotation.NonNull + private String deviceId; + + public static final String JSON_PROPERTY_APP_NAME = "AppName"; + @org.eclipse.jdt.annotation.NonNull + private String appName; + + public static final String JSON_PROPERTY_APP_VERSION = "AppVersion"; + @org.eclipse.jdt.annotation.NonNull + private String appVersion; + + public static final String JSON_PROPERTY_DEVICE_NAME = "DeviceName"; + @org.eclipse.jdt.annotation.NonNull + private String deviceName; + + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_IS_ACTIVE = "IsActive"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isActive; + + public static final String JSON_PROPERTY_DATE_CREATED = "DateCreated"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateCreated; + + public static final String JSON_PROPERTY_DATE_REVOKED = "DateRevoked"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateRevoked; + + public static final String JSON_PROPERTY_DATE_LAST_ACTIVITY = "DateLastActivity"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateLastActivity; + + public static final String JSON_PROPERTY_USER_NAME = "UserName"; + @org.eclipse.jdt.annotation.NonNull + private String userName; + + public AuthenticationInfo() { + } + + public AuthenticationInfo id(@org.eclipse.jdt.annotation.NonNull Long id) { + this.id = id; + return this; + } + + /** + * Gets or sets the identifier. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull Long id) { + this.id = id; + } + + public AuthenticationInfo accessToken(@org.eclipse.jdt.annotation.NonNull String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Gets or sets the access token. + * + * @return accessToken + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccessToken() { + return accessToken; + } + + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessToken(@org.eclipse.jdt.annotation.NonNull String accessToken) { + this.accessToken = accessToken; + } + + public AuthenticationInfo deviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Gets or sets the device identifier. + * + * @return deviceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceId() { + return deviceId; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + } + + public AuthenticationInfo appName(@org.eclipse.jdt.annotation.NonNull String appName) { + this.appName = appName; + return this; + } + + /** + * Gets or sets the name of the application. + * + * @return appName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppName() { + return appName; + } + + @JsonProperty(JSON_PROPERTY_APP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppName(@org.eclipse.jdt.annotation.NonNull String appName) { + this.appName = appName; + } + + public AuthenticationInfo appVersion(@org.eclipse.jdt.annotation.NonNull String appVersion) { + this.appVersion = appVersion; + return this; + } + + /** + * Gets or sets the application version. + * + * @return appVersion + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APP_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppVersion() { + return appVersion; + } + + @JsonProperty(JSON_PROPERTY_APP_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppVersion(@org.eclipse.jdt.annotation.NonNull String appVersion) { + this.appVersion = appVersion; + } + + public AuthenticationInfo deviceName(@org.eclipse.jdt.annotation.NonNull String deviceName) { + this.deviceName = deviceName; + return this; + } + + /** + * Gets or sets the name of the device. + * + * @return deviceName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceName() { + return deviceName; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceName(@org.eclipse.jdt.annotation.NonNull String deviceName) { + this.deviceName = deviceName; + } + + public AuthenticationInfo userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the user identifier. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public AuthenticationInfo isActive(@org.eclipse.jdt.annotation.NonNull Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is active. + * + * @return isActive + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsActive() { + return isActive; + } + + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsActive(@org.eclipse.jdt.annotation.NonNull Boolean isActive) { + this.isActive = isActive; + } + + public AuthenticationInfo dateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + return this; + } + + /** + * Gets or sets the date created. + * + * @return dateCreated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateCreated() { + return dateCreated; + } + + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + } + + public AuthenticationInfo dateRevoked(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateRevoked) { + this.dateRevoked = dateRevoked; + return this; + } + + /** + * Gets or sets the date revoked. + * + * @return dateRevoked + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_REVOKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateRevoked() { + return dateRevoked; + } + + @JsonProperty(JSON_PROPERTY_DATE_REVOKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateRevoked(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateRevoked) { + this.dateRevoked = dateRevoked; + } + + public AuthenticationInfo dateLastActivity(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateLastActivity) { + this.dateLastActivity = dateLastActivity; + return this; + } + + /** + * Get dateLastActivity + * + * @return dateLastActivity + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_LAST_ACTIVITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateLastActivity() { + return dateLastActivity; + } + + @JsonProperty(JSON_PROPERTY_DATE_LAST_ACTIVITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateLastActivity(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateLastActivity) { + this.dateLastActivity = dateLastActivity; + } + + public AuthenticationInfo userName(@org.eclipse.jdt.annotation.NonNull String userName) { + this.userName = userName; + return this; + } + + /** + * Get userName + * + * @return userName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserName() { + return userName; + } + + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserName(@org.eclipse.jdt.annotation.NonNull String userName) { + this.userName = userName; + } + + /** + * Return true if this AuthenticationInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthenticationInfo authenticationInfo = (AuthenticationInfo) o; + return Objects.equals(this.id, authenticationInfo.id) + && Objects.equals(this.accessToken, authenticationInfo.accessToken) + && Objects.equals(this.deviceId, authenticationInfo.deviceId) + && Objects.equals(this.appName, authenticationInfo.appName) + && Objects.equals(this.appVersion, authenticationInfo.appVersion) + && Objects.equals(this.deviceName, authenticationInfo.deviceName) + && Objects.equals(this.userId, authenticationInfo.userId) + && Objects.equals(this.isActive, authenticationInfo.isActive) + && Objects.equals(this.dateCreated, authenticationInfo.dateCreated) + && Objects.equals(this.dateRevoked, authenticationInfo.dateRevoked) + && Objects.equals(this.dateLastActivity, authenticationInfo.dateLastActivity) + && Objects.equals(this.userName, authenticationInfo.userName); + } + + @Override + public int hashCode() { + return Objects.hash(id, accessToken, deviceId, appName, appVersion, deviceName, userId, isActive, dateCreated, + dateRevoked, dateLastActivity, userName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthenticationInfo {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" deviceId: ").append(toIndentedString(deviceId)).append("\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); + sb.append(" deviceName: ").append(toIndentedString(deviceName)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" dateCreated: ").append(toIndentedString(dateCreated)).append("\n"); + sb.append(" dateRevoked: ").append(toIndentedString(dateRevoked)).append("\n"); + sb.append(" dateLastActivity: ").append(toIndentedString(dateLastActivity)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `AccessToken` to the URL query string + if (getAccessToken() != null) { + joiner.add(String.format("%sAccessToken%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAccessToken())))); + } + + // add `DeviceId` to the URL query string + if (getDeviceId() != null) { + joiner.add(String.format("%sDeviceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceId())))); + } + + // add `AppName` to the URL query string + if (getAppName() != null) { + joiner.add(String.format("%sAppName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAppName())))); + } + + // add `AppVersion` to the URL query string + if (getAppVersion() != null) { + joiner.add(String.format("%sAppVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAppVersion())))); + } + + // add `DeviceName` to the URL query string + if (getDeviceName() != null) { + joiner.add(String.format("%sDeviceName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceName())))); + } + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `IsActive` to the URL query string + if (getIsActive() != null) { + joiner.add(String.format("%sIsActive%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsActive())))); + } + + // add `DateCreated` to the URL query string + if (getDateCreated() != null) { + joiner.add(String.format("%sDateCreated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateCreated())))); + } + + // add `DateRevoked` to the URL query string + if (getDateRevoked() != null) { + joiner.add(String.format("%sDateRevoked%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateRevoked())))); + } + + // add `DateLastActivity` to the URL query string + if (getDateLastActivity() != null) { + joiner.add(String.format("%sDateLastActivity%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateLastActivity())))); + } + + // add `UserName` to the URL query string + if (getUserName() != null) { + joiner.add(String.format("%sUserName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AuthenticationInfo instance; + + public Builder() { + this(new AuthenticationInfo()); + } + + protected Builder(AuthenticationInfo instance) { + this.instance = instance; + } + + public AuthenticationInfo.Builder id(Long id) { + this.instance.id = id; + return this; + } + + public AuthenticationInfo.Builder accessToken(String accessToken) { + this.instance.accessToken = accessToken; + return this; + } + + public AuthenticationInfo.Builder deviceId(String deviceId) { + this.instance.deviceId = deviceId; + return this; + } + + public AuthenticationInfo.Builder appName(String appName) { + this.instance.appName = appName; + return this; + } + + public AuthenticationInfo.Builder appVersion(String appVersion) { + this.instance.appVersion = appVersion; + return this; + } + + public AuthenticationInfo.Builder deviceName(String deviceName) { + this.instance.deviceName = deviceName; + return this; + } + + public AuthenticationInfo.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public AuthenticationInfo.Builder isActive(Boolean isActive) { + this.instance.isActive = isActive; + return this; + } + + public AuthenticationInfo.Builder dateCreated(OffsetDateTime dateCreated) { + this.instance.dateCreated = dateCreated; + return this; + } + + public AuthenticationInfo.Builder dateRevoked(OffsetDateTime dateRevoked) { + this.instance.dateRevoked = dateRevoked; + return this; + } + + public AuthenticationInfo.Builder dateLastActivity(OffsetDateTime dateLastActivity) { + this.instance.dateLastActivity = dateLastActivity; + return this; + } + + public AuthenticationInfo.Builder userName(String userName) { + this.instance.userName = userName; + return this; + } + + /** + * returns a built AuthenticationInfo instance. + * + * The builder is not reusable. + */ + public AuthenticationInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AuthenticationInfo.Builder builder() { + return new AuthenticationInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AuthenticationInfo.Builder toBuilder() { + return new AuthenticationInfo.Builder().id(getId()).accessToken(getAccessToken()).deviceId(getDeviceId()) + .appName(getAppName()).appVersion(getAppVersion()).deviceName(getDeviceName()).userId(getUserId()) + .isActive(getIsActive()).dateCreated(getDateCreated()).dateRevoked(getDateRevoked()) + .dateLastActivity(getDateLastActivity()).userName(getUserName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AuthenticationInfoQueryResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AuthenticationInfoQueryResult.java new file mode 100644 index 0000000000000..9c7ad966415f2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AuthenticationInfoQueryResult.java @@ -0,0 +1,290 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Query result container. + */ +@JsonPropertyOrder({ AuthenticationInfoQueryResult.JSON_PROPERTY_ITEMS, + AuthenticationInfoQueryResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, + AuthenticationInfoQueryResult.JSON_PROPERTY_START_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AuthenticationInfoQueryResult { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public AuthenticationInfoQueryResult() { + } + + public AuthenticationInfoQueryResult items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public AuthenticationInfoQueryResult addItemsItem(AuthenticationInfo itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Gets or sets the items. + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public AuthenticationInfoQueryResult totalRecordCount( + @org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total number of records available. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public AuthenticationInfoQueryResult startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the index of the first record in Items. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + /** + * Return true if this AuthenticationInfoQueryResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthenticationInfoQueryResult authenticationInfoQueryResult = (AuthenticationInfoQueryResult) o; + return Objects.equals(this.items, authenticationInfoQueryResult.items) + && Objects.equals(this.totalRecordCount, authenticationInfoQueryResult.totalRecordCount) + && Objects.equals(this.startIndex, authenticationInfoQueryResult.startIndex); + } + + @Override + public int hashCode() { + return Objects.hash(items, totalRecordCount, startIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthenticationInfoQueryResult {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AuthenticationInfoQueryResult instance; + + public Builder() { + this(new AuthenticationInfoQueryResult()); + } + + protected Builder(AuthenticationInfoQueryResult instance) { + this.instance = instance; + } + + public AuthenticationInfoQueryResult.Builder items(List items) { + this.instance.items = items; + return this; + } + + public AuthenticationInfoQueryResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public AuthenticationInfoQueryResult.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + /** + * returns a built AuthenticationInfoQueryResult instance. + * + * The builder is not reusable. + */ + public AuthenticationInfoQueryResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AuthenticationInfoQueryResult.Builder builder() { + return new AuthenticationInfoQueryResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AuthenticationInfoQueryResult.Builder toBuilder() { + return new AuthenticationInfoQueryResult.Builder().items(getItems()).totalRecordCount(getTotalRecordCount()) + .startIndex(getStartIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AuthenticationResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AuthenticationResult.java new file mode 100644 index 0000000000000..5de4c223bc350 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/AuthenticationResult.java @@ -0,0 +1,312 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * A class representing an authentication result. + */ +@JsonPropertyOrder({ AuthenticationResult.JSON_PROPERTY_USER, AuthenticationResult.JSON_PROPERTY_SESSION_INFO, + AuthenticationResult.JSON_PROPERTY_ACCESS_TOKEN, AuthenticationResult.JSON_PROPERTY_SERVER_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AuthenticationResult { + public static final String JSON_PROPERTY_USER = "User"; + @org.eclipse.jdt.annotation.NonNull + private UserDto user; + + public static final String JSON_PROPERTY_SESSION_INFO = "SessionInfo"; + @org.eclipse.jdt.annotation.NonNull + private SessionInfoDto sessionInfo; + + public static final String JSON_PROPERTY_ACCESS_TOKEN = "AccessToken"; + @org.eclipse.jdt.annotation.NonNull + private String accessToken; + + public static final String JSON_PROPERTY_SERVER_ID = "ServerId"; + @org.eclipse.jdt.annotation.NonNull + private String serverId; + + public AuthenticationResult() { + } + + public AuthenticationResult user(@org.eclipse.jdt.annotation.NonNull UserDto user) { + this.user = user; + return this; + } + + /** + * Gets or sets the user. + * + * @return user + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserDto getUser() { + return user; + } + + @JsonProperty(JSON_PROPERTY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUser(@org.eclipse.jdt.annotation.NonNull UserDto user) { + this.user = user; + } + + public AuthenticationResult sessionInfo(@org.eclipse.jdt.annotation.NonNull SessionInfoDto sessionInfo) { + this.sessionInfo = sessionInfo; + return this; + } + + /** + * Gets or sets the session info. + * + * @return sessionInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SESSION_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionInfoDto getSessionInfo() { + return sessionInfo; + } + + @JsonProperty(JSON_PROPERTY_SESSION_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSessionInfo(@org.eclipse.jdt.annotation.NonNull SessionInfoDto sessionInfo) { + this.sessionInfo = sessionInfo; + } + + public AuthenticationResult accessToken(@org.eclipse.jdt.annotation.NonNull String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Gets or sets the access token. + * + * @return accessToken + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccessToken() { + return accessToken; + } + + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessToken(@org.eclipse.jdt.annotation.NonNull String accessToken) { + this.accessToken = accessToken; + } + + public AuthenticationResult serverId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + return this; + } + + /** + * Gets or sets the server id. + * + * @return serverId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerId() { + return serverId; + } + + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + } + + /** + * Return true if this AuthenticationResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthenticationResult authenticationResult = (AuthenticationResult) o; + return Objects.equals(this.user, authenticationResult.user) + && Objects.equals(this.sessionInfo, authenticationResult.sessionInfo) + && Objects.equals(this.accessToken, authenticationResult.accessToken) + && Objects.equals(this.serverId, authenticationResult.serverId); + } + + @Override + public int hashCode() { + return Objects.hash(user, sessionInfo, accessToken, serverId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthenticationResult {\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" sessionInfo: ").append(toIndentedString(sessionInfo)).append("\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `User` to the URL query string + if (getUser() != null) { + joiner.add(getUser().toUrlQueryString(prefix + "User" + suffix)); + } + + // add `SessionInfo` to the URL query string + if (getSessionInfo() != null) { + joiner.add(getSessionInfo().toUrlQueryString(prefix + "SessionInfo" + suffix)); + } + + // add `AccessToken` to the URL query string + if (getAccessToken() != null) { + joiner.add(String.format("%sAccessToken%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAccessToken())))); + } + + // add `ServerId` to the URL query string + if (getServerId() != null) { + joiner.add(String.format("%sServerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AuthenticationResult instance; + + public Builder() { + this(new AuthenticationResult()); + } + + protected Builder(AuthenticationResult instance) { + this.instance = instance; + } + + public AuthenticationResult.Builder user(UserDto user) { + this.instance.user = user; + return this; + } + + public AuthenticationResult.Builder sessionInfo(SessionInfoDto sessionInfo) { + this.instance.sessionInfo = sessionInfo; + return this; + } + + public AuthenticationResult.Builder accessToken(String accessToken) { + this.instance.accessToken = accessToken; + return this; + } + + public AuthenticationResult.Builder serverId(String serverId) { + this.instance.serverId = serverId; + return this; + } + + /** + * returns a built AuthenticationResult instance. + * + * The builder is not reusable. + */ + public AuthenticationResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AuthenticationResult.Builder builder() { + return new AuthenticationResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AuthenticationResult.Builder toBuilder() { + return new AuthenticationResult.Builder().user(getUser()).sessionInfo(getSessionInfo()) + .accessToken(getAccessToken()).serverId(getServerId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemDto.java new file mode 100644 index 0000000000000..fd6b1c6bbab40 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemDto.java @@ -0,0 +1,6695 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * This is strictly used as a data transfer object from the api layer. This holds information about a BaseItem in a + * format that is convenient for the client. + */ +@JsonPropertyOrder({ BaseItemDto.JSON_PROPERTY_NAME, BaseItemDto.JSON_PROPERTY_ORIGINAL_TITLE, + BaseItemDto.JSON_PROPERTY_SERVER_ID, BaseItemDto.JSON_PROPERTY_ID, BaseItemDto.JSON_PROPERTY_ETAG, + BaseItemDto.JSON_PROPERTY_SOURCE_TYPE, BaseItemDto.JSON_PROPERTY_PLAYLIST_ITEM_ID, + BaseItemDto.JSON_PROPERTY_DATE_CREATED, BaseItemDto.JSON_PROPERTY_DATE_LAST_MEDIA_ADDED, + BaseItemDto.JSON_PROPERTY_EXTRA_TYPE, BaseItemDto.JSON_PROPERTY_AIRS_BEFORE_SEASON_NUMBER, + BaseItemDto.JSON_PROPERTY_AIRS_AFTER_SEASON_NUMBER, BaseItemDto.JSON_PROPERTY_AIRS_BEFORE_EPISODE_NUMBER, + BaseItemDto.JSON_PROPERTY_CAN_DELETE, BaseItemDto.JSON_PROPERTY_CAN_DOWNLOAD, + BaseItemDto.JSON_PROPERTY_HAS_LYRICS, BaseItemDto.JSON_PROPERTY_HAS_SUBTITLES, + BaseItemDto.JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE, + BaseItemDto.JSON_PROPERTY_PREFERRED_METADATA_COUNTRY_CODE, BaseItemDto.JSON_PROPERTY_CONTAINER, + BaseItemDto.JSON_PROPERTY_SORT_NAME, BaseItemDto.JSON_PROPERTY_FORCED_SORT_NAME, + BaseItemDto.JSON_PROPERTY_VIDEO3_D_FORMAT, BaseItemDto.JSON_PROPERTY_PREMIERE_DATE, + BaseItemDto.JSON_PROPERTY_EXTERNAL_URLS, BaseItemDto.JSON_PROPERTY_MEDIA_SOURCES, + BaseItemDto.JSON_PROPERTY_CRITIC_RATING, BaseItemDto.JSON_PROPERTY_PRODUCTION_LOCATIONS, + BaseItemDto.JSON_PROPERTY_PATH, BaseItemDto.JSON_PROPERTY_ENABLE_MEDIA_SOURCE_DISPLAY, + BaseItemDto.JSON_PROPERTY_OFFICIAL_RATING, BaseItemDto.JSON_PROPERTY_CUSTOM_RATING, + BaseItemDto.JSON_PROPERTY_CHANNEL_ID, BaseItemDto.JSON_PROPERTY_CHANNEL_NAME, + BaseItemDto.JSON_PROPERTY_OVERVIEW, BaseItemDto.JSON_PROPERTY_TAGLINES, BaseItemDto.JSON_PROPERTY_GENRES, + BaseItemDto.JSON_PROPERTY_COMMUNITY_RATING, BaseItemDto.JSON_PROPERTY_CUMULATIVE_RUN_TIME_TICKS, + BaseItemDto.JSON_PROPERTY_RUN_TIME_TICKS, BaseItemDto.JSON_PROPERTY_PLAY_ACCESS, + BaseItemDto.JSON_PROPERTY_ASPECT_RATIO, BaseItemDto.JSON_PROPERTY_PRODUCTION_YEAR, + BaseItemDto.JSON_PROPERTY_IS_PLACE_HOLDER, BaseItemDto.JSON_PROPERTY_NUMBER, + BaseItemDto.JSON_PROPERTY_CHANNEL_NUMBER, BaseItemDto.JSON_PROPERTY_INDEX_NUMBER, + BaseItemDto.JSON_PROPERTY_INDEX_NUMBER_END, BaseItemDto.JSON_PROPERTY_PARENT_INDEX_NUMBER, + BaseItemDto.JSON_PROPERTY_REMOTE_TRAILERS, BaseItemDto.JSON_PROPERTY_PROVIDER_IDS, + BaseItemDto.JSON_PROPERTY_IS_H_D, BaseItemDto.JSON_PROPERTY_IS_FOLDER, BaseItemDto.JSON_PROPERTY_PARENT_ID, + BaseItemDto.JSON_PROPERTY_TYPE, BaseItemDto.JSON_PROPERTY_PEOPLE, BaseItemDto.JSON_PROPERTY_STUDIOS, + BaseItemDto.JSON_PROPERTY_GENRE_ITEMS, BaseItemDto.JSON_PROPERTY_PARENT_LOGO_ITEM_ID, + BaseItemDto.JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID, BaseItemDto.JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS, + BaseItemDto.JSON_PROPERTY_LOCAL_TRAILER_COUNT, BaseItemDto.JSON_PROPERTY_USER_DATA, + BaseItemDto.JSON_PROPERTY_RECURSIVE_ITEM_COUNT, BaseItemDto.JSON_PROPERTY_CHILD_COUNT, + BaseItemDto.JSON_PROPERTY_SERIES_NAME, BaseItemDto.JSON_PROPERTY_SERIES_ID, BaseItemDto.JSON_PROPERTY_SEASON_ID, + BaseItemDto.JSON_PROPERTY_SPECIAL_FEATURE_COUNT, BaseItemDto.JSON_PROPERTY_DISPLAY_PREFERENCES_ID, + BaseItemDto.JSON_PROPERTY_STATUS, BaseItemDto.JSON_PROPERTY_AIR_TIME, BaseItemDto.JSON_PROPERTY_AIR_DAYS, + BaseItemDto.JSON_PROPERTY_TAGS, BaseItemDto.JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO, + BaseItemDto.JSON_PROPERTY_ARTISTS, BaseItemDto.JSON_PROPERTY_ARTIST_ITEMS, BaseItemDto.JSON_PROPERTY_ALBUM, + BaseItemDto.JSON_PROPERTY_COLLECTION_TYPE, BaseItemDto.JSON_PROPERTY_DISPLAY_ORDER, + BaseItemDto.JSON_PROPERTY_ALBUM_ID, BaseItemDto.JSON_PROPERTY_ALBUM_PRIMARY_IMAGE_TAG, + BaseItemDto.JSON_PROPERTY_SERIES_PRIMARY_IMAGE_TAG, BaseItemDto.JSON_PROPERTY_ALBUM_ARTIST, + BaseItemDto.JSON_PROPERTY_ALBUM_ARTISTS, BaseItemDto.JSON_PROPERTY_SEASON_NAME, + BaseItemDto.JSON_PROPERTY_MEDIA_STREAMS, BaseItemDto.JSON_PROPERTY_VIDEO_TYPE, + BaseItemDto.JSON_PROPERTY_PART_COUNT, BaseItemDto.JSON_PROPERTY_MEDIA_SOURCE_COUNT, + BaseItemDto.JSON_PROPERTY_IMAGE_TAGS, BaseItemDto.JSON_PROPERTY_BACKDROP_IMAGE_TAGS, + BaseItemDto.JSON_PROPERTY_SCREENSHOT_IMAGE_TAGS, BaseItemDto.JSON_PROPERTY_PARENT_LOGO_IMAGE_TAG, + BaseItemDto.JSON_PROPERTY_PARENT_ART_ITEM_ID, BaseItemDto.JSON_PROPERTY_PARENT_ART_IMAGE_TAG, + BaseItemDto.JSON_PROPERTY_SERIES_THUMB_IMAGE_TAG, BaseItemDto.JSON_PROPERTY_IMAGE_BLUR_HASHES, + BaseItemDto.JSON_PROPERTY_SERIES_STUDIO, BaseItemDto.JSON_PROPERTY_PARENT_THUMB_ITEM_ID, + BaseItemDto.JSON_PROPERTY_PARENT_THUMB_IMAGE_TAG, BaseItemDto.JSON_PROPERTY_PARENT_PRIMARY_IMAGE_ITEM_ID, + BaseItemDto.JSON_PROPERTY_PARENT_PRIMARY_IMAGE_TAG, BaseItemDto.JSON_PROPERTY_CHAPTERS, + BaseItemDto.JSON_PROPERTY_TRICKPLAY, BaseItemDto.JSON_PROPERTY_LOCATION_TYPE, + BaseItemDto.JSON_PROPERTY_ISO_TYPE, BaseItemDto.JSON_PROPERTY_MEDIA_TYPE, BaseItemDto.JSON_PROPERTY_END_DATE, + BaseItemDto.JSON_PROPERTY_LOCKED_FIELDS, BaseItemDto.JSON_PROPERTY_TRAILER_COUNT, + BaseItemDto.JSON_PROPERTY_MOVIE_COUNT, BaseItemDto.JSON_PROPERTY_SERIES_COUNT, + BaseItemDto.JSON_PROPERTY_PROGRAM_COUNT, BaseItemDto.JSON_PROPERTY_EPISODE_COUNT, + BaseItemDto.JSON_PROPERTY_SONG_COUNT, BaseItemDto.JSON_PROPERTY_ALBUM_COUNT, + BaseItemDto.JSON_PROPERTY_ARTIST_COUNT, BaseItemDto.JSON_PROPERTY_MUSIC_VIDEO_COUNT, + BaseItemDto.JSON_PROPERTY_LOCK_DATA, BaseItemDto.JSON_PROPERTY_WIDTH, BaseItemDto.JSON_PROPERTY_HEIGHT, + BaseItemDto.JSON_PROPERTY_CAMERA_MAKE, BaseItemDto.JSON_PROPERTY_CAMERA_MODEL, + BaseItemDto.JSON_PROPERTY_SOFTWARE, BaseItemDto.JSON_PROPERTY_EXPOSURE_TIME, + BaseItemDto.JSON_PROPERTY_FOCAL_LENGTH, BaseItemDto.JSON_PROPERTY_IMAGE_ORIENTATION, + BaseItemDto.JSON_PROPERTY_APERTURE, BaseItemDto.JSON_PROPERTY_SHUTTER_SPEED, BaseItemDto.JSON_PROPERTY_LATITUDE, + BaseItemDto.JSON_PROPERTY_LONGITUDE, BaseItemDto.JSON_PROPERTY_ALTITUDE, + BaseItemDto.JSON_PROPERTY_ISO_SPEED_RATING, BaseItemDto.JSON_PROPERTY_SERIES_TIMER_ID, + BaseItemDto.JSON_PROPERTY_PROGRAM_ID, BaseItemDto.JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG, + BaseItemDto.JSON_PROPERTY_START_DATE, BaseItemDto.JSON_PROPERTY_COMPLETION_PERCENTAGE, + BaseItemDto.JSON_PROPERTY_IS_REPEAT, BaseItemDto.JSON_PROPERTY_EPISODE_TITLE, + BaseItemDto.JSON_PROPERTY_CHANNEL_TYPE, BaseItemDto.JSON_PROPERTY_AUDIO, BaseItemDto.JSON_PROPERTY_IS_MOVIE, + BaseItemDto.JSON_PROPERTY_IS_SPORTS, BaseItemDto.JSON_PROPERTY_IS_SERIES, BaseItemDto.JSON_PROPERTY_IS_LIVE, + BaseItemDto.JSON_PROPERTY_IS_NEWS, BaseItemDto.JSON_PROPERTY_IS_KIDS, BaseItemDto.JSON_PROPERTY_IS_PREMIERE, + BaseItemDto.JSON_PROPERTY_TIMER_ID, BaseItemDto.JSON_PROPERTY_NORMALIZATION_GAIN, + BaseItemDto.JSON_PROPERTY_CURRENT_PROGRAM }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BaseItemDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_SERVER_ID = "ServerId"; + @org.eclipse.jdt.annotation.NonNull + private String serverId; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_ETAG = "Etag"; + @org.eclipse.jdt.annotation.NonNull + private String etag; + + public static final String JSON_PROPERTY_SOURCE_TYPE = "SourceType"; + @org.eclipse.jdt.annotation.NonNull + private String sourceType; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private String playlistItemId; + + public static final String JSON_PROPERTY_DATE_CREATED = "DateCreated"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateCreated; + + public static final String JSON_PROPERTY_DATE_LAST_MEDIA_ADDED = "DateLastMediaAdded"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateLastMediaAdded; + + public static final String JSON_PROPERTY_EXTRA_TYPE = "ExtraType"; + @org.eclipse.jdt.annotation.NonNull + private ExtraType extraType; + + public static final String JSON_PROPERTY_AIRS_BEFORE_SEASON_NUMBER = "AirsBeforeSeasonNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer airsBeforeSeasonNumber; + + public static final String JSON_PROPERTY_AIRS_AFTER_SEASON_NUMBER = "AirsAfterSeasonNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer airsAfterSeasonNumber; + + public static final String JSON_PROPERTY_AIRS_BEFORE_EPISODE_NUMBER = "AirsBeforeEpisodeNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer airsBeforeEpisodeNumber; + + public static final String JSON_PROPERTY_CAN_DELETE = "CanDelete"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canDelete; + + public static final String JSON_PROPERTY_CAN_DOWNLOAD = "CanDownload"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canDownload; + + public static final String JSON_PROPERTY_HAS_LYRICS = "HasLyrics"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasLyrics; + + public static final String JSON_PROPERTY_HAS_SUBTITLES = "HasSubtitles"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasSubtitles; + + public static final String JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE = "PreferredMetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String preferredMetadataLanguage; + + public static final String JSON_PROPERTY_PREFERRED_METADATA_COUNTRY_CODE = "PreferredMetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String preferredMetadataCountryCode; + + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public static final String JSON_PROPERTY_SORT_NAME = "SortName"; + @org.eclipse.jdt.annotation.NonNull + private String sortName; + + public static final String JSON_PROPERTY_FORCED_SORT_NAME = "ForcedSortName"; + @org.eclipse.jdt.annotation.NonNull + private String forcedSortName; + + public static final String JSON_PROPERTY_VIDEO3_D_FORMAT = "Video3DFormat"; + @org.eclipse.jdt.annotation.NonNull + private Video3DFormat video3DFormat; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_EXTERNAL_URLS = "ExternalUrls"; + @org.eclipse.jdt.annotation.NonNull + private List externalUrls; + + public static final String JSON_PROPERTY_MEDIA_SOURCES = "MediaSources"; + @org.eclipse.jdt.annotation.NonNull + private List mediaSources; + + public static final String JSON_PROPERTY_CRITIC_RATING = "CriticRating"; + @org.eclipse.jdt.annotation.NonNull + private Float criticRating; + + public static final String JSON_PROPERTY_PRODUCTION_LOCATIONS = "ProductionLocations"; + @org.eclipse.jdt.annotation.NonNull + private List productionLocations; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_ENABLE_MEDIA_SOURCE_DISPLAY = "EnableMediaSourceDisplay"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableMediaSourceDisplay; + + public static final String JSON_PROPERTY_OFFICIAL_RATING = "OfficialRating"; + @org.eclipse.jdt.annotation.NonNull + private String officialRating; + + public static final String JSON_PROPERTY_CUSTOM_RATING = "CustomRating"; + @org.eclipse.jdt.annotation.NonNull + private String customRating; + + public static final String JSON_PROPERTY_CHANNEL_ID = "ChannelId"; + @org.eclipse.jdt.annotation.NonNull + private UUID channelId; + + public static final String JSON_PROPERTY_CHANNEL_NAME = "ChannelName"; + @org.eclipse.jdt.annotation.NonNull + private String channelName; + + public static final String JSON_PROPERTY_OVERVIEW = "Overview"; + @org.eclipse.jdt.annotation.NonNull + private String overview; + + public static final String JSON_PROPERTY_TAGLINES = "Taglines"; + @org.eclipse.jdt.annotation.NonNull + private List taglines; + + public static final String JSON_PROPERTY_GENRES = "Genres"; + @org.eclipse.jdt.annotation.NonNull + private List genres; + + public static final String JSON_PROPERTY_COMMUNITY_RATING = "CommunityRating"; + @org.eclipse.jdt.annotation.NonNull + private Float communityRating; + + public static final String JSON_PROPERTY_CUMULATIVE_RUN_TIME_TICKS = "CumulativeRunTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long cumulativeRunTimeTicks; + + public static final String JSON_PROPERTY_RUN_TIME_TICKS = "RunTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long runTimeTicks; + + public static final String JSON_PROPERTY_PLAY_ACCESS = "PlayAccess"; + @org.eclipse.jdt.annotation.NonNull + private PlayAccess playAccess; + + public static final String JSON_PROPERTY_ASPECT_RATIO = "AspectRatio"; + @org.eclipse.jdt.annotation.NonNull + private String aspectRatio; + + public static final String JSON_PROPERTY_PRODUCTION_YEAR = "ProductionYear"; + @org.eclipse.jdt.annotation.NonNull + private Integer productionYear; + + public static final String JSON_PROPERTY_IS_PLACE_HOLDER = "IsPlaceHolder"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPlaceHolder; + + public static final String JSON_PROPERTY_NUMBER = "Number"; + @org.eclipse.jdt.annotation.NonNull + private String number; + + public static final String JSON_PROPERTY_CHANNEL_NUMBER = "ChannelNumber"; + @org.eclipse.jdt.annotation.NonNull + private String channelNumber; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_INDEX_NUMBER_END = "IndexNumberEnd"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumberEnd; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_REMOTE_TRAILERS = "RemoteTrailers"; + @org.eclipse.jdt.annotation.NonNull + private List remoteTrailers; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_IS_H_D = "IsHD"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isHD; + + public static final String JSON_PROPERTY_IS_FOLDER = "IsFolder"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isFolder; + + public static final String JSON_PROPERTY_PARENT_ID = "ParentId"; + @org.eclipse.jdt.annotation.NonNull + private UUID parentId; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemKind type; + + public static final String JSON_PROPERTY_PEOPLE = "People"; + @org.eclipse.jdt.annotation.NonNull + private List people; + + public static final String JSON_PROPERTY_STUDIOS = "Studios"; + @org.eclipse.jdt.annotation.NonNull + private List studios; + + public static final String JSON_PROPERTY_GENRE_ITEMS = "GenreItems"; + @org.eclipse.jdt.annotation.NonNull + private List genreItems; + + public static final String JSON_PROPERTY_PARENT_LOGO_ITEM_ID = "ParentLogoItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID parentLogoItemId; + + public static final String JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID = "ParentBackdropItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID parentBackdropItemId; + + public static final String JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS = "ParentBackdropImageTags"; + @org.eclipse.jdt.annotation.NonNull + private List parentBackdropImageTags; + + public static final String JSON_PROPERTY_LOCAL_TRAILER_COUNT = "LocalTrailerCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer localTrailerCount; + + public static final String JSON_PROPERTY_USER_DATA = "UserData"; + @org.eclipse.jdt.annotation.NonNull + private UserItemDataDto userData; + + public static final String JSON_PROPERTY_RECURSIVE_ITEM_COUNT = "RecursiveItemCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer recursiveItemCount; + + public static final String JSON_PROPERTY_CHILD_COUNT = "ChildCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer childCount; + + public static final String JSON_PROPERTY_SERIES_NAME = "SeriesName"; + @org.eclipse.jdt.annotation.NonNull + private String seriesName; + + public static final String JSON_PROPERTY_SERIES_ID = "SeriesId"; + @org.eclipse.jdt.annotation.NonNull + private UUID seriesId; + + public static final String JSON_PROPERTY_SEASON_ID = "SeasonId"; + @org.eclipse.jdt.annotation.NonNull + private UUID seasonId; + + public static final String JSON_PROPERTY_SPECIAL_FEATURE_COUNT = "SpecialFeatureCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer specialFeatureCount; + + public static final String JSON_PROPERTY_DISPLAY_PREFERENCES_ID = "DisplayPreferencesId"; + @org.eclipse.jdt.annotation.NonNull + private String displayPreferencesId; + + public static final String JSON_PROPERTY_STATUS = "Status"; + @org.eclipse.jdt.annotation.NonNull + private String status; + + public static final String JSON_PROPERTY_AIR_TIME = "AirTime"; + @org.eclipse.jdt.annotation.NonNull + private String airTime; + + public static final String JSON_PROPERTY_AIR_DAYS = "AirDays"; + @org.eclipse.jdt.annotation.NonNull + private List airDays; + + public static final String JSON_PROPERTY_TAGS = "Tags"; + @org.eclipse.jdt.annotation.NonNull + private List tags; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO = "PrimaryImageAspectRatio"; + @org.eclipse.jdt.annotation.NonNull + private Double primaryImageAspectRatio; + + public static final String JSON_PROPERTY_ARTISTS = "Artists"; + @org.eclipse.jdt.annotation.NonNull + private List artists; + + public static final String JSON_PROPERTY_ARTIST_ITEMS = "ArtistItems"; + @org.eclipse.jdt.annotation.NonNull + private List artistItems; + + public static final String JSON_PROPERTY_ALBUM = "Album"; + @org.eclipse.jdt.annotation.NonNull + private String album; + + public static final String JSON_PROPERTY_COLLECTION_TYPE = "CollectionType"; + @org.eclipse.jdt.annotation.NonNull + private CollectionType collectionType; + + public static final String JSON_PROPERTY_DISPLAY_ORDER = "DisplayOrder"; + @org.eclipse.jdt.annotation.NonNull + private String displayOrder; + + public static final String JSON_PROPERTY_ALBUM_ID = "AlbumId"; + @org.eclipse.jdt.annotation.NonNull + private UUID albumId; + + public static final String JSON_PROPERTY_ALBUM_PRIMARY_IMAGE_TAG = "AlbumPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String albumPrimaryImageTag; + + public static final String JSON_PROPERTY_SERIES_PRIMARY_IMAGE_TAG = "SeriesPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String seriesPrimaryImageTag; + + public static final String JSON_PROPERTY_ALBUM_ARTIST = "AlbumArtist"; + @org.eclipse.jdt.annotation.NonNull + private String albumArtist; + + public static final String JSON_PROPERTY_ALBUM_ARTISTS = "AlbumArtists"; + @org.eclipse.jdt.annotation.NonNull + private List albumArtists; + + public static final String JSON_PROPERTY_SEASON_NAME = "SeasonName"; + @org.eclipse.jdt.annotation.NonNull + private String seasonName; + + public static final String JSON_PROPERTY_MEDIA_STREAMS = "MediaStreams"; + @org.eclipse.jdt.annotation.NonNull + private List mediaStreams; + + public static final String JSON_PROPERTY_VIDEO_TYPE = "VideoType"; + @org.eclipse.jdt.annotation.NonNull + private VideoType videoType; + + public static final String JSON_PROPERTY_PART_COUNT = "PartCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer partCount; + + public static final String JSON_PROPERTY_MEDIA_SOURCE_COUNT = "MediaSourceCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer mediaSourceCount; + + public static final String JSON_PROPERTY_IMAGE_TAGS = "ImageTags"; + @org.eclipse.jdt.annotation.NonNull + private Map imageTags; + + public static final String JSON_PROPERTY_BACKDROP_IMAGE_TAGS = "BackdropImageTags"; + @org.eclipse.jdt.annotation.NonNull + private List backdropImageTags; + + public static final String JSON_PROPERTY_SCREENSHOT_IMAGE_TAGS = "ScreenshotImageTags"; + @org.eclipse.jdt.annotation.NonNull + private List screenshotImageTags; + + public static final String JSON_PROPERTY_PARENT_LOGO_IMAGE_TAG = "ParentLogoImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String parentLogoImageTag; + + public static final String JSON_PROPERTY_PARENT_ART_ITEM_ID = "ParentArtItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID parentArtItemId; + + public static final String JSON_PROPERTY_PARENT_ART_IMAGE_TAG = "ParentArtImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String parentArtImageTag; + + public static final String JSON_PROPERTY_SERIES_THUMB_IMAGE_TAG = "SeriesThumbImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String seriesThumbImageTag; + + public static final String JSON_PROPERTY_IMAGE_BLUR_HASHES = "ImageBlurHashes"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemDtoImageBlurHashes imageBlurHashes; + + public static final String JSON_PROPERTY_SERIES_STUDIO = "SeriesStudio"; + @org.eclipse.jdt.annotation.NonNull + private String seriesStudio; + + public static final String JSON_PROPERTY_PARENT_THUMB_ITEM_ID = "ParentThumbItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID parentThumbItemId; + + public static final String JSON_PROPERTY_PARENT_THUMB_IMAGE_TAG = "ParentThumbImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String parentThumbImageTag; + + public static final String JSON_PROPERTY_PARENT_PRIMARY_IMAGE_ITEM_ID = "ParentPrimaryImageItemId"; + @org.eclipse.jdt.annotation.NonNull + private String parentPrimaryImageItemId; + + public static final String JSON_PROPERTY_PARENT_PRIMARY_IMAGE_TAG = "ParentPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String parentPrimaryImageTag; + + public static final String JSON_PROPERTY_CHAPTERS = "Chapters"; + @org.eclipse.jdt.annotation.NonNull + private List chapters; + + public static final String JSON_PROPERTY_TRICKPLAY = "Trickplay"; + @org.eclipse.jdt.annotation.NonNull + private Map> trickplay; + + public static final String JSON_PROPERTY_LOCATION_TYPE = "LocationType"; + @org.eclipse.jdt.annotation.NonNull + private LocationType locationType; + + public static final String JSON_PROPERTY_ISO_TYPE = "IsoType"; + @org.eclipse.jdt.annotation.NonNull + private IsoType isoType; + + public static final String JSON_PROPERTY_MEDIA_TYPE = "MediaType"; + @org.eclipse.jdt.annotation.NonNull + private MediaType mediaType = MediaType.UNKNOWN; + + public static final String JSON_PROPERTY_END_DATE = "EndDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime endDate; + + public static final String JSON_PROPERTY_LOCKED_FIELDS = "LockedFields"; + @org.eclipse.jdt.annotation.NonNull + private List lockedFields; + + public static final String JSON_PROPERTY_TRAILER_COUNT = "TrailerCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer trailerCount; + + public static final String JSON_PROPERTY_MOVIE_COUNT = "MovieCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer movieCount; + + public static final String JSON_PROPERTY_SERIES_COUNT = "SeriesCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer seriesCount; + + public static final String JSON_PROPERTY_PROGRAM_COUNT = "ProgramCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer programCount; + + public static final String JSON_PROPERTY_EPISODE_COUNT = "EpisodeCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer episodeCount; + + public static final String JSON_PROPERTY_SONG_COUNT = "SongCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer songCount; + + public static final String JSON_PROPERTY_ALBUM_COUNT = "AlbumCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer albumCount; + + public static final String JSON_PROPERTY_ARTIST_COUNT = "ArtistCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer artistCount; + + public static final String JSON_PROPERTY_MUSIC_VIDEO_COUNT = "MusicVideoCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer musicVideoCount; + + public static final String JSON_PROPERTY_LOCK_DATA = "LockData"; + @org.eclipse.jdt.annotation.NonNull + private Boolean lockData; + + public static final String JSON_PROPERTY_WIDTH = "Width"; + @org.eclipse.jdt.annotation.NonNull + private Integer width; + + public static final String JSON_PROPERTY_HEIGHT = "Height"; + @org.eclipse.jdt.annotation.NonNull + private Integer height; + + public static final String JSON_PROPERTY_CAMERA_MAKE = "CameraMake"; + @org.eclipse.jdt.annotation.NonNull + private String cameraMake; + + public static final String JSON_PROPERTY_CAMERA_MODEL = "CameraModel"; + @org.eclipse.jdt.annotation.NonNull + private String cameraModel; + + public static final String JSON_PROPERTY_SOFTWARE = "Software"; + @org.eclipse.jdt.annotation.NonNull + private String software; + + public static final String JSON_PROPERTY_EXPOSURE_TIME = "ExposureTime"; + @org.eclipse.jdt.annotation.NonNull + private Double exposureTime; + + public static final String JSON_PROPERTY_FOCAL_LENGTH = "FocalLength"; + @org.eclipse.jdt.annotation.NonNull + private Double focalLength; + + public static final String JSON_PROPERTY_IMAGE_ORIENTATION = "ImageOrientation"; + @org.eclipse.jdt.annotation.NonNull + private ImageOrientation imageOrientation; + + public static final String JSON_PROPERTY_APERTURE = "Aperture"; + @org.eclipse.jdt.annotation.NonNull + private Double aperture; + + public static final String JSON_PROPERTY_SHUTTER_SPEED = "ShutterSpeed"; + @org.eclipse.jdt.annotation.NonNull + private Double shutterSpeed; + + public static final String JSON_PROPERTY_LATITUDE = "Latitude"; + @org.eclipse.jdt.annotation.NonNull + private Double latitude; + + public static final String JSON_PROPERTY_LONGITUDE = "Longitude"; + @org.eclipse.jdt.annotation.NonNull + private Double longitude; + + public static final String JSON_PROPERTY_ALTITUDE = "Altitude"; + @org.eclipse.jdt.annotation.NonNull + private Double altitude; + + public static final String JSON_PROPERTY_ISO_SPEED_RATING = "IsoSpeedRating"; + @org.eclipse.jdt.annotation.NonNull + private Integer isoSpeedRating; + + public static final String JSON_PROPERTY_SERIES_TIMER_ID = "SeriesTimerId"; + @org.eclipse.jdt.annotation.NonNull + private String seriesTimerId; + + public static final String JSON_PROPERTY_PROGRAM_ID = "ProgramId"; + @org.eclipse.jdt.annotation.NonNull + private String programId; + + public static final String JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG = "ChannelPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String channelPrimaryImageTag; + + public static final String JSON_PROPERTY_START_DATE = "StartDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime startDate; + + public static final String JSON_PROPERTY_COMPLETION_PERCENTAGE = "CompletionPercentage"; + @org.eclipse.jdt.annotation.NonNull + private Double completionPercentage; + + public static final String JSON_PROPERTY_IS_REPEAT = "IsRepeat"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isRepeat; + + public static final String JSON_PROPERTY_EPISODE_TITLE = "EpisodeTitle"; + @org.eclipse.jdt.annotation.NonNull + private String episodeTitle; + + public static final String JSON_PROPERTY_CHANNEL_TYPE = "ChannelType"; + @org.eclipse.jdt.annotation.NonNull + private ChannelType channelType; + + public static final String JSON_PROPERTY_AUDIO = "Audio"; + @org.eclipse.jdt.annotation.NonNull + private ProgramAudio audio; + + public static final String JSON_PROPERTY_IS_MOVIE = "IsMovie"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isMovie; + + public static final String JSON_PROPERTY_IS_SPORTS = "IsSports"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isSports; + + public static final String JSON_PROPERTY_IS_SERIES = "IsSeries"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isSeries; + + public static final String JSON_PROPERTY_IS_LIVE = "IsLive"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isLive; + + public static final String JSON_PROPERTY_IS_NEWS = "IsNews"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isNews; + + public static final String JSON_PROPERTY_IS_KIDS = "IsKids"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isKids; + + public static final String JSON_PROPERTY_IS_PREMIERE = "IsPremiere"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPremiere; + + public static final String JSON_PROPERTY_TIMER_ID = "TimerId"; + @org.eclipse.jdt.annotation.NonNull + private String timerId; + + public static final String JSON_PROPERTY_NORMALIZATION_GAIN = "NormalizationGain"; + @org.eclipse.jdt.annotation.NonNull + private Float normalizationGain; + + public static final String JSON_PROPERTY_CURRENT_PROGRAM = "CurrentProgram"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemDto currentProgram; + + public BaseItemDto() { + } + + public BaseItemDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public BaseItemDto originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Get originalTitle + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public BaseItemDto serverId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + return this; + } + + /** + * Gets or sets the server identifier. + * + * @return serverId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerId() { + return serverId; + } + + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + } + + public BaseItemDto id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public BaseItemDto etag(@org.eclipse.jdt.annotation.NonNull String etag) { + this.etag = etag; + return this; + } + + /** + * Gets or sets the etag. + * + * @return etag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ETAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEtag() { + return etag; + } + + @JsonProperty(JSON_PROPERTY_ETAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEtag(@org.eclipse.jdt.annotation.NonNull String etag) { + this.etag = etag; + } + + public BaseItemDto sourceType(@org.eclipse.jdt.annotation.NonNull String sourceType) { + this.sourceType = sourceType; + return this; + } + + /** + * Gets or sets the type of the source. + * + * @return sourceType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SOURCE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceType() { + return sourceType; + } + + @JsonProperty(JSON_PROPERTY_SOURCE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceType(@org.eclipse.jdt.annotation.NonNull String sourceType) { + this.sourceType = sourceType; + } + + public BaseItemDto playlistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets or sets the playlist item identifier. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + } + + public BaseItemDto dateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + return this; + } + + /** + * Gets or sets the date created. + * + * @return dateCreated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateCreated() { + return dateCreated; + } + + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + } + + public BaseItemDto dateLastMediaAdded(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateLastMediaAdded) { + this.dateLastMediaAdded = dateLastMediaAdded; + return this; + } + + /** + * Get dateLastMediaAdded + * + * @return dateLastMediaAdded + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_LAST_MEDIA_ADDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateLastMediaAdded() { + return dateLastMediaAdded; + } + + @JsonProperty(JSON_PROPERTY_DATE_LAST_MEDIA_ADDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateLastMediaAdded(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateLastMediaAdded) { + this.dateLastMediaAdded = dateLastMediaAdded; + } + + public BaseItemDto extraType(@org.eclipse.jdt.annotation.NonNull ExtraType extraType) { + this.extraType = extraType; + return this; + } + + /** + * Get extraType + * + * @return extraType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTRA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ExtraType getExtraType() { + return extraType; + } + + @JsonProperty(JSON_PROPERTY_EXTRA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExtraType(@org.eclipse.jdt.annotation.NonNull ExtraType extraType) { + this.extraType = extraType; + } + + public BaseItemDto airsBeforeSeasonNumber(@org.eclipse.jdt.annotation.NonNull Integer airsBeforeSeasonNumber) { + this.airsBeforeSeasonNumber = airsBeforeSeasonNumber; + return this; + } + + /** + * Get airsBeforeSeasonNumber + * + * @return airsBeforeSeasonNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AIRS_BEFORE_SEASON_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAirsBeforeSeasonNumber() { + return airsBeforeSeasonNumber; + } + + @JsonProperty(JSON_PROPERTY_AIRS_BEFORE_SEASON_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAirsBeforeSeasonNumber(@org.eclipse.jdt.annotation.NonNull Integer airsBeforeSeasonNumber) { + this.airsBeforeSeasonNumber = airsBeforeSeasonNumber; + } + + public BaseItemDto airsAfterSeasonNumber(@org.eclipse.jdt.annotation.NonNull Integer airsAfterSeasonNumber) { + this.airsAfterSeasonNumber = airsAfterSeasonNumber; + return this; + } + + /** + * Get airsAfterSeasonNumber + * + * @return airsAfterSeasonNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AIRS_AFTER_SEASON_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAirsAfterSeasonNumber() { + return airsAfterSeasonNumber; + } + + @JsonProperty(JSON_PROPERTY_AIRS_AFTER_SEASON_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAirsAfterSeasonNumber(@org.eclipse.jdt.annotation.NonNull Integer airsAfterSeasonNumber) { + this.airsAfterSeasonNumber = airsAfterSeasonNumber; + } + + public BaseItemDto airsBeforeEpisodeNumber(@org.eclipse.jdt.annotation.NonNull Integer airsBeforeEpisodeNumber) { + this.airsBeforeEpisodeNumber = airsBeforeEpisodeNumber; + return this; + } + + /** + * Get airsBeforeEpisodeNumber + * + * @return airsBeforeEpisodeNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AIRS_BEFORE_EPISODE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAirsBeforeEpisodeNumber() { + return airsBeforeEpisodeNumber; + } + + @JsonProperty(JSON_PROPERTY_AIRS_BEFORE_EPISODE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAirsBeforeEpisodeNumber(@org.eclipse.jdt.annotation.NonNull Integer airsBeforeEpisodeNumber) { + this.airsBeforeEpisodeNumber = airsBeforeEpisodeNumber; + } + + public BaseItemDto canDelete(@org.eclipse.jdt.annotation.NonNull Boolean canDelete) { + this.canDelete = canDelete; + return this; + } + + /** + * Get canDelete + * + * @return canDelete + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_DELETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanDelete() { + return canDelete; + } + + @JsonProperty(JSON_PROPERTY_CAN_DELETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanDelete(@org.eclipse.jdt.annotation.NonNull Boolean canDelete) { + this.canDelete = canDelete; + } + + public BaseItemDto canDownload(@org.eclipse.jdt.annotation.NonNull Boolean canDownload) { + this.canDownload = canDownload; + return this; + } + + /** + * Get canDownload + * + * @return canDownload + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_DOWNLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanDownload() { + return canDownload; + } + + @JsonProperty(JSON_PROPERTY_CAN_DOWNLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanDownload(@org.eclipse.jdt.annotation.NonNull Boolean canDownload) { + this.canDownload = canDownload; + } + + public BaseItemDto hasLyrics(@org.eclipse.jdt.annotation.NonNull Boolean hasLyrics) { + this.hasLyrics = hasLyrics; + return this; + } + + /** + * Get hasLyrics + * + * @return hasLyrics + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_LYRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasLyrics() { + return hasLyrics; + } + + @JsonProperty(JSON_PROPERTY_HAS_LYRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasLyrics(@org.eclipse.jdt.annotation.NonNull Boolean hasLyrics) { + this.hasLyrics = hasLyrics; + } + + public BaseItemDto hasSubtitles(@org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles) { + this.hasSubtitles = hasSubtitles; + return this; + } + + /** + * Get hasSubtitles + * + * @return hasSubtitles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_SUBTITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasSubtitles() { + return hasSubtitles; + } + + @JsonProperty(JSON_PROPERTY_HAS_SUBTITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasSubtitles(@org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles) { + this.hasSubtitles = hasSubtitles; + } + + public BaseItemDto preferredMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String preferredMetadataLanguage) { + this.preferredMetadataLanguage = preferredMetadataLanguage; + return this; + } + + /** + * Get preferredMetadataLanguage + * + * @return preferredMetadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPreferredMetadataLanguage() { + return preferredMetadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreferredMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String preferredMetadataLanguage) { + this.preferredMetadataLanguage = preferredMetadataLanguage; + } + + public BaseItemDto preferredMetadataCountryCode( + @org.eclipse.jdt.annotation.NonNull String preferredMetadataCountryCode) { + this.preferredMetadataCountryCode = preferredMetadataCountryCode; + return this; + } + + /** + * Get preferredMetadataCountryCode + * + * @return preferredMetadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPreferredMetadataCountryCode() { + return preferredMetadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreferredMetadataCountryCode( + @org.eclipse.jdt.annotation.NonNull String preferredMetadataCountryCode) { + this.preferredMetadataCountryCode = preferredMetadataCountryCode; + } + + public BaseItemDto container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Get container + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + public BaseItemDto sortName(@org.eclipse.jdt.annotation.NonNull String sortName) { + this.sortName = sortName; + return this; + } + + /** + * Gets or sets the name of the sort. + * + * @return sortName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SORT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSortName() { + return sortName; + } + + @JsonProperty(JSON_PROPERTY_SORT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortName(@org.eclipse.jdt.annotation.NonNull String sortName) { + this.sortName = sortName; + } + + public BaseItemDto forcedSortName(@org.eclipse.jdt.annotation.NonNull String forcedSortName) { + this.forcedSortName = forcedSortName; + return this; + } + + /** + * Get forcedSortName + * + * @return forcedSortName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FORCED_SORT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getForcedSortName() { + return forcedSortName; + } + + @JsonProperty(JSON_PROPERTY_FORCED_SORT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForcedSortName(@org.eclipse.jdt.annotation.NonNull String forcedSortName) { + this.forcedSortName = forcedSortName; + } + + public BaseItemDto video3DFormat(@org.eclipse.jdt.annotation.NonNull Video3DFormat video3DFormat) { + this.video3DFormat = video3DFormat; + return this; + } + + /** + * Gets or sets the video3 D format. + * + * @return video3DFormat + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO3_D_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Video3DFormat getVideo3DFormat() { + return video3DFormat; + } + + @JsonProperty(JSON_PROPERTY_VIDEO3_D_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVideo3DFormat(@org.eclipse.jdt.annotation.NonNull Video3DFormat video3DFormat) { + this.video3DFormat = video3DFormat; + } + + public BaseItemDto premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Gets or sets the premiere date. + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public BaseItemDto externalUrls(@org.eclipse.jdt.annotation.NonNull List externalUrls) { + this.externalUrls = externalUrls; + return this; + } + + public BaseItemDto addExternalUrlsItem(ExternalUrl externalUrlsItem) { + if (this.externalUrls == null) { + this.externalUrls = new ArrayList<>(); + } + this.externalUrls.add(externalUrlsItem); + return this; + } + + /** + * Gets or sets the external urls. + * + * @return externalUrls + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getExternalUrls() { + return externalUrls; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalUrls(@org.eclipse.jdt.annotation.NonNull List externalUrls) { + this.externalUrls = externalUrls; + } + + public BaseItemDto mediaSources(@org.eclipse.jdt.annotation.NonNull List mediaSources) { + this.mediaSources = mediaSources; + return this; + } + + public BaseItemDto addMediaSourcesItem(MediaSourceInfo mediaSourcesItem) { + if (this.mediaSources == null) { + this.mediaSources = new ArrayList<>(); + } + this.mediaSources.add(mediaSourcesItem); + return this; + } + + /** + * Gets or sets the media versions. + * + * @return mediaSources + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMediaSources() { + return mediaSources; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSources(@org.eclipse.jdt.annotation.NonNull List mediaSources) { + this.mediaSources = mediaSources; + } + + public BaseItemDto criticRating(@org.eclipse.jdt.annotation.NonNull Float criticRating) { + this.criticRating = criticRating; + return this; + } + + /** + * Gets or sets the critic rating. + * + * @return criticRating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CRITIC_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getCriticRating() { + return criticRating; + } + + @JsonProperty(JSON_PROPERTY_CRITIC_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCriticRating(@org.eclipse.jdt.annotation.NonNull Float criticRating) { + this.criticRating = criticRating; + } + + public BaseItemDto productionLocations(@org.eclipse.jdt.annotation.NonNull List productionLocations) { + this.productionLocations = productionLocations; + return this; + } + + public BaseItemDto addProductionLocationsItem(String productionLocationsItem) { + if (this.productionLocations == null) { + this.productionLocations = new ArrayList<>(); + } + this.productionLocations.add(productionLocationsItem); + return this; + } + + /** + * Get productionLocations + * + * @return productionLocations + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRODUCTION_LOCATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getProductionLocations() { + return productionLocations; + } + + @JsonProperty(JSON_PROPERTY_PRODUCTION_LOCATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProductionLocations(@org.eclipse.jdt.annotation.NonNull List productionLocations) { + this.productionLocations = productionLocations; + } + + public BaseItemDto path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public BaseItemDto enableMediaSourceDisplay(@org.eclipse.jdt.annotation.NonNull Boolean enableMediaSourceDisplay) { + this.enableMediaSourceDisplay = enableMediaSourceDisplay; + return this; + } + + /** + * Get enableMediaSourceDisplay + * + * @return enableMediaSourceDisplay + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_MEDIA_SOURCE_DISPLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableMediaSourceDisplay() { + return enableMediaSourceDisplay; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_MEDIA_SOURCE_DISPLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableMediaSourceDisplay(@org.eclipse.jdt.annotation.NonNull Boolean enableMediaSourceDisplay) { + this.enableMediaSourceDisplay = enableMediaSourceDisplay; + } + + public BaseItemDto officialRating(@org.eclipse.jdt.annotation.NonNull String officialRating) { + this.officialRating = officialRating; + return this; + } + + /** + * Gets or sets the official rating. + * + * @return officialRating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OFFICIAL_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOfficialRating() { + return officialRating; + } + + @JsonProperty(JSON_PROPERTY_OFFICIAL_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOfficialRating(@org.eclipse.jdt.annotation.NonNull String officialRating) { + this.officialRating = officialRating; + } + + public BaseItemDto customRating(@org.eclipse.jdt.annotation.NonNull String customRating) { + this.customRating = customRating; + return this; + } + + /** + * Gets or sets the custom rating. + * + * @return customRating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CUSTOM_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCustomRating() { + return customRating; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomRating(@org.eclipse.jdt.annotation.NonNull String customRating) { + this.customRating = customRating; + } + + public BaseItemDto channelId(@org.eclipse.jdt.annotation.NonNull UUID channelId) { + this.channelId = channelId; + return this; + } + + /** + * Gets or sets the channel identifier. + * + * @return channelId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getChannelId() { + return channelId; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelId(@org.eclipse.jdt.annotation.NonNull UUID channelId) { + this.channelId = channelId; + } + + public BaseItemDto channelName(@org.eclipse.jdt.annotation.NonNull String channelName) { + this.channelName = channelName; + return this; + } + + /** + * Get channelName + * + * @return channelName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelName() { + return channelName; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelName(@org.eclipse.jdt.annotation.NonNull String channelName) { + this.channelName = channelName; + } + + public BaseItemDto overview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + return this; + } + + /** + * Gets or sets the overview. + * + * @return overview + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOverview() { + return overview; + } + + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOverview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + } + + public BaseItemDto taglines(@org.eclipse.jdt.annotation.NonNull List taglines) { + this.taglines = taglines; + return this; + } + + public BaseItemDto addTaglinesItem(String taglinesItem) { + if (this.taglines == null) { + this.taglines = new ArrayList<>(); + } + this.taglines.add(taglinesItem); + return this; + } + + /** + * Gets or sets the taglines. + * + * @return taglines + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TAGLINES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTaglines() { + return taglines; + } + + @JsonProperty(JSON_PROPERTY_TAGLINES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTaglines(@org.eclipse.jdt.annotation.NonNull List taglines) { + this.taglines = taglines; + } + + public BaseItemDto genres(@org.eclipse.jdt.annotation.NonNull List genres) { + this.genres = genres; + return this; + } + + public BaseItemDto addGenresItem(String genresItem) { + if (this.genres == null) { + this.genres = new ArrayList<>(); + } + this.genres.add(genresItem); + return this; + } + + /** + * Gets or sets the genres. + * + * @return genres + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GENRES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGenres() { + return genres; + } + + @JsonProperty(JSON_PROPERTY_GENRES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGenres(@org.eclipse.jdt.annotation.NonNull List genres) { + this.genres = genres; + } + + public BaseItemDto communityRating(@org.eclipse.jdt.annotation.NonNull Float communityRating) { + this.communityRating = communityRating; + return this; + } + + /** + * Gets or sets the community rating. + * + * @return communityRating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMMUNITY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getCommunityRating() { + return communityRating; + } + + @JsonProperty(JSON_PROPERTY_COMMUNITY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCommunityRating(@org.eclipse.jdt.annotation.NonNull Float communityRating) { + this.communityRating = communityRating; + } + + public BaseItemDto cumulativeRunTimeTicks(@org.eclipse.jdt.annotation.NonNull Long cumulativeRunTimeTicks) { + this.cumulativeRunTimeTicks = cumulativeRunTimeTicks; + return this; + } + + /** + * Gets or sets the cumulative run time ticks. + * + * @return cumulativeRunTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CUMULATIVE_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCumulativeRunTimeTicks() { + return cumulativeRunTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_CUMULATIVE_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCumulativeRunTimeTicks(@org.eclipse.jdt.annotation.NonNull Long cumulativeRunTimeTicks) { + this.cumulativeRunTimeTicks = cumulativeRunTimeTicks; + } + + public BaseItemDto runTimeTicks(@org.eclipse.jdt.annotation.NonNull Long runTimeTicks) { + this.runTimeTicks = runTimeTicks; + return this; + } + + /** + * Gets or sets the run time ticks. + * + * @return runTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getRunTimeTicks() { + return runTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRunTimeTicks(@org.eclipse.jdt.annotation.NonNull Long runTimeTicks) { + this.runTimeTicks = runTimeTicks; + } + + public BaseItemDto playAccess(@org.eclipse.jdt.annotation.NonNull PlayAccess playAccess) { + this.playAccess = playAccess; + return this; + } + + /** + * Gets or sets the play access. + * + * @return playAccess + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlayAccess getPlayAccess() { + return playAccess; + } + + @JsonProperty(JSON_PROPERTY_PLAY_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayAccess(@org.eclipse.jdt.annotation.NonNull PlayAccess playAccess) { + this.playAccess = playAccess; + } + + public BaseItemDto aspectRatio(@org.eclipse.jdt.annotation.NonNull String aspectRatio) { + this.aspectRatio = aspectRatio; + return this; + } + + /** + * Gets or sets the aspect ratio. + * + * @return aspectRatio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAspectRatio() { + return aspectRatio; + } + + @JsonProperty(JSON_PROPERTY_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAspectRatio(@org.eclipse.jdt.annotation.NonNull String aspectRatio) { + this.aspectRatio = aspectRatio; + } + + public BaseItemDto productionYear(@org.eclipse.jdt.annotation.NonNull Integer productionYear) { + this.productionYear = productionYear; + return this; + } + + /** + * Gets or sets the production year. + * + * @return productionYear + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRODUCTION_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getProductionYear() { + return productionYear; + } + + @JsonProperty(JSON_PROPERTY_PRODUCTION_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProductionYear(@org.eclipse.jdt.annotation.NonNull Integer productionYear) { + this.productionYear = productionYear; + } + + public BaseItemDto isPlaceHolder(@org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder) { + this.isPlaceHolder = isPlaceHolder; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is place holder. + * + * @return isPlaceHolder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PLACE_HOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPlaceHolder() { + return isPlaceHolder; + } + + @JsonProperty(JSON_PROPERTY_IS_PLACE_HOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPlaceHolder(@org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder) { + this.isPlaceHolder = isPlaceHolder; + } + + public BaseItemDto number(@org.eclipse.jdt.annotation.NonNull String number) { + this.number = number; + return this; + } + + /** + * Gets or sets the number. + * + * @return number + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNumber() { + return number; + } + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumber(@org.eclipse.jdt.annotation.NonNull String number) { + this.number = number; + } + + public BaseItemDto channelNumber(@org.eclipse.jdt.annotation.NonNull String channelNumber) { + this.channelNumber = channelNumber; + return this; + } + + /** + * Get channelNumber + * + * @return channelNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelNumber() { + return channelNumber; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelNumber(@org.eclipse.jdt.annotation.NonNull String channelNumber) { + this.channelNumber = channelNumber; + } + + public BaseItemDto indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Gets or sets the index number. + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public BaseItemDto indexNumberEnd(@org.eclipse.jdt.annotation.NonNull Integer indexNumberEnd) { + this.indexNumberEnd = indexNumberEnd; + return this; + } + + /** + * Gets or sets the index number end. + * + * @return indexNumberEnd + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER_END) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumberEnd() { + return indexNumberEnd; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER_END) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumberEnd(@org.eclipse.jdt.annotation.NonNull Integer indexNumberEnd) { + this.indexNumberEnd = indexNumberEnd; + } + + public BaseItemDto parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Gets or sets the parent index number. + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public BaseItemDto remoteTrailers(@org.eclipse.jdt.annotation.NonNull List remoteTrailers) { + this.remoteTrailers = remoteTrailers; + return this; + } + + public BaseItemDto addRemoteTrailersItem(MediaUrl remoteTrailersItem) { + if (this.remoteTrailers == null) { + this.remoteTrailers = new ArrayList<>(); + } + this.remoteTrailers.add(remoteTrailersItem); + return this; + } + + /** + * Gets or sets the trailer urls. + * + * @return remoteTrailers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMOTE_TRAILERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRemoteTrailers() { + return remoteTrailers; + } + + @JsonProperty(JSON_PROPERTY_REMOTE_TRAILERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemoteTrailers(@org.eclipse.jdt.annotation.NonNull List remoteTrailers) { + this.remoteTrailers = remoteTrailers; + } + + public BaseItemDto providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public BaseItemDto putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public BaseItemDto isHD(@org.eclipse.jdt.annotation.NonNull Boolean isHD) { + this.isHD = isHD; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is HD. + * + * @return isHD + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_H_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsHD() { + return isHD; + } + + @JsonProperty(JSON_PROPERTY_IS_H_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsHD(@org.eclipse.jdt.annotation.NonNull Boolean isHD) { + this.isHD = isHD; + } + + public BaseItemDto isFolder(@org.eclipse.jdt.annotation.NonNull Boolean isFolder) { + this.isFolder = isFolder; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is folder. + * + * @return isFolder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_FOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsFolder() { + return isFolder; + } + + @JsonProperty(JSON_PROPERTY_IS_FOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsFolder(@org.eclipse.jdt.annotation.NonNull Boolean isFolder) { + this.isFolder = isFolder; + } + + public BaseItemDto parentId(@org.eclipse.jdt.annotation.NonNull UUID parentId) { + this.parentId = parentId; + return this; + } + + /** + * Gets or sets the parent id. + * + * @return parentId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getParentId() { + return parentId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentId(@org.eclipse.jdt.annotation.NonNull UUID parentId) { + this.parentId = parentId; + } + + public BaseItemDto type(@org.eclipse.jdt.annotation.NonNull BaseItemKind type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemKind getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull BaseItemKind type) { + this.type = type; + } + + public BaseItemDto people(@org.eclipse.jdt.annotation.NonNull List people) { + this.people = people; + return this; + } + + public BaseItemDto addPeopleItem(BaseItemPerson peopleItem) { + if (this.people == null) { + this.people = new ArrayList<>(); + } + this.people.add(peopleItem); + return this; + } + + /** + * Gets or sets the people. + * + * @return people + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PEOPLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPeople() { + return people; + } + + @JsonProperty(JSON_PROPERTY_PEOPLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPeople(@org.eclipse.jdt.annotation.NonNull List people) { + this.people = people; + } + + public BaseItemDto studios(@org.eclipse.jdt.annotation.NonNull List studios) { + this.studios = studios; + return this; + } + + public BaseItemDto addStudiosItem(NameGuidPair studiosItem) { + if (this.studios == null) { + this.studios = new ArrayList<>(); + } + this.studios.add(studiosItem); + return this; + } + + /** + * Gets or sets the studios. + * + * @return studios + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STUDIOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStudios() { + return studios; + } + + @JsonProperty(JSON_PROPERTY_STUDIOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStudios(@org.eclipse.jdt.annotation.NonNull List studios) { + this.studios = studios; + } + + public BaseItemDto genreItems(@org.eclipse.jdt.annotation.NonNull List genreItems) { + this.genreItems = genreItems; + return this; + } + + public BaseItemDto addGenreItemsItem(NameGuidPair genreItemsItem) { + if (this.genreItems == null) { + this.genreItems = new ArrayList<>(); + } + this.genreItems.add(genreItemsItem); + return this; + } + + /** + * Get genreItems + * + * @return genreItems + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GENRE_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGenreItems() { + return genreItems; + } + + @JsonProperty(JSON_PROPERTY_GENRE_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGenreItems(@org.eclipse.jdt.annotation.NonNull List genreItems) { + this.genreItems = genreItems; + } + + public BaseItemDto parentLogoItemId(@org.eclipse.jdt.annotation.NonNull UUID parentLogoItemId) { + this.parentLogoItemId = parentLogoItemId; + return this; + } + + /** + * Gets or sets whether the item has a logo, this will hold the Id of the Parent that has one. + * + * @return parentLogoItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_LOGO_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getParentLogoItemId() { + return parentLogoItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_LOGO_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentLogoItemId(@org.eclipse.jdt.annotation.NonNull UUID parentLogoItemId) { + this.parentLogoItemId = parentLogoItemId; + } + + public BaseItemDto parentBackdropItemId(@org.eclipse.jdt.annotation.NonNull UUID parentBackdropItemId) { + this.parentBackdropItemId = parentBackdropItemId; + return this; + } + + /** + * Gets or sets whether the item has any backdrops, this will hold the Id of the Parent that has one. + * + * @return parentBackdropItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getParentBackdropItemId() { + return parentBackdropItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentBackdropItemId(@org.eclipse.jdt.annotation.NonNull UUID parentBackdropItemId) { + this.parentBackdropItemId = parentBackdropItemId; + } + + public BaseItemDto parentBackdropImageTags( + @org.eclipse.jdt.annotation.NonNull List parentBackdropImageTags) { + this.parentBackdropImageTags = parentBackdropImageTags; + return this; + } + + public BaseItemDto addParentBackdropImageTagsItem(String parentBackdropImageTagsItem) { + if (this.parentBackdropImageTags == null) { + this.parentBackdropImageTags = new ArrayList<>(); + } + this.parentBackdropImageTags.add(parentBackdropImageTagsItem); + return this; + } + + /** + * Gets or sets the parent backdrop image tags. + * + * @return parentBackdropImageTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getParentBackdropImageTags() { + return parentBackdropImageTags; + } + + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentBackdropImageTags(@org.eclipse.jdt.annotation.NonNull List parentBackdropImageTags) { + this.parentBackdropImageTags = parentBackdropImageTags; + } + + public BaseItemDto localTrailerCount(@org.eclipse.jdt.annotation.NonNull Integer localTrailerCount) { + this.localTrailerCount = localTrailerCount; + return this; + } + + /** + * Gets or sets the local trailer count. + * + * @return localTrailerCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCAL_TRAILER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLocalTrailerCount() { + return localTrailerCount; + } + + @JsonProperty(JSON_PROPERTY_LOCAL_TRAILER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalTrailerCount(@org.eclipse.jdt.annotation.NonNull Integer localTrailerCount) { + this.localTrailerCount = localTrailerCount; + } + + public BaseItemDto userData(@org.eclipse.jdt.annotation.NonNull UserItemDataDto userData) { + this.userData = userData; + return this; + } + + /** + * Gets or sets the user data for this item based on the user it's being requested for. + * + * @return userData + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserItemDataDto getUserData() { + return userData; + } + + @JsonProperty(JSON_PROPERTY_USER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserData(@org.eclipse.jdt.annotation.NonNull UserItemDataDto userData) { + this.userData = userData; + } + + public BaseItemDto recursiveItemCount(@org.eclipse.jdt.annotation.NonNull Integer recursiveItemCount) { + this.recursiveItemCount = recursiveItemCount; + return this; + } + + /** + * Gets or sets the recursive item count. + * + * @return recursiveItemCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RECURSIVE_ITEM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRecursiveItemCount() { + return recursiveItemCount; + } + + @JsonProperty(JSON_PROPERTY_RECURSIVE_ITEM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecursiveItemCount(@org.eclipse.jdt.annotation.NonNull Integer recursiveItemCount) { + this.recursiveItemCount = recursiveItemCount; + } + + public BaseItemDto childCount(@org.eclipse.jdt.annotation.NonNull Integer childCount) { + this.childCount = childCount; + return this; + } + + /** + * Gets or sets the child count. + * + * @return childCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHILD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getChildCount() { + return childCount; + } + + @JsonProperty(JSON_PROPERTY_CHILD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChildCount(@org.eclipse.jdt.annotation.NonNull Integer childCount) { + this.childCount = childCount; + } + + public BaseItemDto seriesName(@org.eclipse.jdt.annotation.NonNull String seriesName) { + this.seriesName = seriesName; + return this; + } + + /** + * Gets or sets the name of the series. + * + * @return seriesName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesName() { + return seriesName; + } + + @JsonProperty(JSON_PROPERTY_SERIES_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesName(@org.eclipse.jdt.annotation.NonNull String seriesName) { + this.seriesName = seriesName; + } + + public BaseItemDto seriesId(@org.eclipse.jdt.annotation.NonNull UUID seriesId) { + this.seriesId = seriesId; + return this; + } + + /** + * Gets or sets the series id. + * + * @return seriesId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getSeriesId() { + return seriesId; + } + + @JsonProperty(JSON_PROPERTY_SERIES_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesId(@org.eclipse.jdt.annotation.NonNull UUID seriesId) { + this.seriesId = seriesId; + } + + public BaseItemDto seasonId(@org.eclipse.jdt.annotation.NonNull UUID seasonId) { + this.seasonId = seasonId; + return this; + } + + /** + * Gets or sets the season identifier. + * + * @return seasonId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEASON_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getSeasonId() { + return seasonId; + } + + @JsonProperty(JSON_PROPERTY_SEASON_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeasonId(@org.eclipse.jdt.annotation.NonNull UUID seasonId) { + this.seasonId = seasonId; + } + + public BaseItemDto specialFeatureCount(@org.eclipse.jdt.annotation.NonNull Integer specialFeatureCount) { + this.specialFeatureCount = specialFeatureCount; + return this; + } + + /** + * Gets or sets the special feature count. + * + * @return specialFeatureCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SPECIAL_FEATURE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSpecialFeatureCount() { + return specialFeatureCount; + } + + @JsonProperty(JSON_PROPERTY_SPECIAL_FEATURE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSpecialFeatureCount(@org.eclipse.jdt.annotation.NonNull Integer specialFeatureCount) { + this.specialFeatureCount = specialFeatureCount; + } + + public BaseItemDto displayPreferencesId(@org.eclipse.jdt.annotation.NonNull String displayPreferencesId) { + this.displayPreferencesId = displayPreferencesId; + return this; + } + + /** + * Gets or sets the display preferences id. + * + * @return displayPreferencesId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_PREFERENCES_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayPreferencesId() { + return displayPreferencesId; + } + + @JsonProperty(JSON_PROPERTY_DISPLAY_PREFERENCES_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayPreferencesId(@org.eclipse.jdt.annotation.NonNull String displayPreferencesId) { + this.displayPreferencesId = displayPreferencesId; + } + + public BaseItemDto status(@org.eclipse.jdt.annotation.NonNull String status) { + this.status = status; + return this; + } + + /** + * Gets or sets the status. + * + * @return status + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@org.eclipse.jdt.annotation.NonNull String status) { + this.status = status; + } + + public BaseItemDto airTime(@org.eclipse.jdt.annotation.NonNull String airTime) { + this.airTime = airTime; + return this; + } + + /** + * Gets or sets the air time. + * + * @return airTime + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AIR_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAirTime() { + return airTime; + } + + @JsonProperty(JSON_PROPERTY_AIR_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAirTime(@org.eclipse.jdt.annotation.NonNull String airTime) { + this.airTime = airTime; + } + + public BaseItemDto airDays(@org.eclipse.jdt.annotation.NonNull List airDays) { + this.airDays = airDays; + return this; + } + + public BaseItemDto addAirDaysItem(DayOfWeek airDaysItem) { + if (this.airDays == null) { + this.airDays = new ArrayList<>(); + } + this.airDays.add(airDaysItem); + return this; + } + + /** + * Gets or sets the air days. + * + * @return airDays + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AIR_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAirDays() { + return airDays; + } + + @JsonProperty(JSON_PROPERTY_AIR_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAirDays(@org.eclipse.jdt.annotation.NonNull List airDays) { + this.airDays = airDays; + } + + public BaseItemDto tags(@org.eclipse.jdt.annotation.NonNull List tags) { + this.tags = tags; + return this; + } + + public BaseItemDto addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Gets or sets the tags. + * + * @return tags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(@org.eclipse.jdt.annotation.NonNull List tags) { + this.tags = tags; + } + + public BaseItemDto primaryImageAspectRatio(@org.eclipse.jdt.annotation.NonNull Double primaryImageAspectRatio) { + this.primaryImageAspectRatio = primaryImageAspectRatio; + return this; + } + + /** + * Gets or sets the primary image aspect ratio, after image enhancements. + * + * @return primaryImageAspectRatio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getPrimaryImageAspectRatio() { + return primaryImageAspectRatio; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageAspectRatio(@org.eclipse.jdt.annotation.NonNull Double primaryImageAspectRatio) { + this.primaryImageAspectRatio = primaryImageAspectRatio; + } + + public BaseItemDto artists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + return this; + } + + public BaseItemDto addArtistsItem(String artistsItem) { + if (this.artists == null) { + this.artists = new ArrayList<>(); + } + this.artists.add(artistsItem); + return this; + } + + /** + * Gets or sets the artists. + * + * @return artists + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArtists() { + return artists; + } + + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + } + + public BaseItemDto artistItems(@org.eclipse.jdt.annotation.NonNull List artistItems) { + this.artistItems = artistItems; + return this; + } + + public BaseItemDto addArtistItemsItem(NameGuidPair artistItemsItem) { + if (this.artistItems == null) { + this.artistItems = new ArrayList<>(); + } + this.artistItems.add(artistItemsItem); + return this; + } + + /** + * Gets or sets the artist items. + * + * @return artistItems + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTIST_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArtistItems() { + return artistItems; + } + + @JsonProperty(JSON_PROPERTY_ARTIST_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtistItems(@org.eclipse.jdt.annotation.NonNull List artistItems) { + this.artistItems = artistItems; + } + + public BaseItemDto album(@org.eclipse.jdt.annotation.NonNull String album) { + this.album = album; + return this; + } + + /** + * Gets or sets the album. + * + * @return album + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlbum() { + return album; + } + + @JsonProperty(JSON_PROPERTY_ALBUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbum(@org.eclipse.jdt.annotation.NonNull String album) { + this.album = album; + } + + public BaseItemDto collectionType(@org.eclipse.jdt.annotation.NonNull CollectionType collectionType) { + this.collectionType = collectionType; + return this; + } + + /** + * Gets or sets the type of the collection. + * + * @return collectionType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COLLECTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CollectionType getCollectionType() { + return collectionType; + } + + @JsonProperty(JSON_PROPERTY_COLLECTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCollectionType(@org.eclipse.jdt.annotation.NonNull CollectionType collectionType) { + this.collectionType = collectionType; + } + + public BaseItemDto displayOrder(@org.eclipse.jdt.annotation.NonNull String displayOrder) { + this.displayOrder = displayOrder; + return this; + } + + /** + * Gets or sets the display order. + * + * @return displayOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayOrder() { + return displayOrder; + } + + @JsonProperty(JSON_PROPERTY_DISPLAY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayOrder(@org.eclipse.jdt.annotation.NonNull String displayOrder) { + this.displayOrder = displayOrder; + } + + public BaseItemDto albumId(@org.eclipse.jdt.annotation.NonNull UUID albumId) { + this.albumId = albumId; + return this; + } + + /** + * Gets or sets the album id. + * + * @return albumId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getAlbumId() { + return albumId; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumId(@org.eclipse.jdt.annotation.NonNull UUID albumId) { + this.albumId = albumId; + } + + public BaseItemDto albumPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String albumPrimaryImageTag) { + this.albumPrimaryImageTag = albumPrimaryImageTag; + return this; + } + + /** + * Gets or sets the album image tag. + * + * @return albumPrimaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlbumPrimaryImageTag() { + return albumPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String albumPrimaryImageTag) { + this.albumPrimaryImageTag = albumPrimaryImageTag; + } + + public BaseItemDto seriesPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String seriesPrimaryImageTag) { + this.seriesPrimaryImageTag = seriesPrimaryImageTag; + return this; + } + + /** + * Gets or sets the series primary image tag. + * + * @return seriesPrimaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesPrimaryImageTag() { + return seriesPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_SERIES_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String seriesPrimaryImageTag) { + this.seriesPrimaryImageTag = seriesPrimaryImageTag; + } + + public BaseItemDto albumArtist(@org.eclipse.jdt.annotation.NonNull String albumArtist) { + this.albumArtist = albumArtist; + return this; + } + + /** + * Gets or sets the album artist. + * + * @return albumArtist + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ARTIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlbumArtist() { + return albumArtist; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ARTIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumArtist(@org.eclipse.jdt.annotation.NonNull String albumArtist) { + this.albumArtist = albumArtist; + } + + public BaseItemDto albumArtists(@org.eclipse.jdt.annotation.NonNull List albumArtists) { + this.albumArtists = albumArtists; + return this; + } + + public BaseItemDto addAlbumArtistsItem(NameGuidPair albumArtistsItem) { + if (this.albumArtists == null) { + this.albumArtists = new ArrayList<>(); + } + this.albumArtists.add(albumArtistsItem); + return this; + } + + /** + * Gets or sets the album artists. + * + * @return albumArtists + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAlbumArtists() { + return albumArtists; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumArtists(@org.eclipse.jdt.annotation.NonNull List albumArtists) { + this.albumArtists = albumArtists; + } + + public BaseItemDto seasonName(@org.eclipse.jdt.annotation.NonNull String seasonName) { + this.seasonName = seasonName; + return this; + } + + /** + * Gets or sets the name of the season. + * + * @return seasonName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEASON_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeasonName() { + return seasonName; + } + + @JsonProperty(JSON_PROPERTY_SEASON_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeasonName(@org.eclipse.jdt.annotation.NonNull String seasonName) { + this.seasonName = seasonName; + } + + public BaseItemDto mediaStreams(@org.eclipse.jdt.annotation.NonNull List mediaStreams) { + this.mediaStreams = mediaStreams; + return this; + } + + public BaseItemDto addMediaStreamsItem(MediaStream mediaStreamsItem) { + if (this.mediaStreams == null) { + this.mediaStreams = new ArrayList<>(); + } + this.mediaStreams.add(mediaStreamsItem); + return this; + } + + /** + * Gets or sets the media streams. + * + * @return mediaStreams + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_STREAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMediaStreams() { + return mediaStreams; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_STREAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaStreams(@org.eclipse.jdt.annotation.NonNull List mediaStreams) { + this.mediaStreams = mediaStreams; + } + + public BaseItemDto videoType(@org.eclipse.jdt.annotation.NonNull VideoType videoType) { + this.videoType = videoType; + return this; + } + + /** + * Gets or sets the type of the video. + * + * @return videoType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public VideoType getVideoType() { + return videoType; + } + + @JsonProperty(JSON_PROPERTY_VIDEO_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVideoType(@org.eclipse.jdt.annotation.NonNull VideoType videoType) { + this.videoType = videoType; + } + + public BaseItemDto partCount(@org.eclipse.jdt.annotation.NonNull Integer partCount) { + this.partCount = partCount; + return this; + } + + /** + * Gets or sets the part count. + * + * @return partCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PART_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPartCount() { + return partCount; + } + + @JsonProperty(JSON_PROPERTY_PART_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPartCount(@org.eclipse.jdt.annotation.NonNull Integer partCount) { + this.partCount = partCount; + } + + public BaseItemDto mediaSourceCount(@org.eclipse.jdt.annotation.NonNull Integer mediaSourceCount) { + this.mediaSourceCount = mediaSourceCount; + return this; + } + + /** + * Get mediaSourceCount + * + * @return mediaSourceCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMediaSourceCount() { + return mediaSourceCount; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSourceCount(@org.eclipse.jdt.annotation.NonNull Integer mediaSourceCount) { + this.mediaSourceCount = mediaSourceCount; + } + + public BaseItemDto imageTags(@org.eclipse.jdt.annotation.NonNull Map imageTags) { + this.imageTags = imageTags; + return this; + } + + public BaseItemDto putImageTagsItem(String key, String imageTagsItem) { + if (this.imageTags == null) { + this.imageTags = new HashMap<>(); + } + this.imageTags.put(key, imageTagsItem); + return this; + } + + /** + * Gets or sets the image tags. + * + * @return imageTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getImageTags() { + return imageTags; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageTags(@org.eclipse.jdt.annotation.NonNull Map imageTags) { + this.imageTags = imageTags; + } + + public BaseItemDto backdropImageTags(@org.eclipse.jdt.annotation.NonNull List backdropImageTags) { + this.backdropImageTags = backdropImageTags; + return this; + } + + public BaseItemDto addBackdropImageTagsItem(String backdropImageTagsItem) { + if (this.backdropImageTags == null) { + this.backdropImageTags = new ArrayList<>(); + } + this.backdropImageTags.add(backdropImageTagsItem); + return this; + } + + /** + * Gets or sets the backdrop image tags. + * + * @return backdropImageTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BACKDROP_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBackdropImageTags() { + return backdropImageTags; + } + + @JsonProperty(JSON_PROPERTY_BACKDROP_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBackdropImageTags(@org.eclipse.jdt.annotation.NonNull List backdropImageTags) { + this.backdropImageTags = backdropImageTags; + } + + public BaseItemDto screenshotImageTags(@org.eclipse.jdt.annotation.NonNull List screenshotImageTags) { + this.screenshotImageTags = screenshotImageTags; + return this; + } + + public BaseItemDto addScreenshotImageTagsItem(String screenshotImageTagsItem) { + if (this.screenshotImageTags == null) { + this.screenshotImageTags = new ArrayList<>(); + } + this.screenshotImageTags.add(screenshotImageTagsItem); + return this; + } + + /** + * Gets or sets the screenshot image tags. + * + * @return screenshotImageTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SCREENSHOT_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getScreenshotImageTags() { + return screenshotImageTags; + } + + @JsonProperty(JSON_PROPERTY_SCREENSHOT_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScreenshotImageTags(@org.eclipse.jdt.annotation.NonNull List screenshotImageTags) { + this.screenshotImageTags = screenshotImageTags; + } + + public BaseItemDto parentLogoImageTag(@org.eclipse.jdt.annotation.NonNull String parentLogoImageTag) { + this.parentLogoImageTag = parentLogoImageTag; + return this; + } + + /** + * Gets or sets the parent logo image tag. + * + * @return parentLogoImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_LOGO_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentLogoImageTag() { + return parentLogoImageTag; + } + + @JsonProperty(JSON_PROPERTY_PARENT_LOGO_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentLogoImageTag(@org.eclipse.jdt.annotation.NonNull String parentLogoImageTag) { + this.parentLogoImageTag = parentLogoImageTag; + } + + public BaseItemDto parentArtItemId(@org.eclipse.jdt.annotation.NonNull UUID parentArtItemId) { + this.parentArtItemId = parentArtItemId; + return this; + } + + /** + * Gets or sets whether the item has fan art, this will hold the Id of the Parent that has one. + * + * @return parentArtItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_ART_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getParentArtItemId() { + return parentArtItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_ART_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentArtItemId(@org.eclipse.jdt.annotation.NonNull UUID parentArtItemId) { + this.parentArtItemId = parentArtItemId; + } + + public BaseItemDto parentArtImageTag(@org.eclipse.jdt.annotation.NonNull String parentArtImageTag) { + this.parentArtImageTag = parentArtImageTag; + return this; + } + + /** + * Gets or sets the parent art image tag. + * + * @return parentArtImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_ART_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentArtImageTag() { + return parentArtImageTag; + } + + @JsonProperty(JSON_PROPERTY_PARENT_ART_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentArtImageTag(@org.eclipse.jdt.annotation.NonNull String parentArtImageTag) { + this.parentArtImageTag = parentArtImageTag; + } + + public BaseItemDto seriesThumbImageTag(@org.eclipse.jdt.annotation.NonNull String seriesThumbImageTag) { + this.seriesThumbImageTag = seriesThumbImageTag; + return this; + } + + /** + * Gets or sets the series thumb image tag. + * + * @return seriesThumbImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_THUMB_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesThumbImageTag() { + return seriesThumbImageTag; + } + + @JsonProperty(JSON_PROPERTY_SERIES_THUMB_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesThumbImageTag(@org.eclipse.jdt.annotation.NonNull String seriesThumbImageTag) { + this.seriesThumbImageTag = seriesThumbImageTag; + } + + public BaseItemDto imageBlurHashes(@org.eclipse.jdt.annotation.NonNull BaseItemDtoImageBlurHashes imageBlurHashes) { + this.imageBlurHashes = imageBlurHashes; + return this; + } + + /** + * Get imageBlurHashes + * + * @return imageBlurHashes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_BLUR_HASHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemDtoImageBlurHashes getImageBlurHashes() { + return imageBlurHashes; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_BLUR_HASHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageBlurHashes(@org.eclipse.jdt.annotation.NonNull BaseItemDtoImageBlurHashes imageBlurHashes) { + this.imageBlurHashes = imageBlurHashes; + } + + public BaseItemDto seriesStudio(@org.eclipse.jdt.annotation.NonNull String seriesStudio) { + this.seriesStudio = seriesStudio; + return this; + } + + /** + * Gets or sets the series studio. + * + * @return seriesStudio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_STUDIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesStudio() { + return seriesStudio; + } + + @JsonProperty(JSON_PROPERTY_SERIES_STUDIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesStudio(@org.eclipse.jdt.annotation.NonNull String seriesStudio) { + this.seriesStudio = seriesStudio; + } + + public BaseItemDto parentThumbItemId(@org.eclipse.jdt.annotation.NonNull UUID parentThumbItemId) { + this.parentThumbItemId = parentThumbItemId; + return this; + } + + /** + * Gets or sets the parent thumb item id. + * + * @return parentThumbItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_THUMB_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getParentThumbItemId() { + return parentThumbItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_THUMB_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentThumbItemId(@org.eclipse.jdt.annotation.NonNull UUID parentThumbItemId) { + this.parentThumbItemId = parentThumbItemId; + } + + public BaseItemDto parentThumbImageTag(@org.eclipse.jdt.annotation.NonNull String parentThumbImageTag) { + this.parentThumbImageTag = parentThumbImageTag; + return this; + } + + /** + * Gets or sets the parent thumb image tag. + * + * @return parentThumbImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_THUMB_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentThumbImageTag() { + return parentThumbImageTag; + } + + @JsonProperty(JSON_PROPERTY_PARENT_THUMB_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentThumbImageTag(@org.eclipse.jdt.annotation.NonNull String parentThumbImageTag) { + this.parentThumbImageTag = parentThumbImageTag; + } + + public BaseItemDto parentPrimaryImageItemId(@org.eclipse.jdt.annotation.NonNull String parentPrimaryImageItemId) { + this.parentPrimaryImageItemId = parentPrimaryImageItemId; + return this; + } + + /** + * Gets or sets the parent primary image item identifier. + * + * @return parentPrimaryImageItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_PRIMARY_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentPrimaryImageItemId() { + return parentPrimaryImageItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_PRIMARY_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentPrimaryImageItemId(@org.eclipse.jdt.annotation.NonNull String parentPrimaryImageItemId) { + this.parentPrimaryImageItemId = parentPrimaryImageItemId; + } + + public BaseItemDto parentPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String parentPrimaryImageTag) { + this.parentPrimaryImageTag = parentPrimaryImageTag; + return this; + } + + /** + * Gets or sets the parent primary image tag. + * + * @return parentPrimaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentPrimaryImageTag() { + return parentPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_PARENT_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String parentPrimaryImageTag) { + this.parentPrimaryImageTag = parentPrimaryImageTag; + } + + public BaseItemDto chapters(@org.eclipse.jdt.annotation.NonNull List chapters) { + this.chapters = chapters; + return this; + } + + public BaseItemDto addChaptersItem(ChapterInfo chaptersItem) { + if (this.chapters == null) { + this.chapters = new ArrayList<>(); + } + this.chapters.add(chaptersItem); + return this; + } + + /** + * Gets or sets the chapters. + * + * @return chapters + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHAPTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getChapters() { + return chapters; + } + + @JsonProperty(JSON_PROPERTY_CHAPTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChapters(@org.eclipse.jdt.annotation.NonNull List chapters) { + this.chapters = chapters; + } + + public BaseItemDto trickplay( + @org.eclipse.jdt.annotation.NonNull Map> trickplay) { + this.trickplay = trickplay; + return this; + } + + public BaseItemDto putTrickplayItem(String key, Map trickplayItem) { + if (this.trickplay == null) { + this.trickplay = new HashMap<>(); + } + this.trickplay.put(key, trickplayItem); + return this; + } + + /** + * Gets or sets the trickplay manifest. + * + * @return trickplay + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRICKPLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getTrickplay() { + return trickplay; + } + + @JsonProperty(JSON_PROPERTY_TRICKPLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrickplay(@org.eclipse.jdt.annotation.NonNull Map> trickplay) { + this.trickplay = trickplay; + } + + public BaseItemDto locationType(@org.eclipse.jdt.annotation.NonNull LocationType locationType) { + this.locationType = locationType; + return this; + } + + /** + * Gets or sets the type of the location. + * + * @return locationType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LocationType getLocationType() { + return locationType; + } + + @JsonProperty(JSON_PROPERTY_LOCATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocationType(@org.eclipse.jdt.annotation.NonNull LocationType locationType) { + this.locationType = locationType; + } + + public BaseItemDto isoType(@org.eclipse.jdt.annotation.NonNull IsoType isoType) { + this.isoType = isoType; + return this; + } + + /** + * Gets or sets the type of the iso. + * + * @return isoType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ISO_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IsoType getIsoType() { + return isoType; + } + + @JsonProperty(JSON_PROPERTY_ISO_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsoType(@org.eclipse.jdt.annotation.NonNull IsoType isoType) { + this.isoType = isoType; + } + + public BaseItemDto mediaType(@org.eclipse.jdt.annotation.NonNull MediaType mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Gets or sets the type of the media. + * + * @return mediaType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaType getMediaType() { + return mediaType; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaType(@org.eclipse.jdt.annotation.NonNull MediaType mediaType) { + this.mediaType = mediaType; + } + + public BaseItemDto endDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Gets or sets the end date. + * + * @return endDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndDate() { + return endDate; + } + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + } + + public BaseItemDto lockedFields(@org.eclipse.jdt.annotation.NonNull List lockedFields) { + this.lockedFields = lockedFields; + return this; + } + + public BaseItemDto addLockedFieldsItem(MetadataField lockedFieldsItem) { + if (this.lockedFields == null) { + this.lockedFields = new ArrayList<>(); + } + this.lockedFields.add(lockedFieldsItem); + return this; + } + + /** + * Gets or sets the locked fields. + * + * @return lockedFields + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCKED_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLockedFields() { + return lockedFields; + } + + @JsonProperty(JSON_PROPERTY_LOCKED_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLockedFields(@org.eclipse.jdt.annotation.NonNull List lockedFields) { + this.lockedFields = lockedFields; + } + + public BaseItemDto trailerCount(@org.eclipse.jdt.annotation.NonNull Integer trailerCount) { + this.trailerCount = trailerCount; + return this; + } + + /** + * Gets or sets the trailer count. + * + * @return trailerCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRAILER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTrailerCount() { + return trailerCount; + } + + @JsonProperty(JSON_PROPERTY_TRAILER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrailerCount(@org.eclipse.jdt.annotation.NonNull Integer trailerCount) { + this.trailerCount = trailerCount; + } + + public BaseItemDto movieCount(@org.eclipse.jdt.annotation.NonNull Integer movieCount) { + this.movieCount = movieCount; + return this; + } + + /** + * Gets or sets the movie count. + * + * @return movieCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MOVIE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMovieCount() { + return movieCount; + } + + @JsonProperty(JSON_PROPERTY_MOVIE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMovieCount(@org.eclipse.jdt.annotation.NonNull Integer movieCount) { + this.movieCount = movieCount; + } + + public BaseItemDto seriesCount(@org.eclipse.jdt.annotation.NonNull Integer seriesCount) { + this.seriesCount = seriesCount; + return this; + } + + /** + * Gets or sets the series count. + * + * @return seriesCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSeriesCount() { + return seriesCount; + } + + @JsonProperty(JSON_PROPERTY_SERIES_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesCount(@org.eclipse.jdt.annotation.NonNull Integer seriesCount) { + this.seriesCount = seriesCount; + } + + public BaseItemDto programCount(@org.eclipse.jdt.annotation.NonNull Integer programCount) { + this.programCount = programCount; + return this; + } + + /** + * Get programCount + * + * @return programCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROGRAM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getProgramCount() { + return programCount; + } + + @JsonProperty(JSON_PROPERTY_PROGRAM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgramCount(@org.eclipse.jdt.annotation.NonNull Integer programCount) { + this.programCount = programCount; + } + + public BaseItemDto episodeCount(@org.eclipse.jdt.annotation.NonNull Integer episodeCount) { + this.episodeCount = episodeCount; + return this; + } + + /** + * Gets or sets the episode count. + * + * @return episodeCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EPISODE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getEpisodeCount() { + return episodeCount; + } + + @JsonProperty(JSON_PROPERTY_EPISODE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEpisodeCount(@org.eclipse.jdt.annotation.NonNull Integer episodeCount) { + this.episodeCount = episodeCount; + } + + public BaseItemDto songCount(@org.eclipse.jdt.annotation.NonNull Integer songCount) { + this.songCount = songCount; + return this; + } + + /** + * Gets or sets the song count. + * + * @return songCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SONG_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSongCount() { + return songCount; + } + + @JsonProperty(JSON_PROPERTY_SONG_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSongCount(@org.eclipse.jdt.annotation.NonNull Integer songCount) { + this.songCount = songCount; + } + + public BaseItemDto albumCount(@org.eclipse.jdt.annotation.NonNull Integer albumCount) { + this.albumCount = albumCount; + return this; + } + + /** + * Gets or sets the album count. + * + * @return albumCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAlbumCount() { + return albumCount; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumCount(@org.eclipse.jdt.annotation.NonNull Integer albumCount) { + this.albumCount = albumCount; + } + + public BaseItemDto artistCount(@org.eclipse.jdt.annotation.NonNull Integer artistCount) { + this.artistCount = artistCount; + return this; + } + + /** + * Get artistCount + * + * @return artistCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTIST_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getArtistCount() { + return artistCount; + } + + @JsonProperty(JSON_PROPERTY_ARTIST_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtistCount(@org.eclipse.jdt.annotation.NonNull Integer artistCount) { + this.artistCount = artistCount; + } + + public BaseItemDto musicVideoCount(@org.eclipse.jdt.annotation.NonNull Integer musicVideoCount) { + this.musicVideoCount = musicVideoCount; + return this; + } + + /** + * Gets or sets the music video count. + * + * @return musicVideoCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MUSIC_VIDEO_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMusicVideoCount() { + return musicVideoCount; + } + + @JsonProperty(JSON_PROPERTY_MUSIC_VIDEO_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMusicVideoCount(@org.eclipse.jdt.annotation.NonNull Integer musicVideoCount) { + this.musicVideoCount = musicVideoCount; + } + + public BaseItemDto lockData(@org.eclipse.jdt.annotation.NonNull Boolean lockData) { + this.lockData = lockData; + return this; + } + + /** + * Gets or sets a value indicating whether [enable internet providers]. + * + * @return lockData + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCK_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getLockData() { + return lockData; + } + + @JsonProperty(JSON_PROPERTY_LOCK_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLockData(@org.eclipse.jdt.annotation.NonNull Boolean lockData) { + this.lockData = lockData; + } + + public BaseItemDto width(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + return this; + } + + /** + * Get width + * + * @return width + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + } + + public BaseItemDto height(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + return this; + } + + /** + * Get height + * + * @return height + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHeight() { + return height; + } + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + } + + public BaseItemDto cameraMake(@org.eclipse.jdt.annotation.NonNull String cameraMake) { + this.cameraMake = cameraMake; + return this; + } + + /** + * Get cameraMake + * + * @return cameraMake + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAMERA_MAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCameraMake() { + return cameraMake; + } + + @JsonProperty(JSON_PROPERTY_CAMERA_MAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCameraMake(@org.eclipse.jdt.annotation.NonNull String cameraMake) { + this.cameraMake = cameraMake; + } + + public BaseItemDto cameraModel(@org.eclipse.jdt.annotation.NonNull String cameraModel) { + this.cameraModel = cameraModel; + return this; + } + + /** + * Get cameraModel + * + * @return cameraModel + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAMERA_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCameraModel() { + return cameraModel; + } + + @JsonProperty(JSON_PROPERTY_CAMERA_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCameraModel(@org.eclipse.jdt.annotation.NonNull String cameraModel) { + this.cameraModel = cameraModel; + } + + public BaseItemDto software(@org.eclipse.jdt.annotation.NonNull String software) { + this.software = software; + return this; + } + + /** + * Get software + * + * @return software + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SOFTWARE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSoftware() { + return software; + } + + @JsonProperty(JSON_PROPERTY_SOFTWARE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSoftware(@org.eclipse.jdt.annotation.NonNull String software) { + this.software = software; + } + + public BaseItemDto exposureTime(@org.eclipse.jdt.annotation.NonNull Double exposureTime) { + this.exposureTime = exposureTime; + return this; + } + + /** + * Get exposureTime + * + * @return exposureTime + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXPOSURE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getExposureTime() { + return exposureTime; + } + + @JsonProperty(JSON_PROPERTY_EXPOSURE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExposureTime(@org.eclipse.jdt.annotation.NonNull Double exposureTime) { + this.exposureTime = exposureTime; + } + + public BaseItemDto focalLength(@org.eclipse.jdt.annotation.NonNull Double focalLength) { + this.focalLength = focalLength; + return this; + } + + /** + * Get focalLength + * + * @return focalLength + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FOCAL_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getFocalLength() { + return focalLength; + } + + @JsonProperty(JSON_PROPERTY_FOCAL_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFocalLength(@org.eclipse.jdt.annotation.NonNull Double focalLength) { + this.focalLength = focalLength; + } + + public BaseItemDto imageOrientation(@org.eclipse.jdt.annotation.NonNull ImageOrientation imageOrientation) { + this.imageOrientation = imageOrientation; + return this; + } + + /** + * Get imageOrientation + * + * @return imageOrientation + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_ORIENTATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ImageOrientation getImageOrientation() { + return imageOrientation; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_ORIENTATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageOrientation(@org.eclipse.jdt.annotation.NonNull ImageOrientation imageOrientation) { + this.imageOrientation = imageOrientation; + } + + public BaseItemDto aperture(@org.eclipse.jdt.annotation.NonNull Double aperture) { + this.aperture = aperture; + return this; + } + + /** + * Get aperture + * + * @return aperture + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APERTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getAperture() { + return aperture; + } + + @JsonProperty(JSON_PROPERTY_APERTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAperture(@org.eclipse.jdt.annotation.NonNull Double aperture) { + this.aperture = aperture; + } + + public BaseItemDto shutterSpeed(@org.eclipse.jdt.annotation.NonNull Double shutterSpeed) { + this.shutterSpeed = shutterSpeed; + return this; + } + + /** + * Get shutterSpeed + * + * @return shutterSpeed + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SHUTTER_SPEED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getShutterSpeed() { + return shutterSpeed; + } + + @JsonProperty(JSON_PROPERTY_SHUTTER_SPEED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShutterSpeed(@org.eclipse.jdt.annotation.NonNull Double shutterSpeed) { + this.shutterSpeed = shutterSpeed; + } + + public BaseItemDto latitude(@org.eclipse.jdt.annotation.NonNull Double latitude) { + this.latitude = latitude; + return this; + } + + /** + * Get latitude + * + * @return latitude + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LATITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getLatitude() { + return latitude; + } + + @JsonProperty(JSON_PROPERTY_LATITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLatitude(@org.eclipse.jdt.annotation.NonNull Double latitude) { + this.latitude = latitude; + } + + public BaseItemDto longitude(@org.eclipse.jdt.annotation.NonNull Double longitude) { + this.longitude = longitude; + return this; + } + + /** + * Get longitude + * + * @return longitude + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LONGITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getLongitude() { + return longitude; + } + + @JsonProperty(JSON_PROPERTY_LONGITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLongitude(@org.eclipse.jdt.annotation.NonNull Double longitude) { + this.longitude = longitude; + } + + public BaseItemDto altitude(@org.eclipse.jdt.annotation.NonNull Double altitude) { + this.altitude = altitude; + return this; + } + + /** + * Get altitude + * + * @return altitude + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALTITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getAltitude() { + return altitude; + } + + @JsonProperty(JSON_PROPERTY_ALTITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAltitude(@org.eclipse.jdt.annotation.NonNull Double altitude) { + this.altitude = altitude; + } + + public BaseItemDto isoSpeedRating(@org.eclipse.jdt.annotation.NonNull Integer isoSpeedRating) { + this.isoSpeedRating = isoSpeedRating; + return this; + } + + /** + * Get isoSpeedRating + * + * @return isoSpeedRating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ISO_SPEED_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIsoSpeedRating() { + return isoSpeedRating; + } + + @JsonProperty(JSON_PROPERTY_ISO_SPEED_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsoSpeedRating(@org.eclipse.jdt.annotation.NonNull Integer isoSpeedRating) { + this.isoSpeedRating = isoSpeedRating; + } + + public BaseItemDto seriesTimerId(@org.eclipse.jdt.annotation.NonNull String seriesTimerId) { + this.seriesTimerId = seriesTimerId; + return this; + } + + /** + * Gets or sets the series timer identifier. + * + * @return seriesTimerId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesTimerId() { + return seriesTimerId; + } + + @JsonProperty(JSON_PROPERTY_SERIES_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesTimerId(@org.eclipse.jdt.annotation.NonNull String seriesTimerId) { + this.seriesTimerId = seriesTimerId; + } + + public BaseItemDto programId(@org.eclipse.jdt.annotation.NonNull String programId) { + this.programId = programId; + return this; + } + + /** + * Gets or sets the program identifier. + * + * @return programId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProgramId() { + return programId; + } + + @JsonProperty(JSON_PROPERTY_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgramId(@org.eclipse.jdt.annotation.NonNull String programId) { + this.programId = programId; + } + + public BaseItemDto channelPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String channelPrimaryImageTag) { + this.channelPrimaryImageTag = channelPrimaryImageTag; + return this; + } + + /** + * Gets or sets the channel primary image tag. + * + * @return channelPrimaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelPrimaryImageTag() { + return channelPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String channelPrimaryImageTag) { + this.channelPrimaryImageTag = channelPrimaryImageTag; + } + + public BaseItemDto startDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Gets or sets the start date of the recording, in UTC. + * + * @return startDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartDate() { + return startDate; + } + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + } + + public BaseItemDto completionPercentage(@org.eclipse.jdt.annotation.NonNull Double completionPercentage) { + this.completionPercentage = completionPercentage; + return this; + } + + /** + * Gets or sets the completion percentage. + * + * @return completionPercentage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMPLETION_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getCompletionPercentage() { + return completionPercentage; + } + + @JsonProperty(JSON_PROPERTY_COMPLETION_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompletionPercentage(@org.eclipse.jdt.annotation.NonNull Double completionPercentage) { + this.completionPercentage = completionPercentage; + } + + public BaseItemDto isRepeat(@org.eclipse.jdt.annotation.NonNull Boolean isRepeat) { + this.isRepeat = isRepeat; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is repeat. + * + * @return isRepeat + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_REPEAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsRepeat() { + return isRepeat; + } + + @JsonProperty(JSON_PROPERTY_IS_REPEAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsRepeat(@org.eclipse.jdt.annotation.NonNull Boolean isRepeat) { + this.isRepeat = isRepeat; + } + + public BaseItemDto episodeTitle(@org.eclipse.jdt.annotation.NonNull String episodeTitle) { + this.episodeTitle = episodeTitle; + return this; + } + + /** + * Gets or sets the episode title. + * + * @return episodeTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EPISODE_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEpisodeTitle() { + return episodeTitle; + } + + @JsonProperty(JSON_PROPERTY_EPISODE_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEpisodeTitle(@org.eclipse.jdt.annotation.NonNull String episodeTitle) { + this.episodeTitle = episodeTitle; + } + + public BaseItemDto channelType(@org.eclipse.jdt.annotation.NonNull ChannelType channelType) { + this.channelType = channelType; + return this; + } + + /** + * Gets or sets the type of the channel. + * + * @return channelType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChannelType getChannelType() { + return channelType; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelType(@org.eclipse.jdt.annotation.NonNull ChannelType channelType) { + this.channelType = channelType; + } + + public BaseItemDto audio(@org.eclipse.jdt.annotation.NonNull ProgramAudio audio) { + this.audio = audio; + return this; + } + + /** + * Gets or sets the audio. + * + * @return audio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProgramAudio getAudio() { + return audio; + } + + @JsonProperty(JSON_PROPERTY_AUDIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudio(@org.eclipse.jdt.annotation.NonNull ProgramAudio audio) { + this.audio = audio; + } + + public BaseItemDto isMovie(@org.eclipse.jdt.annotation.NonNull Boolean isMovie) { + this.isMovie = isMovie; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is movie. + * + * @return isMovie + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_MOVIE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsMovie() { + return isMovie; + } + + @JsonProperty(JSON_PROPERTY_IS_MOVIE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMovie(@org.eclipse.jdt.annotation.NonNull Boolean isMovie) { + this.isMovie = isMovie; + } + + public BaseItemDto isSports(@org.eclipse.jdt.annotation.NonNull Boolean isSports) { + this.isSports = isSports; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is sports. + * + * @return isSports + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_SPORTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsSports() { + return isSports; + } + + @JsonProperty(JSON_PROPERTY_IS_SPORTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsSports(@org.eclipse.jdt.annotation.NonNull Boolean isSports) { + this.isSports = isSports; + } + + public BaseItemDto isSeries(@org.eclipse.jdt.annotation.NonNull Boolean isSeries) { + this.isSeries = isSeries; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is series. + * + * @return isSeries + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_SERIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsSeries() { + return isSeries; + } + + @JsonProperty(JSON_PROPERTY_IS_SERIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsSeries(@org.eclipse.jdt.annotation.NonNull Boolean isSeries) { + this.isSeries = isSeries; + } + + public BaseItemDto isLive(@org.eclipse.jdt.annotation.NonNull Boolean isLive) { + this.isLive = isLive; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is live. + * + * @return isLive + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_LIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsLive() { + return isLive; + } + + @JsonProperty(JSON_PROPERTY_IS_LIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsLive(@org.eclipse.jdt.annotation.NonNull Boolean isLive) { + this.isLive = isLive; + } + + public BaseItemDto isNews(@org.eclipse.jdt.annotation.NonNull Boolean isNews) { + this.isNews = isNews; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is news. + * + * @return isNews + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_NEWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsNews() { + return isNews; + } + + @JsonProperty(JSON_PROPERTY_IS_NEWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsNews(@org.eclipse.jdt.annotation.NonNull Boolean isNews) { + this.isNews = isNews; + } + + public BaseItemDto isKids(@org.eclipse.jdt.annotation.NonNull Boolean isKids) { + this.isKids = isKids; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is kids. + * + * @return isKids + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_KIDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsKids() { + return isKids; + } + + @JsonProperty(JSON_PROPERTY_IS_KIDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsKids(@org.eclipse.jdt.annotation.NonNull Boolean isKids) { + this.isKids = isKids; + } + + public BaseItemDto isPremiere(@org.eclipse.jdt.annotation.NonNull Boolean isPremiere) { + this.isPremiere = isPremiere; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is premiere. + * + * @return isPremiere + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PREMIERE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPremiere() { + return isPremiere; + } + + @JsonProperty(JSON_PROPERTY_IS_PREMIERE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPremiere(@org.eclipse.jdt.annotation.NonNull Boolean isPremiere) { + this.isPremiere = isPremiere; + } + + public BaseItemDto timerId(@org.eclipse.jdt.annotation.NonNull String timerId) { + this.timerId = timerId; + return this; + } + + /** + * Gets or sets the timer identifier. + * + * @return timerId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTimerId() { + return timerId; + } + + @JsonProperty(JSON_PROPERTY_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimerId(@org.eclipse.jdt.annotation.NonNull String timerId) { + this.timerId = timerId; + } + + public BaseItemDto normalizationGain(@org.eclipse.jdt.annotation.NonNull Float normalizationGain) { + this.normalizationGain = normalizationGain; + return this; + } + + /** + * Gets or sets the gain required for audio normalization. + * + * @return normalizationGain + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NORMALIZATION_GAIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getNormalizationGain() { + return normalizationGain; + } + + @JsonProperty(JSON_PROPERTY_NORMALIZATION_GAIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNormalizationGain(@org.eclipse.jdt.annotation.NonNull Float normalizationGain) { + this.normalizationGain = normalizationGain; + } + + public BaseItemDto currentProgram(@org.eclipse.jdt.annotation.NonNull BaseItemDto currentProgram) { + this.currentProgram = currentProgram; + return this; + } + + /** + * Gets or sets the current program. + * + * @return currentProgram + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CURRENT_PROGRAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemDto getCurrentProgram() { + return currentProgram; + } + + @JsonProperty(JSON_PROPERTY_CURRENT_PROGRAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrentProgram(@org.eclipse.jdt.annotation.NonNull BaseItemDto currentProgram) { + this.currentProgram = currentProgram; + } + + /** + * Return true if this BaseItemDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseItemDto baseItemDto = (BaseItemDto) o; + return Objects.equals(this.name, baseItemDto.name) + && Objects.equals(this.originalTitle, baseItemDto.originalTitle) + && Objects.equals(this.serverId, baseItemDto.serverId) && Objects.equals(this.id, baseItemDto.id) + && Objects.equals(this.etag, baseItemDto.etag) + && Objects.equals(this.sourceType, baseItemDto.sourceType) + && Objects.equals(this.playlistItemId, baseItemDto.playlistItemId) + && Objects.equals(this.dateCreated, baseItemDto.dateCreated) + && Objects.equals(this.dateLastMediaAdded, baseItemDto.dateLastMediaAdded) + && Objects.equals(this.extraType, baseItemDto.extraType) + && Objects.equals(this.airsBeforeSeasonNumber, baseItemDto.airsBeforeSeasonNumber) + && Objects.equals(this.airsAfterSeasonNumber, baseItemDto.airsAfterSeasonNumber) + && Objects.equals(this.airsBeforeEpisodeNumber, baseItemDto.airsBeforeEpisodeNumber) + && Objects.equals(this.canDelete, baseItemDto.canDelete) + && Objects.equals(this.canDownload, baseItemDto.canDownload) + && Objects.equals(this.hasLyrics, baseItemDto.hasLyrics) + && Objects.equals(this.hasSubtitles, baseItemDto.hasSubtitles) + && Objects.equals(this.preferredMetadataLanguage, baseItemDto.preferredMetadataLanguage) + && Objects.equals(this.preferredMetadataCountryCode, baseItemDto.preferredMetadataCountryCode) + && Objects.equals(this.container, baseItemDto.container) + && Objects.equals(this.sortName, baseItemDto.sortName) + && Objects.equals(this.forcedSortName, baseItemDto.forcedSortName) + && Objects.equals(this.video3DFormat, baseItemDto.video3DFormat) + && Objects.equals(this.premiereDate, baseItemDto.premiereDate) + && Objects.equals(this.externalUrls, baseItemDto.externalUrls) + && Objects.equals(this.mediaSources, baseItemDto.mediaSources) + && Objects.equals(this.criticRating, baseItemDto.criticRating) + && Objects.equals(this.productionLocations, baseItemDto.productionLocations) + && Objects.equals(this.path, baseItemDto.path) + && Objects.equals(this.enableMediaSourceDisplay, baseItemDto.enableMediaSourceDisplay) + && Objects.equals(this.officialRating, baseItemDto.officialRating) + && Objects.equals(this.customRating, baseItemDto.customRating) + && Objects.equals(this.channelId, baseItemDto.channelId) + && Objects.equals(this.channelName, baseItemDto.channelName) + && Objects.equals(this.overview, baseItemDto.overview) + && Objects.equals(this.taglines, baseItemDto.taglines) + && Objects.equals(this.genres, baseItemDto.genres) + && Objects.equals(this.communityRating, baseItemDto.communityRating) + && Objects.equals(this.cumulativeRunTimeTicks, baseItemDto.cumulativeRunTimeTicks) + && Objects.equals(this.runTimeTicks, baseItemDto.runTimeTicks) + && Objects.equals(this.playAccess, baseItemDto.playAccess) + && Objects.equals(this.aspectRatio, baseItemDto.aspectRatio) + && Objects.equals(this.productionYear, baseItemDto.productionYear) + && Objects.equals(this.isPlaceHolder, baseItemDto.isPlaceHolder) + && Objects.equals(this.number, baseItemDto.number) + && Objects.equals(this.channelNumber, baseItemDto.channelNumber) + && Objects.equals(this.indexNumber, baseItemDto.indexNumber) + && Objects.equals(this.indexNumberEnd, baseItemDto.indexNumberEnd) + && Objects.equals(this.parentIndexNumber, baseItemDto.parentIndexNumber) + && Objects.equals(this.remoteTrailers, baseItemDto.remoteTrailers) + && Objects.equals(this.providerIds, baseItemDto.providerIds) + && Objects.equals(this.isHD, baseItemDto.isHD) && Objects.equals(this.isFolder, baseItemDto.isFolder) + && Objects.equals(this.parentId, baseItemDto.parentId) && Objects.equals(this.type, baseItemDto.type) + && Objects.equals(this.people, baseItemDto.people) && Objects.equals(this.studios, baseItemDto.studios) + && Objects.equals(this.genreItems, baseItemDto.genreItems) + && Objects.equals(this.parentLogoItemId, baseItemDto.parentLogoItemId) + && Objects.equals(this.parentBackdropItemId, baseItemDto.parentBackdropItemId) + && Objects.equals(this.parentBackdropImageTags, baseItemDto.parentBackdropImageTags) + && Objects.equals(this.localTrailerCount, baseItemDto.localTrailerCount) + && Objects.equals(this.userData, baseItemDto.userData) + && Objects.equals(this.recursiveItemCount, baseItemDto.recursiveItemCount) + && Objects.equals(this.childCount, baseItemDto.childCount) + && Objects.equals(this.seriesName, baseItemDto.seriesName) + && Objects.equals(this.seriesId, baseItemDto.seriesId) + && Objects.equals(this.seasonId, baseItemDto.seasonId) + && Objects.equals(this.specialFeatureCount, baseItemDto.specialFeatureCount) + && Objects.equals(this.displayPreferencesId, baseItemDto.displayPreferencesId) + && Objects.equals(this.status, baseItemDto.status) && Objects.equals(this.airTime, baseItemDto.airTime) + && Objects.equals(this.airDays, baseItemDto.airDays) && Objects.equals(this.tags, baseItemDto.tags) + && Objects.equals(this.primaryImageAspectRatio, baseItemDto.primaryImageAspectRatio) + && Objects.equals(this.artists, baseItemDto.artists) + && Objects.equals(this.artistItems, baseItemDto.artistItems) + && Objects.equals(this.album, baseItemDto.album) + && Objects.equals(this.collectionType, baseItemDto.collectionType) + && Objects.equals(this.displayOrder, baseItemDto.displayOrder) + && Objects.equals(this.albumId, baseItemDto.albumId) + && Objects.equals(this.albumPrimaryImageTag, baseItemDto.albumPrimaryImageTag) + && Objects.equals(this.seriesPrimaryImageTag, baseItemDto.seriesPrimaryImageTag) + && Objects.equals(this.albumArtist, baseItemDto.albumArtist) + && Objects.equals(this.albumArtists, baseItemDto.albumArtists) + && Objects.equals(this.seasonName, baseItemDto.seasonName) + && Objects.equals(this.mediaStreams, baseItemDto.mediaStreams) + && Objects.equals(this.videoType, baseItemDto.videoType) + && Objects.equals(this.partCount, baseItemDto.partCount) + && Objects.equals(this.mediaSourceCount, baseItemDto.mediaSourceCount) + && Objects.equals(this.imageTags, baseItemDto.imageTags) + && Objects.equals(this.backdropImageTags, baseItemDto.backdropImageTags) + && Objects.equals(this.screenshotImageTags, baseItemDto.screenshotImageTags) + && Objects.equals(this.parentLogoImageTag, baseItemDto.parentLogoImageTag) + && Objects.equals(this.parentArtItemId, baseItemDto.parentArtItemId) + && Objects.equals(this.parentArtImageTag, baseItemDto.parentArtImageTag) + && Objects.equals(this.seriesThumbImageTag, baseItemDto.seriesThumbImageTag) + && Objects.equals(this.imageBlurHashes, baseItemDto.imageBlurHashes) + && Objects.equals(this.seriesStudio, baseItemDto.seriesStudio) + && Objects.equals(this.parentThumbItemId, baseItemDto.parentThumbItemId) + && Objects.equals(this.parentThumbImageTag, baseItemDto.parentThumbImageTag) + && Objects.equals(this.parentPrimaryImageItemId, baseItemDto.parentPrimaryImageItemId) + && Objects.equals(this.parentPrimaryImageTag, baseItemDto.parentPrimaryImageTag) + && Objects.equals(this.chapters, baseItemDto.chapters) + && Objects.equals(this.trickplay, baseItemDto.trickplay) + && Objects.equals(this.locationType, baseItemDto.locationType) + && Objects.equals(this.isoType, baseItemDto.isoType) + && Objects.equals(this.mediaType, baseItemDto.mediaType) + && Objects.equals(this.endDate, baseItemDto.endDate) + && Objects.equals(this.lockedFields, baseItemDto.lockedFields) + && Objects.equals(this.trailerCount, baseItemDto.trailerCount) + && Objects.equals(this.movieCount, baseItemDto.movieCount) + && Objects.equals(this.seriesCount, baseItemDto.seriesCount) + && Objects.equals(this.programCount, baseItemDto.programCount) + && Objects.equals(this.episodeCount, baseItemDto.episodeCount) + && Objects.equals(this.songCount, baseItemDto.songCount) + && Objects.equals(this.albumCount, baseItemDto.albumCount) + && Objects.equals(this.artistCount, baseItemDto.artistCount) + && Objects.equals(this.musicVideoCount, baseItemDto.musicVideoCount) + && Objects.equals(this.lockData, baseItemDto.lockData) && Objects.equals(this.width, baseItemDto.width) + && Objects.equals(this.height, baseItemDto.height) + && Objects.equals(this.cameraMake, baseItemDto.cameraMake) + && Objects.equals(this.cameraModel, baseItemDto.cameraModel) + && Objects.equals(this.software, baseItemDto.software) + && Objects.equals(this.exposureTime, baseItemDto.exposureTime) + && Objects.equals(this.focalLength, baseItemDto.focalLength) + && Objects.equals(this.imageOrientation, baseItemDto.imageOrientation) + && Objects.equals(this.aperture, baseItemDto.aperture) + && Objects.equals(this.shutterSpeed, baseItemDto.shutterSpeed) + && Objects.equals(this.latitude, baseItemDto.latitude) + && Objects.equals(this.longitude, baseItemDto.longitude) + && Objects.equals(this.altitude, baseItemDto.altitude) + && Objects.equals(this.isoSpeedRating, baseItemDto.isoSpeedRating) + && Objects.equals(this.seriesTimerId, baseItemDto.seriesTimerId) + && Objects.equals(this.programId, baseItemDto.programId) + && Objects.equals(this.channelPrimaryImageTag, baseItemDto.channelPrimaryImageTag) + && Objects.equals(this.startDate, baseItemDto.startDate) + && Objects.equals(this.completionPercentage, baseItemDto.completionPercentage) + && Objects.equals(this.isRepeat, baseItemDto.isRepeat) + && Objects.equals(this.episodeTitle, baseItemDto.episodeTitle) + && Objects.equals(this.channelType, baseItemDto.channelType) + && Objects.equals(this.audio, baseItemDto.audio) && Objects.equals(this.isMovie, baseItemDto.isMovie) + && Objects.equals(this.isSports, baseItemDto.isSports) + && Objects.equals(this.isSeries, baseItemDto.isSeries) + && Objects.equals(this.isLive, baseItemDto.isLive) && Objects.equals(this.isNews, baseItemDto.isNews) + && Objects.equals(this.isKids, baseItemDto.isKids) + && Objects.equals(this.isPremiere, baseItemDto.isPremiere) + && Objects.equals(this.timerId, baseItemDto.timerId) + && Objects.equals(this.normalizationGain, baseItemDto.normalizationGain) + && Objects.equals(this.currentProgram, baseItemDto.currentProgram); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, serverId, id, etag, sourceType, playlistItemId, dateCreated, + dateLastMediaAdded, extraType, airsBeforeSeasonNumber, airsAfterSeasonNumber, airsBeforeEpisodeNumber, + canDelete, canDownload, hasLyrics, hasSubtitles, preferredMetadataLanguage, + preferredMetadataCountryCode, container, sortName, forcedSortName, video3DFormat, premiereDate, + externalUrls, mediaSources, criticRating, productionLocations, path, enableMediaSourceDisplay, + officialRating, customRating, channelId, channelName, overview, taglines, genres, communityRating, + cumulativeRunTimeTicks, runTimeTicks, playAccess, aspectRatio, productionYear, isPlaceHolder, number, + channelNumber, indexNumber, indexNumberEnd, parentIndexNumber, remoteTrailers, providerIds, isHD, + isFolder, parentId, type, people, studios, genreItems, parentLogoItemId, parentBackdropItemId, + parentBackdropImageTags, localTrailerCount, userData, recursiveItemCount, childCount, seriesName, + seriesId, seasonId, specialFeatureCount, displayPreferencesId, status, airTime, airDays, tags, + primaryImageAspectRatio, artists, artistItems, album, collectionType, displayOrder, albumId, + albumPrimaryImageTag, seriesPrimaryImageTag, albumArtist, albumArtists, seasonName, mediaStreams, + videoType, partCount, mediaSourceCount, imageTags, backdropImageTags, screenshotImageTags, + parentLogoImageTag, parentArtItemId, parentArtImageTag, seriesThumbImageTag, imageBlurHashes, + seriesStudio, parentThumbItemId, parentThumbImageTag, parentPrimaryImageItemId, parentPrimaryImageTag, + chapters, trickplay, locationType, isoType, mediaType, endDate, lockedFields, trailerCount, movieCount, + seriesCount, programCount, episodeCount, songCount, albumCount, artistCount, musicVideoCount, lockData, + width, height, cameraMake, cameraModel, software, exposureTime, focalLength, imageOrientation, aperture, + shutterSpeed, latitude, longitude, altitude, isoSpeedRating, seriesTimerId, programId, + channelPrimaryImageTag, startDate, completionPercentage, isRepeat, episodeTitle, channelType, audio, + isMovie, isSports, isSeries, isLive, isNews, isKids, isPremiere, timerId, normalizationGain, + currentProgram); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseItemDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" etag: ").append(toIndentedString(etag)).append("\n"); + sb.append(" sourceType: ").append(toIndentedString(sourceType)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append(" dateCreated: ").append(toIndentedString(dateCreated)).append("\n"); + sb.append(" dateLastMediaAdded: ").append(toIndentedString(dateLastMediaAdded)).append("\n"); + sb.append(" extraType: ").append(toIndentedString(extraType)).append("\n"); + sb.append(" airsBeforeSeasonNumber: ").append(toIndentedString(airsBeforeSeasonNumber)).append("\n"); + sb.append(" airsAfterSeasonNumber: ").append(toIndentedString(airsAfterSeasonNumber)).append("\n"); + sb.append(" airsBeforeEpisodeNumber: ").append(toIndentedString(airsBeforeEpisodeNumber)).append("\n"); + sb.append(" canDelete: ").append(toIndentedString(canDelete)).append("\n"); + sb.append(" canDownload: ").append(toIndentedString(canDownload)).append("\n"); + sb.append(" hasLyrics: ").append(toIndentedString(hasLyrics)).append("\n"); + sb.append(" hasSubtitles: ").append(toIndentedString(hasSubtitles)).append("\n"); + sb.append(" preferredMetadataLanguage: ").append(toIndentedString(preferredMetadataLanguage)).append("\n"); + sb.append(" preferredMetadataCountryCode: ").append(toIndentedString(preferredMetadataCountryCode)) + .append("\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" sortName: ").append(toIndentedString(sortName)).append("\n"); + sb.append(" forcedSortName: ").append(toIndentedString(forcedSortName)).append("\n"); + sb.append(" video3DFormat: ").append(toIndentedString(video3DFormat)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" externalUrls: ").append(toIndentedString(externalUrls)).append("\n"); + sb.append(" mediaSources: ").append(toIndentedString(mediaSources)).append("\n"); + sb.append(" criticRating: ").append(toIndentedString(criticRating)).append("\n"); + sb.append(" productionLocations: ").append(toIndentedString(productionLocations)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" enableMediaSourceDisplay: ").append(toIndentedString(enableMediaSourceDisplay)).append("\n"); + sb.append(" officialRating: ").append(toIndentedString(officialRating)).append("\n"); + sb.append(" customRating: ").append(toIndentedString(customRating)).append("\n"); + sb.append(" channelId: ").append(toIndentedString(channelId)).append("\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" overview: ").append(toIndentedString(overview)).append("\n"); + sb.append(" taglines: ").append(toIndentedString(taglines)).append("\n"); + sb.append(" genres: ").append(toIndentedString(genres)).append("\n"); + sb.append(" communityRating: ").append(toIndentedString(communityRating)).append("\n"); + sb.append(" cumulativeRunTimeTicks: ").append(toIndentedString(cumulativeRunTimeTicks)).append("\n"); + sb.append(" runTimeTicks: ").append(toIndentedString(runTimeTicks)).append("\n"); + sb.append(" playAccess: ").append(toIndentedString(playAccess)).append("\n"); + sb.append(" aspectRatio: ").append(toIndentedString(aspectRatio)).append("\n"); + sb.append(" productionYear: ").append(toIndentedString(productionYear)).append("\n"); + sb.append(" isPlaceHolder: ").append(toIndentedString(isPlaceHolder)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" channelNumber: ").append(toIndentedString(channelNumber)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" indexNumberEnd: ").append(toIndentedString(indexNumberEnd)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" remoteTrailers: ").append(toIndentedString(remoteTrailers)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" isHD: ").append(toIndentedString(isHD)).append("\n"); + sb.append(" isFolder: ").append(toIndentedString(isFolder)).append("\n"); + sb.append(" parentId: ").append(toIndentedString(parentId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" people: ").append(toIndentedString(people)).append("\n"); + sb.append(" studios: ").append(toIndentedString(studios)).append("\n"); + sb.append(" genreItems: ").append(toIndentedString(genreItems)).append("\n"); + sb.append(" parentLogoItemId: ").append(toIndentedString(parentLogoItemId)).append("\n"); + sb.append(" parentBackdropItemId: ").append(toIndentedString(parentBackdropItemId)).append("\n"); + sb.append(" parentBackdropImageTags: ").append(toIndentedString(parentBackdropImageTags)).append("\n"); + sb.append(" localTrailerCount: ").append(toIndentedString(localTrailerCount)).append("\n"); + sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); + sb.append(" recursiveItemCount: ").append(toIndentedString(recursiveItemCount)).append("\n"); + sb.append(" childCount: ").append(toIndentedString(childCount)).append("\n"); + sb.append(" seriesName: ").append(toIndentedString(seriesName)).append("\n"); + sb.append(" seriesId: ").append(toIndentedString(seriesId)).append("\n"); + sb.append(" seasonId: ").append(toIndentedString(seasonId)).append("\n"); + sb.append(" specialFeatureCount: ").append(toIndentedString(specialFeatureCount)).append("\n"); + sb.append(" displayPreferencesId: ").append(toIndentedString(displayPreferencesId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" airTime: ").append(toIndentedString(airTime)).append("\n"); + sb.append(" airDays: ").append(toIndentedString(airDays)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" primaryImageAspectRatio: ").append(toIndentedString(primaryImageAspectRatio)).append("\n"); + sb.append(" artists: ").append(toIndentedString(artists)).append("\n"); + sb.append(" artistItems: ").append(toIndentedString(artistItems)).append("\n"); + sb.append(" album: ").append(toIndentedString(album)).append("\n"); + sb.append(" collectionType: ").append(toIndentedString(collectionType)).append("\n"); + sb.append(" displayOrder: ").append(toIndentedString(displayOrder)).append("\n"); + sb.append(" albumId: ").append(toIndentedString(albumId)).append("\n"); + sb.append(" albumPrimaryImageTag: ").append(toIndentedString(albumPrimaryImageTag)).append("\n"); + sb.append(" seriesPrimaryImageTag: ").append(toIndentedString(seriesPrimaryImageTag)).append("\n"); + sb.append(" albumArtist: ").append(toIndentedString(albumArtist)).append("\n"); + sb.append(" albumArtists: ").append(toIndentedString(albumArtists)).append("\n"); + sb.append(" seasonName: ").append(toIndentedString(seasonName)).append("\n"); + sb.append(" mediaStreams: ").append(toIndentedString(mediaStreams)).append("\n"); + sb.append(" videoType: ").append(toIndentedString(videoType)).append("\n"); + sb.append(" partCount: ").append(toIndentedString(partCount)).append("\n"); + sb.append(" mediaSourceCount: ").append(toIndentedString(mediaSourceCount)).append("\n"); + sb.append(" imageTags: ").append(toIndentedString(imageTags)).append("\n"); + sb.append(" backdropImageTags: ").append(toIndentedString(backdropImageTags)).append("\n"); + sb.append(" screenshotImageTags: ").append(toIndentedString(screenshotImageTags)).append("\n"); + sb.append(" parentLogoImageTag: ").append(toIndentedString(parentLogoImageTag)).append("\n"); + sb.append(" parentArtItemId: ").append(toIndentedString(parentArtItemId)).append("\n"); + sb.append(" parentArtImageTag: ").append(toIndentedString(parentArtImageTag)).append("\n"); + sb.append(" seriesThumbImageTag: ").append(toIndentedString(seriesThumbImageTag)).append("\n"); + sb.append(" imageBlurHashes: ").append(toIndentedString(imageBlurHashes)).append("\n"); + sb.append(" seriesStudio: ").append(toIndentedString(seriesStudio)).append("\n"); + sb.append(" parentThumbItemId: ").append(toIndentedString(parentThumbItemId)).append("\n"); + sb.append(" parentThumbImageTag: ").append(toIndentedString(parentThumbImageTag)).append("\n"); + sb.append(" parentPrimaryImageItemId: ").append(toIndentedString(parentPrimaryImageItemId)).append("\n"); + sb.append(" parentPrimaryImageTag: ").append(toIndentedString(parentPrimaryImageTag)).append("\n"); + sb.append(" chapters: ").append(toIndentedString(chapters)).append("\n"); + sb.append(" trickplay: ").append(toIndentedString(trickplay)).append("\n"); + sb.append(" locationType: ").append(toIndentedString(locationType)).append("\n"); + sb.append(" isoType: ").append(toIndentedString(isoType)).append("\n"); + sb.append(" mediaType: ").append(toIndentedString(mediaType)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" lockedFields: ").append(toIndentedString(lockedFields)).append("\n"); + sb.append(" trailerCount: ").append(toIndentedString(trailerCount)).append("\n"); + sb.append(" movieCount: ").append(toIndentedString(movieCount)).append("\n"); + sb.append(" seriesCount: ").append(toIndentedString(seriesCount)).append("\n"); + sb.append(" programCount: ").append(toIndentedString(programCount)).append("\n"); + sb.append(" episodeCount: ").append(toIndentedString(episodeCount)).append("\n"); + sb.append(" songCount: ").append(toIndentedString(songCount)).append("\n"); + sb.append(" albumCount: ").append(toIndentedString(albumCount)).append("\n"); + sb.append(" artistCount: ").append(toIndentedString(artistCount)).append("\n"); + sb.append(" musicVideoCount: ").append(toIndentedString(musicVideoCount)).append("\n"); + sb.append(" lockData: ").append(toIndentedString(lockData)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" cameraMake: ").append(toIndentedString(cameraMake)).append("\n"); + sb.append(" cameraModel: ").append(toIndentedString(cameraModel)).append("\n"); + sb.append(" software: ").append(toIndentedString(software)).append("\n"); + sb.append(" exposureTime: ").append(toIndentedString(exposureTime)).append("\n"); + sb.append(" focalLength: ").append(toIndentedString(focalLength)).append("\n"); + sb.append(" imageOrientation: ").append(toIndentedString(imageOrientation)).append("\n"); + sb.append(" aperture: ").append(toIndentedString(aperture)).append("\n"); + sb.append(" shutterSpeed: ").append(toIndentedString(shutterSpeed)).append("\n"); + sb.append(" latitude: ").append(toIndentedString(latitude)).append("\n"); + sb.append(" longitude: ").append(toIndentedString(longitude)).append("\n"); + sb.append(" altitude: ").append(toIndentedString(altitude)).append("\n"); + sb.append(" isoSpeedRating: ").append(toIndentedString(isoSpeedRating)).append("\n"); + sb.append(" seriesTimerId: ").append(toIndentedString(seriesTimerId)).append("\n"); + sb.append(" programId: ").append(toIndentedString(programId)).append("\n"); + sb.append(" channelPrimaryImageTag: ").append(toIndentedString(channelPrimaryImageTag)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" completionPercentage: ").append(toIndentedString(completionPercentage)).append("\n"); + sb.append(" isRepeat: ").append(toIndentedString(isRepeat)).append("\n"); + sb.append(" episodeTitle: ").append(toIndentedString(episodeTitle)).append("\n"); + sb.append(" channelType: ").append(toIndentedString(channelType)).append("\n"); + sb.append(" audio: ").append(toIndentedString(audio)).append("\n"); + sb.append(" isMovie: ").append(toIndentedString(isMovie)).append("\n"); + sb.append(" isSports: ").append(toIndentedString(isSports)).append("\n"); + sb.append(" isSeries: ").append(toIndentedString(isSeries)).append("\n"); + sb.append(" isLive: ").append(toIndentedString(isLive)).append("\n"); + sb.append(" isNews: ").append(toIndentedString(isNews)).append("\n"); + sb.append(" isKids: ").append(toIndentedString(isKids)).append("\n"); + sb.append(" isPremiere: ").append(toIndentedString(isPremiere)).append("\n"); + sb.append(" timerId: ").append(toIndentedString(timerId)).append("\n"); + sb.append(" normalizationGain: ").append(toIndentedString(normalizationGain)).append("\n"); + sb.append(" currentProgram: ").append(toIndentedString(currentProgram)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `ServerId` to the URL query string + if (getServerId() != null) { + joiner.add(String.format("%sServerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerId())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Etag` to the URL query string + if (getEtag() != null) { + joiner.add(String.format("%sEtag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEtag())))); + } + + // add `SourceType` to the URL query string + if (getSourceType() != null) { + joiner.add(String.format("%sSourceType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSourceType())))); + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + // add `DateCreated` to the URL query string + if (getDateCreated() != null) { + joiner.add(String.format("%sDateCreated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateCreated())))); + } + + // add `DateLastMediaAdded` to the URL query string + if (getDateLastMediaAdded() != null) { + joiner.add(String.format("%sDateLastMediaAdded%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateLastMediaAdded())))); + } + + // add `ExtraType` to the URL query string + if (getExtraType() != null) { + joiner.add(String.format("%sExtraType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExtraType())))); + } + + // add `AirsBeforeSeasonNumber` to the URL query string + if (getAirsBeforeSeasonNumber() != null) { + joiner.add(String.format("%sAirsBeforeSeasonNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAirsBeforeSeasonNumber())))); + } + + // add `AirsAfterSeasonNumber` to the URL query string + if (getAirsAfterSeasonNumber() != null) { + joiner.add(String.format("%sAirsAfterSeasonNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAirsAfterSeasonNumber())))); + } + + // add `AirsBeforeEpisodeNumber` to the URL query string + if (getAirsBeforeEpisodeNumber() != null) { + joiner.add(String.format("%sAirsBeforeEpisodeNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAirsBeforeEpisodeNumber())))); + } + + // add `CanDelete` to the URL query string + if (getCanDelete() != null) { + joiner.add(String.format("%sCanDelete%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanDelete())))); + } + + // add `CanDownload` to the URL query string + if (getCanDownload() != null) { + joiner.add(String.format("%sCanDownload%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanDownload())))); + } + + // add `HasLyrics` to the URL query string + if (getHasLyrics() != null) { + joiner.add(String.format("%sHasLyrics%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasLyrics())))); + } + + // add `HasSubtitles` to the URL query string + if (getHasSubtitles() != null) { + joiner.add(String.format("%sHasSubtitles%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasSubtitles())))); + } + + // add `PreferredMetadataLanguage` to the URL query string + if (getPreferredMetadataLanguage() != null) { + joiner.add(String.format("%sPreferredMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreferredMetadataLanguage())))); + } + + // add `PreferredMetadataCountryCode` to the URL query string + if (getPreferredMetadataCountryCode() != null) { + joiner.add(String.format("%sPreferredMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreferredMetadataCountryCode())))); + } + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + // add `SortName` to the URL query string + if (getSortName() != null) { + joiner.add(String.format("%sSortName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSortName())))); + } + + // add `ForcedSortName` to the URL query string + if (getForcedSortName() != null) { + joiner.add(String.format("%sForcedSortName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getForcedSortName())))); + } + + // add `Video3DFormat` to the URL query string + if (getVideo3DFormat() != null) { + joiner.add(String.format("%sVideo3DFormat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideo3DFormat())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `ExternalUrls` to the URL query string + if (getExternalUrls() != null) { + for (int i = 0; i < getExternalUrls().size(); i++) { + if (getExternalUrls().get(i) != null) { + joiner.add(getExternalUrls().get(i).toUrlQueryString(String.format("%sExternalUrls%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `MediaSources` to the URL query string + if (getMediaSources() != null) { + for (int i = 0; i < getMediaSources().size(); i++) { + if (getMediaSources().get(i) != null) { + joiner.add(getMediaSources().get(i).toUrlQueryString(String.format("%sMediaSources%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `CriticRating` to the URL query string + if (getCriticRating() != null) { + joiner.add(String.format("%sCriticRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCriticRating())))); + } + + // add `ProductionLocations` to the URL query string + if (getProductionLocations() != null) { + for (int i = 0; i < getProductionLocations().size(); i++) { + joiner.add(String.format("%sProductionLocations%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getProductionLocations().get(i))))); + } + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `EnableMediaSourceDisplay` to the URL query string + if (getEnableMediaSourceDisplay() != null) { + joiner.add(String.format("%sEnableMediaSourceDisplay%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableMediaSourceDisplay())))); + } + + // add `OfficialRating` to the URL query string + if (getOfficialRating() != null) { + joiner.add(String.format("%sOfficialRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOfficialRating())))); + } + + // add `CustomRating` to the URL query string + if (getCustomRating() != null) { + joiner.add(String.format("%sCustomRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCustomRating())))); + } + + // add `ChannelId` to the URL query string + if (getChannelId() != null) { + joiner.add(String.format("%sChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelId())))); + } + + // add `ChannelName` to the URL query string + if (getChannelName() != null) { + joiner.add(String.format("%sChannelName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelName())))); + } + + // add `Overview` to the URL query string + if (getOverview() != null) { + joiner.add(String.format("%sOverview%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOverview())))); + } + + // add `Taglines` to the URL query string + if (getTaglines() != null) { + for (int i = 0; i < getTaglines().size(); i++) { + joiner.add(String.format("%sTaglines%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getTaglines().get(i))))); + } + } + + // add `Genres` to the URL query string + if (getGenres() != null) { + for (int i = 0; i < getGenres().size(); i++) { + joiner.add(String.format("%sGenres%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getGenres().get(i))))); + } + } + + // add `CommunityRating` to the URL query string + if (getCommunityRating() != null) { + joiner.add(String.format("%sCommunityRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCommunityRating())))); + } + + // add `CumulativeRunTimeTicks` to the URL query string + if (getCumulativeRunTimeTicks() != null) { + joiner.add(String.format("%sCumulativeRunTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCumulativeRunTimeTicks())))); + } + + // add `RunTimeTicks` to the URL query string + if (getRunTimeTicks() != null) { + joiner.add(String.format("%sRunTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRunTimeTicks())))); + } + + // add `PlayAccess` to the URL query string + if (getPlayAccess() != null) { + joiner.add(String.format("%sPlayAccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayAccess())))); + } + + // add `AspectRatio` to the URL query string + if (getAspectRatio() != null) { + joiner.add(String.format("%sAspectRatio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAspectRatio())))); + } + + // add `ProductionYear` to the URL query string + if (getProductionYear() != null) { + joiner.add(String.format("%sProductionYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProductionYear())))); + } + + // add `IsPlaceHolder` to the URL query string + if (getIsPlaceHolder() != null) { + joiner.add(String.format("%sIsPlaceHolder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPlaceHolder())))); + } + + // add `Number` to the URL query string + if (getNumber() != null) { + joiner.add(String.format("%sNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getNumber())))); + } + + // add `ChannelNumber` to the URL query string + if (getChannelNumber() != null) { + joiner.add(String.format("%sChannelNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelNumber())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `IndexNumberEnd` to the URL query string + if (getIndexNumberEnd() != null) { + joiner.add(String.format("%sIndexNumberEnd%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumberEnd())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `RemoteTrailers` to the URL query string + if (getRemoteTrailers() != null) { + for (int i = 0; i < getRemoteTrailers().size(); i++) { + if (getRemoteTrailers().get(i) != null) { + joiner.add(getRemoteTrailers().get(i).toUrlQueryString(String.format("%sRemoteTrailers%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `IsHD` to the URL query string + if (getIsHD() != null) { + joiner.add(String.format("%sIsHD%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsHD())))); + } + + // add `IsFolder` to the URL query string + if (getIsFolder() != null) { + joiner.add(String.format("%sIsFolder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsFolder())))); + } + + // add `ParentId` to the URL query string + if (getParentId() != null) { + joiner.add(String.format("%sParentId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentId())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `People` to the URL query string + if (getPeople() != null) { + for (int i = 0; i < getPeople().size(); i++) { + if (getPeople().get(i) != null) { + joiner.add(getPeople().get(i).toUrlQueryString(String.format("%sPeople%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Studios` to the URL query string + if (getStudios() != null) { + for (int i = 0; i < getStudios().size(); i++) { + if (getStudios().get(i) != null) { + joiner.add(getStudios().get(i).toUrlQueryString(String.format("%sStudios%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `GenreItems` to the URL query string + if (getGenreItems() != null) { + for (int i = 0; i < getGenreItems().size(); i++) { + if (getGenreItems().get(i) != null) { + joiner.add(getGenreItems().get(i).toUrlQueryString(String.format("%sGenreItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ParentLogoItemId` to the URL query string + if (getParentLogoItemId() != null) { + joiner.add(String.format("%sParentLogoItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentLogoItemId())))); + } + + // add `ParentBackdropItemId` to the URL query string + if (getParentBackdropItemId() != null) { + joiner.add(String.format("%sParentBackdropItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentBackdropItemId())))); + } + + // add `ParentBackdropImageTags` to the URL query string + if (getParentBackdropImageTags() != null) { + for (int i = 0; i < getParentBackdropImageTags().size(); i++) { + joiner.add(String.format("%sParentBackdropImageTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getParentBackdropImageTags().get(i))))); + } + } + + // add `LocalTrailerCount` to the URL query string + if (getLocalTrailerCount() != null) { + joiner.add(String.format("%sLocalTrailerCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocalTrailerCount())))); + } + + // add `UserData` to the URL query string + if (getUserData() != null) { + joiner.add(getUserData().toUrlQueryString(prefix + "UserData" + suffix)); + } + + // add `RecursiveItemCount` to the URL query string + if (getRecursiveItemCount() != null) { + joiner.add(String.format("%sRecursiveItemCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRecursiveItemCount())))); + } + + // add `ChildCount` to the URL query string + if (getChildCount() != null) { + joiner.add(String.format("%sChildCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChildCount())))); + } + + // add `SeriesName` to the URL query string + if (getSeriesName() != null) { + joiner.add(String.format("%sSeriesName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesName())))); + } + + // add `SeriesId` to the URL query string + if (getSeriesId() != null) { + joiner.add(String.format("%sSeriesId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesId())))); + } + + // add `SeasonId` to the URL query string + if (getSeasonId() != null) { + joiner.add(String.format("%sSeasonId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeasonId())))); + } + + // add `SpecialFeatureCount` to the URL query string + if (getSpecialFeatureCount() != null) { + joiner.add(String.format("%sSpecialFeatureCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSpecialFeatureCount())))); + } + + // add `DisplayPreferencesId` to the URL query string + if (getDisplayPreferencesId() != null) { + joiner.add(String.format("%sDisplayPreferencesId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplayPreferencesId())))); + } + + // add `Status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sStatus%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `AirTime` to the URL query string + if (getAirTime() != null) { + joiner.add(String.format("%sAirTime%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAirTime())))); + } + + // add `AirDays` to the URL query string + if (getAirDays() != null) { + for (int i = 0; i < getAirDays().size(); i++) { + if (getAirDays().get(i) != null) { + joiner.add(String.format("%sAirDays%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getAirDays().get(i))))); + } + } + } + + // add `Tags` to the URL query string + if (getTags() != null) { + for (int i = 0; i < getTags().size(); i++) { + joiner.add(String.format("%sTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getTags().get(i))))); + } + } + + // add `PrimaryImageAspectRatio` to the URL query string + if (getPrimaryImageAspectRatio() != null) { + joiner.add(String.format("%sPrimaryImageAspectRatio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageAspectRatio())))); + } + + // add `Artists` to the URL query string + if (getArtists() != null) { + for (int i = 0; i < getArtists().size(); i++) { + joiner.add(String.format("%sArtists%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArtists().get(i))))); + } + } + + // add `ArtistItems` to the URL query string + if (getArtistItems() != null) { + for (int i = 0; i < getArtistItems().size(); i++) { + if (getArtistItems().get(i) != null) { + joiner.add(getArtistItems().get(i).toUrlQueryString(String.format("%sArtistItems%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Album` to the URL query string + if (getAlbum() != null) { + joiner.add(String.format("%sAlbum%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbum())))); + } + + // add `CollectionType` to the URL query string + if (getCollectionType() != null) { + joiner.add(String.format("%sCollectionType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCollectionType())))); + } + + // add `DisplayOrder` to the URL query string + if (getDisplayOrder() != null) { + joiner.add(String.format("%sDisplayOrder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplayOrder())))); + } + + // add `AlbumId` to the URL query string + if (getAlbumId() != null) { + joiner.add(String.format("%sAlbumId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbumId())))); + } + + // add `AlbumPrimaryImageTag` to the URL query string + if (getAlbumPrimaryImageTag() != null) { + joiner.add(String.format("%sAlbumPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbumPrimaryImageTag())))); + } + + // add `SeriesPrimaryImageTag` to the URL query string + if (getSeriesPrimaryImageTag() != null) { + joiner.add(String.format("%sSeriesPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesPrimaryImageTag())))); + } + + // add `AlbumArtist` to the URL query string + if (getAlbumArtist() != null) { + joiner.add(String.format("%sAlbumArtist%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbumArtist())))); + } + + // add `AlbumArtists` to the URL query string + if (getAlbumArtists() != null) { + for (int i = 0; i < getAlbumArtists().size(); i++) { + if (getAlbumArtists().get(i) != null) { + joiner.add(getAlbumArtists().get(i).toUrlQueryString(String.format("%sAlbumArtists%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `SeasonName` to the URL query string + if (getSeasonName() != null) { + joiner.add(String.format("%sSeasonName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeasonName())))); + } + + // add `MediaStreams` to the URL query string + if (getMediaStreams() != null) { + for (int i = 0; i < getMediaStreams().size(); i++) { + if (getMediaStreams().get(i) != null) { + joiner.add(getMediaStreams().get(i).toUrlQueryString(String.format("%sMediaStreams%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `VideoType` to the URL query string + if (getVideoType() != null) { + joiner.add(String.format("%sVideoType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoType())))); + } + + // add `PartCount` to the URL query string + if (getPartCount() != null) { + joiner.add(String.format("%sPartCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPartCount())))); + } + + // add `MediaSourceCount` to the URL query string + if (getMediaSourceCount() != null) { + joiner.add(String.format("%sMediaSourceCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaSourceCount())))); + } + + // add `ImageTags` to the URL query string + if (getImageTags() != null) { + for (String _key : getImageTags().keySet()) { + joiner.add(String.format("%sImageTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getImageTags().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getImageTags().get(_key))))); + } + } + + // add `BackdropImageTags` to the URL query string + if (getBackdropImageTags() != null) { + for (int i = 0; i < getBackdropImageTags().size(); i++) { + joiner.add(String.format("%sBackdropImageTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getBackdropImageTags().get(i))))); + } + } + + // add `ScreenshotImageTags` to the URL query string + if (getScreenshotImageTags() != null) { + for (int i = 0; i < getScreenshotImageTags().size(); i++) { + joiner.add(String.format("%sScreenshotImageTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getScreenshotImageTags().get(i))))); + } + } + + // add `ParentLogoImageTag` to the URL query string + if (getParentLogoImageTag() != null) { + joiner.add(String.format("%sParentLogoImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentLogoImageTag())))); + } + + // add `ParentArtItemId` to the URL query string + if (getParentArtItemId() != null) { + joiner.add(String.format("%sParentArtItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentArtItemId())))); + } + + // add `ParentArtImageTag` to the URL query string + if (getParentArtImageTag() != null) { + joiner.add(String.format("%sParentArtImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentArtImageTag())))); + } + + // add `SeriesThumbImageTag` to the URL query string + if (getSeriesThumbImageTag() != null) { + joiner.add(String.format("%sSeriesThumbImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesThumbImageTag())))); + } + + // add `ImageBlurHashes` to the URL query string + if (getImageBlurHashes() != null) { + joiner.add(getImageBlurHashes().toUrlQueryString(prefix + "ImageBlurHashes" + suffix)); + } + + // add `SeriesStudio` to the URL query string + if (getSeriesStudio() != null) { + joiner.add(String.format("%sSeriesStudio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesStudio())))); + } + + // add `ParentThumbItemId` to the URL query string + if (getParentThumbItemId() != null) { + joiner.add(String.format("%sParentThumbItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentThumbItemId())))); + } + + // add `ParentThumbImageTag` to the URL query string + if (getParentThumbImageTag() != null) { + joiner.add(String.format("%sParentThumbImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentThumbImageTag())))); + } + + // add `ParentPrimaryImageItemId` to the URL query string + if (getParentPrimaryImageItemId() != null) { + joiner.add(String.format("%sParentPrimaryImageItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentPrimaryImageItemId())))); + } + + // add `ParentPrimaryImageTag` to the URL query string + if (getParentPrimaryImageTag() != null) { + joiner.add(String.format("%sParentPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentPrimaryImageTag())))); + } + + // add `Chapters` to the URL query string + if (getChapters() != null) { + for (int i = 0; i < getChapters().size(); i++) { + if (getChapters().get(i) != null) { + joiner.add(getChapters().get(i).toUrlQueryString(String.format("%sChapters%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Trickplay` to the URL query string + if (getTrickplay() != null) { + for (String _key : getTrickplay().keySet()) { + joiner.add(String.format("%sTrickplay%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getTrickplay().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getTrickplay().get(_key))))); + } + } + + // add `LocationType` to the URL query string + if (getLocationType() != null) { + joiner.add(String.format("%sLocationType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocationType())))); + } + + // add `IsoType` to the URL query string + if (getIsoType() != null) { + joiner.add(String.format("%sIsoType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsoType())))); + } + + // add `MediaType` to the URL query string + if (getMediaType() != null) { + joiner.add(String.format("%sMediaType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaType())))); + } + + // add `EndDate` to the URL query string + if (getEndDate() != null) { + joiner.add(String.format("%sEndDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndDate())))); + } + + // add `LockedFields` to the URL query string + if (getLockedFields() != null) { + for (int i = 0; i < getLockedFields().size(); i++) { + if (getLockedFields().get(i) != null) { + joiner.add(String.format("%sLockedFields%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLockedFields().get(i))))); + } + } + } + + // add `TrailerCount` to the URL query string + if (getTrailerCount() != null) { + joiner.add(String.format("%sTrailerCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTrailerCount())))); + } + + // add `MovieCount` to the URL query string + if (getMovieCount() != null) { + joiner.add(String.format("%sMovieCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMovieCount())))); + } + + // add `SeriesCount` to the URL query string + if (getSeriesCount() != null) { + joiner.add(String.format("%sSeriesCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesCount())))); + } + + // add `ProgramCount` to the URL query string + if (getProgramCount() != null) { + joiner.add(String.format("%sProgramCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProgramCount())))); + } + + // add `EpisodeCount` to the URL query string + if (getEpisodeCount() != null) { + joiner.add(String.format("%sEpisodeCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEpisodeCount())))); + } + + // add `SongCount` to the URL query string + if (getSongCount() != null) { + joiner.add(String.format("%sSongCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSongCount())))); + } + + // add `AlbumCount` to the URL query string + if (getAlbumCount() != null) { + joiner.add(String.format("%sAlbumCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbumCount())))); + } + + // add `ArtistCount` to the URL query string + if (getArtistCount() != null) { + joiner.add(String.format("%sArtistCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getArtistCount())))); + } + + // add `MusicVideoCount` to the URL query string + if (getMusicVideoCount() != null) { + joiner.add(String.format("%sMusicVideoCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMusicVideoCount())))); + } + + // add `LockData` to the URL query string + if (getLockData() != null) { + joiner.add(String.format("%sLockData%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLockData())))); + } + + // add `Width` to the URL query string + if (getWidth() != null) { + joiner.add(String.format("%sWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWidth())))); + } + + // add `Height` to the URL query string + if (getHeight() != null) { + joiner.add(String.format("%sHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHeight())))); + } + + // add `CameraMake` to the URL query string + if (getCameraMake() != null) { + joiner.add(String.format("%sCameraMake%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCameraMake())))); + } + + // add `CameraModel` to the URL query string + if (getCameraModel() != null) { + joiner.add(String.format("%sCameraModel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCameraModel())))); + } + + // add `Software` to the URL query string + if (getSoftware() != null) { + joiner.add(String.format("%sSoftware%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSoftware())))); + } + + // add `ExposureTime` to the URL query string + if (getExposureTime() != null) { + joiner.add(String.format("%sExposureTime%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExposureTime())))); + } + + // add `FocalLength` to the URL query string + if (getFocalLength() != null) { + joiner.add(String.format("%sFocalLength%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFocalLength())))); + } + + // add `ImageOrientation` to the URL query string + if (getImageOrientation() != null) { + joiner.add(String.format("%sImageOrientation%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageOrientation())))); + } + + // add `Aperture` to the URL query string + if (getAperture() != null) { + joiner.add(String.format("%sAperture%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAperture())))); + } + + // add `ShutterSpeed` to the URL query string + if (getShutterSpeed() != null) { + joiner.add(String.format("%sShutterSpeed%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getShutterSpeed())))); + } + + // add `Latitude` to the URL query string + if (getLatitude() != null) { + joiner.add(String.format("%sLatitude%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLatitude())))); + } + + // add `Longitude` to the URL query string + if (getLongitude() != null) { + joiner.add(String.format("%sLongitude%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLongitude())))); + } + + // add `Altitude` to the URL query string + if (getAltitude() != null) { + joiner.add(String.format("%sAltitude%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAltitude())))); + } + + // add `IsoSpeedRating` to the URL query string + if (getIsoSpeedRating() != null) { + joiner.add(String.format("%sIsoSpeedRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsoSpeedRating())))); + } + + // add `SeriesTimerId` to the URL query string + if (getSeriesTimerId() != null) { + joiner.add(String.format("%sSeriesTimerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesTimerId())))); + } + + // add `ProgramId` to the URL query string + if (getProgramId() != null) { + joiner.add(String.format("%sProgramId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProgramId())))); + } + + // add `ChannelPrimaryImageTag` to the URL query string + if (getChannelPrimaryImageTag() != null) { + joiner.add(String.format("%sChannelPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelPrimaryImageTag())))); + } + + // add `StartDate` to the URL query string + if (getStartDate() != null) { + joiner.add(String.format("%sStartDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartDate())))); + } + + // add `CompletionPercentage` to the URL query string + if (getCompletionPercentage() != null) { + joiner.add(String.format("%sCompletionPercentage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCompletionPercentage())))); + } + + // add `IsRepeat` to the URL query string + if (getIsRepeat() != null) { + joiner.add(String.format("%sIsRepeat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsRepeat())))); + } + + // add `EpisodeTitle` to the URL query string + if (getEpisodeTitle() != null) { + joiner.add(String.format("%sEpisodeTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEpisodeTitle())))); + } + + // add `ChannelType` to the URL query string + if (getChannelType() != null) { + joiner.add(String.format("%sChannelType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelType())))); + } + + // add `Audio` to the URL query string + if (getAudio() != null) { + joiner.add(String.format("%sAudio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudio())))); + } + + // add `IsMovie` to the URL query string + if (getIsMovie() != null) { + joiner.add(String.format("%sIsMovie%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsMovie())))); + } + + // add `IsSports` to the URL query string + if (getIsSports() != null) { + joiner.add(String.format("%sIsSports%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsSports())))); + } + + // add `IsSeries` to the URL query string + if (getIsSeries() != null) { + joiner.add(String.format("%sIsSeries%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsSeries())))); + } + + // add `IsLive` to the URL query string + if (getIsLive() != null) { + joiner.add(String.format("%sIsLive%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsLive())))); + } + + // add `IsNews` to the URL query string + if (getIsNews() != null) { + joiner.add(String.format("%sIsNews%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsNews())))); + } + + // add `IsKids` to the URL query string + if (getIsKids() != null) { + joiner.add(String.format("%sIsKids%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsKids())))); + } + + // add `IsPremiere` to the URL query string + if (getIsPremiere() != null) { + joiner.add(String.format("%sIsPremiere%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPremiere())))); + } + + // add `TimerId` to the URL query string + if (getTimerId() != null) { + joiner.add(String.format("%sTimerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTimerId())))); + } + + // add `NormalizationGain` to the URL query string + if (getNormalizationGain() != null) { + joiner.add(String.format("%sNormalizationGain%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getNormalizationGain())))); + } + + // add `CurrentProgram` to the URL query string + if (getCurrentProgram() != null) { + joiner.add(getCurrentProgram().toUrlQueryString(prefix + "CurrentProgram" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private BaseItemDto instance; + + public Builder() { + this(new BaseItemDto()); + } + + protected Builder(BaseItemDto instance) { + this.instance = instance; + } + + public BaseItemDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public BaseItemDto.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public BaseItemDto.Builder serverId(String serverId) { + this.instance.serverId = serverId; + return this; + } + + public BaseItemDto.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public BaseItemDto.Builder etag(String etag) { + this.instance.etag = etag; + return this; + } + + public BaseItemDto.Builder sourceType(String sourceType) { + this.instance.sourceType = sourceType; + return this; + } + + public BaseItemDto.Builder playlistItemId(String playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + public BaseItemDto.Builder dateCreated(OffsetDateTime dateCreated) { + this.instance.dateCreated = dateCreated; + return this; + } + + public BaseItemDto.Builder dateLastMediaAdded(OffsetDateTime dateLastMediaAdded) { + this.instance.dateLastMediaAdded = dateLastMediaAdded; + return this; + } + + public BaseItemDto.Builder extraType(ExtraType extraType) { + this.instance.extraType = extraType; + return this; + } + + public BaseItemDto.Builder airsBeforeSeasonNumber(Integer airsBeforeSeasonNumber) { + this.instance.airsBeforeSeasonNumber = airsBeforeSeasonNumber; + return this; + } + + public BaseItemDto.Builder airsAfterSeasonNumber(Integer airsAfterSeasonNumber) { + this.instance.airsAfterSeasonNumber = airsAfterSeasonNumber; + return this; + } + + public BaseItemDto.Builder airsBeforeEpisodeNumber(Integer airsBeforeEpisodeNumber) { + this.instance.airsBeforeEpisodeNumber = airsBeforeEpisodeNumber; + return this; + } + + public BaseItemDto.Builder canDelete(Boolean canDelete) { + this.instance.canDelete = canDelete; + return this; + } + + public BaseItemDto.Builder canDownload(Boolean canDownload) { + this.instance.canDownload = canDownload; + return this; + } + + public BaseItemDto.Builder hasLyrics(Boolean hasLyrics) { + this.instance.hasLyrics = hasLyrics; + return this; + } + + public BaseItemDto.Builder hasSubtitles(Boolean hasSubtitles) { + this.instance.hasSubtitles = hasSubtitles; + return this; + } + + public BaseItemDto.Builder preferredMetadataLanguage(String preferredMetadataLanguage) { + this.instance.preferredMetadataLanguage = preferredMetadataLanguage; + return this; + } + + public BaseItemDto.Builder preferredMetadataCountryCode(String preferredMetadataCountryCode) { + this.instance.preferredMetadataCountryCode = preferredMetadataCountryCode; + return this; + } + + public BaseItemDto.Builder container(String container) { + this.instance.container = container; + return this; + } + + public BaseItemDto.Builder sortName(String sortName) { + this.instance.sortName = sortName; + return this; + } + + public BaseItemDto.Builder forcedSortName(String forcedSortName) { + this.instance.forcedSortName = forcedSortName; + return this; + } + + public BaseItemDto.Builder video3DFormat(Video3DFormat video3DFormat) { + this.instance.video3DFormat = video3DFormat; + return this; + } + + public BaseItemDto.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public BaseItemDto.Builder externalUrls(List externalUrls) { + this.instance.externalUrls = externalUrls; + return this; + } + + public BaseItemDto.Builder mediaSources(List mediaSources) { + this.instance.mediaSources = mediaSources; + return this; + } + + public BaseItemDto.Builder criticRating(Float criticRating) { + this.instance.criticRating = criticRating; + return this; + } + + public BaseItemDto.Builder productionLocations(List productionLocations) { + this.instance.productionLocations = productionLocations; + return this; + } + + public BaseItemDto.Builder path(String path) { + this.instance.path = path; + return this; + } + + public BaseItemDto.Builder enableMediaSourceDisplay(Boolean enableMediaSourceDisplay) { + this.instance.enableMediaSourceDisplay = enableMediaSourceDisplay; + return this; + } + + public BaseItemDto.Builder officialRating(String officialRating) { + this.instance.officialRating = officialRating; + return this; + } + + public BaseItemDto.Builder customRating(String customRating) { + this.instance.customRating = customRating; + return this; + } + + public BaseItemDto.Builder channelId(UUID channelId) { + this.instance.channelId = channelId; + return this; + } + + public BaseItemDto.Builder channelName(String channelName) { + this.instance.channelName = channelName; + return this; + } + + public BaseItemDto.Builder overview(String overview) { + this.instance.overview = overview; + return this; + } + + public BaseItemDto.Builder taglines(List taglines) { + this.instance.taglines = taglines; + return this; + } + + public BaseItemDto.Builder genres(List genres) { + this.instance.genres = genres; + return this; + } + + public BaseItemDto.Builder communityRating(Float communityRating) { + this.instance.communityRating = communityRating; + return this; + } + + public BaseItemDto.Builder cumulativeRunTimeTicks(Long cumulativeRunTimeTicks) { + this.instance.cumulativeRunTimeTicks = cumulativeRunTimeTicks; + return this; + } + + public BaseItemDto.Builder runTimeTicks(Long runTimeTicks) { + this.instance.runTimeTicks = runTimeTicks; + return this; + } + + public BaseItemDto.Builder playAccess(PlayAccess playAccess) { + this.instance.playAccess = playAccess; + return this; + } + + public BaseItemDto.Builder aspectRatio(String aspectRatio) { + this.instance.aspectRatio = aspectRatio; + return this; + } + + public BaseItemDto.Builder productionYear(Integer productionYear) { + this.instance.productionYear = productionYear; + return this; + } + + public BaseItemDto.Builder isPlaceHolder(Boolean isPlaceHolder) { + this.instance.isPlaceHolder = isPlaceHolder; + return this; + } + + public BaseItemDto.Builder number(String number) { + this.instance.number = number; + return this; + } + + public BaseItemDto.Builder channelNumber(String channelNumber) { + this.instance.channelNumber = channelNumber; + return this; + } + + public BaseItemDto.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public BaseItemDto.Builder indexNumberEnd(Integer indexNumberEnd) { + this.instance.indexNumberEnd = indexNumberEnd; + return this; + } + + public BaseItemDto.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public BaseItemDto.Builder remoteTrailers(List remoteTrailers) { + this.instance.remoteTrailers = remoteTrailers; + return this; + } + + public BaseItemDto.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public BaseItemDto.Builder isHD(Boolean isHD) { + this.instance.isHD = isHD; + return this; + } + + public BaseItemDto.Builder isFolder(Boolean isFolder) { + this.instance.isFolder = isFolder; + return this; + } + + public BaseItemDto.Builder parentId(UUID parentId) { + this.instance.parentId = parentId; + return this; + } + + public BaseItemDto.Builder type(BaseItemKind type) { + this.instance.type = type; + return this; + } + + public BaseItemDto.Builder people(List people) { + this.instance.people = people; + return this; + } + + public BaseItemDto.Builder studios(List studios) { + this.instance.studios = studios; + return this; + } + + public BaseItemDto.Builder genreItems(List genreItems) { + this.instance.genreItems = genreItems; + return this; + } + + public BaseItemDto.Builder parentLogoItemId(UUID parentLogoItemId) { + this.instance.parentLogoItemId = parentLogoItemId; + return this; + } + + public BaseItemDto.Builder parentBackdropItemId(UUID parentBackdropItemId) { + this.instance.parentBackdropItemId = parentBackdropItemId; + return this; + } + + public BaseItemDto.Builder parentBackdropImageTags(List parentBackdropImageTags) { + this.instance.parentBackdropImageTags = parentBackdropImageTags; + return this; + } + + public BaseItemDto.Builder localTrailerCount(Integer localTrailerCount) { + this.instance.localTrailerCount = localTrailerCount; + return this; + } + + public BaseItemDto.Builder userData(UserItemDataDto userData) { + this.instance.userData = userData; + return this; + } + + public BaseItemDto.Builder recursiveItemCount(Integer recursiveItemCount) { + this.instance.recursiveItemCount = recursiveItemCount; + return this; + } + + public BaseItemDto.Builder childCount(Integer childCount) { + this.instance.childCount = childCount; + return this; + } + + public BaseItemDto.Builder seriesName(String seriesName) { + this.instance.seriesName = seriesName; + return this; + } + + public BaseItemDto.Builder seriesId(UUID seriesId) { + this.instance.seriesId = seriesId; + return this; + } + + public BaseItemDto.Builder seasonId(UUID seasonId) { + this.instance.seasonId = seasonId; + return this; + } + + public BaseItemDto.Builder specialFeatureCount(Integer specialFeatureCount) { + this.instance.specialFeatureCount = specialFeatureCount; + return this; + } + + public BaseItemDto.Builder displayPreferencesId(String displayPreferencesId) { + this.instance.displayPreferencesId = displayPreferencesId; + return this; + } + + public BaseItemDto.Builder status(String status) { + this.instance.status = status; + return this; + } + + public BaseItemDto.Builder airTime(String airTime) { + this.instance.airTime = airTime; + return this; + } + + public BaseItemDto.Builder airDays(List airDays) { + this.instance.airDays = airDays; + return this; + } + + public BaseItemDto.Builder tags(List tags) { + this.instance.tags = tags; + return this; + } + + public BaseItemDto.Builder primaryImageAspectRatio(Double primaryImageAspectRatio) { + this.instance.primaryImageAspectRatio = primaryImageAspectRatio; + return this; + } + + public BaseItemDto.Builder artists(List artists) { + this.instance.artists = artists; + return this; + } + + public BaseItemDto.Builder artistItems(List artistItems) { + this.instance.artistItems = artistItems; + return this; + } + + public BaseItemDto.Builder album(String album) { + this.instance.album = album; + return this; + } + + public BaseItemDto.Builder collectionType(CollectionType collectionType) { + this.instance.collectionType = collectionType; + return this; + } + + public BaseItemDto.Builder displayOrder(String displayOrder) { + this.instance.displayOrder = displayOrder; + return this; + } + + public BaseItemDto.Builder albumId(UUID albumId) { + this.instance.albumId = albumId; + return this; + } + + public BaseItemDto.Builder albumPrimaryImageTag(String albumPrimaryImageTag) { + this.instance.albumPrimaryImageTag = albumPrimaryImageTag; + return this; + } + + public BaseItemDto.Builder seriesPrimaryImageTag(String seriesPrimaryImageTag) { + this.instance.seriesPrimaryImageTag = seriesPrimaryImageTag; + return this; + } + + public BaseItemDto.Builder albumArtist(String albumArtist) { + this.instance.albumArtist = albumArtist; + return this; + } + + public BaseItemDto.Builder albumArtists(List albumArtists) { + this.instance.albumArtists = albumArtists; + return this; + } + + public BaseItemDto.Builder seasonName(String seasonName) { + this.instance.seasonName = seasonName; + return this; + } + + public BaseItemDto.Builder mediaStreams(List mediaStreams) { + this.instance.mediaStreams = mediaStreams; + return this; + } + + public BaseItemDto.Builder videoType(VideoType videoType) { + this.instance.videoType = videoType; + return this; + } + + public BaseItemDto.Builder partCount(Integer partCount) { + this.instance.partCount = partCount; + return this; + } + + public BaseItemDto.Builder mediaSourceCount(Integer mediaSourceCount) { + this.instance.mediaSourceCount = mediaSourceCount; + return this; + } + + public BaseItemDto.Builder imageTags(Map imageTags) { + this.instance.imageTags = imageTags; + return this; + } + + public BaseItemDto.Builder backdropImageTags(List backdropImageTags) { + this.instance.backdropImageTags = backdropImageTags; + return this; + } + + public BaseItemDto.Builder screenshotImageTags(List screenshotImageTags) { + this.instance.screenshotImageTags = screenshotImageTags; + return this; + } + + public BaseItemDto.Builder parentLogoImageTag(String parentLogoImageTag) { + this.instance.parentLogoImageTag = parentLogoImageTag; + return this; + } + + public BaseItemDto.Builder parentArtItemId(UUID parentArtItemId) { + this.instance.parentArtItemId = parentArtItemId; + return this; + } + + public BaseItemDto.Builder parentArtImageTag(String parentArtImageTag) { + this.instance.parentArtImageTag = parentArtImageTag; + return this; + } + + public BaseItemDto.Builder seriesThumbImageTag(String seriesThumbImageTag) { + this.instance.seriesThumbImageTag = seriesThumbImageTag; + return this; + } + + public BaseItemDto.Builder imageBlurHashes(BaseItemDtoImageBlurHashes imageBlurHashes) { + this.instance.imageBlurHashes = imageBlurHashes; + return this; + } + + public BaseItemDto.Builder seriesStudio(String seriesStudio) { + this.instance.seriesStudio = seriesStudio; + return this; + } + + public BaseItemDto.Builder parentThumbItemId(UUID parentThumbItemId) { + this.instance.parentThumbItemId = parentThumbItemId; + return this; + } + + public BaseItemDto.Builder parentThumbImageTag(String parentThumbImageTag) { + this.instance.parentThumbImageTag = parentThumbImageTag; + return this; + } + + public BaseItemDto.Builder parentPrimaryImageItemId(String parentPrimaryImageItemId) { + this.instance.parentPrimaryImageItemId = parentPrimaryImageItemId; + return this; + } + + public BaseItemDto.Builder parentPrimaryImageTag(String parentPrimaryImageTag) { + this.instance.parentPrimaryImageTag = parentPrimaryImageTag; + return this; + } + + public BaseItemDto.Builder chapters(List chapters) { + this.instance.chapters = chapters; + return this; + } + + public BaseItemDto.Builder trickplay(Map> trickplay) { + this.instance.trickplay = trickplay; + return this; + } + + public BaseItemDto.Builder locationType(LocationType locationType) { + this.instance.locationType = locationType; + return this; + } + + public BaseItemDto.Builder isoType(IsoType isoType) { + this.instance.isoType = isoType; + return this; + } + + public BaseItemDto.Builder mediaType(MediaType mediaType) { + this.instance.mediaType = mediaType; + return this; + } + + public BaseItemDto.Builder endDate(OffsetDateTime endDate) { + this.instance.endDate = endDate; + return this; + } + + public BaseItemDto.Builder lockedFields(List lockedFields) { + this.instance.lockedFields = lockedFields; + return this; + } + + public BaseItemDto.Builder trailerCount(Integer trailerCount) { + this.instance.trailerCount = trailerCount; + return this; + } + + public BaseItemDto.Builder movieCount(Integer movieCount) { + this.instance.movieCount = movieCount; + return this; + } + + public BaseItemDto.Builder seriesCount(Integer seriesCount) { + this.instance.seriesCount = seriesCount; + return this; + } + + public BaseItemDto.Builder programCount(Integer programCount) { + this.instance.programCount = programCount; + return this; + } + + public BaseItemDto.Builder episodeCount(Integer episodeCount) { + this.instance.episodeCount = episodeCount; + return this; + } + + public BaseItemDto.Builder songCount(Integer songCount) { + this.instance.songCount = songCount; + return this; + } + + public BaseItemDto.Builder albumCount(Integer albumCount) { + this.instance.albumCount = albumCount; + return this; + } + + public BaseItemDto.Builder artistCount(Integer artistCount) { + this.instance.artistCount = artistCount; + return this; + } + + public BaseItemDto.Builder musicVideoCount(Integer musicVideoCount) { + this.instance.musicVideoCount = musicVideoCount; + return this; + } + + public BaseItemDto.Builder lockData(Boolean lockData) { + this.instance.lockData = lockData; + return this; + } + + public BaseItemDto.Builder width(Integer width) { + this.instance.width = width; + return this; + } + + public BaseItemDto.Builder height(Integer height) { + this.instance.height = height; + return this; + } + + public BaseItemDto.Builder cameraMake(String cameraMake) { + this.instance.cameraMake = cameraMake; + return this; + } + + public BaseItemDto.Builder cameraModel(String cameraModel) { + this.instance.cameraModel = cameraModel; + return this; + } + + public BaseItemDto.Builder software(String software) { + this.instance.software = software; + return this; + } + + public BaseItemDto.Builder exposureTime(Double exposureTime) { + this.instance.exposureTime = exposureTime; + return this; + } + + public BaseItemDto.Builder focalLength(Double focalLength) { + this.instance.focalLength = focalLength; + return this; + } + + public BaseItemDto.Builder imageOrientation(ImageOrientation imageOrientation) { + this.instance.imageOrientation = imageOrientation; + return this; + } + + public BaseItemDto.Builder aperture(Double aperture) { + this.instance.aperture = aperture; + return this; + } + + public BaseItemDto.Builder shutterSpeed(Double shutterSpeed) { + this.instance.shutterSpeed = shutterSpeed; + return this; + } + + public BaseItemDto.Builder latitude(Double latitude) { + this.instance.latitude = latitude; + return this; + } + + public BaseItemDto.Builder longitude(Double longitude) { + this.instance.longitude = longitude; + return this; + } + + public BaseItemDto.Builder altitude(Double altitude) { + this.instance.altitude = altitude; + return this; + } + + public BaseItemDto.Builder isoSpeedRating(Integer isoSpeedRating) { + this.instance.isoSpeedRating = isoSpeedRating; + return this; + } + + public BaseItemDto.Builder seriesTimerId(String seriesTimerId) { + this.instance.seriesTimerId = seriesTimerId; + return this; + } + + public BaseItemDto.Builder programId(String programId) { + this.instance.programId = programId; + return this; + } + + public BaseItemDto.Builder channelPrimaryImageTag(String channelPrimaryImageTag) { + this.instance.channelPrimaryImageTag = channelPrimaryImageTag; + return this; + } + + public BaseItemDto.Builder startDate(OffsetDateTime startDate) { + this.instance.startDate = startDate; + return this; + } + + public BaseItemDto.Builder completionPercentage(Double completionPercentage) { + this.instance.completionPercentage = completionPercentage; + return this; + } + + public BaseItemDto.Builder isRepeat(Boolean isRepeat) { + this.instance.isRepeat = isRepeat; + return this; + } + + public BaseItemDto.Builder episodeTitle(String episodeTitle) { + this.instance.episodeTitle = episodeTitle; + return this; + } + + public BaseItemDto.Builder channelType(ChannelType channelType) { + this.instance.channelType = channelType; + return this; + } + + public BaseItemDto.Builder audio(ProgramAudio audio) { + this.instance.audio = audio; + return this; + } + + public BaseItemDto.Builder isMovie(Boolean isMovie) { + this.instance.isMovie = isMovie; + return this; + } + + public BaseItemDto.Builder isSports(Boolean isSports) { + this.instance.isSports = isSports; + return this; + } + + public BaseItemDto.Builder isSeries(Boolean isSeries) { + this.instance.isSeries = isSeries; + return this; + } + + public BaseItemDto.Builder isLive(Boolean isLive) { + this.instance.isLive = isLive; + return this; + } + + public BaseItemDto.Builder isNews(Boolean isNews) { + this.instance.isNews = isNews; + return this; + } + + public BaseItemDto.Builder isKids(Boolean isKids) { + this.instance.isKids = isKids; + return this; + } + + public BaseItemDto.Builder isPremiere(Boolean isPremiere) { + this.instance.isPremiere = isPremiere; + return this; + } + + public BaseItemDto.Builder timerId(String timerId) { + this.instance.timerId = timerId; + return this; + } + + public BaseItemDto.Builder normalizationGain(Float normalizationGain) { + this.instance.normalizationGain = normalizationGain; + return this; + } + + public BaseItemDto.Builder currentProgram(BaseItemDto currentProgram) { + this.instance.currentProgram = currentProgram; + return this; + } + + /** + * returns a built BaseItemDto instance. + * + * The builder is not reusable. + */ + public BaseItemDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BaseItemDto.Builder builder() { + return new BaseItemDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BaseItemDto.Builder toBuilder() { + return new BaseItemDto.Builder().name(getName()).originalTitle(getOriginalTitle()).serverId(getServerId()) + .id(getId()).etag(getEtag()).sourceType(getSourceType()).playlistItemId(getPlaylistItemId()) + .dateCreated(getDateCreated()).dateLastMediaAdded(getDateLastMediaAdded()).extraType(getExtraType()) + .airsBeforeSeasonNumber(getAirsBeforeSeasonNumber()).airsAfterSeasonNumber(getAirsAfterSeasonNumber()) + .airsBeforeEpisodeNumber(getAirsBeforeEpisodeNumber()).canDelete(getCanDelete()) + .canDownload(getCanDownload()).hasLyrics(getHasLyrics()).hasSubtitles(getHasSubtitles()) + .preferredMetadataLanguage(getPreferredMetadataLanguage()) + .preferredMetadataCountryCode(getPreferredMetadataCountryCode()).container(getContainer()) + .sortName(getSortName()).forcedSortName(getForcedSortName()).video3DFormat(getVideo3DFormat()) + .premiereDate(getPremiereDate()).externalUrls(getExternalUrls()).mediaSources(getMediaSources()) + .criticRating(getCriticRating()).productionLocations(getProductionLocations()).path(getPath()) + .enableMediaSourceDisplay(getEnableMediaSourceDisplay()).officialRating(getOfficialRating()) + .customRating(getCustomRating()).channelId(getChannelId()).channelName(getChannelName()) + .overview(getOverview()).taglines(getTaglines()).genres(getGenres()) + .communityRating(getCommunityRating()).cumulativeRunTimeTicks(getCumulativeRunTimeTicks()) + .runTimeTicks(getRunTimeTicks()).playAccess(getPlayAccess()).aspectRatio(getAspectRatio()) + .productionYear(getProductionYear()).isPlaceHolder(getIsPlaceHolder()).number(getNumber()) + .channelNumber(getChannelNumber()).indexNumber(getIndexNumber()).indexNumberEnd(getIndexNumberEnd()) + .parentIndexNumber(getParentIndexNumber()).remoteTrailers(getRemoteTrailers()) + .providerIds(getProviderIds()).isHD(getIsHD()).isFolder(getIsFolder()).parentId(getParentId()) + .type(getType()).people(getPeople()).studios(getStudios()).genreItems(getGenreItems()) + .parentLogoItemId(getParentLogoItemId()).parentBackdropItemId(getParentBackdropItemId()) + .parentBackdropImageTags(getParentBackdropImageTags()).localTrailerCount(getLocalTrailerCount()) + .userData(getUserData()).recursiveItemCount(getRecursiveItemCount()).childCount(getChildCount()) + .seriesName(getSeriesName()).seriesId(getSeriesId()).seasonId(getSeasonId()) + .specialFeatureCount(getSpecialFeatureCount()).displayPreferencesId(getDisplayPreferencesId()) + .status(getStatus()).airTime(getAirTime()).airDays(getAirDays()).tags(getTags()) + .primaryImageAspectRatio(getPrimaryImageAspectRatio()).artists(getArtists()) + .artistItems(getArtistItems()).album(getAlbum()).collectionType(getCollectionType()) + .displayOrder(getDisplayOrder()).albumId(getAlbumId()).albumPrimaryImageTag(getAlbumPrimaryImageTag()) + .seriesPrimaryImageTag(getSeriesPrimaryImageTag()).albumArtist(getAlbumArtist()) + .albumArtists(getAlbumArtists()).seasonName(getSeasonName()).mediaStreams(getMediaStreams()) + .videoType(getVideoType()).partCount(getPartCount()).mediaSourceCount(getMediaSourceCount()) + .imageTags(getImageTags()).backdropImageTags(getBackdropImageTags()) + .screenshotImageTags(getScreenshotImageTags()).parentLogoImageTag(getParentLogoImageTag()) + .parentArtItemId(getParentArtItemId()).parentArtImageTag(getParentArtImageTag()) + .seriesThumbImageTag(getSeriesThumbImageTag()).imageBlurHashes(getImageBlurHashes()) + .seriesStudio(getSeriesStudio()).parentThumbItemId(getParentThumbItemId()) + .parentThumbImageTag(getParentThumbImageTag()).parentPrimaryImageItemId(getParentPrimaryImageItemId()) + .parentPrimaryImageTag(getParentPrimaryImageTag()).chapters(getChapters()).trickplay(getTrickplay()) + .locationType(getLocationType()).isoType(getIsoType()).mediaType(getMediaType()).endDate(getEndDate()) + .lockedFields(getLockedFields()).trailerCount(getTrailerCount()).movieCount(getMovieCount()) + .seriesCount(getSeriesCount()).programCount(getProgramCount()).episodeCount(getEpisodeCount()) + .songCount(getSongCount()).albumCount(getAlbumCount()).artistCount(getArtistCount()) + .musicVideoCount(getMusicVideoCount()).lockData(getLockData()).width(getWidth()).height(getHeight()) + .cameraMake(getCameraMake()).cameraModel(getCameraModel()).software(getSoftware()) + .exposureTime(getExposureTime()).focalLength(getFocalLength()).imageOrientation(getImageOrientation()) + .aperture(getAperture()).shutterSpeed(getShutterSpeed()).latitude(getLatitude()) + .longitude(getLongitude()).altitude(getAltitude()).isoSpeedRating(getIsoSpeedRating()) + .seriesTimerId(getSeriesTimerId()).programId(getProgramId()) + .channelPrimaryImageTag(getChannelPrimaryImageTag()).startDate(getStartDate()) + .completionPercentage(getCompletionPercentage()).isRepeat(getIsRepeat()).episodeTitle(getEpisodeTitle()) + .channelType(getChannelType()).audio(getAudio()).isMovie(getIsMovie()).isSports(getIsSports()) + .isSeries(getIsSeries()).isLive(getIsLive()).isNews(getIsNews()).isKids(getIsKids()) + .isPremiere(getIsPremiere()).timerId(getTimerId()).normalizationGain(getNormalizationGain()) + .currentProgram(getCurrentProgram()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemDtoImageBlurHashes.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemDtoImageBlurHashes.java new file mode 100644 index 0000000000000..f06766dee0ab8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemDtoImageBlurHashes.java @@ -0,0 +1,829 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Gets or sets the blurhashes for the image tags. Maps image type to dictionary mapping image tag to blurhash value. + */ +@JsonPropertyOrder({ BaseItemDtoImageBlurHashes.JSON_PROPERTY_PRIMARY, BaseItemDtoImageBlurHashes.JSON_PROPERTY_ART, + BaseItemDtoImageBlurHashes.JSON_PROPERTY_BACKDROP, BaseItemDtoImageBlurHashes.JSON_PROPERTY_BANNER, + BaseItemDtoImageBlurHashes.JSON_PROPERTY_LOGO, BaseItemDtoImageBlurHashes.JSON_PROPERTY_THUMB, + BaseItemDtoImageBlurHashes.JSON_PROPERTY_DISC, BaseItemDtoImageBlurHashes.JSON_PROPERTY_BOX, + BaseItemDtoImageBlurHashes.JSON_PROPERTY_SCREENSHOT, BaseItemDtoImageBlurHashes.JSON_PROPERTY_MENU, + BaseItemDtoImageBlurHashes.JSON_PROPERTY_CHAPTER, BaseItemDtoImageBlurHashes.JSON_PROPERTY_BOX_REAR, + BaseItemDtoImageBlurHashes.JSON_PROPERTY_PROFILE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BaseItemDtoImageBlurHashes { + public static final String JSON_PROPERTY_PRIMARY = "Primary"; + @org.eclipse.jdt.annotation.NonNull + private Map primary = new HashMap<>(); + + public static final String JSON_PROPERTY_ART = "Art"; + @org.eclipse.jdt.annotation.NonNull + private Map art = new HashMap<>(); + + public static final String JSON_PROPERTY_BACKDROP = "Backdrop"; + @org.eclipse.jdt.annotation.NonNull + private Map backdrop = new HashMap<>(); + + public static final String JSON_PROPERTY_BANNER = "Banner"; + @org.eclipse.jdt.annotation.NonNull + private Map banner = new HashMap<>(); + + public static final String JSON_PROPERTY_LOGO = "Logo"; + @org.eclipse.jdt.annotation.NonNull + private Map logo = new HashMap<>(); + + public static final String JSON_PROPERTY_THUMB = "Thumb"; + @org.eclipse.jdt.annotation.NonNull + private Map thumb = new HashMap<>(); + + public static final String JSON_PROPERTY_DISC = "Disc"; + @org.eclipse.jdt.annotation.NonNull + private Map disc = new HashMap<>(); + + public static final String JSON_PROPERTY_BOX = "Box"; + @org.eclipse.jdt.annotation.NonNull + private Map box = new HashMap<>(); + + public static final String JSON_PROPERTY_SCREENSHOT = "Screenshot"; + @org.eclipse.jdt.annotation.NonNull + private Map screenshot = new HashMap<>(); + + public static final String JSON_PROPERTY_MENU = "Menu"; + @org.eclipse.jdt.annotation.NonNull + private Map menu = new HashMap<>(); + + public static final String JSON_PROPERTY_CHAPTER = "Chapter"; + @org.eclipse.jdt.annotation.NonNull + private Map chapter = new HashMap<>(); + + public static final String JSON_PROPERTY_BOX_REAR = "BoxRear"; + @org.eclipse.jdt.annotation.NonNull + private Map boxRear = new HashMap<>(); + + public static final String JSON_PROPERTY_PROFILE = "Profile"; + @org.eclipse.jdt.annotation.NonNull + private Map profile = new HashMap<>(); + + public BaseItemDtoImageBlurHashes() { + } + + public BaseItemDtoImageBlurHashes primary(@org.eclipse.jdt.annotation.NonNull Map primary) { + this.primary = primary; + return this; + } + + public BaseItemDtoImageBlurHashes putPrimaryItem(String key, String primaryItem) { + if (this.primary == null) { + this.primary = new HashMap<>(); + } + this.primary.put(key, primaryItem); + return this; + } + + /** + * Get primary + * + * @return primary + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getPrimary() { + return primary; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimary(@org.eclipse.jdt.annotation.NonNull Map primary) { + this.primary = primary; + } + + public BaseItemDtoImageBlurHashes art(@org.eclipse.jdt.annotation.NonNull Map art) { + this.art = art; + return this; + } + + public BaseItemDtoImageBlurHashes putArtItem(String key, String artItem) { + if (this.art == null) { + this.art = new HashMap<>(); + } + this.art.put(key, artItem); + return this; + } + + /** + * Get art + * + * @return art + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getArt() { + return art; + } + + @JsonProperty(JSON_PROPERTY_ART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArt(@org.eclipse.jdt.annotation.NonNull Map art) { + this.art = art; + } + + public BaseItemDtoImageBlurHashes backdrop(@org.eclipse.jdt.annotation.NonNull Map backdrop) { + this.backdrop = backdrop; + return this; + } + + public BaseItemDtoImageBlurHashes putBackdropItem(String key, String backdropItem) { + if (this.backdrop == null) { + this.backdrop = new HashMap<>(); + } + this.backdrop.put(key, backdropItem); + return this; + } + + /** + * Get backdrop + * + * @return backdrop + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BACKDROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBackdrop() { + return backdrop; + } + + @JsonProperty(JSON_PROPERTY_BACKDROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBackdrop(@org.eclipse.jdt.annotation.NonNull Map backdrop) { + this.backdrop = backdrop; + } + + public BaseItemDtoImageBlurHashes banner(@org.eclipse.jdt.annotation.NonNull Map banner) { + this.banner = banner; + return this; + } + + public BaseItemDtoImageBlurHashes putBannerItem(String key, String bannerItem) { + if (this.banner == null) { + this.banner = new HashMap<>(); + } + this.banner.put(key, bannerItem); + return this; + } + + /** + * Get banner + * + * @return banner + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BANNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBanner() { + return banner; + } + + @JsonProperty(JSON_PROPERTY_BANNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBanner(@org.eclipse.jdt.annotation.NonNull Map banner) { + this.banner = banner; + } + + public BaseItemDtoImageBlurHashes logo(@org.eclipse.jdt.annotation.NonNull Map logo) { + this.logo = logo; + return this; + } + + public BaseItemDtoImageBlurHashes putLogoItem(String key, String logoItem) { + if (this.logo == null) { + this.logo = new HashMap<>(); + } + this.logo.put(key, logoItem); + return this; + } + + /** + * Get logo + * + * @return logo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOGO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getLogo() { + return logo; + } + + @JsonProperty(JSON_PROPERTY_LOGO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogo(@org.eclipse.jdt.annotation.NonNull Map logo) { + this.logo = logo; + } + + public BaseItemDtoImageBlurHashes thumb(@org.eclipse.jdt.annotation.NonNull Map thumb) { + this.thumb = thumb; + return this; + } + + public BaseItemDtoImageBlurHashes putThumbItem(String key, String thumbItem) { + if (this.thumb == null) { + this.thumb = new HashMap<>(); + } + this.thumb.put(key, thumbItem); + return this; + } + + /** + * Get thumb + * + * @return thumb + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THUMB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getThumb() { + return thumb; + } + + @JsonProperty(JSON_PROPERTY_THUMB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThumb(@org.eclipse.jdt.annotation.NonNull Map thumb) { + this.thumb = thumb; + } + + public BaseItemDtoImageBlurHashes disc(@org.eclipse.jdt.annotation.NonNull Map disc) { + this.disc = disc; + return this; + } + + public BaseItemDtoImageBlurHashes putDiscItem(String key, String discItem) { + if (this.disc == null) { + this.disc = new HashMap<>(); + } + this.disc.put(key, discItem); + return this; + } + + /** + * Get disc + * + * @return disc + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDisc() { + return disc; + } + + @JsonProperty(JSON_PROPERTY_DISC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisc(@org.eclipse.jdt.annotation.NonNull Map disc) { + this.disc = disc; + } + + public BaseItemDtoImageBlurHashes box(@org.eclipse.jdt.annotation.NonNull Map box) { + this.box = box; + return this; + } + + public BaseItemDtoImageBlurHashes putBoxItem(String key, String boxItem) { + if (this.box == null) { + this.box = new HashMap<>(); + } + this.box.put(key, boxItem); + return this; + } + + /** + * Get box + * + * @return box + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BOX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBox() { + return box; + } + + @JsonProperty(JSON_PROPERTY_BOX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBox(@org.eclipse.jdt.annotation.NonNull Map box) { + this.box = box; + } + + public BaseItemDtoImageBlurHashes screenshot(@org.eclipse.jdt.annotation.NonNull Map screenshot) { + this.screenshot = screenshot; + return this; + } + + public BaseItemDtoImageBlurHashes putScreenshotItem(String key, String screenshotItem) { + if (this.screenshot == null) { + this.screenshot = new HashMap<>(); + } + this.screenshot.put(key, screenshotItem); + return this; + } + + /** + * Get screenshot + * + * @return screenshot + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SCREENSHOT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getScreenshot() { + return screenshot; + } + + @JsonProperty(JSON_PROPERTY_SCREENSHOT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScreenshot(@org.eclipse.jdt.annotation.NonNull Map screenshot) { + this.screenshot = screenshot; + } + + public BaseItemDtoImageBlurHashes menu(@org.eclipse.jdt.annotation.NonNull Map menu) { + this.menu = menu; + return this; + } + + public BaseItemDtoImageBlurHashes putMenuItem(String key, String menuItem) { + if (this.menu == null) { + this.menu = new HashMap<>(); + } + this.menu.put(key, menuItem); + return this; + } + + /** + * Get menu + * + * @return menu + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MENU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMenu() { + return menu; + } + + @JsonProperty(JSON_PROPERTY_MENU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMenu(@org.eclipse.jdt.annotation.NonNull Map menu) { + this.menu = menu; + } + + public BaseItemDtoImageBlurHashes chapter(@org.eclipse.jdt.annotation.NonNull Map chapter) { + this.chapter = chapter; + return this; + } + + public BaseItemDtoImageBlurHashes putChapterItem(String key, String chapterItem) { + if (this.chapter == null) { + this.chapter = new HashMap<>(); + } + this.chapter.put(key, chapterItem); + return this; + } + + /** + * Get chapter + * + * @return chapter + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHAPTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getChapter() { + return chapter; + } + + @JsonProperty(JSON_PROPERTY_CHAPTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChapter(@org.eclipse.jdt.annotation.NonNull Map chapter) { + this.chapter = chapter; + } + + public BaseItemDtoImageBlurHashes boxRear(@org.eclipse.jdt.annotation.NonNull Map boxRear) { + this.boxRear = boxRear; + return this; + } + + public BaseItemDtoImageBlurHashes putBoxRearItem(String key, String boxRearItem) { + if (this.boxRear == null) { + this.boxRear = new HashMap<>(); + } + this.boxRear.put(key, boxRearItem); + return this; + } + + /** + * Get boxRear + * + * @return boxRear + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BOX_REAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBoxRear() { + return boxRear; + } + + @JsonProperty(JSON_PROPERTY_BOX_REAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBoxRear(@org.eclipse.jdt.annotation.NonNull Map boxRear) { + this.boxRear = boxRear; + } + + public BaseItemDtoImageBlurHashes profile(@org.eclipse.jdt.annotation.NonNull Map profile) { + this.profile = profile; + return this; + } + + public BaseItemDtoImageBlurHashes putProfileItem(String key, String profileItem) { + if (this.profile == null) { + this.profile = new HashMap<>(); + } + this.profile.put(key, profileItem); + return this; + } + + /** + * Get profile + * + * @return profile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProfile() { + return profile; + } + + @JsonProperty(JSON_PROPERTY_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProfile(@org.eclipse.jdt.annotation.NonNull Map profile) { + this.profile = profile; + } + + /** + * Return true if this BaseItemDto_ImageBlurHashes object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseItemDtoImageBlurHashes baseItemDtoImageBlurHashes = (BaseItemDtoImageBlurHashes) o; + return Objects.equals(this.primary, baseItemDtoImageBlurHashes.primary) + && Objects.equals(this.art, baseItemDtoImageBlurHashes.art) + && Objects.equals(this.backdrop, baseItemDtoImageBlurHashes.backdrop) + && Objects.equals(this.banner, baseItemDtoImageBlurHashes.banner) + && Objects.equals(this.logo, baseItemDtoImageBlurHashes.logo) + && Objects.equals(this.thumb, baseItemDtoImageBlurHashes.thumb) + && Objects.equals(this.disc, baseItemDtoImageBlurHashes.disc) + && Objects.equals(this.box, baseItemDtoImageBlurHashes.box) + && Objects.equals(this.screenshot, baseItemDtoImageBlurHashes.screenshot) + && Objects.equals(this.menu, baseItemDtoImageBlurHashes.menu) + && Objects.equals(this.chapter, baseItemDtoImageBlurHashes.chapter) + && Objects.equals(this.boxRear, baseItemDtoImageBlurHashes.boxRear) + && Objects.equals(this.profile, baseItemDtoImageBlurHashes.profile); + } + + @Override + public int hashCode() { + return Objects.hash(primary, art, backdrop, banner, logo, thumb, disc, box, screenshot, menu, chapter, boxRear, + profile); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseItemDtoImageBlurHashes {\n"); + sb.append(" primary: ").append(toIndentedString(primary)).append("\n"); + sb.append(" art: ").append(toIndentedString(art)).append("\n"); + sb.append(" backdrop: ").append(toIndentedString(backdrop)).append("\n"); + sb.append(" banner: ").append(toIndentedString(banner)).append("\n"); + sb.append(" logo: ").append(toIndentedString(logo)).append("\n"); + sb.append(" thumb: ").append(toIndentedString(thumb)).append("\n"); + sb.append(" disc: ").append(toIndentedString(disc)).append("\n"); + sb.append(" box: ").append(toIndentedString(box)).append("\n"); + sb.append(" screenshot: ").append(toIndentedString(screenshot)).append("\n"); + sb.append(" menu: ").append(toIndentedString(menu)).append("\n"); + sb.append(" chapter: ").append(toIndentedString(chapter)).append("\n"); + sb.append(" boxRear: ").append(toIndentedString(boxRear)).append("\n"); + sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Primary` to the URL query string + if (getPrimary() != null) { + for (String _key : getPrimary().keySet()) { + joiner.add(String.format("%sPrimary%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getPrimary().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getPrimary().get(_key))))); + } + } + + // add `Art` to the URL query string + if (getArt() != null) { + for (String _key : getArt().keySet()) { + joiner.add(String.format("%sArt%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getArt().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getArt().get(_key))))); + } + } + + // add `Backdrop` to the URL query string + if (getBackdrop() != null) { + for (String _key : getBackdrop().keySet()) { + joiner.add(String.format("%sBackdrop%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getBackdrop().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getBackdrop().get(_key))))); + } + } + + // add `Banner` to the URL query string + if (getBanner() != null) { + for (String _key : getBanner().keySet()) { + joiner.add(String.format("%sBanner%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getBanner().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBanner().get(_key))))); + } + } + + // add `Logo` to the URL query string + if (getLogo() != null) { + for (String _key : getLogo().keySet()) { + joiner.add(String.format("%sLogo%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getLogo().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getLogo().get(_key))))); + } + } + + // add `Thumb` to the URL query string + if (getThumb() != null) { + for (String _key : getThumb().keySet()) { + joiner.add(String.format("%sThumb%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getThumb().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getThumb().get(_key))))); + } + } + + // add `Disc` to the URL query string + if (getDisc() != null) { + for (String _key : getDisc().keySet()) { + joiner.add(String.format("%sDisc%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getDisc().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getDisc().get(_key))))); + } + } + + // add `Box` to the URL query string + if (getBox() != null) { + for (String _key : getBox().keySet()) { + joiner.add(String.format("%sBox%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getBox().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBox().get(_key))))); + } + } + + // add `Screenshot` to the URL query string + if (getScreenshot() != null) { + for (String _key : getScreenshot().keySet()) { + joiner.add(String.format("%sScreenshot%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getScreenshot().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getScreenshot().get(_key))))); + } + } + + // add `Menu` to the URL query string + if (getMenu() != null) { + for (String _key : getMenu().keySet()) { + joiner.add(String.format("%sMenu%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getMenu().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getMenu().get(_key))))); + } + } + + // add `Chapter` to the URL query string + if (getChapter() != null) { + for (String _key : getChapter().keySet()) { + joiner.add(String.format("%sChapter%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getChapter().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getChapter().get(_key))))); + } + } + + // add `BoxRear` to the URL query string + if (getBoxRear() != null) { + for (String _key : getBoxRear().keySet()) { + joiner.add(String.format("%sBoxRear%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getBoxRear().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBoxRear().get(_key))))); + } + } + + // add `Profile` to the URL query string + if (getProfile() != null) { + for (String _key : getProfile().keySet()) { + joiner.add(String.format("%sProfile%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProfile().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getProfile().get(_key))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private BaseItemDtoImageBlurHashes instance; + + public Builder() { + this(new BaseItemDtoImageBlurHashes()); + } + + protected Builder(BaseItemDtoImageBlurHashes instance) { + this.instance = instance; + } + + public BaseItemDtoImageBlurHashes.Builder primary(Map primary) { + this.instance.primary = primary; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder art(Map art) { + this.instance.art = art; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder backdrop(Map backdrop) { + this.instance.backdrop = backdrop; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder banner(Map banner) { + this.instance.banner = banner; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder logo(Map logo) { + this.instance.logo = logo; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder thumb(Map thumb) { + this.instance.thumb = thumb; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder disc(Map disc) { + this.instance.disc = disc; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder box(Map box) { + this.instance.box = box; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder screenshot(Map screenshot) { + this.instance.screenshot = screenshot; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder menu(Map menu) { + this.instance.menu = menu; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder chapter(Map chapter) { + this.instance.chapter = chapter; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder boxRear(Map boxRear) { + this.instance.boxRear = boxRear; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder profile(Map profile) { + this.instance.profile = profile; + return this; + } + + /** + * returns a built BaseItemDtoImageBlurHashes instance. + * + * The builder is not reusable. + */ + public BaseItemDtoImageBlurHashes build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BaseItemDtoImageBlurHashes.Builder builder() { + return new BaseItemDtoImageBlurHashes.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BaseItemDtoImageBlurHashes.Builder toBuilder() { + return new BaseItemDtoImageBlurHashes.Builder().primary(getPrimary()).art(getArt()).backdrop(getBackdrop()) + .banner(getBanner()).logo(getLogo()).thumb(getThumb()).disc(getDisc()).box(getBox()) + .screenshot(getScreenshot()).menu(getMenu()).chapter(getChapter()).boxRear(getBoxRear()) + .profile(getProfile()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemDtoQueryResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemDtoQueryResult.java new file mode 100644 index 0000000000000..90f91ad7fdc47 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemDtoQueryResult.java @@ -0,0 +1,288 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Query result container. + */ +@JsonPropertyOrder({ BaseItemDtoQueryResult.JSON_PROPERTY_ITEMS, + BaseItemDtoQueryResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, BaseItemDtoQueryResult.JSON_PROPERTY_START_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BaseItemDtoQueryResult { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public BaseItemDtoQueryResult() { + } + + public BaseItemDtoQueryResult items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public BaseItemDtoQueryResult addItemsItem(BaseItemDto itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Gets or sets the items. + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public BaseItemDtoQueryResult totalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total number of records available. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public BaseItemDtoQueryResult startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the index of the first record in Items. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + /** + * Return true if this BaseItemDtoQueryResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseItemDtoQueryResult baseItemDtoQueryResult = (BaseItemDtoQueryResult) o; + return Objects.equals(this.items, baseItemDtoQueryResult.items) + && Objects.equals(this.totalRecordCount, baseItemDtoQueryResult.totalRecordCount) + && Objects.equals(this.startIndex, baseItemDtoQueryResult.startIndex); + } + + @Override + public int hashCode() { + return Objects.hash(items, totalRecordCount, startIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseItemDtoQueryResult {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BaseItemDtoQueryResult instance; + + public Builder() { + this(new BaseItemDtoQueryResult()); + } + + protected Builder(BaseItemDtoQueryResult instance) { + this.instance = instance; + } + + public BaseItemDtoQueryResult.Builder items(List items) { + this.instance.items = items; + return this; + } + + public BaseItemDtoQueryResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public BaseItemDtoQueryResult.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + /** + * returns a built BaseItemDtoQueryResult instance. + * + * The builder is not reusable. + */ + public BaseItemDtoQueryResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BaseItemDtoQueryResult.Builder builder() { + return new BaseItemDtoQueryResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BaseItemDtoQueryResult.Builder toBuilder() { + return new BaseItemDtoQueryResult.Builder().items(getItems()).totalRecordCount(getTotalRecordCount()) + .startIndex(getStartIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemKind.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemKind.java new file mode 100644 index 0000000000000..f366d449049a3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemKind.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The base item kind. + */ +public enum BaseItemKind { + + AGGREGATE_FOLDER("AggregateFolder"), + + AUDIO("Audio"), + + AUDIO_BOOK("AudioBook"), + + BASE_PLUGIN_FOLDER("BasePluginFolder"), + + BOOK("Book"), + + BOX_SET("BoxSet"), + + CHANNEL("Channel"), + + CHANNEL_FOLDER_ITEM("ChannelFolderItem"), + + COLLECTION_FOLDER("CollectionFolder"), + + EPISODE("Episode"), + + FOLDER("Folder"), + + GENRE("Genre"), + + MANUAL_PLAYLISTS_FOLDER("ManualPlaylistsFolder"), + + MOVIE("Movie"), + + LIVE_TV_CHANNEL("LiveTvChannel"), + + LIVE_TV_PROGRAM("LiveTvProgram"), + + MUSIC_ALBUM("MusicAlbum"), + + MUSIC_ARTIST("MusicArtist"), + + MUSIC_GENRE("MusicGenre"), + + MUSIC_VIDEO("MusicVideo"), + + PERSON("Person"), + + PHOTO("Photo"), + + PHOTO_ALBUM("PhotoAlbum"), + + PLAYLIST("Playlist"), + + PLAYLISTS_FOLDER("PlaylistsFolder"), + + PROGRAM("Program"), + + RECORDING("Recording"), + + SEASON("Season"), + + SERIES("Series"), + + STUDIO("Studio"), + + TRAILER("Trailer"), + + TV_CHANNEL("TvChannel"), + + TV_PROGRAM("TvProgram"), + + USER_ROOT_FOLDER("UserRootFolder"), + + USER_VIEW("UserView"), + + VIDEO("Video"), + + YEAR("Year"); + + private String value; + + BaseItemKind(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static BaseItemKind fromValue(String value) { + for (BaseItemKind b : BaseItemKind.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemPerson.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemPerson.java new file mode 100644 index 0000000000000..535d4f9e24568 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemPerson.java @@ -0,0 +1,394 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * This is used by the api to get information about a Person within a BaseItem. + */ +@JsonPropertyOrder({ BaseItemPerson.JSON_PROPERTY_NAME, BaseItemPerson.JSON_PROPERTY_ID, + BaseItemPerson.JSON_PROPERTY_ROLE, BaseItemPerson.JSON_PROPERTY_TYPE, + BaseItemPerson.JSON_PROPERTY_PRIMARY_IMAGE_TAG, BaseItemPerson.JSON_PROPERTY_IMAGE_BLUR_HASHES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BaseItemPerson { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_ROLE = "Role"; + @org.eclipse.jdt.annotation.NonNull + private String role; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private PersonKind type = PersonKind.UNKNOWN; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_TAG = "PrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String primaryImageTag; + + public static final String JSON_PROPERTY_IMAGE_BLUR_HASHES = "ImageBlurHashes"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemPersonImageBlurHashes imageBlurHashes; + + public BaseItemPerson() { + } + + public BaseItemPerson name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public BaseItemPerson id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Gets or sets the identifier. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public BaseItemPerson role(@org.eclipse.jdt.annotation.NonNull String role) { + this.role = role; + return this; + } + + /** + * Gets or sets the role. + * + * @return role + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRole() { + return role; + } + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRole(@org.eclipse.jdt.annotation.NonNull String role) { + this.role = role; + } + + public BaseItemPerson type(@org.eclipse.jdt.annotation.NonNull PersonKind type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PersonKind getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull PersonKind type) { + this.type = type; + } + + public BaseItemPerson primaryImageTag(@org.eclipse.jdt.annotation.NonNull String primaryImageTag) { + this.primaryImageTag = primaryImageTag; + return this; + } + + /** + * Gets or sets the primary image tag. + * + * @return primaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryImageTag() { + return primaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String primaryImageTag) { + this.primaryImageTag = primaryImageTag; + } + + public BaseItemPerson imageBlurHashes( + @org.eclipse.jdt.annotation.NonNull BaseItemPersonImageBlurHashes imageBlurHashes) { + this.imageBlurHashes = imageBlurHashes; + return this; + } + + /** + * Get imageBlurHashes + * + * @return imageBlurHashes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_BLUR_HASHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemPersonImageBlurHashes getImageBlurHashes() { + return imageBlurHashes; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_BLUR_HASHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageBlurHashes(@org.eclipse.jdt.annotation.NonNull BaseItemPersonImageBlurHashes imageBlurHashes) { + this.imageBlurHashes = imageBlurHashes; + } + + /** + * Return true if this BaseItemPerson object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseItemPerson baseItemPerson = (BaseItemPerson) o; + return Objects.equals(this.name, baseItemPerson.name) && Objects.equals(this.id, baseItemPerson.id) + && Objects.equals(this.role, baseItemPerson.role) && Objects.equals(this.type, baseItemPerson.type) + && Objects.equals(this.primaryImageTag, baseItemPerson.primaryImageTag) + && Objects.equals(this.imageBlurHashes, baseItemPerson.imageBlurHashes); + } + + @Override + public int hashCode() { + return Objects.hash(name, id, role, type, primaryImageTag, imageBlurHashes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseItemPerson {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" primaryImageTag: ").append(toIndentedString(primaryImageTag)).append("\n"); + sb.append(" imageBlurHashes: ").append(toIndentedString(imageBlurHashes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Role` to the URL query string + if (getRole() != null) { + joiner.add(String.format("%sRole%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRole())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `PrimaryImageTag` to the URL query string + if (getPrimaryImageTag() != null) { + joiner.add(String.format("%sPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageTag())))); + } + + // add `ImageBlurHashes` to the URL query string + if (getImageBlurHashes() != null) { + joiner.add(getImageBlurHashes().toUrlQueryString(prefix + "ImageBlurHashes" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private BaseItemPerson instance; + + public Builder() { + this(new BaseItemPerson()); + } + + protected Builder(BaseItemPerson instance) { + this.instance = instance; + } + + public BaseItemPerson.Builder name(String name) { + this.instance.name = name; + return this; + } + + public BaseItemPerson.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public BaseItemPerson.Builder role(String role) { + this.instance.role = role; + return this; + } + + public BaseItemPerson.Builder type(PersonKind type) { + this.instance.type = type; + return this; + } + + public BaseItemPerson.Builder primaryImageTag(String primaryImageTag) { + this.instance.primaryImageTag = primaryImageTag; + return this; + } + + public BaseItemPerson.Builder imageBlurHashes(BaseItemPersonImageBlurHashes imageBlurHashes) { + this.instance.imageBlurHashes = imageBlurHashes; + return this; + } + + /** + * returns a built BaseItemPerson instance. + * + * The builder is not reusable. + */ + public BaseItemPerson build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BaseItemPerson.Builder builder() { + return new BaseItemPerson.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BaseItemPerson.Builder toBuilder() { + return new BaseItemPerson.Builder().name(getName()).id(getId()).role(getRole()).type(getType()) + .primaryImageTag(getPrimaryImageTag()).imageBlurHashes(getImageBlurHashes()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemPersonImageBlurHashes.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemPersonImageBlurHashes.java new file mode 100644 index 0000000000000..c409774f844e1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BaseItemPersonImageBlurHashes.java @@ -0,0 +1,830 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Gets or sets the primary image blurhash. + */ +@JsonPropertyOrder({ BaseItemPersonImageBlurHashes.JSON_PROPERTY_PRIMARY, + BaseItemPersonImageBlurHashes.JSON_PROPERTY_ART, BaseItemPersonImageBlurHashes.JSON_PROPERTY_BACKDROP, + BaseItemPersonImageBlurHashes.JSON_PROPERTY_BANNER, BaseItemPersonImageBlurHashes.JSON_PROPERTY_LOGO, + BaseItemPersonImageBlurHashes.JSON_PROPERTY_THUMB, BaseItemPersonImageBlurHashes.JSON_PROPERTY_DISC, + BaseItemPersonImageBlurHashes.JSON_PROPERTY_BOX, BaseItemPersonImageBlurHashes.JSON_PROPERTY_SCREENSHOT, + BaseItemPersonImageBlurHashes.JSON_PROPERTY_MENU, BaseItemPersonImageBlurHashes.JSON_PROPERTY_CHAPTER, + BaseItemPersonImageBlurHashes.JSON_PROPERTY_BOX_REAR, BaseItemPersonImageBlurHashes.JSON_PROPERTY_PROFILE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BaseItemPersonImageBlurHashes { + public static final String JSON_PROPERTY_PRIMARY = "Primary"; + @org.eclipse.jdt.annotation.NonNull + private Map primary = new HashMap<>(); + + public static final String JSON_PROPERTY_ART = "Art"; + @org.eclipse.jdt.annotation.NonNull + private Map art = new HashMap<>(); + + public static final String JSON_PROPERTY_BACKDROP = "Backdrop"; + @org.eclipse.jdt.annotation.NonNull + private Map backdrop = new HashMap<>(); + + public static final String JSON_PROPERTY_BANNER = "Banner"; + @org.eclipse.jdt.annotation.NonNull + private Map banner = new HashMap<>(); + + public static final String JSON_PROPERTY_LOGO = "Logo"; + @org.eclipse.jdt.annotation.NonNull + private Map logo = new HashMap<>(); + + public static final String JSON_PROPERTY_THUMB = "Thumb"; + @org.eclipse.jdt.annotation.NonNull + private Map thumb = new HashMap<>(); + + public static final String JSON_PROPERTY_DISC = "Disc"; + @org.eclipse.jdt.annotation.NonNull + private Map disc = new HashMap<>(); + + public static final String JSON_PROPERTY_BOX = "Box"; + @org.eclipse.jdt.annotation.NonNull + private Map box = new HashMap<>(); + + public static final String JSON_PROPERTY_SCREENSHOT = "Screenshot"; + @org.eclipse.jdt.annotation.NonNull + private Map screenshot = new HashMap<>(); + + public static final String JSON_PROPERTY_MENU = "Menu"; + @org.eclipse.jdt.annotation.NonNull + private Map menu = new HashMap<>(); + + public static final String JSON_PROPERTY_CHAPTER = "Chapter"; + @org.eclipse.jdt.annotation.NonNull + private Map chapter = new HashMap<>(); + + public static final String JSON_PROPERTY_BOX_REAR = "BoxRear"; + @org.eclipse.jdt.annotation.NonNull + private Map boxRear = new HashMap<>(); + + public static final String JSON_PROPERTY_PROFILE = "Profile"; + @org.eclipse.jdt.annotation.NonNull + private Map profile = new HashMap<>(); + + public BaseItemPersonImageBlurHashes() { + } + + public BaseItemPersonImageBlurHashes primary(@org.eclipse.jdt.annotation.NonNull Map primary) { + this.primary = primary; + return this; + } + + public BaseItemPersonImageBlurHashes putPrimaryItem(String key, String primaryItem) { + if (this.primary == null) { + this.primary = new HashMap<>(); + } + this.primary.put(key, primaryItem); + return this; + } + + /** + * Get primary + * + * @return primary + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getPrimary() { + return primary; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimary(@org.eclipse.jdt.annotation.NonNull Map primary) { + this.primary = primary; + } + + public BaseItemPersonImageBlurHashes art(@org.eclipse.jdt.annotation.NonNull Map art) { + this.art = art; + return this; + } + + public BaseItemPersonImageBlurHashes putArtItem(String key, String artItem) { + if (this.art == null) { + this.art = new HashMap<>(); + } + this.art.put(key, artItem); + return this; + } + + /** + * Get art + * + * @return art + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getArt() { + return art; + } + + @JsonProperty(JSON_PROPERTY_ART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArt(@org.eclipse.jdt.annotation.NonNull Map art) { + this.art = art; + } + + public BaseItemPersonImageBlurHashes backdrop(@org.eclipse.jdt.annotation.NonNull Map backdrop) { + this.backdrop = backdrop; + return this; + } + + public BaseItemPersonImageBlurHashes putBackdropItem(String key, String backdropItem) { + if (this.backdrop == null) { + this.backdrop = new HashMap<>(); + } + this.backdrop.put(key, backdropItem); + return this; + } + + /** + * Get backdrop + * + * @return backdrop + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BACKDROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBackdrop() { + return backdrop; + } + + @JsonProperty(JSON_PROPERTY_BACKDROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBackdrop(@org.eclipse.jdt.annotation.NonNull Map backdrop) { + this.backdrop = backdrop; + } + + public BaseItemPersonImageBlurHashes banner(@org.eclipse.jdt.annotation.NonNull Map banner) { + this.banner = banner; + return this; + } + + public BaseItemPersonImageBlurHashes putBannerItem(String key, String bannerItem) { + if (this.banner == null) { + this.banner = new HashMap<>(); + } + this.banner.put(key, bannerItem); + return this; + } + + /** + * Get banner + * + * @return banner + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BANNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBanner() { + return banner; + } + + @JsonProperty(JSON_PROPERTY_BANNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBanner(@org.eclipse.jdt.annotation.NonNull Map banner) { + this.banner = banner; + } + + public BaseItemPersonImageBlurHashes logo(@org.eclipse.jdt.annotation.NonNull Map logo) { + this.logo = logo; + return this; + } + + public BaseItemPersonImageBlurHashes putLogoItem(String key, String logoItem) { + if (this.logo == null) { + this.logo = new HashMap<>(); + } + this.logo.put(key, logoItem); + return this; + } + + /** + * Get logo + * + * @return logo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOGO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getLogo() { + return logo; + } + + @JsonProperty(JSON_PROPERTY_LOGO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogo(@org.eclipse.jdt.annotation.NonNull Map logo) { + this.logo = logo; + } + + public BaseItemPersonImageBlurHashes thumb(@org.eclipse.jdt.annotation.NonNull Map thumb) { + this.thumb = thumb; + return this; + } + + public BaseItemPersonImageBlurHashes putThumbItem(String key, String thumbItem) { + if (this.thumb == null) { + this.thumb = new HashMap<>(); + } + this.thumb.put(key, thumbItem); + return this; + } + + /** + * Get thumb + * + * @return thumb + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THUMB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getThumb() { + return thumb; + } + + @JsonProperty(JSON_PROPERTY_THUMB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThumb(@org.eclipse.jdt.annotation.NonNull Map thumb) { + this.thumb = thumb; + } + + public BaseItemPersonImageBlurHashes disc(@org.eclipse.jdt.annotation.NonNull Map disc) { + this.disc = disc; + return this; + } + + public BaseItemPersonImageBlurHashes putDiscItem(String key, String discItem) { + if (this.disc == null) { + this.disc = new HashMap<>(); + } + this.disc.put(key, discItem); + return this; + } + + /** + * Get disc + * + * @return disc + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDisc() { + return disc; + } + + @JsonProperty(JSON_PROPERTY_DISC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisc(@org.eclipse.jdt.annotation.NonNull Map disc) { + this.disc = disc; + } + + public BaseItemPersonImageBlurHashes box(@org.eclipse.jdt.annotation.NonNull Map box) { + this.box = box; + return this; + } + + public BaseItemPersonImageBlurHashes putBoxItem(String key, String boxItem) { + if (this.box == null) { + this.box = new HashMap<>(); + } + this.box.put(key, boxItem); + return this; + } + + /** + * Get box + * + * @return box + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BOX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBox() { + return box; + } + + @JsonProperty(JSON_PROPERTY_BOX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBox(@org.eclipse.jdt.annotation.NonNull Map box) { + this.box = box; + } + + public BaseItemPersonImageBlurHashes screenshot( + @org.eclipse.jdt.annotation.NonNull Map screenshot) { + this.screenshot = screenshot; + return this; + } + + public BaseItemPersonImageBlurHashes putScreenshotItem(String key, String screenshotItem) { + if (this.screenshot == null) { + this.screenshot = new HashMap<>(); + } + this.screenshot.put(key, screenshotItem); + return this; + } + + /** + * Get screenshot + * + * @return screenshot + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SCREENSHOT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getScreenshot() { + return screenshot; + } + + @JsonProperty(JSON_PROPERTY_SCREENSHOT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScreenshot(@org.eclipse.jdt.annotation.NonNull Map screenshot) { + this.screenshot = screenshot; + } + + public BaseItemPersonImageBlurHashes menu(@org.eclipse.jdt.annotation.NonNull Map menu) { + this.menu = menu; + return this; + } + + public BaseItemPersonImageBlurHashes putMenuItem(String key, String menuItem) { + if (this.menu == null) { + this.menu = new HashMap<>(); + } + this.menu.put(key, menuItem); + return this; + } + + /** + * Get menu + * + * @return menu + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MENU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMenu() { + return menu; + } + + @JsonProperty(JSON_PROPERTY_MENU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMenu(@org.eclipse.jdt.annotation.NonNull Map menu) { + this.menu = menu; + } + + public BaseItemPersonImageBlurHashes chapter(@org.eclipse.jdt.annotation.NonNull Map chapter) { + this.chapter = chapter; + return this; + } + + public BaseItemPersonImageBlurHashes putChapterItem(String key, String chapterItem) { + if (this.chapter == null) { + this.chapter = new HashMap<>(); + } + this.chapter.put(key, chapterItem); + return this; + } + + /** + * Get chapter + * + * @return chapter + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHAPTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getChapter() { + return chapter; + } + + @JsonProperty(JSON_PROPERTY_CHAPTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChapter(@org.eclipse.jdt.annotation.NonNull Map chapter) { + this.chapter = chapter; + } + + public BaseItemPersonImageBlurHashes boxRear(@org.eclipse.jdt.annotation.NonNull Map boxRear) { + this.boxRear = boxRear; + return this; + } + + public BaseItemPersonImageBlurHashes putBoxRearItem(String key, String boxRearItem) { + if (this.boxRear == null) { + this.boxRear = new HashMap<>(); + } + this.boxRear.put(key, boxRearItem); + return this; + } + + /** + * Get boxRear + * + * @return boxRear + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BOX_REAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBoxRear() { + return boxRear; + } + + @JsonProperty(JSON_PROPERTY_BOX_REAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBoxRear(@org.eclipse.jdt.annotation.NonNull Map boxRear) { + this.boxRear = boxRear; + } + + public BaseItemPersonImageBlurHashes profile(@org.eclipse.jdt.annotation.NonNull Map profile) { + this.profile = profile; + return this; + } + + public BaseItemPersonImageBlurHashes putProfileItem(String key, String profileItem) { + if (this.profile == null) { + this.profile = new HashMap<>(); + } + this.profile.put(key, profileItem); + return this; + } + + /** + * Get profile + * + * @return profile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProfile() { + return profile; + } + + @JsonProperty(JSON_PROPERTY_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProfile(@org.eclipse.jdt.annotation.NonNull Map profile) { + this.profile = profile; + } + + /** + * Return true if this BaseItemPerson_ImageBlurHashes object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseItemPersonImageBlurHashes baseItemPersonImageBlurHashes = (BaseItemPersonImageBlurHashes) o; + return Objects.equals(this.primary, baseItemPersonImageBlurHashes.primary) + && Objects.equals(this.art, baseItemPersonImageBlurHashes.art) + && Objects.equals(this.backdrop, baseItemPersonImageBlurHashes.backdrop) + && Objects.equals(this.banner, baseItemPersonImageBlurHashes.banner) + && Objects.equals(this.logo, baseItemPersonImageBlurHashes.logo) + && Objects.equals(this.thumb, baseItemPersonImageBlurHashes.thumb) + && Objects.equals(this.disc, baseItemPersonImageBlurHashes.disc) + && Objects.equals(this.box, baseItemPersonImageBlurHashes.box) + && Objects.equals(this.screenshot, baseItemPersonImageBlurHashes.screenshot) + && Objects.equals(this.menu, baseItemPersonImageBlurHashes.menu) + && Objects.equals(this.chapter, baseItemPersonImageBlurHashes.chapter) + && Objects.equals(this.boxRear, baseItemPersonImageBlurHashes.boxRear) + && Objects.equals(this.profile, baseItemPersonImageBlurHashes.profile); + } + + @Override + public int hashCode() { + return Objects.hash(primary, art, backdrop, banner, logo, thumb, disc, box, screenshot, menu, chapter, boxRear, + profile); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseItemPersonImageBlurHashes {\n"); + sb.append(" primary: ").append(toIndentedString(primary)).append("\n"); + sb.append(" art: ").append(toIndentedString(art)).append("\n"); + sb.append(" backdrop: ").append(toIndentedString(backdrop)).append("\n"); + sb.append(" banner: ").append(toIndentedString(banner)).append("\n"); + sb.append(" logo: ").append(toIndentedString(logo)).append("\n"); + sb.append(" thumb: ").append(toIndentedString(thumb)).append("\n"); + sb.append(" disc: ").append(toIndentedString(disc)).append("\n"); + sb.append(" box: ").append(toIndentedString(box)).append("\n"); + sb.append(" screenshot: ").append(toIndentedString(screenshot)).append("\n"); + sb.append(" menu: ").append(toIndentedString(menu)).append("\n"); + sb.append(" chapter: ").append(toIndentedString(chapter)).append("\n"); + sb.append(" boxRear: ").append(toIndentedString(boxRear)).append("\n"); + sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Primary` to the URL query string + if (getPrimary() != null) { + for (String _key : getPrimary().keySet()) { + joiner.add(String.format("%sPrimary%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getPrimary().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getPrimary().get(_key))))); + } + } + + // add `Art` to the URL query string + if (getArt() != null) { + for (String _key : getArt().keySet()) { + joiner.add(String.format("%sArt%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getArt().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getArt().get(_key))))); + } + } + + // add `Backdrop` to the URL query string + if (getBackdrop() != null) { + for (String _key : getBackdrop().keySet()) { + joiner.add(String.format("%sBackdrop%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getBackdrop().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getBackdrop().get(_key))))); + } + } + + // add `Banner` to the URL query string + if (getBanner() != null) { + for (String _key : getBanner().keySet()) { + joiner.add(String.format("%sBanner%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getBanner().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBanner().get(_key))))); + } + } + + // add `Logo` to the URL query string + if (getLogo() != null) { + for (String _key : getLogo().keySet()) { + joiner.add(String.format("%sLogo%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getLogo().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getLogo().get(_key))))); + } + } + + // add `Thumb` to the URL query string + if (getThumb() != null) { + for (String _key : getThumb().keySet()) { + joiner.add(String.format("%sThumb%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getThumb().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getThumb().get(_key))))); + } + } + + // add `Disc` to the URL query string + if (getDisc() != null) { + for (String _key : getDisc().keySet()) { + joiner.add(String.format("%sDisc%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getDisc().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getDisc().get(_key))))); + } + } + + // add `Box` to the URL query string + if (getBox() != null) { + for (String _key : getBox().keySet()) { + joiner.add(String.format("%sBox%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getBox().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBox().get(_key))))); + } + } + + // add `Screenshot` to the URL query string + if (getScreenshot() != null) { + for (String _key : getScreenshot().keySet()) { + joiner.add(String.format("%sScreenshot%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getScreenshot().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getScreenshot().get(_key))))); + } + } + + // add `Menu` to the URL query string + if (getMenu() != null) { + for (String _key : getMenu().keySet()) { + joiner.add(String.format("%sMenu%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getMenu().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getMenu().get(_key))))); + } + } + + // add `Chapter` to the URL query string + if (getChapter() != null) { + for (String _key : getChapter().keySet()) { + joiner.add(String.format("%sChapter%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getChapter().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getChapter().get(_key))))); + } + } + + // add `BoxRear` to the URL query string + if (getBoxRear() != null) { + for (String _key : getBoxRear().keySet()) { + joiner.add(String.format("%sBoxRear%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getBoxRear().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBoxRear().get(_key))))); + } + } + + // add `Profile` to the URL query string + if (getProfile() != null) { + for (String _key : getProfile().keySet()) { + joiner.add(String.format("%sProfile%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProfile().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getProfile().get(_key))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private BaseItemPersonImageBlurHashes instance; + + public Builder() { + this(new BaseItemPersonImageBlurHashes()); + } + + protected Builder(BaseItemPersonImageBlurHashes instance) { + this.instance = instance; + } + + public BaseItemPersonImageBlurHashes.Builder primary(Map primary) { + this.instance.primary = primary; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder art(Map art) { + this.instance.art = art; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder backdrop(Map backdrop) { + this.instance.backdrop = backdrop; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder banner(Map banner) { + this.instance.banner = banner; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder logo(Map logo) { + this.instance.logo = logo; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder thumb(Map thumb) { + this.instance.thumb = thumb; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder disc(Map disc) { + this.instance.disc = disc; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder box(Map box) { + this.instance.box = box; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder screenshot(Map screenshot) { + this.instance.screenshot = screenshot; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder menu(Map menu) { + this.instance.menu = menu; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder chapter(Map chapter) { + this.instance.chapter = chapter; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder boxRear(Map boxRear) { + this.instance.boxRear = boxRear; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder profile(Map profile) { + this.instance.profile = profile; + return this; + } + + /** + * returns a built BaseItemPersonImageBlurHashes instance. + * + * The builder is not reusable. + */ + public BaseItemPersonImageBlurHashes build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BaseItemPersonImageBlurHashes.Builder builder() { + return new BaseItemPersonImageBlurHashes.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BaseItemPersonImageBlurHashes.Builder toBuilder() { + return new BaseItemPersonImageBlurHashes.Builder().primary(getPrimary()).art(getArt()).backdrop(getBackdrop()) + .banner(getBanner()).logo(getLogo()).thumb(getThumb()).disc(getDisc()).box(getBox()) + .screenshot(getScreenshot()).menu(getMenu()).chapter(getChapter()).boxRear(getBoxRear()) + .profile(getProfile()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BookInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BookInfo.java new file mode 100644 index 0000000000000..2bf08ccd66511 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BookInfo.java @@ -0,0 +1,654 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BookInfo + */ +@JsonPropertyOrder({ BookInfo.JSON_PROPERTY_NAME, BookInfo.JSON_PROPERTY_ORIGINAL_TITLE, BookInfo.JSON_PROPERTY_PATH, + BookInfo.JSON_PROPERTY_METADATA_LANGUAGE, BookInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, + BookInfo.JSON_PROPERTY_PROVIDER_IDS, BookInfo.JSON_PROPERTY_YEAR, BookInfo.JSON_PROPERTY_INDEX_NUMBER, + BookInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, BookInfo.JSON_PROPERTY_PREMIERE_DATE, + BookInfo.JSON_PROPERTY_IS_AUTOMATED, BookInfo.JSON_PROPERTY_SERIES_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BookInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public static final String JSON_PROPERTY_SERIES_NAME = "SeriesName"; + @org.eclipse.jdt.annotation.NonNull + private String seriesName; + + public BookInfo() { + } + + public BookInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public BookInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public BookInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public BookInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public BookInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public BookInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public BookInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public BookInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public BookInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public BookInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public BookInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public BookInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + public BookInfo seriesName(@org.eclipse.jdt.annotation.NonNull String seriesName) { + this.seriesName = seriesName; + return this; + } + + /** + * Get seriesName + * + * @return seriesName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesName() { + return seriesName; + } + + @JsonProperty(JSON_PROPERTY_SERIES_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesName(@org.eclipse.jdt.annotation.NonNull String seriesName) { + this.seriesName = seriesName; + } + + /** + * Return true if this BookInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BookInfo bookInfo = (BookInfo) o; + return Objects.equals(this.name, bookInfo.name) && Objects.equals(this.originalTitle, bookInfo.originalTitle) + && Objects.equals(this.path, bookInfo.path) + && Objects.equals(this.metadataLanguage, bookInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, bookInfo.metadataCountryCode) + && Objects.equals(this.providerIds, bookInfo.providerIds) && Objects.equals(this.year, bookInfo.year) + && Objects.equals(this.indexNumber, bookInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, bookInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, bookInfo.premiereDate) + && Objects.equals(this.isAutomated, bookInfo.isAutomated) + && Objects.equals(this.seriesName, bookInfo.seriesName); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated, seriesName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BookInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append(" seriesName: ").append(toIndentedString(seriesName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + // add `SeriesName` to the URL query string + if (getSeriesName() != null) { + joiner.add(String.format("%sSeriesName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BookInfo instance; + + public Builder() { + this(new BookInfo()); + } + + protected Builder(BookInfo instance) { + this.instance = instance; + } + + public BookInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public BookInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public BookInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public BookInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public BookInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public BookInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public BookInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public BookInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public BookInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public BookInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public BookInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + public BookInfo.Builder seriesName(String seriesName) { + this.instance.seriesName = seriesName; + return this; + } + + /** + * returns a built BookInfo instance. + * + * The builder is not reusable. + */ + public BookInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BookInfo.Builder builder() { + return new BookInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BookInfo.Builder toBuilder() { + return new BookInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()).isAutomated(getIsAutomated()) + .seriesName(getSeriesName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BookInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BookInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..7ece7daa2ed55 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BookInfoRemoteSearchQuery.java @@ -0,0 +1,316 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BookInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ BookInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + BookInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, BookInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + BookInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BookInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private BookInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public BookInfoRemoteSearchQuery() { + } + + public BookInfoRemoteSearchQuery searchInfo(@org.eclipse.jdt.annotation.NonNull BookInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BookInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull BookInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public BookInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public BookInfoRemoteSearchQuery searchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public BookInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this BookInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BookInfoRemoteSearchQuery bookInfoRemoteSearchQuery = (BookInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, bookInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, bookInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, bookInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, bookInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BookInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BookInfoRemoteSearchQuery instance; + + public Builder() { + this(new BookInfoRemoteSearchQuery()); + } + + protected Builder(BookInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public BookInfoRemoteSearchQuery.Builder searchInfo(BookInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public BookInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public BookInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public BookInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built BookInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public BookInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BookInfoRemoteSearchQuery.Builder builder() { + return new BookInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BookInfoRemoteSearchQuery.Builder toBuilder() { + return new BookInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BoxSetInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BoxSetInfo.java new file mode 100644 index 0000000000000..d605741729cd9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BoxSetInfo.java @@ -0,0 +1,617 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BoxSetInfo + */ +@JsonPropertyOrder({ BoxSetInfo.JSON_PROPERTY_NAME, BoxSetInfo.JSON_PROPERTY_ORIGINAL_TITLE, + BoxSetInfo.JSON_PROPERTY_PATH, BoxSetInfo.JSON_PROPERTY_METADATA_LANGUAGE, + BoxSetInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, BoxSetInfo.JSON_PROPERTY_PROVIDER_IDS, + BoxSetInfo.JSON_PROPERTY_YEAR, BoxSetInfo.JSON_PROPERTY_INDEX_NUMBER, + BoxSetInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, BoxSetInfo.JSON_PROPERTY_PREMIERE_DATE, + BoxSetInfo.JSON_PROPERTY_IS_AUTOMATED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BoxSetInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public BoxSetInfo() { + } + + public BoxSetInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public BoxSetInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public BoxSetInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public BoxSetInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public BoxSetInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public BoxSetInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public BoxSetInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public BoxSetInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public BoxSetInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public BoxSetInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public BoxSetInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public BoxSetInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + /** + * Return true if this BoxSetInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BoxSetInfo boxSetInfo = (BoxSetInfo) o; + return Objects.equals(this.name, boxSetInfo.name) + && Objects.equals(this.originalTitle, boxSetInfo.originalTitle) + && Objects.equals(this.path, boxSetInfo.path) + && Objects.equals(this.metadataLanguage, boxSetInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, boxSetInfo.metadataCountryCode) + && Objects.equals(this.providerIds, boxSetInfo.providerIds) + && Objects.equals(this.year, boxSetInfo.year) + && Objects.equals(this.indexNumber, boxSetInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, boxSetInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, boxSetInfo.premiereDate) + && Objects.equals(this.isAutomated, boxSetInfo.isAutomated); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BoxSetInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BoxSetInfo instance; + + public Builder() { + this(new BoxSetInfo()); + } + + protected Builder(BoxSetInfo instance) { + this.instance = instance; + } + + public BoxSetInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public BoxSetInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public BoxSetInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public BoxSetInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public BoxSetInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public BoxSetInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public BoxSetInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public BoxSetInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public BoxSetInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public BoxSetInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public BoxSetInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + /** + * returns a built BoxSetInfo instance. + * + * The builder is not reusable. + */ + public BoxSetInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BoxSetInfo.Builder builder() { + return new BoxSetInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BoxSetInfo.Builder toBuilder() { + return new BoxSetInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()) + .isAutomated(getIsAutomated()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BoxSetInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BoxSetInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..49ba94b08f42d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BoxSetInfoRemoteSearchQuery.java @@ -0,0 +1,318 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BoxSetInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ BoxSetInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + BoxSetInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, + BoxSetInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + BoxSetInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BoxSetInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private BoxSetInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public BoxSetInfoRemoteSearchQuery() { + } + + public BoxSetInfoRemoteSearchQuery searchInfo(@org.eclipse.jdt.annotation.NonNull BoxSetInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BoxSetInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull BoxSetInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public BoxSetInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public BoxSetInfoRemoteSearchQuery searchProviderName( + @org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public BoxSetInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this BoxSetInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BoxSetInfoRemoteSearchQuery boxSetInfoRemoteSearchQuery = (BoxSetInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, boxSetInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, boxSetInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, boxSetInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, boxSetInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BoxSetInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BoxSetInfoRemoteSearchQuery instance; + + public Builder() { + this(new BoxSetInfoRemoteSearchQuery()); + } + + protected Builder(BoxSetInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public BoxSetInfoRemoteSearchQuery.Builder searchInfo(BoxSetInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public BoxSetInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public BoxSetInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public BoxSetInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built BoxSetInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public BoxSetInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BoxSetInfoRemoteSearchQuery.Builder builder() { + return new BoxSetInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BoxSetInfoRemoteSearchQuery.Builder toBuilder() { + return new BoxSetInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BrandingOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BrandingOptions.java new file mode 100644 index 0000000000000..39c9105f10b7d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BrandingOptions.java @@ -0,0 +1,274 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The branding options. + */ +@JsonPropertyOrder({ BrandingOptions.JSON_PROPERTY_LOGIN_DISCLAIMER, BrandingOptions.JSON_PROPERTY_CUSTOM_CSS, + BrandingOptions.JSON_PROPERTY_SPLASHSCREEN_ENABLED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BrandingOptions { + public static final String JSON_PROPERTY_LOGIN_DISCLAIMER = "LoginDisclaimer"; + @org.eclipse.jdt.annotation.NonNull + private String loginDisclaimer; + + public static final String JSON_PROPERTY_CUSTOM_CSS = "CustomCss"; + @org.eclipse.jdt.annotation.NonNull + private String customCss; + + public static final String JSON_PROPERTY_SPLASHSCREEN_ENABLED = "SplashscreenEnabled"; + @org.eclipse.jdt.annotation.NonNull + private Boolean splashscreenEnabled; + + public BrandingOptions() { + } + + public BrandingOptions loginDisclaimer(@org.eclipse.jdt.annotation.NonNull String loginDisclaimer) { + this.loginDisclaimer = loginDisclaimer; + return this; + } + + /** + * Gets or sets the login disclaimer. + * + * @return loginDisclaimer + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOGIN_DISCLAIMER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLoginDisclaimer() { + return loginDisclaimer; + } + + @JsonProperty(JSON_PROPERTY_LOGIN_DISCLAIMER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoginDisclaimer(@org.eclipse.jdt.annotation.NonNull String loginDisclaimer) { + this.loginDisclaimer = loginDisclaimer; + } + + public BrandingOptions customCss(@org.eclipse.jdt.annotation.NonNull String customCss) { + this.customCss = customCss; + return this; + } + + /** + * Gets or sets the custom CSS. + * + * @return customCss + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CUSTOM_CSS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCustomCss() { + return customCss; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_CSS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomCss(@org.eclipse.jdt.annotation.NonNull String customCss) { + this.customCss = customCss; + } + + public BrandingOptions splashscreenEnabled(@org.eclipse.jdt.annotation.NonNull Boolean splashscreenEnabled) { + this.splashscreenEnabled = splashscreenEnabled; + return this; + } + + /** + * Gets or sets a value indicating whether to enable the splashscreen. + * + * @return splashscreenEnabled + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SPLASHSCREEN_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSplashscreenEnabled() { + return splashscreenEnabled; + } + + @JsonProperty(JSON_PROPERTY_SPLASHSCREEN_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSplashscreenEnabled(@org.eclipse.jdt.annotation.NonNull Boolean splashscreenEnabled) { + this.splashscreenEnabled = splashscreenEnabled; + } + + /** + * Return true if this BrandingOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BrandingOptions brandingOptions = (BrandingOptions) o; + return Objects.equals(this.loginDisclaimer, brandingOptions.loginDisclaimer) + && Objects.equals(this.customCss, brandingOptions.customCss) + && Objects.equals(this.splashscreenEnabled, brandingOptions.splashscreenEnabled); + } + + @Override + public int hashCode() { + return Objects.hash(loginDisclaimer, customCss, splashscreenEnabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BrandingOptions {\n"); + sb.append(" loginDisclaimer: ").append(toIndentedString(loginDisclaimer)).append("\n"); + sb.append(" customCss: ").append(toIndentedString(customCss)).append("\n"); + sb.append(" splashscreenEnabled: ").append(toIndentedString(splashscreenEnabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `LoginDisclaimer` to the URL query string + if (getLoginDisclaimer() != null) { + joiner.add(String.format("%sLoginDisclaimer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLoginDisclaimer())))); + } + + // add `CustomCss` to the URL query string + if (getCustomCss() != null) { + joiner.add(String.format("%sCustomCss%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCustomCss())))); + } + + // add `SplashscreenEnabled` to the URL query string + if (getSplashscreenEnabled() != null) { + joiner.add(String.format("%sSplashscreenEnabled%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSplashscreenEnabled())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BrandingOptions instance; + + public Builder() { + this(new BrandingOptions()); + } + + protected Builder(BrandingOptions instance) { + this.instance = instance; + } + + public BrandingOptions.Builder loginDisclaimer(String loginDisclaimer) { + this.instance.loginDisclaimer = loginDisclaimer; + return this; + } + + public BrandingOptions.Builder customCss(String customCss) { + this.instance.customCss = customCss; + return this; + } + + public BrandingOptions.Builder splashscreenEnabled(Boolean splashscreenEnabled) { + this.instance.splashscreenEnabled = splashscreenEnabled; + return this; + } + + /** + * returns a built BrandingOptions instance. + * + * The builder is not reusable. + */ + public BrandingOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BrandingOptions.Builder builder() { + return new BrandingOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BrandingOptions.Builder toBuilder() { + return new BrandingOptions.Builder().loginDisclaimer(getLoginDisclaimer()).customCss(getCustomCss()) + .splashscreenEnabled(getSplashscreenEnabled()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BufferRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BufferRequestDto.java new file mode 100644 index 0000000000000..a8eb63fde0508 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/BufferRequestDto.java @@ -0,0 +1,316 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class BufferRequestDto. + */ +@JsonPropertyOrder({ BufferRequestDto.JSON_PROPERTY_WHEN, BufferRequestDto.JSON_PROPERTY_POSITION_TICKS, + BufferRequestDto.JSON_PROPERTY_IS_PLAYING, BufferRequestDto.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BufferRequestDto { + public static final String JSON_PROPERTY_WHEN = "When"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime when; + + public static final String JSON_PROPERTY_POSITION_TICKS = "PositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long positionTicks; + + public static final String JSON_PROPERTY_IS_PLAYING = "IsPlaying"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPlaying; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID playlistItemId; + + public BufferRequestDto() { + } + + public BufferRequestDto when(@org.eclipse.jdt.annotation.NonNull OffsetDateTime when) { + this.when = when; + return this; + } + + /** + * Gets or sets when the request has been made by the client. + * + * @return when + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WHEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getWhen() { + return when; + } + + @JsonProperty(JSON_PROPERTY_WHEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhen(@org.eclipse.jdt.annotation.NonNull OffsetDateTime when) { + this.when = when; + } + + public BufferRequestDto positionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + return this; + } + + /** + * Gets or sets the position ticks. + * + * @return positionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPositionTicks() { + return positionTicks; + } + + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPositionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + } + + public BufferRequestDto isPlaying(@org.eclipse.jdt.annotation.NonNull Boolean isPlaying) { + this.isPlaying = isPlaying; + return this; + } + + /** + * Gets or sets a value indicating whether the client playback is unpaused. + * + * @return isPlaying + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PLAYING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPlaying() { + return isPlaying; + } + + @JsonProperty(JSON_PROPERTY_IS_PLAYING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPlaying(@org.eclipse.jdt.annotation.NonNull Boolean isPlaying) { + this.isPlaying = isPlaying; + } + + public BufferRequestDto playlistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets or sets the playlist item identifier of the playing item. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + } + + /** + * Return true if this BufferRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BufferRequestDto bufferRequestDto = (BufferRequestDto) o; + return Objects.equals(this.when, bufferRequestDto.when) + && Objects.equals(this.positionTicks, bufferRequestDto.positionTicks) + && Objects.equals(this.isPlaying, bufferRequestDto.isPlaying) + && Objects.equals(this.playlistItemId, bufferRequestDto.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(when, positionTicks, isPlaying, playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BufferRequestDto {\n"); + sb.append(" when: ").append(toIndentedString(when)).append("\n"); + sb.append(" positionTicks: ").append(toIndentedString(positionTicks)).append("\n"); + sb.append(" isPlaying: ").append(toIndentedString(isPlaying)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `When` to the URL query string + if (getWhen() != null) { + joiner.add(String.format("%sWhen%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWhen())))); + } + + // add `PositionTicks` to the URL query string + if (getPositionTicks() != null) { + joiner.add(String.format("%sPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPositionTicks())))); + } + + // add `IsPlaying` to the URL query string + if (getIsPlaying() != null) { + joiner.add(String.format("%sIsPlaying%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPlaying())))); + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BufferRequestDto instance; + + public Builder() { + this(new BufferRequestDto()); + } + + protected Builder(BufferRequestDto instance) { + this.instance = instance; + } + + public BufferRequestDto.Builder when(OffsetDateTime when) { + this.instance.when = when; + return this; + } + + public BufferRequestDto.Builder positionTicks(Long positionTicks) { + this.instance.positionTicks = positionTicks; + return this; + } + + public BufferRequestDto.Builder isPlaying(Boolean isPlaying) { + this.instance.isPlaying = isPlaying; + return this; + } + + public BufferRequestDto.Builder playlistItemId(UUID playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built BufferRequestDto instance. + * + * The builder is not reusable. + */ + public BufferRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BufferRequestDto.Builder builder() { + return new BufferRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BufferRequestDto.Builder toBuilder() { + return new BufferRequestDto.Builder().when(getWhen()).positionTicks(getPositionTicks()) + .isPlaying(getIsPlaying()).playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CastReceiverApplication.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CastReceiverApplication.java new file mode 100644 index 0000000000000..95e24e0bd60fd --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CastReceiverApplication.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The cast receiver application model. + */ +@JsonPropertyOrder({ CastReceiverApplication.JSON_PROPERTY_ID, CastReceiverApplication.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class CastReceiverApplication { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public CastReceiverApplication() { + } + + public CastReceiverApplication id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the cast receiver application id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public CastReceiverApplication name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the cast receiver application name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + /** + * Return true if this CastReceiverApplication object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CastReceiverApplication castReceiverApplication = (CastReceiverApplication) o; + return Objects.equals(this.id, castReceiverApplication.id) + && Objects.equals(this.name, castReceiverApplication.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CastReceiverApplication {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private CastReceiverApplication instance; + + public Builder() { + this(new CastReceiverApplication()); + } + + protected Builder(CastReceiverApplication instance) { + this.instance = instance; + } + + public CastReceiverApplication.Builder id(String id) { + this.instance.id = id; + return this; + } + + public CastReceiverApplication.Builder name(String name) { + this.instance.name = name; + return this; + } + + /** + * returns a built CastReceiverApplication instance. + * + * The builder is not reusable. + */ + public CastReceiverApplication build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CastReceiverApplication.Builder builder() { + return new CastReceiverApplication.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CastReceiverApplication.Builder toBuilder() { + return new CastReceiverApplication.Builder().id(getId()).name(getName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelFeatures.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelFeatures.java new file mode 100644 index 0000000000000..893eb7384eda7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelFeatures.java @@ -0,0 +1,687 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ChannelFeatures + */ +@JsonPropertyOrder({ ChannelFeatures.JSON_PROPERTY_NAME, ChannelFeatures.JSON_PROPERTY_ID, + ChannelFeatures.JSON_PROPERTY_CAN_SEARCH, ChannelFeatures.JSON_PROPERTY_MEDIA_TYPES, + ChannelFeatures.JSON_PROPERTY_CONTENT_TYPES, ChannelFeatures.JSON_PROPERTY_MAX_PAGE_SIZE, + ChannelFeatures.JSON_PROPERTY_AUTO_REFRESH_LEVELS, ChannelFeatures.JSON_PROPERTY_DEFAULT_SORT_FIELDS, + ChannelFeatures.JSON_PROPERTY_SUPPORTS_SORT_ORDER_TOGGLE, ChannelFeatures.JSON_PROPERTY_SUPPORTS_LATEST_MEDIA, + ChannelFeatures.JSON_PROPERTY_CAN_FILTER, ChannelFeatures.JSON_PROPERTY_SUPPORTS_CONTENT_DOWNLOADING }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ChannelFeatures { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_CAN_SEARCH = "CanSearch"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canSearch; + + public static final String JSON_PROPERTY_MEDIA_TYPES = "MediaTypes"; + @org.eclipse.jdt.annotation.NonNull + private List mediaTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_CONTENT_TYPES = "ContentTypes"; + @org.eclipse.jdt.annotation.NonNull + private List contentTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_MAX_PAGE_SIZE = "MaxPageSize"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxPageSize; + + public static final String JSON_PROPERTY_AUTO_REFRESH_LEVELS = "AutoRefreshLevels"; + @org.eclipse.jdt.annotation.NonNull + private Integer autoRefreshLevels; + + public static final String JSON_PROPERTY_DEFAULT_SORT_FIELDS = "DefaultSortFields"; + @org.eclipse.jdt.annotation.NonNull + private List defaultSortFields = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUPPORTS_SORT_ORDER_TOGGLE = "SupportsSortOrderToggle"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsSortOrderToggle; + + public static final String JSON_PROPERTY_SUPPORTS_LATEST_MEDIA = "SupportsLatestMedia"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsLatestMedia; + + public static final String JSON_PROPERTY_CAN_FILTER = "CanFilter"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canFilter; + + public static final String JSON_PROPERTY_SUPPORTS_CONTENT_DOWNLOADING = "SupportsContentDownloading"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsContentDownloading; + + public ChannelFeatures() { + } + + public ChannelFeatures name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ChannelFeatures id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Gets or sets the identifier. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public ChannelFeatures canSearch(@org.eclipse.jdt.annotation.NonNull Boolean canSearch) { + this.canSearch = canSearch; + return this; + } + + /** + * Gets or sets a value indicating whether this instance can search. + * + * @return canSearch + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_SEARCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanSearch() { + return canSearch; + } + + @JsonProperty(JSON_PROPERTY_CAN_SEARCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanSearch(@org.eclipse.jdt.annotation.NonNull Boolean canSearch) { + this.canSearch = canSearch; + } + + public ChannelFeatures mediaTypes(@org.eclipse.jdt.annotation.NonNull List mediaTypes) { + this.mediaTypes = mediaTypes; + return this; + } + + public ChannelFeatures addMediaTypesItem(ChannelMediaType mediaTypesItem) { + if (this.mediaTypes == null) { + this.mediaTypes = new ArrayList<>(); + } + this.mediaTypes.add(mediaTypesItem); + return this; + } + + /** + * Gets or sets the media types. + * + * @return mediaTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMediaTypes() { + return mediaTypes; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaTypes(@org.eclipse.jdt.annotation.NonNull List mediaTypes) { + this.mediaTypes = mediaTypes; + } + + public ChannelFeatures contentTypes( + @org.eclipse.jdt.annotation.NonNull List contentTypes) { + this.contentTypes = contentTypes; + return this; + } + + public ChannelFeatures addContentTypesItem(ChannelMediaContentType contentTypesItem) { + if (this.contentTypes == null) { + this.contentTypes = new ArrayList<>(); + } + this.contentTypes.add(contentTypesItem); + return this; + } + + /** + * Gets or sets the content types. + * + * @return contentTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTENT_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getContentTypes() { + return contentTypes; + } + + @JsonProperty(JSON_PROPERTY_CONTENT_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentTypes(@org.eclipse.jdt.annotation.NonNull List contentTypes) { + this.contentTypes = contentTypes; + } + + public ChannelFeatures maxPageSize(@org.eclipse.jdt.annotation.NonNull Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Gets or sets the maximum number of records the channel allows retrieving at a time. + * + * @return maxPageSize + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_PAGE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxPageSize() { + return maxPageSize; + } + + @JsonProperty(JSON_PROPERTY_MAX_PAGE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxPageSize(@org.eclipse.jdt.annotation.NonNull Integer maxPageSize) { + this.maxPageSize = maxPageSize; + } + + public ChannelFeatures autoRefreshLevels(@org.eclipse.jdt.annotation.NonNull Integer autoRefreshLevels) { + this.autoRefreshLevels = autoRefreshLevels; + return this; + } + + /** + * Gets or sets the automatic refresh levels. + * + * @return autoRefreshLevels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTO_REFRESH_LEVELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAutoRefreshLevels() { + return autoRefreshLevels; + } + + @JsonProperty(JSON_PROPERTY_AUTO_REFRESH_LEVELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAutoRefreshLevels(@org.eclipse.jdt.annotation.NonNull Integer autoRefreshLevels) { + this.autoRefreshLevels = autoRefreshLevels; + } + + public ChannelFeatures defaultSortFields( + @org.eclipse.jdt.annotation.NonNull List defaultSortFields) { + this.defaultSortFields = defaultSortFields; + return this; + } + + public ChannelFeatures addDefaultSortFieldsItem(ChannelItemSortField defaultSortFieldsItem) { + if (this.defaultSortFields == null) { + this.defaultSortFields = new ArrayList<>(); + } + this.defaultSortFields.add(defaultSortFieldsItem); + return this; + } + + /** + * Gets or sets the default sort orders. + * + * @return defaultSortFields + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEFAULT_SORT_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDefaultSortFields() { + return defaultSortFields; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_SORT_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultSortFields(@org.eclipse.jdt.annotation.NonNull List defaultSortFields) { + this.defaultSortFields = defaultSortFields; + } + + public ChannelFeatures supportsSortOrderToggle( + @org.eclipse.jdt.annotation.NonNull Boolean supportsSortOrderToggle) { + this.supportsSortOrderToggle = supportsSortOrderToggle; + return this; + } + + /** + * Gets or sets a value indicating whether a sort ascending/descending toggle is supported. + * + * @return supportsSortOrderToggle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_SORT_ORDER_TOGGLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsSortOrderToggle() { + return supportsSortOrderToggle; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_SORT_ORDER_TOGGLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsSortOrderToggle(@org.eclipse.jdt.annotation.NonNull Boolean supportsSortOrderToggle) { + this.supportsSortOrderToggle = supportsSortOrderToggle; + } + + public ChannelFeatures supportsLatestMedia(@org.eclipse.jdt.annotation.NonNull Boolean supportsLatestMedia) { + this.supportsLatestMedia = supportsLatestMedia; + return this; + } + + /** + * Gets or sets a value indicating whether [supports latest media]. + * + * @return supportsLatestMedia + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_LATEST_MEDIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsLatestMedia() { + return supportsLatestMedia; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_LATEST_MEDIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsLatestMedia(@org.eclipse.jdt.annotation.NonNull Boolean supportsLatestMedia) { + this.supportsLatestMedia = supportsLatestMedia; + } + + public ChannelFeatures canFilter(@org.eclipse.jdt.annotation.NonNull Boolean canFilter) { + this.canFilter = canFilter; + return this; + } + + /** + * Gets or sets a value indicating whether this instance can filter. + * + * @return canFilter + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanFilter() { + return canFilter; + } + + @JsonProperty(JSON_PROPERTY_CAN_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanFilter(@org.eclipse.jdt.annotation.NonNull Boolean canFilter) { + this.canFilter = canFilter; + } + + public ChannelFeatures supportsContentDownloading( + @org.eclipse.jdt.annotation.NonNull Boolean supportsContentDownloading) { + this.supportsContentDownloading = supportsContentDownloading; + return this; + } + + /** + * Gets or sets a value indicating whether [supports content downloading]. + * + * @return supportsContentDownloading + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_CONTENT_DOWNLOADING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsContentDownloading() { + return supportsContentDownloading; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_CONTENT_DOWNLOADING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsContentDownloading(@org.eclipse.jdt.annotation.NonNull Boolean supportsContentDownloading) { + this.supportsContentDownloading = supportsContentDownloading; + } + + /** + * Return true if this ChannelFeatures object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChannelFeatures channelFeatures = (ChannelFeatures) o; + return Objects.equals(this.name, channelFeatures.name) && Objects.equals(this.id, channelFeatures.id) + && Objects.equals(this.canSearch, channelFeatures.canSearch) + && Objects.equals(this.mediaTypes, channelFeatures.mediaTypes) + && Objects.equals(this.contentTypes, channelFeatures.contentTypes) + && Objects.equals(this.maxPageSize, channelFeatures.maxPageSize) + && Objects.equals(this.autoRefreshLevels, channelFeatures.autoRefreshLevels) + && Objects.equals(this.defaultSortFields, channelFeatures.defaultSortFields) + && Objects.equals(this.supportsSortOrderToggle, channelFeatures.supportsSortOrderToggle) + && Objects.equals(this.supportsLatestMedia, channelFeatures.supportsLatestMedia) + && Objects.equals(this.canFilter, channelFeatures.canFilter) + && Objects.equals(this.supportsContentDownloading, channelFeatures.supportsContentDownloading); + } + + @Override + public int hashCode() { + return Objects.hash(name, id, canSearch, mediaTypes, contentTypes, maxPageSize, autoRefreshLevels, + defaultSortFields, supportsSortOrderToggle, supportsLatestMedia, canFilter, supportsContentDownloading); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChannelFeatures {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" canSearch: ").append(toIndentedString(canSearch)).append("\n"); + sb.append(" mediaTypes: ").append(toIndentedString(mediaTypes)).append("\n"); + sb.append(" contentTypes: ").append(toIndentedString(contentTypes)).append("\n"); + sb.append(" maxPageSize: ").append(toIndentedString(maxPageSize)).append("\n"); + sb.append(" autoRefreshLevels: ").append(toIndentedString(autoRefreshLevels)).append("\n"); + sb.append(" defaultSortFields: ").append(toIndentedString(defaultSortFields)).append("\n"); + sb.append(" supportsSortOrderToggle: ").append(toIndentedString(supportsSortOrderToggle)).append("\n"); + sb.append(" supportsLatestMedia: ").append(toIndentedString(supportsLatestMedia)).append("\n"); + sb.append(" canFilter: ").append(toIndentedString(canFilter)).append("\n"); + sb.append(" supportsContentDownloading: ").append(toIndentedString(supportsContentDownloading)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `CanSearch` to the URL query string + if (getCanSearch() != null) { + joiner.add(String.format("%sCanSearch%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanSearch())))); + } + + // add `MediaTypes` to the URL query string + if (getMediaTypes() != null) { + for (int i = 0; i < getMediaTypes().size(); i++) { + if (getMediaTypes().get(i) != null) { + joiner.add(String.format("%sMediaTypes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMediaTypes().get(i))))); + } + } + } + + // add `ContentTypes` to the URL query string + if (getContentTypes() != null) { + for (int i = 0; i < getContentTypes().size(); i++) { + if (getContentTypes().get(i) != null) { + joiner.add(String.format("%sContentTypes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getContentTypes().get(i))))); + } + } + } + + // add `MaxPageSize` to the URL query string + if (getMaxPageSize() != null) { + joiner.add(String.format("%sMaxPageSize%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxPageSize())))); + } + + // add `AutoRefreshLevels` to the URL query string + if (getAutoRefreshLevels() != null) { + joiner.add(String.format("%sAutoRefreshLevels%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAutoRefreshLevels())))); + } + + // add `DefaultSortFields` to the URL query string + if (getDefaultSortFields() != null) { + for (int i = 0; i < getDefaultSortFields().size(); i++) { + if (getDefaultSortFields().get(i) != null) { + joiner.add(String.format("%sDefaultSortFields%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDefaultSortFields().get(i))))); + } + } + } + + // add `SupportsSortOrderToggle` to the URL query string + if (getSupportsSortOrderToggle() != null) { + joiner.add(String.format("%sSupportsSortOrderToggle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsSortOrderToggle())))); + } + + // add `SupportsLatestMedia` to the URL query string + if (getSupportsLatestMedia() != null) { + joiner.add(String.format("%sSupportsLatestMedia%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsLatestMedia())))); + } + + // add `CanFilter` to the URL query string + if (getCanFilter() != null) { + joiner.add(String.format("%sCanFilter%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanFilter())))); + } + + // add `SupportsContentDownloading` to the URL query string + if (getSupportsContentDownloading() != null) { + joiner.add(String.format("%sSupportsContentDownloading%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsContentDownloading())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ChannelFeatures instance; + + public Builder() { + this(new ChannelFeatures()); + } + + protected Builder(ChannelFeatures instance) { + this.instance = instance; + } + + public ChannelFeatures.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ChannelFeatures.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public ChannelFeatures.Builder canSearch(Boolean canSearch) { + this.instance.canSearch = canSearch; + return this; + } + + public ChannelFeatures.Builder mediaTypes(List mediaTypes) { + this.instance.mediaTypes = mediaTypes; + return this; + } + + public ChannelFeatures.Builder contentTypes(List contentTypes) { + this.instance.contentTypes = contentTypes; + return this; + } + + public ChannelFeatures.Builder maxPageSize(Integer maxPageSize) { + this.instance.maxPageSize = maxPageSize; + return this; + } + + public ChannelFeatures.Builder autoRefreshLevels(Integer autoRefreshLevels) { + this.instance.autoRefreshLevels = autoRefreshLevels; + return this; + } + + public ChannelFeatures.Builder defaultSortFields(List defaultSortFields) { + this.instance.defaultSortFields = defaultSortFields; + return this; + } + + public ChannelFeatures.Builder supportsSortOrderToggle(Boolean supportsSortOrderToggle) { + this.instance.supportsSortOrderToggle = supportsSortOrderToggle; + return this; + } + + public ChannelFeatures.Builder supportsLatestMedia(Boolean supportsLatestMedia) { + this.instance.supportsLatestMedia = supportsLatestMedia; + return this; + } + + public ChannelFeatures.Builder canFilter(Boolean canFilter) { + this.instance.canFilter = canFilter; + return this; + } + + public ChannelFeatures.Builder supportsContentDownloading(Boolean supportsContentDownloading) { + this.instance.supportsContentDownloading = supportsContentDownloading; + return this; + } + + /** + * returns a built ChannelFeatures instance. + * + * The builder is not reusable. + */ + public ChannelFeatures build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ChannelFeatures.Builder builder() { + return new ChannelFeatures.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ChannelFeatures.Builder toBuilder() { + return new ChannelFeatures.Builder().name(getName()).id(getId()).canSearch(getCanSearch()) + .mediaTypes(getMediaTypes()).contentTypes(getContentTypes()).maxPageSize(getMaxPageSize()) + .autoRefreshLevels(getAutoRefreshLevels()).defaultSortFields(getDefaultSortFields()) + .supportsSortOrderToggle(getSupportsSortOrderToggle()).supportsLatestMedia(getSupportsLatestMedia()) + .canFilter(getCanFilter()).supportsContentDownloading(getSupportsContentDownloading()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelItemSortField.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelItemSortField.java new file mode 100644 index 0000000000000..4b4f1c7926e84 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelItemSortField.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ChannelItemSortField + */ +public enum ChannelItemSortField { + + NAME("Name"), + + COMMUNITY_RATING("CommunityRating"), + + PREMIERE_DATE("PremiereDate"), + + DATE_CREATED("DateCreated"), + + RUNTIME("Runtime"), + + PLAY_COUNT("PlayCount"), + + COMMUNITY_PLAY_COUNT("CommunityPlayCount"); + + private String value; + + ChannelItemSortField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ChannelItemSortField fromValue(String value) { + for (ChannelItemSortField b : ChannelItemSortField.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelMappingOptionsDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelMappingOptionsDto.java new file mode 100644 index 0000000000000..a4291bd72ce74 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelMappingOptionsDto.java @@ -0,0 +1,357 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Channel mapping options dto. + */ +@JsonPropertyOrder({ ChannelMappingOptionsDto.JSON_PROPERTY_TUNER_CHANNELS, + ChannelMappingOptionsDto.JSON_PROPERTY_PROVIDER_CHANNELS, ChannelMappingOptionsDto.JSON_PROPERTY_MAPPINGS, + ChannelMappingOptionsDto.JSON_PROPERTY_PROVIDER_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ChannelMappingOptionsDto { + public static final String JSON_PROPERTY_TUNER_CHANNELS = "TunerChannels"; + @org.eclipse.jdt.annotation.NonNull + private List tunerChannels = new ArrayList<>(); + + public static final String JSON_PROPERTY_PROVIDER_CHANNELS = "ProviderChannels"; + @org.eclipse.jdt.annotation.NonNull + private List providerChannels = new ArrayList<>(); + + public static final String JSON_PROPERTY_MAPPINGS = "Mappings"; + @org.eclipse.jdt.annotation.NonNull + private List mappings = new ArrayList<>(); + + public static final String JSON_PROPERTY_PROVIDER_NAME = "ProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String providerName; + + public ChannelMappingOptionsDto() { + } + + public ChannelMappingOptionsDto tunerChannels( + @org.eclipse.jdt.annotation.NonNull List tunerChannels) { + this.tunerChannels = tunerChannels; + return this; + } + + public ChannelMappingOptionsDto addTunerChannelsItem(TunerChannelMapping tunerChannelsItem) { + if (this.tunerChannels == null) { + this.tunerChannels = new ArrayList<>(); + } + this.tunerChannels.add(tunerChannelsItem); + return this; + } + + /** + * Gets or sets list of tuner channels. + * + * @return tunerChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TUNER_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTunerChannels() { + return tunerChannels; + } + + @JsonProperty(JSON_PROPERTY_TUNER_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTunerChannels(@org.eclipse.jdt.annotation.NonNull List tunerChannels) { + this.tunerChannels = tunerChannels; + } + + public ChannelMappingOptionsDto providerChannels( + @org.eclipse.jdt.annotation.NonNull List providerChannels) { + this.providerChannels = providerChannels; + return this; + } + + public ChannelMappingOptionsDto addProviderChannelsItem(NameIdPair providerChannelsItem) { + if (this.providerChannels == null) { + this.providerChannels = new ArrayList<>(); + } + this.providerChannels.add(providerChannelsItem); + return this; + } + + /** + * Gets or sets list of provider channels. + * + * @return providerChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getProviderChannels() { + return providerChannels; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderChannels(@org.eclipse.jdt.annotation.NonNull List providerChannels) { + this.providerChannels = providerChannels; + } + + public ChannelMappingOptionsDto mappings(@org.eclipse.jdt.annotation.NonNull List mappings) { + this.mappings = mappings; + return this; + } + + public ChannelMappingOptionsDto addMappingsItem(NameValuePair mappingsItem) { + if (this.mappings == null) { + this.mappings = new ArrayList<>(); + } + this.mappings.add(mappingsItem); + return this; + } + + /** + * Gets or sets list of mappings. + * + * @return mappings + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAPPINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMappings() { + return mappings; + } + + @JsonProperty(JSON_PROPERTY_MAPPINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMappings(@org.eclipse.jdt.annotation.NonNull List mappings) { + this.mappings = mappings; + } + + public ChannelMappingOptionsDto providerName(@org.eclipse.jdt.annotation.NonNull String providerName) { + this.providerName = providerName; + return this; + } + + /** + * Gets or sets provider name. + * + * @return providerName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProviderName() { + return providerName; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderName(@org.eclipse.jdt.annotation.NonNull String providerName) { + this.providerName = providerName; + } + + /** + * Return true if this ChannelMappingOptionsDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChannelMappingOptionsDto channelMappingOptionsDto = (ChannelMappingOptionsDto) o; + return Objects.equals(this.tunerChannels, channelMappingOptionsDto.tunerChannels) + && Objects.equals(this.providerChannels, channelMappingOptionsDto.providerChannels) + && Objects.equals(this.mappings, channelMappingOptionsDto.mappings) + && Objects.equals(this.providerName, channelMappingOptionsDto.providerName); + } + + @Override + public int hashCode() { + return Objects.hash(tunerChannels, providerChannels, mappings, providerName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChannelMappingOptionsDto {\n"); + sb.append(" tunerChannels: ").append(toIndentedString(tunerChannels)).append("\n"); + sb.append(" providerChannels: ").append(toIndentedString(providerChannels)).append("\n"); + sb.append(" mappings: ").append(toIndentedString(mappings)).append("\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `TunerChannels` to the URL query string + if (getTunerChannels() != null) { + for (int i = 0; i < getTunerChannels().size(); i++) { + if (getTunerChannels().get(i) != null) { + joiner.add(getTunerChannels().get(i).toUrlQueryString(String.format("%sTunerChannels%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ProviderChannels` to the URL query string + if (getProviderChannels() != null) { + for (int i = 0; i < getProviderChannels().size(); i++) { + if (getProviderChannels().get(i) != null) { + joiner.add(getProviderChannels().get(i).toUrlQueryString(String.format("%sProviderChannels%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Mappings` to the URL query string + if (getMappings() != null) { + for (int i = 0; i < getMappings().size(); i++) { + if (getMappings().get(i) != null) { + joiner.add(getMappings().get(i).toUrlQueryString(String.format("%sMappings%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ProviderName` to the URL query string + if (getProviderName() != null) { + joiner.add(String.format("%sProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProviderName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ChannelMappingOptionsDto instance; + + public Builder() { + this(new ChannelMappingOptionsDto()); + } + + protected Builder(ChannelMappingOptionsDto instance) { + this.instance = instance; + } + + public ChannelMappingOptionsDto.Builder tunerChannels(List tunerChannels) { + this.instance.tunerChannels = tunerChannels; + return this; + } + + public ChannelMappingOptionsDto.Builder providerChannels(List providerChannels) { + this.instance.providerChannels = providerChannels; + return this; + } + + public ChannelMappingOptionsDto.Builder mappings(List mappings) { + this.instance.mappings = mappings; + return this; + } + + public ChannelMappingOptionsDto.Builder providerName(String providerName) { + this.instance.providerName = providerName; + return this; + } + + /** + * returns a built ChannelMappingOptionsDto instance. + * + * The builder is not reusable. + */ + public ChannelMappingOptionsDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ChannelMappingOptionsDto.Builder builder() { + return new ChannelMappingOptionsDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ChannelMappingOptionsDto.Builder toBuilder() { + return new ChannelMappingOptionsDto.Builder().tunerChannels(getTunerChannels()) + .providerChannels(getProviderChannels()).mappings(getMappings()).providerName(getProviderName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelMediaContentType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelMediaContentType.java new file mode 100644 index 0000000000000..b0e34892ca794 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelMediaContentType.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ChannelMediaContentType + */ +public enum ChannelMediaContentType { + + CLIP("Clip"), + + PODCAST("Podcast"), + + TRAILER("Trailer"), + + MOVIE("Movie"), + + EPISODE("Episode"), + + SONG("Song"), + + MOVIE_EXTRA("MovieExtra"), + + TV_EXTRA("TvExtra"); + + private String value; + + ChannelMediaContentType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ChannelMediaContentType fromValue(String value) { + for (ChannelMediaContentType b : ChannelMediaContentType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelMediaType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelMediaType.java new file mode 100644 index 0000000000000..220fb34b260cf --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelMediaType.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ChannelMediaType + */ +public enum ChannelMediaType { + + AUDIO("Audio"), + + VIDEO("Video"), + + PHOTO("Photo"); + + private String value; + + ChannelMediaType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ChannelMediaType fromValue(String value) { + for (ChannelMediaType b : ChannelMediaType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelType.java new file mode 100644 index 0000000000000..9a3c53c7664bd --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChannelType.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum ChannelType. + */ +public enum ChannelType { + + TV("TV"), + + RADIO("Radio"); + + private String value; + + ChannelType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ChannelType fromValue(String value) { + for (ChannelType b : ChannelType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChapterInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChapterInfo.java new file mode 100644 index 0000000000000..210495415e9c2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ChapterInfo.java @@ -0,0 +1,355 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class ChapterInfo. + */ +@JsonPropertyOrder({ ChapterInfo.JSON_PROPERTY_START_POSITION_TICKS, ChapterInfo.JSON_PROPERTY_NAME, + ChapterInfo.JSON_PROPERTY_IMAGE_PATH, ChapterInfo.JSON_PROPERTY_IMAGE_DATE_MODIFIED, + ChapterInfo.JSON_PROPERTY_IMAGE_TAG }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ChapterInfo { + public static final String JSON_PROPERTY_START_POSITION_TICKS = "StartPositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long startPositionTicks; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_IMAGE_PATH = "ImagePath"; + @org.eclipse.jdt.annotation.NonNull + private String imagePath; + + public static final String JSON_PROPERTY_IMAGE_DATE_MODIFIED = "ImageDateModified"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime imageDateModified; + + public static final String JSON_PROPERTY_IMAGE_TAG = "ImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String imageTag; + + public ChapterInfo() { + } + + public ChapterInfo startPositionTicks(@org.eclipse.jdt.annotation.NonNull Long startPositionTicks) { + this.startPositionTicks = startPositionTicks; + return this; + } + + /** + * Gets or sets the start position ticks. + * + * @return startPositionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartPositionTicks() { + return startPositionTicks; + } + + @JsonProperty(JSON_PROPERTY_START_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartPositionTicks(@org.eclipse.jdt.annotation.NonNull Long startPositionTicks) { + this.startPositionTicks = startPositionTicks; + } + + public ChapterInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ChapterInfo imagePath(@org.eclipse.jdt.annotation.NonNull String imagePath) { + this.imagePath = imagePath; + return this; + } + + /** + * Gets or sets the image path. + * + * @return imagePath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getImagePath() { + return imagePath; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImagePath(@org.eclipse.jdt.annotation.NonNull String imagePath) { + this.imagePath = imagePath; + } + + public ChapterInfo imageDateModified(@org.eclipse.jdt.annotation.NonNull OffsetDateTime imageDateModified) { + this.imageDateModified = imageDateModified; + return this; + } + + /** + * Get imageDateModified + * + * @return imageDateModified + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_DATE_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getImageDateModified() { + return imageDateModified; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_DATE_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageDateModified(@org.eclipse.jdt.annotation.NonNull OffsetDateTime imageDateModified) { + this.imageDateModified = imageDateModified; + } + + public ChapterInfo imageTag(@org.eclipse.jdt.annotation.NonNull String imageTag) { + this.imageTag = imageTag; + return this; + } + + /** + * Get imageTag + * + * @return imageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getImageTag() { + return imageTag; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageTag(@org.eclipse.jdt.annotation.NonNull String imageTag) { + this.imageTag = imageTag; + } + + /** + * Return true if this ChapterInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChapterInfo chapterInfo = (ChapterInfo) o; + return Objects.equals(this.startPositionTicks, chapterInfo.startPositionTicks) + && Objects.equals(this.name, chapterInfo.name) && Objects.equals(this.imagePath, chapterInfo.imagePath) + && Objects.equals(this.imageDateModified, chapterInfo.imageDateModified) + && Objects.equals(this.imageTag, chapterInfo.imageTag); + } + + @Override + public int hashCode() { + return Objects.hash(startPositionTicks, name, imagePath, imageDateModified, imageTag); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChapterInfo {\n"); + sb.append(" startPositionTicks: ").append(toIndentedString(startPositionTicks)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" imagePath: ").append(toIndentedString(imagePath)).append("\n"); + sb.append(" imageDateModified: ").append(toIndentedString(imageDateModified)).append("\n"); + sb.append(" imageTag: ").append(toIndentedString(imageTag)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `StartPositionTicks` to the URL query string + if (getStartPositionTicks() != null) { + joiner.add(String.format("%sStartPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartPositionTicks())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `ImagePath` to the URL query string + if (getImagePath() != null) { + joiner.add(String.format("%sImagePath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImagePath())))); + } + + // add `ImageDateModified` to the URL query string + if (getImageDateModified() != null) { + joiner.add(String.format("%sImageDateModified%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageDateModified())))); + } + + // add `ImageTag` to the URL query string + if (getImageTag() != null) { + joiner.add(String.format("%sImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageTag())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ChapterInfo instance; + + public Builder() { + this(new ChapterInfo()); + } + + protected Builder(ChapterInfo instance) { + this.instance = instance; + } + + public ChapterInfo.Builder startPositionTicks(Long startPositionTicks) { + this.instance.startPositionTicks = startPositionTicks; + return this; + } + + public ChapterInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ChapterInfo.Builder imagePath(String imagePath) { + this.instance.imagePath = imagePath; + return this; + } + + public ChapterInfo.Builder imageDateModified(OffsetDateTime imageDateModified) { + this.instance.imageDateModified = imageDateModified; + return this; + } + + public ChapterInfo.Builder imageTag(String imageTag) { + this.instance.imageTag = imageTag; + return this; + } + + /** + * returns a built ChapterInfo instance. + * + * The builder is not reusable. + */ + public ChapterInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ChapterInfo.Builder builder() { + return new ChapterInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ChapterInfo.Builder toBuilder() { + return new ChapterInfo.Builder().startPositionTicks(getStartPositionTicks()).name(getName()) + .imagePath(getImagePath()).imageDateModified(getImageDateModified()).imageTag(getImageTag()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ClientCapabilitiesDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ClientCapabilitiesDto.java new file mode 100644 index 0000000000000..a31463eb2c77f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ClientCapabilitiesDto.java @@ -0,0 +1,474 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Client capabilities dto. + */ +@JsonPropertyOrder({ ClientCapabilitiesDto.JSON_PROPERTY_PLAYABLE_MEDIA_TYPES, + ClientCapabilitiesDto.JSON_PROPERTY_SUPPORTED_COMMANDS, + ClientCapabilitiesDto.JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL, + ClientCapabilitiesDto.JSON_PROPERTY_SUPPORTS_PERSISTENT_IDENTIFIER, + ClientCapabilitiesDto.JSON_PROPERTY_DEVICE_PROFILE, ClientCapabilitiesDto.JSON_PROPERTY_APP_STORE_URL, + ClientCapabilitiesDto.JSON_PROPERTY_ICON_URL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ClientCapabilitiesDto { + public static final String JSON_PROPERTY_PLAYABLE_MEDIA_TYPES = "PlayableMediaTypes"; + @org.eclipse.jdt.annotation.NonNull + private List playableMediaTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUPPORTED_COMMANDS = "SupportedCommands"; + @org.eclipse.jdt.annotation.NonNull + private List supportedCommands = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL = "SupportsMediaControl"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsMediaControl; + + public static final String JSON_PROPERTY_SUPPORTS_PERSISTENT_IDENTIFIER = "SupportsPersistentIdentifier"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsPersistentIdentifier; + + public static final String JSON_PROPERTY_DEVICE_PROFILE = "DeviceProfile"; + @org.eclipse.jdt.annotation.NonNull + private DeviceProfile deviceProfile; + + public static final String JSON_PROPERTY_APP_STORE_URL = "AppStoreUrl"; + @org.eclipse.jdt.annotation.NonNull + private String appStoreUrl; + + public static final String JSON_PROPERTY_ICON_URL = "IconUrl"; + @org.eclipse.jdt.annotation.NonNull + private String iconUrl; + + public ClientCapabilitiesDto() { + } + + public ClientCapabilitiesDto playableMediaTypes( + @org.eclipse.jdt.annotation.NonNull List playableMediaTypes) { + this.playableMediaTypes = playableMediaTypes; + return this; + } + + public ClientCapabilitiesDto addPlayableMediaTypesItem(MediaType playableMediaTypesItem) { + if (this.playableMediaTypes == null) { + this.playableMediaTypes = new ArrayList<>(); + } + this.playableMediaTypes.add(playableMediaTypesItem); + return this; + } + + /** + * Gets or sets the list of playable media types. + * + * @return playableMediaTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYABLE_MEDIA_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPlayableMediaTypes() { + return playableMediaTypes; + } + + @JsonProperty(JSON_PROPERTY_PLAYABLE_MEDIA_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayableMediaTypes(@org.eclipse.jdt.annotation.NonNull List playableMediaTypes) { + this.playableMediaTypes = playableMediaTypes; + } + + public ClientCapabilitiesDto supportedCommands( + @org.eclipse.jdt.annotation.NonNull List supportedCommands) { + this.supportedCommands = supportedCommands; + return this; + } + + public ClientCapabilitiesDto addSupportedCommandsItem(GeneralCommandType supportedCommandsItem) { + if (this.supportedCommands == null) { + this.supportedCommands = new ArrayList<>(); + } + this.supportedCommands.add(supportedCommandsItem); + return this; + } + + /** + * Gets or sets the list of supported commands. + * + * @return supportedCommands + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTED_COMMANDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSupportedCommands() { + return supportedCommands; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTED_COMMANDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportedCommands(@org.eclipse.jdt.annotation.NonNull List supportedCommands) { + this.supportedCommands = supportedCommands; + } + + public ClientCapabilitiesDto supportsMediaControl( + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl) { + this.supportsMediaControl = supportsMediaControl; + return this; + } + + /** + * Gets or sets a value indicating whether session supports media control. + * + * @return supportsMediaControl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsMediaControl() { + return supportsMediaControl; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsMediaControl(@org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl) { + this.supportsMediaControl = supportsMediaControl; + } + + public ClientCapabilitiesDto supportsPersistentIdentifier( + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier) { + this.supportsPersistentIdentifier = supportsPersistentIdentifier; + return this; + } + + /** + * Gets or sets a value indicating whether session supports a persistent identifier. + * + * @return supportsPersistentIdentifier + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_PERSISTENT_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsPersistentIdentifier() { + return supportsPersistentIdentifier; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_PERSISTENT_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsPersistentIdentifier( + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier) { + this.supportsPersistentIdentifier = supportsPersistentIdentifier; + } + + public ClientCapabilitiesDto deviceProfile(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) { + this.deviceProfile = deviceProfile; + return this; + } + + /** + * Gets or sets the device profile. + * + * @return deviceProfile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceProfile getDeviceProfile() { + return deviceProfile; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceProfile(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) { + this.deviceProfile = deviceProfile; + } + + public ClientCapabilitiesDto appStoreUrl(@org.eclipse.jdt.annotation.NonNull String appStoreUrl) { + this.appStoreUrl = appStoreUrl; + return this; + } + + /** + * Gets or sets the app store url. + * + * @return appStoreUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APP_STORE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppStoreUrl() { + return appStoreUrl; + } + + @JsonProperty(JSON_PROPERTY_APP_STORE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppStoreUrl(@org.eclipse.jdt.annotation.NonNull String appStoreUrl) { + this.appStoreUrl = appStoreUrl; + } + + public ClientCapabilitiesDto iconUrl(@org.eclipse.jdt.annotation.NonNull String iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + /** + * Gets or sets the icon url. + * + * @return iconUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ICON_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIconUrl() { + return iconUrl; + } + + @JsonProperty(JSON_PROPERTY_ICON_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIconUrl(@org.eclipse.jdt.annotation.NonNull String iconUrl) { + this.iconUrl = iconUrl; + } + + /** + * Return true if this ClientCapabilitiesDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientCapabilitiesDto clientCapabilitiesDto = (ClientCapabilitiesDto) o; + return Objects.equals(this.playableMediaTypes, clientCapabilitiesDto.playableMediaTypes) + && Objects.equals(this.supportedCommands, clientCapabilitiesDto.supportedCommands) + && Objects.equals(this.supportsMediaControl, clientCapabilitiesDto.supportsMediaControl) + && Objects.equals(this.supportsPersistentIdentifier, clientCapabilitiesDto.supportsPersistentIdentifier) + && Objects.equals(this.deviceProfile, clientCapabilitiesDto.deviceProfile) + && Objects.equals(this.appStoreUrl, clientCapabilitiesDto.appStoreUrl) + && Objects.equals(this.iconUrl, clientCapabilitiesDto.iconUrl); + } + + @Override + public int hashCode() { + return Objects.hash(playableMediaTypes, supportedCommands, supportsMediaControl, supportsPersistentIdentifier, + deviceProfile, appStoreUrl, iconUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClientCapabilitiesDto {\n"); + sb.append(" playableMediaTypes: ").append(toIndentedString(playableMediaTypes)).append("\n"); + sb.append(" supportedCommands: ").append(toIndentedString(supportedCommands)).append("\n"); + sb.append(" supportsMediaControl: ").append(toIndentedString(supportsMediaControl)).append("\n"); + sb.append(" supportsPersistentIdentifier: ").append(toIndentedString(supportsPersistentIdentifier)) + .append("\n"); + sb.append(" deviceProfile: ").append(toIndentedString(deviceProfile)).append("\n"); + sb.append(" appStoreUrl: ").append(toIndentedString(appStoreUrl)).append("\n"); + sb.append(" iconUrl: ").append(toIndentedString(iconUrl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlayableMediaTypes` to the URL query string + if (getPlayableMediaTypes() != null) { + for (int i = 0; i < getPlayableMediaTypes().size(); i++) { + if (getPlayableMediaTypes().get(i) != null) { + joiner.add(String.format("%sPlayableMediaTypes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getPlayableMediaTypes().get(i))))); + } + } + } + + // add `SupportedCommands` to the URL query string + if (getSupportedCommands() != null) { + for (int i = 0; i < getSupportedCommands().size(); i++) { + if (getSupportedCommands().get(i) != null) { + joiner.add(String.format("%sSupportedCommands%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSupportedCommands().get(i))))); + } + } + } + + // add `SupportsMediaControl` to the URL query string + if (getSupportsMediaControl() != null) { + joiner.add(String.format("%sSupportsMediaControl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsMediaControl())))); + } + + // add `SupportsPersistentIdentifier` to the URL query string + if (getSupportsPersistentIdentifier() != null) { + joiner.add(String.format("%sSupportsPersistentIdentifier%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsPersistentIdentifier())))); + } + + // add `DeviceProfile` to the URL query string + if (getDeviceProfile() != null) { + joiner.add(getDeviceProfile().toUrlQueryString(prefix + "DeviceProfile" + suffix)); + } + + // add `AppStoreUrl` to the URL query string + if (getAppStoreUrl() != null) { + joiner.add(String.format("%sAppStoreUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAppStoreUrl())))); + } + + // add `IconUrl` to the URL query string + if (getIconUrl() != null) { + joiner.add(String.format("%sIconUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIconUrl())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ClientCapabilitiesDto instance; + + public Builder() { + this(new ClientCapabilitiesDto()); + } + + protected Builder(ClientCapabilitiesDto instance) { + this.instance = instance; + } + + public ClientCapabilitiesDto.Builder playableMediaTypes(List playableMediaTypes) { + this.instance.playableMediaTypes = playableMediaTypes; + return this; + } + + public ClientCapabilitiesDto.Builder supportedCommands(List supportedCommands) { + this.instance.supportedCommands = supportedCommands; + return this; + } + + public ClientCapabilitiesDto.Builder supportsMediaControl(Boolean supportsMediaControl) { + this.instance.supportsMediaControl = supportsMediaControl; + return this; + } + + public ClientCapabilitiesDto.Builder supportsPersistentIdentifier(Boolean supportsPersistentIdentifier) { + this.instance.supportsPersistentIdentifier = supportsPersistentIdentifier; + return this; + } + + public ClientCapabilitiesDto.Builder deviceProfile(DeviceProfile deviceProfile) { + this.instance.deviceProfile = deviceProfile; + return this; + } + + public ClientCapabilitiesDto.Builder appStoreUrl(String appStoreUrl) { + this.instance.appStoreUrl = appStoreUrl; + return this; + } + + public ClientCapabilitiesDto.Builder iconUrl(String iconUrl) { + this.instance.iconUrl = iconUrl; + return this; + } + + /** + * returns a built ClientCapabilitiesDto instance. + * + * The builder is not reusable. + */ + public ClientCapabilitiesDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ClientCapabilitiesDto.Builder builder() { + return new ClientCapabilitiesDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ClientCapabilitiesDto.Builder toBuilder() { + return new ClientCapabilitiesDto.Builder().playableMediaTypes(getPlayableMediaTypes()) + .supportedCommands(getSupportedCommands()).supportsMediaControl(getSupportsMediaControl()) + .supportsPersistentIdentifier(getSupportsPersistentIdentifier()).deviceProfile(getDeviceProfile()) + .appStoreUrl(getAppStoreUrl()).iconUrl(getIconUrl()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ClientLogDocumentResponseDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ClientLogDocumentResponseDto.java new file mode 100644 index 0000000000000..51b1ee512fcc8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ClientLogDocumentResponseDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Client log document response dto. + */ +@JsonPropertyOrder({ ClientLogDocumentResponseDto.JSON_PROPERTY_FILE_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ClientLogDocumentResponseDto { + public static final String JSON_PROPERTY_FILE_NAME = "FileName"; + @org.eclipse.jdt.annotation.NonNull + private String fileName; + + public ClientLogDocumentResponseDto() { + } + + public ClientLogDocumentResponseDto fileName(@org.eclipse.jdt.annotation.NonNull String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Gets the resulting filename. + * + * @return fileName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FILE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFileName() { + return fileName; + } + + @JsonProperty(JSON_PROPERTY_FILE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileName(@org.eclipse.jdt.annotation.NonNull String fileName) { + this.fileName = fileName; + } + + /** + * Return true if this ClientLogDocumentResponseDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientLogDocumentResponseDto clientLogDocumentResponseDto = (ClientLogDocumentResponseDto) o; + return Objects.equals(this.fileName, clientLogDocumentResponseDto.fileName); + } + + @Override + public int hashCode() { + return Objects.hash(fileName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClientLogDocumentResponseDto {\n"); + sb.append(" fileName: ").append(toIndentedString(fileName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `FileName` to the URL query string + if (getFileName() != null) { + joiner.add(String.format("%sFileName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFileName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ClientLogDocumentResponseDto instance; + + public Builder() { + this(new ClientLogDocumentResponseDto()); + } + + protected Builder(ClientLogDocumentResponseDto instance) { + this.instance = instance; + } + + public ClientLogDocumentResponseDto.Builder fileName(String fileName) { + this.instance.fileName = fileName; + return this; + } + + /** + * returns a built ClientLogDocumentResponseDto instance. + * + * The builder is not reusable. + */ + public ClientLogDocumentResponseDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ClientLogDocumentResponseDto.Builder builder() { + return new ClientLogDocumentResponseDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ClientLogDocumentResponseDto.Builder toBuilder() { + return new ClientLogDocumentResponseDto.Builder().fileName(getFileName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CodecProfile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CodecProfile.java new file mode 100644 index 0000000000000..7de86d0ff5b3c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CodecProfile.java @@ -0,0 +1,422 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines the MediaBrowser.Model.Dlna.CodecProfile. + */ +@JsonPropertyOrder({ CodecProfile.JSON_PROPERTY_TYPE, CodecProfile.JSON_PROPERTY_CONDITIONS, + CodecProfile.JSON_PROPERTY_APPLY_CONDITIONS, CodecProfile.JSON_PROPERTY_CODEC, + CodecProfile.JSON_PROPERTY_CONTAINER, CodecProfile.JSON_PROPERTY_SUB_CONTAINER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class CodecProfile { + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private CodecType type; + + public static final String JSON_PROPERTY_CONDITIONS = "Conditions"; + @org.eclipse.jdt.annotation.NonNull + private List conditions = new ArrayList<>(); + + public static final String JSON_PROPERTY_APPLY_CONDITIONS = "ApplyConditions"; + @org.eclipse.jdt.annotation.NonNull + private List applyConditions = new ArrayList<>(); + + public static final String JSON_PROPERTY_CODEC = "Codec"; + @org.eclipse.jdt.annotation.NonNull + private String codec; + + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public static final String JSON_PROPERTY_SUB_CONTAINER = "SubContainer"; + @org.eclipse.jdt.annotation.NonNull + private String subContainer; + + public CodecProfile() { + } + + public CodecProfile type(@org.eclipse.jdt.annotation.NonNull CodecType type) { + this.type = type; + return this; + } + + /** + * Gets or sets the MediaBrowser.Model.Dlna.CodecType which this container must meet. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CodecType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull CodecType type) { + this.type = type; + } + + public CodecProfile conditions(@org.eclipse.jdt.annotation.NonNull List conditions) { + this.conditions = conditions; + return this; + } + + public CodecProfile addConditionsItem(ProfileCondition conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * Gets or sets the list of MediaBrowser.Model.Dlna.ProfileCondition which this profile must meet. + * + * @return conditions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getConditions() { + return conditions; + } + + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConditions(@org.eclipse.jdt.annotation.NonNull List conditions) { + this.conditions = conditions; + } + + public CodecProfile applyConditions(@org.eclipse.jdt.annotation.NonNull List applyConditions) { + this.applyConditions = applyConditions; + return this; + } + + public CodecProfile addApplyConditionsItem(ProfileCondition applyConditionsItem) { + if (this.applyConditions == null) { + this.applyConditions = new ArrayList<>(); + } + this.applyConditions.add(applyConditionsItem); + return this; + } + + /** + * Gets or sets the list of MediaBrowser.Model.Dlna.ProfileCondition to apply if this profile is met. + * + * @return applyConditions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APPLY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getApplyConditions() { + return applyConditions; + } + + @JsonProperty(JSON_PROPERTY_APPLY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApplyConditions(@org.eclipse.jdt.annotation.NonNull List applyConditions) { + this.applyConditions = applyConditions; + } + + public CodecProfile codec(@org.eclipse.jdt.annotation.NonNull String codec) { + this.codec = codec; + return this; + } + + /** + * Gets or sets the codec(s) that this profile applies to. + * + * @return codec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCodec() { + return codec; + } + + @JsonProperty(JSON_PROPERTY_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCodec(@org.eclipse.jdt.annotation.NonNull String codec) { + this.codec = codec; + } + + public CodecProfile container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Gets or sets the container(s) which this profile will be applied to. + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + public CodecProfile subContainer(@org.eclipse.jdt.annotation.NonNull String subContainer) { + this.subContainer = subContainer; + return this; + } + + /** + * Gets or sets the sub-container(s) which this profile will be applied to. + * + * @return subContainer + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUB_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubContainer() { + return subContainer; + } + + @JsonProperty(JSON_PROPERTY_SUB_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubContainer(@org.eclipse.jdt.annotation.NonNull String subContainer) { + this.subContainer = subContainer; + } + + /** + * Return true if this CodecProfile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CodecProfile codecProfile = (CodecProfile) o; + return Objects.equals(this.type, codecProfile.type) && Objects.equals(this.conditions, codecProfile.conditions) + && Objects.equals(this.applyConditions, codecProfile.applyConditions) + && Objects.equals(this.codec, codecProfile.codec) + && Objects.equals(this.container, codecProfile.container) + && Objects.equals(this.subContainer, codecProfile.subContainer); + } + + @Override + public int hashCode() { + return Objects.hash(type, conditions, applyConditions, codec, container, subContainer); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CodecProfile {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" applyConditions: ").append(toIndentedString(applyConditions)).append("\n"); + sb.append(" codec: ").append(toIndentedString(codec)).append("\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" subContainer: ").append(toIndentedString(subContainer)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `Conditions` to the URL query string + if (getConditions() != null) { + for (int i = 0; i < getConditions().size(); i++) { + if (getConditions().get(i) != null) { + joiner.add(getConditions().get(i).toUrlQueryString(String.format("%sConditions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ApplyConditions` to the URL query string + if (getApplyConditions() != null) { + for (int i = 0; i < getApplyConditions().size(); i++) { + if (getApplyConditions().get(i) != null) { + joiner.add(getApplyConditions().get(i).toUrlQueryString(String.format("%sApplyConditions%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Codec` to the URL query string + if (getCodec() != null) { + joiner.add(String.format("%sCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCodec())))); + } + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + // add `SubContainer` to the URL query string + if (getSubContainer() != null) { + joiner.add(String.format("%sSubContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubContainer())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private CodecProfile instance; + + public Builder() { + this(new CodecProfile()); + } + + protected Builder(CodecProfile instance) { + this.instance = instance; + } + + public CodecProfile.Builder type(CodecType type) { + this.instance.type = type; + return this; + } + + public CodecProfile.Builder conditions(List conditions) { + this.instance.conditions = conditions; + return this; + } + + public CodecProfile.Builder applyConditions(List applyConditions) { + this.instance.applyConditions = applyConditions; + return this; + } + + public CodecProfile.Builder codec(String codec) { + this.instance.codec = codec; + return this; + } + + public CodecProfile.Builder container(String container) { + this.instance.container = container; + return this; + } + + public CodecProfile.Builder subContainer(String subContainer) { + this.instance.subContainer = subContainer; + return this; + } + + /** + * returns a built CodecProfile instance. + * + * The builder is not reusable. + */ + public CodecProfile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CodecProfile.Builder builder() { + return new CodecProfile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CodecProfile.Builder toBuilder() { + return new CodecProfile.Builder().type(getType()).conditions(getConditions()) + .applyConditions(getApplyConditions()).codec(getCodec()).container(getContainer()) + .subContainer(getSubContainer()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CodecType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CodecType.java new file mode 100644 index 0000000000000..1ca718ee4c32c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CodecType.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets CodecType + */ +public enum CodecType { + + VIDEO("Video"), + + VIDEO_AUDIO("VideoAudio"), + + AUDIO("Audio"); + + private String value; + + CodecType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CodecType fromValue(String value) { + for (CodecType b : CodecType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CollectionCreationResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CollectionCreationResult.java new file mode 100644 index 0000000000000..7d2f4cee2bead --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CollectionCreationResult.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * CollectionCreationResult + */ +@JsonPropertyOrder({ CollectionCreationResult.JSON_PROPERTY_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class CollectionCreationResult { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public CollectionCreationResult() { + } + + public CollectionCreationResult id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + /** + * Return true if this CollectionCreationResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CollectionCreationResult collectionCreationResult = (CollectionCreationResult) o; + return Objects.equals(this.id, collectionCreationResult.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CollectionCreationResult {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private CollectionCreationResult instance; + + public Builder() { + this(new CollectionCreationResult()); + } + + protected Builder(CollectionCreationResult instance) { + this.instance = instance; + } + + public CollectionCreationResult.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + /** + * returns a built CollectionCreationResult instance. + * + * The builder is not reusable. + */ + public CollectionCreationResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CollectionCreationResult.Builder builder() { + return new CollectionCreationResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CollectionCreationResult.Builder toBuilder() { + return new CollectionCreationResult.Builder().id(getId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CollectionType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CollectionType.java new file mode 100644 index 0000000000000..6e0f783248fa4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CollectionType.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Collection type. + */ +public enum CollectionType { + + UNKNOWN("unknown"), + + MOVIES("movies"), + + TVSHOWS("tvshows"), + + MUSIC("music"), + + MUSICVIDEOS("musicvideos"), + + TRAILERS("trailers"), + + HOMEVIDEOS("homevideos"), + + BOXSETS("boxsets"), + + BOOKS("books"), + + PHOTOS("photos"), + + LIVETV("livetv"), + + PLAYLISTS("playlists"), + + FOLDERS("folders"); + + private String value; + + CollectionType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CollectionType fromValue(String value) { + for (CollectionType b : CollectionType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CollectionTypeOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CollectionTypeOptions.java new file mode 100644 index 0000000000000..73343beee6166 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CollectionTypeOptions.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The collection type options. + */ +public enum CollectionTypeOptions { + + MOVIES("movies"), + + TVSHOWS("tvshows"), + + MUSIC("music"), + + MUSICVIDEOS("musicvideos"), + + HOMEVIDEOS("homevideos"), + + BOXSETS("boxsets"), + + BOOKS("books"), + + MIXED("mixed"); + + private String value; + + CollectionTypeOptions(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CollectionTypeOptions fromValue(String value) { + for (CollectionTypeOptions b : CollectionTypeOptions.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ConfigImageTypes.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ConfigImageTypes.java new file mode 100644 index 0000000000000..8cda5f7e66d59 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ConfigImageTypes.java @@ -0,0 +1,494 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ConfigImageTypes + */ +@JsonPropertyOrder({ ConfigImageTypes.JSON_PROPERTY_BACKDROP_SIZES, ConfigImageTypes.JSON_PROPERTY_BASE_URL, + ConfigImageTypes.JSON_PROPERTY_LOGO_SIZES, ConfigImageTypes.JSON_PROPERTY_POSTER_SIZES, + ConfigImageTypes.JSON_PROPERTY_PROFILE_SIZES, ConfigImageTypes.JSON_PROPERTY_SECURE_BASE_URL, + ConfigImageTypes.JSON_PROPERTY_STILL_SIZES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ConfigImageTypes { + public static final String JSON_PROPERTY_BACKDROP_SIZES = "BackdropSizes"; + @org.eclipse.jdt.annotation.NonNull + private List backdropSizes; + + public static final String JSON_PROPERTY_BASE_URL = "BaseUrl"; + @org.eclipse.jdt.annotation.NonNull + private String baseUrl; + + public static final String JSON_PROPERTY_LOGO_SIZES = "LogoSizes"; + @org.eclipse.jdt.annotation.NonNull + private List logoSizes; + + public static final String JSON_PROPERTY_POSTER_SIZES = "PosterSizes"; + @org.eclipse.jdt.annotation.NonNull + private List posterSizes; + + public static final String JSON_PROPERTY_PROFILE_SIZES = "ProfileSizes"; + @org.eclipse.jdt.annotation.NonNull + private List profileSizes; + + public static final String JSON_PROPERTY_SECURE_BASE_URL = "SecureBaseUrl"; + @org.eclipse.jdt.annotation.NonNull + private String secureBaseUrl; + + public static final String JSON_PROPERTY_STILL_SIZES = "StillSizes"; + @org.eclipse.jdt.annotation.NonNull + private List stillSizes; + + public ConfigImageTypes() { + } + + public ConfigImageTypes backdropSizes(@org.eclipse.jdt.annotation.NonNull List backdropSizes) { + this.backdropSizes = backdropSizes; + return this; + } + + public ConfigImageTypes addBackdropSizesItem(String backdropSizesItem) { + if (this.backdropSizes == null) { + this.backdropSizes = new ArrayList<>(); + } + this.backdropSizes.add(backdropSizesItem); + return this; + } + + /** + * Get backdropSizes + * + * @return backdropSizes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BACKDROP_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBackdropSizes() { + return backdropSizes; + } + + @JsonProperty(JSON_PROPERTY_BACKDROP_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBackdropSizes(@org.eclipse.jdt.annotation.NonNull List backdropSizes) { + this.backdropSizes = backdropSizes; + } + + public ConfigImageTypes baseUrl(@org.eclipse.jdt.annotation.NonNull String baseUrl) { + this.baseUrl = baseUrl; + return this; + } + + /** + * Get baseUrl + * + * @return baseUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BASE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaseUrl() { + return baseUrl; + } + + @JsonProperty(JSON_PROPERTY_BASE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBaseUrl(@org.eclipse.jdt.annotation.NonNull String baseUrl) { + this.baseUrl = baseUrl; + } + + public ConfigImageTypes logoSizes(@org.eclipse.jdt.annotation.NonNull List logoSizes) { + this.logoSizes = logoSizes; + return this; + } + + public ConfigImageTypes addLogoSizesItem(String logoSizesItem) { + if (this.logoSizes == null) { + this.logoSizes = new ArrayList<>(); + } + this.logoSizes.add(logoSizesItem); + return this; + } + + /** + * Get logoSizes + * + * @return logoSizes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOGO_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLogoSizes() { + return logoSizes; + } + + @JsonProperty(JSON_PROPERTY_LOGO_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogoSizes(@org.eclipse.jdt.annotation.NonNull List logoSizes) { + this.logoSizes = logoSizes; + } + + public ConfigImageTypes posterSizes(@org.eclipse.jdt.annotation.NonNull List posterSizes) { + this.posterSizes = posterSizes; + return this; + } + + public ConfigImageTypes addPosterSizesItem(String posterSizesItem) { + if (this.posterSizes == null) { + this.posterSizes = new ArrayList<>(); + } + this.posterSizes.add(posterSizesItem); + return this; + } + + /** + * Get posterSizes + * + * @return posterSizes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSTER_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPosterSizes() { + return posterSizes; + } + + @JsonProperty(JSON_PROPERTY_POSTER_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPosterSizes(@org.eclipse.jdt.annotation.NonNull List posterSizes) { + this.posterSizes = posterSizes; + } + + public ConfigImageTypes profileSizes(@org.eclipse.jdt.annotation.NonNull List profileSizes) { + this.profileSizes = profileSizes; + return this; + } + + public ConfigImageTypes addProfileSizesItem(String profileSizesItem) { + if (this.profileSizes == null) { + this.profileSizes = new ArrayList<>(); + } + this.profileSizes.add(profileSizesItem); + return this; + } + + /** + * Get profileSizes + * + * @return profileSizes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROFILE_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getProfileSizes() { + return profileSizes; + } + + @JsonProperty(JSON_PROPERTY_PROFILE_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProfileSizes(@org.eclipse.jdt.annotation.NonNull List profileSizes) { + this.profileSizes = profileSizes; + } + + public ConfigImageTypes secureBaseUrl(@org.eclipse.jdt.annotation.NonNull String secureBaseUrl) { + this.secureBaseUrl = secureBaseUrl; + return this; + } + + /** + * Get secureBaseUrl + * + * @return secureBaseUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SECURE_BASE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecureBaseUrl() { + return secureBaseUrl; + } + + @JsonProperty(JSON_PROPERTY_SECURE_BASE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecureBaseUrl(@org.eclipse.jdt.annotation.NonNull String secureBaseUrl) { + this.secureBaseUrl = secureBaseUrl; + } + + public ConfigImageTypes stillSizes(@org.eclipse.jdt.annotation.NonNull List stillSizes) { + this.stillSizes = stillSizes; + return this; + } + + public ConfigImageTypes addStillSizesItem(String stillSizesItem) { + if (this.stillSizes == null) { + this.stillSizes = new ArrayList<>(); + } + this.stillSizes.add(stillSizesItem); + return this; + } + + /** + * Get stillSizes + * + * @return stillSizes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STILL_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStillSizes() { + return stillSizes; + } + + @JsonProperty(JSON_PROPERTY_STILL_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStillSizes(@org.eclipse.jdt.annotation.NonNull List stillSizes) { + this.stillSizes = stillSizes; + } + + /** + * Return true if this ConfigImageTypes object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConfigImageTypes configImageTypes = (ConfigImageTypes) o; + return Objects.equals(this.backdropSizes, configImageTypes.backdropSizes) + && Objects.equals(this.baseUrl, configImageTypes.baseUrl) + && Objects.equals(this.logoSizes, configImageTypes.logoSizes) + && Objects.equals(this.posterSizes, configImageTypes.posterSizes) + && Objects.equals(this.profileSizes, configImageTypes.profileSizes) + && Objects.equals(this.secureBaseUrl, configImageTypes.secureBaseUrl) + && Objects.equals(this.stillSizes, configImageTypes.stillSizes); + } + + @Override + public int hashCode() { + return Objects.hash(backdropSizes, baseUrl, logoSizes, posterSizes, profileSizes, secureBaseUrl, stillSizes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConfigImageTypes {\n"); + sb.append(" backdropSizes: ").append(toIndentedString(backdropSizes)).append("\n"); + sb.append(" baseUrl: ").append(toIndentedString(baseUrl)).append("\n"); + sb.append(" logoSizes: ").append(toIndentedString(logoSizes)).append("\n"); + sb.append(" posterSizes: ").append(toIndentedString(posterSizes)).append("\n"); + sb.append(" profileSizes: ").append(toIndentedString(profileSizes)).append("\n"); + sb.append(" secureBaseUrl: ").append(toIndentedString(secureBaseUrl)).append("\n"); + sb.append(" stillSizes: ").append(toIndentedString(stillSizes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `BackdropSizes` to the URL query string + if (getBackdropSizes() != null) { + for (int i = 0; i < getBackdropSizes().size(); i++) { + joiner.add(String.format("%sBackdropSizes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getBackdropSizes().get(i))))); + } + } + + // add `BaseUrl` to the URL query string + if (getBaseUrl() != null) { + joiner.add(String.format("%sBaseUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBaseUrl())))); + } + + // add `LogoSizes` to the URL query string + if (getLogoSizes() != null) { + for (int i = 0; i < getLogoSizes().size(); i++) { + joiner.add(String.format("%sLogoSizes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLogoSizes().get(i))))); + } + } + + // add `PosterSizes` to the URL query string + if (getPosterSizes() != null) { + for (int i = 0; i < getPosterSizes().size(); i++) { + joiner.add(String.format("%sPosterSizes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getPosterSizes().get(i))))); + } + } + + // add `ProfileSizes` to the URL query string + if (getProfileSizes() != null) { + for (int i = 0; i < getProfileSizes().size(); i++) { + joiner.add(String.format("%sProfileSizes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getProfileSizes().get(i))))); + } + } + + // add `SecureBaseUrl` to the URL query string + if (getSecureBaseUrl() != null) { + joiner.add(String.format("%sSecureBaseUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSecureBaseUrl())))); + } + + // add `StillSizes` to the URL query string + if (getStillSizes() != null) { + for (int i = 0; i < getStillSizes().size(); i++) { + joiner.add(String.format("%sStillSizes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getStillSizes().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private ConfigImageTypes instance; + + public Builder() { + this(new ConfigImageTypes()); + } + + protected Builder(ConfigImageTypes instance) { + this.instance = instance; + } + + public ConfigImageTypes.Builder backdropSizes(List backdropSizes) { + this.instance.backdropSizes = backdropSizes; + return this; + } + + public ConfigImageTypes.Builder baseUrl(String baseUrl) { + this.instance.baseUrl = baseUrl; + return this; + } + + public ConfigImageTypes.Builder logoSizes(List logoSizes) { + this.instance.logoSizes = logoSizes; + return this; + } + + public ConfigImageTypes.Builder posterSizes(List posterSizes) { + this.instance.posterSizes = posterSizes; + return this; + } + + public ConfigImageTypes.Builder profileSizes(List profileSizes) { + this.instance.profileSizes = profileSizes; + return this; + } + + public ConfigImageTypes.Builder secureBaseUrl(String secureBaseUrl) { + this.instance.secureBaseUrl = secureBaseUrl; + return this; + } + + public ConfigImageTypes.Builder stillSizes(List stillSizes) { + this.instance.stillSizes = stillSizes; + return this; + } + + /** + * returns a built ConfigImageTypes instance. + * + * The builder is not reusable. + */ + public ConfigImageTypes build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ConfigImageTypes.Builder builder() { + return new ConfigImageTypes.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ConfigImageTypes.Builder toBuilder() { + return new ConfigImageTypes.Builder().backdropSizes(getBackdropSizes()).baseUrl(getBaseUrl()) + .logoSizes(getLogoSizes()).posterSizes(getPosterSizes()).profileSizes(getProfileSizes()) + .secureBaseUrl(getSecureBaseUrl()).stillSizes(getStillSizes()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ConfigurationPageInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ConfigurationPageInfo.java new file mode 100644 index 0000000000000..35711f3550ba1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ConfigurationPageInfo.java @@ -0,0 +1,397 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The configuration page info. + */ +@JsonPropertyOrder({ ConfigurationPageInfo.JSON_PROPERTY_NAME, ConfigurationPageInfo.JSON_PROPERTY_ENABLE_IN_MAIN_MENU, + ConfigurationPageInfo.JSON_PROPERTY_MENU_SECTION, ConfigurationPageInfo.JSON_PROPERTY_MENU_ICON, + ConfigurationPageInfo.JSON_PROPERTY_DISPLAY_NAME, ConfigurationPageInfo.JSON_PROPERTY_PLUGIN_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ConfigurationPageInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ENABLE_IN_MAIN_MENU = "EnableInMainMenu"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableInMainMenu; + + public static final String JSON_PROPERTY_MENU_SECTION = "MenuSection"; + @org.eclipse.jdt.annotation.NonNull + private String menuSection; + + public static final String JSON_PROPERTY_MENU_ICON = "MenuIcon"; + @org.eclipse.jdt.annotation.NonNull + private String menuIcon; + + public static final String JSON_PROPERTY_DISPLAY_NAME = "DisplayName"; + @org.eclipse.jdt.annotation.NonNull + private String displayName; + + public static final String JSON_PROPERTY_PLUGIN_ID = "PluginId"; + @org.eclipse.jdt.annotation.NonNull + private UUID pluginId; + + public ConfigurationPageInfo() { + } + + public ConfigurationPageInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ConfigurationPageInfo enableInMainMenu(@org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu) { + this.enableInMainMenu = enableInMainMenu; + return this; + } + + /** + * Gets or sets a value indicating whether the configurations page is enabled in the main menu. + * + * @return enableInMainMenu + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_IN_MAIN_MENU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableInMainMenu() { + return enableInMainMenu; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_IN_MAIN_MENU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableInMainMenu(@org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu) { + this.enableInMainMenu = enableInMainMenu; + } + + public ConfigurationPageInfo menuSection(@org.eclipse.jdt.annotation.NonNull String menuSection) { + this.menuSection = menuSection; + return this; + } + + /** + * Gets or sets the menu section. + * + * @return menuSection + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MENU_SECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMenuSection() { + return menuSection; + } + + @JsonProperty(JSON_PROPERTY_MENU_SECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMenuSection(@org.eclipse.jdt.annotation.NonNull String menuSection) { + this.menuSection = menuSection; + } + + public ConfigurationPageInfo menuIcon(@org.eclipse.jdt.annotation.NonNull String menuIcon) { + this.menuIcon = menuIcon; + return this; + } + + /** + * Gets or sets the menu icon. + * + * @return menuIcon + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MENU_ICON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMenuIcon() { + return menuIcon; + } + + @JsonProperty(JSON_PROPERTY_MENU_ICON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMenuIcon(@org.eclipse.jdt.annotation.NonNull String menuIcon) { + this.menuIcon = menuIcon; + } + + public ConfigurationPageInfo displayName(@org.eclipse.jdt.annotation.NonNull String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Gets or sets the display name. + * + * @return displayName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayName() { + return displayName; + } + + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayName(@org.eclipse.jdt.annotation.NonNull String displayName) { + this.displayName = displayName; + } + + public ConfigurationPageInfo pluginId(@org.eclipse.jdt.annotation.NonNull UUID pluginId) { + this.pluginId = pluginId; + return this; + } + + /** + * Gets or sets the plugin id. + * + * @return pluginId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLUGIN_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPluginId() { + return pluginId; + } + + @JsonProperty(JSON_PROPERTY_PLUGIN_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPluginId(@org.eclipse.jdt.annotation.NonNull UUID pluginId) { + this.pluginId = pluginId; + } + + /** + * Return true if this ConfigurationPageInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConfigurationPageInfo configurationPageInfo = (ConfigurationPageInfo) o; + return Objects.equals(this.name, configurationPageInfo.name) + && Objects.equals(this.enableInMainMenu, configurationPageInfo.enableInMainMenu) + && Objects.equals(this.menuSection, configurationPageInfo.menuSection) + && Objects.equals(this.menuIcon, configurationPageInfo.menuIcon) + && Objects.equals(this.displayName, configurationPageInfo.displayName) + && Objects.equals(this.pluginId, configurationPageInfo.pluginId); + } + + @Override + public int hashCode() { + return Objects.hash(name, enableInMainMenu, menuSection, menuIcon, displayName, pluginId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConfigurationPageInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" enableInMainMenu: ").append(toIndentedString(enableInMainMenu)).append("\n"); + sb.append(" menuSection: ").append(toIndentedString(menuSection)).append("\n"); + sb.append(" menuIcon: ").append(toIndentedString(menuIcon)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" pluginId: ").append(toIndentedString(pluginId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `EnableInMainMenu` to the URL query string + if (getEnableInMainMenu() != null) { + joiner.add(String.format("%sEnableInMainMenu%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableInMainMenu())))); + } + + // add `MenuSection` to the URL query string + if (getMenuSection() != null) { + joiner.add(String.format("%sMenuSection%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMenuSection())))); + } + + // add `MenuIcon` to the URL query string + if (getMenuIcon() != null) { + joiner.add(String.format("%sMenuIcon%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMenuIcon())))); + } + + // add `DisplayName` to the URL query string + if (getDisplayName() != null) { + joiner.add(String.format("%sDisplayName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplayName())))); + } + + // add `PluginId` to the URL query string + if (getPluginId() != null) { + joiner.add(String.format("%sPluginId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPluginId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ConfigurationPageInfo instance; + + public Builder() { + this(new ConfigurationPageInfo()); + } + + protected Builder(ConfigurationPageInfo instance) { + this.instance = instance; + } + + public ConfigurationPageInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ConfigurationPageInfo.Builder enableInMainMenu(Boolean enableInMainMenu) { + this.instance.enableInMainMenu = enableInMainMenu; + return this; + } + + public ConfigurationPageInfo.Builder menuSection(String menuSection) { + this.instance.menuSection = menuSection; + return this; + } + + public ConfigurationPageInfo.Builder menuIcon(String menuIcon) { + this.instance.menuIcon = menuIcon; + return this; + } + + public ConfigurationPageInfo.Builder displayName(String displayName) { + this.instance.displayName = displayName; + return this; + } + + public ConfigurationPageInfo.Builder pluginId(UUID pluginId) { + this.instance.pluginId = pluginId; + return this; + } + + /** + * returns a built ConfigurationPageInfo instance. + * + * The builder is not reusable. + */ + public ConfigurationPageInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ConfigurationPageInfo.Builder builder() { + return new ConfigurationPageInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ConfigurationPageInfo.Builder toBuilder() { + return new ConfigurationPageInfo.Builder().name(getName()).enableInMainMenu(getEnableInMainMenu()) + .menuSection(getMenuSection()).menuIcon(getMenuIcon()).displayName(getDisplayName()) + .pluginId(getPluginId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ContainerProfile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ContainerProfile.java new file mode 100644 index 0000000000000..f20a6c0a847e7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ContainerProfile.java @@ -0,0 +1,328 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines the MediaBrowser.Model.Dlna.ContainerProfile. + */ +@JsonPropertyOrder({ ContainerProfile.JSON_PROPERTY_TYPE, ContainerProfile.JSON_PROPERTY_CONDITIONS, + ContainerProfile.JSON_PROPERTY_CONTAINER, ContainerProfile.JSON_PROPERTY_SUB_CONTAINER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ContainerProfile { + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private DlnaProfileType type; + + public static final String JSON_PROPERTY_CONDITIONS = "Conditions"; + @org.eclipse.jdt.annotation.NonNull + private List conditions = new ArrayList<>(); + + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public static final String JSON_PROPERTY_SUB_CONTAINER = "SubContainer"; + @org.eclipse.jdt.annotation.NonNull + private String subContainer; + + public ContainerProfile() { + } + + public ContainerProfile type(@org.eclipse.jdt.annotation.NonNull DlnaProfileType type) { + this.type = type; + return this; + } + + /** + * Gets or sets the MediaBrowser.Model.Dlna.DlnaProfileType which this container must meet. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DlnaProfileType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull DlnaProfileType type) { + this.type = type; + } + + public ContainerProfile conditions(@org.eclipse.jdt.annotation.NonNull List conditions) { + this.conditions = conditions; + return this; + } + + public ContainerProfile addConditionsItem(ProfileCondition conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * Gets or sets the list of MediaBrowser.Model.Dlna.ProfileCondition which this container will be applied to. + * + * @return conditions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getConditions() { + return conditions; + } + + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConditions(@org.eclipse.jdt.annotation.NonNull List conditions) { + this.conditions = conditions; + } + + public ContainerProfile container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Gets or sets the container(s) which this container must meet. + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + public ContainerProfile subContainer(@org.eclipse.jdt.annotation.NonNull String subContainer) { + this.subContainer = subContainer; + return this; + } + + /** + * Gets or sets the sub container(s) which this container must meet. + * + * @return subContainer + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUB_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubContainer() { + return subContainer; + } + + @JsonProperty(JSON_PROPERTY_SUB_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubContainer(@org.eclipse.jdt.annotation.NonNull String subContainer) { + this.subContainer = subContainer; + } + + /** + * Return true if this ContainerProfile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerProfile containerProfile = (ContainerProfile) o; + return Objects.equals(this.type, containerProfile.type) + && Objects.equals(this.conditions, containerProfile.conditions) + && Objects.equals(this.container, containerProfile.container) + && Objects.equals(this.subContainer, containerProfile.subContainer); + } + + @Override + public int hashCode() { + return Objects.hash(type, conditions, container, subContainer); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerProfile {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" subContainer: ").append(toIndentedString(subContainer)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `Conditions` to the URL query string + if (getConditions() != null) { + for (int i = 0; i < getConditions().size(); i++) { + if (getConditions().get(i) != null) { + joiner.add(getConditions().get(i).toUrlQueryString(String.format("%sConditions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + // add `SubContainer` to the URL query string + if (getSubContainer() != null) { + joiner.add(String.format("%sSubContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubContainer())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ContainerProfile instance; + + public Builder() { + this(new ContainerProfile()); + } + + protected Builder(ContainerProfile instance) { + this.instance = instance; + } + + public ContainerProfile.Builder type(DlnaProfileType type) { + this.instance.type = type; + return this; + } + + public ContainerProfile.Builder conditions(List conditions) { + this.instance.conditions = conditions; + return this; + } + + public ContainerProfile.Builder container(String container) { + this.instance.container = container; + return this; + } + + public ContainerProfile.Builder subContainer(String subContainer) { + this.instance.subContainer = subContainer; + return this; + } + + /** + * returns a built ContainerProfile instance. + * + * The builder is not reusable. + */ + public ContainerProfile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ContainerProfile.Builder builder() { + return new ContainerProfile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ContainerProfile.Builder toBuilder() { + return new ContainerProfile.Builder().type(getType()).conditions(getConditions()).container(getContainer()) + .subContainer(getSubContainer()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CountryInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CountryInfo.java new file mode 100644 index 0000000000000..90059a833ef2d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CountryInfo.java @@ -0,0 +1,315 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class CountryInfo. + */ +@JsonPropertyOrder({ CountryInfo.JSON_PROPERTY_NAME, CountryInfo.JSON_PROPERTY_DISPLAY_NAME, + CountryInfo.JSON_PROPERTY_TWO_LETTER_I_S_O_REGION_NAME, + CountryInfo.JSON_PROPERTY_THREE_LETTER_I_S_O_REGION_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class CountryInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_DISPLAY_NAME = "DisplayName"; + @org.eclipse.jdt.annotation.NonNull + private String displayName; + + public static final String JSON_PROPERTY_TWO_LETTER_I_S_O_REGION_NAME = "TwoLetterISORegionName"; + @org.eclipse.jdt.annotation.NonNull + private String twoLetterISORegionName; + + public static final String JSON_PROPERTY_THREE_LETTER_I_S_O_REGION_NAME = "ThreeLetterISORegionName"; + @org.eclipse.jdt.annotation.NonNull + private String threeLetterISORegionName; + + public CountryInfo() { + } + + public CountryInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public CountryInfo displayName(@org.eclipse.jdt.annotation.NonNull String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Gets or sets the display name. + * + * @return displayName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayName() { + return displayName; + } + + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayName(@org.eclipse.jdt.annotation.NonNull String displayName) { + this.displayName = displayName; + } + + public CountryInfo twoLetterISORegionName(@org.eclipse.jdt.annotation.NonNull String twoLetterISORegionName) { + this.twoLetterISORegionName = twoLetterISORegionName; + return this; + } + + /** + * Gets or sets the name of the two letter ISO region. + * + * @return twoLetterISORegionName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TWO_LETTER_I_S_O_REGION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTwoLetterISORegionName() { + return twoLetterISORegionName; + } + + @JsonProperty(JSON_PROPERTY_TWO_LETTER_I_S_O_REGION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTwoLetterISORegionName(@org.eclipse.jdt.annotation.NonNull String twoLetterISORegionName) { + this.twoLetterISORegionName = twoLetterISORegionName; + } + + public CountryInfo threeLetterISORegionName(@org.eclipse.jdt.annotation.NonNull String threeLetterISORegionName) { + this.threeLetterISORegionName = threeLetterISORegionName; + return this; + } + + /** + * Gets or sets the name of the three letter ISO region. + * + * @return threeLetterISORegionName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THREE_LETTER_I_S_O_REGION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getThreeLetterISORegionName() { + return threeLetterISORegionName; + } + + @JsonProperty(JSON_PROPERTY_THREE_LETTER_I_S_O_REGION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThreeLetterISORegionName(@org.eclipse.jdt.annotation.NonNull String threeLetterISORegionName) { + this.threeLetterISORegionName = threeLetterISORegionName; + } + + /** + * Return true if this CountryInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CountryInfo countryInfo = (CountryInfo) o; + return Objects.equals(this.name, countryInfo.name) && Objects.equals(this.displayName, countryInfo.displayName) + && Objects.equals(this.twoLetterISORegionName, countryInfo.twoLetterISORegionName) + && Objects.equals(this.threeLetterISORegionName, countryInfo.threeLetterISORegionName); + } + + @Override + public int hashCode() { + return Objects.hash(name, displayName, twoLetterISORegionName, threeLetterISORegionName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CountryInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" twoLetterISORegionName: ").append(toIndentedString(twoLetterISORegionName)).append("\n"); + sb.append(" threeLetterISORegionName: ").append(toIndentedString(threeLetterISORegionName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `DisplayName` to the URL query string + if (getDisplayName() != null) { + joiner.add(String.format("%sDisplayName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplayName())))); + } + + // add `TwoLetterISORegionName` to the URL query string + if (getTwoLetterISORegionName() != null) { + joiner.add(String.format("%sTwoLetterISORegionName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTwoLetterISORegionName())))); + } + + // add `ThreeLetterISORegionName` to the URL query string + if (getThreeLetterISORegionName() != null) { + joiner.add(String.format("%sThreeLetterISORegionName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getThreeLetterISORegionName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private CountryInfo instance; + + public Builder() { + this(new CountryInfo()); + } + + protected Builder(CountryInfo instance) { + this.instance = instance; + } + + public CountryInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public CountryInfo.Builder displayName(String displayName) { + this.instance.displayName = displayName; + return this; + } + + public CountryInfo.Builder twoLetterISORegionName(String twoLetterISORegionName) { + this.instance.twoLetterISORegionName = twoLetterISORegionName; + return this; + } + + public CountryInfo.Builder threeLetterISORegionName(String threeLetterISORegionName) { + this.instance.threeLetterISORegionName = threeLetterISORegionName; + return this; + } + + /** + * returns a built CountryInfo instance. + * + * The builder is not reusable. + */ + public CountryInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CountryInfo.Builder builder() { + return new CountryInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CountryInfo.Builder toBuilder() { + return new CountryInfo.Builder().name(getName()).displayName(getDisplayName()) + .twoLetterISORegionName(getTwoLetterISORegionName()) + .threeLetterISORegionName(getThreeLetterISORegionName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CreatePlaylistDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CreatePlaylistDto.java new file mode 100644 index 0000000000000..13ce6c7eb9748 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CreatePlaylistDto.java @@ -0,0 +1,422 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Create new playlist dto. + */ +@JsonPropertyOrder({ CreatePlaylistDto.JSON_PROPERTY_NAME, CreatePlaylistDto.JSON_PROPERTY_IDS, + CreatePlaylistDto.JSON_PROPERTY_USER_ID, CreatePlaylistDto.JSON_PROPERTY_MEDIA_TYPE, + CreatePlaylistDto.JSON_PROPERTY_USERS, CreatePlaylistDto.JSON_PROPERTY_IS_PUBLIC }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class CreatePlaylistDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_IDS = "Ids"; + @org.eclipse.jdt.annotation.NonNull + private List ids = new ArrayList<>(); + + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_MEDIA_TYPE = "MediaType"; + @org.eclipse.jdt.annotation.NonNull + private MediaType mediaType; + + public static final String JSON_PROPERTY_USERS = "Users"; + @org.eclipse.jdt.annotation.NonNull + private List users = new ArrayList<>(); + + public static final String JSON_PROPERTY_IS_PUBLIC = "IsPublic"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPublic; + + public CreatePlaylistDto() { + } + + public CreatePlaylistDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name of the new playlist. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public CreatePlaylistDto ids(@org.eclipse.jdt.annotation.NonNull List ids) { + this.ids = ids; + return this; + } + + public CreatePlaylistDto addIdsItem(UUID idsItem) { + if (this.ids == null) { + this.ids = new ArrayList<>(); + } + this.ids.add(idsItem); + return this; + } + + /** + * Gets or sets item ids to add to the playlist. + * + * @return ids + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIds() { + return ids; + } + + @JsonProperty(JSON_PROPERTY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIds(@org.eclipse.jdt.annotation.NonNull List ids) { + this.ids = ids; + } + + public CreatePlaylistDto userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the user id. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public CreatePlaylistDto mediaType(@org.eclipse.jdt.annotation.NonNull MediaType mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Gets or sets the media type. + * + * @return mediaType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaType getMediaType() { + return mediaType; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaType(@org.eclipse.jdt.annotation.NonNull MediaType mediaType) { + this.mediaType = mediaType; + } + + public CreatePlaylistDto users(@org.eclipse.jdt.annotation.NonNull List users) { + this.users = users; + return this; + } + + public CreatePlaylistDto addUsersItem(PlaylistUserPermissions usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + return this; + } + + /** + * Gets or sets the playlist users. + * + * @return users + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getUsers() { + return users; + } + + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsers(@org.eclipse.jdt.annotation.NonNull List users) { + this.users = users; + } + + public CreatePlaylistDto isPublic(@org.eclipse.jdt.annotation.NonNull Boolean isPublic) { + this.isPublic = isPublic; + return this; + } + + /** + * Gets or sets a value indicating whether the playlist is public. + * + * @return isPublic + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PUBLIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPublic() { + return isPublic; + } + + @JsonProperty(JSON_PROPERTY_IS_PUBLIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPublic(@org.eclipse.jdt.annotation.NonNull Boolean isPublic) { + this.isPublic = isPublic; + } + + /** + * Return true if this CreatePlaylistDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePlaylistDto createPlaylistDto = (CreatePlaylistDto) o; + return Objects.equals(this.name, createPlaylistDto.name) && Objects.equals(this.ids, createPlaylistDto.ids) + && Objects.equals(this.userId, createPlaylistDto.userId) + && Objects.equals(this.mediaType, createPlaylistDto.mediaType) + && Objects.equals(this.users, createPlaylistDto.users) + && Objects.equals(this.isPublic, createPlaylistDto.isPublic); + } + + @Override + public int hashCode() { + return Objects.hash(name, ids, userId, mediaType, users, isPublic); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreatePlaylistDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ids: ").append(toIndentedString(ids)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" mediaType: ").append(toIndentedString(mediaType)).append("\n"); + sb.append(" users: ").append(toIndentedString(users)).append("\n"); + sb.append(" isPublic: ").append(toIndentedString(isPublic)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Ids` to the URL query string + if (getIds() != null) { + for (int i = 0; i < getIds().size(); i++) { + if (getIds().get(i) != null) { + joiner.add(String.format("%sIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getIds().get(i))))); + } + } + } + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `MediaType` to the URL query string + if (getMediaType() != null) { + joiner.add(String.format("%sMediaType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaType())))); + } + + // add `Users` to the URL query string + if (getUsers() != null) { + for (int i = 0; i < getUsers().size(); i++) { + if (getUsers().get(i) != null) { + joiner.add(getUsers().get(i).toUrlQueryString(String.format("%sUsers%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `IsPublic` to the URL query string + if (getIsPublic() != null) { + joiner.add(String.format("%sIsPublic%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPublic())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private CreatePlaylistDto instance; + + public Builder() { + this(new CreatePlaylistDto()); + } + + protected Builder(CreatePlaylistDto instance) { + this.instance = instance; + } + + public CreatePlaylistDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public CreatePlaylistDto.Builder ids(List ids) { + this.instance.ids = ids; + return this; + } + + public CreatePlaylistDto.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public CreatePlaylistDto.Builder mediaType(MediaType mediaType) { + this.instance.mediaType = mediaType; + return this; + } + + public CreatePlaylistDto.Builder users(List users) { + this.instance.users = users; + return this; + } + + public CreatePlaylistDto.Builder isPublic(Boolean isPublic) { + this.instance.isPublic = isPublic; + return this; + } + + /** + * returns a built CreatePlaylistDto instance. + * + * The builder is not reusable. + */ + public CreatePlaylistDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CreatePlaylistDto.Builder builder() { + return new CreatePlaylistDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CreatePlaylistDto.Builder toBuilder() { + return new CreatePlaylistDto.Builder().name(getName()).ids(getIds()).userId(getUserId()) + .mediaType(getMediaType()).users(getUsers()).isPublic(getIsPublic()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CreateUserByName.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CreateUserByName.java new file mode 100644 index 0000000000000..8a5091f60b178 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CreateUserByName.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The create user by name request body. + */ +@JsonPropertyOrder({ CreateUserByName.JSON_PROPERTY_NAME, CreateUserByName.JSON_PROPERTY_PASSWORD }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class CreateUserByName { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_PASSWORD = "Password"; + @org.eclipse.jdt.annotation.NonNull + private String password; + + public CreateUserByName() { + } + + public CreateUserByName name(@org.eclipse.jdt.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the username. + * + * @return name + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@org.eclipse.jdt.annotation.Nullable String name) { + this.name = name; + } + + public CreateUserByName password(@org.eclipse.jdt.annotation.NonNull String password) { + this.password = password; + return this; + } + + /** + * Gets or sets the password. + * + * @return password + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(@org.eclipse.jdt.annotation.NonNull String password) { + this.password = password; + } + + /** + * Return true if this CreateUserByName object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUserByName createUserByName = (CreateUserByName) o; + return Objects.equals(this.name, createUserByName.name) + && Objects.equals(this.password, createUserByName.password); + } + + @Override + public int hashCode() { + return Objects.hash(name, password); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUserByName {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Password` to the URL query string + if (getPassword() != null) { + joiner.add(String.format("%sPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPassword())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private CreateUserByName instance; + + public Builder() { + this(new CreateUserByName()); + } + + protected Builder(CreateUserByName instance) { + this.instance = instance; + } + + public CreateUserByName.Builder name(String name) { + this.instance.name = name; + return this; + } + + public CreateUserByName.Builder password(String password) { + this.instance.password = password; + return this; + } + + /** + * returns a built CreateUserByName instance. + * + * The builder is not reusable. + */ + public CreateUserByName build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CreateUserByName.Builder builder() { + return new CreateUserByName.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CreateUserByName.Builder toBuilder() { + return new CreateUserByName.Builder().name(getName()).password(getPassword()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CultureDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CultureDto.java new file mode 100644 index 0000000000000..691cf0a313f25 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/CultureDto.java @@ -0,0 +1,370 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class CultureDto. + */ +@JsonPropertyOrder({ CultureDto.JSON_PROPERTY_NAME, CultureDto.JSON_PROPERTY_DISPLAY_NAME, + CultureDto.JSON_PROPERTY_TWO_LETTER_I_S_O_LANGUAGE_NAME, + CultureDto.JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME, + CultureDto.JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAMES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class CultureDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_DISPLAY_NAME = "DisplayName"; + @org.eclipse.jdt.annotation.NonNull + private String displayName; + + public static final String JSON_PROPERTY_TWO_LETTER_I_S_O_LANGUAGE_NAME = "TwoLetterISOLanguageName"; + @org.eclipse.jdt.annotation.NonNull + private String twoLetterISOLanguageName; + + public static final String JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME = "ThreeLetterISOLanguageName"; + @org.eclipse.jdt.annotation.NonNull + private String threeLetterISOLanguageName; + + public static final String JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAMES = "ThreeLetterISOLanguageNames"; + @org.eclipse.jdt.annotation.NonNull + private List threeLetterISOLanguageNames = new ArrayList<>(); + + public CultureDto() { + } + + @JsonCreator + public CultureDto(@JsonProperty(JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME) String threeLetterISOLanguageName) { + this(); + this.threeLetterISOLanguageName = threeLetterISOLanguageName; + } + + public CultureDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public CultureDto displayName(@org.eclipse.jdt.annotation.NonNull String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Gets the display name. + * + * @return displayName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayName() { + return displayName; + } + + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayName(@org.eclipse.jdt.annotation.NonNull String displayName) { + this.displayName = displayName; + } + + public CultureDto twoLetterISOLanguageName(@org.eclipse.jdt.annotation.NonNull String twoLetterISOLanguageName) { + this.twoLetterISOLanguageName = twoLetterISOLanguageName; + return this; + } + + /** + * Gets the name of the two letter ISO language. + * + * @return twoLetterISOLanguageName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TWO_LETTER_I_S_O_LANGUAGE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTwoLetterISOLanguageName() { + return twoLetterISOLanguageName; + } + + @JsonProperty(JSON_PROPERTY_TWO_LETTER_I_S_O_LANGUAGE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTwoLetterISOLanguageName(@org.eclipse.jdt.annotation.NonNull String twoLetterISOLanguageName) { + this.twoLetterISOLanguageName = twoLetterISOLanguageName; + } + + /** + * Gets the name of the three letter ISO language. + * + * @return threeLetterISOLanguageName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getThreeLetterISOLanguageName() { + return threeLetterISOLanguageName; + } + + public CultureDto threeLetterISOLanguageNames( + @org.eclipse.jdt.annotation.NonNull List threeLetterISOLanguageNames) { + this.threeLetterISOLanguageNames = threeLetterISOLanguageNames; + return this; + } + + public CultureDto addThreeLetterISOLanguageNamesItem(String threeLetterISOLanguageNamesItem) { + if (this.threeLetterISOLanguageNames == null) { + this.threeLetterISOLanguageNames = new ArrayList<>(); + } + this.threeLetterISOLanguageNames.add(threeLetterISOLanguageNamesItem); + return this; + } + + /** + * Get threeLetterISOLanguageNames + * + * @return threeLetterISOLanguageNames + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getThreeLetterISOLanguageNames() { + return threeLetterISOLanguageNames; + } + + @JsonProperty(JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThreeLetterISOLanguageNames( + @org.eclipse.jdt.annotation.NonNull List threeLetterISOLanguageNames) { + this.threeLetterISOLanguageNames = threeLetterISOLanguageNames; + } + + /** + * Return true if this CultureDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CultureDto cultureDto = (CultureDto) o; + return Objects.equals(this.name, cultureDto.name) && Objects.equals(this.displayName, cultureDto.displayName) + && Objects.equals(this.twoLetterISOLanguageName, cultureDto.twoLetterISOLanguageName) + && Objects.equals(this.threeLetterISOLanguageName, cultureDto.threeLetterISOLanguageName) + && Objects.equals(this.threeLetterISOLanguageNames, cultureDto.threeLetterISOLanguageNames); + } + + @Override + public int hashCode() { + return Objects.hash(name, displayName, twoLetterISOLanguageName, threeLetterISOLanguageName, + threeLetterISOLanguageNames); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CultureDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" twoLetterISOLanguageName: ").append(toIndentedString(twoLetterISOLanguageName)).append("\n"); + sb.append(" threeLetterISOLanguageName: ").append(toIndentedString(threeLetterISOLanguageName)).append("\n"); + sb.append(" threeLetterISOLanguageNames: ").append(toIndentedString(threeLetterISOLanguageNames)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `DisplayName` to the URL query string + if (getDisplayName() != null) { + joiner.add(String.format("%sDisplayName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplayName())))); + } + + // add `TwoLetterISOLanguageName` to the URL query string + if (getTwoLetterISOLanguageName() != null) { + joiner.add(String.format("%sTwoLetterISOLanguageName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTwoLetterISOLanguageName())))); + } + + // add `ThreeLetterISOLanguageName` to the URL query string + if (getThreeLetterISOLanguageName() != null) { + joiner.add(String.format("%sThreeLetterISOLanguageName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getThreeLetterISOLanguageName())))); + } + + // add `ThreeLetterISOLanguageNames` to the URL query string + if (getThreeLetterISOLanguageNames() != null) { + for (int i = 0; i < getThreeLetterISOLanguageNames().size(); i++) { + joiner.add(String.format("%sThreeLetterISOLanguageNames%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getThreeLetterISOLanguageNames().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private CultureDto instance; + + public Builder() { + this(new CultureDto()); + } + + protected Builder(CultureDto instance) { + this.instance = instance; + } + + public CultureDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public CultureDto.Builder displayName(String displayName) { + this.instance.displayName = displayName; + return this; + } + + public CultureDto.Builder twoLetterISOLanguageName(String twoLetterISOLanguageName) { + this.instance.twoLetterISOLanguageName = twoLetterISOLanguageName; + return this; + } + + public CultureDto.Builder threeLetterISOLanguageName(String threeLetterISOLanguageName) { + this.instance.threeLetterISOLanguageName = threeLetterISOLanguageName; + return this; + } + + public CultureDto.Builder threeLetterISOLanguageNames(List threeLetterISOLanguageNames) { + this.instance.threeLetterISOLanguageNames = threeLetterISOLanguageNames; + return this; + } + + /** + * returns a built CultureDto instance. + * + * The builder is not reusable. + */ + public CultureDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CultureDto.Builder builder() { + return new CultureDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CultureDto.Builder toBuilder() { + return new CultureDto.Builder().name(getName()).displayName(getDisplayName()) + .twoLetterISOLanguageName(getTwoLetterISOLanguageName()) + .threeLetterISOLanguageName(getThreeLetterISOLanguageName()) + .threeLetterISOLanguageNames(getThreeLetterISOLanguageNames()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DayOfWeek.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DayOfWeek.java new file mode 100644 index 0000000000000..9c2c11523fb4b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DayOfWeek.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets DayOfWeek + */ +public enum DayOfWeek { + + SUNDAY("Sunday"), + + MONDAY("Monday"), + + TUESDAY("Tuesday"), + + WEDNESDAY("Wednesday"), + + THURSDAY("Thursday"), + + FRIDAY("Friday"), + + SATURDAY("Saturday"); + + private String value; + + DayOfWeek(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DayOfWeek fromValue(String value) { + for (DayOfWeek b : DayOfWeek.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DayPattern.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DayPattern.java new file mode 100644 index 0000000000000..ebcfbffca98da --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DayPattern.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets DayPattern + */ +public enum DayPattern { + + DAILY("Daily"), + + WEEKDAYS("Weekdays"), + + WEEKENDS("Weekends"); + + private String value; + + DayPattern(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DayPattern fromValue(String value) { + for (DayPattern b : DayPattern.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DefaultDirectoryBrowserInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DefaultDirectoryBrowserInfoDto.java new file mode 100644 index 0000000000000..f81ad89f46a55 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DefaultDirectoryBrowserInfoDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Default directory browser info. + */ +@JsonPropertyOrder({ DefaultDirectoryBrowserInfoDto.JSON_PROPERTY_PATH }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DefaultDirectoryBrowserInfoDto { + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public DefaultDirectoryBrowserInfoDto() { + } + + public DefaultDirectoryBrowserInfoDto path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + /** + * Return true if this DefaultDirectoryBrowserInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DefaultDirectoryBrowserInfoDto defaultDirectoryBrowserInfoDto = (DefaultDirectoryBrowserInfoDto) o; + return Objects.equals(this.path, defaultDirectoryBrowserInfoDto.path); + } + + @Override + public int hashCode() { + return Objects.hash(path); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DefaultDirectoryBrowserInfoDto {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DefaultDirectoryBrowserInfoDto instance; + + public Builder() { + this(new DefaultDirectoryBrowserInfoDto()); + } + + protected Builder(DefaultDirectoryBrowserInfoDto instance) { + this.instance = instance; + } + + public DefaultDirectoryBrowserInfoDto.Builder path(String path) { + this.instance.path = path; + return this; + } + + /** + * returns a built DefaultDirectoryBrowserInfoDto instance. + * + * The builder is not reusable. + */ + public DefaultDirectoryBrowserInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DefaultDirectoryBrowserInfoDto.Builder builder() { + return new DefaultDirectoryBrowserInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DefaultDirectoryBrowserInfoDto.Builder toBuilder() { + return new DefaultDirectoryBrowserInfoDto.Builder().path(getPath()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeinterlaceMethod.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeinterlaceMethod.java new file mode 100644 index 0000000000000..271da2267638f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeinterlaceMethod.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum containing deinterlace methods. + */ +public enum DeinterlaceMethod { + + YADIF("yadif"), + + BWDIF("bwdif"); + + private String value; + + DeinterlaceMethod(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DeinterlaceMethod fromValue(String value) { + for (DeinterlaceMethod b : DeinterlaceMethod.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeviceInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeviceInfoDto.java new file mode 100644 index 0000000000000..a3e1ac9976c93 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeviceInfoDto.java @@ -0,0 +1,602 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * A DTO representing device information. + */ +@JsonPropertyOrder({ DeviceInfoDto.JSON_PROPERTY_NAME, DeviceInfoDto.JSON_PROPERTY_CUSTOM_NAME, + DeviceInfoDto.JSON_PROPERTY_ACCESS_TOKEN, DeviceInfoDto.JSON_PROPERTY_ID, + DeviceInfoDto.JSON_PROPERTY_LAST_USER_NAME, DeviceInfoDto.JSON_PROPERTY_APP_NAME, + DeviceInfoDto.JSON_PROPERTY_APP_VERSION, DeviceInfoDto.JSON_PROPERTY_LAST_USER_ID, + DeviceInfoDto.JSON_PROPERTY_DATE_LAST_ACTIVITY, DeviceInfoDto.JSON_PROPERTY_CAPABILITIES, + DeviceInfoDto.JSON_PROPERTY_ICON_URL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DeviceInfoDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_CUSTOM_NAME = "CustomName"; + @org.eclipse.jdt.annotation.NonNull + private String customName; + + public static final String JSON_PROPERTY_ACCESS_TOKEN = "AccessToken"; + @org.eclipse.jdt.annotation.NonNull + private String accessToken; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_LAST_USER_NAME = "LastUserName"; + @org.eclipse.jdt.annotation.NonNull + private String lastUserName; + + public static final String JSON_PROPERTY_APP_NAME = "AppName"; + @org.eclipse.jdt.annotation.NonNull + private String appName; + + public static final String JSON_PROPERTY_APP_VERSION = "AppVersion"; + @org.eclipse.jdt.annotation.NonNull + private String appVersion; + + public static final String JSON_PROPERTY_LAST_USER_ID = "LastUserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID lastUserId; + + public static final String JSON_PROPERTY_DATE_LAST_ACTIVITY = "DateLastActivity"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateLastActivity; + + public static final String JSON_PROPERTY_CAPABILITIES = "Capabilities"; + @org.eclipse.jdt.annotation.NonNull + private ClientCapabilitiesDto capabilities; + + public static final String JSON_PROPERTY_ICON_URL = "IconUrl"; + @org.eclipse.jdt.annotation.NonNull + private String iconUrl; + + public DeviceInfoDto() { + } + + public DeviceInfoDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public DeviceInfoDto customName(@org.eclipse.jdt.annotation.NonNull String customName) { + this.customName = customName; + return this; + } + + /** + * Gets or sets the custom name. + * + * @return customName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CUSTOM_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCustomName() { + return customName; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomName(@org.eclipse.jdt.annotation.NonNull String customName) { + this.customName = customName; + } + + public DeviceInfoDto accessToken(@org.eclipse.jdt.annotation.NonNull String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Gets or sets the access token. + * + * @return accessToken + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccessToken() { + return accessToken; + } + + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessToken(@org.eclipse.jdt.annotation.NonNull String accessToken) { + this.accessToken = accessToken; + } + + public DeviceInfoDto id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the identifier. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public DeviceInfoDto lastUserName(@org.eclipse.jdt.annotation.NonNull String lastUserName) { + this.lastUserName = lastUserName; + return this; + } + + /** + * Gets or sets the last name of the user. + * + * @return lastUserName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastUserName() { + return lastUserName; + } + + @JsonProperty(JSON_PROPERTY_LAST_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastUserName(@org.eclipse.jdt.annotation.NonNull String lastUserName) { + this.lastUserName = lastUserName; + } + + public DeviceInfoDto appName(@org.eclipse.jdt.annotation.NonNull String appName) { + this.appName = appName; + return this; + } + + /** + * Gets or sets the name of the application. + * + * @return appName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppName() { + return appName; + } + + @JsonProperty(JSON_PROPERTY_APP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppName(@org.eclipse.jdt.annotation.NonNull String appName) { + this.appName = appName; + } + + public DeviceInfoDto appVersion(@org.eclipse.jdt.annotation.NonNull String appVersion) { + this.appVersion = appVersion; + return this; + } + + /** + * Gets or sets the application version. + * + * @return appVersion + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APP_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppVersion() { + return appVersion; + } + + @JsonProperty(JSON_PROPERTY_APP_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppVersion(@org.eclipse.jdt.annotation.NonNull String appVersion) { + this.appVersion = appVersion; + } + + public DeviceInfoDto lastUserId(@org.eclipse.jdt.annotation.NonNull UUID lastUserId) { + this.lastUserId = lastUserId; + return this; + } + + /** + * Gets or sets the last user identifier. + * + * @return lastUserId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getLastUserId() { + return lastUserId; + } + + @JsonProperty(JSON_PROPERTY_LAST_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastUserId(@org.eclipse.jdt.annotation.NonNull UUID lastUserId) { + this.lastUserId = lastUserId; + } + + public DeviceInfoDto dateLastActivity(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateLastActivity) { + this.dateLastActivity = dateLastActivity; + return this; + } + + /** + * Gets or sets the date last modified. + * + * @return dateLastActivity + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_LAST_ACTIVITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateLastActivity() { + return dateLastActivity; + } + + @JsonProperty(JSON_PROPERTY_DATE_LAST_ACTIVITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateLastActivity(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateLastActivity) { + this.dateLastActivity = dateLastActivity; + } + + public DeviceInfoDto capabilities(@org.eclipse.jdt.annotation.NonNull ClientCapabilitiesDto capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Gets or sets the capabilities. + * + * @return capabilities + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAPABILITIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ClientCapabilitiesDto getCapabilities() { + return capabilities; + } + + @JsonProperty(JSON_PROPERTY_CAPABILITIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapabilities(@org.eclipse.jdt.annotation.NonNull ClientCapabilitiesDto capabilities) { + this.capabilities = capabilities; + } + + public DeviceInfoDto iconUrl(@org.eclipse.jdt.annotation.NonNull String iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + /** + * Gets or sets the icon URL. + * + * @return iconUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ICON_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIconUrl() { + return iconUrl; + } + + @JsonProperty(JSON_PROPERTY_ICON_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIconUrl(@org.eclipse.jdt.annotation.NonNull String iconUrl) { + this.iconUrl = iconUrl; + } + + /** + * Return true if this DeviceInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceInfoDto deviceInfoDto = (DeviceInfoDto) o; + return Objects.equals(this.name, deviceInfoDto.name) + && Objects.equals(this.customName, deviceInfoDto.customName) + && Objects.equals(this.accessToken, deviceInfoDto.accessToken) + && Objects.equals(this.id, deviceInfoDto.id) + && Objects.equals(this.lastUserName, deviceInfoDto.lastUserName) + && Objects.equals(this.appName, deviceInfoDto.appName) + && Objects.equals(this.appVersion, deviceInfoDto.appVersion) + && Objects.equals(this.lastUserId, deviceInfoDto.lastUserId) + && Objects.equals(this.dateLastActivity, deviceInfoDto.dateLastActivity) + && Objects.equals(this.capabilities, deviceInfoDto.capabilities) + && Objects.equals(this.iconUrl, deviceInfoDto.iconUrl); + } + + @Override + public int hashCode() { + return Objects.hash(name, customName, accessToken, id, lastUserName, appName, appVersion, lastUserId, + dateLastActivity, capabilities, iconUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceInfoDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" customName: ").append(toIndentedString(customName)).append("\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" lastUserName: ").append(toIndentedString(lastUserName)).append("\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); + sb.append(" lastUserId: ").append(toIndentedString(lastUserId)).append("\n"); + sb.append(" dateLastActivity: ").append(toIndentedString(dateLastActivity)).append("\n"); + sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); + sb.append(" iconUrl: ").append(toIndentedString(iconUrl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `CustomName` to the URL query string + if (getCustomName() != null) { + joiner.add(String.format("%sCustomName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCustomName())))); + } + + // add `AccessToken` to the URL query string + if (getAccessToken() != null) { + joiner.add(String.format("%sAccessToken%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAccessToken())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `LastUserName` to the URL query string + if (getLastUserName() != null) { + joiner.add(String.format("%sLastUserName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastUserName())))); + } + + // add `AppName` to the URL query string + if (getAppName() != null) { + joiner.add(String.format("%sAppName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAppName())))); + } + + // add `AppVersion` to the URL query string + if (getAppVersion() != null) { + joiner.add(String.format("%sAppVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAppVersion())))); + } + + // add `LastUserId` to the URL query string + if (getLastUserId() != null) { + joiner.add(String.format("%sLastUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastUserId())))); + } + + // add `DateLastActivity` to the URL query string + if (getDateLastActivity() != null) { + joiner.add(String.format("%sDateLastActivity%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateLastActivity())))); + } + + // add `Capabilities` to the URL query string + if (getCapabilities() != null) { + joiner.add(getCapabilities().toUrlQueryString(prefix + "Capabilities" + suffix)); + } + + // add `IconUrl` to the URL query string + if (getIconUrl() != null) { + joiner.add(String.format("%sIconUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIconUrl())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DeviceInfoDto instance; + + public Builder() { + this(new DeviceInfoDto()); + } + + protected Builder(DeviceInfoDto instance) { + this.instance = instance; + } + + public DeviceInfoDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public DeviceInfoDto.Builder customName(String customName) { + this.instance.customName = customName; + return this; + } + + public DeviceInfoDto.Builder accessToken(String accessToken) { + this.instance.accessToken = accessToken; + return this; + } + + public DeviceInfoDto.Builder id(String id) { + this.instance.id = id; + return this; + } + + public DeviceInfoDto.Builder lastUserName(String lastUserName) { + this.instance.lastUserName = lastUserName; + return this; + } + + public DeviceInfoDto.Builder appName(String appName) { + this.instance.appName = appName; + return this; + } + + public DeviceInfoDto.Builder appVersion(String appVersion) { + this.instance.appVersion = appVersion; + return this; + } + + public DeviceInfoDto.Builder lastUserId(UUID lastUserId) { + this.instance.lastUserId = lastUserId; + return this; + } + + public DeviceInfoDto.Builder dateLastActivity(OffsetDateTime dateLastActivity) { + this.instance.dateLastActivity = dateLastActivity; + return this; + } + + public DeviceInfoDto.Builder capabilities(ClientCapabilitiesDto capabilities) { + this.instance.capabilities = capabilities; + return this; + } + + public DeviceInfoDto.Builder iconUrl(String iconUrl) { + this.instance.iconUrl = iconUrl; + return this; + } + + /** + * returns a built DeviceInfoDto instance. + * + * The builder is not reusable. + */ + public DeviceInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DeviceInfoDto.Builder builder() { + return new DeviceInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DeviceInfoDto.Builder toBuilder() { + return new DeviceInfoDto.Builder().name(getName()).customName(getCustomName()).accessToken(getAccessToken()) + .id(getId()).lastUserName(getLastUserName()).appName(getAppName()).appVersion(getAppVersion()) + .lastUserId(getLastUserId()).dateLastActivity(getDateLastActivity()).capabilities(getCapabilities()) + .iconUrl(getIconUrl()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeviceInfoDtoQueryResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeviceInfoDtoQueryResult.java new file mode 100644 index 0000000000000..d01c57c879cfd --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeviceInfoDtoQueryResult.java @@ -0,0 +1,288 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Query result container. + */ +@JsonPropertyOrder({ DeviceInfoDtoQueryResult.JSON_PROPERTY_ITEMS, + DeviceInfoDtoQueryResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, DeviceInfoDtoQueryResult.JSON_PROPERTY_START_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DeviceInfoDtoQueryResult { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public DeviceInfoDtoQueryResult() { + } + + public DeviceInfoDtoQueryResult items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public DeviceInfoDtoQueryResult addItemsItem(DeviceInfoDto itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Gets or sets the items. + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public DeviceInfoDtoQueryResult totalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total number of records available. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public DeviceInfoDtoQueryResult startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the index of the first record in Items. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + /** + * Return true if this DeviceInfoDtoQueryResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceInfoDtoQueryResult deviceInfoDtoQueryResult = (DeviceInfoDtoQueryResult) o; + return Objects.equals(this.items, deviceInfoDtoQueryResult.items) + && Objects.equals(this.totalRecordCount, deviceInfoDtoQueryResult.totalRecordCount) + && Objects.equals(this.startIndex, deviceInfoDtoQueryResult.startIndex); + } + + @Override + public int hashCode() { + return Objects.hash(items, totalRecordCount, startIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceInfoDtoQueryResult {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DeviceInfoDtoQueryResult instance; + + public Builder() { + this(new DeviceInfoDtoQueryResult()); + } + + protected Builder(DeviceInfoDtoQueryResult instance) { + this.instance = instance; + } + + public DeviceInfoDtoQueryResult.Builder items(List items) { + this.instance.items = items; + return this; + } + + public DeviceInfoDtoQueryResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public DeviceInfoDtoQueryResult.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + /** + * returns a built DeviceInfoDtoQueryResult instance. + * + * The builder is not reusable. + */ + public DeviceInfoDtoQueryResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DeviceInfoDtoQueryResult.Builder builder() { + return new DeviceInfoDtoQueryResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DeviceInfoDtoQueryResult.Builder toBuilder() { + return new DeviceInfoDtoQueryResult.Builder().items(getItems()).totalRecordCount(getTotalRecordCount()) + .startIndex(getStartIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeviceOptionsDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeviceOptionsDto.java new file mode 100644 index 0000000000000..db3105d858b35 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeviceOptionsDto.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * A dto representing custom options for a device. + */ +@JsonPropertyOrder({ DeviceOptionsDto.JSON_PROPERTY_ID, DeviceOptionsDto.JSON_PROPERTY_DEVICE_ID, + DeviceOptionsDto.JSON_PROPERTY_CUSTOM_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DeviceOptionsDto { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private Integer id; + + public static final String JSON_PROPERTY_DEVICE_ID = "DeviceId"; + @org.eclipse.jdt.annotation.NonNull + private String deviceId; + + public static final String JSON_PROPERTY_CUSTOM_NAME = "CustomName"; + @org.eclipse.jdt.annotation.NonNull + private String customName; + + public DeviceOptionsDto() { + } + + public DeviceOptionsDto id(@org.eclipse.jdt.annotation.NonNull Integer id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull Integer id) { + this.id = id; + } + + public DeviceOptionsDto deviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Gets or sets the device id. + * + * @return deviceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceId() { + return deviceId; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + } + + public DeviceOptionsDto customName(@org.eclipse.jdt.annotation.NonNull String customName) { + this.customName = customName; + return this; + } + + /** + * Gets or sets the custom name. + * + * @return customName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CUSTOM_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCustomName() { + return customName; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomName(@org.eclipse.jdt.annotation.NonNull String customName) { + this.customName = customName; + } + + /** + * Return true if this DeviceOptionsDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceOptionsDto deviceOptionsDto = (DeviceOptionsDto) o; + return Objects.equals(this.id, deviceOptionsDto.id) && Objects.equals(this.deviceId, deviceOptionsDto.deviceId) + && Objects.equals(this.customName, deviceOptionsDto.customName); + } + + @Override + public int hashCode() { + return Objects.hash(id, deviceId, customName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceOptionsDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deviceId: ").append(toIndentedString(deviceId)).append("\n"); + sb.append(" customName: ").append(toIndentedString(customName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `DeviceId` to the URL query string + if (getDeviceId() != null) { + joiner.add(String.format("%sDeviceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceId())))); + } + + // add `CustomName` to the URL query string + if (getCustomName() != null) { + joiner.add(String.format("%sCustomName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCustomName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DeviceOptionsDto instance; + + public Builder() { + this(new DeviceOptionsDto()); + } + + protected Builder(DeviceOptionsDto instance) { + this.instance = instance; + } + + public DeviceOptionsDto.Builder id(Integer id) { + this.instance.id = id; + return this; + } + + public DeviceOptionsDto.Builder deviceId(String deviceId) { + this.instance.deviceId = deviceId; + return this; + } + + public DeviceOptionsDto.Builder customName(String customName) { + this.instance.customName = customName; + return this; + } + + /** + * returns a built DeviceOptionsDto instance. + * + * The builder is not reusable. + */ + public DeviceOptionsDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DeviceOptionsDto.Builder builder() { + return new DeviceOptionsDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DeviceOptionsDto.Builder toBuilder() { + return new DeviceOptionsDto.Builder().id(getId()).deviceId(getDeviceId()).customName(getCustomName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeviceProfile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeviceProfile.java new file mode 100644 index 0000000000000..40e37019a6df5 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DeviceProfile.java @@ -0,0 +1,685 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device + * is able to play. <br /> Specifically, it defines the supported <see + * cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles\">containers</see> and + * <see cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles\">codecs</see> (video + * and/or audio, including codec profiles and levels) the device is able to direct play (without transcoding or + * remuxing), as well as which <see + * cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles\">containers/codecs to transcode + * to</see> in case it isn't. + */ +@JsonPropertyOrder({ DeviceProfile.JSON_PROPERTY_NAME, DeviceProfile.JSON_PROPERTY_ID, + DeviceProfile.JSON_PROPERTY_MAX_STREAMING_BITRATE, DeviceProfile.JSON_PROPERTY_MAX_STATIC_BITRATE, + DeviceProfile.JSON_PROPERTY_MUSIC_STREAMING_TRANSCODING_BITRATE, + DeviceProfile.JSON_PROPERTY_MAX_STATIC_MUSIC_BITRATE, DeviceProfile.JSON_PROPERTY_DIRECT_PLAY_PROFILES, + DeviceProfile.JSON_PROPERTY_TRANSCODING_PROFILES, DeviceProfile.JSON_PROPERTY_CONTAINER_PROFILES, + DeviceProfile.JSON_PROPERTY_CODEC_PROFILES, DeviceProfile.JSON_PROPERTY_SUBTITLE_PROFILES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DeviceProfile { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_MAX_STREAMING_BITRATE = "MaxStreamingBitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxStreamingBitrate; + + public static final String JSON_PROPERTY_MAX_STATIC_BITRATE = "MaxStaticBitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxStaticBitrate; + + public static final String JSON_PROPERTY_MUSIC_STREAMING_TRANSCODING_BITRATE = "MusicStreamingTranscodingBitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer musicStreamingTranscodingBitrate; + + public static final String JSON_PROPERTY_MAX_STATIC_MUSIC_BITRATE = "MaxStaticMusicBitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxStaticMusicBitrate; + + public static final String JSON_PROPERTY_DIRECT_PLAY_PROFILES = "DirectPlayProfiles"; + @org.eclipse.jdt.annotation.NonNull + private List directPlayProfiles = new ArrayList<>(); + + public static final String JSON_PROPERTY_TRANSCODING_PROFILES = "TranscodingProfiles"; + @org.eclipse.jdt.annotation.NonNull + private List transcodingProfiles = new ArrayList<>(); + + public static final String JSON_PROPERTY_CONTAINER_PROFILES = "ContainerProfiles"; + @org.eclipse.jdt.annotation.NonNull + private List containerProfiles = new ArrayList<>(); + + public static final String JSON_PROPERTY_CODEC_PROFILES = "CodecProfiles"; + @org.eclipse.jdt.annotation.NonNull + private List codecProfiles = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUBTITLE_PROFILES = "SubtitleProfiles"; + @org.eclipse.jdt.annotation.NonNull + private List subtitleProfiles = new ArrayList<>(); + + public DeviceProfile() { + } + + public DeviceProfile name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name of this device profile. User profiles must have a unique name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public DeviceProfile id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Gets or sets the unique internal identifier. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public DeviceProfile maxStreamingBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate) { + this.maxStreamingBitrate = maxStreamingBitrate; + return this; + } + + /** + * Gets or sets the maximum allowed bitrate for all streamed content. + * + * @return maxStreamingBitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_STREAMING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxStreamingBitrate() { + return maxStreamingBitrate; + } + + @JsonProperty(JSON_PROPERTY_MAX_STREAMING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxStreamingBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate) { + this.maxStreamingBitrate = maxStreamingBitrate; + } + + public DeviceProfile maxStaticBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStaticBitrate) { + this.maxStaticBitrate = maxStaticBitrate; + return this; + } + + /** + * Gets or sets the maximum allowed bitrate for statically streamed content (= direct played files). + * + * @return maxStaticBitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_STATIC_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxStaticBitrate() { + return maxStaticBitrate; + } + + @JsonProperty(JSON_PROPERTY_MAX_STATIC_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxStaticBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStaticBitrate) { + this.maxStaticBitrate = maxStaticBitrate; + } + + public DeviceProfile musicStreamingTranscodingBitrate( + @org.eclipse.jdt.annotation.NonNull Integer musicStreamingTranscodingBitrate) { + this.musicStreamingTranscodingBitrate = musicStreamingTranscodingBitrate; + return this; + } + + /** + * Gets or sets the maximum allowed bitrate for transcoded music streams. + * + * @return musicStreamingTranscodingBitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MUSIC_STREAMING_TRANSCODING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMusicStreamingTranscodingBitrate() { + return musicStreamingTranscodingBitrate; + } + + @JsonProperty(JSON_PROPERTY_MUSIC_STREAMING_TRANSCODING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMusicStreamingTranscodingBitrate( + @org.eclipse.jdt.annotation.NonNull Integer musicStreamingTranscodingBitrate) { + this.musicStreamingTranscodingBitrate = musicStreamingTranscodingBitrate; + } + + public DeviceProfile maxStaticMusicBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStaticMusicBitrate) { + this.maxStaticMusicBitrate = maxStaticMusicBitrate; + return this; + } + + /** + * Gets or sets the maximum allowed bitrate for statically streamed (= direct played) music files. + * + * @return maxStaticMusicBitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_STATIC_MUSIC_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxStaticMusicBitrate() { + return maxStaticMusicBitrate; + } + + @JsonProperty(JSON_PROPERTY_MAX_STATIC_MUSIC_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxStaticMusicBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStaticMusicBitrate) { + this.maxStaticMusicBitrate = maxStaticMusicBitrate; + } + + public DeviceProfile directPlayProfiles( + @org.eclipse.jdt.annotation.NonNull List directPlayProfiles) { + this.directPlayProfiles = directPlayProfiles; + return this; + } + + public DeviceProfile addDirectPlayProfilesItem(DirectPlayProfile directPlayProfilesItem) { + if (this.directPlayProfiles == null) { + this.directPlayProfiles = new ArrayList<>(); + } + this.directPlayProfiles.add(directPlayProfilesItem); + return this; + } + + /** + * Gets or sets the direct play profiles. + * + * @return directPlayProfiles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DIRECT_PLAY_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDirectPlayProfiles() { + return directPlayProfiles; + } + + @JsonProperty(JSON_PROPERTY_DIRECT_PLAY_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDirectPlayProfiles(@org.eclipse.jdt.annotation.NonNull List directPlayProfiles) { + this.directPlayProfiles = directPlayProfiles; + } + + public DeviceProfile transcodingProfiles( + @org.eclipse.jdt.annotation.NonNull List transcodingProfiles) { + this.transcodingProfiles = transcodingProfiles; + return this; + } + + public DeviceProfile addTranscodingProfilesItem(TranscodingProfile transcodingProfilesItem) { + if (this.transcodingProfiles == null) { + this.transcodingProfiles = new ArrayList<>(); + } + this.transcodingProfiles.add(transcodingProfilesItem); + return this; + } + + /** + * Gets or sets the transcoding profiles. + * + * @return transcodingProfiles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODING_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTranscodingProfiles() { + return transcodingProfiles; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODING_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodingProfiles( + @org.eclipse.jdt.annotation.NonNull List transcodingProfiles) { + this.transcodingProfiles = transcodingProfiles; + } + + public DeviceProfile containerProfiles( + @org.eclipse.jdt.annotation.NonNull List containerProfiles) { + this.containerProfiles = containerProfiles; + return this; + } + + public DeviceProfile addContainerProfilesItem(ContainerProfile containerProfilesItem) { + if (this.containerProfiles == null) { + this.containerProfiles = new ArrayList<>(); + } + this.containerProfiles.add(containerProfilesItem); + return this; + } + + /** + * Gets or sets the container profiles. Failing to meet these optional conditions causes transcoding to occur. + * + * @return containerProfiles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getContainerProfiles() { + return containerProfiles; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainerProfiles(@org.eclipse.jdt.annotation.NonNull List containerProfiles) { + this.containerProfiles = containerProfiles; + } + + public DeviceProfile codecProfiles(@org.eclipse.jdt.annotation.NonNull List codecProfiles) { + this.codecProfiles = codecProfiles; + return this; + } + + public DeviceProfile addCodecProfilesItem(CodecProfile codecProfilesItem) { + if (this.codecProfiles == null) { + this.codecProfiles = new ArrayList<>(); + } + this.codecProfiles.add(codecProfilesItem); + return this; + } + + /** + * Gets or sets the codec profiles. + * + * @return codecProfiles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODEC_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCodecProfiles() { + return codecProfiles; + } + + @JsonProperty(JSON_PROPERTY_CODEC_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCodecProfiles(@org.eclipse.jdt.annotation.NonNull List codecProfiles) { + this.codecProfiles = codecProfiles; + } + + public DeviceProfile subtitleProfiles(@org.eclipse.jdt.annotation.NonNull List subtitleProfiles) { + this.subtitleProfiles = subtitleProfiles; + return this; + } + + public DeviceProfile addSubtitleProfilesItem(SubtitleProfile subtitleProfilesItem) { + if (this.subtitleProfiles == null) { + this.subtitleProfiles = new ArrayList<>(); + } + this.subtitleProfiles.add(subtitleProfilesItem); + return this; + } + + /** + * Gets or sets the subtitle profiles. + * + * @return subtitleProfiles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSubtitleProfiles() { + return subtitleProfiles; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleProfiles(@org.eclipse.jdt.annotation.NonNull List subtitleProfiles) { + this.subtitleProfiles = subtitleProfiles; + } + + /** + * Return true if this DeviceProfile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceProfile deviceProfile = (DeviceProfile) o; + return Objects.equals(this.name, deviceProfile.name) && Objects.equals(this.id, deviceProfile.id) + && Objects.equals(this.maxStreamingBitrate, deviceProfile.maxStreamingBitrate) + && Objects.equals(this.maxStaticBitrate, deviceProfile.maxStaticBitrate) + && Objects.equals(this.musicStreamingTranscodingBitrate, deviceProfile.musicStreamingTranscodingBitrate) + && Objects.equals(this.maxStaticMusicBitrate, deviceProfile.maxStaticMusicBitrate) + && Objects.equals(this.directPlayProfiles, deviceProfile.directPlayProfiles) + && Objects.equals(this.transcodingProfiles, deviceProfile.transcodingProfiles) + && Objects.equals(this.containerProfiles, deviceProfile.containerProfiles) + && Objects.equals(this.codecProfiles, deviceProfile.codecProfiles) + && Objects.equals(this.subtitleProfiles, deviceProfile.subtitleProfiles); + } + + @Override + public int hashCode() { + return Objects.hash(name, id, maxStreamingBitrate, maxStaticBitrate, musicStreamingTranscodingBitrate, + maxStaticMusicBitrate, directPlayProfiles, transcodingProfiles, containerProfiles, codecProfiles, + subtitleProfiles); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceProfile {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" maxStreamingBitrate: ").append(toIndentedString(maxStreamingBitrate)).append("\n"); + sb.append(" maxStaticBitrate: ").append(toIndentedString(maxStaticBitrate)).append("\n"); + sb.append(" musicStreamingTranscodingBitrate: ").append(toIndentedString(musicStreamingTranscodingBitrate)) + .append("\n"); + sb.append(" maxStaticMusicBitrate: ").append(toIndentedString(maxStaticMusicBitrate)).append("\n"); + sb.append(" directPlayProfiles: ").append(toIndentedString(directPlayProfiles)).append("\n"); + sb.append(" transcodingProfiles: ").append(toIndentedString(transcodingProfiles)).append("\n"); + sb.append(" containerProfiles: ").append(toIndentedString(containerProfiles)).append("\n"); + sb.append(" codecProfiles: ").append(toIndentedString(codecProfiles)).append("\n"); + sb.append(" subtitleProfiles: ").append(toIndentedString(subtitleProfiles)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `MaxStreamingBitrate` to the URL query string + if (getMaxStreamingBitrate() != null) { + joiner.add(String.format("%sMaxStreamingBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxStreamingBitrate())))); + } + + // add `MaxStaticBitrate` to the URL query string + if (getMaxStaticBitrate() != null) { + joiner.add(String.format("%sMaxStaticBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxStaticBitrate())))); + } + + // add `MusicStreamingTranscodingBitrate` to the URL query string + if (getMusicStreamingTranscodingBitrate() != null) { + joiner.add(String.format("%sMusicStreamingTranscodingBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMusicStreamingTranscodingBitrate())))); + } + + // add `MaxStaticMusicBitrate` to the URL query string + if (getMaxStaticMusicBitrate() != null) { + joiner.add(String.format("%sMaxStaticMusicBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxStaticMusicBitrate())))); + } + + // add `DirectPlayProfiles` to the URL query string + if (getDirectPlayProfiles() != null) { + for (int i = 0; i < getDirectPlayProfiles().size(); i++) { + if (getDirectPlayProfiles().get(i) != null) { + joiner.add(getDirectPlayProfiles().get(i).toUrlQueryString(String.format("%sDirectPlayProfiles%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TranscodingProfiles` to the URL query string + if (getTranscodingProfiles() != null) { + for (int i = 0; i < getTranscodingProfiles().size(); i++) { + if (getTranscodingProfiles().get(i) != null) { + joiner.add(getTranscodingProfiles().get(i).toUrlQueryString(String.format( + "%sTranscodingProfiles%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ContainerProfiles` to the URL query string + if (getContainerProfiles() != null) { + for (int i = 0; i < getContainerProfiles().size(); i++) { + if (getContainerProfiles().get(i) != null) { + joiner.add(getContainerProfiles().get(i).toUrlQueryString(String.format("%sContainerProfiles%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `CodecProfiles` to the URL query string + if (getCodecProfiles() != null) { + for (int i = 0; i < getCodecProfiles().size(); i++) { + if (getCodecProfiles().get(i) != null) { + joiner.add(getCodecProfiles().get(i).toUrlQueryString(String.format("%sCodecProfiles%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `SubtitleProfiles` to the URL query string + if (getSubtitleProfiles() != null) { + for (int i = 0; i < getSubtitleProfiles().size(); i++) { + if (getSubtitleProfiles().get(i) != null) { + joiner.add(getSubtitleProfiles().get(i).toUrlQueryString(String.format("%sSubtitleProfiles%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private DeviceProfile instance; + + public Builder() { + this(new DeviceProfile()); + } + + protected Builder(DeviceProfile instance) { + this.instance = instance; + } + + public DeviceProfile.Builder name(String name) { + this.instance.name = name; + return this; + } + + public DeviceProfile.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public DeviceProfile.Builder maxStreamingBitrate(Integer maxStreamingBitrate) { + this.instance.maxStreamingBitrate = maxStreamingBitrate; + return this; + } + + public DeviceProfile.Builder maxStaticBitrate(Integer maxStaticBitrate) { + this.instance.maxStaticBitrate = maxStaticBitrate; + return this; + } + + public DeviceProfile.Builder musicStreamingTranscodingBitrate(Integer musicStreamingTranscodingBitrate) { + this.instance.musicStreamingTranscodingBitrate = musicStreamingTranscodingBitrate; + return this; + } + + public DeviceProfile.Builder maxStaticMusicBitrate(Integer maxStaticMusicBitrate) { + this.instance.maxStaticMusicBitrate = maxStaticMusicBitrate; + return this; + } + + public DeviceProfile.Builder directPlayProfiles(List directPlayProfiles) { + this.instance.directPlayProfiles = directPlayProfiles; + return this; + } + + public DeviceProfile.Builder transcodingProfiles(List transcodingProfiles) { + this.instance.transcodingProfiles = transcodingProfiles; + return this; + } + + public DeviceProfile.Builder containerProfiles(List containerProfiles) { + this.instance.containerProfiles = containerProfiles; + return this; + } + + public DeviceProfile.Builder codecProfiles(List codecProfiles) { + this.instance.codecProfiles = codecProfiles; + return this; + } + + public DeviceProfile.Builder subtitleProfiles(List subtitleProfiles) { + this.instance.subtitleProfiles = subtitleProfiles; + return this; + } + + /** + * returns a built DeviceProfile instance. + * + * The builder is not reusable. + */ + public DeviceProfile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DeviceProfile.Builder builder() { + return new DeviceProfile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DeviceProfile.Builder toBuilder() { + return new DeviceProfile.Builder().name(getName()).id(getId()).maxStreamingBitrate(getMaxStreamingBitrate()) + .maxStaticBitrate(getMaxStaticBitrate()) + .musicStreamingTranscodingBitrate(getMusicStreamingTranscodingBitrate()) + .maxStaticMusicBitrate(getMaxStaticMusicBitrate()).directPlayProfiles(getDirectPlayProfiles()) + .transcodingProfiles(getTranscodingProfiles()).containerProfiles(getContainerProfiles()) + .codecProfiles(getCodecProfiles()).subtitleProfiles(getSubtitleProfiles()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DirectPlayProfile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DirectPlayProfile.java new file mode 100644 index 0000000000000..4aecf9c55c98f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DirectPlayProfile.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines the MediaBrowser.Model.Dlna.DirectPlayProfile. + */ +@JsonPropertyOrder({ DirectPlayProfile.JSON_PROPERTY_CONTAINER, DirectPlayProfile.JSON_PROPERTY_AUDIO_CODEC, + DirectPlayProfile.JSON_PROPERTY_VIDEO_CODEC, DirectPlayProfile.JSON_PROPERTY_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DirectPlayProfile { + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public static final String JSON_PROPERTY_AUDIO_CODEC = "AudioCodec"; + @org.eclipse.jdt.annotation.NonNull + private String audioCodec; + + public static final String JSON_PROPERTY_VIDEO_CODEC = "VideoCodec"; + @org.eclipse.jdt.annotation.NonNull + private String videoCodec; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private DlnaProfileType type; + + public DirectPlayProfile() { + } + + public DirectPlayProfile container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Gets or sets the container. + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + public DirectPlayProfile audioCodec(@org.eclipse.jdt.annotation.NonNull String audioCodec) { + this.audioCodec = audioCodec; + return this; + } + + /** + * Gets or sets the audio codec. + * + * @return audioCodec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAudioCodec() { + return audioCodec; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioCodec(@org.eclipse.jdt.annotation.NonNull String audioCodec) { + this.audioCodec = audioCodec; + } + + public DirectPlayProfile videoCodec(@org.eclipse.jdt.annotation.NonNull String videoCodec) { + this.videoCodec = videoCodec; + return this; + } + + /** + * Gets or sets the video codec. + * + * @return videoCodec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVideoCodec() { + return videoCodec; + } + + @JsonProperty(JSON_PROPERTY_VIDEO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVideoCodec(@org.eclipse.jdt.annotation.NonNull String videoCodec) { + this.videoCodec = videoCodec; + } + + public DirectPlayProfile type(@org.eclipse.jdt.annotation.NonNull DlnaProfileType type) { + this.type = type; + return this; + } + + /** + * Gets or sets the Dlna profile type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DlnaProfileType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull DlnaProfileType type) { + this.type = type; + } + + /** + * Return true if this DirectPlayProfile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DirectPlayProfile directPlayProfile = (DirectPlayProfile) o; + return Objects.equals(this.container, directPlayProfile.container) + && Objects.equals(this.audioCodec, directPlayProfile.audioCodec) + && Objects.equals(this.videoCodec, directPlayProfile.videoCodec) + && Objects.equals(this.type, directPlayProfile.type); + } + + @Override + public int hashCode() { + return Objects.hash(container, audioCodec, videoCodec, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DirectPlayProfile {\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" audioCodec: ").append(toIndentedString(audioCodec)).append("\n"); + sb.append(" videoCodec: ").append(toIndentedString(videoCodec)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + // add `AudioCodec` to the URL query string + if (getAudioCodec() != null) { + joiner.add(String.format("%sAudioCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioCodec())))); + } + + // add `VideoCodec` to the URL query string + if (getVideoCodec() != null) { + joiner.add(String.format("%sVideoCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoCodec())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DirectPlayProfile instance; + + public Builder() { + this(new DirectPlayProfile()); + } + + protected Builder(DirectPlayProfile instance) { + this.instance = instance; + } + + public DirectPlayProfile.Builder container(String container) { + this.instance.container = container; + return this; + } + + public DirectPlayProfile.Builder audioCodec(String audioCodec) { + this.instance.audioCodec = audioCodec; + return this; + } + + public DirectPlayProfile.Builder videoCodec(String videoCodec) { + this.instance.videoCodec = videoCodec; + return this; + } + + public DirectPlayProfile.Builder type(DlnaProfileType type) { + this.instance.type = type; + return this; + } + + /** + * returns a built DirectPlayProfile instance. + * + * The builder is not reusable. + */ + public DirectPlayProfile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DirectPlayProfile.Builder builder() { + return new DirectPlayProfile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DirectPlayProfile.Builder toBuilder() { + return new DirectPlayProfile.Builder().container(getContainer()).audioCodec(getAudioCodec()) + .videoCodec(getVideoCodec()).type(getType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DisplayPreferencesDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DisplayPreferencesDto.java new file mode 100644 index 0000000000000..456d7ee987272 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DisplayPreferencesDto.java @@ -0,0 +1,738 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines the display preferences for any item that supports them (usually Folders). + */ +@JsonPropertyOrder({ DisplayPreferencesDto.JSON_PROPERTY_ID, DisplayPreferencesDto.JSON_PROPERTY_VIEW_TYPE, + DisplayPreferencesDto.JSON_PROPERTY_SORT_BY, DisplayPreferencesDto.JSON_PROPERTY_INDEX_BY, + DisplayPreferencesDto.JSON_PROPERTY_REMEMBER_INDEXING, DisplayPreferencesDto.JSON_PROPERTY_PRIMARY_IMAGE_HEIGHT, + DisplayPreferencesDto.JSON_PROPERTY_PRIMARY_IMAGE_WIDTH, DisplayPreferencesDto.JSON_PROPERTY_CUSTOM_PREFS, + DisplayPreferencesDto.JSON_PROPERTY_SCROLL_DIRECTION, DisplayPreferencesDto.JSON_PROPERTY_SHOW_BACKDROP, + DisplayPreferencesDto.JSON_PROPERTY_REMEMBER_SORTING, DisplayPreferencesDto.JSON_PROPERTY_SORT_ORDER, + DisplayPreferencesDto.JSON_PROPERTY_SHOW_SIDEBAR, DisplayPreferencesDto.JSON_PROPERTY_CLIENT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DisplayPreferencesDto { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_VIEW_TYPE = "ViewType"; + @org.eclipse.jdt.annotation.NonNull + private String viewType; + + public static final String JSON_PROPERTY_SORT_BY = "SortBy"; + @org.eclipse.jdt.annotation.NonNull + private String sortBy; + + public static final String JSON_PROPERTY_INDEX_BY = "IndexBy"; + @org.eclipse.jdt.annotation.NonNull + private String indexBy; + + public static final String JSON_PROPERTY_REMEMBER_INDEXING = "RememberIndexing"; + @org.eclipse.jdt.annotation.NonNull + private Boolean rememberIndexing; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_HEIGHT = "PrimaryImageHeight"; + @org.eclipse.jdt.annotation.NonNull + private Integer primaryImageHeight; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_WIDTH = "PrimaryImageWidth"; + @org.eclipse.jdt.annotation.NonNull + private Integer primaryImageWidth; + + public static final String JSON_PROPERTY_CUSTOM_PREFS = "CustomPrefs"; + @org.eclipse.jdt.annotation.NonNull + private Map customPrefs = new HashMap<>(); + + public static final String JSON_PROPERTY_SCROLL_DIRECTION = "ScrollDirection"; + @org.eclipse.jdt.annotation.NonNull + private ScrollDirection scrollDirection; + + public static final String JSON_PROPERTY_SHOW_BACKDROP = "ShowBackdrop"; + @org.eclipse.jdt.annotation.NonNull + private Boolean showBackdrop; + + public static final String JSON_PROPERTY_REMEMBER_SORTING = "RememberSorting"; + @org.eclipse.jdt.annotation.NonNull + private Boolean rememberSorting; + + public static final String JSON_PROPERTY_SORT_ORDER = "SortOrder"; + @org.eclipse.jdt.annotation.NonNull + private SortOrder sortOrder; + + public static final String JSON_PROPERTY_SHOW_SIDEBAR = "ShowSidebar"; + @org.eclipse.jdt.annotation.NonNull + private Boolean showSidebar; + + public static final String JSON_PROPERTY_CLIENT = "Client"; + @org.eclipse.jdt.annotation.NonNull + private String client; + + public DisplayPreferencesDto() { + } + + public DisplayPreferencesDto id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the user id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public DisplayPreferencesDto viewType(@org.eclipse.jdt.annotation.NonNull String viewType) { + this.viewType = viewType; + return this; + } + + /** + * Gets or sets the type of the view. + * + * @return viewType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIEW_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getViewType() { + return viewType; + } + + @JsonProperty(JSON_PROPERTY_VIEW_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setViewType(@org.eclipse.jdt.annotation.NonNull String viewType) { + this.viewType = viewType; + } + + public DisplayPreferencesDto sortBy(@org.eclipse.jdt.annotation.NonNull String sortBy) { + this.sortBy = sortBy; + return this; + } + + /** + * Gets or sets the sort by. + * + * @return sortBy + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SORT_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSortBy() { + return sortBy; + } + + @JsonProperty(JSON_PROPERTY_SORT_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortBy(@org.eclipse.jdt.annotation.NonNull String sortBy) { + this.sortBy = sortBy; + } + + public DisplayPreferencesDto indexBy(@org.eclipse.jdt.annotation.NonNull String indexBy) { + this.indexBy = indexBy; + return this; + } + + /** + * Gets or sets the index by. + * + * @return indexBy + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIndexBy() { + return indexBy; + } + + @JsonProperty(JSON_PROPERTY_INDEX_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexBy(@org.eclipse.jdt.annotation.NonNull String indexBy) { + this.indexBy = indexBy; + } + + public DisplayPreferencesDto rememberIndexing(@org.eclipse.jdt.annotation.NonNull Boolean rememberIndexing) { + this.rememberIndexing = rememberIndexing; + return this; + } + + /** + * Gets or sets a value indicating whether [remember indexing]. + * + * @return rememberIndexing + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMEMBER_INDEXING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRememberIndexing() { + return rememberIndexing; + } + + @JsonProperty(JSON_PROPERTY_REMEMBER_INDEXING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRememberIndexing(@org.eclipse.jdt.annotation.NonNull Boolean rememberIndexing) { + this.rememberIndexing = rememberIndexing; + } + + public DisplayPreferencesDto primaryImageHeight(@org.eclipse.jdt.annotation.NonNull Integer primaryImageHeight) { + this.primaryImageHeight = primaryImageHeight; + return this; + } + + /** + * Gets or sets the height of the primary image. + * + * @return primaryImageHeight + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrimaryImageHeight() { + return primaryImageHeight; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageHeight(@org.eclipse.jdt.annotation.NonNull Integer primaryImageHeight) { + this.primaryImageHeight = primaryImageHeight; + } + + public DisplayPreferencesDto primaryImageWidth(@org.eclipse.jdt.annotation.NonNull Integer primaryImageWidth) { + this.primaryImageWidth = primaryImageWidth; + return this; + } + + /** + * Gets or sets the width of the primary image. + * + * @return primaryImageWidth + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrimaryImageWidth() { + return primaryImageWidth; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageWidth(@org.eclipse.jdt.annotation.NonNull Integer primaryImageWidth) { + this.primaryImageWidth = primaryImageWidth; + } + + public DisplayPreferencesDto customPrefs(@org.eclipse.jdt.annotation.NonNull Map customPrefs) { + this.customPrefs = customPrefs; + return this; + } + + public DisplayPreferencesDto putCustomPrefsItem(String key, String customPrefsItem) { + if (this.customPrefs == null) { + this.customPrefs = new HashMap<>(); + } + this.customPrefs.put(key, customPrefsItem); + return this; + } + + /** + * Gets or sets the custom prefs. + * + * @return customPrefs + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CUSTOM_PREFS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getCustomPrefs() { + return customPrefs; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_PREFS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomPrefs(@org.eclipse.jdt.annotation.NonNull Map customPrefs) { + this.customPrefs = customPrefs; + } + + public DisplayPreferencesDto scrollDirection(@org.eclipse.jdt.annotation.NonNull ScrollDirection scrollDirection) { + this.scrollDirection = scrollDirection; + return this; + } + + /** + * Gets or sets the scroll direction. + * + * @return scrollDirection + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SCROLL_DIRECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ScrollDirection getScrollDirection() { + return scrollDirection; + } + + @JsonProperty(JSON_PROPERTY_SCROLL_DIRECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScrollDirection(@org.eclipse.jdt.annotation.NonNull ScrollDirection scrollDirection) { + this.scrollDirection = scrollDirection; + } + + public DisplayPreferencesDto showBackdrop(@org.eclipse.jdt.annotation.NonNull Boolean showBackdrop) { + this.showBackdrop = showBackdrop; + return this; + } + + /** + * Gets or sets a value indicating whether to show backdrops on this item. + * + * @return showBackdrop + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SHOW_BACKDROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShowBackdrop() { + return showBackdrop; + } + + @JsonProperty(JSON_PROPERTY_SHOW_BACKDROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowBackdrop(@org.eclipse.jdt.annotation.NonNull Boolean showBackdrop) { + this.showBackdrop = showBackdrop; + } + + public DisplayPreferencesDto rememberSorting(@org.eclipse.jdt.annotation.NonNull Boolean rememberSorting) { + this.rememberSorting = rememberSorting; + return this; + } + + /** + * Gets or sets a value indicating whether [remember sorting]. + * + * @return rememberSorting + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMEMBER_SORTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRememberSorting() { + return rememberSorting; + } + + @JsonProperty(JSON_PROPERTY_REMEMBER_SORTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRememberSorting(@org.eclipse.jdt.annotation.NonNull Boolean rememberSorting) { + this.rememberSorting = rememberSorting; + } + + public DisplayPreferencesDto sortOrder(@org.eclipse.jdt.annotation.NonNull SortOrder sortOrder) { + this.sortOrder = sortOrder; + return this; + } + + /** + * Gets or sets the sort order. + * + * @return sortOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SORT_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SortOrder getSortOrder() { + return sortOrder; + } + + @JsonProperty(JSON_PROPERTY_SORT_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortOrder(@org.eclipse.jdt.annotation.NonNull SortOrder sortOrder) { + this.sortOrder = sortOrder; + } + + public DisplayPreferencesDto showSidebar(@org.eclipse.jdt.annotation.NonNull Boolean showSidebar) { + this.showSidebar = showSidebar; + return this; + } + + /** + * Gets or sets a value indicating whether [show sidebar]. + * + * @return showSidebar + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SHOW_SIDEBAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShowSidebar() { + return showSidebar; + } + + @JsonProperty(JSON_PROPERTY_SHOW_SIDEBAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowSidebar(@org.eclipse.jdt.annotation.NonNull Boolean showSidebar) { + this.showSidebar = showSidebar; + } + + public DisplayPreferencesDto client(@org.eclipse.jdt.annotation.NonNull String client) { + this.client = client; + return this; + } + + /** + * Gets or sets the client. + * + * @return client + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { + return client; + } + + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClient(@org.eclipse.jdt.annotation.NonNull String client) { + this.client = client; + } + + /** + * Return true if this DisplayPreferencesDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DisplayPreferencesDto displayPreferencesDto = (DisplayPreferencesDto) o; + return Objects.equals(this.id, displayPreferencesDto.id) + && Objects.equals(this.viewType, displayPreferencesDto.viewType) + && Objects.equals(this.sortBy, displayPreferencesDto.sortBy) + && Objects.equals(this.indexBy, displayPreferencesDto.indexBy) + && Objects.equals(this.rememberIndexing, displayPreferencesDto.rememberIndexing) + && Objects.equals(this.primaryImageHeight, displayPreferencesDto.primaryImageHeight) + && Objects.equals(this.primaryImageWidth, displayPreferencesDto.primaryImageWidth) + && Objects.equals(this.customPrefs, displayPreferencesDto.customPrefs) + && Objects.equals(this.scrollDirection, displayPreferencesDto.scrollDirection) + && Objects.equals(this.showBackdrop, displayPreferencesDto.showBackdrop) + && Objects.equals(this.rememberSorting, displayPreferencesDto.rememberSorting) + && Objects.equals(this.sortOrder, displayPreferencesDto.sortOrder) + && Objects.equals(this.showSidebar, displayPreferencesDto.showSidebar) + && Objects.equals(this.client, displayPreferencesDto.client); + } + + @Override + public int hashCode() { + return Objects.hash(id, viewType, sortBy, indexBy, rememberIndexing, primaryImageHeight, primaryImageWidth, + customPrefs, scrollDirection, showBackdrop, rememberSorting, sortOrder, showSidebar, client); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DisplayPreferencesDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" viewType: ").append(toIndentedString(viewType)).append("\n"); + sb.append(" sortBy: ").append(toIndentedString(sortBy)).append("\n"); + sb.append(" indexBy: ").append(toIndentedString(indexBy)).append("\n"); + sb.append(" rememberIndexing: ").append(toIndentedString(rememberIndexing)).append("\n"); + sb.append(" primaryImageHeight: ").append(toIndentedString(primaryImageHeight)).append("\n"); + sb.append(" primaryImageWidth: ").append(toIndentedString(primaryImageWidth)).append("\n"); + sb.append(" customPrefs: ").append(toIndentedString(customPrefs)).append("\n"); + sb.append(" scrollDirection: ").append(toIndentedString(scrollDirection)).append("\n"); + sb.append(" showBackdrop: ").append(toIndentedString(showBackdrop)).append("\n"); + sb.append(" rememberSorting: ").append(toIndentedString(rememberSorting)).append("\n"); + sb.append(" sortOrder: ").append(toIndentedString(sortOrder)).append("\n"); + sb.append(" showSidebar: ").append(toIndentedString(showSidebar)).append("\n"); + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `ViewType` to the URL query string + if (getViewType() != null) { + joiner.add(String.format("%sViewType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getViewType())))); + } + + // add `SortBy` to the URL query string + if (getSortBy() != null) { + joiner.add(String.format("%sSortBy%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSortBy())))); + } + + // add `IndexBy` to the URL query string + if (getIndexBy() != null) { + joiner.add(String.format("%sIndexBy%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexBy())))); + } + + // add `RememberIndexing` to the URL query string + if (getRememberIndexing() != null) { + joiner.add(String.format("%sRememberIndexing%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRememberIndexing())))); + } + + // add `PrimaryImageHeight` to the URL query string + if (getPrimaryImageHeight() != null) { + joiner.add(String.format("%sPrimaryImageHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageHeight())))); + } + + // add `PrimaryImageWidth` to the URL query string + if (getPrimaryImageWidth() != null) { + joiner.add(String.format("%sPrimaryImageWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageWidth())))); + } + + // add `CustomPrefs` to the URL query string + if (getCustomPrefs() != null) { + for (String _key : getCustomPrefs().keySet()) { + joiner.add(String.format("%sCustomPrefs%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getCustomPrefs().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getCustomPrefs().get(_key))))); + } + } + + // add `ScrollDirection` to the URL query string + if (getScrollDirection() != null) { + joiner.add(String.format("%sScrollDirection%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getScrollDirection())))); + } + + // add `ShowBackdrop` to the URL query string + if (getShowBackdrop() != null) { + joiner.add(String.format("%sShowBackdrop%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getShowBackdrop())))); + } + + // add `RememberSorting` to the URL query string + if (getRememberSorting() != null) { + joiner.add(String.format("%sRememberSorting%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRememberSorting())))); + } + + // add `SortOrder` to the URL query string + if (getSortOrder() != null) { + joiner.add(String.format("%sSortOrder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSortOrder())))); + } + + // add `ShowSidebar` to the URL query string + if (getShowSidebar() != null) { + joiner.add(String.format("%sShowSidebar%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getShowSidebar())))); + } + + // add `Client` to the URL query string + if (getClient() != null) { + joiner.add(String.format("%sClient%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getClient())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DisplayPreferencesDto instance; + + public Builder() { + this(new DisplayPreferencesDto()); + } + + protected Builder(DisplayPreferencesDto instance) { + this.instance = instance; + } + + public DisplayPreferencesDto.Builder id(String id) { + this.instance.id = id; + return this; + } + + public DisplayPreferencesDto.Builder viewType(String viewType) { + this.instance.viewType = viewType; + return this; + } + + public DisplayPreferencesDto.Builder sortBy(String sortBy) { + this.instance.sortBy = sortBy; + return this; + } + + public DisplayPreferencesDto.Builder indexBy(String indexBy) { + this.instance.indexBy = indexBy; + return this; + } + + public DisplayPreferencesDto.Builder rememberIndexing(Boolean rememberIndexing) { + this.instance.rememberIndexing = rememberIndexing; + return this; + } + + public DisplayPreferencesDto.Builder primaryImageHeight(Integer primaryImageHeight) { + this.instance.primaryImageHeight = primaryImageHeight; + return this; + } + + public DisplayPreferencesDto.Builder primaryImageWidth(Integer primaryImageWidth) { + this.instance.primaryImageWidth = primaryImageWidth; + return this; + } + + public DisplayPreferencesDto.Builder customPrefs(Map customPrefs) { + this.instance.customPrefs = customPrefs; + return this; + } + + public DisplayPreferencesDto.Builder scrollDirection(ScrollDirection scrollDirection) { + this.instance.scrollDirection = scrollDirection; + return this; + } + + public DisplayPreferencesDto.Builder showBackdrop(Boolean showBackdrop) { + this.instance.showBackdrop = showBackdrop; + return this; + } + + public DisplayPreferencesDto.Builder rememberSorting(Boolean rememberSorting) { + this.instance.rememberSorting = rememberSorting; + return this; + } + + public DisplayPreferencesDto.Builder sortOrder(SortOrder sortOrder) { + this.instance.sortOrder = sortOrder; + return this; + } + + public DisplayPreferencesDto.Builder showSidebar(Boolean showSidebar) { + this.instance.showSidebar = showSidebar; + return this; + } + + public DisplayPreferencesDto.Builder client(String client) { + this.instance.client = client; + return this; + } + + /** + * returns a built DisplayPreferencesDto instance. + * + * The builder is not reusable. + */ + public DisplayPreferencesDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DisplayPreferencesDto.Builder builder() { + return new DisplayPreferencesDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DisplayPreferencesDto.Builder toBuilder() { + return new DisplayPreferencesDto.Builder().id(getId()).viewType(getViewType()).sortBy(getSortBy()) + .indexBy(getIndexBy()).rememberIndexing(getRememberIndexing()) + .primaryImageHeight(getPrimaryImageHeight()).primaryImageWidth(getPrimaryImageWidth()) + .customPrefs(getCustomPrefs()).scrollDirection(getScrollDirection()).showBackdrop(getShowBackdrop()) + .rememberSorting(getRememberSorting()).sortOrder(getSortOrder()).showSidebar(getShowSidebar()) + .client(getClient()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DlnaProfileType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DlnaProfileType.java new file mode 100644 index 0000000000000..d17c6b3226933 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DlnaProfileType.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets DlnaProfileType + */ +public enum DlnaProfileType { + + AUDIO("Audio"), + + VIDEO("Video"), + + PHOTO("Photo"), + + SUBTITLE("Subtitle"), + + LYRIC("Lyric"); + + private String value; + + DlnaProfileType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DlnaProfileType fromValue(String value) { + for (DlnaProfileType b : DlnaProfileType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DownMixStereoAlgorithms.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DownMixStereoAlgorithms.java new file mode 100644 index 0000000000000..c044403e86f81 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DownMixStereoAlgorithms.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * An enum representing an algorithm to downmix surround sound to stereo. + */ +public enum DownMixStereoAlgorithms { + + NONE("None"), + + DAVE750("Dave750"), + + NIGHTMODE_DIALOGUE("NightmodeDialogue"), + + RFC7845("Rfc7845"), + + AC4("Ac4"); + + private String value; + + DownMixStereoAlgorithms(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DownMixStereoAlgorithms fromValue(String value) { + for (DownMixStereoAlgorithms b : DownMixStereoAlgorithms.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DynamicDayOfWeek.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DynamicDayOfWeek.java new file mode 100644 index 0000000000000..fcaf05785139a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/DynamicDayOfWeek.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * An enum that represents a day of the week, weekdays, weekends, or all days. + */ +public enum DynamicDayOfWeek { + + SUNDAY("Sunday"), + + MONDAY("Monday"), + + TUESDAY("Tuesday"), + + WEDNESDAY("Wednesday"), + + THURSDAY("Thursday"), + + FRIDAY("Friday"), + + SATURDAY("Saturday"), + + EVERYDAY("Everyday"), + + WEEKDAY("Weekday"), + + WEEKEND("Weekend"); + + private String value; + + DynamicDayOfWeek(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DynamicDayOfWeek fromValue(String value) { + for (DynamicDayOfWeek b : DynamicDayOfWeek.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EmbeddedSubtitleOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EmbeddedSubtitleOptions.java new file mode 100644 index 0000000000000..67d34ce9ace4d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EmbeddedSubtitleOptions.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * An enum representing the options to disable embedded subs. + */ +public enum EmbeddedSubtitleOptions { + + ALLOW_ALL("AllowAll"), + + ALLOW_TEXT("AllowText"), + + ALLOW_IMAGE("AllowImage"), + + ALLOW_NONE("AllowNone"); + + private String value; + + EmbeddedSubtitleOptions(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EmbeddedSubtitleOptions fromValue(String value) { + for (EmbeddedSubtitleOptions b : EmbeddedSubtitleOptions.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EncoderPreset.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EncoderPreset.java new file mode 100644 index 0000000000000..245131bf42078 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EncoderPreset.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum containing encoder presets. + */ +public enum EncoderPreset { + + AUTO("auto"), + + PLACEBO("placebo"), + + VERYSLOW("veryslow"), + + SLOWER("slower"), + + SLOW("slow"), + + MEDIUM("medium"), + + FAST("fast"), + + FASTER("faster"), + + VERYFAST("veryfast"), + + SUPERFAST("superfast"), + + ULTRAFAST("ultrafast"); + + private String value; + + EncoderPreset(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EncoderPreset fromValue(String value) { + for (EncoderPreset b : EncoderPreset.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EncodingContext.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EncodingContext.java new file mode 100644 index 0000000000000..a50d618cada3f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EncodingContext.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EncodingContext + */ +public enum EncodingContext { + + STREAMING("Streaming"), + + STATIC("Static"); + + private String value; + + EncodingContext(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EncodingContext fromValue(String value) { + for (EncodingContext b : EncodingContext.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EncodingOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EncodingOptions.java new file mode 100644 index 0000000000000..668a5d5e4fc51 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EncodingOptions.java @@ -0,0 +1,2171 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class EncodingOptions. + */ +@JsonPropertyOrder({ EncodingOptions.JSON_PROPERTY_ENCODING_THREAD_COUNT, + EncodingOptions.JSON_PROPERTY_TRANSCODING_TEMP_PATH, EncodingOptions.JSON_PROPERTY_FALLBACK_FONT_PATH, + EncodingOptions.JSON_PROPERTY_ENABLE_FALLBACK_FONT, EncodingOptions.JSON_PROPERTY_ENABLE_AUDIO_VBR, + EncodingOptions.JSON_PROPERTY_DOWN_MIX_AUDIO_BOOST, EncodingOptions.JSON_PROPERTY_DOWN_MIX_STEREO_ALGORITHM, + EncodingOptions.JSON_PROPERTY_MAX_MUXING_QUEUE_SIZE, EncodingOptions.JSON_PROPERTY_ENABLE_THROTTLING, + EncodingOptions.JSON_PROPERTY_THROTTLE_DELAY_SECONDS, EncodingOptions.JSON_PROPERTY_ENABLE_SEGMENT_DELETION, + EncodingOptions.JSON_PROPERTY_SEGMENT_KEEP_SECONDS, EncodingOptions.JSON_PROPERTY_HARDWARE_ACCELERATION_TYPE, + EncodingOptions.JSON_PROPERTY_ENCODER_APP_PATH, EncodingOptions.JSON_PROPERTY_ENCODER_APP_PATH_DISPLAY, + EncodingOptions.JSON_PROPERTY_VAAPI_DEVICE, EncodingOptions.JSON_PROPERTY_QSV_DEVICE, + EncodingOptions.JSON_PROPERTY_ENABLE_TONEMAPPING, EncodingOptions.JSON_PROPERTY_ENABLE_VPP_TONEMAPPING, + EncodingOptions.JSON_PROPERTY_ENABLE_VIDEO_TOOLBOX_TONEMAPPING, + EncodingOptions.JSON_PROPERTY_TONEMAPPING_ALGORITHM, EncodingOptions.JSON_PROPERTY_TONEMAPPING_MODE, + EncodingOptions.JSON_PROPERTY_TONEMAPPING_RANGE, EncodingOptions.JSON_PROPERTY_TONEMAPPING_DESAT, + EncodingOptions.JSON_PROPERTY_TONEMAPPING_PEAK, EncodingOptions.JSON_PROPERTY_TONEMAPPING_PARAM, + EncodingOptions.JSON_PROPERTY_VPP_TONEMAPPING_BRIGHTNESS, + EncodingOptions.JSON_PROPERTY_VPP_TONEMAPPING_CONTRAST, EncodingOptions.JSON_PROPERTY_H264_CRF, + EncodingOptions.JSON_PROPERTY_H265_CRF, EncodingOptions.JSON_PROPERTY_ENCODER_PRESET, + EncodingOptions.JSON_PROPERTY_DEINTERLACE_DOUBLE_RATE, EncodingOptions.JSON_PROPERTY_DEINTERLACE_METHOD, + EncodingOptions.JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_HEVC, + EncodingOptions.JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_VP9, + EncodingOptions.JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_HEVC_REXT, + EncodingOptions.JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH12_HEVC_REXT, + EncodingOptions.JSON_PROPERTY_ENABLE_ENHANCED_NVDEC_DECODER, + EncodingOptions.JSON_PROPERTY_PREFER_SYSTEM_NATIVE_HW_DECODER, + EncodingOptions.JSON_PROPERTY_ENABLE_INTEL_LOW_POWER_H264_HW_ENCODER, + EncodingOptions.JSON_PROPERTY_ENABLE_INTEL_LOW_POWER_HEVC_HW_ENCODER, + EncodingOptions.JSON_PROPERTY_ENABLE_HARDWARE_ENCODING, EncodingOptions.JSON_PROPERTY_ALLOW_HEVC_ENCODING, + EncodingOptions.JSON_PROPERTY_ALLOW_AV1_ENCODING, EncodingOptions.JSON_PROPERTY_ENABLE_SUBTITLE_EXTRACTION, + EncodingOptions.JSON_PROPERTY_HARDWARE_DECODING_CODECS, + EncodingOptions.JSON_PROPERTY_ALLOW_ON_DEMAND_METADATA_BASED_KEYFRAME_EXTRACTION_FOR_EXTENSIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class EncodingOptions { + public static final String JSON_PROPERTY_ENCODING_THREAD_COUNT = "EncodingThreadCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer encodingThreadCount; + + public static final String JSON_PROPERTY_TRANSCODING_TEMP_PATH = "TranscodingTempPath"; + @org.eclipse.jdt.annotation.NonNull + private String transcodingTempPath; + + public static final String JSON_PROPERTY_FALLBACK_FONT_PATH = "FallbackFontPath"; + @org.eclipse.jdt.annotation.NonNull + private String fallbackFontPath; + + public static final String JSON_PROPERTY_ENABLE_FALLBACK_FONT = "EnableFallbackFont"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableFallbackFont; + + public static final String JSON_PROPERTY_ENABLE_AUDIO_VBR = "EnableAudioVbr"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAudioVbr; + + public static final String JSON_PROPERTY_DOWN_MIX_AUDIO_BOOST = "DownMixAudioBoost"; + @org.eclipse.jdt.annotation.NonNull + private Double downMixAudioBoost; + + public static final String JSON_PROPERTY_DOWN_MIX_STEREO_ALGORITHM = "DownMixStereoAlgorithm"; + @org.eclipse.jdt.annotation.NonNull + private DownMixStereoAlgorithms downMixStereoAlgorithm; + + public static final String JSON_PROPERTY_MAX_MUXING_QUEUE_SIZE = "MaxMuxingQueueSize"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxMuxingQueueSize; + + public static final String JSON_PROPERTY_ENABLE_THROTTLING = "EnableThrottling"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableThrottling; + + public static final String JSON_PROPERTY_THROTTLE_DELAY_SECONDS = "ThrottleDelaySeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer throttleDelaySeconds; + + public static final String JSON_PROPERTY_ENABLE_SEGMENT_DELETION = "EnableSegmentDeletion"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableSegmentDeletion; + + public static final String JSON_PROPERTY_SEGMENT_KEEP_SECONDS = "SegmentKeepSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer segmentKeepSeconds; + + public static final String JSON_PROPERTY_HARDWARE_ACCELERATION_TYPE = "HardwareAccelerationType"; + @org.eclipse.jdt.annotation.NonNull + private HardwareAccelerationType hardwareAccelerationType; + + public static final String JSON_PROPERTY_ENCODER_APP_PATH = "EncoderAppPath"; + @org.eclipse.jdt.annotation.NonNull + private String encoderAppPath; + + public static final String JSON_PROPERTY_ENCODER_APP_PATH_DISPLAY = "EncoderAppPathDisplay"; + @org.eclipse.jdt.annotation.NonNull + private String encoderAppPathDisplay; + + public static final String JSON_PROPERTY_VAAPI_DEVICE = "VaapiDevice"; + @org.eclipse.jdt.annotation.NonNull + private String vaapiDevice; + + public static final String JSON_PROPERTY_QSV_DEVICE = "QsvDevice"; + @org.eclipse.jdt.annotation.NonNull + private String qsvDevice; + + public static final String JSON_PROPERTY_ENABLE_TONEMAPPING = "EnableTonemapping"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableTonemapping; + + public static final String JSON_PROPERTY_ENABLE_VPP_TONEMAPPING = "EnableVppTonemapping"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableVppTonemapping; + + public static final String JSON_PROPERTY_ENABLE_VIDEO_TOOLBOX_TONEMAPPING = "EnableVideoToolboxTonemapping"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableVideoToolboxTonemapping; + + public static final String JSON_PROPERTY_TONEMAPPING_ALGORITHM = "TonemappingAlgorithm"; + @org.eclipse.jdt.annotation.NonNull + private TonemappingAlgorithm tonemappingAlgorithm; + + public static final String JSON_PROPERTY_TONEMAPPING_MODE = "TonemappingMode"; + @org.eclipse.jdt.annotation.NonNull + private TonemappingMode tonemappingMode; + + public static final String JSON_PROPERTY_TONEMAPPING_RANGE = "TonemappingRange"; + @org.eclipse.jdt.annotation.NonNull + private TonemappingRange tonemappingRange; + + public static final String JSON_PROPERTY_TONEMAPPING_DESAT = "TonemappingDesat"; + @org.eclipse.jdt.annotation.NonNull + private Double tonemappingDesat; + + public static final String JSON_PROPERTY_TONEMAPPING_PEAK = "TonemappingPeak"; + @org.eclipse.jdt.annotation.NonNull + private Double tonemappingPeak; + + public static final String JSON_PROPERTY_TONEMAPPING_PARAM = "TonemappingParam"; + @org.eclipse.jdt.annotation.NonNull + private Double tonemappingParam; + + public static final String JSON_PROPERTY_VPP_TONEMAPPING_BRIGHTNESS = "VppTonemappingBrightness"; + @org.eclipse.jdt.annotation.NonNull + private Double vppTonemappingBrightness; + + public static final String JSON_PROPERTY_VPP_TONEMAPPING_CONTRAST = "VppTonemappingContrast"; + @org.eclipse.jdt.annotation.NonNull + private Double vppTonemappingContrast; + + public static final String JSON_PROPERTY_H264_CRF = "H264Crf"; + @org.eclipse.jdt.annotation.NonNull + private Integer h264Crf; + + public static final String JSON_PROPERTY_H265_CRF = "H265Crf"; + @org.eclipse.jdt.annotation.NonNull + private Integer h265Crf; + + public static final String JSON_PROPERTY_ENCODER_PRESET = "EncoderPreset"; + @org.eclipse.jdt.annotation.NonNull + private EncoderPreset encoderPreset; + + public static final String JSON_PROPERTY_DEINTERLACE_DOUBLE_RATE = "DeinterlaceDoubleRate"; + @org.eclipse.jdt.annotation.NonNull + private Boolean deinterlaceDoubleRate; + + public static final String JSON_PROPERTY_DEINTERLACE_METHOD = "DeinterlaceMethod"; + @org.eclipse.jdt.annotation.NonNull + private DeinterlaceMethod deinterlaceMethod; + + public static final String JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_HEVC = "EnableDecodingColorDepth10Hevc"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableDecodingColorDepth10Hevc; + + public static final String JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_VP9 = "EnableDecodingColorDepth10Vp9"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableDecodingColorDepth10Vp9; + + public static final String JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_HEVC_REXT = "EnableDecodingColorDepth10HevcRext"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableDecodingColorDepth10HevcRext; + + public static final String JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH12_HEVC_REXT = "EnableDecodingColorDepth12HevcRext"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableDecodingColorDepth12HevcRext; + + public static final String JSON_PROPERTY_ENABLE_ENHANCED_NVDEC_DECODER = "EnableEnhancedNvdecDecoder"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableEnhancedNvdecDecoder; + + public static final String JSON_PROPERTY_PREFER_SYSTEM_NATIVE_HW_DECODER = "PreferSystemNativeHwDecoder"; + @org.eclipse.jdt.annotation.NonNull + private Boolean preferSystemNativeHwDecoder; + + public static final String JSON_PROPERTY_ENABLE_INTEL_LOW_POWER_H264_HW_ENCODER = "EnableIntelLowPowerH264HwEncoder"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableIntelLowPowerH264HwEncoder; + + public static final String JSON_PROPERTY_ENABLE_INTEL_LOW_POWER_HEVC_HW_ENCODER = "EnableIntelLowPowerHevcHwEncoder"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableIntelLowPowerHevcHwEncoder; + + public static final String JSON_PROPERTY_ENABLE_HARDWARE_ENCODING = "EnableHardwareEncoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableHardwareEncoding; + + public static final String JSON_PROPERTY_ALLOW_HEVC_ENCODING = "AllowHevcEncoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean allowHevcEncoding; + + public static final String JSON_PROPERTY_ALLOW_AV1_ENCODING = "AllowAv1Encoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean allowAv1Encoding; + + public static final String JSON_PROPERTY_ENABLE_SUBTITLE_EXTRACTION = "EnableSubtitleExtraction"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableSubtitleExtraction; + + public static final String JSON_PROPERTY_HARDWARE_DECODING_CODECS = "HardwareDecodingCodecs"; + @org.eclipse.jdt.annotation.NonNull + private List hardwareDecodingCodecs; + + public static final String JSON_PROPERTY_ALLOW_ON_DEMAND_METADATA_BASED_KEYFRAME_EXTRACTION_FOR_EXTENSIONS = "AllowOnDemandMetadataBasedKeyframeExtractionForExtensions"; + @org.eclipse.jdt.annotation.NonNull + private List allowOnDemandMetadataBasedKeyframeExtractionForExtensions; + + public EncodingOptions() { + } + + public EncodingOptions encodingThreadCount(@org.eclipse.jdt.annotation.NonNull Integer encodingThreadCount) { + this.encodingThreadCount = encodingThreadCount; + return this; + } + + /** + * Gets or sets the thread count used for encoding. + * + * @return encodingThreadCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENCODING_THREAD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getEncodingThreadCount() { + return encodingThreadCount; + } + + @JsonProperty(JSON_PROPERTY_ENCODING_THREAD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncodingThreadCount(@org.eclipse.jdt.annotation.NonNull Integer encodingThreadCount) { + this.encodingThreadCount = encodingThreadCount; + } + + public EncodingOptions transcodingTempPath(@org.eclipse.jdt.annotation.NonNull String transcodingTempPath) { + this.transcodingTempPath = transcodingTempPath; + return this; + } + + /** + * Gets or sets the temporary transcoding path. + * + * @return transcodingTempPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODING_TEMP_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTranscodingTempPath() { + return transcodingTempPath; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODING_TEMP_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodingTempPath(@org.eclipse.jdt.annotation.NonNull String transcodingTempPath) { + this.transcodingTempPath = transcodingTempPath; + } + + public EncodingOptions fallbackFontPath(@org.eclipse.jdt.annotation.NonNull String fallbackFontPath) { + this.fallbackFontPath = fallbackFontPath; + return this; + } + + /** + * Gets or sets the path to the fallback font. + * + * @return fallbackFontPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FALLBACK_FONT_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFallbackFontPath() { + return fallbackFontPath; + } + + @JsonProperty(JSON_PROPERTY_FALLBACK_FONT_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFallbackFontPath(@org.eclipse.jdt.annotation.NonNull String fallbackFontPath) { + this.fallbackFontPath = fallbackFontPath; + } + + public EncodingOptions enableFallbackFont(@org.eclipse.jdt.annotation.NonNull Boolean enableFallbackFont) { + this.enableFallbackFont = enableFallbackFont; + return this; + } + + /** + * Gets or sets a value indicating whether to use the fallback font. + * + * @return enableFallbackFont + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_FALLBACK_FONT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableFallbackFont() { + return enableFallbackFont; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_FALLBACK_FONT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableFallbackFont(@org.eclipse.jdt.annotation.NonNull Boolean enableFallbackFont) { + this.enableFallbackFont = enableFallbackFont; + } + + public EncodingOptions enableAudioVbr(@org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbr) { + this.enableAudioVbr = enableAudioVbr; + return this; + } + + /** + * Gets or sets a value indicating whether audio VBR is enabled. + * + * @return enableAudioVbr + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_AUDIO_VBR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAudioVbr() { + return enableAudioVbr; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_AUDIO_VBR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAudioVbr(@org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbr) { + this.enableAudioVbr = enableAudioVbr; + } + + public EncodingOptions downMixAudioBoost(@org.eclipse.jdt.annotation.NonNull Double downMixAudioBoost) { + this.downMixAudioBoost = downMixAudioBoost; + return this; + } + + /** + * Gets or sets the audio boost applied when downmixing audio. + * + * @return downMixAudioBoost + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DOWN_MIX_AUDIO_BOOST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDownMixAudioBoost() { + return downMixAudioBoost; + } + + @JsonProperty(JSON_PROPERTY_DOWN_MIX_AUDIO_BOOST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownMixAudioBoost(@org.eclipse.jdt.annotation.NonNull Double downMixAudioBoost) { + this.downMixAudioBoost = downMixAudioBoost; + } + + public EncodingOptions downMixStereoAlgorithm( + @org.eclipse.jdt.annotation.NonNull DownMixStereoAlgorithms downMixStereoAlgorithm) { + this.downMixStereoAlgorithm = downMixStereoAlgorithm; + return this; + } + + /** + * Gets or sets the algorithm used for downmixing audio to stereo. + * + * @return downMixStereoAlgorithm + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DOWN_MIX_STEREO_ALGORITHM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DownMixStereoAlgorithms getDownMixStereoAlgorithm() { + return downMixStereoAlgorithm; + } + + @JsonProperty(JSON_PROPERTY_DOWN_MIX_STEREO_ALGORITHM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownMixStereoAlgorithm( + @org.eclipse.jdt.annotation.NonNull DownMixStereoAlgorithms downMixStereoAlgorithm) { + this.downMixStereoAlgorithm = downMixStereoAlgorithm; + } + + public EncodingOptions maxMuxingQueueSize(@org.eclipse.jdt.annotation.NonNull Integer maxMuxingQueueSize) { + this.maxMuxingQueueSize = maxMuxingQueueSize; + return this; + } + + /** + * Gets or sets the maximum size of the muxing queue. + * + * @return maxMuxingQueueSize + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_MUXING_QUEUE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxMuxingQueueSize() { + return maxMuxingQueueSize; + } + + @JsonProperty(JSON_PROPERTY_MAX_MUXING_QUEUE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxMuxingQueueSize(@org.eclipse.jdt.annotation.NonNull Integer maxMuxingQueueSize) { + this.maxMuxingQueueSize = maxMuxingQueueSize; + } + + public EncodingOptions enableThrottling(@org.eclipse.jdt.annotation.NonNull Boolean enableThrottling) { + this.enableThrottling = enableThrottling; + return this; + } + + /** + * Gets or sets a value indicating whether throttling is enabled. + * + * @return enableThrottling + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_THROTTLING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableThrottling() { + return enableThrottling; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_THROTTLING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableThrottling(@org.eclipse.jdt.annotation.NonNull Boolean enableThrottling) { + this.enableThrottling = enableThrottling; + } + + public EncodingOptions throttleDelaySeconds(@org.eclipse.jdt.annotation.NonNull Integer throttleDelaySeconds) { + this.throttleDelaySeconds = throttleDelaySeconds; + return this; + } + + /** + * Gets or sets the delay after which throttling happens. + * + * @return throttleDelaySeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THROTTLE_DELAY_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getThrottleDelaySeconds() { + return throttleDelaySeconds; + } + + @JsonProperty(JSON_PROPERTY_THROTTLE_DELAY_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThrottleDelaySeconds(@org.eclipse.jdt.annotation.NonNull Integer throttleDelaySeconds) { + this.throttleDelaySeconds = throttleDelaySeconds; + } + + public EncodingOptions enableSegmentDeletion(@org.eclipse.jdt.annotation.NonNull Boolean enableSegmentDeletion) { + this.enableSegmentDeletion = enableSegmentDeletion; + return this; + } + + /** + * Gets or sets a value indicating whether segment deletion is enabled. + * + * @return enableSegmentDeletion + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_SEGMENT_DELETION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableSegmentDeletion() { + return enableSegmentDeletion; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_SEGMENT_DELETION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableSegmentDeletion(@org.eclipse.jdt.annotation.NonNull Boolean enableSegmentDeletion) { + this.enableSegmentDeletion = enableSegmentDeletion; + } + + public EncodingOptions segmentKeepSeconds(@org.eclipse.jdt.annotation.NonNull Integer segmentKeepSeconds) { + this.segmentKeepSeconds = segmentKeepSeconds; + return this; + } + + /** + * Gets or sets seconds for which segments should be kept before being deleted. + * + * @return segmentKeepSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEGMENT_KEEP_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSegmentKeepSeconds() { + return segmentKeepSeconds; + } + + @JsonProperty(JSON_PROPERTY_SEGMENT_KEEP_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSegmentKeepSeconds(@org.eclipse.jdt.annotation.NonNull Integer segmentKeepSeconds) { + this.segmentKeepSeconds = segmentKeepSeconds; + } + + public EncodingOptions hardwareAccelerationType( + @org.eclipse.jdt.annotation.NonNull HardwareAccelerationType hardwareAccelerationType) { + this.hardwareAccelerationType = hardwareAccelerationType; + return this; + } + + /** + * Gets or sets the hardware acceleration type. + * + * @return hardwareAccelerationType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HARDWARE_ACCELERATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public HardwareAccelerationType getHardwareAccelerationType() { + return hardwareAccelerationType; + } + + @JsonProperty(JSON_PROPERTY_HARDWARE_ACCELERATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHardwareAccelerationType( + @org.eclipse.jdt.annotation.NonNull HardwareAccelerationType hardwareAccelerationType) { + this.hardwareAccelerationType = hardwareAccelerationType; + } + + public EncodingOptions encoderAppPath(@org.eclipse.jdt.annotation.NonNull String encoderAppPath) { + this.encoderAppPath = encoderAppPath; + return this; + } + + /** + * Gets or sets the FFmpeg path as set by the user via the UI. + * + * @return encoderAppPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENCODER_APP_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEncoderAppPath() { + return encoderAppPath; + } + + @JsonProperty(JSON_PROPERTY_ENCODER_APP_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncoderAppPath(@org.eclipse.jdt.annotation.NonNull String encoderAppPath) { + this.encoderAppPath = encoderAppPath; + } + + public EncodingOptions encoderAppPathDisplay(@org.eclipse.jdt.annotation.NonNull String encoderAppPathDisplay) { + this.encoderAppPathDisplay = encoderAppPathDisplay; + return this; + } + + /** + * Gets or sets the current FFmpeg path being used by the system and displayed on the transcode page. + * + * @return encoderAppPathDisplay + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENCODER_APP_PATH_DISPLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEncoderAppPathDisplay() { + return encoderAppPathDisplay; + } + + @JsonProperty(JSON_PROPERTY_ENCODER_APP_PATH_DISPLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncoderAppPathDisplay(@org.eclipse.jdt.annotation.NonNull String encoderAppPathDisplay) { + this.encoderAppPathDisplay = encoderAppPathDisplay; + } + + public EncodingOptions vaapiDevice(@org.eclipse.jdt.annotation.NonNull String vaapiDevice) { + this.vaapiDevice = vaapiDevice; + return this; + } + + /** + * Gets or sets the VA-API device. + * + * @return vaapiDevice + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VAAPI_DEVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVaapiDevice() { + return vaapiDevice; + } + + @JsonProperty(JSON_PROPERTY_VAAPI_DEVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVaapiDevice(@org.eclipse.jdt.annotation.NonNull String vaapiDevice) { + this.vaapiDevice = vaapiDevice; + } + + public EncodingOptions qsvDevice(@org.eclipse.jdt.annotation.NonNull String qsvDevice) { + this.qsvDevice = qsvDevice; + return this; + } + + /** + * Gets or sets the QSV device. + * + * @return qsvDevice + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_QSV_DEVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQsvDevice() { + return qsvDevice; + } + + @JsonProperty(JSON_PROPERTY_QSV_DEVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQsvDevice(@org.eclipse.jdt.annotation.NonNull String qsvDevice) { + this.qsvDevice = qsvDevice; + } + + public EncodingOptions enableTonemapping(@org.eclipse.jdt.annotation.NonNull Boolean enableTonemapping) { + this.enableTonemapping = enableTonemapping; + return this; + } + + /** + * Gets or sets a value indicating whether tonemapping is enabled. + * + * @return enableTonemapping + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_TONEMAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableTonemapping() { + return enableTonemapping; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_TONEMAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableTonemapping(@org.eclipse.jdt.annotation.NonNull Boolean enableTonemapping) { + this.enableTonemapping = enableTonemapping; + } + + public EncodingOptions enableVppTonemapping(@org.eclipse.jdt.annotation.NonNull Boolean enableVppTonemapping) { + this.enableVppTonemapping = enableVppTonemapping; + return this; + } + + /** + * Gets or sets a value indicating whether VPP tonemapping is enabled. + * + * @return enableVppTonemapping + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_VPP_TONEMAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableVppTonemapping() { + return enableVppTonemapping; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_VPP_TONEMAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableVppTonemapping(@org.eclipse.jdt.annotation.NonNull Boolean enableVppTonemapping) { + this.enableVppTonemapping = enableVppTonemapping; + } + + public EncodingOptions enableVideoToolboxTonemapping( + @org.eclipse.jdt.annotation.NonNull Boolean enableVideoToolboxTonemapping) { + this.enableVideoToolboxTonemapping = enableVideoToolboxTonemapping; + return this; + } + + /** + * Gets or sets a value indicating whether videotoolbox tonemapping is enabled. + * + * @return enableVideoToolboxTonemapping + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_VIDEO_TOOLBOX_TONEMAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableVideoToolboxTonemapping() { + return enableVideoToolboxTonemapping; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_VIDEO_TOOLBOX_TONEMAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableVideoToolboxTonemapping( + @org.eclipse.jdt.annotation.NonNull Boolean enableVideoToolboxTonemapping) { + this.enableVideoToolboxTonemapping = enableVideoToolboxTonemapping; + } + + public EncodingOptions tonemappingAlgorithm( + @org.eclipse.jdt.annotation.NonNull TonemappingAlgorithm tonemappingAlgorithm) { + this.tonemappingAlgorithm = tonemappingAlgorithm; + return this; + } + + /** + * Gets or sets the tone-mapping algorithm. + * + * @return tonemappingAlgorithm + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TONEMAPPING_ALGORITHM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TonemappingAlgorithm getTonemappingAlgorithm() { + return tonemappingAlgorithm; + } + + @JsonProperty(JSON_PROPERTY_TONEMAPPING_ALGORITHM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTonemappingAlgorithm(@org.eclipse.jdt.annotation.NonNull TonemappingAlgorithm tonemappingAlgorithm) { + this.tonemappingAlgorithm = tonemappingAlgorithm; + } + + public EncodingOptions tonemappingMode(@org.eclipse.jdt.annotation.NonNull TonemappingMode tonemappingMode) { + this.tonemappingMode = tonemappingMode; + return this; + } + + /** + * Gets or sets the tone-mapping mode. + * + * @return tonemappingMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TONEMAPPING_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TonemappingMode getTonemappingMode() { + return tonemappingMode; + } + + @JsonProperty(JSON_PROPERTY_TONEMAPPING_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTonemappingMode(@org.eclipse.jdt.annotation.NonNull TonemappingMode tonemappingMode) { + this.tonemappingMode = tonemappingMode; + } + + public EncodingOptions tonemappingRange(@org.eclipse.jdt.annotation.NonNull TonemappingRange tonemappingRange) { + this.tonemappingRange = tonemappingRange; + return this; + } + + /** + * Gets or sets the tone-mapping range. + * + * @return tonemappingRange + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TONEMAPPING_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TonemappingRange getTonemappingRange() { + return tonemappingRange; + } + + @JsonProperty(JSON_PROPERTY_TONEMAPPING_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTonemappingRange(@org.eclipse.jdt.annotation.NonNull TonemappingRange tonemappingRange) { + this.tonemappingRange = tonemappingRange; + } + + public EncodingOptions tonemappingDesat(@org.eclipse.jdt.annotation.NonNull Double tonemappingDesat) { + this.tonemappingDesat = tonemappingDesat; + return this; + } + + /** + * Gets or sets the tone-mapping desaturation. + * + * @return tonemappingDesat + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TONEMAPPING_DESAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTonemappingDesat() { + return tonemappingDesat; + } + + @JsonProperty(JSON_PROPERTY_TONEMAPPING_DESAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTonemappingDesat(@org.eclipse.jdt.annotation.NonNull Double tonemappingDesat) { + this.tonemappingDesat = tonemappingDesat; + } + + public EncodingOptions tonemappingPeak(@org.eclipse.jdt.annotation.NonNull Double tonemappingPeak) { + this.tonemappingPeak = tonemappingPeak; + return this; + } + + /** + * Gets or sets the tone-mapping peak. + * + * @return tonemappingPeak + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TONEMAPPING_PEAK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTonemappingPeak() { + return tonemappingPeak; + } + + @JsonProperty(JSON_PROPERTY_TONEMAPPING_PEAK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTonemappingPeak(@org.eclipse.jdt.annotation.NonNull Double tonemappingPeak) { + this.tonemappingPeak = tonemappingPeak; + } + + public EncodingOptions tonemappingParam(@org.eclipse.jdt.annotation.NonNull Double tonemappingParam) { + this.tonemappingParam = tonemappingParam; + return this; + } + + /** + * Gets or sets the tone-mapping parameters. + * + * @return tonemappingParam + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TONEMAPPING_PARAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTonemappingParam() { + return tonemappingParam; + } + + @JsonProperty(JSON_PROPERTY_TONEMAPPING_PARAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTonemappingParam(@org.eclipse.jdt.annotation.NonNull Double tonemappingParam) { + this.tonemappingParam = tonemappingParam; + } + + public EncodingOptions vppTonemappingBrightness( + @org.eclipse.jdt.annotation.NonNull Double vppTonemappingBrightness) { + this.vppTonemappingBrightness = vppTonemappingBrightness; + return this; + } + + /** + * Gets or sets the VPP tone-mapping brightness. + * + * @return vppTonemappingBrightness + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VPP_TONEMAPPING_BRIGHTNESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getVppTonemappingBrightness() { + return vppTonemappingBrightness; + } + + @JsonProperty(JSON_PROPERTY_VPP_TONEMAPPING_BRIGHTNESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVppTonemappingBrightness(@org.eclipse.jdt.annotation.NonNull Double vppTonemappingBrightness) { + this.vppTonemappingBrightness = vppTonemappingBrightness; + } + + public EncodingOptions vppTonemappingContrast(@org.eclipse.jdt.annotation.NonNull Double vppTonemappingContrast) { + this.vppTonemappingContrast = vppTonemappingContrast; + return this; + } + + /** + * Gets or sets the VPP tone-mapping contrast. + * + * @return vppTonemappingContrast + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VPP_TONEMAPPING_CONTRAST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getVppTonemappingContrast() { + return vppTonemappingContrast; + } + + @JsonProperty(JSON_PROPERTY_VPP_TONEMAPPING_CONTRAST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVppTonemappingContrast(@org.eclipse.jdt.annotation.NonNull Double vppTonemappingContrast) { + this.vppTonemappingContrast = vppTonemappingContrast; + } + + public EncodingOptions h264Crf(@org.eclipse.jdt.annotation.NonNull Integer h264Crf) { + this.h264Crf = h264Crf; + return this; + } + + /** + * Gets or sets the H264 CRF. + * + * @return h264Crf + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_H264_CRF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getH264Crf() { + return h264Crf; + } + + @JsonProperty(JSON_PROPERTY_H264_CRF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setH264Crf(@org.eclipse.jdt.annotation.NonNull Integer h264Crf) { + this.h264Crf = h264Crf; + } + + public EncodingOptions h265Crf(@org.eclipse.jdt.annotation.NonNull Integer h265Crf) { + this.h265Crf = h265Crf; + return this; + } + + /** + * Gets or sets the H265 CRF. + * + * @return h265Crf + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_H265_CRF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getH265Crf() { + return h265Crf; + } + + @JsonProperty(JSON_PROPERTY_H265_CRF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setH265Crf(@org.eclipse.jdt.annotation.NonNull Integer h265Crf) { + this.h265Crf = h265Crf; + } + + public EncodingOptions encoderPreset(@org.eclipse.jdt.annotation.NonNull EncoderPreset encoderPreset) { + this.encoderPreset = encoderPreset; + return this; + } + + /** + * Gets or sets the encoder preset. + * + * @return encoderPreset + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENCODER_PRESET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EncoderPreset getEncoderPreset() { + return encoderPreset; + } + + @JsonProperty(JSON_PROPERTY_ENCODER_PRESET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncoderPreset(@org.eclipse.jdt.annotation.NonNull EncoderPreset encoderPreset) { + this.encoderPreset = encoderPreset; + } + + public EncodingOptions deinterlaceDoubleRate(@org.eclipse.jdt.annotation.NonNull Boolean deinterlaceDoubleRate) { + this.deinterlaceDoubleRate = deinterlaceDoubleRate; + return this; + } + + /** + * Gets or sets a value indicating whether the framerate is doubled when deinterlacing. + * + * @return deinterlaceDoubleRate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEINTERLACE_DOUBLE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeinterlaceDoubleRate() { + return deinterlaceDoubleRate; + } + + @JsonProperty(JSON_PROPERTY_DEINTERLACE_DOUBLE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeinterlaceDoubleRate(@org.eclipse.jdt.annotation.NonNull Boolean deinterlaceDoubleRate) { + this.deinterlaceDoubleRate = deinterlaceDoubleRate; + } + + public EncodingOptions deinterlaceMethod(@org.eclipse.jdt.annotation.NonNull DeinterlaceMethod deinterlaceMethod) { + this.deinterlaceMethod = deinterlaceMethod; + return this; + } + + /** + * Gets or sets the deinterlace method. + * + * @return deinterlaceMethod + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEINTERLACE_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeinterlaceMethod getDeinterlaceMethod() { + return deinterlaceMethod; + } + + @JsonProperty(JSON_PROPERTY_DEINTERLACE_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeinterlaceMethod(@org.eclipse.jdt.annotation.NonNull DeinterlaceMethod deinterlaceMethod) { + this.deinterlaceMethod = deinterlaceMethod; + } + + public EncodingOptions enableDecodingColorDepth10Hevc( + @org.eclipse.jdt.annotation.NonNull Boolean enableDecodingColorDepth10Hevc) { + this.enableDecodingColorDepth10Hevc = enableDecodingColorDepth10Hevc; + return this; + } + + /** + * Gets or sets a value indicating whether 10bit HEVC decoding is enabled. + * + * @return enableDecodingColorDepth10Hevc + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_HEVC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableDecodingColorDepth10Hevc() { + return enableDecodingColorDepth10Hevc; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_HEVC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableDecodingColorDepth10Hevc( + @org.eclipse.jdt.annotation.NonNull Boolean enableDecodingColorDepth10Hevc) { + this.enableDecodingColorDepth10Hevc = enableDecodingColorDepth10Hevc; + } + + public EncodingOptions enableDecodingColorDepth10Vp9( + @org.eclipse.jdt.annotation.NonNull Boolean enableDecodingColorDepth10Vp9) { + this.enableDecodingColorDepth10Vp9 = enableDecodingColorDepth10Vp9; + return this; + } + + /** + * Gets or sets a value indicating whether 10bit VP9 decoding is enabled. + * + * @return enableDecodingColorDepth10Vp9 + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_VP9) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableDecodingColorDepth10Vp9() { + return enableDecodingColorDepth10Vp9; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_VP9) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableDecodingColorDepth10Vp9( + @org.eclipse.jdt.annotation.NonNull Boolean enableDecodingColorDepth10Vp9) { + this.enableDecodingColorDepth10Vp9 = enableDecodingColorDepth10Vp9; + } + + public EncodingOptions enableDecodingColorDepth10HevcRext( + @org.eclipse.jdt.annotation.NonNull Boolean enableDecodingColorDepth10HevcRext) { + this.enableDecodingColorDepth10HevcRext = enableDecodingColorDepth10HevcRext; + return this; + } + + /** + * Gets or sets a value indicating whether 8/10bit HEVC RExt decoding is enabled. + * + * @return enableDecodingColorDepth10HevcRext + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_HEVC_REXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableDecodingColorDepth10HevcRext() { + return enableDecodingColorDepth10HevcRext; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_HEVC_REXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableDecodingColorDepth10HevcRext( + @org.eclipse.jdt.annotation.NonNull Boolean enableDecodingColorDepth10HevcRext) { + this.enableDecodingColorDepth10HevcRext = enableDecodingColorDepth10HevcRext; + } + + public EncodingOptions enableDecodingColorDepth12HevcRext( + @org.eclipse.jdt.annotation.NonNull Boolean enableDecodingColorDepth12HevcRext) { + this.enableDecodingColorDepth12HevcRext = enableDecodingColorDepth12HevcRext; + return this; + } + + /** + * Gets or sets a value indicating whether 12bit HEVC RExt decoding is enabled. + * + * @return enableDecodingColorDepth12HevcRext + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH12_HEVC_REXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableDecodingColorDepth12HevcRext() { + return enableDecodingColorDepth12HevcRext; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH12_HEVC_REXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableDecodingColorDepth12HevcRext( + @org.eclipse.jdt.annotation.NonNull Boolean enableDecodingColorDepth12HevcRext) { + this.enableDecodingColorDepth12HevcRext = enableDecodingColorDepth12HevcRext; + } + + public EncodingOptions enableEnhancedNvdecDecoder( + @org.eclipse.jdt.annotation.NonNull Boolean enableEnhancedNvdecDecoder) { + this.enableEnhancedNvdecDecoder = enableEnhancedNvdecDecoder; + return this; + } + + /** + * Gets or sets a value indicating whether the enhanced NVDEC is enabled. + * + * @return enableEnhancedNvdecDecoder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_ENHANCED_NVDEC_DECODER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableEnhancedNvdecDecoder() { + return enableEnhancedNvdecDecoder; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_ENHANCED_NVDEC_DECODER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableEnhancedNvdecDecoder(@org.eclipse.jdt.annotation.NonNull Boolean enableEnhancedNvdecDecoder) { + this.enableEnhancedNvdecDecoder = enableEnhancedNvdecDecoder; + } + + public EncodingOptions preferSystemNativeHwDecoder( + @org.eclipse.jdt.annotation.NonNull Boolean preferSystemNativeHwDecoder) { + this.preferSystemNativeHwDecoder = preferSystemNativeHwDecoder; + return this; + } + + /** + * Gets or sets a value indicating whether the system native hardware decoder should be used. + * + * @return preferSystemNativeHwDecoder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREFER_SYSTEM_NATIVE_HW_DECODER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPreferSystemNativeHwDecoder() { + return preferSystemNativeHwDecoder; + } + + @JsonProperty(JSON_PROPERTY_PREFER_SYSTEM_NATIVE_HW_DECODER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreferSystemNativeHwDecoder( + @org.eclipse.jdt.annotation.NonNull Boolean preferSystemNativeHwDecoder) { + this.preferSystemNativeHwDecoder = preferSystemNativeHwDecoder; + } + + public EncodingOptions enableIntelLowPowerH264HwEncoder( + @org.eclipse.jdt.annotation.NonNull Boolean enableIntelLowPowerH264HwEncoder) { + this.enableIntelLowPowerH264HwEncoder = enableIntelLowPowerH264HwEncoder; + return this; + } + + /** + * Gets or sets a value indicating whether the Intel H264 low-power hardware encoder should be used. + * + * @return enableIntelLowPowerH264HwEncoder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_INTEL_LOW_POWER_H264_HW_ENCODER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableIntelLowPowerH264HwEncoder() { + return enableIntelLowPowerH264HwEncoder; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_INTEL_LOW_POWER_H264_HW_ENCODER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableIntelLowPowerH264HwEncoder( + @org.eclipse.jdt.annotation.NonNull Boolean enableIntelLowPowerH264HwEncoder) { + this.enableIntelLowPowerH264HwEncoder = enableIntelLowPowerH264HwEncoder; + } + + public EncodingOptions enableIntelLowPowerHevcHwEncoder( + @org.eclipse.jdt.annotation.NonNull Boolean enableIntelLowPowerHevcHwEncoder) { + this.enableIntelLowPowerHevcHwEncoder = enableIntelLowPowerHevcHwEncoder; + return this; + } + + /** + * Gets or sets a value indicating whether the Intel HEVC low-power hardware encoder should be used. + * + * @return enableIntelLowPowerHevcHwEncoder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_INTEL_LOW_POWER_HEVC_HW_ENCODER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableIntelLowPowerHevcHwEncoder() { + return enableIntelLowPowerHevcHwEncoder; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_INTEL_LOW_POWER_HEVC_HW_ENCODER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableIntelLowPowerHevcHwEncoder( + @org.eclipse.jdt.annotation.NonNull Boolean enableIntelLowPowerHevcHwEncoder) { + this.enableIntelLowPowerHevcHwEncoder = enableIntelLowPowerHevcHwEncoder; + } + + public EncodingOptions enableHardwareEncoding(@org.eclipse.jdt.annotation.NonNull Boolean enableHardwareEncoding) { + this.enableHardwareEncoding = enableHardwareEncoding; + return this; + } + + /** + * Gets or sets a value indicating whether hardware encoding is enabled. + * + * @return enableHardwareEncoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_HARDWARE_ENCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableHardwareEncoding() { + return enableHardwareEncoding; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_HARDWARE_ENCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableHardwareEncoding(@org.eclipse.jdt.annotation.NonNull Boolean enableHardwareEncoding) { + this.enableHardwareEncoding = enableHardwareEncoding; + } + + public EncodingOptions allowHevcEncoding(@org.eclipse.jdt.annotation.NonNull Boolean allowHevcEncoding) { + this.allowHevcEncoding = allowHevcEncoding; + return this; + } + + /** + * Gets or sets a value indicating whether HEVC encoding is enabled. + * + * @return allowHevcEncoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_HEVC_ENCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowHevcEncoding() { + return allowHevcEncoding; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_HEVC_ENCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowHevcEncoding(@org.eclipse.jdt.annotation.NonNull Boolean allowHevcEncoding) { + this.allowHevcEncoding = allowHevcEncoding; + } + + public EncodingOptions allowAv1Encoding(@org.eclipse.jdt.annotation.NonNull Boolean allowAv1Encoding) { + this.allowAv1Encoding = allowAv1Encoding; + return this; + } + + /** + * Gets or sets a value indicating whether AV1 encoding is enabled. + * + * @return allowAv1Encoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_AV1_ENCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowAv1Encoding() { + return allowAv1Encoding; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_AV1_ENCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowAv1Encoding(@org.eclipse.jdt.annotation.NonNull Boolean allowAv1Encoding) { + this.allowAv1Encoding = allowAv1Encoding; + } + + public EncodingOptions enableSubtitleExtraction( + @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitleExtraction) { + this.enableSubtitleExtraction = enableSubtitleExtraction; + return this; + } + + /** + * Gets or sets a value indicating whether subtitle extraction is enabled. + * + * @return enableSubtitleExtraction + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_SUBTITLE_EXTRACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableSubtitleExtraction() { + return enableSubtitleExtraction; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_SUBTITLE_EXTRACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableSubtitleExtraction(@org.eclipse.jdt.annotation.NonNull Boolean enableSubtitleExtraction) { + this.enableSubtitleExtraction = enableSubtitleExtraction; + } + + public EncodingOptions hardwareDecodingCodecs( + @org.eclipse.jdt.annotation.NonNull List hardwareDecodingCodecs) { + this.hardwareDecodingCodecs = hardwareDecodingCodecs; + return this; + } + + public EncodingOptions addHardwareDecodingCodecsItem(String hardwareDecodingCodecsItem) { + if (this.hardwareDecodingCodecs == null) { + this.hardwareDecodingCodecs = new ArrayList<>(); + } + this.hardwareDecodingCodecs.add(hardwareDecodingCodecsItem); + return this; + } + + /** + * Gets or sets the codecs hardware encoding is used for. + * + * @return hardwareDecodingCodecs + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HARDWARE_DECODING_CODECS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getHardwareDecodingCodecs() { + return hardwareDecodingCodecs; + } + + @JsonProperty(JSON_PROPERTY_HARDWARE_DECODING_CODECS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHardwareDecodingCodecs(@org.eclipse.jdt.annotation.NonNull List hardwareDecodingCodecs) { + this.hardwareDecodingCodecs = hardwareDecodingCodecs; + } + + public EncodingOptions allowOnDemandMetadataBasedKeyframeExtractionForExtensions( + @org.eclipse.jdt.annotation.NonNull List allowOnDemandMetadataBasedKeyframeExtractionForExtensions) { + this.allowOnDemandMetadataBasedKeyframeExtractionForExtensions = allowOnDemandMetadataBasedKeyframeExtractionForExtensions; + return this; + } + + public EncodingOptions addAllowOnDemandMetadataBasedKeyframeExtractionForExtensionsItem( + String allowOnDemandMetadataBasedKeyframeExtractionForExtensionsItem) { + if (this.allowOnDemandMetadataBasedKeyframeExtractionForExtensions == null) { + this.allowOnDemandMetadataBasedKeyframeExtractionForExtensions = new ArrayList<>(); + } + this.allowOnDemandMetadataBasedKeyframeExtractionForExtensions + .add(allowOnDemandMetadataBasedKeyframeExtractionForExtensionsItem); + return this; + } + + /** + * Gets or sets the file extensions on-demand metadata based keyframe extraction is enabled for. + * + * @return allowOnDemandMetadataBasedKeyframeExtractionForExtensions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_ON_DEMAND_METADATA_BASED_KEYFRAME_EXTRACTION_FOR_EXTENSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAllowOnDemandMetadataBasedKeyframeExtractionForExtensions() { + return allowOnDemandMetadataBasedKeyframeExtractionForExtensions; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_ON_DEMAND_METADATA_BASED_KEYFRAME_EXTRACTION_FOR_EXTENSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowOnDemandMetadataBasedKeyframeExtractionForExtensions( + @org.eclipse.jdt.annotation.NonNull List allowOnDemandMetadataBasedKeyframeExtractionForExtensions) { + this.allowOnDemandMetadataBasedKeyframeExtractionForExtensions = allowOnDemandMetadataBasedKeyframeExtractionForExtensions; + } + + /** + * Return true if this EncodingOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EncodingOptions encodingOptions = (EncodingOptions) o; + return Objects.equals(this.encodingThreadCount, encodingOptions.encodingThreadCount) + && Objects.equals(this.transcodingTempPath, encodingOptions.transcodingTempPath) + && Objects.equals(this.fallbackFontPath, encodingOptions.fallbackFontPath) + && Objects.equals(this.enableFallbackFont, encodingOptions.enableFallbackFont) + && Objects.equals(this.enableAudioVbr, encodingOptions.enableAudioVbr) + && Objects.equals(this.downMixAudioBoost, encodingOptions.downMixAudioBoost) + && Objects.equals(this.downMixStereoAlgorithm, encodingOptions.downMixStereoAlgorithm) + && Objects.equals(this.maxMuxingQueueSize, encodingOptions.maxMuxingQueueSize) + && Objects.equals(this.enableThrottling, encodingOptions.enableThrottling) + && Objects.equals(this.throttleDelaySeconds, encodingOptions.throttleDelaySeconds) + && Objects.equals(this.enableSegmentDeletion, encodingOptions.enableSegmentDeletion) + && Objects.equals(this.segmentKeepSeconds, encodingOptions.segmentKeepSeconds) + && Objects.equals(this.hardwareAccelerationType, encodingOptions.hardwareAccelerationType) + && Objects.equals(this.encoderAppPath, encodingOptions.encoderAppPath) + && Objects.equals(this.encoderAppPathDisplay, encodingOptions.encoderAppPathDisplay) + && Objects.equals(this.vaapiDevice, encodingOptions.vaapiDevice) + && Objects.equals(this.qsvDevice, encodingOptions.qsvDevice) + && Objects.equals(this.enableTonemapping, encodingOptions.enableTonemapping) + && Objects.equals(this.enableVppTonemapping, encodingOptions.enableVppTonemapping) + && Objects.equals(this.enableVideoToolboxTonemapping, encodingOptions.enableVideoToolboxTonemapping) + && Objects.equals(this.tonemappingAlgorithm, encodingOptions.tonemappingAlgorithm) + && Objects.equals(this.tonemappingMode, encodingOptions.tonemappingMode) + && Objects.equals(this.tonemappingRange, encodingOptions.tonemappingRange) + && Objects.equals(this.tonemappingDesat, encodingOptions.tonemappingDesat) + && Objects.equals(this.tonemappingPeak, encodingOptions.tonemappingPeak) + && Objects.equals(this.tonemappingParam, encodingOptions.tonemappingParam) + && Objects.equals(this.vppTonemappingBrightness, encodingOptions.vppTonemappingBrightness) + && Objects.equals(this.vppTonemappingContrast, encodingOptions.vppTonemappingContrast) + && Objects.equals(this.h264Crf, encodingOptions.h264Crf) + && Objects.equals(this.h265Crf, encodingOptions.h265Crf) + && Objects.equals(this.encoderPreset, encodingOptions.encoderPreset) + && Objects.equals(this.deinterlaceDoubleRate, encodingOptions.deinterlaceDoubleRate) + && Objects.equals(this.deinterlaceMethod, encodingOptions.deinterlaceMethod) + && Objects.equals(this.enableDecodingColorDepth10Hevc, encodingOptions.enableDecodingColorDepth10Hevc) + && Objects.equals(this.enableDecodingColorDepth10Vp9, encodingOptions.enableDecodingColorDepth10Vp9) + && Objects.equals(this.enableDecodingColorDepth10HevcRext, + encodingOptions.enableDecodingColorDepth10HevcRext) + && Objects.equals(this.enableDecodingColorDepth12HevcRext, + encodingOptions.enableDecodingColorDepth12HevcRext) + && Objects.equals(this.enableEnhancedNvdecDecoder, encodingOptions.enableEnhancedNvdecDecoder) + && Objects.equals(this.preferSystemNativeHwDecoder, encodingOptions.preferSystemNativeHwDecoder) + && Objects.equals(this.enableIntelLowPowerH264HwEncoder, + encodingOptions.enableIntelLowPowerH264HwEncoder) + && Objects.equals(this.enableIntelLowPowerHevcHwEncoder, + encodingOptions.enableIntelLowPowerHevcHwEncoder) + && Objects.equals(this.enableHardwareEncoding, encodingOptions.enableHardwareEncoding) + && Objects.equals(this.allowHevcEncoding, encodingOptions.allowHevcEncoding) + && Objects.equals(this.allowAv1Encoding, encodingOptions.allowAv1Encoding) + && Objects.equals(this.enableSubtitleExtraction, encodingOptions.enableSubtitleExtraction) + && Objects.equals(this.hardwareDecodingCodecs, encodingOptions.hardwareDecodingCodecs) + && Objects.equals(this.allowOnDemandMetadataBasedKeyframeExtractionForExtensions, + encodingOptions.allowOnDemandMetadataBasedKeyframeExtractionForExtensions); + } + + @Override + public int hashCode() { + return Objects.hash(encodingThreadCount, transcodingTempPath, fallbackFontPath, enableFallbackFont, + enableAudioVbr, downMixAudioBoost, downMixStereoAlgorithm, maxMuxingQueueSize, enableThrottling, + throttleDelaySeconds, enableSegmentDeletion, segmentKeepSeconds, hardwareAccelerationType, + encoderAppPath, encoderAppPathDisplay, vaapiDevice, qsvDevice, enableTonemapping, enableVppTonemapping, + enableVideoToolboxTonemapping, tonemappingAlgorithm, tonemappingMode, tonemappingRange, + tonemappingDesat, tonemappingPeak, tonemappingParam, vppTonemappingBrightness, vppTonemappingContrast, + h264Crf, h265Crf, encoderPreset, deinterlaceDoubleRate, deinterlaceMethod, + enableDecodingColorDepth10Hevc, enableDecodingColorDepth10Vp9, enableDecodingColorDepth10HevcRext, + enableDecodingColorDepth12HevcRext, enableEnhancedNvdecDecoder, preferSystemNativeHwDecoder, + enableIntelLowPowerH264HwEncoder, enableIntelLowPowerHevcHwEncoder, enableHardwareEncoding, + allowHevcEncoding, allowAv1Encoding, enableSubtitleExtraction, hardwareDecodingCodecs, + allowOnDemandMetadataBasedKeyframeExtractionForExtensions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EncodingOptions {\n"); + sb.append(" encodingThreadCount: ").append(toIndentedString(encodingThreadCount)).append("\n"); + sb.append(" transcodingTempPath: ").append(toIndentedString(transcodingTempPath)).append("\n"); + sb.append(" fallbackFontPath: ").append(toIndentedString(fallbackFontPath)).append("\n"); + sb.append(" enableFallbackFont: ").append(toIndentedString(enableFallbackFont)).append("\n"); + sb.append(" enableAudioVbr: ").append(toIndentedString(enableAudioVbr)).append("\n"); + sb.append(" downMixAudioBoost: ").append(toIndentedString(downMixAudioBoost)).append("\n"); + sb.append(" downMixStereoAlgorithm: ").append(toIndentedString(downMixStereoAlgorithm)).append("\n"); + sb.append(" maxMuxingQueueSize: ").append(toIndentedString(maxMuxingQueueSize)).append("\n"); + sb.append(" enableThrottling: ").append(toIndentedString(enableThrottling)).append("\n"); + sb.append(" throttleDelaySeconds: ").append(toIndentedString(throttleDelaySeconds)).append("\n"); + sb.append(" enableSegmentDeletion: ").append(toIndentedString(enableSegmentDeletion)).append("\n"); + sb.append(" segmentKeepSeconds: ").append(toIndentedString(segmentKeepSeconds)).append("\n"); + sb.append(" hardwareAccelerationType: ").append(toIndentedString(hardwareAccelerationType)).append("\n"); + sb.append(" encoderAppPath: ").append(toIndentedString(encoderAppPath)).append("\n"); + sb.append(" encoderAppPathDisplay: ").append(toIndentedString(encoderAppPathDisplay)).append("\n"); + sb.append(" vaapiDevice: ").append(toIndentedString(vaapiDevice)).append("\n"); + sb.append(" qsvDevice: ").append(toIndentedString(qsvDevice)).append("\n"); + sb.append(" enableTonemapping: ").append(toIndentedString(enableTonemapping)).append("\n"); + sb.append(" enableVppTonemapping: ").append(toIndentedString(enableVppTonemapping)).append("\n"); + sb.append(" enableVideoToolboxTonemapping: ").append(toIndentedString(enableVideoToolboxTonemapping)) + .append("\n"); + sb.append(" tonemappingAlgorithm: ").append(toIndentedString(tonemappingAlgorithm)).append("\n"); + sb.append(" tonemappingMode: ").append(toIndentedString(tonemappingMode)).append("\n"); + sb.append(" tonemappingRange: ").append(toIndentedString(tonemappingRange)).append("\n"); + sb.append(" tonemappingDesat: ").append(toIndentedString(tonemappingDesat)).append("\n"); + sb.append(" tonemappingPeak: ").append(toIndentedString(tonemappingPeak)).append("\n"); + sb.append(" tonemappingParam: ").append(toIndentedString(tonemappingParam)).append("\n"); + sb.append(" vppTonemappingBrightness: ").append(toIndentedString(vppTonemappingBrightness)).append("\n"); + sb.append(" vppTonemappingContrast: ").append(toIndentedString(vppTonemappingContrast)).append("\n"); + sb.append(" h264Crf: ").append(toIndentedString(h264Crf)).append("\n"); + sb.append(" h265Crf: ").append(toIndentedString(h265Crf)).append("\n"); + sb.append(" encoderPreset: ").append(toIndentedString(encoderPreset)).append("\n"); + sb.append(" deinterlaceDoubleRate: ").append(toIndentedString(deinterlaceDoubleRate)).append("\n"); + sb.append(" deinterlaceMethod: ").append(toIndentedString(deinterlaceMethod)).append("\n"); + sb.append(" enableDecodingColorDepth10Hevc: ").append(toIndentedString(enableDecodingColorDepth10Hevc)) + .append("\n"); + sb.append(" enableDecodingColorDepth10Vp9: ").append(toIndentedString(enableDecodingColorDepth10Vp9)) + .append("\n"); + sb.append(" enableDecodingColorDepth10HevcRext: ") + .append(toIndentedString(enableDecodingColorDepth10HevcRext)).append("\n"); + sb.append(" enableDecodingColorDepth12HevcRext: ") + .append(toIndentedString(enableDecodingColorDepth12HevcRext)).append("\n"); + sb.append(" enableEnhancedNvdecDecoder: ").append(toIndentedString(enableEnhancedNvdecDecoder)).append("\n"); + sb.append(" preferSystemNativeHwDecoder: ").append(toIndentedString(preferSystemNativeHwDecoder)) + .append("\n"); + sb.append(" enableIntelLowPowerH264HwEncoder: ").append(toIndentedString(enableIntelLowPowerH264HwEncoder)) + .append("\n"); + sb.append(" enableIntelLowPowerHevcHwEncoder: ").append(toIndentedString(enableIntelLowPowerHevcHwEncoder)) + .append("\n"); + sb.append(" enableHardwareEncoding: ").append(toIndentedString(enableHardwareEncoding)).append("\n"); + sb.append(" allowHevcEncoding: ").append(toIndentedString(allowHevcEncoding)).append("\n"); + sb.append(" allowAv1Encoding: ").append(toIndentedString(allowAv1Encoding)).append("\n"); + sb.append(" enableSubtitleExtraction: ").append(toIndentedString(enableSubtitleExtraction)).append("\n"); + sb.append(" hardwareDecodingCodecs: ").append(toIndentedString(hardwareDecodingCodecs)).append("\n"); + sb.append(" allowOnDemandMetadataBasedKeyframeExtractionForExtensions: ") + .append(toIndentedString(allowOnDemandMetadataBasedKeyframeExtractionForExtensions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `EncodingThreadCount` to the URL query string + if (getEncodingThreadCount() != null) { + joiner.add(String.format("%sEncodingThreadCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEncodingThreadCount())))); + } + + // add `TranscodingTempPath` to the URL query string + if (getTranscodingTempPath() != null) { + joiner.add(String.format("%sTranscodingTempPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTranscodingTempPath())))); + } + + // add `FallbackFontPath` to the URL query string + if (getFallbackFontPath() != null) { + joiner.add(String.format("%sFallbackFontPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFallbackFontPath())))); + } + + // add `EnableFallbackFont` to the URL query string + if (getEnableFallbackFont() != null) { + joiner.add(String.format("%sEnableFallbackFont%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableFallbackFont())))); + } + + // add `EnableAudioVbr` to the URL query string + if (getEnableAudioVbr() != null) { + joiner.add(String.format("%sEnableAudioVbr%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAudioVbr())))); + } + + // add `DownMixAudioBoost` to the URL query string + if (getDownMixAudioBoost() != null) { + joiner.add(String.format("%sDownMixAudioBoost%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDownMixAudioBoost())))); + } + + // add `DownMixStereoAlgorithm` to the URL query string + if (getDownMixStereoAlgorithm() != null) { + joiner.add(String.format("%sDownMixStereoAlgorithm%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDownMixStereoAlgorithm())))); + } + + // add `MaxMuxingQueueSize` to the URL query string + if (getMaxMuxingQueueSize() != null) { + joiner.add(String.format("%sMaxMuxingQueueSize%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxMuxingQueueSize())))); + } + + // add `EnableThrottling` to the URL query string + if (getEnableThrottling() != null) { + joiner.add(String.format("%sEnableThrottling%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableThrottling())))); + } + + // add `ThrottleDelaySeconds` to the URL query string + if (getThrottleDelaySeconds() != null) { + joiner.add(String.format("%sThrottleDelaySeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getThrottleDelaySeconds())))); + } + + // add `EnableSegmentDeletion` to the URL query string + if (getEnableSegmentDeletion() != null) { + joiner.add(String.format("%sEnableSegmentDeletion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableSegmentDeletion())))); + } + + // add `SegmentKeepSeconds` to the URL query string + if (getSegmentKeepSeconds() != null) { + joiner.add(String.format("%sSegmentKeepSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSegmentKeepSeconds())))); + } + + // add `HardwareAccelerationType` to the URL query string + if (getHardwareAccelerationType() != null) { + joiner.add(String.format("%sHardwareAccelerationType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHardwareAccelerationType())))); + } + + // add `EncoderAppPath` to the URL query string + if (getEncoderAppPath() != null) { + joiner.add(String.format("%sEncoderAppPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEncoderAppPath())))); + } + + // add `EncoderAppPathDisplay` to the URL query string + if (getEncoderAppPathDisplay() != null) { + joiner.add(String.format("%sEncoderAppPathDisplay%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEncoderAppPathDisplay())))); + } + + // add `VaapiDevice` to the URL query string + if (getVaapiDevice() != null) { + joiner.add(String.format("%sVaapiDevice%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVaapiDevice())))); + } + + // add `QsvDevice` to the URL query string + if (getQsvDevice() != null) { + joiner.add(String.format("%sQsvDevice%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getQsvDevice())))); + } + + // add `EnableTonemapping` to the URL query string + if (getEnableTonemapping() != null) { + joiner.add(String.format("%sEnableTonemapping%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableTonemapping())))); + } + + // add `EnableVppTonemapping` to the URL query string + if (getEnableVppTonemapping() != null) { + joiner.add(String.format("%sEnableVppTonemapping%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableVppTonemapping())))); + } + + // add `EnableVideoToolboxTonemapping` to the URL query string + if (getEnableVideoToolboxTonemapping() != null) { + joiner.add(String.format("%sEnableVideoToolboxTonemapping%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableVideoToolboxTonemapping())))); + } + + // add `TonemappingAlgorithm` to the URL query string + if (getTonemappingAlgorithm() != null) { + joiner.add(String.format("%sTonemappingAlgorithm%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTonemappingAlgorithm())))); + } + + // add `TonemappingMode` to the URL query string + if (getTonemappingMode() != null) { + joiner.add(String.format("%sTonemappingMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTonemappingMode())))); + } + + // add `TonemappingRange` to the URL query string + if (getTonemappingRange() != null) { + joiner.add(String.format("%sTonemappingRange%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTonemappingRange())))); + } + + // add `TonemappingDesat` to the URL query string + if (getTonemappingDesat() != null) { + joiner.add(String.format("%sTonemappingDesat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTonemappingDesat())))); + } + + // add `TonemappingPeak` to the URL query string + if (getTonemappingPeak() != null) { + joiner.add(String.format("%sTonemappingPeak%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTonemappingPeak())))); + } + + // add `TonemappingParam` to the URL query string + if (getTonemappingParam() != null) { + joiner.add(String.format("%sTonemappingParam%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTonemappingParam())))); + } + + // add `VppTonemappingBrightness` to the URL query string + if (getVppTonemappingBrightness() != null) { + joiner.add(String.format("%sVppTonemappingBrightness%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVppTonemappingBrightness())))); + } + + // add `VppTonemappingContrast` to the URL query string + if (getVppTonemappingContrast() != null) { + joiner.add(String.format("%sVppTonemappingContrast%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVppTonemappingContrast())))); + } + + // add `H264Crf` to the URL query string + if (getH264Crf() != null) { + joiner.add(String.format("%sH264Crf%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getH264Crf())))); + } + + // add `H265Crf` to the URL query string + if (getH265Crf() != null) { + joiner.add(String.format("%sH265Crf%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getH265Crf())))); + } + + // add `EncoderPreset` to the URL query string + if (getEncoderPreset() != null) { + joiner.add(String.format("%sEncoderPreset%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEncoderPreset())))); + } + + // add `DeinterlaceDoubleRate` to the URL query string + if (getDeinterlaceDoubleRate() != null) { + joiner.add(String.format("%sDeinterlaceDoubleRate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeinterlaceDoubleRate())))); + } + + // add `DeinterlaceMethod` to the URL query string + if (getDeinterlaceMethod() != null) { + joiner.add(String.format("%sDeinterlaceMethod%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeinterlaceMethod())))); + } + + // add `EnableDecodingColorDepth10Hevc` to the URL query string + if (getEnableDecodingColorDepth10Hevc() != null) { + joiner.add(String.format("%sEnableDecodingColorDepth10Hevc%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableDecodingColorDepth10Hevc())))); + } + + // add `EnableDecodingColorDepth10Vp9` to the URL query string + if (getEnableDecodingColorDepth10Vp9() != null) { + joiner.add(String.format("%sEnableDecodingColorDepth10Vp9%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableDecodingColorDepth10Vp9())))); + } + + // add `EnableDecodingColorDepth10HevcRext` to the URL query string + if (getEnableDecodingColorDepth10HevcRext() != null) { + joiner.add(String.format("%sEnableDecodingColorDepth10HevcRext%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableDecodingColorDepth10HevcRext())))); + } + + // add `EnableDecodingColorDepth12HevcRext` to the URL query string + if (getEnableDecodingColorDepth12HevcRext() != null) { + joiner.add(String.format("%sEnableDecodingColorDepth12HevcRext%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableDecodingColorDepth12HevcRext())))); + } + + // add `EnableEnhancedNvdecDecoder` to the URL query string + if (getEnableEnhancedNvdecDecoder() != null) { + joiner.add(String.format("%sEnableEnhancedNvdecDecoder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableEnhancedNvdecDecoder())))); + } + + // add `PreferSystemNativeHwDecoder` to the URL query string + if (getPreferSystemNativeHwDecoder() != null) { + joiner.add(String.format("%sPreferSystemNativeHwDecoder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreferSystemNativeHwDecoder())))); + } + + // add `EnableIntelLowPowerH264HwEncoder` to the URL query string + if (getEnableIntelLowPowerH264HwEncoder() != null) { + joiner.add(String.format("%sEnableIntelLowPowerH264HwEncoder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableIntelLowPowerH264HwEncoder())))); + } + + // add `EnableIntelLowPowerHevcHwEncoder` to the URL query string + if (getEnableIntelLowPowerHevcHwEncoder() != null) { + joiner.add(String.format("%sEnableIntelLowPowerHevcHwEncoder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableIntelLowPowerHevcHwEncoder())))); + } + + // add `EnableHardwareEncoding` to the URL query string + if (getEnableHardwareEncoding() != null) { + joiner.add(String.format("%sEnableHardwareEncoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableHardwareEncoding())))); + } + + // add `AllowHevcEncoding` to the URL query string + if (getAllowHevcEncoding() != null) { + joiner.add(String.format("%sAllowHevcEncoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAllowHevcEncoding())))); + } + + // add `AllowAv1Encoding` to the URL query string + if (getAllowAv1Encoding() != null) { + joiner.add(String.format("%sAllowAv1Encoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAllowAv1Encoding())))); + } + + // add `EnableSubtitleExtraction` to the URL query string + if (getEnableSubtitleExtraction() != null) { + joiner.add(String.format("%sEnableSubtitleExtraction%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableSubtitleExtraction())))); + } + + // add `HardwareDecodingCodecs` to the URL query string + if (getHardwareDecodingCodecs() != null) { + for (int i = 0; i < getHardwareDecodingCodecs().size(); i++) { + joiner.add(String.format("%sHardwareDecodingCodecs%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getHardwareDecodingCodecs().get(i))))); + } + } + + // add `AllowOnDemandMetadataBasedKeyframeExtractionForExtensions` to the URL query string + if (getAllowOnDemandMetadataBasedKeyframeExtractionForExtensions() != null) { + for (int i = 0; i < getAllowOnDemandMetadataBasedKeyframeExtractionForExtensions().size(); i++) { + joiner.add(String.format("%sAllowOnDemandMetadataBasedKeyframeExtractionForExtensions%s%s=%s", prefix, + suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString( + getAllowOnDemandMetadataBasedKeyframeExtractionForExtensions().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private EncodingOptions instance; + + public Builder() { + this(new EncodingOptions()); + } + + protected Builder(EncodingOptions instance) { + this.instance = instance; + } + + public EncodingOptions.Builder encodingThreadCount(Integer encodingThreadCount) { + this.instance.encodingThreadCount = encodingThreadCount; + return this; + } + + public EncodingOptions.Builder transcodingTempPath(String transcodingTempPath) { + this.instance.transcodingTempPath = transcodingTempPath; + return this; + } + + public EncodingOptions.Builder fallbackFontPath(String fallbackFontPath) { + this.instance.fallbackFontPath = fallbackFontPath; + return this; + } + + public EncodingOptions.Builder enableFallbackFont(Boolean enableFallbackFont) { + this.instance.enableFallbackFont = enableFallbackFont; + return this; + } + + public EncodingOptions.Builder enableAudioVbr(Boolean enableAudioVbr) { + this.instance.enableAudioVbr = enableAudioVbr; + return this; + } + + public EncodingOptions.Builder downMixAudioBoost(Double downMixAudioBoost) { + this.instance.downMixAudioBoost = downMixAudioBoost; + return this; + } + + public EncodingOptions.Builder downMixStereoAlgorithm(DownMixStereoAlgorithms downMixStereoAlgorithm) { + this.instance.downMixStereoAlgorithm = downMixStereoAlgorithm; + return this; + } + + public EncodingOptions.Builder maxMuxingQueueSize(Integer maxMuxingQueueSize) { + this.instance.maxMuxingQueueSize = maxMuxingQueueSize; + return this; + } + + public EncodingOptions.Builder enableThrottling(Boolean enableThrottling) { + this.instance.enableThrottling = enableThrottling; + return this; + } + + public EncodingOptions.Builder throttleDelaySeconds(Integer throttleDelaySeconds) { + this.instance.throttleDelaySeconds = throttleDelaySeconds; + return this; + } + + public EncodingOptions.Builder enableSegmentDeletion(Boolean enableSegmentDeletion) { + this.instance.enableSegmentDeletion = enableSegmentDeletion; + return this; + } + + public EncodingOptions.Builder segmentKeepSeconds(Integer segmentKeepSeconds) { + this.instance.segmentKeepSeconds = segmentKeepSeconds; + return this; + } + + public EncodingOptions.Builder hardwareAccelerationType(HardwareAccelerationType hardwareAccelerationType) { + this.instance.hardwareAccelerationType = hardwareAccelerationType; + return this; + } + + public EncodingOptions.Builder encoderAppPath(String encoderAppPath) { + this.instance.encoderAppPath = encoderAppPath; + return this; + } + + public EncodingOptions.Builder encoderAppPathDisplay(String encoderAppPathDisplay) { + this.instance.encoderAppPathDisplay = encoderAppPathDisplay; + return this; + } + + public EncodingOptions.Builder vaapiDevice(String vaapiDevice) { + this.instance.vaapiDevice = vaapiDevice; + return this; + } + + public EncodingOptions.Builder qsvDevice(String qsvDevice) { + this.instance.qsvDevice = qsvDevice; + return this; + } + + public EncodingOptions.Builder enableTonemapping(Boolean enableTonemapping) { + this.instance.enableTonemapping = enableTonemapping; + return this; + } + + public EncodingOptions.Builder enableVppTonemapping(Boolean enableVppTonemapping) { + this.instance.enableVppTonemapping = enableVppTonemapping; + return this; + } + + public EncodingOptions.Builder enableVideoToolboxTonemapping(Boolean enableVideoToolboxTonemapping) { + this.instance.enableVideoToolboxTonemapping = enableVideoToolboxTonemapping; + return this; + } + + public EncodingOptions.Builder tonemappingAlgorithm(TonemappingAlgorithm tonemappingAlgorithm) { + this.instance.tonemappingAlgorithm = tonemappingAlgorithm; + return this; + } + + public EncodingOptions.Builder tonemappingMode(TonemappingMode tonemappingMode) { + this.instance.tonemappingMode = tonemappingMode; + return this; + } + + public EncodingOptions.Builder tonemappingRange(TonemappingRange tonemappingRange) { + this.instance.tonemappingRange = tonemappingRange; + return this; + } + + public EncodingOptions.Builder tonemappingDesat(Double tonemappingDesat) { + this.instance.tonemappingDesat = tonemappingDesat; + return this; + } + + public EncodingOptions.Builder tonemappingPeak(Double tonemappingPeak) { + this.instance.tonemappingPeak = tonemappingPeak; + return this; + } + + public EncodingOptions.Builder tonemappingParam(Double tonemappingParam) { + this.instance.tonemappingParam = tonemappingParam; + return this; + } + + public EncodingOptions.Builder vppTonemappingBrightness(Double vppTonemappingBrightness) { + this.instance.vppTonemappingBrightness = vppTonemappingBrightness; + return this; + } + + public EncodingOptions.Builder vppTonemappingContrast(Double vppTonemappingContrast) { + this.instance.vppTonemappingContrast = vppTonemappingContrast; + return this; + } + + public EncodingOptions.Builder h264Crf(Integer h264Crf) { + this.instance.h264Crf = h264Crf; + return this; + } + + public EncodingOptions.Builder h265Crf(Integer h265Crf) { + this.instance.h265Crf = h265Crf; + return this; + } + + public EncodingOptions.Builder encoderPreset(EncoderPreset encoderPreset) { + this.instance.encoderPreset = encoderPreset; + return this; + } + + public EncodingOptions.Builder deinterlaceDoubleRate(Boolean deinterlaceDoubleRate) { + this.instance.deinterlaceDoubleRate = deinterlaceDoubleRate; + return this; + } + + public EncodingOptions.Builder deinterlaceMethod(DeinterlaceMethod deinterlaceMethod) { + this.instance.deinterlaceMethod = deinterlaceMethod; + return this; + } + + public EncodingOptions.Builder enableDecodingColorDepth10Hevc(Boolean enableDecodingColorDepth10Hevc) { + this.instance.enableDecodingColorDepth10Hevc = enableDecodingColorDepth10Hevc; + return this; + } + + public EncodingOptions.Builder enableDecodingColorDepth10Vp9(Boolean enableDecodingColorDepth10Vp9) { + this.instance.enableDecodingColorDepth10Vp9 = enableDecodingColorDepth10Vp9; + return this; + } + + public EncodingOptions.Builder enableDecodingColorDepth10HevcRext(Boolean enableDecodingColorDepth10HevcRext) { + this.instance.enableDecodingColorDepth10HevcRext = enableDecodingColorDepth10HevcRext; + return this; + } + + public EncodingOptions.Builder enableDecodingColorDepth12HevcRext(Boolean enableDecodingColorDepth12HevcRext) { + this.instance.enableDecodingColorDepth12HevcRext = enableDecodingColorDepth12HevcRext; + return this; + } + + public EncodingOptions.Builder enableEnhancedNvdecDecoder(Boolean enableEnhancedNvdecDecoder) { + this.instance.enableEnhancedNvdecDecoder = enableEnhancedNvdecDecoder; + return this; + } + + public EncodingOptions.Builder preferSystemNativeHwDecoder(Boolean preferSystemNativeHwDecoder) { + this.instance.preferSystemNativeHwDecoder = preferSystemNativeHwDecoder; + return this; + } + + public EncodingOptions.Builder enableIntelLowPowerH264HwEncoder(Boolean enableIntelLowPowerH264HwEncoder) { + this.instance.enableIntelLowPowerH264HwEncoder = enableIntelLowPowerH264HwEncoder; + return this; + } + + public EncodingOptions.Builder enableIntelLowPowerHevcHwEncoder(Boolean enableIntelLowPowerHevcHwEncoder) { + this.instance.enableIntelLowPowerHevcHwEncoder = enableIntelLowPowerHevcHwEncoder; + return this; + } + + public EncodingOptions.Builder enableHardwareEncoding(Boolean enableHardwareEncoding) { + this.instance.enableHardwareEncoding = enableHardwareEncoding; + return this; + } + + public EncodingOptions.Builder allowHevcEncoding(Boolean allowHevcEncoding) { + this.instance.allowHevcEncoding = allowHevcEncoding; + return this; + } + + public EncodingOptions.Builder allowAv1Encoding(Boolean allowAv1Encoding) { + this.instance.allowAv1Encoding = allowAv1Encoding; + return this; + } + + public EncodingOptions.Builder enableSubtitleExtraction(Boolean enableSubtitleExtraction) { + this.instance.enableSubtitleExtraction = enableSubtitleExtraction; + return this; + } + + public EncodingOptions.Builder hardwareDecodingCodecs(List hardwareDecodingCodecs) { + this.instance.hardwareDecodingCodecs = hardwareDecodingCodecs; + return this; + } + + public EncodingOptions.Builder allowOnDemandMetadataBasedKeyframeExtractionForExtensions( + List allowOnDemandMetadataBasedKeyframeExtractionForExtensions) { + this.instance.allowOnDemandMetadataBasedKeyframeExtractionForExtensions = allowOnDemandMetadataBasedKeyframeExtractionForExtensions; + return this; + } + + /** + * returns a built EncodingOptions instance. + * + * The builder is not reusable. + */ + public EncodingOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static EncodingOptions.Builder builder() { + return new EncodingOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public EncodingOptions.Builder toBuilder() { + return new EncodingOptions.Builder().encodingThreadCount(getEncodingThreadCount()) + .transcodingTempPath(getTranscodingTempPath()).fallbackFontPath(getFallbackFontPath()) + .enableFallbackFont(getEnableFallbackFont()).enableAudioVbr(getEnableAudioVbr()) + .downMixAudioBoost(getDownMixAudioBoost()).downMixStereoAlgorithm(getDownMixStereoAlgorithm()) + .maxMuxingQueueSize(getMaxMuxingQueueSize()).enableThrottling(getEnableThrottling()) + .throttleDelaySeconds(getThrottleDelaySeconds()).enableSegmentDeletion(getEnableSegmentDeletion()) + .segmentKeepSeconds(getSegmentKeepSeconds()).hardwareAccelerationType(getHardwareAccelerationType()) + .encoderAppPath(getEncoderAppPath()).encoderAppPathDisplay(getEncoderAppPathDisplay()) + .vaapiDevice(getVaapiDevice()).qsvDevice(getQsvDevice()).enableTonemapping(getEnableTonemapping()) + .enableVppTonemapping(getEnableVppTonemapping()) + .enableVideoToolboxTonemapping(getEnableVideoToolboxTonemapping()) + .tonemappingAlgorithm(getTonemappingAlgorithm()).tonemappingMode(getTonemappingMode()) + .tonemappingRange(getTonemappingRange()).tonemappingDesat(getTonemappingDesat()) + .tonemappingPeak(getTonemappingPeak()).tonemappingParam(getTonemappingParam()) + .vppTonemappingBrightness(getVppTonemappingBrightness()) + .vppTonemappingContrast(getVppTonemappingContrast()).h264Crf(getH264Crf()).h265Crf(getH265Crf()) + .encoderPreset(getEncoderPreset()).deinterlaceDoubleRate(getDeinterlaceDoubleRate()) + .deinterlaceMethod(getDeinterlaceMethod()) + .enableDecodingColorDepth10Hevc(getEnableDecodingColorDepth10Hevc()) + .enableDecodingColorDepth10Vp9(getEnableDecodingColorDepth10Vp9()) + .enableDecodingColorDepth10HevcRext(getEnableDecodingColorDepth10HevcRext()) + .enableDecodingColorDepth12HevcRext(getEnableDecodingColorDepth12HevcRext()) + .enableEnhancedNvdecDecoder(getEnableEnhancedNvdecDecoder()) + .preferSystemNativeHwDecoder(getPreferSystemNativeHwDecoder()) + .enableIntelLowPowerH264HwEncoder(getEnableIntelLowPowerH264HwEncoder()) + .enableIntelLowPowerHevcHwEncoder(getEnableIntelLowPowerHevcHwEncoder()) + .enableHardwareEncoding(getEnableHardwareEncoding()).allowHevcEncoding(getAllowHevcEncoding()) + .allowAv1Encoding(getAllowAv1Encoding()).enableSubtitleExtraction(getEnableSubtitleExtraction()) + .hardwareDecodingCodecs(getHardwareDecodingCodecs()) + .allowOnDemandMetadataBasedKeyframeExtractionForExtensions( + getAllowOnDemandMetadataBasedKeyframeExtractionForExtensions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EndPointInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EndPointInfo.java new file mode 100644 index 0000000000000..4483e7ebd5dd5 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/EndPointInfo.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * EndPointInfo + */ +@JsonPropertyOrder({ EndPointInfo.JSON_PROPERTY_IS_LOCAL, EndPointInfo.JSON_PROPERTY_IS_IN_NETWORK }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class EndPointInfo { + public static final String JSON_PROPERTY_IS_LOCAL = "IsLocal"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isLocal; + + public static final String JSON_PROPERTY_IS_IN_NETWORK = "IsInNetwork"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isInNetwork; + + public EndPointInfo() { + } + + public EndPointInfo isLocal(@org.eclipse.jdt.annotation.NonNull Boolean isLocal) { + this.isLocal = isLocal; + return this; + } + + /** + * Get isLocal + * + * @return isLocal + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_LOCAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsLocal() { + return isLocal; + } + + @JsonProperty(JSON_PROPERTY_IS_LOCAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsLocal(@org.eclipse.jdt.annotation.NonNull Boolean isLocal) { + this.isLocal = isLocal; + } + + public EndPointInfo isInNetwork(@org.eclipse.jdt.annotation.NonNull Boolean isInNetwork) { + this.isInNetwork = isInNetwork; + return this; + } + + /** + * Get isInNetwork + * + * @return isInNetwork + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_IN_NETWORK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsInNetwork() { + return isInNetwork; + } + + @JsonProperty(JSON_PROPERTY_IS_IN_NETWORK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsInNetwork(@org.eclipse.jdt.annotation.NonNull Boolean isInNetwork) { + this.isInNetwork = isInNetwork; + } + + /** + * Return true if this EndPointInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EndPointInfo endPointInfo = (EndPointInfo) o; + return Objects.equals(this.isLocal, endPointInfo.isLocal) + && Objects.equals(this.isInNetwork, endPointInfo.isInNetwork); + } + + @Override + public int hashCode() { + return Objects.hash(isLocal, isInNetwork); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EndPointInfo {\n"); + sb.append(" isLocal: ").append(toIndentedString(isLocal)).append("\n"); + sb.append(" isInNetwork: ").append(toIndentedString(isInNetwork)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `IsLocal` to the URL query string + if (getIsLocal() != null) { + joiner.add(String.format("%sIsLocal%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsLocal())))); + } + + // add `IsInNetwork` to the URL query string + if (getIsInNetwork() != null) { + joiner.add(String.format("%sIsInNetwork%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsInNetwork())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private EndPointInfo instance; + + public Builder() { + this(new EndPointInfo()); + } + + protected Builder(EndPointInfo instance) { + this.instance = instance; + } + + public EndPointInfo.Builder isLocal(Boolean isLocal) { + this.instance.isLocal = isLocal; + return this; + } + + public EndPointInfo.Builder isInNetwork(Boolean isInNetwork) { + this.instance.isInNetwork = isInNetwork; + return this; + } + + /** + * returns a built EndPointInfo instance. + * + * The builder is not reusable. + */ + public EndPointInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static EndPointInfo.Builder builder() { + return new EndPointInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public EndPointInfo.Builder toBuilder() { + return new EndPointInfo.Builder().isLocal(getIsLocal()).isInNetwork(getIsInNetwork()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ExternalIdInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ExternalIdInfo.java new file mode 100644 index 0000000000000..e7b909c951cc0 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ExternalIdInfo.java @@ -0,0 +1,317 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Represents the external id information for serialization to the client. + */ +@JsonPropertyOrder({ ExternalIdInfo.JSON_PROPERTY_NAME, ExternalIdInfo.JSON_PROPERTY_KEY, + ExternalIdInfo.JSON_PROPERTY_TYPE, ExternalIdInfo.JSON_PROPERTY_URL_FORMAT_STRING }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ExternalIdInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_KEY = "Key"; + @org.eclipse.jdt.annotation.NonNull + private String key; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private ExternalIdMediaType type; + + public static final String JSON_PROPERTY_URL_FORMAT_STRING = "UrlFormatString"; + @org.eclipse.jdt.annotation.NonNull + private String urlFormatString; + + public ExternalIdInfo() { + } + + public ExternalIdInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the display name of the external id provider (IE: IMDB, MusicBrainz, etc). + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ExternalIdInfo key(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + return this; + } + + /** + * Gets or sets the unique key for this id. This key should be unique across all providers. + * + * @return key + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + } + + public ExternalIdInfo type(@org.eclipse.jdt.annotation.NonNull ExternalIdMediaType type) { + this.type = type; + return this; + } + + /** + * Gets or sets the specific media type for this id. This is used to distinguish between the different external id + * types for providers with multiple ids. A null value indicates there is no specific media type associated with the + * external id, or this is the default id for the external provider so there is no need to specify a type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ExternalIdMediaType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull ExternalIdMediaType type) { + this.type = type; + } + + public ExternalIdInfo urlFormatString(@org.eclipse.jdt.annotation.NonNull String urlFormatString) { + this.urlFormatString = urlFormatString; + return this; + } + + /** + * Gets or sets the URL format string. + * + * @return urlFormatString + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_URL_FORMAT_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrlFormatString() { + return urlFormatString; + } + + @JsonProperty(JSON_PROPERTY_URL_FORMAT_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrlFormatString(@org.eclipse.jdt.annotation.NonNull String urlFormatString) { + this.urlFormatString = urlFormatString; + } + + /** + * Return true if this ExternalIdInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExternalIdInfo externalIdInfo = (ExternalIdInfo) o; + return Objects.equals(this.name, externalIdInfo.name) && Objects.equals(this.key, externalIdInfo.key) + && Objects.equals(this.type, externalIdInfo.type) + && Objects.equals(this.urlFormatString, externalIdInfo.urlFormatString); + } + + @Override + public int hashCode() { + return Objects.hash(name, key, type, urlFormatString); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExternalIdInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" urlFormatString: ").append(toIndentedString(urlFormatString)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Key` to the URL query string + if (getKey() != null) { + joiner.add(String.format("%sKey%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getKey())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `UrlFormatString` to the URL query string + if (getUrlFormatString() != null) { + joiner.add(String.format("%sUrlFormatString%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUrlFormatString())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ExternalIdInfo instance; + + public Builder() { + this(new ExternalIdInfo()); + } + + protected Builder(ExternalIdInfo instance) { + this.instance = instance; + } + + public ExternalIdInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ExternalIdInfo.Builder key(String key) { + this.instance.key = key; + return this; + } + + public ExternalIdInfo.Builder type(ExternalIdMediaType type) { + this.instance.type = type; + return this; + } + + public ExternalIdInfo.Builder urlFormatString(String urlFormatString) { + this.instance.urlFormatString = urlFormatString; + return this; + } + + /** + * returns a built ExternalIdInfo instance. + * + * The builder is not reusable. + */ + public ExternalIdInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ExternalIdInfo.Builder builder() { + return new ExternalIdInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ExternalIdInfo.Builder toBuilder() { + return new ExternalIdInfo.Builder().name(getName()).key(getKey()).type(getType()) + .urlFormatString(getUrlFormatString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ExternalIdMediaType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ExternalIdMediaType.java new file mode 100644 index 0000000000000..c0293b3533eb7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ExternalIdMediaType.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The specific media type of an MediaBrowser.Model.Providers.ExternalIdInfo. + */ +public enum ExternalIdMediaType { + + ALBUM("Album"), + + ALBUM_ARTIST("AlbumArtist"), + + ARTIST("Artist"), + + BOX_SET("BoxSet"), + + EPISODE("Episode"), + + MOVIE("Movie"), + + OTHER_ARTIST("OtherArtist"), + + PERSON("Person"), + + RELEASE_GROUP("ReleaseGroup"), + + SEASON("Season"), + + SERIES("Series"), + + TRACK("Track"), + + BOOK("Book"); + + private String value; + + ExternalIdMediaType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ExternalIdMediaType fromValue(String value) { + for (ExternalIdMediaType b : ExternalIdMediaType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ExternalUrl.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ExternalUrl.java new file mode 100644 index 0000000000000..1185df0fe1565 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ExternalUrl.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ExternalUrl + */ +@JsonPropertyOrder({ ExternalUrl.JSON_PROPERTY_NAME, ExternalUrl.JSON_PROPERTY_URL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ExternalUrl { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_URL = "Url"; + @org.eclipse.jdt.annotation.NonNull + private String url; + + public ExternalUrl() { + } + + public ExternalUrl name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ExternalUrl url(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + return this; + } + + /** + * Gets or sets the type of the item. + * + * @return url + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + } + + /** + * Return true if this ExternalUrl object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExternalUrl externalUrl = (ExternalUrl) o; + return Objects.equals(this.name, externalUrl.name) && Objects.equals(this.url, externalUrl.url); + } + + @Override + public int hashCode() { + return Objects.hash(name, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExternalUrl {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format("%sUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ExternalUrl instance; + + public Builder() { + this(new ExternalUrl()); + } + + protected Builder(ExternalUrl instance) { + this.instance = instance; + } + + public ExternalUrl.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ExternalUrl.Builder url(String url) { + this.instance.url = url; + return this; + } + + /** + * returns a built ExternalUrl instance. + * + * The builder is not reusable. + */ + public ExternalUrl build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ExternalUrl.Builder builder() { + return new ExternalUrl.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ExternalUrl.Builder toBuilder() { + return new ExternalUrl.Builder().name(getName()).url(getUrl()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ExtraType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ExtraType.java new file mode 100644 index 0000000000000..9d687b355e0d2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ExtraType.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ExtraType + */ +public enum ExtraType { + + UNKNOWN("Unknown"), + + CLIP("Clip"), + + TRAILER("Trailer"), + + BEHIND_THE_SCENES("BehindTheScenes"), + + DELETED_SCENE("DeletedScene"), + + INTERVIEW("Interview"), + + SCENE("Scene"), + + SAMPLE("Sample"), + + THEME_SONG("ThemeSong"), + + THEME_VIDEO("ThemeVideo"), + + FEATURETTE("Featurette"), + + SHORT("Short"); + + private String value; + + ExtraType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ExtraType fromValue(String value) { + for (ExtraType b : ExtraType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/FileSystemEntryInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/FileSystemEntryInfo.java new file mode 100644 index 0000000000000..e4967a474fb74 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/FileSystemEntryInfo.java @@ -0,0 +1,273 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class FileSystemEntryInfo. + */ +@JsonPropertyOrder({ FileSystemEntryInfo.JSON_PROPERTY_NAME, FileSystemEntryInfo.JSON_PROPERTY_PATH, + FileSystemEntryInfo.JSON_PROPERTY_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class FileSystemEntryInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private FileSystemEntryType type; + + public FileSystemEntryInfo() { + } + + public FileSystemEntryInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public FileSystemEntryInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public FileSystemEntryInfo type(@org.eclipse.jdt.annotation.NonNull FileSystemEntryType type) { + this.type = type; + return this; + } + + /** + * Gets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FileSystemEntryType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull FileSystemEntryType type) { + this.type = type; + } + + /** + * Return true if this FileSystemEntryInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSystemEntryInfo fileSystemEntryInfo = (FileSystemEntryInfo) o; + return Objects.equals(this.name, fileSystemEntryInfo.name) + && Objects.equals(this.path, fileSystemEntryInfo.path) + && Objects.equals(this.type, fileSystemEntryInfo.type); + } + + @Override + public int hashCode() { + return Objects.hash(name, path, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSystemEntryInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private FileSystemEntryInfo instance; + + public Builder() { + this(new FileSystemEntryInfo()); + } + + protected Builder(FileSystemEntryInfo instance) { + this.instance = instance; + } + + public FileSystemEntryInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public FileSystemEntryInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public FileSystemEntryInfo.Builder type(FileSystemEntryType type) { + this.instance.type = type; + return this; + } + + /** + * returns a built FileSystemEntryInfo instance. + * + * The builder is not reusable. + */ + public FileSystemEntryInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FileSystemEntryInfo.Builder builder() { + return new FileSystemEntryInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FileSystemEntryInfo.Builder toBuilder() { + return new FileSystemEntryInfo.Builder().name(getName()).path(getPath()).type(getType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/FileSystemEntryType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/FileSystemEntryType.java new file mode 100644 index 0000000000000..8da2a36a793e4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/FileSystemEntryType.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum FileSystemEntryType. + */ +public enum FileSystemEntryType { + + FILE("File"), + + DIRECTORY("Directory"), + + NETWORK_COMPUTER("NetworkComputer"), + + NETWORK_SHARE("NetworkShare"); + + private String value; + + FileSystemEntryType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FileSystemEntryType fromValue(String value) { + for (FileSystemEntryType b : FileSystemEntryType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/FontFile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/FontFile.java new file mode 100644 index 0000000000000..27446d24d7fb1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/FontFile.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class FontFile. + */ +@JsonPropertyOrder({ FontFile.JSON_PROPERTY_NAME, FontFile.JSON_PROPERTY_SIZE, FontFile.JSON_PROPERTY_DATE_CREATED, + FontFile.JSON_PROPERTY_DATE_MODIFIED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class FontFile { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_SIZE = "Size"; + @org.eclipse.jdt.annotation.NonNull + private Long size; + + public static final String JSON_PROPERTY_DATE_CREATED = "DateCreated"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateCreated; + + public static final String JSON_PROPERTY_DATE_MODIFIED = "DateModified"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateModified; + + public FontFile() { + } + + public FontFile name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public FontFile size(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + return this; + } + + /** + * Gets or sets the size. + * + * @return size + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSize() { + return size; + } + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSize(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + } + + public FontFile dateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + return this; + } + + /** + * Gets or sets the date created. + * + * @return dateCreated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateCreated() { + return dateCreated; + } + + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + } + + public FontFile dateModified(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateModified) { + this.dateModified = dateModified; + return this; + } + + /** + * Gets or sets the date modified. + * + * @return dateModified + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateModified() { + return dateModified; + } + + @JsonProperty(JSON_PROPERTY_DATE_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateModified(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateModified) { + this.dateModified = dateModified; + } + + /** + * Return true if this FontFile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FontFile fontFile = (FontFile) o; + return Objects.equals(this.name, fontFile.name) && Objects.equals(this.size, fontFile.size) + && Objects.equals(this.dateCreated, fontFile.dateCreated) + && Objects.equals(this.dateModified, fontFile.dateModified); + } + + @Override + public int hashCode() { + return Objects.hash(name, size, dateCreated, dateModified); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FontFile {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" dateCreated: ").append(toIndentedString(dateCreated)).append("\n"); + sb.append(" dateModified: ").append(toIndentedString(dateModified)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Size` to the URL query string + if (getSize() != null) { + joiner.add(String.format("%sSize%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSize())))); + } + + // add `DateCreated` to the URL query string + if (getDateCreated() != null) { + joiner.add(String.format("%sDateCreated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateCreated())))); + } + + // add `DateModified` to the URL query string + if (getDateModified() != null) { + joiner.add(String.format("%sDateModified%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateModified())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private FontFile instance; + + public Builder() { + this(new FontFile()); + } + + protected Builder(FontFile instance) { + this.instance = instance; + } + + public FontFile.Builder name(String name) { + this.instance.name = name; + return this; + } + + public FontFile.Builder size(Long size) { + this.instance.size = size; + return this; + } + + public FontFile.Builder dateCreated(OffsetDateTime dateCreated) { + this.instance.dateCreated = dateCreated; + return this; + } + + public FontFile.Builder dateModified(OffsetDateTime dateModified) { + this.instance.dateModified = dateModified; + return this; + } + + /** + * returns a built FontFile instance. + * + * The builder is not reusable. + */ + public FontFile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FontFile.Builder builder() { + return new FontFile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FontFile.Builder toBuilder() { + return new FontFile.Builder().name(getName()).size(getSize()).dateCreated(getDateCreated()) + .dateModified(getDateModified()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForceKeepAliveMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForceKeepAliveMessage.java new file mode 100644 index 0000000000000..204bb5ff33880 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForceKeepAliveMessage.java @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Force keep alive websocket messages. + */ +@JsonPropertyOrder({ ForceKeepAliveMessage.JSON_PROPERTY_DATA, ForceKeepAliveMessage.JSON_PROPERTY_MESSAGE_ID, + ForceKeepAliveMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ForceKeepAliveMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private Integer data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.FORCE_KEEP_ALIVE; + + public ForceKeepAliveMessage() { + } + + @JsonCreator + public ForceKeepAliveMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public ForceKeepAliveMessage data(@org.eclipse.jdt.annotation.NonNull Integer data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull Integer data) { + this.data = data; + } + + public ForceKeepAliveMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this ForceKeepAliveMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForceKeepAliveMessage forceKeepAliveMessage = (ForceKeepAliveMessage) o; + return Objects.equals(this.data, forceKeepAliveMessage.data) + && Objects.equals(this.messageId, forceKeepAliveMessage.messageId) + && Objects.equals(this.messageType, forceKeepAliveMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForceKeepAliveMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(String.format("%sData%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getData())))); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ForceKeepAliveMessage instance; + + public Builder() { + this(new ForceKeepAliveMessage()); + } + + protected Builder(ForceKeepAliveMessage instance) { + this.instance = instance; + } + + public ForceKeepAliveMessage.Builder data(Integer data) { + this.instance.data = data; + return this; + } + + public ForceKeepAliveMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public ForceKeepAliveMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built ForceKeepAliveMessage instance. + * + * The builder is not reusable. + */ + public ForceKeepAliveMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ForceKeepAliveMessage.Builder builder() { + return new ForceKeepAliveMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ForceKeepAliveMessage.Builder toBuilder() { + return new ForceKeepAliveMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForgotPasswordAction.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForgotPasswordAction.java new file mode 100644 index 0000000000000..4acca23e252d3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForgotPasswordAction.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ForgotPasswordAction + */ +public enum ForgotPasswordAction { + + CONTACT_ADMIN("ContactAdmin"), + + PIN_CODE("PinCode"), + + IN_NETWORK_REQUIRED("InNetworkRequired"); + + private String value; + + ForgotPasswordAction(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ForgotPasswordAction fromValue(String value) { + for (ForgotPasswordAction b : ForgotPasswordAction.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForgotPasswordDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForgotPasswordDto.java new file mode 100644 index 0000000000000..dd3d51ed631c3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForgotPasswordDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Forgot Password request body DTO. + */ +@JsonPropertyOrder({ ForgotPasswordDto.JSON_PROPERTY_ENTERED_USERNAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ForgotPasswordDto { + public static final String JSON_PROPERTY_ENTERED_USERNAME = "EnteredUsername"; + @org.eclipse.jdt.annotation.Nullable + private String enteredUsername; + + public ForgotPasswordDto() { + } + + public ForgotPasswordDto enteredUsername(@org.eclipse.jdt.annotation.Nullable String enteredUsername) { + this.enteredUsername = enteredUsername; + return this; + } + + /** + * Gets or sets the entered username to have its password reset. + * + * @return enteredUsername + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENTERED_USERNAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEnteredUsername() { + return enteredUsername; + } + + @JsonProperty(JSON_PROPERTY_ENTERED_USERNAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnteredUsername(@org.eclipse.jdt.annotation.Nullable String enteredUsername) { + this.enteredUsername = enteredUsername; + } + + /** + * Return true if this ForgotPasswordDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForgotPasswordDto forgotPasswordDto = (ForgotPasswordDto) o; + return Objects.equals(this.enteredUsername, forgotPasswordDto.enteredUsername); + } + + @Override + public int hashCode() { + return Objects.hash(enteredUsername); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForgotPasswordDto {\n"); + sb.append(" enteredUsername: ").append(toIndentedString(enteredUsername)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `EnteredUsername` to the URL query string + if (getEnteredUsername() != null) { + joiner.add(String.format("%sEnteredUsername%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnteredUsername())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ForgotPasswordDto instance; + + public Builder() { + this(new ForgotPasswordDto()); + } + + protected Builder(ForgotPasswordDto instance) { + this.instance = instance; + } + + public ForgotPasswordDto.Builder enteredUsername(String enteredUsername) { + this.instance.enteredUsername = enteredUsername; + return this; + } + + /** + * returns a built ForgotPasswordDto instance. + * + * The builder is not reusable. + */ + public ForgotPasswordDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ForgotPasswordDto.Builder builder() { + return new ForgotPasswordDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ForgotPasswordDto.Builder toBuilder() { + return new ForgotPasswordDto.Builder().enteredUsername(getEnteredUsername()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForgotPasswordPinDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForgotPasswordPinDto.java new file mode 100644 index 0000000000000..19a80c9a66dcc --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForgotPasswordPinDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Forgot Password Pin enter request body DTO. + */ +@JsonPropertyOrder({ ForgotPasswordPinDto.JSON_PROPERTY_PIN }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ForgotPasswordPinDto { + public static final String JSON_PROPERTY_PIN = "Pin"; + @org.eclipse.jdt.annotation.Nullable + private String pin; + + public ForgotPasswordPinDto() { + } + + public ForgotPasswordPinDto pin(@org.eclipse.jdt.annotation.Nullable String pin) { + this.pin = pin; + return this; + } + + /** + * Gets or sets the entered pin to have the password reset. + * + * @return pin + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPin() { + return pin; + } + + @JsonProperty(JSON_PROPERTY_PIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPin(@org.eclipse.jdt.annotation.Nullable String pin) { + this.pin = pin; + } + + /** + * Return true if this ForgotPasswordPinDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForgotPasswordPinDto forgotPasswordPinDto = (ForgotPasswordPinDto) o; + return Objects.equals(this.pin, forgotPasswordPinDto.pin); + } + + @Override + public int hashCode() { + return Objects.hash(pin); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForgotPasswordPinDto {\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Pin` to the URL query string + if (getPin() != null) { + joiner.add(String.format("%sPin%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPin())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ForgotPasswordPinDto instance; + + public Builder() { + this(new ForgotPasswordPinDto()); + } + + protected Builder(ForgotPasswordPinDto instance) { + this.instance = instance; + } + + public ForgotPasswordPinDto.Builder pin(String pin) { + this.instance.pin = pin; + return this; + } + + /** + * returns a built ForgotPasswordPinDto instance. + * + * The builder is not reusable. + */ + public ForgotPasswordPinDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ForgotPasswordPinDto.Builder builder() { + return new ForgotPasswordPinDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ForgotPasswordPinDto.Builder toBuilder() { + return new ForgotPasswordPinDto.Builder().pin(getPin()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForgotPasswordResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForgotPasswordResult.java new file mode 100644 index 0000000000000..075961668f4cb --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ForgotPasswordResult.java @@ -0,0 +1,276 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ForgotPasswordResult + */ +@JsonPropertyOrder({ ForgotPasswordResult.JSON_PROPERTY_ACTION, ForgotPasswordResult.JSON_PROPERTY_PIN_FILE, + ForgotPasswordResult.JSON_PROPERTY_PIN_EXPIRATION_DATE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ForgotPasswordResult { + public static final String JSON_PROPERTY_ACTION = "Action"; + @org.eclipse.jdt.annotation.NonNull + private ForgotPasswordAction action; + + public static final String JSON_PROPERTY_PIN_FILE = "PinFile"; + @org.eclipse.jdt.annotation.NonNull + private String pinFile; + + public static final String JSON_PROPERTY_PIN_EXPIRATION_DATE = "PinExpirationDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime pinExpirationDate; + + public ForgotPasswordResult() { + } + + public ForgotPasswordResult action(@org.eclipse.jdt.annotation.NonNull ForgotPasswordAction action) { + this.action = action; + return this; + } + + /** + * Gets or sets the action. + * + * @return action + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ForgotPasswordAction getAction() { + return action; + } + + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAction(@org.eclipse.jdt.annotation.NonNull ForgotPasswordAction action) { + this.action = action; + } + + public ForgotPasswordResult pinFile(@org.eclipse.jdt.annotation.NonNull String pinFile) { + this.pinFile = pinFile; + return this; + } + + /** + * Gets or sets the pin file. + * + * @return pinFile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PIN_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPinFile() { + return pinFile; + } + + @JsonProperty(JSON_PROPERTY_PIN_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPinFile(@org.eclipse.jdt.annotation.NonNull String pinFile) { + this.pinFile = pinFile; + } + + public ForgotPasswordResult pinExpirationDate( + @org.eclipse.jdt.annotation.NonNull OffsetDateTime pinExpirationDate) { + this.pinExpirationDate = pinExpirationDate; + return this; + } + + /** + * Gets or sets the pin expiration date. + * + * @return pinExpirationDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PIN_EXPIRATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPinExpirationDate() { + return pinExpirationDate; + } + + @JsonProperty(JSON_PROPERTY_PIN_EXPIRATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPinExpirationDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime pinExpirationDate) { + this.pinExpirationDate = pinExpirationDate; + } + + /** + * Return true if this ForgotPasswordResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForgotPasswordResult forgotPasswordResult = (ForgotPasswordResult) o; + return Objects.equals(this.action, forgotPasswordResult.action) + && Objects.equals(this.pinFile, forgotPasswordResult.pinFile) + && Objects.equals(this.pinExpirationDate, forgotPasswordResult.pinExpirationDate); + } + + @Override + public int hashCode() { + return Objects.hash(action, pinFile, pinExpirationDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForgotPasswordResult {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" pinFile: ").append(toIndentedString(pinFile)).append("\n"); + sb.append(" pinExpirationDate: ").append(toIndentedString(pinExpirationDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Action` to the URL query string + if (getAction() != null) { + joiner.add(String.format("%sAction%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAction())))); + } + + // add `PinFile` to the URL query string + if (getPinFile() != null) { + joiner.add(String.format("%sPinFile%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPinFile())))); + } + + // add `PinExpirationDate` to the URL query string + if (getPinExpirationDate() != null) { + joiner.add(String.format("%sPinExpirationDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPinExpirationDate())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ForgotPasswordResult instance; + + public Builder() { + this(new ForgotPasswordResult()); + } + + protected Builder(ForgotPasswordResult instance) { + this.instance = instance; + } + + public ForgotPasswordResult.Builder action(ForgotPasswordAction action) { + this.instance.action = action; + return this; + } + + public ForgotPasswordResult.Builder pinFile(String pinFile) { + this.instance.pinFile = pinFile; + return this; + } + + public ForgotPasswordResult.Builder pinExpirationDate(OffsetDateTime pinExpirationDate) { + this.instance.pinExpirationDate = pinExpirationDate; + return this; + } + + /** + * returns a built ForgotPasswordResult instance. + * + * The builder is not reusable. + */ + public ForgotPasswordResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ForgotPasswordResult.Builder builder() { + return new ForgotPasswordResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ForgotPasswordResult.Builder toBuilder() { + return new ForgotPasswordResult.Builder().action(getAction()).pinFile(getPinFile()) + .pinExpirationDate(getPinExpirationDate()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GeneralCommand.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GeneralCommand.java new file mode 100644 index 0000000000000..95e414eba030c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GeneralCommand.java @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * GeneralCommand + */ +@JsonPropertyOrder({ GeneralCommand.JSON_PROPERTY_NAME, GeneralCommand.JSON_PROPERTY_CONTROLLING_USER_ID, + GeneralCommand.JSON_PROPERTY_ARGUMENTS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class GeneralCommand { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private GeneralCommandType name; + + public static final String JSON_PROPERTY_CONTROLLING_USER_ID = "ControllingUserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID controllingUserId; + + public static final String JSON_PROPERTY_ARGUMENTS = "Arguments"; + @org.eclipse.jdt.annotation.NonNull + private Map arguments = new HashMap<>(); + + public GeneralCommand() { + } + + public GeneralCommand name(@org.eclipse.jdt.annotation.NonNull GeneralCommandType name) { + this.name = name; + return this; + } + + /** + * This exists simply to identify a set of known commands. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GeneralCommandType getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull GeneralCommandType name) { + this.name = name; + } + + public GeneralCommand controllingUserId(@org.eclipse.jdt.annotation.NonNull UUID controllingUserId) { + this.controllingUserId = controllingUserId; + return this; + } + + /** + * Get controllingUserId + * + * @return controllingUserId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTROLLING_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getControllingUserId() { + return controllingUserId; + } + + @JsonProperty(JSON_PROPERTY_CONTROLLING_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setControllingUserId(@org.eclipse.jdt.annotation.NonNull UUID controllingUserId) { + this.controllingUserId = controllingUserId; + } + + public GeneralCommand arguments(@org.eclipse.jdt.annotation.NonNull Map arguments) { + this.arguments = arguments; + return this; + } + + public GeneralCommand putArgumentsItem(String key, String argumentsItem) { + if (this.arguments == null) { + this.arguments = new HashMap<>(); + } + this.arguments.put(key, argumentsItem); + return this; + } + + /** + * Get arguments + * + * @return arguments + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARGUMENTS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getArguments() { + return arguments; + } + + @JsonProperty(JSON_PROPERTY_ARGUMENTS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setArguments(@org.eclipse.jdt.annotation.NonNull Map arguments) { + this.arguments = arguments; + } + + /** + * Return true if this GeneralCommand object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneralCommand generalCommand = (GeneralCommand) o; + return Objects.equals(this.name, generalCommand.name) + && Objects.equals(this.controllingUserId, generalCommand.controllingUserId) + && Objects.equals(this.arguments, generalCommand.arguments); + } + + @Override + public int hashCode() { + return Objects.hash(name, controllingUserId, arguments); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneralCommand {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" controllingUserId: ").append(toIndentedString(controllingUserId)).append("\n"); + sb.append(" arguments: ").append(toIndentedString(arguments)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `ControllingUserId` to the URL query string + if (getControllingUserId() != null) { + joiner.add(String.format("%sControllingUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getControllingUserId())))); + } + + // add `Arguments` to the URL query string + if (getArguments() != null) { + for (String _key : getArguments().keySet()) { + joiner.add(String.format("%sArguments%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getArguments().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getArguments().get(_key))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private GeneralCommand instance; + + public Builder() { + this(new GeneralCommand()); + } + + protected Builder(GeneralCommand instance) { + this.instance = instance; + } + + public GeneralCommand.Builder name(GeneralCommandType name) { + this.instance.name = name; + return this; + } + + public GeneralCommand.Builder controllingUserId(UUID controllingUserId) { + this.instance.controllingUserId = controllingUserId; + return this; + } + + public GeneralCommand.Builder arguments(Map arguments) { + this.instance.arguments = arguments; + return this; + } + + /** + * returns a built GeneralCommand instance. + * + * The builder is not reusable. + */ + public GeneralCommand build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static GeneralCommand.Builder builder() { + return new GeneralCommand.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public GeneralCommand.Builder toBuilder() { + return new GeneralCommand.Builder().name(getName()).controllingUserId(getControllingUserId()) + .arguments(getArguments()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GeneralCommandMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GeneralCommandMessage.java new file mode 100644 index 0000000000000..8eb4a1acbca00 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GeneralCommandMessage.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * General command websocket message. + */ +@JsonPropertyOrder({ GeneralCommandMessage.JSON_PROPERTY_DATA, GeneralCommandMessage.JSON_PROPERTY_MESSAGE_ID, + GeneralCommandMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class GeneralCommandMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private GeneralCommand data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.GENERAL_COMMAND; + + public GeneralCommandMessage() { + } + + @JsonCreator + public GeneralCommandMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public GeneralCommandMessage data(@org.eclipse.jdt.annotation.NonNull GeneralCommand data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GeneralCommand getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull GeneralCommand data) { + this.data = data; + } + + public GeneralCommandMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this GeneralCommandMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneralCommandMessage generalCommandMessage = (GeneralCommandMessage) o; + return Objects.equals(this.data, generalCommandMessage.data) + && Objects.equals(this.messageId, generalCommandMessage.messageId) + && Objects.equals(this.messageType, generalCommandMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneralCommandMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private GeneralCommandMessage instance; + + public Builder() { + this(new GeneralCommandMessage()); + } + + protected Builder(GeneralCommandMessage instance) { + this.instance = instance; + } + + public GeneralCommandMessage.Builder data(GeneralCommand data) { + this.instance.data = data; + return this; + } + + public GeneralCommandMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public GeneralCommandMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built GeneralCommandMessage instance. + * + * The builder is not reusable. + */ + public GeneralCommandMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static GeneralCommandMessage.Builder builder() { + return new GeneralCommandMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public GeneralCommandMessage.Builder toBuilder() { + return new GeneralCommandMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GeneralCommandType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GeneralCommandType.java new file mode 100644 index 0000000000000..274f12f56ddc6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GeneralCommandType.java @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * This exists simply to identify a set of known commands. + */ +public enum GeneralCommandType { + + MOVE_UP("MoveUp"), + + MOVE_DOWN("MoveDown"), + + MOVE_LEFT("MoveLeft"), + + MOVE_RIGHT("MoveRight"), + + PAGE_UP("PageUp"), + + PAGE_DOWN("PageDown"), + + PREVIOUS_LETTER("PreviousLetter"), + + NEXT_LETTER("NextLetter"), + + TOGGLE_OSD("ToggleOsd"), + + TOGGLE_CONTEXT_MENU("ToggleContextMenu"), + + SELECT("Select"), + + BACK("Back"), + + TAKE_SCREENSHOT("TakeScreenshot"), + + SEND_KEY("SendKey"), + + SEND_STRING("SendString"), + + GO_HOME("GoHome"), + + GO_TO_SETTINGS("GoToSettings"), + + VOLUME_UP("VolumeUp"), + + VOLUME_DOWN("VolumeDown"), + + MUTE("Mute"), + + UNMUTE("Unmute"), + + TOGGLE_MUTE("ToggleMute"), + + SET_VOLUME("SetVolume"), + + SET_AUDIO_STREAM_INDEX("SetAudioStreamIndex"), + + SET_SUBTITLE_STREAM_INDEX("SetSubtitleStreamIndex"), + + TOGGLE_FULLSCREEN("ToggleFullscreen"), + + DISPLAY_CONTENT("DisplayContent"), + + GO_TO_SEARCH("GoToSearch"), + + DISPLAY_MESSAGE("DisplayMessage"), + + SET_REPEAT_MODE("SetRepeatMode"), + + CHANNEL_UP("ChannelUp"), + + CHANNEL_DOWN("ChannelDown"), + + GUIDE("Guide"), + + TOGGLE_STATS("ToggleStats"), + + PLAY_MEDIA_SOURCE("PlayMediaSource"), + + PLAY_TRAILERS("PlayTrailers"), + + SET_SHUFFLE_QUEUE("SetShuffleQueue"), + + PLAY_STATE("PlayState"), + + PLAY_NEXT("PlayNext"), + + TOGGLE_OSD_MENU("ToggleOsdMenu"), + + PLAY("Play"), + + SET_MAX_STREAMING_BITRATE("SetMaxStreamingBitrate"), + + SET_PLAYBACK_ORDER("SetPlaybackOrder"); + + private String value; + + GeneralCommandType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GeneralCommandType fromValue(String value) { + for (GeneralCommandType b : GeneralCommandType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GetProgramsDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GetProgramsDto.java new file mode 100644 index 0000000000000..b2871264e559b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GetProgramsDto.java @@ -0,0 +1,1349 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Get programs dto. + */ +@JsonPropertyOrder({ GetProgramsDto.JSON_PROPERTY_CHANNEL_IDS, GetProgramsDto.JSON_PROPERTY_USER_ID, + GetProgramsDto.JSON_PROPERTY_MIN_START_DATE, GetProgramsDto.JSON_PROPERTY_HAS_AIRED, + GetProgramsDto.JSON_PROPERTY_IS_AIRING, GetProgramsDto.JSON_PROPERTY_MAX_START_DATE, + GetProgramsDto.JSON_PROPERTY_MIN_END_DATE, GetProgramsDto.JSON_PROPERTY_MAX_END_DATE, + GetProgramsDto.JSON_PROPERTY_IS_MOVIE, GetProgramsDto.JSON_PROPERTY_IS_SERIES, + GetProgramsDto.JSON_PROPERTY_IS_NEWS, GetProgramsDto.JSON_PROPERTY_IS_KIDS, + GetProgramsDto.JSON_PROPERTY_IS_SPORTS, GetProgramsDto.JSON_PROPERTY_START_INDEX, + GetProgramsDto.JSON_PROPERTY_LIMIT, GetProgramsDto.JSON_PROPERTY_SORT_BY, + GetProgramsDto.JSON_PROPERTY_SORT_ORDER, GetProgramsDto.JSON_PROPERTY_GENRES, + GetProgramsDto.JSON_PROPERTY_GENRE_IDS, GetProgramsDto.JSON_PROPERTY_ENABLE_IMAGES, + GetProgramsDto.JSON_PROPERTY_ENABLE_TOTAL_RECORD_COUNT, GetProgramsDto.JSON_PROPERTY_IMAGE_TYPE_LIMIT, + GetProgramsDto.JSON_PROPERTY_ENABLE_IMAGE_TYPES, GetProgramsDto.JSON_PROPERTY_ENABLE_USER_DATA, + GetProgramsDto.JSON_PROPERTY_SERIES_TIMER_ID, GetProgramsDto.JSON_PROPERTY_LIBRARY_SERIES_ID, + GetProgramsDto.JSON_PROPERTY_FIELDS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class GetProgramsDto { + public static final String JSON_PROPERTY_CHANNEL_IDS = "ChannelIds"; + @org.eclipse.jdt.annotation.NonNull + private List channelIds; + + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_MIN_START_DATE = "MinStartDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime minStartDate; + + public static final String JSON_PROPERTY_HAS_AIRED = "HasAired"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasAired; + + public static final String JSON_PROPERTY_IS_AIRING = "IsAiring"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAiring; + + public static final String JSON_PROPERTY_MAX_START_DATE = "MaxStartDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime maxStartDate; + + public static final String JSON_PROPERTY_MIN_END_DATE = "MinEndDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime minEndDate; + + public static final String JSON_PROPERTY_MAX_END_DATE = "MaxEndDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime maxEndDate; + + public static final String JSON_PROPERTY_IS_MOVIE = "IsMovie"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isMovie; + + public static final String JSON_PROPERTY_IS_SERIES = "IsSeries"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isSeries; + + public static final String JSON_PROPERTY_IS_NEWS = "IsNews"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isNews; + + public static final String JSON_PROPERTY_IS_KIDS = "IsKids"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isKids; + + public static final String JSON_PROPERTY_IS_SPORTS = "IsSports"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isSports; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public static final String JSON_PROPERTY_LIMIT = "Limit"; + @org.eclipse.jdt.annotation.NonNull + private Integer limit; + + public static final String JSON_PROPERTY_SORT_BY = "SortBy"; + @org.eclipse.jdt.annotation.NonNull + private List sortBy; + + public static final String JSON_PROPERTY_SORT_ORDER = "SortOrder"; + @org.eclipse.jdt.annotation.NonNull + private List sortOrder; + + public static final String JSON_PROPERTY_GENRES = "Genres"; + @org.eclipse.jdt.annotation.NonNull + private List genres; + + public static final String JSON_PROPERTY_GENRE_IDS = "GenreIds"; + @org.eclipse.jdt.annotation.NonNull + private List genreIds; + + public static final String JSON_PROPERTY_ENABLE_IMAGES = "EnableImages"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableImages; + + public static final String JSON_PROPERTY_ENABLE_TOTAL_RECORD_COUNT = "EnableTotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableTotalRecordCount = true; + + public static final String JSON_PROPERTY_IMAGE_TYPE_LIMIT = "ImageTypeLimit"; + @org.eclipse.jdt.annotation.NonNull + private Integer imageTypeLimit; + + public static final String JSON_PROPERTY_ENABLE_IMAGE_TYPES = "EnableImageTypes"; + @org.eclipse.jdt.annotation.NonNull + private List enableImageTypes; + + public static final String JSON_PROPERTY_ENABLE_USER_DATA = "EnableUserData"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableUserData; + + public static final String JSON_PROPERTY_SERIES_TIMER_ID = "SeriesTimerId"; + @org.eclipse.jdt.annotation.NonNull + private String seriesTimerId; + + public static final String JSON_PROPERTY_LIBRARY_SERIES_ID = "LibrarySeriesId"; + @org.eclipse.jdt.annotation.NonNull + private UUID librarySeriesId; + + public static final String JSON_PROPERTY_FIELDS = "Fields"; + @org.eclipse.jdt.annotation.NonNull + private List fields; + + public GetProgramsDto() { + } + + public GetProgramsDto channelIds(@org.eclipse.jdt.annotation.NonNull List channelIds) { + this.channelIds = channelIds; + return this; + } + + public GetProgramsDto addChannelIdsItem(UUID channelIdsItem) { + if (this.channelIds == null) { + this.channelIds = new ArrayList<>(); + } + this.channelIds.add(channelIdsItem); + return this; + } + + /** + * Gets or sets the channels to return guide information for. + * + * @return channelIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getChannelIds() { + return channelIds; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelIds(@org.eclipse.jdt.annotation.NonNull List channelIds) { + this.channelIds = channelIds; + } + + public GetProgramsDto userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets optional. Filter by user id. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public GetProgramsDto minStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime minStartDate) { + this.minStartDate = minStartDate; + return this; + } + + /** + * Gets or sets the minimum premiere start date. + * + * @return minStartDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIN_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getMinStartDate() { + return minStartDate; + } + + @JsonProperty(JSON_PROPERTY_MIN_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime minStartDate) { + this.minStartDate = minStartDate; + } + + public GetProgramsDto hasAired(@org.eclipse.jdt.annotation.NonNull Boolean hasAired) { + this.hasAired = hasAired; + return this; + } + + /** + * Gets or sets filter by programs that have completed airing, or not. + * + * @return hasAired + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_AIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasAired() { + return hasAired; + } + + @JsonProperty(JSON_PROPERTY_HAS_AIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasAired(@org.eclipse.jdt.annotation.NonNull Boolean hasAired) { + this.hasAired = hasAired; + } + + public GetProgramsDto isAiring(@org.eclipse.jdt.annotation.NonNull Boolean isAiring) { + this.isAiring = isAiring; + return this; + } + + /** + * Gets or sets filter by programs that are currently airing, or not. + * + * @return isAiring + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AIRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAiring() { + return isAiring; + } + + @JsonProperty(JSON_PROPERTY_IS_AIRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAiring(@org.eclipse.jdt.annotation.NonNull Boolean isAiring) { + this.isAiring = isAiring; + } + + public GetProgramsDto maxStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime maxStartDate) { + this.maxStartDate = maxStartDate; + return this; + } + + /** + * Gets or sets the maximum premiere start date. + * + * @return maxStartDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getMaxStartDate() { + return maxStartDate; + } + + @JsonProperty(JSON_PROPERTY_MAX_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime maxStartDate) { + this.maxStartDate = maxStartDate; + } + + public GetProgramsDto minEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime minEndDate) { + this.minEndDate = minEndDate; + return this; + } + + /** + * Gets or sets the minimum premiere end date. + * + * @return minEndDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIN_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getMinEndDate() { + return minEndDate; + } + + @JsonProperty(JSON_PROPERTY_MIN_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime minEndDate) { + this.minEndDate = minEndDate; + } + + public GetProgramsDto maxEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime maxEndDate) { + this.maxEndDate = maxEndDate; + return this; + } + + /** + * Gets or sets the maximum premiere end date. + * + * @return maxEndDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getMaxEndDate() { + return maxEndDate; + } + + @JsonProperty(JSON_PROPERTY_MAX_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime maxEndDate) { + this.maxEndDate = maxEndDate; + } + + public GetProgramsDto isMovie(@org.eclipse.jdt.annotation.NonNull Boolean isMovie) { + this.isMovie = isMovie; + return this; + } + + /** + * Gets or sets filter for movies. + * + * @return isMovie + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_MOVIE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsMovie() { + return isMovie; + } + + @JsonProperty(JSON_PROPERTY_IS_MOVIE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMovie(@org.eclipse.jdt.annotation.NonNull Boolean isMovie) { + this.isMovie = isMovie; + } + + public GetProgramsDto isSeries(@org.eclipse.jdt.annotation.NonNull Boolean isSeries) { + this.isSeries = isSeries; + return this; + } + + /** + * Gets or sets filter for series. + * + * @return isSeries + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_SERIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsSeries() { + return isSeries; + } + + @JsonProperty(JSON_PROPERTY_IS_SERIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsSeries(@org.eclipse.jdt.annotation.NonNull Boolean isSeries) { + this.isSeries = isSeries; + } + + public GetProgramsDto isNews(@org.eclipse.jdt.annotation.NonNull Boolean isNews) { + this.isNews = isNews; + return this; + } + + /** + * Gets or sets filter for news. + * + * @return isNews + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_NEWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsNews() { + return isNews; + } + + @JsonProperty(JSON_PROPERTY_IS_NEWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsNews(@org.eclipse.jdt.annotation.NonNull Boolean isNews) { + this.isNews = isNews; + } + + public GetProgramsDto isKids(@org.eclipse.jdt.annotation.NonNull Boolean isKids) { + this.isKids = isKids; + return this; + } + + /** + * Gets or sets filter for kids. + * + * @return isKids + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_KIDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsKids() { + return isKids; + } + + @JsonProperty(JSON_PROPERTY_IS_KIDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsKids(@org.eclipse.jdt.annotation.NonNull Boolean isKids) { + this.isKids = isKids; + } + + public GetProgramsDto isSports(@org.eclipse.jdt.annotation.NonNull Boolean isSports) { + this.isSports = isSports; + return this; + } + + /** + * Gets or sets filter for sports. + * + * @return isSports + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_SPORTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsSports() { + return isSports; + } + + @JsonProperty(JSON_PROPERTY_IS_SPORTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsSports(@org.eclipse.jdt.annotation.NonNull Boolean isSports) { + this.isSports = isSports; + } + + public GetProgramsDto startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the record index to start at. All items with a lower index will be dropped from the results. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + public GetProgramsDto limit(@org.eclipse.jdt.annotation.NonNull Integer limit) { + this.limit = limit; + return this; + } + + /** + * Gets or sets the maximum number of records to return. + * + * @return limit + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLimit() { + return limit; + } + + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLimit(@org.eclipse.jdt.annotation.NonNull Integer limit) { + this.limit = limit; + } + + public GetProgramsDto sortBy(@org.eclipse.jdt.annotation.NonNull List sortBy) { + this.sortBy = sortBy; + return this; + } + + public GetProgramsDto addSortByItem(ItemSortBy sortByItem) { + if (this.sortBy == null) { + this.sortBy = new ArrayList<>(); + } + this.sortBy.add(sortByItem); + return this; + } + + /** + * Gets or sets specify one or more sort orders, comma delimited. Options: Name, StartDate. + * + * @return sortBy + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SORT_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSortBy() { + return sortBy; + } + + @JsonProperty(JSON_PROPERTY_SORT_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortBy(@org.eclipse.jdt.annotation.NonNull List sortBy) { + this.sortBy = sortBy; + } + + public GetProgramsDto sortOrder(@org.eclipse.jdt.annotation.NonNull List sortOrder) { + this.sortOrder = sortOrder; + return this; + } + + public GetProgramsDto addSortOrderItem(SortOrder sortOrderItem) { + if (this.sortOrder == null) { + this.sortOrder = new ArrayList<>(); + } + this.sortOrder.add(sortOrderItem); + return this; + } + + /** + * Gets or sets sort order. + * + * @return sortOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SORT_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSortOrder() { + return sortOrder; + } + + @JsonProperty(JSON_PROPERTY_SORT_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortOrder(@org.eclipse.jdt.annotation.NonNull List sortOrder) { + this.sortOrder = sortOrder; + } + + public GetProgramsDto genres(@org.eclipse.jdt.annotation.NonNull List genres) { + this.genres = genres; + return this; + } + + public GetProgramsDto addGenresItem(String genresItem) { + if (this.genres == null) { + this.genres = new ArrayList<>(); + } + this.genres.add(genresItem); + return this; + } + + /** + * Gets or sets the genres to return guide information for. + * + * @return genres + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GENRES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGenres() { + return genres; + } + + @JsonProperty(JSON_PROPERTY_GENRES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGenres(@org.eclipse.jdt.annotation.NonNull List genres) { + this.genres = genres; + } + + public GetProgramsDto genreIds(@org.eclipse.jdt.annotation.NonNull List genreIds) { + this.genreIds = genreIds; + return this; + } + + public GetProgramsDto addGenreIdsItem(UUID genreIdsItem) { + if (this.genreIds == null) { + this.genreIds = new ArrayList<>(); + } + this.genreIds.add(genreIdsItem); + return this; + } + + /** + * Gets or sets the genre ids to return guide information for. + * + * @return genreIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GENRE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGenreIds() { + return genreIds; + } + + @JsonProperty(JSON_PROPERTY_GENRE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGenreIds(@org.eclipse.jdt.annotation.NonNull List genreIds) { + this.genreIds = genreIds; + } + + public GetProgramsDto enableImages(@org.eclipse.jdt.annotation.NonNull Boolean enableImages) { + this.enableImages = enableImages; + return this; + } + + /** + * Gets or sets include image information in output. + * + * @return enableImages + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_IMAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableImages() { + return enableImages; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_IMAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableImages(@org.eclipse.jdt.annotation.NonNull Boolean enableImages) { + this.enableImages = enableImages; + } + + public GetProgramsDto enableTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) { + this.enableTotalRecordCount = enableTotalRecordCount; + return this; + } + + /** + * Gets or sets a value indicating whether retrieve total record count. + * + * @return enableTotalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableTotalRecordCount() { + return enableTotalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) { + this.enableTotalRecordCount = enableTotalRecordCount; + } + + public GetProgramsDto imageTypeLimit(@org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit) { + this.imageTypeLimit = imageTypeLimit; + return this; + } + + /** + * Gets or sets the max number of images to return, per image type. + * + * @return imageTypeLimit + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_TYPE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getImageTypeLimit() { + return imageTypeLimit; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_TYPE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageTypeLimit(@org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit) { + this.imageTypeLimit = imageTypeLimit; + } + + public GetProgramsDto enableImageTypes(@org.eclipse.jdt.annotation.NonNull List enableImageTypes) { + this.enableImageTypes = enableImageTypes; + return this; + } + + public GetProgramsDto addEnableImageTypesItem(ImageType enableImageTypesItem) { + if (this.enableImageTypes == null) { + this.enableImageTypes = new ArrayList<>(); + } + this.enableImageTypes.add(enableImageTypesItem); + return this; + } + + /** + * Gets or sets the image types to include in the output. + * + * @return enableImageTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_IMAGE_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnableImageTypes() { + return enableImageTypes; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_IMAGE_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableImageTypes(@org.eclipse.jdt.annotation.NonNull List enableImageTypes) { + this.enableImageTypes = enableImageTypes; + } + + public GetProgramsDto enableUserData(@org.eclipse.jdt.annotation.NonNull Boolean enableUserData) { + this.enableUserData = enableUserData; + return this; + } + + /** + * Gets or sets include user data. + * + * @return enableUserData + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_USER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableUserData() { + return enableUserData; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_USER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableUserData(@org.eclipse.jdt.annotation.NonNull Boolean enableUserData) { + this.enableUserData = enableUserData; + } + + public GetProgramsDto seriesTimerId(@org.eclipse.jdt.annotation.NonNull String seriesTimerId) { + this.seriesTimerId = seriesTimerId; + return this; + } + + /** + * Gets or sets filter by series timer id. + * + * @return seriesTimerId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesTimerId() { + return seriesTimerId; + } + + @JsonProperty(JSON_PROPERTY_SERIES_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesTimerId(@org.eclipse.jdt.annotation.NonNull String seriesTimerId) { + this.seriesTimerId = seriesTimerId; + } + + public GetProgramsDto librarySeriesId(@org.eclipse.jdt.annotation.NonNull UUID librarySeriesId) { + this.librarySeriesId = librarySeriesId; + return this; + } + + /** + * Gets or sets filter by library series id. + * + * @return librarySeriesId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIBRARY_SERIES_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getLibrarySeriesId() { + return librarySeriesId; + } + + @JsonProperty(JSON_PROPERTY_LIBRARY_SERIES_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLibrarySeriesId(@org.eclipse.jdt.annotation.NonNull UUID librarySeriesId) { + this.librarySeriesId = librarySeriesId; + } + + public GetProgramsDto fields(@org.eclipse.jdt.annotation.NonNull List fields) { + this.fields = fields; + return this; + } + + public GetProgramsDto addFieldsItem(ItemFields fieldsItem) { + if (this.fields == null) { + this.fields = new ArrayList<>(); + } + this.fields.add(fieldsItem); + return this; + } + + /** + * Gets or sets specify additional fields of information to return in the output. + * + * @return fields + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFields() { + return fields; + } + + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFields(@org.eclipse.jdt.annotation.NonNull List fields) { + this.fields = fields; + } + + /** + * Return true if this GetProgramsDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetProgramsDto getProgramsDto = (GetProgramsDto) o; + return Objects.equals(this.channelIds, getProgramsDto.channelIds) + && Objects.equals(this.userId, getProgramsDto.userId) + && Objects.equals(this.minStartDate, getProgramsDto.minStartDate) + && Objects.equals(this.hasAired, getProgramsDto.hasAired) + && Objects.equals(this.isAiring, getProgramsDto.isAiring) + && Objects.equals(this.maxStartDate, getProgramsDto.maxStartDate) + && Objects.equals(this.minEndDate, getProgramsDto.minEndDate) + && Objects.equals(this.maxEndDate, getProgramsDto.maxEndDate) + && Objects.equals(this.isMovie, getProgramsDto.isMovie) + && Objects.equals(this.isSeries, getProgramsDto.isSeries) + && Objects.equals(this.isNews, getProgramsDto.isNews) + && Objects.equals(this.isKids, getProgramsDto.isKids) + && Objects.equals(this.isSports, getProgramsDto.isSports) + && Objects.equals(this.startIndex, getProgramsDto.startIndex) + && Objects.equals(this.limit, getProgramsDto.limit) + && Objects.equals(this.sortBy, getProgramsDto.sortBy) + && Objects.equals(this.sortOrder, getProgramsDto.sortOrder) + && Objects.equals(this.genres, getProgramsDto.genres) + && Objects.equals(this.genreIds, getProgramsDto.genreIds) + && Objects.equals(this.enableImages, getProgramsDto.enableImages) + && Objects.equals(this.enableTotalRecordCount, getProgramsDto.enableTotalRecordCount) + && Objects.equals(this.imageTypeLimit, getProgramsDto.imageTypeLimit) + && Objects.equals(this.enableImageTypes, getProgramsDto.enableImageTypes) + && Objects.equals(this.enableUserData, getProgramsDto.enableUserData) + && Objects.equals(this.seriesTimerId, getProgramsDto.seriesTimerId) + && Objects.equals(this.librarySeriesId, getProgramsDto.librarySeriesId) + && Objects.equals(this.fields, getProgramsDto.fields); + } + + @Override + public int hashCode() { + return Objects.hash(channelIds, userId, minStartDate, hasAired, isAiring, maxStartDate, minEndDate, maxEndDate, + isMovie, isSeries, isNews, isKids, isSports, startIndex, limit, sortBy, sortOrder, genres, genreIds, + enableImages, enableTotalRecordCount, imageTypeLimit, enableImageTypes, enableUserData, seriesTimerId, + librarySeriesId, fields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetProgramsDto {\n"); + sb.append(" channelIds: ").append(toIndentedString(channelIds)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" minStartDate: ").append(toIndentedString(minStartDate)).append("\n"); + sb.append(" hasAired: ").append(toIndentedString(hasAired)).append("\n"); + sb.append(" isAiring: ").append(toIndentedString(isAiring)).append("\n"); + sb.append(" maxStartDate: ").append(toIndentedString(maxStartDate)).append("\n"); + sb.append(" minEndDate: ").append(toIndentedString(minEndDate)).append("\n"); + sb.append(" maxEndDate: ").append(toIndentedString(maxEndDate)).append("\n"); + sb.append(" isMovie: ").append(toIndentedString(isMovie)).append("\n"); + sb.append(" isSeries: ").append(toIndentedString(isSeries)).append("\n"); + sb.append(" isNews: ").append(toIndentedString(isNews)).append("\n"); + sb.append(" isKids: ").append(toIndentedString(isKids)).append("\n"); + sb.append(" isSports: ").append(toIndentedString(isSports)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" sortBy: ").append(toIndentedString(sortBy)).append("\n"); + sb.append(" sortOrder: ").append(toIndentedString(sortOrder)).append("\n"); + sb.append(" genres: ").append(toIndentedString(genres)).append("\n"); + sb.append(" genreIds: ").append(toIndentedString(genreIds)).append("\n"); + sb.append(" enableImages: ").append(toIndentedString(enableImages)).append("\n"); + sb.append(" enableTotalRecordCount: ").append(toIndentedString(enableTotalRecordCount)).append("\n"); + sb.append(" imageTypeLimit: ").append(toIndentedString(imageTypeLimit)).append("\n"); + sb.append(" enableImageTypes: ").append(toIndentedString(enableImageTypes)).append("\n"); + sb.append(" enableUserData: ").append(toIndentedString(enableUserData)).append("\n"); + sb.append(" seriesTimerId: ").append(toIndentedString(seriesTimerId)).append("\n"); + sb.append(" librarySeriesId: ").append(toIndentedString(librarySeriesId)).append("\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ChannelIds` to the URL query string + if (getChannelIds() != null) { + for (int i = 0; i < getChannelIds().size(); i++) { + if (getChannelIds().get(i) != null) { + joiner.add(String.format("%sChannelIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getChannelIds().get(i))))); + } + } + } + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `MinStartDate` to the URL query string + if (getMinStartDate() != null) { + joiner.add(String.format("%sMinStartDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMinStartDate())))); + } + + // add `HasAired` to the URL query string + if (getHasAired() != null) { + joiner.add(String.format("%sHasAired%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasAired())))); + } + + // add `IsAiring` to the URL query string + if (getIsAiring() != null) { + joiner.add(String.format("%sIsAiring%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAiring())))); + } + + // add `MaxStartDate` to the URL query string + if (getMaxStartDate() != null) { + joiner.add(String.format("%sMaxStartDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxStartDate())))); + } + + // add `MinEndDate` to the URL query string + if (getMinEndDate() != null) { + joiner.add(String.format("%sMinEndDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMinEndDate())))); + } + + // add `MaxEndDate` to the URL query string + if (getMaxEndDate() != null) { + joiner.add(String.format("%sMaxEndDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxEndDate())))); + } + + // add `IsMovie` to the URL query string + if (getIsMovie() != null) { + joiner.add(String.format("%sIsMovie%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsMovie())))); + } + + // add `IsSeries` to the URL query string + if (getIsSeries() != null) { + joiner.add(String.format("%sIsSeries%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsSeries())))); + } + + // add `IsNews` to the URL query string + if (getIsNews() != null) { + joiner.add(String.format("%sIsNews%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsNews())))); + } + + // add `IsKids` to the URL query string + if (getIsKids() != null) { + joiner.add(String.format("%sIsKids%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsKids())))); + } + + // add `IsSports` to the URL query string + if (getIsSports() != null) { + joiner.add(String.format("%sIsSports%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsSports())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + // add `Limit` to the URL query string + if (getLimit() != null) { + joiner.add(String.format("%sLimit%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLimit())))); + } + + // add `SortBy` to the URL query string + if (getSortBy() != null) { + for (int i = 0; i < getSortBy().size(); i++) { + if (getSortBy().get(i) != null) { + joiner.add(String.format("%sSortBy%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSortBy().get(i))))); + } + } + } + + // add `SortOrder` to the URL query string + if (getSortOrder() != null) { + for (int i = 0; i < getSortOrder().size(); i++) { + if (getSortOrder().get(i) != null) { + joiner.add(String.format("%sSortOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSortOrder().get(i))))); + } + } + } + + // add `Genres` to the URL query string + if (getGenres() != null) { + for (int i = 0; i < getGenres().size(); i++) { + joiner.add(String.format("%sGenres%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getGenres().get(i))))); + } + } + + // add `GenreIds` to the URL query string + if (getGenreIds() != null) { + for (int i = 0; i < getGenreIds().size(); i++) { + if (getGenreIds().get(i) != null) { + joiner.add(String.format("%sGenreIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getGenreIds().get(i))))); + } + } + } + + // add `EnableImages` to the URL query string + if (getEnableImages() != null) { + joiner.add(String.format("%sEnableImages%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableImages())))); + } + + // add `EnableTotalRecordCount` to the URL query string + if (getEnableTotalRecordCount() != null) { + joiner.add(String.format("%sEnableTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableTotalRecordCount())))); + } + + // add `ImageTypeLimit` to the URL query string + if (getImageTypeLimit() != null) { + joiner.add(String.format("%sImageTypeLimit%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageTypeLimit())))); + } + + // add `EnableImageTypes` to the URL query string + if (getEnableImageTypes() != null) { + for (int i = 0; i < getEnableImageTypes().size(); i++) { + if (getEnableImageTypes().get(i) != null) { + joiner.add(String.format("%sEnableImageTypes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEnableImageTypes().get(i))))); + } + } + } + + // add `EnableUserData` to the URL query string + if (getEnableUserData() != null) { + joiner.add(String.format("%sEnableUserData%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableUserData())))); + } + + // add `SeriesTimerId` to the URL query string + if (getSeriesTimerId() != null) { + joiner.add(String.format("%sSeriesTimerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesTimerId())))); + } + + // add `LibrarySeriesId` to the URL query string + if (getLibrarySeriesId() != null) { + joiner.add(String.format("%sLibrarySeriesId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLibrarySeriesId())))); + } + + // add `Fields` to the URL query string + if (getFields() != null) { + for (int i = 0; i < getFields().size(); i++) { + if (getFields().get(i) != null) { + joiner.add(String.format("%sFields%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getFields().get(i))))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private GetProgramsDto instance; + + public Builder() { + this(new GetProgramsDto()); + } + + protected Builder(GetProgramsDto instance) { + this.instance = instance; + } + + public GetProgramsDto.Builder channelIds(List channelIds) { + this.instance.channelIds = channelIds; + return this; + } + + public GetProgramsDto.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public GetProgramsDto.Builder minStartDate(OffsetDateTime minStartDate) { + this.instance.minStartDate = minStartDate; + return this; + } + + public GetProgramsDto.Builder hasAired(Boolean hasAired) { + this.instance.hasAired = hasAired; + return this; + } + + public GetProgramsDto.Builder isAiring(Boolean isAiring) { + this.instance.isAiring = isAiring; + return this; + } + + public GetProgramsDto.Builder maxStartDate(OffsetDateTime maxStartDate) { + this.instance.maxStartDate = maxStartDate; + return this; + } + + public GetProgramsDto.Builder minEndDate(OffsetDateTime minEndDate) { + this.instance.minEndDate = minEndDate; + return this; + } + + public GetProgramsDto.Builder maxEndDate(OffsetDateTime maxEndDate) { + this.instance.maxEndDate = maxEndDate; + return this; + } + + public GetProgramsDto.Builder isMovie(Boolean isMovie) { + this.instance.isMovie = isMovie; + return this; + } + + public GetProgramsDto.Builder isSeries(Boolean isSeries) { + this.instance.isSeries = isSeries; + return this; + } + + public GetProgramsDto.Builder isNews(Boolean isNews) { + this.instance.isNews = isNews; + return this; + } + + public GetProgramsDto.Builder isKids(Boolean isKids) { + this.instance.isKids = isKids; + return this; + } + + public GetProgramsDto.Builder isSports(Boolean isSports) { + this.instance.isSports = isSports; + return this; + } + + public GetProgramsDto.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + public GetProgramsDto.Builder limit(Integer limit) { + this.instance.limit = limit; + return this; + } + + public GetProgramsDto.Builder sortBy(List sortBy) { + this.instance.sortBy = sortBy; + return this; + } + + public GetProgramsDto.Builder sortOrder(List sortOrder) { + this.instance.sortOrder = sortOrder; + return this; + } + + public GetProgramsDto.Builder genres(List genres) { + this.instance.genres = genres; + return this; + } + + public GetProgramsDto.Builder genreIds(List genreIds) { + this.instance.genreIds = genreIds; + return this; + } + + public GetProgramsDto.Builder enableImages(Boolean enableImages) { + this.instance.enableImages = enableImages; + return this; + } + + public GetProgramsDto.Builder enableTotalRecordCount(Boolean enableTotalRecordCount) { + this.instance.enableTotalRecordCount = enableTotalRecordCount; + return this; + } + + public GetProgramsDto.Builder imageTypeLimit(Integer imageTypeLimit) { + this.instance.imageTypeLimit = imageTypeLimit; + return this; + } + + public GetProgramsDto.Builder enableImageTypes(List enableImageTypes) { + this.instance.enableImageTypes = enableImageTypes; + return this; + } + + public GetProgramsDto.Builder enableUserData(Boolean enableUserData) { + this.instance.enableUserData = enableUserData; + return this; + } + + public GetProgramsDto.Builder seriesTimerId(String seriesTimerId) { + this.instance.seriesTimerId = seriesTimerId; + return this; + } + + public GetProgramsDto.Builder librarySeriesId(UUID librarySeriesId) { + this.instance.librarySeriesId = librarySeriesId; + return this; + } + + public GetProgramsDto.Builder fields(List fields) { + this.instance.fields = fields; + return this; + } + + /** + * returns a built GetProgramsDto instance. + * + * The builder is not reusable. + */ + public GetProgramsDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static GetProgramsDto.Builder builder() { + return new GetProgramsDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public GetProgramsDto.Builder toBuilder() { + return new GetProgramsDto.Builder().channelIds(getChannelIds()).userId(getUserId()) + .minStartDate(getMinStartDate()).hasAired(getHasAired()).isAiring(getIsAiring()) + .maxStartDate(getMaxStartDate()).minEndDate(getMinEndDate()).maxEndDate(getMaxEndDate()) + .isMovie(getIsMovie()).isSeries(getIsSeries()).isNews(getIsNews()).isKids(getIsKids()) + .isSports(getIsSports()).startIndex(getStartIndex()).limit(getLimit()).sortBy(getSortBy()) + .sortOrder(getSortOrder()).genres(getGenres()).genreIds(getGenreIds()).enableImages(getEnableImages()) + .enableTotalRecordCount(getEnableTotalRecordCount()).imageTypeLimit(getImageTypeLimit()) + .enableImageTypes(getEnableImageTypes()).enableUserData(getEnableUserData()) + .seriesTimerId(getSeriesTimerId()).librarySeriesId(getLibrarySeriesId()).fields(getFields()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupInfoDto.java new file mode 100644 index 0000000000000..e7851ba9b32a4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupInfoDto.java @@ -0,0 +1,370 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class GroupInfoDto. + */ +@JsonPropertyOrder({ GroupInfoDto.JSON_PROPERTY_GROUP_ID, GroupInfoDto.JSON_PROPERTY_GROUP_NAME, + GroupInfoDto.JSON_PROPERTY_STATE, GroupInfoDto.JSON_PROPERTY_PARTICIPANTS, + GroupInfoDto.JSON_PROPERTY_LAST_UPDATED_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class GroupInfoDto { + public static final String JSON_PROPERTY_GROUP_ID = "GroupId"; + @org.eclipse.jdt.annotation.NonNull + private UUID groupId; + + public static final String JSON_PROPERTY_GROUP_NAME = "GroupName"; + @org.eclipse.jdt.annotation.NonNull + private String groupName; + + public static final String JSON_PROPERTY_STATE = "State"; + @org.eclipse.jdt.annotation.NonNull + private GroupStateType state; + + public static final String JSON_PROPERTY_PARTICIPANTS = "Participants"; + @org.eclipse.jdt.annotation.NonNull + private List participants = new ArrayList<>(); + + public static final String JSON_PROPERTY_LAST_UPDATED_AT = "LastUpdatedAt"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime lastUpdatedAt; + + public GroupInfoDto() { + } + + public GroupInfoDto groupId(@org.eclipse.jdt.annotation.NonNull UUID groupId) { + this.groupId = groupId; + return this; + } + + /** + * Gets the group identifier. + * + * @return groupId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getGroupId() { + return groupId; + } + + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupId(@org.eclipse.jdt.annotation.NonNull UUID groupId) { + this.groupId = groupId; + } + + public GroupInfoDto groupName(@org.eclipse.jdt.annotation.NonNull String groupName) { + this.groupName = groupName; + return this; + } + + /** + * Gets the group name. + * + * @return groupName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGroupName() { + return groupName; + } + + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupName(@org.eclipse.jdt.annotation.NonNull String groupName) { + this.groupName = groupName; + } + + public GroupInfoDto state(@org.eclipse.jdt.annotation.NonNull GroupStateType state) { + this.state = state; + return this; + } + + /** + * Gets the group state. + * + * @return state + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupStateType getState() { + return state; + } + + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setState(@org.eclipse.jdt.annotation.NonNull GroupStateType state) { + this.state = state; + } + + public GroupInfoDto participants(@org.eclipse.jdt.annotation.NonNull List participants) { + this.participants = participants; + return this; + } + + public GroupInfoDto addParticipantsItem(String participantsItem) { + if (this.participants == null) { + this.participants = new ArrayList<>(); + } + this.participants.add(participantsItem); + return this; + } + + /** + * Gets the participants. + * + * @return participants + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARTICIPANTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getParticipants() { + return participants; + } + + @JsonProperty(JSON_PROPERTY_PARTICIPANTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParticipants(@org.eclipse.jdt.annotation.NonNull List participants) { + this.participants = participants; + } + + public GroupInfoDto lastUpdatedAt(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastUpdatedAt) { + this.lastUpdatedAt = lastUpdatedAt; + return this; + } + + /** + * Gets the date when this DTO has been created. + * + * @return lastUpdatedAt + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastUpdatedAt() { + return lastUpdatedAt; + } + + @JsonProperty(JSON_PROPERTY_LAST_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastUpdatedAt(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastUpdatedAt) { + this.lastUpdatedAt = lastUpdatedAt; + } + + /** + * Return true if this GroupInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupInfoDto groupInfoDto = (GroupInfoDto) o; + return Objects.equals(this.groupId, groupInfoDto.groupId) + && Objects.equals(this.groupName, groupInfoDto.groupName) + && Objects.equals(this.state, groupInfoDto.state) + && Objects.equals(this.participants, groupInfoDto.participants) + && Objects.equals(this.lastUpdatedAt, groupInfoDto.lastUpdatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(groupId, groupName, state, participants, lastUpdatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupInfoDto {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" participants: ").append(toIndentedString(participants)).append("\n"); + sb.append(" lastUpdatedAt: ").append(toIndentedString(lastUpdatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `GroupId` to the URL query string + if (getGroupId() != null) { + joiner.add(String.format("%sGroupId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGroupId())))); + } + + // add `GroupName` to the URL query string + if (getGroupName() != null) { + joiner.add(String.format("%sGroupName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGroupName())))); + } + + // add `State` to the URL query string + if (getState() != null) { + joiner.add(String.format("%sState%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getState())))); + } + + // add `Participants` to the URL query string + if (getParticipants() != null) { + for (int i = 0; i < getParticipants().size(); i++) { + joiner.add(String.format("%sParticipants%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getParticipants().get(i))))); + } + } + + // add `LastUpdatedAt` to the URL query string + if (getLastUpdatedAt() != null) { + joiner.add(String.format("%sLastUpdatedAt%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastUpdatedAt())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private GroupInfoDto instance; + + public Builder() { + this(new GroupInfoDto()); + } + + protected Builder(GroupInfoDto instance) { + this.instance = instance; + } + + public GroupInfoDto.Builder groupId(UUID groupId) { + this.instance.groupId = groupId; + return this; + } + + public GroupInfoDto.Builder groupName(String groupName) { + this.instance.groupName = groupName; + return this; + } + + public GroupInfoDto.Builder state(GroupStateType state) { + this.instance.state = state; + return this; + } + + public GroupInfoDto.Builder participants(List participants) { + this.instance.participants = participants; + return this; + } + + public GroupInfoDto.Builder lastUpdatedAt(OffsetDateTime lastUpdatedAt) { + this.instance.lastUpdatedAt = lastUpdatedAt; + return this; + } + + /** + * returns a built GroupInfoDto instance. + * + * The builder is not reusable. + */ + public GroupInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static GroupInfoDto.Builder builder() { + return new GroupInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public GroupInfoDto.Builder toBuilder() { + return new GroupInfoDto.Builder().groupId(getGroupId()).groupName(getGroupName()).state(getState()) + .participants(getParticipants()).lastUpdatedAt(getLastUpdatedAt()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupInfoDtoGroupUpdate.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupInfoDtoGroupUpdate.java new file mode 100644 index 0000000000000..959f0d3bd4b0e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupInfoDtoGroupUpdate.java @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class GroupUpdate. + */ +@JsonPropertyOrder({ GroupInfoDtoGroupUpdate.JSON_PROPERTY_GROUP_ID, GroupInfoDtoGroupUpdate.JSON_PROPERTY_TYPE, + GroupInfoDtoGroupUpdate.JSON_PROPERTY_DATA }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class GroupInfoDtoGroupUpdate { + public static final String JSON_PROPERTY_GROUP_ID = "GroupId"; + @org.eclipse.jdt.annotation.NonNull + private UUID groupId; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private GroupUpdateType type; + + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private GroupInfoDto data; + + public GroupInfoDtoGroupUpdate() { + } + + @JsonCreator + public GroupInfoDtoGroupUpdate(@JsonProperty(JSON_PROPERTY_GROUP_ID) UUID groupId) { + this(); + this.groupId = groupId; + } + + /** + * Gets the group identifier. + * + * @return groupId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getGroupId() { + return groupId; + } + + public GroupInfoDtoGroupUpdate type(@org.eclipse.jdt.annotation.NonNull GroupUpdateType type) { + this.type = type; + return this; + } + + /** + * Gets the update type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupUpdateType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull GroupUpdateType type) { + this.type = type; + } + + public GroupInfoDtoGroupUpdate data(@org.eclipse.jdt.annotation.NonNull GroupInfoDto data) { + this.data = data; + return this; + } + + /** + * Gets the update data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupInfoDto getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull GroupInfoDto data) { + this.data = data; + } + + /** + * Return true if this GroupInfoDtoGroupUpdate object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupInfoDtoGroupUpdate groupInfoDtoGroupUpdate = (GroupInfoDtoGroupUpdate) o; + return Objects.equals(this.groupId, groupInfoDtoGroupUpdate.groupId) + && Objects.equals(this.type, groupInfoDtoGroupUpdate.type) + && Objects.equals(this.data, groupInfoDtoGroupUpdate.data); + } + + @Override + public int hashCode() { + return Objects.hash(groupId, type, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupInfoDtoGroupUpdate {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `GroupId` to the URL query string + if (getGroupId() != null) { + joiner.add(String.format("%sGroupId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGroupId())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private GroupInfoDtoGroupUpdate instance; + + public Builder() { + this(new GroupInfoDtoGroupUpdate()); + } + + protected Builder(GroupInfoDtoGroupUpdate instance) { + this.instance = instance; + } + + public GroupInfoDtoGroupUpdate.Builder groupId(UUID groupId) { + this.instance.groupId = groupId; + return this; + } + + public GroupInfoDtoGroupUpdate.Builder type(GroupUpdateType type) { + this.instance.type = type; + return this; + } + + public GroupInfoDtoGroupUpdate.Builder data(GroupInfoDto data) { + this.instance.data = data; + return this; + } + + /** + * returns a built GroupInfoDtoGroupUpdate instance. + * + * The builder is not reusable. + */ + public GroupInfoDtoGroupUpdate build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static GroupInfoDtoGroupUpdate.Builder builder() { + return new GroupInfoDtoGroupUpdate.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public GroupInfoDtoGroupUpdate.Builder toBuilder() { + return new GroupInfoDtoGroupUpdate.Builder().groupId(getGroupId()).type(getType()).data(getData()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupQueueMode.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupQueueMode.java new file mode 100644 index 0000000000000..e8d8825cabc53 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupQueueMode.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum GroupQueueMode. + */ +public enum GroupQueueMode { + + QUEUE("Queue"), + + QUEUE_NEXT("QueueNext"); + + private String value; + + GroupQueueMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GroupQueueMode fromValue(String value) { + for (GroupQueueMode b : GroupQueueMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupRepeatMode.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupRepeatMode.java new file mode 100644 index 0000000000000..ff384b59611bb --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupRepeatMode.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum GroupRepeatMode. + */ +public enum GroupRepeatMode { + + REPEAT_ONE("RepeatOne"), + + REPEAT_ALL("RepeatAll"), + + REPEAT_NONE("RepeatNone"); + + private String value; + + GroupRepeatMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GroupRepeatMode fromValue(String value) { + for (GroupRepeatMode b : GroupRepeatMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupShuffleMode.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupShuffleMode.java new file mode 100644 index 0000000000000..f136d52961627 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupShuffleMode.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum GroupShuffleMode. + */ +public enum GroupShuffleMode { + + SORTED("Sorted"), + + SHUFFLE("Shuffle"); + + private String value; + + GroupShuffleMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GroupShuffleMode fromValue(String value) { + for (GroupShuffleMode b : GroupShuffleMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupStateType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupStateType.java new file mode 100644 index 0000000000000..c37aafba0d207 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupStateType.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum GroupState. + */ +public enum GroupStateType { + + IDLE("Idle"), + + WAITING("Waiting"), + + PAUSED("Paused"), + + PLAYING("Playing"); + + private String value; + + GroupStateType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GroupStateType fromValue(String value) { + for (GroupStateType b : GroupStateType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupStateUpdate.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupStateUpdate.java new file mode 100644 index 0000000000000..82a7a8179b9e3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupStateUpdate.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class GroupStateUpdate. + */ +@JsonPropertyOrder({ GroupStateUpdate.JSON_PROPERTY_STATE, GroupStateUpdate.JSON_PROPERTY_REASON }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class GroupStateUpdate { + public static final String JSON_PROPERTY_STATE = "State"; + @org.eclipse.jdt.annotation.NonNull + private GroupStateType state; + + public static final String JSON_PROPERTY_REASON = "Reason"; + @org.eclipse.jdt.annotation.NonNull + private PlaybackRequestType reason; + + public GroupStateUpdate() { + } + + public GroupStateUpdate state(@org.eclipse.jdt.annotation.NonNull GroupStateType state) { + this.state = state; + return this; + } + + /** + * Gets the state of the group. + * + * @return state + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupStateType getState() { + return state; + } + + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setState(@org.eclipse.jdt.annotation.NonNull GroupStateType state) { + this.state = state; + } + + public GroupStateUpdate reason(@org.eclipse.jdt.annotation.NonNull PlaybackRequestType reason) { + this.reason = reason; + return this; + } + + /** + * Gets the reason of the state change. + * + * @return reason + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlaybackRequestType getReason() { + return reason; + } + + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReason(@org.eclipse.jdt.annotation.NonNull PlaybackRequestType reason) { + this.reason = reason; + } + + /** + * Return true if this GroupStateUpdate object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupStateUpdate groupStateUpdate = (GroupStateUpdate) o; + return Objects.equals(this.state, groupStateUpdate.state) + && Objects.equals(this.reason, groupStateUpdate.reason); + } + + @Override + public int hashCode() { + return Objects.hash(state, reason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupStateUpdate {\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `State` to the URL query string + if (getState() != null) { + joiner.add(String.format("%sState%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getState())))); + } + + // add `Reason` to the URL query string + if (getReason() != null) { + joiner.add(String.format("%sReason%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getReason())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private GroupStateUpdate instance; + + public Builder() { + this(new GroupStateUpdate()); + } + + protected Builder(GroupStateUpdate instance) { + this.instance = instance; + } + + public GroupStateUpdate.Builder state(GroupStateType state) { + this.instance.state = state; + return this; + } + + public GroupStateUpdate.Builder reason(PlaybackRequestType reason) { + this.instance.reason = reason; + return this; + } + + /** + * returns a built GroupStateUpdate instance. + * + * The builder is not reusable. + */ + public GroupStateUpdate build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static GroupStateUpdate.Builder builder() { + return new GroupStateUpdate.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public GroupStateUpdate.Builder toBuilder() { + return new GroupStateUpdate.Builder().state(getState()).reason(getReason()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupStateUpdateGroupUpdate.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupStateUpdateGroupUpdate.java new file mode 100644 index 0000000000000..d9d3ca6e47f6e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupStateUpdateGroupUpdate.java @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class GroupUpdate. + */ +@JsonPropertyOrder({ GroupStateUpdateGroupUpdate.JSON_PROPERTY_GROUP_ID, GroupStateUpdateGroupUpdate.JSON_PROPERTY_TYPE, + GroupStateUpdateGroupUpdate.JSON_PROPERTY_DATA }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class GroupStateUpdateGroupUpdate { + public static final String JSON_PROPERTY_GROUP_ID = "GroupId"; + @org.eclipse.jdt.annotation.NonNull + private UUID groupId; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private GroupUpdateType type; + + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private GroupStateUpdate data; + + public GroupStateUpdateGroupUpdate() { + } + + @JsonCreator + public GroupStateUpdateGroupUpdate(@JsonProperty(JSON_PROPERTY_GROUP_ID) UUID groupId) { + this(); + this.groupId = groupId; + } + + /** + * Gets the group identifier. + * + * @return groupId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getGroupId() { + return groupId; + } + + public GroupStateUpdateGroupUpdate type(@org.eclipse.jdt.annotation.NonNull GroupUpdateType type) { + this.type = type; + return this; + } + + /** + * Gets the update type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupUpdateType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull GroupUpdateType type) { + this.type = type; + } + + public GroupStateUpdateGroupUpdate data(@org.eclipse.jdt.annotation.NonNull GroupStateUpdate data) { + this.data = data; + return this; + } + + /** + * Gets the update data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupStateUpdate getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull GroupStateUpdate data) { + this.data = data; + } + + /** + * Return true if this GroupStateUpdateGroupUpdate object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupStateUpdateGroupUpdate groupStateUpdateGroupUpdate = (GroupStateUpdateGroupUpdate) o; + return Objects.equals(this.groupId, groupStateUpdateGroupUpdate.groupId) + && Objects.equals(this.type, groupStateUpdateGroupUpdate.type) + && Objects.equals(this.data, groupStateUpdateGroupUpdate.data); + } + + @Override + public int hashCode() { + return Objects.hash(groupId, type, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupStateUpdateGroupUpdate {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `GroupId` to the URL query string + if (getGroupId() != null) { + joiner.add(String.format("%sGroupId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGroupId())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private GroupStateUpdateGroupUpdate instance; + + public Builder() { + this(new GroupStateUpdateGroupUpdate()); + } + + protected Builder(GroupStateUpdateGroupUpdate instance) { + this.instance = instance; + } + + public GroupStateUpdateGroupUpdate.Builder groupId(UUID groupId) { + this.instance.groupId = groupId; + return this; + } + + public GroupStateUpdateGroupUpdate.Builder type(GroupUpdateType type) { + this.instance.type = type; + return this; + } + + public GroupStateUpdateGroupUpdate.Builder data(GroupStateUpdate data) { + this.instance.data = data; + return this; + } + + /** + * returns a built GroupStateUpdateGroupUpdate instance. + * + * The builder is not reusable. + */ + public GroupStateUpdateGroupUpdate build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static GroupStateUpdateGroupUpdate.Builder builder() { + return new GroupStateUpdateGroupUpdate.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public GroupStateUpdateGroupUpdate.Builder toBuilder() { + return new GroupStateUpdateGroupUpdate.Builder().groupId(getGroupId()).type(getType()).data(getData()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupUpdate.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupUpdate.java new file mode 100644 index 0000000000000..63ca046789615 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupUpdate.java @@ -0,0 +1,453 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.StringJoiner; +import java.util.logging.Level; +import java.util.logging.Logger; + +import org.openhab.binding.jellyfin.internal.api.generated.JSON; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +@JsonDeserialize(using = GroupUpdate.GroupUpdateDeserializer.class) +@JsonSerialize(using = GroupUpdate.GroupUpdateSerializer.class) +public class GroupUpdate extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(GroupUpdate.class.getName()); + + public static class GroupUpdateSerializer extends StdSerializer { + public GroupUpdateSerializer(Class t) { + super(t); + } + + public GroupUpdateSerializer() { + this(null); + } + + @Override + public void serialize(GroupUpdate value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class GroupUpdateDeserializer extends StdDeserializer { + public GroupUpdateDeserializer() { + this(GroupUpdate.class); + } + + public GroupUpdateDeserializer(Class vc) { + super(vc); + } + + @Override + public GroupUpdate deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize GroupInfoDtoGroupUpdate + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (GroupInfoDtoGroupUpdate.class.equals(Integer.class) + || GroupInfoDtoGroupUpdate.class.equals(Long.class) + || GroupInfoDtoGroupUpdate.class.equals(Float.class) + || GroupInfoDtoGroupUpdate.class.equals(Double.class) + || GroupInfoDtoGroupUpdate.class.equals(Boolean.class) + || GroupInfoDtoGroupUpdate.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((GroupInfoDtoGroupUpdate.class.equals(Integer.class) + || GroupInfoDtoGroupUpdate.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((GroupInfoDtoGroupUpdate.class.equals(Float.class) + || GroupInfoDtoGroupUpdate.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (GroupInfoDtoGroupUpdate.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (GroupInfoDtoGroupUpdate.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(GroupInfoDtoGroupUpdate.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'GroupInfoDtoGroupUpdate'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'GroupInfoDtoGroupUpdate'", e); + } + + // deserialize GroupStateUpdateGroupUpdate + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (GroupStateUpdateGroupUpdate.class.equals(Integer.class) + || GroupStateUpdateGroupUpdate.class.equals(Long.class) + || GroupStateUpdateGroupUpdate.class.equals(Float.class) + || GroupStateUpdateGroupUpdate.class.equals(Double.class) + || GroupStateUpdateGroupUpdate.class.equals(Boolean.class) + || GroupStateUpdateGroupUpdate.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((GroupStateUpdateGroupUpdate.class.equals(Integer.class) + || GroupStateUpdateGroupUpdate.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((GroupStateUpdateGroupUpdate.class.equals(Float.class) + || GroupStateUpdateGroupUpdate.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (GroupStateUpdateGroupUpdate.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (GroupStateUpdateGroupUpdate.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(GroupStateUpdateGroupUpdate.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'GroupStateUpdateGroupUpdate'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'GroupStateUpdateGroupUpdate'", e); + } + + // deserialize PlayQueueUpdateGroupUpdate + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (PlayQueueUpdateGroupUpdate.class.equals(Integer.class) + || PlayQueueUpdateGroupUpdate.class.equals(Long.class) + || PlayQueueUpdateGroupUpdate.class.equals(Float.class) + || PlayQueueUpdateGroupUpdate.class.equals(Double.class) + || PlayQueueUpdateGroupUpdate.class.equals(Boolean.class) + || PlayQueueUpdateGroupUpdate.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((PlayQueueUpdateGroupUpdate.class.equals(Integer.class) + || PlayQueueUpdateGroupUpdate.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((PlayQueueUpdateGroupUpdate.class.equals(Float.class) + || PlayQueueUpdateGroupUpdate.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (PlayQueueUpdateGroupUpdate.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (PlayQueueUpdateGroupUpdate.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(PlayQueueUpdateGroupUpdate.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'PlayQueueUpdateGroupUpdate'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'PlayQueueUpdateGroupUpdate'", e); + } + + // deserialize StringGroupUpdate + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (StringGroupUpdate.class.equals(Integer.class) || StringGroupUpdate.class.equals(Long.class) + || StringGroupUpdate.class.equals(Float.class) || StringGroupUpdate.class.equals(Double.class) + || StringGroupUpdate.class.equals(Boolean.class) + || StringGroupUpdate.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((StringGroupUpdate.class.equals(Integer.class) + || StringGroupUpdate.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((StringGroupUpdate.class.equals(Float.class) + || StringGroupUpdate.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (StringGroupUpdate.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (StringGroupUpdate.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(StringGroupUpdate.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'StringGroupUpdate'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'StringGroupUpdate'", e); + } + + if (match == 1) { + GroupUpdate ret = new GroupUpdate(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String + .format("Failed deserialization for GroupUpdate: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public GroupUpdate getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "GroupUpdate cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public GroupUpdate() { + super("oneOf", Boolean.FALSE); + } + + public GroupUpdate(GroupInfoDtoGroupUpdate o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public GroupUpdate(GroupStateUpdateGroupUpdate o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public GroupUpdate(PlayQueueUpdateGroupUpdate o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public GroupUpdate(StringGroupUpdate o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("GroupInfoDtoGroupUpdate", GroupInfoDtoGroupUpdate.class); + schemas.put("GroupStateUpdateGroupUpdate", GroupStateUpdateGroupUpdate.class); + schemas.put("PlayQueueUpdateGroupUpdate", PlayQueueUpdateGroupUpdate.class); + schemas.put("StringGroupUpdate", StringGroupUpdate.class); + JSON.registerDescendants(GroupUpdate.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("GroupDoesNotExist", StringGroupUpdate.class); + mappings.put("GroupJoined", GroupInfoDtoGroupUpdate.class); + mappings.put("GroupLeft", StringGroupUpdate.class); + mappings.put("LibraryAccessDenied", StringGroupUpdate.class); + mappings.put("NotInGroup", StringGroupUpdate.class); + mappings.put("PlayQueue", PlayQueueUpdateGroupUpdate.class); + mappings.put("StateUpdate", GroupStateUpdateGroupUpdate.class); + mappings.put("UserJoined", StringGroupUpdate.class); + mappings.put("UserLeft", StringGroupUpdate.class); + mappings.put("GroupInfoDtoGroupUpdate", GroupInfoDtoGroupUpdate.class); + mappings.put("GroupStateUpdateGroupUpdate", GroupStateUpdateGroupUpdate.class); + mappings.put("PlayQueueUpdateGroupUpdate", PlayQueueUpdateGroupUpdate.class); + mappings.put("StringGroupUpdate", StringGroupUpdate.class); + mappings.put("GroupUpdate", GroupUpdate.class); + JSON.registerDiscriminator(GroupUpdate.class, "Type", mappings); + } + + @Override + public Map> getSchemas() { + return GroupUpdate.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * GroupInfoDtoGroupUpdate, GroupStateUpdateGroupUpdate, PlayQueueUpdateGroupUpdate, StringGroupUpdate + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(GroupInfoDtoGroupUpdate.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(GroupStateUpdateGroupUpdate.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(PlayQueueUpdateGroupUpdate.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(StringGroupUpdate.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be GroupInfoDtoGroupUpdate, GroupStateUpdateGroupUpdate, PlayQueueUpdateGroupUpdate, StringGroupUpdate"); + } + + /** + * Get the actual instance, which can be the following: + * GroupInfoDtoGroupUpdate, GroupStateUpdateGroupUpdate, PlayQueueUpdateGroupUpdate, StringGroupUpdate + * + * @return The actual instance (GroupInfoDtoGroupUpdate, GroupStateUpdateGroupUpdate, PlayQueueUpdateGroupUpdate, + * StringGroupUpdate) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `GroupInfoDtoGroupUpdate`. If the actual instance is not `GroupInfoDtoGroupUpdate`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GroupInfoDtoGroupUpdate` + * @throws ClassCastException if the instance is not `GroupInfoDtoGroupUpdate` + */ + public GroupInfoDtoGroupUpdate getGroupInfoDtoGroupUpdate() throws ClassCastException { + return (GroupInfoDtoGroupUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `GroupStateUpdateGroupUpdate`. If the actual instance is not + * `GroupStateUpdateGroupUpdate`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GroupStateUpdateGroupUpdate` + * @throws ClassCastException if the instance is not `GroupStateUpdateGroupUpdate` + */ + public GroupStateUpdateGroupUpdate getGroupStateUpdateGroupUpdate() throws ClassCastException { + return (GroupStateUpdateGroupUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `PlayQueueUpdateGroupUpdate`. If the actual instance is not + * `PlayQueueUpdateGroupUpdate`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `PlayQueueUpdateGroupUpdate` + * @throws ClassCastException if the instance is not `PlayQueueUpdateGroupUpdate` + */ + public PlayQueueUpdateGroupUpdate getPlayQueueUpdateGroupUpdate() throws ClassCastException { + return (PlayQueueUpdateGroupUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `StringGroupUpdate`. If the actual instance is not `StringGroupUpdate`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `StringGroupUpdate` + * @throws ClassCastException if the instance is not `StringGroupUpdate` + */ + public StringGroupUpdate getStringGroupUpdate() throws ClassCastException { + return (StringGroupUpdate) super.getActualInstance(); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof GroupInfoDtoGroupUpdate) { + if (getActualInstance() != null) { + joiner.add( + ((GroupInfoDtoGroupUpdate) getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof GroupStateUpdateGroupUpdate) { + if (getActualInstance() != null) { + joiner.add(((GroupStateUpdateGroupUpdate) getActualInstance()) + .toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof StringGroupUpdate) { + if (getActualInstance() != null) { + joiner.add(((StringGroupUpdate) getActualInstance()).toUrlQueryString(prefix + "one_of_2" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof PlayQueueUpdateGroupUpdate) { + if (getActualInstance() != null) { + joiner.add(((PlayQueueUpdateGroupUpdate) getActualInstance()) + .toUrlQueryString(prefix + "one_of_3" + suffix)); + } + return joiner.toString(); + } + return null; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupUpdateType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupUpdateType.java new file mode 100644 index 0000000000000..2b4576fe2cb7c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupUpdateType.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum GroupUpdateType. + */ +public enum GroupUpdateType { + + USER_JOINED("UserJoined"), + + USER_LEFT("UserLeft"), + + GROUP_JOINED("GroupJoined"), + + GROUP_LEFT("GroupLeft"), + + STATE_UPDATE("StateUpdate"), + + PLAY_QUEUE("PlayQueue"), + + NOT_IN_GROUP("NotInGroup"), + + GROUP_DOES_NOT_EXIST("GroupDoesNotExist"), + + CREATE_GROUP_DENIED("CreateGroupDenied"), + + JOIN_GROUP_DENIED("JoinGroupDenied"), + + LIBRARY_ACCESS_DENIED("LibraryAccessDenied"); + + private String value; + + GroupUpdateType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GroupUpdateType fromValue(String value) { + for (GroupUpdateType b : GroupUpdateType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GuideInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GuideInfo.java new file mode 100644 index 0000000000000..86398c77360a5 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GuideInfo.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * GuideInfo + */ +@JsonPropertyOrder({ GuideInfo.JSON_PROPERTY_START_DATE, GuideInfo.JSON_PROPERTY_END_DATE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class GuideInfo { + public static final String JSON_PROPERTY_START_DATE = "StartDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime startDate; + + public static final String JSON_PROPERTY_END_DATE = "EndDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime endDate; + + public GuideInfo() { + } + + public GuideInfo startDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Gets or sets the start date. + * + * @return startDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartDate() { + return startDate; + } + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + } + + public GuideInfo endDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Gets or sets the end date. + * + * @return endDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndDate() { + return endDate; + } + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + } + + /** + * Return true if this GuideInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GuideInfo guideInfo = (GuideInfo) o; + return Objects.equals(this.startDate, guideInfo.startDate) && Objects.equals(this.endDate, guideInfo.endDate); + } + + @Override + public int hashCode() { + return Objects.hash(startDate, endDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GuideInfo {\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `StartDate` to the URL query string + if (getStartDate() != null) { + joiner.add(String.format("%sStartDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartDate())))); + } + + // add `EndDate` to the URL query string + if (getEndDate() != null) { + joiner.add(String.format("%sEndDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndDate())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private GuideInfo instance; + + public Builder() { + this(new GuideInfo()); + } + + protected Builder(GuideInfo instance) { + this.instance = instance; + } + + public GuideInfo.Builder startDate(OffsetDateTime startDate) { + this.instance.startDate = startDate; + return this; + } + + public GuideInfo.Builder endDate(OffsetDateTime endDate) { + this.instance.endDate = endDate; + return this; + } + + /** + * returns a built GuideInfo instance. + * + * The builder is not reusable. + */ + public GuideInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static GuideInfo.Builder builder() { + return new GuideInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public GuideInfo.Builder toBuilder() { + return new GuideInfo.Builder().startDate(getStartDate()).endDate(getEndDate()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/HardwareAccelerationType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/HardwareAccelerationType.java new file mode 100644 index 0000000000000..1bf409e5e0dac --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/HardwareAccelerationType.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum containing hardware acceleration types. + */ +public enum HardwareAccelerationType { + + NONE("none"), + + AMF("amf"), + + QSV("qsv"), + + NVENC("nvenc"), + + V4L2M2M("v4l2m2m"), + + VAAPI("vaapi"), + + VIDEOTOOLBOX("videotoolbox"), + + RKMPP("rkmpp"); + + private String value; + + HardwareAccelerationType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static HardwareAccelerationType fromValue(String value) { + for (HardwareAccelerationType b : HardwareAccelerationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/IPlugin.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/IPlugin.java new file mode 100644 index 0000000000000..91ab956a77a8b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/IPlugin.java @@ -0,0 +1,376 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines the MediaBrowser.Common.Plugins.IPlugin. + */ +@JsonPropertyOrder({ IPlugin.JSON_PROPERTY_NAME, IPlugin.JSON_PROPERTY_DESCRIPTION, IPlugin.JSON_PROPERTY_ID, + IPlugin.JSON_PROPERTY_VERSION, IPlugin.JSON_PROPERTY_ASSEMBLY_FILE_PATH, IPlugin.JSON_PROPERTY_CAN_UNINSTALL, + IPlugin.JSON_PROPERTY_DATA_FOLDER_PATH }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class IPlugin { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_DESCRIPTION = "Description"; + @org.eclipse.jdt.annotation.NonNull + private String description; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_VERSION = "Version"; + @org.eclipse.jdt.annotation.NonNull + private String version; + + public static final String JSON_PROPERTY_ASSEMBLY_FILE_PATH = "AssemblyFilePath"; + @org.eclipse.jdt.annotation.NonNull + private String assemblyFilePath; + + public static final String JSON_PROPERTY_CAN_UNINSTALL = "CanUninstall"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canUninstall; + + public static final String JSON_PROPERTY_DATA_FOLDER_PATH = "DataFolderPath"; + @org.eclipse.jdt.annotation.NonNull + private String dataFolderPath; + + public IPlugin() { + } + + @JsonCreator + public IPlugin(@JsonProperty(JSON_PROPERTY_NAME) String name, + @JsonProperty(JSON_PROPERTY_DESCRIPTION) String description, @JsonProperty(JSON_PROPERTY_ID) UUID id, + @JsonProperty(JSON_PROPERTY_VERSION) String version, + @JsonProperty(JSON_PROPERTY_ASSEMBLY_FILE_PATH) String assemblyFilePath, + @JsonProperty(JSON_PROPERTY_CAN_UNINSTALL) Boolean canUninstall, + @JsonProperty(JSON_PROPERTY_DATA_FOLDER_PATH) String dataFolderPath) { + this(); + this.name = name; + this.description = description; + this.id = id; + this.version = version; + this.assemblyFilePath = assemblyFilePath; + this.canUninstall = canUninstall; + this.dataFolderPath = dataFolderPath; + } + + /** + * Gets the name of the plugin. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * Gets the Description. + * + * @return description + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + /** + * Gets the unique id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + /** + * Gets the plugin version. + * + * @return version + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + /** + * Gets the path to the assembly file. + * + * @return assemblyFilePath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ASSEMBLY_FILE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAssemblyFilePath() { + return assemblyFilePath; + } + + /** + * Gets a value indicating whether the plugin can be uninstalled. + * + * @return canUninstall + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_UNINSTALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanUninstall() { + return canUninstall; + } + + /** + * Gets the full path to the data folder, where the plugin can store any miscellaneous files needed. + * + * @return dataFolderPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA_FOLDER_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDataFolderPath() { + return dataFolderPath; + } + + /** + * Return true if this IPlugin object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IPlugin iplugin = (IPlugin) o; + return Objects.equals(this.name, iplugin.name) && Objects.equals(this.description, iplugin.description) + && Objects.equals(this.id, iplugin.id) && Objects.equals(this.version, iplugin.version) + && Objects.equals(this.assemblyFilePath, iplugin.assemblyFilePath) + && Objects.equals(this.canUninstall, iplugin.canUninstall) + && Objects.equals(this.dataFolderPath, iplugin.dataFolderPath); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, id, version, assemblyFilePath, canUninstall, dataFolderPath); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IPlugin {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" assemblyFilePath: ").append(toIndentedString(assemblyFilePath)).append("\n"); + sb.append(" canUninstall: ").append(toIndentedString(canUninstall)).append("\n"); + sb.append(" dataFolderPath: ").append(toIndentedString(dataFolderPath)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sDescription%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format("%sVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `AssemblyFilePath` to the URL query string + if (getAssemblyFilePath() != null) { + joiner.add(String.format("%sAssemblyFilePath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAssemblyFilePath())))); + } + + // add `CanUninstall` to the URL query string + if (getCanUninstall() != null) { + joiner.add(String.format("%sCanUninstall%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanUninstall())))); + } + + // add `DataFolderPath` to the URL query string + if (getDataFolderPath() != null) { + joiner.add(String.format("%sDataFolderPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDataFolderPath())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private IPlugin instance; + + public Builder() { + this(new IPlugin()); + } + + protected Builder(IPlugin instance) { + this.instance = instance; + } + + public IPlugin.Builder name(String name) { + this.instance.name = name; + return this; + } + + public IPlugin.Builder description(String description) { + this.instance.description = description; + return this; + } + + public IPlugin.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public IPlugin.Builder version(String version) { + this.instance.version = version; + return this; + } + + public IPlugin.Builder assemblyFilePath(String assemblyFilePath) { + this.instance.assemblyFilePath = assemblyFilePath; + return this; + } + + public IPlugin.Builder canUninstall(Boolean canUninstall) { + this.instance.canUninstall = canUninstall; + return this; + } + + public IPlugin.Builder dataFolderPath(String dataFolderPath) { + this.instance.dataFolderPath = dataFolderPath; + return this; + } + + /** + * returns a built IPlugin instance. + * + * The builder is not reusable. + */ + public IPlugin build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static IPlugin.Builder builder() { + return new IPlugin.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public IPlugin.Builder toBuilder() { + return new IPlugin.Builder().name(getName()).description(getDescription()).id(getId()).version(getVersion()) + .assemblyFilePath(getAssemblyFilePath()).canUninstall(getCanUninstall()) + .dataFolderPath(getDataFolderPath()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/IgnoreWaitRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/IgnoreWaitRequestDto.java new file mode 100644 index 0000000000000..769b78f5399e4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/IgnoreWaitRequestDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class IgnoreWaitRequestDto. + */ +@JsonPropertyOrder({ IgnoreWaitRequestDto.JSON_PROPERTY_IGNORE_WAIT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class IgnoreWaitRequestDto { + public static final String JSON_PROPERTY_IGNORE_WAIT = "IgnoreWait"; + @org.eclipse.jdt.annotation.NonNull + private Boolean ignoreWait; + + public IgnoreWaitRequestDto() { + } + + public IgnoreWaitRequestDto ignoreWait(@org.eclipse.jdt.annotation.NonNull Boolean ignoreWait) { + this.ignoreWait = ignoreWait; + return this; + } + + /** + * Gets or sets a value indicating whether the client should be ignored. + * + * @return ignoreWait + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IGNORE_WAIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIgnoreWait() { + return ignoreWait; + } + + @JsonProperty(JSON_PROPERTY_IGNORE_WAIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIgnoreWait(@org.eclipse.jdt.annotation.NonNull Boolean ignoreWait) { + this.ignoreWait = ignoreWait; + } + + /** + * Return true if this IgnoreWaitRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IgnoreWaitRequestDto ignoreWaitRequestDto = (IgnoreWaitRequestDto) o; + return Objects.equals(this.ignoreWait, ignoreWaitRequestDto.ignoreWait); + } + + @Override + public int hashCode() { + return Objects.hash(ignoreWait); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IgnoreWaitRequestDto {\n"); + sb.append(" ignoreWait: ").append(toIndentedString(ignoreWait)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `IgnoreWait` to the URL query string + if (getIgnoreWait() != null) { + joiner.add(String.format("%sIgnoreWait%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIgnoreWait())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private IgnoreWaitRequestDto instance; + + public Builder() { + this(new IgnoreWaitRequestDto()); + } + + protected Builder(IgnoreWaitRequestDto instance) { + this.instance = instance; + } + + public IgnoreWaitRequestDto.Builder ignoreWait(Boolean ignoreWait) { + this.instance.ignoreWait = ignoreWait; + return this; + } + + /** + * returns a built IgnoreWaitRequestDto instance. + * + * The builder is not reusable. + */ + public IgnoreWaitRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static IgnoreWaitRequestDto.Builder builder() { + return new IgnoreWaitRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public IgnoreWaitRequestDto.Builder toBuilder() { + return new IgnoreWaitRequestDto.Builder().ignoreWait(getIgnoreWait()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageFormat.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageFormat.java new file mode 100644 index 0000000000000..ccbc263843d08 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageFormat.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum ImageOutputFormat. + */ +public enum ImageFormat { + + BMP("Bmp"), + + GIF("Gif"), + + JPG("Jpg"), + + PNG("Png"), + + WEBP("Webp"), + + SVG("Svg"); + + private String value; + + ImageFormat(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ImageFormat fromValue(String value) { + for (ImageFormat b : ImageFormat.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageInfo.java new file mode 100644 index 0000000000000..c6f3f244bcf79 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageInfo.java @@ -0,0 +1,472 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class ImageInfo. + */ +@JsonPropertyOrder({ ImageInfo.JSON_PROPERTY_IMAGE_TYPE, ImageInfo.JSON_PROPERTY_IMAGE_INDEX, + ImageInfo.JSON_PROPERTY_IMAGE_TAG, ImageInfo.JSON_PROPERTY_PATH, ImageInfo.JSON_PROPERTY_BLUR_HASH, + ImageInfo.JSON_PROPERTY_HEIGHT, ImageInfo.JSON_PROPERTY_WIDTH, ImageInfo.JSON_PROPERTY_SIZE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ImageInfo { + public static final String JSON_PROPERTY_IMAGE_TYPE = "ImageType"; + @org.eclipse.jdt.annotation.NonNull + private ImageType imageType; + + public static final String JSON_PROPERTY_IMAGE_INDEX = "ImageIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer imageIndex; + + public static final String JSON_PROPERTY_IMAGE_TAG = "ImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String imageTag; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_BLUR_HASH = "BlurHash"; + @org.eclipse.jdt.annotation.NonNull + private String blurHash; + + public static final String JSON_PROPERTY_HEIGHT = "Height"; + @org.eclipse.jdt.annotation.NonNull + private Integer height; + + public static final String JSON_PROPERTY_WIDTH = "Width"; + @org.eclipse.jdt.annotation.NonNull + private Integer width; + + public static final String JSON_PROPERTY_SIZE = "Size"; + @org.eclipse.jdt.annotation.NonNull + private Long size; + + public ImageInfo() { + } + + public ImageInfo imageType(@org.eclipse.jdt.annotation.NonNull ImageType imageType) { + this.imageType = imageType; + return this; + } + + /** + * Gets or sets the type of the image. + * + * @return imageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ImageType getImageType() { + return imageType; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageType(@org.eclipse.jdt.annotation.NonNull ImageType imageType) { + this.imageType = imageType; + } + + public ImageInfo imageIndex(@org.eclipse.jdt.annotation.NonNull Integer imageIndex) { + this.imageIndex = imageIndex; + return this; + } + + /** + * Gets or sets the index of the image. + * + * @return imageIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getImageIndex() { + return imageIndex; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageIndex(@org.eclipse.jdt.annotation.NonNull Integer imageIndex) { + this.imageIndex = imageIndex; + } + + public ImageInfo imageTag(@org.eclipse.jdt.annotation.NonNull String imageTag) { + this.imageTag = imageTag; + return this; + } + + /** + * Gets or sets the image tag. + * + * @return imageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getImageTag() { + return imageTag; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageTag(@org.eclipse.jdt.annotation.NonNull String imageTag) { + this.imageTag = imageTag; + } + + public ImageInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public ImageInfo blurHash(@org.eclipse.jdt.annotation.NonNull String blurHash) { + this.blurHash = blurHash; + return this; + } + + /** + * Gets or sets the blurhash. + * + * @return blurHash + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BLUR_HASH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBlurHash() { + return blurHash; + } + + @JsonProperty(JSON_PROPERTY_BLUR_HASH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlurHash(@org.eclipse.jdt.annotation.NonNull String blurHash) { + this.blurHash = blurHash; + } + + public ImageInfo height(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + return this; + } + + /** + * Gets or sets the height. + * + * @return height + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHeight() { + return height; + } + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + } + + public ImageInfo width(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + return this; + } + + /** + * Gets or sets the width. + * + * @return width + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + } + + public ImageInfo size(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + return this; + } + + /** + * Gets or sets the size. + * + * @return size + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSize() { + return size; + } + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSize(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + } + + /** + * Return true if this ImageInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageInfo imageInfo = (ImageInfo) o; + return Objects.equals(this.imageType, imageInfo.imageType) + && Objects.equals(this.imageIndex, imageInfo.imageIndex) + && Objects.equals(this.imageTag, imageInfo.imageTag) && Objects.equals(this.path, imageInfo.path) + && Objects.equals(this.blurHash, imageInfo.blurHash) && Objects.equals(this.height, imageInfo.height) + && Objects.equals(this.width, imageInfo.width) && Objects.equals(this.size, imageInfo.size); + } + + @Override + public int hashCode() { + return Objects.hash(imageType, imageIndex, imageTag, path, blurHash, height, width, size); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageInfo {\n"); + sb.append(" imageType: ").append(toIndentedString(imageType)).append("\n"); + sb.append(" imageIndex: ").append(toIndentedString(imageIndex)).append("\n"); + sb.append(" imageTag: ").append(toIndentedString(imageTag)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" blurHash: ").append(toIndentedString(blurHash)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ImageType` to the URL query string + if (getImageType() != null) { + joiner.add(String.format("%sImageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageType())))); + } + + // add `ImageIndex` to the URL query string + if (getImageIndex() != null) { + joiner.add(String.format("%sImageIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageIndex())))); + } + + // add `ImageTag` to the URL query string + if (getImageTag() != null) { + joiner.add(String.format("%sImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageTag())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `BlurHash` to the URL query string + if (getBlurHash() != null) { + joiner.add(String.format("%sBlurHash%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBlurHash())))); + } + + // add `Height` to the URL query string + if (getHeight() != null) { + joiner.add(String.format("%sHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHeight())))); + } + + // add `Width` to the URL query string + if (getWidth() != null) { + joiner.add(String.format("%sWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWidth())))); + } + + // add `Size` to the URL query string + if (getSize() != null) { + joiner.add(String.format("%sSize%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSize())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ImageInfo instance; + + public Builder() { + this(new ImageInfo()); + } + + protected Builder(ImageInfo instance) { + this.instance = instance; + } + + public ImageInfo.Builder imageType(ImageType imageType) { + this.instance.imageType = imageType; + return this; + } + + public ImageInfo.Builder imageIndex(Integer imageIndex) { + this.instance.imageIndex = imageIndex; + return this; + } + + public ImageInfo.Builder imageTag(String imageTag) { + this.instance.imageTag = imageTag; + return this; + } + + public ImageInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public ImageInfo.Builder blurHash(String blurHash) { + this.instance.blurHash = blurHash; + return this; + } + + public ImageInfo.Builder height(Integer height) { + this.instance.height = height; + return this; + } + + public ImageInfo.Builder width(Integer width) { + this.instance.width = width; + return this; + } + + public ImageInfo.Builder size(Long size) { + this.instance.size = size; + return this; + } + + /** + * returns a built ImageInfo instance. + * + * The builder is not reusable. + */ + public ImageInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ImageInfo.Builder builder() { + return new ImageInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ImageInfo.Builder toBuilder() { + return new ImageInfo.Builder().imageType(getImageType()).imageIndex(getImageIndex()).imageTag(getImageTag()) + .path(getPath()).blurHash(getBlurHash()).height(getHeight()).width(getWidth()).size(getSize()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageOption.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageOption.java new file mode 100644 index 0000000000000..88fb8b3307345 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageOption.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ImageOption + */ +@JsonPropertyOrder({ ImageOption.JSON_PROPERTY_TYPE, ImageOption.JSON_PROPERTY_LIMIT, + ImageOption.JSON_PROPERTY_MIN_WIDTH }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ImageOption { + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private ImageType type; + + public static final String JSON_PROPERTY_LIMIT = "Limit"; + @org.eclipse.jdt.annotation.NonNull + private Integer limit; + + public static final String JSON_PROPERTY_MIN_WIDTH = "MinWidth"; + @org.eclipse.jdt.annotation.NonNull + private Integer minWidth; + + public ImageOption() { + } + + public ImageOption type(@org.eclipse.jdt.annotation.NonNull ImageType type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ImageType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull ImageType type) { + this.type = type; + } + + public ImageOption limit(@org.eclipse.jdt.annotation.NonNull Integer limit) { + this.limit = limit; + return this; + } + + /** + * Gets or sets the limit. + * + * @return limit + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLimit() { + return limit; + } + + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLimit(@org.eclipse.jdt.annotation.NonNull Integer limit) { + this.limit = limit; + } + + public ImageOption minWidth(@org.eclipse.jdt.annotation.NonNull Integer minWidth) { + this.minWidth = minWidth; + return this; + } + + /** + * Gets or sets the minimum width. + * + * @return minWidth + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIN_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMinWidth() { + return minWidth; + } + + @JsonProperty(JSON_PROPERTY_MIN_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinWidth(@org.eclipse.jdt.annotation.NonNull Integer minWidth) { + this.minWidth = minWidth; + } + + /** + * Return true if this ImageOption object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageOption imageOption = (ImageOption) o; + return Objects.equals(this.type, imageOption.type) && Objects.equals(this.limit, imageOption.limit) + && Objects.equals(this.minWidth, imageOption.minWidth); + } + + @Override + public int hashCode() { + return Objects.hash(type, limit, minWidth); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageOption {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" minWidth: ").append(toIndentedString(minWidth)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `Limit` to the URL query string + if (getLimit() != null) { + joiner.add(String.format("%sLimit%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLimit())))); + } + + // add `MinWidth` to the URL query string + if (getMinWidth() != null) { + joiner.add(String.format("%sMinWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMinWidth())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ImageOption instance; + + public Builder() { + this(new ImageOption()); + } + + protected Builder(ImageOption instance) { + this.instance = instance; + } + + public ImageOption.Builder type(ImageType type) { + this.instance.type = type; + return this; + } + + public ImageOption.Builder limit(Integer limit) { + this.instance.limit = limit; + return this; + } + + public ImageOption.Builder minWidth(Integer minWidth) { + this.instance.minWidth = minWidth; + return this; + } + + /** + * returns a built ImageOption instance. + * + * The builder is not reusable. + */ + public ImageOption build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ImageOption.Builder builder() { + return new ImageOption.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ImageOption.Builder toBuilder() { + return new ImageOption.Builder().type(getType()).limit(getLimit()).minWidth(getMinWidth()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageOrientation.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageOrientation.java new file mode 100644 index 0000000000000..745c929e82055 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageOrientation.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ImageOrientation + */ +public enum ImageOrientation { + + TOP_LEFT("TopLeft"), + + TOP_RIGHT("TopRight"), + + BOTTOM_RIGHT("BottomRight"), + + BOTTOM_LEFT("BottomLeft"), + + LEFT_TOP("LeftTop"), + + RIGHT_TOP("RightTop"), + + RIGHT_BOTTOM("RightBottom"), + + LEFT_BOTTOM("LeftBottom"); + + private String value; + + ImageOrientation(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ImageOrientation fromValue(String value) { + for (ImageOrientation b : ImageOrientation.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageProviderInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageProviderInfo.java new file mode 100644 index 0000000000000..f802e9e71e384 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageProviderInfo.java @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class ImageProviderInfo. + */ +@JsonPropertyOrder({ ImageProviderInfo.JSON_PROPERTY_NAME, ImageProviderInfo.JSON_PROPERTY_SUPPORTED_IMAGES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ImageProviderInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_SUPPORTED_IMAGES = "SupportedImages"; + @org.eclipse.jdt.annotation.NonNull + private List supportedImages = new ArrayList<>(); + + public ImageProviderInfo() { + } + + public ImageProviderInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ImageProviderInfo supportedImages(@org.eclipse.jdt.annotation.NonNull List supportedImages) { + this.supportedImages = supportedImages; + return this; + } + + public ImageProviderInfo addSupportedImagesItem(ImageType supportedImagesItem) { + if (this.supportedImages == null) { + this.supportedImages = new ArrayList<>(); + } + this.supportedImages.add(supportedImagesItem); + return this; + } + + /** + * Gets the supported image types. + * + * @return supportedImages + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTED_IMAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSupportedImages() { + return supportedImages; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTED_IMAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportedImages(@org.eclipse.jdt.annotation.NonNull List supportedImages) { + this.supportedImages = supportedImages; + } + + /** + * Return true if this ImageProviderInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageProviderInfo imageProviderInfo = (ImageProviderInfo) o; + return Objects.equals(this.name, imageProviderInfo.name) + && Objects.equals(this.supportedImages, imageProviderInfo.supportedImages); + } + + @Override + public int hashCode() { + return Objects.hash(name, supportedImages); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageProviderInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" supportedImages: ").append(toIndentedString(supportedImages)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `SupportedImages` to the URL query string + if (getSupportedImages() != null) { + for (int i = 0; i < getSupportedImages().size(); i++) { + if (getSupportedImages().get(i) != null) { + joiner.add(String.format("%sSupportedImages%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSupportedImages().get(i))))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private ImageProviderInfo instance; + + public Builder() { + this(new ImageProviderInfo()); + } + + protected Builder(ImageProviderInfo instance) { + this.instance = instance; + } + + public ImageProviderInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ImageProviderInfo.Builder supportedImages(List supportedImages) { + this.instance.supportedImages = supportedImages; + return this; + } + + /** + * returns a built ImageProviderInfo instance. + * + * The builder is not reusable. + */ + public ImageProviderInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ImageProviderInfo.Builder builder() { + return new ImageProviderInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ImageProviderInfo.Builder toBuilder() { + return new ImageProviderInfo.Builder().name(getName()).supportedImages(getSupportedImages()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageResolution.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageResolution.java new file mode 100644 index 0000000000000..16da1fcbf4211 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageResolution.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum ImageResolution. + */ +public enum ImageResolution { + + MATCH_SOURCE("MatchSource"), + + P144("P144"), + + P240("P240"), + + P360("P360"), + + P480("P480"), + + P720("P720"), + + P1080("P1080"), + + P1440("P1440"), + + P2160("P2160"); + + private String value; + + ImageResolution(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ImageResolution fromValue(String value) { + for (ImageResolution b : ImageResolution.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageSavingConvention.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageSavingConvention.java new file mode 100644 index 0000000000000..f3c82e5c86bd3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageSavingConvention.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ImageSavingConvention + */ +public enum ImageSavingConvention { + + LEGACY("Legacy"), + + COMPATIBLE("Compatible"); + + private String value; + + ImageSavingConvention(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ImageSavingConvention fromValue(String value) { + for (ImageSavingConvention b : ImageSavingConvention.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageType.java new file mode 100644 index 0000000000000..a7a531941590c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ImageType.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum ImageType. + */ +public enum ImageType { + + PRIMARY("Primary"), + + ART("Art"), + + BACKDROP("Backdrop"), + + BANNER("Banner"), + + LOGO("Logo"), + + THUMB("Thumb"), + + DISC("Disc"), + + BOX("Box"), + + SCREENSHOT("Screenshot"), + + MENU("Menu"), + + CHAPTER("Chapter"), + + BOX_REAR("BoxRear"), + + PROFILE("Profile"); + + private String value; + + ImageType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ImageType fromValue(String value) { + for (ImageType b : ImageType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/InboundKeepAliveMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/InboundKeepAliveMessage.java new file mode 100644 index 0000000000000..058df21e6bb7a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/InboundKeepAliveMessage.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Keep alive websocket messages. + */ +@JsonPropertyOrder({ InboundKeepAliveMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class InboundKeepAliveMessage { + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.KEEP_ALIVE; + + public InboundKeepAliveMessage() { + } + + @JsonCreator + public InboundKeepAliveMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this InboundKeepAliveMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InboundKeepAliveMessage inboundKeepAliveMessage = (InboundKeepAliveMessage) o; + return Objects.equals(this.messageType, inboundKeepAliveMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InboundKeepAliveMessage {\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private InboundKeepAliveMessage instance; + + public Builder() { + this(new InboundKeepAliveMessage()); + } + + protected Builder(InboundKeepAliveMessage instance) { + this.instance = instance; + } + + public InboundKeepAliveMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built InboundKeepAliveMessage instance. + * + * The builder is not reusable. + */ + public InboundKeepAliveMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static InboundKeepAliveMessage.Builder builder() { + return new InboundKeepAliveMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public InboundKeepAliveMessage.Builder toBuilder() { + return new InboundKeepAliveMessage.Builder().messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/InboundWebSocketMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/InboundWebSocketMessage.java new file mode 100644 index 0000000000000..107ce8538bc07 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/InboundWebSocketMessage.java @@ -0,0 +1,656 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.StringJoiner; +import java.util.logging.Level; +import java.util.logging.Logger; + +import org.openhab.binding.jellyfin.internal.api.generated.JSON; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +@JsonDeserialize(using = InboundWebSocketMessage.InboundWebSocketMessageDeserializer.class) +@JsonSerialize(using = InboundWebSocketMessage.InboundWebSocketMessageSerializer.class) +public class InboundWebSocketMessage extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(InboundWebSocketMessage.class.getName()); + + public static class InboundWebSocketMessageSerializer extends StdSerializer { + public InboundWebSocketMessageSerializer(Class t) { + super(t); + } + + public InboundWebSocketMessageSerializer() { + this(null); + } + + @Override + public void serialize(InboundWebSocketMessage value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class InboundWebSocketMessageDeserializer extends StdDeserializer { + public InboundWebSocketMessageDeserializer() { + this(InboundWebSocketMessage.class); + } + + public InboundWebSocketMessageDeserializer(Class vc) { + super(vc); + } + + @Override + public InboundWebSocketMessage deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize ActivityLogEntryStartMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ActivityLogEntryStartMessage.class.equals(Integer.class) + || ActivityLogEntryStartMessage.class.equals(Long.class) + || ActivityLogEntryStartMessage.class.equals(Float.class) + || ActivityLogEntryStartMessage.class.equals(Double.class) + || ActivityLogEntryStartMessage.class.equals(Boolean.class) + || ActivityLogEntryStartMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((ActivityLogEntryStartMessage.class.equals(Integer.class) + || ActivityLogEntryStartMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((ActivityLogEntryStartMessage.class.equals(Float.class) + || ActivityLogEntryStartMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (ActivityLogEntryStartMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (ActivityLogEntryStartMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ActivityLogEntryStartMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ActivityLogEntryStartMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ActivityLogEntryStartMessage'", e); + } + + // deserialize ActivityLogEntryStopMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ActivityLogEntryStopMessage.class.equals(Integer.class) + || ActivityLogEntryStopMessage.class.equals(Long.class) + || ActivityLogEntryStopMessage.class.equals(Float.class) + || ActivityLogEntryStopMessage.class.equals(Double.class) + || ActivityLogEntryStopMessage.class.equals(Boolean.class) + || ActivityLogEntryStopMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((ActivityLogEntryStopMessage.class.equals(Integer.class) + || ActivityLogEntryStopMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((ActivityLogEntryStopMessage.class.equals(Float.class) + || ActivityLogEntryStopMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (ActivityLogEntryStopMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (ActivityLogEntryStopMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ActivityLogEntryStopMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ActivityLogEntryStopMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ActivityLogEntryStopMessage'", e); + } + + // deserialize InboundKeepAliveMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (InboundKeepAliveMessage.class.equals(Integer.class) + || InboundKeepAliveMessage.class.equals(Long.class) + || InboundKeepAliveMessage.class.equals(Float.class) + || InboundKeepAliveMessage.class.equals(Double.class) + || InboundKeepAliveMessage.class.equals(Boolean.class) + || InboundKeepAliveMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((InboundKeepAliveMessage.class.equals(Integer.class) + || InboundKeepAliveMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((InboundKeepAliveMessage.class.equals(Float.class) + || InboundKeepAliveMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (InboundKeepAliveMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (InboundKeepAliveMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(InboundKeepAliveMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'InboundKeepAliveMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'InboundKeepAliveMessage'", e); + } + + // deserialize ScheduledTasksInfoStartMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ScheduledTasksInfoStartMessage.class.equals(Integer.class) + || ScheduledTasksInfoStartMessage.class.equals(Long.class) + || ScheduledTasksInfoStartMessage.class.equals(Float.class) + || ScheduledTasksInfoStartMessage.class.equals(Double.class) + || ScheduledTasksInfoStartMessage.class.equals(Boolean.class) + || ScheduledTasksInfoStartMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((ScheduledTasksInfoStartMessage.class.equals(Integer.class) + || ScheduledTasksInfoStartMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((ScheduledTasksInfoStartMessage.class.equals(Float.class) + || ScheduledTasksInfoStartMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (ScheduledTasksInfoStartMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (ScheduledTasksInfoStartMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ScheduledTasksInfoStartMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ScheduledTasksInfoStartMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ScheduledTasksInfoStartMessage'", e); + } + + // deserialize ScheduledTasksInfoStopMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ScheduledTasksInfoStopMessage.class.equals(Integer.class) + || ScheduledTasksInfoStopMessage.class.equals(Long.class) + || ScheduledTasksInfoStopMessage.class.equals(Float.class) + || ScheduledTasksInfoStopMessage.class.equals(Double.class) + || ScheduledTasksInfoStopMessage.class.equals(Boolean.class) + || ScheduledTasksInfoStopMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((ScheduledTasksInfoStopMessage.class.equals(Integer.class) + || ScheduledTasksInfoStopMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((ScheduledTasksInfoStopMessage.class.equals(Float.class) + || ScheduledTasksInfoStopMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (ScheduledTasksInfoStopMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (ScheduledTasksInfoStopMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ScheduledTasksInfoStopMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ScheduledTasksInfoStopMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ScheduledTasksInfoStopMessage'", e); + } + + // deserialize SessionsStartMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SessionsStartMessage.class.equals(Integer.class) || SessionsStartMessage.class.equals(Long.class) + || SessionsStartMessage.class.equals(Float.class) + || SessionsStartMessage.class.equals(Double.class) + || SessionsStartMessage.class.equals(Boolean.class) + || SessionsStartMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((SessionsStartMessage.class.equals(Integer.class) + || SessionsStartMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((SessionsStartMessage.class.equals(Float.class) + || SessionsStartMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (SessionsStartMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (SessionsStartMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(SessionsStartMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'SessionsStartMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SessionsStartMessage'", e); + } + + // deserialize SessionsStopMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SessionsStopMessage.class.equals(Integer.class) || SessionsStopMessage.class.equals(Long.class) + || SessionsStopMessage.class.equals(Float.class) + || SessionsStopMessage.class.equals(Double.class) + || SessionsStopMessage.class.equals(Boolean.class) + || SessionsStopMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((SessionsStopMessage.class.equals(Integer.class) + || SessionsStopMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((SessionsStopMessage.class.equals(Float.class) + || SessionsStopMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (SessionsStopMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (SessionsStopMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(SessionsStopMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'SessionsStopMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SessionsStopMessage'", e); + } + + if (match == 1) { + InboundWebSocketMessage ret = new InboundWebSocketMessage(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format( + "Failed deserialization for InboundWebSocketMessage: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public InboundWebSocketMessage getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "InboundWebSocketMessage cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public InboundWebSocketMessage() { + super("oneOf", Boolean.FALSE); + } + + public InboundWebSocketMessage(ActivityLogEntryStartMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public InboundWebSocketMessage(ActivityLogEntryStopMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public InboundWebSocketMessage(InboundKeepAliveMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public InboundWebSocketMessage(ScheduledTasksInfoStartMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public InboundWebSocketMessage(ScheduledTasksInfoStopMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public InboundWebSocketMessage(SessionsStartMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public InboundWebSocketMessage(SessionsStopMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ActivityLogEntryStartMessage", ActivityLogEntryStartMessage.class); + schemas.put("ActivityLogEntryStopMessage", ActivityLogEntryStopMessage.class); + schemas.put("InboundKeepAliveMessage", InboundKeepAliveMessage.class); + schemas.put("ScheduledTasksInfoStartMessage", ScheduledTasksInfoStartMessage.class); + schemas.put("ScheduledTasksInfoStopMessage", ScheduledTasksInfoStopMessage.class); + schemas.put("SessionsStartMessage", SessionsStartMessage.class); + schemas.put("SessionsStopMessage", SessionsStopMessage.class); + JSON.registerDescendants(InboundWebSocketMessage.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("ActivityLogEntryStart", ActivityLogEntryStartMessage.class); + mappings.put("ActivityLogEntryStop", ActivityLogEntryStopMessage.class); + mappings.put("KeepAlive", InboundKeepAliveMessage.class); + mappings.put("ScheduledTasksInfoStart", ScheduledTasksInfoStartMessage.class); + mappings.put("ScheduledTasksInfoStop", ScheduledTasksInfoStopMessage.class); + mappings.put("SessionsStart", SessionsStartMessage.class); + mappings.put("SessionsStop", SessionsStopMessage.class); + mappings.put("ActivityLogEntryStartMessage", ActivityLogEntryStartMessage.class); + mappings.put("ActivityLogEntryStopMessage", ActivityLogEntryStopMessage.class); + mappings.put("InboundKeepAliveMessage", InboundKeepAliveMessage.class); + mappings.put("ScheduledTasksInfoStartMessage", ScheduledTasksInfoStartMessage.class); + mappings.put("ScheduledTasksInfoStopMessage", ScheduledTasksInfoStopMessage.class); + mappings.put("SessionsStartMessage", SessionsStartMessage.class); + mappings.put("SessionsStopMessage", SessionsStopMessage.class); + mappings.put("InboundWebSocketMessage", InboundWebSocketMessage.class); + JSON.registerDiscriminator(InboundWebSocketMessage.class, "MessageType", mappings); + } + + @Override + public Map> getSchemas() { + return InboundWebSocketMessage.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * ActivityLogEntryStartMessage, ActivityLogEntryStopMessage, InboundKeepAliveMessage, + * ScheduledTasksInfoStartMessage, ScheduledTasksInfoStopMessage, SessionsStartMessage, SessionsStopMessage + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(ActivityLogEntryStartMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(ActivityLogEntryStopMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(InboundKeepAliveMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(ScheduledTasksInfoStartMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(ScheduledTasksInfoStopMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(SessionsStartMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(SessionsStopMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be ActivityLogEntryStartMessage, ActivityLogEntryStopMessage, InboundKeepAliveMessage, ScheduledTasksInfoStartMessage, ScheduledTasksInfoStopMessage, SessionsStartMessage, SessionsStopMessage"); + } + + /** + * Get the actual instance, which can be the following: + * ActivityLogEntryStartMessage, ActivityLogEntryStopMessage, InboundKeepAliveMessage, + * ScheduledTasksInfoStartMessage, ScheduledTasksInfoStopMessage, SessionsStartMessage, SessionsStopMessage + * + * @return The actual instance (ActivityLogEntryStartMessage, ActivityLogEntryStopMessage, InboundKeepAliveMessage, + * ScheduledTasksInfoStartMessage, ScheduledTasksInfoStopMessage, SessionsStartMessage, SessionsStopMessage) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ActivityLogEntryStartMessage`. If the actual instance is not + * `ActivityLogEntryStartMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ActivityLogEntryStartMessage` + * @throws ClassCastException if the instance is not `ActivityLogEntryStartMessage` + */ + public ActivityLogEntryStartMessage getActivityLogEntryStartMessage() throws ClassCastException { + return (ActivityLogEntryStartMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `ActivityLogEntryStopMessage`. If the actual instance is not + * `ActivityLogEntryStopMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ActivityLogEntryStopMessage` + * @throws ClassCastException if the instance is not `ActivityLogEntryStopMessage` + */ + public ActivityLogEntryStopMessage getActivityLogEntryStopMessage() throws ClassCastException { + return (ActivityLogEntryStopMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `InboundKeepAliveMessage`. If the actual instance is not `InboundKeepAliveMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `InboundKeepAliveMessage` + * @throws ClassCastException if the instance is not `InboundKeepAliveMessage` + */ + public InboundKeepAliveMessage getInboundKeepAliveMessage() throws ClassCastException { + return (InboundKeepAliveMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `ScheduledTasksInfoStartMessage`. If the actual instance is not + * `ScheduledTasksInfoStartMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ScheduledTasksInfoStartMessage` + * @throws ClassCastException if the instance is not `ScheduledTasksInfoStartMessage` + */ + public ScheduledTasksInfoStartMessage getScheduledTasksInfoStartMessage() throws ClassCastException { + return (ScheduledTasksInfoStartMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `ScheduledTasksInfoStopMessage`. If the actual instance is not + * `ScheduledTasksInfoStopMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ScheduledTasksInfoStopMessage` + * @throws ClassCastException if the instance is not `ScheduledTasksInfoStopMessage` + */ + public ScheduledTasksInfoStopMessage getScheduledTasksInfoStopMessage() throws ClassCastException { + return (ScheduledTasksInfoStopMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `SessionsStartMessage`. If the actual instance is not `SessionsStartMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SessionsStartMessage` + * @throws ClassCastException if the instance is not `SessionsStartMessage` + */ + public SessionsStartMessage getSessionsStartMessage() throws ClassCastException { + return (SessionsStartMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `SessionsStopMessage`. If the actual instance is not `SessionsStopMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SessionsStopMessage` + * @throws ClassCastException if the instance is not `SessionsStopMessage` + */ + public SessionsStopMessage getSessionsStopMessage() throws ClassCastException { + return (SessionsStopMessage) super.getActualInstance(); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof ActivityLogEntryStartMessage) { + if (getActualInstance() != null) { + joiner.add(((ActivityLogEntryStartMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof ActivityLogEntryStopMessage) { + if (getActualInstance() != null) { + joiner.add(((ActivityLogEntryStopMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof InboundKeepAliveMessage) { + if (getActualInstance() != null) { + joiner.add( + ((InboundKeepAliveMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_2" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof ScheduledTasksInfoStartMessage) { + if (getActualInstance() != null) { + joiner.add(((ScheduledTasksInfoStartMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_3" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof ScheduledTasksInfoStopMessage) { + if (getActualInstance() != null) { + joiner.add(((ScheduledTasksInfoStopMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_4" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof SessionsStartMessage) { + if (getActualInstance() != null) { + joiner.add(((SessionsStartMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_5" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof SessionsStopMessage) { + if (getActualInstance() != null) { + joiner.add(((SessionsStopMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_6" + suffix)); + } + return joiner.toString(); + } + return null; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/InstallationInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/InstallationInfo.java new file mode 100644 index 0000000000000..d1331010cafe7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/InstallationInfo.java @@ -0,0 +1,436 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class InstallationInfo. + */ +@JsonPropertyOrder({ InstallationInfo.JSON_PROPERTY_GUID, InstallationInfo.JSON_PROPERTY_NAME, + InstallationInfo.JSON_PROPERTY_VERSION, InstallationInfo.JSON_PROPERTY_CHANGELOG, + InstallationInfo.JSON_PROPERTY_SOURCE_URL, InstallationInfo.JSON_PROPERTY_CHECKSUM, + InstallationInfo.JSON_PROPERTY_PACKAGE_INFO }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class InstallationInfo { + public static final String JSON_PROPERTY_GUID = "Guid"; + @org.eclipse.jdt.annotation.NonNull + private UUID guid; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_VERSION = "Version"; + @org.eclipse.jdt.annotation.NonNull + private String version; + + public static final String JSON_PROPERTY_CHANGELOG = "Changelog"; + @org.eclipse.jdt.annotation.NonNull + private String changelog; + + public static final String JSON_PROPERTY_SOURCE_URL = "SourceUrl"; + @org.eclipse.jdt.annotation.NonNull + private String sourceUrl; + + public static final String JSON_PROPERTY_CHECKSUM = "Checksum"; + @org.eclipse.jdt.annotation.NonNull + private String checksum; + + public static final String JSON_PROPERTY_PACKAGE_INFO = "PackageInfo"; + @org.eclipse.jdt.annotation.NonNull + private PackageInfo packageInfo; + + public InstallationInfo() { + } + + public InstallationInfo guid(@org.eclipse.jdt.annotation.NonNull UUID guid) { + this.guid = guid; + return this; + } + + /** + * Gets or sets the Id. + * + * @return guid + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getGuid() { + return guid; + } + + @JsonProperty(JSON_PROPERTY_GUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGuid(@org.eclipse.jdt.annotation.NonNull UUID guid) { + this.guid = guid; + } + + public InstallationInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public InstallationInfo version(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + return this; + } + + /** + * Gets or sets the version. + * + * @return version + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + } + + public InstallationInfo changelog(@org.eclipse.jdt.annotation.NonNull String changelog) { + this.changelog = changelog; + return this; + } + + /** + * Gets or sets the changelog for this version. + * + * @return changelog + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANGELOG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChangelog() { + return changelog; + } + + @JsonProperty(JSON_PROPERTY_CHANGELOG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChangelog(@org.eclipse.jdt.annotation.NonNull String changelog) { + this.changelog = changelog; + } + + public InstallationInfo sourceUrl(@org.eclipse.jdt.annotation.NonNull String sourceUrl) { + this.sourceUrl = sourceUrl; + return this; + } + + /** + * Gets or sets the source URL. + * + * @return sourceUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SOURCE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceUrl() { + return sourceUrl; + } + + @JsonProperty(JSON_PROPERTY_SOURCE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceUrl(@org.eclipse.jdt.annotation.NonNull String sourceUrl) { + this.sourceUrl = sourceUrl; + } + + public InstallationInfo checksum(@org.eclipse.jdt.annotation.NonNull String checksum) { + this.checksum = checksum; + return this; + } + + /** + * Gets or sets a checksum for the binary. + * + * @return checksum + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHECKSUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChecksum() { + return checksum; + } + + @JsonProperty(JSON_PROPERTY_CHECKSUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChecksum(@org.eclipse.jdt.annotation.NonNull String checksum) { + this.checksum = checksum; + } + + public InstallationInfo packageInfo(@org.eclipse.jdt.annotation.NonNull PackageInfo packageInfo) { + this.packageInfo = packageInfo; + return this; + } + + /** + * Gets or sets package information for the installation. + * + * @return packageInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PACKAGE_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PackageInfo getPackageInfo() { + return packageInfo; + } + + @JsonProperty(JSON_PROPERTY_PACKAGE_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPackageInfo(@org.eclipse.jdt.annotation.NonNull PackageInfo packageInfo) { + this.packageInfo = packageInfo; + } + + /** + * Return true if this InstallationInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InstallationInfo installationInfo = (InstallationInfo) o; + return Objects.equals(this.guid, installationInfo.guid) && Objects.equals(this.name, installationInfo.name) + && Objects.equals(this.version, installationInfo.version) + && Objects.equals(this.changelog, installationInfo.changelog) + && Objects.equals(this.sourceUrl, installationInfo.sourceUrl) + && Objects.equals(this.checksum, installationInfo.checksum) + && Objects.equals(this.packageInfo, installationInfo.packageInfo); + } + + @Override + public int hashCode() { + return Objects.hash(guid, name, version, changelog, sourceUrl, checksum, packageInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InstallationInfo {\n"); + sb.append(" guid: ").append(toIndentedString(guid)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" changelog: ").append(toIndentedString(changelog)).append("\n"); + sb.append(" sourceUrl: ").append(toIndentedString(sourceUrl)).append("\n"); + sb.append(" checksum: ").append(toIndentedString(checksum)).append("\n"); + sb.append(" packageInfo: ").append(toIndentedString(packageInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Guid` to the URL query string + if (getGuid() != null) { + joiner.add(String.format("%sGuid%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGuid())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format("%sVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `Changelog` to the URL query string + if (getChangelog() != null) { + joiner.add(String.format("%sChangelog%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChangelog())))); + } + + // add `SourceUrl` to the URL query string + if (getSourceUrl() != null) { + joiner.add(String.format("%sSourceUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSourceUrl())))); + } + + // add `Checksum` to the URL query string + if (getChecksum() != null) { + joiner.add(String.format("%sChecksum%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChecksum())))); + } + + // add `PackageInfo` to the URL query string + if (getPackageInfo() != null) { + joiner.add(getPackageInfo().toUrlQueryString(prefix + "PackageInfo" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private InstallationInfo instance; + + public Builder() { + this(new InstallationInfo()); + } + + protected Builder(InstallationInfo instance) { + this.instance = instance; + } + + public InstallationInfo.Builder guid(UUID guid) { + this.instance.guid = guid; + return this; + } + + public InstallationInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public InstallationInfo.Builder version(String version) { + this.instance.version = version; + return this; + } + + public InstallationInfo.Builder changelog(String changelog) { + this.instance.changelog = changelog; + return this; + } + + public InstallationInfo.Builder sourceUrl(String sourceUrl) { + this.instance.sourceUrl = sourceUrl; + return this; + } + + public InstallationInfo.Builder checksum(String checksum) { + this.instance.checksum = checksum; + return this; + } + + public InstallationInfo.Builder packageInfo(PackageInfo packageInfo) { + this.instance.packageInfo = packageInfo; + return this; + } + + /** + * returns a built InstallationInfo instance. + * + * The builder is not reusable. + */ + public InstallationInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static InstallationInfo.Builder builder() { + return new InstallationInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public InstallationInfo.Builder toBuilder() { + return new InstallationInfo.Builder().guid(getGuid()).name(getName()).version(getVersion()) + .changelog(getChangelog()).sourceUrl(getSourceUrl()).checksum(getChecksum()) + .packageInfo(getPackageInfo()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/IsoType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/IsoType.java new file mode 100644 index 0000000000000..fd111c5ed7ffc --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/IsoType.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum IsoType. + */ +public enum IsoType { + + DVD("Dvd"), + + BLU_RAY("BluRay"); + + private String value; + + IsoType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static IsoType fromValue(String value) { + for (IsoType b : IsoType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ItemCounts.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ItemCounts.java new file mode 100644 index 0000000000000..4a6e1f4da1708 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ItemCounts.java @@ -0,0 +1,642 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class LibrarySummary. + */ +@JsonPropertyOrder({ ItemCounts.JSON_PROPERTY_MOVIE_COUNT, ItemCounts.JSON_PROPERTY_SERIES_COUNT, + ItemCounts.JSON_PROPERTY_EPISODE_COUNT, ItemCounts.JSON_PROPERTY_ARTIST_COUNT, + ItemCounts.JSON_PROPERTY_PROGRAM_COUNT, ItemCounts.JSON_PROPERTY_TRAILER_COUNT, + ItemCounts.JSON_PROPERTY_SONG_COUNT, ItemCounts.JSON_PROPERTY_ALBUM_COUNT, + ItemCounts.JSON_PROPERTY_MUSIC_VIDEO_COUNT, ItemCounts.JSON_PROPERTY_BOX_SET_COUNT, + ItemCounts.JSON_PROPERTY_BOOK_COUNT, ItemCounts.JSON_PROPERTY_ITEM_COUNT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ItemCounts { + public static final String JSON_PROPERTY_MOVIE_COUNT = "MovieCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer movieCount; + + public static final String JSON_PROPERTY_SERIES_COUNT = "SeriesCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer seriesCount; + + public static final String JSON_PROPERTY_EPISODE_COUNT = "EpisodeCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer episodeCount; + + public static final String JSON_PROPERTY_ARTIST_COUNT = "ArtistCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer artistCount; + + public static final String JSON_PROPERTY_PROGRAM_COUNT = "ProgramCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer programCount; + + public static final String JSON_PROPERTY_TRAILER_COUNT = "TrailerCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer trailerCount; + + public static final String JSON_PROPERTY_SONG_COUNT = "SongCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer songCount; + + public static final String JSON_PROPERTY_ALBUM_COUNT = "AlbumCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer albumCount; + + public static final String JSON_PROPERTY_MUSIC_VIDEO_COUNT = "MusicVideoCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer musicVideoCount; + + public static final String JSON_PROPERTY_BOX_SET_COUNT = "BoxSetCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer boxSetCount; + + public static final String JSON_PROPERTY_BOOK_COUNT = "BookCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer bookCount; + + public static final String JSON_PROPERTY_ITEM_COUNT = "ItemCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer itemCount; + + public ItemCounts() { + } + + public ItemCounts movieCount(@org.eclipse.jdt.annotation.NonNull Integer movieCount) { + this.movieCount = movieCount; + return this; + } + + /** + * Gets or sets the movie count. + * + * @return movieCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MOVIE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMovieCount() { + return movieCount; + } + + @JsonProperty(JSON_PROPERTY_MOVIE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMovieCount(@org.eclipse.jdt.annotation.NonNull Integer movieCount) { + this.movieCount = movieCount; + } + + public ItemCounts seriesCount(@org.eclipse.jdt.annotation.NonNull Integer seriesCount) { + this.seriesCount = seriesCount; + return this; + } + + /** + * Gets or sets the series count. + * + * @return seriesCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSeriesCount() { + return seriesCount; + } + + @JsonProperty(JSON_PROPERTY_SERIES_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesCount(@org.eclipse.jdt.annotation.NonNull Integer seriesCount) { + this.seriesCount = seriesCount; + } + + public ItemCounts episodeCount(@org.eclipse.jdt.annotation.NonNull Integer episodeCount) { + this.episodeCount = episodeCount; + return this; + } + + /** + * Gets or sets the episode count. + * + * @return episodeCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EPISODE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getEpisodeCount() { + return episodeCount; + } + + @JsonProperty(JSON_PROPERTY_EPISODE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEpisodeCount(@org.eclipse.jdt.annotation.NonNull Integer episodeCount) { + this.episodeCount = episodeCount; + } + + public ItemCounts artistCount(@org.eclipse.jdt.annotation.NonNull Integer artistCount) { + this.artistCount = artistCount; + return this; + } + + /** + * Gets or sets the artist count. + * + * @return artistCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTIST_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getArtistCount() { + return artistCount; + } + + @JsonProperty(JSON_PROPERTY_ARTIST_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtistCount(@org.eclipse.jdt.annotation.NonNull Integer artistCount) { + this.artistCount = artistCount; + } + + public ItemCounts programCount(@org.eclipse.jdt.annotation.NonNull Integer programCount) { + this.programCount = programCount; + return this; + } + + /** + * Gets or sets the program count. + * + * @return programCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROGRAM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getProgramCount() { + return programCount; + } + + @JsonProperty(JSON_PROPERTY_PROGRAM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgramCount(@org.eclipse.jdt.annotation.NonNull Integer programCount) { + this.programCount = programCount; + } + + public ItemCounts trailerCount(@org.eclipse.jdt.annotation.NonNull Integer trailerCount) { + this.trailerCount = trailerCount; + return this; + } + + /** + * Gets or sets the trailer count. + * + * @return trailerCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRAILER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTrailerCount() { + return trailerCount; + } + + @JsonProperty(JSON_PROPERTY_TRAILER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrailerCount(@org.eclipse.jdt.annotation.NonNull Integer trailerCount) { + this.trailerCount = trailerCount; + } + + public ItemCounts songCount(@org.eclipse.jdt.annotation.NonNull Integer songCount) { + this.songCount = songCount; + return this; + } + + /** + * Gets or sets the song count. + * + * @return songCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SONG_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSongCount() { + return songCount; + } + + @JsonProperty(JSON_PROPERTY_SONG_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSongCount(@org.eclipse.jdt.annotation.NonNull Integer songCount) { + this.songCount = songCount; + } + + public ItemCounts albumCount(@org.eclipse.jdt.annotation.NonNull Integer albumCount) { + this.albumCount = albumCount; + return this; + } + + /** + * Gets or sets the album count. + * + * @return albumCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAlbumCount() { + return albumCount; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumCount(@org.eclipse.jdt.annotation.NonNull Integer albumCount) { + this.albumCount = albumCount; + } + + public ItemCounts musicVideoCount(@org.eclipse.jdt.annotation.NonNull Integer musicVideoCount) { + this.musicVideoCount = musicVideoCount; + return this; + } + + /** + * Gets or sets the music video count. + * + * @return musicVideoCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MUSIC_VIDEO_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMusicVideoCount() { + return musicVideoCount; + } + + @JsonProperty(JSON_PROPERTY_MUSIC_VIDEO_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMusicVideoCount(@org.eclipse.jdt.annotation.NonNull Integer musicVideoCount) { + this.musicVideoCount = musicVideoCount; + } + + public ItemCounts boxSetCount(@org.eclipse.jdt.annotation.NonNull Integer boxSetCount) { + this.boxSetCount = boxSetCount; + return this; + } + + /** + * Gets or sets the box set count. + * + * @return boxSetCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BOX_SET_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBoxSetCount() { + return boxSetCount; + } + + @JsonProperty(JSON_PROPERTY_BOX_SET_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBoxSetCount(@org.eclipse.jdt.annotation.NonNull Integer boxSetCount) { + this.boxSetCount = boxSetCount; + } + + public ItemCounts bookCount(@org.eclipse.jdt.annotation.NonNull Integer bookCount) { + this.bookCount = bookCount; + return this; + } + + /** + * Gets or sets the book count. + * + * @return bookCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BOOK_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBookCount() { + return bookCount; + } + + @JsonProperty(JSON_PROPERTY_BOOK_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBookCount(@org.eclipse.jdt.annotation.NonNull Integer bookCount) { + this.bookCount = bookCount; + } + + public ItemCounts itemCount(@org.eclipse.jdt.annotation.NonNull Integer itemCount) { + this.itemCount = itemCount; + return this; + } + + /** + * Gets or sets the item count. + * + * @return itemCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getItemCount() { + return itemCount; + } + + @JsonProperty(JSON_PROPERTY_ITEM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemCount(@org.eclipse.jdt.annotation.NonNull Integer itemCount) { + this.itemCount = itemCount; + } + + /** + * Return true if this ItemCounts object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemCounts itemCounts = (ItemCounts) o; + return Objects.equals(this.movieCount, itemCounts.movieCount) + && Objects.equals(this.seriesCount, itemCounts.seriesCount) + && Objects.equals(this.episodeCount, itemCounts.episodeCount) + && Objects.equals(this.artistCount, itemCounts.artistCount) + && Objects.equals(this.programCount, itemCounts.programCount) + && Objects.equals(this.trailerCount, itemCounts.trailerCount) + && Objects.equals(this.songCount, itemCounts.songCount) + && Objects.equals(this.albumCount, itemCounts.albumCount) + && Objects.equals(this.musicVideoCount, itemCounts.musicVideoCount) + && Objects.equals(this.boxSetCount, itemCounts.boxSetCount) + && Objects.equals(this.bookCount, itemCounts.bookCount) + && Objects.equals(this.itemCount, itemCounts.itemCount); + } + + @Override + public int hashCode() { + return Objects.hash(movieCount, seriesCount, episodeCount, artistCount, programCount, trailerCount, songCount, + albumCount, musicVideoCount, boxSetCount, bookCount, itemCount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ItemCounts {\n"); + sb.append(" movieCount: ").append(toIndentedString(movieCount)).append("\n"); + sb.append(" seriesCount: ").append(toIndentedString(seriesCount)).append("\n"); + sb.append(" episodeCount: ").append(toIndentedString(episodeCount)).append("\n"); + sb.append(" artistCount: ").append(toIndentedString(artistCount)).append("\n"); + sb.append(" programCount: ").append(toIndentedString(programCount)).append("\n"); + sb.append(" trailerCount: ").append(toIndentedString(trailerCount)).append("\n"); + sb.append(" songCount: ").append(toIndentedString(songCount)).append("\n"); + sb.append(" albumCount: ").append(toIndentedString(albumCount)).append("\n"); + sb.append(" musicVideoCount: ").append(toIndentedString(musicVideoCount)).append("\n"); + sb.append(" boxSetCount: ").append(toIndentedString(boxSetCount)).append("\n"); + sb.append(" bookCount: ").append(toIndentedString(bookCount)).append("\n"); + sb.append(" itemCount: ").append(toIndentedString(itemCount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MovieCount` to the URL query string + if (getMovieCount() != null) { + joiner.add(String.format("%sMovieCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMovieCount())))); + } + + // add `SeriesCount` to the URL query string + if (getSeriesCount() != null) { + joiner.add(String.format("%sSeriesCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesCount())))); + } + + // add `EpisodeCount` to the URL query string + if (getEpisodeCount() != null) { + joiner.add(String.format("%sEpisodeCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEpisodeCount())))); + } + + // add `ArtistCount` to the URL query string + if (getArtistCount() != null) { + joiner.add(String.format("%sArtistCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getArtistCount())))); + } + + // add `ProgramCount` to the URL query string + if (getProgramCount() != null) { + joiner.add(String.format("%sProgramCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProgramCount())))); + } + + // add `TrailerCount` to the URL query string + if (getTrailerCount() != null) { + joiner.add(String.format("%sTrailerCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTrailerCount())))); + } + + // add `SongCount` to the URL query string + if (getSongCount() != null) { + joiner.add(String.format("%sSongCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSongCount())))); + } + + // add `AlbumCount` to the URL query string + if (getAlbumCount() != null) { + joiner.add(String.format("%sAlbumCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbumCount())))); + } + + // add `MusicVideoCount` to the URL query string + if (getMusicVideoCount() != null) { + joiner.add(String.format("%sMusicVideoCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMusicVideoCount())))); + } + + // add `BoxSetCount` to the URL query string + if (getBoxSetCount() != null) { + joiner.add(String.format("%sBoxSetCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBoxSetCount())))); + } + + // add `BookCount` to the URL query string + if (getBookCount() != null) { + joiner.add(String.format("%sBookCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBookCount())))); + } + + // add `ItemCount` to the URL query string + if (getItemCount() != null) { + joiner.add(String.format("%sItemCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemCount())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ItemCounts instance; + + public Builder() { + this(new ItemCounts()); + } + + protected Builder(ItemCounts instance) { + this.instance = instance; + } + + public ItemCounts.Builder movieCount(Integer movieCount) { + this.instance.movieCount = movieCount; + return this; + } + + public ItemCounts.Builder seriesCount(Integer seriesCount) { + this.instance.seriesCount = seriesCount; + return this; + } + + public ItemCounts.Builder episodeCount(Integer episodeCount) { + this.instance.episodeCount = episodeCount; + return this; + } + + public ItemCounts.Builder artistCount(Integer artistCount) { + this.instance.artistCount = artistCount; + return this; + } + + public ItemCounts.Builder programCount(Integer programCount) { + this.instance.programCount = programCount; + return this; + } + + public ItemCounts.Builder trailerCount(Integer trailerCount) { + this.instance.trailerCount = trailerCount; + return this; + } + + public ItemCounts.Builder songCount(Integer songCount) { + this.instance.songCount = songCount; + return this; + } + + public ItemCounts.Builder albumCount(Integer albumCount) { + this.instance.albumCount = albumCount; + return this; + } + + public ItemCounts.Builder musicVideoCount(Integer musicVideoCount) { + this.instance.musicVideoCount = musicVideoCount; + return this; + } + + public ItemCounts.Builder boxSetCount(Integer boxSetCount) { + this.instance.boxSetCount = boxSetCount; + return this; + } + + public ItemCounts.Builder bookCount(Integer bookCount) { + this.instance.bookCount = bookCount; + return this; + } + + public ItemCounts.Builder itemCount(Integer itemCount) { + this.instance.itemCount = itemCount; + return this; + } + + /** + * returns a built ItemCounts instance. + * + * The builder is not reusable. + */ + public ItemCounts build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ItemCounts.Builder builder() { + return new ItemCounts.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ItemCounts.Builder toBuilder() { + return new ItemCounts.Builder().movieCount(getMovieCount()).seriesCount(getSeriesCount()) + .episodeCount(getEpisodeCount()).artistCount(getArtistCount()).programCount(getProgramCount()) + .trailerCount(getTrailerCount()).songCount(getSongCount()).albumCount(getAlbumCount()) + .musicVideoCount(getMusicVideoCount()).boxSetCount(getBoxSetCount()).bookCount(getBookCount()) + .itemCount(getItemCount()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ItemFields.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ItemFields.java new file mode 100644 index 0000000000000..d9de19cd207f0 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ItemFields.java @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Used to control the data that gets attached to DtoBaseItems. + */ +public enum ItemFields { + + AIR_TIME("AirTime"), + + CAN_DELETE("CanDelete"), + + CAN_DOWNLOAD("CanDownload"), + + CHANNEL_INFO("ChannelInfo"), + + CHAPTERS("Chapters"), + + TRICKPLAY("Trickplay"), + + CHILD_COUNT("ChildCount"), + + CUMULATIVE_RUN_TIME_TICKS("CumulativeRunTimeTicks"), + + CUSTOM_RATING("CustomRating"), + + DATE_CREATED("DateCreated"), + + DATE_LAST_MEDIA_ADDED("DateLastMediaAdded"), + + DISPLAY_PREFERENCES_ID("DisplayPreferencesId"), + + ETAG("Etag"), + + EXTERNAL_URLS("ExternalUrls"), + + GENRES("Genres"), + + HOME_PAGE_URL("HomePageUrl"), + + ITEM_COUNTS("ItemCounts"), + + MEDIA_SOURCE_COUNT("MediaSourceCount"), + + MEDIA_SOURCES("MediaSources"), + + ORIGINAL_TITLE("OriginalTitle"), + + OVERVIEW("Overview"), + + PARENT_ID("ParentId"), + + PATH("Path"), + + PEOPLE("People"), + + PLAY_ACCESS("PlayAccess"), + + PRODUCTION_LOCATIONS("ProductionLocations"), + + PROVIDER_IDS("ProviderIds"), + + PRIMARY_IMAGE_ASPECT_RATIO("PrimaryImageAspectRatio"), + + RECURSIVE_ITEM_COUNT("RecursiveItemCount"), + + SETTINGS("Settings"), + + SCREENSHOT_IMAGE_TAGS("ScreenshotImageTags"), + + SERIES_PRIMARY_IMAGE("SeriesPrimaryImage"), + + SERIES_STUDIO("SeriesStudio"), + + SORT_NAME("SortName"), + + SPECIAL_EPISODE_NUMBERS("SpecialEpisodeNumbers"), + + STUDIOS("Studios"), + + TAGLINES("Taglines"), + + TAGS("Tags"), + + REMOTE_TRAILERS("RemoteTrailers"), + + MEDIA_STREAMS("MediaStreams"), + + SEASON_USER_DATA("SeasonUserData"), + + SERVICE_NAME("ServiceName"), + + THEME_SONG_IDS("ThemeSongIds"), + + THEME_VIDEO_IDS("ThemeVideoIds"), + + EXTERNAL_ETAG("ExternalEtag"), + + PRESENTATION_UNIQUE_KEY("PresentationUniqueKey"), + + INHERITED_PARENTAL_RATING_VALUE("InheritedParentalRatingValue"), + + EXTERNAL_SERIES_ID("ExternalSeriesId"), + + SERIES_PRESENTATION_UNIQUE_KEY("SeriesPresentationUniqueKey"), + + DATE_LAST_REFRESHED("DateLastRefreshed"), + + DATE_LAST_SAVED("DateLastSaved"), + + REFRESH_STATE("RefreshState"), + + CHANNEL_IMAGE("ChannelImage"), + + ENABLE_MEDIA_SOURCE_DISPLAY("EnableMediaSourceDisplay"), + + WIDTH("Width"), + + HEIGHT("Height"), + + EXTRA_IDS("ExtraIds"), + + LOCAL_TRAILER_COUNT("LocalTrailerCount"), + + IS_HD("IsHD"), + + SPECIAL_FEATURE_COUNT("SpecialFeatureCount"); + + private String value; + + ItemFields(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ItemFields fromValue(String value) { + for (ItemFields b : ItemFields.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ItemFilter.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ItemFilter.java new file mode 100644 index 0000000000000..e433cdd8408ed --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ItemFilter.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum ItemFilter. + */ +public enum ItemFilter { + + IS_FOLDER("IsFolder"), + + IS_NOT_FOLDER("IsNotFolder"), + + IS_UNPLAYED("IsUnplayed"), + + IS_PLAYED("IsPlayed"), + + IS_FAVORITE("IsFavorite"), + + IS_RESUMABLE("IsResumable"), + + LIKES("Likes"), + + DISLIKES("Dislikes"), + + IS_FAVORITE_OR_LIKES("IsFavoriteOrLikes"); + + private String value; + + ItemFilter(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ItemFilter fromValue(String value) { + for (ItemFilter b : ItemFilter.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ItemSortBy.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ItemSortBy.java new file mode 100644 index 0000000000000..34d802e46de54 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ItemSortBy.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * These represent sort orders. + */ +public enum ItemSortBy { + + DEFAULT("Default"), + + AIRED_EPISODE_ORDER("AiredEpisodeOrder"), + + ALBUM("Album"), + + ALBUM_ARTIST("AlbumArtist"), + + ARTIST("Artist"), + + DATE_CREATED("DateCreated"), + + OFFICIAL_RATING("OfficialRating"), + + DATE_PLAYED("DatePlayed"), + + PREMIERE_DATE("PremiereDate"), + + START_DATE("StartDate"), + + SORT_NAME("SortName"), + + NAME("Name"), + + RANDOM("Random"), + + RUNTIME("Runtime"), + + COMMUNITY_RATING("CommunityRating"), + + PRODUCTION_YEAR("ProductionYear"), + + PLAY_COUNT("PlayCount"), + + CRITIC_RATING("CriticRating"), + + IS_FOLDER("IsFolder"), + + IS_UNPLAYED("IsUnplayed"), + + IS_PLAYED("IsPlayed"), + + SERIES_SORT_NAME("SeriesSortName"), + + VIDEO_BIT_RATE("VideoBitRate"), + + AIR_TIME("AirTime"), + + STUDIO("Studio"), + + IS_FAVORITE_OR_LIKED("IsFavoriteOrLiked"), + + DATE_LAST_CONTENT_ADDED("DateLastContentAdded"), + + SERIES_DATE_PLAYED("SeriesDatePlayed"), + + PARENT_INDEX_NUMBER("ParentIndexNumber"), + + INDEX_NUMBER("IndexNumber"), + + SIMILARITY_SCORE("SimilarityScore"), + + SEARCH_SCORE("SearchScore"); + + private String value; + + ItemSortBy(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ItemSortBy fromValue(String value) { + for (ItemSortBy b : ItemSortBy.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/JoinGroupRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/JoinGroupRequestDto.java new file mode 100644 index 0000000000000..2884d3d09a05b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/JoinGroupRequestDto.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class JoinGroupRequestDto. + */ +@JsonPropertyOrder({ JoinGroupRequestDto.JSON_PROPERTY_GROUP_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class JoinGroupRequestDto { + public static final String JSON_PROPERTY_GROUP_ID = "GroupId"; + @org.eclipse.jdt.annotation.NonNull + private UUID groupId; + + public JoinGroupRequestDto() { + } + + public JoinGroupRequestDto groupId(@org.eclipse.jdt.annotation.NonNull UUID groupId) { + this.groupId = groupId; + return this; + } + + /** + * Gets or sets the group identifier. + * + * @return groupId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getGroupId() { + return groupId; + } + + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupId(@org.eclipse.jdt.annotation.NonNull UUID groupId) { + this.groupId = groupId; + } + + /** + * Return true if this JoinGroupRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JoinGroupRequestDto joinGroupRequestDto = (JoinGroupRequestDto) o; + return Objects.equals(this.groupId, joinGroupRequestDto.groupId); + } + + @Override + public int hashCode() { + return Objects.hash(groupId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JoinGroupRequestDto {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `GroupId` to the URL query string + if (getGroupId() != null) { + joiner.add(String.format("%sGroupId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGroupId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private JoinGroupRequestDto instance; + + public Builder() { + this(new JoinGroupRequestDto()); + } + + protected Builder(JoinGroupRequestDto instance) { + this.instance = instance; + } + + public JoinGroupRequestDto.Builder groupId(UUID groupId) { + this.instance.groupId = groupId; + return this; + } + + /** + * returns a built JoinGroupRequestDto instance. + * + * The builder is not reusable. + */ + public JoinGroupRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static JoinGroupRequestDto.Builder builder() { + return new JoinGroupRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public JoinGroupRequestDto.Builder toBuilder() { + return new JoinGroupRequestDto.Builder().groupId(getGroupId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/KeepUntil.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/KeepUntil.java new file mode 100644 index 0000000000000..f0da7e93139ba --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/KeepUntil.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets KeepUntil + */ +public enum KeepUntil { + + UNTIL_DELETED("UntilDeleted"), + + UNTIL_SPACE_NEEDED("UntilSpaceNeeded"), + + UNTIL_WATCHED("UntilWatched"), + + UNTIL_DATE("UntilDate"); + + private String value; + + KeepUntil(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KeepUntil fromValue(String value) { + for (KeepUntil b : KeepUntil.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryChangedMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryChangedMessage.java new file mode 100644 index 0000000000000..ebced8dc1b963 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryChangedMessage.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Library changed message. + */ +@JsonPropertyOrder({ LibraryChangedMessage.JSON_PROPERTY_DATA, LibraryChangedMessage.JSON_PROPERTY_MESSAGE_ID, + LibraryChangedMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LibraryChangedMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private LibraryUpdateInfo data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.LIBRARY_CHANGED; + + public LibraryChangedMessage() { + } + + @JsonCreator + public LibraryChangedMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public LibraryChangedMessage data(@org.eclipse.jdt.annotation.NonNull LibraryUpdateInfo data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LibraryUpdateInfo getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull LibraryUpdateInfo data) { + this.data = data; + } + + public LibraryChangedMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this LibraryChangedMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LibraryChangedMessage libraryChangedMessage = (LibraryChangedMessage) o; + return Objects.equals(this.data, libraryChangedMessage.data) + && Objects.equals(this.messageId, libraryChangedMessage.messageId) + && Objects.equals(this.messageType, libraryChangedMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LibraryChangedMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private LibraryChangedMessage instance; + + public Builder() { + this(new LibraryChangedMessage()); + } + + protected Builder(LibraryChangedMessage instance) { + this.instance = instance; + } + + public LibraryChangedMessage.Builder data(LibraryUpdateInfo data) { + this.instance.data = data; + return this; + } + + public LibraryChangedMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public LibraryChangedMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built LibraryChangedMessage instance. + * + * The builder is not reusable. + */ + public LibraryChangedMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LibraryChangedMessage.Builder builder() { + return new LibraryChangedMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LibraryChangedMessage.Builder toBuilder() { + return new LibraryChangedMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryOptionInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryOptionInfoDto.java new file mode 100644 index 0000000000000..084e005c79e29 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryOptionInfoDto.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Library option info dto. + */ +@JsonPropertyOrder({ LibraryOptionInfoDto.JSON_PROPERTY_NAME, LibraryOptionInfoDto.JSON_PROPERTY_DEFAULT_ENABLED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LibraryOptionInfoDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_DEFAULT_ENABLED = "DefaultEnabled"; + @org.eclipse.jdt.annotation.NonNull + private Boolean defaultEnabled; + + public LibraryOptionInfoDto() { + } + + public LibraryOptionInfoDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public LibraryOptionInfoDto defaultEnabled(@org.eclipse.jdt.annotation.NonNull Boolean defaultEnabled) { + this.defaultEnabled = defaultEnabled; + return this; + } + + /** + * Gets or sets a value indicating whether default enabled. + * + * @return defaultEnabled + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEFAULT_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDefaultEnabled() { + return defaultEnabled; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultEnabled(@org.eclipse.jdt.annotation.NonNull Boolean defaultEnabled) { + this.defaultEnabled = defaultEnabled; + } + + /** + * Return true if this LibraryOptionInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LibraryOptionInfoDto libraryOptionInfoDto = (LibraryOptionInfoDto) o; + return Objects.equals(this.name, libraryOptionInfoDto.name) + && Objects.equals(this.defaultEnabled, libraryOptionInfoDto.defaultEnabled); + } + + @Override + public int hashCode() { + return Objects.hash(name, defaultEnabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LibraryOptionInfoDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" defaultEnabled: ").append(toIndentedString(defaultEnabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `DefaultEnabled` to the URL query string + if (getDefaultEnabled() != null) { + joiner.add(String.format("%sDefaultEnabled%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDefaultEnabled())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private LibraryOptionInfoDto instance; + + public Builder() { + this(new LibraryOptionInfoDto()); + } + + protected Builder(LibraryOptionInfoDto instance) { + this.instance = instance; + } + + public LibraryOptionInfoDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public LibraryOptionInfoDto.Builder defaultEnabled(Boolean defaultEnabled) { + this.instance.defaultEnabled = defaultEnabled; + return this; + } + + /** + * returns a built LibraryOptionInfoDto instance. + * + * The builder is not reusable. + */ + public LibraryOptionInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LibraryOptionInfoDto.Builder builder() { + return new LibraryOptionInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LibraryOptionInfoDto.Builder toBuilder() { + return new LibraryOptionInfoDto.Builder().name(getName()).defaultEnabled(getDefaultEnabled()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryOptions.java new file mode 100644 index 0000000000000..529bf26d47fd2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryOptions.java @@ -0,0 +1,2119 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * LibraryOptions + */ +@JsonPropertyOrder({ LibraryOptions.JSON_PROPERTY_ENABLED, LibraryOptions.JSON_PROPERTY_ENABLE_PHOTOS, + LibraryOptions.JSON_PROPERTY_ENABLE_REALTIME_MONITOR, LibraryOptions.JSON_PROPERTY_ENABLE_L_U_F_S_SCAN, + LibraryOptions.JSON_PROPERTY_ENABLE_CHAPTER_IMAGE_EXTRACTION, + LibraryOptions.JSON_PROPERTY_EXTRACT_CHAPTER_IMAGES_DURING_LIBRARY_SCAN, + LibraryOptions.JSON_PROPERTY_ENABLE_TRICKPLAY_IMAGE_EXTRACTION, + LibraryOptions.JSON_PROPERTY_EXTRACT_TRICKPLAY_IMAGES_DURING_LIBRARY_SCAN, + LibraryOptions.JSON_PROPERTY_PATH_INFOS, LibraryOptions.JSON_PROPERTY_SAVE_LOCAL_METADATA, + LibraryOptions.JSON_PROPERTY_ENABLE_INTERNET_PROVIDERS, + LibraryOptions.JSON_PROPERTY_ENABLE_AUTOMATIC_SERIES_GROUPING, + LibraryOptions.JSON_PROPERTY_ENABLE_EMBEDDED_TITLES, LibraryOptions.JSON_PROPERTY_ENABLE_EMBEDDED_EXTRAS_TITLES, + LibraryOptions.JSON_PROPERTY_ENABLE_EMBEDDED_EPISODE_INFOS, + LibraryOptions.JSON_PROPERTY_AUTOMATIC_REFRESH_INTERVAL_DAYS, + LibraryOptions.JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE, LibraryOptions.JSON_PROPERTY_METADATA_COUNTRY_CODE, + LibraryOptions.JSON_PROPERTY_SEASON_ZERO_DISPLAY_NAME, LibraryOptions.JSON_PROPERTY_METADATA_SAVERS, + LibraryOptions.JSON_PROPERTY_DISABLED_LOCAL_METADATA_READERS, + LibraryOptions.JSON_PROPERTY_LOCAL_METADATA_READER_ORDER, + LibraryOptions.JSON_PROPERTY_DISABLED_SUBTITLE_FETCHERS, LibraryOptions.JSON_PROPERTY_SUBTITLE_FETCHER_ORDER, + LibraryOptions.JSON_PROPERTY_DISABLED_MEDIA_SEGMENT_PROVIDERS, + LibraryOptions.JSON_PROPERTY_MEDIA_SEGMENT_PROVIDE_ORDER, + LibraryOptions.JSON_PROPERTY_SKIP_SUBTITLES_IF_EMBEDDED_SUBTITLES_PRESENT, + LibraryOptions.JSON_PROPERTY_SKIP_SUBTITLES_IF_AUDIO_TRACK_MATCHES, + LibraryOptions.JSON_PROPERTY_SUBTITLE_DOWNLOAD_LANGUAGES, + LibraryOptions.JSON_PROPERTY_REQUIRE_PERFECT_SUBTITLE_MATCH, + LibraryOptions.JSON_PROPERTY_SAVE_SUBTITLES_WITH_MEDIA, LibraryOptions.JSON_PROPERTY_SAVE_LYRICS_WITH_MEDIA, + LibraryOptions.JSON_PROPERTY_SAVE_TRICKPLAY_WITH_MEDIA, LibraryOptions.JSON_PROPERTY_DISABLED_LYRIC_FETCHERS, + LibraryOptions.JSON_PROPERTY_LYRIC_FETCHER_ORDER, LibraryOptions.JSON_PROPERTY_PREFER_NONSTANDARD_ARTISTS_TAG, + LibraryOptions.JSON_PROPERTY_USE_CUSTOM_TAG_DELIMITERS, LibraryOptions.JSON_PROPERTY_CUSTOM_TAG_DELIMITERS, + LibraryOptions.JSON_PROPERTY_DELIMITER_WHITELIST, LibraryOptions.JSON_PROPERTY_AUTOMATICALLY_ADD_TO_COLLECTION, + LibraryOptions.JSON_PROPERTY_ALLOW_EMBEDDED_SUBTITLES, LibraryOptions.JSON_PROPERTY_TYPE_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LibraryOptions { + public static final String JSON_PROPERTY_ENABLED = "Enabled"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enabled; + + public static final String JSON_PROPERTY_ENABLE_PHOTOS = "EnablePhotos"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enablePhotos; + + public static final String JSON_PROPERTY_ENABLE_REALTIME_MONITOR = "EnableRealtimeMonitor"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableRealtimeMonitor; + + public static final String JSON_PROPERTY_ENABLE_L_U_F_S_SCAN = "EnableLUFSScan"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableLUFSScan; + + public static final String JSON_PROPERTY_ENABLE_CHAPTER_IMAGE_EXTRACTION = "EnableChapterImageExtraction"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableChapterImageExtraction; + + public static final String JSON_PROPERTY_EXTRACT_CHAPTER_IMAGES_DURING_LIBRARY_SCAN = "ExtractChapterImagesDuringLibraryScan"; + @org.eclipse.jdt.annotation.NonNull + private Boolean extractChapterImagesDuringLibraryScan; + + public static final String JSON_PROPERTY_ENABLE_TRICKPLAY_IMAGE_EXTRACTION = "EnableTrickplayImageExtraction"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableTrickplayImageExtraction; + + public static final String JSON_PROPERTY_EXTRACT_TRICKPLAY_IMAGES_DURING_LIBRARY_SCAN = "ExtractTrickplayImagesDuringLibraryScan"; + @org.eclipse.jdt.annotation.NonNull + private Boolean extractTrickplayImagesDuringLibraryScan; + + public static final String JSON_PROPERTY_PATH_INFOS = "PathInfos"; + @org.eclipse.jdt.annotation.NonNull + private List pathInfos = new ArrayList<>(); + + public static final String JSON_PROPERTY_SAVE_LOCAL_METADATA = "SaveLocalMetadata"; + @org.eclipse.jdt.annotation.NonNull + private Boolean saveLocalMetadata; + + public static final String JSON_PROPERTY_ENABLE_INTERNET_PROVIDERS = "EnableInternetProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableInternetProviders; + + public static final String JSON_PROPERTY_ENABLE_AUTOMATIC_SERIES_GROUPING = "EnableAutomaticSeriesGrouping"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAutomaticSeriesGrouping; + + public static final String JSON_PROPERTY_ENABLE_EMBEDDED_TITLES = "EnableEmbeddedTitles"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableEmbeddedTitles; + + public static final String JSON_PROPERTY_ENABLE_EMBEDDED_EXTRAS_TITLES = "EnableEmbeddedExtrasTitles"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableEmbeddedExtrasTitles; + + public static final String JSON_PROPERTY_ENABLE_EMBEDDED_EPISODE_INFOS = "EnableEmbeddedEpisodeInfos"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableEmbeddedEpisodeInfos; + + public static final String JSON_PROPERTY_AUTOMATIC_REFRESH_INTERVAL_DAYS = "AutomaticRefreshIntervalDays"; + @org.eclipse.jdt.annotation.NonNull + private Integer automaticRefreshIntervalDays; + + public static final String JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE = "PreferredMetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String preferredMetadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_SEASON_ZERO_DISPLAY_NAME = "SeasonZeroDisplayName"; + @org.eclipse.jdt.annotation.NonNull + private String seasonZeroDisplayName; + + public static final String JSON_PROPERTY_METADATA_SAVERS = "MetadataSavers"; + @org.eclipse.jdt.annotation.NonNull + private List metadataSavers; + + public static final String JSON_PROPERTY_DISABLED_LOCAL_METADATA_READERS = "DisabledLocalMetadataReaders"; + @org.eclipse.jdt.annotation.NonNull + private List disabledLocalMetadataReaders = new ArrayList<>(); + + public static final String JSON_PROPERTY_LOCAL_METADATA_READER_ORDER = "LocalMetadataReaderOrder"; + @org.eclipse.jdt.annotation.NonNull + private List localMetadataReaderOrder; + + public static final String JSON_PROPERTY_DISABLED_SUBTITLE_FETCHERS = "DisabledSubtitleFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List disabledSubtitleFetchers = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUBTITLE_FETCHER_ORDER = "SubtitleFetcherOrder"; + @org.eclipse.jdt.annotation.NonNull + private List subtitleFetcherOrder = new ArrayList<>(); + + public static final String JSON_PROPERTY_DISABLED_MEDIA_SEGMENT_PROVIDERS = "DisabledMediaSegmentProviders"; + @org.eclipse.jdt.annotation.NonNull + private List disabledMediaSegmentProviders = new ArrayList<>(); + + public static final String JSON_PROPERTY_MEDIA_SEGMENT_PROVIDE_ORDER = "MediaSegmentProvideOrder"; + @org.eclipse.jdt.annotation.NonNull + private List mediaSegmentProvideOrder = new ArrayList<>(); + + public static final String JSON_PROPERTY_SKIP_SUBTITLES_IF_EMBEDDED_SUBTITLES_PRESENT = "SkipSubtitlesIfEmbeddedSubtitlesPresent"; + @org.eclipse.jdt.annotation.NonNull + private Boolean skipSubtitlesIfEmbeddedSubtitlesPresent; + + public static final String JSON_PROPERTY_SKIP_SUBTITLES_IF_AUDIO_TRACK_MATCHES = "SkipSubtitlesIfAudioTrackMatches"; + @org.eclipse.jdt.annotation.NonNull + private Boolean skipSubtitlesIfAudioTrackMatches; + + public static final String JSON_PROPERTY_SUBTITLE_DOWNLOAD_LANGUAGES = "SubtitleDownloadLanguages"; + @org.eclipse.jdt.annotation.NonNull + private List subtitleDownloadLanguages; + + public static final String JSON_PROPERTY_REQUIRE_PERFECT_SUBTITLE_MATCH = "RequirePerfectSubtitleMatch"; + @org.eclipse.jdt.annotation.NonNull + private Boolean requirePerfectSubtitleMatch; + + public static final String JSON_PROPERTY_SAVE_SUBTITLES_WITH_MEDIA = "SaveSubtitlesWithMedia"; + @org.eclipse.jdt.annotation.NonNull + private Boolean saveSubtitlesWithMedia; + + public static final String JSON_PROPERTY_SAVE_LYRICS_WITH_MEDIA = "SaveLyricsWithMedia"; + @org.eclipse.jdt.annotation.NonNull + private Boolean saveLyricsWithMedia = false; + + public static final String JSON_PROPERTY_SAVE_TRICKPLAY_WITH_MEDIA = "SaveTrickplayWithMedia"; + @org.eclipse.jdt.annotation.NonNull + private Boolean saveTrickplayWithMedia = false; + + public static final String JSON_PROPERTY_DISABLED_LYRIC_FETCHERS = "DisabledLyricFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List disabledLyricFetchers = new ArrayList<>(); + + public static final String JSON_PROPERTY_LYRIC_FETCHER_ORDER = "LyricFetcherOrder"; + @org.eclipse.jdt.annotation.NonNull + private List lyricFetcherOrder = new ArrayList<>(); + + public static final String JSON_PROPERTY_PREFER_NONSTANDARD_ARTISTS_TAG = "PreferNonstandardArtistsTag"; + @org.eclipse.jdt.annotation.NonNull + private Boolean preferNonstandardArtistsTag = false; + + public static final String JSON_PROPERTY_USE_CUSTOM_TAG_DELIMITERS = "UseCustomTagDelimiters"; + @org.eclipse.jdt.annotation.NonNull + private Boolean useCustomTagDelimiters = false; + + public static final String JSON_PROPERTY_CUSTOM_TAG_DELIMITERS = "CustomTagDelimiters"; + @org.eclipse.jdt.annotation.NonNull + private List customTagDelimiters = new ArrayList<>(); + + public static final String JSON_PROPERTY_DELIMITER_WHITELIST = "DelimiterWhitelist"; + @org.eclipse.jdt.annotation.NonNull + private List delimiterWhitelist = new ArrayList<>(); + + public static final String JSON_PROPERTY_AUTOMATICALLY_ADD_TO_COLLECTION = "AutomaticallyAddToCollection"; + @org.eclipse.jdt.annotation.NonNull + private Boolean automaticallyAddToCollection; + + public static final String JSON_PROPERTY_ALLOW_EMBEDDED_SUBTITLES = "AllowEmbeddedSubtitles"; + @org.eclipse.jdt.annotation.NonNull + private EmbeddedSubtitleOptions allowEmbeddedSubtitles; + + public static final String JSON_PROPERTY_TYPE_OPTIONS = "TypeOptions"; + @org.eclipse.jdt.annotation.NonNull + private List typeOptions = new ArrayList<>(); + + public LibraryOptions() { + } + + public LibraryOptions enabled(@org.eclipse.jdt.annotation.NonNull Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabled(@org.eclipse.jdt.annotation.NonNull Boolean enabled) { + this.enabled = enabled; + } + + public LibraryOptions enablePhotos(@org.eclipse.jdt.annotation.NonNull Boolean enablePhotos) { + this.enablePhotos = enablePhotos; + return this; + } + + /** + * Get enablePhotos + * + * @return enablePhotos + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_PHOTOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnablePhotos() { + return enablePhotos; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_PHOTOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnablePhotos(@org.eclipse.jdt.annotation.NonNull Boolean enablePhotos) { + this.enablePhotos = enablePhotos; + } + + public LibraryOptions enableRealtimeMonitor(@org.eclipse.jdt.annotation.NonNull Boolean enableRealtimeMonitor) { + this.enableRealtimeMonitor = enableRealtimeMonitor; + return this; + } + + /** + * Get enableRealtimeMonitor + * + * @return enableRealtimeMonitor + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_REALTIME_MONITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableRealtimeMonitor() { + return enableRealtimeMonitor; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_REALTIME_MONITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableRealtimeMonitor(@org.eclipse.jdt.annotation.NonNull Boolean enableRealtimeMonitor) { + this.enableRealtimeMonitor = enableRealtimeMonitor; + } + + public LibraryOptions enableLUFSScan(@org.eclipse.jdt.annotation.NonNull Boolean enableLUFSScan) { + this.enableLUFSScan = enableLUFSScan; + return this; + } + + /** + * Get enableLUFSScan + * + * @return enableLUFSScan + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_L_U_F_S_SCAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableLUFSScan() { + return enableLUFSScan; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_L_U_F_S_SCAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableLUFSScan(@org.eclipse.jdt.annotation.NonNull Boolean enableLUFSScan) { + this.enableLUFSScan = enableLUFSScan; + } + + public LibraryOptions enableChapterImageExtraction( + @org.eclipse.jdt.annotation.NonNull Boolean enableChapterImageExtraction) { + this.enableChapterImageExtraction = enableChapterImageExtraction; + return this; + } + + /** + * Get enableChapterImageExtraction + * + * @return enableChapterImageExtraction + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_CHAPTER_IMAGE_EXTRACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableChapterImageExtraction() { + return enableChapterImageExtraction; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_CHAPTER_IMAGE_EXTRACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableChapterImageExtraction( + @org.eclipse.jdt.annotation.NonNull Boolean enableChapterImageExtraction) { + this.enableChapterImageExtraction = enableChapterImageExtraction; + } + + public LibraryOptions extractChapterImagesDuringLibraryScan( + @org.eclipse.jdt.annotation.NonNull Boolean extractChapterImagesDuringLibraryScan) { + this.extractChapterImagesDuringLibraryScan = extractChapterImagesDuringLibraryScan; + return this; + } + + /** + * Get extractChapterImagesDuringLibraryScan + * + * @return extractChapterImagesDuringLibraryScan + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTRACT_CHAPTER_IMAGES_DURING_LIBRARY_SCAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getExtractChapterImagesDuringLibraryScan() { + return extractChapterImagesDuringLibraryScan; + } + + @JsonProperty(JSON_PROPERTY_EXTRACT_CHAPTER_IMAGES_DURING_LIBRARY_SCAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExtractChapterImagesDuringLibraryScan( + @org.eclipse.jdt.annotation.NonNull Boolean extractChapterImagesDuringLibraryScan) { + this.extractChapterImagesDuringLibraryScan = extractChapterImagesDuringLibraryScan; + } + + public LibraryOptions enableTrickplayImageExtraction( + @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplayImageExtraction) { + this.enableTrickplayImageExtraction = enableTrickplayImageExtraction; + return this; + } + + /** + * Get enableTrickplayImageExtraction + * + * @return enableTrickplayImageExtraction + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_TRICKPLAY_IMAGE_EXTRACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableTrickplayImageExtraction() { + return enableTrickplayImageExtraction; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_TRICKPLAY_IMAGE_EXTRACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableTrickplayImageExtraction( + @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplayImageExtraction) { + this.enableTrickplayImageExtraction = enableTrickplayImageExtraction; + } + + public LibraryOptions extractTrickplayImagesDuringLibraryScan( + @org.eclipse.jdt.annotation.NonNull Boolean extractTrickplayImagesDuringLibraryScan) { + this.extractTrickplayImagesDuringLibraryScan = extractTrickplayImagesDuringLibraryScan; + return this; + } + + /** + * Get extractTrickplayImagesDuringLibraryScan + * + * @return extractTrickplayImagesDuringLibraryScan + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTRACT_TRICKPLAY_IMAGES_DURING_LIBRARY_SCAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getExtractTrickplayImagesDuringLibraryScan() { + return extractTrickplayImagesDuringLibraryScan; + } + + @JsonProperty(JSON_PROPERTY_EXTRACT_TRICKPLAY_IMAGES_DURING_LIBRARY_SCAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExtractTrickplayImagesDuringLibraryScan( + @org.eclipse.jdt.annotation.NonNull Boolean extractTrickplayImagesDuringLibraryScan) { + this.extractTrickplayImagesDuringLibraryScan = extractTrickplayImagesDuringLibraryScan; + } + + public LibraryOptions pathInfos(@org.eclipse.jdt.annotation.NonNull List pathInfos) { + this.pathInfos = pathInfos; + return this; + } + + public LibraryOptions addPathInfosItem(MediaPathInfo pathInfosItem) { + if (this.pathInfos == null) { + this.pathInfos = new ArrayList<>(); + } + this.pathInfos.add(pathInfosItem); + return this; + } + + /** + * Get pathInfos + * + * @return pathInfos + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPathInfos() { + return pathInfos; + } + + @JsonProperty(JSON_PROPERTY_PATH_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPathInfos(@org.eclipse.jdt.annotation.NonNull List pathInfos) { + this.pathInfos = pathInfos; + } + + public LibraryOptions saveLocalMetadata(@org.eclipse.jdt.annotation.NonNull Boolean saveLocalMetadata) { + this.saveLocalMetadata = saveLocalMetadata; + return this; + } + + /** + * Get saveLocalMetadata + * + * @return saveLocalMetadata + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SAVE_LOCAL_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSaveLocalMetadata() { + return saveLocalMetadata; + } + + @JsonProperty(JSON_PROPERTY_SAVE_LOCAL_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaveLocalMetadata(@org.eclipse.jdt.annotation.NonNull Boolean saveLocalMetadata) { + this.saveLocalMetadata = saveLocalMetadata; + } + + public LibraryOptions enableInternetProviders(@org.eclipse.jdt.annotation.NonNull Boolean enableInternetProviders) { + this.enableInternetProviders = enableInternetProviders; + return this; + } + + /** + * Get enableInternetProviders + * + * @return enableInternetProviders + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_INTERNET_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableInternetProviders() { + return enableInternetProviders; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_INTERNET_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableInternetProviders(@org.eclipse.jdt.annotation.NonNull Boolean enableInternetProviders) { + this.enableInternetProviders = enableInternetProviders; + } + + public LibraryOptions enableAutomaticSeriesGrouping( + @org.eclipse.jdt.annotation.NonNull Boolean enableAutomaticSeriesGrouping) { + this.enableAutomaticSeriesGrouping = enableAutomaticSeriesGrouping; + return this; + } + + /** + * Get enableAutomaticSeriesGrouping + * + * @return enableAutomaticSeriesGrouping + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_AUTOMATIC_SERIES_GROUPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAutomaticSeriesGrouping() { + return enableAutomaticSeriesGrouping; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_AUTOMATIC_SERIES_GROUPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAutomaticSeriesGrouping( + @org.eclipse.jdt.annotation.NonNull Boolean enableAutomaticSeriesGrouping) { + this.enableAutomaticSeriesGrouping = enableAutomaticSeriesGrouping; + } + + public LibraryOptions enableEmbeddedTitles(@org.eclipse.jdt.annotation.NonNull Boolean enableEmbeddedTitles) { + this.enableEmbeddedTitles = enableEmbeddedTitles; + return this; + } + + /** + * Get enableEmbeddedTitles + * + * @return enableEmbeddedTitles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_EMBEDDED_TITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableEmbeddedTitles() { + return enableEmbeddedTitles; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_EMBEDDED_TITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableEmbeddedTitles(@org.eclipse.jdt.annotation.NonNull Boolean enableEmbeddedTitles) { + this.enableEmbeddedTitles = enableEmbeddedTitles; + } + + public LibraryOptions enableEmbeddedExtrasTitles( + @org.eclipse.jdt.annotation.NonNull Boolean enableEmbeddedExtrasTitles) { + this.enableEmbeddedExtrasTitles = enableEmbeddedExtrasTitles; + return this; + } + + /** + * Get enableEmbeddedExtrasTitles + * + * @return enableEmbeddedExtrasTitles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_EMBEDDED_EXTRAS_TITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableEmbeddedExtrasTitles() { + return enableEmbeddedExtrasTitles; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_EMBEDDED_EXTRAS_TITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableEmbeddedExtrasTitles(@org.eclipse.jdt.annotation.NonNull Boolean enableEmbeddedExtrasTitles) { + this.enableEmbeddedExtrasTitles = enableEmbeddedExtrasTitles; + } + + public LibraryOptions enableEmbeddedEpisodeInfos( + @org.eclipse.jdt.annotation.NonNull Boolean enableEmbeddedEpisodeInfos) { + this.enableEmbeddedEpisodeInfos = enableEmbeddedEpisodeInfos; + return this; + } + + /** + * Get enableEmbeddedEpisodeInfos + * + * @return enableEmbeddedEpisodeInfos + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_EMBEDDED_EPISODE_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableEmbeddedEpisodeInfos() { + return enableEmbeddedEpisodeInfos; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_EMBEDDED_EPISODE_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableEmbeddedEpisodeInfos(@org.eclipse.jdt.annotation.NonNull Boolean enableEmbeddedEpisodeInfos) { + this.enableEmbeddedEpisodeInfos = enableEmbeddedEpisodeInfos; + } + + public LibraryOptions automaticRefreshIntervalDays( + @org.eclipse.jdt.annotation.NonNull Integer automaticRefreshIntervalDays) { + this.automaticRefreshIntervalDays = automaticRefreshIntervalDays; + return this; + } + + /** + * Get automaticRefreshIntervalDays + * + * @return automaticRefreshIntervalDays + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTOMATIC_REFRESH_INTERVAL_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAutomaticRefreshIntervalDays() { + return automaticRefreshIntervalDays; + } + + @JsonProperty(JSON_PROPERTY_AUTOMATIC_REFRESH_INTERVAL_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAutomaticRefreshIntervalDays( + @org.eclipse.jdt.annotation.NonNull Integer automaticRefreshIntervalDays) { + this.automaticRefreshIntervalDays = automaticRefreshIntervalDays; + } + + public LibraryOptions preferredMetadataLanguage( + @org.eclipse.jdt.annotation.NonNull String preferredMetadataLanguage) { + this.preferredMetadataLanguage = preferredMetadataLanguage; + return this; + } + + /** + * Gets or sets the preferred metadata language. + * + * @return preferredMetadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPreferredMetadataLanguage() { + return preferredMetadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreferredMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String preferredMetadataLanguage) { + this.preferredMetadataLanguage = preferredMetadataLanguage; + } + + public LibraryOptions metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public LibraryOptions seasonZeroDisplayName(@org.eclipse.jdt.annotation.NonNull String seasonZeroDisplayName) { + this.seasonZeroDisplayName = seasonZeroDisplayName; + return this; + } + + /** + * Get seasonZeroDisplayName + * + * @return seasonZeroDisplayName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEASON_ZERO_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeasonZeroDisplayName() { + return seasonZeroDisplayName; + } + + @JsonProperty(JSON_PROPERTY_SEASON_ZERO_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeasonZeroDisplayName(@org.eclipse.jdt.annotation.NonNull String seasonZeroDisplayName) { + this.seasonZeroDisplayName = seasonZeroDisplayName; + } + + public LibraryOptions metadataSavers(@org.eclipse.jdt.annotation.NonNull List metadataSavers) { + this.metadataSavers = metadataSavers; + return this; + } + + public LibraryOptions addMetadataSaversItem(String metadataSaversItem) { + if (this.metadataSavers == null) { + this.metadataSavers = new ArrayList<>(); + } + this.metadataSavers.add(metadataSaversItem); + return this; + } + + /** + * Get metadataSavers + * + * @return metadataSavers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_SAVERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMetadataSavers() { + return metadataSavers; + } + + @JsonProperty(JSON_PROPERTY_METADATA_SAVERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataSavers(@org.eclipse.jdt.annotation.NonNull List metadataSavers) { + this.metadataSavers = metadataSavers; + } + + public LibraryOptions disabledLocalMetadataReaders( + @org.eclipse.jdt.annotation.NonNull List disabledLocalMetadataReaders) { + this.disabledLocalMetadataReaders = disabledLocalMetadataReaders; + return this; + } + + public LibraryOptions addDisabledLocalMetadataReadersItem(String disabledLocalMetadataReadersItem) { + if (this.disabledLocalMetadataReaders == null) { + this.disabledLocalMetadataReaders = new ArrayList<>(); + } + this.disabledLocalMetadataReaders.add(disabledLocalMetadataReadersItem); + return this; + } + + /** + * Get disabledLocalMetadataReaders + * + * @return disabledLocalMetadataReaders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISABLED_LOCAL_METADATA_READERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisabledLocalMetadataReaders() { + return disabledLocalMetadataReaders; + } + + @JsonProperty(JSON_PROPERTY_DISABLED_LOCAL_METADATA_READERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisabledLocalMetadataReaders( + @org.eclipse.jdt.annotation.NonNull List disabledLocalMetadataReaders) { + this.disabledLocalMetadataReaders = disabledLocalMetadataReaders; + } + + public LibraryOptions localMetadataReaderOrder( + @org.eclipse.jdt.annotation.NonNull List localMetadataReaderOrder) { + this.localMetadataReaderOrder = localMetadataReaderOrder; + return this; + } + + public LibraryOptions addLocalMetadataReaderOrderItem(String localMetadataReaderOrderItem) { + if (this.localMetadataReaderOrder == null) { + this.localMetadataReaderOrder = new ArrayList<>(); + } + this.localMetadataReaderOrder.add(localMetadataReaderOrderItem); + return this; + } + + /** + * Get localMetadataReaderOrder + * + * @return localMetadataReaderOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCAL_METADATA_READER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLocalMetadataReaderOrder() { + return localMetadataReaderOrder; + } + + @JsonProperty(JSON_PROPERTY_LOCAL_METADATA_READER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalMetadataReaderOrder(@org.eclipse.jdt.annotation.NonNull List localMetadataReaderOrder) { + this.localMetadataReaderOrder = localMetadataReaderOrder; + } + + public LibraryOptions disabledSubtitleFetchers( + @org.eclipse.jdt.annotation.NonNull List disabledSubtitleFetchers) { + this.disabledSubtitleFetchers = disabledSubtitleFetchers; + return this; + } + + public LibraryOptions addDisabledSubtitleFetchersItem(String disabledSubtitleFetchersItem) { + if (this.disabledSubtitleFetchers == null) { + this.disabledSubtitleFetchers = new ArrayList<>(); + } + this.disabledSubtitleFetchers.add(disabledSubtitleFetchersItem); + return this; + } + + /** + * Get disabledSubtitleFetchers + * + * @return disabledSubtitleFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISABLED_SUBTITLE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisabledSubtitleFetchers() { + return disabledSubtitleFetchers; + } + + @JsonProperty(JSON_PROPERTY_DISABLED_SUBTITLE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisabledSubtitleFetchers(@org.eclipse.jdt.annotation.NonNull List disabledSubtitleFetchers) { + this.disabledSubtitleFetchers = disabledSubtitleFetchers; + } + + public LibraryOptions subtitleFetcherOrder(@org.eclipse.jdt.annotation.NonNull List subtitleFetcherOrder) { + this.subtitleFetcherOrder = subtitleFetcherOrder; + return this; + } + + public LibraryOptions addSubtitleFetcherOrderItem(String subtitleFetcherOrderItem) { + if (this.subtitleFetcherOrder == null) { + this.subtitleFetcherOrder = new ArrayList<>(); + } + this.subtitleFetcherOrder.add(subtitleFetcherOrderItem); + return this; + } + + /** + * Get subtitleFetcherOrder + * + * @return subtitleFetcherOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSubtitleFetcherOrder() { + return subtitleFetcherOrder; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleFetcherOrder(@org.eclipse.jdt.annotation.NonNull List subtitleFetcherOrder) { + this.subtitleFetcherOrder = subtitleFetcherOrder; + } + + public LibraryOptions disabledMediaSegmentProviders( + @org.eclipse.jdt.annotation.NonNull List disabledMediaSegmentProviders) { + this.disabledMediaSegmentProviders = disabledMediaSegmentProviders; + return this; + } + + public LibraryOptions addDisabledMediaSegmentProvidersItem(String disabledMediaSegmentProvidersItem) { + if (this.disabledMediaSegmentProviders == null) { + this.disabledMediaSegmentProviders = new ArrayList<>(); + } + this.disabledMediaSegmentProviders.add(disabledMediaSegmentProvidersItem); + return this; + } + + /** + * Get disabledMediaSegmentProviders + * + * @return disabledMediaSegmentProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISABLED_MEDIA_SEGMENT_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisabledMediaSegmentProviders() { + return disabledMediaSegmentProviders; + } + + @JsonProperty(JSON_PROPERTY_DISABLED_MEDIA_SEGMENT_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisabledMediaSegmentProviders( + @org.eclipse.jdt.annotation.NonNull List disabledMediaSegmentProviders) { + this.disabledMediaSegmentProviders = disabledMediaSegmentProviders; + } + + public LibraryOptions mediaSegmentProvideOrder( + @org.eclipse.jdt.annotation.NonNull List mediaSegmentProvideOrder) { + this.mediaSegmentProvideOrder = mediaSegmentProvideOrder; + return this; + } + + public LibraryOptions addMediaSegmentProvideOrderItem(String mediaSegmentProvideOrderItem) { + if (this.mediaSegmentProvideOrder == null) { + this.mediaSegmentProvideOrder = new ArrayList<>(); + } + this.mediaSegmentProvideOrder.add(mediaSegmentProvideOrderItem); + return this; + } + + /** + * Get mediaSegmentProvideOrder + * + * @return mediaSegmentProvideOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SEGMENT_PROVIDE_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMediaSegmentProvideOrder() { + return mediaSegmentProvideOrder; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SEGMENT_PROVIDE_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSegmentProvideOrder(@org.eclipse.jdt.annotation.NonNull List mediaSegmentProvideOrder) { + this.mediaSegmentProvideOrder = mediaSegmentProvideOrder; + } + + public LibraryOptions skipSubtitlesIfEmbeddedSubtitlesPresent( + @org.eclipse.jdt.annotation.NonNull Boolean skipSubtitlesIfEmbeddedSubtitlesPresent) { + this.skipSubtitlesIfEmbeddedSubtitlesPresent = skipSubtitlesIfEmbeddedSubtitlesPresent; + return this; + } + + /** + * Get skipSubtitlesIfEmbeddedSubtitlesPresent + * + * @return skipSubtitlesIfEmbeddedSubtitlesPresent + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SKIP_SUBTITLES_IF_EMBEDDED_SUBTITLES_PRESENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSkipSubtitlesIfEmbeddedSubtitlesPresent() { + return skipSubtitlesIfEmbeddedSubtitlesPresent; + } + + @JsonProperty(JSON_PROPERTY_SKIP_SUBTITLES_IF_EMBEDDED_SUBTITLES_PRESENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipSubtitlesIfEmbeddedSubtitlesPresent( + @org.eclipse.jdt.annotation.NonNull Boolean skipSubtitlesIfEmbeddedSubtitlesPresent) { + this.skipSubtitlesIfEmbeddedSubtitlesPresent = skipSubtitlesIfEmbeddedSubtitlesPresent; + } + + public LibraryOptions skipSubtitlesIfAudioTrackMatches( + @org.eclipse.jdt.annotation.NonNull Boolean skipSubtitlesIfAudioTrackMatches) { + this.skipSubtitlesIfAudioTrackMatches = skipSubtitlesIfAudioTrackMatches; + return this; + } + + /** + * Get skipSubtitlesIfAudioTrackMatches + * + * @return skipSubtitlesIfAudioTrackMatches + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SKIP_SUBTITLES_IF_AUDIO_TRACK_MATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSkipSubtitlesIfAudioTrackMatches() { + return skipSubtitlesIfAudioTrackMatches; + } + + @JsonProperty(JSON_PROPERTY_SKIP_SUBTITLES_IF_AUDIO_TRACK_MATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipSubtitlesIfAudioTrackMatches( + @org.eclipse.jdt.annotation.NonNull Boolean skipSubtitlesIfAudioTrackMatches) { + this.skipSubtitlesIfAudioTrackMatches = skipSubtitlesIfAudioTrackMatches; + } + + public LibraryOptions subtitleDownloadLanguages( + @org.eclipse.jdt.annotation.NonNull List subtitleDownloadLanguages) { + this.subtitleDownloadLanguages = subtitleDownloadLanguages; + return this; + } + + public LibraryOptions addSubtitleDownloadLanguagesItem(String subtitleDownloadLanguagesItem) { + if (this.subtitleDownloadLanguages == null) { + this.subtitleDownloadLanguages = new ArrayList<>(); + } + this.subtitleDownloadLanguages.add(subtitleDownloadLanguagesItem); + return this; + } + + /** + * Get subtitleDownloadLanguages + * + * @return subtitleDownloadLanguages + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_DOWNLOAD_LANGUAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSubtitleDownloadLanguages() { + return subtitleDownloadLanguages; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_DOWNLOAD_LANGUAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleDownloadLanguages( + @org.eclipse.jdt.annotation.NonNull List subtitleDownloadLanguages) { + this.subtitleDownloadLanguages = subtitleDownloadLanguages; + } + + public LibraryOptions requirePerfectSubtitleMatch( + @org.eclipse.jdt.annotation.NonNull Boolean requirePerfectSubtitleMatch) { + this.requirePerfectSubtitleMatch = requirePerfectSubtitleMatch; + return this; + } + + /** + * Get requirePerfectSubtitleMatch + * + * @return requirePerfectSubtitleMatch + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUIRE_PERFECT_SUBTITLE_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequirePerfectSubtitleMatch() { + return requirePerfectSubtitleMatch; + } + + @JsonProperty(JSON_PROPERTY_REQUIRE_PERFECT_SUBTITLE_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequirePerfectSubtitleMatch( + @org.eclipse.jdt.annotation.NonNull Boolean requirePerfectSubtitleMatch) { + this.requirePerfectSubtitleMatch = requirePerfectSubtitleMatch; + } + + public LibraryOptions saveSubtitlesWithMedia(@org.eclipse.jdt.annotation.NonNull Boolean saveSubtitlesWithMedia) { + this.saveSubtitlesWithMedia = saveSubtitlesWithMedia; + return this; + } + + /** + * Get saveSubtitlesWithMedia + * + * @return saveSubtitlesWithMedia + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SAVE_SUBTITLES_WITH_MEDIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSaveSubtitlesWithMedia() { + return saveSubtitlesWithMedia; + } + + @JsonProperty(JSON_PROPERTY_SAVE_SUBTITLES_WITH_MEDIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaveSubtitlesWithMedia(@org.eclipse.jdt.annotation.NonNull Boolean saveSubtitlesWithMedia) { + this.saveSubtitlesWithMedia = saveSubtitlesWithMedia; + } + + public LibraryOptions saveLyricsWithMedia(@org.eclipse.jdt.annotation.NonNull Boolean saveLyricsWithMedia) { + this.saveLyricsWithMedia = saveLyricsWithMedia; + return this; + } + + /** + * Get saveLyricsWithMedia + * + * @return saveLyricsWithMedia + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SAVE_LYRICS_WITH_MEDIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSaveLyricsWithMedia() { + return saveLyricsWithMedia; + } + + @JsonProperty(JSON_PROPERTY_SAVE_LYRICS_WITH_MEDIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaveLyricsWithMedia(@org.eclipse.jdt.annotation.NonNull Boolean saveLyricsWithMedia) { + this.saveLyricsWithMedia = saveLyricsWithMedia; + } + + public LibraryOptions saveTrickplayWithMedia(@org.eclipse.jdt.annotation.NonNull Boolean saveTrickplayWithMedia) { + this.saveTrickplayWithMedia = saveTrickplayWithMedia; + return this; + } + + /** + * Get saveTrickplayWithMedia + * + * @return saveTrickplayWithMedia + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SAVE_TRICKPLAY_WITH_MEDIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSaveTrickplayWithMedia() { + return saveTrickplayWithMedia; + } + + @JsonProperty(JSON_PROPERTY_SAVE_TRICKPLAY_WITH_MEDIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaveTrickplayWithMedia(@org.eclipse.jdt.annotation.NonNull Boolean saveTrickplayWithMedia) { + this.saveTrickplayWithMedia = saveTrickplayWithMedia; + } + + public LibraryOptions disabledLyricFetchers( + @org.eclipse.jdt.annotation.NonNull List disabledLyricFetchers) { + this.disabledLyricFetchers = disabledLyricFetchers; + return this; + } + + public LibraryOptions addDisabledLyricFetchersItem(String disabledLyricFetchersItem) { + if (this.disabledLyricFetchers == null) { + this.disabledLyricFetchers = new ArrayList<>(); + } + this.disabledLyricFetchers.add(disabledLyricFetchersItem); + return this; + } + + /** + * Get disabledLyricFetchers + * + * @return disabledLyricFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISABLED_LYRIC_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisabledLyricFetchers() { + return disabledLyricFetchers; + } + + @JsonProperty(JSON_PROPERTY_DISABLED_LYRIC_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisabledLyricFetchers(@org.eclipse.jdt.annotation.NonNull List disabledLyricFetchers) { + this.disabledLyricFetchers = disabledLyricFetchers; + } + + public LibraryOptions lyricFetcherOrder(@org.eclipse.jdt.annotation.NonNull List lyricFetcherOrder) { + this.lyricFetcherOrder = lyricFetcherOrder; + return this; + } + + public LibraryOptions addLyricFetcherOrderItem(String lyricFetcherOrderItem) { + if (this.lyricFetcherOrder == null) { + this.lyricFetcherOrder = new ArrayList<>(); + } + this.lyricFetcherOrder.add(lyricFetcherOrderItem); + return this; + } + + /** + * Get lyricFetcherOrder + * + * @return lyricFetcherOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LYRIC_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLyricFetcherOrder() { + return lyricFetcherOrder; + } + + @JsonProperty(JSON_PROPERTY_LYRIC_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLyricFetcherOrder(@org.eclipse.jdt.annotation.NonNull List lyricFetcherOrder) { + this.lyricFetcherOrder = lyricFetcherOrder; + } + + public LibraryOptions preferNonstandardArtistsTag( + @org.eclipse.jdt.annotation.NonNull Boolean preferNonstandardArtistsTag) { + this.preferNonstandardArtistsTag = preferNonstandardArtistsTag; + return this; + } + + /** + * Get preferNonstandardArtistsTag + * + * @return preferNonstandardArtistsTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREFER_NONSTANDARD_ARTISTS_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPreferNonstandardArtistsTag() { + return preferNonstandardArtistsTag; + } + + @JsonProperty(JSON_PROPERTY_PREFER_NONSTANDARD_ARTISTS_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreferNonstandardArtistsTag( + @org.eclipse.jdt.annotation.NonNull Boolean preferNonstandardArtistsTag) { + this.preferNonstandardArtistsTag = preferNonstandardArtistsTag; + } + + public LibraryOptions useCustomTagDelimiters(@org.eclipse.jdt.annotation.NonNull Boolean useCustomTagDelimiters) { + this.useCustomTagDelimiters = useCustomTagDelimiters; + return this; + } + + /** + * Get useCustomTagDelimiters + * + * @return useCustomTagDelimiters + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USE_CUSTOM_TAG_DELIMITERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUseCustomTagDelimiters() { + return useCustomTagDelimiters; + } + + @JsonProperty(JSON_PROPERTY_USE_CUSTOM_TAG_DELIMITERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseCustomTagDelimiters(@org.eclipse.jdt.annotation.NonNull Boolean useCustomTagDelimiters) { + this.useCustomTagDelimiters = useCustomTagDelimiters; + } + + public LibraryOptions customTagDelimiters(@org.eclipse.jdt.annotation.NonNull List customTagDelimiters) { + this.customTagDelimiters = customTagDelimiters; + return this; + } + + public LibraryOptions addCustomTagDelimitersItem(String customTagDelimitersItem) { + if (this.customTagDelimiters == null) { + this.customTagDelimiters = new ArrayList<>(); + } + this.customTagDelimiters.add(customTagDelimitersItem); + return this; + } + + /** + * Get customTagDelimiters + * + * @return customTagDelimiters + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CUSTOM_TAG_DELIMITERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomTagDelimiters() { + return customTagDelimiters; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_TAG_DELIMITERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomTagDelimiters(@org.eclipse.jdt.annotation.NonNull List customTagDelimiters) { + this.customTagDelimiters = customTagDelimiters; + } + + public LibraryOptions delimiterWhitelist(@org.eclipse.jdt.annotation.NonNull List delimiterWhitelist) { + this.delimiterWhitelist = delimiterWhitelist; + return this; + } + + public LibraryOptions addDelimiterWhitelistItem(String delimiterWhitelistItem) { + if (this.delimiterWhitelist == null) { + this.delimiterWhitelist = new ArrayList<>(); + } + this.delimiterWhitelist.add(delimiterWhitelistItem); + return this; + } + + /** + * Get delimiterWhitelist + * + * @return delimiterWhitelist + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DELIMITER_WHITELIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDelimiterWhitelist() { + return delimiterWhitelist; + } + + @JsonProperty(JSON_PROPERTY_DELIMITER_WHITELIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDelimiterWhitelist(@org.eclipse.jdt.annotation.NonNull List delimiterWhitelist) { + this.delimiterWhitelist = delimiterWhitelist; + } + + public LibraryOptions automaticallyAddToCollection( + @org.eclipse.jdt.annotation.NonNull Boolean automaticallyAddToCollection) { + this.automaticallyAddToCollection = automaticallyAddToCollection; + return this; + } + + /** + * Get automaticallyAddToCollection + * + * @return automaticallyAddToCollection + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTOMATICALLY_ADD_TO_COLLECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAutomaticallyAddToCollection() { + return automaticallyAddToCollection; + } + + @JsonProperty(JSON_PROPERTY_AUTOMATICALLY_ADD_TO_COLLECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAutomaticallyAddToCollection( + @org.eclipse.jdt.annotation.NonNull Boolean automaticallyAddToCollection) { + this.automaticallyAddToCollection = automaticallyAddToCollection; + } + + public LibraryOptions allowEmbeddedSubtitles( + @org.eclipse.jdt.annotation.NonNull EmbeddedSubtitleOptions allowEmbeddedSubtitles) { + this.allowEmbeddedSubtitles = allowEmbeddedSubtitles; + return this; + } + + /** + * An enum representing the options to disable embedded subs. + * + * @return allowEmbeddedSubtitles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_EMBEDDED_SUBTITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EmbeddedSubtitleOptions getAllowEmbeddedSubtitles() { + return allowEmbeddedSubtitles; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_EMBEDDED_SUBTITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowEmbeddedSubtitles( + @org.eclipse.jdt.annotation.NonNull EmbeddedSubtitleOptions allowEmbeddedSubtitles) { + this.allowEmbeddedSubtitles = allowEmbeddedSubtitles; + } + + public LibraryOptions typeOptions(@org.eclipse.jdt.annotation.NonNull List typeOptions) { + this.typeOptions = typeOptions; + return this; + } + + public LibraryOptions addTypeOptionsItem(TypeOptions typeOptionsItem) { + if (this.typeOptions == null) { + this.typeOptions = new ArrayList<>(); + } + this.typeOptions.add(typeOptionsItem); + return this; + } + + /** + * Get typeOptions + * + * @return typeOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTypeOptions() { + return typeOptions; + } + + @JsonProperty(JSON_PROPERTY_TYPE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTypeOptions(@org.eclipse.jdt.annotation.NonNull List typeOptions) { + this.typeOptions = typeOptions; + } + + /** + * Return true if this LibraryOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LibraryOptions libraryOptions = (LibraryOptions) o; + return Objects.equals(this.enabled, libraryOptions.enabled) + && Objects.equals(this.enablePhotos, libraryOptions.enablePhotos) + && Objects.equals(this.enableRealtimeMonitor, libraryOptions.enableRealtimeMonitor) + && Objects.equals(this.enableLUFSScan, libraryOptions.enableLUFSScan) + && Objects.equals(this.enableChapterImageExtraction, libraryOptions.enableChapterImageExtraction) + && Objects.equals(this.extractChapterImagesDuringLibraryScan, + libraryOptions.extractChapterImagesDuringLibraryScan) + && Objects.equals(this.enableTrickplayImageExtraction, libraryOptions.enableTrickplayImageExtraction) + && Objects.equals(this.extractTrickplayImagesDuringLibraryScan, + libraryOptions.extractTrickplayImagesDuringLibraryScan) + && Objects.equals(this.pathInfos, libraryOptions.pathInfos) + && Objects.equals(this.saveLocalMetadata, libraryOptions.saveLocalMetadata) + && Objects.equals(this.enableInternetProviders, libraryOptions.enableInternetProviders) + && Objects.equals(this.enableAutomaticSeriesGrouping, libraryOptions.enableAutomaticSeriesGrouping) + && Objects.equals(this.enableEmbeddedTitles, libraryOptions.enableEmbeddedTitles) + && Objects.equals(this.enableEmbeddedExtrasTitles, libraryOptions.enableEmbeddedExtrasTitles) + && Objects.equals(this.enableEmbeddedEpisodeInfos, libraryOptions.enableEmbeddedEpisodeInfos) + && Objects.equals(this.automaticRefreshIntervalDays, libraryOptions.automaticRefreshIntervalDays) + && Objects.equals(this.preferredMetadataLanguage, libraryOptions.preferredMetadataLanguage) + && Objects.equals(this.metadataCountryCode, libraryOptions.metadataCountryCode) + && Objects.equals(this.seasonZeroDisplayName, libraryOptions.seasonZeroDisplayName) + && Objects.equals(this.metadataSavers, libraryOptions.metadataSavers) + && Objects.equals(this.disabledLocalMetadataReaders, libraryOptions.disabledLocalMetadataReaders) + && Objects.equals(this.localMetadataReaderOrder, libraryOptions.localMetadataReaderOrder) + && Objects.equals(this.disabledSubtitleFetchers, libraryOptions.disabledSubtitleFetchers) + && Objects.equals(this.subtitleFetcherOrder, libraryOptions.subtitleFetcherOrder) + && Objects.equals(this.disabledMediaSegmentProviders, libraryOptions.disabledMediaSegmentProviders) + && Objects.equals(this.mediaSegmentProvideOrder, libraryOptions.mediaSegmentProvideOrder) + && Objects.equals(this.skipSubtitlesIfEmbeddedSubtitlesPresent, + libraryOptions.skipSubtitlesIfEmbeddedSubtitlesPresent) + && Objects.equals(this.skipSubtitlesIfAudioTrackMatches, + libraryOptions.skipSubtitlesIfAudioTrackMatches) + && Objects.equals(this.subtitleDownloadLanguages, libraryOptions.subtitleDownloadLanguages) + && Objects.equals(this.requirePerfectSubtitleMatch, libraryOptions.requirePerfectSubtitleMatch) + && Objects.equals(this.saveSubtitlesWithMedia, libraryOptions.saveSubtitlesWithMedia) + && Objects.equals(this.saveLyricsWithMedia, libraryOptions.saveLyricsWithMedia) + && Objects.equals(this.saveTrickplayWithMedia, libraryOptions.saveTrickplayWithMedia) + && Objects.equals(this.disabledLyricFetchers, libraryOptions.disabledLyricFetchers) + && Objects.equals(this.lyricFetcherOrder, libraryOptions.lyricFetcherOrder) + && Objects.equals(this.preferNonstandardArtistsTag, libraryOptions.preferNonstandardArtistsTag) + && Objects.equals(this.useCustomTagDelimiters, libraryOptions.useCustomTagDelimiters) + && Objects.equals(this.customTagDelimiters, libraryOptions.customTagDelimiters) + && Objects.equals(this.delimiterWhitelist, libraryOptions.delimiterWhitelist) + && Objects.equals(this.automaticallyAddToCollection, libraryOptions.automaticallyAddToCollection) + && Objects.equals(this.allowEmbeddedSubtitles, libraryOptions.allowEmbeddedSubtitles) + && Objects.equals(this.typeOptions, libraryOptions.typeOptions); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, enablePhotos, enableRealtimeMonitor, enableLUFSScan, enableChapterImageExtraction, + extractChapterImagesDuringLibraryScan, enableTrickplayImageExtraction, + extractTrickplayImagesDuringLibraryScan, pathInfos, saveLocalMetadata, enableInternetProviders, + enableAutomaticSeriesGrouping, enableEmbeddedTitles, enableEmbeddedExtrasTitles, + enableEmbeddedEpisodeInfos, automaticRefreshIntervalDays, preferredMetadataLanguage, + metadataCountryCode, seasonZeroDisplayName, metadataSavers, disabledLocalMetadataReaders, + localMetadataReaderOrder, disabledSubtitleFetchers, subtitleFetcherOrder, disabledMediaSegmentProviders, + mediaSegmentProvideOrder, skipSubtitlesIfEmbeddedSubtitlesPresent, skipSubtitlesIfAudioTrackMatches, + subtitleDownloadLanguages, requirePerfectSubtitleMatch, saveSubtitlesWithMedia, saveLyricsWithMedia, + saveTrickplayWithMedia, disabledLyricFetchers, lyricFetcherOrder, preferNonstandardArtistsTag, + useCustomTagDelimiters, customTagDelimiters, delimiterWhitelist, automaticallyAddToCollection, + allowEmbeddedSubtitles, typeOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LibraryOptions {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" enablePhotos: ").append(toIndentedString(enablePhotos)).append("\n"); + sb.append(" enableRealtimeMonitor: ").append(toIndentedString(enableRealtimeMonitor)).append("\n"); + sb.append(" enableLUFSScan: ").append(toIndentedString(enableLUFSScan)).append("\n"); + sb.append(" enableChapterImageExtraction: ").append(toIndentedString(enableChapterImageExtraction)) + .append("\n"); + sb.append(" extractChapterImagesDuringLibraryScan: ") + .append(toIndentedString(extractChapterImagesDuringLibraryScan)).append("\n"); + sb.append(" enableTrickplayImageExtraction: ").append(toIndentedString(enableTrickplayImageExtraction)) + .append("\n"); + sb.append(" extractTrickplayImagesDuringLibraryScan: ") + .append(toIndentedString(extractTrickplayImagesDuringLibraryScan)).append("\n"); + sb.append(" pathInfos: ").append(toIndentedString(pathInfos)).append("\n"); + sb.append(" saveLocalMetadata: ").append(toIndentedString(saveLocalMetadata)).append("\n"); + sb.append(" enableInternetProviders: ").append(toIndentedString(enableInternetProviders)).append("\n"); + sb.append(" enableAutomaticSeriesGrouping: ").append(toIndentedString(enableAutomaticSeriesGrouping)) + .append("\n"); + sb.append(" enableEmbeddedTitles: ").append(toIndentedString(enableEmbeddedTitles)).append("\n"); + sb.append(" enableEmbeddedExtrasTitles: ").append(toIndentedString(enableEmbeddedExtrasTitles)).append("\n"); + sb.append(" enableEmbeddedEpisodeInfos: ").append(toIndentedString(enableEmbeddedEpisodeInfos)).append("\n"); + sb.append(" automaticRefreshIntervalDays: ").append(toIndentedString(automaticRefreshIntervalDays)) + .append("\n"); + sb.append(" preferredMetadataLanguage: ").append(toIndentedString(preferredMetadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" seasonZeroDisplayName: ").append(toIndentedString(seasonZeroDisplayName)).append("\n"); + sb.append(" metadataSavers: ").append(toIndentedString(metadataSavers)).append("\n"); + sb.append(" disabledLocalMetadataReaders: ").append(toIndentedString(disabledLocalMetadataReaders)) + .append("\n"); + sb.append(" localMetadataReaderOrder: ").append(toIndentedString(localMetadataReaderOrder)).append("\n"); + sb.append(" disabledSubtitleFetchers: ").append(toIndentedString(disabledSubtitleFetchers)).append("\n"); + sb.append(" subtitleFetcherOrder: ").append(toIndentedString(subtitleFetcherOrder)).append("\n"); + sb.append(" disabledMediaSegmentProviders: ").append(toIndentedString(disabledMediaSegmentProviders)) + .append("\n"); + sb.append(" mediaSegmentProvideOrder: ").append(toIndentedString(mediaSegmentProvideOrder)).append("\n"); + sb.append(" skipSubtitlesIfEmbeddedSubtitlesPresent: ") + .append(toIndentedString(skipSubtitlesIfEmbeddedSubtitlesPresent)).append("\n"); + sb.append(" skipSubtitlesIfAudioTrackMatches: ").append(toIndentedString(skipSubtitlesIfAudioTrackMatches)) + .append("\n"); + sb.append(" subtitleDownloadLanguages: ").append(toIndentedString(subtitleDownloadLanguages)).append("\n"); + sb.append(" requirePerfectSubtitleMatch: ").append(toIndentedString(requirePerfectSubtitleMatch)) + .append("\n"); + sb.append(" saveSubtitlesWithMedia: ").append(toIndentedString(saveSubtitlesWithMedia)).append("\n"); + sb.append(" saveLyricsWithMedia: ").append(toIndentedString(saveLyricsWithMedia)).append("\n"); + sb.append(" saveTrickplayWithMedia: ").append(toIndentedString(saveTrickplayWithMedia)).append("\n"); + sb.append(" disabledLyricFetchers: ").append(toIndentedString(disabledLyricFetchers)).append("\n"); + sb.append(" lyricFetcherOrder: ").append(toIndentedString(lyricFetcherOrder)).append("\n"); + sb.append(" preferNonstandardArtistsTag: ").append(toIndentedString(preferNonstandardArtistsTag)) + .append("\n"); + sb.append(" useCustomTagDelimiters: ").append(toIndentedString(useCustomTagDelimiters)).append("\n"); + sb.append(" customTagDelimiters: ").append(toIndentedString(customTagDelimiters)).append("\n"); + sb.append(" delimiterWhitelist: ").append(toIndentedString(delimiterWhitelist)).append("\n"); + sb.append(" automaticallyAddToCollection: ").append(toIndentedString(automaticallyAddToCollection)) + .append("\n"); + sb.append(" allowEmbeddedSubtitles: ").append(toIndentedString(allowEmbeddedSubtitles)).append("\n"); + sb.append(" typeOptions: ").append(toIndentedString(typeOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Enabled` to the URL query string + if (getEnabled() != null) { + joiner.add(String.format("%sEnabled%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnabled())))); + } + + // add `EnablePhotos` to the URL query string + if (getEnablePhotos() != null) { + joiner.add(String.format("%sEnablePhotos%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnablePhotos())))); + } + + // add `EnableRealtimeMonitor` to the URL query string + if (getEnableRealtimeMonitor() != null) { + joiner.add(String.format("%sEnableRealtimeMonitor%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableRealtimeMonitor())))); + } + + // add `EnableLUFSScan` to the URL query string + if (getEnableLUFSScan() != null) { + joiner.add(String.format("%sEnableLUFSScan%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableLUFSScan())))); + } + + // add `EnableChapterImageExtraction` to the URL query string + if (getEnableChapterImageExtraction() != null) { + joiner.add(String.format("%sEnableChapterImageExtraction%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableChapterImageExtraction())))); + } + + // add `ExtractChapterImagesDuringLibraryScan` to the URL query string + if (getExtractChapterImagesDuringLibraryScan() != null) { + joiner.add(String.format("%sExtractChapterImagesDuringLibraryScan%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExtractChapterImagesDuringLibraryScan())))); + } + + // add `EnableTrickplayImageExtraction` to the URL query string + if (getEnableTrickplayImageExtraction() != null) { + joiner.add(String.format("%sEnableTrickplayImageExtraction%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableTrickplayImageExtraction())))); + } + + // add `ExtractTrickplayImagesDuringLibraryScan` to the URL query string + if (getExtractTrickplayImagesDuringLibraryScan() != null) { + joiner.add(String.format("%sExtractTrickplayImagesDuringLibraryScan%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExtractTrickplayImagesDuringLibraryScan())))); + } + + // add `PathInfos` to the URL query string + if (getPathInfos() != null) { + for (int i = 0; i < getPathInfos().size(); i++) { + if (getPathInfos().get(i) != null) { + joiner.add(getPathInfos().get(i).toUrlQueryString(String.format("%sPathInfos%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `SaveLocalMetadata` to the URL query string + if (getSaveLocalMetadata() != null) { + joiner.add(String.format("%sSaveLocalMetadata%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSaveLocalMetadata())))); + } + + // add `EnableInternetProviders` to the URL query string + if (getEnableInternetProviders() != null) { + joiner.add(String.format("%sEnableInternetProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableInternetProviders())))); + } + + // add `EnableAutomaticSeriesGrouping` to the URL query string + if (getEnableAutomaticSeriesGrouping() != null) { + joiner.add(String.format("%sEnableAutomaticSeriesGrouping%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAutomaticSeriesGrouping())))); + } + + // add `EnableEmbeddedTitles` to the URL query string + if (getEnableEmbeddedTitles() != null) { + joiner.add(String.format("%sEnableEmbeddedTitles%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableEmbeddedTitles())))); + } + + // add `EnableEmbeddedExtrasTitles` to the URL query string + if (getEnableEmbeddedExtrasTitles() != null) { + joiner.add(String.format("%sEnableEmbeddedExtrasTitles%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableEmbeddedExtrasTitles())))); + } + + // add `EnableEmbeddedEpisodeInfos` to the URL query string + if (getEnableEmbeddedEpisodeInfos() != null) { + joiner.add(String.format("%sEnableEmbeddedEpisodeInfos%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableEmbeddedEpisodeInfos())))); + } + + // add `AutomaticRefreshIntervalDays` to the URL query string + if (getAutomaticRefreshIntervalDays() != null) { + joiner.add(String.format("%sAutomaticRefreshIntervalDays%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAutomaticRefreshIntervalDays())))); + } + + // add `PreferredMetadataLanguage` to the URL query string + if (getPreferredMetadataLanguage() != null) { + joiner.add(String.format("%sPreferredMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreferredMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `SeasonZeroDisplayName` to the URL query string + if (getSeasonZeroDisplayName() != null) { + joiner.add(String.format("%sSeasonZeroDisplayName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeasonZeroDisplayName())))); + } + + // add `MetadataSavers` to the URL query string + if (getMetadataSavers() != null) { + for (int i = 0; i < getMetadataSavers().size(); i++) { + joiner.add(String.format("%sMetadataSavers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMetadataSavers().get(i))))); + } + } + + // add `DisabledLocalMetadataReaders` to the URL query string + if (getDisabledLocalMetadataReaders() != null) { + for (int i = 0; i < getDisabledLocalMetadataReaders().size(); i++) { + joiner.add(String.format("%sDisabledLocalMetadataReaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDisabledLocalMetadataReaders().get(i))))); + } + } + + // add `LocalMetadataReaderOrder` to the URL query string + if (getLocalMetadataReaderOrder() != null) { + for (int i = 0; i < getLocalMetadataReaderOrder().size(); i++) { + joiner.add(String.format("%sLocalMetadataReaderOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLocalMetadataReaderOrder().get(i))))); + } + } + + // add `DisabledSubtitleFetchers` to the URL query string + if (getDisabledSubtitleFetchers() != null) { + for (int i = 0; i < getDisabledSubtitleFetchers().size(); i++) { + joiner.add(String.format("%sDisabledSubtitleFetchers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDisabledSubtitleFetchers().get(i))))); + } + } + + // add `SubtitleFetcherOrder` to the URL query string + if (getSubtitleFetcherOrder() != null) { + for (int i = 0; i < getSubtitleFetcherOrder().size(); i++) { + joiner.add(String.format("%sSubtitleFetcherOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleFetcherOrder().get(i))))); + } + } + + // add `DisabledMediaSegmentProviders` to the URL query string + if (getDisabledMediaSegmentProviders() != null) { + for (int i = 0; i < getDisabledMediaSegmentProviders().size(); i++) { + joiner.add(String.format("%sDisabledMediaSegmentProviders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDisabledMediaSegmentProviders().get(i))))); + } + } + + // add `MediaSegmentProvideOrder` to the URL query string + if (getMediaSegmentProvideOrder() != null) { + for (int i = 0; i < getMediaSegmentProvideOrder().size(); i++) { + joiner.add(String.format("%sMediaSegmentProvideOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMediaSegmentProvideOrder().get(i))))); + } + } + + // add `SkipSubtitlesIfEmbeddedSubtitlesPresent` to the URL query string + if (getSkipSubtitlesIfEmbeddedSubtitlesPresent() != null) { + joiner.add(String.format("%sSkipSubtitlesIfEmbeddedSubtitlesPresent%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSkipSubtitlesIfEmbeddedSubtitlesPresent())))); + } + + // add `SkipSubtitlesIfAudioTrackMatches` to the URL query string + if (getSkipSubtitlesIfAudioTrackMatches() != null) { + joiner.add(String.format("%sSkipSubtitlesIfAudioTrackMatches%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSkipSubtitlesIfAudioTrackMatches())))); + } + + // add `SubtitleDownloadLanguages` to the URL query string + if (getSubtitleDownloadLanguages() != null) { + for (int i = 0; i < getSubtitleDownloadLanguages().size(); i++) { + joiner.add(String.format("%sSubtitleDownloadLanguages%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleDownloadLanguages().get(i))))); + } + } + + // add `RequirePerfectSubtitleMatch` to the URL query string + if (getRequirePerfectSubtitleMatch() != null) { + joiner.add(String.format("%sRequirePerfectSubtitleMatch%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRequirePerfectSubtitleMatch())))); + } + + // add `SaveSubtitlesWithMedia` to the URL query string + if (getSaveSubtitlesWithMedia() != null) { + joiner.add(String.format("%sSaveSubtitlesWithMedia%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSaveSubtitlesWithMedia())))); + } + + // add `SaveLyricsWithMedia` to the URL query string + if (getSaveLyricsWithMedia() != null) { + joiner.add(String.format("%sSaveLyricsWithMedia%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSaveLyricsWithMedia())))); + } + + // add `SaveTrickplayWithMedia` to the URL query string + if (getSaveTrickplayWithMedia() != null) { + joiner.add(String.format("%sSaveTrickplayWithMedia%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSaveTrickplayWithMedia())))); + } + + // add `DisabledLyricFetchers` to the URL query string + if (getDisabledLyricFetchers() != null) { + for (int i = 0; i < getDisabledLyricFetchers().size(); i++) { + joiner.add(String.format("%sDisabledLyricFetchers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDisabledLyricFetchers().get(i))))); + } + } + + // add `LyricFetcherOrder` to the URL query string + if (getLyricFetcherOrder() != null) { + for (int i = 0; i < getLyricFetcherOrder().size(); i++) { + joiner.add(String.format("%sLyricFetcherOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLyricFetcherOrder().get(i))))); + } + } + + // add `PreferNonstandardArtistsTag` to the URL query string + if (getPreferNonstandardArtistsTag() != null) { + joiner.add(String.format("%sPreferNonstandardArtistsTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreferNonstandardArtistsTag())))); + } + + // add `UseCustomTagDelimiters` to the URL query string + if (getUseCustomTagDelimiters() != null) { + joiner.add(String.format("%sUseCustomTagDelimiters%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUseCustomTagDelimiters())))); + } + + // add `CustomTagDelimiters` to the URL query string + if (getCustomTagDelimiters() != null) { + for (int i = 0; i < getCustomTagDelimiters().size(); i++) { + joiner.add(String.format("%sCustomTagDelimiters%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getCustomTagDelimiters().get(i))))); + } + } + + // add `DelimiterWhitelist` to the URL query string + if (getDelimiterWhitelist() != null) { + for (int i = 0; i < getDelimiterWhitelist().size(); i++) { + joiner.add(String.format("%sDelimiterWhitelist%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDelimiterWhitelist().get(i))))); + } + } + + // add `AutomaticallyAddToCollection` to the URL query string + if (getAutomaticallyAddToCollection() != null) { + joiner.add(String.format("%sAutomaticallyAddToCollection%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAutomaticallyAddToCollection())))); + } + + // add `AllowEmbeddedSubtitles` to the URL query string + if (getAllowEmbeddedSubtitles() != null) { + joiner.add(String.format("%sAllowEmbeddedSubtitles%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAllowEmbeddedSubtitles())))); + } + + // add `TypeOptions` to the URL query string + if (getTypeOptions() != null) { + for (int i = 0; i < getTypeOptions().size(); i++) { + if (getTypeOptions().get(i) != null) { + joiner.add(getTypeOptions().get(i).toUrlQueryString(String.format("%sTypeOptions%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private LibraryOptions instance; + + public Builder() { + this(new LibraryOptions()); + } + + protected Builder(LibraryOptions instance) { + this.instance = instance; + } + + public LibraryOptions.Builder enabled(Boolean enabled) { + this.instance.enabled = enabled; + return this; + } + + public LibraryOptions.Builder enablePhotos(Boolean enablePhotos) { + this.instance.enablePhotos = enablePhotos; + return this; + } + + public LibraryOptions.Builder enableRealtimeMonitor(Boolean enableRealtimeMonitor) { + this.instance.enableRealtimeMonitor = enableRealtimeMonitor; + return this; + } + + public LibraryOptions.Builder enableLUFSScan(Boolean enableLUFSScan) { + this.instance.enableLUFSScan = enableLUFSScan; + return this; + } + + public LibraryOptions.Builder enableChapterImageExtraction(Boolean enableChapterImageExtraction) { + this.instance.enableChapterImageExtraction = enableChapterImageExtraction; + return this; + } + + public LibraryOptions.Builder extractChapterImagesDuringLibraryScan( + Boolean extractChapterImagesDuringLibraryScan) { + this.instance.extractChapterImagesDuringLibraryScan = extractChapterImagesDuringLibraryScan; + return this; + } + + public LibraryOptions.Builder enableTrickplayImageExtraction(Boolean enableTrickplayImageExtraction) { + this.instance.enableTrickplayImageExtraction = enableTrickplayImageExtraction; + return this; + } + + public LibraryOptions.Builder extractTrickplayImagesDuringLibraryScan( + Boolean extractTrickplayImagesDuringLibraryScan) { + this.instance.extractTrickplayImagesDuringLibraryScan = extractTrickplayImagesDuringLibraryScan; + return this; + } + + public LibraryOptions.Builder pathInfos(List pathInfos) { + this.instance.pathInfos = pathInfos; + return this; + } + + public LibraryOptions.Builder saveLocalMetadata(Boolean saveLocalMetadata) { + this.instance.saveLocalMetadata = saveLocalMetadata; + return this; + } + + public LibraryOptions.Builder enableInternetProviders(Boolean enableInternetProviders) { + this.instance.enableInternetProviders = enableInternetProviders; + return this; + } + + public LibraryOptions.Builder enableAutomaticSeriesGrouping(Boolean enableAutomaticSeriesGrouping) { + this.instance.enableAutomaticSeriesGrouping = enableAutomaticSeriesGrouping; + return this; + } + + public LibraryOptions.Builder enableEmbeddedTitles(Boolean enableEmbeddedTitles) { + this.instance.enableEmbeddedTitles = enableEmbeddedTitles; + return this; + } + + public LibraryOptions.Builder enableEmbeddedExtrasTitles(Boolean enableEmbeddedExtrasTitles) { + this.instance.enableEmbeddedExtrasTitles = enableEmbeddedExtrasTitles; + return this; + } + + public LibraryOptions.Builder enableEmbeddedEpisodeInfos(Boolean enableEmbeddedEpisodeInfos) { + this.instance.enableEmbeddedEpisodeInfos = enableEmbeddedEpisodeInfos; + return this; + } + + public LibraryOptions.Builder automaticRefreshIntervalDays(Integer automaticRefreshIntervalDays) { + this.instance.automaticRefreshIntervalDays = automaticRefreshIntervalDays; + return this; + } + + public LibraryOptions.Builder preferredMetadataLanguage(String preferredMetadataLanguage) { + this.instance.preferredMetadataLanguage = preferredMetadataLanguage; + return this; + } + + public LibraryOptions.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public LibraryOptions.Builder seasonZeroDisplayName(String seasonZeroDisplayName) { + this.instance.seasonZeroDisplayName = seasonZeroDisplayName; + return this; + } + + public LibraryOptions.Builder metadataSavers(List metadataSavers) { + this.instance.metadataSavers = metadataSavers; + return this; + } + + public LibraryOptions.Builder disabledLocalMetadataReaders(List disabledLocalMetadataReaders) { + this.instance.disabledLocalMetadataReaders = disabledLocalMetadataReaders; + return this; + } + + public LibraryOptions.Builder localMetadataReaderOrder(List localMetadataReaderOrder) { + this.instance.localMetadataReaderOrder = localMetadataReaderOrder; + return this; + } + + public LibraryOptions.Builder disabledSubtitleFetchers(List disabledSubtitleFetchers) { + this.instance.disabledSubtitleFetchers = disabledSubtitleFetchers; + return this; + } + + public LibraryOptions.Builder subtitleFetcherOrder(List subtitleFetcherOrder) { + this.instance.subtitleFetcherOrder = subtitleFetcherOrder; + return this; + } + + public LibraryOptions.Builder disabledMediaSegmentProviders(List disabledMediaSegmentProviders) { + this.instance.disabledMediaSegmentProviders = disabledMediaSegmentProviders; + return this; + } + + public LibraryOptions.Builder mediaSegmentProvideOrder(List mediaSegmentProvideOrder) { + this.instance.mediaSegmentProvideOrder = mediaSegmentProvideOrder; + return this; + } + + public LibraryOptions.Builder skipSubtitlesIfEmbeddedSubtitlesPresent( + Boolean skipSubtitlesIfEmbeddedSubtitlesPresent) { + this.instance.skipSubtitlesIfEmbeddedSubtitlesPresent = skipSubtitlesIfEmbeddedSubtitlesPresent; + return this; + } + + public LibraryOptions.Builder skipSubtitlesIfAudioTrackMatches(Boolean skipSubtitlesIfAudioTrackMatches) { + this.instance.skipSubtitlesIfAudioTrackMatches = skipSubtitlesIfAudioTrackMatches; + return this; + } + + public LibraryOptions.Builder subtitleDownloadLanguages(List subtitleDownloadLanguages) { + this.instance.subtitleDownloadLanguages = subtitleDownloadLanguages; + return this; + } + + public LibraryOptions.Builder requirePerfectSubtitleMatch(Boolean requirePerfectSubtitleMatch) { + this.instance.requirePerfectSubtitleMatch = requirePerfectSubtitleMatch; + return this; + } + + public LibraryOptions.Builder saveSubtitlesWithMedia(Boolean saveSubtitlesWithMedia) { + this.instance.saveSubtitlesWithMedia = saveSubtitlesWithMedia; + return this; + } + + public LibraryOptions.Builder saveLyricsWithMedia(Boolean saveLyricsWithMedia) { + this.instance.saveLyricsWithMedia = saveLyricsWithMedia; + return this; + } + + public LibraryOptions.Builder saveTrickplayWithMedia(Boolean saveTrickplayWithMedia) { + this.instance.saveTrickplayWithMedia = saveTrickplayWithMedia; + return this; + } + + public LibraryOptions.Builder disabledLyricFetchers(List disabledLyricFetchers) { + this.instance.disabledLyricFetchers = disabledLyricFetchers; + return this; + } + + public LibraryOptions.Builder lyricFetcherOrder(List lyricFetcherOrder) { + this.instance.lyricFetcherOrder = lyricFetcherOrder; + return this; + } + + public LibraryOptions.Builder preferNonstandardArtistsTag(Boolean preferNonstandardArtistsTag) { + this.instance.preferNonstandardArtistsTag = preferNonstandardArtistsTag; + return this; + } + + public LibraryOptions.Builder useCustomTagDelimiters(Boolean useCustomTagDelimiters) { + this.instance.useCustomTagDelimiters = useCustomTagDelimiters; + return this; + } + + public LibraryOptions.Builder customTagDelimiters(List customTagDelimiters) { + this.instance.customTagDelimiters = customTagDelimiters; + return this; + } + + public LibraryOptions.Builder delimiterWhitelist(List delimiterWhitelist) { + this.instance.delimiterWhitelist = delimiterWhitelist; + return this; + } + + public LibraryOptions.Builder automaticallyAddToCollection(Boolean automaticallyAddToCollection) { + this.instance.automaticallyAddToCollection = automaticallyAddToCollection; + return this; + } + + public LibraryOptions.Builder allowEmbeddedSubtitles(EmbeddedSubtitleOptions allowEmbeddedSubtitles) { + this.instance.allowEmbeddedSubtitles = allowEmbeddedSubtitles; + return this; + } + + public LibraryOptions.Builder typeOptions(List typeOptions) { + this.instance.typeOptions = typeOptions; + return this; + } + + /** + * returns a built LibraryOptions instance. + * + * The builder is not reusable. + */ + public LibraryOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LibraryOptions.Builder builder() { + return new LibraryOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LibraryOptions.Builder toBuilder() { + return new LibraryOptions.Builder().enabled(getEnabled()).enablePhotos(getEnablePhotos()) + .enableRealtimeMonitor(getEnableRealtimeMonitor()).enableLUFSScan(getEnableLUFSScan()) + .enableChapterImageExtraction(getEnableChapterImageExtraction()) + .extractChapterImagesDuringLibraryScan(getExtractChapterImagesDuringLibraryScan()) + .enableTrickplayImageExtraction(getEnableTrickplayImageExtraction()) + .extractTrickplayImagesDuringLibraryScan(getExtractTrickplayImagesDuringLibraryScan()) + .pathInfos(getPathInfos()).saveLocalMetadata(getSaveLocalMetadata()) + .enableInternetProviders(getEnableInternetProviders()) + .enableAutomaticSeriesGrouping(getEnableAutomaticSeriesGrouping()) + .enableEmbeddedTitles(getEnableEmbeddedTitles()) + .enableEmbeddedExtrasTitles(getEnableEmbeddedExtrasTitles()) + .enableEmbeddedEpisodeInfos(getEnableEmbeddedEpisodeInfos()) + .automaticRefreshIntervalDays(getAutomaticRefreshIntervalDays()) + .preferredMetadataLanguage(getPreferredMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .seasonZeroDisplayName(getSeasonZeroDisplayName()).metadataSavers(getMetadataSavers()) + .disabledLocalMetadataReaders(getDisabledLocalMetadataReaders()) + .localMetadataReaderOrder(getLocalMetadataReaderOrder()) + .disabledSubtitleFetchers(getDisabledSubtitleFetchers()).subtitleFetcherOrder(getSubtitleFetcherOrder()) + .disabledMediaSegmentProviders(getDisabledMediaSegmentProviders()) + .mediaSegmentProvideOrder(getMediaSegmentProvideOrder()) + .skipSubtitlesIfEmbeddedSubtitlesPresent(getSkipSubtitlesIfEmbeddedSubtitlesPresent()) + .skipSubtitlesIfAudioTrackMatches(getSkipSubtitlesIfAudioTrackMatches()) + .subtitleDownloadLanguages(getSubtitleDownloadLanguages()) + .requirePerfectSubtitleMatch(getRequirePerfectSubtitleMatch()) + .saveSubtitlesWithMedia(getSaveSubtitlesWithMedia()).saveLyricsWithMedia(getSaveLyricsWithMedia()) + .saveTrickplayWithMedia(getSaveTrickplayWithMedia()).disabledLyricFetchers(getDisabledLyricFetchers()) + .lyricFetcherOrder(getLyricFetcherOrder()).preferNonstandardArtistsTag(getPreferNonstandardArtistsTag()) + .useCustomTagDelimiters(getUseCustomTagDelimiters()).customTagDelimiters(getCustomTagDelimiters()) + .delimiterWhitelist(getDelimiterWhitelist()) + .automaticallyAddToCollection(getAutomaticallyAddToCollection()) + .allowEmbeddedSubtitles(getAllowEmbeddedSubtitles()).typeOptions(getTypeOptions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryOptionsResultDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryOptionsResultDto.java new file mode 100644 index 0000000000000..395edaf933c65 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryOptionsResultDto.java @@ -0,0 +1,426 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Library options result dto. + */ +@JsonPropertyOrder({ LibraryOptionsResultDto.JSON_PROPERTY_METADATA_SAVERS, + LibraryOptionsResultDto.JSON_PROPERTY_METADATA_READERS, LibraryOptionsResultDto.JSON_PROPERTY_SUBTITLE_FETCHERS, + LibraryOptionsResultDto.JSON_PROPERTY_LYRIC_FETCHERS, LibraryOptionsResultDto.JSON_PROPERTY_TYPE_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LibraryOptionsResultDto { + public static final String JSON_PROPERTY_METADATA_SAVERS = "MetadataSavers"; + @org.eclipse.jdt.annotation.NonNull + private List metadataSavers = new ArrayList<>(); + + public static final String JSON_PROPERTY_METADATA_READERS = "MetadataReaders"; + @org.eclipse.jdt.annotation.NonNull + private List metadataReaders = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUBTITLE_FETCHERS = "SubtitleFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List subtitleFetchers = new ArrayList<>(); + + public static final String JSON_PROPERTY_LYRIC_FETCHERS = "LyricFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List lyricFetchers = new ArrayList<>(); + + public static final String JSON_PROPERTY_TYPE_OPTIONS = "TypeOptions"; + @org.eclipse.jdt.annotation.NonNull + private List typeOptions = new ArrayList<>(); + + public LibraryOptionsResultDto() { + } + + public LibraryOptionsResultDto metadataSavers( + @org.eclipse.jdt.annotation.NonNull List metadataSavers) { + this.metadataSavers = metadataSavers; + return this; + } + + public LibraryOptionsResultDto addMetadataSaversItem(LibraryOptionInfoDto metadataSaversItem) { + if (this.metadataSavers == null) { + this.metadataSavers = new ArrayList<>(); + } + this.metadataSavers.add(metadataSaversItem); + return this; + } + + /** + * Gets or sets the metadata savers. + * + * @return metadataSavers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_SAVERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMetadataSavers() { + return metadataSavers; + } + + @JsonProperty(JSON_PROPERTY_METADATA_SAVERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataSavers(@org.eclipse.jdt.annotation.NonNull List metadataSavers) { + this.metadataSavers = metadataSavers; + } + + public LibraryOptionsResultDto metadataReaders( + @org.eclipse.jdt.annotation.NonNull List metadataReaders) { + this.metadataReaders = metadataReaders; + return this; + } + + public LibraryOptionsResultDto addMetadataReadersItem(LibraryOptionInfoDto metadataReadersItem) { + if (this.metadataReaders == null) { + this.metadataReaders = new ArrayList<>(); + } + this.metadataReaders.add(metadataReadersItem); + return this; + } + + /** + * Gets or sets the metadata readers. + * + * @return metadataReaders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_READERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMetadataReaders() { + return metadataReaders; + } + + @JsonProperty(JSON_PROPERTY_METADATA_READERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataReaders(@org.eclipse.jdt.annotation.NonNull List metadataReaders) { + this.metadataReaders = metadataReaders; + } + + public LibraryOptionsResultDto subtitleFetchers( + @org.eclipse.jdt.annotation.NonNull List subtitleFetchers) { + this.subtitleFetchers = subtitleFetchers; + return this; + } + + public LibraryOptionsResultDto addSubtitleFetchersItem(LibraryOptionInfoDto subtitleFetchersItem) { + if (this.subtitleFetchers == null) { + this.subtitleFetchers = new ArrayList<>(); + } + this.subtitleFetchers.add(subtitleFetchersItem); + return this; + } + + /** + * Gets or sets the subtitle fetchers. + * + * @return subtitleFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSubtitleFetchers() { + return subtitleFetchers; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleFetchers(@org.eclipse.jdt.annotation.NonNull List subtitleFetchers) { + this.subtitleFetchers = subtitleFetchers; + } + + public LibraryOptionsResultDto lyricFetchers( + @org.eclipse.jdt.annotation.NonNull List lyricFetchers) { + this.lyricFetchers = lyricFetchers; + return this; + } + + public LibraryOptionsResultDto addLyricFetchersItem(LibraryOptionInfoDto lyricFetchersItem) { + if (this.lyricFetchers == null) { + this.lyricFetchers = new ArrayList<>(); + } + this.lyricFetchers.add(lyricFetchersItem); + return this; + } + + /** + * Gets or sets the list of lyric fetchers. + * + * @return lyricFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LYRIC_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLyricFetchers() { + return lyricFetchers; + } + + @JsonProperty(JSON_PROPERTY_LYRIC_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLyricFetchers(@org.eclipse.jdt.annotation.NonNull List lyricFetchers) { + this.lyricFetchers = lyricFetchers; + } + + public LibraryOptionsResultDto typeOptions( + @org.eclipse.jdt.annotation.NonNull List typeOptions) { + this.typeOptions = typeOptions; + return this; + } + + public LibraryOptionsResultDto addTypeOptionsItem(LibraryTypeOptionsDto typeOptionsItem) { + if (this.typeOptions == null) { + this.typeOptions = new ArrayList<>(); + } + this.typeOptions.add(typeOptionsItem); + return this; + } + + /** + * Gets or sets the type options. + * + * @return typeOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTypeOptions() { + return typeOptions; + } + + @JsonProperty(JSON_PROPERTY_TYPE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTypeOptions(@org.eclipse.jdt.annotation.NonNull List typeOptions) { + this.typeOptions = typeOptions; + } + + /** + * Return true if this LibraryOptionsResultDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LibraryOptionsResultDto libraryOptionsResultDto = (LibraryOptionsResultDto) o; + return Objects.equals(this.metadataSavers, libraryOptionsResultDto.metadataSavers) + && Objects.equals(this.metadataReaders, libraryOptionsResultDto.metadataReaders) + && Objects.equals(this.subtitleFetchers, libraryOptionsResultDto.subtitleFetchers) + && Objects.equals(this.lyricFetchers, libraryOptionsResultDto.lyricFetchers) + && Objects.equals(this.typeOptions, libraryOptionsResultDto.typeOptions); + } + + @Override + public int hashCode() { + return Objects.hash(metadataSavers, metadataReaders, subtitleFetchers, lyricFetchers, typeOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LibraryOptionsResultDto {\n"); + sb.append(" metadataSavers: ").append(toIndentedString(metadataSavers)).append("\n"); + sb.append(" metadataReaders: ").append(toIndentedString(metadataReaders)).append("\n"); + sb.append(" subtitleFetchers: ").append(toIndentedString(subtitleFetchers)).append("\n"); + sb.append(" lyricFetchers: ").append(toIndentedString(lyricFetchers)).append("\n"); + sb.append(" typeOptions: ").append(toIndentedString(typeOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MetadataSavers` to the URL query string + if (getMetadataSavers() != null) { + for (int i = 0; i < getMetadataSavers().size(); i++) { + if (getMetadataSavers().get(i) != null) { + joiner.add(getMetadataSavers().get(i).toUrlQueryString(String.format("%sMetadataSavers%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `MetadataReaders` to the URL query string + if (getMetadataReaders() != null) { + for (int i = 0; i < getMetadataReaders().size(); i++) { + if (getMetadataReaders().get(i) != null) { + joiner.add(getMetadataReaders().get(i).toUrlQueryString(String.format("%sMetadataReaders%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `SubtitleFetchers` to the URL query string + if (getSubtitleFetchers() != null) { + for (int i = 0; i < getSubtitleFetchers().size(); i++) { + if (getSubtitleFetchers().get(i) != null) { + joiner.add(getSubtitleFetchers().get(i).toUrlQueryString(String.format("%sSubtitleFetchers%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `LyricFetchers` to the URL query string + if (getLyricFetchers() != null) { + for (int i = 0; i < getLyricFetchers().size(); i++) { + if (getLyricFetchers().get(i) != null) { + joiner.add(getLyricFetchers().get(i).toUrlQueryString(String.format("%sLyricFetchers%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TypeOptions` to the URL query string + if (getTypeOptions() != null) { + for (int i = 0; i < getTypeOptions().size(); i++) { + if (getTypeOptions().get(i) != null) { + joiner.add(getTypeOptions().get(i).toUrlQueryString(String.format("%sTypeOptions%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private LibraryOptionsResultDto instance; + + public Builder() { + this(new LibraryOptionsResultDto()); + } + + protected Builder(LibraryOptionsResultDto instance) { + this.instance = instance; + } + + public LibraryOptionsResultDto.Builder metadataSavers(List metadataSavers) { + this.instance.metadataSavers = metadataSavers; + return this; + } + + public LibraryOptionsResultDto.Builder metadataReaders(List metadataReaders) { + this.instance.metadataReaders = metadataReaders; + return this; + } + + public LibraryOptionsResultDto.Builder subtitleFetchers(List subtitleFetchers) { + this.instance.subtitleFetchers = subtitleFetchers; + return this; + } + + public LibraryOptionsResultDto.Builder lyricFetchers(List lyricFetchers) { + this.instance.lyricFetchers = lyricFetchers; + return this; + } + + public LibraryOptionsResultDto.Builder typeOptions(List typeOptions) { + this.instance.typeOptions = typeOptions; + return this; + } + + /** + * returns a built LibraryOptionsResultDto instance. + * + * The builder is not reusable. + */ + public LibraryOptionsResultDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LibraryOptionsResultDto.Builder builder() { + return new LibraryOptionsResultDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LibraryOptionsResultDto.Builder toBuilder() { + return new LibraryOptionsResultDto.Builder().metadataSavers(getMetadataSavers()) + .metadataReaders(getMetadataReaders()).subtitleFetchers(getSubtitleFetchers()) + .lyricFetchers(getLyricFetchers()).typeOptions(getTypeOptions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryTypeOptionsDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryTypeOptionsDto.java new file mode 100644 index 0000000000000..b5923424a4f58 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryTypeOptionsDto.java @@ -0,0 +1,414 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Library type options dto. + */ +@JsonPropertyOrder({ LibraryTypeOptionsDto.JSON_PROPERTY_TYPE, LibraryTypeOptionsDto.JSON_PROPERTY_METADATA_FETCHERS, + LibraryTypeOptionsDto.JSON_PROPERTY_IMAGE_FETCHERS, LibraryTypeOptionsDto.JSON_PROPERTY_SUPPORTED_IMAGE_TYPES, + LibraryTypeOptionsDto.JSON_PROPERTY_DEFAULT_IMAGE_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LibraryTypeOptionsDto { + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_METADATA_FETCHERS = "MetadataFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List metadataFetchers = new ArrayList<>(); + + public static final String JSON_PROPERTY_IMAGE_FETCHERS = "ImageFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List imageFetchers = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUPPORTED_IMAGE_TYPES = "SupportedImageTypes"; + @org.eclipse.jdt.annotation.NonNull + private List supportedImageTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_DEFAULT_IMAGE_OPTIONS = "DefaultImageOptions"; + @org.eclipse.jdt.annotation.NonNull + private List defaultImageOptions = new ArrayList<>(); + + public LibraryTypeOptionsDto() { + } + + public LibraryTypeOptionsDto type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public LibraryTypeOptionsDto metadataFetchers( + @org.eclipse.jdt.annotation.NonNull List metadataFetchers) { + this.metadataFetchers = metadataFetchers; + return this; + } + + public LibraryTypeOptionsDto addMetadataFetchersItem(LibraryOptionInfoDto metadataFetchersItem) { + if (this.metadataFetchers == null) { + this.metadataFetchers = new ArrayList<>(); + } + this.metadataFetchers.add(metadataFetchersItem); + return this; + } + + /** + * Gets or sets the metadata fetchers. + * + * @return metadataFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMetadataFetchers() { + return metadataFetchers; + } + + @JsonProperty(JSON_PROPERTY_METADATA_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataFetchers(@org.eclipse.jdt.annotation.NonNull List metadataFetchers) { + this.metadataFetchers = metadataFetchers; + } + + public LibraryTypeOptionsDto imageFetchers( + @org.eclipse.jdt.annotation.NonNull List imageFetchers) { + this.imageFetchers = imageFetchers; + return this; + } + + public LibraryTypeOptionsDto addImageFetchersItem(LibraryOptionInfoDto imageFetchersItem) { + if (this.imageFetchers == null) { + this.imageFetchers = new ArrayList<>(); + } + this.imageFetchers.add(imageFetchersItem); + return this; + } + + /** + * Gets or sets the image fetchers. + * + * @return imageFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getImageFetchers() { + return imageFetchers; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageFetchers(@org.eclipse.jdt.annotation.NonNull List imageFetchers) { + this.imageFetchers = imageFetchers; + } + + public LibraryTypeOptionsDto supportedImageTypes( + @org.eclipse.jdt.annotation.NonNull List supportedImageTypes) { + this.supportedImageTypes = supportedImageTypes; + return this; + } + + public LibraryTypeOptionsDto addSupportedImageTypesItem(ImageType supportedImageTypesItem) { + if (this.supportedImageTypes == null) { + this.supportedImageTypes = new ArrayList<>(); + } + this.supportedImageTypes.add(supportedImageTypesItem); + return this; + } + + /** + * Gets or sets the supported image types. + * + * @return supportedImageTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTED_IMAGE_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSupportedImageTypes() { + return supportedImageTypes; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTED_IMAGE_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportedImageTypes(@org.eclipse.jdt.annotation.NonNull List supportedImageTypes) { + this.supportedImageTypes = supportedImageTypes; + } + + public LibraryTypeOptionsDto defaultImageOptions( + @org.eclipse.jdt.annotation.NonNull List defaultImageOptions) { + this.defaultImageOptions = defaultImageOptions; + return this; + } + + public LibraryTypeOptionsDto addDefaultImageOptionsItem(ImageOption defaultImageOptionsItem) { + if (this.defaultImageOptions == null) { + this.defaultImageOptions = new ArrayList<>(); + } + this.defaultImageOptions.add(defaultImageOptionsItem); + return this; + } + + /** + * Gets or sets the default image options. + * + * @return defaultImageOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEFAULT_IMAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDefaultImageOptions() { + return defaultImageOptions; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_IMAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultImageOptions(@org.eclipse.jdt.annotation.NonNull List defaultImageOptions) { + this.defaultImageOptions = defaultImageOptions; + } + + /** + * Return true if this LibraryTypeOptionsDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LibraryTypeOptionsDto libraryTypeOptionsDto = (LibraryTypeOptionsDto) o; + return Objects.equals(this.type, libraryTypeOptionsDto.type) + && Objects.equals(this.metadataFetchers, libraryTypeOptionsDto.metadataFetchers) + && Objects.equals(this.imageFetchers, libraryTypeOptionsDto.imageFetchers) + && Objects.equals(this.supportedImageTypes, libraryTypeOptionsDto.supportedImageTypes) + && Objects.equals(this.defaultImageOptions, libraryTypeOptionsDto.defaultImageOptions); + } + + @Override + public int hashCode() { + return Objects.hash(type, metadataFetchers, imageFetchers, supportedImageTypes, defaultImageOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LibraryTypeOptionsDto {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" metadataFetchers: ").append(toIndentedString(metadataFetchers)).append("\n"); + sb.append(" imageFetchers: ").append(toIndentedString(imageFetchers)).append("\n"); + sb.append(" supportedImageTypes: ").append(toIndentedString(supportedImageTypes)).append("\n"); + sb.append(" defaultImageOptions: ").append(toIndentedString(defaultImageOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `MetadataFetchers` to the URL query string + if (getMetadataFetchers() != null) { + for (int i = 0; i < getMetadataFetchers().size(); i++) { + if (getMetadataFetchers().get(i) != null) { + joiner.add(getMetadataFetchers().get(i).toUrlQueryString(String.format("%sMetadataFetchers%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ImageFetchers` to the URL query string + if (getImageFetchers() != null) { + for (int i = 0; i < getImageFetchers().size(); i++) { + if (getImageFetchers().get(i) != null) { + joiner.add(getImageFetchers().get(i).toUrlQueryString(String.format("%sImageFetchers%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `SupportedImageTypes` to the URL query string + if (getSupportedImageTypes() != null) { + for (int i = 0; i < getSupportedImageTypes().size(); i++) { + if (getSupportedImageTypes().get(i) != null) { + joiner.add(String.format("%sSupportedImageTypes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSupportedImageTypes().get(i))))); + } + } + } + + // add `DefaultImageOptions` to the URL query string + if (getDefaultImageOptions() != null) { + for (int i = 0; i < getDefaultImageOptions().size(); i++) { + if (getDefaultImageOptions().get(i) != null) { + joiner.add(getDefaultImageOptions().get(i).toUrlQueryString(String.format( + "%sDefaultImageOptions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private LibraryTypeOptionsDto instance; + + public Builder() { + this(new LibraryTypeOptionsDto()); + } + + protected Builder(LibraryTypeOptionsDto instance) { + this.instance = instance; + } + + public LibraryTypeOptionsDto.Builder type(String type) { + this.instance.type = type; + return this; + } + + public LibraryTypeOptionsDto.Builder metadataFetchers(List metadataFetchers) { + this.instance.metadataFetchers = metadataFetchers; + return this; + } + + public LibraryTypeOptionsDto.Builder imageFetchers(List imageFetchers) { + this.instance.imageFetchers = imageFetchers; + return this; + } + + public LibraryTypeOptionsDto.Builder supportedImageTypes(List supportedImageTypes) { + this.instance.supportedImageTypes = supportedImageTypes; + return this; + } + + public LibraryTypeOptionsDto.Builder defaultImageOptions(List defaultImageOptions) { + this.instance.defaultImageOptions = defaultImageOptions; + return this; + } + + /** + * returns a built LibraryTypeOptionsDto instance. + * + * The builder is not reusable. + */ + public LibraryTypeOptionsDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LibraryTypeOptionsDto.Builder builder() { + return new LibraryTypeOptionsDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LibraryTypeOptionsDto.Builder toBuilder() { + return new LibraryTypeOptionsDto.Builder().type(getType()).metadataFetchers(getMetadataFetchers()) + .imageFetchers(getImageFetchers()).supportedImageTypes(getSupportedImageTypes()) + .defaultImageOptions(getDefaultImageOptions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryUpdateInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryUpdateInfo.java new file mode 100644 index 0000000000000..bed5f33f3ac15 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LibraryUpdateInfo.java @@ -0,0 +1,502 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class LibraryUpdateInfo. + */ +@JsonPropertyOrder({ LibraryUpdateInfo.JSON_PROPERTY_FOLDERS_ADDED_TO, + LibraryUpdateInfo.JSON_PROPERTY_FOLDERS_REMOVED_FROM, LibraryUpdateInfo.JSON_PROPERTY_ITEMS_ADDED, + LibraryUpdateInfo.JSON_PROPERTY_ITEMS_REMOVED, LibraryUpdateInfo.JSON_PROPERTY_ITEMS_UPDATED, + LibraryUpdateInfo.JSON_PROPERTY_COLLECTION_FOLDERS, LibraryUpdateInfo.JSON_PROPERTY_IS_EMPTY }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LibraryUpdateInfo { + public static final String JSON_PROPERTY_FOLDERS_ADDED_TO = "FoldersAddedTo"; + @org.eclipse.jdt.annotation.NonNull + private List foldersAddedTo = new ArrayList<>(); + + public static final String JSON_PROPERTY_FOLDERS_REMOVED_FROM = "FoldersRemovedFrom"; + @org.eclipse.jdt.annotation.NonNull + private List foldersRemovedFrom = new ArrayList<>(); + + public static final String JSON_PROPERTY_ITEMS_ADDED = "ItemsAdded"; + @org.eclipse.jdt.annotation.NonNull + private List itemsAdded = new ArrayList<>(); + + public static final String JSON_PROPERTY_ITEMS_REMOVED = "ItemsRemoved"; + @org.eclipse.jdt.annotation.NonNull + private List itemsRemoved = new ArrayList<>(); + + public static final String JSON_PROPERTY_ITEMS_UPDATED = "ItemsUpdated"; + @org.eclipse.jdt.annotation.NonNull + private List itemsUpdated = new ArrayList<>(); + + public static final String JSON_PROPERTY_COLLECTION_FOLDERS = "CollectionFolders"; + @org.eclipse.jdt.annotation.NonNull + private List collectionFolders = new ArrayList<>(); + + public static final String JSON_PROPERTY_IS_EMPTY = "IsEmpty"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isEmpty; + + public LibraryUpdateInfo() { + } + + @JsonCreator + public LibraryUpdateInfo(@JsonProperty(JSON_PROPERTY_IS_EMPTY) Boolean isEmpty) { + this(); + this.isEmpty = isEmpty; + } + + public LibraryUpdateInfo foldersAddedTo(@org.eclipse.jdt.annotation.NonNull List foldersAddedTo) { + this.foldersAddedTo = foldersAddedTo; + return this; + } + + public LibraryUpdateInfo addFoldersAddedToItem(String foldersAddedToItem) { + if (this.foldersAddedTo == null) { + this.foldersAddedTo = new ArrayList<>(); + } + this.foldersAddedTo.add(foldersAddedToItem); + return this; + } + + /** + * Gets or sets the folders added to. + * + * @return foldersAddedTo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FOLDERS_ADDED_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFoldersAddedTo() { + return foldersAddedTo; + } + + @JsonProperty(JSON_PROPERTY_FOLDERS_ADDED_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFoldersAddedTo(@org.eclipse.jdt.annotation.NonNull List foldersAddedTo) { + this.foldersAddedTo = foldersAddedTo; + } + + public LibraryUpdateInfo foldersRemovedFrom(@org.eclipse.jdt.annotation.NonNull List foldersRemovedFrom) { + this.foldersRemovedFrom = foldersRemovedFrom; + return this; + } + + public LibraryUpdateInfo addFoldersRemovedFromItem(String foldersRemovedFromItem) { + if (this.foldersRemovedFrom == null) { + this.foldersRemovedFrom = new ArrayList<>(); + } + this.foldersRemovedFrom.add(foldersRemovedFromItem); + return this; + } + + /** + * Gets or sets the folders removed from. + * + * @return foldersRemovedFrom + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FOLDERS_REMOVED_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFoldersRemovedFrom() { + return foldersRemovedFrom; + } + + @JsonProperty(JSON_PROPERTY_FOLDERS_REMOVED_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFoldersRemovedFrom(@org.eclipse.jdt.annotation.NonNull List foldersRemovedFrom) { + this.foldersRemovedFrom = foldersRemovedFrom; + } + + public LibraryUpdateInfo itemsAdded(@org.eclipse.jdt.annotation.NonNull List itemsAdded) { + this.itemsAdded = itemsAdded; + return this; + } + + public LibraryUpdateInfo addItemsAddedItem(String itemsAddedItem) { + if (this.itemsAdded == null) { + this.itemsAdded = new ArrayList<>(); + } + this.itemsAdded.add(itemsAddedItem); + return this; + } + + /** + * Gets or sets the items added. + * + * @return itemsAdded + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS_ADDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItemsAdded() { + return itemsAdded; + } + + @JsonProperty(JSON_PROPERTY_ITEMS_ADDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemsAdded(@org.eclipse.jdt.annotation.NonNull List itemsAdded) { + this.itemsAdded = itemsAdded; + } + + public LibraryUpdateInfo itemsRemoved(@org.eclipse.jdt.annotation.NonNull List itemsRemoved) { + this.itemsRemoved = itemsRemoved; + return this; + } + + public LibraryUpdateInfo addItemsRemovedItem(String itemsRemovedItem) { + if (this.itemsRemoved == null) { + this.itemsRemoved = new ArrayList<>(); + } + this.itemsRemoved.add(itemsRemovedItem); + return this; + } + + /** + * Gets or sets the items removed. + * + * @return itemsRemoved + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS_REMOVED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItemsRemoved() { + return itemsRemoved; + } + + @JsonProperty(JSON_PROPERTY_ITEMS_REMOVED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemsRemoved(@org.eclipse.jdt.annotation.NonNull List itemsRemoved) { + this.itemsRemoved = itemsRemoved; + } + + public LibraryUpdateInfo itemsUpdated(@org.eclipse.jdt.annotation.NonNull List itemsUpdated) { + this.itemsUpdated = itemsUpdated; + return this; + } + + public LibraryUpdateInfo addItemsUpdatedItem(String itemsUpdatedItem) { + if (this.itemsUpdated == null) { + this.itemsUpdated = new ArrayList<>(); + } + this.itemsUpdated.add(itemsUpdatedItem); + return this; + } + + /** + * Gets or sets the items updated. + * + * @return itemsUpdated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS_UPDATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItemsUpdated() { + return itemsUpdated; + } + + @JsonProperty(JSON_PROPERTY_ITEMS_UPDATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemsUpdated(@org.eclipse.jdt.annotation.NonNull List itemsUpdated) { + this.itemsUpdated = itemsUpdated; + } + + public LibraryUpdateInfo collectionFolders(@org.eclipse.jdt.annotation.NonNull List collectionFolders) { + this.collectionFolders = collectionFolders; + return this; + } + + public LibraryUpdateInfo addCollectionFoldersItem(String collectionFoldersItem) { + if (this.collectionFolders == null) { + this.collectionFolders = new ArrayList<>(); + } + this.collectionFolders.add(collectionFoldersItem); + return this; + } + + /** + * Get collectionFolders + * + * @return collectionFolders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COLLECTION_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCollectionFolders() { + return collectionFolders; + } + + @JsonProperty(JSON_PROPERTY_COLLECTION_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCollectionFolders(@org.eclipse.jdt.annotation.NonNull List collectionFolders) { + this.collectionFolders = collectionFolders; + } + + /** + * Get isEmpty + * + * @return isEmpty + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_EMPTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsEmpty() { + return isEmpty; + } + + /** + * Return true if this LibraryUpdateInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LibraryUpdateInfo libraryUpdateInfo = (LibraryUpdateInfo) o; + return Objects.equals(this.foldersAddedTo, libraryUpdateInfo.foldersAddedTo) + && Objects.equals(this.foldersRemovedFrom, libraryUpdateInfo.foldersRemovedFrom) + && Objects.equals(this.itemsAdded, libraryUpdateInfo.itemsAdded) + && Objects.equals(this.itemsRemoved, libraryUpdateInfo.itemsRemoved) + && Objects.equals(this.itemsUpdated, libraryUpdateInfo.itemsUpdated) + && Objects.equals(this.collectionFolders, libraryUpdateInfo.collectionFolders) + && Objects.equals(this.isEmpty, libraryUpdateInfo.isEmpty); + } + + @Override + public int hashCode() { + return Objects.hash(foldersAddedTo, foldersRemovedFrom, itemsAdded, itemsRemoved, itemsUpdated, + collectionFolders, isEmpty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LibraryUpdateInfo {\n"); + sb.append(" foldersAddedTo: ").append(toIndentedString(foldersAddedTo)).append("\n"); + sb.append(" foldersRemovedFrom: ").append(toIndentedString(foldersRemovedFrom)).append("\n"); + sb.append(" itemsAdded: ").append(toIndentedString(itemsAdded)).append("\n"); + sb.append(" itemsRemoved: ").append(toIndentedString(itemsRemoved)).append("\n"); + sb.append(" itemsUpdated: ").append(toIndentedString(itemsUpdated)).append("\n"); + sb.append(" collectionFolders: ").append(toIndentedString(collectionFolders)).append("\n"); + sb.append(" isEmpty: ").append(toIndentedString(isEmpty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `FoldersAddedTo` to the URL query string + if (getFoldersAddedTo() != null) { + for (int i = 0; i < getFoldersAddedTo().size(); i++) { + joiner.add(String.format("%sFoldersAddedTo%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getFoldersAddedTo().get(i))))); + } + } + + // add `FoldersRemovedFrom` to the URL query string + if (getFoldersRemovedFrom() != null) { + for (int i = 0; i < getFoldersRemovedFrom().size(); i++) { + joiner.add(String.format("%sFoldersRemovedFrom%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getFoldersRemovedFrom().get(i))))); + } + } + + // add `ItemsAdded` to the URL query string + if (getItemsAdded() != null) { + for (int i = 0; i < getItemsAdded().size(); i++) { + joiner.add(String.format("%sItemsAdded%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getItemsAdded().get(i))))); + } + } + + // add `ItemsRemoved` to the URL query string + if (getItemsRemoved() != null) { + for (int i = 0; i < getItemsRemoved().size(); i++) { + joiner.add(String.format("%sItemsRemoved%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getItemsRemoved().get(i))))); + } + } + + // add `ItemsUpdated` to the URL query string + if (getItemsUpdated() != null) { + for (int i = 0; i < getItemsUpdated().size(); i++) { + joiner.add(String.format("%sItemsUpdated%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getItemsUpdated().get(i))))); + } + } + + // add `CollectionFolders` to the URL query string + if (getCollectionFolders() != null) { + for (int i = 0; i < getCollectionFolders().size(); i++) { + joiner.add(String.format("%sCollectionFolders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getCollectionFolders().get(i))))); + } + } + + // add `IsEmpty` to the URL query string + if (getIsEmpty() != null) { + joiner.add(String.format("%sIsEmpty%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsEmpty())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private LibraryUpdateInfo instance; + + public Builder() { + this(new LibraryUpdateInfo()); + } + + protected Builder(LibraryUpdateInfo instance) { + this.instance = instance; + } + + public LibraryUpdateInfo.Builder foldersAddedTo(List foldersAddedTo) { + this.instance.foldersAddedTo = foldersAddedTo; + return this; + } + + public LibraryUpdateInfo.Builder foldersRemovedFrom(List foldersRemovedFrom) { + this.instance.foldersRemovedFrom = foldersRemovedFrom; + return this; + } + + public LibraryUpdateInfo.Builder itemsAdded(List itemsAdded) { + this.instance.itemsAdded = itemsAdded; + return this; + } + + public LibraryUpdateInfo.Builder itemsRemoved(List itemsRemoved) { + this.instance.itemsRemoved = itemsRemoved; + return this; + } + + public LibraryUpdateInfo.Builder itemsUpdated(List itemsUpdated) { + this.instance.itemsUpdated = itemsUpdated; + return this; + } + + public LibraryUpdateInfo.Builder collectionFolders(List collectionFolders) { + this.instance.collectionFolders = collectionFolders; + return this; + } + + public LibraryUpdateInfo.Builder isEmpty(Boolean isEmpty) { + this.instance.isEmpty = isEmpty; + return this; + } + + /** + * returns a built LibraryUpdateInfo instance. + * + * The builder is not reusable. + */ + public LibraryUpdateInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LibraryUpdateInfo.Builder builder() { + return new LibraryUpdateInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LibraryUpdateInfo.Builder toBuilder() { + return new LibraryUpdateInfo.Builder().foldersAddedTo(getFoldersAddedTo()) + .foldersRemovedFrom(getFoldersRemovedFrom()).itemsAdded(getItemsAdded()).itemsRemoved(getItemsRemoved()) + .itemsUpdated(getItemsUpdated()).collectionFolders(getCollectionFolders()).isEmpty(getIsEmpty()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ListingsProviderInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ListingsProviderInfo.java new file mode 100644 index 0000000000000..5694e6ab7d7ef --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ListingsProviderInfo.java @@ -0,0 +1,958 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ListingsProviderInfo + */ +@JsonPropertyOrder({ ListingsProviderInfo.JSON_PROPERTY_ID, ListingsProviderInfo.JSON_PROPERTY_TYPE, + ListingsProviderInfo.JSON_PROPERTY_USERNAME, ListingsProviderInfo.JSON_PROPERTY_PASSWORD, + ListingsProviderInfo.JSON_PROPERTY_LISTINGS_ID, ListingsProviderInfo.JSON_PROPERTY_ZIP_CODE, + ListingsProviderInfo.JSON_PROPERTY_COUNTRY, ListingsProviderInfo.JSON_PROPERTY_PATH, + ListingsProviderInfo.JSON_PROPERTY_ENABLED_TUNERS, ListingsProviderInfo.JSON_PROPERTY_ENABLE_ALL_TUNERS, + ListingsProviderInfo.JSON_PROPERTY_NEWS_CATEGORIES, ListingsProviderInfo.JSON_PROPERTY_SPORTS_CATEGORIES, + ListingsProviderInfo.JSON_PROPERTY_KIDS_CATEGORIES, ListingsProviderInfo.JSON_PROPERTY_MOVIE_CATEGORIES, + ListingsProviderInfo.JSON_PROPERTY_CHANNEL_MAPPINGS, ListingsProviderInfo.JSON_PROPERTY_MOVIE_PREFIX, + ListingsProviderInfo.JSON_PROPERTY_PREFERRED_LANGUAGE, ListingsProviderInfo.JSON_PROPERTY_USER_AGENT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ListingsProviderInfo { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_USERNAME = "Username"; + @org.eclipse.jdt.annotation.NonNull + private String username; + + public static final String JSON_PROPERTY_PASSWORD = "Password"; + @org.eclipse.jdt.annotation.NonNull + private String password; + + public static final String JSON_PROPERTY_LISTINGS_ID = "ListingsId"; + @org.eclipse.jdt.annotation.NonNull + private String listingsId; + + public static final String JSON_PROPERTY_ZIP_CODE = "ZipCode"; + @org.eclipse.jdt.annotation.NonNull + private String zipCode; + + public static final String JSON_PROPERTY_COUNTRY = "Country"; + @org.eclipse.jdt.annotation.NonNull + private String country; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_ENABLED_TUNERS = "EnabledTuners"; + @org.eclipse.jdt.annotation.NonNull + private List enabledTuners; + + public static final String JSON_PROPERTY_ENABLE_ALL_TUNERS = "EnableAllTuners"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAllTuners; + + public static final String JSON_PROPERTY_NEWS_CATEGORIES = "NewsCategories"; + @org.eclipse.jdt.annotation.NonNull + private List newsCategories; + + public static final String JSON_PROPERTY_SPORTS_CATEGORIES = "SportsCategories"; + @org.eclipse.jdt.annotation.NonNull + private List sportsCategories; + + public static final String JSON_PROPERTY_KIDS_CATEGORIES = "KidsCategories"; + @org.eclipse.jdt.annotation.NonNull + private List kidsCategories; + + public static final String JSON_PROPERTY_MOVIE_CATEGORIES = "MovieCategories"; + @org.eclipse.jdt.annotation.NonNull + private List movieCategories; + + public static final String JSON_PROPERTY_CHANNEL_MAPPINGS = "ChannelMappings"; + @org.eclipse.jdt.annotation.NonNull + private List channelMappings; + + public static final String JSON_PROPERTY_MOVIE_PREFIX = "MoviePrefix"; + @org.eclipse.jdt.annotation.NonNull + private String moviePrefix; + + public static final String JSON_PROPERTY_PREFERRED_LANGUAGE = "PreferredLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String preferredLanguage; + + public static final String JSON_PROPERTY_USER_AGENT = "UserAgent"; + @org.eclipse.jdt.annotation.NonNull + private String userAgent; + + public ListingsProviderInfo() { + } + + public ListingsProviderInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public ListingsProviderInfo type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public ListingsProviderInfo username(@org.eclipse.jdt.annotation.NonNull String username) { + this.username = username; + return this; + } + + /** + * Get username + * + * @return username + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; + } + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(@org.eclipse.jdt.annotation.NonNull String username) { + this.username = username; + } + + public ListingsProviderInfo password(@org.eclipse.jdt.annotation.NonNull String password) { + this.password = password; + return this; + } + + /** + * Get password + * + * @return password + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(@org.eclipse.jdt.annotation.NonNull String password) { + this.password = password; + } + + public ListingsProviderInfo listingsId(@org.eclipse.jdt.annotation.NonNull String listingsId) { + this.listingsId = listingsId; + return this; + } + + /** + * Get listingsId + * + * @return listingsId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LISTINGS_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getListingsId() { + return listingsId; + } + + @JsonProperty(JSON_PROPERTY_LISTINGS_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setListingsId(@org.eclipse.jdt.annotation.NonNull String listingsId) { + this.listingsId = listingsId; + } + + public ListingsProviderInfo zipCode(@org.eclipse.jdt.annotation.NonNull String zipCode) { + this.zipCode = zipCode; + return this; + } + + /** + * Get zipCode + * + * @return zipCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ZIP_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getZipCode() { + return zipCode; + } + + @JsonProperty(JSON_PROPERTY_ZIP_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setZipCode(@org.eclipse.jdt.annotation.NonNull String zipCode) { + this.zipCode = zipCode; + } + + public ListingsProviderInfo country(@org.eclipse.jdt.annotation.NonNull String country) { + this.country = country; + return this; + } + + /** + * Get country + * + * @return country + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCountry() { + return country; + } + + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCountry(@org.eclipse.jdt.annotation.NonNull String country) { + this.country = country; + } + + public ListingsProviderInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Get path + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public ListingsProviderInfo enabledTuners(@org.eclipse.jdt.annotation.NonNull List enabledTuners) { + this.enabledTuners = enabledTuners; + return this; + } + + public ListingsProviderInfo addEnabledTunersItem(String enabledTunersItem) { + if (this.enabledTuners == null) { + this.enabledTuners = new ArrayList<>(); + } + this.enabledTuners.add(enabledTunersItem); + return this; + } + + /** + * Get enabledTuners + * + * @return enabledTuners + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLED_TUNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnabledTuners() { + return enabledTuners; + } + + @JsonProperty(JSON_PROPERTY_ENABLED_TUNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabledTuners(@org.eclipse.jdt.annotation.NonNull List enabledTuners) { + this.enabledTuners = enabledTuners; + } + + public ListingsProviderInfo enableAllTuners(@org.eclipse.jdt.annotation.NonNull Boolean enableAllTuners) { + this.enableAllTuners = enableAllTuners; + return this; + } + + /** + * Get enableAllTuners + * + * @return enableAllTuners + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_ALL_TUNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAllTuners() { + return enableAllTuners; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_ALL_TUNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAllTuners(@org.eclipse.jdt.annotation.NonNull Boolean enableAllTuners) { + this.enableAllTuners = enableAllTuners; + } + + public ListingsProviderInfo newsCategories(@org.eclipse.jdt.annotation.NonNull List newsCategories) { + this.newsCategories = newsCategories; + return this; + } + + public ListingsProviderInfo addNewsCategoriesItem(String newsCategoriesItem) { + if (this.newsCategories == null) { + this.newsCategories = new ArrayList<>(); + } + this.newsCategories.add(newsCategoriesItem); + return this; + } + + /** + * Get newsCategories + * + * @return newsCategories + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NEWS_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNewsCategories() { + return newsCategories; + } + + @JsonProperty(JSON_PROPERTY_NEWS_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewsCategories(@org.eclipse.jdt.annotation.NonNull List newsCategories) { + this.newsCategories = newsCategories; + } + + public ListingsProviderInfo sportsCategories(@org.eclipse.jdt.annotation.NonNull List sportsCategories) { + this.sportsCategories = sportsCategories; + return this; + } + + public ListingsProviderInfo addSportsCategoriesItem(String sportsCategoriesItem) { + if (this.sportsCategories == null) { + this.sportsCategories = new ArrayList<>(); + } + this.sportsCategories.add(sportsCategoriesItem); + return this; + } + + /** + * Get sportsCategories + * + * @return sportsCategories + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SPORTS_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSportsCategories() { + return sportsCategories; + } + + @JsonProperty(JSON_PROPERTY_SPORTS_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSportsCategories(@org.eclipse.jdt.annotation.NonNull List sportsCategories) { + this.sportsCategories = sportsCategories; + } + + public ListingsProviderInfo kidsCategories(@org.eclipse.jdt.annotation.NonNull List kidsCategories) { + this.kidsCategories = kidsCategories; + return this; + } + + public ListingsProviderInfo addKidsCategoriesItem(String kidsCategoriesItem) { + if (this.kidsCategories == null) { + this.kidsCategories = new ArrayList<>(); + } + this.kidsCategories.add(kidsCategoriesItem); + return this; + } + + /** + * Get kidsCategories + * + * @return kidsCategories + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KIDS_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getKidsCategories() { + return kidsCategories; + } + + @JsonProperty(JSON_PROPERTY_KIDS_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKidsCategories(@org.eclipse.jdt.annotation.NonNull List kidsCategories) { + this.kidsCategories = kidsCategories; + } + + public ListingsProviderInfo movieCategories(@org.eclipse.jdt.annotation.NonNull List movieCategories) { + this.movieCategories = movieCategories; + return this; + } + + public ListingsProviderInfo addMovieCategoriesItem(String movieCategoriesItem) { + if (this.movieCategories == null) { + this.movieCategories = new ArrayList<>(); + } + this.movieCategories.add(movieCategoriesItem); + return this; + } + + /** + * Get movieCategories + * + * @return movieCategories + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MOVIE_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMovieCategories() { + return movieCategories; + } + + @JsonProperty(JSON_PROPERTY_MOVIE_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMovieCategories(@org.eclipse.jdt.annotation.NonNull List movieCategories) { + this.movieCategories = movieCategories; + } + + public ListingsProviderInfo channelMappings( + @org.eclipse.jdt.annotation.NonNull List channelMappings) { + this.channelMappings = channelMappings; + return this; + } + + public ListingsProviderInfo addChannelMappingsItem(NameValuePair channelMappingsItem) { + if (this.channelMappings == null) { + this.channelMappings = new ArrayList<>(); + } + this.channelMappings.add(channelMappingsItem); + return this; + } + + /** + * Get channelMappings + * + * @return channelMappings + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_MAPPINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getChannelMappings() { + return channelMappings; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_MAPPINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelMappings(@org.eclipse.jdt.annotation.NonNull List channelMappings) { + this.channelMappings = channelMappings; + } + + public ListingsProviderInfo moviePrefix(@org.eclipse.jdt.annotation.NonNull String moviePrefix) { + this.moviePrefix = moviePrefix; + return this; + } + + /** + * Get moviePrefix + * + * @return moviePrefix + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MOVIE_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMoviePrefix() { + return moviePrefix; + } + + @JsonProperty(JSON_PROPERTY_MOVIE_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMoviePrefix(@org.eclipse.jdt.annotation.NonNull String moviePrefix) { + this.moviePrefix = moviePrefix; + } + + public ListingsProviderInfo preferredLanguage(@org.eclipse.jdt.annotation.NonNull String preferredLanguage) { + this.preferredLanguage = preferredLanguage; + return this; + } + + /** + * Get preferredLanguage + * + * @return preferredLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREFERRED_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPreferredLanguage() { + return preferredLanguage; + } + + @JsonProperty(JSON_PROPERTY_PREFERRED_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreferredLanguage(@org.eclipse.jdt.annotation.NonNull String preferredLanguage) { + this.preferredLanguage = preferredLanguage; + } + + public ListingsProviderInfo userAgent(@org.eclipse.jdt.annotation.NonNull String userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + * Get userAgent + * + * @return userAgent + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_AGENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserAgent() { + return userAgent; + } + + @JsonProperty(JSON_PROPERTY_USER_AGENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserAgent(@org.eclipse.jdt.annotation.NonNull String userAgent) { + this.userAgent = userAgent; + } + + /** + * Return true if this ListingsProviderInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListingsProviderInfo listingsProviderInfo = (ListingsProviderInfo) o; + return Objects.equals(this.id, listingsProviderInfo.id) && Objects.equals(this.type, listingsProviderInfo.type) + && Objects.equals(this.username, listingsProviderInfo.username) + && Objects.equals(this.password, listingsProviderInfo.password) + && Objects.equals(this.listingsId, listingsProviderInfo.listingsId) + && Objects.equals(this.zipCode, listingsProviderInfo.zipCode) + && Objects.equals(this.country, listingsProviderInfo.country) + && Objects.equals(this.path, listingsProviderInfo.path) + && Objects.equals(this.enabledTuners, listingsProviderInfo.enabledTuners) + && Objects.equals(this.enableAllTuners, listingsProviderInfo.enableAllTuners) + && Objects.equals(this.newsCategories, listingsProviderInfo.newsCategories) + && Objects.equals(this.sportsCategories, listingsProviderInfo.sportsCategories) + && Objects.equals(this.kidsCategories, listingsProviderInfo.kidsCategories) + && Objects.equals(this.movieCategories, listingsProviderInfo.movieCategories) + && Objects.equals(this.channelMappings, listingsProviderInfo.channelMappings) + && Objects.equals(this.moviePrefix, listingsProviderInfo.moviePrefix) + && Objects.equals(this.preferredLanguage, listingsProviderInfo.preferredLanguage) + && Objects.equals(this.userAgent, listingsProviderInfo.userAgent); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, username, password, listingsId, zipCode, country, path, enabledTuners, + enableAllTuners, newsCategories, sportsCategories, kidsCategories, movieCategories, channelMappings, + moviePrefix, preferredLanguage, userAgent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListingsProviderInfo {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" listingsId: ").append(toIndentedString(listingsId)).append("\n"); + sb.append(" zipCode: ").append(toIndentedString(zipCode)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" enabledTuners: ").append(toIndentedString(enabledTuners)).append("\n"); + sb.append(" enableAllTuners: ").append(toIndentedString(enableAllTuners)).append("\n"); + sb.append(" newsCategories: ").append(toIndentedString(newsCategories)).append("\n"); + sb.append(" sportsCategories: ").append(toIndentedString(sportsCategories)).append("\n"); + sb.append(" kidsCategories: ").append(toIndentedString(kidsCategories)).append("\n"); + sb.append(" movieCategories: ").append(toIndentedString(movieCategories)).append("\n"); + sb.append(" channelMappings: ").append(toIndentedString(channelMappings)).append("\n"); + sb.append(" moviePrefix: ").append(toIndentedString(moviePrefix)).append("\n"); + sb.append(" preferredLanguage: ").append(toIndentedString(preferredLanguage)).append("\n"); + sb.append(" userAgent: ").append(toIndentedString(userAgent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `Username` to the URL query string + if (getUsername() != null) { + joiner.add(String.format("%sUsername%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUsername())))); + } + + // add `Password` to the URL query string + if (getPassword() != null) { + joiner.add(String.format("%sPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPassword())))); + } + + // add `ListingsId` to the URL query string + if (getListingsId() != null) { + joiner.add(String.format("%sListingsId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getListingsId())))); + } + + // add `ZipCode` to the URL query string + if (getZipCode() != null) { + joiner.add(String.format("%sZipCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getZipCode())))); + } + + // add `Country` to the URL query string + if (getCountry() != null) { + joiner.add(String.format("%sCountry%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCountry())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `EnabledTuners` to the URL query string + if (getEnabledTuners() != null) { + for (int i = 0; i < getEnabledTuners().size(); i++) { + joiner.add(String.format("%sEnabledTuners%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEnabledTuners().get(i))))); + } + } + + // add `EnableAllTuners` to the URL query string + if (getEnableAllTuners() != null) { + joiner.add(String.format("%sEnableAllTuners%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAllTuners())))); + } + + // add `NewsCategories` to the URL query string + if (getNewsCategories() != null) { + for (int i = 0; i < getNewsCategories().size(); i++) { + joiner.add(String.format("%sNewsCategories%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getNewsCategories().get(i))))); + } + } + + // add `SportsCategories` to the URL query string + if (getSportsCategories() != null) { + for (int i = 0; i < getSportsCategories().size(); i++) { + joiner.add(String.format("%sSportsCategories%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSportsCategories().get(i))))); + } + } + + // add `KidsCategories` to the URL query string + if (getKidsCategories() != null) { + for (int i = 0; i < getKidsCategories().size(); i++) { + joiner.add(String.format("%sKidsCategories%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getKidsCategories().get(i))))); + } + } + + // add `MovieCategories` to the URL query string + if (getMovieCategories() != null) { + for (int i = 0; i < getMovieCategories().size(); i++) { + joiner.add(String.format("%sMovieCategories%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMovieCategories().get(i))))); + } + } + + // add `ChannelMappings` to the URL query string + if (getChannelMappings() != null) { + for (int i = 0; i < getChannelMappings().size(); i++) { + if (getChannelMappings().get(i) != null) { + joiner.add(getChannelMappings().get(i).toUrlQueryString(String.format("%sChannelMappings%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `MoviePrefix` to the URL query string + if (getMoviePrefix() != null) { + joiner.add(String.format("%sMoviePrefix%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMoviePrefix())))); + } + + // add `PreferredLanguage` to the URL query string + if (getPreferredLanguage() != null) { + joiner.add(String.format("%sPreferredLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreferredLanguage())))); + } + + // add `UserAgent` to the URL query string + if (getUserAgent() != null) { + joiner.add(String.format("%sUserAgent%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserAgent())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ListingsProviderInfo instance; + + public Builder() { + this(new ListingsProviderInfo()); + } + + protected Builder(ListingsProviderInfo instance) { + this.instance = instance; + } + + public ListingsProviderInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public ListingsProviderInfo.Builder type(String type) { + this.instance.type = type; + return this; + } + + public ListingsProviderInfo.Builder username(String username) { + this.instance.username = username; + return this; + } + + public ListingsProviderInfo.Builder password(String password) { + this.instance.password = password; + return this; + } + + public ListingsProviderInfo.Builder listingsId(String listingsId) { + this.instance.listingsId = listingsId; + return this; + } + + public ListingsProviderInfo.Builder zipCode(String zipCode) { + this.instance.zipCode = zipCode; + return this; + } + + public ListingsProviderInfo.Builder country(String country) { + this.instance.country = country; + return this; + } + + public ListingsProviderInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public ListingsProviderInfo.Builder enabledTuners(List enabledTuners) { + this.instance.enabledTuners = enabledTuners; + return this; + } + + public ListingsProviderInfo.Builder enableAllTuners(Boolean enableAllTuners) { + this.instance.enableAllTuners = enableAllTuners; + return this; + } + + public ListingsProviderInfo.Builder newsCategories(List newsCategories) { + this.instance.newsCategories = newsCategories; + return this; + } + + public ListingsProviderInfo.Builder sportsCategories(List sportsCategories) { + this.instance.sportsCategories = sportsCategories; + return this; + } + + public ListingsProviderInfo.Builder kidsCategories(List kidsCategories) { + this.instance.kidsCategories = kidsCategories; + return this; + } + + public ListingsProviderInfo.Builder movieCategories(List movieCategories) { + this.instance.movieCategories = movieCategories; + return this; + } + + public ListingsProviderInfo.Builder channelMappings(List channelMappings) { + this.instance.channelMappings = channelMappings; + return this; + } + + public ListingsProviderInfo.Builder moviePrefix(String moviePrefix) { + this.instance.moviePrefix = moviePrefix; + return this; + } + + public ListingsProviderInfo.Builder preferredLanguage(String preferredLanguage) { + this.instance.preferredLanguage = preferredLanguage; + return this; + } + + public ListingsProviderInfo.Builder userAgent(String userAgent) { + this.instance.userAgent = userAgent; + return this; + } + + /** + * returns a built ListingsProviderInfo instance. + * + * The builder is not reusable. + */ + public ListingsProviderInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ListingsProviderInfo.Builder builder() { + return new ListingsProviderInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ListingsProviderInfo.Builder toBuilder() { + return new ListingsProviderInfo.Builder().id(getId()).type(getType()).username(getUsername()) + .password(getPassword()).listingsId(getListingsId()).zipCode(getZipCode()).country(getCountry()) + .path(getPath()).enabledTuners(getEnabledTuners()).enableAllTuners(getEnableAllTuners()) + .newsCategories(getNewsCategories()).sportsCategories(getSportsCategories()) + .kidsCategories(getKidsCategories()).movieCategories(getMovieCategories()) + .channelMappings(getChannelMappings()).moviePrefix(getMoviePrefix()) + .preferredLanguage(getPreferredLanguage()).userAgent(getUserAgent()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveStreamResponse.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveStreamResponse.java new file mode 100644 index 0000000000000..2130c80dbc923 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveStreamResponse.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * LiveStreamResponse + */ +@JsonPropertyOrder({ LiveStreamResponse.JSON_PROPERTY_MEDIA_SOURCE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LiveStreamResponse { + public static final String JSON_PROPERTY_MEDIA_SOURCE = "MediaSource"; + @org.eclipse.jdt.annotation.NonNull + private MediaSourceInfo mediaSource; + + public LiveStreamResponse() { + } + + public LiveStreamResponse mediaSource(@org.eclipse.jdt.annotation.NonNull MediaSourceInfo mediaSource) { + this.mediaSource = mediaSource; + return this; + } + + /** + * Get mediaSource + * + * @return mediaSource + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaSourceInfo getMediaSource() { + return mediaSource; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSource(@org.eclipse.jdt.annotation.NonNull MediaSourceInfo mediaSource) { + this.mediaSource = mediaSource; + } + + /** + * Return true if this LiveStreamResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LiveStreamResponse liveStreamResponse = (LiveStreamResponse) o; + return Objects.equals(this.mediaSource, liveStreamResponse.mediaSource); + } + + @Override + public int hashCode() { + return Objects.hash(mediaSource); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LiveStreamResponse {\n"); + sb.append(" mediaSource: ").append(toIndentedString(mediaSource)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MediaSource` to the URL query string + if (getMediaSource() != null) { + joiner.add(getMediaSource().toUrlQueryString(prefix + "MediaSource" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private LiveStreamResponse instance; + + public Builder() { + this(new LiveStreamResponse()); + } + + protected Builder(LiveStreamResponse instance) { + this.instance = instance; + } + + public LiveStreamResponse.Builder mediaSource(MediaSourceInfo mediaSource) { + this.instance.mediaSource = mediaSource; + return this; + } + + /** + * returns a built LiveStreamResponse instance. + * + * The builder is not reusable. + */ + public LiveStreamResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LiveStreamResponse.Builder builder() { + return new LiveStreamResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LiveStreamResponse.Builder toBuilder() { + return new LiveStreamResponse.Builder().mediaSource(getMediaSource()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveTvInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveTvInfo.java new file mode 100644 index 0000000000000..ba2fa70b7db39 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveTvInfo.java @@ -0,0 +1,299 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * LiveTvInfo + */ +@JsonPropertyOrder({ LiveTvInfo.JSON_PROPERTY_SERVICES, LiveTvInfo.JSON_PROPERTY_IS_ENABLED, + LiveTvInfo.JSON_PROPERTY_ENABLED_USERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LiveTvInfo { + public static final String JSON_PROPERTY_SERVICES = "Services"; + @org.eclipse.jdt.annotation.NonNull + private List services = new ArrayList<>(); + + public static final String JSON_PROPERTY_IS_ENABLED = "IsEnabled"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isEnabled; + + public static final String JSON_PROPERTY_ENABLED_USERS = "EnabledUsers"; + @org.eclipse.jdt.annotation.NonNull + private List enabledUsers = new ArrayList<>(); + + public LiveTvInfo() { + } + + public LiveTvInfo services(@org.eclipse.jdt.annotation.NonNull List services) { + this.services = services; + return this; + } + + public LiveTvInfo addServicesItem(LiveTvServiceInfo servicesItem) { + if (this.services == null) { + this.services = new ArrayList<>(); + } + this.services.add(servicesItem); + return this; + } + + /** + * Gets or sets the services. + * + * @return services + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getServices() { + return services; + } + + @JsonProperty(JSON_PROPERTY_SERVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServices(@org.eclipse.jdt.annotation.NonNull List services) { + this.services = services; + } + + public LiveTvInfo isEnabled(@org.eclipse.jdt.annotation.NonNull Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is enabled. + * + * @return isEnabled + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsEnabled() { + return isEnabled; + } + + @JsonProperty(JSON_PROPERTY_IS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsEnabled(@org.eclipse.jdt.annotation.NonNull Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + public LiveTvInfo enabledUsers(@org.eclipse.jdt.annotation.NonNull List enabledUsers) { + this.enabledUsers = enabledUsers; + return this; + } + + public LiveTvInfo addEnabledUsersItem(String enabledUsersItem) { + if (this.enabledUsers == null) { + this.enabledUsers = new ArrayList<>(); + } + this.enabledUsers.add(enabledUsersItem); + return this; + } + + /** + * Gets or sets the enabled users. + * + * @return enabledUsers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLED_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnabledUsers() { + return enabledUsers; + } + + @JsonProperty(JSON_PROPERTY_ENABLED_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabledUsers(@org.eclipse.jdt.annotation.NonNull List enabledUsers) { + this.enabledUsers = enabledUsers; + } + + /** + * Return true if this LiveTvInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LiveTvInfo liveTvInfo = (LiveTvInfo) o; + return Objects.equals(this.services, liveTvInfo.services) + && Objects.equals(this.isEnabled, liveTvInfo.isEnabled) + && Objects.equals(this.enabledUsers, liveTvInfo.enabledUsers); + } + + @Override + public int hashCode() { + return Objects.hash(services, isEnabled, enabledUsers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LiveTvInfo {\n"); + sb.append(" services: ").append(toIndentedString(services)).append("\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" enabledUsers: ").append(toIndentedString(enabledUsers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Services` to the URL query string + if (getServices() != null) { + for (int i = 0; i < getServices().size(); i++) { + if (getServices().get(i) != null) { + joiner.add(getServices().get(i).toUrlQueryString(String.format("%sServices%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `IsEnabled` to the URL query string + if (getIsEnabled() != null) { + joiner.add(String.format("%sIsEnabled%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsEnabled())))); + } + + // add `EnabledUsers` to the URL query string + if (getEnabledUsers() != null) { + for (int i = 0; i < getEnabledUsers().size(); i++) { + joiner.add(String.format("%sEnabledUsers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEnabledUsers().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private LiveTvInfo instance; + + public Builder() { + this(new LiveTvInfo()); + } + + protected Builder(LiveTvInfo instance) { + this.instance = instance; + } + + public LiveTvInfo.Builder services(List services) { + this.instance.services = services; + return this; + } + + public LiveTvInfo.Builder isEnabled(Boolean isEnabled) { + this.instance.isEnabled = isEnabled; + return this; + } + + public LiveTvInfo.Builder enabledUsers(List enabledUsers) { + this.instance.enabledUsers = enabledUsers; + return this; + } + + /** + * returns a built LiveTvInfo instance. + * + * The builder is not reusable. + */ + public LiveTvInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LiveTvInfo.Builder builder() { + return new LiveTvInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LiveTvInfo.Builder toBuilder() { + return new LiveTvInfo.Builder().services(getServices()).isEnabled(getIsEnabled()) + .enabledUsers(getEnabledUsers()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveTvOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveTvOptions.java new file mode 100644 index 0000000000000..c2ac02a4f480e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveTvOptions.java @@ -0,0 +1,819 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * LiveTvOptions + */ +@JsonPropertyOrder({ LiveTvOptions.JSON_PROPERTY_GUIDE_DAYS, LiveTvOptions.JSON_PROPERTY_RECORDING_PATH, + LiveTvOptions.JSON_PROPERTY_MOVIE_RECORDING_PATH, LiveTvOptions.JSON_PROPERTY_SERIES_RECORDING_PATH, + LiveTvOptions.JSON_PROPERTY_ENABLE_RECORDING_SUBFOLDERS, + LiveTvOptions.JSON_PROPERTY_ENABLE_ORIGINAL_AUDIO_WITH_ENCODED_RECORDINGS, + LiveTvOptions.JSON_PROPERTY_TUNER_HOSTS, LiveTvOptions.JSON_PROPERTY_LISTING_PROVIDERS, + LiveTvOptions.JSON_PROPERTY_PRE_PADDING_SECONDS, LiveTvOptions.JSON_PROPERTY_POST_PADDING_SECONDS, + LiveTvOptions.JSON_PROPERTY_MEDIA_LOCATIONS_CREATED, LiveTvOptions.JSON_PROPERTY_RECORDING_POST_PROCESSOR, + LiveTvOptions.JSON_PROPERTY_RECORDING_POST_PROCESSOR_ARGUMENTS, + LiveTvOptions.JSON_PROPERTY_SAVE_RECORDING_N_F_O, LiveTvOptions.JSON_PROPERTY_SAVE_RECORDING_IMAGES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LiveTvOptions { + public static final String JSON_PROPERTY_GUIDE_DAYS = "GuideDays"; + @org.eclipse.jdt.annotation.NonNull + private Integer guideDays; + + public static final String JSON_PROPERTY_RECORDING_PATH = "RecordingPath"; + @org.eclipse.jdt.annotation.NonNull + private String recordingPath; + + public static final String JSON_PROPERTY_MOVIE_RECORDING_PATH = "MovieRecordingPath"; + @org.eclipse.jdt.annotation.NonNull + private String movieRecordingPath; + + public static final String JSON_PROPERTY_SERIES_RECORDING_PATH = "SeriesRecordingPath"; + @org.eclipse.jdt.annotation.NonNull + private String seriesRecordingPath; + + public static final String JSON_PROPERTY_ENABLE_RECORDING_SUBFOLDERS = "EnableRecordingSubfolders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableRecordingSubfolders; + + public static final String JSON_PROPERTY_ENABLE_ORIGINAL_AUDIO_WITH_ENCODED_RECORDINGS = "EnableOriginalAudioWithEncodedRecordings"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableOriginalAudioWithEncodedRecordings; + + public static final String JSON_PROPERTY_TUNER_HOSTS = "TunerHosts"; + @org.eclipse.jdt.annotation.NonNull + private List tunerHosts; + + public static final String JSON_PROPERTY_LISTING_PROVIDERS = "ListingProviders"; + @org.eclipse.jdt.annotation.NonNull + private List listingProviders; + + public static final String JSON_PROPERTY_PRE_PADDING_SECONDS = "PrePaddingSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer prePaddingSeconds; + + public static final String JSON_PROPERTY_POST_PADDING_SECONDS = "PostPaddingSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer postPaddingSeconds; + + public static final String JSON_PROPERTY_MEDIA_LOCATIONS_CREATED = "MediaLocationsCreated"; + @org.eclipse.jdt.annotation.NonNull + private List mediaLocationsCreated; + + public static final String JSON_PROPERTY_RECORDING_POST_PROCESSOR = "RecordingPostProcessor"; + @org.eclipse.jdt.annotation.NonNull + private String recordingPostProcessor; + + public static final String JSON_PROPERTY_RECORDING_POST_PROCESSOR_ARGUMENTS = "RecordingPostProcessorArguments"; + @org.eclipse.jdt.annotation.NonNull + private String recordingPostProcessorArguments; + + public static final String JSON_PROPERTY_SAVE_RECORDING_N_F_O = "SaveRecordingNFO"; + @org.eclipse.jdt.annotation.NonNull + private Boolean saveRecordingNFO; + + public static final String JSON_PROPERTY_SAVE_RECORDING_IMAGES = "SaveRecordingImages"; + @org.eclipse.jdt.annotation.NonNull + private Boolean saveRecordingImages; + + public LiveTvOptions() { + } + + public LiveTvOptions guideDays(@org.eclipse.jdt.annotation.NonNull Integer guideDays) { + this.guideDays = guideDays; + return this; + } + + /** + * Get guideDays + * + * @return guideDays + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GUIDE_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getGuideDays() { + return guideDays; + } + + @JsonProperty(JSON_PROPERTY_GUIDE_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGuideDays(@org.eclipse.jdt.annotation.NonNull Integer guideDays) { + this.guideDays = guideDays; + } + + public LiveTvOptions recordingPath(@org.eclipse.jdt.annotation.NonNull String recordingPath) { + this.recordingPath = recordingPath; + return this; + } + + /** + * Get recordingPath + * + * @return recordingPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RECORDING_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRecordingPath() { + return recordingPath; + } + + @JsonProperty(JSON_PROPERTY_RECORDING_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecordingPath(@org.eclipse.jdt.annotation.NonNull String recordingPath) { + this.recordingPath = recordingPath; + } + + public LiveTvOptions movieRecordingPath(@org.eclipse.jdt.annotation.NonNull String movieRecordingPath) { + this.movieRecordingPath = movieRecordingPath; + return this; + } + + /** + * Get movieRecordingPath + * + * @return movieRecordingPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MOVIE_RECORDING_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMovieRecordingPath() { + return movieRecordingPath; + } + + @JsonProperty(JSON_PROPERTY_MOVIE_RECORDING_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMovieRecordingPath(@org.eclipse.jdt.annotation.NonNull String movieRecordingPath) { + this.movieRecordingPath = movieRecordingPath; + } + + public LiveTvOptions seriesRecordingPath(@org.eclipse.jdt.annotation.NonNull String seriesRecordingPath) { + this.seriesRecordingPath = seriesRecordingPath; + return this; + } + + /** + * Get seriesRecordingPath + * + * @return seriesRecordingPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_RECORDING_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesRecordingPath() { + return seriesRecordingPath; + } + + @JsonProperty(JSON_PROPERTY_SERIES_RECORDING_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesRecordingPath(@org.eclipse.jdt.annotation.NonNull String seriesRecordingPath) { + this.seriesRecordingPath = seriesRecordingPath; + } + + public LiveTvOptions enableRecordingSubfolders( + @org.eclipse.jdt.annotation.NonNull Boolean enableRecordingSubfolders) { + this.enableRecordingSubfolders = enableRecordingSubfolders; + return this; + } + + /** + * Get enableRecordingSubfolders + * + * @return enableRecordingSubfolders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_RECORDING_SUBFOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableRecordingSubfolders() { + return enableRecordingSubfolders; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_RECORDING_SUBFOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableRecordingSubfolders(@org.eclipse.jdt.annotation.NonNull Boolean enableRecordingSubfolders) { + this.enableRecordingSubfolders = enableRecordingSubfolders; + } + + public LiveTvOptions enableOriginalAudioWithEncodedRecordings( + @org.eclipse.jdt.annotation.NonNull Boolean enableOriginalAudioWithEncodedRecordings) { + this.enableOriginalAudioWithEncodedRecordings = enableOriginalAudioWithEncodedRecordings; + return this; + } + + /** + * Get enableOriginalAudioWithEncodedRecordings + * + * @return enableOriginalAudioWithEncodedRecordings + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_ORIGINAL_AUDIO_WITH_ENCODED_RECORDINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableOriginalAudioWithEncodedRecordings() { + return enableOriginalAudioWithEncodedRecordings; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_ORIGINAL_AUDIO_WITH_ENCODED_RECORDINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableOriginalAudioWithEncodedRecordings( + @org.eclipse.jdt.annotation.NonNull Boolean enableOriginalAudioWithEncodedRecordings) { + this.enableOriginalAudioWithEncodedRecordings = enableOriginalAudioWithEncodedRecordings; + } + + public LiveTvOptions tunerHosts(@org.eclipse.jdt.annotation.NonNull List tunerHosts) { + this.tunerHosts = tunerHosts; + return this; + } + + public LiveTvOptions addTunerHostsItem(TunerHostInfo tunerHostsItem) { + if (this.tunerHosts == null) { + this.tunerHosts = new ArrayList<>(); + } + this.tunerHosts.add(tunerHostsItem); + return this; + } + + /** + * Get tunerHosts + * + * @return tunerHosts + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TUNER_HOSTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTunerHosts() { + return tunerHosts; + } + + @JsonProperty(JSON_PROPERTY_TUNER_HOSTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTunerHosts(@org.eclipse.jdt.annotation.NonNull List tunerHosts) { + this.tunerHosts = tunerHosts; + } + + public LiveTvOptions listingProviders( + @org.eclipse.jdt.annotation.NonNull List listingProviders) { + this.listingProviders = listingProviders; + return this; + } + + public LiveTvOptions addListingProvidersItem(ListingsProviderInfo listingProvidersItem) { + if (this.listingProviders == null) { + this.listingProviders = new ArrayList<>(); + } + this.listingProviders.add(listingProvidersItem); + return this; + } + + /** + * Get listingProviders + * + * @return listingProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LISTING_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getListingProviders() { + return listingProviders; + } + + @JsonProperty(JSON_PROPERTY_LISTING_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setListingProviders(@org.eclipse.jdt.annotation.NonNull List listingProviders) { + this.listingProviders = listingProviders; + } + + public LiveTvOptions prePaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer prePaddingSeconds) { + this.prePaddingSeconds = prePaddingSeconds; + return this; + } + + /** + * Get prePaddingSeconds + * + * @return prePaddingSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRE_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrePaddingSeconds() { + return prePaddingSeconds; + } + + @JsonProperty(JSON_PROPERTY_PRE_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrePaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer prePaddingSeconds) { + this.prePaddingSeconds = prePaddingSeconds; + } + + public LiveTvOptions postPaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer postPaddingSeconds) { + this.postPaddingSeconds = postPaddingSeconds; + return this; + } + + /** + * Get postPaddingSeconds + * + * @return postPaddingSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POST_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPostPaddingSeconds() { + return postPaddingSeconds; + } + + @JsonProperty(JSON_PROPERTY_POST_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPostPaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer postPaddingSeconds) { + this.postPaddingSeconds = postPaddingSeconds; + } + + public LiveTvOptions mediaLocationsCreated(@org.eclipse.jdt.annotation.NonNull List mediaLocationsCreated) { + this.mediaLocationsCreated = mediaLocationsCreated; + return this; + } + + public LiveTvOptions addMediaLocationsCreatedItem(String mediaLocationsCreatedItem) { + if (this.mediaLocationsCreated == null) { + this.mediaLocationsCreated = new ArrayList<>(); + } + this.mediaLocationsCreated.add(mediaLocationsCreatedItem); + return this; + } + + /** + * Get mediaLocationsCreated + * + * @return mediaLocationsCreated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_LOCATIONS_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMediaLocationsCreated() { + return mediaLocationsCreated; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_LOCATIONS_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaLocationsCreated(@org.eclipse.jdt.annotation.NonNull List mediaLocationsCreated) { + this.mediaLocationsCreated = mediaLocationsCreated; + } + + public LiveTvOptions recordingPostProcessor(@org.eclipse.jdt.annotation.NonNull String recordingPostProcessor) { + this.recordingPostProcessor = recordingPostProcessor; + return this; + } + + /** + * Get recordingPostProcessor + * + * @return recordingPostProcessor + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RECORDING_POST_PROCESSOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRecordingPostProcessor() { + return recordingPostProcessor; + } + + @JsonProperty(JSON_PROPERTY_RECORDING_POST_PROCESSOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecordingPostProcessor(@org.eclipse.jdt.annotation.NonNull String recordingPostProcessor) { + this.recordingPostProcessor = recordingPostProcessor; + } + + public LiveTvOptions recordingPostProcessorArguments( + @org.eclipse.jdt.annotation.NonNull String recordingPostProcessorArguments) { + this.recordingPostProcessorArguments = recordingPostProcessorArguments; + return this; + } + + /** + * Get recordingPostProcessorArguments + * + * @return recordingPostProcessorArguments + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RECORDING_POST_PROCESSOR_ARGUMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRecordingPostProcessorArguments() { + return recordingPostProcessorArguments; + } + + @JsonProperty(JSON_PROPERTY_RECORDING_POST_PROCESSOR_ARGUMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecordingPostProcessorArguments( + @org.eclipse.jdt.annotation.NonNull String recordingPostProcessorArguments) { + this.recordingPostProcessorArguments = recordingPostProcessorArguments; + } + + public LiveTvOptions saveRecordingNFO(@org.eclipse.jdt.annotation.NonNull Boolean saveRecordingNFO) { + this.saveRecordingNFO = saveRecordingNFO; + return this; + } + + /** + * Get saveRecordingNFO + * + * @return saveRecordingNFO + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SAVE_RECORDING_N_F_O) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSaveRecordingNFO() { + return saveRecordingNFO; + } + + @JsonProperty(JSON_PROPERTY_SAVE_RECORDING_N_F_O) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaveRecordingNFO(@org.eclipse.jdt.annotation.NonNull Boolean saveRecordingNFO) { + this.saveRecordingNFO = saveRecordingNFO; + } + + public LiveTvOptions saveRecordingImages(@org.eclipse.jdt.annotation.NonNull Boolean saveRecordingImages) { + this.saveRecordingImages = saveRecordingImages; + return this; + } + + /** + * Get saveRecordingImages + * + * @return saveRecordingImages + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SAVE_RECORDING_IMAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSaveRecordingImages() { + return saveRecordingImages; + } + + @JsonProperty(JSON_PROPERTY_SAVE_RECORDING_IMAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaveRecordingImages(@org.eclipse.jdt.annotation.NonNull Boolean saveRecordingImages) { + this.saveRecordingImages = saveRecordingImages; + } + + /** + * Return true if this LiveTvOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LiveTvOptions liveTvOptions = (LiveTvOptions) o; + return Objects.equals(this.guideDays, liveTvOptions.guideDays) + && Objects.equals(this.recordingPath, liveTvOptions.recordingPath) + && Objects.equals(this.movieRecordingPath, liveTvOptions.movieRecordingPath) + && Objects.equals(this.seriesRecordingPath, liveTvOptions.seriesRecordingPath) + && Objects.equals(this.enableRecordingSubfolders, liveTvOptions.enableRecordingSubfolders) + && Objects.equals(this.enableOriginalAudioWithEncodedRecordings, + liveTvOptions.enableOriginalAudioWithEncodedRecordings) + && Objects.equals(this.tunerHosts, liveTvOptions.tunerHosts) + && Objects.equals(this.listingProviders, liveTvOptions.listingProviders) + && Objects.equals(this.prePaddingSeconds, liveTvOptions.prePaddingSeconds) + && Objects.equals(this.postPaddingSeconds, liveTvOptions.postPaddingSeconds) + && Objects.equals(this.mediaLocationsCreated, liveTvOptions.mediaLocationsCreated) + && Objects.equals(this.recordingPostProcessor, liveTvOptions.recordingPostProcessor) + && Objects.equals(this.recordingPostProcessorArguments, liveTvOptions.recordingPostProcessorArguments) + && Objects.equals(this.saveRecordingNFO, liveTvOptions.saveRecordingNFO) + && Objects.equals(this.saveRecordingImages, liveTvOptions.saveRecordingImages); + } + + @Override + public int hashCode() { + return Objects.hash(guideDays, recordingPath, movieRecordingPath, seriesRecordingPath, + enableRecordingSubfolders, enableOriginalAudioWithEncodedRecordings, tunerHosts, listingProviders, + prePaddingSeconds, postPaddingSeconds, mediaLocationsCreated, recordingPostProcessor, + recordingPostProcessorArguments, saveRecordingNFO, saveRecordingImages); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LiveTvOptions {\n"); + sb.append(" guideDays: ").append(toIndentedString(guideDays)).append("\n"); + sb.append(" recordingPath: ").append(toIndentedString(recordingPath)).append("\n"); + sb.append(" movieRecordingPath: ").append(toIndentedString(movieRecordingPath)).append("\n"); + sb.append(" seriesRecordingPath: ").append(toIndentedString(seriesRecordingPath)).append("\n"); + sb.append(" enableRecordingSubfolders: ").append(toIndentedString(enableRecordingSubfolders)).append("\n"); + sb.append(" enableOriginalAudioWithEncodedRecordings: ") + .append(toIndentedString(enableOriginalAudioWithEncodedRecordings)).append("\n"); + sb.append(" tunerHosts: ").append(toIndentedString(tunerHosts)).append("\n"); + sb.append(" listingProviders: ").append(toIndentedString(listingProviders)).append("\n"); + sb.append(" prePaddingSeconds: ").append(toIndentedString(prePaddingSeconds)).append("\n"); + sb.append(" postPaddingSeconds: ").append(toIndentedString(postPaddingSeconds)).append("\n"); + sb.append(" mediaLocationsCreated: ").append(toIndentedString(mediaLocationsCreated)).append("\n"); + sb.append(" recordingPostProcessor: ").append(toIndentedString(recordingPostProcessor)).append("\n"); + sb.append(" recordingPostProcessorArguments: ").append(toIndentedString(recordingPostProcessorArguments)) + .append("\n"); + sb.append(" saveRecordingNFO: ").append(toIndentedString(saveRecordingNFO)).append("\n"); + sb.append(" saveRecordingImages: ").append(toIndentedString(saveRecordingImages)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `GuideDays` to the URL query string + if (getGuideDays() != null) { + joiner.add(String.format("%sGuideDays%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGuideDays())))); + } + + // add `RecordingPath` to the URL query string + if (getRecordingPath() != null) { + joiner.add(String.format("%sRecordingPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRecordingPath())))); + } + + // add `MovieRecordingPath` to the URL query string + if (getMovieRecordingPath() != null) { + joiner.add(String.format("%sMovieRecordingPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMovieRecordingPath())))); + } + + // add `SeriesRecordingPath` to the URL query string + if (getSeriesRecordingPath() != null) { + joiner.add(String.format("%sSeriesRecordingPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesRecordingPath())))); + } + + // add `EnableRecordingSubfolders` to the URL query string + if (getEnableRecordingSubfolders() != null) { + joiner.add(String.format("%sEnableRecordingSubfolders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableRecordingSubfolders())))); + } + + // add `EnableOriginalAudioWithEncodedRecordings` to the URL query string + if (getEnableOriginalAudioWithEncodedRecordings() != null) { + joiner.add(String.format("%sEnableOriginalAudioWithEncodedRecordings%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableOriginalAudioWithEncodedRecordings())))); + } + + // add `TunerHosts` to the URL query string + if (getTunerHosts() != null) { + for (int i = 0; i < getTunerHosts().size(); i++) { + if (getTunerHosts().get(i) != null) { + joiner.add(getTunerHosts().get(i).toUrlQueryString(String.format("%sTunerHosts%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ListingProviders` to the URL query string + if (getListingProviders() != null) { + for (int i = 0; i < getListingProviders().size(); i++) { + if (getListingProviders().get(i) != null) { + joiner.add(getListingProviders().get(i).toUrlQueryString(String.format("%sListingProviders%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `PrePaddingSeconds` to the URL query string + if (getPrePaddingSeconds() != null) { + joiner.add(String.format("%sPrePaddingSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrePaddingSeconds())))); + } + + // add `PostPaddingSeconds` to the URL query string + if (getPostPaddingSeconds() != null) { + joiner.add(String.format("%sPostPaddingSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPostPaddingSeconds())))); + } + + // add `MediaLocationsCreated` to the URL query string + if (getMediaLocationsCreated() != null) { + for (int i = 0; i < getMediaLocationsCreated().size(); i++) { + joiner.add(String.format("%sMediaLocationsCreated%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMediaLocationsCreated().get(i))))); + } + } + + // add `RecordingPostProcessor` to the URL query string + if (getRecordingPostProcessor() != null) { + joiner.add(String.format("%sRecordingPostProcessor%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRecordingPostProcessor())))); + } + + // add `RecordingPostProcessorArguments` to the URL query string + if (getRecordingPostProcessorArguments() != null) { + joiner.add(String.format("%sRecordingPostProcessorArguments%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRecordingPostProcessorArguments())))); + } + + // add `SaveRecordingNFO` to the URL query string + if (getSaveRecordingNFO() != null) { + joiner.add(String.format("%sSaveRecordingNFO%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSaveRecordingNFO())))); + } + + // add `SaveRecordingImages` to the URL query string + if (getSaveRecordingImages() != null) { + joiner.add(String.format("%sSaveRecordingImages%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSaveRecordingImages())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private LiveTvOptions instance; + + public Builder() { + this(new LiveTvOptions()); + } + + protected Builder(LiveTvOptions instance) { + this.instance = instance; + } + + public LiveTvOptions.Builder guideDays(Integer guideDays) { + this.instance.guideDays = guideDays; + return this; + } + + public LiveTvOptions.Builder recordingPath(String recordingPath) { + this.instance.recordingPath = recordingPath; + return this; + } + + public LiveTvOptions.Builder movieRecordingPath(String movieRecordingPath) { + this.instance.movieRecordingPath = movieRecordingPath; + return this; + } + + public LiveTvOptions.Builder seriesRecordingPath(String seriesRecordingPath) { + this.instance.seriesRecordingPath = seriesRecordingPath; + return this; + } + + public LiveTvOptions.Builder enableRecordingSubfolders(Boolean enableRecordingSubfolders) { + this.instance.enableRecordingSubfolders = enableRecordingSubfolders; + return this; + } + + public LiveTvOptions.Builder enableOriginalAudioWithEncodedRecordings( + Boolean enableOriginalAudioWithEncodedRecordings) { + this.instance.enableOriginalAudioWithEncodedRecordings = enableOriginalAudioWithEncodedRecordings; + return this; + } + + public LiveTvOptions.Builder tunerHosts(List tunerHosts) { + this.instance.tunerHosts = tunerHosts; + return this; + } + + public LiveTvOptions.Builder listingProviders(List listingProviders) { + this.instance.listingProviders = listingProviders; + return this; + } + + public LiveTvOptions.Builder prePaddingSeconds(Integer prePaddingSeconds) { + this.instance.prePaddingSeconds = prePaddingSeconds; + return this; + } + + public LiveTvOptions.Builder postPaddingSeconds(Integer postPaddingSeconds) { + this.instance.postPaddingSeconds = postPaddingSeconds; + return this; + } + + public LiveTvOptions.Builder mediaLocationsCreated(List mediaLocationsCreated) { + this.instance.mediaLocationsCreated = mediaLocationsCreated; + return this; + } + + public LiveTvOptions.Builder recordingPostProcessor(String recordingPostProcessor) { + this.instance.recordingPostProcessor = recordingPostProcessor; + return this; + } + + public LiveTvOptions.Builder recordingPostProcessorArguments(String recordingPostProcessorArguments) { + this.instance.recordingPostProcessorArguments = recordingPostProcessorArguments; + return this; + } + + public LiveTvOptions.Builder saveRecordingNFO(Boolean saveRecordingNFO) { + this.instance.saveRecordingNFO = saveRecordingNFO; + return this; + } + + public LiveTvOptions.Builder saveRecordingImages(Boolean saveRecordingImages) { + this.instance.saveRecordingImages = saveRecordingImages; + return this; + } + + /** + * returns a built LiveTvOptions instance. + * + * The builder is not reusable. + */ + public LiveTvOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LiveTvOptions.Builder builder() { + return new LiveTvOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LiveTvOptions.Builder toBuilder() { + return new LiveTvOptions.Builder().guideDays(getGuideDays()).recordingPath(getRecordingPath()) + .movieRecordingPath(getMovieRecordingPath()).seriesRecordingPath(getSeriesRecordingPath()) + .enableRecordingSubfolders(getEnableRecordingSubfolders()) + .enableOriginalAudioWithEncodedRecordings(getEnableOriginalAudioWithEncodedRecordings()) + .tunerHosts(getTunerHosts()).listingProviders(getListingProviders()) + .prePaddingSeconds(getPrePaddingSeconds()).postPaddingSeconds(getPostPaddingSeconds()) + .mediaLocationsCreated(getMediaLocationsCreated()).recordingPostProcessor(getRecordingPostProcessor()) + .recordingPostProcessorArguments(getRecordingPostProcessorArguments()) + .saveRecordingNFO(getSaveRecordingNFO()).saveRecordingImages(getSaveRecordingImages()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveTvServiceInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveTvServiceInfo.java new file mode 100644 index 0000000000000..d7b39b1dbc330 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveTvServiceInfo.java @@ -0,0 +1,490 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class ServiceInfo. + */ +@JsonPropertyOrder({ LiveTvServiceInfo.JSON_PROPERTY_NAME, LiveTvServiceInfo.JSON_PROPERTY_HOME_PAGE_URL, + LiveTvServiceInfo.JSON_PROPERTY_STATUS, LiveTvServiceInfo.JSON_PROPERTY_STATUS_MESSAGE, + LiveTvServiceInfo.JSON_PROPERTY_VERSION, LiveTvServiceInfo.JSON_PROPERTY_HAS_UPDATE_AVAILABLE, + LiveTvServiceInfo.JSON_PROPERTY_IS_VISIBLE, LiveTvServiceInfo.JSON_PROPERTY_TUNERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LiveTvServiceInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_HOME_PAGE_URL = "HomePageUrl"; + @org.eclipse.jdt.annotation.NonNull + private String homePageUrl; + + public static final String JSON_PROPERTY_STATUS = "Status"; + @org.eclipse.jdt.annotation.NonNull + private LiveTvServiceStatus status; + + public static final String JSON_PROPERTY_STATUS_MESSAGE = "StatusMessage"; + @org.eclipse.jdt.annotation.NonNull + private String statusMessage; + + public static final String JSON_PROPERTY_VERSION = "Version"; + @org.eclipse.jdt.annotation.NonNull + private String version; + + public static final String JSON_PROPERTY_HAS_UPDATE_AVAILABLE = "HasUpdateAvailable"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasUpdateAvailable; + + public static final String JSON_PROPERTY_IS_VISIBLE = "IsVisible"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isVisible; + + public static final String JSON_PROPERTY_TUNERS = "Tuners"; + @org.eclipse.jdt.annotation.NonNull + private List tuners; + + public LiveTvServiceInfo() { + } + + public LiveTvServiceInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public LiveTvServiceInfo homePageUrl(@org.eclipse.jdt.annotation.NonNull String homePageUrl) { + this.homePageUrl = homePageUrl; + return this; + } + + /** + * Gets or sets the home page URL. + * + * @return homePageUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HOME_PAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHomePageUrl() { + return homePageUrl; + } + + @JsonProperty(JSON_PROPERTY_HOME_PAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHomePageUrl(@org.eclipse.jdt.annotation.NonNull String homePageUrl) { + this.homePageUrl = homePageUrl; + } + + public LiveTvServiceInfo status(@org.eclipse.jdt.annotation.NonNull LiveTvServiceStatus status) { + this.status = status; + return this; + } + + /** + * Gets or sets the status. + * + * @return status + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LiveTvServiceStatus getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@org.eclipse.jdt.annotation.NonNull LiveTvServiceStatus status) { + this.status = status; + } + + public LiveTvServiceInfo statusMessage(@org.eclipse.jdt.annotation.NonNull String statusMessage) { + this.statusMessage = statusMessage; + return this; + } + + /** + * Gets or sets the status message. + * + * @return statusMessage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATUS_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatusMessage() { + return statusMessage; + } + + @JsonProperty(JSON_PROPERTY_STATUS_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatusMessage(@org.eclipse.jdt.annotation.NonNull String statusMessage) { + this.statusMessage = statusMessage; + } + + public LiveTvServiceInfo version(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + return this; + } + + /** + * Gets or sets the version. + * + * @return version + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + } + + public LiveTvServiceInfo hasUpdateAvailable(@org.eclipse.jdt.annotation.NonNull Boolean hasUpdateAvailable) { + this.hasUpdateAvailable = hasUpdateAvailable; + return this; + } + + /** + * Gets or sets a value indicating whether this instance has update available. + * + * @return hasUpdateAvailable + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_UPDATE_AVAILABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasUpdateAvailable() { + return hasUpdateAvailable; + } + + @JsonProperty(JSON_PROPERTY_HAS_UPDATE_AVAILABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasUpdateAvailable(@org.eclipse.jdt.annotation.NonNull Boolean hasUpdateAvailable) { + this.hasUpdateAvailable = hasUpdateAvailable; + } + + public LiveTvServiceInfo isVisible(@org.eclipse.jdt.annotation.NonNull Boolean isVisible) { + this.isVisible = isVisible; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is visible. + * + * @return isVisible + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_VISIBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsVisible() { + return isVisible; + } + + @JsonProperty(JSON_PROPERTY_IS_VISIBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsVisible(@org.eclipse.jdt.annotation.NonNull Boolean isVisible) { + this.isVisible = isVisible; + } + + public LiveTvServiceInfo tuners(@org.eclipse.jdt.annotation.NonNull List tuners) { + this.tuners = tuners; + return this; + } + + public LiveTvServiceInfo addTunersItem(String tunersItem) { + if (this.tuners == null) { + this.tuners = new ArrayList<>(); + } + this.tuners.add(tunersItem); + return this; + } + + /** + * Get tuners + * + * @return tuners + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TUNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTuners() { + return tuners; + } + + @JsonProperty(JSON_PROPERTY_TUNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTuners(@org.eclipse.jdt.annotation.NonNull List tuners) { + this.tuners = tuners; + } + + /** + * Return true if this LiveTvServiceInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LiveTvServiceInfo liveTvServiceInfo = (LiveTvServiceInfo) o; + return Objects.equals(this.name, liveTvServiceInfo.name) + && Objects.equals(this.homePageUrl, liveTvServiceInfo.homePageUrl) + && Objects.equals(this.status, liveTvServiceInfo.status) + && Objects.equals(this.statusMessage, liveTvServiceInfo.statusMessage) + && Objects.equals(this.version, liveTvServiceInfo.version) + && Objects.equals(this.hasUpdateAvailable, liveTvServiceInfo.hasUpdateAvailable) + && Objects.equals(this.isVisible, liveTvServiceInfo.isVisible) + && Objects.equals(this.tuners, liveTvServiceInfo.tuners); + } + + @Override + public int hashCode() { + return Objects.hash(name, homePageUrl, status, statusMessage, version, hasUpdateAvailable, isVisible, tuners); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LiveTvServiceInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" homePageUrl: ").append(toIndentedString(homePageUrl)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" statusMessage: ").append(toIndentedString(statusMessage)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" hasUpdateAvailable: ").append(toIndentedString(hasUpdateAvailable)).append("\n"); + sb.append(" isVisible: ").append(toIndentedString(isVisible)).append("\n"); + sb.append(" tuners: ").append(toIndentedString(tuners)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `HomePageUrl` to the URL query string + if (getHomePageUrl() != null) { + joiner.add(String.format("%sHomePageUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHomePageUrl())))); + } + + // add `Status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sStatus%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `StatusMessage` to the URL query string + if (getStatusMessage() != null) { + joiner.add(String.format("%sStatusMessage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStatusMessage())))); + } + + // add `Version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format("%sVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `HasUpdateAvailable` to the URL query string + if (getHasUpdateAvailable() != null) { + joiner.add(String.format("%sHasUpdateAvailable%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasUpdateAvailable())))); + } + + // add `IsVisible` to the URL query string + if (getIsVisible() != null) { + joiner.add(String.format("%sIsVisible%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsVisible())))); + } + + // add `Tuners` to the URL query string + if (getTuners() != null) { + for (int i = 0; i < getTuners().size(); i++) { + joiner.add(String.format("%sTuners%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getTuners().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private LiveTvServiceInfo instance; + + public Builder() { + this(new LiveTvServiceInfo()); + } + + protected Builder(LiveTvServiceInfo instance) { + this.instance = instance; + } + + public LiveTvServiceInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public LiveTvServiceInfo.Builder homePageUrl(String homePageUrl) { + this.instance.homePageUrl = homePageUrl; + return this; + } + + public LiveTvServiceInfo.Builder status(LiveTvServiceStatus status) { + this.instance.status = status; + return this; + } + + public LiveTvServiceInfo.Builder statusMessage(String statusMessage) { + this.instance.statusMessage = statusMessage; + return this; + } + + public LiveTvServiceInfo.Builder version(String version) { + this.instance.version = version; + return this; + } + + public LiveTvServiceInfo.Builder hasUpdateAvailable(Boolean hasUpdateAvailable) { + this.instance.hasUpdateAvailable = hasUpdateAvailable; + return this; + } + + public LiveTvServiceInfo.Builder isVisible(Boolean isVisible) { + this.instance.isVisible = isVisible; + return this; + } + + public LiveTvServiceInfo.Builder tuners(List tuners) { + this.instance.tuners = tuners; + return this; + } + + /** + * returns a built LiveTvServiceInfo instance. + * + * The builder is not reusable. + */ + public LiveTvServiceInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LiveTvServiceInfo.Builder builder() { + return new LiveTvServiceInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LiveTvServiceInfo.Builder toBuilder() { + return new LiveTvServiceInfo.Builder().name(getName()).homePageUrl(getHomePageUrl()).status(getStatus()) + .statusMessage(getStatusMessage()).version(getVersion()).hasUpdateAvailable(getHasUpdateAvailable()) + .isVisible(getIsVisible()).tuners(getTuners()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveTvServiceStatus.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveTvServiceStatus.java new file mode 100644 index 0000000000000..bbad62e611b57 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LiveTvServiceStatus.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets LiveTvServiceStatus + */ +public enum LiveTvServiceStatus { + + OK("Ok"), + + UNAVAILABLE("Unavailable"); + + private String value; + + LiveTvServiceStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LiveTvServiceStatus fromValue(String value) { + for (LiveTvServiceStatus b : LiveTvServiceStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LocalizationOption.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LocalizationOption.java new file mode 100644 index 0000000000000..a765d287cb176 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LocalizationOption.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * LocalizationOption + */ +@JsonPropertyOrder({ LocalizationOption.JSON_PROPERTY_NAME, LocalizationOption.JSON_PROPERTY_VALUE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LocalizationOption { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_VALUE = "Value"; + @org.eclipse.jdt.annotation.NonNull + private String value; + + public LocalizationOption() { + } + + public LocalizationOption name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public LocalizationOption value(@org.eclipse.jdt.annotation.NonNull String value) { + this.value = value; + return this; + } + + /** + * Get value + * + * @return value + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@org.eclipse.jdt.annotation.NonNull String value) { + this.value = value; + } + + /** + * Return true if this LocalizationOption object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LocalizationOption localizationOption = (LocalizationOption) o; + return Objects.equals(this.name, localizationOption.name) + && Objects.equals(this.value, localizationOption.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LocalizationOption {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Value` to the URL query string + if (getValue() != null) { + joiner.add(String.format("%sValue%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getValue())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private LocalizationOption instance; + + public Builder() { + this(new LocalizationOption()); + } + + protected Builder(LocalizationOption instance) { + this.instance = instance; + } + + public LocalizationOption.Builder name(String name) { + this.instance.name = name; + return this; + } + + public LocalizationOption.Builder value(String value) { + this.instance.value = value; + return this; + } + + /** + * returns a built LocalizationOption instance. + * + * The builder is not reusable. + */ + public LocalizationOption build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LocalizationOption.Builder builder() { + return new LocalizationOption.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LocalizationOption.Builder toBuilder() { + return new LocalizationOption.Builder().name(getName()).value(getValue()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LocationType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LocationType.java new file mode 100644 index 0000000000000..637a6c7d10641 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LocationType.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum LocationType. + */ +public enum LocationType { + + FILE_SYSTEM("FileSystem"), + + REMOTE("Remote"), + + VIRTUAL("Virtual"), + + OFFLINE("Offline"); + + private String value; + + LocationType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LocationType fromValue(String value) { + for (LocationType b : LocationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LogFile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LogFile.java new file mode 100644 index 0000000000000..0e3abeb96e0eb --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LogFile.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * LogFile + */ +@JsonPropertyOrder({ LogFile.JSON_PROPERTY_DATE_CREATED, LogFile.JSON_PROPERTY_DATE_MODIFIED, + LogFile.JSON_PROPERTY_SIZE, LogFile.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LogFile { + public static final String JSON_PROPERTY_DATE_CREATED = "DateCreated"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateCreated; + + public static final String JSON_PROPERTY_DATE_MODIFIED = "DateModified"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateModified; + + public static final String JSON_PROPERTY_SIZE = "Size"; + @org.eclipse.jdt.annotation.NonNull + private Long size; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public LogFile() { + } + + public LogFile dateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + return this; + } + + /** + * Gets or sets the date created. + * + * @return dateCreated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateCreated() { + return dateCreated; + } + + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + } + + public LogFile dateModified(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateModified) { + this.dateModified = dateModified; + return this; + } + + /** + * Gets or sets the date modified. + * + * @return dateModified + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateModified() { + return dateModified; + } + + @JsonProperty(JSON_PROPERTY_DATE_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateModified(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateModified) { + this.dateModified = dateModified; + } + + public LogFile size(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + return this; + } + + /** + * Gets or sets the size. + * + * @return size + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSize() { + return size; + } + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSize(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + } + + public LogFile name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + /** + * Return true if this LogFile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogFile logFile = (LogFile) o; + return Objects.equals(this.dateCreated, logFile.dateCreated) + && Objects.equals(this.dateModified, logFile.dateModified) && Objects.equals(this.size, logFile.size) + && Objects.equals(this.name, logFile.name); + } + + @Override + public int hashCode() { + return Objects.hash(dateCreated, dateModified, size, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogFile {\n"); + sb.append(" dateCreated: ").append(toIndentedString(dateCreated)).append("\n"); + sb.append(" dateModified: ").append(toIndentedString(dateModified)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `DateCreated` to the URL query string + if (getDateCreated() != null) { + joiner.add(String.format("%sDateCreated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateCreated())))); + } + + // add `DateModified` to the URL query string + if (getDateModified() != null) { + joiner.add(String.format("%sDateModified%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateModified())))); + } + + // add `Size` to the URL query string + if (getSize() != null) { + joiner.add(String.format("%sSize%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSize())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private LogFile instance; + + public Builder() { + this(new LogFile()); + } + + protected Builder(LogFile instance) { + this.instance = instance; + } + + public LogFile.Builder dateCreated(OffsetDateTime dateCreated) { + this.instance.dateCreated = dateCreated; + return this; + } + + public LogFile.Builder dateModified(OffsetDateTime dateModified) { + this.instance.dateModified = dateModified; + return this; + } + + public LogFile.Builder size(Long size) { + this.instance.size = size; + return this; + } + + public LogFile.Builder name(String name) { + this.instance.name = name; + return this; + } + + /** + * returns a built LogFile instance. + * + * The builder is not reusable. + */ + public LogFile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LogFile.Builder builder() { + return new LogFile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LogFile.Builder toBuilder() { + return new LogFile.Builder().dateCreated(getDateCreated()).dateModified(getDateModified()).size(getSize()) + .name(getName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LogLevel.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LogLevel.java new file mode 100644 index 0000000000000..8a4d7c79f6349 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LogLevel.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets LogLevel + */ +public enum LogLevel { + + TRACE("Trace"), + + DEBUG("Debug"), + + INFORMATION("Information"), + + WARNING("Warning"), + + ERROR("Error"), + + CRITICAL("Critical"), + + NONE("None"); + + private String value; + + LogLevel(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LogLevel fromValue(String value) { + for (LogLevel b : LogLevel.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LyricDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LyricDto.java new file mode 100644 index 0000000000000..f8c4439fbe4ca --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LyricDto.java @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * LyricResponse model. + */ +@JsonPropertyOrder({ LyricDto.JSON_PROPERTY_METADATA, LyricDto.JSON_PROPERTY_LYRICS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LyricDto { + public static final String JSON_PROPERTY_METADATA = "Metadata"; + @org.eclipse.jdt.annotation.NonNull + private LyricMetadata metadata; + + public static final String JSON_PROPERTY_LYRICS = "Lyrics"; + @org.eclipse.jdt.annotation.NonNull + private List lyrics = new ArrayList<>(); + + public LyricDto() { + } + + public LyricDto metadata(@org.eclipse.jdt.annotation.NonNull LyricMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Gets or sets Metadata for the lyrics. + * + * @return metadata + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LyricMetadata getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@org.eclipse.jdt.annotation.NonNull LyricMetadata metadata) { + this.metadata = metadata; + } + + public LyricDto lyrics(@org.eclipse.jdt.annotation.NonNull List lyrics) { + this.lyrics = lyrics; + return this; + } + + public LyricDto addLyricsItem(LyricLine lyricsItem) { + if (this.lyrics == null) { + this.lyrics = new ArrayList<>(); + } + this.lyrics.add(lyricsItem); + return this; + } + + /** + * Gets or sets a collection of individual lyric lines. + * + * @return lyrics + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LYRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLyrics() { + return lyrics; + } + + @JsonProperty(JSON_PROPERTY_LYRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLyrics(@org.eclipse.jdt.annotation.NonNull List lyrics) { + this.lyrics = lyrics; + } + + /** + * Return true if this LyricDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LyricDto lyricDto = (LyricDto) o; + return Objects.equals(this.metadata, lyricDto.metadata) && Objects.equals(this.lyrics, lyricDto.lyrics); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, lyrics); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LyricDto {\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" lyrics: ").append(toIndentedString(lyrics)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Metadata` to the URL query string + if (getMetadata() != null) { + joiner.add(getMetadata().toUrlQueryString(prefix + "Metadata" + suffix)); + } + + // add `Lyrics` to the URL query string + if (getLyrics() != null) { + for (int i = 0; i < getLyrics().size(); i++) { + if (getLyrics().get(i) != null) { + joiner.add(getLyrics().get(i).toUrlQueryString(String.format("%sLyrics%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private LyricDto instance; + + public Builder() { + this(new LyricDto()); + } + + protected Builder(LyricDto instance) { + this.instance = instance; + } + + public LyricDto.Builder metadata(LyricMetadata metadata) { + this.instance.metadata = metadata; + return this; + } + + public LyricDto.Builder lyrics(List lyrics) { + this.instance.lyrics = lyrics; + return this; + } + + /** + * returns a built LyricDto instance. + * + * The builder is not reusable. + */ + public LyricDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LyricDto.Builder builder() { + return new LyricDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LyricDto.Builder toBuilder() { + return new LyricDto.Builder().metadata(getMetadata()).lyrics(getLyrics()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LyricLine.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LyricLine.java new file mode 100644 index 0000000000000..906b4709e1fed --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LyricLine.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Lyric model. + */ +@JsonPropertyOrder({ LyricLine.JSON_PROPERTY_TEXT, LyricLine.JSON_PROPERTY_START }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LyricLine { + public static final String JSON_PROPERTY_TEXT = "Text"; + @org.eclipse.jdt.annotation.NonNull + private String text; + + public static final String JSON_PROPERTY_START = "Start"; + @org.eclipse.jdt.annotation.NonNull + private Long start; + + public LyricLine() { + } + + public LyricLine text(@org.eclipse.jdt.annotation.NonNull String text) { + this.text = text; + return this; + } + + /** + * Gets the text of this lyric line. + * + * @return text + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getText() { + return text; + } + + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setText(@org.eclipse.jdt.annotation.NonNull String text) { + this.text = text; + } + + public LyricLine start(@org.eclipse.jdt.annotation.NonNull Long start) { + this.start = start; + return this; + } + + /** + * Gets the start time in ticks. + * + * @return start + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStart() { + return start; + } + + @JsonProperty(JSON_PROPERTY_START) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStart(@org.eclipse.jdt.annotation.NonNull Long start) { + this.start = start; + } + + /** + * Return true if this LyricLine object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LyricLine lyricLine = (LyricLine) o; + return Objects.equals(this.text, lyricLine.text) && Objects.equals(this.start, lyricLine.start); + } + + @Override + public int hashCode() { + return Objects.hash(text, start); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LyricLine {\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" start: ").append(toIndentedString(start)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Text` to the URL query string + if (getText() != null) { + joiner.add(String.format("%sText%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getText())))); + } + + // add `Start` to the URL query string + if (getStart() != null) { + joiner.add(String.format("%sStart%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStart())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private LyricLine instance; + + public Builder() { + this(new LyricLine()); + } + + protected Builder(LyricLine instance) { + this.instance = instance; + } + + public LyricLine.Builder text(String text) { + this.instance.text = text; + return this; + } + + public LyricLine.Builder start(Long start) { + this.instance.start = start; + return this; + } + + /** + * returns a built LyricLine instance. + * + * The builder is not reusable. + */ + public LyricLine build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LyricLine.Builder builder() { + return new LyricLine.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LyricLine.Builder toBuilder() { + return new LyricLine.Builder().text(getText()).start(getStart()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LyricMetadata.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LyricMetadata.java new file mode 100644 index 0000000000000..70105d6bfedac --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/LyricMetadata.java @@ -0,0 +1,554 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * LyricMetadata model. + */ +@JsonPropertyOrder({ LyricMetadata.JSON_PROPERTY_ARTIST, LyricMetadata.JSON_PROPERTY_ALBUM, + LyricMetadata.JSON_PROPERTY_TITLE, LyricMetadata.JSON_PROPERTY_AUTHOR, LyricMetadata.JSON_PROPERTY_LENGTH, + LyricMetadata.JSON_PROPERTY_BY, LyricMetadata.JSON_PROPERTY_OFFSET, LyricMetadata.JSON_PROPERTY_CREATOR, + LyricMetadata.JSON_PROPERTY_VERSION, LyricMetadata.JSON_PROPERTY_IS_SYNCED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LyricMetadata { + public static final String JSON_PROPERTY_ARTIST = "Artist"; + @org.eclipse.jdt.annotation.NonNull + private String artist; + + public static final String JSON_PROPERTY_ALBUM = "Album"; + @org.eclipse.jdt.annotation.NonNull + private String album; + + public static final String JSON_PROPERTY_TITLE = "Title"; + @org.eclipse.jdt.annotation.NonNull + private String title; + + public static final String JSON_PROPERTY_AUTHOR = "Author"; + @org.eclipse.jdt.annotation.NonNull + private String author; + + public static final String JSON_PROPERTY_LENGTH = "Length"; + @org.eclipse.jdt.annotation.NonNull + private Long length; + + public static final String JSON_PROPERTY_BY = "By"; + @org.eclipse.jdt.annotation.NonNull + private String by; + + public static final String JSON_PROPERTY_OFFSET = "Offset"; + @org.eclipse.jdt.annotation.NonNull + private Long offset; + + public static final String JSON_PROPERTY_CREATOR = "Creator"; + @org.eclipse.jdt.annotation.NonNull + private String creator; + + public static final String JSON_PROPERTY_VERSION = "Version"; + @org.eclipse.jdt.annotation.NonNull + private String version; + + public static final String JSON_PROPERTY_IS_SYNCED = "IsSynced"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isSynced; + + public LyricMetadata() { + } + + public LyricMetadata artist(@org.eclipse.jdt.annotation.NonNull String artist) { + this.artist = artist; + return this; + } + + /** + * Gets or sets the song artist. + * + * @return artist + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getArtist() { + return artist; + } + + @JsonProperty(JSON_PROPERTY_ARTIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtist(@org.eclipse.jdt.annotation.NonNull String artist) { + this.artist = artist; + } + + public LyricMetadata album(@org.eclipse.jdt.annotation.NonNull String album) { + this.album = album; + return this; + } + + /** + * Gets or sets the album this song is on. + * + * @return album + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlbum() { + return album; + } + + @JsonProperty(JSON_PROPERTY_ALBUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbum(@org.eclipse.jdt.annotation.NonNull String album) { + this.album = album; + } + + public LyricMetadata title(@org.eclipse.jdt.annotation.NonNull String title) { + this.title = title; + return this; + } + + /** + * Gets or sets the title of the song. + * + * @return title + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@org.eclipse.jdt.annotation.NonNull String title) { + this.title = title; + } + + public LyricMetadata author(@org.eclipse.jdt.annotation.NonNull String author) { + this.author = author; + return this; + } + + /** + * Gets or sets the author of the lyric data. + * + * @return author + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTHOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthor() { + return author; + } + + @JsonProperty(JSON_PROPERTY_AUTHOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthor(@org.eclipse.jdt.annotation.NonNull String author) { + this.author = author; + } + + public LyricMetadata length(@org.eclipse.jdt.annotation.NonNull Long length) { + this.length = length; + return this; + } + + /** + * Gets or sets the length of the song in ticks. + * + * @return length + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getLength() { + return length; + } + + @JsonProperty(JSON_PROPERTY_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLength(@org.eclipse.jdt.annotation.NonNull Long length) { + this.length = length; + } + + public LyricMetadata by(@org.eclipse.jdt.annotation.NonNull String by) { + this.by = by; + return this; + } + + /** + * Gets or sets who the LRC file was created by. + * + * @return by + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBy() { + return by; + } + + @JsonProperty(JSON_PROPERTY_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBy(@org.eclipse.jdt.annotation.NonNull String by) { + this.by = by; + } + + public LyricMetadata offset(@org.eclipse.jdt.annotation.NonNull Long offset) { + this.offset = offset; + return this; + } + + /** + * Gets or sets the lyric offset compared to audio in ticks. + * + * @return offset + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOffset() { + return offset; + } + + @JsonProperty(JSON_PROPERTY_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOffset(@org.eclipse.jdt.annotation.NonNull Long offset) { + this.offset = offset; + } + + public LyricMetadata creator(@org.eclipse.jdt.annotation.NonNull String creator) { + this.creator = creator; + return this; + } + + /** + * Gets or sets the software used to create the LRC file. + * + * @return creator + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CREATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreator() { + return creator; + } + + @JsonProperty(JSON_PROPERTY_CREATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreator(@org.eclipse.jdt.annotation.NonNull String creator) { + this.creator = creator; + } + + public LyricMetadata version(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + return this; + } + + /** + * Gets or sets the version of the creator used. + * + * @return version + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + } + + public LyricMetadata isSynced(@org.eclipse.jdt.annotation.NonNull Boolean isSynced) { + this.isSynced = isSynced; + return this; + } + + /** + * Gets or sets a value indicating whether this lyric is synced. + * + * @return isSynced + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_SYNCED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsSynced() { + return isSynced; + } + + @JsonProperty(JSON_PROPERTY_IS_SYNCED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsSynced(@org.eclipse.jdt.annotation.NonNull Boolean isSynced) { + this.isSynced = isSynced; + } + + /** + * Return true if this LyricMetadata object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LyricMetadata lyricMetadata = (LyricMetadata) o; + return Objects.equals(this.artist, lyricMetadata.artist) && Objects.equals(this.album, lyricMetadata.album) + && Objects.equals(this.title, lyricMetadata.title) && Objects.equals(this.author, lyricMetadata.author) + && Objects.equals(this.length, lyricMetadata.length) && Objects.equals(this.by, lyricMetadata.by) + && Objects.equals(this.offset, lyricMetadata.offset) + && Objects.equals(this.creator, lyricMetadata.creator) + && Objects.equals(this.version, lyricMetadata.version) + && Objects.equals(this.isSynced, lyricMetadata.isSynced); + } + + @Override + public int hashCode() { + return Objects.hash(artist, album, title, author, length, by, offset, creator, version, isSynced); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LyricMetadata {\n"); + sb.append(" artist: ").append(toIndentedString(artist)).append("\n"); + sb.append(" album: ").append(toIndentedString(album)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" author: ").append(toIndentedString(author)).append("\n"); + sb.append(" length: ").append(toIndentedString(length)).append("\n"); + sb.append(" by: ").append(toIndentedString(by)).append("\n"); + sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); + sb.append(" creator: ").append(toIndentedString(creator)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" isSynced: ").append(toIndentedString(isSynced)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Artist` to the URL query string + if (getArtist() != null) { + joiner.add(String.format("%sArtist%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getArtist())))); + } + + // add `Album` to the URL query string + if (getAlbum() != null) { + joiner.add(String.format("%sAlbum%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbum())))); + } + + // add `Title` to the URL query string + if (getTitle() != null) { + joiner.add(String.format("%sTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTitle())))); + } + + // add `Author` to the URL query string + if (getAuthor() != null) { + joiner.add(String.format("%sAuthor%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAuthor())))); + } + + // add `Length` to the URL query string + if (getLength() != null) { + joiner.add(String.format("%sLength%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLength())))); + } + + // add `By` to the URL query string + if (getBy() != null) { + joiner.add( + String.format("%sBy%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBy())))); + } + + // add `Offset` to the URL query string + if (getOffset() != null) { + joiner.add(String.format("%sOffset%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOffset())))); + } + + // add `Creator` to the URL query string + if (getCreator() != null) { + joiner.add(String.format("%sCreator%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCreator())))); + } + + // add `Version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format("%sVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `IsSynced` to the URL query string + if (getIsSynced() != null) { + joiner.add(String.format("%sIsSynced%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsSynced())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private LyricMetadata instance; + + public Builder() { + this(new LyricMetadata()); + } + + protected Builder(LyricMetadata instance) { + this.instance = instance; + } + + public LyricMetadata.Builder artist(String artist) { + this.instance.artist = artist; + return this; + } + + public LyricMetadata.Builder album(String album) { + this.instance.album = album; + return this; + } + + public LyricMetadata.Builder title(String title) { + this.instance.title = title; + return this; + } + + public LyricMetadata.Builder author(String author) { + this.instance.author = author; + return this; + } + + public LyricMetadata.Builder length(Long length) { + this.instance.length = length; + return this; + } + + public LyricMetadata.Builder by(String by) { + this.instance.by = by; + return this; + } + + public LyricMetadata.Builder offset(Long offset) { + this.instance.offset = offset; + return this; + } + + public LyricMetadata.Builder creator(String creator) { + this.instance.creator = creator; + return this; + } + + public LyricMetadata.Builder version(String version) { + this.instance.version = version; + return this; + } + + public LyricMetadata.Builder isSynced(Boolean isSynced) { + this.instance.isSynced = isSynced; + return this; + } + + /** + * returns a built LyricMetadata instance. + * + * The builder is not reusable. + */ + public LyricMetadata build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LyricMetadata.Builder builder() { + return new LyricMetadata.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LyricMetadata.Builder toBuilder() { + return new LyricMetadata.Builder().artist(getArtist()).album(getAlbum()).title(getTitle()).author(getAuthor()) + .length(getLength()).by(getBy()).offset(getOffset()).creator(getCreator()).version(getVersion()) + .isSynced(getIsSynced()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaAttachment.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaAttachment.java new file mode 100644 index 0000000000000..3985650941fec --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaAttachment.java @@ -0,0 +1,436 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class MediaAttachment. + */ +@JsonPropertyOrder({ MediaAttachment.JSON_PROPERTY_CODEC, MediaAttachment.JSON_PROPERTY_CODEC_TAG, + MediaAttachment.JSON_PROPERTY_COMMENT, MediaAttachment.JSON_PROPERTY_INDEX, + MediaAttachment.JSON_PROPERTY_FILE_NAME, MediaAttachment.JSON_PROPERTY_MIME_TYPE, + MediaAttachment.JSON_PROPERTY_DELIVERY_URL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaAttachment { + public static final String JSON_PROPERTY_CODEC = "Codec"; + @org.eclipse.jdt.annotation.NonNull + private String codec; + + public static final String JSON_PROPERTY_CODEC_TAG = "CodecTag"; + @org.eclipse.jdt.annotation.NonNull + private String codecTag; + + public static final String JSON_PROPERTY_COMMENT = "Comment"; + @org.eclipse.jdt.annotation.NonNull + private String comment; + + public static final String JSON_PROPERTY_INDEX = "Index"; + @org.eclipse.jdt.annotation.NonNull + private Integer index; + + public static final String JSON_PROPERTY_FILE_NAME = "FileName"; + @org.eclipse.jdt.annotation.NonNull + private String fileName; + + public static final String JSON_PROPERTY_MIME_TYPE = "MimeType"; + @org.eclipse.jdt.annotation.NonNull + private String mimeType; + + public static final String JSON_PROPERTY_DELIVERY_URL = "DeliveryUrl"; + @org.eclipse.jdt.annotation.NonNull + private String deliveryUrl; + + public MediaAttachment() { + } + + public MediaAttachment codec(@org.eclipse.jdt.annotation.NonNull String codec) { + this.codec = codec; + return this; + } + + /** + * Gets or sets the codec. + * + * @return codec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCodec() { + return codec; + } + + @JsonProperty(JSON_PROPERTY_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCodec(@org.eclipse.jdt.annotation.NonNull String codec) { + this.codec = codec; + } + + public MediaAttachment codecTag(@org.eclipse.jdt.annotation.NonNull String codecTag) { + this.codecTag = codecTag; + return this; + } + + /** + * Gets or sets the codec tag. + * + * @return codecTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODEC_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCodecTag() { + return codecTag; + } + + @JsonProperty(JSON_PROPERTY_CODEC_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCodecTag(@org.eclipse.jdt.annotation.NonNull String codecTag) { + this.codecTag = codecTag; + } + + public MediaAttachment comment(@org.eclipse.jdt.annotation.NonNull String comment) { + this.comment = comment; + return this; + } + + /** + * Gets or sets the comment. + * + * @return comment + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getComment() { + return comment; + } + + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComment(@org.eclipse.jdt.annotation.NonNull String comment) { + this.comment = comment; + } + + public MediaAttachment index(@org.eclipse.jdt.annotation.NonNull Integer index) { + this.index = index; + return this; + } + + /** + * Gets or sets the index. + * + * @return index + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndex() { + return index; + } + + @JsonProperty(JSON_PROPERTY_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndex(@org.eclipse.jdt.annotation.NonNull Integer index) { + this.index = index; + } + + public MediaAttachment fileName(@org.eclipse.jdt.annotation.NonNull String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Gets or sets the filename. + * + * @return fileName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FILE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFileName() { + return fileName; + } + + @JsonProperty(JSON_PROPERTY_FILE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileName(@org.eclipse.jdt.annotation.NonNull String fileName) { + this.fileName = fileName; + } + + public MediaAttachment mimeType(@org.eclipse.jdt.annotation.NonNull String mimeType) { + this.mimeType = mimeType; + return this; + } + + /** + * Gets or sets the MIME type. + * + * @return mimeType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIME_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMimeType() { + return mimeType; + } + + @JsonProperty(JSON_PROPERTY_MIME_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMimeType(@org.eclipse.jdt.annotation.NonNull String mimeType) { + this.mimeType = mimeType; + } + + public MediaAttachment deliveryUrl(@org.eclipse.jdt.annotation.NonNull String deliveryUrl) { + this.deliveryUrl = deliveryUrl; + return this; + } + + /** + * Gets or sets the delivery URL. + * + * @return deliveryUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DELIVERY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeliveryUrl() { + return deliveryUrl; + } + + @JsonProperty(JSON_PROPERTY_DELIVERY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeliveryUrl(@org.eclipse.jdt.annotation.NonNull String deliveryUrl) { + this.deliveryUrl = deliveryUrl; + } + + /** + * Return true if this MediaAttachment object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaAttachment mediaAttachment = (MediaAttachment) o; + return Objects.equals(this.codec, mediaAttachment.codec) + && Objects.equals(this.codecTag, mediaAttachment.codecTag) + && Objects.equals(this.comment, mediaAttachment.comment) + && Objects.equals(this.index, mediaAttachment.index) + && Objects.equals(this.fileName, mediaAttachment.fileName) + && Objects.equals(this.mimeType, mediaAttachment.mimeType) + && Objects.equals(this.deliveryUrl, mediaAttachment.deliveryUrl); + } + + @Override + public int hashCode() { + return Objects.hash(codec, codecTag, comment, index, fileName, mimeType, deliveryUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaAttachment {\n"); + sb.append(" codec: ").append(toIndentedString(codec)).append("\n"); + sb.append(" codecTag: ").append(toIndentedString(codecTag)).append("\n"); + sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" fileName: ").append(toIndentedString(fileName)).append("\n"); + sb.append(" mimeType: ").append(toIndentedString(mimeType)).append("\n"); + sb.append(" deliveryUrl: ").append(toIndentedString(deliveryUrl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Codec` to the URL query string + if (getCodec() != null) { + joiner.add(String.format("%sCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCodec())))); + } + + // add `CodecTag` to the URL query string + if (getCodecTag() != null) { + joiner.add(String.format("%sCodecTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCodecTag())))); + } + + // add `Comment` to the URL query string + if (getComment() != null) { + joiner.add(String.format("%sComment%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getComment())))); + } + + // add `Index` to the URL query string + if (getIndex() != null) { + joiner.add(String.format("%sIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndex())))); + } + + // add `FileName` to the URL query string + if (getFileName() != null) { + joiner.add(String.format("%sFileName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFileName())))); + } + + // add `MimeType` to the URL query string + if (getMimeType() != null) { + joiner.add(String.format("%sMimeType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMimeType())))); + } + + // add `DeliveryUrl` to the URL query string + if (getDeliveryUrl() != null) { + joiner.add(String.format("%sDeliveryUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeliveryUrl())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaAttachment instance; + + public Builder() { + this(new MediaAttachment()); + } + + protected Builder(MediaAttachment instance) { + this.instance = instance; + } + + public MediaAttachment.Builder codec(String codec) { + this.instance.codec = codec; + return this; + } + + public MediaAttachment.Builder codecTag(String codecTag) { + this.instance.codecTag = codecTag; + return this; + } + + public MediaAttachment.Builder comment(String comment) { + this.instance.comment = comment; + return this; + } + + public MediaAttachment.Builder index(Integer index) { + this.instance.index = index; + return this; + } + + public MediaAttachment.Builder fileName(String fileName) { + this.instance.fileName = fileName; + return this; + } + + public MediaAttachment.Builder mimeType(String mimeType) { + this.instance.mimeType = mimeType; + return this; + } + + public MediaAttachment.Builder deliveryUrl(String deliveryUrl) { + this.instance.deliveryUrl = deliveryUrl; + return this; + } + + /** + * returns a built MediaAttachment instance. + * + * The builder is not reusable. + */ + public MediaAttachment build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaAttachment.Builder builder() { + return new MediaAttachment.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaAttachment.Builder toBuilder() { + return new MediaAttachment.Builder().codec(getCodec()).codecTag(getCodecTag()).comment(getComment()) + .index(getIndex()).fileName(getFileName()).mimeType(getMimeType()).deliveryUrl(getDeliveryUrl()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaPathDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaPathDto.java new file mode 100644 index 0000000000000..fe360a5fdd2c8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaPathDto.java @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Media Path dto. + */ +@JsonPropertyOrder({ MediaPathDto.JSON_PROPERTY_NAME, MediaPathDto.JSON_PROPERTY_PATH, + MediaPathDto.JSON_PROPERTY_PATH_INFO }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaPathDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_PATH_INFO = "PathInfo"; + @org.eclipse.jdt.annotation.NonNull + private MediaPathInfo pathInfo; + + public MediaPathDto() { + } + + public MediaPathDto name(@org.eclipse.jdt.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name of the library. + * + * @return name + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@org.eclipse.jdt.annotation.Nullable String name) { + this.name = name; + } + + public MediaPathDto path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path to add. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public MediaPathDto pathInfo(@org.eclipse.jdt.annotation.NonNull MediaPathInfo pathInfo) { + this.pathInfo = pathInfo; + return this; + } + + /** + * Gets or sets the path info. + * + * @return pathInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaPathInfo getPathInfo() { + return pathInfo; + } + + @JsonProperty(JSON_PROPERTY_PATH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPathInfo(@org.eclipse.jdt.annotation.NonNull MediaPathInfo pathInfo) { + this.pathInfo = pathInfo; + } + + /** + * Return true if this MediaPathDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaPathDto mediaPathDto = (MediaPathDto) o; + return Objects.equals(this.name, mediaPathDto.name) && Objects.equals(this.path, mediaPathDto.path) + && Objects.equals(this.pathInfo, mediaPathDto.pathInfo); + } + + @Override + public int hashCode() { + return Objects.hash(name, path, pathInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaPathDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" pathInfo: ").append(toIndentedString(pathInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `PathInfo` to the URL query string + if (getPathInfo() != null) { + joiner.add(getPathInfo().toUrlQueryString(prefix + "PathInfo" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaPathDto instance; + + public Builder() { + this(new MediaPathDto()); + } + + protected Builder(MediaPathDto instance) { + this.instance = instance; + } + + public MediaPathDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public MediaPathDto.Builder path(String path) { + this.instance.path = path; + return this; + } + + public MediaPathDto.Builder pathInfo(MediaPathInfo pathInfo) { + this.instance.pathInfo = pathInfo; + return this; + } + + /** + * returns a built MediaPathDto instance. + * + * The builder is not reusable. + */ + public MediaPathDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaPathDto.Builder builder() { + return new MediaPathDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaPathDto.Builder toBuilder() { + return new MediaPathDto.Builder().name(getName()).path(getPath()).pathInfo(getPathInfo()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaPathInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaPathInfo.java new file mode 100644 index 0000000000000..eb976f13884d7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaPathInfo.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MediaPathInfo + */ +@JsonPropertyOrder({ MediaPathInfo.JSON_PROPERTY_PATH }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaPathInfo { + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public MediaPathInfo() { + } + + public MediaPathInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Get path + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + /** + * Return true if this MediaPathInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaPathInfo mediaPathInfo = (MediaPathInfo) o; + return Objects.equals(this.path, mediaPathInfo.path); + } + + @Override + public int hashCode() { + return Objects.hash(path); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaPathInfo {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaPathInfo instance; + + public Builder() { + this(new MediaPathInfo()); + } + + protected Builder(MediaPathInfo instance) { + this.instance = instance; + } + + public MediaPathInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + /** + * returns a built MediaPathInfo instance. + * + * The builder is not reusable. + */ + public MediaPathInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaPathInfo.Builder builder() { + return new MediaPathInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaPathInfo.Builder toBuilder() { + return new MediaPathInfo.Builder().path(getPath()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaProtocol.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaProtocol.java new file mode 100644 index 0000000000000..ea3b8e90f7850 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaProtocol.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets MediaProtocol + */ +public enum MediaProtocol { + + FILE("File"), + + HTTP("Http"), + + RTMP("Rtmp"), + + RTSP("Rtsp"), + + UDP("Udp"), + + RTP("Rtp"), + + FTP("Ftp"); + + private String value; + + MediaProtocol(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MediaProtocol fromValue(String value) { + for (MediaProtocol b : MediaProtocol.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSegmentDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSegmentDto.java new file mode 100644 index 0000000000000..e2ed8841fb526 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSegmentDto.java @@ -0,0 +1,355 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Api model for MediaSegment's. + */ +@JsonPropertyOrder({ MediaSegmentDto.JSON_PROPERTY_ID, MediaSegmentDto.JSON_PROPERTY_ITEM_ID, + MediaSegmentDto.JSON_PROPERTY_TYPE, MediaSegmentDto.JSON_PROPERTY_START_TICKS, + MediaSegmentDto.JSON_PROPERTY_END_TICKS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaSegmentDto { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private MediaSegmentType type = MediaSegmentType.UNKNOWN; + + public static final String JSON_PROPERTY_START_TICKS = "StartTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long startTicks; + + public static final String JSON_PROPERTY_END_TICKS = "EndTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long endTicks; + + public MediaSegmentDto() { + } + + public MediaSegmentDto id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id of the media segment. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public MediaSegmentDto itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the id of the associated item. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public MediaSegmentDto type(@org.eclipse.jdt.annotation.NonNull MediaSegmentType type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type of content this segment defines. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaSegmentType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull MediaSegmentType type) { + this.type = type; + } + + public MediaSegmentDto startTicks(@org.eclipse.jdt.annotation.NonNull Long startTicks) { + this.startTicks = startTicks; + return this; + } + + /** + * Gets or sets the start of the segment. + * + * @return startTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartTicks() { + return startTicks; + } + + @JsonProperty(JSON_PROPERTY_START_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartTicks(@org.eclipse.jdt.annotation.NonNull Long startTicks) { + this.startTicks = startTicks; + } + + public MediaSegmentDto endTicks(@org.eclipse.jdt.annotation.NonNull Long endTicks) { + this.endTicks = endTicks; + return this; + } + + /** + * Gets or sets the end of the segment. + * + * @return endTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_END_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getEndTicks() { + return endTicks; + } + + @JsonProperty(JSON_PROPERTY_END_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndTicks(@org.eclipse.jdt.annotation.NonNull Long endTicks) { + this.endTicks = endTicks; + } + + /** + * Return true if this MediaSegmentDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaSegmentDto mediaSegmentDto = (MediaSegmentDto) o; + return Objects.equals(this.id, mediaSegmentDto.id) && Objects.equals(this.itemId, mediaSegmentDto.itemId) + && Objects.equals(this.type, mediaSegmentDto.type) + && Objects.equals(this.startTicks, mediaSegmentDto.startTicks) + && Objects.equals(this.endTicks, mediaSegmentDto.endTicks); + } + + @Override + public int hashCode() { + return Objects.hash(id, itemId, type, startTicks, endTicks); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaSegmentDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" startTicks: ").append(toIndentedString(startTicks)).append("\n"); + sb.append(" endTicks: ").append(toIndentedString(endTicks)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `StartTicks` to the URL query string + if (getStartTicks() != null) { + joiner.add(String.format("%sStartTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartTicks())))); + } + + // add `EndTicks` to the URL query string + if (getEndTicks() != null) { + joiner.add(String.format("%sEndTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndTicks())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaSegmentDto instance; + + public Builder() { + this(new MediaSegmentDto()); + } + + protected Builder(MediaSegmentDto instance) { + this.instance = instance; + } + + public MediaSegmentDto.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public MediaSegmentDto.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public MediaSegmentDto.Builder type(MediaSegmentType type) { + this.instance.type = type; + return this; + } + + public MediaSegmentDto.Builder startTicks(Long startTicks) { + this.instance.startTicks = startTicks; + return this; + } + + public MediaSegmentDto.Builder endTicks(Long endTicks) { + this.instance.endTicks = endTicks; + return this; + } + + /** + * returns a built MediaSegmentDto instance. + * + * The builder is not reusable. + */ + public MediaSegmentDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaSegmentDto.Builder builder() { + return new MediaSegmentDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaSegmentDto.Builder toBuilder() { + return new MediaSegmentDto.Builder().id(getId()).itemId(getItemId()).type(getType()).startTicks(getStartTicks()) + .endTicks(getEndTicks()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSegmentDtoQueryResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSegmentDtoQueryResult.java new file mode 100644 index 0000000000000..35e23fae80d8d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSegmentDtoQueryResult.java @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Query result container. + */ +@JsonPropertyOrder({ MediaSegmentDtoQueryResult.JSON_PROPERTY_ITEMS, + MediaSegmentDtoQueryResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, + MediaSegmentDtoQueryResult.JSON_PROPERTY_START_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaSegmentDtoQueryResult { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public MediaSegmentDtoQueryResult() { + } + + public MediaSegmentDtoQueryResult items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public MediaSegmentDtoQueryResult addItemsItem(MediaSegmentDto itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Gets or sets the items. + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public MediaSegmentDtoQueryResult totalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total number of records available. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public MediaSegmentDtoQueryResult startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the index of the first record in Items. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + /** + * Return true if this MediaSegmentDtoQueryResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaSegmentDtoQueryResult mediaSegmentDtoQueryResult = (MediaSegmentDtoQueryResult) o; + return Objects.equals(this.items, mediaSegmentDtoQueryResult.items) + && Objects.equals(this.totalRecordCount, mediaSegmentDtoQueryResult.totalRecordCount) + && Objects.equals(this.startIndex, mediaSegmentDtoQueryResult.startIndex); + } + + @Override + public int hashCode() { + return Objects.hash(items, totalRecordCount, startIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaSegmentDtoQueryResult {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaSegmentDtoQueryResult instance; + + public Builder() { + this(new MediaSegmentDtoQueryResult()); + } + + protected Builder(MediaSegmentDtoQueryResult instance) { + this.instance = instance; + } + + public MediaSegmentDtoQueryResult.Builder items(List items) { + this.instance.items = items; + return this; + } + + public MediaSegmentDtoQueryResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public MediaSegmentDtoQueryResult.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + /** + * returns a built MediaSegmentDtoQueryResult instance. + * + * The builder is not reusable. + */ + public MediaSegmentDtoQueryResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaSegmentDtoQueryResult.Builder builder() { + return new MediaSegmentDtoQueryResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaSegmentDtoQueryResult.Builder toBuilder() { + return new MediaSegmentDtoQueryResult.Builder().items(getItems()).totalRecordCount(getTotalRecordCount()) + .startIndex(getStartIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSegmentType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSegmentType.java new file mode 100644 index 0000000000000..b74bc054e9795 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSegmentType.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines the types of content an individual Jellyfin.Data.Entities.MediaSegment represents. + */ +public enum MediaSegmentType { + + UNKNOWN("Unknown"), + + COMMERCIAL("Commercial"), + + PREVIEW("Preview"), + + RECAP("Recap"), + + OUTRO("Outro"), + + INTRO("Intro"); + + private String value; + + MediaSegmentType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MediaSegmentType fromValue(String value) { + for (MediaSegmentType b : MediaSegmentType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSourceInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSourceInfo.java new file mode 100644 index 0000000000000..34dd64bbba5af --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSourceInfo.java @@ -0,0 +1,2063 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MediaSourceInfo + */ +@JsonPropertyOrder({ MediaSourceInfo.JSON_PROPERTY_PROTOCOL, MediaSourceInfo.JSON_PROPERTY_ID, + MediaSourceInfo.JSON_PROPERTY_PATH, MediaSourceInfo.JSON_PROPERTY_ENCODER_PATH, + MediaSourceInfo.JSON_PROPERTY_ENCODER_PROTOCOL, MediaSourceInfo.JSON_PROPERTY_TYPE, + MediaSourceInfo.JSON_PROPERTY_CONTAINER, MediaSourceInfo.JSON_PROPERTY_SIZE, MediaSourceInfo.JSON_PROPERTY_NAME, + MediaSourceInfo.JSON_PROPERTY_IS_REMOTE, MediaSourceInfo.JSON_PROPERTY_ETAG, + MediaSourceInfo.JSON_PROPERTY_RUN_TIME_TICKS, MediaSourceInfo.JSON_PROPERTY_READ_AT_NATIVE_FRAMERATE, + MediaSourceInfo.JSON_PROPERTY_IGNORE_DTS, MediaSourceInfo.JSON_PROPERTY_IGNORE_INDEX, + MediaSourceInfo.JSON_PROPERTY_GEN_PTS_INPUT, MediaSourceInfo.JSON_PROPERTY_SUPPORTS_TRANSCODING, + MediaSourceInfo.JSON_PROPERTY_SUPPORTS_DIRECT_STREAM, MediaSourceInfo.JSON_PROPERTY_SUPPORTS_DIRECT_PLAY, + MediaSourceInfo.JSON_PROPERTY_IS_INFINITE_STREAM, + MediaSourceInfo.JSON_PROPERTY_USE_MOST_COMPATIBLE_TRANSCODING_PROFILE, + MediaSourceInfo.JSON_PROPERTY_REQUIRES_OPENING, MediaSourceInfo.JSON_PROPERTY_OPEN_TOKEN, + MediaSourceInfo.JSON_PROPERTY_REQUIRES_CLOSING, MediaSourceInfo.JSON_PROPERTY_LIVE_STREAM_ID, + MediaSourceInfo.JSON_PROPERTY_BUFFER_MS, MediaSourceInfo.JSON_PROPERTY_REQUIRES_LOOPING, + MediaSourceInfo.JSON_PROPERTY_SUPPORTS_PROBING, MediaSourceInfo.JSON_PROPERTY_VIDEO_TYPE, + MediaSourceInfo.JSON_PROPERTY_ISO_TYPE, MediaSourceInfo.JSON_PROPERTY_VIDEO3_D_FORMAT, + MediaSourceInfo.JSON_PROPERTY_MEDIA_STREAMS, MediaSourceInfo.JSON_PROPERTY_MEDIA_ATTACHMENTS, + MediaSourceInfo.JSON_PROPERTY_FORMATS, MediaSourceInfo.JSON_PROPERTY_BITRATE, + MediaSourceInfo.JSON_PROPERTY_FALLBACK_MAX_STREAMING_BITRATE, MediaSourceInfo.JSON_PROPERTY_TIMESTAMP, + MediaSourceInfo.JSON_PROPERTY_REQUIRED_HTTP_HEADERS, MediaSourceInfo.JSON_PROPERTY_TRANSCODING_URL, + MediaSourceInfo.JSON_PROPERTY_TRANSCODING_SUB_PROTOCOL, MediaSourceInfo.JSON_PROPERTY_TRANSCODING_CONTAINER, + MediaSourceInfo.JSON_PROPERTY_ANALYZE_DURATION_MS, MediaSourceInfo.JSON_PROPERTY_DEFAULT_AUDIO_STREAM_INDEX, + MediaSourceInfo.JSON_PROPERTY_DEFAULT_SUBTITLE_STREAM_INDEX, MediaSourceInfo.JSON_PROPERTY_HAS_SEGMENTS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaSourceInfo { + public static final String JSON_PROPERTY_PROTOCOL = "Protocol"; + @org.eclipse.jdt.annotation.NonNull + private MediaProtocol protocol; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_ENCODER_PATH = "EncoderPath"; + @org.eclipse.jdt.annotation.NonNull + private String encoderPath; + + public static final String JSON_PROPERTY_ENCODER_PROTOCOL = "EncoderProtocol"; + @org.eclipse.jdt.annotation.NonNull + private MediaProtocol encoderProtocol; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private MediaSourceType type; + + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public static final String JSON_PROPERTY_SIZE = "Size"; + @org.eclipse.jdt.annotation.NonNull + private Long size; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_IS_REMOTE = "IsRemote"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isRemote; + + public static final String JSON_PROPERTY_ETAG = "ETag"; + @org.eclipse.jdt.annotation.NonNull + private String etag; + + public static final String JSON_PROPERTY_RUN_TIME_TICKS = "RunTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long runTimeTicks; + + public static final String JSON_PROPERTY_READ_AT_NATIVE_FRAMERATE = "ReadAtNativeFramerate"; + @org.eclipse.jdt.annotation.NonNull + private Boolean readAtNativeFramerate; + + public static final String JSON_PROPERTY_IGNORE_DTS = "IgnoreDts"; + @org.eclipse.jdt.annotation.NonNull + private Boolean ignoreDts; + + public static final String JSON_PROPERTY_IGNORE_INDEX = "IgnoreIndex"; + @org.eclipse.jdt.annotation.NonNull + private Boolean ignoreIndex; + + public static final String JSON_PROPERTY_GEN_PTS_INPUT = "GenPtsInput"; + @org.eclipse.jdt.annotation.NonNull + private Boolean genPtsInput; + + public static final String JSON_PROPERTY_SUPPORTS_TRANSCODING = "SupportsTranscoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsTranscoding; + + public static final String JSON_PROPERTY_SUPPORTS_DIRECT_STREAM = "SupportsDirectStream"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsDirectStream; + + public static final String JSON_PROPERTY_SUPPORTS_DIRECT_PLAY = "SupportsDirectPlay"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsDirectPlay; + + public static final String JSON_PROPERTY_IS_INFINITE_STREAM = "IsInfiniteStream"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isInfiniteStream; + + public static final String JSON_PROPERTY_USE_MOST_COMPATIBLE_TRANSCODING_PROFILE = "UseMostCompatibleTranscodingProfile"; + @org.eclipse.jdt.annotation.NonNull + private Boolean useMostCompatibleTranscodingProfile = false; + + public static final String JSON_PROPERTY_REQUIRES_OPENING = "RequiresOpening"; + @org.eclipse.jdt.annotation.NonNull + private Boolean requiresOpening; + + public static final String JSON_PROPERTY_OPEN_TOKEN = "OpenToken"; + @org.eclipse.jdt.annotation.NonNull + private String openToken; + + public static final String JSON_PROPERTY_REQUIRES_CLOSING = "RequiresClosing"; + @org.eclipse.jdt.annotation.NonNull + private Boolean requiresClosing; + + public static final String JSON_PROPERTY_LIVE_STREAM_ID = "LiveStreamId"; + @org.eclipse.jdt.annotation.NonNull + private String liveStreamId; + + public static final String JSON_PROPERTY_BUFFER_MS = "BufferMs"; + @org.eclipse.jdt.annotation.NonNull + private Integer bufferMs; + + public static final String JSON_PROPERTY_REQUIRES_LOOPING = "RequiresLooping"; + @org.eclipse.jdt.annotation.NonNull + private Boolean requiresLooping; + + public static final String JSON_PROPERTY_SUPPORTS_PROBING = "SupportsProbing"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsProbing; + + public static final String JSON_PROPERTY_VIDEO_TYPE = "VideoType"; + @org.eclipse.jdt.annotation.NonNull + private VideoType videoType; + + public static final String JSON_PROPERTY_ISO_TYPE = "IsoType"; + @org.eclipse.jdt.annotation.NonNull + private IsoType isoType; + + public static final String JSON_PROPERTY_VIDEO3_D_FORMAT = "Video3DFormat"; + @org.eclipse.jdt.annotation.NonNull + private Video3DFormat video3DFormat; + + public static final String JSON_PROPERTY_MEDIA_STREAMS = "MediaStreams"; + @org.eclipse.jdt.annotation.NonNull + private List mediaStreams; + + public static final String JSON_PROPERTY_MEDIA_ATTACHMENTS = "MediaAttachments"; + @org.eclipse.jdt.annotation.NonNull + private List mediaAttachments; + + public static final String JSON_PROPERTY_FORMATS = "Formats"; + @org.eclipse.jdt.annotation.NonNull + private List formats; + + public static final String JSON_PROPERTY_BITRATE = "Bitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer bitrate; + + public static final String JSON_PROPERTY_FALLBACK_MAX_STREAMING_BITRATE = "FallbackMaxStreamingBitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer fallbackMaxStreamingBitrate; + + public static final String JSON_PROPERTY_TIMESTAMP = "Timestamp"; + @org.eclipse.jdt.annotation.NonNull + private TransportStreamTimestamp timestamp; + + public static final String JSON_PROPERTY_REQUIRED_HTTP_HEADERS = "RequiredHttpHeaders"; + @org.eclipse.jdt.annotation.NonNull + private Map requiredHttpHeaders; + + public static final String JSON_PROPERTY_TRANSCODING_URL = "TranscodingUrl"; + @org.eclipse.jdt.annotation.NonNull + private String transcodingUrl; + + public static final String JSON_PROPERTY_TRANSCODING_SUB_PROTOCOL = "TranscodingSubProtocol"; + @org.eclipse.jdt.annotation.NonNull + private MediaStreamProtocol transcodingSubProtocol; + + public static final String JSON_PROPERTY_TRANSCODING_CONTAINER = "TranscodingContainer"; + @org.eclipse.jdt.annotation.NonNull + private String transcodingContainer; + + public static final String JSON_PROPERTY_ANALYZE_DURATION_MS = "AnalyzeDurationMs"; + @org.eclipse.jdt.annotation.NonNull + private Integer analyzeDurationMs; + + public static final String JSON_PROPERTY_DEFAULT_AUDIO_STREAM_INDEX = "DefaultAudioStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer defaultAudioStreamIndex; + + public static final String JSON_PROPERTY_DEFAULT_SUBTITLE_STREAM_INDEX = "DefaultSubtitleStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer defaultSubtitleStreamIndex; + + public static final String JSON_PROPERTY_HAS_SEGMENTS = "HasSegments"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasSegments; + + public MediaSourceInfo() { + } + + public MediaSourceInfo protocol(@org.eclipse.jdt.annotation.NonNull MediaProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * + * @return protocol + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaProtocol getProtocol() { + return protocol; + } + + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtocol(@org.eclipse.jdt.annotation.NonNull MediaProtocol protocol) { + this.protocol = protocol; + } + + public MediaSourceInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public MediaSourceInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Get path + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public MediaSourceInfo encoderPath(@org.eclipse.jdt.annotation.NonNull String encoderPath) { + this.encoderPath = encoderPath; + return this; + } + + /** + * Get encoderPath + * + * @return encoderPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENCODER_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEncoderPath() { + return encoderPath; + } + + @JsonProperty(JSON_PROPERTY_ENCODER_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncoderPath(@org.eclipse.jdt.annotation.NonNull String encoderPath) { + this.encoderPath = encoderPath; + } + + public MediaSourceInfo encoderProtocol(@org.eclipse.jdt.annotation.NonNull MediaProtocol encoderProtocol) { + this.encoderProtocol = encoderProtocol; + return this; + } + + /** + * Get encoderProtocol + * + * @return encoderProtocol + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENCODER_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaProtocol getEncoderProtocol() { + return encoderProtocol; + } + + @JsonProperty(JSON_PROPERTY_ENCODER_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncoderProtocol(@org.eclipse.jdt.annotation.NonNull MediaProtocol encoderProtocol) { + this.encoderProtocol = encoderProtocol; + } + + public MediaSourceInfo type(@org.eclipse.jdt.annotation.NonNull MediaSourceType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaSourceType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull MediaSourceType type) { + this.type = type; + } + + public MediaSourceInfo container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Get container + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + public MediaSourceInfo size(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + return this; + } + + /** + * Get size + * + * @return size + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSize() { + return size; + } + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSize(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + } + + public MediaSourceInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public MediaSourceInfo isRemote(@org.eclipse.jdt.annotation.NonNull Boolean isRemote) { + this.isRemote = isRemote; + return this; + } + + /** + * Gets or sets a value indicating whether the media is remote. Differentiate internet url vs local network. + * + * @return isRemote + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_REMOTE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsRemote() { + return isRemote; + } + + @JsonProperty(JSON_PROPERTY_IS_REMOTE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsRemote(@org.eclipse.jdt.annotation.NonNull Boolean isRemote) { + this.isRemote = isRemote; + } + + public MediaSourceInfo etag(@org.eclipse.jdt.annotation.NonNull String etag) { + this.etag = etag; + return this; + } + + /** + * Get etag + * + * @return etag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ETAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEtag() { + return etag; + } + + @JsonProperty(JSON_PROPERTY_ETAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEtag(@org.eclipse.jdt.annotation.NonNull String etag) { + this.etag = etag; + } + + public MediaSourceInfo runTimeTicks(@org.eclipse.jdt.annotation.NonNull Long runTimeTicks) { + this.runTimeTicks = runTimeTicks; + return this; + } + + /** + * Get runTimeTicks + * + * @return runTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getRunTimeTicks() { + return runTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRunTimeTicks(@org.eclipse.jdt.annotation.NonNull Long runTimeTicks) { + this.runTimeTicks = runTimeTicks; + } + + public MediaSourceInfo readAtNativeFramerate(@org.eclipse.jdt.annotation.NonNull Boolean readAtNativeFramerate) { + this.readAtNativeFramerate = readAtNativeFramerate; + return this; + } + + /** + * Get readAtNativeFramerate + * + * @return readAtNativeFramerate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_READ_AT_NATIVE_FRAMERATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getReadAtNativeFramerate() { + return readAtNativeFramerate; + } + + @JsonProperty(JSON_PROPERTY_READ_AT_NATIVE_FRAMERATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReadAtNativeFramerate(@org.eclipse.jdt.annotation.NonNull Boolean readAtNativeFramerate) { + this.readAtNativeFramerate = readAtNativeFramerate; + } + + public MediaSourceInfo ignoreDts(@org.eclipse.jdt.annotation.NonNull Boolean ignoreDts) { + this.ignoreDts = ignoreDts; + return this; + } + + /** + * Get ignoreDts + * + * @return ignoreDts + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IGNORE_DTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIgnoreDts() { + return ignoreDts; + } + + @JsonProperty(JSON_PROPERTY_IGNORE_DTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIgnoreDts(@org.eclipse.jdt.annotation.NonNull Boolean ignoreDts) { + this.ignoreDts = ignoreDts; + } + + public MediaSourceInfo ignoreIndex(@org.eclipse.jdt.annotation.NonNull Boolean ignoreIndex) { + this.ignoreIndex = ignoreIndex; + return this; + } + + /** + * Get ignoreIndex + * + * @return ignoreIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IGNORE_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIgnoreIndex() { + return ignoreIndex; + } + + @JsonProperty(JSON_PROPERTY_IGNORE_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIgnoreIndex(@org.eclipse.jdt.annotation.NonNull Boolean ignoreIndex) { + this.ignoreIndex = ignoreIndex; + } + + public MediaSourceInfo genPtsInput(@org.eclipse.jdt.annotation.NonNull Boolean genPtsInput) { + this.genPtsInput = genPtsInput; + return this; + } + + /** + * Get genPtsInput + * + * @return genPtsInput + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GEN_PTS_INPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getGenPtsInput() { + return genPtsInput; + } + + @JsonProperty(JSON_PROPERTY_GEN_PTS_INPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGenPtsInput(@org.eclipse.jdt.annotation.NonNull Boolean genPtsInput) { + this.genPtsInput = genPtsInput; + } + + public MediaSourceInfo supportsTranscoding(@org.eclipse.jdt.annotation.NonNull Boolean supportsTranscoding) { + this.supportsTranscoding = supportsTranscoding; + return this; + } + + /** + * Get supportsTranscoding + * + * @return supportsTranscoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsTranscoding() { + return supportsTranscoding; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsTranscoding(@org.eclipse.jdt.annotation.NonNull Boolean supportsTranscoding) { + this.supportsTranscoding = supportsTranscoding; + } + + public MediaSourceInfo supportsDirectStream(@org.eclipse.jdt.annotation.NonNull Boolean supportsDirectStream) { + this.supportsDirectStream = supportsDirectStream; + return this; + } + + /** + * Get supportsDirectStream + * + * @return supportsDirectStream + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_DIRECT_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsDirectStream() { + return supportsDirectStream; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_DIRECT_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsDirectStream(@org.eclipse.jdt.annotation.NonNull Boolean supportsDirectStream) { + this.supportsDirectStream = supportsDirectStream; + } + + public MediaSourceInfo supportsDirectPlay(@org.eclipse.jdt.annotation.NonNull Boolean supportsDirectPlay) { + this.supportsDirectPlay = supportsDirectPlay; + return this; + } + + /** + * Get supportsDirectPlay + * + * @return supportsDirectPlay + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_DIRECT_PLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsDirectPlay() { + return supportsDirectPlay; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_DIRECT_PLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsDirectPlay(@org.eclipse.jdt.annotation.NonNull Boolean supportsDirectPlay) { + this.supportsDirectPlay = supportsDirectPlay; + } + + public MediaSourceInfo isInfiniteStream(@org.eclipse.jdt.annotation.NonNull Boolean isInfiniteStream) { + this.isInfiniteStream = isInfiniteStream; + return this; + } + + /** + * Get isInfiniteStream + * + * @return isInfiniteStream + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_INFINITE_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsInfiniteStream() { + return isInfiniteStream; + } + + @JsonProperty(JSON_PROPERTY_IS_INFINITE_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsInfiniteStream(@org.eclipse.jdt.annotation.NonNull Boolean isInfiniteStream) { + this.isInfiniteStream = isInfiniteStream; + } + + public MediaSourceInfo useMostCompatibleTranscodingProfile( + @org.eclipse.jdt.annotation.NonNull Boolean useMostCompatibleTranscodingProfile) { + this.useMostCompatibleTranscodingProfile = useMostCompatibleTranscodingProfile; + return this; + } + + /** + * Get useMostCompatibleTranscodingProfile + * + * @return useMostCompatibleTranscodingProfile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USE_MOST_COMPATIBLE_TRANSCODING_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUseMostCompatibleTranscodingProfile() { + return useMostCompatibleTranscodingProfile; + } + + @JsonProperty(JSON_PROPERTY_USE_MOST_COMPATIBLE_TRANSCODING_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseMostCompatibleTranscodingProfile( + @org.eclipse.jdt.annotation.NonNull Boolean useMostCompatibleTranscodingProfile) { + this.useMostCompatibleTranscodingProfile = useMostCompatibleTranscodingProfile; + } + + public MediaSourceInfo requiresOpening(@org.eclipse.jdt.annotation.NonNull Boolean requiresOpening) { + this.requiresOpening = requiresOpening; + return this; + } + + /** + * Get requiresOpening + * + * @return requiresOpening + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUIRES_OPENING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequiresOpening() { + return requiresOpening; + } + + @JsonProperty(JSON_PROPERTY_REQUIRES_OPENING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequiresOpening(@org.eclipse.jdt.annotation.NonNull Boolean requiresOpening) { + this.requiresOpening = requiresOpening; + } + + public MediaSourceInfo openToken(@org.eclipse.jdt.annotation.NonNull String openToken) { + this.openToken = openToken; + return this; + } + + /** + * Get openToken + * + * @return openToken + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OPEN_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOpenToken() { + return openToken; + } + + @JsonProperty(JSON_PROPERTY_OPEN_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpenToken(@org.eclipse.jdt.annotation.NonNull String openToken) { + this.openToken = openToken; + } + + public MediaSourceInfo requiresClosing(@org.eclipse.jdt.annotation.NonNull Boolean requiresClosing) { + this.requiresClosing = requiresClosing; + return this; + } + + /** + * Get requiresClosing + * + * @return requiresClosing + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUIRES_CLOSING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequiresClosing() { + return requiresClosing; + } + + @JsonProperty(JSON_PROPERTY_REQUIRES_CLOSING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequiresClosing(@org.eclipse.jdt.annotation.NonNull Boolean requiresClosing) { + this.requiresClosing = requiresClosing; + } + + public MediaSourceInfo liveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + return this; + } + + /** + * Get liveStreamId + * + * @return liveStreamId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLiveStreamId() { + return liveStreamId; + } + + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLiveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + } + + public MediaSourceInfo bufferMs(@org.eclipse.jdt.annotation.NonNull Integer bufferMs) { + this.bufferMs = bufferMs; + return this; + } + + /** + * Get bufferMs + * + * @return bufferMs + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BUFFER_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBufferMs() { + return bufferMs; + } + + @JsonProperty(JSON_PROPERTY_BUFFER_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBufferMs(@org.eclipse.jdt.annotation.NonNull Integer bufferMs) { + this.bufferMs = bufferMs; + } + + public MediaSourceInfo requiresLooping(@org.eclipse.jdt.annotation.NonNull Boolean requiresLooping) { + this.requiresLooping = requiresLooping; + return this; + } + + /** + * Get requiresLooping + * + * @return requiresLooping + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUIRES_LOOPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequiresLooping() { + return requiresLooping; + } + + @JsonProperty(JSON_PROPERTY_REQUIRES_LOOPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequiresLooping(@org.eclipse.jdt.annotation.NonNull Boolean requiresLooping) { + this.requiresLooping = requiresLooping; + } + + public MediaSourceInfo supportsProbing(@org.eclipse.jdt.annotation.NonNull Boolean supportsProbing) { + this.supportsProbing = supportsProbing; + return this; + } + + /** + * Get supportsProbing + * + * @return supportsProbing + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_PROBING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsProbing() { + return supportsProbing; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_PROBING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsProbing(@org.eclipse.jdt.annotation.NonNull Boolean supportsProbing) { + this.supportsProbing = supportsProbing; + } + + public MediaSourceInfo videoType(@org.eclipse.jdt.annotation.NonNull VideoType videoType) { + this.videoType = videoType; + return this; + } + + /** + * Get videoType + * + * @return videoType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public VideoType getVideoType() { + return videoType; + } + + @JsonProperty(JSON_PROPERTY_VIDEO_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVideoType(@org.eclipse.jdt.annotation.NonNull VideoType videoType) { + this.videoType = videoType; + } + + public MediaSourceInfo isoType(@org.eclipse.jdt.annotation.NonNull IsoType isoType) { + this.isoType = isoType; + return this; + } + + /** + * Get isoType + * + * @return isoType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ISO_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IsoType getIsoType() { + return isoType; + } + + @JsonProperty(JSON_PROPERTY_ISO_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsoType(@org.eclipse.jdt.annotation.NonNull IsoType isoType) { + this.isoType = isoType; + } + + public MediaSourceInfo video3DFormat(@org.eclipse.jdt.annotation.NonNull Video3DFormat video3DFormat) { + this.video3DFormat = video3DFormat; + return this; + } + + /** + * Get video3DFormat + * + * @return video3DFormat + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO3_D_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Video3DFormat getVideo3DFormat() { + return video3DFormat; + } + + @JsonProperty(JSON_PROPERTY_VIDEO3_D_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVideo3DFormat(@org.eclipse.jdt.annotation.NonNull Video3DFormat video3DFormat) { + this.video3DFormat = video3DFormat; + } + + public MediaSourceInfo mediaStreams(@org.eclipse.jdt.annotation.NonNull List mediaStreams) { + this.mediaStreams = mediaStreams; + return this; + } + + public MediaSourceInfo addMediaStreamsItem(MediaStream mediaStreamsItem) { + if (this.mediaStreams == null) { + this.mediaStreams = new ArrayList<>(); + } + this.mediaStreams.add(mediaStreamsItem); + return this; + } + + /** + * Get mediaStreams + * + * @return mediaStreams + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_STREAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMediaStreams() { + return mediaStreams; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_STREAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaStreams(@org.eclipse.jdt.annotation.NonNull List mediaStreams) { + this.mediaStreams = mediaStreams; + } + + public MediaSourceInfo mediaAttachments( + @org.eclipse.jdt.annotation.NonNull List mediaAttachments) { + this.mediaAttachments = mediaAttachments; + return this; + } + + public MediaSourceInfo addMediaAttachmentsItem(MediaAttachment mediaAttachmentsItem) { + if (this.mediaAttachments == null) { + this.mediaAttachments = new ArrayList<>(); + } + this.mediaAttachments.add(mediaAttachmentsItem); + return this; + } + + /** + * Get mediaAttachments + * + * @return mediaAttachments + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMediaAttachments() { + return mediaAttachments; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaAttachments(@org.eclipse.jdt.annotation.NonNull List mediaAttachments) { + this.mediaAttachments = mediaAttachments; + } + + public MediaSourceInfo formats(@org.eclipse.jdt.annotation.NonNull List formats) { + this.formats = formats; + return this; + } + + public MediaSourceInfo addFormatsItem(String formatsItem) { + if (this.formats == null) { + this.formats = new ArrayList<>(); + } + this.formats.add(formatsItem); + return this; + } + + /** + * Get formats + * + * @return formats + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FORMATS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormats() { + return formats; + } + + @JsonProperty(JSON_PROPERTY_FORMATS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormats(@org.eclipse.jdt.annotation.NonNull List formats) { + this.formats = formats; + } + + public MediaSourceInfo bitrate(@org.eclipse.jdt.annotation.NonNull Integer bitrate) { + this.bitrate = bitrate; + return this; + } + + /** + * Get bitrate + * + * @return bitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBitrate() { + return bitrate; + } + + @JsonProperty(JSON_PROPERTY_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBitrate(@org.eclipse.jdt.annotation.NonNull Integer bitrate) { + this.bitrate = bitrate; + } + + public MediaSourceInfo fallbackMaxStreamingBitrate( + @org.eclipse.jdt.annotation.NonNull Integer fallbackMaxStreamingBitrate) { + this.fallbackMaxStreamingBitrate = fallbackMaxStreamingBitrate; + return this; + } + + /** + * Get fallbackMaxStreamingBitrate + * + * @return fallbackMaxStreamingBitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FALLBACK_MAX_STREAMING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getFallbackMaxStreamingBitrate() { + return fallbackMaxStreamingBitrate; + } + + @JsonProperty(JSON_PROPERTY_FALLBACK_MAX_STREAMING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFallbackMaxStreamingBitrate( + @org.eclipse.jdt.annotation.NonNull Integer fallbackMaxStreamingBitrate) { + this.fallbackMaxStreamingBitrate = fallbackMaxStreamingBitrate; + } + + public MediaSourceInfo timestamp(@org.eclipse.jdt.annotation.NonNull TransportStreamTimestamp timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * + * @return timestamp + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransportStreamTimestamp getTimestamp() { + return timestamp; + } + + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimestamp(@org.eclipse.jdt.annotation.NonNull TransportStreamTimestamp timestamp) { + this.timestamp = timestamp; + } + + public MediaSourceInfo requiredHttpHeaders( + @org.eclipse.jdt.annotation.NonNull Map requiredHttpHeaders) { + this.requiredHttpHeaders = requiredHttpHeaders; + return this; + } + + public MediaSourceInfo putRequiredHttpHeadersItem(String key, String requiredHttpHeadersItem) { + if (this.requiredHttpHeaders == null) { + this.requiredHttpHeaders = new HashMap<>(); + } + this.requiredHttpHeaders.put(key, requiredHttpHeadersItem); + return this; + } + + /** + * Get requiredHttpHeaders + * + * @return requiredHttpHeaders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUIRED_HTTP_HEADERS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getRequiredHttpHeaders() { + return requiredHttpHeaders; + } + + @JsonProperty(JSON_PROPERTY_REQUIRED_HTTP_HEADERS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setRequiredHttpHeaders(@org.eclipse.jdt.annotation.NonNull Map requiredHttpHeaders) { + this.requiredHttpHeaders = requiredHttpHeaders; + } + + public MediaSourceInfo transcodingUrl(@org.eclipse.jdt.annotation.NonNull String transcodingUrl) { + this.transcodingUrl = transcodingUrl; + return this; + } + + /** + * Get transcodingUrl + * + * @return transcodingUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODING_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTranscodingUrl() { + return transcodingUrl; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODING_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodingUrl(@org.eclipse.jdt.annotation.NonNull String transcodingUrl) { + this.transcodingUrl = transcodingUrl; + } + + public MediaSourceInfo transcodingSubProtocol( + @org.eclipse.jdt.annotation.NonNull MediaStreamProtocol transcodingSubProtocol) { + this.transcodingSubProtocol = transcodingSubProtocol; + return this; + } + + /** + * Media streaming protocol. Lowercase for backwards compatibility. + * + * @return transcodingSubProtocol + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODING_SUB_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaStreamProtocol getTranscodingSubProtocol() { + return transcodingSubProtocol; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODING_SUB_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodingSubProtocol( + @org.eclipse.jdt.annotation.NonNull MediaStreamProtocol transcodingSubProtocol) { + this.transcodingSubProtocol = transcodingSubProtocol; + } + + public MediaSourceInfo transcodingContainer(@org.eclipse.jdt.annotation.NonNull String transcodingContainer) { + this.transcodingContainer = transcodingContainer; + return this; + } + + /** + * Get transcodingContainer + * + * @return transcodingContainer + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODING_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTranscodingContainer() { + return transcodingContainer; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODING_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodingContainer(@org.eclipse.jdt.annotation.NonNull String transcodingContainer) { + this.transcodingContainer = transcodingContainer; + } + + public MediaSourceInfo analyzeDurationMs(@org.eclipse.jdt.annotation.NonNull Integer analyzeDurationMs) { + this.analyzeDurationMs = analyzeDurationMs; + return this; + } + + /** + * Get analyzeDurationMs + * + * @return analyzeDurationMs + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ANALYZE_DURATION_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAnalyzeDurationMs() { + return analyzeDurationMs; + } + + @JsonProperty(JSON_PROPERTY_ANALYZE_DURATION_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAnalyzeDurationMs(@org.eclipse.jdt.annotation.NonNull Integer analyzeDurationMs) { + this.analyzeDurationMs = analyzeDurationMs; + } + + public MediaSourceInfo defaultAudioStreamIndex( + @org.eclipse.jdt.annotation.NonNull Integer defaultAudioStreamIndex) { + this.defaultAudioStreamIndex = defaultAudioStreamIndex; + return this; + } + + /** + * Get defaultAudioStreamIndex + * + * @return defaultAudioStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEFAULT_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDefaultAudioStreamIndex() { + return defaultAudioStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultAudioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer defaultAudioStreamIndex) { + this.defaultAudioStreamIndex = defaultAudioStreamIndex; + } + + public MediaSourceInfo defaultSubtitleStreamIndex( + @org.eclipse.jdt.annotation.NonNull Integer defaultSubtitleStreamIndex) { + this.defaultSubtitleStreamIndex = defaultSubtitleStreamIndex; + return this; + } + + /** + * Get defaultSubtitleStreamIndex + * + * @return defaultSubtitleStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEFAULT_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDefaultSubtitleStreamIndex() { + return defaultSubtitleStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultSubtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer defaultSubtitleStreamIndex) { + this.defaultSubtitleStreamIndex = defaultSubtitleStreamIndex; + } + + public MediaSourceInfo hasSegments(@org.eclipse.jdt.annotation.NonNull Boolean hasSegments) { + this.hasSegments = hasSegments; + return this; + } + + /** + * Get hasSegments + * + * @return hasSegments + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_SEGMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasSegments() { + return hasSegments; + } + + @JsonProperty(JSON_PROPERTY_HAS_SEGMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasSegments(@org.eclipse.jdt.annotation.NonNull Boolean hasSegments) { + this.hasSegments = hasSegments; + } + + /** + * Return true if this MediaSourceInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaSourceInfo mediaSourceInfo = (MediaSourceInfo) o; + return Objects.equals(this.protocol, mediaSourceInfo.protocol) && Objects.equals(this.id, mediaSourceInfo.id) + && Objects.equals(this.path, mediaSourceInfo.path) + && Objects.equals(this.encoderPath, mediaSourceInfo.encoderPath) + && Objects.equals(this.encoderProtocol, mediaSourceInfo.encoderProtocol) + && Objects.equals(this.type, mediaSourceInfo.type) + && Objects.equals(this.container, mediaSourceInfo.container) + && Objects.equals(this.size, mediaSourceInfo.size) && Objects.equals(this.name, mediaSourceInfo.name) + && Objects.equals(this.isRemote, mediaSourceInfo.isRemote) + && Objects.equals(this.etag, mediaSourceInfo.etag) + && Objects.equals(this.runTimeTicks, mediaSourceInfo.runTimeTicks) + && Objects.equals(this.readAtNativeFramerate, mediaSourceInfo.readAtNativeFramerate) + && Objects.equals(this.ignoreDts, mediaSourceInfo.ignoreDts) + && Objects.equals(this.ignoreIndex, mediaSourceInfo.ignoreIndex) + && Objects.equals(this.genPtsInput, mediaSourceInfo.genPtsInput) + && Objects.equals(this.supportsTranscoding, mediaSourceInfo.supportsTranscoding) + && Objects.equals(this.supportsDirectStream, mediaSourceInfo.supportsDirectStream) + && Objects.equals(this.supportsDirectPlay, mediaSourceInfo.supportsDirectPlay) + && Objects.equals(this.isInfiniteStream, mediaSourceInfo.isInfiniteStream) + && Objects.equals(this.useMostCompatibleTranscodingProfile, + mediaSourceInfo.useMostCompatibleTranscodingProfile) + && Objects.equals(this.requiresOpening, mediaSourceInfo.requiresOpening) + && Objects.equals(this.openToken, mediaSourceInfo.openToken) + && Objects.equals(this.requiresClosing, mediaSourceInfo.requiresClosing) + && Objects.equals(this.liveStreamId, mediaSourceInfo.liveStreamId) + && Objects.equals(this.bufferMs, mediaSourceInfo.bufferMs) + && Objects.equals(this.requiresLooping, mediaSourceInfo.requiresLooping) + && Objects.equals(this.supportsProbing, mediaSourceInfo.supportsProbing) + && Objects.equals(this.videoType, mediaSourceInfo.videoType) + && Objects.equals(this.isoType, mediaSourceInfo.isoType) + && Objects.equals(this.video3DFormat, mediaSourceInfo.video3DFormat) + && Objects.equals(this.mediaStreams, mediaSourceInfo.mediaStreams) + && Objects.equals(this.mediaAttachments, mediaSourceInfo.mediaAttachments) + && Objects.equals(this.formats, mediaSourceInfo.formats) + && Objects.equals(this.bitrate, mediaSourceInfo.bitrate) + && Objects.equals(this.fallbackMaxStreamingBitrate, mediaSourceInfo.fallbackMaxStreamingBitrate) + && Objects.equals(this.timestamp, mediaSourceInfo.timestamp) + && Objects.equals(this.requiredHttpHeaders, mediaSourceInfo.requiredHttpHeaders) + && Objects.equals(this.transcodingUrl, mediaSourceInfo.transcodingUrl) + && Objects.equals(this.transcodingSubProtocol, mediaSourceInfo.transcodingSubProtocol) + && Objects.equals(this.transcodingContainer, mediaSourceInfo.transcodingContainer) + && Objects.equals(this.analyzeDurationMs, mediaSourceInfo.analyzeDurationMs) + && Objects.equals(this.defaultAudioStreamIndex, mediaSourceInfo.defaultAudioStreamIndex) + && Objects.equals(this.defaultSubtitleStreamIndex, mediaSourceInfo.defaultSubtitleStreamIndex) + && Objects.equals(this.hasSegments, mediaSourceInfo.hasSegments); + } + + @Override + public int hashCode() { + return Objects.hash(protocol, id, path, encoderPath, encoderProtocol, type, container, size, name, isRemote, + etag, runTimeTicks, readAtNativeFramerate, ignoreDts, ignoreIndex, genPtsInput, supportsTranscoding, + supportsDirectStream, supportsDirectPlay, isInfiniteStream, useMostCompatibleTranscodingProfile, + requiresOpening, openToken, requiresClosing, liveStreamId, bufferMs, requiresLooping, supportsProbing, + videoType, isoType, video3DFormat, mediaStreams, mediaAttachments, formats, bitrate, + fallbackMaxStreamingBitrate, timestamp, requiredHttpHeaders, transcodingUrl, transcodingSubProtocol, + transcodingContainer, analyzeDurationMs, defaultAudioStreamIndex, defaultSubtitleStreamIndex, + hasSegments); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaSourceInfo {\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" encoderPath: ").append(toIndentedString(encoderPath)).append("\n"); + sb.append(" encoderProtocol: ").append(toIndentedString(encoderProtocol)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" isRemote: ").append(toIndentedString(isRemote)).append("\n"); + sb.append(" etag: ").append(toIndentedString(etag)).append("\n"); + sb.append(" runTimeTicks: ").append(toIndentedString(runTimeTicks)).append("\n"); + sb.append(" readAtNativeFramerate: ").append(toIndentedString(readAtNativeFramerate)).append("\n"); + sb.append(" ignoreDts: ").append(toIndentedString(ignoreDts)).append("\n"); + sb.append(" ignoreIndex: ").append(toIndentedString(ignoreIndex)).append("\n"); + sb.append(" genPtsInput: ").append(toIndentedString(genPtsInput)).append("\n"); + sb.append(" supportsTranscoding: ").append(toIndentedString(supportsTranscoding)).append("\n"); + sb.append(" supportsDirectStream: ").append(toIndentedString(supportsDirectStream)).append("\n"); + sb.append(" supportsDirectPlay: ").append(toIndentedString(supportsDirectPlay)).append("\n"); + sb.append(" isInfiniteStream: ").append(toIndentedString(isInfiniteStream)).append("\n"); + sb.append(" useMostCompatibleTranscodingProfile: ") + .append(toIndentedString(useMostCompatibleTranscodingProfile)).append("\n"); + sb.append(" requiresOpening: ").append(toIndentedString(requiresOpening)).append("\n"); + sb.append(" openToken: ").append(toIndentedString(openToken)).append("\n"); + sb.append(" requiresClosing: ").append(toIndentedString(requiresClosing)).append("\n"); + sb.append(" liveStreamId: ").append(toIndentedString(liveStreamId)).append("\n"); + sb.append(" bufferMs: ").append(toIndentedString(bufferMs)).append("\n"); + sb.append(" requiresLooping: ").append(toIndentedString(requiresLooping)).append("\n"); + sb.append(" supportsProbing: ").append(toIndentedString(supportsProbing)).append("\n"); + sb.append(" videoType: ").append(toIndentedString(videoType)).append("\n"); + sb.append(" isoType: ").append(toIndentedString(isoType)).append("\n"); + sb.append(" video3DFormat: ").append(toIndentedString(video3DFormat)).append("\n"); + sb.append(" mediaStreams: ").append(toIndentedString(mediaStreams)).append("\n"); + sb.append(" mediaAttachments: ").append(toIndentedString(mediaAttachments)).append("\n"); + sb.append(" formats: ").append(toIndentedString(formats)).append("\n"); + sb.append(" bitrate: ").append(toIndentedString(bitrate)).append("\n"); + sb.append(" fallbackMaxStreamingBitrate: ").append(toIndentedString(fallbackMaxStreamingBitrate)) + .append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" requiredHttpHeaders: ").append(toIndentedString(requiredHttpHeaders)).append("\n"); + sb.append(" transcodingUrl: ").append(toIndentedString(transcodingUrl)).append("\n"); + sb.append(" transcodingSubProtocol: ").append(toIndentedString(transcodingSubProtocol)).append("\n"); + sb.append(" transcodingContainer: ").append(toIndentedString(transcodingContainer)).append("\n"); + sb.append(" analyzeDurationMs: ").append(toIndentedString(analyzeDurationMs)).append("\n"); + sb.append(" defaultAudioStreamIndex: ").append(toIndentedString(defaultAudioStreamIndex)).append("\n"); + sb.append(" defaultSubtitleStreamIndex: ").append(toIndentedString(defaultSubtitleStreamIndex)).append("\n"); + sb.append(" hasSegments: ").append(toIndentedString(hasSegments)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Protocol` to the URL query string + if (getProtocol() != null) { + joiner.add(String.format("%sProtocol%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProtocol())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `EncoderPath` to the URL query string + if (getEncoderPath() != null) { + joiner.add(String.format("%sEncoderPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEncoderPath())))); + } + + // add `EncoderProtocol` to the URL query string + if (getEncoderProtocol() != null) { + joiner.add(String.format("%sEncoderProtocol%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEncoderProtocol())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + // add `Size` to the URL query string + if (getSize() != null) { + joiner.add(String.format("%sSize%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSize())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `IsRemote` to the URL query string + if (getIsRemote() != null) { + joiner.add(String.format("%sIsRemote%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsRemote())))); + } + + // add `ETag` to the URL query string + if (getEtag() != null) { + joiner.add(String.format("%sETag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEtag())))); + } + + // add `RunTimeTicks` to the URL query string + if (getRunTimeTicks() != null) { + joiner.add(String.format("%sRunTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRunTimeTicks())))); + } + + // add `ReadAtNativeFramerate` to the URL query string + if (getReadAtNativeFramerate() != null) { + joiner.add(String.format("%sReadAtNativeFramerate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getReadAtNativeFramerate())))); + } + + // add `IgnoreDts` to the URL query string + if (getIgnoreDts() != null) { + joiner.add(String.format("%sIgnoreDts%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIgnoreDts())))); + } + + // add `IgnoreIndex` to the URL query string + if (getIgnoreIndex() != null) { + joiner.add(String.format("%sIgnoreIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIgnoreIndex())))); + } + + // add `GenPtsInput` to the URL query string + if (getGenPtsInput() != null) { + joiner.add(String.format("%sGenPtsInput%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGenPtsInput())))); + } + + // add `SupportsTranscoding` to the URL query string + if (getSupportsTranscoding() != null) { + joiner.add(String.format("%sSupportsTranscoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsTranscoding())))); + } + + // add `SupportsDirectStream` to the URL query string + if (getSupportsDirectStream() != null) { + joiner.add(String.format("%sSupportsDirectStream%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsDirectStream())))); + } + + // add `SupportsDirectPlay` to the URL query string + if (getSupportsDirectPlay() != null) { + joiner.add(String.format("%sSupportsDirectPlay%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsDirectPlay())))); + } + + // add `IsInfiniteStream` to the URL query string + if (getIsInfiniteStream() != null) { + joiner.add(String.format("%sIsInfiniteStream%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsInfiniteStream())))); + } + + // add `UseMostCompatibleTranscodingProfile` to the URL query string + if (getUseMostCompatibleTranscodingProfile() != null) { + joiner.add(String.format("%sUseMostCompatibleTranscodingProfile%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUseMostCompatibleTranscodingProfile())))); + } + + // add `RequiresOpening` to the URL query string + if (getRequiresOpening() != null) { + joiner.add(String.format("%sRequiresOpening%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRequiresOpening())))); + } + + // add `OpenToken` to the URL query string + if (getOpenToken() != null) { + joiner.add(String.format("%sOpenToken%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOpenToken())))); + } + + // add `RequiresClosing` to the URL query string + if (getRequiresClosing() != null) { + joiner.add(String.format("%sRequiresClosing%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRequiresClosing())))); + } + + // add `LiveStreamId` to the URL query string + if (getLiveStreamId() != null) { + joiner.add(String.format("%sLiveStreamId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLiveStreamId())))); + } + + // add `BufferMs` to the URL query string + if (getBufferMs() != null) { + joiner.add(String.format("%sBufferMs%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBufferMs())))); + } + + // add `RequiresLooping` to the URL query string + if (getRequiresLooping() != null) { + joiner.add(String.format("%sRequiresLooping%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRequiresLooping())))); + } + + // add `SupportsProbing` to the URL query string + if (getSupportsProbing() != null) { + joiner.add(String.format("%sSupportsProbing%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsProbing())))); + } + + // add `VideoType` to the URL query string + if (getVideoType() != null) { + joiner.add(String.format("%sVideoType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoType())))); + } + + // add `IsoType` to the URL query string + if (getIsoType() != null) { + joiner.add(String.format("%sIsoType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsoType())))); + } + + // add `Video3DFormat` to the URL query string + if (getVideo3DFormat() != null) { + joiner.add(String.format("%sVideo3DFormat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideo3DFormat())))); + } + + // add `MediaStreams` to the URL query string + if (getMediaStreams() != null) { + for (int i = 0; i < getMediaStreams().size(); i++) { + if (getMediaStreams().get(i) != null) { + joiner.add(getMediaStreams().get(i).toUrlQueryString(String.format("%sMediaStreams%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `MediaAttachments` to the URL query string + if (getMediaAttachments() != null) { + for (int i = 0; i < getMediaAttachments().size(); i++) { + if (getMediaAttachments().get(i) != null) { + joiner.add(getMediaAttachments().get(i).toUrlQueryString(String.format("%sMediaAttachments%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Formats` to the URL query string + if (getFormats() != null) { + for (int i = 0; i < getFormats().size(); i++) { + joiner.add(String.format("%sFormats%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getFormats().get(i))))); + } + } + + // add `Bitrate` to the URL query string + if (getBitrate() != null) { + joiner.add(String.format("%sBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBitrate())))); + } + + // add `FallbackMaxStreamingBitrate` to the URL query string + if (getFallbackMaxStreamingBitrate() != null) { + joiner.add(String.format("%sFallbackMaxStreamingBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFallbackMaxStreamingBitrate())))); + } + + // add `Timestamp` to the URL query string + if (getTimestamp() != null) { + joiner.add(String.format("%sTimestamp%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTimestamp())))); + } + + // add `RequiredHttpHeaders` to the URL query string + if (getRequiredHttpHeaders() != null) { + for (String _key : getRequiredHttpHeaders().keySet()) { + joiner.add(String.format("%sRequiredHttpHeaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getRequiredHttpHeaders().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getRequiredHttpHeaders().get(_key))))); + } + } + + // add `TranscodingUrl` to the URL query string + if (getTranscodingUrl() != null) { + joiner.add(String.format("%sTranscodingUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTranscodingUrl())))); + } + + // add `TranscodingSubProtocol` to the URL query string + if (getTranscodingSubProtocol() != null) { + joiner.add(String.format("%sTranscodingSubProtocol%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTranscodingSubProtocol())))); + } + + // add `TranscodingContainer` to the URL query string + if (getTranscodingContainer() != null) { + joiner.add(String.format("%sTranscodingContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTranscodingContainer())))); + } + + // add `AnalyzeDurationMs` to the URL query string + if (getAnalyzeDurationMs() != null) { + joiner.add(String.format("%sAnalyzeDurationMs%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAnalyzeDurationMs())))); + } + + // add `DefaultAudioStreamIndex` to the URL query string + if (getDefaultAudioStreamIndex() != null) { + joiner.add(String.format("%sDefaultAudioStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDefaultAudioStreamIndex())))); + } + + // add `DefaultSubtitleStreamIndex` to the URL query string + if (getDefaultSubtitleStreamIndex() != null) { + joiner.add(String.format("%sDefaultSubtitleStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDefaultSubtitleStreamIndex())))); + } + + // add `HasSegments` to the URL query string + if (getHasSegments() != null) { + joiner.add(String.format("%sHasSegments%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasSegments())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaSourceInfo instance; + + public Builder() { + this(new MediaSourceInfo()); + } + + protected Builder(MediaSourceInfo instance) { + this.instance = instance; + } + + public MediaSourceInfo.Builder protocol(MediaProtocol protocol) { + this.instance.protocol = protocol; + return this; + } + + public MediaSourceInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public MediaSourceInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public MediaSourceInfo.Builder encoderPath(String encoderPath) { + this.instance.encoderPath = encoderPath; + return this; + } + + public MediaSourceInfo.Builder encoderProtocol(MediaProtocol encoderProtocol) { + this.instance.encoderProtocol = encoderProtocol; + return this; + } + + public MediaSourceInfo.Builder type(MediaSourceType type) { + this.instance.type = type; + return this; + } + + public MediaSourceInfo.Builder container(String container) { + this.instance.container = container; + return this; + } + + public MediaSourceInfo.Builder size(Long size) { + this.instance.size = size; + return this; + } + + public MediaSourceInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public MediaSourceInfo.Builder isRemote(Boolean isRemote) { + this.instance.isRemote = isRemote; + return this; + } + + public MediaSourceInfo.Builder etag(String etag) { + this.instance.etag = etag; + return this; + } + + public MediaSourceInfo.Builder runTimeTicks(Long runTimeTicks) { + this.instance.runTimeTicks = runTimeTicks; + return this; + } + + public MediaSourceInfo.Builder readAtNativeFramerate(Boolean readAtNativeFramerate) { + this.instance.readAtNativeFramerate = readAtNativeFramerate; + return this; + } + + public MediaSourceInfo.Builder ignoreDts(Boolean ignoreDts) { + this.instance.ignoreDts = ignoreDts; + return this; + } + + public MediaSourceInfo.Builder ignoreIndex(Boolean ignoreIndex) { + this.instance.ignoreIndex = ignoreIndex; + return this; + } + + public MediaSourceInfo.Builder genPtsInput(Boolean genPtsInput) { + this.instance.genPtsInput = genPtsInput; + return this; + } + + public MediaSourceInfo.Builder supportsTranscoding(Boolean supportsTranscoding) { + this.instance.supportsTranscoding = supportsTranscoding; + return this; + } + + public MediaSourceInfo.Builder supportsDirectStream(Boolean supportsDirectStream) { + this.instance.supportsDirectStream = supportsDirectStream; + return this; + } + + public MediaSourceInfo.Builder supportsDirectPlay(Boolean supportsDirectPlay) { + this.instance.supportsDirectPlay = supportsDirectPlay; + return this; + } + + public MediaSourceInfo.Builder isInfiniteStream(Boolean isInfiniteStream) { + this.instance.isInfiniteStream = isInfiniteStream; + return this; + } + + public MediaSourceInfo.Builder useMostCompatibleTranscodingProfile( + Boolean useMostCompatibleTranscodingProfile) { + this.instance.useMostCompatibleTranscodingProfile = useMostCompatibleTranscodingProfile; + return this; + } + + public MediaSourceInfo.Builder requiresOpening(Boolean requiresOpening) { + this.instance.requiresOpening = requiresOpening; + return this; + } + + public MediaSourceInfo.Builder openToken(String openToken) { + this.instance.openToken = openToken; + return this; + } + + public MediaSourceInfo.Builder requiresClosing(Boolean requiresClosing) { + this.instance.requiresClosing = requiresClosing; + return this; + } + + public MediaSourceInfo.Builder liveStreamId(String liveStreamId) { + this.instance.liveStreamId = liveStreamId; + return this; + } + + public MediaSourceInfo.Builder bufferMs(Integer bufferMs) { + this.instance.bufferMs = bufferMs; + return this; + } + + public MediaSourceInfo.Builder requiresLooping(Boolean requiresLooping) { + this.instance.requiresLooping = requiresLooping; + return this; + } + + public MediaSourceInfo.Builder supportsProbing(Boolean supportsProbing) { + this.instance.supportsProbing = supportsProbing; + return this; + } + + public MediaSourceInfo.Builder videoType(VideoType videoType) { + this.instance.videoType = videoType; + return this; + } + + public MediaSourceInfo.Builder isoType(IsoType isoType) { + this.instance.isoType = isoType; + return this; + } + + public MediaSourceInfo.Builder video3DFormat(Video3DFormat video3DFormat) { + this.instance.video3DFormat = video3DFormat; + return this; + } + + public MediaSourceInfo.Builder mediaStreams(List mediaStreams) { + this.instance.mediaStreams = mediaStreams; + return this; + } + + public MediaSourceInfo.Builder mediaAttachments(List mediaAttachments) { + this.instance.mediaAttachments = mediaAttachments; + return this; + } + + public MediaSourceInfo.Builder formats(List formats) { + this.instance.formats = formats; + return this; + } + + public MediaSourceInfo.Builder bitrate(Integer bitrate) { + this.instance.bitrate = bitrate; + return this; + } + + public MediaSourceInfo.Builder fallbackMaxStreamingBitrate(Integer fallbackMaxStreamingBitrate) { + this.instance.fallbackMaxStreamingBitrate = fallbackMaxStreamingBitrate; + return this; + } + + public MediaSourceInfo.Builder timestamp(TransportStreamTimestamp timestamp) { + this.instance.timestamp = timestamp; + return this; + } + + public MediaSourceInfo.Builder requiredHttpHeaders(Map requiredHttpHeaders) { + this.instance.requiredHttpHeaders = requiredHttpHeaders; + return this; + } + + public MediaSourceInfo.Builder transcodingUrl(String transcodingUrl) { + this.instance.transcodingUrl = transcodingUrl; + return this; + } + + public MediaSourceInfo.Builder transcodingSubProtocol(MediaStreamProtocol transcodingSubProtocol) { + this.instance.transcodingSubProtocol = transcodingSubProtocol; + return this; + } + + public MediaSourceInfo.Builder transcodingContainer(String transcodingContainer) { + this.instance.transcodingContainer = transcodingContainer; + return this; + } + + public MediaSourceInfo.Builder analyzeDurationMs(Integer analyzeDurationMs) { + this.instance.analyzeDurationMs = analyzeDurationMs; + return this; + } + + public MediaSourceInfo.Builder defaultAudioStreamIndex(Integer defaultAudioStreamIndex) { + this.instance.defaultAudioStreamIndex = defaultAudioStreamIndex; + return this; + } + + public MediaSourceInfo.Builder defaultSubtitleStreamIndex(Integer defaultSubtitleStreamIndex) { + this.instance.defaultSubtitleStreamIndex = defaultSubtitleStreamIndex; + return this; + } + + public MediaSourceInfo.Builder hasSegments(Boolean hasSegments) { + this.instance.hasSegments = hasSegments; + return this; + } + + /** + * returns a built MediaSourceInfo instance. + * + * The builder is not reusable. + */ + public MediaSourceInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaSourceInfo.Builder builder() { + return new MediaSourceInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaSourceInfo.Builder toBuilder() { + return new MediaSourceInfo.Builder().protocol(getProtocol()).id(getId()).path(getPath()) + .encoderPath(getEncoderPath()).encoderProtocol(getEncoderProtocol()).type(getType()) + .container(getContainer()).size(getSize()).name(getName()).isRemote(getIsRemote()).etag(getEtag()) + .runTimeTicks(getRunTimeTicks()).readAtNativeFramerate(getReadAtNativeFramerate()) + .ignoreDts(getIgnoreDts()).ignoreIndex(getIgnoreIndex()).genPtsInput(getGenPtsInput()) + .supportsTranscoding(getSupportsTranscoding()).supportsDirectStream(getSupportsDirectStream()) + .supportsDirectPlay(getSupportsDirectPlay()).isInfiniteStream(getIsInfiniteStream()) + .useMostCompatibleTranscodingProfile(getUseMostCompatibleTranscodingProfile()) + .requiresOpening(getRequiresOpening()).openToken(getOpenToken()).requiresClosing(getRequiresClosing()) + .liveStreamId(getLiveStreamId()).bufferMs(getBufferMs()).requiresLooping(getRequiresLooping()) + .supportsProbing(getSupportsProbing()).videoType(getVideoType()).isoType(getIsoType()) + .video3DFormat(getVideo3DFormat()).mediaStreams(getMediaStreams()) + .mediaAttachments(getMediaAttachments()).formats(getFormats()).bitrate(getBitrate()) + .fallbackMaxStreamingBitrate(getFallbackMaxStreamingBitrate()).timestamp(getTimestamp()) + .requiredHttpHeaders(getRequiredHttpHeaders()).transcodingUrl(getTranscodingUrl()) + .transcodingSubProtocol(getTranscodingSubProtocol()).transcodingContainer(getTranscodingContainer()) + .analyzeDurationMs(getAnalyzeDurationMs()).defaultAudioStreamIndex(getDefaultAudioStreamIndex()) + .defaultSubtitleStreamIndex(getDefaultSubtitleStreamIndex()).hasSegments(getHasSegments()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSourceType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSourceType.java new file mode 100644 index 0000000000000..0a06f1ef78450 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaSourceType.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets MediaSourceType + */ +public enum MediaSourceType { + + DEFAULT("Default"), + + GROUPING("Grouping"), + + PLACEHOLDER("Placeholder"); + + private String value; + + MediaSourceType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MediaSourceType fromValue(String value) { + for (MediaSourceType b : MediaSourceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaStream.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaStream.java new file mode 100644 index 0000000000000..2b0c2baf5b2ad --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaStream.java @@ -0,0 +1,2670 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class MediaStream. + */ +@JsonPropertyOrder({ MediaStream.JSON_PROPERTY_CODEC, MediaStream.JSON_PROPERTY_CODEC_TAG, + MediaStream.JSON_PROPERTY_LANGUAGE, MediaStream.JSON_PROPERTY_COLOR_RANGE, + MediaStream.JSON_PROPERTY_COLOR_SPACE, MediaStream.JSON_PROPERTY_COLOR_TRANSFER, + MediaStream.JSON_PROPERTY_COLOR_PRIMARIES, MediaStream.JSON_PROPERTY_DV_VERSION_MAJOR, + MediaStream.JSON_PROPERTY_DV_VERSION_MINOR, MediaStream.JSON_PROPERTY_DV_PROFILE, + MediaStream.JSON_PROPERTY_DV_LEVEL, MediaStream.JSON_PROPERTY_RPU_PRESENT_FLAG, + MediaStream.JSON_PROPERTY_EL_PRESENT_FLAG, MediaStream.JSON_PROPERTY_BL_PRESENT_FLAG, + MediaStream.JSON_PROPERTY_DV_BL_SIGNAL_COMPATIBILITY_ID, MediaStream.JSON_PROPERTY_ROTATION, + MediaStream.JSON_PROPERTY_COMMENT, MediaStream.JSON_PROPERTY_TIME_BASE, + MediaStream.JSON_PROPERTY_CODEC_TIME_BASE, MediaStream.JSON_PROPERTY_TITLE, + MediaStream.JSON_PROPERTY_VIDEO_RANGE, MediaStream.JSON_PROPERTY_VIDEO_RANGE_TYPE, + MediaStream.JSON_PROPERTY_VIDEO_DO_VI_TITLE, MediaStream.JSON_PROPERTY_AUDIO_SPATIAL_FORMAT, + MediaStream.JSON_PROPERTY_LOCALIZED_UNDEFINED, MediaStream.JSON_PROPERTY_LOCALIZED_DEFAULT, + MediaStream.JSON_PROPERTY_LOCALIZED_FORCED, MediaStream.JSON_PROPERTY_LOCALIZED_EXTERNAL, + MediaStream.JSON_PROPERTY_LOCALIZED_HEARING_IMPAIRED, MediaStream.JSON_PROPERTY_DISPLAY_TITLE, + MediaStream.JSON_PROPERTY_NAL_LENGTH_SIZE, MediaStream.JSON_PROPERTY_IS_INTERLACED, + MediaStream.JSON_PROPERTY_IS_A_V_C, MediaStream.JSON_PROPERTY_CHANNEL_LAYOUT, + MediaStream.JSON_PROPERTY_BIT_RATE, MediaStream.JSON_PROPERTY_BIT_DEPTH, MediaStream.JSON_PROPERTY_REF_FRAMES, + MediaStream.JSON_PROPERTY_PACKET_LENGTH, MediaStream.JSON_PROPERTY_CHANNELS, + MediaStream.JSON_PROPERTY_SAMPLE_RATE, MediaStream.JSON_PROPERTY_IS_DEFAULT, + MediaStream.JSON_PROPERTY_IS_FORCED, MediaStream.JSON_PROPERTY_IS_HEARING_IMPAIRED, + MediaStream.JSON_PROPERTY_HEIGHT, MediaStream.JSON_PROPERTY_WIDTH, MediaStream.JSON_PROPERTY_AVERAGE_FRAME_RATE, + MediaStream.JSON_PROPERTY_REAL_FRAME_RATE, MediaStream.JSON_PROPERTY_REFERENCE_FRAME_RATE, + MediaStream.JSON_PROPERTY_PROFILE, MediaStream.JSON_PROPERTY_TYPE, MediaStream.JSON_PROPERTY_ASPECT_RATIO, + MediaStream.JSON_PROPERTY_INDEX, MediaStream.JSON_PROPERTY_SCORE, MediaStream.JSON_PROPERTY_IS_EXTERNAL, + MediaStream.JSON_PROPERTY_DELIVERY_METHOD, MediaStream.JSON_PROPERTY_DELIVERY_URL, + MediaStream.JSON_PROPERTY_IS_EXTERNAL_URL, MediaStream.JSON_PROPERTY_IS_TEXT_SUBTITLE_STREAM, + MediaStream.JSON_PROPERTY_SUPPORTS_EXTERNAL_STREAM, MediaStream.JSON_PROPERTY_PATH, + MediaStream.JSON_PROPERTY_PIXEL_FORMAT, MediaStream.JSON_PROPERTY_LEVEL, + MediaStream.JSON_PROPERTY_IS_ANAMORPHIC }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaStream { + public static final String JSON_PROPERTY_CODEC = "Codec"; + @org.eclipse.jdt.annotation.NonNull + private String codec; + + public static final String JSON_PROPERTY_CODEC_TAG = "CodecTag"; + @org.eclipse.jdt.annotation.NonNull + private String codecTag; + + public static final String JSON_PROPERTY_LANGUAGE = "Language"; + @org.eclipse.jdt.annotation.NonNull + private String language; + + public static final String JSON_PROPERTY_COLOR_RANGE = "ColorRange"; + @org.eclipse.jdt.annotation.NonNull + private String colorRange; + + public static final String JSON_PROPERTY_COLOR_SPACE = "ColorSpace"; + @org.eclipse.jdt.annotation.NonNull + private String colorSpace; + + public static final String JSON_PROPERTY_COLOR_TRANSFER = "ColorTransfer"; + @org.eclipse.jdt.annotation.NonNull + private String colorTransfer; + + public static final String JSON_PROPERTY_COLOR_PRIMARIES = "ColorPrimaries"; + @org.eclipse.jdt.annotation.NonNull + private String colorPrimaries; + + public static final String JSON_PROPERTY_DV_VERSION_MAJOR = "DvVersionMajor"; + @org.eclipse.jdt.annotation.NonNull + private Integer dvVersionMajor; + + public static final String JSON_PROPERTY_DV_VERSION_MINOR = "DvVersionMinor"; + @org.eclipse.jdt.annotation.NonNull + private Integer dvVersionMinor; + + public static final String JSON_PROPERTY_DV_PROFILE = "DvProfile"; + @org.eclipse.jdt.annotation.NonNull + private Integer dvProfile; + + public static final String JSON_PROPERTY_DV_LEVEL = "DvLevel"; + @org.eclipse.jdt.annotation.NonNull + private Integer dvLevel; + + public static final String JSON_PROPERTY_RPU_PRESENT_FLAG = "RpuPresentFlag"; + @org.eclipse.jdt.annotation.NonNull + private Integer rpuPresentFlag; + + public static final String JSON_PROPERTY_EL_PRESENT_FLAG = "ElPresentFlag"; + @org.eclipse.jdt.annotation.NonNull + private Integer elPresentFlag; + + public static final String JSON_PROPERTY_BL_PRESENT_FLAG = "BlPresentFlag"; + @org.eclipse.jdt.annotation.NonNull + private Integer blPresentFlag; + + public static final String JSON_PROPERTY_DV_BL_SIGNAL_COMPATIBILITY_ID = "DvBlSignalCompatibilityId"; + @org.eclipse.jdt.annotation.NonNull + private Integer dvBlSignalCompatibilityId; + + public static final String JSON_PROPERTY_ROTATION = "Rotation"; + @org.eclipse.jdt.annotation.NonNull + private Integer rotation; + + public static final String JSON_PROPERTY_COMMENT = "Comment"; + @org.eclipse.jdt.annotation.NonNull + private String comment; + + public static final String JSON_PROPERTY_TIME_BASE = "TimeBase"; + @org.eclipse.jdt.annotation.NonNull + private String timeBase; + + public static final String JSON_PROPERTY_CODEC_TIME_BASE = "CodecTimeBase"; + @org.eclipse.jdt.annotation.NonNull + private String codecTimeBase; + + public static final String JSON_PROPERTY_TITLE = "Title"; + @org.eclipse.jdt.annotation.NonNull + private String title; + + public static final String JSON_PROPERTY_VIDEO_RANGE = "VideoRange"; + @org.eclipse.jdt.annotation.NonNull + private VideoRange videoRange = VideoRange.UNKNOWN; + + public static final String JSON_PROPERTY_VIDEO_RANGE_TYPE = "VideoRangeType"; + @org.eclipse.jdt.annotation.NonNull + private VideoRangeType videoRangeType = VideoRangeType.UNKNOWN; + + public static final String JSON_PROPERTY_VIDEO_DO_VI_TITLE = "VideoDoViTitle"; + @org.eclipse.jdt.annotation.NonNull + private String videoDoViTitle; + + public static final String JSON_PROPERTY_AUDIO_SPATIAL_FORMAT = "AudioSpatialFormat"; + @org.eclipse.jdt.annotation.NonNull + private AudioSpatialFormat audioSpatialFormat = AudioSpatialFormat.NONE; + + public static final String JSON_PROPERTY_LOCALIZED_UNDEFINED = "LocalizedUndefined"; + @org.eclipse.jdt.annotation.NonNull + private String localizedUndefined; + + public static final String JSON_PROPERTY_LOCALIZED_DEFAULT = "LocalizedDefault"; + @org.eclipse.jdt.annotation.NonNull + private String localizedDefault; + + public static final String JSON_PROPERTY_LOCALIZED_FORCED = "LocalizedForced"; + @org.eclipse.jdt.annotation.NonNull + private String localizedForced; + + public static final String JSON_PROPERTY_LOCALIZED_EXTERNAL = "LocalizedExternal"; + @org.eclipse.jdt.annotation.NonNull + private String localizedExternal; + + public static final String JSON_PROPERTY_LOCALIZED_HEARING_IMPAIRED = "LocalizedHearingImpaired"; + @org.eclipse.jdt.annotation.NonNull + private String localizedHearingImpaired; + + public static final String JSON_PROPERTY_DISPLAY_TITLE = "DisplayTitle"; + @org.eclipse.jdt.annotation.NonNull + private String displayTitle; + + public static final String JSON_PROPERTY_NAL_LENGTH_SIZE = "NalLengthSize"; + @org.eclipse.jdt.annotation.NonNull + private String nalLengthSize; + + public static final String JSON_PROPERTY_IS_INTERLACED = "IsInterlaced"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isInterlaced; + + public static final String JSON_PROPERTY_IS_A_V_C = "IsAVC"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAVC; + + public static final String JSON_PROPERTY_CHANNEL_LAYOUT = "ChannelLayout"; + @org.eclipse.jdt.annotation.NonNull + private String channelLayout; + + public static final String JSON_PROPERTY_BIT_RATE = "BitRate"; + @org.eclipse.jdt.annotation.NonNull + private Integer bitRate; + + public static final String JSON_PROPERTY_BIT_DEPTH = "BitDepth"; + @org.eclipse.jdt.annotation.NonNull + private Integer bitDepth; + + public static final String JSON_PROPERTY_REF_FRAMES = "RefFrames"; + @org.eclipse.jdt.annotation.NonNull + private Integer refFrames; + + public static final String JSON_PROPERTY_PACKET_LENGTH = "PacketLength"; + @org.eclipse.jdt.annotation.NonNull + private Integer packetLength; + + public static final String JSON_PROPERTY_CHANNELS = "Channels"; + @org.eclipse.jdt.annotation.NonNull + private Integer channels; + + public static final String JSON_PROPERTY_SAMPLE_RATE = "SampleRate"; + @org.eclipse.jdt.annotation.NonNull + private Integer sampleRate; + + public static final String JSON_PROPERTY_IS_DEFAULT = "IsDefault"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isDefault; + + public static final String JSON_PROPERTY_IS_FORCED = "IsForced"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isForced; + + public static final String JSON_PROPERTY_IS_HEARING_IMPAIRED = "IsHearingImpaired"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isHearingImpaired; + + public static final String JSON_PROPERTY_HEIGHT = "Height"; + @org.eclipse.jdt.annotation.NonNull + private Integer height; + + public static final String JSON_PROPERTY_WIDTH = "Width"; + @org.eclipse.jdt.annotation.NonNull + private Integer width; + + public static final String JSON_PROPERTY_AVERAGE_FRAME_RATE = "AverageFrameRate"; + @org.eclipse.jdt.annotation.NonNull + private Float averageFrameRate; + + public static final String JSON_PROPERTY_REAL_FRAME_RATE = "RealFrameRate"; + @org.eclipse.jdt.annotation.NonNull + private Float realFrameRate; + + public static final String JSON_PROPERTY_REFERENCE_FRAME_RATE = "ReferenceFrameRate"; + @org.eclipse.jdt.annotation.NonNull + private Float referenceFrameRate; + + public static final String JSON_PROPERTY_PROFILE = "Profile"; + @org.eclipse.jdt.annotation.NonNull + private String profile; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private MediaStreamType type; + + public static final String JSON_PROPERTY_ASPECT_RATIO = "AspectRatio"; + @org.eclipse.jdt.annotation.NonNull + private String aspectRatio; + + public static final String JSON_PROPERTY_INDEX = "Index"; + @org.eclipse.jdt.annotation.NonNull + private Integer index; + + public static final String JSON_PROPERTY_SCORE = "Score"; + @org.eclipse.jdt.annotation.NonNull + private Integer score; + + public static final String JSON_PROPERTY_IS_EXTERNAL = "IsExternal"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isExternal; + + public static final String JSON_PROPERTY_DELIVERY_METHOD = "DeliveryMethod"; + @org.eclipse.jdt.annotation.NonNull + private SubtitleDeliveryMethod deliveryMethod; + + public static final String JSON_PROPERTY_DELIVERY_URL = "DeliveryUrl"; + @org.eclipse.jdt.annotation.NonNull + private String deliveryUrl; + + public static final String JSON_PROPERTY_IS_EXTERNAL_URL = "IsExternalUrl"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isExternalUrl; + + public static final String JSON_PROPERTY_IS_TEXT_SUBTITLE_STREAM = "IsTextSubtitleStream"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isTextSubtitleStream; + + public static final String JSON_PROPERTY_SUPPORTS_EXTERNAL_STREAM = "SupportsExternalStream"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsExternalStream; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_PIXEL_FORMAT = "PixelFormat"; + @org.eclipse.jdt.annotation.NonNull + private String pixelFormat; + + public static final String JSON_PROPERTY_LEVEL = "Level"; + @org.eclipse.jdt.annotation.NonNull + private Double level; + + public static final String JSON_PROPERTY_IS_ANAMORPHIC = "IsAnamorphic"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAnamorphic; + + public MediaStream() { + } + + @JsonCreator + public MediaStream(@JsonProperty(JSON_PROPERTY_VIDEO_RANGE) VideoRange videoRange, + @JsonProperty(JSON_PROPERTY_VIDEO_RANGE_TYPE) VideoRangeType videoRangeType, + @JsonProperty(JSON_PROPERTY_VIDEO_DO_VI_TITLE) String videoDoViTitle, + @JsonProperty(JSON_PROPERTY_AUDIO_SPATIAL_FORMAT) AudioSpatialFormat audioSpatialFormat, + @JsonProperty(JSON_PROPERTY_DISPLAY_TITLE) String displayTitle, + @JsonProperty(JSON_PROPERTY_REFERENCE_FRAME_RATE) Float referenceFrameRate, + @JsonProperty(JSON_PROPERTY_IS_TEXT_SUBTITLE_STREAM) Boolean isTextSubtitleStream) { + this(); + this.videoRange = videoRange; + this.videoRangeType = videoRangeType; + this.videoDoViTitle = videoDoViTitle; + this.audioSpatialFormat = audioSpatialFormat; + this.displayTitle = displayTitle; + this.referenceFrameRate = referenceFrameRate; + this.isTextSubtitleStream = isTextSubtitleStream; + } + + public MediaStream codec(@org.eclipse.jdt.annotation.NonNull String codec) { + this.codec = codec; + return this; + } + + /** + * Gets or sets the codec. + * + * @return codec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCodec() { + return codec; + } + + @JsonProperty(JSON_PROPERTY_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCodec(@org.eclipse.jdt.annotation.NonNull String codec) { + this.codec = codec; + } + + public MediaStream codecTag(@org.eclipse.jdt.annotation.NonNull String codecTag) { + this.codecTag = codecTag; + return this; + } + + /** + * Gets or sets the codec tag. + * + * @return codecTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODEC_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCodecTag() { + return codecTag; + } + + @JsonProperty(JSON_PROPERTY_CODEC_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCodecTag(@org.eclipse.jdt.annotation.NonNull String codecTag) { + this.codecTag = codecTag; + } + + public MediaStream language(@org.eclipse.jdt.annotation.NonNull String language) { + this.language = language; + return this; + } + + /** + * Gets or sets the language. + * + * @return language + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLanguage() { + return language; + } + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLanguage(@org.eclipse.jdt.annotation.NonNull String language) { + this.language = language; + } + + public MediaStream colorRange(@org.eclipse.jdt.annotation.NonNull String colorRange) { + this.colorRange = colorRange; + return this; + } + + /** + * Gets or sets the color range. + * + * @return colorRange + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COLOR_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColorRange() { + return colorRange; + } + + @JsonProperty(JSON_PROPERTY_COLOR_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColorRange(@org.eclipse.jdt.annotation.NonNull String colorRange) { + this.colorRange = colorRange; + } + + public MediaStream colorSpace(@org.eclipse.jdt.annotation.NonNull String colorSpace) { + this.colorSpace = colorSpace; + return this; + } + + /** + * Gets or sets the color space. + * + * @return colorSpace + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COLOR_SPACE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColorSpace() { + return colorSpace; + } + + @JsonProperty(JSON_PROPERTY_COLOR_SPACE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColorSpace(@org.eclipse.jdt.annotation.NonNull String colorSpace) { + this.colorSpace = colorSpace; + } + + public MediaStream colorTransfer(@org.eclipse.jdt.annotation.NonNull String colorTransfer) { + this.colorTransfer = colorTransfer; + return this; + } + + /** + * Gets or sets the color transfer. + * + * @return colorTransfer + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COLOR_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColorTransfer() { + return colorTransfer; + } + + @JsonProperty(JSON_PROPERTY_COLOR_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColorTransfer(@org.eclipse.jdt.annotation.NonNull String colorTransfer) { + this.colorTransfer = colorTransfer; + } + + public MediaStream colorPrimaries(@org.eclipse.jdt.annotation.NonNull String colorPrimaries) { + this.colorPrimaries = colorPrimaries; + return this; + } + + /** + * Gets or sets the color primaries. + * + * @return colorPrimaries + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COLOR_PRIMARIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColorPrimaries() { + return colorPrimaries; + } + + @JsonProperty(JSON_PROPERTY_COLOR_PRIMARIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColorPrimaries(@org.eclipse.jdt.annotation.NonNull String colorPrimaries) { + this.colorPrimaries = colorPrimaries; + } + + public MediaStream dvVersionMajor(@org.eclipse.jdt.annotation.NonNull Integer dvVersionMajor) { + this.dvVersionMajor = dvVersionMajor; + return this; + } + + /** + * Gets or sets the Dolby Vision version major. + * + * @return dvVersionMajor + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DV_VERSION_MAJOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDvVersionMajor() { + return dvVersionMajor; + } + + @JsonProperty(JSON_PROPERTY_DV_VERSION_MAJOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDvVersionMajor(@org.eclipse.jdt.annotation.NonNull Integer dvVersionMajor) { + this.dvVersionMajor = dvVersionMajor; + } + + public MediaStream dvVersionMinor(@org.eclipse.jdt.annotation.NonNull Integer dvVersionMinor) { + this.dvVersionMinor = dvVersionMinor; + return this; + } + + /** + * Gets or sets the Dolby Vision version minor. + * + * @return dvVersionMinor + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DV_VERSION_MINOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDvVersionMinor() { + return dvVersionMinor; + } + + @JsonProperty(JSON_PROPERTY_DV_VERSION_MINOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDvVersionMinor(@org.eclipse.jdt.annotation.NonNull Integer dvVersionMinor) { + this.dvVersionMinor = dvVersionMinor; + } + + public MediaStream dvProfile(@org.eclipse.jdt.annotation.NonNull Integer dvProfile) { + this.dvProfile = dvProfile; + return this; + } + + /** + * Gets or sets the Dolby Vision profile. + * + * @return dvProfile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DV_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDvProfile() { + return dvProfile; + } + + @JsonProperty(JSON_PROPERTY_DV_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDvProfile(@org.eclipse.jdt.annotation.NonNull Integer dvProfile) { + this.dvProfile = dvProfile; + } + + public MediaStream dvLevel(@org.eclipse.jdt.annotation.NonNull Integer dvLevel) { + this.dvLevel = dvLevel; + return this; + } + + /** + * Gets or sets the Dolby Vision level. + * + * @return dvLevel + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DV_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDvLevel() { + return dvLevel; + } + + @JsonProperty(JSON_PROPERTY_DV_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDvLevel(@org.eclipse.jdt.annotation.NonNull Integer dvLevel) { + this.dvLevel = dvLevel; + } + + public MediaStream rpuPresentFlag(@org.eclipse.jdt.annotation.NonNull Integer rpuPresentFlag) { + this.rpuPresentFlag = rpuPresentFlag; + return this; + } + + /** + * Gets or sets the Dolby Vision rpu present flag. + * + * @return rpuPresentFlag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RPU_PRESENT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRpuPresentFlag() { + return rpuPresentFlag; + } + + @JsonProperty(JSON_PROPERTY_RPU_PRESENT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRpuPresentFlag(@org.eclipse.jdt.annotation.NonNull Integer rpuPresentFlag) { + this.rpuPresentFlag = rpuPresentFlag; + } + + public MediaStream elPresentFlag(@org.eclipse.jdt.annotation.NonNull Integer elPresentFlag) { + this.elPresentFlag = elPresentFlag; + return this; + } + + /** + * Gets or sets the Dolby Vision el present flag. + * + * @return elPresentFlag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EL_PRESENT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getElPresentFlag() { + return elPresentFlag; + } + + @JsonProperty(JSON_PROPERTY_EL_PRESENT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setElPresentFlag(@org.eclipse.jdt.annotation.NonNull Integer elPresentFlag) { + this.elPresentFlag = elPresentFlag; + } + + public MediaStream blPresentFlag(@org.eclipse.jdt.annotation.NonNull Integer blPresentFlag) { + this.blPresentFlag = blPresentFlag; + return this; + } + + /** + * Gets or sets the Dolby Vision bl present flag. + * + * @return blPresentFlag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BL_PRESENT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBlPresentFlag() { + return blPresentFlag; + } + + @JsonProperty(JSON_PROPERTY_BL_PRESENT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlPresentFlag(@org.eclipse.jdt.annotation.NonNull Integer blPresentFlag) { + this.blPresentFlag = blPresentFlag; + } + + public MediaStream dvBlSignalCompatibilityId( + @org.eclipse.jdt.annotation.NonNull Integer dvBlSignalCompatibilityId) { + this.dvBlSignalCompatibilityId = dvBlSignalCompatibilityId; + return this; + } + + /** + * Gets or sets the Dolby Vision bl signal compatibility id. + * + * @return dvBlSignalCompatibilityId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DV_BL_SIGNAL_COMPATIBILITY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDvBlSignalCompatibilityId() { + return dvBlSignalCompatibilityId; + } + + @JsonProperty(JSON_PROPERTY_DV_BL_SIGNAL_COMPATIBILITY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDvBlSignalCompatibilityId(@org.eclipse.jdt.annotation.NonNull Integer dvBlSignalCompatibilityId) { + this.dvBlSignalCompatibilityId = dvBlSignalCompatibilityId; + } + + public MediaStream rotation(@org.eclipse.jdt.annotation.NonNull Integer rotation) { + this.rotation = rotation; + return this; + } + + /** + * Gets or sets the Rotation in degrees. + * + * @return rotation + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ROTATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRotation() { + return rotation; + } + + @JsonProperty(JSON_PROPERTY_ROTATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRotation(@org.eclipse.jdt.annotation.NonNull Integer rotation) { + this.rotation = rotation; + } + + public MediaStream comment(@org.eclipse.jdt.annotation.NonNull String comment) { + this.comment = comment; + return this; + } + + /** + * Gets or sets the comment. + * + * @return comment + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getComment() { + return comment; + } + + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComment(@org.eclipse.jdt.annotation.NonNull String comment) { + this.comment = comment; + } + + public MediaStream timeBase(@org.eclipse.jdt.annotation.NonNull String timeBase) { + this.timeBase = timeBase; + return this; + } + + /** + * Gets or sets the time base. + * + * @return timeBase + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TIME_BASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTimeBase() { + return timeBase; + } + + @JsonProperty(JSON_PROPERTY_TIME_BASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimeBase(@org.eclipse.jdt.annotation.NonNull String timeBase) { + this.timeBase = timeBase; + } + + public MediaStream codecTimeBase(@org.eclipse.jdt.annotation.NonNull String codecTimeBase) { + this.codecTimeBase = codecTimeBase; + return this; + } + + /** + * Gets or sets the codec time base. + * + * @return codecTimeBase + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODEC_TIME_BASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCodecTimeBase() { + return codecTimeBase; + } + + @JsonProperty(JSON_PROPERTY_CODEC_TIME_BASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCodecTimeBase(@org.eclipse.jdt.annotation.NonNull String codecTimeBase) { + this.codecTimeBase = codecTimeBase; + } + + public MediaStream title(@org.eclipse.jdt.annotation.NonNull String title) { + this.title = title; + return this; + } + + /** + * Gets or sets the title. + * + * @return title + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@org.eclipse.jdt.annotation.NonNull String title) { + this.title = title; + } + + /** + * Gets the video range. + * + * @return videoRange + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public VideoRange getVideoRange() { + return videoRange; + } + + /** + * Gets the video range type. + * + * @return videoRangeType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_RANGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public VideoRangeType getVideoRangeType() { + return videoRangeType; + } + + /** + * Gets the video dovi title. + * + * @return videoDoViTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_DO_VI_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVideoDoViTitle() { + return videoDoViTitle; + } + + /** + * Gets the audio spatial format. + * + * @return audioSpatialFormat + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_SPATIAL_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AudioSpatialFormat getAudioSpatialFormat() { + return audioSpatialFormat; + } + + public MediaStream localizedUndefined(@org.eclipse.jdt.annotation.NonNull String localizedUndefined) { + this.localizedUndefined = localizedUndefined; + return this; + } + + /** + * Get localizedUndefined + * + * @return localizedUndefined + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCALIZED_UNDEFINED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocalizedUndefined() { + return localizedUndefined; + } + + @JsonProperty(JSON_PROPERTY_LOCALIZED_UNDEFINED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalizedUndefined(@org.eclipse.jdt.annotation.NonNull String localizedUndefined) { + this.localizedUndefined = localizedUndefined; + } + + public MediaStream localizedDefault(@org.eclipse.jdt.annotation.NonNull String localizedDefault) { + this.localizedDefault = localizedDefault; + return this; + } + + /** + * Get localizedDefault + * + * @return localizedDefault + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCALIZED_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocalizedDefault() { + return localizedDefault; + } + + @JsonProperty(JSON_PROPERTY_LOCALIZED_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalizedDefault(@org.eclipse.jdt.annotation.NonNull String localizedDefault) { + this.localizedDefault = localizedDefault; + } + + public MediaStream localizedForced(@org.eclipse.jdt.annotation.NonNull String localizedForced) { + this.localizedForced = localizedForced; + return this; + } + + /** + * Get localizedForced + * + * @return localizedForced + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCALIZED_FORCED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocalizedForced() { + return localizedForced; + } + + @JsonProperty(JSON_PROPERTY_LOCALIZED_FORCED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalizedForced(@org.eclipse.jdt.annotation.NonNull String localizedForced) { + this.localizedForced = localizedForced; + } + + public MediaStream localizedExternal(@org.eclipse.jdt.annotation.NonNull String localizedExternal) { + this.localizedExternal = localizedExternal; + return this; + } + + /** + * Get localizedExternal + * + * @return localizedExternal + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCALIZED_EXTERNAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocalizedExternal() { + return localizedExternal; + } + + @JsonProperty(JSON_PROPERTY_LOCALIZED_EXTERNAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalizedExternal(@org.eclipse.jdt.annotation.NonNull String localizedExternal) { + this.localizedExternal = localizedExternal; + } + + public MediaStream localizedHearingImpaired(@org.eclipse.jdt.annotation.NonNull String localizedHearingImpaired) { + this.localizedHearingImpaired = localizedHearingImpaired; + return this; + } + + /** + * Get localizedHearingImpaired + * + * @return localizedHearingImpaired + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCALIZED_HEARING_IMPAIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocalizedHearingImpaired() { + return localizedHearingImpaired; + } + + @JsonProperty(JSON_PROPERTY_LOCALIZED_HEARING_IMPAIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalizedHearingImpaired(@org.eclipse.jdt.annotation.NonNull String localizedHearingImpaired) { + this.localizedHearingImpaired = localizedHearingImpaired; + } + + /** + * Get displayTitle + * + * @return displayTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayTitle() { + return displayTitle; + } + + public MediaStream nalLengthSize(@org.eclipse.jdt.annotation.NonNull String nalLengthSize) { + this.nalLengthSize = nalLengthSize; + return this; + } + + /** + * Get nalLengthSize + * + * @return nalLengthSize + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAL_LENGTH_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNalLengthSize() { + return nalLengthSize; + } + + @JsonProperty(JSON_PROPERTY_NAL_LENGTH_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNalLengthSize(@org.eclipse.jdt.annotation.NonNull String nalLengthSize) { + this.nalLengthSize = nalLengthSize; + } + + public MediaStream isInterlaced(@org.eclipse.jdt.annotation.NonNull Boolean isInterlaced) { + this.isInterlaced = isInterlaced; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is interlaced. + * + * @return isInterlaced + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_INTERLACED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsInterlaced() { + return isInterlaced; + } + + @JsonProperty(JSON_PROPERTY_IS_INTERLACED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsInterlaced(@org.eclipse.jdt.annotation.NonNull Boolean isInterlaced) { + this.isInterlaced = isInterlaced; + } + + public MediaStream isAVC(@org.eclipse.jdt.annotation.NonNull Boolean isAVC) { + this.isAVC = isAVC; + return this; + } + + /** + * Get isAVC + * + * @return isAVC + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_A_V_C) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAVC() { + return isAVC; + } + + @JsonProperty(JSON_PROPERTY_IS_A_V_C) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAVC(@org.eclipse.jdt.annotation.NonNull Boolean isAVC) { + this.isAVC = isAVC; + } + + public MediaStream channelLayout(@org.eclipse.jdt.annotation.NonNull String channelLayout) { + this.channelLayout = channelLayout; + return this; + } + + /** + * Gets or sets the channel layout. + * + * @return channelLayout + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_LAYOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelLayout() { + return channelLayout; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_LAYOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelLayout(@org.eclipse.jdt.annotation.NonNull String channelLayout) { + this.channelLayout = channelLayout; + } + + public MediaStream bitRate(@org.eclipse.jdt.annotation.NonNull Integer bitRate) { + this.bitRate = bitRate; + return this; + } + + /** + * Gets or sets the bit rate. + * + * @return bitRate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BIT_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBitRate() { + return bitRate; + } + + @JsonProperty(JSON_PROPERTY_BIT_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBitRate(@org.eclipse.jdt.annotation.NonNull Integer bitRate) { + this.bitRate = bitRate; + } + + public MediaStream bitDepth(@org.eclipse.jdt.annotation.NonNull Integer bitDepth) { + this.bitDepth = bitDepth; + return this; + } + + /** + * Gets or sets the bit depth. + * + * @return bitDepth + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BIT_DEPTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBitDepth() { + return bitDepth; + } + + @JsonProperty(JSON_PROPERTY_BIT_DEPTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBitDepth(@org.eclipse.jdt.annotation.NonNull Integer bitDepth) { + this.bitDepth = bitDepth; + } + + public MediaStream refFrames(@org.eclipse.jdt.annotation.NonNull Integer refFrames) { + this.refFrames = refFrames; + return this; + } + + /** + * Gets or sets the reference frames. + * + * @return refFrames + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REF_FRAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRefFrames() { + return refFrames; + } + + @JsonProperty(JSON_PROPERTY_REF_FRAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRefFrames(@org.eclipse.jdt.annotation.NonNull Integer refFrames) { + this.refFrames = refFrames; + } + + public MediaStream packetLength(@org.eclipse.jdt.annotation.NonNull Integer packetLength) { + this.packetLength = packetLength; + return this; + } + + /** + * Gets or sets the length of the packet. + * + * @return packetLength + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PACKET_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPacketLength() { + return packetLength; + } + + @JsonProperty(JSON_PROPERTY_PACKET_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPacketLength(@org.eclipse.jdt.annotation.NonNull Integer packetLength) { + this.packetLength = packetLength; + } + + public MediaStream channels(@org.eclipse.jdt.annotation.NonNull Integer channels) { + this.channels = channels; + return this; + } + + /** + * Gets or sets the channels. + * + * @return channels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getChannels() { + return channels; + } + + @JsonProperty(JSON_PROPERTY_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannels(@org.eclipse.jdt.annotation.NonNull Integer channels) { + this.channels = channels; + } + + public MediaStream sampleRate(@org.eclipse.jdt.annotation.NonNull Integer sampleRate) { + this.sampleRate = sampleRate; + return this; + } + + /** + * Gets or sets the sample rate. + * + * @return sampleRate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SAMPLE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSampleRate() { + return sampleRate; + } + + @JsonProperty(JSON_PROPERTY_SAMPLE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSampleRate(@org.eclipse.jdt.annotation.NonNull Integer sampleRate) { + this.sampleRate = sampleRate; + } + + public MediaStream isDefault(@org.eclipse.jdt.annotation.NonNull Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is default. + * + * @return isDefault + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsDefault() { + return isDefault; + } + + @JsonProperty(JSON_PROPERTY_IS_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDefault(@org.eclipse.jdt.annotation.NonNull Boolean isDefault) { + this.isDefault = isDefault; + } + + public MediaStream isForced(@org.eclipse.jdt.annotation.NonNull Boolean isForced) { + this.isForced = isForced; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is forced. + * + * @return isForced + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_FORCED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsForced() { + return isForced; + } + + @JsonProperty(JSON_PROPERTY_IS_FORCED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsForced(@org.eclipse.jdt.annotation.NonNull Boolean isForced) { + this.isForced = isForced; + } + + public MediaStream isHearingImpaired(@org.eclipse.jdt.annotation.NonNull Boolean isHearingImpaired) { + this.isHearingImpaired = isHearingImpaired; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is for the hearing impaired. + * + * @return isHearingImpaired + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_HEARING_IMPAIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsHearingImpaired() { + return isHearingImpaired; + } + + @JsonProperty(JSON_PROPERTY_IS_HEARING_IMPAIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsHearingImpaired(@org.eclipse.jdt.annotation.NonNull Boolean isHearingImpaired) { + this.isHearingImpaired = isHearingImpaired; + } + + public MediaStream height(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + return this; + } + + /** + * Gets or sets the height. + * + * @return height + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHeight() { + return height; + } + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + } + + public MediaStream width(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + return this; + } + + /** + * Gets or sets the width. + * + * @return width + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + } + + public MediaStream averageFrameRate(@org.eclipse.jdt.annotation.NonNull Float averageFrameRate) { + this.averageFrameRate = averageFrameRate; + return this; + } + + /** + * Gets or sets the average frame rate. + * + * @return averageFrameRate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AVERAGE_FRAME_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getAverageFrameRate() { + return averageFrameRate; + } + + @JsonProperty(JSON_PROPERTY_AVERAGE_FRAME_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAverageFrameRate(@org.eclipse.jdt.annotation.NonNull Float averageFrameRate) { + this.averageFrameRate = averageFrameRate; + } + + public MediaStream realFrameRate(@org.eclipse.jdt.annotation.NonNull Float realFrameRate) { + this.realFrameRate = realFrameRate; + return this; + } + + /** + * Gets or sets the real frame rate. + * + * @return realFrameRate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REAL_FRAME_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getRealFrameRate() { + return realFrameRate; + } + + @JsonProperty(JSON_PROPERTY_REAL_FRAME_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRealFrameRate(@org.eclipse.jdt.annotation.NonNull Float realFrameRate) { + this.realFrameRate = realFrameRate; + } + + /** + * Gets the framerate used as reference. Prefer AverageFrameRate, if that is null or an unrealistic value then + * fallback to RealFrameRate. + * + * @return referenceFrameRate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REFERENCE_FRAME_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getReferenceFrameRate() { + return referenceFrameRate; + } + + public MediaStream profile(@org.eclipse.jdt.annotation.NonNull String profile) { + this.profile = profile; + return this; + } + + /** + * Gets or sets the profile. + * + * @return profile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProfile() { + return profile; + } + + @JsonProperty(JSON_PROPERTY_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProfile(@org.eclipse.jdt.annotation.NonNull String profile) { + this.profile = profile; + } + + public MediaStream type(@org.eclipse.jdt.annotation.NonNull MediaStreamType type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaStreamType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull MediaStreamType type) { + this.type = type; + } + + public MediaStream aspectRatio(@org.eclipse.jdt.annotation.NonNull String aspectRatio) { + this.aspectRatio = aspectRatio; + return this; + } + + /** + * Gets or sets the aspect ratio. + * + * @return aspectRatio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAspectRatio() { + return aspectRatio; + } + + @JsonProperty(JSON_PROPERTY_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAspectRatio(@org.eclipse.jdt.annotation.NonNull String aspectRatio) { + this.aspectRatio = aspectRatio; + } + + public MediaStream index(@org.eclipse.jdt.annotation.NonNull Integer index) { + this.index = index; + return this; + } + + /** + * Gets or sets the index. + * + * @return index + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndex() { + return index; + } + + @JsonProperty(JSON_PROPERTY_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndex(@org.eclipse.jdt.annotation.NonNull Integer index) { + this.index = index; + } + + public MediaStream score(@org.eclipse.jdt.annotation.NonNull Integer score) { + this.score = score; + return this; + } + + /** + * Gets or sets the score. + * + * @return score + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SCORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getScore() { + return score; + } + + @JsonProperty(JSON_PROPERTY_SCORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScore(@org.eclipse.jdt.annotation.NonNull Integer score) { + this.score = score; + } + + public MediaStream isExternal(@org.eclipse.jdt.annotation.NonNull Boolean isExternal) { + this.isExternal = isExternal; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is external. + * + * @return isExternal + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_EXTERNAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsExternal() { + return isExternal; + } + + @JsonProperty(JSON_PROPERTY_IS_EXTERNAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsExternal(@org.eclipse.jdt.annotation.NonNull Boolean isExternal) { + this.isExternal = isExternal; + } + + public MediaStream deliveryMethod(@org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod deliveryMethod) { + this.deliveryMethod = deliveryMethod; + return this; + } + + /** + * Gets or sets the method. + * + * @return deliveryMethod + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DELIVERY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubtitleDeliveryMethod getDeliveryMethod() { + return deliveryMethod; + } + + @JsonProperty(JSON_PROPERTY_DELIVERY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeliveryMethod(@org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod deliveryMethod) { + this.deliveryMethod = deliveryMethod; + } + + public MediaStream deliveryUrl(@org.eclipse.jdt.annotation.NonNull String deliveryUrl) { + this.deliveryUrl = deliveryUrl; + return this; + } + + /** + * Gets or sets the delivery URL. + * + * @return deliveryUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DELIVERY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeliveryUrl() { + return deliveryUrl; + } + + @JsonProperty(JSON_PROPERTY_DELIVERY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeliveryUrl(@org.eclipse.jdt.annotation.NonNull String deliveryUrl) { + this.deliveryUrl = deliveryUrl; + } + + public MediaStream isExternalUrl(@org.eclipse.jdt.annotation.NonNull Boolean isExternalUrl) { + this.isExternalUrl = isExternalUrl; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is external URL. + * + * @return isExternalUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_EXTERNAL_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsExternalUrl() { + return isExternalUrl; + } + + @JsonProperty(JSON_PROPERTY_IS_EXTERNAL_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsExternalUrl(@org.eclipse.jdt.annotation.NonNull Boolean isExternalUrl) { + this.isExternalUrl = isExternalUrl; + } + + /** + * Get isTextSubtitleStream + * + * @return isTextSubtitleStream + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_TEXT_SUBTITLE_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsTextSubtitleStream() { + return isTextSubtitleStream; + } + + public MediaStream supportsExternalStream(@org.eclipse.jdt.annotation.NonNull Boolean supportsExternalStream) { + this.supportsExternalStream = supportsExternalStream; + return this; + } + + /** + * Gets or sets a value indicating whether [supports external stream]. + * + * @return supportsExternalStream + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_EXTERNAL_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsExternalStream() { + return supportsExternalStream; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_EXTERNAL_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsExternalStream(@org.eclipse.jdt.annotation.NonNull Boolean supportsExternalStream) { + this.supportsExternalStream = supportsExternalStream; + } + + public MediaStream path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the filename. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public MediaStream pixelFormat(@org.eclipse.jdt.annotation.NonNull String pixelFormat) { + this.pixelFormat = pixelFormat; + return this; + } + + /** + * Gets or sets the pixel format. + * + * @return pixelFormat + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PIXEL_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPixelFormat() { + return pixelFormat; + } + + @JsonProperty(JSON_PROPERTY_PIXEL_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPixelFormat(@org.eclipse.jdt.annotation.NonNull String pixelFormat) { + this.pixelFormat = pixelFormat; + } + + public MediaStream level(@org.eclipse.jdt.annotation.NonNull Double level) { + this.level = level; + return this; + } + + /** + * Gets or sets the level. + * + * @return level + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getLevel() { + return level; + } + + @JsonProperty(JSON_PROPERTY_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLevel(@org.eclipse.jdt.annotation.NonNull Double level) { + this.level = level; + } + + public MediaStream isAnamorphic(@org.eclipse.jdt.annotation.NonNull Boolean isAnamorphic) { + this.isAnamorphic = isAnamorphic; + return this; + } + + /** + * Gets or sets whether this instance is anamorphic. + * + * @return isAnamorphic + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_ANAMORPHIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAnamorphic() { + return isAnamorphic; + } + + @JsonProperty(JSON_PROPERTY_IS_ANAMORPHIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAnamorphic(@org.eclipse.jdt.annotation.NonNull Boolean isAnamorphic) { + this.isAnamorphic = isAnamorphic; + } + + /** + * Return true if this MediaStream object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaStream mediaStream = (MediaStream) o; + return Objects.equals(this.codec, mediaStream.codec) && Objects.equals(this.codecTag, mediaStream.codecTag) + && Objects.equals(this.language, mediaStream.language) + && Objects.equals(this.colorRange, mediaStream.colorRange) + && Objects.equals(this.colorSpace, mediaStream.colorSpace) + && Objects.equals(this.colorTransfer, mediaStream.colorTransfer) + && Objects.equals(this.colorPrimaries, mediaStream.colorPrimaries) + && Objects.equals(this.dvVersionMajor, mediaStream.dvVersionMajor) + && Objects.equals(this.dvVersionMinor, mediaStream.dvVersionMinor) + && Objects.equals(this.dvProfile, mediaStream.dvProfile) + && Objects.equals(this.dvLevel, mediaStream.dvLevel) + && Objects.equals(this.rpuPresentFlag, mediaStream.rpuPresentFlag) + && Objects.equals(this.elPresentFlag, mediaStream.elPresentFlag) + && Objects.equals(this.blPresentFlag, mediaStream.blPresentFlag) + && Objects.equals(this.dvBlSignalCompatibilityId, mediaStream.dvBlSignalCompatibilityId) + && Objects.equals(this.rotation, mediaStream.rotation) + && Objects.equals(this.comment, mediaStream.comment) + && Objects.equals(this.timeBase, mediaStream.timeBase) + && Objects.equals(this.codecTimeBase, mediaStream.codecTimeBase) + && Objects.equals(this.title, mediaStream.title) + && Objects.equals(this.videoRange, mediaStream.videoRange) + && Objects.equals(this.videoRangeType, mediaStream.videoRangeType) + && Objects.equals(this.videoDoViTitle, mediaStream.videoDoViTitle) + && Objects.equals(this.audioSpatialFormat, mediaStream.audioSpatialFormat) + && Objects.equals(this.localizedUndefined, mediaStream.localizedUndefined) + && Objects.equals(this.localizedDefault, mediaStream.localizedDefault) + && Objects.equals(this.localizedForced, mediaStream.localizedForced) + && Objects.equals(this.localizedExternal, mediaStream.localizedExternal) + && Objects.equals(this.localizedHearingImpaired, mediaStream.localizedHearingImpaired) + && Objects.equals(this.displayTitle, mediaStream.displayTitle) + && Objects.equals(this.nalLengthSize, mediaStream.nalLengthSize) + && Objects.equals(this.isInterlaced, mediaStream.isInterlaced) + && Objects.equals(this.isAVC, mediaStream.isAVC) + && Objects.equals(this.channelLayout, mediaStream.channelLayout) + && Objects.equals(this.bitRate, mediaStream.bitRate) + && Objects.equals(this.bitDepth, mediaStream.bitDepth) + && Objects.equals(this.refFrames, mediaStream.refFrames) + && Objects.equals(this.packetLength, mediaStream.packetLength) + && Objects.equals(this.channels, mediaStream.channels) + && Objects.equals(this.sampleRate, mediaStream.sampleRate) + && Objects.equals(this.isDefault, mediaStream.isDefault) + && Objects.equals(this.isForced, mediaStream.isForced) + && Objects.equals(this.isHearingImpaired, mediaStream.isHearingImpaired) + && Objects.equals(this.height, mediaStream.height) && Objects.equals(this.width, mediaStream.width) + && Objects.equals(this.averageFrameRate, mediaStream.averageFrameRate) + && Objects.equals(this.realFrameRate, mediaStream.realFrameRate) + && Objects.equals(this.referenceFrameRate, mediaStream.referenceFrameRate) + && Objects.equals(this.profile, mediaStream.profile) && Objects.equals(this.type, mediaStream.type) + && Objects.equals(this.aspectRatio, mediaStream.aspectRatio) + && Objects.equals(this.index, mediaStream.index) && Objects.equals(this.score, mediaStream.score) + && Objects.equals(this.isExternal, mediaStream.isExternal) + && Objects.equals(this.deliveryMethod, mediaStream.deliveryMethod) + && Objects.equals(this.deliveryUrl, mediaStream.deliveryUrl) + && Objects.equals(this.isExternalUrl, mediaStream.isExternalUrl) + && Objects.equals(this.isTextSubtitleStream, mediaStream.isTextSubtitleStream) + && Objects.equals(this.supportsExternalStream, mediaStream.supportsExternalStream) + && Objects.equals(this.path, mediaStream.path) + && Objects.equals(this.pixelFormat, mediaStream.pixelFormat) + && Objects.equals(this.level, mediaStream.level) + && Objects.equals(this.isAnamorphic, mediaStream.isAnamorphic); + } + + @Override + public int hashCode() { + return Objects.hash(codec, codecTag, language, colorRange, colorSpace, colorTransfer, colorPrimaries, + dvVersionMajor, dvVersionMinor, dvProfile, dvLevel, rpuPresentFlag, elPresentFlag, blPresentFlag, + dvBlSignalCompatibilityId, rotation, comment, timeBase, codecTimeBase, title, videoRange, + videoRangeType, videoDoViTitle, audioSpatialFormat, localizedUndefined, localizedDefault, + localizedForced, localizedExternal, localizedHearingImpaired, displayTitle, nalLengthSize, isInterlaced, + isAVC, channelLayout, bitRate, bitDepth, refFrames, packetLength, channels, sampleRate, isDefault, + isForced, isHearingImpaired, height, width, averageFrameRate, realFrameRate, referenceFrameRate, + profile, type, aspectRatio, index, score, isExternal, deliveryMethod, deliveryUrl, isExternalUrl, + isTextSubtitleStream, supportsExternalStream, path, pixelFormat, level, isAnamorphic); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaStream {\n"); + sb.append(" codec: ").append(toIndentedString(codec)).append("\n"); + sb.append(" codecTag: ").append(toIndentedString(codecTag)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" colorRange: ").append(toIndentedString(colorRange)).append("\n"); + sb.append(" colorSpace: ").append(toIndentedString(colorSpace)).append("\n"); + sb.append(" colorTransfer: ").append(toIndentedString(colorTransfer)).append("\n"); + sb.append(" colorPrimaries: ").append(toIndentedString(colorPrimaries)).append("\n"); + sb.append(" dvVersionMajor: ").append(toIndentedString(dvVersionMajor)).append("\n"); + sb.append(" dvVersionMinor: ").append(toIndentedString(dvVersionMinor)).append("\n"); + sb.append(" dvProfile: ").append(toIndentedString(dvProfile)).append("\n"); + sb.append(" dvLevel: ").append(toIndentedString(dvLevel)).append("\n"); + sb.append(" rpuPresentFlag: ").append(toIndentedString(rpuPresentFlag)).append("\n"); + sb.append(" elPresentFlag: ").append(toIndentedString(elPresentFlag)).append("\n"); + sb.append(" blPresentFlag: ").append(toIndentedString(blPresentFlag)).append("\n"); + sb.append(" dvBlSignalCompatibilityId: ").append(toIndentedString(dvBlSignalCompatibilityId)).append("\n"); + sb.append(" rotation: ").append(toIndentedString(rotation)).append("\n"); + sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); + sb.append(" timeBase: ").append(toIndentedString(timeBase)).append("\n"); + sb.append(" codecTimeBase: ").append(toIndentedString(codecTimeBase)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" videoRange: ").append(toIndentedString(videoRange)).append("\n"); + sb.append(" videoRangeType: ").append(toIndentedString(videoRangeType)).append("\n"); + sb.append(" videoDoViTitle: ").append(toIndentedString(videoDoViTitle)).append("\n"); + sb.append(" audioSpatialFormat: ").append(toIndentedString(audioSpatialFormat)).append("\n"); + sb.append(" localizedUndefined: ").append(toIndentedString(localizedUndefined)).append("\n"); + sb.append(" localizedDefault: ").append(toIndentedString(localizedDefault)).append("\n"); + sb.append(" localizedForced: ").append(toIndentedString(localizedForced)).append("\n"); + sb.append(" localizedExternal: ").append(toIndentedString(localizedExternal)).append("\n"); + sb.append(" localizedHearingImpaired: ").append(toIndentedString(localizedHearingImpaired)).append("\n"); + sb.append(" displayTitle: ").append(toIndentedString(displayTitle)).append("\n"); + sb.append(" nalLengthSize: ").append(toIndentedString(nalLengthSize)).append("\n"); + sb.append(" isInterlaced: ").append(toIndentedString(isInterlaced)).append("\n"); + sb.append(" isAVC: ").append(toIndentedString(isAVC)).append("\n"); + sb.append(" channelLayout: ").append(toIndentedString(channelLayout)).append("\n"); + sb.append(" bitRate: ").append(toIndentedString(bitRate)).append("\n"); + sb.append(" bitDepth: ").append(toIndentedString(bitDepth)).append("\n"); + sb.append(" refFrames: ").append(toIndentedString(refFrames)).append("\n"); + sb.append(" packetLength: ").append(toIndentedString(packetLength)).append("\n"); + sb.append(" channels: ").append(toIndentedString(channels)).append("\n"); + sb.append(" sampleRate: ").append(toIndentedString(sampleRate)).append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" isForced: ").append(toIndentedString(isForced)).append("\n"); + sb.append(" isHearingImpaired: ").append(toIndentedString(isHearingImpaired)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" averageFrameRate: ").append(toIndentedString(averageFrameRate)).append("\n"); + sb.append(" realFrameRate: ").append(toIndentedString(realFrameRate)).append("\n"); + sb.append(" referenceFrameRate: ").append(toIndentedString(referenceFrameRate)).append("\n"); + sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" aspectRatio: ").append(toIndentedString(aspectRatio)).append("\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).append("\n"); + sb.append(" isExternal: ").append(toIndentedString(isExternal)).append("\n"); + sb.append(" deliveryMethod: ").append(toIndentedString(deliveryMethod)).append("\n"); + sb.append(" deliveryUrl: ").append(toIndentedString(deliveryUrl)).append("\n"); + sb.append(" isExternalUrl: ").append(toIndentedString(isExternalUrl)).append("\n"); + sb.append(" isTextSubtitleStream: ").append(toIndentedString(isTextSubtitleStream)).append("\n"); + sb.append(" supportsExternalStream: ").append(toIndentedString(supportsExternalStream)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" pixelFormat: ").append(toIndentedString(pixelFormat)).append("\n"); + sb.append(" level: ").append(toIndentedString(level)).append("\n"); + sb.append(" isAnamorphic: ").append(toIndentedString(isAnamorphic)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Codec` to the URL query string + if (getCodec() != null) { + joiner.add(String.format("%sCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCodec())))); + } + + // add `CodecTag` to the URL query string + if (getCodecTag() != null) { + joiner.add(String.format("%sCodecTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCodecTag())))); + } + + // add `Language` to the URL query string + if (getLanguage() != null) { + joiner.add(String.format("%sLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLanguage())))); + } + + // add `ColorRange` to the URL query string + if (getColorRange() != null) { + joiner.add(String.format("%sColorRange%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getColorRange())))); + } + + // add `ColorSpace` to the URL query string + if (getColorSpace() != null) { + joiner.add(String.format("%sColorSpace%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getColorSpace())))); + } + + // add `ColorTransfer` to the URL query string + if (getColorTransfer() != null) { + joiner.add(String.format("%sColorTransfer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getColorTransfer())))); + } + + // add `ColorPrimaries` to the URL query string + if (getColorPrimaries() != null) { + joiner.add(String.format("%sColorPrimaries%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getColorPrimaries())))); + } + + // add `DvVersionMajor` to the URL query string + if (getDvVersionMajor() != null) { + joiner.add(String.format("%sDvVersionMajor%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDvVersionMajor())))); + } + + // add `DvVersionMinor` to the URL query string + if (getDvVersionMinor() != null) { + joiner.add(String.format("%sDvVersionMinor%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDvVersionMinor())))); + } + + // add `DvProfile` to the URL query string + if (getDvProfile() != null) { + joiner.add(String.format("%sDvProfile%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDvProfile())))); + } + + // add `DvLevel` to the URL query string + if (getDvLevel() != null) { + joiner.add(String.format("%sDvLevel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDvLevel())))); + } + + // add `RpuPresentFlag` to the URL query string + if (getRpuPresentFlag() != null) { + joiner.add(String.format("%sRpuPresentFlag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRpuPresentFlag())))); + } + + // add `ElPresentFlag` to the URL query string + if (getElPresentFlag() != null) { + joiner.add(String.format("%sElPresentFlag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getElPresentFlag())))); + } + + // add `BlPresentFlag` to the URL query string + if (getBlPresentFlag() != null) { + joiner.add(String.format("%sBlPresentFlag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBlPresentFlag())))); + } + + // add `DvBlSignalCompatibilityId` to the URL query string + if (getDvBlSignalCompatibilityId() != null) { + joiner.add(String.format("%sDvBlSignalCompatibilityId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDvBlSignalCompatibilityId())))); + } + + // add `Rotation` to the URL query string + if (getRotation() != null) { + joiner.add(String.format("%sRotation%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRotation())))); + } + + // add `Comment` to the URL query string + if (getComment() != null) { + joiner.add(String.format("%sComment%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getComment())))); + } + + // add `TimeBase` to the URL query string + if (getTimeBase() != null) { + joiner.add(String.format("%sTimeBase%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTimeBase())))); + } + + // add `CodecTimeBase` to the URL query string + if (getCodecTimeBase() != null) { + joiner.add(String.format("%sCodecTimeBase%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCodecTimeBase())))); + } + + // add `Title` to the URL query string + if (getTitle() != null) { + joiner.add(String.format("%sTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTitle())))); + } + + // add `VideoRange` to the URL query string + if (getVideoRange() != null) { + joiner.add(String.format("%sVideoRange%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoRange())))); + } + + // add `VideoRangeType` to the URL query string + if (getVideoRangeType() != null) { + joiner.add(String.format("%sVideoRangeType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoRangeType())))); + } + + // add `VideoDoViTitle` to the URL query string + if (getVideoDoViTitle() != null) { + joiner.add(String.format("%sVideoDoViTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoDoViTitle())))); + } + + // add `AudioSpatialFormat` to the URL query string + if (getAudioSpatialFormat() != null) { + joiner.add(String.format("%sAudioSpatialFormat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioSpatialFormat())))); + } + + // add `LocalizedUndefined` to the URL query string + if (getLocalizedUndefined() != null) { + joiner.add(String.format("%sLocalizedUndefined%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocalizedUndefined())))); + } + + // add `LocalizedDefault` to the URL query string + if (getLocalizedDefault() != null) { + joiner.add(String.format("%sLocalizedDefault%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocalizedDefault())))); + } + + // add `LocalizedForced` to the URL query string + if (getLocalizedForced() != null) { + joiner.add(String.format("%sLocalizedForced%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocalizedForced())))); + } + + // add `LocalizedExternal` to the URL query string + if (getLocalizedExternal() != null) { + joiner.add(String.format("%sLocalizedExternal%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocalizedExternal())))); + } + + // add `LocalizedHearingImpaired` to the URL query string + if (getLocalizedHearingImpaired() != null) { + joiner.add(String.format("%sLocalizedHearingImpaired%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocalizedHearingImpaired())))); + } + + // add `DisplayTitle` to the URL query string + if (getDisplayTitle() != null) { + joiner.add(String.format("%sDisplayTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplayTitle())))); + } + + // add `NalLengthSize` to the URL query string + if (getNalLengthSize() != null) { + joiner.add(String.format("%sNalLengthSize%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getNalLengthSize())))); + } + + // add `IsInterlaced` to the URL query string + if (getIsInterlaced() != null) { + joiner.add(String.format("%sIsInterlaced%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsInterlaced())))); + } + + // add `IsAVC` to the URL query string + if (getIsAVC() != null) { + joiner.add(String.format("%sIsAVC%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAVC())))); + } + + // add `ChannelLayout` to the URL query string + if (getChannelLayout() != null) { + joiner.add(String.format("%sChannelLayout%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelLayout())))); + } + + // add `BitRate` to the URL query string + if (getBitRate() != null) { + joiner.add(String.format("%sBitRate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBitRate())))); + } + + // add `BitDepth` to the URL query string + if (getBitDepth() != null) { + joiner.add(String.format("%sBitDepth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBitDepth())))); + } + + // add `RefFrames` to the URL query string + if (getRefFrames() != null) { + joiner.add(String.format("%sRefFrames%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRefFrames())))); + } + + // add `PacketLength` to the URL query string + if (getPacketLength() != null) { + joiner.add(String.format("%sPacketLength%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPacketLength())))); + } + + // add `Channels` to the URL query string + if (getChannels() != null) { + joiner.add(String.format("%sChannels%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannels())))); + } + + // add `SampleRate` to the URL query string + if (getSampleRate() != null) { + joiner.add(String.format("%sSampleRate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSampleRate())))); + } + + // add `IsDefault` to the URL query string + if (getIsDefault() != null) { + joiner.add(String.format("%sIsDefault%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsDefault())))); + } + + // add `IsForced` to the URL query string + if (getIsForced() != null) { + joiner.add(String.format("%sIsForced%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsForced())))); + } + + // add `IsHearingImpaired` to the URL query string + if (getIsHearingImpaired() != null) { + joiner.add(String.format("%sIsHearingImpaired%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsHearingImpaired())))); + } + + // add `Height` to the URL query string + if (getHeight() != null) { + joiner.add(String.format("%sHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHeight())))); + } + + // add `Width` to the URL query string + if (getWidth() != null) { + joiner.add(String.format("%sWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWidth())))); + } + + // add `AverageFrameRate` to the URL query string + if (getAverageFrameRate() != null) { + joiner.add(String.format("%sAverageFrameRate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAverageFrameRate())))); + } + + // add `RealFrameRate` to the URL query string + if (getRealFrameRate() != null) { + joiner.add(String.format("%sRealFrameRate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRealFrameRate())))); + } + + // add `ReferenceFrameRate` to the URL query string + if (getReferenceFrameRate() != null) { + joiner.add(String.format("%sReferenceFrameRate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getReferenceFrameRate())))); + } + + // add `Profile` to the URL query string + if (getProfile() != null) { + joiner.add(String.format("%sProfile%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProfile())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `AspectRatio` to the URL query string + if (getAspectRatio() != null) { + joiner.add(String.format("%sAspectRatio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAspectRatio())))); + } + + // add `Index` to the URL query string + if (getIndex() != null) { + joiner.add(String.format("%sIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndex())))); + } + + // add `Score` to the URL query string + if (getScore() != null) { + joiner.add(String.format("%sScore%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getScore())))); + } + + // add `IsExternal` to the URL query string + if (getIsExternal() != null) { + joiner.add(String.format("%sIsExternal%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsExternal())))); + } + + // add `DeliveryMethod` to the URL query string + if (getDeliveryMethod() != null) { + joiner.add(String.format("%sDeliveryMethod%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeliveryMethod())))); + } + + // add `DeliveryUrl` to the URL query string + if (getDeliveryUrl() != null) { + joiner.add(String.format("%sDeliveryUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeliveryUrl())))); + } + + // add `IsExternalUrl` to the URL query string + if (getIsExternalUrl() != null) { + joiner.add(String.format("%sIsExternalUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsExternalUrl())))); + } + + // add `IsTextSubtitleStream` to the URL query string + if (getIsTextSubtitleStream() != null) { + joiner.add(String.format("%sIsTextSubtitleStream%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsTextSubtitleStream())))); + } + + // add `SupportsExternalStream` to the URL query string + if (getSupportsExternalStream() != null) { + joiner.add(String.format("%sSupportsExternalStream%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsExternalStream())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `PixelFormat` to the URL query string + if (getPixelFormat() != null) { + joiner.add(String.format("%sPixelFormat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPixelFormat())))); + } + + // add `Level` to the URL query string + if (getLevel() != null) { + joiner.add(String.format("%sLevel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLevel())))); + } + + // add `IsAnamorphic` to the URL query string + if (getIsAnamorphic() != null) { + joiner.add(String.format("%sIsAnamorphic%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAnamorphic())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaStream instance; + + public Builder() { + this(new MediaStream()); + } + + protected Builder(MediaStream instance) { + this.instance = instance; + } + + public MediaStream.Builder codec(String codec) { + this.instance.codec = codec; + return this; + } + + public MediaStream.Builder codecTag(String codecTag) { + this.instance.codecTag = codecTag; + return this; + } + + public MediaStream.Builder language(String language) { + this.instance.language = language; + return this; + } + + public MediaStream.Builder colorRange(String colorRange) { + this.instance.colorRange = colorRange; + return this; + } + + public MediaStream.Builder colorSpace(String colorSpace) { + this.instance.colorSpace = colorSpace; + return this; + } + + public MediaStream.Builder colorTransfer(String colorTransfer) { + this.instance.colorTransfer = colorTransfer; + return this; + } + + public MediaStream.Builder colorPrimaries(String colorPrimaries) { + this.instance.colorPrimaries = colorPrimaries; + return this; + } + + public MediaStream.Builder dvVersionMajor(Integer dvVersionMajor) { + this.instance.dvVersionMajor = dvVersionMajor; + return this; + } + + public MediaStream.Builder dvVersionMinor(Integer dvVersionMinor) { + this.instance.dvVersionMinor = dvVersionMinor; + return this; + } + + public MediaStream.Builder dvProfile(Integer dvProfile) { + this.instance.dvProfile = dvProfile; + return this; + } + + public MediaStream.Builder dvLevel(Integer dvLevel) { + this.instance.dvLevel = dvLevel; + return this; + } + + public MediaStream.Builder rpuPresentFlag(Integer rpuPresentFlag) { + this.instance.rpuPresentFlag = rpuPresentFlag; + return this; + } + + public MediaStream.Builder elPresentFlag(Integer elPresentFlag) { + this.instance.elPresentFlag = elPresentFlag; + return this; + } + + public MediaStream.Builder blPresentFlag(Integer blPresentFlag) { + this.instance.blPresentFlag = blPresentFlag; + return this; + } + + public MediaStream.Builder dvBlSignalCompatibilityId(Integer dvBlSignalCompatibilityId) { + this.instance.dvBlSignalCompatibilityId = dvBlSignalCompatibilityId; + return this; + } + + public MediaStream.Builder rotation(Integer rotation) { + this.instance.rotation = rotation; + return this; + } + + public MediaStream.Builder comment(String comment) { + this.instance.comment = comment; + return this; + } + + public MediaStream.Builder timeBase(String timeBase) { + this.instance.timeBase = timeBase; + return this; + } + + public MediaStream.Builder codecTimeBase(String codecTimeBase) { + this.instance.codecTimeBase = codecTimeBase; + return this; + } + + public MediaStream.Builder title(String title) { + this.instance.title = title; + return this; + } + + public MediaStream.Builder videoRange(VideoRange videoRange) { + this.instance.videoRange = videoRange; + return this; + } + + public MediaStream.Builder videoRangeType(VideoRangeType videoRangeType) { + this.instance.videoRangeType = videoRangeType; + return this; + } + + public MediaStream.Builder videoDoViTitle(String videoDoViTitle) { + this.instance.videoDoViTitle = videoDoViTitle; + return this; + } + + public MediaStream.Builder audioSpatialFormat(AudioSpatialFormat audioSpatialFormat) { + this.instance.audioSpatialFormat = audioSpatialFormat; + return this; + } + + public MediaStream.Builder localizedUndefined(String localizedUndefined) { + this.instance.localizedUndefined = localizedUndefined; + return this; + } + + public MediaStream.Builder localizedDefault(String localizedDefault) { + this.instance.localizedDefault = localizedDefault; + return this; + } + + public MediaStream.Builder localizedForced(String localizedForced) { + this.instance.localizedForced = localizedForced; + return this; + } + + public MediaStream.Builder localizedExternal(String localizedExternal) { + this.instance.localizedExternal = localizedExternal; + return this; + } + + public MediaStream.Builder localizedHearingImpaired(String localizedHearingImpaired) { + this.instance.localizedHearingImpaired = localizedHearingImpaired; + return this; + } + + public MediaStream.Builder displayTitle(String displayTitle) { + this.instance.displayTitle = displayTitle; + return this; + } + + public MediaStream.Builder nalLengthSize(String nalLengthSize) { + this.instance.nalLengthSize = nalLengthSize; + return this; + } + + public MediaStream.Builder isInterlaced(Boolean isInterlaced) { + this.instance.isInterlaced = isInterlaced; + return this; + } + + public MediaStream.Builder isAVC(Boolean isAVC) { + this.instance.isAVC = isAVC; + return this; + } + + public MediaStream.Builder channelLayout(String channelLayout) { + this.instance.channelLayout = channelLayout; + return this; + } + + public MediaStream.Builder bitRate(Integer bitRate) { + this.instance.bitRate = bitRate; + return this; + } + + public MediaStream.Builder bitDepth(Integer bitDepth) { + this.instance.bitDepth = bitDepth; + return this; + } + + public MediaStream.Builder refFrames(Integer refFrames) { + this.instance.refFrames = refFrames; + return this; + } + + public MediaStream.Builder packetLength(Integer packetLength) { + this.instance.packetLength = packetLength; + return this; + } + + public MediaStream.Builder channels(Integer channels) { + this.instance.channels = channels; + return this; + } + + public MediaStream.Builder sampleRate(Integer sampleRate) { + this.instance.sampleRate = sampleRate; + return this; + } + + public MediaStream.Builder isDefault(Boolean isDefault) { + this.instance.isDefault = isDefault; + return this; + } + + public MediaStream.Builder isForced(Boolean isForced) { + this.instance.isForced = isForced; + return this; + } + + public MediaStream.Builder isHearingImpaired(Boolean isHearingImpaired) { + this.instance.isHearingImpaired = isHearingImpaired; + return this; + } + + public MediaStream.Builder height(Integer height) { + this.instance.height = height; + return this; + } + + public MediaStream.Builder width(Integer width) { + this.instance.width = width; + return this; + } + + public MediaStream.Builder averageFrameRate(Float averageFrameRate) { + this.instance.averageFrameRate = averageFrameRate; + return this; + } + + public MediaStream.Builder realFrameRate(Float realFrameRate) { + this.instance.realFrameRate = realFrameRate; + return this; + } + + public MediaStream.Builder referenceFrameRate(Float referenceFrameRate) { + this.instance.referenceFrameRate = referenceFrameRate; + return this; + } + + public MediaStream.Builder profile(String profile) { + this.instance.profile = profile; + return this; + } + + public MediaStream.Builder type(MediaStreamType type) { + this.instance.type = type; + return this; + } + + public MediaStream.Builder aspectRatio(String aspectRatio) { + this.instance.aspectRatio = aspectRatio; + return this; + } + + public MediaStream.Builder index(Integer index) { + this.instance.index = index; + return this; + } + + public MediaStream.Builder score(Integer score) { + this.instance.score = score; + return this; + } + + public MediaStream.Builder isExternal(Boolean isExternal) { + this.instance.isExternal = isExternal; + return this; + } + + public MediaStream.Builder deliveryMethod(SubtitleDeliveryMethod deliveryMethod) { + this.instance.deliveryMethod = deliveryMethod; + return this; + } + + public MediaStream.Builder deliveryUrl(String deliveryUrl) { + this.instance.deliveryUrl = deliveryUrl; + return this; + } + + public MediaStream.Builder isExternalUrl(Boolean isExternalUrl) { + this.instance.isExternalUrl = isExternalUrl; + return this; + } + + public MediaStream.Builder isTextSubtitleStream(Boolean isTextSubtitleStream) { + this.instance.isTextSubtitleStream = isTextSubtitleStream; + return this; + } + + public MediaStream.Builder supportsExternalStream(Boolean supportsExternalStream) { + this.instance.supportsExternalStream = supportsExternalStream; + return this; + } + + public MediaStream.Builder path(String path) { + this.instance.path = path; + return this; + } + + public MediaStream.Builder pixelFormat(String pixelFormat) { + this.instance.pixelFormat = pixelFormat; + return this; + } + + public MediaStream.Builder level(Double level) { + this.instance.level = level; + return this; + } + + public MediaStream.Builder isAnamorphic(Boolean isAnamorphic) { + this.instance.isAnamorphic = isAnamorphic; + return this; + } + + /** + * returns a built MediaStream instance. + * + * The builder is not reusable. + */ + public MediaStream build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaStream.Builder builder() { + return new MediaStream.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaStream.Builder toBuilder() { + return new MediaStream.Builder().codec(getCodec()).codecTag(getCodecTag()).language(getLanguage()) + .colorRange(getColorRange()).colorSpace(getColorSpace()).colorTransfer(getColorTransfer()) + .colorPrimaries(getColorPrimaries()).dvVersionMajor(getDvVersionMajor()) + .dvVersionMinor(getDvVersionMinor()).dvProfile(getDvProfile()).dvLevel(getDvLevel()) + .rpuPresentFlag(getRpuPresentFlag()).elPresentFlag(getElPresentFlag()).blPresentFlag(getBlPresentFlag()) + .dvBlSignalCompatibilityId(getDvBlSignalCompatibilityId()).rotation(getRotation()).comment(getComment()) + .timeBase(getTimeBase()).codecTimeBase(getCodecTimeBase()).title(getTitle()).videoRange(getVideoRange()) + .videoRangeType(getVideoRangeType()).videoDoViTitle(getVideoDoViTitle()) + .audioSpatialFormat(getAudioSpatialFormat()).localizedUndefined(getLocalizedUndefined()) + .localizedDefault(getLocalizedDefault()).localizedForced(getLocalizedForced()) + .localizedExternal(getLocalizedExternal()).localizedHearingImpaired(getLocalizedHearingImpaired()) + .displayTitle(getDisplayTitle()).nalLengthSize(getNalLengthSize()).isInterlaced(getIsInterlaced()) + .isAVC(getIsAVC()).channelLayout(getChannelLayout()).bitRate(getBitRate()).bitDepth(getBitDepth()) + .refFrames(getRefFrames()).packetLength(getPacketLength()).channels(getChannels()) + .sampleRate(getSampleRate()).isDefault(getIsDefault()).isForced(getIsForced()) + .isHearingImpaired(getIsHearingImpaired()).height(getHeight()).width(getWidth()) + .averageFrameRate(getAverageFrameRate()).realFrameRate(getRealFrameRate()) + .referenceFrameRate(getReferenceFrameRate()).profile(getProfile()).type(getType()) + .aspectRatio(getAspectRatio()).index(getIndex()).score(getScore()).isExternal(getIsExternal()) + .deliveryMethod(getDeliveryMethod()).deliveryUrl(getDeliveryUrl()).isExternalUrl(getIsExternalUrl()) + .isTextSubtitleStream(getIsTextSubtitleStream()).supportsExternalStream(getSupportsExternalStream()) + .path(getPath()).pixelFormat(getPixelFormat()).level(getLevel()).isAnamorphic(getIsAnamorphic()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaStreamProtocol.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaStreamProtocol.java new file mode 100644 index 0000000000000..baa4a3e1219eb --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaStreamProtocol.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Media streaming protocol. Lowercase for backwards compatibility. + */ +public enum MediaStreamProtocol { + + HTTP("http"), + + HLS("hls"); + + private String value; + + MediaStreamProtocol(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MediaStreamProtocol fromValue(String value) { + for (MediaStreamProtocol b : MediaStreamProtocol.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaStreamType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaStreamType.java new file mode 100644 index 0000000000000..a34ed5f8699b9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaStreamType.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum MediaStreamType. + */ +public enum MediaStreamType { + + AUDIO("Audio"), + + VIDEO("Video"), + + SUBTITLE("Subtitle"), + + EMBEDDED_IMAGE("EmbeddedImage"), + + DATA("Data"), + + LYRIC("Lyric"); + + private String value; + + MediaStreamType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MediaStreamType fromValue(String value) { + for (MediaStreamType b : MediaStreamType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaType.java new file mode 100644 index 0000000000000..9ef012209e583 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaType.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Media types. + */ +public enum MediaType { + + UNKNOWN("Unknown"), + + VIDEO("Video"), + + AUDIO("Audio"), + + PHOTO("Photo"), + + BOOK("Book"); + + private String value; + + MediaType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MediaType fromValue(String value) { + for (MediaType b : MediaType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaUpdateInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaUpdateInfoDto.java new file mode 100644 index 0000000000000..100954a8529e6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaUpdateInfoDto.java @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Media Update Info Dto. + */ +@JsonPropertyOrder({ MediaUpdateInfoDto.JSON_PROPERTY_UPDATES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaUpdateInfoDto { + public static final String JSON_PROPERTY_UPDATES = "Updates"; + @org.eclipse.jdt.annotation.NonNull + private List updates = new ArrayList<>(); + + public MediaUpdateInfoDto() { + } + + public MediaUpdateInfoDto updates(@org.eclipse.jdt.annotation.NonNull List updates) { + this.updates = updates; + return this; + } + + public MediaUpdateInfoDto addUpdatesItem(MediaUpdateInfoPathDto updatesItem) { + if (this.updates == null) { + this.updates = new ArrayList<>(); + } + this.updates.add(updatesItem); + return this; + } + + /** + * Gets or sets the list of updates. + * + * @return updates + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_UPDATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getUpdates() { + return updates; + } + + @JsonProperty(JSON_PROPERTY_UPDATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdates(@org.eclipse.jdt.annotation.NonNull List updates) { + this.updates = updates; + } + + /** + * Return true if this MediaUpdateInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaUpdateInfoDto mediaUpdateInfoDto = (MediaUpdateInfoDto) o; + return Objects.equals(this.updates, mediaUpdateInfoDto.updates); + } + + @Override + public int hashCode() { + return Objects.hash(updates); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaUpdateInfoDto {\n"); + sb.append(" updates: ").append(toIndentedString(updates)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Updates` to the URL query string + if (getUpdates() != null) { + for (int i = 0; i < getUpdates().size(); i++) { + if (getUpdates().get(i) != null) { + joiner.add(getUpdates().get(i).toUrlQueryString(String.format("%sUpdates%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaUpdateInfoDto instance; + + public Builder() { + this(new MediaUpdateInfoDto()); + } + + protected Builder(MediaUpdateInfoDto instance) { + this.instance = instance; + } + + public MediaUpdateInfoDto.Builder updates(List updates) { + this.instance.updates = updates; + return this; + } + + /** + * returns a built MediaUpdateInfoDto instance. + * + * The builder is not reusable. + */ + public MediaUpdateInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaUpdateInfoDto.Builder builder() { + return new MediaUpdateInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaUpdateInfoDto.Builder toBuilder() { + return new MediaUpdateInfoDto.Builder().updates(getUpdates()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaUpdateInfoPathDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaUpdateInfoPathDto.java new file mode 100644 index 0000000000000..fe1afd405c05b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaUpdateInfoPathDto.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The media update info path. + */ +@JsonPropertyOrder({ MediaUpdateInfoPathDto.JSON_PROPERTY_PATH, MediaUpdateInfoPathDto.JSON_PROPERTY_UPDATE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaUpdateInfoPathDto { + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_UPDATE_TYPE = "UpdateType"; + @org.eclipse.jdt.annotation.NonNull + private String updateType; + + public MediaUpdateInfoPathDto() { + } + + public MediaUpdateInfoPathDto path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets media path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public MediaUpdateInfoPathDto updateType(@org.eclipse.jdt.annotation.NonNull String updateType) { + this.updateType = updateType; + return this; + } + + /** + * Gets or sets media update type. Created, Modified, Deleted. + * + * @return updateType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_UPDATE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdateType() { + return updateType; + } + + @JsonProperty(JSON_PROPERTY_UPDATE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdateType(@org.eclipse.jdt.annotation.NonNull String updateType) { + this.updateType = updateType; + } + + /** + * Return true if this MediaUpdateInfoPathDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaUpdateInfoPathDto mediaUpdateInfoPathDto = (MediaUpdateInfoPathDto) o; + return Objects.equals(this.path, mediaUpdateInfoPathDto.path) + && Objects.equals(this.updateType, mediaUpdateInfoPathDto.updateType); + } + + @Override + public int hashCode() { + return Objects.hash(path, updateType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaUpdateInfoPathDto {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" updateType: ").append(toIndentedString(updateType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `UpdateType` to the URL query string + if (getUpdateType() != null) { + joiner.add(String.format("%sUpdateType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUpdateType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaUpdateInfoPathDto instance; + + public Builder() { + this(new MediaUpdateInfoPathDto()); + } + + protected Builder(MediaUpdateInfoPathDto instance) { + this.instance = instance; + } + + public MediaUpdateInfoPathDto.Builder path(String path) { + this.instance.path = path; + return this; + } + + public MediaUpdateInfoPathDto.Builder updateType(String updateType) { + this.instance.updateType = updateType; + return this; + } + + /** + * returns a built MediaUpdateInfoPathDto instance. + * + * The builder is not reusable. + */ + public MediaUpdateInfoPathDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaUpdateInfoPathDto.Builder builder() { + return new MediaUpdateInfoPathDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaUpdateInfoPathDto.Builder toBuilder() { + return new MediaUpdateInfoPathDto.Builder().path(getPath()).updateType(getUpdateType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaUrl.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaUrl.java new file mode 100644 index 0000000000000..429191c1f1d4d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MediaUrl.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MediaUrl + */ +@JsonPropertyOrder({ MediaUrl.JSON_PROPERTY_URL, MediaUrl.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaUrl { + public static final String JSON_PROPERTY_URL = "Url"; + @org.eclipse.jdt.annotation.NonNull + private String url; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public MediaUrl() { + } + + public MediaUrl url(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + return this; + } + + /** + * Get url + * + * @return url + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + } + + public MediaUrl name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + /** + * Return true if this MediaUrl object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaUrl mediaUrl = (MediaUrl) o; + return Objects.equals(this.url, mediaUrl.url) && Objects.equals(this.name, mediaUrl.name); + } + + @Override + public int hashCode() { + return Objects.hash(url, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaUrl {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format("%sUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaUrl instance; + + public Builder() { + this(new MediaUrl()); + } + + protected Builder(MediaUrl instance) { + this.instance = instance; + } + + public MediaUrl.Builder url(String url) { + this.instance.url = url; + return this; + } + + public MediaUrl.Builder name(String name) { + this.instance.name = name; + return this; + } + + /** + * returns a built MediaUrl instance. + * + * The builder is not reusable. + */ + public MediaUrl build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaUrl.Builder builder() { + return new MediaUrl.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaUrl.Builder toBuilder() { + return new MediaUrl.Builder().url(getUrl()).name(getName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MessageCommand.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MessageCommand.java new file mode 100644 index 0000000000000..6516877dab745 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MessageCommand.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MessageCommand + */ +@JsonPropertyOrder({ MessageCommand.JSON_PROPERTY_HEADER, MessageCommand.JSON_PROPERTY_TEXT, + MessageCommand.JSON_PROPERTY_TIMEOUT_MS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MessageCommand { + public static final String JSON_PROPERTY_HEADER = "Header"; + @org.eclipse.jdt.annotation.NonNull + private String header; + + public static final String JSON_PROPERTY_TEXT = "Text"; + @org.eclipse.jdt.annotation.Nullable + private String text; + + public static final String JSON_PROPERTY_TIMEOUT_MS = "TimeoutMs"; + @org.eclipse.jdt.annotation.NonNull + private Long timeoutMs; + + public MessageCommand() { + } + + public MessageCommand header(@org.eclipse.jdt.annotation.NonNull String header) { + this.header = header; + return this; + } + + /** + * Get header + * + * @return header + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHeader() { + return header; + } + + @JsonProperty(JSON_PROPERTY_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeader(@org.eclipse.jdt.annotation.NonNull String header) { + this.header = header; + } + + public MessageCommand text(@org.eclipse.jdt.annotation.Nullable String text) { + this.text = text; + return this; + } + + /** + * Get text + * + * @return text + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getText() { + return text; + } + + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setText(@org.eclipse.jdt.annotation.Nullable String text) { + this.text = text; + } + + public MessageCommand timeoutMs(@org.eclipse.jdt.annotation.NonNull Long timeoutMs) { + this.timeoutMs = timeoutMs; + return this; + } + + /** + * Get timeoutMs + * + * @return timeoutMs + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTimeoutMs() { + return timeoutMs; + } + + @JsonProperty(JSON_PROPERTY_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimeoutMs(@org.eclipse.jdt.annotation.NonNull Long timeoutMs) { + this.timeoutMs = timeoutMs; + } + + /** + * Return true if this MessageCommand object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessageCommand messageCommand = (MessageCommand) o; + return Objects.equals(this.header, messageCommand.header) && Objects.equals(this.text, messageCommand.text) + && Objects.equals(this.timeoutMs, messageCommand.timeoutMs); + } + + @Override + public int hashCode() { + return Objects.hash(header, text, timeoutMs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessageCommand {\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Header` to the URL query string + if (getHeader() != null) { + joiner.add(String.format("%sHeader%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHeader())))); + } + + // add `Text` to the URL query string + if (getText() != null) { + joiner.add(String.format("%sText%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getText())))); + } + + // add `TimeoutMs` to the URL query string + if (getTimeoutMs() != null) { + joiner.add(String.format("%sTimeoutMs%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTimeoutMs())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MessageCommand instance; + + public Builder() { + this(new MessageCommand()); + } + + protected Builder(MessageCommand instance) { + this.instance = instance; + } + + public MessageCommand.Builder header(String header) { + this.instance.header = header; + return this; + } + + public MessageCommand.Builder text(String text) { + this.instance.text = text; + return this; + } + + public MessageCommand.Builder timeoutMs(Long timeoutMs) { + this.instance.timeoutMs = timeoutMs; + return this; + } + + /** + * returns a built MessageCommand instance. + * + * The builder is not reusable. + */ + public MessageCommand build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MessageCommand.Builder builder() { + return new MessageCommand.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessageCommand.Builder toBuilder() { + return new MessageCommand.Builder().header(getHeader()).text(getText()).timeoutMs(getTimeoutMs()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataConfiguration.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataConfiguration.java new file mode 100644 index 0000000000000..894ec29f70e6e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataConfiguration.java @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MetadataConfiguration + */ +@JsonPropertyOrder({ MetadataConfiguration.JSON_PROPERTY_USE_FILE_CREATION_TIME_FOR_DATE_ADDED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MetadataConfiguration { + public static final String JSON_PROPERTY_USE_FILE_CREATION_TIME_FOR_DATE_ADDED = "UseFileCreationTimeForDateAdded"; + @org.eclipse.jdt.annotation.NonNull + private Boolean useFileCreationTimeForDateAdded; + + public MetadataConfiguration() { + } + + public MetadataConfiguration useFileCreationTimeForDateAdded( + @org.eclipse.jdt.annotation.NonNull Boolean useFileCreationTimeForDateAdded) { + this.useFileCreationTimeForDateAdded = useFileCreationTimeForDateAdded; + return this; + } + + /** + * Get useFileCreationTimeForDateAdded + * + * @return useFileCreationTimeForDateAdded + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USE_FILE_CREATION_TIME_FOR_DATE_ADDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUseFileCreationTimeForDateAdded() { + return useFileCreationTimeForDateAdded; + } + + @JsonProperty(JSON_PROPERTY_USE_FILE_CREATION_TIME_FOR_DATE_ADDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseFileCreationTimeForDateAdded( + @org.eclipse.jdt.annotation.NonNull Boolean useFileCreationTimeForDateAdded) { + this.useFileCreationTimeForDateAdded = useFileCreationTimeForDateAdded; + } + + /** + * Return true if this MetadataConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetadataConfiguration metadataConfiguration = (MetadataConfiguration) o; + return Objects.equals(this.useFileCreationTimeForDateAdded, + metadataConfiguration.useFileCreationTimeForDateAdded); + } + + @Override + public int hashCode() { + return Objects.hash(useFileCreationTimeForDateAdded); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MetadataConfiguration {\n"); + sb.append(" useFileCreationTimeForDateAdded: ").append(toIndentedString(useFileCreationTimeForDateAdded)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `UseFileCreationTimeForDateAdded` to the URL query string + if (getUseFileCreationTimeForDateAdded() != null) { + joiner.add(String.format("%sUseFileCreationTimeForDateAdded%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUseFileCreationTimeForDateAdded())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MetadataConfiguration instance; + + public Builder() { + this(new MetadataConfiguration()); + } + + protected Builder(MetadataConfiguration instance) { + this.instance = instance; + } + + public MetadataConfiguration.Builder useFileCreationTimeForDateAdded(Boolean useFileCreationTimeForDateAdded) { + this.instance.useFileCreationTimeForDateAdded = useFileCreationTimeForDateAdded; + return this; + } + + /** + * returns a built MetadataConfiguration instance. + * + * The builder is not reusable. + */ + public MetadataConfiguration build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MetadataConfiguration.Builder builder() { + return new MetadataConfiguration.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MetadataConfiguration.Builder toBuilder() { + return new MetadataConfiguration.Builder() + .useFileCreationTimeForDateAdded(getUseFileCreationTimeForDateAdded()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataEditorInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataEditorInfo.java new file mode 100644 index 0000000000000..29b2f0f487e7f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataEditorInfo.java @@ -0,0 +1,467 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MetadataEditorInfo + */ +@JsonPropertyOrder({ MetadataEditorInfo.JSON_PROPERTY_PARENTAL_RATING_OPTIONS, + MetadataEditorInfo.JSON_PROPERTY_COUNTRIES, MetadataEditorInfo.JSON_PROPERTY_CULTURES, + MetadataEditorInfo.JSON_PROPERTY_EXTERNAL_ID_INFOS, MetadataEditorInfo.JSON_PROPERTY_CONTENT_TYPE, + MetadataEditorInfo.JSON_PROPERTY_CONTENT_TYPE_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MetadataEditorInfo { + public static final String JSON_PROPERTY_PARENTAL_RATING_OPTIONS = "ParentalRatingOptions"; + @org.eclipse.jdt.annotation.NonNull + private List parentalRatingOptions = new ArrayList<>(); + + public static final String JSON_PROPERTY_COUNTRIES = "Countries"; + @org.eclipse.jdt.annotation.NonNull + private List countries = new ArrayList<>(); + + public static final String JSON_PROPERTY_CULTURES = "Cultures"; + @org.eclipse.jdt.annotation.NonNull + private List cultures = new ArrayList<>(); + + public static final String JSON_PROPERTY_EXTERNAL_ID_INFOS = "ExternalIdInfos"; + @org.eclipse.jdt.annotation.NonNull + private List externalIdInfos = new ArrayList<>(); + + public static final String JSON_PROPERTY_CONTENT_TYPE = "ContentType"; + @org.eclipse.jdt.annotation.NonNull + private CollectionType contentType; + + public static final String JSON_PROPERTY_CONTENT_TYPE_OPTIONS = "ContentTypeOptions"; + @org.eclipse.jdt.annotation.NonNull + private List contentTypeOptions = new ArrayList<>(); + + public MetadataEditorInfo() { + } + + public MetadataEditorInfo parentalRatingOptions( + @org.eclipse.jdt.annotation.NonNull List parentalRatingOptions) { + this.parentalRatingOptions = parentalRatingOptions; + return this; + } + + public MetadataEditorInfo addParentalRatingOptionsItem(ParentalRating parentalRatingOptionsItem) { + if (this.parentalRatingOptions == null) { + this.parentalRatingOptions = new ArrayList<>(); + } + this.parentalRatingOptions.add(parentalRatingOptionsItem); + return this; + } + + /** + * Get parentalRatingOptions + * + * @return parentalRatingOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENTAL_RATING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getParentalRatingOptions() { + return parentalRatingOptions; + } + + @JsonProperty(JSON_PROPERTY_PARENTAL_RATING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentalRatingOptions( + @org.eclipse.jdt.annotation.NonNull List parentalRatingOptions) { + this.parentalRatingOptions = parentalRatingOptions; + } + + public MetadataEditorInfo countries(@org.eclipse.jdt.annotation.NonNull List countries) { + this.countries = countries; + return this; + } + + public MetadataEditorInfo addCountriesItem(CountryInfo countriesItem) { + if (this.countries == null) { + this.countries = new ArrayList<>(); + } + this.countries.add(countriesItem); + return this; + } + + /** + * Get countries + * + * @return countries + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COUNTRIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCountries() { + return countries; + } + + @JsonProperty(JSON_PROPERTY_COUNTRIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCountries(@org.eclipse.jdt.annotation.NonNull List countries) { + this.countries = countries; + } + + public MetadataEditorInfo cultures(@org.eclipse.jdt.annotation.NonNull List cultures) { + this.cultures = cultures; + return this; + } + + public MetadataEditorInfo addCulturesItem(CultureDto culturesItem) { + if (this.cultures == null) { + this.cultures = new ArrayList<>(); + } + this.cultures.add(culturesItem); + return this; + } + + /** + * Get cultures + * + * @return cultures + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CULTURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCultures() { + return cultures; + } + + @JsonProperty(JSON_PROPERTY_CULTURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCultures(@org.eclipse.jdt.annotation.NonNull List cultures) { + this.cultures = cultures; + } + + public MetadataEditorInfo externalIdInfos( + @org.eclipse.jdt.annotation.NonNull List externalIdInfos) { + this.externalIdInfos = externalIdInfos; + return this; + } + + public MetadataEditorInfo addExternalIdInfosItem(ExternalIdInfo externalIdInfosItem) { + if (this.externalIdInfos == null) { + this.externalIdInfos = new ArrayList<>(); + } + this.externalIdInfos.add(externalIdInfosItem); + return this; + } + + /** + * Get externalIdInfos + * + * @return externalIdInfos + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getExternalIdInfos() { + return externalIdInfos; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalIdInfos(@org.eclipse.jdt.annotation.NonNull List externalIdInfos) { + this.externalIdInfos = externalIdInfos; + } + + public MetadataEditorInfo contentType(@org.eclipse.jdt.annotation.NonNull CollectionType contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get contentType + * + * @return contentType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CollectionType getContentType() { + return contentType; + } + + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentType(@org.eclipse.jdt.annotation.NonNull CollectionType contentType) { + this.contentType = contentType; + } + + public MetadataEditorInfo contentTypeOptions( + @org.eclipse.jdt.annotation.NonNull List contentTypeOptions) { + this.contentTypeOptions = contentTypeOptions; + return this; + } + + public MetadataEditorInfo addContentTypeOptionsItem(NameValuePair contentTypeOptionsItem) { + if (this.contentTypeOptions == null) { + this.contentTypeOptions = new ArrayList<>(); + } + this.contentTypeOptions.add(contentTypeOptionsItem); + return this; + } + + /** + * Get contentTypeOptions + * + * @return contentTypeOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getContentTypeOptions() { + return contentTypeOptions; + } + + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentTypeOptions(@org.eclipse.jdt.annotation.NonNull List contentTypeOptions) { + this.contentTypeOptions = contentTypeOptions; + } + + /** + * Return true if this MetadataEditorInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetadataEditorInfo metadataEditorInfo = (MetadataEditorInfo) o; + return Objects.equals(this.parentalRatingOptions, metadataEditorInfo.parentalRatingOptions) + && Objects.equals(this.countries, metadataEditorInfo.countries) + && Objects.equals(this.cultures, metadataEditorInfo.cultures) + && Objects.equals(this.externalIdInfos, metadataEditorInfo.externalIdInfos) + && Objects.equals(this.contentType, metadataEditorInfo.contentType) + && Objects.equals(this.contentTypeOptions, metadataEditorInfo.contentTypeOptions); + } + + @Override + public int hashCode() { + return Objects.hash(parentalRatingOptions, countries, cultures, externalIdInfos, contentType, + contentTypeOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MetadataEditorInfo {\n"); + sb.append(" parentalRatingOptions: ").append(toIndentedString(parentalRatingOptions)).append("\n"); + sb.append(" countries: ").append(toIndentedString(countries)).append("\n"); + sb.append(" cultures: ").append(toIndentedString(cultures)).append("\n"); + sb.append(" externalIdInfos: ").append(toIndentedString(externalIdInfos)).append("\n"); + sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n"); + sb.append(" contentTypeOptions: ").append(toIndentedString(contentTypeOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ParentalRatingOptions` to the URL query string + if (getParentalRatingOptions() != null) { + for (int i = 0; i < getParentalRatingOptions().size(); i++) { + if (getParentalRatingOptions().get(i) != null) { + joiner.add(getParentalRatingOptions().get(i).toUrlQueryString(String.format( + "%sParentalRatingOptions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Countries` to the URL query string + if (getCountries() != null) { + for (int i = 0; i < getCountries().size(); i++) { + if (getCountries().get(i) != null) { + joiner.add(getCountries().get(i).toUrlQueryString(String.format("%sCountries%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Cultures` to the URL query string + if (getCultures() != null) { + for (int i = 0; i < getCultures().size(); i++) { + if (getCultures().get(i) != null) { + joiner.add(getCultures().get(i).toUrlQueryString(String.format("%sCultures%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ExternalIdInfos` to the URL query string + if (getExternalIdInfos() != null) { + for (int i = 0; i < getExternalIdInfos().size(); i++) { + if (getExternalIdInfos().get(i) != null) { + joiner.add(getExternalIdInfos().get(i).toUrlQueryString(String.format("%sExternalIdInfos%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ContentType` to the URL query string + if (getContentType() != null) { + joiner.add(String.format("%sContentType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContentType())))); + } + + // add `ContentTypeOptions` to the URL query string + if (getContentTypeOptions() != null) { + for (int i = 0; i < getContentTypeOptions().size(); i++) { + if (getContentTypeOptions().get(i) != null) { + joiner.add(getContentTypeOptions().get(i).toUrlQueryString(String.format("%sContentTypeOptions%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private MetadataEditorInfo instance; + + public Builder() { + this(new MetadataEditorInfo()); + } + + protected Builder(MetadataEditorInfo instance) { + this.instance = instance; + } + + public MetadataEditorInfo.Builder parentalRatingOptions(List parentalRatingOptions) { + this.instance.parentalRatingOptions = parentalRatingOptions; + return this; + } + + public MetadataEditorInfo.Builder countries(List countries) { + this.instance.countries = countries; + return this; + } + + public MetadataEditorInfo.Builder cultures(List cultures) { + this.instance.cultures = cultures; + return this; + } + + public MetadataEditorInfo.Builder externalIdInfos(List externalIdInfos) { + this.instance.externalIdInfos = externalIdInfos; + return this; + } + + public MetadataEditorInfo.Builder contentType(CollectionType contentType) { + this.instance.contentType = contentType; + return this; + } + + public MetadataEditorInfo.Builder contentTypeOptions(List contentTypeOptions) { + this.instance.contentTypeOptions = contentTypeOptions; + return this; + } + + /** + * returns a built MetadataEditorInfo instance. + * + * The builder is not reusable. + */ + public MetadataEditorInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MetadataEditorInfo.Builder builder() { + return new MetadataEditorInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MetadataEditorInfo.Builder toBuilder() { + return new MetadataEditorInfo.Builder().parentalRatingOptions(getParentalRatingOptions()) + .countries(getCountries()).cultures(getCultures()).externalIdInfos(getExternalIdInfos()) + .contentType(getContentType()).contentTypeOptions(getContentTypeOptions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataField.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataField.java new file mode 100644 index 0000000000000..c83fb2b792073 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataField.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum MetadataFields. + */ +public enum MetadataField { + + CAST("Cast"), + + GENRES("Genres"), + + PRODUCTION_LOCATIONS("ProductionLocations"), + + STUDIOS("Studios"), + + TAGS("Tags"), + + NAME("Name"), + + OVERVIEW("Overview"), + + RUNTIME("Runtime"), + + OFFICIAL_RATING("OfficialRating"); + + private String value; + + MetadataField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MetadataField fromValue(String value) { + for (MetadataField b : MetadataField.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataOptions.java new file mode 100644 index 0000000000000..c0ab19d221827 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataOptions.java @@ -0,0 +1,511 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class MetadataOptions. + */ +@JsonPropertyOrder({ MetadataOptions.JSON_PROPERTY_ITEM_TYPE, MetadataOptions.JSON_PROPERTY_DISABLED_METADATA_SAVERS, + MetadataOptions.JSON_PROPERTY_LOCAL_METADATA_READER_ORDER, + MetadataOptions.JSON_PROPERTY_DISABLED_METADATA_FETCHERS, MetadataOptions.JSON_PROPERTY_METADATA_FETCHER_ORDER, + MetadataOptions.JSON_PROPERTY_DISABLED_IMAGE_FETCHERS, MetadataOptions.JSON_PROPERTY_IMAGE_FETCHER_ORDER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MetadataOptions { + public static final String JSON_PROPERTY_ITEM_TYPE = "ItemType"; + @org.eclipse.jdt.annotation.NonNull + private String itemType; + + public static final String JSON_PROPERTY_DISABLED_METADATA_SAVERS = "DisabledMetadataSavers"; + @org.eclipse.jdt.annotation.NonNull + private List disabledMetadataSavers; + + public static final String JSON_PROPERTY_LOCAL_METADATA_READER_ORDER = "LocalMetadataReaderOrder"; + @org.eclipse.jdt.annotation.NonNull + private List localMetadataReaderOrder; + + public static final String JSON_PROPERTY_DISABLED_METADATA_FETCHERS = "DisabledMetadataFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List disabledMetadataFetchers; + + public static final String JSON_PROPERTY_METADATA_FETCHER_ORDER = "MetadataFetcherOrder"; + @org.eclipse.jdt.annotation.NonNull + private List metadataFetcherOrder; + + public static final String JSON_PROPERTY_DISABLED_IMAGE_FETCHERS = "DisabledImageFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List disabledImageFetchers; + + public static final String JSON_PROPERTY_IMAGE_FETCHER_ORDER = "ImageFetcherOrder"; + @org.eclipse.jdt.annotation.NonNull + private List imageFetcherOrder; + + public MetadataOptions() { + } + + public MetadataOptions itemType(@org.eclipse.jdt.annotation.NonNull String itemType) { + this.itemType = itemType; + return this; + } + + /** + * Get itemType + * + * @return itemType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getItemType() { + return itemType; + } + + @JsonProperty(JSON_PROPERTY_ITEM_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemType(@org.eclipse.jdt.annotation.NonNull String itemType) { + this.itemType = itemType; + } + + public MetadataOptions disabledMetadataSavers( + @org.eclipse.jdt.annotation.NonNull List disabledMetadataSavers) { + this.disabledMetadataSavers = disabledMetadataSavers; + return this; + } + + public MetadataOptions addDisabledMetadataSaversItem(String disabledMetadataSaversItem) { + if (this.disabledMetadataSavers == null) { + this.disabledMetadataSavers = new ArrayList<>(); + } + this.disabledMetadataSavers.add(disabledMetadataSaversItem); + return this; + } + + /** + * Get disabledMetadataSavers + * + * @return disabledMetadataSavers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISABLED_METADATA_SAVERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisabledMetadataSavers() { + return disabledMetadataSavers; + } + + @JsonProperty(JSON_PROPERTY_DISABLED_METADATA_SAVERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisabledMetadataSavers(@org.eclipse.jdt.annotation.NonNull List disabledMetadataSavers) { + this.disabledMetadataSavers = disabledMetadataSavers; + } + + public MetadataOptions localMetadataReaderOrder( + @org.eclipse.jdt.annotation.NonNull List localMetadataReaderOrder) { + this.localMetadataReaderOrder = localMetadataReaderOrder; + return this; + } + + public MetadataOptions addLocalMetadataReaderOrderItem(String localMetadataReaderOrderItem) { + if (this.localMetadataReaderOrder == null) { + this.localMetadataReaderOrder = new ArrayList<>(); + } + this.localMetadataReaderOrder.add(localMetadataReaderOrderItem); + return this; + } + + /** + * Get localMetadataReaderOrder + * + * @return localMetadataReaderOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCAL_METADATA_READER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLocalMetadataReaderOrder() { + return localMetadataReaderOrder; + } + + @JsonProperty(JSON_PROPERTY_LOCAL_METADATA_READER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalMetadataReaderOrder(@org.eclipse.jdt.annotation.NonNull List localMetadataReaderOrder) { + this.localMetadataReaderOrder = localMetadataReaderOrder; + } + + public MetadataOptions disabledMetadataFetchers( + @org.eclipse.jdt.annotation.NonNull List disabledMetadataFetchers) { + this.disabledMetadataFetchers = disabledMetadataFetchers; + return this; + } + + public MetadataOptions addDisabledMetadataFetchersItem(String disabledMetadataFetchersItem) { + if (this.disabledMetadataFetchers == null) { + this.disabledMetadataFetchers = new ArrayList<>(); + } + this.disabledMetadataFetchers.add(disabledMetadataFetchersItem); + return this; + } + + /** + * Get disabledMetadataFetchers + * + * @return disabledMetadataFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISABLED_METADATA_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisabledMetadataFetchers() { + return disabledMetadataFetchers; + } + + @JsonProperty(JSON_PROPERTY_DISABLED_METADATA_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisabledMetadataFetchers(@org.eclipse.jdt.annotation.NonNull List disabledMetadataFetchers) { + this.disabledMetadataFetchers = disabledMetadataFetchers; + } + + public MetadataOptions metadataFetcherOrder(@org.eclipse.jdt.annotation.NonNull List metadataFetcherOrder) { + this.metadataFetcherOrder = metadataFetcherOrder; + return this; + } + + public MetadataOptions addMetadataFetcherOrderItem(String metadataFetcherOrderItem) { + if (this.metadataFetcherOrder == null) { + this.metadataFetcherOrder = new ArrayList<>(); + } + this.metadataFetcherOrder.add(metadataFetcherOrderItem); + return this; + } + + /** + * Get metadataFetcherOrder + * + * @return metadataFetcherOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMetadataFetcherOrder() { + return metadataFetcherOrder; + } + + @JsonProperty(JSON_PROPERTY_METADATA_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataFetcherOrder(@org.eclipse.jdt.annotation.NonNull List metadataFetcherOrder) { + this.metadataFetcherOrder = metadataFetcherOrder; + } + + public MetadataOptions disabledImageFetchers( + @org.eclipse.jdt.annotation.NonNull List disabledImageFetchers) { + this.disabledImageFetchers = disabledImageFetchers; + return this; + } + + public MetadataOptions addDisabledImageFetchersItem(String disabledImageFetchersItem) { + if (this.disabledImageFetchers == null) { + this.disabledImageFetchers = new ArrayList<>(); + } + this.disabledImageFetchers.add(disabledImageFetchersItem); + return this; + } + + /** + * Get disabledImageFetchers + * + * @return disabledImageFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISABLED_IMAGE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisabledImageFetchers() { + return disabledImageFetchers; + } + + @JsonProperty(JSON_PROPERTY_DISABLED_IMAGE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisabledImageFetchers(@org.eclipse.jdt.annotation.NonNull List disabledImageFetchers) { + this.disabledImageFetchers = disabledImageFetchers; + } + + public MetadataOptions imageFetcherOrder(@org.eclipse.jdt.annotation.NonNull List imageFetcherOrder) { + this.imageFetcherOrder = imageFetcherOrder; + return this; + } + + public MetadataOptions addImageFetcherOrderItem(String imageFetcherOrderItem) { + if (this.imageFetcherOrder == null) { + this.imageFetcherOrder = new ArrayList<>(); + } + this.imageFetcherOrder.add(imageFetcherOrderItem); + return this; + } + + /** + * Get imageFetcherOrder + * + * @return imageFetcherOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getImageFetcherOrder() { + return imageFetcherOrder; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageFetcherOrder(@org.eclipse.jdt.annotation.NonNull List imageFetcherOrder) { + this.imageFetcherOrder = imageFetcherOrder; + } + + /** + * Return true if this MetadataOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetadataOptions metadataOptions = (MetadataOptions) o; + return Objects.equals(this.itemType, metadataOptions.itemType) + && Objects.equals(this.disabledMetadataSavers, metadataOptions.disabledMetadataSavers) + && Objects.equals(this.localMetadataReaderOrder, metadataOptions.localMetadataReaderOrder) + && Objects.equals(this.disabledMetadataFetchers, metadataOptions.disabledMetadataFetchers) + && Objects.equals(this.metadataFetcherOrder, metadataOptions.metadataFetcherOrder) + && Objects.equals(this.disabledImageFetchers, metadataOptions.disabledImageFetchers) + && Objects.equals(this.imageFetcherOrder, metadataOptions.imageFetcherOrder); + } + + @Override + public int hashCode() { + return Objects.hash(itemType, disabledMetadataSavers, localMetadataReaderOrder, disabledMetadataFetchers, + metadataFetcherOrder, disabledImageFetchers, imageFetcherOrder); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MetadataOptions {\n"); + sb.append(" itemType: ").append(toIndentedString(itemType)).append("\n"); + sb.append(" disabledMetadataSavers: ").append(toIndentedString(disabledMetadataSavers)).append("\n"); + sb.append(" localMetadataReaderOrder: ").append(toIndentedString(localMetadataReaderOrder)).append("\n"); + sb.append(" disabledMetadataFetchers: ").append(toIndentedString(disabledMetadataFetchers)).append("\n"); + sb.append(" metadataFetcherOrder: ").append(toIndentedString(metadataFetcherOrder)).append("\n"); + sb.append(" disabledImageFetchers: ").append(toIndentedString(disabledImageFetchers)).append("\n"); + sb.append(" imageFetcherOrder: ").append(toIndentedString(imageFetcherOrder)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ItemType` to the URL query string + if (getItemType() != null) { + joiner.add(String.format("%sItemType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemType())))); + } + + // add `DisabledMetadataSavers` to the URL query string + if (getDisabledMetadataSavers() != null) { + for (int i = 0; i < getDisabledMetadataSavers().size(); i++) { + joiner.add(String.format("%sDisabledMetadataSavers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDisabledMetadataSavers().get(i))))); + } + } + + // add `LocalMetadataReaderOrder` to the URL query string + if (getLocalMetadataReaderOrder() != null) { + for (int i = 0; i < getLocalMetadataReaderOrder().size(); i++) { + joiner.add(String.format("%sLocalMetadataReaderOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLocalMetadataReaderOrder().get(i))))); + } + } + + // add `DisabledMetadataFetchers` to the URL query string + if (getDisabledMetadataFetchers() != null) { + for (int i = 0; i < getDisabledMetadataFetchers().size(); i++) { + joiner.add(String.format("%sDisabledMetadataFetchers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDisabledMetadataFetchers().get(i))))); + } + } + + // add `MetadataFetcherOrder` to the URL query string + if (getMetadataFetcherOrder() != null) { + for (int i = 0; i < getMetadataFetcherOrder().size(); i++) { + joiner.add(String.format("%sMetadataFetcherOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMetadataFetcherOrder().get(i))))); + } + } + + // add `DisabledImageFetchers` to the URL query string + if (getDisabledImageFetchers() != null) { + for (int i = 0; i < getDisabledImageFetchers().size(); i++) { + joiner.add(String.format("%sDisabledImageFetchers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDisabledImageFetchers().get(i))))); + } + } + + // add `ImageFetcherOrder` to the URL query string + if (getImageFetcherOrder() != null) { + for (int i = 0; i < getImageFetcherOrder().size(); i++) { + joiner.add(String.format("%sImageFetcherOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getImageFetcherOrder().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private MetadataOptions instance; + + public Builder() { + this(new MetadataOptions()); + } + + protected Builder(MetadataOptions instance) { + this.instance = instance; + } + + public MetadataOptions.Builder itemType(String itemType) { + this.instance.itemType = itemType; + return this; + } + + public MetadataOptions.Builder disabledMetadataSavers(List disabledMetadataSavers) { + this.instance.disabledMetadataSavers = disabledMetadataSavers; + return this; + } + + public MetadataOptions.Builder localMetadataReaderOrder(List localMetadataReaderOrder) { + this.instance.localMetadataReaderOrder = localMetadataReaderOrder; + return this; + } + + public MetadataOptions.Builder disabledMetadataFetchers(List disabledMetadataFetchers) { + this.instance.disabledMetadataFetchers = disabledMetadataFetchers; + return this; + } + + public MetadataOptions.Builder metadataFetcherOrder(List metadataFetcherOrder) { + this.instance.metadataFetcherOrder = metadataFetcherOrder; + return this; + } + + public MetadataOptions.Builder disabledImageFetchers(List disabledImageFetchers) { + this.instance.disabledImageFetchers = disabledImageFetchers; + return this; + } + + public MetadataOptions.Builder imageFetcherOrder(List imageFetcherOrder) { + this.instance.imageFetcherOrder = imageFetcherOrder; + return this; + } + + /** + * returns a built MetadataOptions instance. + * + * The builder is not reusable. + */ + public MetadataOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MetadataOptions.Builder builder() { + return new MetadataOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MetadataOptions.Builder toBuilder() { + return new MetadataOptions.Builder().itemType(getItemType()).disabledMetadataSavers(getDisabledMetadataSavers()) + .localMetadataReaderOrder(getLocalMetadataReaderOrder()) + .disabledMetadataFetchers(getDisabledMetadataFetchers()).metadataFetcherOrder(getMetadataFetcherOrder()) + .disabledImageFetchers(getDisabledImageFetchers()).imageFetcherOrder(getImageFetcherOrder()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataRefreshMode.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataRefreshMode.java new file mode 100644 index 0000000000000..876375ab00dde --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MetadataRefreshMode.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets MetadataRefreshMode + */ +public enum MetadataRefreshMode { + + NONE("None"), + + VALIDATION_ONLY("ValidationOnly"), + + DEFAULT("Default"), + + FULL_REFRESH("FullRefresh"); + + private String value; + + MetadataRefreshMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MetadataRefreshMode fromValue(String value) { + for (MetadataRefreshMode b : MetadataRefreshMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MovePlaylistItemRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MovePlaylistItemRequestDto.java new file mode 100644 index 0000000000000..44c3d560cfe68 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MovePlaylistItemRequestDto.java @@ -0,0 +1,234 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class MovePlaylistItemRequestDto. + */ +@JsonPropertyOrder({ MovePlaylistItemRequestDto.JSON_PROPERTY_PLAYLIST_ITEM_ID, + MovePlaylistItemRequestDto.JSON_PROPERTY_NEW_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MovePlaylistItemRequestDto { + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID playlistItemId; + + public static final String JSON_PROPERTY_NEW_INDEX = "NewIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer newIndex; + + public MovePlaylistItemRequestDto() { + } + + public MovePlaylistItemRequestDto playlistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets or sets the playlist identifier of the item. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + } + + public MovePlaylistItemRequestDto newIndex(@org.eclipse.jdt.annotation.NonNull Integer newIndex) { + this.newIndex = newIndex; + return this; + } + + /** + * Gets or sets the new position. + * + * @return newIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NEW_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNewIndex() { + return newIndex; + } + + @JsonProperty(JSON_PROPERTY_NEW_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewIndex(@org.eclipse.jdt.annotation.NonNull Integer newIndex) { + this.newIndex = newIndex; + } + + /** + * Return true if this MovePlaylistItemRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MovePlaylistItemRequestDto movePlaylistItemRequestDto = (MovePlaylistItemRequestDto) o; + return Objects.equals(this.playlistItemId, movePlaylistItemRequestDto.playlistItemId) + && Objects.equals(this.newIndex, movePlaylistItemRequestDto.newIndex); + } + + @Override + public int hashCode() { + return Objects.hash(playlistItemId, newIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MovePlaylistItemRequestDto {\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append(" newIndex: ").append(toIndentedString(newIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + // add `NewIndex` to the URL query string + if (getNewIndex() != null) { + joiner.add(String.format("%sNewIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getNewIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MovePlaylistItemRequestDto instance; + + public Builder() { + this(new MovePlaylistItemRequestDto()); + } + + protected Builder(MovePlaylistItemRequestDto instance) { + this.instance = instance; + } + + public MovePlaylistItemRequestDto.Builder playlistItemId(UUID playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + public MovePlaylistItemRequestDto.Builder newIndex(Integer newIndex) { + this.instance.newIndex = newIndex; + return this; + } + + /** + * returns a built MovePlaylistItemRequestDto instance. + * + * The builder is not reusable. + */ + public MovePlaylistItemRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MovePlaylistItemRequestDto.Builder builder() { + return new MovePlaylistItemRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MovePlaylistItemRequestDto.Builder toBuilder() { + return new MovePlaylistItemRequestDto.Builder().playlistItemId(getPlaylistItemId()).newIndex(getNewIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MovieInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MovieInfo.java new file mode 100644 index 0000000000000..6a06090c04072 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MovieInfo.java @@ -0,0 +1,614 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MovieInfo + */ +@JsonPropertyOrder({ MovieInfo.JSON_PROPERTY_NAME, MovieInfo.JSON_PROPERTY_ORIGINAL_TITLE, MovieInfo.JSON_PROPERTY_PATH, + MovieInfo.JSON_PROPERTY_METADATA_LANGUAGE, MovieInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, + MovieInfo.JSON_PROPERTY_PROVIDER_IDS, MovieInfo.JSON_PROPERTY_YEAR, MovieInfo.JSON_PROPERTY_INDEX_NUMBER, + MovieInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, MovieInfo.JSON_PROPERTY_PREMIERE_DATE, + MovieInfo.JSON_PROPERTY_IS_AUTOMATED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MovieInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public MovieInfo() { + } + + public MovieInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public MovieInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public MovieInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public MovieInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public MovieInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public MovieInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public MovieInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public MovieInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public MovieInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public MovieInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public MovieInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public MovieInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + /** + * Return true if this MovieInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MovieInfo movieInfo = (MovieInfo) o; + return Objects.equals(this.name, movieInfo.name) && Objects.equals(this.originalTitle, movieInfo.originalTitle) + && Objects.equals(this.path, movieInfo.path) + && Objects.equals(this.metadataLanguage, movieInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, movieInfo.metadataCountryCode) + && Objects.equals(this.providerIds, movieInfo.providerIds) && Objects.equals(this.year, movieInfo.year) + && Objects.equals(this.indexNumber, movieInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, movieInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, movieInfo.premiereDate) + && Objects.equals(this.isAutomated, movieInfo.isAutomated); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MovieInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MovieInfo instance; + + public Builder() { + this(new MovieInfo()); + } + + protected Builder(MovieInfo instance) { + this.instance = instance; + } + + public MovieInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public MovieInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public MovieInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public MovieInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public MovieInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public MovieInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public MovieInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public MovieInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public MovieInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public MovieInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public MovieInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + /** + * returns a built MovieInfo instance. + * + * The builder is not reusable. + */ + public MovieInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MovieInfo.Builder builder() { + return new MovieInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MovieInfo.Builder toBuilder() { + return new MovieInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()) + .isAutomated(getIsAutomated()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MovieInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MovieInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..6183c138d3c44 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MovieInfoRemoteSearchQuery.java @@ -0,0 +1,317 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MovieInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ MovieInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + MovieInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, MovieInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + MovieInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MovieInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private MovieInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public MovieInfoRemoteSearchQuery() { + } + + public MovieInfoRemoteSearchQuery searchInfo(@org.eclipse.jdt.annotation.NonNull MovieInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MovieInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull MovieInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public MovieInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public MovieInfoRemoteSearchQuery searchProviderName( + @org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public MovieInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this MovieInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MovieInfoRemoteSearchQuery movieInfoRemoteSearchQuery = (MovieInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, movieInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, movieInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, movieInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, movieInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MovieInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MovieInfoRemoteSearchQuery instance; + + public Builder() { + this(new MovieInfoRemoteSearchQuery()); + } + + protected Builder(MovieInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public MovieInfoRemoteSearchQuery.Builder searchInfo(MovieInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public MovieInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public MovieInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public MovieInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built MovieInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public MovieInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MovieInfoRemoteSearchQuery.Builder builder() { + return new MovieInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MovieInfoRemoteSearchQuery.Builder toBuilder() { + return new MovieInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MusicVideoInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MusicVideoInfo.java new file mode 100644 index 0000000000000..64fe88bdf58fc --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MusicVideoInfo.java @@ -0,0 +1,670 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MusicVideoInfo + */ +@JsonPropertyOrder({ MusicVideoInfo.JSON_PROPERTY_NAME, MusicVideoInfo.JSON_PROPERTY_ORIGINAL_TITLE, + MusicVideoInfo.JSON_PROPERTY_PATH, MusicVideoInfo.JSON_PROPERTY_METADATA_LANGUAGE, + MusicVideoInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, MusicVideoInfo.JSON_PROPERTY_PROVIDER_IDS, + MusicVideoInfo.JSON_PROPERTY_YEAR, MusicVideoInfo.JSON_PROPERTY_INDEX_NUMBER, + MusicVideoInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, MusicVideoInfo.JSON_PROPERTY_PREMIERE_DATE, + MusicVideoInfo.JSON_PROPERTY_IS_AUTOMATED, MusicVideoInfo.JSON_PROPERTY_ARTISTS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MusicVideoInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public static final String JSON_PROPERTY_ARTISTS = "Artists"; + @org.eclipse.jdt.annotation.NonNull + private List artists; + + public MusicVideoInfo() { + } + + public MusicVideoInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public MusicVideoInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public MusicVideoInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public MusicVideoInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public MusicVideoInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public MusicVideoInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public MusicVideoInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public MusicVideoInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public MusicVideoInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public MusicVideoInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public MusicVideoInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public MusicVideoInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + public MusicVideoInfo artists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + return this; + } + + public MusicVideoInfo addArtistsItem(String artistsItem) { + if (this.artists == null) { + this.artists = new ArrayList<>(); + } + this.artists.add(artistsItem); + return this; + } + + /** + * Get artists + * + * @return artists + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArtists() { + return artists; + } + + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + } + + /** + * Return true if this MusicVideoInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MusicVideoInfo musicVideoInfo = (MusicVideoInfo) o; + return Objects.equals(this.name, musicVideoInfo.name) + && Objects.equals(this.originalTitle, musicVideoInfo.originalTitle) + && Objects.equals(this.path, musicVideoInfo.path) + && Objects.equals(this.metadataLanguage, musicVideoInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, musicVideoInfo.metadataCountryCode) + && Objects.equals(this.providerIds, musicVideoInfo.providerIds) + && Objects.equals(this.year, musicVideoInfo.year) + && Objects.equals(this.indexNumber, musicVideoInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, musicVideoInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, musicVideoInfo.premiereDate) + && Objects.equals(this.isAutomated, musicVideoInfo.isAutomated) + && Objects.equals(this.artists, musicVideoInfo.artists); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated, artists); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MusicVideoInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append(" artists: ").append(toIndentedString(artists)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + // add `Artists` to the URL query string + if (getArtists() != null) { + for (int i = 0; i < getArtists().size(); i++) { + joiner.add(String.format("%sArtists%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArtists().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private MusicVideoInfo instance; + + public Builder() { + this(new MusicVideoInfo()); + } + + protected Builder(MusicVideoInfo instance) { + this.instance = instance; + } + + public MusicVideoInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public MusicVideoInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public MusicVideoInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public MusicVideoInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public MusicVideoInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public MusicVideoInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public MusicVideoInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public MusicVideoInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public MusicVideoInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public MusicVideoInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public MusicVideoInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + public MusicVideoInfo.Builder artists(List artists) { + this.instance.artists = artists; + return this; + } + + /** + * returns a built MusicVideoInfo instance. + * + * The builder is not reusable. + */ + public MusicVideoInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MusicVideoInfo.Builder builder() { + return new MusicVideoInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MusicVideoInfo.Builder toBuilder() { + return new MusicVideoInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()).isAutomated(getIsAutomated()) + .artists(getArtists()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MusicVideoInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MusicVideoInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..3051601fb3297 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/MusicVideoInfoRemoteSearchQuery.java @@ -0,0 +1,319 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MusicVideoInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ MusicVideoInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + MusicVideoInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, + MusicVideoInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + MusicVideoInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MusicVideoInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private MusicVideoInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public MusicVideoInfoRemoteSearchQuery() { + } + + public MusicVideoInfoRemoteSearchQuery searchInfo(@org.eclipse.jdt.annotation.NonNull MusicVideoInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MusicVideoInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull MusicVideoInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public MusicVideoInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public MusicVideoInfoRemoteSearchQuery searchProviderName( + @org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public MusicVideoInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this MusicVideoInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MusicVideoInfoRemoteSearchQuery musicVideoInfoRemoteSearchQuery = (MusicVideoInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, musicVideoInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, musicVideoInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, musicVideoInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, + musicVideoInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MusicVideoInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MusicVideoInfoRemoteSearchQuery instance; + + public Builder() { + this(new MusicVideoInfoRemoteSearchQuery()); + } + + protected Builder(MusicVideoInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public MusicVideoInfoRemoteSearchQuery.Builder searchInfo(MusicVideoInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public MusicVideoInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public MusicVideoInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public MusicVideoInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built MusicVideoInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public MusicVideoInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MusicVideoInfoRemoteSearchQuery.Builder builder() { + return new MusicVideoInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MusicVideoInfoRemoteSearchQuery.Builder toBuilder() { + return new MusicVideoInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NameGuidPair.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NameGuidPair.java new file mode 100644 index 0000000000000..dde6c3bc3ec47 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NameGuidPair.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * NameGuidPair + */ +@JsonPropertyOrder({ NameGuidPair.JSON_PROPERTY_NAME, NameGuidPair.JSON_PROPERTY_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NameGuidPair { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public NameGuidPair() { + } + + public NameGuidPair name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public NameGuidPair id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + /** + * Return true if this NameGuidPair object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NameGuidPair nameGuidPair = (NameGuidPair) o; + return Objects.equals(this.name, nameGuidPair.name) && Objects.equals(this.id, nameGuidPair.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NameGuidPair {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NameGuidPair instance; + + public Builder() { + this(new NameGuidPair()); + } + + protected Builder(NameGuidPair instance) { + this.instance = instance; + } + + public NameGuidPair.Builder name(String name) { + this.instance.name = name; + return this; + } + + public NameGuidPair.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + /** + * returns a built NameGuidPair instance. + * + * The builder is not reusable. + */ + public NameGuidPair build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NameGuidPair.Builder builder() { + return new NameGuidPair.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NameGuidPair.Builder toBuilder() { + return new NameGuidPair.Builder().name(getName()).id(getId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NameIdPair.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NameIdPair.java new file mode 100644 index 0000000000000..814ddf4fc9fe7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NameIdPair.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * NameIdPair + */ +@JsonPropertyOrder({ NameIdPair.JSON_PROPERTY_NAME, NameIdPair.JSON_PROPERTY_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NameIdPair { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public NameIdPair() { + } + + public NameIdPair name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public NameIdPair id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the identifier. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + /** + * Return true if this NameIdPair object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NameIdPair nameIdPair = (NameIdPair) o; + return Objects.equals(this.name, nameIdPair.name) && Objects.equals(this.id, nameIdPair.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NameIdPair {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NameIdPair instance; + + public Builder() { + this(new NameIdPair()); + } + + protected Builder(NameIdPair instance) { + this.instance = instance; + } + + public NameIdPair.Builder name(String name) { + this.instance.name = name; + return this; + } + + public NameIdPair.Builder id(String id) { + this.instance.id = id; + return this; + } + + /** + * returns a built NameIdPair instance. + * + * The builder is not reusable. + */ + public NameIdPair build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NameIdPair.Builder builder() { + return new NameIdPair.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NameIdPair.Builder toBuilder() { + return new NameIdPair.Builder().name(getName()).id(getId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NameValuePair.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NameValuePair.java new file mode 100644 index 0000000000000..29569ab8c3e91 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NameValuePair.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * NameValuePair + */ +@JsonPropertyOrder({ NameValuePair.JSON_PROPERTY_NAME, NameValuePair.JSON_PROPERTY_VALUE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NameValuePair { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_VALUE = "Value"; + @org.eclipse.jdt.annotation.NonNull + private String value; + + public NameValuePair() { + } + + public NameValuePair name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public NameValuePair value(@org.eclipse.jdt.annotation.NonNull String value) { + this.value = value; + return this; + } + + /** + * Gets or sets the value. + * + * @return value + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@org.eclipse.jdt.annotation.NonNull String value) { + this.value = value; + } + + /** + * Return true if this NameValuePair object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NameValuePair nameValuePair = (NameValuePair) o; + return Objects.equals(this.name, nameValuePair.name) && Objects.equals(this.value, nameValuePair.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NameValuePair {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Value` to the URL query string + if (getValue() != null) { + joiner.add(String.format("%sValue%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getValue())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NameValuePair instance; + + public Builder() { + this(new NameValuePair()); + } + + protected Builder(NameValuePair instance) { + this.instance = instance; + } + + public NameValuePair.Builder name(String name) { + this.instance.name = name; + return this; + } + + public NameValuePair.Builder value(String value) { + this.instance.value = value; + return this; + } + + /** + * returns a built NameValuePair instance. + * + * The builder is not reusable. + */ + public NameValuePair build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NameValuePair.Builder builder() { + return new NameValuePair.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NameValuePair.Builder toBuilder() { + return new NameValuePair.Builder().name(getName()).value(getValue()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NetworkConfiguration.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NetworkConfiguration.java new file mode 100644 index 0000000000000..c265bcf23ab92 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NetworkConfiguration.java @@ -0,0 +1,1188 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines the MediaBrowser.Common.Net.NetworkConfiguration. + */ +@JsonPropertyOrder({ NetworkConfiguration.JSON_PROPERTY_BASE_URL, NetworkConfiguration.JSON_PROPERTY_ENABLE_HTTPS, + NetworkConfiguration.JSON_PROPERTY_REQUIRE_HTTPS, NetworkConfiguration.JSON_PROPERTY_CERTIFICATE_PATH, + NetworkConfiguration.JSON_PROPERTY_CERTIFICATE_PASSWORD, NetworkConfiguration.JSON_PROPERTY_INTERNAL_HTTP_PORT, + NetworkConfiguration.JSON_PROPERTY_INTERNAL_HTTPS_PORT, NetworkConfiguration.JSON_PROPERTY_PUBLIC_HTTP_PORT, + NetworkConfiguration.JSON_PROPERTY_PUBLIC_HTTPS_PORT, NetworkConfiguration.JSON_PROPERTY_AUTO_DISCOVERY, + NetworkConfiguration.JSON_PROPERTY_ENABLE_U_PN_P, NetworkConfiguration.JSON_PROPERTY_ENABLE_I_PV4, + NetworkConfiguration.JSON_PROPERTY_ENABLE_I_PV6, NetworkConfiguration.JSON_PROPERTY_ENABLE_REMOTE_ACCESS, + NetworkConfiguration.JSON_PROPERTY_LOCAL_NETWORK_SUBNETS, + NetworkConfiguration.JSON_PROPERTY_LOCAL_NETWORK_ADDRESSES, NetworkConfiguration.JSON_PROPERTY_KNOWN_PROXIES, + NetworkConfiguration.JSON_PROPERTY_IGNORE_VIRTUAL_INTERFACES, + NetworkConfiguration.JSON_PROPERTY_VIRTUAL_INTERFACE_NAMES, + NetworkConfiguration.JSON_PROPERTY_ENABLE_PUBLISHED_SERVER_URI_BY_REQUEST, + NetworkConfiguration.JSON_PROPERTY_PUBLISHED_SERVER_URI_BY_SUBNET, + NetworkConfiguration.JSON_PROPERTY_REMOTE_I_P_FILTER, + NetworkConfiguration.JSON_PROPERTY_IS_REMOTE_I_P_FILTER_BLACKLIST }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NetworkConfiguration { + public static final String JSON_PROPERTY_BASE_URL = "BaseUrl"; + @org.eclipse.jdt.annotation.NonNull + private String baseUrl; + + public static final String JSON_PROPERTY_ENABLE_HTTPS = "EnableHttps"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableHttps; + + public static final String JSON_PROPERTY_REQUIRE_HTTPS = "RequireHttps"; + @org.eclipse.jdt.annotation.NonNull + private Boolean requireHttps; + + public static final String JSON_PROPERTY_CERTIFICATE_PATH = "CertificatePath"; + @org.eclipse.jdt.annotation.NonNull + private String certificatePath; + + public static final String JSON_PROPERTY_CERTIFICATE_PASSWORD = "CertificatePassword"; + @org.eclipse.jdt.annotation.NonNull + private String certificatePassword; + + public static final String JSON_PROPERTY_INTERNAL_HTTP_PORT = "InternalHttpPort"; + @org.eclipse.jdt.annotation.NonNull + private Integer internalHttpPort; + + public static final String JSON_PROPERTY_INTERNAL_HTTPS_PORT = "InternalHttpsPort"; + @org.eclipse.jdt.annotation.NonNull + private Integer internalHttpsPort; + + public static final String JSON_PROPERTY_PUBLIC_HTTP_PORT = "PublicHttpPort"; + @org.eclipse.jdt.annotation.NonNull + private Integer publicHttpPort; + + public static final String JSON_PROPERTY_PUBLIC_HTTPS_PORT = "PublicHttpsPort"; + @org.eclipse.jdt.annotation.NonNull + private Integer publicHttpsPort; + + public static final String JSON_PROPERTY_AUTO_DISCOVERY = "AutoDiscovery"; + @org.eclipse.jdt.annotation.NonNull + private Boolean autoDiscovery; + + public static final String JSON_PROPERTY_ENABLE_U_PN_P = "EnableUPnP"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableUPnP; + + public static final String JSON_PROPERTY_ENABLE_I_PV4 = "EnableIPv4"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableIPv4; + + public static final String JSON_PROPERTY_ENABLE_I_PV6 = "EnableIPv6"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableIPv6; + + public static final String JSON_PROPERTY_ENABLE_REMOTE_ACCESS = "EnableRemoteAccess"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableRemoteAccess; + + public static final String JSON_PROPERTY_LOCAL_NETWORK_SUBNETS = "LocalNetworkSubnets"; + @org.eclipse.jdt.annotation.NonNull + private List localNetworkSubnets = new ArrayList<>(); + + public static final String JSON_PROPERTY_LOCAL_NETWORK_ADDRESSES = "LocalNetworkAddresses"; + @org.eclipse.jdt.annotation.NonNull + private List localNetworkAddresses = new ArrayList<>(); + + public static final String JSON_PROPERTY_KNOWN_PROXIES = "KnownProxies"; + @org.eclipse.jdt.annotation.NonNull + private List knownProxies = new ArrayList<>(); + + public static final String JSON_PROPERTY_IGNORE_VIRTUAL_INTERFACES = "IgnoreVirtualInterfaces"; + @org.eclipse.jdt.annotation.NonNull + private Boolean ignoreVirtualInterfaces; + + public static final String JSON_PROPERTY_VIRTUAL_INTERFACE_NAMES = "VirtualInterfaceNames"; + @org.eclipse.jdt.annotation.NonNull + private List virtualInterfaceNames = new ArrayList<>(); + + public static final String JSON_PROPERTY_ENABLE_PUBLISHED_SERVER_URI_BY_REQUEST = "EnablePublishedServerUriByRequest"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enablePublishedServerUriByRequest; + + public static final String JSON_PROPERTY_PUBLISHED_SERVER_URI_BY_SUBNET = "PublishedServerUriBySubnet"; + @org.eclipse.jdt.annotation.NonNull + private List publishedServerUriBySubnet = new ArrayList<>(); + + public static final String JSON_PROPERTY_REMOTE_I_P_FILTER = "RemoteIPFilter"; + @org.eclipse.jdt.annotation.NonNull + private List remoteIPFilter = new ArrayList<>(); + + public static final String JSON_PROPERTY_IS_REMOTE_I_P_FILTER_BLACKLIST = "IsRemoteIPFilterBlacklist"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isRemoteIPFilterBlacklist; + + public NetworkConfiguration() { + } + + public NetworkConfiguration baseUrl(@org.eclipse.jdt.annotation.NonNull String baseUrl) { + this.baseUrl = baseUrl; + return this; + } + + /** + * Gets or sets a value used to specify the URL prefix that your Jellyfin instance can be accessed at. + * + * @return baseUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BASE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaseUrl() { + return baseUrl; + } + + @JsonProperty(JSON_PROPERTY_BASE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBaseUrl(@org.eclipse.jdt.annotation.NonNull String baseUrl) { + this.baseUrl = baseUrl; + } + + public NetworkConfiguration enableHttps(@org.eclipse.jdt.annotation.NonNull Boolean enableHttps) { + this.enableHttps = enableHttps; + return this; + } + + /** + * Gets or sets a value indicating whether to use HTTPS. + * + * @return enableHttps + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_HTTPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableHttps() { + return enableHttps; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_HTTPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableHttps(@org.eclipse.jdt.annotation.NonNull Boolean enableHttps) { + this.enableHttps = enableHttps; + } + + public NetworkConfiguration requireHttps(@org.eclipse.jdt.annotation.NonNull Boolean requireHttps) { + this.requireHttps = requireHttps; + return this; + } + + /** + * Gets or sets a value indicating whether the server should force connections over HTTPS. + * + * @return requireHttps + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUIRE_HTTPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequireHttps() { + return requireHttps; + } + + @JsonProperty(JSON_PROPERTY_REQUIRE_HTTPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequireHttps(@org.eclipse.jdt.annotation.NonNull Boolean requireHttps) { + this.requireHttps = requireHttps; + } + + public NetworkConfiguration certificatePath(@org.eclipse.jdt.annotation.NonNull String certificatePath) { + this.certificatePath = certificatePath; + return this; + } + + /** + * Gets or sets the filesystem path of an X.509 certificate to use for SSL. + * + * @return certificatePath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CERTIFICATE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCertificatePath() { + return certificatePath; + } + + @JsonProperty(JSON_PROPERTY_CERTIFICATE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCertificatePath(@org.eclipse.jdt.annotation.NonNull String certificatePath) { + this.certificatePath = certificatePath; + } + + public NetworkConfiguration certificatePassword(@org.eclipse.jdt.annotation.NonNull String certificatePassword) { + this.certificatePassword = certificatePassword; + return this; + } + + /** + * Gets or sets the password required to access the X.509 certificate data in the file specified by + * MediaBrowser.Common.Net.NetworkConfiguration.CertificatePath. + * + * @return certificatePassword + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CERTIFICATE_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCertificatePassword() { + return certificatePassword; + } + + @JsonProperty(JSON_PROPERTY_CERTIFICATE_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCertificatePassword(@org.eclipse.jdt.annotation.NonNull String certificatePassword) { + this.certificatePassword = certificatePassword; + } + + public NetworkConfiguration internalHttpPort(@org.eclipse.jdt.annotation.NonNull Integer internalHttpPort) { + this.internalHttpPort = internalHttpPort; + return this; + } + + /** + * Gets or sets the internal HTTP server port. + * + * @return internalHttpPort + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INTERNAL_HTTP_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInternalHttpPort() { + return internalHttpPort; + } + + @JsonProperty(JSON_PROPERTY_INTERNAL_HTTP_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInternalHttpPort(@org.eclipse.jdt.annotation.NonNull Integer internalHttpPort) { + this.internalHttpPort = internalHttpPort; + } + + public NetworkConfiguration internalHttpsPort(@org.eclipse.jdt.annotation.NonNull Integer internalHttpsPort) { + this.internalHttpsPort = internalHttpsPort; + return this; + } + + /** + * Gets or sets the internal HTTPS server port. + * + * @return internalHttpsPort + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INTERNAL_HTTPS_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInternalHttpsPort() { + return internalHttpsPort; + } + + @JsonProperty(JSON_PROPERTY_INTERNAL_HTTPS_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInternalHttpsPort(@org.eclipse.jdt.annotation.NonNull Integer internalHttpsPort) { + this.internalHttpsPort = internalHttpsPort; + } + + public NetworkConfiguration publicHttpPort(@org.eclipse.jdt.annotation.NonNull Integer publicHttpPort) { + this.publicHttpPort = publicHttpPort; + return this; + } + + /** + * Gets or sets the public HTTP port. + * + * @return publicHttpPort + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PUBLIC_HTTP_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPublicHttpPort() { + return publicHttpPort; + } + + @JsonProperty(JSON_PROPERTY_PUBLIC_HTTP_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPublicHttpPort(@org.eclipse.jdt.annotation.NonNull Integer publicHttpPort) { + this.publicHttpPort = publicHttpPort; + } + + public NetworkConfiguration publicHttpsPort(@org.eclipse.jdt.annotation.NonNull Integer publicHttpsPort) { + this.publicHttpsPort = publicHttpsPort; + return this; + } + + /** + * Gets or sets the public HTTPS port. + * + * @return publicHttpsPort + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PUBLIC_HTTPS_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPublicHttpsPort() { + return publicHttpsPort; + } + + @JsonProperty(JSON_PROPERTY_PUBLIC_HTTPS_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPublicHttpsPort(@org.eclipse.jdt.annotation.NonNull Integer publicHttpsPort) { + this.publicHttpsPort = publicHttpsPort; + } + + public NetworkConfiguration autoDiscovery(@org.eclipse.jdt.annotation.NonNull Boolean autoDiscovery) { + this.autoDiscovery = autoDiscovery; + return this; + } + + /** + * Gets or sets a value indicating whether Autodiscovery is enabled. + * + * @return autoDiscovery + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTO_DISCOVERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAutoDiscovery() { + return autoDiscovery; + } + + @JsonProperty(JSON_PROPERTY_AUTO_DISCOVERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAutoDiscovery(@org.eclipse.jdt.annotation.NonNull Boolean autoDiscovery) { + this.autoDiscovery = autoDiscovery; + } + + public NetworkConfiguration enableUPnP(@org.eclipse.jdt.annotation.NonNull Boolean enableUPnP) { + this.enableUPnP = enableUPnP; + return this; + } + + /** + * Gets or sets a value indicating whether to enable automatic port forwarding. + * + * @return enableUPnP + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_U_PN_P) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableUPnP() { + return enableUPnP; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_U_PN_P) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableUPnP(@org.eclipse.jdt.annotation.NonNull Boolean enableUPnP) { + this.enableUPnP = enableUPnP; + } + + public NetworkConfiguration enableIPv4(@org.eclipse.jdt.annotation.NonNull Boolean enableIPv4) { + this.enableIPv4 = enableIPv4; + return this; + } + + /** + * Gets or sets a value indicating whether IPv6 is enabled. + * + * @return enableIPv4 + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_I_PV4) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableIPv4() { + return enableIPv4; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_I_PV4) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableIPv4(@org.eclipse.jdt.annotation.NonNull Boolean enableIPv4) { + this.enableIPv4 = enableIPv4; + } + + public NetworkConfiguration enableIPv6(@org.eclipse.jdt.annotation.NonNull Boolean enableIPv6) { + this.enableIPv6 = enableIPv6; + return this; + } + + /** + * Gets or sets a value indicating whether IPv6 is enabled. + * + * @return enableIPv6 + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_I_PV6) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableIPv6() { + return enableIPv6; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_I_PV6) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableIPv6(@org.eclipse.jdt.annotation.NonNull Boolean enableIPv6) { + this.enableIPv6 = enableIPv6; + } + + public NetworkConfiguration enableRemoteAccess(@org.eclipse.jdt.annotation.NonNull Boolean enableRemoteAccess) { + this.enableRemoteAccess = enableRemoteAccess; + return this; + } + + /** + * Gets or sets a value indicating whether access from outside of the LAN is permitted. + * + * @return enableRemoteAccess + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_REMOTE_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableRemoteAccess() { + return enableRemoteAccess; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_REMOTE_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableRemoteAccess(@org.eclipse.jdt.annotation.NonNull Boolean enableRemoteAccess) { + this.enableRemoteAccess = enableRemoteAccess; + } + + public NetworkConfiguration localNetworkSubnets( + @org.eclipse.jdt.annotation.NonNull List localNetworkSubnets) { + this.localNetworkSubnets = localNetworkSubnets; + return this; + } + + public NetworkConfiguration addLocalNetworkSubnetsItem(String localNetworkSubnetsItem) { + if (this.localNetworkSubnets == null) { + this.localNetworkSubnets = new ArrayList<>(); + } + this.localNetworkSubnets.add(localNetworkSubnetsItem); + return this; + } + + /** + * Gets or sets the subnets that are deemed to make up the LAN. + * + * @return localNetworkSubnets + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCAL_NETWORK_SUBNETS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLocalNetworkSubnets() { + return localNetworkSubnets; + } + + @JsonProperty(JSON_PROPERTY_LOCAL_NETWORK_SUBNETS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalNetworkSubnets(@org.eclipse.jdt.annotation.NonNull List localNetworkSubnets) { + this.localNetworkSubnets = localNetworkSubnets; + } + + public NetworkConfiguration localNetworkAddresses( + @org.eclipse.jdt.annotation.NonNull List localNetworkAddresses) { + this.localNetworkAddresses = localNetworkAddresses; + return this; + } + + public NetworkConfiguration addLocalNetworkAddressesItem(String localNetworkAddressesItem) { + if (this.localNetworkAddresses == null) { + this.localNetworkAddresses = new ArrayList<>(); + } + this.localNetworkAddresses.add(localNetworkAddressesItem); + return this; + } + + /** + * Gets or sets the interface addresses which Jellyfin will bind to. If empty, all interfaces will be used. + * + * @return localNetworkAddresses + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCAL_NETWORK_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLocalNetworkAddresses() { + return localNetworkAddresses; + } + + @JsonProperty(JSON_PROPERTY_LOCAL_NETWORK_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalNetworkAddresses(@org.eclipse.jdt.annotation.NonNull List localNetworkAddresses) { + this.localNetworkAddresses = localNetworkAddresses; + } + + public NetworkConfiguration knownProxies(@org.eclipse.jdt.annotation.NonNull List knownProxies) { + this.knownProxies = knownProxies; + return this; + } + + public NetworkConfiguration addKnownProxiesItem(String knownProxiesItem) { + if (this.knownProxies == null) { + this.knownProxies = new ArrayList<>(); + } + this.knownProxies.add(knownProxiesItem); + return this; + } + + /** + * Gets or sets the known proxies. + * + * @return knownProxies + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KNOWN_PROXIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getKnownProxies() { + return knownProxies; + } + + @JsonProperty(JSON_PROPERTY_KNOWN_PROXIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKnownProxies(@org.eclipse.jdt.annotation.NonNull List knownProxies) { + this.knownProxies = knownProxies; + } + + public NetworkConfiguration ignoreVirtualInterfaces( + @org.eclipse.jdt.annotation.NonNull Boolean ignoreVirtualInterfaces) { + this.ignoreVirtualInterfaces = ignoreVirtualInterfaces; + return this; + } + + /** + * Gets or sets a value indicating whether address names that match + * MediaBrowser.Common.Net.NetworkConfiguration.VirtualInterfaceNames should be ignored for the purposes of binding. + * + * @return ignoreVirtualInterfaces + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IGNORE_VIRTUAL_INTERFACES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIgnoreVirtualInterfaces() { + return ignoreVirtualInterfaces; + } + + @JsonProperty(JSON_PROPERTY_IGNORE_VIRTUAL_INTERFACES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIgnoreVirtualInterfaces(@org.eclipse.jdt.annotation.NonNull Boolean ignoreVirtualInterfaces) { + this.ignoreVirtualInterfaces = ignoreVirtualInterfaces; + } + + public NetworkConfiguration virtualInterfaceNames( + @org.eclipse.jdt.annotation.NonNull List virtualInterfaceNames) { + this.virtualInterfaceNames = virtualInterfaceNames; + return this; + } + + public NetworkConfiguration addVirtualInterfaceNamesItem(String virtualInterfaceNamesItem) { + if (this.virtualInterfaceNames == null) { + this.virtualInterfaceNames = new ArrayList<>(); + } + this.virtualInterfaceNames.add(virtualInterfaceNamesItem); + return this; + } + + /** + * Gets or sets a value indicating the interface name prefixes that should be ignored. The list can be comma + * separated and values are case-insensitive. <seealso + * cref=\"P:MediaBrowser.Common.Net.NetworkConfiguration.IgnoreVirtualInterfaces\" />. + * + * @return virtualInterfaceNames + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIRTUAL_INTERFACE_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getVirtualInterfaceNames() { + return virtualInterfaceNames; + } + + @JsonProperty(JSON_PROPERTY_VIRTUAL_INTERFACE_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVirtualInterfaceNames(@org.eclipse.jdt.annotation.NonNull List virtualInterfaceNames) { + this.virtualInterfaceNames = virtualInterfaceNames; + } + + public NetworkConfiguration enablePublishedServerUriByRequest( + @org.eclipse.jdt.annotation.NonNull Boolean enablePublishedServerUriByRequest) { + this.enablePublishedServerUriByRequest = enablePublishedServerUriByRequest; + return this; + } + + /** + * Gets or sets a value indicating whether the published server uri is based on information in HTTP requests. + * + * @return enablePublishedServerUriByRequest + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_PUBLISHED_SERVER_URI_BY_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnablePublishedServerUriByRequest() { + return enablePublishedServerUriByRequest; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_PUBLISHED_SERVER_URI_BY_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnablePublishedServerUriByRequest( + @org.eclipse.jdt.annotation.NonNull Boolean enablePublishedServerUriByRequest) { + this.enablePublishedServerUriByRequest = enablePublishedServerUriByRequest; + } + + public NetworkConfiguration publishedServerUriBySubnet( + @org.eclipse.jdt.annotation.NonNull List publishedServerUriBySubnet) { + this.publishedServerUriBySubnet = publishedServerUriBySubnet; + return this; + } + + public NetworkConfiguration addPublishedServerUriBySubnetItem(String publishedServerUriBySubnetItem) { + if (this.publishedServerUriBySubnet == null) { + this.publishedServerUriBySubnet = new ArrayList<>(); + } + this.publishedServerUriBySubnet.add(publishedServerUriBySubnetItem); + return this; + } + + /** + * Gets or sets the PublishedServerUriBySubnet Gets or sets PublishedServerUri to advertise for specific subnets. + * + * @return publishedServerUriBySubnet + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PUBLISHED_SERVER_URI_BY_SUBNET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPublishedServerUriBySubnet() { + return publishedServerUriBySubnet; + } + + @JsonProperty(JSON_PROPERTY_PUBLISHED_SERVER_URI_BY_SUBNET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPublishedServerUriBySubnet( + @org.eclipse.jdt.annotation.NonNull List publishedServerUriBySubnet) { + this.publishedServerUriBySubnet = publishedServerUriBySubnet; + } + + public NetworkConfiguration remoteIPFilter(@org.eclipse.jdt.annotation.NonNull List remoteIPFilter) { + this.remoteIPFilter = remoteIPFilter; + return this; + } + + public NetworkConfiguration addRemoteIPFilterItem(String remoteIPFilterItem) { + if (this.remoteIPFilter == null) { + this.remoteIPFilter = new ArrayList<>(); + } + this.remoteIPFilter.add(remoteIPFilterItem); + return this; + } + + /** + * Gets or sets the filter for remote IP connectivity. Used in conjunction with <seealso + * cref=\"P:MediaBrowser.Common.Net.NetworkConfiguration.IsRemoteIPFilterBlacklist\" />. + * + * @return remoteIPFilter + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMOTE_I_P_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRemoteIPFilter() { + return remoteIPFilter; + } + + @JsonProperty(JSON_PROPERTY_REMOTE_I_P_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemoteIPFilter(@org.eclipse.jdt.annotation.NonNull List remoteIPFilter) { + this.remoteIPFilter = remoteIPFilter; + } + + public NetworkConfiguration isRemoteIPFilterBlacklist( + @org.eclipse.jdt.annotation.NonNull Boolean isRemoteIPFilterBlacklist) { + this.isRemoteIPFilterBlacklist = isRemoteIPFilterBlacklist; + return this; + } + + /** + * Gets or sets a value indicating whether <seealso + * cref=\"P:MediaBrowser.Common.Net.NetworkConfiguration.RemoteIPFilter\" /> contains a blacklist + * or a whitelist. Default is a whitelist. + * + * @return isRemoteIPFilterBlacklist + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_REMOTE_I_P_FILTER_BLACKLIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsRemoteIPFilterBlacklist() { + return isRemoteIPFilterBlacklist; + } + + @JsonProperty(JSON_PROPERTY_IS_REMOTE_I_P_FILTER_BLACKLIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsRemoteIPFilterBlacklist(@org.eclipse.jdt.annotation.NonNull Boolean isRemoteIPFilterBlacklist) { + this.isRemoteIPFilterBlacklist = isRemoteIPFilterBlacklist; + } + + /** + * Return true if this NetworkConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NetworkConfiguration networkConfiguration = (NetworkConfiguration) o; + return Objects.equals(this.baseUrl, networkConfiguration.baseUrl) + && Objects.equals(this.enableHttps, networkConfiguration.enableHttps) + && Objects.equals(this.requireHttps, networkConfiguration.requireHttps) + && Objects.equals(this.certificatePath, networkConfiguration.certificatePath) + && Objects.equals(this.certificatePassword, networkConfiguration.certificatePassword) + && Objects.equals(this.internalHttpPort, networkConfiguration.internalHttpPort) + && Objects.equals(this.internalHttpsPort, networkConfiguration.internalHttpsPort) + && Objects.equals(this.publicHttpPort, networkConfiguration.publicHttpPort) + && Objects.equals(this.publicHttpsPort, networkConfiguration.publicHttpsPort) + && Objects.equals(this.autoDiscovery, networkConfiguration.autoDiscovery) + && Objects.equals(this.enableUPnP, networkConfiguration.enableUPnP) + && Objects.equals(this.enableIPv4, networkConfiguration.enableIPv4) + && Objects.equals(this.enableIPv6, networkConfiguration.enableIPv6) + && Objects.equals(this.enableRemoteAccess, networkConfiguration.enableRemoteAccess) + && Objects.equals(this.localNetworkSubnets, networkConfiguration.localNetworkSubnets) + && Objects.equals(this.localNetworkAddresses, networkConfiguration.localNetworkAddresses) + && Objects.equals(this.knownProxies, networkConfiguration.knownProxies) + && Objects.equals(this.ignoreVirtualInterfaces, networkConfiguration.ignoreVirtualInterfaces) + && Objects.equals(this.virtualInterfaceNames, networkConfiguration.virtualInterfaceNames) + && Objects.equals(this.enablePublishedServerUriByRequest, + networkConfiguration.enablePublishedServerUriByRequest) + && Objects.equals(this.publishedServerUriBySubnet, networkConfiguration.publishedServerUriBySubnet) + && Objects.equals(this.remoteIPFilter, networkConfiguration.remoteIPFilter) + && Objects.equals(this.isRemoteIPFilterBlacklist, networkConfiguration.isRemoteIPFilterBlacklist); + } + + @Override + public int hashCode() { + return Objects.hash(baseUrl, enableHttps, requireHttps, certificatePath, certificatePassword, internalHttpPort, + internalHttpsPort, publicHttpPort, publicHttpsPort, autoDiscovery, enableUPnP, enableIPv4, enableIPv6, + enableRemoteAccess, localNetworkSubnets, localNetworkAddresses, knownProxies, ignoreVirtualInterfaces, + virtualInterfaceNames, enablePublishedServerUriByRequest, publishedServerUriBySubnet, remoteIPFilter, + isRemoteIPFilterBlacklist); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NetworkConfiguration {\n"); + sb.append(" baseUrl: ").append(toIndentedString(baseUrl)).append("\n"); + sb.append(" enableHttps: ").append(toIndentedString(enableHttps)).append("\n"); + sb.append(" requireHttps: ").append(toIndentedString(requireHttps)).append("\n"); + sb.append(" certificatePath: ").append(toIndentedString(certificatePath)).append("\n"); + sb.append(" certificatePassword: ").append(toIndentedString(certificatePassword)).append("\n"); + sb.append(" internalHttpPort: ").append(toIndentedString(internalHttpPort)).append("\n"); + sb.append(" internalHttpsPort: ").append(toIndentedString(internalHttpsPort)).append("\n"); + sb.append(" publicHttpPort: ").append(toIndentedString(publicHttpPort)).append("\n"); + sb.append(" publicHttpsPort: ").append(toIndentedString(publicHttpsPort)).append("\n"); + sb.append(" autoDiscovery: ").append(toIndentedString(autoDiscovery)).append("\n"); + sb.append(" enableUPnP: ").append(toIndentedString(enableUPnP)).append("\n"); + sb.append(" enableIPv4: ").append(toIndentedString(enableIPv4)).append("\n"); + sb.append(" enableIPv6: ").append(toIndentedString(enableIPv6)).append("\n"); + sb.append(" enableRemoteAccess: ").append(toIndentedString(enableRemoteAccess)).append("\n"); + sb.append(" localNetworkSubnets: ").append(toIndentedString(localNetworkSubnets)).append("\n"); + sb.append(" localNetworkAddresses: ").append(toIndentedString(localNetworkAddresses)).append("\n"); + sb.append(" knownProxies: ").append(toIndentedString(knownProxies)).append("\n"); + sb.append(" ignoreVirtualInterfaces: ").append(toIndentedString(ignoreVirtualInterfaces)).append("\n"); + sb.append(" virtualInterfaceNames: ").append(toIndentedString(virtualInterfaceNames)).append("\n"); + sb.append(" enablePublishedServerUriByRequest: ").append(toIndentedString(enablePublishedServerUriByRequest)) + .append("\n"); + sb.append(" publishedServerUriBySubnet: ").append(toIndentedString(publishedServerUriBySubnet)).append("\n"); + sb.append(" remoteIPFilter: ").append(toIndentedString(remoteIPFilter)).append("\n"); + sb.append(" isRemoteIPFilterBlacklist: ").append(toIndentedString(isRemoteIPFilterBlacklist)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `BaseUrl` to the URL query string + if (getBaseUrl() != null) { + joiner.add(String.format("%sBaseUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBaseUrl())))); + } + + // add `EnableHttps` to the URL query string + if (getEnableHttps() != null) { + joiner.add(String.format("%sEnableHttps%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableHttps())))); + } + + // add `RequireHttps` to the URL query string + if (getRequireHttps() != null) { + joiner.add(String.format("%sRequireHttps%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRequireHttps())))); + } + + // add `CertificatePath` to the URL query string + if (getCertificatePath() != null) { + joiner.add(String.format("%sCertificatePath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCertificatePath())))); + } + + // add `CertificatePassword` to the URL query string + if (getCertificatePassword() != null) { + joiner.add(String.format("%sCertificatePassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCertificatePassword())))); + } + + // add `InternalHttpPort` to the URL query string + if (getInternalHttpPort() != null) { + joiner.add(String.format("%sInternalHttpPort%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getInternalHttpPort())))); + } + + // add `InternalHttpsPort` to the URL query string + if (getInternalHttpsPort() != null) { + joiner.add(String.format("%sInternalHttpsPort%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getInternalHttpsPort())))); + } + + // add `PublicHttpPort` to the URL query string + if (getPublicHttpPort() != null) { + joiner.add(String.format("%sPublicHttpPort%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPublicHttpPort())))); + } + + // add `PublicHttpsPort` to the URL query string + if (getPublicHttpsPort() != null) { + joiner.add(String.format("%sPublicHttpsPort%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPublicHttpsPort())))); + } + + // add `AutoDiscovery` to the URL query string + if (getAutoDiscovery() != null) { + joiner.add(String.format("%sAutoDiscovery%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAutoDiscovery())))); + } + + // add `EnableUPnP` to the URL query string + if (getEnableUPnP() != null) { + joiner.add(String.format("%sEnableUPnP%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableUPnP())))); + } + + // add `EnableIPv4` to the URL query string + if (getEnableIPv4() != null) { + joiner.add(String.format("%sEnableIPv4%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableIPv4())))); + } + + // add `EnableIPv6` to the URL query string + if (getEnableIPv6() != null) { + joiner.add(String.format("%sEnableIPv6%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableIPv6())))); + } + + // add `EnableRemoteAccess` to the URL query string + if (getEnableRemoteAccess() != null) { + joiner.add(String.format("%sEnableRemoteAccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableRemoteAccess())))); + } + + // add `LocalNetworkSubnets` to the URL query string + if (getLocalNetworkSubnets() != null) { + for (int i = 0; i < getLocalNetworkSubnets().size(); i++) { + joiner.add(String.format("%sLocalNetworkSubnets%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLocalNetworkSubnets().get(i))))); + } + } + + // add `LocalNetworkAddresses` to the URL query string + if (getLocalNetworkAddresses() != null) { + for (int i = 0; i < getLocalNetworkAddresses().size(); i++) { + joiner.add(String.format("%sLocalNetworkAddresses%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLocalNetworkAddresses().get(i))))); + } + } + + // add `KnownProxies` to the URL query string + if (getKnownProxies() != null) { + for (int i = 0; i < getKnownProxies().size(); i++) { + joiner.add(String.format("%sKnownProxies%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getKnownProxies().get(i))))); + } + } + + // add `IgnoreVirtualInterfaces` to the URL query string + if (getIgnoreVirtualInterfaces() != null) { + joiner.add(String.format("%sIgnoreVirtualInterfaces%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIgnoreVirtualInterfaces())))); + } + + // add `VirtualInterfaceNames` to the URL query string + if (getVirtualInterfaceNames() != null) { + for (int i = 0; i < getVirtualInterfaceNames().size(); i++) { + joiner.add(String.format("%sVirtualInterfaceNames%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getVirtualInterfaceNames().get(i))))); + } + } + + // add `EnablePublishedServerUriByRequest` to the URL query string + if (getEnablePublishedServerUriByRequest() != null) { + joiner.add(String.format("%sEnablePublishedServerUriByRequest%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnablePublishedServerUriByRequest())))); + } + + // add `PublishedServerUriBySubnet` to the URL query string + if (getPublishedServerUriBySubnet() != null) { + for (int i = 0; i < getPublishedServerUriBySubnet().size(); i++) { + joiner.add(String.format("%sPublishedServerUriBySubnet%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getPublishedServerUriBySubnet().get(i))))); + } + } + + // add `RemoteIPFilter` to the URL query string + if (getRemoteIPFilter() != null) { + for (int i = 0; i < getRemoteIPFilter().size(); i++) { + joiner.add(String.format("%sRemoteIPFilter%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getRemoteIPFilter().get(i))))); + } + } + + // add `IsRemoteIPFilterBlacklist` to the URL query string + if (getIsRemoteIPFilterBlacklist() != null) { + joiner.add(String.format("%sIsRemoteIPFilterBlacklist%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsRemoteIPFilterBlacklist())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NetworkConfiguration instance; + + public Builder() { + this(new NetworkConfiguration()); + } + + protected Builder(NetworkConfiguration instance) { + this.instance = instance; + } + + public NetworkConfiguration.Builder baseUrl(String baseUrl) { + this.instance.baseUrl = baseUrl; + return this; + } + + public NetworkConfiguration.Builder enableHttps(Boolean enableHttps) { + this.instance.enableHttps = enableHttps; + return this; + } + + public NetworkConfiguration.Builder requireHttps(Boolean requireHttps) { + this.instance.requireHttps = requireHttps; + return this; + } + + public NetworkConfiguration.Builder certificatePath(String certificatePath) { + this.instance.certificatePath = certificatePath; + return this; + } + + public NetworkConfiguration.Builder certificatePassword(String certificatePassword) { + this.instance.certificatePassword = certificatePassword; + return this; + } + + public NetworkConfiguration.Builder internalHttpPort(Integer internalHttpPort) { + this.instance.internalHttpPort = internalHttpPort; + return this; + } + + public NetworkConfiguration.Builder internalHttpsPort(Integer internalHttpsPort) { + this.instance.internalHttpsPort = internalHttpsPort; + return this; + } + + public NetworkConfiguration.Builder publicHttpPort(Integer publicHttpPort) { + this.instance.publicHttpPort = publicHttpPort; + return this; + } + + public NetworkConfiguration.Builder publicHttpsPort(Integer publicHttpsPort) { + this.instance.publicHttpsPort = publicHttpsPort; + return this; + } + + public NetworkConfiguration.Builder autoDiscovery(Boolean autoDiscovery) { + this.instance.autoDiscovery = autoDiscovery; + return this; + } + + public NetworkConfiguration.Builder enableUPnP(Boolean enableUPnP) { + this.instance.enableUPnP = enableUPnP; + return this; + } + + public NetworkConfiguration.Builder enableIPv4(Boolean enableIPv4) { + this.instance.enableIPv4 = enableIPv4; + return this; + } + + public NetworkConfiguration.Builder enableIPv6(Boolean enableIPv6) { + this.instance.enableIPv6 = enableIPv6; + return this; + } + + public NetworkConfiguration.Builder enableRemoteAccess(Boolean enableRemoteAccess) { + this.instance.enableRemoteAccess = enableRemoteAccess; + return this; + } + + public NetworkConfiguration.Builder localNetworkSubnets(List localNetworkSubnets) { + this.instance.localNetworkSubnets = localNetworkSubnets; + return this; + } + + public NetworkConfiguration.Builder localNetworkAddresses(List localNetworkAddresses) { + this.instance.localNetworkAddresses = localNetworkAddresses; + return this; + } + + public NetworkConfiguration.Builder knownProxies(List knownProxies) { + this.instance.knownProxies = knownProxies; + return this; + } + + public NetworkConfiguration.Builder ignoreVirtualInterfaces(Boolean ignoreVirtualInterfaces) { + this.instance.ignoreVirtualInterfaces = ignoreVirtualInterfaces; + return this; + } + + public NetworkConfiguration.Builder virtualInterfaceNames(List virtualInterfaceNames) { + this.instance.virtualInterfaceNames = virtualInterfaceNames; + return this; + } + + public NetworkConfiguration.Builder enablePublishedServerUriByRequest( + Boolean enablePublishedServerUriByRequest) { + this.instance.enablePublishedServerUriByRequest = enablePublishedServerUriByRequest; + return this; + } + + public NetworkConfiguration.Builder publishedServerUriBySubnet(List publishedServerUriBySubnet) { + this.instance.publishedServerUriBySubnet = publishedServerUriBySubnet; + return this; + } + + public NetworkConfiguration.Builder remoteIPFilter(List remoteIPFilter) { + this.instance.remoteIPFilter = remoteIPFilter; + return this; + } + + public NetworkConfiguration.Builder isRemoteIPFilterBlacklist(Boolean isRemoteIPFilterBlacklist) { + this.instance.isRemoteIPFilterBlacklist = isRemoteIPFilterBlacklist; + return this; + } + + /** + * returns a built NetworkConfiguration instance. + * + * The builder is not reusable. + */ + public NetworkConfiguration build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NetworkConfiguration.Builder builder() { + return new NetworkConfiguration.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NetworkConfiguration.Builder toBuilder() { + return new NetworkConfiguration.Builder().baseUrl(getBaseUrl()).enableHttps(getEnableHttps()) + .requireHttps(getRequireHttps()).certificatePath(getCertificatePath()) + .certificatePassword(getCertificatePassword()).internalHttpPort(getInternalHttpPort()) + .internalHttpsPort(getInternalHttpsPort()).publicHttpPort(getPublicHttpPort()) + .publicHttpsPort(getPublicHttpsPort()).autoDiscovery(getAutoDiscovery()).enableUPnP(getEnableUPnP()) + .enableIPv4(getEnableIPv4()).enableIPv6(getEnableIPv6()).enableRemoteAccess(getEnableRemoteAccess()) + .localNetworkSubnets(getLocalNetworkSubnets()).localNetworkAddresses(getLocalNetworkAddresses()) + .knownProxies(getKnownProxies()).ignoreVirtualInterfaces(getIgnoreVirtualInterfaces()) + .virtualInterfaceNames(getVirtualInterfaceNames()) + .enablePublishedServerUriByRequest(getEnablePublishedServerUriByRequest()) + .publishedServerUriBySubnet(getPublishedServerUriBySubnet()).remoteIPFilter(getRemoteIPFilter()) + .isRemoteIPFilterBlacklist(getIsRemoteIPFilterBlacklist()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NewGroupRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NewGroupRequestDto.java new file mode 100644 index 0000000000000..9fd4e32ff79ec --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NewGroupRequestDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class NewGroupRequestDto. + */ +@JsonPropertyOrder({ NewGroupRequestDto.JSON_PROPERTY_GROUP_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NewGroupRequestDto { + public static final String JSON_PROPERTY_GROUP_NAME = "GroupName"; + @org.eclipse.jdt.annotation.NonNull + private String groupName; + + public NewGroupRequestDto() { + } + + public NewGroupRequestDto groupName(@org.eclipse.jdt.annotation.NonNull String groupName) { + this.groupName = groupName; + return this; + } + + /** + * Gets or sets the group name. + * + * @return groupName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGroupName() { + return groupName; + } + + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupName(@org.eclipse.jdt.annotation.NonNull String groupName) { + this.groupName = groupName; + } + + /** + * Return true if this NewGroupRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewGroupRequestDto newGroupRequestDto = (NewGroupRequestDto) o; + return Objects.equals(this.groupName, newGroupRequestDto.groupName); + } + + @Override + public int hashCode() { + return Objects.hash(groupName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewGroupRequestDto {\n"); + sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `GroupName` to the URL query string + if (getGroupName() != null) { + joiner.add(String.format("%sGroupName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGroupName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NewGroupRequestDto instance; + + public Builder() { + this(new NewGroupRequestDto()); + } + + protected Builder(NewGroupRequestDto instance) { + this.instance = instance; + } + + public NewGroupRequestDto.Builder groupName(String groupName) { + this.instance.groupName = groupName; + return this; + } + + /** + * returns a built NewGroupRequestDto instance. + * + * The builder is not reusable. + */ + public NewGroupRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NewGroupRequestDto.Builder builder() { + return new NewGroupRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NewGroupRequestDto.Builder toBuilder() { + return new NewGroupRequestDto.Builder().groupName(getGroupName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NextItemRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NextItemRequestDto.java new file mode 100644 index 0000000000000..3756b56441cfa --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/NextItemRequestDto.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class NextItemRequestDto. + */ +@JsonPropertyOrder({ NextItemRequestDto.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NextItemRequestDto { + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID playlistItemId; + + public NextItemRequestDto() { + } + + public NextItemRequestDto playlistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets or sets the playing item identifier. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + } + + /** + * Return true if this NextItemRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NextItemRequestDto nextItemRequestDto = (NextItemRequestDto) o; + return Objects.equals(this.playlistItemId, nextItemRequestDto.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NextItemRequestDto {\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NextItemRequestDto instance; + + public Builder() { + this(new NextItemRequestDto()); + } + + protected Builder(NextItemRequestDto instance) { + this.instance = instance; + } + + public NextItemRequestDto.Builder playlistItemId(UUID playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built NextItemRequestDto instance. + * + * The builder is not reusable. + */ + public NextItemRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NextItemRequestDto.Builder builder() { + return new NextItemRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NextItemRequestDto.Builder toBuilder() { + return new NextItemRequestDto.Builder().playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/OpenLiveStreamDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/OpenLiveStreamDto.java new file mode 100644 index 0000000000000..f1a31998db196 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/OpenLiveStreamDto.java @@ -0,0 +1,755 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Open live stream dto. + */ +@JsonPropertyOrder({ OpenLiveStreamDto.JSON_PROPERTY_OPEN_TOKEN, OpenLiveStreamDto.JSON_PROPERTY_USER_ID, + OpenLiveStreamDto.JSON_PROPERTY_PLAY_SESSION_ID, OpenLiveStreamDto.JSON_PROPERTY_MAX_STREAMING_BITRATE, + OpenLiveStreamDto.JSON_PROPERTY_START_TIME_TICKS, OpenLiveStreamDto.JSON_PROPERTY_AUDIO_STREAM_INDEX, + OpenLiveStreamDto.JSON_PROPERTY_SUBTITLE_STREAM_INDEX, OpenLiveStreamDto.JSON_PROPERTY_MAX_AUDIO_CHANNELS, + OpenLiveStreamDto.JSON_PROPERTY_ITEM_ID, OpenLiveStreamDto.JSON_PROPERTY_ENABLE_DIRECT_PLAY, + OpenLiveStreamDto.JSON_PROPERTY_ENABLE_DIRECT_STREAM, + OpenLiveStreamDto.JSON_PROPERTY_ALWAYS_BURN_IN_SUBTITLE_WHEN_TRANSCODING, + OpenLiveStreamDto.JSON_PROPERTY_DEVICE_PROFILE, OpenLiveStreamDto.JSON_PROPERTY_DIRECT_PLAY_PROTOCOLS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class OpenLiveStreamDto { + public static final String JSON_PROPERTY_OPEN_TOKEN = "OpenToken"; + @org.eclipse.jdt.annotation.NonNull + private String openToken; + + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_PLAY_SESSION_ID = "PlaySessionId"; + @org.eclipse.jdt.annotation.NonNull + private String playSessionId; + + public static final String JSON_PROPERTY_MAX_STREAMING_BITRATE = "MaxStreamingBitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxStreamingBitrate; + + public static final String JSON_PROPERTY_START_TIME_TICKS = "StartTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long startTimeTicks; + + public static final String JSON_PROPERTY_AUDIO_STREAM_INDEX = "AudioStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer audioStreamIndex; + + public static final String JSON_PROPERTY_SUBTITLE_STREAM_INDEX = "SubtitleStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer subtitleStreamIndex; + + public static final String JSON_PROPERTY_MAX_AUDIO_CHANNELS = "MaxAudioChannels"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxAudioChannels; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_ENABLE_DIRECT_PLAY = "EnableDirectPlay"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableDirectPlay; + + public static final String JSON_PROPERTY_ENABLE_DIRECT_STREAM = "EnableDirectStream"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableDirectStream; + + public static final String JSON_PROPERTY_ALWAYS_BURN_IN_SUBTITLE_WHEN_TRANSCODING = "AlwaysBurnInSubtitleWhenTranscoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean alwaysBurnInSubtitleWhenTranscoding; + + public static final String JSON_PROPERTY_DEVICE_PROFILE = "DeviceProfile"; + @org.eclipse.jdt.annotation.NonNull + private DeviceProfile deviceProfile; + + public static final String JSON_PROPERTY_DIRECT_PLAY_PROTOCOLS = "DirectPlayProtocols"; + @org.eclipse.jdt.annotation.NonNull + private List directPlayProtocols = new ArrayList<>(); + + public OpenLiveStreamDto() { + } + + public OpenLiveStreamDto openToken(@org.eclipse.jdt.annotation.NonNull String openToken) { + this.openToken = openToken; + return this; + } + + /** + * Gets or sets the open token. + * + * @return openToken + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OPEN_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOpenToken() { + return openToken; + } + + @JsonProperty(JSON_PROPERTY_OPEN_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpenToken(@org.eclipse.jdt.annotation.NonNull String openToken) { + this.openToken = openToken; + } + + public OpenLiveStreamDto userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the user id. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public OpenLiveStreamDto playSessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + return this; + } + + /** + * Gets or sets the play session id. + * + * @return playSessionId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaySessionId() { + return playSessionId; + } + + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaySessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + } + + public OpenLiveStreamDto maxStreamingBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate) { + this.maxStreamingBitrate = maxStreamingBitrate; + return this; + } + + /** + * Gets or sets the max streaming bitrate. + * + * @return maxStreamingBitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_STREAMING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxStreamingBitrate() { + return maxStreamingBitrate; + } + + @JsonProperty(JSON_PROPERTY_MAX_STREAMING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxStreamingBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate) { + this.maxStreamingBitrate = maxStreamingBitrate; + } + + public OpenLiveStreamDto startTimeTicks(@org.eclipse.jdt.annotation.NonNull Long startTimeTicks) { + this.startTimeTicks = startTimeTicks; + return this; + } + + /** + * Gets or sets the start time in ticks. + * + * @return startTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartTimeTicks() { + return startTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_START_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartTimeTicks(@org.eclipse.jdt.annotation.NonNull Long startTimeTicks) { + this.startTimeTicks = startTimeTicks; + } + + public OpenLiveStreamDto audioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + return this; + } + + /** + * Gets or sets the audio stream index. + * + * @return audioStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAudioStreamIndex() { + return audioStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + } + + public OpenLiveStreamDto subtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + /** + * Gets or sets the subtitle stream index. + * + * @return subtitleStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSubtitleStreamIndex() { + return subtitleStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + } + + public OpenLiveStreamDto maxAudioChannels(@org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels) { + this.maxAudioChannels = maxAudioChannels; + return this; + } + + /** + * Gets or sets the max audio channels. + * + * @return maxAudioChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_AUDIO_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxAudioChannels() { + return maxAudioChannels; + } + + @JsonProperty(JSON_PROPERTY_MAX_AUDIO_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxAudioChannels(@org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels) { + this.maxAudioChannels = maxAudioChannels; + } + + public OpenLiveStreamDto itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item id. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public OpenLiveStreamDto enableDirectPlay(@org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay) { + this.enableDirectPlay = enableDirectPlay; + return this; + } + + /** + * Gets or sets a value indicating whether to enable direct play. + * + * @return enableDirectPlay + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_DIRECT_PLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableDirectPlay() { + return enableDirectPlay; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_DIRECT_PLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableDirectPlay(@org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay) { + this.enableDirectPlay = enableDirectPlay; + } + + public OpenLiveStreamDto enableDirectStream(@org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream) { + this.enableDirectStream = enableDirectStream; + return this; + } + + /** + * Gets or sets a value indicating whether to enale direct stream. + * + * @return enableDirectStream + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_DIRECT_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableDirectStream() { + return enableDirectStream; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_DIRECT_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableDirectStream(@org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream) { + this.enableDirectStream = enableDirectStream; + } + + public OpenLiveStreamDto alwaysBurnInSubtitleWhenTranscoding( + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) { + this.alwaysBurnInSubtitleWhenTranscoding = alwaysBurnInSubtitleWhenTranscoding; + return this; + } + + /** + * Gets or sets a value indicating whether always burn in subtitles when transcoding. + * + * @return alwaysBurnInSubtitleWhenTranscoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALWAYS_BURN_IN_SUBTITLE_WHEN_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAlwaysBurnInSubtitleWhenTranscoding() { + return alwaysBurnInSubtitleWhenTranscoding; + } + + @JsonProperty(JSON_PROPERTY_ALWAYS_BURN_IN_SUBTITLE_WHEN_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlwaysBurnInSubtitleWhenTranscoding( + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) { + this.alwaysBurnInSubtitleWhenTranscoding = alwaysBurnInSubtitleWhenTranscoding; + } + + public OpenLiveStreamDto deviceProfile(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) { + this.deviceProfile = deviceProfile; + return this; + } + + /** + * A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain + * device is able to play. <br /> Specifically, it defines the supported <see + * cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles\">containers</see> and + * <see cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles\">codecs</see> + * (video and/or audio, including codec profiles and levels) the device is able to direct play (without transcoding + * or remuxing), as well as which <see + * cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles\">containers/codecs to + * transcode to</see> in case it isn't. + * + * @return deviceProfile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceProfile getDeviceProfile() { + return deviceProfile; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceProfile(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) { + this.deviceProfile = deviceProfile; + } + + public OpenLiveStreamDto directPlayProtocols( + @org.eclipse.jdt.annotation.NonNull List directPlayProtocols) { + this.directPlayProtocols = directPlayProtocols; + return this; + } + + public OpenLiveStreamDto addDirectPlayProtocolsItem(MediaProtocol directPlayProtocolsItem) { + if (this.directPlayProtocols == null) { + this.directPlayProtocols = new ArrayList<>(); + } + this.directPlayProtocols.add(directPlayProtocolsItem); + return this; + } + + /** + * Gets or sets the device play protocols. + * + * @return directPlayProtocols + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DIRECT_PLAY_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDirectPlayProtocols() { + return directPlayProtocols; + } + + @JsonProperty(JSON_PROPERTY_DIRECT_PLAY_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDirectPlayProtocols(@org.eclipse.jdt.annotation.NonNull List directPlayProtocols) { + this.directPlayProtocols = directPlayProtocols; + } + + /** + * Return true if this OpenLiveStreamDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenLiveStreamDto openLiveStreamDto = (OpenLiveStreamDto) o; + return Objects.equals(this.openToken, openLiveStreamDto.openToken) + && Objects.equals(this.userId, openLiveStreamDto.userId) + && Objects.equals(this.playSessionId, openLiveStreamDto.playSessionId) + && Objects.equals(this.maxStreamingBitrate, openLiveStreamDto.maxStreamingBitrate) + && Objects.equals(this.startTimeTicks, openLiveStreamDto.startTimeTicks) + && Objects.equals(this.audioStreamIndex, openLiveStreamDto.audioStreamIndex) + && Objects.equals(this.subtitleStreamIndex, openLiveStreamDto.subtitleStreamIndex) + && Objects.equals(this.maxAudioChannels, openLiveStreamDto.maxAudioChannels) + && Objects.equals(this.itemId, openLiveStreamDto.itemId) + && Objects.equals(this.enableDirectPlay, openLiveStreamDto.enableDirectPlay) + && Objects.equals(this.enableDirectStream, openLiveStreamDto.enableDirectStream) + && Objects.equals(this.alwaysBurnInSubtitleWhenTranscoding, + openLiveStreamDto.alwaysBurnInSubtitleWhenTranscoding) + && Objects.equals(this.deviceProfile, openLiveStreamDto.deviceProfile) + && Objects.equals(this.directPlayProtocols, openLiveStreamDto.directPlayProtocols); + } + + @Override + public int hashCode() { + return Objects.hash(openToken, userId, playSessionId, maxStreamingBitrate, startTimeTicks, audioStreamIndex, + subtitleStreamIndex, maxAudioChannels, itemId, enableDirectPlay, enableDirectStream, + alwaysBurnInSubtitleWhenTranscoding, deviceProfile, directPlayProtocols); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenLiveStreamDto {\n"); + sb.append(" openToken: ").append(toIndentedString(openToken)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" playSessionId: ").append(toIndentedString(playSessionId)).append("\n"); + sb.append(" maxStreamingBitrate: ").append(toIndentedString(maxStreamingBitrate)).append("\n"); + sb.append(" startTimeTicks: ").append(toIndentedString(startTimeTicks)).append("\n"); + sb.append(" audioStreamIndex: ").append(toIndentedString(audioStreamIndex)).append("\n"); + sb.append(" subtitleStreamIndex: ").append(toIndentedString(subtitleStreamIndex)).append("\n"); + sb.append(" maxAudioChannels: ").append(toIndentedString(maxAudioChannels)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" enableDirectPlay: ").append(toIndentedString(enableDirectPlay)).append("\n"); + sb.append(" enableDirectStream: ").append(toIndentedString(enableDirectStream)).append("\n"); + sb.append(" alwaysBurnInSubtitleWhenTranscoding: ") + .append(toIndentedString(alwaysBurnInSubtitleWhenTranscoding)).append("\n"); + sb.append(" deviceProfile: ").append(toIndentedString(deviceProfile)).append("\n"); + sb.append(" directPlayProtocols: ").append(toIndentedString(directPlayProtocols)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `OpenToken` to the URL query string + if (getOpenToken() != null) { + joiner.add(String.format("%sOpenToken%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOpenToken())))); + } + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `PlaySessionId` to the URL query string + if (getPlaySessionId() != null) { + joiner.add(String.format("%sPlaySessionId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaySessionId())))); + } + + // add `MaxStreamingBitrate` to the URL query string + if (getMaxStreamingBitrate() != null) { + joiner.add(String.format("%sMaxStreamingBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxStreamingBitrate())))); + } + + // add `StartTimeTicks` to the URL query string + if (getStartTimeTicks() != null) { + joiner.add(String.format("%sStartTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartTimeTicks())))); + } + + // add `AudioStreamIndex` to the URL query string + if (getAudioStreamIndex() != null) { + joiner.add(String.format("%sAudioStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioStreamIndex())))); + } + + // add `SubtitleStreamIndex` to the URL query string + if (getSubtitleStreamIndex() != null) { + joiner.add(String.format("%sSubtitleStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleStreamIndex())))); + } + + // add `MaxAudioChannels` to the URL query string + if (getMaxAudioChannels() != null) { + joiner.add(String.format("%sMaxAudioChannels%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxAudioChannels())))); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `EnableDirectPlay` to the URL query string + if (getEnableDirectPlay() != null) { + joiner.add(String.format("%sEnableDirectPlay%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableDirectPlay())))); + } + + // add `EnableDirectStream` to the URL query string + if (getEnableDirectStream() != null) { + joiner.add(String.format("%sEnableDirectStream%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableDirectStream())))); + } + + // add `AlwaysBurnInSubtitleWhenTranscoding` to the URL query string + if (getAlwaysBurnInSubtitleWhenTranscoding() != null) { + joiner.add(String.format("%sAlwaysBurnInSubtitleWhenTranscoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlwaysBurnInSubtitleWhenTranscoding())))); + } + + // add `DeviceProfile` to the URL query string + if (getDeviceProfile() != null) { + joiner.add(getDeviceProfile().toUrlQueryString(prefix + "DeviceProfile" + suffix)); + } + + // add `DirectPlayProtocols` to the URL query string + if (getDirectPlayProtocols() != null) { + for (int i = 0; i < getDirectPlayProtocols().size(); i++) { + if (getDirectPlayProtocols().get(i) != null) { + joiner.add(String.format("%sDirectPlayProtocols%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDirectPlayProtocols().get(i))))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private OpenLiveStreamDto instance; + + public Builder() { + this(new OpenLiveStreamDto()); + } + + protected Builder(OpenLiveStreamDto instance) { + this.instance = instance; + } + + public OpenLiveStreamDto.Builder openToken(String openToken) { + this.instance.openToken = openToken; + return this; + } + + public OpenLiveStreamDto.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public OpenLiveStreamDto.Builder playSessionId(String playSessionId) { + this.instance.playSessionId = playSessionId; + return this; + } + + public OpenLiveStreamDto.Builder maxStreamingBitrate(Integer maxStreamingBitrate) { + this.instance.maxStreamingBitrate = maxStreamingBitrate; + return this; + } + + public OpenLiveStreamDto.Builder startTimeTicks(Long startTimeTicks) { + this.instance.startTimeTicks = startTimeTicks; + return this; + } + + public OpenLiveStreamDto.Builder audioStreamIndex(Integer audioStreamIndex) { + this.instance.audioStreamIndex = audioStreamIndex; + return this; + } + + public OpenLiveStreamDto.Builder subtitleStreamIndex(Integer subtitleStreamIndex) { + this.instance.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + public OpenLiveStreamDto.Builder maxAudioChannels(Integer maxAudioChannels) { + this.instance.maxAudioChannels = maxAudioChannels; + return this; + } + + public OpenLiveStreamDto.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public OpenLiveStreamDto.Builder enableDirectPlay(Boolean enableDirectPlay) { + this.instance.enableDirectPlay = enableDirectPlay; + return this; + } + + public OpenLiveStreamDto.Builder enableDirectStream(Boolean enableDirectStream) { + this.instance.enableDirectStream = enableDirectStream; + return this; + } + + public OpenLiveStreamDto.Builder alwaysBurnInSubtitleWhenTranscoding( + Boolean alwaysBurnInSubtitleWhenTranscoding) { + this.instance.alwaysBurnInSubtitleWhenTranscoding = alwaysBurnInSubtitleWhenTranscoding; + return this; + } + + public OpenLiveStreamDto.Builder deviceProfile(DeviceProfile deviceProfile) { + this.instance.deviceProfile = deviceProfile; + return this; + } + + public OpenLiveStreamDto.Builder directPlayProtocols(List directPlayProtocols) { + this.instance.directPlayProtocols = directPlayProtocols; + return this; + } + + /** + * returns a built OpenLiveStreamDto instance. + * + * The builder is not reusable. + */ + public OpenLiveStreamDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static OpenLiveStreamDto.Builder builder() { + return new OpenLiveStreamDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public OpenLiveStreamDto.Builder toBuilder() { + return new OpenLiveStreamDto.Builder().openToken(getOpenToken()).userId(getUserId()) + .playSessionId(getPlaySessionId()).maxStreamingBitrate(getMaxStreamingBitrate()) + .startTimeTicks(getStartTimeTicks()).audioStreamIndex(getAudioStreamIndex()) + .subtitleStreamIndex(getSubtitleStreamIndex()).maxAudioChannels(getMaxAudioChannels()) + .itemId(getItemId()).enableDirectPlay(getEnableDirectPlay()).enableDirectStream(getEnableDirectStream()) + .alwaysBurnInSubtitleWhenTranscoding(getAlwaysBurnInSubtitleWhenTranscoding()) + .deviceProfile(getDeviceProfile()).directPlayProtocols(getDirectPlayProtocols()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/OutboundKeepAliveMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/OutboundKeepAliveMessage.java new file mode 100644 index 0000000000000..1948aa8659934 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/OutboundKeepAliveMessage.java @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Keep alive websocket messages. + */ +@JsonPropertyOrder({ OutboundKeepAliveMessage.JSON_PROPERTY_MESSAGE_ID, + OutboundKeepAliveMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class OutboundKeepAliveMessage { + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.KEEP_ALIVE; + + public OutboundKeepAliveMessage() { + } + + @JsonCreator + public OutboundKeepAliveMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public OutboundKeepAliveMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this OutboundKeepAliveMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OutboundKeepAliveMessage outboundKeepAliveMessage = (OutboundKeepAliveMessage) o; + return Objects.equals(this.messageId, outboundKeepAliveMessage.messageId) + && Objects.equals(this.messageType, outboundKeepAliveMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OutboundKeepAliveMessage {\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private OutboundKeepAliveMessage instance; + + public Builder() { + this(new OutboundKeepAliveMessage()); + } + + protected Builder(OutboundKeepAliveMessage instance) { + this.instance = instance; + } + + public OutboundKeepAliveMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public OutboundKeepAliveMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built OutboundKeepAliveMessage instance. + * + * The builder is not reusable. + */ + public OutboundKeepAliveMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static OutboundKeepAliveMessage.Builder builder() { + return new OutboundKeepAliveMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public OutboundKeepAliveMessage.Builder toBuilder() { + return new OutboundKeepAliveMessage.Builder().messageId(getMessageId()).messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/OutboundWebSocketMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/OutboundWebSocketMessage.java new file mode 100644 index 0000000000000..4bf540256c85c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/OutboundWebSocketMessage.java @@ -0,0 +1,2079 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.StringJoiner; +import java.util.logging.Level; +import java.util.logging.Logger; + +import org.openhab.binding.jellyfin.internal.api.generated.JSON; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +@JsonDeserialize(using = OutboundWebSocketMessage.OutboundWebSocketMessageDeserializer.class) +@JsonSerialize(using = OutboundWebSocketMessage.OutboundWebSocketMessageSerializer.class) +public class OutboundWebSocketMessage extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(OutboundWebSocketMessage.class.getName()); + + public static class OutboundWebSocketMessageSerializer extends StdSerializer { + public OutboundWebSocketMessageSerializer(Class t) { + super(t); + } + + public OutboundWebSocketMessageSerializer() { + this(null); + } + + @Override + public void serialize(OutboundWebSocketMessage value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class OutboundWebSocketMessageDeserializer extends StdDeserializer { + public OutboundWebSocketMessageDeserializer() { + this(OutboundWebSocketMessage.class); + } + + public OutboundWebSocketMessageDeserializer(Class vc) { + super(vc); + } + + @Override + public OutboundWebSocketMessage deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize ActivityLogEntryMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ActivityLogEntryMessage.class.equals(Integer.class) + || ActivityLogEntryMessage.class.equals(Long.class) + || ActivityLogEntryMessage.class.equals(Float.class) + || ActivityLogEntryMessage.class.equals(Double.class) + || ActivityLogEntryMessage.class.equals(Boolean.class) + || ActivityLogEntryMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((ActivityLogEntryMessage.class.equals(Integer.class) + || ActivityLogEntryMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((ActivityLogEntryMessage.class.equals(Float.class) + || ActivityLogEntryMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (ActivityLogEntryMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (ActivityLogEntryMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ActivityLogEntryMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ActivityLogEntryMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ActivityLogEntryMessage'", e); + } + + // deserialize ForceKeepAliveMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ForceKeepAliveMessage.class.equals(Integer.class) || ForceKeepAliveMessage.class.equals(Long.class) + || ForceKeepAliveMessage.class.equals(Float.class) + || ForceKeepAliveMessage.class.equals(Double.class) + || ForceKeepAliveMessage.class.equals(Boolean.class) + || ForceKeepAliveMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((ForceKeepAliveMessage.class.equals(Integer.class) + || ForceKeepAliveMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((ForceKeepAliveMessage.class.equals(Float.class) + || ForceKeepAliveMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (ForceKeepAliveMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (ForceKeepAliveMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ForceKeepAliveMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ForceKeepAliveMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ForceKeepAliveMessage'", e); + } + + // deserialize GeneralCommandMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (GeneralCommandMessage.class.equals(Integer.class) || GeneralCommandMessage.class.equals(Long.class) + || GeneralCommandMessage.class.equals(Float.class) + || GeneralCommandMessage.class.equals(Double.class) + || GeneralCommandMessage.class.equals(Boolean.class) + || GeneralCommandMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((GeneralCommandMessage.class.equals(Integer.class) + || GeneralCommandMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((GeneralCommandMessage.class.equals(Float.class) + || GeneralCommandMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (GeneralCommandMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (GeneralCommandMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(GeneralCommandMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'GeneralCommandMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'GeneralCommandMessage'", e); + } + + // deserialize LibraryChangedMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (LibraryChangedMessage.class.equals(Integer.class) || LibraryChangedMessage.class.equals(Long.class) + || LibraryChangedMessage.class.equals(Float.class) + || LibraryChangedMessage.class.equals(Double.class) + || LibraryChangedMessage.class.equals(Boolean.class) + || LibraryChangedMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((LibraryChangedMessage.class.equals(Integer.class) + || LibraryChangedMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((LibraryChangedMessage.class.equals(Float.class) + || LibraryChangedMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (LibraryChangedMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (LibraryChangedMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(LibraryChangedMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'LibraryChangedMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'LibraryChangedMessage'", e); + } + + // deserialize OutboundKeepAliveMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (OutboundKeepAliveMessage.class.equals(Integer.class) + || OutboundKeepAliveMessage.class.equals(Long.class) + || OutboundKeepAliveMessage.class.equals(Float.class) + || OutboundKeepAliveMessage.class.equals(Double.class) + || OutboundKeepAliveMessage.class.equals(Boolean.class) + || OutboundKeepAliveMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((OutboundKeepAliveMessage.class.equals(Integer.class) + || OutboundKeepAliveMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((OutboundKeepAliveMessage.class.equals(Float.class) + || OutboundKeepAliveMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (OutboundKeepAliveMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (OutboundKeepAliveMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(OutboundKeepAliveMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'OutboundKeepAliveMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'OutboundKeepAliveMessage'", e); + } + + // deserialize PlayMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (PlayMessage.class.equals(Integer.class) || PlayMessage.class.equals(Long.class) + || PlayMessage.class.equals(Float.class) || PlayMessage.class.equals(Double.class) + || PlayMessage.class.equals(Boolean.class) || PlayMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((PlayMessage.class.equals(Integer.class) + || PlayMessage.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((PlayMessage.class.equals(Float.class) + || PlayMessage.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (PlayMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (PlayMessage.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(PlayMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'PlayMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'PlayMessage'", e); + } + + // deserialize PlaystateMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (PlaystateMessage.class.equals(Integer.class) || PlaystateMessage.class.equals(Long.class) + || PlaystateMessage.class.equals(Float.class) || PlaystateMessage.class.equals(Double.class) + || PlaystateMessage.class.equals(Boolean.class) + || PlaystateMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((PlaystateMessage.class.equals(Integer.class) + || PlaystateMessage.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((PlaystateMessage.class.equals(Float.class) + || PlaystateMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (PlaystateMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (PlaystateMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(PlaystateMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'PlaystateMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'PlaystateMessage'", e); + } + + // deserialize PluginInstallationCancelledMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (PluginInstallationCancelledMessage.class.equals(Integer.class) + || PluginInstallationCancelledMessage.class.equals(Long.class) + || PluginInstallationCancelledMessage.class.equals(Float.class) + || PluginInstallationCancelledMessage.class.equals(Double.class) + || PluginInstallationCancelledMessage.class.equals(Boolean.class) + || PluginInstallationCancelledMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((PluginInstallationCancelledMessage.class.equals(Integer.class) + || PluginInstallationCancelledMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((PluginInstallationCancelledMessage.class.equals(Float.class) + || PluginInstallationCancelledMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (PluginInstallationCancelledMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (PluginInstallationCancelledMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(PluginInstallationCancelledMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'PluginInstallationCancelledMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'PluginInstallationCancelledMessage'", e); + } + + // deserialize PluginInstallationCompletedMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (PluginInstallationCompletedMessage.class.equals(Integer.class) + || PluginInstallationCompletedMessage.class.equals(Long.class) + || PluginInstallationCompletedMessage.class.equals(Float.class) + || PluginInstallationCompletedMessage.class.equals(Double.class) + || PluginInstallationCompletedMessage.class.equals(Boolean.class) + || PluginInstallationCompletedMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((PluginInstallationCompletedMessage.class.equals(Integer.class) + || PluginInstallationCompletedMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((PluginInstallationCompletedMessage.class.equals(Float.class) + || PluginInstallationCompletedMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (PluginInstallationCompletedMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (PluginInstallationCompletedMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(PluginInstallationCompletedMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'PluginInstallationCompletedMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'PluginInstallationCompletedMessage'", e); + } + + // deserialize PluginInstallationFailedMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (PluginInstallationFailedMessage.class.equals(Integer.class) + || PluginInstallationFailedMessage.class.equals(Long.class) + || PluginInstallationFailedMessage.class.equals(Float.class) + || PluginInstallationFailedMessage.class.equals(Double.class) + || PluginInstallationFailedMessage.class.equals(Boolean.class) + || PluginInstallationFailedMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((PluginInstallationFailedMessage.class.equals(Integer.class) + || PluginInstallationFailedMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((PluginInstallationFailedMessage.class.equals(Float.class) + || PluginInstallationFailedMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (PluginInstallationFailedMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (PluginInstallationFailedMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(PluginInstallationFailedMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'PluginInstallationFailedMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'PluginInstallationFailedMessage'", e); + } + + // deserialize PluginInstallingMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (PluginInstallingMessage.class.equals(Integer.class) + || PluginInstallingMessage.class.equals(Long.class) + || PluginInstallingMessage.class.equals(Float.class) + || PluginInstallingMessage.class.equals(Double.class) + || PluginInstallingMessage.class.equals(Boolean.class) + || PluginInstallingMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((PluginInstallingMessage.class.equals(Integer.class) + || PluginInstallingMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((PluginInstallingMessage.class.equals(Float.class) + || PluginInstallingMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (PluginInstallingMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (PluginInstallingMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(PluginInstallingMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'PluginInstallingMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'PluginInstallingMessage'", e); + } + + // deserialize PluginUninstalledMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (PluginUninstalledMessage.class.equals(Integer.class) + || PluginUninstalledMessage.class.equals(Long.class) + || PluginUninstalledMessage.class.equals(Float.class) + || PluginUninstalledMessage.class.equals(Double.class) + || PluginUninstalledMessage.class.equals(Boolean.class) + || PluginUninstalledMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((PluginUninstalledMessage.class.equals(Integer.class) + || PluginUninstalledMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((PluginUninstalledMessage.class.equals(Float.class) + || PluginUninstalledMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (PluginUninstalledMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (PluginUninstalledMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(PluginUninstalledMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'PluginUninstalledMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'PluginUninstalledMessage'", e); + } + + // deserialize RefreshProgressMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (RefreshProgressMessage.class.equals(Integer.class) + || RefreshProgressMessage.class.equals(Long.class) + || RefreshProgressMessage.class.equals(Float.class) + || RefreshProgressMessage.class.equals(Double.class) + || RefreshProgressMessage.class.equals(Boolean.class) + || RefreshProgressMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((RefreshProgressMessage.class.equals(Integer.class) + || RefreshProgressMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((RefreshProgressMessage.class.equals(Float.class) + || RefreshProgressMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (RefreshProgressMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (RefreshProgressMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(RefreshProgressMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'RefreshProgressMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'RefreshProgressMessage'", e); + } + + // deserialize RestartRequiredMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (RestartRequiredMessage.class.equals(Integer.class) + || RestartRequiredMessage.class.equals(Long.class) + || RestartRequiredMessage.class.equals(Float.class) + || RestartRequiredMessage.class.equals(Double.class) + || RestartRequiredMessage.class.equals(Boolean.class) + || RestartRequiredMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((RestartRequiredMessage.class.equals(Integer.class) + || RestartRequiredMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((RestartRequiredMessage.class.equals(Float.class) + || RestartRequiredMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (RestartRequiredMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (RestartRequiredMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(RestartRequiredMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'RestartRequiredMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'RestartRequiredMessage'", e); + } + + // deserialize ScheduledTaskEndedMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ScheduledTaskEndedMessage.class.equals(Integer.class) + || ScheduledTaskEndedMessage.class.equals(Long.class) + || ScheduledTaskEndedMessage.class.equals(Float.class) + || ScheduledTaskEndedMessage.class.equals(Double.class) + || ScheduledTaskEndedMessage.class.equals(Boolean.class) + || ScheduledTaskEndedMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((ScheduledTaskEndedMessage.class.equals(Integer.class) + || ScheduledTaskEndedMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((ScheduledTaskEndedMessage.class.equals(Float.class) + || ScheduledTaskEndedMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (ScheduledTaskEndedMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (ScheduledTaskEndedMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ScheduledTaskEndedMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ScheduledTaskEndedMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ScheduledTaskEndedMessage'", e); + } + + // deserialize ScheduledTasksInfoMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ScheduledTasksInfoMessage.class.equals(Integer.class) + || ScheduledTasksInfoMessage.class.equals(Long.class) + || ScheduledTasksInfoMessage.class.equals(Float.class) + || ScheduledTasksInfoMessage.class.equals(Double.class) + || ScheduledTasksInfoMessage.class.equals(Boolean.class) + || ScheduledTasksInfoMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((ScheduledTasksInfoMessage.class.equals(Integer.class) + || ScheduledTasksInfoMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((ScheduledTasksInfoMessage.class.equals(Float.class) + || ScheduledTasksInfoMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (ScheduledTasksInfoMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (ScheduledTasksInfoMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ScheduledTasksInfoMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ScheduledTasksInfoMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ScheduledTasksInfoMessage'", e); + } + + // deserialize SeriesTimerCancelledMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SeriesTimerCancelledMessage.class.equals(Integer.class) + || SeriesTimerCancelledMessage.class.equals(Long.class) + || SeriesTimerCancelledMessage.class.equals(Float.class) + || SeriesTimerCancelledMessage.class.equals(Double.class) + || SeriesTimerCancelledMessage.class.equals(Boolean.class) + || SeriesTimerCancelledMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((SeriesTimerCancelledMessage.class.equals(Integer.class) + || SeriesTimerCancelledMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((SeriesTimerCancelledMessage.class.equals(Float.class) + || SeriesTimerCancelledMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (SeriesTimerCancelledMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (SeriesTimerCancelledMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(SeriesTimerCancelledMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'SeriesTimerCancelledMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SeriesTimerCancelledMessage'", e); + } + + // deserialize SeriesTimerCreatedMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SeriesTimerCreatedMessage.class.equals(Integer.class) + || SeriesTimerCreatedMessage.class.equals(Long.class) + || SeriesTimerCreatedMessage.class.equals(Float.class) + || SeriesTimerCreatedMessage.class.equals(Double.class) + || SeriesTimerCreatedMessage.class.equals(Boolean.class) + || SeriesTimerCreatedMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((SeriesTimerCreatedMessage.class.equals(Integer.class) + || SeriesTimerCreatedMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((SeriesTimerCreatedMessage.class.equals(Float.class) + || SeriesTimerCreatedMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (SeriesTimerCreatedMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (SeriesTimerCreatedMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(SeriesTimerCreatedMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'SeriesTimerCreatedMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SeriesTimerCreatedMessage'", e); + } + + // deserialize ServerRestartingMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ServerRestartingMessage.class.equals(Integer.class) + || ServerRestartingMessage.class.equals(Long.class) + || ServerRestartingMessage.class.equals(Float.class) + || ServerRestartingMessage.class.equals(Double.class) + || ServerRestartingMessage.class.equals(Boolean.class) + || ServerRestartingMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((ServerRestartingMessage.class.equals(Integer.class) + || ServerRestartingMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((ServerRestartingMessage.class.equals(Float.class) + || ServerRestartingMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (ServerRestartingMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (ServerRestartingMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ServerRestartingMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ServerRestartingMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ServerRestartingMessage'", e); + } + + // deserialize ServerShuttingDownMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ServerShuttingDownMessage.class.equals(Integer.class) + || ServerShuttingDownMessage.class.equals(Long.class) + || ServerShuttingDownMessage.class.equals(Float.class) + || ServerShuttingDownMessage.class.equals(Double.class) + || ServerShuttingDownMessage.class.equals(Boolean.class) + || ServerShuttingDownMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((ServerShuttingDownMessage.class.equals(Integer.class) + || ServerShuttingDownMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((ServerShuttingDownMessage.class.equals(Float.class) + || ServerShuttingDownMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (ServerShuttingDownMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (ServerShuttingDownMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ServerShuttingDownMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ServerShuttingDownMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ServerShuttingDownMessage'", e); + } + + // deserialize SessionsMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SessionsMessage.class.equals(Integer.class) || SessionsMessage.class.equals(Long.class) + || SessionsMessage.class.equals(Float.class) || SessionsMessage.class.equals(Double.class) + || SessionsMessage.class.equals(Boolean.class) || SessionsMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((SessionsMessage.class.equals(Integer.class) + || SessionsMessage.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((SessionsMessage.class.equals(Float.class) + || SessionsMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (SessionsMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (SessionsMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(SessionsMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'SessionsMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SessionsMessage'", e); + } + + // deserialize SyncPlayCommandMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SyncPlayCommandMessage.class.equals(Integer.class) + || SyncPlayCommandMessage.class.equals(Long.class) + || SyncPlayCommandMessage.class.equals(Float.class) + || SyncPlayCommandMessage.class.equals(Double.class) + || SyncPlayCommandMessage.class.equals(Boolean.class) + || SyncPlayCommandMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((SyncPlayCommandMessage.class.equals(Integer.class) + || SyncPlayCommandMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((SyncPlayCommandMessage.class.equals(Float.class) + || SyncPlayCommandMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (SyncPlayCommandMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (SyncPlayCommandMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(SyncPlayCommandMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'SyncPlayCommandMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SyncPlayCommandMessage'", e); + } + + // deserialize SyncPlayGroupUpdateCommandMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SyncPlayGroupUpdateCommandMessage.class.equals(Integer.class) + || SyncPlayGroupUpdateCommandMessage.class.equals(Long.class) + || SyncPlayGroupUpdateCommandMessage.class.equals(Float.class) + || SyncPlayGroupUpdateCommandMessage.class.equals(Double.class) + || SyncPlayGroupUpdateCommandMessage.class.equals(Boolean.class) + || SyncPlayGroupUpdateCommandMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((SyncPlayGroupUpdateCommandMessage.class.equals(Integer.class) + || SyncPlayGroupUpdateCommandMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((SyncPlayGroupUpdateCommandMessage.class.equals(Float.class) + || SyncPlayGroupUpdateCommandMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (SyncPlayGroupUpdateCommandMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (SyncPlayGroupUpdateCommandMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(SyncPlayGroupUpdateCommandMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'SyncPlayGroupUpdateCommandMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SyncPlayGroupUpdateCommandMessage'", e); + } + + // deserialize TimerCancelledMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (TimerCancelledMessage.class.equals(Integer.class) || TimerCancelledMessage.class.equals(Long.class) + || TimerCancelledMessage.class.equals(Float.class) + || TimerCancelledMessage.class.equals(Double.class) + || TimerCancelledMessage.class.equals(Boolean.class) + || TimerCancelledMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((TimerCancelledMessage.class.equals(Integer.class) + || TimerCancelledMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((TimerCancelledMessage.class.equals(Float.class) + || TimerCancelledMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (TimerCancelledMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (TimerCancelledMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(TimerCancelledMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'TimerCancelledMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'TimerCancelledMessage'", e); + } + + // deserialize TimerCreatedMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (TimerCreatedMessage.class.equals(Integer.class) || TimerCreatedMessage.class.equals(Long.class) + || TimerCreatedMessage.class.equals(Float.class) + || TimerCreatedMessage.class.equals(Double.class) + || TimerCreatedMessage.class.equals(Boolean.class) + || TimerCreatedMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((TimerCreatedMessage.class.equals(Integer.class) + || TimerCreatedMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((TimerCreatedMessage.class.equals(Float.class) + || TimerCreatedMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (TimerCreatedMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (TimerCreatedMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(TimerCreatedMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'TimerCreatedMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'TimerCreatedMessage'", e); + } + + // deserialize UserDataChangedMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (UserDataChangedMessage.class.equals(Integer.class) + || UserDataChangedMessage.class.equals(Long.class) + || UserDataChangedMessage.class.equals(Float.class) + || UserDataChangedMessage.class.equals(Double.class) + || UserDataChangedMessage.class.equals(Boolean.class) + || UserDataChangedMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((UserDataChangedMessage.class.equals(Integer.class) + || UserDataChangedMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((UserDataChangedMessage.class.equals(Float.class) + || UserDataChangedMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (UserDataChangedMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (UserDataChangedMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(UserDataChangedMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'UserDataChangedMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'UserDataChangedMessage'", e); + } + + // deserialize UserDeletedMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (UserDeletedMessage.class.equals(Integer.class) || UserDeletedMessage.class.equals(Long.class) + || UserDeletedMessage.class.equals(Float.class) || UserDeletedMessage.class.equals(Double.class) + || UserDeletedMessage.class.equals(Boolean.class) + || UserDeletedMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((UserDeletedMessage.class.equals(Integer.class) + || UserDeletedMessage.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((UserDeletedMessage.class.equals(Float.class) + || UserDeletedMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (UserDeletedMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (UserDeletedMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(UserDeletedMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'UserDeletedMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'UserDeletedMessage'", e); + } + + // deserialize UserUpdatedMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (UserUpdatedMessage.class.equals(Integer.class) || UserUpdatedMessage.class.equals(Long.class) + || UserUpdatedMessage.class.equals(Float.class) || UserUpdatedMessage.class.equals(Double.class) + || UserUpdatedMessage.class.equals(Boolean.class) + || UserUpdatedMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((UserUpdatedMessage.class.equals(Integer.class) + || UserUpdatedMessage.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((UserUpdatedMessage.class.equals(Float.class) + || UserUpdatedMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (UserUpdatedMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (UserUpdatedMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(UserUpdatedMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'UserUpdatedMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'UserUpdatedMessage'", e); + } + + if (match == 1) { + OutboundWebSocketMessage ret = new OutboundWebSocketMessage(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format( + "Failed deserialization for OutboundWebSocketMessage: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public OutboundWebSocketMessage getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "OutboundWebSocketMessage cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public OutboundWebSocketMessage() { + super("oneOf", Boolean.FALSE); + } + + public OutboundWebSocketMessage(ActivityLogEntryMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(ForceKeepAliveMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(GeneralCommandMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(LibraryChangedMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(OutboundKeepAliveMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(PlayMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(PlaystateMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(PluginInstallationCancelledMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(PluginInstallationCompletedMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(PluginInstallationFailedMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(PluginInstallingMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(PluginUninstalledMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(RefreshProgressMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(RestartRequiredMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(ScheduledTaskEndedMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(ScheduledTasksInfoMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(SeriesTimerCancelledMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(SeriesTimerCreatedMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(ServerRestartingMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(ServerShuttingDownMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(SessionsMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(SyncPlayCommandMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(SyncPlayGroupUpdateCommandMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(TimerCancelledMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(TimerCreatedMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(UserDataChangedMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(UserDeletedMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OutboundWebSocketMessage(UserUpdatedMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ActivityLogEntryMessage", ActivityLogEntryMessage.class); + schemas.put("ForceKeepAliveMessage", ForceKeepAliveMessage.class); + schemas.put("GeneralCommandMessage", GeneralCommandMessage.class); + schemas.put("LibraryChangedMessage", LibraryChangedMessage.class); + schemas.put("OutboundKeepAliveMessage", OutboundKeepAliveMessage.class); + schemas.put("PlayMessage", PlayMessage.class); + schemas.put("PlaystateMessage", PlaystateMessage.class); + schemas.put("PluginInstallationCancelledMessage", PluginInstallationCancelledMessage.class); + schemas.put("PluginInstallationCompletedMessage", PluginInstallationCompletedMessage.class); + schemas.put("PluginInstallationFailedMessage", PluginInstallationFailedMessage.class); + schemas.put("PluginInstallingMessage", PluginInstallingMessage.class); + schemas.put("PluginUninstalledMessage", PluginUninstalledMessage.class); + schemas.put("RefreshProgressMessage", RefreshProgressMessage.class); + schemas.put("RestartRequiredMessage", RestartRequiredMessage.class); + schemas.put("ScheduledTaskEndedMessage", ScheduledTaskEndedMessage.class); + schemas.put("ScheduledTasksInfoMessage", ScheduledTasksInfoMessage.class); + schemas.put("SeriesTimerCancelledMessage", SeriesTimerCancelledMessage.class); + schemas.put("SeriesTimerCreatedMessage", SeriesTimerCreatedMessage.class); + schemas.put("ServerRestartingMessage", ServerRestartingMessage.class); + schemas.put("ServerShuttingDownMessage", ServerShuttingDownMessage.class); + schemas.put("SessionsMessage", SessionsMessage.class); + schemas.put("SyncPlayCommandMessage", SyncPlayCommandMessage.class); + schemas.put("SyncPlayGroupUpdateCommandMessage", SyncPlayGroupUpdateCommandMessage.class); + schemas.put("TimerCancelledMessage", TimerCancelledMessage.class); + schemas.put("TimerCreatedMessage", TimerCreatedMessage.class); + schemas.put("UserDataChangedMessage", UserDataChangedMessage.class); + schemas.put("UserDeletedMessage", UserDeletedMessage.class); + schemas.put("UserUpdatedMessage", UserUpdatedMessage.class); + JSON.registerDescendants(OutboundWebSocketMessage.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("ActivityLogEntry", ActivityLogEntryMessage.class); + mappings.put("ForceKeepAlive", ForceKeepAliveMessage.class); + mappings.put("GeneralCommand", GeneralCommandMessage.class); + mappings.put("KeepAlive", OutboundKeepAliveMessage.class); + mappings.put("LibraryChanged", LibraryChangedMessage.class); + mappings.put("PackageInstallationCancelled", PluginInstallationCancelledMessage.class); + mappings.put("PackageInstallationCompleted", PluginInstallationCompletedMessage.class); + mappings.put("PackageInstallationFailed", PluginInstallationFailedMessage.class); + mappings.put("PackageInstalling", PluginInstallingMessage.class); + mappings.put("PackageUninstalled", PluginUninstalledMessage.class); + mappings.put("Play", PlayMessage.class); + mappings.put("Playstate", PlaystateMessage.class); + mappings.put("RefreshProgress", RefreshProgressMessage.class); + mappings.put("RestartRequired", RestartRequiredMessage.class); + mappings.put("ScheduledTaskEnded", ScheduledTaskEndedMessage.class); + mappings.put("ScheduledTasksInfo", ScheduledTasksInfoMessage.class); + mappings.put("SeriesTimerCancelled", SeriesTimerCancelledMessage.class); + mappings.put("SeriesTimerCreated", SeriesTimerCreatedMessage.class); + mappings.put("ServerRestarting", ServerRestartingMessage.class); + mappings.put("ServerShuttingDown", ServerShuttingDownMessage.class); + mappings.put("Sessions", SessionsMessage.class); + mappings.put("SyncPlayCommand", SyncPlayCommandMessage.class); + mappings.put("SyncPlayGroupUpdate", SyncPlayGroupUpdateCommandMessage.class); + mappings.put("TimerCancelled", TimerCancelledMessage.class); + mappings.put("TimerCreated", TimerCreatedMessage.class); + mappings.put("UserDataChanged", UserDataChangedMessage.class); + mappings.put("UserDeleted", UserDeletedMessage.class); + mappings.put("UserUpdated", UserUpdatedMessage.class); + mappings.put("ActivityLogEntryMessage", ActivityLogEntryMessage.class); + mappings.put("ForceKeepAliveMessage", ForceKeepAliveMessage.class); + mappings.put("GeneralCommandMessage", GeneralCommandMessage.class); + mappings.put("LibraryChangedMessage", LibraryChangedMessage.class); + mappings.put("OutboundKeepAliveMessage", OutboundKeepAliveMessage.class); + mappings.put("PlayMessage", PlayMessage.class); + mappings.put("PlaystateMessage", PlaystateMessage.class); + mappings.put("PluginInstallationCancelledMessage", PluginInstallationCancelledMessage.class); + mappings.put("PluginInstallationCompletedMessage", PluginInstallationCompletedMessage.class); + mappings.put("PluginInstallationFailedMessage", PluginInstallationFailedMessage.class); + mappings.put("PluginInstallingMessage", PluginInstallingMessage.class); + mappings.put("PluginUninstalledMessage", PluginUninstalledMessage.class); + mappings.put("RefreshProgressMessage", RefreshProgressMessage.class); + mappings.put("RestartRequiredMessage", RestartRequiredMessage.class); + mappings.put("ScheduledTaskEndedMessage", ScheduledTaskEndedMessage.class); + mappings.put("ScheduledTasksInfoMessage", ScheduledTasksInfoMessage.class); + mappings.put("SeriesTimerCancelledMessage", SeriesTimerCancelledMessage.class); + mappings.put("SeriesTimerCreatedMessage", SeriesTimerCreatedMessage.class); + mappings.put("ServerRestartingMessage", ServerRestartingMessage.class); + mappings.put("ServerShuttingDownMessage", ServerShuttingDownMessage.class); + mappings.put("SessionsMessage", SessionsMessage.class); + mappings.put("SyncPlayCommandMessage", SyncPlayCommandMessage.class); + mappings.put("SyncPlayGroupUpdateCommandMessage", SyncPlayGroupUpdateCommandMessage.class); + mappings.put("TimerCancelledMessage", TimerCancelledMessage.class); + mappings.put("TimerCreatedMessage", TimerCreatedMessage.class); + mappings.put("UserDataChangedMessage", UserDataChangedMessage.class); + mappings.put("UserDeletedMessage", UserDeletedMessage.class); + mappings.put("UserUpdatedMessage", UserUpdatedMessage.class); + mappings.put("OutboundWebSocketMessage", OutboundWebSocketMessage.class); + JSON.registerDiscriminator(OutboundWebSocketMessage.class, "MessageType", mappings); + } + + @Override + public Map> getSchemas() { + return OutboundWebSocketMessage.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * ActivityLogEntryMessage, ForceKeepAliveMessage, GeneralCommandMessage, LibraryChangedMessage, + * OutboundKeepAliveMessage, PlayMessage, PlaystateMessage, PluginInstallationCancelledMessage, + * PluginInstallationCompletedMessage, PluginInstallationFailedMessage, PluginInstallingMessage, + * PluginUninstalledMessage, RefreshProgressMessage, RestartRequiredMessage, ScheduledTaskEndedMessage, + * ScheduledTasksInfoMessage, SeriesTimerCancelledMessage, SeriesTimerCreatedMessage, ServerRestartingMessage, + * ServerShuttingDownMessage, SessionsMessage, SyncPlayCommandMessage, SyncPlayGroupUpdateCommandMessage, + * TimerCancelledMessage, TimerCreatedMessage, UserDataChangedMessage, UserDeletedMessage, UserUpdatedMessage + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(ActivityLogEntryMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(ForceKeepAliveMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(GeneralCommandMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(LibraryChangedMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(OutboundKeepAliveMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(PlayMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(PlaystateMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(PluginInstallationCancelledMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(PluginInstallationCompletedMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(PluginInstallationFailedMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(PluginInstallingMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(PluginUninstalledMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(RefreshProgressMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(RestartRequiredMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(ScheduledTaskEndedMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(ScheduledTasksInfoMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(SeriesTimerCancelledMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(SeriesTimerCreatedMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(ServerRestartingMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(ServerShuttingDownMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(SessionsMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(SyncPlayCommandMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(SyncPlayGroupUpdateCommandMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(TimerCancelledMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(TimerCreatedMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UserDataChangedMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UserDeletedMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UserUpdatedMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be ActivityLogEntryMessage, ForceKeepAliveMessage, GeneralCommandMessage, LibraryChangedMessage, OutboundKeepAliveMessage, PlayMessage, PlaystateMessage, PluginInstallationCancelledMessage, PluginInstallationCompletedMessage, PluginInstallationFailedMessage, PluginInstallingMessage, PluginUninstalledMessage, RefreshProgressMessage, RestartRequiredMessage, ScheduledTaskEndedMessage, ScheduledTasksInfoMessage, SeriesTimerCancelledMessage, SeriesTimerCreatedMessage, ServerRestartingMessage, ServerShuttingDownMessage, SessionsMessage, SyncPlayCommandMessage, SyncPlayGroupUpdateCommandMessage, TimerCancelledMessage, TimerCreatedMessage, UserDataChangedMessage, UserDeletedMessage, UserUpdatedMessage"); + } + + /** + * Get the actual instance, which can be the following: + * ActivityLogEntryMessage, ForceKeepAliveMessage, GeneralCommandMessage, LibraryChangedMessage, + * OutboundKeepAliveMessage, PlayMessage, PlaystateMessage, PluginInstallationCancelledMessage, + * PluginInstallationCompletedMessage, PluginInstallationFailedMessage, PluginInstallingMessage, + * PluginUninstalledMessage, RefreshProgressMessage, RestartRequiredMessage, ScheduledTaskEndedMessage, + * ScheduledTasksInfoMessage, SeriesTimerCancelledMessage, SeriesTimerCreatedMessage, ServerRestartingMessage, + * ServerShuttingDownMessage, SessionsMessage, SyncPlayCommandMessage, SyncPlayGroupUpdateCommandMessage, + * TimerCancelledMessage, TimerCreatedMessage, UserDataChangedMessage, UserDeletedMessage, UserUpdatedMessage + * + * @return The actual instance (ActivityLogEntryMessage, ForceKeepAliveMessage, GeneralCommandMessage, + * LibraryChangedMessage, OutboundKeepAliveMessage, PlayMessage, PlaystateMessage, + * PluginInstallationCancelledMessage, PluginInstallationCompletedMessage, PluginInstallationFailedMessage, + * PluginInstallingMessage, PluginUninstalledMessage, RefreshProgressMessage, RestartRequiredMessage, + * ScheduledTaskEndedMessage, ScheduledTasksInfoMessage, SeriesTimerCancelledMessage, + * SeriesTimerCreatedMessage, ServerRestartingMessage, ServerShuttingDownMessage, SessionsMessage, + * SyncPlayCommandMessage, SyncPlayGroupUpdateCommandMessage, TimerCancelledMessage, TimerCreatedMessage, + * UserDataChangedMessage, UserDeletedMessage, UserUpdatedMessage) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ActivityLogEntryMessage`. If the actual instance is not `ActivityLogEntryMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ActivityLogEntryMessage` + * @throws ClassCastException if the instance is not `ActivityLogEntryMessage` + */ + public ActivityLogEntryMessage getActivityLogEntryMessage() throws ClassCastException { + return (ActivityLogEntryMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `ForceKeepAliveMessage`. If the actual instance is not `ForceKeepAliveMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ForceKeepAliveMessage` + * @throws ClassCastException if the instance is not `ForceKeepAliveMessage` + */ + public ForceKeepAliveMessage getForceKeepAliveMessage() throws ClassCastException { + return (ForceKeepAliveMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `GeneralCommandMessage`. If the actual instance is not `GeneralCommandMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GeneralCommandMessage` + * @throws ClassCastException if the instance is not `GeneralCommandMessage` + */ + public GeneralCommandMessage getGeneralCommandMessage() throws ClassCastException { + return (GeneralCommandMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `LibraryChangedMessage`. If the actual instance is not `LibraryChangedMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `LibraryChangedMessage` + * @throws ClassCastException if the instance is not `LibraryChangedMessage` + */ + public LibraryChangedMessage getLibraryChangedMessage() throws ClassCastException { + return (LibraryChangedMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `OutboundKeepAliveMessage`. If the actual instance is not `OutboundKeepAliveMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `OutboundKeepAliveMessage` + * @throws ClassCastException if the instance is not `OutboundKeepAliveMessage` + */ + public OutboundKeepAliveMessage getOutboundKeepAliveMessage() throws ClassCastException { + return (OutboundKeepAliveMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `PlayMessage`. If the actual instance is not `PlayMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `PlayMessage` + * @throws ClassCastException if the instance is not `PlayMessage` + */ + public PlayMessage getPlayMessage() throws ClassCastException { + return (PlayMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `PlaystateMessage`. If the actual instance is not `PlaystateMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `PlaystateMessage` + * @throws ClassCastException if the instance is not `PlaystateMessage` + */ + public PlaystateMessage getPlaystateMessage() throws ClassCastException { + return (PlaystateMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `PluginInstallationCancelledMessage`. If the actual instance is not + * `PluginInstallationCancelledMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `PluginInstallationCancelledMessage` + * @throws ClassCastException if the instance is not `PluginInstallationCancelledMessage` + */ + public PluginInstallationCancelledMessage getPluginInstallationCancelledMessage() throws ClassCastException { + return (PluginInstallationCancelledMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `PluginInstallationCompletedMessage`. If the actual instance is not + * `PluginInstallationCompletedMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `PluginInstallationCompletedMessage` + * @throws ClassCastException if the instance is not `PluginInstallationCompletedMessage` + */ + public PluginInstallationCompletedMessage getPluginInstallationCompletedMessage() throws ClassCastException { + return (PluginInstallationCompletedMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `PluginInstallationFailedMessage`. If the actual instance is not + * `PluginInstallationFailedMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `PluginInstallationFailedMessage` + * @throws ClassCastException if the instance is not `PluginInstallationFailedMessage` + */ + public PluginInstallationFailedMessage getPluginInstallationFailedMessage() throws ClassCastException { + return (PluginInstallationFailedMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `PluginInstallingMessage`. If the actual instance is not `PluginInstallingMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `PluginInstallingMessage` + * @throws ClassCastException if the instance is not `PluginInstallingMessage` + */ + public PluginInstallingMessage getPluginInstallingMessage() throws ClassCastException { + return (PluginInstallingMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `PluginUninstalledMessage`. If the actual instance is not `PluginUninstalledMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `PluginUninstalledMessage` + * @throws ClassCastException if the instance is not `PluginUninstalledMessage` + */ + public PluginUninstalledMessage getPluginUninstalledMessage() throws ClassCastException { + return (PluginUninstalledMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `RefreshProgressMessage`. If the actual instance is not `RefreshProgressMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `RefreshProgressMessage` + * @throws ClassCastException if the instance is not `RefreshProgressMessage` + */ + public RefreshProgressMessage getRefreshProgressMessage() throws ClassCastException { + return (RefreshProgressMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `RestartRequiredMessage`. If the actual instance is not `RestartRequiredMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `RestartRequiredMessage` + * @throws ClassCastException if the instance is not `RestartRequiredMessage` + */ + public RestartRequiredMessage getRestartRequiredMessage() throws ClassCastException { + return (RestartRequiredMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `ScheduledTaskEndedMessage`. If the actual instance is not + * `ScheduledTaskEndedMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ScheduledTaskEndedMessage` + * @throws ClassCastException if the instance is not `ScheduledTaskEndedMessage` + */ + public ScheduledTaskEndedMessage getScheduledTaskEndedMessage() throws ClassCastException { + return (ScheduledTaskEndedMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `ScheduledTasksInfoMessage`. If the actual instance is not + * `ScheduledTasksInfoMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ScheduledTasksInfoMessage` + * @throws ClassCastException if the instance is not `ScheduledTasksInfoMessage` + */ + public ScheduledTasksInfoMessage getScheduledTasksInfoMessage() throws ClassCastException { + return (ScheduledTasksInfoMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `SeriesTimerCancelledMessage`. If the actual instance is not + * `SeriesTimerCancelledMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SeriesTimerCancelledMessage` + * @throws ClassCastException if the instance is not `SeriesTimerCancelledMessage` + */ + public SeriesTimerCancelledMessage getSeriesTimerCancelledMessage() throws ClassCastException { + return (SeriesTimerCancelledMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `SeriesTimerCreatedMessage`. If the actual instance is not + * `SeriesTimerCreatedMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SeriesTimerCreatedMessage` + * @throws ClassCastException if the instance is not `SeriesTimerCreatedMessage` + */ + public SeriesTimerCreatedMessage getSeriesTimerCreatedMessage() throws ClassCastException { + return (SeriesTimerCreatedMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `ServerRestartingMessage`. If the actual instance is not `ServerRestartingMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ServerRestartingMessage` + * @throws ClassCastException if the instance is not `ServerRestartingMessage` + */ + public ServerRestartingMessage getServerRestartingMessage() throws ClassCastException { + return (ServerRestartingMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `ServerShuttingDownMessage`. If the actual instance is not + * `ServerShuttingDownMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ServerShuttingDownMessage` + * @throws ClassCastException if the instance is not `ServerShuttingDownMessage` + */ + public ServerShuttingDownMessage getServerShuttingDownMessage() throws ClassCastException { + return (ServerShuttingDownMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `SessionsMessage`. If the actual instance is not `SessionsMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SessionsMessage` + * @throws ClassCastException if the instance is not `SessionsMessage` + */ + public SessionsMessage getSessionsMessage() throws ClassCastException { + return (SessionsMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `SyncPlayCommandMessage`. If the actual instance is not `SyncPlayCommandMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SyncPlayCommandMessage` + * @throws ClassCastException if the instance is not `SyncPlayCommandMessage` + */ + public SyncPlayCommandMessage getSyncPlayCommandMessage() throws ClassCastException { + return (SyncPlayCommandMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `SyncPlayGroupUpdateCommandMessage`. If the actual instance is not + * `SyncPlayGroupUpdateCommandMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SyncPlayGroupUpdateCommandMessage` + * @throws ClassCastException if the instance is not `SyncPlayGroupUpdateCommandMessage` + */ + public SyncPlayGroupUpdateCommandMessage getSyncPlayGroupUpdateCommandMessage() throws ClassCastException { + return (SyncPlayGroupUpdateCommandMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `TimerCancelledMessage`. If the actual instance is not `TimerCancelledMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TimerCancelledMessage` + * @throws ClassCastException if the instance is not `TimerCancelledMessage` + */ + public TimerCancelledMessage getTimerCancelledMessage() throws ClassCastException { + return (TimerCancelledMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `TimerCreatedMessage`. If the actual instance is not `TimerCreatedMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TimerCreatedMessage` + * @throws ClassCastException if the instance is not `TimerCreatedMessage` + */ + public TimerCreatedMessage getTimerCreatedMessage() throws ClassCastException { + return (TimerCreatedMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `UserDataChangedMessage`. If the actual instance is not `UserDataChangedMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `UserDataChangedMessage` + * @throws ClassCastException if the instance is not `UserDataChangedMessage` + */ + public UserDataChangedMessage getUserDataChangedMessage() throws ClassCastException { + return (UserDataChangedMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `UserDeletedMessage`. If the actual instance is not `UserDeletedMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `UserDeletedMessage` + * @throws ClassCastException if the instance is not `UserDeletedMessage` + */ + public UserDeletedMessage getUserDeletedMessage() throws ClassCastException { + return (UserDeletedMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `UserUpdatedMessage`. If the actual instance is not `UserUpdatedMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `UserUpdatedMessage` + * @throws ClassCastException if the instance is not `UserUpdatedMessage` + */ + public UserUpdatedMessage getUserUpdatedMessage() throws ClassCastException { + return (UserUpdatedMessage) super.getActualInstance(); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof ActivityLogEntryMessage) { + if (getActualInstance() != null) { + joiner.add( + ((ActivityLogEntryMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof ForceKeepAliveMessage) { + if (getActualInstance() != null) { + joiner.add( + ((ForceKeepAliveMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof GeneralCommandMessage) { + if (getActualInstance() != null) { + joiner.add( + ((GeneralCommandMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_2" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof LibraryChangedMessage) { + if (getActualInstance() != null) { + joiner.add( + ((LibraryChangedMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_3" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof OutboundKeepAliveMessage) { + if (getActualInstance() != null) { + joiner.add(((OutboundKeepAliveMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_4" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof PlayMessage) { + if (getActualInstance() != null) { + joiner.add(((PlayMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_5" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof PlaystateMessage) { + if (getActualInstance() != null) { + joiner.add(((PlaystateMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_6" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof PluginInstallationCancelledMessage) { + if (getActualInstance() != null) { + joiner.add(((PluginInstallationCancelledMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_7" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof PluginInstallationCompletedMessage) { + if (getActualInstance() != null) { + joiner.add(((PluginInstallationCompletedMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_8" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof PluginInstallationFailedMessage) { + if (getActualInstance() != null) { + joiner.add(((PluginInstallationFailedMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_9" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof PluginInstallingMessage) { + if (getActualInstance() != null) { + joiner.add(((PluginInstallingMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_10" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof PluginUninstalledMessage) { + if (getActualInstance() != null) { + joiner.add(((PluginUninstalledMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_11" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof RefreshProgressMessage) { + if (getActualInstance() != null) { + joiner.add( + ((RefreshProgressMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_12" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof RestartRequiredMessage) { + if (getActualInstance() != null) { + joiner.add( + ((RestartRequiredMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_13" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof ScheduledTaskEndedMessage) { + if (getActualInstance() != null) { + joiner.add(((ScheduledTaskEndedMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_14" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof ScheduledTasksInfoMessage) { + if (getActualInstance() != null) { + joiner.add(((ScheduledTasksInfoMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_15" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof SeriesTimerCancelledMessage) { + if (getActualInstance() != null) { + joiner.add(((SeriesTimerCancelledMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_16" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof SeriesTimerCreatedMessage) { + if (getActualInstance() != null) { + joiner.add(((SeriesTimerCreatedMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_17" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof ServerRestartingMessage) { + if (getActualInstance() != null) { + joiner.add(((ServerRestartingMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_18" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof ServerShuttingDownMessage) { + if (getActualInstance() != null) { + joiner.add(((ServerShuttingDownMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_19" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof SessionsMessage) { + if (getActualInstance() != null) { + joiner.add(((SessionsMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_20" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof SyncPlayCommandMessage) { + if (getActualInstance() != null) { + joiner.add( + ((SyncPlayCommandMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_21" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof SyncPlayGroupUpdateCommandMessage) { + if (getActualInstance() != null) { + joiner.add(((SyncPlayGroupUpdateCommandMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_22" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof TimerCancelledMessage) { + if (getActualInstance() != null) { + joiner.add( + ((TimerCancelledMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_23" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof TimerCreatedMessage) { + if (getActualInstance() != null) { + joiner.add(((TimerCreatedMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_24" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof UserDataChangedMessage) { + if (getActualInstance() != null) { + joiner.add( + ((UserDataChangedMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_25" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof UserDeletedMessage) { + if (getActualInstance() != null) { + joiner.add(((UserDeletedMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_26" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof UserUpdatedMessage) { + if (getActualInstance() != null) { + joiner.add(((UserUpdatedMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_27" + suffix)); + } + return joiner.toString(); + } + return null; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PackageInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PackageInfo.java new file mode 100644 index 0000000000000..eb94695a235ab --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PackageInfo.java @@ -0,0 +1,489 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PackageInfo. + */ +@JsonPropertyOrder({ PackageInfo.JSON_PROPERTY_NAME, PackageInfo.JSON_PROPERTY_DESCRIPTION, + PackageInfo.JSON_PROPERTY_OVERVIEW, PackageInfo.JSON_PROPERTY_OWNER, PackageInfo.JSON_PROPERTY_CATEGORY, + PackageInfo.JSON_PROPERTY_GUID, PackageInfo.JSON_PROPERTY_VERSIONS, PackageInfo.JSON_PROPERTY_IMAGE_URL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PackageInfo { + public static final String JSON_PROPERTY_NAME = "name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + @org.eclipse.jdt.annotation.NonNull + private String description; + + public static final String JSON_PROPERTY_OVERVIEW = "overview"; + @org.eclipse.jdt.annotation.NonNull + private String overview; + + public static final String JSON_PROPERTY_OWNER = "owner"; + @org.eclipse.jdt.annotation.NonNull + private String owner; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + @org.eclipse.jdt.annotation.NonNull + private String category; + + public static final String JSON_PROPERTY_GUID = "guid"; + @org.eclipse.jdt.annotation.NonNull + private UUID guid; + + public static final String JSON_PROPERTY_VERSIONS = "versions"; + @org.eclipse.jdt.annotation.NonNull + private List versions = new ArrayList<>(); + + public static final String JSON_PROPERTY_IMAGE_URL = "imageUrl"; + @org.eclipse.jdt.annotation.NonNull + private String imageUrl; + + public PackageInfo() { + } + + public PackageInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public PackageInfo description(@org.eclipse.jdt.annotation.NonNull String description) { + this.description = description; + return this; + } + + /** + * Gets or sets a long description of the plugin containing features or helpful explanations. + * + * @return description + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@org.eclipse.jdt.annotation.NonNull String description) { + this.description = description; + } + + public PackageInfo overview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + return this; + } + + /** + * Gets or sets a short overview of what the plugin does. + * + * @return overview + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOverview() { + return overview; + } + + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOverview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + } + + public PackageInfo owner(@org.eclipse.jdt.annotation.NonNull String owner) { + this.owner = owner; + return this; + } + + /** + * Gets or sets the owner. + * + * @return owner + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OWNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOwner() { + return owner; + } + + @JsonProperty(JSON_PROPERTY_OWNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOwner(@org.eclipse.jdt.annotation.NonNull String owner) { + this.owner = owner; + } + + public PackageInfo category(@org.eclipse.jdt.annotation.NonNull String category) { + this.category = category; + return this; + } + + /** + * Gets or sets the category. + * + * @return category + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCategory() { + return category; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(@org.eclipse.jdt.annotation.NonNull String category) { + this.category = category; + } + + public PackageInfo guid(@org.eclipse.jdt.annotation.NonNull UUID guid) { + this.guid = guid; + return this; + } + + /** + * Gets or sets the guid of the assembly associated with this plugin. This is used to identify the proper item for + * automatic updates. + * + * @return guid + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getGuid() { + return guid; + } + + @JsonProperty(JSON_PROPERTY_GUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGuid(@org.eclipse.jdt.annotation.NonNull UUID guid) { + this.guid = guid; + } + + public PackageInfo versions(@org.eclipse.jdt.annotation.NonNull List versions) { + this.versions = versions; + return this; + } + + public PackageInfo addVersionsItem(VersionInfo versionsItem) { + if (this.versions == null) { + this.versions = new ArrayList<>(); + } + this.versions.add(versionsItem); + return this; + } + + /** + * Gets or sets the versions. + * + * @return versions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getVersions() { + return versions; + } + + @JsonProperty(JSON_PROPERTY_VERSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersions(@org.eclipse.jdt.annotation.NonNull List versions) { + this.versions = versions; + } + + public PackageInfo imageUrl(@org.eclipse.jdt.annotation.NonNull String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Gets or sets the image url for the package. + * + * @return imageUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getImageUrl() { + return imageUrl; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageUrl(@org.eclipse.jdt.annotation.NonNull String imageUrl) { + this.imageUrl = imageUrl; + } + + /** + * Return true if this PackageInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PackageInfo packageInfo = (PackageInfo) o; + return Objects.equals(this.name, packageInfo.name) && Objects.equals(this.description, packageInfo.description) + && Objects.equals(this.overview, packageInfo.overview) && Objects.equals(this.owner, packageInfo.owner) + && Objects.equals(this.category, packageInfo.category) && Objects.equals(this.guid, packageInfo.guid) + && Objects.equals(this.versions, packageInfo.versions) + && Objects.equals(this.imageUrl, packageInfo.imageUrl); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, overview, owner, category, guid, versions, imageUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PackageInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" overview: ").append(toIndentedString(overview)).append("\n"); + sb.append(" owner: ").append(toIndentedString(owner)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" guid: ").append(toIndentedString(guid)).append("\n"); + sb.append(" versions: ").append(toIndentedString(versions)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sname%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sdescription%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `overview` to the URL query string + if (getOverview() != null) { + joiner.add(String.format("%soverview%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOverview())))); + } + + // add `owner` to the URL query string + if (getOwner() != null) { + joiner.add(String.format("%sowner%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOwner())))); + } + + // add `category` to the URL query string + if (getCategory() != null) { + joiner.add(String.format("%scategory%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCategory())))); + } + + // add `guid` to the URL query string + if (getGuid() != null) { + joiner.add(String.format("%sguid%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGuid())))); + } + + // add `versions` to the URL query string + if (getVersions() != null) { + for (int i = 0; i < getVersions().size(); i++) { + if (getVersions().get(i) != null) { + joiner.add(getVersions().get(i).toUrlQueryString(String.format("%sversions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `imageUrl` to the URL query string + if (getImageUrl() != null) { + joiner.add(String.format("%simageUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageUrl())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PackageInfo instance; + + public Builder() { + this(new PackageInfo()); + } + + protected Builder(PackageInfo instance) { + this.instance = instance; + } + + public PackageInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public PackageInfo.Builder description(String description) { + this.instance.description = description; + return this; + } + + public PackageInfo.Builder overview(String overview) { + this.instance.overview = overview; + return this; + } + + public PackageInfo.Builder owner(String owner) { + this.instance.owner = owner; + return this; + } + + public PackageInfo.Builder category(String category) { + this.instance.category = category; + return this; + } + + public PackageInfo.Builder guid(UUID guid) { + this.instance.guid = guid; + return this; + } + + public PackageInfo.Builder versions(List versions) { + this.instance.versions = versions; + return this; + } + + public PackageInfo.Builder imageUrl(String imageUrl) { + this.instance.imageUrl = imageUrl; + return this; + } + + /** + * returns a built PackageInfo instance. + * + * The builder is not reusable. + */ + public PackageInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PackageInfo.Builder builder() { + return new PackageInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PackageInfo.Builder toBuilder() { + return new PackageInfo.Builder().name(getName()).description(getDescription()).overview(getOverview()) + .owner(getOwner()).category(getCategory()).guid(getGuid()).versions(getVersions()) + .imageUrl(getImageUrl()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ParentalRating.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ParentalRating.java new file mode 100644 index 0000000000000..1d98a10c625f9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ParentalRating.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class ParentalRating. + */ +@JsonPropertyOrder({ ParentalRating.JSON_PROPERTY_NAME, ParentalRating.JSON_PROPERTY_VALUE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ParentalRating { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_VALUE = "Value"; + @org.eclipse.jdt.annotation.NonNull + private Integer value; + + public ParentalRating() { + } + + public ParentalRating name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ParentalRating value(@org.eclipse.jdt.annotation.NonNull Integer value) { + this.value = value; + return this; + } + + /** + * Gets or sets the value. + * + * @return value + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@org.eclipse.jdt.annotation.NonNull Integer value) { + this.value = value; + } + + /** + * Return true if this ParentalRating object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ParentalRating parentalRating = (ParentalRating) o; + return Objects.equals(this.name, parentalRating.name) && Objects.equals(this.value, parentalRating.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentalRating {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Value` to the URL query string + if (getValue() != null) { + joiner.add(String.format("%sValue%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getValue())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ParentalRating instance; + + public Builder() { + this(new ParentalRating()); + } + + protected Builder(ParentalRating instance) { + this.instance = instance; + } + + public ParentalRating.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ParentalRating.Builder value(Integer value) { + this.instance.value = value; + return this; + } + + /** + * returns a built ParentalRating instance. + * + * The builder is not reusable. + */ + public ParentalRating build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ParentalRating.Builder builder() { + return new ParentalRating.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ParentalRating.Builder toBuilder() { + return new ParentalRating.Builder().name(getName()).value(getValue()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PathSubstitution.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PathSubstitution.java new file mode 100644 index 0000000000000..c561ad9e105f3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PathSubstitution.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines the MediaBrowser.Model.Configuration.PathSubstitution. + */ +@JsonPropertyOrder({ PathSubstitution.JSON_PROPERTY_FROM, PathSubstitution.JSON_PROPERTY_TO }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PathSubstitution { + public static final String JSON_PROPERTY_FROM = "From"; + @org.eclipse.jdt.annotation.NonNull + private String from; + + public static final String JSON_PROPERTY_TO = "To"; + @org.eclipse.jdt.annotation.NonNull + private String to; + + public PathSubstitution() { + } + + public PathSubstitution from(@org.eclipse.jdt.annotation.NonNull String from) { + this.from = from; + return this; + } + + /** + * Gets or sets the value to substitute. + * + * @return from + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFrom() { + return from; + } + + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFrom(@org.eclipse.jdt.annotation.NonNull String from) { + this.from = from; + } + + public PathSubstitution to(@org.eclipse.jdt.annotation.NonNull String to) { + this.to = to; + return this; + } + + /** + * Gets or sets the value to substitution with. + * + * @return to + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTo() { + return to; + } + + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTo(@org.eclipse.jdt.annotation.NonNull String to) { + this.to = to; + } + + /** + * Return true if this PathSubstitution object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PathSubstitution pathSubstitution = (PathSubstitution) o; + return Objects.equals(this.from, pathSubstitution.from) && Objects.equals(this.to, pathSubstitution.to); + } + + @Override + public int hashCode() { + return Objects.hash(from, to); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PathSubstitution {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `From` to the URL query string + if (getFrom() != null) { + joiner.add(String.format("%sFrom%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFrom())))); + } + + // add `To` to the URL query string + if (getTo() != null) { + joiner.add( + String.format("%sTo%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTo())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PathSubstitution instance; + + public Builder() { + this(new PathSubstitution()); + } + + protected Builder(PathSubstitution instance) { + this.instance = instance; + } + + public PathSubstitution.Builder from(String from) { + this.instance.from = from; + return this; + } + + public PathSubstitution.Builder to(String to) { + this.instance.to = to; + return this; + } + + /** + * returns a built PathSubstitution instance. + * + * The builder is not reusable. + */ + public PathSubstitution build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PathSubstitution.Builder builder() { + return new PathSubstitution.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PathSubstitution.Builder toBuilder() { + return new PathSubstitution.Builder().from(getFrom()).to(getTo()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PersonKind.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PersonKind.java new file mode 100644 index 0000000000000..42c5045e42f52 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PersonKind.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The person kind. + */ +public enum PersonKind { + + UNKNOWN("Unknown"), + + ACTOR("Actor"), + + DIRECTOR("Director"), + + COMPOSER("Composer"), + + WRITER("Writer"), + + GUEST_STAR("GuestStar"), + + PRODUCER("Producer"), + + CONDUCTOR("Conductor"), + + LYRICIST("Lyricist"), + + ARRANGER("Arranger"), + + ENGINEER("Engineer"), + + MIXER("Mixer"), + + REMIXER("Remixer"), + + CREATOR("Creator"), + + ARTIST("Artist"), + + ALBUM_ARTIST("AlbumArtist"), + + AUTHOR("Author"), + + ILLUSTRATOR("Illustrator"), + + PENCILLER("Penciller"), + + INKER("Inker"), + + COLORIST("Colorist"), + + LETTERER("Letterer"), + + COVER_ARTIST("CoverArtist"), + + EDITOR("Editor"), + + TRANSLATOR("Translator"); + + private String value; + + PersonKind(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PersonKind fromValue(String value) { + for (PersonKind b : PersonKind.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PersonLookupInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PersonLookupInfo.java new file mode 100644 index 0000000000000..5689537fd07d4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PersonLookupInfo.java @@ -0,0 +1,617 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * PersonLookupInfo + */ +@JsonPropertyOrder({ PersonLookupInfo.JSON_PROPERTY_NAME, PersonLookupInfo.JSON_PROPERTY_ORIGINAL_TITLE, + PersonLookupInfo.JSON_PROPERTY_PATH, PersonLookupInfo.JSON_PROPERTY_METADATA_LANGUAGE, + PersonLookupInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, PersonLookupInfo.JSON_PROPERTY_PROVIDER_IDS, + PersonLookupInfo.JSON_PROPERTY_YEAR, PersonLookupInfo.JSON_PROPERTY_INDEX_NUMBER, + PersonLookupInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, PersonLookupInfo.JSON_PROPERTY_PREMIERE_DATE, + PersonLookupInfo.JSON_PROPERTY_IS_AUTOMATED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PersonLookupInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public PersonLookupInfo() { + } + + public PersonLookupInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public PersonLookupInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public PersonLookupInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public PersonLookupInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public PersonLookupInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public PersonLookupInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public PersonLookupInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public PersonLookupInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public PersonLookupInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public PersonLookupInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public PersonLookupInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public PersonLookupInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + /** + * Return true if this PersonLookupInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonLookupInfo personLookupInfo = (PersonLookupInfo) o; + return Objects.equals(this.name, personLookupInfo.name) + && Objects.equals(this.originalTitle, personLookupInfo.originalTitle) + && Objects.equals(this.path, personLookupInfo.path) + && Objects.equals(this.metadataLanguage, personLookupInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, personLookupInfo.metadataCountryCode) + && Objects.equals(this.providerIds, personLookupInfo.providerIds) + && Objects.equals(this.year, personLookupInfo.year) + && Objects.equals(this.indexNumber, personLookupInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, personLookupInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, personLookupInfo.premiereDate) + && Objects.equals(this.isAutomated, personLookupInfo.isAutomated); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonLookupInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PersonLookupInfo instance; + + public Builder() { + this(new PersonLookupInfo()); + } + + protected Builder(PersonLookupInfo instance) { + this.instance = instance; + } + + public PersonLookupInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public PersonLookupInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public PersonLookupInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public PersonLookupInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public PersonLookupInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public PersonLookupInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public PersonLookupInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public PersonLookupInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public PersonLookupInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public PersonLookupInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public PersonLookupInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + /** + * returns a built PersonLookupInfo instance. + * + * The builder is not reusable. + */ + public PersonLookupInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PersonLookupInfo.Builder builder() { + return new PersonLookupInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PersonLookupInfo.Builder toBuilder() { + return new PersonLookupInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()) + .isAutomated(getIsAutomated()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PersonLookupInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PersonLookupInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..543c84e03051d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PersonLookupInfoRemoteSearchQuery.java @@ -0,0 +1,320 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * PersonLookupInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ PersonLookupInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + PersonLookupInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, + PersonLookupInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + PersonLookupInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PersonLookupInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private PersonLookupInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public PersonLookupInfoRemoteSearchQuery() { + } + + public PersonLookupInfoRemoteSearchQuery searchInfo( + @org.eclipse.jdt.annotation.NonNull PersonLookupInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PersonLookupInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull PersonLookupInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public PersonLookupInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public PersonLookupInfoRemoteSearchQuery searchProviderName( + @org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public PersonLookupInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this PersonLookupInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonLookupInfoRemoteSearchQuery personLookupInfoRemoteSearchQuery = (PersonLookupInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, personLookupInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, personLookupInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, personLookupInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, + personLookupInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonLookupInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PersonLookupInfoRemoteSearchQuery instance; + + public Builder() { + this(new PersonLookupInfoRemoteSearchQuery()); + } + + protected Builder(PersonLookupInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public PersonLookupInfoRemoteSearchQuery.Builder searchInfo(PersonLookupInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public PersonLookupInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public PersonLookupInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public PersonLookupInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built PersonLookupInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public PersonLookupInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PersonLookupInfoRemoteSearchQuery.Builder builder() { + return new PersonLookupInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PersonLookupInfoRemoteSearchQuery.Builder toBuilder() { + return new PersonLookupInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PinRedeemResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PinRedeemResult.java new file mode 100644 index 0000000000000..4c3095d1874d4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PinRedeemResult.java @@ -0,0 +1,245 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * PinRedeemResult + */ +@JsonPropertyOrder({ PinRedeemResult.JSON_PROPERTY_SUCCESS, PinRedeemResult.JSON_PROPERTY_USERS_RESET }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PinRedeemResult { + public static final String JSON_PROPERTY_SUCCESS = "Success"; + @org.eclipse.jdt.annotation.NonNull + private Boolean success; + + public static final String JSON_PROPERTY_USERS_RESET = "UsersReset"; + @org.eclipse.jdt.annotation.NonNull + private List usersReset = new ArrayList<>(); + + public PinRedeemResult() { + } + + public PinRedeemResult success(@org.eclipse.jdt.annotation.NonNull Boolean success) { + this.success = success; + return this; + } + + /** + * Gets or sets a value indicating whether this MediaBrowser.Model.Users.PinRedeemResult is success. + * + * @return success + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUCCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSuccess() { + return success; + } + + @JsonProperty(JSON_PROPERTY_SUCCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSuccess(@org.eclipse.jdt.annotation.NonNull Boolean success) { + this.success = success; + } + + public PinRedeemResult usersReset(@org.eclipse.jdt.annotation.NonNull List usersReset) { + this.usersReset = usersReset; + return this; + } + + public PinRedeemResult addUsersResetItem(String usersResetItem) { + if (this.usersReset == null) { + this.usersReset = new ArrayList<>(); + } + this.usersReset.add(usersResetItem); + return this; + } + + /** + * Gets or sets the users reset. + * + * @return usersReset + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USERS_RESET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getUsersReset() { + return usersReset; + } + + @JsonProperty(JSON_PROPERTY_USERS_RESET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsersReset(@org.eclipse.jdt.annotation.NonNull List usersReset) { + this.usersReset = usersReset; + } + + /** + * Return true if this PinRedeemResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PinRedeemResult pinRedeemResult = (PinRedeemResult) o; + return Objects.equals(this.success, pinRedeemResult.success) + && Objects.equals(this.usersReset, pinRedeemResult.usersReset); + } + + @Override + public int hashCode() { + return Objects.hash(success, usersReset); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PinRedeemResult {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" usersReset: ").append(toIndentedString(usersReset)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Success` to the URL query string + if (getSuccess() != null) { + joiner.add(String.format("%sSuccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSuccess())))); + } + + // add `UsersReset` to the URL query string + if (getUsersReset() != null) { + for (int i = 0; i < getUsersReset().size(); i++) { + joiner.add(String.format("%sUsersReset%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getUsersReset().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private PinRedeemResult instance; + + public Builder() { + this(new PinRedeemResult()); + } + + protected Builder(PinRedeemResult instance) { + this.instance = instance; + } + + public PinRedeemResult.Builder success(Boolean success) { + this.instance.success = success; + return this; + } + + public PinRedeemResult.Builder usersReset(List usersReset) { + this.instance.usersReset = usersReset; + return this; + } + + /** + * returns a built PinRedeemResult instance. + * + * The builder is not reusable. + */ + public PinRedeemResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PinRedeemResult.Builder builder() { + return new PinRedeemResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PinRedeemResult.Builder toBuilder() { + return new PinRedeemResult.Builder().success(getSuccess()).usersReset(getUsersReset()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PingRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PingRequestDto.java new file mode 100644 index 0000000000000..b481e2fd51f6a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PingRequestDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PingRequestDto. + */ +@JsonPropertyOrder({ PingRequestDto.JSON_PROPERTY_PING }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PingRequestDto { + public static final String JSON_PROPERTY_PING = "Ping"; + @org.eclipse.jdt.annotation.NonNull + private Long ping; + + public PingRequestDto() { + } + + public PingRequestDto ping(@org.eclipse.jdt.annotation.NonNull Long ping) { + this.ping = ping; + return this; + } + + /** + * Gets or sets the ping time. + * + * @return ping + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPing() { + return ping; + } + + @JsonProperty(JSON_PROPERTY_PING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPing(@org.eclipse.jdt.annotation.NonNull Long ping) { + this.ping = ping; + } + + /** + * Return true if this PingRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PingRequestDto pingRequestDto = (PingRequestDto) o; + return Objects.equals(this.ping, pingRequestDto.ping); + } + + @Override + public int hashCode() { + return Objects.hash(ping); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PingRequestDto {\n"); + sb.append(" ping: ").append(toIndentedString(ping)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Ping` to the URL query string + if (getPing() != null) { + joiner.add(String.format("%sPing%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPing())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PingRequestDto instance; + + public Builder() { + this(new PingRequestDto()); + } + + protected Builder(PingRequestDto instance) { + this.instance = instance; + } + + public PingRequestDto.Builder ping(Long ping) { + this.instance.ping = ping; + return this; + } + + /** + * returns a built PingRequestDto instance. + * + * The builder is not reusable. + */ + public PingRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PingRequestDto.Builder builder() { + return new PingRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PingRequestDto.Builder toBuilder() { + return new PingRequestDto.Builder().ping(getPing()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayAccess.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayAccess.java new file mode 100644 index 0000000000000..a270c5de2aaa6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayAccess.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets PlayAccess + */ +public enum PlayAccess { + + FULL("Full"), + + NONE("None"); + + private String value; + + PlayAccess(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PlayAccess fromValue(String value) { + for (PlayAccess b : PlayAccess.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayCommand.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayCommand.java new file mode 100644 index 0000000000000..85ec029342cca --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayCommand.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum PlayCommand. + */ +public enum PlayCommand { + + PLAY_NOW("PlayNow"), + + PLAY_NEXT("PlayNext"), + + PLAY_LAST("PlayLast"), + + PLAY_INSTANT_MIX("PlayInstantMix"), + + PLAY_SHUFFLE("PlayShuffle"); + + private String value; + + PlayCommand(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PlayCommand fromValue(String value) { + for (PlayCommand b : PlayCommand.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayMessage.java new file mode 100644 index 0000000000000..0b4d3aa770fd9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayMessage.java @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Play command websocket message. + */ +@JsonPropertyOrder({ PlayMessage.JSON_PROPERTY_DATA, PlayMessage.JSON_PROPERTY_MESSAGE_ID, + PlayMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlayMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private PlayRequest data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.PLAY; + + public PlayMessage() { + } + + @JsonCreator + public PlayMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public PlayMessage data(@org.eclipse.jdt.annotation.NonNull PlayRequest data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlayRequest getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull PlayRequest data) { + this.data = data; + } + + public PlayMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this PlayMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlayMessage playMessage = (PlayMessage) o; + return Objects.equals(this.data, playMessage.data) && Objects.equals(this.messageId, playMessage.messageId) + && Objects.equals(this.messageType, playMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlayMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlayMessage instance; + + public Builder() { + this(new PlayMessage()); + } + + protected Builder(PlayMessage instance) { + this.instance = instance; + } + + public PlayMessage.Builder data(PlayRequest data) { + this.instance.data = data; + return this; + } + + public PlayMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public PlayMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built PlayMessage instance. + * + * The builder is not reusable. + */ + public PlayMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlayMessage.Builder builder() { + return new PlayMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlayMessage.Builder toBuilder() { + return new PlayMessage.Builder().data(getData()).messageId(getMessageId()).messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayMethod.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayMethod.java new file mode 100644 index 0000000000000..7929e0eefc56b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayMethod.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets PlayMethod + */ +public enum PlayMethod { + + TRANSCODE("Transcode"), + + DIRECT_STREAM("DirectStream"), + + DIRECT_PLAY("DirectPlay"); + + private String value; + + PlayMethod(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PlayMethod fromValue(String value) { + for (PlayMethod b : PlayMethod.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayQueueUpdate.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayQueueUpdate.java new file mode 100644 index 0000000000000..d84422222cf10 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayQueueUpdate.java @@ -0,0 +1,493 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PlayQueueUpdate. + */ +@JsonPropertyOrder({ PlayQueueUpdate.JSON_PROPERTY_REASON, PlayQueueUpdate.JSON_PROPERTY_LAST_UPDATE, + PlayQueueUpdate.JSON_PROPERTY_PLAYLIST, PlayQueueUpdate.JSON_PROPERTY_PLAYING_ITEM_INDEX, + PlayQueueUpdate.JSON_PROPERTY_START_POSITION_TICKS, PlayQueueUpdate.JSON_PROPERTY_IS_PLAYING, + PlayQueueUpdate.JSON_PROPERTY_SHUFFLE_MODE, PlayQueueUpdate.JSON_PROPERTY_REPEAT_MODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlayQueueUpdate { + public static final String JSON_PROPERTY_REASON = "Reason"; + @org.eclipse.jdt.annotation.NonNull + private PlayQueueUpdateReason reason; + + public static final String JSON_PROPERTY_LAST_UPDATE = "LastUpdate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime lastUpdate; + + public static final String JSON_PROPERTY_PLAYLIST = "Playlist"; + @org.eclipse.jdt.annotation.NonNull + private List playlist = new ArrayList<>(); + + public static final String JSON_PROPERTY_PLAYING_ITEM_INDEX = "PlayingItemIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer playingItemIndex; + + public static final String JSON_PROPERTY_START_POSITION_TICKS = "StartPositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long startPositionTicks; + + public static final String JSON_PROPERTY_IS_PLAYING = "IsPlaying"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPlaying; + + public static final String JSON_PROPERTY_SHUFFLE_MODE = "ShuffleMode"; + @org.eclipse.jdt.annotation.NonNull + private GroupShuffleMode shuffleMode; + + public static final String JSON_PROPERTY_REPEAT_MODE = "RepeatMode"; + @org.eclipse.jdt.annotation.NonNull + private GroupRepeatMode repeatMode; + + public PlayQueueUpdate() { + } + + public PlayQueueUpdate reason(@org.eclipse.jdt.annotation.NonNull PlayQueueUpdateReason reason) { + this.reason = reason; + return this; + } + + /** + * Gets the request type that originated this update. + * + * @return reason + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlayQueueUpdateReason getReason() { + return reason; + } + + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReason(@org.eclipse.jdt.annotation.NonNull PlayQueueUpdateReason reason) { + this.reason = reason; + } + + public PlayQueueUpdate lastUpdate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastUpdate) { + this.lastUpdate = lastUpdate; + return this; + } + + /** + * Gets the UTC time of the last change to the playing queue. + * + * @return lastUpdate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_UPDATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastUpdate() { + return lastUpdate; + } + + @JsonProperty(JSON_PROPERTY_LAST_UPDATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastUpdate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastUpdate) { + this.lastUpdate = lastUpdate; + } + + public PlayQueueUpdate playlist(@org.eclipse.jdt.annotation.NonNull List playlist) { + this.playlist = playlist; + return this; + } + + public PlayQueueUpdate addPlaylistItem(SyncPlayQueueItem playlistItem) { + if (this.playlist == null) { + this.playlist = new ArrayList<>(); + } + this.playlist.add(playlistItem); + return this; + } + + /** + * Gets the playlist. + * + * @return playlist + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPlaylist() { + return playlist; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylist(@org.eclipse.jdt.annotation.NonNull List playlist) { + this.playlist = playlist; + } + + public PlayQueueUpdate playingItemIndex(@org.eclipse.jdt.annotation.NonNull Integer playingItemIndex) { + this.playingItemIndex = playingItemIndex; + return this; + } + + /** + * Gets the playing item index in the playlist. + * + * @return playingItemIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYING_ITEM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPlayingItemIndex() { + return playingItemIndex; + } + + @JsonProperty(JSON_PROPERTY_PLAYING_ITEM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayingItemIndex(@org.eclipse.jdt.annotation.NonNull Integer playingItemIndex) { + this.playingItemIndex = playingItemIndex; + } + + public PlayQueueUpdate startPositionTicks(@org.eclipse.jdt.annotation.NonNull Long startPositionTicks) { + this.startPositionTicks = startPositionTicks; + return this; + } + + /** + * Gets the start position ticks. + * + * @return startPositionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartPositionTicks() { + return startPositionTicks; + } + + @JsonProperty(JSON_PROPERTY_START_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartPositionTicks(@org.eclipse.jdt.annotation.NonNull Long startPositionTicks) { + this.startPositionTicks = startPositionTicks; + } + + public PlayQueueUpdate isPlaying(@org.eclipse.jdt.annotation.NonNull Boolean isPlaying) { + this.isPlaying = isPlaying; + return this; + } + + /** + * Gets a value indicating whether the current item is playing. + * + * @return isPlaying + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PLAYING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPlaying() { + return isPlaying; + } + + @JsonProperty(JSON_PROPERTY_IS_PLAYING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPlaying(@org.eclipse.jdt.annotation.NonNull Boolean isPlaying) { + this.isPlaying = isPlaying; + } + + public PlayQueueUpdate shuffleMode(@org.eclipse.jdt.annotation.NonNull GroupShuffleMode shuffleMode) { + this.shuffleMode = shuffleMode; + return this; + } + + /** + * Gets the shuffle mode. + * + * @return shuffleMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SHUFFLE_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupShuffleMode getShuffleMode() { + return shuffleMode; + } + + @JsonProperty(JSON_PROPERTY_SHUFFLE_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShuffleMode(@org.eclipse.jdt.annotation.NonNull GroupShuffleMode shuffleMode) { + this.shuffleMode = shuffleMode; + } + + public PlayQueueUpdate repeatMode(@org.eclipse.jdt.annotation.NonNull GroupRepeatMode repeatMode) { + this.repeatMode = repeatMode; + return this; + } + + /** + * Gets the repeat mode. + * + * @return repeatMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REPEAT_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupRepeatMode getRepeatMode() { + return repeatMode; + } + + @JsonProperty(JSON_PROPERTY_REPEAT_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepeatMode(@org.eclipse.jdt.annotation.NonNull GroupRepeatMode repeatMode) { + this.repeatMode = repeatMode; + } + + /** + * Return true if this PlayQueueUpdate object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlayQueueUpdate playQueueUpdate = (PlayQueueUpdate) o; + return Objects.equals(this.reason, playQueueUpdate.reason) + && Objects.equals(this.lastUpdate, playQueueUpdate.lastUpdate) + && Objects.equals(this.playlist, playQueueUpdate.playlist) + && Objects.equals(this.playingItemIndex, playQueueUpdate.playingItemIndex) + && Objects.equals(this.startPositionTicks, playQueueUpdate.startPositionTicks) + && Objects.equals(this.isPlaying, playQueueUpdate.isPlaying) + && Objects.equals(this.shuffleMode, playQueueUpdate.shuffleMode) + && Objects.equals(this.repeatMode, playQueueUpdate.repeatMode); + } + + @Override + public int hashCode() { + return Objects.hash(reason, lastUpdate, playlist, playingItemIndex, startPositionTicks, isPlaying, shuffleMode, + repeatMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlayQueueUpdate {\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" lastUpdate: ").append(toIndentedString(lastUpdate)).append("\n"); + sb.append(" playlist: ").append(toIndentedString(playlist)).append("\n"); + sb.append(" playingItemIndex: ").append(toIndentedString(playingItemIndex)).append("\n"); + sb.append(" startPositionTicks: ").append(toIndentedString(startPositionTicks)).append("\n"); + sb.append(" isPlaying: ").append(toIndentedString(isPlaying)).append("\n"); + sb.append(" shuffleMode: ").append(toIndentedString(shuffleMode)).append("\n"); + sb.append(" repeatMode: ").append(toIndentedString(repeatMode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Reason` to the URL query string + if (getReason() != null) { + joiner.add(String.format("%sReason%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getReason())))); + } + + // add `LastUpdate` to the URL query string + if (getLastUpdate() != null) { + joiner.add(String.format("%sLastUpdate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastUpdate())))); + } + + // add `Playlist` to the URL query string + if (getPlaylist() != null) { + for (int i = 0; i < getPlaylist().size(); i++) { + if (getPlaylist().get(i) != null) { + joiner.add(getPlaylist().get(i).toUrlQueryString(String.format("%sPlaylist%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `PlayingItemIndex` to the URL query string + if (getPlayingItemIndex() != null) { + joiner.add(String.format("%sPlayingItemIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayingItemIndex())))); + } + + // add `StartPositionTicks` to the URL query string + if (getStartPositionTicks() != null) { + joiner.add(String.format("%sStartPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartPositionTicks())))); + } + + // add `IsPlaying` to the URL query string + if (getIsPlaying() != null) { + joiner.add(String.format("%sIsPlaying%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPlaying())))); + } + + // add `ShuffleMode` to the URL query string + if (getShuffleMode() != null) { + joiner.add(String.format("%sShuffleMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getShuffleMode())))); + } + + // add `RepeatMode` to the URL query string + if (getRepeatMode() != null) { + joiner.add(String.format("%sRepeatMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRepeatMode())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlayQueueUpdate instance; + + public Builder() { + this(new PlayQueueUpdate()); + } + + protected Builder(PlayQueueUpdate instance) { + this.instance = instance; + } + + public PlayQueueUpdate.Builder reason(PlayQueueUpdateReason reason) { + this.instance.reason = reason; + return this; + } + + public PlayQueueUpdate.Builder lastUpdate(OffsetDateTime lastUpdate) { + this.instance.lastUpdate = lastUpdate; + return this; + } + + public PlayQueueUpdate.Builder playlist(List playlist) { + this.instance.playlist = playlist; + return this; + } + + public PlayQueueUpdate.Builder playingItemIndex(Integer playingItemIndex) { + this.instance.playingItemIndex = playingItemIndex; + return this; + } + + public PlayQueueUpdate.Builder startPositionTicks(Long startPositionTicks) { + this.instance.startPositionTicks = startPositionTicks; + return this; + } + + public PlayQueueUpdate.Builder isPlaying(Boolean isPlaying) { + this.instance.isPlaying = isPlaying; + return this; + } + + public PlayQueueUpdate.Builder shuffleMode(GroupShuffleMode shuffleMode) { + this.instance.shuffleMode = shuffleMode; + return this; + } + + public PlayQueueUpdate.Builder repeatMode(GroupRepeatMode repeatMode) { + this.instance.repeatMode = repeatMode; + return this; + } + + /** + * returns a built PlayQueueUpdate instance. + * + * The builder is not reusable. + */ + public PlayQueueUpdate build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlayQueueUpdate.Builder builder() { + return new PlayQueueUpdate.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlayQueueUpdate.Builder toBuilder() { + return new PlayQueueUpdate.Builder().reason(getReason()).lastUpdate(getLastUpdate()).playlist(getPlaylist()) + .playingItemIndex(getPlayingItemIndex()).startPositionTicks(getStartPositionTicks()) + .isPlaying(getIsPlaying()).shuffleMode(getShuffleMode()).repeatMode(getRepeatMode()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayQueueUpdateGroupUpdate.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayQueueUpdateGroupUpdate.java new file mode 100644 index 0000000000000..0637286376bdd --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayQueueUpdateGroupUpdate.java @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class GroupUpdate. + */ +@JsonPropertyOrder({ PlayQueueUpdateGroupUpdate.JSON_PROPERTY_GROUP_ID, PlayQueueUpdateGroupUpdate.JSON_PROPERTY_TYPE, + PlayQueueUpdateGroupUpdate.JSON_PROPERTY_DATA }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlayQueueUpdateGroupUpdate { + public static final String JSON_PROPERTY_GROUP_ID = "GroupId"; + @org.eclipse.jdt.annotation.NonNull + private UUID groupId; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private GroupUpdateType type; + + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private PlayQueueUpdate data; + + public PlayQueueUpdateGroupUpdate() { + } + + @JsonCreator + public PlayQueueUpdateGroupUpdate(@JsonProperty(JSON_PROPERTY_GROUP_ID) UUID groupId) { + this(); + this.groupId = groupId; + } + + /** + * Gets the group identifier. + * + * @return groupId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getGroupId() { + return groupId; + } + + public PlayQueueUpdateGroupUpdate type(@org.eclipse.jdt.annotation.NonNull GroupUpdateType type) { + this.type = type; + return this; + } + + /** + * Gets the update type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupUpdateType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull GroupUpdateType type) { + this.type = type; + } + + public PlayQueueUpdateGroupUpdate data(@org.eclipse.jdt.annotation.NonNull PlayQueueUpdate data) { + this.data = data; + return this; + } + + /** + * Gets the update data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlayQueueUpdate getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull PlayQueueUpdate data) { + this.data = data; + } + + /** + * Return true if this PlayQueueUpdateGroupUpdate object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlayQueueUpdateGroupUpdate playQueueUpdateGroupUpdate = (PlayQueueUpdateGroupUpdate) o; + return Objects.equals(this.groupId, playQueueUpdateGroupUpdate.groupId) + && Objects.equals(this.type, playQueueUpdateGroupUpdate.type) + && Objects.equals(this.data, playQueueUpdateGroupUpdate.data); + } + + @Override + public int hashCode() { + return Objects.hash(groupId, type, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlayQueueUpdateGroupUpdate {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `GroupId` to the URL query string + if (getGroupId() != null) { + joiner.add(String.format("%sGroupId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGroupId())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlayQueueUpdateGroupUpdate instance; + + public Builder() { + this(new PlayQueueUpdateGroupUpdate()); + } + + protected Builder(PlayQueueUpdateGroupUpdate instance) { + this.instance = instance; + } + + public PlayQueueUpdateGroupUpdate.Builder groupId(UUID groupId) { + this.instance.groupId = groupId; + return this; + } + + public PlayQueueUpdateGroupUpdate.Builder type(GroupUpdateType type) { + this.instance.type = type; + return this; + } + + public PlayQueueUpdateGroupUpdate.Builder data(PlayQueueUpdate data) { + this.instance.data = data; + return this; + } + + /** + * returns a built PlayQueueUpdateGroupUpdate instance. + * + * The builder is not reusable. + */ + public PlayQueueUpdateGroupUpdate build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlayQueueUpdateGroupUpdate.Builder builder() { + return new PlayQueueUpdateGroupUpdate.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlayQueueUpdateGroupUpdate.Builder toBuilder() { + return new PlayQueueUpdateGroupUpdate.Builder().groupId(getGroupId()).type(getType()).data(getData()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayQueueUpdateReason.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayQueueUpdateReason.java new file mode 100644 index 0000000000000..fcfba75fdd86b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayQueueUpdateReason.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum PlayQueueUpdateReason. + */ +public enum PlayQueueUpdateReason { + + NEW_PLAYLIST("NewPlaylist"), + + SET_CURRENT_ITEM("SetCurrentItem"), + + REMOVE_ITEMS("RemoveItems"), + + MOVE_ITEM("MoveItem"), + + QUEUE("Queue"), + + QUEUE_NEXT("QueueNext"), + + NEXT_ITEM("NextItem"), + + PREVIOUS_ITEM("PreviousItem"), + + REPEAT_MODE("RepeatMode"), + + SHUFFLE_MODE("ShuffleMode"); + + private String value; + + PlayQueueUpdateReason(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PlayQueueUpdateReason fromValue(String value) { + for (PlayQueueUpdateReason b : PlayQueueUpdateReason.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayRequest.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayRequest.java new file mode 100644 index 0000000000000..030f5881950ab --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayRequest.java @@ -0,0 +1,495 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PlayRequest. + */ +@JsonPropertyOrder({ PlayRequest.JSON_PROPERTY_ITEM_IDS, PlayRequest.JSON_PROPERTY_START_POSITION_TICKS, + PlayRequest.JSON_PROPERTY_PLAY_COMMAND, PlayRequest.JSON_PROPERTY_CONTROLLING_USER_ID, + PlayRequest.JSON_PROPERTY_SUBTITLE_STREAM_INDEX, PlayRequest.JSON_PROPERTY_AUDIO_STREAM_INDEX, + PlayRequest.JSON_PROPERTY_MEDIA_SOURCE_ID, PlayRequest.JSON_PROPERTY_START_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlayRequest { + public static final String JSON_PROPERTY_ITEM_IDS = "ItemIds"; + @org.eclipse.jdt.annotation.NonNull + private List itemIds; + + public static final String JSON_PROPERTY_START_POSITION_TICKS = "StartPositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long startPositionTicks; + + public static final String JSON_PROPERTY_PLAY_COMMAND = "PlayCommand"; + @org.eclipse.jdt.annotation.NonNull + private PlayCommand playCommand; + + public static final String JSON_PROPERTY_CONTROLLING_USER_ID = "ControllingUserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID controllingUserId; + + public static final String JSON_PROPERTY_SUBTITLE_STREAM_INDEX = "SubtitleStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer subtitleStreamIndex; + + public static final String JSON_PROPERTY_AUDIO_STREAM_INDEX = "AudioStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer audioStreamIndex; + + public static final String JSON_PROPERTY_MEDIA_SOURCE_ID = "MediaSourceId"; + @org.eclipse.jdt.annotation.NonNull + private String mediaSourceId; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public PlayRequest() { + } + + public PlayRequest itemIds(@org.eclipse.jdt.annotation.NonNull List itemIds) { + this.itemIds = itemIds; + return this; + } + + public PlayRequest addItemIdsItem(UUID itemIdsItem) { + if (this.itemIds == null) { + this.itemIds = new ArrayList<>(); + } + this.itemIds.add(itemIdsItem); + return this; + } + + /** + * Gets or sets the item ids. + * + * @return itemIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItemIds() { + return itemIds; + } + + @JsonProperty(JSON_PROPERTY_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemIds(@org.eclipse.jdt.annotation.NonNull List itemIds) { + this.itemIds = itemIds; + } + + public PlayRequest startPositionTicks(@org.eclipse.jdt.annotation.NonNull Long startPositionTicks) { + this.startPositionTicks = startPositionTicks; + return this; + } + + /** + * Gets or sets the start position ticks that the first item should be played at. + * + * @return startPositionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartPositionTicks() { + return startPositionTicks; + } + + @JsonProperty(JSON_PROPERTY_START_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartPositionTicks(@org.eclipse.jdt.annotation.NonNull Long startPositionTicks) { + this.startPositionTicks = startPositionTicks; + } + + public PlayRequest playCommand(@org.eclipse.jdt.annotation.NonNull PlayCommand playCommand) { + this.playCommand = playCommand; + return this; + } + + /** + * Gets or sets the play command. + * + * @return playCommand + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlayCommand getPlayCommand() { + return playCommand; + } + + @JsonProperty(JSON_PROPERTY_PLAY_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayCommand(@org.eclipse.jdt.annotation.NonNull PlayCommand playCommand) { + this.playCommand = playCommand; + } + + public PlayRequest controllingUserId(@org.eclipse.jdt.annotation.NonNull UUID controllingUserId) { + this.controllingUserId = controllingUserId; + return this; + } + + /** + * Gets or sets the controlling user identifier. + * + * @return controllingUserId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTROLLING_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getControllingUserId() { + return controllingUserId; + } + + @JsonProperty(JSON_PROPERTY_CONTROLLING_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setControllingUserId(@org.eclipse.jdt.annotation.NonNull UUID controllingUserId) { + this.controllingUserId = controllingUserId; + } + + public PlayRequest subtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + /** + * Get subtitleStreamIndex + * + * @return subtitleStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSubtitleStreamIndex() { + return subtitleStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + } + + public PlayRequest audioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + return this; + } + + /** + * Get audioStreamIndex + * + * @return audioStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAudioStreamIndex() { + return audioStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + } + + public PlayRequest mediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + return this; + } + + /** + * Get mediaSourceId + * + * @return mediaSourceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMediaSourceId() { + return mediaSourceId; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + } + + public PlayRequest startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Get startIndex + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + /** + * Return true if this PlayRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlayRequest playRequest = (PlayRequest) o; + return Objects.equals(this.itemIds, playRequest.itemIds) + && Objects.equals(this.startPositionTicks, playRequest.startPositionTicks) + && Objects.equals(this.playCommand, playRequest.playCommand) + && Objects.equals(this.controllingUserId, playRequest.controllingUserId) + && Objects.equals(this.subtitleStreamIndex, playRequest.subtitleStreamIndex) + && Objects.equals(this.audioStreamIndex, playRequest.audioStreamIndex) + && Objects.equals(this.mediaSourceId, playRequest.mediaSourceId) + && Objects.equals(this.startIndex, playRequest.startIndex); + } + + @Override + public int hashCode() { + return Objects.hash(itemIds, startPositionTicks, playCommand, controllingUserId, subtitleStreamIndex, + audioStreamIndex, mediaSourceId, startIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlayRequest {\n"); + sb.append(" itemIds: ").append(toIndentedString(itemIds)).append("\n"); + sb.append(" startPositionTicks: ").append(toIndentedString(startPositionTicks)).append("\n"); + sb.append(" playCommand: ").append(toIndentedString(playCommand)).append("\n"); + sb.append(" controllingUserId: ").append(toIndentedString(controllingUserId)).append("\n"); + sb.append(" subtitleStreamIndex: ").append(toIndentedString(subtitleStreamIndex)).append("\n"); + sb.append(" audioStreamIndex: ").append(toIndentedString(audioStreamIndex)).append("\n"); + sb.append(" mediaSourceId: ").append(toIndentedString(mediaSourceId)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ItemIds` to the URL query string + if (getItemIds() != null) { + for (int i = 0; i < getItemIds().size(); i++) { + if (getItemIds().get(i) != null) { + joiner.add(String.format("%sItemIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getItemIds().get(i))))); + } + } + } + + // add `StartPositionTicks` to the URL query string + if (getStartPositionTicks() != null) { + joiner.add(String.format("%sStartPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartPositionTicks())))); + } + + // add `PlayCommand` to the URL query string + if (getPlayCommand() != null) { + joiner.add(String.format("%sPlayCommand%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayCommand())))); + } + + // add `ControllingUserId` to the URL query string + if (getControllingUserId() != null) { + joiner.add(String.format("%sControllingUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getControllingUserId())))); + } + + // add `SubtitleStreamIndex` to the URL query string + if (getSubtitleStreamIndex() != null) { + joiner.add(String.format("%sSubtitleStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleStreamIndex())))); + } + + // add `AudioStreamIndex` to the URL query string + if (getAudioStreamIndex() != null) { + joiner.add(String.format("%sAudioStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioStreamIndex())))); + } + + // add `MediaSourceId` to the URL query string + if (getMediaSourceId() != null) { + joiner.add(String.format("%sMediaSourceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaSourceId())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlayRequest instance; + + public Builder() { + this(new PlayRequest()); + } + + protected Builder(PlayRequest instance) { + this.instance = instance; + } + + public PlayRequest.Builder itemIds(List itemIds) { + this.instance.itemIds = itemIds; + return this; + } + + public PlayRequest.Builder startPositionTicks(Long startPositionTicks) { + this.instance.startPositionTicks = startPositionTicks; + return this; + } + + public PlayRequest.Builder playCommand(PlayCommand playCommand) { + this.instance.playCommand = playCommand; + return this; + } + + public PlayRequest.Builder controllingUserId(UUID controllingUserId) { + this.instance.controllingUserId = controllingUserId; + return this; + } + + public PlayRequest.Builder subtitleStreamIndex(Integer subtitleStreamIndex) { + this.instance.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + public PlayRequest.Builder audioStreamIndex(Integer audioStreamIndex) { + this.instance.audioStreamIndex = audioStreamIndex; + return this; + } + + public PlayRequest.Builder mediaSourceId(String mediaSourceId) { + this.instance.mediaSourceId = mediaSourceId; + return this; + } + + public PlayRequest.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + /** + * returns a built PlayRequest instance. + * + * The builder is not reusable. + */ + public PlayRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlayRequest.Builder builder() { + return new PlayRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlayRequest.Builder toBuilder() { + return new PlayRequest.Builder().itemIds(getItemIds()).startPositionTicks(getStartPositionTicks()) + .playCommand(getPlayCommand()).controllingUserId(getControllingUserId()) + .subtitleStreamIndex(getSubtitleStreamIndex()).audioStreamIndex(getAudioStreamIndex()) + .mediaSourceId(getMediaSourceId()).startIndex(getStartIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayRequestDto.java new file mode 100644 index 0000000000000..87e7a367eb7ef --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayRequestDto.java @@ -0,0 +1,290 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PlayRequestDto. + */ +@JsonPropertyOrder({ PlayRequestDto.JSON_PROPERTY_PLAYING_QUEUE, PlayRequestDto.JSON_PROPERTY_PLAYING_ITEM_POSITION, + PlayRequestDto.JSON_PROPERTY_START_POSITION_TICKS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlayRequestDto { + public static final String JSON_PROPERTY_PLAYING_QUEUE = "PlayingQueue"; + @org.eclipse.jdt.annotation.NonNull + private List playingQueue = new ArrayList<>(); + + public static final String JSON_PROPERTY_PLAYING_ITEM_POSITION = "PlayingItemPosition"; + @org.eclipse.jdt.annotation.NonNull + private Integer playingItemPosition; + + public static final String JSON_PROPERTY_START_POSITION_TICKS = "StartPositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long startPositionTicks; + + public PlayRequestDto() { + } + + public PlayRequestDto playingQueue(@org.eclipse.jdt.annotation.NonNull List playingQueue) { + this.playingQueue = playingQueue; + return this; + } + + public PlayRequestDto addPlayingQueueItem(UUID playingQueueItem) { + if (this.playingQueue == null) { + this.playingQueue = new ArrayList<>(); + } + this.playingQueue.add(playingQueueItem); + return this; + } + + /** + * Gets or sets the playing queue. + * + * @return playingQueue + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPlayingQueue() { + return playingQueue; + } + + @JsonProperty(JSON_PROPERTY_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayingQueue(@org.eclipse.jdt.annotation.NonNull List playingQueue) { + this.playingQueue = playingQueue; + } + + public PlayRequestDto playingItemPosition(@org.eclipse.jdt.annotation.NonNull Integer playingItemPosition) { + this.playingItemPosition = playingItemPosition; + return this; + } + + /** + * Gets or sets the position of the playing item in the queue. + * + * @return playingItemPosition + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYING_ITEM_POSITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPlayingItemPosition() { + return playingItemPosition; + } + + @JsonProperty(JSON_PROPERTY_PLAYING_ITEM_POSITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayingItemPosition(@org.eclipse.jdt.annotation.NonNull Integer playingItemPosition) { + this.playingItemPosition = playingItemPosition; + } + + public PlayRequestDto startPositionTicks(@org.eclipse.jdt.annotation.NonNull Long startPositionTicks) { + this.startPositionTicks = startPositionTicks; + return this; + } + + /** + * Gets or sets the start position ticks. + * + * @return startPositionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartPositionTicks() { + return startPositionTicks; + } + + @JsonProperty(JSON_PROPERTY_START_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartPositionTicks(@org.eclipse.jdt.annotation.NonNull Long startPositionTicks) { + this.startPositionTicks = startPositionTicks; + } + + /** + * Return true if this PlayRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlayRequestDto playRequestDto = (PlayRequestDto) o; + return Objects.equals(this.playingQueue, playRequestDto.playingQueue) + && Objects.equals(this.playingItemPosition, playRequestDto.playingItemPosition) + && Objects.equals(this.startPositionTicks, playRequestDto.startPositionTicks); + } + + @Override + public int hashCode() { + return Objects.hash(playingQueue, playingItemPosition, startPositionTicks); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlayRequestDto {\n"); + sb.append(" playingQueue: ").append(toIndentedString(playingQueue)).append("\n"); + sb.append(" playingItemPosition: ").append(toIndentedString(playingItemPosition)).append("\n"); + sb.append(" startPositionTicks: ").append(toIndentedString(startPositionTicks)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlayingQueue` to the URL query string + if (getPlayingQueue() != null) { + for (int i = 0; i < getPlayingQueue().size(); i++) { + if (getPlayingQueue().get(i) != null) { + joiner.add(String.format("%sPlayingQueue%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getPlayingQueue().get(i))))); + } + } + } + + // add `PlayingItemPosition` to the URL query string + if (getPlayingItemPosition() != null) { + joiner.add(String.format("%sPlayingItemPosition%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayingItemPosition())))); + } + + // add `StartPositionTicks` to the URL query string + if (getStartPositionTicks() != null) { + joiner.add(String.format("%sStartPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartPositionTicks())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlayRequestDto instance; + + public Builder() { + this(new PlayRequestDto()); + } + + protected Builder(PlayRequestDto instance) { + this.instance = instance; + } + + public PlayRequestDto.Builder playingQueue(List playingQueue) { + this.instance.playingQueue = playingQueue; + return this; + } + + public PlayRequestDto.Builder playingItemPosition(Integer playingItemPosition) { + this.instance.playingItemPosition = playingItemPosition; + return this; + } + + public PlayRequestDto.Builder startPositionTicks(Long startPositionTicks) { + this.instance.startPositionTicks = startPositionTicks; + return this; + } + + /** + * returns a built PlayRequestDto instance. + * + * The builder is not reusable. + */ + public PlayRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlayRequestDto.Builder builder() { + return new PlayRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlayRequestDto.Builder toBuilder() { + return new PlayRequestDto.Builder().playingQueue(getPlayingQueue()) + .playingItemPosition(getPlayingItemPosition()).startPositionTicks(getStartPositionTicks()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackErrorCode.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackErrorCode.java new file mode 100644 index 0000000000000..ce2b13eb7037f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackErrorCode.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets PlaybackErrorCode + */ +public enum PlaybackErrorCode { + + NOT_ALLOWED("NotAllowed"), + + NO_COMPATIBLE_STREAM("NoCompatibleStream"), + + RATE_LIMIT_EXCEEDED("RateLimitExceeded"); + + private String value; + + PlaybackErrorCode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PlaybackErrorCode fromValue(String value) { + for (PlaybackErrorCode b : PlaybackErrorCode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackInfoDto.java new file mode 100644 index 0000000000000..60b7f2952a233 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackInfoDto.java @@ -0,0 +1,821 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Plabyback info dto. + */ +@JsonPropertyOrder({ PlaybackInfoDto.JSON_PROPERTY_USER_ID, PlaybackInfoDto.JSON_PROPERTY_MAX_STREAMING_BITRATE, + PlaybackInfoDto.JSON_PROPERTY_START_TIME_TICKS, PlaybackInfoDto.JSON_PROPERTY_AUDIO_STREAM_INDEX, + PlaybackInfoDto.JSON_PROPERTY_SUBTITLE_STREAM_INDEX, PlaybackInfoDto.JSON_PROPERTY_MAX_AUDIO_CHANNELS, + PlaybackInfoDto.JSON_PROPERTY_MEDIA_SOURCE_ID, PlaybackInfoDto.JSON_PROPERTY_LIVE_STREAM_ID, + PlaybackInfoDto.JSON_PROPERTY_DEVICE_PROFILE, PlaybackInfoDto.JSON_PROPERTY_ENABLE_DIRECT_PLAY, + PlaybackInfoDto.JSON_PROPERTY_ENABLE_DIRECT_STREAM, PlaybackInfoDto.JSON_PROPERTY_ENABLE_TRANSCODING, + PlaybackInfoDto.JSON_PROPERTY_ALLOW_VIDEO_STREAM_COPY, PlaybackInfoDto.JSON_PROPERTY_ALLOW_AUDIO_STREAM_COPY, + PlaybackInfoDto.JSON_PROPERTY_AUTO_OPEN_LIVE_STREAM, + PlaybackInfoDto.JSON_PROPERTY_ALWAYS_BURN_IN_SUBTITLE_WHEN_TRANSCODING }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaybackInfoDto { + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_MAX_STREAMING_BITRATE = "MaxStreamingBitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxStreamingBitrate; + + public static final String JSON_PROPERTY_START_TIME_TICKS = "StartTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long startTimeTicks; + + public static final String JSON_PROPERTY_AUDIO_STREAM_INDEX = "AudioStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer audioStreamIndex; + + public static final String JSON_PROPERTY_SUBTITLE_STREAM_INDEX = "SubtitleStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer subtitleStreamIndex; + + public static final String JSON_PROPERTY_MAX_AUDIO_CHANNELS = "MaxAudioChannels"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxAudioChannels; + + public static final String JSON_PROPERTY_MEDIA_SOURCE_ID = "MediaSourceId"; + @org.eclipse.jdt.annotation.NonNull + private String mediaSourceId; + + public static final String JSON_PROPERTY_LIVE_STREAM_ID = "LiveStreamId"; + @org.eclipse.jdt.annotation.NonNull + private String liveStreamId; + + public static final String JSON_PROPERTY_DEVICE_PROFILE = "DeviceProfile"; + @org.eclipse.jdt.annotation.NonNull + private DeviceProfile deviceProfile; + + public static final String JSON_PROPERTY_ENABLE_DIRECT_PLAY = "EnableDirectPlay"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableDirectPlay; + + public static final String JSON_PROPERTY_ENABLE_DIRECT_STREAM = "EnableDirectStream"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableDirectStream; + + public static final String JSON_PROPERTY_ENABLE_TRANSCODING = "EnableTranscoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableTranscoding; + + public static final String JSON_PROPERTY_ALLOW_VIDEO_STREAM_COPY = "AllowVideoStreamCopy"; + @org.eclipse.jdt.annotation.NonNull + private Boolean allowVideoStreamCopy; + + public static final String JSON_PROPERTY_ALLOW_AUDIO_STREAM_COPY = "AllowAudioStreamCopy"; + @org.eclipse.jdt.annotation.NonNull + private Boolean allowAudioStreamCopy; + + public static final String JSON_PROPERTY_AUTO_OPEN_LIVE_STREAM = "AutoOpenLiveStream"; + @org.eclipse.jdt.annotation.NonNull + private Boolean autoOpenLiveStream; + + public static final String JSON_PROPERTY_ALWAYS_BURN_IN_SUBTITLE_WHEN_TRANSCODING = "AlwaysBurnInSubtitleWhenTranscoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean alwaysBurnInSubtitleWhenTranscoding; + + public PlaybackInfoDto() { + } + + public PlaybackInfoDto userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the playback userId. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public PlaybackInfoDto maxStreamingBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate) { + this.maxStreamingBitrate = maxStreamingBitrate; + return this; + } + + /** + * Gets or sets the max streaming bitrate. + * + * @return maxStreamingBitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_STREAMING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxStreamingBitrate() { + return maxStreamingBitrate; + } + + @JsonProperty(JSON_PROPERTY_MAX_STREAMING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxStreamingBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate) { + this.maxStreamingBitrate = maxStreamingBitrate; + } + + public PlaybackInfoDto startTimeTicks(@org.eclipse.jdt.annotation.NonNull Long startTimeTicks) { + this.startTimeTicks = startTimeTicks; + return this; + } + + /** + * Gets or sets the start time in ticks. + * + * @return startTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartTimeTicks() { + return startTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_START_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartTimeTicks(@org.eclipse.jdt.annotation.NonNull Long startTimeTicks) { + this.startTimeTicks = startTimeTicks; + } + + public PlaybackInfoDto audioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + return this; + } + + /** + * Gets or sets the audio stream index. + * + * @return audioStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAudioStreamIndex() { + return audioStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + } + + public PlaybackInfoDto subtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + /** + * Gets or sets the subtitle stream index. + * + * @return subtitleStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSubtitleStreamIndex() { + return subtitleStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + } + + public PlaybackInfoDto maxAudioChannels(@org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels) { + this.maxAudioChannels = maxAudioChannels; + return this; + } + + /** + * Gets or sets the max audio channels. + * + * @return maxAudioChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_AUDIO_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxAudioChannels() { + return maxAudioChannels; + } + + @JsonProperty(JSON_PROPERTY_MAX_AUDIO_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxAudioChannels(@org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels) { + this.maxAudioChannels = maxAudioChannels; + } + + public PlaybackInfoDto mediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + return this; + } + + /** + * Gets or sets the media source id. + * + * @return mediaSourceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMediaSourceId() { + return mediaSourceId; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + } + + public PlaybackInfoDto liveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + return this; + } + + /** + * Gets or sets the live stream id. + * + * @return liveStreamId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLiveStreamId() { + return liveStreamId; + } + + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLiveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + } + + public PlaybackInfoDto deviceProfile(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) { + this.deviceProfile = deviceProfile; + return this; + } + + /** + * A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain + * device is able to play. <br /> Specifically, it defines the supported <see + * cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles\">containers</see> and + * <see cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles\">codecs</see> + * (video and/or audio, including codec profiles and levels) the device is able to direct play (without transcoding + * or remuxing), as well as which <see + * cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles\">containers/codecs to + * transcode to</see> in case it isn't. + * + * @return deviceProfile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceProfile getDeviceProfile() { + return deviceProfile; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceProfile(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) { + this.deviceProfile = deviceProfile; + } + + public PlaybackInfoDto enableDirectPlay(@org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay) { + this.enableDirectPlay = enableDirectPlay; + return this; + } + + /** + * Gets or sets a value indicating whether to enable direct play. + * + * @return enableDirectPlay + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_DIRECT_PLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableDirectPlay() { + return enableDirectPlay; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_DIRECT_PLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableDirectPlay(@org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay) { + this.enableDirectPlay = enableDirectPlay; + } + + public PlaybackInfoDto enableDirectStream(@org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream) { + this.enableDirectStream = enableDirectStream; + return this; + } + + /** + * Gets or sets a value indicating whether to enable direct stream. + * + * @return enableDirectStream + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_DIRECT_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableDirectStream() { + return enableDirectStream; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_DIRECT_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableDirectStream(@org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream) { + this.enableDirectStream = enableDirectStream; + } + + public PlaybackInfoDto enableTranscoding(@org.eclipse.jdt.annotation.NonNull Boolean enableTranscoding) { + this.enableTranscoding = enableTranscoding; + return this; + } + + /** + * Gets or sets a value indicating whether to enable transcoding. + * + * @return enableTranscoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableTranscoding() { + return enableTranscoding; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableTranscoding(@org.eclipse.jdt.annotation.NonNull Boolean enableTranscoding) { + this.enableTranscoding = enableTranscoding; + } + + public PlaybackInfoDto allowVideoStreamCopy(@org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy) { + this.allowVideoStreamCopy = allowVideoStreamCopy; + return this; + } + + /** + * Gets or sets a value indicating whether to enable video stream copy. + * + * @return allowVideoStreamCopy + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_VIDEO_STREAM_COPY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowVideoStreamCopy() { + return allowVideoStreamCopy; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_VIDEO_STREAM_COPY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowVideoStreamCopy(@org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy) { + this.allowVideoStreamCopy = allowVideoStreamCopy; + } + + public PlaybackInfoDto allowAudioStreamCopy(@org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy) { + this.allowAudioStreamCopy = allowAudioStreamCopy; + return this; + } + + /** + * Gets or sets a value indicating whether to allow audio stream copy. + * + * @return allowAudioStreamCopy + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_AUDIO_STREAM_COPY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowAudioStreamCopy() { + return allowAudioStreamCopy; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_AUDIO_STREAM_COPY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowAudioStreamCopy(@org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy) { + this.allowAudioStreamCopy = allowAudioStreamCopy; + } + + public PlaybackInfoDto autoOpenLiveStream(@org.eclipse.jdt.annotation.NonNull Boolean autoOpenLiveStream) { + this.autoOpenLiveStream = autoOpenLiveStream; + return this; + } + + /** + * Gets or sets a value indicating whether to auto open the live stream. + * + * @return autoOpenLiveStream + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTO_OPEN_LIVE_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAutoOpenLiveStream() { + return autoOpenLiveStream; + } + + @JsonProperty(JSON_PROPERTY_AUTO_OPEN_LIVE_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAutoOpenLiveStream(@org.eclipse.jdt.annotation.NonNull Boolean autoOpenLiveStream) { + this.autoOpenLiveStream = autoOpenLiveStream; + } + + public PlaybackInfoDto alwaysBurnInSubtitleWhenTranscoding( + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) { + this.alwaysBurnInSubtitleWhenTranscoding = alwaysBurnInSubtitleWhenTranscoding; + return this; + } + + /** + * Gets or sets a value indicating whether always burn in subtitles when transcoding. + * + * @return alwaysBurnInSubtitleWhenTranscoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALWAYS_BURN_IN_SUBTITLE_WHEN_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAlwaysBurnInSubtitleWhenTranscoding() { + return alwaysBurnInSubtitleWhenTranscoding; + } + + @JsonProperty(JSON_PROPERTY_ALWAYS_BURN_IN_SUBTITLE_WHEN_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlwaysBurnInSubtitleWhenTranscoding( + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) { + this.alwaysBurnInSubtitleWhenTranscoding = alwaysBurnInSubtitleWhenTranscoding; + } + + /** + * Return true if this PlaybackInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaybackInfoDto playbackInfoDto = (PlaybackInfoDto) o; + return Objects.equals(this.userId, playbackInfoDto.userId) + && Objects.equals(this.maxStreamingBitrate, playbackInfoDto.maxStreamingBitrate) + && Objects.equals(this.startTimeTicks, playbackInfoDto.startTimeTicks) + && Objects.equals(this.audioStreamIndex, playbackInfoDto.audioStreamIndex) + && Objects.equals(this.subtitleStreamIndex, playbackInfoDto.subtitleStreamIndex) + && Objects.equals(this.maxAudioChannels, playbackInfoDto.maxAudioChannels) + && Objects.equals(this.mediaSourceId, playbackInfoDto.mediaSourceId) + && Objects.equals(this.liveStreamId, playbackInfoDto.liveStreamId) + && Objects.equals(this.deviceProfile, playbackInfoDto.deviceProfile) + && Objects.equals(this.enableDirectPlay, playbackInfoDto.enableDirectPlay) + && Objects.equals(this.enableDirectStream, playbackInfoDto.enableDirectStream) + && Objects.equals(this.enableTranscoding, playbackInfoDto.enableTranscoding) + && Objects.equals(this.allowVideoStreamCopy, playbackInfoDto.allowVideoStreamCopy) + && Objects.equals(this.allowAudioStreamCopy, playbackInfoDto.allowAudioStreamCopy) + && Objects.equals(this.autoOpenLiveStream, playbackInfoDto.autoOpenLiveStream) && Objects.equals( + this.alwaysBurnInSubtitleWhenTranscoding, playbackInfoDto.alwaysBurnInSubtitleWhenTranscoding); + } + + @Override + public int hashCode() { + return Objects.hash(userId, maxStreamingBitrate, startTimeTicks, audioStreamIndex, subtitleStreamIndex, + maxAudioChannels, mediaSourceId, liveStreamId, deviceProfile, enableDirectPlay, enableDirectStream, + enableTranscoding, allowVideoStreamCopy, allowAudioStreamCopy, autoOpenLiveStream, + alwaysBurnInSubtitleWhenTranscoding); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaybackInfoDto {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" maxStreamingBitrate: ").append(toIndentedString(maxStreamingBitrate)).append("\n"); + sb.append(" startTimeTicks: ").append(toIndentedString(startTimeTicks)).append("\n"); + sb.append(" audioStreamIndex: ").append(toIndentedString(audioStreamIndex)).append("\n"); + sb.append(" subtitleStreamIndex: ").append(toIndentedString(subtitleStreamIndex)).append("\n"); + sb.append(" maxAudioChannels: ").append(toIndentedString(maxAudioChannels)).append("\n"); + sb.append(" mediaSourceId: ").append(toIndentedString(mediaSourceId)).append("\n"); + sb.append(" liveStreamId: ").append(toIndentedString(liveStreamId)).append("\n"); + sb.append(" deviceProfile: ").append(toIndentedString(deviceProfile)).append("\n"); + sb.append(" enableDirectPlay: ").append(toIndentedString(enableDirectPlay)).append("\n"); + sb.append(" enableDirectStream: ").append(toIndentedString(enableDirectStream)).append("\n"); + sb.append(" enableTranscoding: ").append(toIndentedString(enableTranscoding)).append("\n"); + sb.append(" allowVideoStreamCopy: ").append(toIndentedString(allowVideoStreamCopy)).append("\n"); + sb.append(" allowAudioStreamCopy: ").append(toIndentedString(allowAudioStreamCopy)).append("\n"); + sb.append(" autoOpenLiveStream: ").append(toIndentedString(autoOpenLiveStream)).append("\n"); + sb.append(" alwaysBurnInSubtitleWhenTranscoding: ") + .append(toIndentedString(alwaysBurnInSubtitleWhenTranscoding)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `MaxStreamingBitrate` to the URL query string + if (getMaxStreamingBitrate() != null) { + joiner.add(String.format("%sMaxStreamingBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxStreamingBitrate())))); + } + + // add `StartTimeTicks` to the URL query string + if (getStartTimeTicks() != null) { + joiner.add(String.format("%sStartTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartTimeTicks())))); + } + + // add `AudioStreamIndex` to the URL query string + if (getAudioStreamIndex() != null) { + joiner.add(String.format("%sAudioStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioStreamIndex())))); + } + + // add `SubtitleStreamIndex` to the URL query string + if (getSubtitleStreamIndex() != null) { + joiner.add(String.format("%sSubtitleStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleStreamIndex())))); + } + + // add `MaxAudioChannels` to the URL query string + if (getMaxAudioChannels() != null) { + joiner.add(String.format("%sMaxAudioChannels%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxAudioChannels())))); + } + + // add `MediaSourceId` to the URL query string + if (getMediaSourceId() != null) { + joiner.add(String.format("%sMediaSourceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaSourceId())))); + } + + // add `LiveStreamId` to the URL query string + if (getLiveStreamId() != null) { + joiner.add(String.format("%sLiveStreamId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLiveStreamId())))); + } + + // add `DeviceProfile` to the URL query string + if (getDeviceProfile() != null) { + joiner.add(getDeviceProfile().toUrlQueryString(prefix + "DeviceProfile" + suffix)); + } + + // add `EnableDirectPlay` to the URL query string + if (getEnableDirectPlay() != null) { + joiner.add(String.format("%sEnableDirectPlay%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableDirectPlay())))); + } + + // add `EnableDirectStream` to the URL query string + if (getEnableDirectStream() != null) { + joiner.add(String.format("%sEnableDirectStream%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableDirectStream())))); + } + + // add `EnableTranscoding` to the URL query string + if (getEnableTranscoding() != null) { + joiner.add(String.format("%sEnableTranscoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableTranscoding())))); + } + + // add `AllowVideoStreamCopy` to the URL query string + if (getAllowVideoStreamCopy() != null) { + joiner.add(String.format("%sAllowVideoStreamCopy%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAllowVideoStreamCopy())))); + } + + // add `AllowAudioStreamCopy` to the URL query string + if (getAllowAudioStreamCopy() != null) { + joiner.add(String.format("%sAllowAudioStreamCopy%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAllowAudioStreamCopy())))); + } + + // add `AutoOpenLiveStream` to the URL query string + if (getAutoOpenLiveStream() != null) { + joiner.add(String.format("%sAutoOpenLiveStream%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAutoOpenLiveStream())))); + } + + // add `AlwaysBurnInSubtitleWhenTranscoding` to the URL query string + if (getAlwaysBurnInSubtitleWhenTranscoding() != null) { + joiner.add(String.format("%sAlwaysBurnInSubtitleWhenTranscoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlwaysBurnInSubtitleWhenTranscoding())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaybackInfoDto instance; + + public Builder() { + this(new PlaybackInfoDto()); + } + + protected Builder(PlaybackInfoDto instance) { + this.instance = instance; + } + + public PlaybackInfoDto.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public PlaybackInfoDto.Builder maxStreamingBitrate(Integer maxStreamingBitrate) { + this.instance.maxStreamingBitrate = maxStreamingBitrate; + return this; + } + + public PlaybackInfoDto.Builder startTimeTicks(Long startTimeTicks) { + this.instance.startTimeTicks = startTimeTicks; + return this; + } + + public PlaybackInfoDto.Builder audioStreamIndex(Integer audioStreamIndex) { + this.instance.audioStreamIndex = audioStreamIndex; + return this; + } + + public PlaybackInfoDto.Builder subtitleStreamIndex(Integer subtitleStreamIndex) { + this.instance.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + public PlaybackInfoDto.Builder maxAudioChannels(Integer maxAudioChannels) { + this.instance.maxAudioChannels = maxAudioChannels; + return this; + } + + public PlaybackInfoDto.Builder mediaSourceId(String mediaSourceId) { + this.instance.mediaSourceId = mediaSourceId; + return this; + } + + public PlaybackInfoDto.Builder liveStreamId(String liveStreamId) { + this.instance.liveStreamId = liveStreamId; + return this; + } + + public PlaybackInfoDto.Builder deviceProfile(DeviceProfile deviceProfile) { + this.instance.deviceProfile = deviceProfile; + return this; + } + + public PlaybackInfoDto.Builder enableDirectPlay(Boolean enableDirectPlay) { + this.instance.enableDirectPlay = enableDirectPlay; + return this; + } + + public PlaybackInfoDto.Builder enableDirectStream(Boolean enableDirectStream) { + this.instance.enableDirectStream = enableDirectStream; + return this; + } + + public PlaybackInfoDto.Builder enableTranscoding(Boolean enableTranscoding) { + this.instance.enableTranscoding = enableTranscoding; + return this; + } + + public PlaybackInfoDto.Builder allowVideoStreamCopy(Boolean allowVideoStreamCopy) { + this.instance.allowVideoStreamCopy = allowVideoStreamCopy; + return this; + } + + public PlaybackInfoDto.Builder allowAudioStreamCopy(Boolean allowAudioStreamCopy) { + this.instance.allowAudioStreamCopy = allowAudioStreamCopy; + return this; + } + + public PlaybackInfoDto.Builder autoOpenLiveStream(Boolean autoOpenLiveStream) { + this.instance.autoOpenLiveStream = autoOpenLiveStream; + return this; + } + + public PlaybackInfoDto.Builder alwaysBurnInSubtitleWhenTranscoding( + Boolean alwaysBurnInSubtitleWhenTranscoding) { + this.instance.alwaysBurnInSubtitleWhenTranscoding = alwaysBurnInSubtitleWhenTranscoding; + return this; + } + + /** + * returns a built PlaybackInfoDto instance. + * + * The builder is not reusable. + */ + public PlaybackInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaybackInfoDto.Builder builder() { + return new PlaybackInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaybackInfoDto.Builder toBuilder() { + return new PlaybackInfoDto.Builder().userId(getUserId()).maxStreamingBitrate(getMaxStreamingBitrate()) + .startTimeTicks(getStartTimeTicks()).audioStreamIndex(getAudioStreamIndex()) + .subtitleStreamIndex(getSubtitleStreamIndex()).maxAudioChannels(getMaxAudioChannels()) + .mediaSourceId(getMediaSourceId()).liveStreamId(getLiveStreamId()).deviceProfile(getDeviceProfile()) + .enableDirectPlay(getEnableDirectPlay()).enableDirectStream(getEnableDirectStream()) + .enableTranscoding(getEnableTranscoding()).allowVideoStreamCopy(getAllowVideoStreamCopy()) + .allowAudioStreamCopy(getAllowAudioStreamCopy()).autoOpenLiveStream(getAutoOpenLiveStream()) + .alwaysBurnInSubtitleWhenTranscoding(getAlwaysBurnInSubtitleWhenTranscoding()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackInfoResponse.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackInfoResponse.java new file mode 100644 index 0000000000000..48c2563f3f7c2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackInfoResponse.java @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PlaybackInfoResponse. + */ +@JsonPropertyOrder({ PlaybackInfoResponse.JSON_PROPERTY_MEDIA_SOURCES, + PlaybackInfoResponse.JSON_PROPERTY_PLAY_SESSION_ID, PlaybackInfoResponse.JSON_PROPERTY_ERROR_CODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaybackInfoResponse { + public static final String JSON_PROPERTY_MEDIA_SOURCES = "MediaSources"; + @org.eclipse.jdt.annotation.NonNull + private List mediaSources = new ArrayList<>(); + + public static final String JSON_PROPERTY_PLAY_SESSION_ID = "PlaySessionId"; + @org.eclipse.jdt.annotation.NonNull + private String playSessionId; + + public static final String JSON_PROPERTY_ERROR_CODE = "ErrorCode"; + @org.eclipse.jdt.annotation.NonNull + private PlaybackErrorCode errorCode; + + public PlaybackInfoResponse() { + } + + public PlaybackInfoResponse mediaSources(@org.eclipse.jdt.annotation.NonNull List mediaSources) { + this.mediaSources = mediaSources; + return this; + } + + public PlaybackInfoResponse addMediaSourcesItem(MediaSourceInfo mediaSourcesItem) { + if (this.mediaSources == null) { + this.mediaSources = new ArrayList<>(); + } + this.mediaSources.add(mediaSourcesItem); + return this; + } + + /** + * Gets or sets the media sources. + * + * @return mediaSources + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMediaSources() { + return mediaSources; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSources(@org.eclipse.jdt.annotation.NonNull List mediaSources) { + this.mediaSources = mediaSources; + } + + public PlaybackInfoResponse playSessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + return this; + } + + /** + * Gets or sets the play session identifier. + * + * @return playSessionId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaySessionId() { + return playSessionId; + } + + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaySessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + } + + public PlaybackInfoResponse errorCode(@org.eclipse.jdt.annotation.NonNull PlaybackErrorCode errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Gets or sets the error code. + * + * @return errorCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ERROR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlaybackErrorCode getErrorCode() { + return errorCode; + } + + @JsonProperty(JSON_PROPERTY_ERROR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorCode(@org.eclipse.jdt.annotation.NonNull PlaybackErrorCode errorCode) { + this.errorCode = errorCode; + } + + /** + * Return true if this PlaybackInfoResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaybackInfoResponse playbackInfoResponse = (PlaybackInfoResponse) o; + return Objects.equals(this.mediaSources, playbackInfoResponse.mediaSources) + && Objects.equals(this.playSessionId, playbackInfoResponse.playSessionId) + && Objects.equals(this.errorCode, playbackInfoResponse.errorCode); + } + + @Override + public int hashCode() { + return Objects.hash(mediaSources, playSessionId, errorCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaybackInfoResponse {\n"); + sb.append(" mediaSources: ").append(toIndentedString(mediaSources)).append("\n"); + sb.append(" playSessionId: ").append(toIndentedString(playSessionId)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MediaSources` to the URL query string + if (getMediaSources() != null) { + for (int i = 0; i < getMediaSources().size(); i++) { + if (getMediaSources().get(i) != null) { + joiner.add(getMediaSources().get(i).toUrlQueryString(String.format("%sMediaSources%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `PlaySessionId` to the URL query string + if (getPlaySessionId() != null) { + joiner.add(String.format("%sPlaySessionId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaySessionId())))); + } + + // add `ErrorCode` to the URL query string + if (getErrorCode() != null) { + joiner.add(String.format("%sErrorCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getErrorCode())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaybackInfoResponse instance; + + public Builder() { + this(new PlaybackInfoResponse()); + } + + protected Builder(PlaybackInfoResponse instance) { + this.instance = instance; + } + + public PlaybackInfoResponse.Builder mediaSources(List mediaSources) { + this.instance.mediaSources = mediaSources; + return this; + } + + public PlaybackInfoResponse.Builder playSessionId(String playSessionId) { + this.instance.playSessionId = playSessionId; + return this; + } + + public PlaybackInfoResponse.Builder errorCode(PlaybackErrorCode errorCode) { + this.instance.errorCode = errorCode; + return this; + } + + /** + * returns a built PlaybackInfoResponse instance. + * + * The builder is not reusable. + */ + public PlaybackInfoResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaybackInfoResponse.Builder builder() { + return new PlaybackInfoResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaybackInfoResponse.Builder toBuilder() { + return new PlaybackInfoResponse.Builder().mediaSources(getMediaSources()).playSessionId(getPlaySessionId()) + .errorCode(getErrorCode()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackOrder.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackOrder.java new file mode 100644 index 0000000000000..8fb76d3c89895 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackOrder.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum PlaybackOrder. + */ +public enum PlaybackOrder { + + DEFAULT("Default"), + + SHUFFLE("Shuffle"); + + private String value; + + PlaybackOrder(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PlaybackOrder fromValue(String value) { + for (PlaybackOrder b : PlaybackOrder.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackProgressInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackProgressInfo.java new file mode 100644 index 0000000000000..7dba232ff65b3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackProgressInfo.java @@ -0,0 +1,1027 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PlaybackProgressInfo. + */ +@JsonPropertyOrder({ PlaybackProgressInfo.JSON_PROPERTY_CAN_SEEK, PlaybackProgressInfo.JSON_PROPERTY_ITEM, + PlaybackProgressInfo.JSON_PROPERTY_ITEM_ID, PlaybackProgressInfo.JSON_PROPERTY_SESSION_ID, + PlaybackProgressInfo.JSON_PROPERTY_MEDIA_SOURCE_ID, PlaybackProgressInfo.JSON_PROPERTY_AUDIO_STREAM_INDEX, + PlaybackProgressInfo.JSON_PROPERTY_SUBTITLE_STREAM_INDEX, PlaybackProgressInfo.JSON_PROPERTY_IS_PAUSED, + PlaybackProgressInfo.JSON_PROPERTY_IS_MUTED, PlaybackProgressInfo.JSON_PROPERTY_POSITION_TICKS, + PlaybackProgressInfo.JSON_PROPERTY_PLAYBACK_START_TIME_TICKS, PlaybackProgressInfo.JSON_PROPERTY_VOLUME_LEVEL, + PlaybackProgressInfo.JSON_PROPERTY_BRIGHTNESS, PlaybackProgressInfo.JSON_PROPERTY_ASPECT_RATIO, + PlaybackProgressInfo.JSON_PROPERTY_PLAY_METHOD, PlaybackProgressInfo.JSON_PROPERTY_LIVE_STREAM_ID, + PlaybackProgressInfo.JSON_PROPERTY_PLAY_SESSION_ID, PlaybackProgressInfo.JSON_PROPERTY_REPEAT_MODE, + PlaybackProgressInfo.JSON_PROPERTY_PLAYBACK_ORDER, PlaybackProgressInfo.JSON_PROPERTY_NOW_PLAYING_QUEUE, + PlaybackProgressInfo.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaybackProgressInfo { + public static final String JSON_PROPERTY_CAN_SEEK = "CanSeek"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canSeek; + + public static final String JSON_PROPERTY_ITEM = "Item"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemDto item; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SESSION_ID = "SessionId"; + @org.eclipse.jdt.annotation.NonNull + private String sessionId; + + public static final String JSON_PROPERTY_MEDIA_SOURCE_ID = "MediaSourceId"; + @org.eclipse.jdt.annotation.NonNull + private String mediaSourceId; + + public static final String JSON_PROPERTY_AUDIO_STREAM_INDEX = "AudioStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer audioStreamIndex; + + public static final String JSON_PROPERTY_SUBTITLE_STREAM_INDEX = "SubtitleStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer subtitleStreamIndex; + + public static final String JSON_PROPERTY_IS_PAUSED = "IsPaused"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPaused; + + public static final String JSON_PROPERTY_IS_MUTED = "IsMuted"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isMuted; + + public static final String JSON_PROPERTY_POSITION_TICKS = "PositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long positionTicks; + + public static final String JSON_PROPERTY_PLAYBACK_START_TIME_TICKS = "PlaybackStartTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long playbackStartTimeTicks; + + public static final String JSON_PROPERTY_VOLUME_LEVEL = "VolumeLevel"; + @org.eclipse.jdt.annotation.NonNull + private Integer volumeLevel; + + public static final String JSON_PROPERTY_BRIGHTNESS = "Brightness"; + @org.eclipse.jdt.annotation.NonNull + private Integer brightness; + + public static final String JSON_PROPERTY_ASPECT_RATIO = "AspectRatio"; + @org.eclipse.jdt.annotation.NonNull + private String aspectRatio; + + public static final String JSON_PROPERTY_PLAY_METHOD = "PlayMethod"; + @org.eclipse.jdt.annotation.NonNull + private PlayMethod playMethod; + + public static final String JSON_PROPERTY_LIVE_STREAM_ID = "LiveStreamId"; + @org.eclipse.jdt.annotation.NonNull + private String liveStreamId; + + public static final String JSON_PROPERTY_PLAY_SESSION_ID = "PlaySessionId"; + @org.eclipse.jdt.annotation.NonNull + private String playSessionId; + + public static final String JSON_PROPERTY_REPEAT_MODE = "RepeatMode"; + @org.eclipse.jdt.annotation.NonNull + private RepeatMode repeatMode; + + public static final String JSON_PROPERTY_PLAYBACK_ORDER = "PlaybackOrder"; + @org.eclipse.jdt.annotation.NonNull + private PlaybackOrder playbackOrder; + + public static final String JSON_PROPERTY_NOW_PLAYING_QUEUE = "NowPlayingQueue"; + @org.eclipse.jdt.annotation.NonNull + private List nowPlayingQueue; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private String playlistItemId; + + public PlaybackProgressInfo() { + } + + public PlaybackProgressInfo canSeek(@org.eclipse.jdt.annotation.NonNull Boolean canSeek) { + this.canSeek = canSeek; + return this; + } + + /** + * Gets or sets a value indicating whether this instance can seek. + * + * @return canSeek + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_SEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanSeek() { + return canSeek; + } + + @JsonProperty(JSON_PROPERTY_CAN_SEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanSeek(@org.eclipse.jdt.annotation.NonNull Boolean canSeek) { + this.canSeek = canSeek; + } + + public PlaybackProgressInfo item(@org.eclipse.jdt.annotation.NonNull BaseItemDto item) { + this.item = item; + return this; + } + + /** + * Gets or sets the item. + * + * @return item + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemDto getItem() { + return item; + } + + @JsonProperty(JSON_PROPERTY_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItem(@org.eclipse.jdt.annotation.NonNull BaseItemDto item) { + this.item = item; + } + + public PlaybackProgressInfo itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item identifier. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public PlaybackProgressInfo sessionId(@org.eclipse.jdt.annotation.NonNull String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Gets or sets the session id. + * + * @return sessionId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSessionId() { + return sessionId; + } + + @JsonProperty(JSON_PROPERTY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSessionId(@org.eclipse.jdt.annotation.NonNull String sessionId) { + this.sessionId = sessionId; + } + + public PlaybackProgressInfo mediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + return this; + } + + /** + * Gets or sets the media version identifier. + * + * @return mediaSourceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMediaSourceId() { + return mediaSourceId; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + } + + public PlaybackProgressInfo audioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + return this; + } + + /** + * Gets or sets the index of the audio stream. + * + * @return audioStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAudioStreamIndex() { + return audioStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + } + + public PlaybackProgressInfo subtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + /** + * Gets or sets the index of the subtitle stream. + * + * @return subtitleStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSubtitleStreamIndex() { + return subtitleStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + } + + public PlaybackProgressInfo isPaused(@org.eclipse.jdt.annotation.NonNull Boolean isPaused) { + this.isPaused = isPaused; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is paused. + * + * @return isPaused + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PAUSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPaused() { + return isPaused; + } + + @JsonProperty(JSON_PROPERTY_IS_PAUSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPaused(@org.eclipse.jdt.annotation.NonNull Boolean isPaused) { + this.isPaused = isPaused; + } + + public PlaybackProgressInfo isMuted(@org.eclipse.jdt.annotation.NonNull Boolean isMuted) { + this.isMuted = isMuted; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is muted. + * + * @return isMuted + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_MUTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsMuted() { + return isMuted; + } + + @JsonProperty(JSON_PROPERTY_IS_MUTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMuted(@org.eclipse.jdt.annotation.NonNull Boolean isMuted) { + this.isMuted = isMuted; + } + + public PlaybackProgressInfo positionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + return this; + } + + /** + * Gets or sets the position ticks. + * + * @return positionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPositionTicks() { + return positionTicks; + } + + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPositionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + } + + public PlaybackProgressInfo playbackStartTimeTicks( + @org.eclipse.jdt.annotation.NonNull Long playbackStartTimeTicks) { + this.playbackStartTimeTicks = playbackStartTimeTicks; + return this; + } + + /** + * Get playbackStartTimeTicks + * + * @return playbackStartTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYBACK_START_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPlaybackStartTimeTicks() { + return playbackStartTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_PLAYBACK_START_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaybackStartTimeTicks(@org.eclipse.jdt.annotation.NonNull Long playbackStartTimeTicks) { + this.playbackStartTimeTicks = playbackStartTimeTicks; + } + + public PlaybackProgressInfo volumeLevel(@org.eclipse.jdt.annotation.NonNull Integer volumeLevel) { + this.volumeLevel = volumeLevel; + return this; + } + + /** + * Gets or sets the volume level. + * + * @return volumeLevel + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VOLUME_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getVolumeLevel() { + return volumeLevel; + } + + @JsonProperty(JSON_PROPERTY_VOLUME_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVolumeLevel(@org.eclipse.jdt.annotation.NonNull Integer volumeLevel) { + this.volumeLevel = volumeLevel; + } + + public PlaybackProgressInfo brightness(@org.eclipse.jdt.annotation.NonNull Integer brightness) { + this.brightness = brightness; + return this; + } + + /** + * Get brightness + * + * @return brightness + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BRIGHTNESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBrightness() { + return brightness; + } + + @JsonProperty(JSON_PROPERTY_BRIGHTNESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBrightness(@org.eclipse.jdt.annotation.NonNull Integer brightness) { + this.brightness = brightness; + } + + public PlaybackProgressInfo aspectRatio(@org.eclipse.jdt.annotation.NonNull String aspectRatio) { + this.aspectRatio = aspectRatio; + return this; + } + + /** + * Get aspectRatio + * + * @return aspectRatio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAspectRatio() { + return aspectRatio; + } + + @JsonProperty(JSON_PROPERTY_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAspectRatio(@org.eclipse.jdt.annotation.NonNull String aspectRatio) { + this.aspectRatio = aspectRatio; + } + + public PlaybackProgressInfo playMethod(@org.eclipse.jdt.annotation.NonNull PlayMethod playMethod) { + this.playMethod = playMethod; + return this; + } + + /** + * Gets or sets the play method. + * + * @return playMethod + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlayMethod getPlayMethod() { + return playMethod; + } + + @JsonProperty(JSON_PROPERTY_PLAY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayMethod(@org.eclipse.jdt.annotation.NonNull PlayMethod playMethod) { + this.playMethod = playMethod; + } + + public PlaybackProgressInfo liveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + return this; + } + + /** + * Gets or sets the live stream identifier. + * + * @return liveStreamId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLiveStreamId() { + return liveStreamId; + } + + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLiveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + } + + public PlaybackProgressInfo playSessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + return this; + } + + /** + * Gets or sets the play session identifier. + * + * @return playSessionId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaySessionId() { + return playSessionId; + } + + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaySessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + } + + public PlaybackProgressInfo repeatMode(@org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode) { + this.repeatMode = repeatMode; + return this; + } + + /** + * Gets or sets the repeat mode. + * + * @return repeatMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REPEAT_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RepeatMode getRepeatMode() { + return repeatMode; + } + + @JsonProperty(JSON_PROPERTY_REPEAT_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepeatMode(@org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode) { + this.repeatMode = repeatMode; + } + + public PlaybackProgressInfo playbackOrder(@org.eclipse.jdt.annotation.NonNull PlaybackOrder playbackOrder) { + this.playbackOrder = playbackOrder; + return this; + } + + /** + * Gets or sets the playback order. + * + * @return playbackOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYBACK_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlaybackOrder getPlaybackOrder() { + return playbackOrder; + } + + @JsonProperty(JSON_PROPERTY_PLAYBACK_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaybackOrder(@org.eclipse.jdt.annotation.NonNull PlaybackOrder playbackOrder) { + this.playbackOrder = playbackOrder; + } + + public PlaybackProgressInfo nowPlayingQueue(@org.eclipse.jdt.annotation.NonNull List nowPlayingQueue) { + this.nowPlayingQueue = nowPlayingQueue; + return this; + } + + public PlaybackProgressInfo addNowPlayingQueueItem(QueueItem nowPlayingQueueItem) { + if (this.nowPlayingQueue == null) { + this.nowPlayingQueue = new ArrayList<>(); + } + this.nowPlayingQueue.add(nowPlayingQueueItem); + return this; + } + + /** + * Get nowPlayingQueue + * + * @return nowPlayingQueue + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNowPlayingQueue() { + return nowPlayingQueue; + } + + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNowPlayingQueue(@org.eclipse.jdt.annotation.NonNull List nowPlayingQueue) { + this.nowPlayingQueue = nowPlayingQueue; + } + + public PlaybackProgressInfo playlistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Get playlistItemId + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + } + + /** + * Return true if this PlaybackProgressInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaybackProgressInfo playbackProgressInfo = (PlaybackProgressInfo) o; + return Objects.equals(this.canSeek, playbackProgressInfo.canSeek) + && Objects.equals(this.item, playbackProgressInfo.item) + && Objects.equals(this.itemId, playbackProgressInfo.itemId) + && Objects.equals(this.sessionId, playbackProgressInfo.sessionId) + && Objects.equals(this.mediaSourceId, playbackProgressInfo.mediaSourceId) + && Objects.equals(this.audioStreamIndex, playbackProgressInfo.audioStreamIndex) + && Objects.equals(this.subtitleStreamIndex, playbackProgressInfo.subtitleStreamIndex) + && Objects.equals(this.isPaused, playbackProgressInfo.isPaused) + && Objects.equals(this.isMuted, playbackProgressInfo.isMuted) + && Objects.equals(this.positionTicks, playbackProgressInfo.positionTicks) + && Objects.equals(this.playbackStartTimeTicks, playbackProgressInfo.playbackStartTimeTicks) + && Objects.equals(this.volumeLevel, playbackProgressInfo.volumeLevel) + && Objects.equals(this.brightness, playbackProgressInfo.brightness) + && Objects.equals(this.aspectRatio, playbackProgressInfo.aspectRatio) + && Objects.equals(this.playMethod, playbackProgressInfo.playMethod) + && Objects.equals(this.liveStreamId, playbackProgressInfo.liveStreamId) + && Objects.equals(this.playSessionId, playbackProgressInfo.playSessionId) + && Objects.equals(this.repeatMode, playbackProgressInfo.repeatMode) + && Objects.equals(this.playbackOrder, playbackProgressInfo.playbackOrder) + && Objects.equals(this.nowPlayingQueue, playbackProgressInfo.nowPlayingQueue) + && Objects.equals(this.playlistItemId, playbackProgressInfo.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(canSeek, item, itemId, sessionId, mediaSourceId, audioStreamIndex, subtitleStreamIndex, + isPaused, isMuted, positionTicks, playbackStartTimeTicks, volumeLevel, brightness, aspectRatio, + playMethod, liveStreamId, playSessionId, repeatMode, playbackOrder, nowPlayingQueue, playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaybackProgressInfo {\n"); + sb.append(" canSeek: ").append(toIndentedString(canSeek)).append("\n"); + sb.append(" item: ").append(toIndentedString(item)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" sessionId: ").append(toIndentedString(sessionId)).append("\n"); + sb.append(" mediaSourceId: ").append(toIndentedString(mediaSourceId)).append("\n"); + sb.append(" audioStreamIndex: ").append(toIndentedString(audioStreamIndex)).append("\n"); + sb.append(" subtitleStreamIndex: ").append(toIndentedString(subtitleStreamIndex)).append("\n"); + sb.append(" isPaused: ").append(toIndentedString(isPaused)).append("\n"); + sb.append(" isMuted: ").append(toIndentedString(isMuted)).append("\n"); + sb.append(" positionTicks: ").append(toIndentedString(positionTicks)).append("\n"); + sb.append(" playbackStartTimeTicks: ").append(toIndentedString(playbackStartTimeTicks)).append("\n"); + sb.append(" volumeLevel: ").append(toIndentedString(volumeLevel)).append("\n"); + sb.append(" brightness: ").append(toIndentedString(brightness)).append("\n"); + sb.append(" aspectRatio: ").append(toIndentedString(aspectRatio)).append("\n"); + sb.append(" playMethod: ").append(toIndentedString(playMethod)).append("\n"); + sb.append(" liveStreamId: ").append(toIndentedString(liveStreamId)).append("\n"); + sb.append(" playSessionId: ").append(toIndentedString(playSessionId)).append("\n"); + sb.append(" repeatMode: ").append(toIndentedString(repeatMode)).append("\n"); + sb.append(" playbackOrder: ").append(toIndentedString(playbackOrder)).append("\n"); + sb.append(" nowPlayingQueue: ").append(toIndentedString(nowPlayingQueue)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `CanSeek` to the URL query string + if (getCanSeek() != null) { + joiner.add(String.format("%sCanSeek%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanSeek())))); + } + + // add `Item` to the URL query string + if (getItem() != null) { + joiner.add(getItem().toUrlQueryString(prefix + "Item" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SessionId` to the URL query string + if (getSessionId() != null) { + joiner.add(String.format("%sSessionId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSessionId())))); + } + + // add `MediaSourceId` to the URL query string + if (getMediaSourceId() != null) { + joiner.add(String.format("%sMediaSourceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaSourceId())))); + } + + // add `AudioStreamIndex` to the URL query string + if (getAudioStreamIndex() != null) { + joiner.add(String.format("%sAudioStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioStreamIndex())))); + } + + // add `SubtitleStreamIndex` to the URL query string + if (getSubtitleStreamIndex() != null) { + joiner.add(String.format("%sSubtitleStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleStreamIndex())))); + } + + // add `IsPaused` to the URL query string + if (getIsPaused() != null) { + joiner.add(String.format("%sIsPaused%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPaused())))); + } + + // add `IsMuted` to the URL query string + if (getIsMuted() != null) { + joiner.add(String.format("%sIsMuted%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsMuted())))); + } + + // add `PositionTicks` to the URL query string + if (getPositionTicks() != null) { + joiner.add(String.format("%sPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPositionTicks())))); + } + + // add `PlaybackStartTimeTicks` to the URL query string + if (getPlaybackStartTimeTicks() != null) { + joiner.add(String.format("%sPlaybackStartTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaybackStartTimeTicks())))); + } + + // add `VolumeLevel` to the URL query string + if (getVolumeLevel() != null) { + joiner.add(String.format("%sVolumeLevel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVolumeLevel())))); + } + + // add `Brightness` to the URL query string + if (getBrightness() != null) { + joiner.add(String.format("%sBrightness%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBrightness())))); + } + + // add `AspectRatio` to the URL query string + if (getAspectRatio() != null) { + joiner.add(String.format("%sAspectRatio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAspectRatio())))); + } + + // add `PlayMethod` to the URL query string + if (getPlayMethod() != null) { + joiner.add(String.format("%sPlayMethod%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayMethod())))); + } + + // add `LiveStreamId` to the URL query string + if (getLiveStreamId() != null) { + joiner.add(String.format("%sLiveStreamId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLiveStreamId())))); + } + + // add `PlaySessionId` to the URL query string + if (getPlaySessionId() != null) { + joiner.add(String.format("%sPlaySessionId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaySessionId())))); + } + + // add `RepeatMode` to the URL query string + if (getRepeatMode() != null) { + joiner.add(String.format("%sRepeatMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRepeatMode())))); + } + + // add `PlaybackOrder` to the URL query string + if (getPlaybackOrder() != null) { + joiner.add(String.format("%sPlaybackOrder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaybackOrder())))); + } + + // add `NowPlayingQueue` to the URL query string + if (getNowPlayingQueue() != null) { + for (int i = 0; i < getNowPlayingQueue().size(); i++) { + if (getNowPlayingQueue().get(i) != null) { + joiner.add(getNowPlayingQueue().get(i).toUrlQueryString(String.format("%sNowPlayingQueue%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaybackProgressInfo instance; + + public Builder() { + this(new PlaybackProgressInfo()); + } + + protected Builder(PlaybackProgressInfo instance) { + this.instance = instance; + } + + public PlaybackProgressInfo.Builder canSeek(Boolean canSeek) { + this.instance.canSeek = canSeek; + return this; + } + + public PlaybackProgressInfo.Builder item(BaseItemDto item) { + this.instance.item = item; + return this; + } + + public PlaybackProgressInfo.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public PlaybackProgressInfo.Builder sessionId(String sessionId) { + this.instance.sessionId = sessionId; + return this; + } + + public PlaybackProgressInfo.Builder mediaSourceId(String mediaSourceId) { + this.instance.mediaSourceId = mediaSourceId; + return this; + } + + public PlaybackProgressInfo.Builder audioStreamIndex(Integer audioStreamIndex) { + this.instance.audioStreamIndex = audioStreamIndex; + return this; + } + + public PlaybackProgressInfo.Builder subtitleStreamIndex(Integer subtitleStreamIndex) { + this.instance.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + public PlaybackProgressInfo.Builder isPaused(Boolean isPaused) { + this.instance.isPaused = isPaused; + return this; + } + + public PlaybackProgressInfo.Builder isMuted(Boolean isMuted) { + this.instance.isMuted = isMuted; + return this; + } + + public PlaybackProgressInfo.Builder positionTicks(Long positionTicks) { + this.instance.positionTicks = positionTicks; + return this; + } + + public PlaybackProgressInfo.Builder playbackStartTimeTicks(Long playbackStartTimeTicks) { + this.instance.playbackStartTimeTicks = playbackStartTimeTicks; + return this; + } + + public PlaybackProgressInfo.Builder volumeLevel(Integer volumeLevel) { + this.instance.volumeLevel = volumeLevel; + return this; + } + + public PlaybackProgressInfo.Builder brightness(Integer brightness) { + this.instance.brightness = brightness; + return this; + } + + public PlaybackProgressInfo.Builder aspectRatio(String aspectRatio) { + this.instance.aspectRatio = aspectRatio; + return this; + } + + public PlaybackProgressInfo.Builder playMethod(PlayMethod playMethod) { + this.instance.playMethod = playMethod; + return this; + } + + public PlaybackProgressInfo.Builder liveStreamId(String liveStreamId) { + this.instance.liveStreamId = liveStreamId; + return this; + } + + public PlaybackProgressInfo.Builder playSessionId(String playSessionId) { + this.instance.playSessionId = playSessionId; + return this; + } + + public PlaybackProgressInfo.Builder repeatMode(RepeatMode repeatMode) { + this.instance.repeatMode = repeatMode; + return this; + } + + public PlaybackProgressInfo.Builder playbackOrder(PlaybackOrder playbackOrder) { + this.instance.playbackOrder = playbackOrder; + return this; + } + + public PlaybackProgressInfo.Builder nowPlayingQueue(List nowPlayingQueue) { + this.instance.nowPlayingQueue = nowPlayingQueue; + return this; + } + + public PlaybackProgressInfo.Builder playlistItemId(String playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built PlaybackProgressInfo instance. + * + * The builder is not reusable. + */ + public PlaybackProgressInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaybackProgressInfo.Builder builder() { + return new PlaybackProgressInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaybackProgressInfo.Builder toBuilder() { + return new PlaybackProgressInfo.Builder().canSeek(getCanSeek()).item(getItem()).itemId(getItemId()) + .sessionId(getSessionId()).mediaSourceId(getMediaSourceId()).audioStreamIndex(getAudioStreamIndex()) + .subtitleStreamIndex(getSubtitleStreamIndex()).isPaused(getIsPaused()).isMuted(getIsMuted()) + .positionTicks(getPositionTicks()).playbackStartTimeTicks(getPlaybackStartTimeTicks()) + .volumeLevel(getVolumeLevel()).brightness(getBrightness()).aspectRatio(getAspectRatio()) + .playMethod(getPlayMethod()).liveStreamId(getLiveStreamId()).playSessionId(getPlaySessionId()) + .repeatMode(getRepeatMode()).playbackOrder(getPlaybackOrder()).nowPlayingQueue(getNowPlayingQueue()) + .playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackRequestType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackRequestType.java new file mode 100644 index 0000000000000..cf0b1becb6d47 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackRequestType.java @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum PlaybackRequestType. + */ +public enum PlaybackRequestType { + + PLAY("Play"), + + SET_PLAYLIST_ITEM("SetPlaylistItem"), + + REMOVE_FROM_PLAYLIST("RemoveFromPlaylist"), + + MOVE_PLAYLIST_ITEM("MovePlaylistItem"), + + QUEUE("Queue"), + + UNPAUSE("Unpause"), + + PAUSE("Pause"), + + STOP("Stop"), + + SEEK("Seek"), + + BUFFER("Buffer"), + + READY("Ready"), + + NEXT_ITEM("NextItem"), + + PREVIOUS_ITEM("PreviousItem"), + + SET_REPEAT_MODE("SetRepeatMode"), + + SET_SHUFFLE_MODE("SetShuffleMode"), + + PING("Ping"), + + IGNORE_WAIT("IgnoreWait"); + + private String value; + + PlaybackRequestType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PlaybackRequestType fromValue(String value) { + for (PlaybackRequestType b : PlaybackRequestType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackStartInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackStartInfo.java new file mode 100644 index 0000000000000..8d7d15785da40 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackStartInfo.java @@ -0,0 +1,1026 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PlaybackStartInfo. + */ +@JsonPropertyOrder({ PlaybackStartInfo.JSON_PROPERTY_CAN_SEEK, PlaybackStartInfo.JSON_PROPERTY_ITEM, + PlaybackStartInfo.JSON_PROPERTY_ITEM_ID, PlaybackStartInfo.JSON_PROPERTY_SESSION_ID, + PlaybackStartInfo.JSON_PROPERTY_MEDIA_SOURCE_ID, PlaybackStartInfo.JSON_PROPERTY_AUDIO_STREAM_INDEX, + PlaybackStartInfo.JSON_PROPERTY_SUBTITLE_STREAM_INDEX, PlaybackStartInfo.JSON_PROPERTY_IS_PAUSED, + PlaybackStartInfo.JSON_PROPERTY_IS_MUTED, PlaybackStartInfo.JSON_PROPERTY_POSITION_TICKS, + PlaybackStartInfo.JSON_PROPERTY_PLAYBACK_START_TIME_TICKS, PlaybackStartInfo.JSON_PROPERTY_VOLUME_LEVEL, + PlaybackStartInfo.JSON_PROPERTY_BRIGHTNESS, PlaybackStartInfo.JSON_PROPERTY_ASPECT_RATIO, + PlaybackStartInfo.JSON_PROPERTY_PLAY_METHOD, PlaybackStartInfo.JSON_PROPERTY_LIVE_STREAM_ID, + PlaybackStartInfo.JSON_PROPERTY_PLAY_SESSION_ID, PlaybackStartInfo.JSON_PROPERTY_REPEAT_MODE, + PlaybackStartInfo.JSON_PROPERTY_PLAYBACK_ORDER, PlaybackStartInfo.JSON_PROPERTY_NOW_PLAYING_QUEUE, + PlaybackStartInfo.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaybackStartInfo { + public static final String JSON_PROPERTY_CAN_SEEK = "CanSeek"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canSeek; + + public static final String JSON_PROPERTY_ITEM = "Item"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemDto item; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SESSION_ID = "SessionId"; + @org.eclipse.jdt.annotation.NonNull + private String sessionId; + + public static final String JSON_PROPERTY_MEDIA_SOURCE_ID = "MediaSourceId"; + @org.eclipse.jdt.annotation.NonNull + private String mediaSourceId; + + public static final String JSON_PROPERTY_AUDIO_STREAM_INDEX = "AudioStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer audioStreamIndex; + + public static final String JSON_PROPERTY_SUBTITLE_STREAM_INDEX = "SubtitleStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer subtitleStreamIndex; + + public static final String JSON_PROPERTY_IS_PAUSED = "IsPaused"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPaused; + + public static final String JSON_PROPERTY_IS_MUTED = "IsMuted"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isMuted; + + public static final String JSON_PROPERTY_POSITION_TICKS = "PositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long positionTicks; + + public static final String JSON_PROPERTY_PLAYBACK_START_TIME_TICKS = "PlaybackStartTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long playbackStartTimeTicks; + + public static final String JSON_PROPERTY_VOLUME_LEVEL = "VolumeLevel"; + @org.eclipse.jdt.annotation.NonNull + private Integer volumeLevel; + + public static final String JSON_PROPERTY_BRIGHTNESS = "Brightness"; + @org.eclipse.jdt.annotation.NonNull + private Integer brightness; + + public static final String JSON_PROPERTY_ASPECT_RATIO = "AspectRatio"; + @org.eclipse.jdt.annotation.NonNull + private String aspectRatio; + + public static final String JSON_PROPERTY_PLAY_METHOD = "PlayMethod"; + @org.eclipse.jdt.annotation.NonNull + private PlayMethod playMethod; + + public static final String JSON_PROPERTY_LIVE_STREAM_ID = "LiveStreamId"; + @org.eclipse.jdt.annotation.NonNull + private String liveStreamId; + + public static final String JSON_PROPERTY_PLAY_SESSION_ID = "PlaySessionId"; + @org.eclipse.jdt.annotation.NonNull + private String playSessionId; + + public static final String JSON_PROPERTY_REPEAT_MODE = "RepeatMode"; + @org.eclipse.jdt.annotation.NonNull + private RepeatMode repeatMode; + + public static final String JSON_PROPERTY_PLAYBACK_ORDER = "PlaybackOrder"; + @org.eclipse.jdt.annotation.NonNull + private PlaybackOrder playbackOrder; + + public static final String JSON_PROPERTY_NOW_PLAYING_QUEUE = "NowPlayingQueue"; + @org.eclipse.jdt.annotation.NonNull + private List nowPlayingQueue; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private String playlistItemId; + + public PlaybackStartInfo() { + } + + public PlaybackStartInfo canSeek(@org.eclipse.jdt.annotation.NonNull Boolean canSeek) { + this.canSeek = canSeek; + return this; + } + + /** + * Gets or sets a value indicating whether this instance can seek. + * + * @return canSeek + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_SEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanSeek() { + return canSeek; + } + + @JsonProperty(JSON_PROPERTY_CAN_SEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanSeek(@org.eclipse.jdt.annotation.NonNull Boolean canSeek) { + this.canSeek = canSeek; + } + + public PlaybackStartInfo item(@org.eclipse.jdt.annotation.NonNull BaseItemDto item) { + this.item = item; + return this; + } + + /** + * Gets or sets the item. + * + * @return item + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemDto getItem() { + return item; + } + + @JsonProperty(JSON_PROPERTY_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItem(@org.eclipse.jdt.annotation.NonNull BaseItemDto item) { + this.item = item; + } + + public PlaybackStartInfo itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item identifier. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public PlaybackStartInfo sessionId(@org.eclipse.jdt.annotation.NonNull String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Gets or sets the session id. + * + * @return sessionId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSessionId() { + return sessionId; + } + + @JsonProperty(JSON_PROPERTY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSessionId(@org.eclipse.jdt.annotation.NonNull String sessionId) { + this.sessionId = sessionId; + } + + public PlaybackStartInfo mediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + return this; + } + + /** + * Gets or sets the media version identifier. + * + * @return mediaSourceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMediaSourceId() { + return mediaSourceId; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + } + + public PlaybackStartInfo audioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + return this; + } + + /** + * Gets or sets the index of the audio stream. + * + * @return audioStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAudioStreamIndex() { + return audioStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + } + + public PlaybackStartInfo subtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + /** + * Gets or sets the index of the subtitle stream. + * + * @return subtitleStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSubtitleStreamIndex() { + return subtitleStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + } + + public PlaybackStartInfo isPaused(@org.eclipse.jdt.annotation.NonNull Boolean isPaused) { + this.isPaused = isPaused; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is paused. + * + * @return isPaused + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PAUSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPaused() { + return isPaused; + } + + @JsonProperty(JSON_PROPERTY_IS_PAUSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPaused(@org.eclipse.jdt.annotation.NonNull Boolean isPaused) { + this.isPaused = isPaused; + } + + public PlaybackStartInfo isMuted(@org.eclipse.jdt.annotation.NonNull Boolean isMuted) { + this.isMuted = isMuted; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is muted. + * + * @return isMuted + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_MUTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsMuted() { + return isMuted; + } + + @JsonProperty(JSON_PROPERTY_IS_MUTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMuted(@org.eclipse.jdt.annotation.NonNull Boolean isMuted) { + this.isMuted = isMuted; + } + + public PlaybackStartInfo positionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + return this; + } + + /** + * Gets or sets the position ticks. + * + * @return positionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPositionTicks() { + return positionTicks; + } + + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPositionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + } + + public PlaybackStartInfo playbackStartTimeTicks(@org.eclipse.jdt.annotation.NonNull Long playbackStartTimeTicks) { + this.playbackStartTimeTicks = playbackStartTimeTicks; + return this; + } + + /** + * Get playbackStartTimeTicks + * + * @return playbackStartTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYBACK_START_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPlaybackStartTimeTicks() { + return playbackStartTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_PLAYBACK_START_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaybackStartTimeTicks(@org.eclipse.jdt.annotation.NonNull Long playbackStartTimeTicks) { + this.playbackStartTimeTicks = playbackStartTimeTicks; + } + + public PlaybackStartInfo volumeLevel(@org.eclipse.jdt.annotation.NonNull Integer volumeLevel) { + this.volumeLevel = volumeLevel; + return this; + } + + /** + * Gets or sets the volume level. + * + * @return volumeLevel + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VOLUME_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getVolumeLevel() { + return volumeLevel; + } + + @JsonProperty(JSON_PROPERTY_VOLUME_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVolumeLevel(@org.eclipse.jdt.annotation.NonNull Integer volumeLevel) { + this.volumeLevel = volumeLevel; + } + + public PlaybackStartInfo brightness(@org.eclipse.jdt.annotation.NonNull Integer brightness) { + this.brightness = brightness; + return this; + } + + /** + * Get brightness + * + * @return brightness + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BRIGHTNESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBrightness() { + return brightness; + } + + @JsonProperty(JSON_PROPERTY_BRIGHTNESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBrightness(@org.eclipse.jdt.annotation.NonNull Integer brightness) { + this.brightness = brightness; + } + + public PlaybackStartInfo aspectRatio(@org.eclipse.jdt.annotation.NonNull String aspectRatio) { + this.aspectRatio = aspectRatio; + return this; + } + + /** + * Get aspectRatio + * + * @return aspectRatio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAspectRatio() { + return aspectRatio; + } + + @JsonProperty(JSON_PROPERTY_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAspectRatio(@org.eclipse.jdt.annotation.NonNull String aspectRatio) { + this.aspectRatio = aspectRatio; + } + + public PlaybackStartInfo playMethod(@org.eclipse.jdt.annotation.NonNull PlayMethod playMethod) { + this.playMethod = playMethod; + return this; + } + + /** + * Gets or sets the play method. + * + * @return playMethod + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlayMethod getPlayMethod() { + return playMethod; + } + + @JsonProperty(JSON_PROPERTY_PLAY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayMethod(@org.eclipse.jdt.annotation.NonNull PlayMethod playMethod) { + this.playMethod = playMethod; + } + + public PlaybackStartInfo liveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + return this; + } + + /** + * Gets or sets the live stream identifier. + * + * @return liveStreamId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLiveStreamId() { + return liveStreamId; + } + + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLiveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + } + + public PlaybackStartInfo playSessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + return this; + } + + /** + * Gets or sets the play session identifier. + * + * @return playSessionId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaySessionId() { + return playSessionId; + } + + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaySessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + } + + public PlaybackStartInfo repeatMode(@org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode) { + this.repeatMode = repeatMode; + return this; + } + + /** + * Gets or sets the repeat mode. + * + * @return repeatMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REPEAT_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RepeatMode getRepeatMode() { + return repeatMode; + } + + @JsonProperty(JSON_PROPERTY_REPEAT_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepeatMode(@org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode) { + this.repeatMode = repeatMode; + } + + public PlaybackStartInfo playbackOrder(@org.eclipse.jdt.annotation.NonNull PlaybackOrder playbackOrder) { + this.playbackOrder = playbackOrder; + return this; + } + + /** + * Gets or sets the playback order. + * + * @return playbackOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYBACK_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlaybackOrder getPlaybackOrder() { + return playbackOrder; + } + + @JsonProperty(JSON_PROPERTY_PLAYBACK_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaybackOrder(@org.eclipse.jdt.annotation.NonNull PlaybackOrder playbackOrder) { + this.playbackOrder = playbackOrder; + } + + public PlaybackStartInfo nowPlayingQueue(@org.eclipse.jdt.annotation.NonNull List nowPlayingQueue) { + this.nowPlayingQueue = nowPlayingQueue; + return this; + } + + public PlaybackStartInfo addNowPlayingQueueItem(QueueItem nowPlayingQueueItem) { + if (this.nowPlayingQueue == null) { + this.nowPlayingQueue = new ArrayList<>(); + } + this.nowPlayingQueue.add(nowPlayingQueueItem); + return this; + } + + /** + * Get nowPlayingQueue + * + * @return nowPlayingQueue + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNowPlayingQueue() { + return nowPlayingQueue; + } + + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNowPlayingQueue(@org.eclipse.jdt.annotation.NonNull List nowPlayingQueue) { + this.nowPlayingQueue = nowPlayingQueue; + } + + public PlaybackStartInfo playlistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Get playlistItemId + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + } + + /** + * Return true if this PlaybackStartInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaybackStartInfo playbackStartInfo = (PlaybackStartInfo) o; + return Objects.equals(this.canSeek, playbackStartInfo.canSeek) + && Objects.equals(this.item, playbackStartInfo.item) + && Objects.equals(this.itemId, playbackStartInfo.itemId) + && Objects.equals(this.sessionId, playbackStartInfo.sessionId) + && Objects.equals(this.mediaSourceId, playbackStartInfo.mediaSourceId) + && Objects.equals(this.audioStreamIndex, playbackStartInfo.audioStreamIndex) + && Objects.equals(this.subtitleStreamIndex, playbackStartInfo.subtitleStreamIndex) + && Objects.equals(this.isPaused, playbackStartInfo.isPaused) + && Objects.equals(this.isMuted, playbackStartInfo.isMuted) + && Objects.equals(this.positionTicks, playbackStartInfo.positionTicks) + && Objects.equals(this.playbackStartTimeTicks, playbackStartInfo.playbackStartTimeTicks) + && Objects.equals(this.volumeLevel, playbackStartInfo.volumeLevel) + && Objects.equals(this.brightness, playbackStartInfo.brightness) + && Objects.equals(this.aspectRatio, playbackStartInfo.aspectRatio) + && Objects.equals(this.playMethod, playbackStartInfo.playMethod) + && Objects.equals(this.liveStreamId, playbackStartInfo.liveStreamId) + && Objects.equals(this.playSessionId, playbackStartInfo.playSessionId) + && Objects.equals(this.repeatMode, playbackStartInfo.repeatMode) + && Objects.equals(this.playbackOrder, playbackStartInfo.playbackOrder) + && Objects.equals(this.nowPlayingQueue, playbackStartInfo.nowPlayingQueue) + && Objects.equals(this.playlistItemId, playbackStartInfo.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(canSeek, item, itemId, sessionId, mediaSourceId, audioStreamIndex, subtitleStreamIndex, + isPaused, isMuted, positionTicks, playbackStartTimeTicks, volumeLevel, brightness, aspectRatio, + playMethod, liveStreamId, playSessionId, repeatMode, playbackOrder, nowPlayingQueue, playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaybackStartInfo {\n"); + sb.append(" canSeek: ").append(toIndentedString(canSeek)).append("\n"); + sb.append(" item: ").append(toIndentedString(item)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" sessionId: ").append(toIndentedString(sessionId)).append("\n"); + sb.append(" mediaSourceId: ").append(toIndentedString(mediaSourceId)).append("\n"); + sb.append(" audioStreamIndex: ").append(toIndentedString(audioStreamIndex)).append("\n"); + sb.append(" subtitleStreamIndex: ").append(toIndentedString(subtitleStreamIndex)).append("\n"); + sb.append(" isPaused: ").append(toIndentedString(isPaused)).append("\n"); + sb.append(" isMuted: ").append(toIndentedString(isMuted)).append("\n"); + sb.append(" positionTicks: ").append(toIndentedString(positionTicks)).append("\n"); + sb.append(" playbackStartTimeTicks: ").append(toIndentedString(playbackStartTimeTicks)).append("\n"); + sb.append(" volumeLevel: ").append(toIndentedString(volumeLevel)).append("\n"); + sb.append(" brightness: ").append(toIndentedString(brightness)).append("\n"); + sb.append(" aspectRatio: ").append(toIndentedString(aspectRatio)).append("\n"); + sb.append(" playMethod: ").append(toIndentedString(playMethod)).append("\n"); + sb.append(" liveStreamId: ").append(toIndentedString(liveStreamId)).append("\n"); + sb.append(" playSessionId: ").append(toIndentedString(playSessionId)).append("\n"); + sb.append(" repeatMode: ").append(toIndentedString(repeatMode)).append("\n"); + sb.append(" playbackOrder: ").append(toIndentedString(playbackOrder)).append("\n"); + sb.append(" nowPlayingQueue: ").append(toIndentedString(nowPlayingQueue)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `CanSeek` to the URL query string + if (getCanSeek() != null) { + joiner.add(String.format("%sCanSeek%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanSeek())))); + } + + // add `Item` to the URL query string + if (getItem() != null) { + joiner.add(getItem().toUrlQueryString(prefix + "Item" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SessionId` to the URL query string + if (getSessionId() != null) { + joiner.add(String.format("%sSessionId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSessionId())))); + } + + // add `MediaSourceId` to the URL query string + if (getMediaSourceId() != null) { + joiner.add(String.format("%sMediaSourceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaSourceId())))); + } + + // add `AudioStreamIndex` to the URL query string + if (getAudioStreamIndex() != null) { + joiner.add(String.format("%sAudioStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioStreamIndex())))); + } + + // add `SubtitleStreamIndex` to the URL query string + if (getSubtitleStreamIndex() != null) { + joiner.add(String.format("%sSubtitleStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleStreamIndex())))); + } + + // add `IsPaused` to the URL query string + if (getIsPaused() != null) { + joiner.add(String.format("%sIsPaused%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPaused())))); + } + + // add `IsMuted` to the URL query string + if (getIsMuted() != null) { + joiner.add(String.format("%sIsMuted%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsMuted())))); + } + + // add `PositionTicks` to the URL query string + if (getPositionTicks() != null) { + joiner.add(String.format("%sPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPositionTicks())))); + } + + // add `PlaybackStartTimeTicks` to the URL query string + if (getPlaybackStartTimeTicks() != null) { + joiner.add(String.format("%sPlaybackStartTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaybackStartTimeTicks())))); + } + + // add `VolumeLevel` to the URL query string + if (getVolumeLevel() != null) { + joiner.add(String.format("%sVolumeLevel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVolumeLevel())))); + } + + // add `Brightness` to the URL query string + if (getBrightness() != null) { + joiner.add(String.format("%sBrightness%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBrightness())))); + } + + // add `AspectRatio` to the URL query string + if (getAspectRatio() != null) { + joiner.add(String.format("%sAspectRatio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAspectRatio())))); + } + + // add `PlayMethod` to the URL query string + if (getPlayMethod() != null) { + joiner.add(String.format("%sPlayMethod%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayMethod())))); + } + + // add `LiveStreamId` to the URL query string + if (getLiveStreamId() != null) { + joiner.add(String.format("%sLiveStreamId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLiveStreamId())))); + } + + // add `PlaySessionId` to the URL query string + if (getPlaySessionId() != null) { + joiner.add(String.format("%sPlaySessionId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaySessionId())))); + } + + // add `RepeatMode` to the URL query string + if (getRepeatMode() != null) { + joiner.add(String.format("%sRepeatMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRepeatMode())))); + } + + // add `PlaybackOrder` to the URL query string + if (getPlaybackOrder() != null) { + joiner.add(String.format("%sPlaybackOrder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaybackOrder())))); + } + + // add `NowPlayingQueue` to the URL query string + if (getNowPlayingQueue() != null) { + for (int i = 0; i < getNowPlayingQueue().size(); i++) { + if (getNowPlayingQueue().get(i) != null) { + joiner.add(getNowPlayingQueue().get(i).toUrlQueryString(String.format("%sNowPlayingQueue%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaybackStartInfo instance; + + public Builder() { + this(new PlaybackStartInfo()); + } + + protected Builder(PlaybackStartInfo instance) { + this.instance = instance; + } + + public PlaybackStartInfo.Builder canSeek(Boolean canSeek) { + this.instance.canSeek = canSeek; + return this; + } + + public PlaybackStartInfo.Builder item(BaseItemDto item) { + this.instance.item = item; + return this; + } + + public PlaybackStartInfo.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public PlaybackStartInfo.Builder sessionId(String sessionId) { + this.instance.sessionId = sessionId; + return this; + } + + public PlaybackStartInfo.Builder mediaSourceId(String mediaSourceId) { + this.instance.mediaSourceId = mediaSourceId; + return this; + } + + public PlaybackStartInfo.Builder audioStreamIndex(Integer audioStreamIndex) { + this.instance.audioStreamIndex = audioStreamIndex; + return this; + } + + public PlaybackStartInfo.Builder subtitleStreamIndex(Integer subtitleStreamIndex) { + this.instance.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + public PlaybackStartInfo.Builder isPaused(Boolean isPaused) { + this.instance.isPaused = isPaused; + return this; + } + + public PlaybackStartInfo.Builder isMuted(Boolean isMuted) { + this.instance.isMuted = isMuted; + return this; + } + + public PlaybackStartInfo.Builder positionTicks(Long positionTicks) { + this.instance.positionTicks = positionTicks; + return this; + } + + public PlaybackStartInfo.Builder playbackStartTimeTicks(Long playbackStartTimeTicks) { + this.instance.playbackStartTimeTicks = playbackStartTimeTicks; + return this; + } + + public PlaybackStartInfo.Builder volumeLevel(Integer volumeLevel) { + this.instance.volumeLevel = volumeLevel; + return this; + } + + public PlaybackStartInfo.Builder brightness(Integer brightness) { + this.instance.brightness = brightness; + return this; + } + + public PlaybackStartInfo.Builder aspectRatio(String aspectRatio) { + this.instance.aspectRatio = aspectRatio; + return this; + } + + public PlaybackStartInfo.Builder playMethod(PlayMethod playMethod) { + this.instance.playMethod = playMethod; + return this; + } + + public PlaybackStartInfo.Builder liveStreamId(String liveStreamId) { + this.instance.liveStreamId = liveStreamId; + return this; + } + + public PlaybackStartInfo.Builder playSessionId(String playSessionId) { + this.instance.playSessionId = playSessionId; + return this; + } + + public PlaybackStartInfo.Builder repeatMode(RepeatMode repeatMode) { + this.instance.repeatMode = repeatMode; + return this; + } + + public PlaybackStartInfo.Builder playbackOrder(PlaybackOrder playbackOrder) { + this.instance.playbackOrder = playbackOrder; + return this; + } + + public PlaybackStartInfo.Builder nowPlayingQueue(List nowPlayingQueue) { + this.instance.nowPlayingQueue = nowPlayingQueue; + return this; + } + + public PlaybackStartInfo.Builder playlistItemId(String playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built PlaybackStartInfo instance. + * + * The builder is not reusable. + */ + public PlaybackStartInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaybackStartInfo.Builder builder() { + return new PlaybackStartInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaybackStartInfo.Builder toBuilder() { + return new PlaybackStartInfo.Builder().canSeek(getCanSeek()).item(getItem()).itemId(getItemId()) + .sessionId(getSessionId()).mediaSourceId(getMediaSourceId()).audioStreamIndex(getAudioStreamIndex()) + .subtitleStreamIndex(getSubtitleStreamIndex()).isPaused(getIsPaused()).isMuted(getIsMuted()) + .positionTicks(getPositionTicks()).playbackStartTimeTicks(getPlaybackStartTimeTicks()) + .volumeLevel(getVolumeLevel()).brightness(getBrightness()).aspectRatio(getAspectRatio()) + .playMethod(getPlayMethod()).liveStreamId(getLiveStreamId()).playSessionId(getPlaySessionId()) + .repeatMode(getRepeatMode()).playbackOrder(getPlaybackOrder()).nowPlayingQueue(getNowPlayingQueue()) + .playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackStopInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackStopInfo.java new file mode 100644 index 0000000000000..51d6ca686d4a8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaybackStopInfo.java @@ -0,0 +1,615 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PlaybackStopInfo. + */ +@JsonPropertyOrder({ PlaybackStopInfo.JSON_PROPERTY_ITEM, PlaybackStopInfo.JSON_PROPERTY_ITEM_ID, + PlaybackStopInfo.JSON_PROPERTY_SESSION_ID, PlaybackStopInfo.JSON_PROPERTY_MEDIA_SOURCE_ID, + PlaybackStopInfo.JSON_PROPERTY_POSITION_TICKS, PlaybackStopInfo.JSON_PROPERTY_LIVE_STREAM_ID, + PlaybackStopInfo.JSON_PROPERTY_PLAY_SESSION_ID, PlaybackStopInfo.JSON_PROPERTY_FAILED, + PlaybackStopInfo.JSON_PROPERTY_NEXT_MEDIA_TYPE, PlaybackStopInfo.JSON_PROPERTY_PLAYLIST_ITEM_ID, + PlaybackStopInfo.JSON_PROPERTY_NOW_PLAYING_QUEUE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaybackStopInfo { + public static final String JSON_PROPERTY_ITEM = "Item"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemDto item; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SESSION_ID = "SessionId"; + @org.eclipse.jdt.annotation.NonNull + private String sessionId; + + public static final String JSON_PROPERTY_MEDIA_SOURCE_ID = "MediaSourceId"; + @org.eclipse.jdt.annotation.NonNull + private String mediaSourceId; + + public static final String JSON_PROPERTY_POSITION_TICKS = "PositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long positionTicks; + + public static final String JSON_PROPERTY_LIVE_STREAM_ID = "LiveStreamId"; + @org.eclipse.jdt.annotation.NonNull + private String liveStreamId; + + public static final String JSON_PROPERTY_PLAY_SESSION_ID = "PlaySessionId"; + @org.eclipse.jdt.annotation.NonNull + private String playSessionId; + + public static final String JSON_PROPERTY_FAILED = "Failed"; + @org.eclipse.jdt.annotation.NonNull + private Boolean failed; + + public static final String JSON_PROPERTY_NEXT_MEDIA_TYPE = "NextMediaType"; + @org.eclipse.jdt.annotation.NonNull + private String nextMediaType; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private String playlistItemId; + + public static final String JSON_PROPERTY_NOW_PLAYING_QUEUE = "NowPlayingQueue"; + @org.eclipse.jdt.annotation.NonNull + private List nowPlayingQueue; + + public PlaybackStopInfo() { + } + + public PlaybackStopInfo item(@org.eclipse.jdt.annotation.NonNull BaseItemDto item) { + this.item = item; + return this; + } + + /** + * Gets or sets the item. + * + * @return item + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemDto getItem() { + return item; + } + + @JsonProperty(JSON_PROPERTY_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItem(@org.eclipse.jdt.annotation.NonNull BaseItemDto item) { + this.item = item; + } + + public PlaybackStopInfo itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item identifier. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public PlaybackStopInfo sessionId(@org.eclipse.jdt.annotation.NonNull String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Gets or sets the session id. + * + * @return sessionId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSessionId() { + return sessionId; + } + + @JsonProperty(JSON_PROPERTY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSessionId(@org.eclipse.jdt.annotation.NonNull String sessionId) { + this.sessionId = sessionId; + } + + public PlaybackStopInfo mediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + return this; + } + + /** + * Gets or sets the media version identifier. + * + * @return mediaSourceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMediaSourceId() { + return mediaSourceId; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + } + + public PlaybackStopInfo positionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + return this; + } + + /** + * Gets or sets the position ticks. + * + * @return positionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPositionTicks() { + return positionTicks; + } + + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPositionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + } + + public PlaybackStopInfo liveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + return this; + } + + /** + * Gets or sets the live stream identifier. + * + * @return liveStreamId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLiveStreamId() { + return liveStreamId; + } + + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLiveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + } + + public PlaybackStopInfo playSessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + return this; + } + + /** + * Gets or sets the play session identifier. + * + * @return playSessionId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaySessionId() { + return playSessionId; + } + + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaySessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + } + + public PlaybackStopInfo failed(@org.eclipse.jdt.annotation.NonNull Boolean failed) { + this.failed = failed; + return this; + } + + /** + * Gets or sets a value indicating whether this MediaBrowser.Model.Session.PlaybackStopInfo is failed. + * + * @return failed + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FAILED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getFailed() { + return failed; + } + + @JsonProperty(JSON_PROPERTY_FAILED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFailed(@org.eclipse.jdt.annotation.NonNull Boolean failed) { + this.failed = failed; + } + + public PlaybackStopInfo nextMediaType(@org.eclipse.jdt.annotation.NonNull String nextMediaType) { + this.nextMediaType = nextMediaType; + return this; + } + + /** + * Get nextMediaType + * + * @return nextMediaType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NEXT_MEDIA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNextMediaType() { + return nextMediaType; + } + + @JsonProperty(JSON_PROPERTY_NEXT_MEDIA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNextMediaType(@org.eclipse.jdt.annotation.NonNull String nextMediaType) { + this.nextMediaType = nextMediaType; + } + + public PlaybackStopInfo playlistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Get playlistItemId + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + } + + public PlaybackStopInfo nowPlayingQueue(@org.eclipse.jdt.annotation.NonNull List nowPlayingQueue) { + this.nowPlayingQueue = nowPlayingQueue; + return this; + } + + public PlaybackStopInfo addNowPlayingQueueItem(QueueItem nowPlayingQueueItem) { + if (this.nowPlayingQueue == null) { + this.nowPlayingQueue = new ArrayList<>(); + } + this.nowPlayingQueue.add(nowPlayingQueueItem); + return this; + } + + /** + * Get nowPlayingQueue + * + * @return nowPlayingQueue + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNowPlayingQueue() { + return nowPlayingQueue; + } + + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNowPlayingQueue(@org.eclipse.jdt.annotation.NonNull List nowPlayingQueue) { + this.nowPlayingQueue = nowPlayingQueue; + } + + /** + * Return true if this PlaybackStopInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaybackStopInfo playbackStopInfo = (PlaybackStopInfo) o; + return Objects.equals(this.item, playbackStopInfo.item) && Objects.equals(this.itemId, playbackStopInfo.itemId) + && Objects.equals(this.sessionId, playbackStopInfo.sessionId) + && Objects.equals(this.mediaSourceId, playbackStopInfo.mediaSourceId) + && Objects.equals(this.positionTicks, playbackStopInfo.positionTicks) + && Objects.equals(this.liveStreamId, playbackStopInfo.liveStreamId) + && Objects.equals(this.playSessionId, playbackStopInfo.playSessionId) + && Objects.equals(this.failed, playbackStopInfo.failed) + && Objects.equals(this.nextMediaType, playbackStopInfo.nextMediaType) + && Objects.equals(this.playlistItemId, playbackStopInfo.playlistItemId) + && Objects.equals(this.nowPlayingQueue, playbackStopInfo.nowPlayingQueue); + } + + @Override + public int hashCode() { + return Objects.hash(item, itemId, sessionId, mediaSourceId, positionTicks, liveStreamId, playSessionId, failed, + nextMediaType, playlistItemId, nowPlayingQueue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaybackStopInfo {\n"); + sb.append(" item: ").append(toIndentedString(item)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" sessionId: ").append(toIndentedString(sessionId)).append("\n"); + sb.append(" mediaSourceId: ").append(toIndentedString(mediaSourceId)).append("\n"); + sb.append(" positionTicks: ").append(toIndentedString(positionTicks)).append("\n"); + sb.append(" liveStreamId: ").append(toIndentedString(liveStreamId)).append("\n"); + sb.append(" playSessionId: ").append(toIndentedString(playSessionId)).append("\n"); + sb.append(" failed: ").append(toIndentedString(failed)).append("\n"); + sb.append(" nextMediaType: ").append(toIndentedString(nextMediaType)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append(" nowPlayingQueue: ").append(toIndentedString(nowPlayingQueue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Item` to the URL query string + if (getItem() != null) { + joiner.add(getItem().toUrlQueryString(prefix + "Item" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SessionId` to the URL query string + if (getSessionId() != null) { + joiner.add(String.format("%sSessionId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSessionId())))); + } + + // add `MediaSourceId` to the URL query string + if (getMediaSourceId() != null) { + joiner.add(String.format("%sMediaSourceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaSourceId())))); + } + + // add `PositionTicks` to the URL query string + if (getPositionTicks() != null) { + joiner.add(String.format("%sPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPositionTicks())))); + } + + // add `LiveStreamId` to the URL query string + if (getLiveStreamId() != null) { + joiner.add(String.format("%sLiveStreamId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLiveStreamId())))); + } + + // add `PlaySessionId` to the URL query string + if (getPlaySessionId() != null) { + joiner.add(String.format("%sPlaySessionId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaySessionId())))); + } + + // add `Failed` to the URL query string + if (getFailed() != null) { + joiner.add(String.format("%sFailed%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFailed())))); + } + + // add `NextMediaType` to the URL query string + if (getNextMediaType() != null) { + joiner.add(String.format("%sNextMediaType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getNextMediaType())))); + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + // add `NowPlayingQueue` to the URL query string + if (getNowPlayingQueue() != null) { + for (int i = 0; i < getNowPlayingQueue().size(); i++) { + if (getNowPlayingQueue().get(i) != null) { + joiner.add(getNowPlayingQueue().get(i).toUrlQueryString(String.format("%sNowPlayingQueue%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaybackStopInfo instance; + + public Builder() { + this(new PlaybackStopInfo()); + } + + protected Builder(PlaybackStopInfo instance) { + this.instance = instance; + } + + public PlaybackStopInfo.Builder item(BaseItemDto item) { + this.instance.item = item; + return this; + } + + public PlaybackStopInfo.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public PlaybackStopInfo.Builder sessionId(String sessionId) { + this.instance.sessionId = sessionId; + return this; + } + + public PlaybackStopInfo.Builder mediaSourceId(String mediaSourceId) { + this.instance.mediaSourceId = mediaSourceId; + return this; + } + + public PlaybackStopInfo.Builder positionTicks(Long positionTicks) { + this.instance.positionTicks = positionTicks; + return this; + } + + public PlaybackStopInfo.Builder liveStreamId(String liveStreamId) { + this.instance.liveStreamId = liveStreamId; + return this; + } + + public PlaybackStopInfo.Builder playSessionId(String playSessionId) { + this.instance.playSessionId = playSessionId; + return this; + } + + public PlaybackStopInfo.Builder failed(Boolean failed) { + this.instance.failed = failed; + return this; + } + + public PlaybackStopInfo.Builder nextMediaType(String nextMediaType) { + this.instance.nextMediaType = nextMediaType; + return this; + } + + public PlaybackStopInfo.Builder playlistItemId(String playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + public PlaybackStopInfo.Builder nowPlayingQueue(List nowPlayingQueue) { + this.instance.nowPlayingQueue = nowPlayingQueue; + return this; + } + + /** + * returns a built PlaybackStopInfo instance. + * + * The builder is not reusable. + */ + public PlaybackStopInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaybackStopInfo.Builder builder() { + return new PlaybackStopInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaybackStopInfo.Builder toBuilder() { + return new PlaybackStopInfo.Builder().item(getItem()).itemId(getItemId()).sessionId(getSessionId()) + .mediaSourceId(getMediaSourceId()).positionTicks(getPositionTicks()).liveStreamId(getLiveStreamId()) + .playSessionId(getPlaySessionId()).failed(getFailed()).nextMediaType(getNextMediaType()) + .playlistItemId(getPlaylistItemId()).nowPlayingQueue(getNowPlayingQueue()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayerStateInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayerStateInfo.java new file mode 100644 index 0000000000000..b127020aeb332 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlayerStateInfo.java @@ -0,0 +1,642 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * PlayerStateInfo + */ +@JsonPropertyOrder({ PlayerStateInfo.JSON_PROPERTY_POSITION_TICKS, PlayerStateInfo.JSON_PROPERTY_CAN_SEEK, + PlayerStateInfo.JSON_PROPERTY_IS_PAUSED, PlayerStateInfo.JSON_PROPERTY_IS_MUTED, + PlayerStateInfo.JSON_PROPERTY_VOLUME_LEVEL, PlayerStateInfo.JSON_PROPERTY_AUDIO_STREAM_INDEX, + PlayerStateInfo.JSON_PROPERTY_SUBTITLE_STREAM_INDEX, PlayerStateInfo.JSON_PROPERTY_MEDIA_SOURCE_ID, + PlayerStateInfo.JSON_PROPERTY_PLAY_METHOD, PlayerStateInfo.JSON_PROPERTY_REPEAT_MODE, + PlayerStateInfo.JSON_PROPERTY_PLAYBACK_ORDER, PlayerStateInfo.JSON_PROPERTY_LIVE_STREAM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlayerStateInfo { + public static final String JSON_PROPERTY_POSITION_TICKS = "PositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long positionTicks; + + public static final String JSON_PROPERTY_CAN_SEEK = "CanSeek"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canSeek; + + public static final String JSON_PROPERTY_IS_PAUSED = "IsPaused"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPaused; + + public static final String JSON_PROPERTY_IS_MUTED = "IsMuted"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isMuted; + + public static final String JSON_PROPERTY_VOLUME_LEVEL = "VolumeLevel"; + @org.eclipse.jdt.annotation.NonNull + private Integer volumeLevel; + + public static final String JSON_PROPERTY_AUDIO_STREAM_INDEX = "AudioStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer audioStreamIndex; + + public static final String JSON_PROPERTY_SUBTITLE_STREAM_INDEX = "SubtitleStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer subtitleStreamIndex; + + public static final String JSON_PROPERTY_MEDIA_SOURCE_ID = "MediaSourceId"; + @org.eclipse.jdt.annotation.NonNull + private String mediaSourceId; + + public static final String JSON_PROPERTY_PLAY_METHOD = "PlayMethod"; + @org.eclipse.jdt.annotation.NonNull + private PlayMethod playMethod; + + public static final String JSON_PROPERTY_REPEAT_MODE = "RepeatMode"; + @org.eclipse.jdt.annotation.NonNull + private RepeatMode repeatMode; + + public static final String JSON_PROPERTY_PLAYBACK_ORDER = "PlaybackOrder"; + @org.eclipse.jdt.annotation.NonNull + private PlaybackOrder playbackOrder; + + public static final String JSON_PROPERTY_LIVE_STREAM_ID = "LiveStreamId"; + @org.eclipse.jdt.annotation.NonNull + private String liveStreamId; + + public PlayerStateInfo() { + } + + public PlayerStateInfo positionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + return this; + } + + /** + * Gets or sets the now playing position ticks. + * + * @return positionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPositionTicks() { + return positionTicks; + } + + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPositionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + } + + public PlayerStateInfo canSeek(@org.eclipse.jdt.annotation.NonNull Boolean canSeek) { + this.canSeek = canSeek; + return this; + } + + /** + * Gets or sets a value indicating whether this instance can seek. + * + * @return canSeek + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_SEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanSeek() { + return canSeek; + } + + @JsonProperty(JSON_PROPERTY_CAN_SEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanSeek(@org.eclipse.jdt.annotation.NonNull Boolean canSeek) { + this.canSeek = canSeek; + } + + public PlayerStateInfo isPaused(@org.eclipse.jdt.annotation.NonNull Boolean isPaused) { + this.isPaused = isPaused; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is paused. + * + * @return isPaused + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PAUSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPaused() { + return isPaused; + } + + @JsonProperty(JSON_PROPERTY_IS_PAUSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPaused(@org.eclipse.jdt.annotation.NonNull Boolean isPaused) { + this.isPaused = isPaused; + } + + public PlayerStateInfo isMuted(@org.eclipse.jdt.annotation.NonNull Boolean isMuted) { + this.isMuted = isMuted; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is muted. + * + * @return isMuted + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_MUTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsMuted() { + return isMuted; + } + + @JsonProperty(JSON_PROPERTY_IS_MUTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMuted(@org.eclipse.jdt.annotation.NonNull Boolean isMuted) { + this.isMuted = isMuted; + } + + public PlayerStateInfo volumeLevel(@org.eclipse.jdt.annotation.NonNull Integer volumeLevel) { + this.volumeLevel = volumeLevel; + return this; + } + + /** + * Gets or sets the volume level. + * + * @return volumeLevel + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VOLUME_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getVolumeLevel() { + return volumeLevel; + } + + @JsonProperty(JSON_PROPERTY_VOLUME_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVolumeLevel(@org.eclipse.jdt.annotation.NonNull Integer volumeLevel) { + this.volumeLevel = volumeLevel; + } + + public PlayerStateInfo audioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + return this; + } + + /** + * Gets or sets the index of the now playing audio stream. + * + * @return audioStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAudioStreamIndex() { + return audioStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + } + + public PlayerStateInfo subtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + /** + * Gets or sets the index of the now playing subtitle stream. + * + * @return subtitleStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSubtitleStreamIndex() { + return subtitleStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + } + + public PlayerStateInfo mediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + return this; + } + + /** + * Gets or sets the now playing media version identifier. + * + * @return mediaSourceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMediaSourceId() { + return mediaSourceId; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + } + + public PlayerStateInfo playMethod(@org.eclipse.jdt.annotation.NonNull PlayMethod playMethod) { + this.playMethod = playMethod; + return this; + } + + /** + * Gets or sets the play method. + * + * @return playMethod + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlayMethod getPlayMethod() { + return playMethod; + } + + @JsonProperty(JSON_PROPERTY_PLAY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayMethod(@org.eclipse.jdt.annotation.NonNull PlayMethod playMethod) { + this.playMethod = playMethod; + } + + public PlayerStateInfo repeatMode(@org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode) { + this.repeatMode = repeatMode; + return this; + } + + /** + * Gets or sets the repeat mode. + * + * @return repeatMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REPEAT_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RepeatMode getRepeatMode() { + return repeatMode; + } + + @JsonProperty(JSON_PROPERTY_REPEAT_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepeatMode(@org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode) { + this.repeatMode = repeatMode; + } + + public PlayerStateInfo playbackOrder(@org.eclipse.jdt.annotation.NonNull PlaybackOrder playbackOrder) { + this.playbackOrder = playbackOrder; + return this; + } + + /** + * Gets or sets the playback order. + * + * @return playbackOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYBACK_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlaybackOrder getPlaybackOrder() { + return playbackOrder; + } + + @JsonProperty(JSON_PROPERTY_PLAYBACK_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaybackOrder(@org.eclipse.jdt.annotation.NonNull PlaybackOrder playbackOrder) { + this.playbackOrder = playbackOrder; + } + + public PlayerStateInfo liveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + return this; + } + + /** + * Gets or sets the now playing live stream identifier. + * + * @return liveStreamId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLiveStreamId() { + return liveStreamId; + } + + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLiveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + } + + /** + * Return true if this PlayerStateInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlayerStateInfo playerStateInfo = (PlayerStateInfo) o; + return Objects.equals(this.positionTicks, playerStateInfo.positionTicks) + && Objects.equals(this.canSeek, playerStateInfo.canSeek) + && Objects.equals(this.isPaused, playerStateInfo.isPaused) + && Objects.equals(this.isMuted, playerStateInfo.isMuted) + && Objects.equals(this.volumeLevel, playerStateInfo.volumeLevel) + && Objects.equals(this.audioStreamIndex, playerStateInfo.audioStreamIndex) + && Objects.equals(this.subtitleStreamIndex, playerStateInfo.subtitleStreamIndex) + && Objects.equals(this.mediaSourceId, playerStateInfo.mediaSourceId) + && Objects.equals(this.playMethod, playerStateInfo.playMethod) + && Objects.equals(this.repeatMode, playerStateInfo.repeatMode) + && Objects.equals(this.playbackOrder, playerStateInfo.playbackOrder) + && Objects.equals(this.liveStreamId, playerStateInfo.liveStreamId); + } + + @Override + public int hashCode() { + return Objects.hash(positionTicks, canSeek, isPaused, isMuted, volumeLevel, audioStreamIndex, + subtitleStreamIndex, mediaSourceId, playMethod, repeatMode, playbackOrder, liveStreamId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlayerStateInfo {\n"); + sb.append(" positionTicks: ").append(toIndentedString(positionTicks)).append("\n"); + sb.append(" canSeek: ").append(toIndentedString(canSeek)).append("\n"); + sb.append(" isPaused: ").append(toIndentedString(isPaused)).append("\n"); + sb.append(" isMuted: ").append(toIndentedString(isMuted)).append("\n"); + sb.append(" volumeLevel: ").append(toIndentedString(volumeLevel)).append("\n"); + sb.append(" audioStreamIndex: ").append(toIndentedString(audioStreamIndex)).append("\n"); + sb.append(" subtitleStreamIndex: ").append(toIndentedString(subtitleStreamIndex)).append("\n"); + sb.append(" mediaSourceId: ").append(toIndentedString(mediaSourceId)).append("\n"); + sb.append(" playMethod: ").append(toIndentedString(playMethod)).append("\n"); + sb.append(" repeatMode: ").append(toIndentedString(repeatMode)).append("\n"); + sb.append(" playbackOrder: ").append(toIndentedString(playbackOrder)).append("\n"); + sb.append(" liveStreamId: ").append(toIndentedString(liveStreamId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PositionTicks` to the URL query string + if (getPositionTicks() != null) { + joiner.add(String.format("%sPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPositionTicks())))); + } + + // add `CanSeek` to the URL query string + if (getCanSeek() != null) { + joiner.add(String.format("%sCanSeek%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanSeek())))); + } + + // add `IsPaused` to the URL query string + if (getIsPaused() != null) { + joiner.add(String.format("%sIsPaused%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPaused())))); + } + + // add `IsMuted` to the URL query string + if (getIsMuted() != null) { + joiner.add(String.format("%sIsMuted%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsMuted())))); + } + + // add `VolumeLevel` to the URL query string + if (getVolumeLevel() != null) { + joiner.add(String.format("%sVolumeLevel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVolumeLevel())))); + } + + // add `AudioStreamIndex` to the URL query string + if (getAudioStreamIndex() != null) { + joiner.add(String.format("%sAudioStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioStreamIndex())))); + } + + // add `SubtitleStreamIndex` to the URL query string + if (getSubtitleStreamIndex() != null) { + joiner.add(String.format("%sSubtitleStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleStreamIndex())))); + } + + // add `MediaSourceId` to the URL query string + if (getMediaSourceId() != null) { + joiner.add(String.format("%sMediaSourceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaSourceId())))); + } + + // add `PlayMethod` to the URL query string + if (getPlayMethod() != null) { + joiner.add(String.format("%sPlayMethod%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayMethod())))); + } + + // add `RepeatMode` to the URL query string + if (getRepeatMode() != null) { + joiner.add(String.format("%sRepeatMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRepeatMode())))); + } + + // add `PlaybackOrder` to the URL query string + if (getPlaybackOrder() != null) { + joiner.add(String.format("%sPlaybackOrder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaybackOrder())))); + } + + // add `LiveStreamId` to the URL query string + if (getLiveStreamId() != null) { + joiner.add(String.format("%sLiveStreamId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLiveStreamId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlayerStateInfo instance; + + public Builder() { + this(new PlayerStateInfo()); + } + + protected Builder(PlayerStateInfo instance) { + this.instance = instance; + } + + public PlayerStateInfo.Builder positionTicks(Long positionTicks) { + this.instance.positionTicks = positionTicks; + return this; + } + + public PlayerStateInfo.Builder canSeek(Boolean canSeek) { + this.instance.canSeek = canSeek; + return this; + } + + public PlayerStateInfo.Builder isPaused(Boolean isPaused) { + this.instance.isPaused = isPaused; + return this; + } + + public PlayerStateInfo.Builder isMuted(Boolean isMuted) { + this.instance.isMuted = isMuted; + return this; + } + + public PlayerStateInfo.Builder volumeLevel(Integer volumeLevel) { + this.instance.volumeLevel = volumeLevel; + return this; + } + + public PlayerStateInfo.Builder audioStreamIndex(Integer audioStreamIndex) { + this.instance.audioStreamIndex = audioStreamIndex; + return this; + } + + public PlayerStateInfo.Builder subtitleStreamIndex(Integer subtitleStreamIndex) { + this.instance.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + public PlayerStateInfo.Builder mediaSourceId(String mediaSourceId) { + this.instance.mediaSourceId = mediaSourceId; + return this; + } + + public PlayerStateInfo.Builder playMethod(PlayMethod playMethod) { + this.instance.playMethod = playMethod; + return this; + } + + public PlayerStateInfo.Builder repeatMode(RepeatMode repeatMode) { + this.instance.repeatMode = repeatMode; + return this; + } + + public PlayerStateInfo.Builder playbackOrder(PlaybackOrder playbackOrder) { + this.instance.playbackOrder = playbackOrder; + return this; + } + + public PlayerStateInfo.Builder liveStreamId(String liveStreamId) { + this.instance.liveStreamId = liveStreamId; + return this; + } + + /** + * returns a built PlayerStateInfo instance. + * + * The builder is not reusable. + */ + public PlayerStateInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlayerStateInfo.Builder builder() { + return new PlayerStateInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlayerStateInfo.Builder toBuilder() { + return new PlayerStateInfo.Builder().positionTicks(getPositionTicks()).canSeek(getCanSeek()) + .isPaused(getIsPaused()).isMuted(getIsMuted()).volumeLevel(getVolumeLevel()) + .audioStreamIndex(getAudioStreamIndex()).subtitleStreamIndex(getSubtitleStreamIndex()) + .mediaSourceId(getMediaSourceId()).playMethod(getPlayMethod()).repeatMode(getRepeatMode()) + .playbackOrder(getPlaybackOrder()).liveStreamId(getLiveStreamId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaylistCreationResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaylistCreationResult.java new file mode 100644 index 0000000000000..dcd6d80029785 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaylistCreationResult.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * PlaylistCreationResult + */ +@JsonPropertyOrder({ PlaylistCreationResult.JSON_PROPERTY_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaylistCreationResult { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public PlaylistCreationResult() { + } + + public PlaylistCreationResult id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + /** + * Return true if this PlaylistCreationResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaylistCreationResult playlistCreationResult = (PlaylistCreationResult) o; + return Objects.equals(this.id, playlistCreationResult.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaylistCreationResult {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaylistCreationResult instance; + + public Builder() { + this(new PlaylistCreationResult()); + } + + protected Builder(PlaylistCreationResult instance) { + this.instance = instance; + } + + public PlaylistCreationResult.Builder id(String id) { + this.instance.id = id; + return this; + } + + /** + * returns a built PlaylistCreationResult instance. + * + * The builder is not reusable. + */ + public PlaylistCreationResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaylistCreationResult.Builder builder() { + return new PlaylistCreationResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaylistCreationResult.Builder toBuilder() { + return new PlaylistCreationResult.Builder().id(getId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaylistDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaylistDto.java new file mode 100644 index 0000000000000..14f9f854e7c04 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaylistDto.java @@ -0,0 +1,300 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * DTO for playlists. + */ +@JsonPropertyOrder({ PlaylistDto.JSON_PROPERTY_OPEN_ACCESS, PlaylistDto.JSON_PROPERTY_SHARES, + PlaylistDto.JSON_PROPERTY_ITEM_IDS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaylistDto { + public static final String JSON_PROPERTY_OPEN_ACCESS = "OpenAccess"; + @org.eclipse.jdt.annotation.NonNull + private Boolean openAccess; + + public static final String JSON_PROPERTY_SHARES = "Shares"; + @org.eclipse.jdt.annotation.NonNull + private List shares = new ArrayList<>(); + + public static final String JSON_PROPERTY_ITEM_IDS = "ItemIds"; + @org.eclipse.jdt.annotation.NonNull + private List itemIds = new ArrayList<>(); + + public PlaylistDto() { + } + + public PlaylistDto openAccess(@org.eclipse.jdt.annotation.NonNull Boolean openAccess) { + this.openAccess = openAccess; + return this; + } + + /** + * Gets or sets a value indicating whether the playlist is publicly readable. + * + * @return openAccess + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OPEN_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getOpenAccess() { + return openAccess; + } + + @JsonProperty(JSON_PROPERTY_OPEN_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpenAccess(@org.eclipse.jdt.annotation.NonNull Boolean openAccess) { + this.openAccess = openAccess; + } + + public PlaylistDto shares(@org.eclipse.jdt.annotation.NonNull List shares) { + this.shares = shares; + return this; + } + + public PlaylistDto addSharesItem(PlaylistUserPermissions sharesItem) { + if (this.shares == null) { + this.shares = new ArrayList<>(); + } + this.shares.add(sharesItem); + return this; + } + + /** + * Gets or sets the share permissions. + * + * @return shares + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SHARES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getShares() { + return shares; + } + + @JsonProperty(JSON_PROPERTY_SHARES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShares(@org.eclipse.jdt.annotation.NonNull List shares) { + this.shares = shares; + } + + public PlaylistDto itemIds(@org.eclipse.jdt.annotation.NonNull List itemIds) { + this.itemIds = itemIds; + return this; + } + + public PlaylistDto addItemIdsItem(UUID itemIdsItem) { + if (this.itemIds == null) { + this.itemIds = new ArrayList<>(); + } + this.itemIds.add(itemIdsItem); + return this; + } + + /** + * Gets or sets the item ids. + * + * @return itemIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItemIds() { + return itemIds; + } + + @JsonProperty(JSON_PROPERTY_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemIds(@org.eclipse.jdt.annotation.NonNull List itemIds) { + this.itemIds = itemIds; + } + + /** + * Return true if this PlaylistDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaylistDto playlistDto = (PlaylistDto) o; + return Objects.equals(this.openAccess, playlistDto.openAccess) + && Objects.equals(this.shares, playlistDto.shares) && Objects.equals(this.itemIds, playlistDto.itemIds); + } + + @Override + public int hashCode() { + return Objects.hash(openAccess, shares, itemIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaylistDto {\n"); + sb.append(" openAccess: ").append(toIndentedString(openAccess)).append("\n"); + sb.append(" shares: ").append(toIndentedString(shares)).append("\n"); + sb.append(" itemIds: ").append(toIndentedString(itemIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `OpenAccess` to the URL query string + if (getOpenAccess() != null) { + joiner.add(String.format("%sOpenAccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOpenAccess())))); + } + + // add `Shares` to the URL query string + if (getShares() != null) { + for (int i = 0; i < getShares().size(); i++) { + if (getShares().get(i) != null) { + joiner.add(getShares().get(i).toUrlQueryString(String.format("%sShares%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ItemIds` to the URL query string + if (getItemIds() != null) { + for (int i = 0; i < getItemIds().size(); i++) { + if (getItemIds().get(i) != null) { + joiner.add(String.format("%sItemIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getItemIds().get(i))))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaylistDto instance; + + public Builder() { + this(new PlaylistDto()); + } + + protected Builder(PlaylistDto instance) { + this.instance = instance; + } + + public PlaylistDto.Builder openAccess(Boolean openAccess) { + this.instance.openAccess = openAccess; + return this; + } + + public PlaylistDto.Builder shares(List shares) { + this.instance.shares = shares; + return this; + } + + public PlaylistDto.Builder itemIds(List itemIds) { + this.instance.itemIds = itemIds; + return this; + } + + /** + * returns a built PlaylistDto instance. + * + * The builder is not reusable. + */ + public PlaylistDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaylistDto.Builder builder() { + return new PlaylistDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaylistDto.Builder toBuilder() { + return new PlaylistDto.Builder().openAccess(getOpenAccess()).shares(getShares()).itemIds(getItemIds()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaylistUserPermissions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaylistUserPermissions.java new file mode 100644 index 0000000000000..e50b882ccdf11 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaylistUserPermissions.java @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class to hold data on user permissions for playlists. + */ +@JsonPropertyOrder({ PlaylistUserPermissions.JSON_PROPERTY_USER_ID, PlaylistUserPermissions.JSON_PROPERTY_CAN_EDIT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaylistUserPermissions { + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_CAN_EDIT = "CanEdit"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canEdit; + + public PlaylistUserPermissions() { + } + + public PlaylistUserPermissions userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the user id. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public PlaylistUserPermissions canEdit(@org.eclipse.jdt.annotation.NonNull Boolean canEdit) { + this.canEdit = canEdit; + return this; + } + + /** + * Gets or sets a value indicating whether the user has edit permissions. + * + * @return canEdit + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_EDIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanEdit() { + return canEdit; + } + + @JsonProperty(JSON_PROPERTY_CAN_EDIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanEdit(@org.eclipse.jdt.annotation.NonNull Boolean canEdit) { + this.canEdit = canEdit; + } + + /** + * Return true if this PlaylistUserPermissions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaylistUserPermissions playlistUserPermissions = (PlaylistUserPermissions) o; + return Objects.equals(this.userId, playlistUserPermissions.userId) + && Objects.equals(this.canEdit, playlistUserPermissions.canEdit); + } + + @Override + public int hashCode() { + return Objects.hash(userId, canEdit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaylistUserPermissions {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" canEdit: ").append(toIndentedString(canEdit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `CanEdit` to the URL query string + if (getCanEdit() != null) { + joiner.add(String.format("%sCanEdit%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanEdit())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaylistUserPermissions instance; + + public Builder() { + this(new PlaylistUserPermissions()); + } + + protected Builder(PlaylistUserPermissions instance) { + this.instance = instance; + } + + public PlaylistUserPermissions.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public PlaylistUserPermissions.Builder canEdit(Boolean canEdit) { + this.instance.canEdit = canEdit; + return this; + } + + /** + * returns a built PlaylistUserPermissions instance. + * + * The builder is not reusable. + */ + public PlaylistUserPermissions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaylistUserPermissions.Builder builder() { + return new PlaylistUserPermissions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaylistUserPermissions.Builder toBuilder() { + return new PlaylistUserPermissions.Builder().userId(getUserId()).canEdit(getCanEdit()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaystateCommand.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaystateCommand.java new file mode 100644 index 0000000000000..ea83dd5821140 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaystateCommand.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum PlaystateCommand. + */ +public enum PlaystateCommand { + + STOP("Stop"), + + PAUSE("Pause"), + + UNPAUSE("Unpause"), + + NEXT_TRACK("NextTrack"), + + PREVIOUS_TRACK("PreviousTrack"), + + SEEK("Seek"), + + REWIND("Rewind"), + + FAST_FORWARD("FastForward"), + + PLAY_PAUSE("PlayPause"); + + private String value; + + PlaystateCommand(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PlaystateCommand fromValue(String value) { + for (PlaystateCommand b : PlaystateCommand.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaystateMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaystateMessage.java new file mode 100644 index 0000000000000..4b76c5b4e108c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaystateMessage.java @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Playstate message. + */ +@JsonPropertyOrder({ PlaystateMessage.JSON_PROPERTY_DATA, PlaystateMessage.JSON_PROPERTY_MESSAGE_ID, + PlaystateMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaystateMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private PlaystateRequest data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.PLAYSTATE; + + public PlaystateMessage() { + } + + @JsonCreator + public PlaystateMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public PlaystateMessage data(@org.eclipse.jdt.annotation.NonNull PlaystateRequest data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlaystateRequest getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull PlaystateRequest data) { + this.data = data; + } + + public PlaystateMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this PlaystateMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaystateMessage playstateMessage = (PlaystateMessage) o; + return Objects.equals(this.data, playstateMessage.data) + && Objects.equals(this.messageId, playstateMessage.messageId) + && Objects.equals(this.messageType, playstateMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaystateMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaystateMessage instance; + + public Builder() { + this(new PlaystateMessage()); + } + + protected Builder(PlaystateMessage instance) { + this.instance = instance; + } + + public PlaystateMessage.Builder data(PlaystateRequest data) { + this.instance.data = data; + return this; + } + + public PlaystateMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public PlaystateMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built PlaystateMessage instance. + * + * The builder is not reusable. + */ + public PlaystateMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaystateMessage.Builder builder() { + return new PlaystateMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaystateMessage.Builder toBuilder() { + return new PlaystateMessage.Builder().data(getData()).messageId(getMessageId()).messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaystateRequest.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaystateRequest.java new file mode 100644 index 0000000000000..9b00493339b75 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PlaystateRequest.java @@ -0,0 +1,274 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * PlaystateRequest + */ +@JsonPropertyOrder({ PlaystateRequest.JSON_PROPERTY_COMMAND, PlaystateRequest.JSON_PROPERTY_SEEK_POSITION_TICKS, + PlaystateRequest.JSON_PROPERTY_CONTROLLING_USER_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaystateRequest { + public static final String JSON_PROPERTY_COMMAND = "Command"; + @org.eclipse.jdt.annotation.NonNull + private PlaystateCommand command; + + public static final String JSON_PROPERTY_SEEK_POSITION_TICKS = "SeekPositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long seekPositionTicks; + + public static final String JSON_PROPERTY_CONTROLLING_USER_ID = "ControllingUserId"; + @org.eclipse.jdt.annotation.NonNull + private String controllingUserId; + + public PlaystateRequest() { + } + + public PlaystateRequest command(@org.eclipse.jdt.annotation.NonNull PlaystateCommand command) { + this.command = command; + return this; + } + + /** + * Enum PlaystateCommand. + * + * @return command + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlaystateCommand getCommand() { + return command; + } + + @JsonProperty(JSON_PROPERTY_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCommand(@org.eclipse.jdt.annotation.NonNull PlaystateCommand command) { + this.command = command; + } + + public PlaystateRequest seekPositionTicks(@org.eclipse.jdt.annotation.NonNull Long seekPositionTicks) { + this.seekPositionTicks = seekPositionTicks; + return this; + } + + /** + * Get seekPositionTicks + * + * @return seekPositionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEEK_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSeekPositionTicks() { + return seekPositionTicks; + } + + @JsonProperty(JSON_PROPERTY_SEEK_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeekPositionTicks(@org.eclipse.jdt.annotation.NonNull Long seekPositionTicks) { + this.seekPositionTicks = seekPositionTicks; + } + + public PlaystateRequest controllingUserId(@org.eclipse.jdt.annotation.NonNull String controllingUserId) { + this.controllingUserId = controllingUserId; + return this; + } + + /** + * Gets or sets the controlling user identifier. + * + * @return controllingUserId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTROLLING_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getControllingUserId() { + return controllingUserId; + } + + @JsonProperty(JSON_PROPERTY_CONTROLLING_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setControllingUserId(@org.eclipse.jdt.annotation.NonNull String controllingUserId) { + this.controllingUserId = controllingUserId; + } + + /** + * Return true if this PlaystateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaystateRequest playstateRequest = (PlaystateRequest) o; + return Objects.equals(this.command, playstateRequest.command) + && Objects.equals(this.seekPositionTicks, playstateRequest.seekPositionTicks) + && Objects.equals(this.controllingUserId, playstateRequest.controllingUserId); + } + + @Override + public int hashCode() { + return Objects.hash(command, seekPositionTicks, controllingUserId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaystateRequest {\n"); + sb.append(" command: ").append(toIndentedString(command)).append("\n"); + sb.append(" seekPositionTicks: ").append(toIndentedString(seekPositionTicks)).append("\n"); + sb.append(" controllingUserId: ").append(toIndentedString(controllingUserId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Command` to the URL query string + if (getCommand() != null) { + joiner.add(String.format("%sCommand%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCommand())))); + } + + // add `SeekPositionTicks` to the URL query string + if (getSeekPositionTicks() != null) { + joiner.add(String.format("%sSeekPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeekPositionTicks())))); + } + + // add `ControllingUserId` to the URL query string + if (getControllingUserId() != null) { + joiner.add(String.format("%sControllingUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getControllingUserId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaystateRequest instance; + + public Builder() { + this(new PlaystateRequest()); + } + + protected Builder(PlaystateRequest instance) { + this.instance = instance; + } + + public PlaystateRequest.Builder command(PlaystateCommand command) { + this.instance.command = command; + return this; + } + + public PlaystateRequest.Builder seekPositionTicks(Long seekPositionTicks) { + this.instance.seekPositionTicks = seekPositionTicks; + return this; + } + + public PlaystateRequest.Builder controllingUserId(String controllingUserId) { + this.instance.controllingUserId = controllingUserId; + return this; + } + + /** + * returns a built PlaystateRequest instance. + * + * The builder is not reusable. + */ + public PlaystateRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaystateRequest.Builder builder() { + return new PlaystateRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaystateRequest.Builder toBuilder() { + return new PlaystateRequest.Builder().command(getCommand()).seekPositionTicks(getSeekPositionTicks()) + .controllingUserId(getControllingUserId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInfo.java new file mode 100644 index 0000000000000..edfe99b4da24b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInfo.java @@ -0,0 +1,475 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * This is a serializable stub class that is used by the api to provide information about installed plugins. + */ +@JsonPropertyOrder({ PluginInfo.JSON_PROPERTY_NAME, PluginInfo.JSON_PROPERTY_VERSION, + PluginInfo.JSON_PROPERTY_CONFIGURATION_FILE_NAME, PluginInfo.JSON_PROPERTY_DESCRIPTION, + PluginInfo.JSON_PROPERTY_ID, PluginInfo.JSON_PROPERTY_CAN_UNINSTALL, PluginInfo.JSON_PROPERTY_HAS_IMAGE, + PluginInfo.JSON_PROPERTY_STATUS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PluginInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_VERSION = "Version"; + @org.eclipse.jdt.annotation.NonNull + private String version; + + public static final String JSON_PROPERTY_CONFIGURATION_FILE_NAME = "ConfigurationFileName"; + @org.eclipse.jdt.annotation.NonNull + private String configurationFileName; + + public static final String JSON_PROPERTY_DESCRIPTION = "Description"; + @org.eclipse.jdt.annotation.NonNull + private String description; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_CAN_UNINSTALL = "CanUninstall"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canUninstall; + + public static final String JSON_PROPERTY_HAS_IMAGE = "HasImage"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasImage; + + public static final String JSON_PROPERTY_STATUS = "Status"; + @org.eclipse.jdt.annotation.NonNull + private PluginStatus status; + + public PluginInfo() { + } + + public PluginInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public PluginInfo version(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + return this; + } + + /** + * Gets or sets the version. + * + * @return version + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + } + + public PluginInfo configurationFileName(@org.eclipse.jdt.annotation.NonNull String configurationFileName) { + this.configurationFileName = configurationFileName; + return this; + } + + /** + * Gets or sets the name of the configuration file. + * + * @return configurationFileName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONFIGURATION_FILE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getConfigurationFileName() { + return configurationFileName; + } + + @JsonProperty(JSON_PROPERTY_CONFIGURATION_FILE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfigurationFileName(@org.eclipse.jdt.annotation.NonNull String configurationFileName) { + this.configurationFileName = configurationFileName; + } + + public PluginInfo description(@org.eclipse.jdt.annotation.NonNull String description) { + this.description = description; + return this; + } + + /** + * Gets or sets the description. + * + * @return description + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@org.eclipse.jdt.annotation.NonNull String description) { + this.description = description; + } + + public PluginInfo id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Gets or sets the unique id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public PluginInfo canUninstall(@org.eclipse.jdt.annotation.NonNull Boolean canUninstall) { + this.canUninstall = canUninstall; + return this; + } + + /** + * Gets or sets a value indicating whether the plugin can be uninstalled. + * + * @return canUninstall + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_UNINSTALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanUninstall() { + return canUninstall; + } + + @JsonProperty(JSON_PROPERTY_CAN_UNINSTALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanUninstall(@org.eclipse.jdt.annotation.NonNull Boolean canUninstall) { + this.canUninstall = canUninstall; + } + + public PluginInfo hasImage(@org.eclipse.jdt.annotation.NonNull Boolean hasImage) { + this.hasImage = hasImage; + return this; + } + + /** + * Gets or sets a value indicating whether this plugin has a valid image. + * + * @return hasImage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_IMAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasImage() { + return hasImage; + } + + @JsonProperty(JSON_PROPERTY_HAS_IMAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasImage(@org.eclipse.jdt.annotation.NonNull Boolean hasImage) { + this.hasImage = hasImage; + } + + public PluginInfo status(@org.eclipse.jdt.annotation.NonNull PluginStatus status) { + this.status = status; + return this; + } + + /** + * Gets or sets a value indicating the status of the plugin. + * + * @return status + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PluginStatus getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@org.eclipse.jdt.annotation.NonNull PluginStatus status) { + this.status = status; + } + + /** + * Return true if this PluginInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PluginInfo pluginInfo = (PluginInfo) o; + return Objects.equals(this.name, pluginInfo.name) && Objects.equals(this.version, pluginInfo.version) + && Objects.equals(this.configurationFileName, pluginInfo.configurationFileName) + && Objects.equals(this.description, pluginInfo.description) && Objects.equals(this.id, pluginInfo.id) + && Objects.equals(this.canUninstall, pluginInfo.canUninstall) + && Objects.equals(this.hasImage, pluginInfo.hasImage) && Objects.equals(this.status, pluginInfo.status); + } + + @Override + public int hashCode() { + return Objects.hash(name, version, configurationFileName, description, id, canUninstall, hasImage, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PluginInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" configurationFileName: ").append(toIndentedString(configurationFileName)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" canUninstall: ").append(toIndentedString(canUninstall)).append("\n"); + sb.append(" hasImage: ").append(toIndentedString(hasImage)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format("%sVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `ConfigurationFileName` to the URL query string + if (getConfigurationFileName() != null) { + joiner.add(String.format("%sConfigurationFileName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getConfigurationFileName())))); + } + + // add `Description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sDescription%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `CanUninstall` to the URL query string + if (getCanUninstall() != null) { + joiner.add(String.format("%sCanUninstall%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanUninstall())))); + } + + // add `HasImage` to the URL query string + if (getHasImage() != null) { + joiner.add(String.format("%sHasImage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasImage())))); + } + + // add `Status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sStatus%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PluginInfo instance; + + public Builder() { + this(new PluginInfo()); + } + + protected Builder(PluginInfo instance) { + this.instance = instance; + } + + public PluginInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public PluginInfo.Builder version(String version) { + this.instance.version = version; + return this; + } + + public PluginInfo.Builder configurationFileName(String configurationFileName) { + this.instance.configurationFileName = configurationFileName; + return this; + } + + public PluginInfo.Builder description(String description) { + this.instance.description = description; + return this; + } + + public PluginInfo.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public PluginInfo.Builder canUninstall(Boolean canUninstall) { + this.instance.canUninstall = canUninstall; + return this; + } + + public PluginInfo.Builder hasImage(Boolean hasImage) { + this.instance.hasImage = hasImage; + return this; + } + + public PluginInfo.Builder status(PluginStatus status) { + this.instance.status = status; + return this; + } + + /** + * returns a built PluginInfo instance. + * + * The builder is not reusable. + */ + public PluginInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PluginInfo.Builder builder() { + return new PluginInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PluginInfo.Builder toBuilder() { + return new PluginInfo.Builder().name(getName()).version(getVersion()) + .configurationFileName(getConfigurationFileName()).description(getDescription()).id(getId()) + .canUninstall(getCanUninstall()).hasImage(getHasImage()).status(getStatus()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInstallationCancelledMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInstallationCancelledMessage.java new file mode 100644 index 0000000000000..03fe7ec052c44 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInstallationCancelledMessage.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Plugin installation cancelled message. + */ +@JsonPropertyOrder({ PluginInstallationCancelledMessage.JSON_PROPERTY_DATA, + PluginInstallationCancelledMessage.JSON_PROPERTY_MESSAGE_ID, + PluginInstallationCancelledMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PluginInstallationCancelledMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private InstallationInfo data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.PACKAGE_INSTALLATION_CANCELLED; + + public PluginInstallationCancelledMessage() { + } + + @JsonCreator + public PluginInstallationCancelledMessage( + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public PluginInstallationCancelledMessage data(@org.eclipse.jdt.annotation.NonNull InstallationInfo data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InstallationInfo getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull InstallationInfo data) { + this.data = data; + } + + public PluginInstallationCancelledMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this PluginInstallationCancelledMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PluginInstallationCancelledMessage pluginInstallationCancelledMessage = (PluginInstallationCancelledMessage) o; + return Objects.equals(this.data, pluginInstallationCancelledMessage.data) + && Objects.equals(this.messageId, pluginInstallationCancelledMessage.messageId) + && Objects.equals(this.messageType, pluginInstallationCancelledMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PluginInstallationCancelledMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PluginInstallationCancelledMessage instance; + + public Builder() { + this(new PluginInstallationCancelledMessage()); + } + + protected Builder(PluginInstallationCancelledMessage instance) { + this.instance = instance; + } + + public PluginInstallationCancelledMessage.Builder data(InstallationInfo data) { + this.instance.data = data; + return this; + } + + public PluginInstallationCancelledMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public PluginInstallationCancelledMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built PluginInstallationCancelledMessage instance. + * + * The builder is not reusable. + */ + public PluginInstallationCancelledMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PluginInstallationCancelledMessage.Builder builder() { + return new PluginInstallationCancelledMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PluginInstallationCancelledMessage.Builder toBuilder() { + return new PluginInstallationCancelledMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInstallationCompletedMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInstallationCompletedMessage.java new file mode 100644 index 0000000000000..33ca75bdaa4be --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInstallationCompletedMessage.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Plugin installation completed message. + */ +@JsonPropertyOrder({ PluginInstallationCompletedMessage.JSON_PROPERTY_DATA, + PluginInstallationCompletedMessage.JSON_PROPERTY_MESSAGE_ID, + PluginInstallationCompletedMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PluginInstallationCompletedMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private InstallationInfo data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.PACKAGE_INSTALLATION_COMPLETED; + + public PluginInstallationCompletedMessage() { + } + + @JsonCreator + public PluginInstallationCompletedMessage( + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public PluginInstallationCompletedMessage data(@org.eclipse.jdt.annotation.NonNull InstallationInfo data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InstallationInfo getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull InstallationInfo data) { + this.data = data; + } + + public PluginInstallationCompletedMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this PluginInstallationCompletedMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PluginInstallationCompletedMessage pluginInstallationCompletedMessage = (PluginInstallationCompletedMessage) o; + return Objects.equals(this.data, pluginInstallationCompletedMessage.data) + && Objects.equals(this.messageId, pluginInstallationCompletedMessage.messageId) + && Objects.equals(this.messageType, pluginInstallationCompletedMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PluginInstallationCompletedMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PluginInstallationCompletedMessage instance; + + public Builder() { + this(new PluginInstallationCompletedMessage()); + } + + protected Builder(PluginInstallationCompletedMessage instance) { + this.instance = instance; + } + + public PluginInstallationCompletedMessage.Builder data(InstallationInfo data) { + this.instance.data = data; + return this; + } + + public PluginInstallationCompletedMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public PluginInstallationCompletedMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built PluginInstallationCompletedMessage instance. + * + * The builder is not reusable. + */ + public PluginInstallationCompletedMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PluginInstallationCompletedMessage.Builder builder() { + return new PluginInstallationCompletedMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PluginInstallationCompletedMessage.Builder toBuilder() { + return new PluginInstallationCompletedMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInstallationFailedMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInstallationFailedMessage.java new file mode 100644 index 0000000000000..337b4c1496e50 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInstallationFailedMessage.java @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Plugin installation failed message. + */ +@JsonPropertyOrder({ PluginInstallationFailedMessage.JSON_PROPERTY_DATA, + PluginInstallationFailedMessage.JSON_PROPERTY_MESSAGE_ID, + PluginInstallationFailedMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PluginInstallationFailedMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private InstallationInfo data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.PACKAGE_INSTALLATION_FAILED; + + public PluginInstallationFailedMessage() { + } + + @JsonCreator + public PluginInstallationFailedMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public PluginInstallationFailedMessage data(@org.eclipse.jdt.annotation.NonNull InstallationInfo data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InstallationInfo getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull InstallationInfo data) { + this.data = data; + } + + public PluginInstallationFailedMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this PluginInstallationFailedMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PluginInstallationFailedMessage pluginInstallationFailedMessage = (PluginInstallationFailedMessage) o; + return Objects.equals(this.data, pluginInstallationFailedMessage.data) + && Objects.equals(this.messageId, pluginInstallationFailedMessage.messageId) + && Objects.equals(this.messageType, pluginInstallationFailedMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PluginInstallationFailedMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PluginInstallationFailedMessage instance; + + public Builder() { + this(new PluginInstallationFailedMessage()); + } + + protected Builder(PluginInstallationFailedMessage instance) { + this.instance = instance; + } + + public PluginInstallationFailedMessage.Builder data(InstallationInfo data) { + this.instance.data = data; + return this; + } + + public PluginInstallationFailedMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public PluginInstallationFailedMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built PluginInstallationFailedMessage instance. + * + * The builder is not reusable. + */ + public PluginInstallationFailedMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PluginInstallationFailedMessage.Builder builder() { + return new PluginInstallationFailedMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PluginInstallationFailedMessage.Builder toBuilder() { + return new PluginInstallationFailedMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInstallingMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInstallingMessage.java new file mode 100644 index 0000000000000..12178ffb8c01e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginInstallingMessage.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Package installing message. + */ +@JsonPropertyOrder({ PluginInstallingMessage.JSON_PROPERTY_DATA, PluginInstallingMessage.JSON_PROPERTY_MESSAGE_ID, + PluginInstallingMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PluginInstallingMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private InstallationInfo data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.PACKAGE_INSTALLING; + + public PluginInstallingMessage() { + } + + @JsonCreator + public PluginInstallingMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public PluginInstallingMessage data(@org.eclipse.jdt.annotation.NonNull InstallationInfo data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InstallationInfo getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull InstallationInfo data) { + this.data = data; + } + + public PluginInstallingMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this PluginInstallingMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PluginInstallingMessage pluginInstallingMessage = (PluginInstallingMessage) o; + return Objects.equals(this.data, pluginInstallingMessage.data) + && Objects.equals(this.messageId, pluginInstallingMessage.messageId) + && Objects.equals(this.messageType, pluginInstallingMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PluginInstallingMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PluginInstallingMessage instance; + + public Builder() { + this(new PluginInstallingMessage()); + } + + protected Builder(PluginInstallingMessage instance) { + this.instance = instance; + } + + public PluginInstallingMessage.Builder data(InstallationInfo data) { + this.instance.data = data; + return this; + } + + public PluginInstallingMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public PluginInstallingMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built PluginInstallingMessage instance. + * + * The builder is not reusable. + */ + public PluginInstallingMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PluginInstallingMessage.Builder builder() { + return new PluginInstallingMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PluginInstallingMessage.Builder toBuilder() { + return new PluginInstallingMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginStatus.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginStatus.java new file mode 100644 index 0000000000000..079d506f017b7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginStatus.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Plugin load status. + */ +public enum PluginStatus { + + ACTIVE("Active"), + + RESTART("Restart"), + + DELETED("Deleted"), + + SUPERCEDED("Superceded"), + + MALFUNCTIONED("Malfunctioned"), + + NOT_SUPPORTED("NotSupported"), + + DISABLED("Disabled"); + + private String value; + + PluginStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PluginStatus fromValue(String value) { + for (PluginStatus b : PluginStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginUninstalledMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginUninstalledMessage.java new file mode 100644 index 0000000000000..8fe78455e67fa --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PluginUninstalledMessage.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Plugin uninstalled message. + */ +@JsonPropertyOrder({ PluginUninstalledMessage.JSON_PROPERTY_DATA, PluginUninstalledMessage.JSON_PROPERTY_MESSAGE_ID, + PluginUninstalledMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PluginUninstalledMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private PluginInfo data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.PACKAGE_UNINSTALLED; + + public PluginUninstalledMessage() { + } + + @JsonCreator + public PluginUninstalledMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public PluginUninstalledMessage data(@org.eclipse.jdt.annotation.NonNull PluginInfo data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PluginInfo getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull PluginInfo data) { + this.data = data; + } + + public PluginUninstalledMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this PluginUninstalledMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PluginUninstalledMessage pluginUninstalledMessage = (PluginUninstalledMessage) o; + return Objects.equals(this.data, pluginUninstalledMessage.data) + && Objects.equals(this.messageId, pluginUninstalledMessage.messageId) + && Objects.equals(this.messageType, pluginUninstalledMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PluginUninstalledMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PluginUninstalledMessage instance; + + public Builder() { + this(new PluginUninstalledMessage()); + } + + protected Builder(PluginUninstalledMessage instance) { + this.instance = instance; + } + + public PluginUninstalledMessage.Builder data(PluginInfo data) { + this.instance.data = data; + return this; + } + + public PluginUninstalledMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public PluginUninstalledMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built PluginUninstalledMessage instance. + * + * The builder is not reusable. + */ + public PluginUninstalledMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PluginUninstalledMessage.Builder builder() { + return new PluginUninstalledMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PluginUninstalledMessage.Builder toBuilder() { + return new PluginUninstalledMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PreviousItemRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PreviousItemRequestDto.java new file mode 100644 index 0000000000000..01aa40ef303bd --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PreviousItemRequestDto.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PreviousItemRequestDto. + */ +@JsonPropertyOrder({ PreviousItemRequestDto.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PreviousItemRequestDto { + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID playlistItemId; + + public PreviousItemRequestDto() { + } + + public PreviousItemRequestDto playlistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets or sets the playing item identifier. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + } + + /** + * Return true if this PreviousItemRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PreviousItemRequestDto previousItemRequestDto = (PreviousItemRequestDto) o; + return Objects.equals(this.playlistItemId, previousItemRequestDto.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PreviousItemRequestDto {\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PreviousItemRequestDto instance; + + public Builder() { + this(new PreviousItemRequestDto()); + } + + protected Builder(PreviousItemRequestDto instance) { + this.instance = instance; + } + + public PreviousItemRequestDto.Builder playlistItemId(UUID playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built PreviousItemRequestDto instance. + * + * The builder is not reusable. + */ + public PreviousItemRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PreviousItemRequestDto.Builder builder() { + return new PreviousItemRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PreviousItemRequestDto.Builder toBuilder() { + return new PreviousItemRequestDto.Builder().playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProblemDetails.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProblemDetails.java new file mode 100644 index 0000000000000..c1fae34c8c497 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProblemDetails.java @@ -0,0 +1,408 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ProblemDetails + */ +@JsonPropertyOrder({ ProblemDetails.JSON_PROPERTY_TYPE, ProblemDetails.JSON_PROPERTY_TITLE, + ProblemDetails.JSON_PROPERTY_STATUS, ProblemDetails.JSON_PROPERTY_DETAIL, + ProblemDetails.JSON_PROPERTY_INSTANCE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ProblemDetails extends HashMap { + public static final String JSON_PROPERTY_TYPE = "type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_TITLE = "title"; + @org.eclipse.jdt.annotation.NonNull + private String title; + + public static final String JSON_PROPERTY_STATUS = "status"; + @org.eclipse.jdt.annotation.NonNull + private Integer status; + + public static final String JSON_PROPERTY_DETAIL = "detail"; + @org.eclipse.jdt.annotation.NonNull + private String detail; + + public static final String JSON_PROPERTY_INSTANCE = "instance"; + @org.eclipse.jdt.annotation.NonNull + private String instance; + + public ProblemDetails() { + } + + public ProblemDetails type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public ProblemDetails title(@org.eclipse.jdt.annotation.NonNull String title) { + this.title = title; + return this; + } + + /** + * Get title + * + * @return title + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@org.eclipse.jdt.annotation.NonNull String title) { + this.title = title; + } + + public ProblemDetails status(@org.eclipse.jdt.annotation.NonNull Integer status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@org.eclipse.jdt.annotation.NonNull Integer status) { + this.status = status; + } + + public ProblemDetails detail(@org.eclipse.jdt.annotation.NonNull String detail) { + this.detail = detail; + return this; + } + + /** + * Get detail + * + * @return detail + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDetail() { + return detail; + } + + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDetail(@org.eclipse.jdt.annotation.NonNull String detail) { + this.detail = detail; + } + + public ProblemDetails instance(@org.eclipse.jdt.annotation.NonNull String instance) { + this.instance = instance; + return this; + } + + /** + * Get instance + * + * @return instance + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INSTANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstance() { + return instance; + } + + @JsonProperty(JSON_PROPERTY_INSTANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstance(@org.eclipse.jdt.annotation.NonNull String instance) { + this.instance = instance; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public ProblemDetails putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this ProblemDetails object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProblemDetails problemDetails = (ProblemDetails) o; + return Objects.equals(this.type, problemDetails.type) && Objects.equals(this.title, problemDetails.title) + && Objects.equals(this.status, problemDetails.status) + && Objects.equals(this.detail, problemDetails.detail) + && Objects.equals(this.instance, problemDetails.instance) + && Objects.equals(this.additionalProperties, problemDetails.additionalProperties) && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, title, status, detail, instance, super.hashCode(), additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProblemDetails {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%stype%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `title` to the URL query string + if (getTitle() != null) { + joiner.add(String.format("%stitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTitle())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `detail` to the URL query string + if (getDetail() != null) { + joiner.add(String.format("%sdetail%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDetail())))); + } + + // add `instance` to the URL query string + if (getInstance() != null) { + joiner.add(String.format("%sinstance%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getInstance())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ProblemDetails instance; + + public Builder() { + this(new ProblemDetails()); + } + + protected Builder(ProblemDetails instance) { + this.instance = instance; + } + + public ProblemDetails.Builder type(String type) { + this.instance.type = type; + return this; + } + + public ProblemDetails.Builder title(String title) { + this.instance.title = title; + return this; + } + + public ProblemDetails.Builder status(Integer status) { + this.instance.status = status; + return this; + } + + public ProblemDetails.Builder detail(String detail) { + this.instance.detail = detail; + return this; + } + + public ProblemDetails.Builder instance(String instance) { + this.instance.instance = instance; + return this; + } + + /** + * returns a built ProblemDetails instance. + * + * The builder is not reusable. + */ + public ProblemDetails build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ProblemDetails.Builder builder() { + return new ProblemDetails.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ProblemDetails.Builder toBuilder() { + return new ProblemDetails.Builder().type(getType()).title(getTitle()).status(getStatus()).detail(getDetail()) + .instance(getInstance()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProcessPriorityClass.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProcessPriorityClass.java new file mode 100644 index 0000000000000..f8a1c3d3e1461 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProcessPriorityClass.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ProcessPriorityClass + */ +public enum ProcessPriorityClass { + + NORMAL("Normal"), + + IDLE("Idle"), + + HIGH("High"), + + REAL_TIME("RealTime"), + + BELOW_NORMAL("BelowNormal"), + + ABOVE_NORMAL("AboveNormal"); + + private String value; + + ProcessPriorityClass(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ProcessPriorityClass fromValue(String value) { + for (ProcessPriorityClass b : ProcessPriorityClass.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProfileCondition.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProfileCondition.java new file mode 100644 index 0000000000000..69bb6809e721e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProfileCondition.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ProfileCondition + */ +@JsonPropertyOrder({ ProfileCondition.JSON_PROPERTY_CONDITION, ProfileCondition.JSON_PROPERTY_PROPERTY, + ProfileCondition.JSON_PROPERTY_VALUE, ProfileCondition.JSON_PROPERTY_IS_REQUIRED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ProfileCondition { + public static final String JSON_PROPERTY_CONDITION = "Condition"; + @org.eclipse.jdt.annotation.NonNull + private ProfileConditionType condition; + + public static final String JSON_PROPERTY_PROPERTY = "Property"; + @org.eclipse.jdt.annotation.NonNull + private ProfileConditionValue property; + + public static final String JSON_PROPERTY_VALUE = "Value"; + @org.eclipse.jdt.annotation.NonNull + private String value; + + public static final String JSON_PROPERTY_IS_REQUIRED = "IsRequired"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isRequired; + + public ProfileCondition() { + } + + public ProfileCondition condition(@org.eclipse.jdt.annotation.NonNull ProfileConditionType condition) { + this.condition = condition; + return this; + } + + /** + * Get condition + * + * @return condition + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONDITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProfileConditionType getCondition() { + return condition; + } + + @JsonProperty(JSON_PROPERTY_CONDITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCondition(@org.eclipse.jdt.annotation.NonNull ProfileConditionType condition) { + this.condition = condition; + } + + public ProfileCondition property(@org.eclipse.jdt.annotation.NonNull ProfileConditionValue property) { + this.property = property; + return this; + } + + /** + * Get property + * + * @return property + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProfileConditionValue getProperty() { + return property; + } + + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperty(@org.eclipse.jdt.annotation.NonNull ProfileConditionValue property) { + this.property = property; + } + + public ProfileCondition value(@org.eclipse.jdt.annotation.NonNull String value) { + this.value = value; + return this; + } + + /** + * Get value + * + * @return value + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@org.eclipse.jdt.annotation.NonNull String value) { + this.value = value; + } + + public ProfileCondition isRequired(@org.eclipse.jdt.annotation.NonNull Boolean isRequired) { + this.isRequired = isRequired; + return this; + } + + /** + * Get isRequired + * + * @return isRequired + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsRequired() { + return isRequired; + } + + @JsonProperty(JSON_PROPERTY_IS_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsRequired(@org.eclipse.jdt.annotation.NonNull Boolean isRequired) { + this.isRequired = isRequired; + } + + /** + * Return true if this ProfileCondition object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileCondition profileCondition = (ProfileCondition) o; + return Objects.equals(this.condition, profileCondition.condition) + && Objects.equals(this.property, profileCondition.property) + && Objects.equals(this.value, profileCondition.value) + && Objects.equals(this.isRequired, profileCondition.isRequired); + } + + @Override + public int hashCode() { + return Objects.hash(condition, property, value, isRequired); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileCondition {\n"); + sb.append(" condition: ").append(toIndentedString(condition)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" isRequired: ").append(toIndentedString(isRequired)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Condition` to the URL query string + if (getCondition() != null) { + joiner.add(String.format("%sCondition%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCondition())))); + } + + // add `Property` to the URL query string + if (getProperty() != null) { + joiner.add(String.format("%sProperty%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProperty())))); + } + + // add `Value` to the URL query string + if (getValue() != null) { + joiner.add(String.format("%sValue%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getValue())))); + } + + // add `IsRequired` to the URL query string + if (getIsRequired() != null) { + joiner.add(String.format("%sIsRequired%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsRequired())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ProfileCondition instance; + + public Builder() { + this(new ProfileCondition()); + } + + protected Builder(ProfileCondition instance) { + this.instance = instance; + } + + public ProfileCondition.Builder condition(ProfileConditionType condition) { + this.instance.condition = condition; + return this; + } + + public ProfileCondition.Builder property(ProfileConditionValue property) { + this.instance.property = property; + return this; + } + + public ProfileCondition.Builder value(String value) { + this.instance.value = value; + return this; + } + + public ProfileCondition.Builder isRequired(Boolean isRequired) { + this.instance.isRequired = isRequired; + return this; + } + + /** + * returns a built ProfileCondition instance. + * + * The builder is not reusable. + */ + public ProfileCondition build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ProfileCondition.Builder builder() { + return new ProfileCondition.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ProfileCondition.Builder toBuilder() { + return new ProfileCondition.Builder().condition(getCondition()).property(getProperty()).value(getValue()) + .isRequired(getIsRequired()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProfileConditionType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProfileConditionType.java new file mode 100644 index 0000000000000..307d3e08344b8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProfileConditionType.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ProfileConditionType + */ +public enum ProfileConditionType { + + EQUALS("Equals"), + + NOT_EQUALS("NotEquals"), + + LESS_THAN_EQUAL("LessThanEqual"), + + GREATER_THAN_EQUAL("GreaterThanEqual"), + + EQUALS_ANY("EqualsAny"); + + private String value; + + ProfileConditionType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ProfileConditionType fromValue(String value) { + for (ProfileConditionType b : ProfileConditionType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProfileConditionValue.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProfileConditionValue.java new file mode 100644 index 0000000000000..4022a57990235 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProfileConditionValue.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ProfileConditionValue + */ +public enum ProfileConditionValue { + + AUDIO_CHANNELS("AudioChannels"), + + AUDIO_BITRATE("AudioBitrate"), + + AUDIO_PROFILE("AudioProfile"), + + WIDTH("Width"), + + HEIGHT("Height"), + + HAS64_BIT_OFFSETS("Has64BitOffsets"), + + PACKET_LENGTH("PacketLength"), + + VIDEO_BIT_DEPTH("VideoBitDepth"), + + VIDEO_BITRATE("VideoBitrate"), + + VIDEO_FRAMERATE("VideoFramerate"), + + VIDEO_LEVEL("VideoLevel"), + + VIDEO_PROFILE("VideoProfile"), + + VIDEO_TIMESTAMP("VideoTimestamp"), + + IS_ANAMORPHIC("IsAnamorphic"), + + REF_FRAMES("RefFrames"), + + NUM_AUDIO_STREAMS("NumAudioStreams"), + + NUM_VIDEO_STREAMS("NumVideoStreams"), + + IS_SECONDARY_AUDIO("IsSecondaryAudio"), + + VIDEO_CODEC_TAG("VideoCodecTag"), + + IS_AVC("IsAvc"), + + IS_INTERLACED("IsInterlaced"), + + AUDIO_SAMPLE_RATE("AudioSampleRate"), + + AUDIO_BIT_DEPTH("AudioBitDepth"), + + VIDEO_RANGE_TYPE("VideoRangeType"); + + private String value; + + ProfileConditionValue(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ProfileConditionValue fromValue(String value) { + for (ProfileConditionValue b : ProfileConditionValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProgramAudio.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProgramAudio.java new file mode 100644 index 0000000000000..6bcf20e0d169a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProgramAudio.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ProgramAudio + */ +public enum ProgramAudio { + + MONO("Mono"), + + STEREO("Stereo"), + + DOLBY("Dolby"), + + DOLBY_DIGITAL("DolbyDigital"), + + THX("Thx"), + + ATMOS("Atmos"); + + private String value; + + ProgramAudio(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ProgramAudio fromValue(String value) { + for (ProgramAudio b : ProgramAudio.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PublicSystemInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PublicSystemInfo.java new file mode 100644 index 0000000000000..f3f6f0063ceac --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/PublicSystemInfo.java @@ -0,0 +1,440 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * PublicSystemInfo + */ +@JsonPropertyOrder({ PublicSystemInfo.JSON_PROPERTY_LOCAL_ADDRESS, PublicSystemInfo.JSON_PROPERTY_SERVER_NAME, + PublicSystemInfo.JSON_PROPERTY_VERSION, PublicSystemInfo.JSON_PROPERTY_PRODUCT_NAME, + PublicSystemInfo.JSON_PROPERTY_OPERATING_SYSTEM, PublicSystemInfo.JSON_PROPERTY_ID, + PublicSystemInfo.JSON_PROPERTY_STARTUP_WIZARD_COMPLETED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PublicSystemInfo { + public static final String JSON_PROPERTY_LOCAL_ADDRESS = "LocalAddress"; + @org.eclipse.jdt.annotation.NonNull + private String localAddress; + + public static final String JSON_PROPERTY_SERVER_NAME = "ServerName"; + @org.eclipse.jdt.annotation.NonNull + private String serverName; + + public static final String JSON_PROPERTY_VERSION = "Version"; + @org.eclipse.jdt.annotation.NonNull + private String version; + + public static final String JSON_PROPERTY_PRODUCT_NAME = "ProductName"; + @org.eclipse.jdt.annotation.NonNull + private String productName; + + public static final String JSON_PROPERTY_OPERATING_SYSTEM = "OperatingSystem"; + @org.eclipse.jdt.annotation.NonNull + private String operatingSystem; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_STARTUP_WIZARD_COMPLETED = "StartupWizardCompleted"; + @org.eclipse.jdt.annotation.NonNull + private Boolean startupWizardCompleted; + + public PublicSystemInfo() { + } + + public PublicSystemInfo localAddress(@org.eclipse.jdt.annotation.NonNull String localAddress) { + this.localAddress = localAddress; + return this; + } + + /** + * Gets or sets the local address. + * + * @return localAddress + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCAL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocalAddress() { + return localAddress; + } + + @JsonProperty(JSON_PROPERTY_LOCAL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalAddress(@org.eclipse.jdt.annotation.NonNull String localAddress) { + this.localAddress = localAddress; + } + + public PublicSystemInfo serverName(@org.eclipse.jdt.annotation.NonNull String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Gets or sets the name of the server. + * + * @return serverName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerName() { + return serverName; + } + + @JsonProperty(JSON_PROPERTY_SERVER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerName(@org.eclipse.jdt.annotation.NonNull String serverName) { + this.serverName = serverName; + } + + public PublicSystemInfo version(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + return this; + } + + /** + * Gets or sets the server version. + * + * @return version + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + } + + public PublicSystemInfo productName(@org.eclipse.jdt.annotation.NonNull String productName) { + this.productName = productName; + return this; + } + + /** + * Gets or sets the product name. This is the AssemblyProduct name. + * + * @return productName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRODUCT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProductName() { + return productName; + } + + @JsonProperty(JSON_PROPERTY_PRODUCT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProductName(@org.eclipse.jdt.annotation.NonNull String productName) { + this.productName = productName; + } + + public PublicSystemInfo operatingSystem(@org.eclipse.jdt.annotation.NonNull String operatingSystem) { + this.operatingSystem = operatingSystem; + return this; + } + + /** + * Gets or sets the operating system. + * + * @return operatingSystem + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OPERATING_SYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOperatingSystem() { + return operatingSystem; + } + + @JsonProperty(JSON_PROPERTY_OPERATING_SYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOperatingSystem(@org.eclipse.jdt.annotation.NonNull String operatingSystem) { + this.operatingSystem = operatingSystem; + } + + public PublicSystemInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public PublicSystemInfo startupWizardCompleted(@org.eclipse.jdt.annotation.NonNull Boolean startupWizardCompleted) { + this.startupWizardCompleted = startupWizardCompleted; + return this; + } + + /** + * Gets or sets a value indicating whether the startup wizard is completed. + * + * @return startupWizardCompleted + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STARTUP_WIZARD_COMPLETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStartupWizardCompleted() { + return startupWizardCompleted; + } + + @JsonProperty(JSON_PROPERTY_STARTUP_WIZARD_COMPLETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartupWizardCompleted(@org.eclipse.jdt.annotation.NonNull Boolean startupWizardCompleted) { + this.startupWizardCompleted = startupWizardCompleted; + } + + /** + * Return true if this PublicSystemInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicSystemInfo publicSystemInfo = (PublicSystemInfo) o; + return Objects.equals(this.localAddress, publicSystemInfo.localAddress) + && Objects.equals(this.serverName, publicSystemInfo.serverName) + && Objects.equals(this.version, publicSystemInfo.version) + && Objects.equals(this.productName, publicSystemInfo.productName) + && Objects.equals(this.operatingSystem, publicSystemInfo.operatingSystem) + && Objects.equals(this.id, publicSystemInfo.id) + && Objects.equals(this.startupWizardCompleted, publicSystemInfo.startupWizardCompleted); + } + + @Override + public int hashCode() { + return Objects.hash(localAddress, serverName, version, productName, operatingSystem, id, + startupWizardCompleted); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicSystemInfo {\n"); + sb.append(" localAddress: ").append(toIndentedString(localAddress)).append("\n"); + sb.append(" serverName: ").append(toIndentedString(serverName)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" productName: ").append(toIndentedString(productName)).append("\n"); + sb.append(" operatingSystem: ").append(toIndentedString(operatingSystem)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" startupWizardCompleted: ").append(toIndentedString(startupWizardCompleted)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `LocalAddress` to the URL query string + if (getLocalAddress() != null) { + joiner.add(String.format("%sLocalAddress%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocalAddress())))); + } + + // add `ServerName` to the URL query string + if (getServerName() != null) { + joiner.add(String.format("%sServerName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerName())))); + } + + // add `Version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format("%sVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `ProductName` to the URL query string + if (getProductName() != null) { + joiner.add(String.format("%sProductName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProductName())))); + } + + // add `OperatingSystem` to the URL query string + if (getOperatingSystem() != null) { + joiner.add(String.format("%sOperatingSystem%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOperatingSystem())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `StartupWizardCompleted` to the URL query string + if (getStartupWizardCompleted() != null) { + joiner.add(String.format("%sStartupWizardCompleted%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartupWizardCompleted())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PublicSystemInfo instance; + + public Builder() { + this(new PublicSystemInfo()); + } + + protected Builder(PublicSystemInfo instance) { + this.instance = instance; + } + + public PublicSystemInfo.Builder localAddress(String localAddress) { + this.instance.localAddress = localAddress; + return this; + } + + public PublicSystemInfo.Builder serverName(String serverName) { + this.instance.serverName = serverName; + return this; + } + + public PublicSystemInfo.Builder version(String version) { + this.instance.version = version; + return this; + } + + public PublicSystemInfo.Builder productName(String productName) { + this.instance.productName = productName; + return this; + } + + public PublicSystemInfo.Builder operatingSystem(String operatingSystem) { + this.instance.operatingSystem = operatingSystem; + return this; + } + + public PublicSystemInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public PublicSystemInfo.Builder startupWizardCompleted(Boolean startupWizardCompleted) { + this.instance.startupWizardCompleted = startupWizardCompleted; + return this; + } + + /** + * returns a built PublicSystemInfo instance. + * + * The builder is not reusable. + */ + public PublicSystemInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PublicSystemInfo.Builder builder() { + return new PublicSystemInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PublicSystemInfo.Builder toBuilder() { + return new PublicSystemInfo.Builder().localAddress(getLocalAddress()).serverName(getServerName()) + .version(getVersion()).productName(getProductName()).operatingSystem(getOperatingSystem()).id(getId()) + .startupWizardCompleted(getStartupWizardCompleted()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QueryFilters.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QueryFilters.java new file mode 100644 index 0000000000000..9b55e11f488db --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QueryFilters.java @@ -0,0 +1,256 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * QueryFilters + */ +@JsonPropertyOrder({ QueryFilters.JSON_PROPERTY_GENRES, QueryFilters.JSON_PROPERTY_TAGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class QueryFilters { + public static final String JSON_PROPERTY_GENRES = "Genres"; + @org.eclipse.jdt.annotation.NonNull + private List genres; + + public static final String JSON_PROPERTY_TAGS = "Tags"; + @org.eclipse.jdt.annotation.NonNull + private List tags; + + public QueryFilters() { + } + + public QueryFilters genres(@org.eclipse.jdt.annotation.NonNull List genres) { + this.genres = genres; + return this; + } + + public QueryFilters addGenresItem(NameGuidPair genresItem) { + if (this.genres == null) { + this.genres = new ArrayList<>(); + } + this.genres.add(genresItem); + return this; + } + + /** + * Get genres + * + * @return genres + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GENRES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGenres() { + return genres; + } + + @JsonProperty(JSON_PROPERTY_GENRES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGenres(@org.eclipse.jdt.annotation.NonNull List genres) { + this.genres = genres; + } + + public QueryFilters tags(@org.eclipse.jdt.annotation.NonNull List tags) { + this.tags = tags; + return this; + } + + public QueryFilters addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * + * @return tags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(@org.eclipse.jdt.annotation.NonNull List tags) { + this.tags = tags; + } + + /** + * Return true if this QueryFilters object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryFilters queryFilters = (QueryFilters) o; + return Objects.equals(this.genres, queryFilters.genres) && Objects.equals(this.tags, queryFilters.tags); + } + + @Override + public int hashCode() { + return Objects.hash(genres, tags); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryFilters {\n"); + sb.append(" genres: ").append(toIndentedString(genres)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Genres` to the URL query string + if (getGenres() != null) { + for (int i = 0; i < getGenres().size(); i++) { + if (getGenres().get(i) != null) { + joiner.add(getGenres().get(i).toUrlQueryString(String.format("%sGenres%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Tags` to the URL query string + if (getTags() != null) { + for (int i = 0; i < getTags().size(); i++) { + joiner.add(String.format("%sTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getTags().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private QueryFilters instance; + + public Builder() { + this(new QueryFilters()); + } + + protected Builder(QueryFilters instance) { + this.instance = instance; + } + + public QueryFilters.Builder genres(List genres) { + this.instance.genres = genres; + return this; + } + + public QueryFilters.Builder tags(List tags) { + this.instance.tags = tags; + return this; + } + + /** + * returns a built QueryFilters instance. + * + * The builder is not reusable. + */ + public QueryFilters build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static QueryFilters.Builder builder() { + return new QueryFilters.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public QueryFilters.Builder toBuilder() { + return new QueryFilters.Builder().genres(getGenres()).tags(getTags()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QueryFiltersLegacy.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QueryFiltersLegacy.java new file mode 100644 index 0000000000000..71a59fbb01da2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QueryFiltersLegacy.java @@ -0,0 +1,360 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * QueryFiltersLegacy + */ +@JsonPropertyOrder({ QueryFiltersLegacy.JSON_PROPERTY_GENRES, QueryFiltersLegacy.JSON_PROPERTY_TAGS, + QueryFiltersLegacy.JSON_PROPERTY_OFFICIAL_RATINGS, QueryFiltersLegacy.JSON_PROPERTY_YEARS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class QueryFiltersLegacy { + public static final String JSON_PROPERTY_GENRES = "Genres"; + @org.eclipse.jdt.annotation.NonNull + private List genres; + + public static final String JSON_PROPERTY_TAGS = "Tags"; + @org.eclipse.jdt.annotation.NonNull + private List tags; + + public static final String JSON_PROPERTY_OFFICIAL_RATINGS = "OfficialRatings"; + @org.eclipse.jdt.annotation.NonNull + private List officialRatings; + + public static final String JSON_PROPERTY_YEARS = "Years"; + @org.eclipse.jdt.annotation.NonNull + private List years; + + public QueryFiltersLegacy() { + } + + public QueryFiltersLegacy genres(@org.eclipse.jdt.annotation.NonNull List genres) { + this.genres = genres; + return this; + } + + public QueryFiltersLegacy addGenresItem(String genresItem) { + if (this.genres == null) { + this.genres = new ArrayList<>(); + } + this.genres.add(genresItem); + return this; + } + + /** + * Get genres + * + * @return genres + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GENRES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGenres() { + return genres; + } + + @JsonProperty(JSON_PROPERTY_GENRES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGenres(@org.eclipse.jdt.annotation.NonNull List genres) { + this.genres = genres; + } + + public QueryFiltersLegacy tags(@org.eclipse.jdt.annotation.NonNull List tags) { + this.tags = tags; + return this; + } + + public QueryFiltersLegacy addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * + * @return tags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(@org.eclipse.jdt.annotation.NonNull List tags) { + this.tags = tags; + } + + public QueryFiltersLegacy officialRatings(@org.eclipse.jdt.annotation.NonNull List officialRatings) { + this.officialRatings = officialRatings; + return this; + } + + public QueryFiltersLegacy addOfficialRatingsItem(String officialRatingsItem) { + if (this.officialRatings == null) { + this.officialRatings = new ArrayList<>(); + } + this.officialRatings.add(officialRatingsItem); + return this; + } + + /** + * Get officialRatings + * + * @return officialRatings + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OFFICIAL_RATINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getOfficialRatings() { + return officialRatings; + } + + @JsonProperty(JSON_PROPERTY_OFFICIAL_RATINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOfficialRatings(@org.eclipse.jdt.annotation.NonNull List officialRatings) { + this.officialRatings = officialRatings; + } + + public QueryFiltersLegacy years(@org.eclipse.jdt.annotation.NonNull List years) { + this.years = years; + return this; + } + + public QueryFiltersLegacy addYearsItem(Integer yearsItem) { + if (this.years == null) { + this.years = new ArrayList<>(); + } + this.years.add(yearsItem); + return this; + } + + /** + * Get years + * + * @return years + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEARS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getYears() { + return years; + } + + @JsonProperty(JSON_PROPERTY_YEARS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYears(@org.eclipse.jdt.annotation.NonNull List years) { + this.years = years; + } + + /** + * Return true if this QueryFiltersLegacy object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryFiltersLegacy queryFiltersLegacy = (QueryFiltersLegacy) o; + return Objects.equals(this.genres, queryFiltersLegacy.genres) + && Objects.equals(this.tags, queryFiltersLegacy.tags) + && Objects.equals(this.officialRatings, queryFiltersLegacy.officialRatings) + && Objects.equals(this.years, queryFiltersLegacy.years); + } + + @Override + public int hashCode() { + return Objects.hash(genres, tags, officialRatings, years); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryFiltersLegacy {\n"); + sb.append(" genres: ").append(toIndentedString(genres)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" officialRatings: ").append(toIndentedString(officialRatings)).append("\n"); + sb.append(" years: ").append(toIndentedString(years)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Genres` to the URL query string + if (getGenres() != null) { + for (int i = 0; i < getGenres().size(); i++) { + joiner.add(String.format("%sGenres%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getGenres().get(i))))); + } + } + + // add `Tags` to the URL query string + if (getTags() != null) { + for (int i = 0; i < getTags().size(); i++) { + joiner.add(String.format("%sTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getTags().get(i))))); + } + } + + // add `OfficialRatings` to the URL query string + if (getOfficialRatings() != null) { + for (int i = 0; i < getOfficialRatings().size(); i++) { + joiner.add(String.format("%sOfficialRatings%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getOfficialRatings().get(i))))); + } + } + + // add `Years` to the URL query string + if (getYears() != null) { + for (int i = 0; i < getYears().size(); i++) { + joiner.add(String.format("%sYears%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getYears().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private QueryFiltersLegacy instance; + + public Builder() { + this(new QueryFiltersLegacy()); + } + + protected Builder(QueryFiltersLegacy instance) { + this.instance = instance; + } + + public QueryFiltersLegacy.Builder genres(List genres) { + this.instance.genres = genres; + return this; + } + + public QueryFiltersLegacy.Builder tags(List tags) { + this.instance.tags = tags; + return this; + } + + public QueryFiltersLegacy.Builder officialRatings(List officialRatings) { + this.instance.officialRatings = officialRatings; + return this; + } + + public QueryFiltersLegacy.Builder years(List years) { + this.instance.years = years; + return this; + } + + /** + * returns a built QueryFiltersLegacy instance. + * + * The builder is not reusable. + */ + public QueryFiltersLegacy build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static QueryFiltersLegacy.Builder builder() { + return new QueryFiltersLegacy.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public QueryFiltersLegacy.Builder toBuilder() { + return new QueryFiltersLegacy.Builder().genres(getGenres()).tags(getTags()) + .officialRatings(getOfficialRatings()).years(getYears()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QueueItem.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QueueItem.java new file mode 100644 index 0000000000000..72b47bd17c982 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QueueItem.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * QueueItem + */ +@JsonPropertyOrder({ QueueItem.JSON_PROPERTY_ID, QueueItem.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class QueueItem { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private String playlistItemId; + + public QueueItem() { + } + + public QueueItem id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public QueueItem playlistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Get playlistItemId + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + } + + /** + * Return true if this QueueItem object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueueItem queueItem = (QueueItem) o; + return Objects.equals(this.id, queueItem.id) && Objects.equals(this.playlistItemId, queueItem.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(id, playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueueItem {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private QueueItem instance; + + public Builder() { + this(new QueueItem()); + } + + protected Builder(QueueItem instance) { + this.instance = instance; + } + + public QueueItem.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public QueueItem.Builder playlistItemId(String playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built QueueItem instance. + * + * The builder is not reusable. + */ + public QueueItem build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static QueueItem.Builder builder() { + return new QueueItem.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public QueueItem.Builder toBuilder() { + return new QueueItem.Builder().id(getId()).playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QueueRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QueueRequestDto.java new file mode 100644 index 0000000000000..98eaff9ec44fe --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QueueRequestDto.java @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class QueueRequestDto. + */ +@JsonPropertyOrder({ QueueRequestDto.JSON_PROPERTY_ITEM_IDS, QueueRequestDto.JSON_PROPERTY_MODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class QueueRequestDto { + public static final String JSON_PROPERTY_ITEM_IDS = "ItemIds"; + @org.eclipse.jdt.annotation.NonNull + private List itemIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_MODE = "Mode"; + @org.eclipse.jdt.annotation.NonNull + private GroupQueueMode mode; + + public QueueRequestDto() { + } + + public QueueRequestDto itemIds(@org.eclipse.jdt.annotation.NonNull List itemIds) { + this.itemIds = itemIds; + return this; + } + + public QueueRequestDto addItemIdsItem(UUID itemIdsItem) { + if (this.itemIds == null) { + this.itemIds = new ArrayList<>(); + } + this.itemIds.add(itemIdsItem); + return this; + } + + /** + * Gets or sets the items to enqueue. + * + * @return itemIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItemIds() { + return itemIds; + } + + @JsonProperty(JSON_PROPERTY_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemIds(@org.eclipse.jdt.annotation.NonNull List itemIds) { + this.itemIds = itemIds; + } + + public QueueRequestDto mode(@org.eclipse.jdt.annotation.NonNull GroupQueueMode mode) { + this.mode = mode; + return this; + } + + /** + * Enum GroupQueueMode. + * + * @return mode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupQueueMode getMode() { + return mode; + } + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(@org.eclipse.jdt.annotation.NonNull GroupQueueMode mode) { + this.mode = mode; + } + + /** + * Return true if this QueueRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueueRequestDto queueRequestDto = (QueueRequestDto) o; + return Objects.equals(this.itemIds, queueRequestDto.itemIds) && Objects.equals(this.mode, queueRequestDto.mode); + } + + @Override + public int hashCode() { + return Objects.hash(itemIds, mode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueueRequestDto {\n"); + sb.append(" itemIds: ").append(toIndentedString(itemIds)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ItemIds` to the URL query string + if (getItemIds() != null) { + for (int i = 0; i < getItemIds().size(); i++) { + if (getItemIds().get(i) != null) { + joiner.add(String.format("%sItemIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getItemIds().get(i))))); + } + } + } + + // add `Mode` to the URL query string + if (getMode() != null) { + joiner.add(String.format("%sMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMode())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private QueueRequestDto instance; + + public Builder() { + this(new QueueRequestDto()); + } + + protected Builder(QueueRequestDto instance) { + this.instance = instance; + } + + public QueueRequestDto.Builder itemIds(List itemIds) { + this.instance.itemIds = itemIds; + return this; + } + + public QueueRequestDto.Builder mode(GroupQueueMode mode) { + this.instance.mode = mode; + return this; + } + + /** + * returns a built QueueRequestDto instance. + * + * The builder is not reusable. + */ + public QueueRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static QueueRequestDto.Builder builder() { + return new QueueRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public QueueRequestDto.Builder toBuilder() { + return new QueueRequestDto.Builder().itemIds(getItemIds()).mode(getMode()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QuickConnectDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QuickConnectDto.java new file mode 100644 index 0000000000000..be9822d0a4952 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QuickConnectDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The quick connect request body. + */ +@JsonPropertyOrder({ QuickConnectDto.JSON_PROPERTY_SECRET }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class QuickConnectDto { + public static final String JSON_PROPERTY_SECRET = "Secret"; + @org.eclipse.jdt.annotation.Nullable + private String secret; + + public QuickConnectDto() { + } + + public QuickConnectDto secret(@org.eclipse.jdt.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * Gets or sets the quick connect secret. + * + * @return secret + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSecret() { + return secret; + } + + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSecret(@org.eclipse.jdt.annotation.Nullable String secret) { + this.secret = secret; + } + + /** + * Return true if this QuickConnectDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuickConnectDto quickConnectDto = (QuickConnectDto) o; + return Objects.equals(this.secret, quickConnectDto.secret); + } + + @Override + public int hashCode() { + return Objects.hash(secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuickConnectDto {\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Secret` to the URL query string + if (getSecret() != null) { + joiner.add(String.format("%sSecret%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSecret())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private QuickConnectDto instance; + + public Builder() { + this(new QuickConnectDto()); + } + + protected Builder(QuickConnectDto instance) { + this.instance = instance; + } + + public QuickConnectDto.Builder secret(String secret) { + this.instance.secret = secret; + return this; + } + + /** + * returns a built QuickConnectDto instance. + * + * The builder is not reusable. + */ + public QuickConnectDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static QuickConnectDto.Builder builder() { + return new QuickConnectDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public QuickConnectDto.Builder toBuilder() { + return new QuickConnectDto.Builder().secret(getSecret()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QuickConnectResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QuickConnectResult.java new file mode 100644 index 0000000000000..64e53bf85cf25 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/QuickConnectResult.java @@ -0,0 +1,478 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Stores the state of an quick connect request. + */ +@JsonPropertyOrder({ QuickConnectResult.JSON_PROPERTY_AUTHENTICATED, QuickConnectResult.JSON_PROPERTY_SECRET, + QuickConnectResult.JSON_PROPERTY_CODE, QuickConnectResult.JSON_PROPERTY_DEVICE_ID, + QuickConnectResult.JSON_PROPERTY_DEVICE_NAME, QuickConnectResult.JSON_PROPERTY_APP_NAME, + QuickConnectResult.JSON_PROPERTY_APP_VERSION, QuickConnectResult.JSON_PROPERTY_DATE_ADDED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class QuickConnectResult { + public static final String JSON_PROPERTY_AUTHENTICATED = "Authenticated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean authenticated; + + public static final String JSON_PROPERTY_SECRET = "Secret"; + @org.eclipse.jdt.annotation.NonNull + private String secret; + + public static final String JSON_PROPERTY_CODE = "Code"; + @org.eclipse.jdt.annotation.NonNull + private String code; + + public static final String JSON_PROPERTY_DEVICE_ID = "DeviceId"; + @org.eclipse.jdt.annotation.NonNull + private String deviceId; + + public static final String JSON_PROPERTY_DEVICE_NAME = "DeviceName"; + @org.eclipse.jdt.annotation.NonNull + private String deviceName; + + public static final String JSON_PROPERTY_APP_NAME = "AppName"; + @org.eclipse.jdt.annotation.NonNull + private String appName; + + public static final String JSON_PROPERTY_APP_VERSION = "AppVersion"; + @org.eclipse.jdt.annotation.NonNull + private String appVersion; + + public static final String JSON_PROPERTY_DATE_ADDED = "DateAdded"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateAdded; + + public QuickConnectResult() { + } + + public QuickConnectResult authenticated(@org.eclipse.jdt.annotation.NonNull Boolean authenticated) { + this.authenticated = authenticated; + return this; + } + + /** + * Gets or sets a value indicating whether this request is authorized. + * + * @return authenticated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTHENTICATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAuthenticated() { + return authenticated; + } + + @JsonProperty(JSON_PROPERTY_AUTHENTICATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthenticated(@org.eclipse.jdt.annotation.NonNull Boolean authenticated) { + this.authenticated = authenticated; + } + + public QuickConnectResult secret(@org.eclipse.jdt.annotation.NonNull String secret) { + this.secret = secret; + return this; + } + + /** + * Gets the secret value used to uniquely identify this request. Can be used to retrieve authentication information. + * + * @return secret + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecret() { + return secret; + } + + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(@org.eclipse.jdt.annotation.NonNull String secret) { + this.secret = secret; + } + + public QuickConnectResult code(@org.eclipse.jdt.annotation.NonNull String code) { + this.code = code; + return this; + } + + /** + * Gets the user facing code used so the user can quickly differentiate this request from others. + * + * @return code + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCode() { + return code; + } + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCode(@org.eclipse.jdt.annotation.NonNull String code) { + this.code = code; + } + + public QuickConnectResult deviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Gets the requesting device id. + * + * @return deviceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceId() { + return deviceId; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + } + + public QuickConnectResult deviceName(@org.eclipse.jdt.annotation.NonNull String deviceName) { + this.deviceName = deviceName; + return this; + } + + /** + * Gets the requesting device name. + * + * @return deviceName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceName() { + return deviceName; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceName(@org.eclipse.jdt.annotation.NonNull String deviceName) { + this.deviceName = deviceName; + } + + public QuickConnectResult appName(@org.eclipse.jdt.annotation.NonNull String appName) { + this.appName = appName; + return this; + } + + /** + * Gets the requesting app name. + * + * @return appName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppName() { + return appName; + } + + @JsonProperty(JSON_PROPERTY_APP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppName(@org.eclipse.jdt.annotation.NonNull String appName) { + this.appName = appName; + } + + public QuickConnectResult appVersion(@org.eclipse.jdt.annotation.NonNull String appVersion) { + this.appVersion = appVersion; + return this; + } + + /** + * Gets the requesting app version. + * + * @return appVersion + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APP_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppVersion() { + return appVersion; + } + + @JsonProperty(JSON_PROPERTY_APP_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppVersion(@org.eclipse.jdt.annotation.NonNull String appVersion) { + this.appVersion = appVersion; + } + + public QuickConnectResult dateAdded(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateAdded) { + this.dateAdded = dateAdded; + return this; + } + + /** + * Gets or sets the DateTime that this request was created. + * + * @return dateAdded + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_ADDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateAdded() { + return dateAdded; + } + + @JsonProperty(JSON_PROPERTY_DATE_ADDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateAdded(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateAdded) { + this.dateAdded = dateAdded; + } + + /** + * Return true if this QuickConnectResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuickConnectResult quickConnectResult = (QuickConnectResult) o; + return Objects.equals(this.authenticated, quickConnectResult.authenticated) + && Objects.equals(this.secret, quickConnectResult.secret) + && Objects.equals(this.code, quickConnectResult.code) + && Objects.equals(this.deviceId, quickConnectResult.deviceId) + && Objects.equals(this.deviceName, quickConnectResult.deviceName) + && Objects.equals(this.appName, quickConnectResult.appName) + && Objects.equals(this.appVersion, quickConnectResult.appVersion) + && Objects.equals(this.dateAdded, quickConnectResult.dateAdded); + } + + @Override + public int hashCode() { + return Objects.hash(authenticated, secret, code, deviceId, deviceName, appName, appVersion, dateAdded); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuickConnectResult {\n"); + sb.append(" authenticated: ").append(toIndentedString(authenticated)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" deviceId: ").append(toIndentedString(deviceId)).append("\n"); + sb.append(" deviceName: ").append(toIndentedString(deviceName)).append("\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); + sb.append(" dateAdded: ").append(toIndentedString(dateAdded)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Authenticated` to the URL query string + if (getAuthenticated() != null) { + joiner.add(String.format("%sAuthenticated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAuthenticated())))); + } + + // add `Secret` to the URL query string + if (getSecret() != null) { + joiner.add(String.format("%sSecret%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSecret())))); + } + + // add `Code` to the URL query string + if (getCode() != null) { + joiner.add(String.format("%sCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCode())))); + } + + // add `DeviceId` to the URL query string + if (getDeviceId() != null) { + joiner.add(String.format("%sDeviceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceId())))); + } + + // add `DeviceName` to the URL query string + if (getDeviceName() != null) { + joiner.add(String.format("%sDeviceName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceName())))); + } + + // add `AppName` to the URL query string + if (getAppName() != null) { + joiner.add(String.format("%sAppName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAppName())))); + } + + // add `AppVersion` to the URL query string + if (getAppVersion() != null) { + joiner.add(String.format("%sAppVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAppVersion())))); + } + + // add `DateAdded` to the URL query string + if (getDateAdded() != null) { + joiner.add(String.format("%sDateAdded%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateAdded())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private QuickConnectResult instance; + + public Builder() { + this(new QuickConnectResult()); + } + + protected Builder(QuickConnectResult instance) { + this.instance = instance; + } + + public QuickConnectResult.Builder authenticated(Boolean authenticated) { + this.instance.authenticated = authenticated; + return this; + } + + public QuickConnectResult.Builder secret(String secret) { + this.instance.secret = secret; + return this; + } + + public QuickConnectResult.Builder code(String code) { + this.instance.code = code; + return this; + } + + public QuickConnectResult.Builder deviceId(String deviceId) { + this.instance.deviceId = deviceId; + return this; + } + + public QuickConnectResult.Builder deviceName(String deviceName) { + this.instance.deviceName = deviceName; + return this; + } + + public QuickConnectResult.Builder appName(String appName) { + this.instance.appName = appName; + return this; + } + + public QuickConnectResult.Builder appVersion(String appVersion) { + this.instance.appVersion = appVersion; + return this; + } + + public QuickConnectResult.Builder dateAdded(OffsetDateTime dateAdded) { + this.instance.dateAdded = dateAdded; + return this; + } + + /** + * returns a built QuickConnectResult instance. + * + * The builder is not reusable. + */ + public QuickConnectResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static QuickConnectResult.Builder builder() { + return new QuickConnectResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public QuickConnectResult.Builder toBuilder() { + return new QuickConnectResult.Builder().authenticated(getAuthenticated()).secret(getSecret()).code(getCode()) + .deviceId(getDeviceId()).deviceName(getDeviceName()).appName(getAppName()).appVersion(getAppVersion()) + .dateAdded(getDateAdded()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RatingType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RatingType.java new file mode 100644 index 0000000000000..ff2da9d9344e6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RatingType.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets RatingType + */ +public enum RatingType { + + SCORE("Score"), + + LIKES("Likes"); + + private String value; + + RatingType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static RatingType fromValue(String value) { + for (RatingType b : RatingType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ReadyRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ReadyRequestDto.java new file mode 100644 index 0000000000000..50e0997ab9414 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ReadyRequestDto.java @@ -0,0 +1,316 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class ReadyRequest. + */ +@JsonPropertyOrder({ ReadyRequestDto.JSON_PROPERTY_WHEN, ReadyRequestDto.JSON_PROPERTY_POSITION_TICKS, + ReadyRequestDto.JSON_PROPERTY_IS_PLAYING, ReadyRequestDto.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ReadyRequestDto { + public static final String JSON_PROPERTY_WHEN = "When"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime when; + + public static final String JSON_PROPERTY_POSITION_TICKS = "PositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long positionTicks; + + public static final String JSON_PROPERTY_IS_PLAYING = "IsPlaying"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPlaying; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID playlistItemId; + + public ReadyRequestDto() { + } + + public ReadyRequestDto when(@org.eclipse.jdt.annotation.NonNull OffsetDateTime when) { + this.when = when; + return this; + } + + /** + * Gets or sets when the request has been made by the client. + * + * @return when + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WHEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getWhen() { + return when; + } + + @JsonProperty(JSON_PROPERTY_WHEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhen(@org.eclipse.jdt.annotation.NonNull OffsetDateTime when) { + this.when = when; + } + + public ReadyRequestDto positionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + return this; + } + + /** + * Gets or sets the position ticks. + * + * @return positionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPositionTicks() { + return positionTicks; + } + + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPositionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + } + + public ReadyRequestDto isPlaying(@org.eclipse.jdt.annotation.NonNull Boolean isPlaying) { + this.isPlaying = isPlaying; + return this; + } + + /** + * Gets or sets a value indicating whether the client playback is unpaused. + * + * @return isPlaying + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PLAYING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPlaying() { + return isPlaying; + } + + @JsonProperty(JSON_PROPERTY_IS_PLAYING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPlaying(@org.eclipse.jdt.annotation.NonNull Boolean isPlaying) { + this.isPlaying = isPlaying; + } + + public ReadyRequestDto playlistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets or sets the playlist item identifier of the playing item. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + } + + /** + * Return true if this ReadyRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadyRequestDto readyRequestDto = (ReadyRequestDto) o; + return Objects.equals(this.when, readyRequestDto.when) + && Objects.equals(this.positionTicks, readyRequestDto.positionTicks) + && Objects.equals(this.isPlaying, readyRequestDto.isPlaying) + && Objects.equals(this.playlistItemId, readyRequestDto.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(when, positionTicks, isPlaying, playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadyRequestDto {\n"); + sb.append(" when: ").append(toIndentedString(when)).append("\n"); + sb.append(" positionTicks: ").append(toIndentedString(positionTicks)).append("\n"); + sb.append(" isPlaying: ").append(toIndentedString(isPlaying)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `When` to the URL query string + if (getWhen() != null) { + joiner.add(String.format("%sWhen%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWhen())))); + } + + // add `PositionTicks` to the URL query string + if (getPositionTicks() != null) { + joiner.add(String.format("%sPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPositionTicks())))); + } + + // add `IsPlaying` to the URL query string + if (getIsPlaying() != null) { + joiner.add(String.format("%sIsPlaying%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPlaying())))); + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ReadyRequestDto instance; + + public Builder() { + this(new ReadyRequestDto()); + } + + protected Builder(ReadyRequestDto instance) { + this.instance = instance; + } + + public ReadyRequestDto.Builder when(OffsetDateTime when) { + this.instance.when = when; + return this; + } + + public ReadyRequestDto.Builder positionTicks(Long positionTicks) { + this.instance.positionTicks = positionTicks; + return this; + } + + public ReadyRequestDto.Builder isPlaying(Boolean isPlaying) { + this.instance.isPlaying = isPlaying; + return this; + } + + public ReadyRequestDto.Builder playlistItemId(UUID playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built ReadyRequestDto instance. + * + * The builder is not reusable. + */ + public ReadyRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ReadyRequestDto.Builder builder() { + return new ReadyRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ReadyRequestDto.Builder toBuilder() { + return new ReadyRequestDto.Builder().when(getWhen()).positionTicks(getPositionTicks()).isPlaying(getIsPlaying()) + .playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RecommendationDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RecommendationDto.java new file mode 100644 index 0000000000000..cecce491595eb --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RecommendationDto.java @@ -0,0 +1,330 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * RecommendationDto + */ +@JsonPropertyOrder({ RecommendationDto.JSON_PROPERTY_ITEMS, RecommendationDto.JSON_PROPERTY_RECOMMENDATION_TYPE, + RecommendationDto.JSON_PROPERTY_BASELINE_ITEM_NAME, RecommendationDto.JSON_PROPERTY_CATEGORY_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RecommendationDto { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items; + + public static final String JSON_PROPERTY_RECOMMENDATION_TYPE = "RecommendationType"; + @org.eclipse.jdt.annotation.NonNull + private RecommendationType recommendationType; + + public static final String JSON_PROPERTY_BASELINE_ITEM_NAME = "BaselineItemName"; + @org.eclipse.jdt.annotation.NonNull + private String baselineItemName; + + public static final String JSON_PROPERTY_CATEGORY_ID = "CategoryId"; + @org.eclipse.jdt.annotation.NonNull + private UUID categoryId; + + public RecommendationDto() { + } + + public RecommendationDto items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public RecommendationDto addItemsItem(BaseItemDto itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Get items + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public RecommendationDto recommendationType( + @org.eclipse.jdt.annotation.NonNull RecommendationType recommendationType) { + this.recommendationType = recommendationType; + return this; + } + + /** + * Get recommendationType + * + * @return recommendationType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RECOMMENDATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RecommendationType getRecommendationType() { + return recommendationType; + } + + @JsonProperty(JSON_PROPERTY_RECOMMENDATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecommendationType(@org.eclipse.jdt.annotation.NonNull RecommendationType recommendationType) { + this.recommendationType = recommendationType; + } + + public RecommendationDto baselineItemName(@org.eclipse.jdt.annotation.NonNull String baselineItemName) { + this.baselineItemName = baselineItemName; + return this; + } + + /** + * Get baselineItemName + * + * @return baselineItemName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BASELINE_ITEM_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaselineItemName() { + return baselineItemName; + } + + @JsonProperty(JSON_PROPERTY_BASELINE_ITEM_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBaselineItemName(@org.eclipse.jdt.annotation.NonNull String baselineItemName) { + this.baselineItemName = baselineItemName; + } + + public RecommendationDto categoryId(@org.eclipse.jdt.annotation.NonNull UUID categoryId) { + this.categoryId = categoryId; + return this; + } + + /** + * Get categoryId + * + * @return categoryId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CATEGORY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getCategoryId() { + return categoryId; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategoryId(@org.eclipse.jdt.annotation.NonNull UUID categoryId) { + this.categoryId = categoryId; + } + + /** + * Return true if this RecommendationDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecommendationDto recommendationDto = (RecommendationDto) o; + return Objects.equals(this.items, recommendationDto.items) + && Objects.equals(this.recommendationType, recommendationDto.recommendationType) + && Objects.equals(this.baselineItemName, recommendationDto.baselineItemName) + && Objects.equals(this.categoryId, recommendationDto.categoryId); + } + + @Override + public int hashCode() { + return Objects.hash(items, recommendationType, baselineItemName, categoryId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecommendationDto {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" recommendationType: ").append(toIndentedString(recommendationType)).append("\n"); + sb.append(" baselineItemName: ").append(toIndentedString(baselineItemName)).append("\n"); + sb.append(" categoryId: ").append(toIndentedString(categoryId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `RecommendationType` to the URL query string + if (getRecommendationType() != null) { + joiner.add(String.format("%sRecommendationType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRecommendationType())))); + } + + // add `BaselineItemName` to the URL query string + if (getBaselineItemName() != null) { + joiner.add(String.format("%sBaselineItemName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBaselineItemName())))); + } + + // add `CategoryId` to the URL query string + if (getCategoryId() != null) { + joiner.add(String.format("%sCategoryId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCategoryId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private RecommendationDto instance; + + public Builder() { + this(new RecommendationDto()); + } + + protected Builder(RecommendationDto instance) { + this.instance = instance; + } + + public RecommendationDto.Builder items(List items) { + this.instance.items = items; + return this; + } + + public RecommendationDto.Builder recommendationType(RecommendationType recommendationType) { + this.instance.recommendationType = recommendationType; + return this; + } + + public RecommendationDto.Builder baselineItemName(String baselineItemName) { + this.instance.baselineItemName = baselineItemName; + return this; + } + + public RecommendationDto.Builder categoryId(UUID categoryId) { + this.instance.categoryId = categoryId; + return this; + } + + /** + * returns a built RecommendationDto instance. + * + * The builder is not reusable. + */ + public RecommendationDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RecommendationDto.Builder builder() { + return new RecommendationDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RecommendationDto.Builder toBuilder() { + return new RecommendationDto.Builder().items(getItems()).recommendationType(getRecommendationType()) + .baselineItemName(getBaselineItemName()).categoryId(getCategoryId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RecommendationType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RecommendationType.java new file mode 100644 index 0000000000000..7237ab058095e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RecommendationType.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets RecommendationType + */ +public enum RecommendationType { + + SIMILAR_TO_RECENTLY_PLAYED("SimilarToRecentlyPlayed"), + + SIMILAR_TO_LIKED_ITEM("SimilarToLikedItem"), + + HAS_DIRECTOR_FROM_RECENTLY_PLAYED("HasDirectorFromRecentlyPlayed"), + + HAS_ACTOR_FROM_RECENTLY_PLAYED("HasActorFromRecentlyPlayed"), + + HAS_LIKED_DIRECTOR("HasLikedDirector"), + + HAS_LIKED_ACTOR("HasLikedActor"); + + private String value; + + RecommendationType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static RecommendationType fromValue(String value) { + for (RecommendationType b : RecommendationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RecordingStatus.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RecordingStatus.java new file mode 100644 index 0000000000000..7e3f1de731224 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RecordingStatus.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets RecordingStatus + */ +public enum RecordingStatus { + + NEW("New"), + + IN_PROGRESS("InProgress"), + + COMPLETED("Completed"), + + CANCELLED("Cancelled"), + + CONFLICTED_OK("ConflictedOk"), + + CONFLICTED_NOT_OK("ConflictedNotOk"), + + ERROR("Error"); + + private String value; + + RecordingStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static RecordingStatus fromValue(String value) { + for (RecordingStatus b : RecordingStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RefreshProgressMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RefreshProgressMessage.java new file mode 100644 index 0000000000000..64cd752d617b8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RefreshProgressMessage.java @@ -0,0 +1,284 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Refresh progress message. + */ +@JsonPropertyOrder({ RefreshProgressMessage.JSON_PROPERTY_DATA, RefreshProgressMessage.JSON_PROPERTY_MESSAGE_ID, + RefreshProgressMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RefreshProgressMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private Map data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.REFRESH_PROGRESS; + + public RefreshProgressMessage() { + } + + @JsonCreator + public RefreshProgressMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public RefreshProgressMessage data(@org.eclipse.jdt.annotation.NonNull Map data) { + this.data = data; + return this; + } + + public RefreshProgressMessage putDataItem(String key, String dataItem) { + if (this.data == null) { + this.data = new HashMap<>(); + } + this.data.put(key, dataItem); + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull Map data) { + this.data = data; + } + + public RefreshProgressMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this RefreshProgressMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RefreshProgressMessage refreshProgressMessage = (RefreshProgressMessage) o; + return Objects.equals(this.data, refreshProgressMessage.data) + && Objects.equals(this.messageId, refreshProgressMessage.messageId) + && Objects.equals(this.messageType, refreshProgressMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RefreshProgressMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + for (String _key : getData().keySet()) { + joiner.add(String.format("%sData%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getData().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getData().get(_key))))); + } + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private RefreshProgressMessage instance; + + public Builder() { + this(new RefreshProgressMessage()); + } + + protected Builder(RefreshProgressMessage instance) { + this.instance = instance; + } + + public RefreshProgressMessage.Builder data(Map data) { + this.instance.data = data; + return this; + } + + public RefreshProgressMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public RefreshProgressMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built RefreshProgressMessage instance. + * + * The builder is not reusable. + */ + public RefreshProgressMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RefreshProgressMessage.Builder builder() { + return new RefreshProgressMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RefreshProgressMessage.Builder toBuilder() { + return new RefreshProgressMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteImageInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteImageInfo.java new file mode 100644 index 0000000000000..4236428c8d030 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteImageInfo.java @@ -0,0 +1,560 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class RemoteImageInfo. + */ +@JsonPropertyOrder({ RemoteImageInfo.JSON_PROPERTY_PROVIDER_NAME, RemoteImageInfo.JSON_PROPERTY_URL, + RemoteImageInfo.JSON_PROPERTY_THUMBNAIL_URL, RemoteImageInfo.JSON_PROPERTY_HEIGHT, + RemoteImageInfo.JSON_PROPERTY_WIDTH, RemoteImageInfo.JSON_PROPERTY_COMMUNITY_RATING, + RemoteImageInfo.JSON_PROPERTY_VOTE_COUNT, RemoteImageInfo.JSON_PROPERTY_LANGUAGE, + RemoteImageInfo.JSON_PROPERTY_TYPE, RemoteImageInfo.JSON_PROPERTY_RATING_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RemoteImageInfo { + public static final String JSON_PROPERTY_PROVIDER_NAME = "ProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String providerName; + + public static final String JSON_PROPERTY_URL = "Url"; + @org.eclipse.jdt.annotation.NonNull + private String url; + + public static final String JSON_PROPERTY_THUMBNAIL_URL = "ThumbnailUrl"; + @org.eclipse.jdt.annotation.NonNull + private String thumbnailUrl; + + public static final String JSON_PROPERTY_HEIGHT = "Height"; + @org.eclipse.jdt.annotation.NonNull + private Integer height; + + public static final String JSON_PROPERTY_WIDTH = "Width"; + @org.eclipse.jdt.annotation.NonNull + private Integer width; + + public static final String JSON_PROPERTY_COMMUNITY_RATING = "CommunityRating"; + @org.eclipse.jdt.annotation.NonNull + private Double communityRating; + + public static final String JSON_PROPERTY_VOTE_COUNT = "VoteCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer voteCount; + + public static final String JSON_PROPERTY_LANGUAGE = "Language"; + @org.eclipse.jdt.annotation.NonNull + private String language; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private ImageType type; + + public static final String JSON_PROPERTY_RATING_TYPE = "RatingType"; + @org.eclipse.jdt.annotation.NonNull + private RatingType ratingType; + + public RemoteImageInfo() { + } + + public RemoteImageInfo providerName(@org.eclipse.jdt.annotation.NonNull String providerName) { + this.providerName = providerName; + return this; + } + + /** + * Gets or sets the name of the provider. + * + * @return providerName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProviderName() { + return providerName; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderName(@org.eclipse.jdt.annotation.NonNull String providerName) { + this.providerName = providerName; + } + + public RemoteImageInfo url(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + return this; + } + + /** + * Gets or sets the URL. + * + * @return url + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + } + + public RemoteImageInfo thumbnailUrl(@org.eclipse.jdt.annotation.NonNull String thumbnailUrl) { + this.thumbnailUrl = thumbnailUrl; + return this; + } + + /** + * Gets or sets a url used for previewing a smaller version. + * + * @return thumbnailUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THUMBNAIL_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getThumbnailUrl() { + return thumbnailUrl; + } + + @JsonProperty(JSON_PROPERTY_THUMBNAIL_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThumbnailUrl(@org.eclipse.jdt.annotation.NonNull String thumbnailUrl) { + this.thumbnailUrl = thumbnailUrl; + } + + public RemoteImageInfo height(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + return this; + } + + /** + * Gets or sets the height. + * + * @return height + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHeight() { + return height; + } + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + } + + public RemoteImageInfo width(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + return this; + } + + /** + * Gets or sets the width. + * + * @return width + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + } + + public RemoteImageInfo communityRating(@org.eclipse.jdt.annotation.NonNull Double communityRating) { + this.communityRating = communityRating; + return this; + } + + /** + * Gets or sets the community rating. + * + * @return communityRating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMMUNITY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getCommunityRating() { + return communityRating; + } + + @JsonProperty(JSON_PROPERTY_COMMUNITY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCommunityRating(@org.eclipse.jdt.annotation.NonNull Double communityRating) { + this.communityRating = communityRating; + } + + public RemoteImageInfo voteCount(@org.eclipse.jdt.annotation.NonNull Integer voteCount) { + this.voteCount = voteCount; + return this; + } + + /** + * Gets or sets the vote count. + * + * @return voteCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VOTE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getVoteCount() { + return voteCount; + } + + @JsonProperty(JSON_PROPERTY_VOTE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVoteCount(@org.eclipse.jdt.annotation.NonNull Integer voteCount) { + this.voteCount = voteCount; + } + + public RemoteImageInfo language(@org.eclipse.jdt.annotation.NonNull String language) { + this.language = language; + return this; + } + + /** + * Gets or sets the language. + * + * @return language + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLanguage() { + return language; + } + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLanguage(@org.eclipse.jdt.annotation.NonNull String language) { + this.language = language; + } + + public RemoteImageInfo type(@org.eclipse.jdt.annotation.NonNull ImageType type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ImageType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull ImageType type) { + this.type = type; + } + + public RemoteImageInfo ratingType(@org.eclipse.jdt.annotation.NonNull RatingType ratingType) { + this.ratingType = ratingType; + return this; + } + + /** + * Gets or sets the type of the rating. + * + * @return ratingType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RATING_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RatingType getRatingType() { + return ratingType; + } + + @JsonProperty(JSON_PROPERTY_RATING_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRatingType(@org.eclipse.jdt.annotation.NonNull RatingType ratingType) { + this.ratingType = ratingType; + } + + /** + * Return true if this RemoteImageInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoteImageInfo remoteImageInfo = (RemoteImageInfo) o; + return Objects.equals(this.providerName, remoteImageInfo.providerName) + && Objects.equals(this.url, remoteImageInfo.url) + && Objects.equals(this.thumbnailUrl, remoteImageInfo.thumbnailUrl) + && Objects.equals(this.height, remoteImageInfo.height) + && Objects.equals(this.width, remoteImageInfo.width) + && Objects.equals(this.communityRating, remoteImageInfo.communityRating) + && Objects.equals(this.voteCount, remoteImageInfo.voteCount) + && Objects.equals(this.language, remoteImageInfo.language) + && Objects.equals(this.type, remoteImageInfo.type) + && Objects.equals(this.ratingType, remoteImageInfo.ratingType); + } + + @Override + public int hashCode() { + return Objects.hash(providerName, url, thumbnailUrl, height, width, communityRating, voteCount, language, type, + ratingType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoteImageInfo {\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" thumbnailUrl: ").append(toIndentedString(thumbnailUrl)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" communityRating: ").append(toIndentedString(communityRating)).append("\n"); + sb.append(" voteCount: ").append(toIndentedString(voteCount)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ratingType: ").append(toIndentedString(ratingType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ProviderName` to the URL query string + if (getProviderName() != null) { + joiner.add(String.format("%sProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProviderName())))); + } + + // add `Url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format("%sUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + // add `ThumbnailUrl` to the URL query string + if (getThumbnailUrl() != null) { + joiner.add(String.format("%sThumbnailUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getThumbnailUrl())))); + } + + // add `Height` to the URL query string + if (getHeight() != null) { + joiner.add(String.format("%sHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHeight())))); + } + + // add `Width` to the URL query string + if (getWidth() != null) { + joiner.add(String.format("%sWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWidth())))); + } + + // add `CommunityRating` to the URL query string + if (getCommunityRating() != null) { + joiner.add(String.format("%sCommunityRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCommunityRating())))); + } + + // add `VoteCount` to the URL query string + if (getVoteCount() != null) { + joiner.add(String.format("%sVoteCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVoteCount())))); + } + + // add `Language` to the URL query string + if (getLanguage() != null) { + joiner.add(String.format("%sLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLanguage())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `RatingType` to the URL query string + if (getRatingType() != null) { + joiner.add(String.format("%sRatingType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRatingType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private RemoteImageInfo instance; + + public Builder() { + this(new RemoteImageInfo()); + } + + protected Builder(RemoteImageInfo instance) { + this.instance = instance; + } + + public RemoteImageInfo.Builder providerName(String providerName) { + this.instance.providerName = providerName; + return this; + } + + public RemoteImageInfo.Builder url(String url) { + this.instance.url = url; + return this; + } + + public RemoteImageInfo.Builder thumbnailUrl(String thumbnailUrl) { + this.instance.thumbnailUrl = thumbnailUrl; + return this; + } + + public RemoteImageInfo.Builder height(Integer height) { + this.instance.height = height; + return this; + } + + public RemoteImageInfo.Builder width(Integer width) { + this.instance.width = width; + return this; + } + + public RemoteImageInfo.Builder communityRating(Double communityRating) { + this.instance.communityRating = communityRating; + return this; + } + + public RemoteImageInfo.Builder voteCount(Integer voteCount) { + this.instance.voteCount = voteCount; + return this; + } + + public RemoteImageInfo.Builder language(String language) { + this.instance.language = language; + return this; + } + + public RemoteImageInfo.Builder type(ImageType type) { + this.instance.type = type; + return this; + } + + public RemoteImageInfo.Builder ratingType(RatingType ratingType) { + this.instance.ratingType = ratingType; + return this; + } + + /** + * returns a built RemoteImageInfo instance. + * + * The builder is not reusable. + */ + public RemoteImageInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RemoteImageInfo.Builder builder() { + return new RemoteImageInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RemoteImageInfo.Builder toBuilder() { + return new RemoteImageInfo.Builder().providerName(getProviderName()).url(getUrl()) + .thumbnailUrl(getThumbnailUrl()).height(getHeight()).width(getWidth()) + .communityRating(getCommunityRating()).voteCount(getVoteCount()).language(getLanguage()).type(getType()) + .ratingType(getRatingType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteImageResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteImageResult.java new file mode 100644 index 0000000000000..728a4abe89ef6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteImageResult.java @@ -0,0 +1,299 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class RemoteImageResult. + */ +@JsonPropertyOrder({ RemoteImageResult.JSON_PROPERTY_IMAGES, RemoteImageResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, + RemoteImageResult.JSON_PROPERTY_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RemoteImageResult { + public static final String JSON_PROPERTY_IMAGES = "Images"; + @org.eclipse.jdt.annotation.NonNull + private List images; + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_PROVIDERS = "Providers"; + @org.eclipse.jdt.annotation.NonNull + private List providers; + + public RemoteImageResult() { + } + + public RemoteImageResult images(@org.eclipse.jdt.annotation.NonNull List images) { + this.images = images; + return this; + } + + public RemoteImageResult addImagesItem(RemoteImageInfo imagesItem) { + if (this.images == null) { + this.images = new ArrayList<>(); + } + this.images.add(imagesItem); + return this; + } + + /** + * Gets or sets the images. + * + * @return images + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getImages() { + return images; + } + + @JsonProperty(JSON_PROPERTY_IMAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImages(@org.eclipse.jdt.annotation.NonNull List images) { + this.images = images; + } + + public RemoteImageResult totalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total record count. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public RemoteImageResult providers(@org.eclipse.jdt.annotation.NonNull List providers) { + this.providers = providers; + return this; + } + + public RemoteImageResult addProvidersItem(String providersItem) { + if (this.providers == null) { + this.providers = new ArrayList<>(); + } + this.providers.add(providersItem); + return this; + } + + /** + * Gets or sets the providers. + * + * @return providers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getProviders() { + return providers; + } + + @JsonProperty(JSON_PROPERTY_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviders(@org.eclipse.jdt.annotation.NonNull List providers) { + this.providers = providers; + } + + /** + * Return true if this RemoteImageResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoteImageResult remoteImageResult = (RemoteImageResult) o; + return Objects.equals(this.images, remoteImageResult.images) + && Objects.equals(this.totalRecordCount, remoteImageResult.totalRecordCount) + && Objects.equals(this.providers, remoteImageResult.providers); + } + + @Override + public int hashCode() { + return Objects.hash(images, totalRecordCount, providers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoteImageResult {\n"); + sb.append(" images: ").append(toIndentedString(images)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" providers: ").append(toIndentedString(providers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Images` to the URL query string + if (getImages() != null) { + for (int i = 0; i < getImages().size(); i++) { + if (getImages().get(i) != null) { + joiner.add(getImages().get(i).toUrlQueryString(String.format("%sImages%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `Providers` to the URL query string + if (getProviders() != null) { + for (int i = 0; i < getProviders().size(); i++) { + joiner.add(String.format("%sProviders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getProviders().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private RemoteImageResult instance; + + public Builder() { + this(new RemoteImageResult()); + } + + protected Builder(RemoteImageResult instance) { + this.instance = instance; + } + + public RemoteImageResult.Builder images(List images) { + this.instance.images = images; + return this; + } + + public RemoteImageResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public RemoteImageResult.Builder providers(List providers) { + this.instance.providers = providers; + return this; + } + + /** + * returns a built RemoteImageResult instance. + * + * The builder is not reusable. + */ + public RemoteImageResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RemoteImageResult.Builder builder() { + return new RemoteImageResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RemoteImageResult.Builder toBuilder() { + return new RemoteImageResult.Builder().images(getImages()).totalRecordCount(getTotalRecordCount()) + .providers(getProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteLyricInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteLyricInfoDto.java new file mode 100644 index 0000000000000..e58b99b6503f6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteLyricInfoDto.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The remote lyric info dto. + */ +@JsonPropertyOrder({ RemoteLyricInfoDto.JSON_PROPERTY_ID, RemoteLyricInfoDto.JSON_PROPERTY_PROVIDER_NAME, + RemoteLyricInfoDto.JSON_PROPERTY_LYRICS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RemoteLyricInfoDto { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_PROVIDER_NAME = "ProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String providerName; + + public static final String JSON_PROPERTY_LYRICS = "Lyrics"; + @org.eclipse.jdt.annotation.NonNull + private LyricDto lyrics; + + public RemoteLyricInfoDto() { + } + + public RemoteLyricInfoDto id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id for the lyric. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public RemoteLyricInfoDto providerName(@org.eclipse.jdt.annotation.NonNull String providerName) { + this.providerName = providerName; + return this; + } + + /** + * Gets the provider name. + * + * @return providerName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProviderName() { + return providerName; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderName(@org.eclipse.jdt.annotation.NonNull String providerName) { + this.providerName = providerName; + } + + public RemoteLyricInfoDto lyrics(@org.eclipse.jdt.annotation.NonNull LyricDto lyrics) { + this.lyrics = lyrics; + return this; + } + + /** + * Gets the lyrics. + * + * @return lyrics + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LYRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LyricDto getLyrics() { + return lyrics; + } + + @JsonProperty(JSON_PROPERTY_LYRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLyrics(@org.eclipse.jdt.annotation.NonNull LyricDto lyrics) { + this.lyrics = lyrics; + } + + /** + * Return true if this RemoteLyricInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoteLyricInfoDto remoteLyricInfoDto = (RemoteLyricInfoDto) o; + return Objects.equals(this.id, remoteLyricInfoDto.id) + && Objects.equals(this.providerName, remoteLyricInfoDto.providerName) + && Objects.equals(this.lyrics, remoteLyricInfoDto.lyrics); + } + + @Override + public int hashCode() { + return Objects.hash(id, providerName, lyrics); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoteLyricInfoDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append(" lyrics: ").append(toIndentedString(lyrics)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `ProviderName` to the URL query string + if (getProviderName() != null) { + joiner.add(String.format("%sProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProviderName())))); + } + + // add `Lyrics` to the URL query string + if (getLyrics() != null) { + joiner.add(getLyrics().toUrlQueryString(prefix + "Lyrics" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private RemoteLyricInfoDto instance; + + public Builder() { + this(new RemoteLyricInfoDto()); + } + + protected Builder(RemoteLyricInfoDto instance) { + this.instance = instance; + } + + public RemoteLyricInfoDto.Builder id(String id) { + this.instance.id = id; + return this; + } + + public RemoteLyricInfoDto.Builder providerName(String providerName) { + this.instance.providerName = providerName; + return this; + } + + public RemoteLyricInfoDto.Builder lyrics(LyricDto lyrics) { + this.instance.lyrics = lyrics; + return this; + } + + /** + * returns a built RemoteLyricInfoDto instance. + * + * The builder is not reusable. + */ + public RemoteLyricInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RemoteLyricInfoDto.Builder builder() { + return new RemoteLyricInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RemoteLyricInfoDto.Builder toBuilder() { + return new RemoteLyricInfoDto.Builder().id(getId()).providerName(getProviderName()).lyrics(getLyrics()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteSearchResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteSearchResult.java new file mode 100644 index 0000000000000..b0fc75786d826 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteSearchResult.java @@ -0,0 +1,670 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * RemoteSearchResult + */ +@JsonPropertyOrder({ RemoteSearchResult.JSON_PROPERTY_NAME, RemoteSearchResult.JSON_PROPERTY_PROVIDER_IDS, + RemoteSearchResult.JSON_PROPERTY_PRODUCTION_YEAR, RemoteSearchResult.JSON_PROPERTY_INDEX_NUMBER, + RemoteSearchResult.JSON_PROPERTY_INDEX_NUMBER_END, RemoteSearchResult.JSON_PROPERTY_PARENT_INDEX_NUMBER, + RemoteSearchResult.JSON_PROPERTY_PREMIERE_DATE, RemoteSearchResult.JSON_PROPERTY_IMAGE_URL, + RemoteSearchResult.JSON_PROPERTY_SEARCH_PROVIDER_NAME, RemoteSearchResult.JSON_PROPERTY_OVERVIEW, + RemoteSearchResult.JSON_PROPERTY_ALBUM_ARTIST, RemoteSearchResult.JSON_PROPERTY_ARTISTS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RemoteSearchResult { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_PRODUCTION_YEAR = "ProductionYear"; + @org.eclipse.jdt.annotation.NonNull + private Integer productionYear; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_INDEX_NUMBER_END = "IndexNumberEnd"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumberEnd; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IMAGE_URL = "ImageUrl"; + @org.eclipse.jdt.annotation.NonNull + private String imageUrl; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_OVERVIEW = "Overview"; + @org.eclipse.jdt.annotation.NonNull + private String overview; + + public static final String JSON_PROPERTY_ALBUM_ARTIST = "AlbumArtist"; + @org.eclipse.jdt.annotation.NonNull + private RemoteSearchResult albumArtist; + + public static final String JSON_PROPERTY_ARTISTS = "Artists"; + @org.eclipse.jdt.annotation.NonNull + private List artists; + + public RemoteSearchResult() { + } + + public RemoteSearchResult name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public RemoteSearchResult providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public RemoteSearchResult putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public RemoteSearchResult productionYear(@org.eclipse.jdt.annotation.NonNull Integer productionYear) { + this.productionYear = productionYear; + return this; + } + + /** + * Gets or sets the year. + * + * @return productionYear + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRODUCTION_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getProductionYear() { + return productionYear; + } + + @JsonProperty(JSON_PROPERTY_PRODUCTION_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProductionYear(@org.eclipse.jdt.annotation.NonNull Integer productionYear) { + this.productionYear = productionYear; + } + + public RemoteSearchResult indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public RemoteSearchResult indexNumberEnd(@org.eclipse.jdt.annotation.NonNull Integer indexNumberEnd) { + this.indexNumberEnd = indexNumberEnd; + return this; + } + + /** + * Get indexNumberEnd + * + * @return indexNumberEnd + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER_END) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumberEnd() { + return indexNumberEnd; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER_END) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumberEnd(@org.eclipse.jdt.annotation.NonNull Integer indexNumberEnd) { + this.indexNumberEnd = indexNumberEnd; + } + + public RemoteSearchResult parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public RemoteSearchResult premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public RemoteSearchResult imageUrl(@org.eclipse.jdt.annotation.NonNull String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * + * @return imageUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getImageUrl() { + return imageUrl; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageUrl(@org.eclipse.jdt.annotation.NonNull String imageUrl) { + this.imageUrl = imageUrl; + } + + public RemoteSearchResult searchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Get searchProviderName + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public RemoteSearchResult overview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + return this; + } + + /** + * Get overview + * + * @return overview + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOverview() { + return overview; + } + + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOverview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + } + + public RemoteSearchResult albumArtist(@org.eclipse.jdt.annotation.NonNull RemoteSearchResult albumArtist) { + this.albumArtist = albumArtist; + return this; + } + + /** + * Get albumArtist + * + * @return albumArtist + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ARTIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RemoteSearchResult getAlbumArtist() { + return albumArtist; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ARTIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumArtist(@org.eclipse.jdt.annotation.NonNull RemoteSearchResult albumArtist) { + this.albumArtist = albumArtist; + } + + public RemoteSearchResult artists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + return this; + } + + public RemoteSearchResult addArtistsItem(RemoteSearchResult artistsItem) { + if (this.artists == null) { + this.artists = new ArrayList<>(); + } + this.artists.add(artistsItem); + return this; + } + + /** + * Get artists + * + * @return artists + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArtists() { + return artists; + } + + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + } + + /** + * Return true if this RemoteSearchResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoteSearchResult remoteSearchResult = (RemoteSearchResult) o; + return Objects.equals(this.name, remoteSearchResult.name) + && Objects.equals(this.providerIds, remoteSearchResult.providerIds) + && Objects.equals(this.productionYear, remoteSearchResult.productionYear) + && Objects.equals(this.indexNumber, remoteSearchResult.indexNumber) + && Objects.equals(this.indexNumberEnd, remoteSearchResult.indexNumberEnd) + && Objects.equals(this.parentIndexNumber, remoteSearchResult.parentIndexNumber) + && Objects.equals(this.premiereDate, remoteSearchResult.premiereDate) + && Objects.equals(this.imageUrl, remoteSearchResult.imageUrl) + && Objects.equals(this.searchProviderName, remoteSearchResult.searchProviderName) + && Objects.equals(this.overview, remoteSearchResult.overview) + && Objects.equals(this.albumArtist, remoteSearchResult.albumArtist) + && Objects.equals(this.artists, remoteSearchResult.artists); + } + + @Override + public int hashCode() { + return Objects.hash(name, providerIds, productionYear, indexNumber, indexNumberEnd, parentIndexNumber, + premiereDate, imageUrl, searchProviderName, overview, albumArtist, artists); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoteSearchResult {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" productionYear: ").append(toIndentedString(productionYear)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" indexNumberEnd: ").append(toIndentedString(indexNumberEnd)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" overview: ").append(toIndentedString(overview)).append("\n"); + sb.append(" albumArtist: ").append(toIndentedString(albumArtist)).append("\n"); + sb.append(" artists: ").append(toIndentedString(artists)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `ProductionYear` to the URL query string + if (getProductionYear() != null) { + joiner.add(String.format("%sProductionYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProductionYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `IndexNumberEnd` to the URL query string + if (getIndexNumberEnd() != null) { + joiner.add(String.format("%sIndexNumberEnd%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumberEnd())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `ImageUrl` to the URL query string + if (getImageUrl() != null) { + joiner.add(String.format("%sImageUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageUrl())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `Overview` to the URL query string + if (getOverview() != null) { + joiner.add(String.format("%sOverview%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOverview())))); + } + + // add `AlbumArtist` to the URL query string + if (getAlbumArtist() != null) { + joiner.add(getAlbumArtist().toUrlQueryString(prefix + "AlbumArtist" + suffix)); + } + + // add `Artists` to the URL query string + if (getArtists() != null) { + for (int i = 0; i < getArtists().size(); i++) { + if (getArtists().get(i) != null) { + joiner.add(getArtists().get(i).toUrlQueryString(String.format("%sArtists%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private RemoteSearchResult instance; + + public Builder() { + this(new RemoteSearchResult()); + } + + protected Builder(RemoteSearchResult instance) { + this.instance = instance; + } + + public RemoteSearchResult.Builder name(String name) { + this.instance.name = name; + return this; + } + + public RemoteSearchResult.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public RemoteSearchResult.Builder productionYear(Integer productionYear) { + this.instance.productionYear = productionYear; + return this; + } + + public RemoteSearchResult.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public RemoteSearchResult.Builder indexNumberEnd(Integer indexNumberEnd) { + this.instance.indexNumberEnd = indexNumberEnd; + return this; + } + + public RemoteSearchResult.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public RemoteSearchResult.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public RemoteSearchResult.Builder imageUrl(String imageUrl) { + this.instance.imageUrl = imageUrl; + return this; + } + + public RemoteSearchResult.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public RemoteSearchResult.Builder overview(String overview) { + this.instance.overview = overview; + return this; + } + + public RemoteSearchResult.Builder albumArtist(RemoteSearchResult albumArtist) { + this.instance.albumArtist = albumArtist; + return this; + } + + public RemoteSearchResult.Builder artists(List artists) { + this.instance.artists = artists; + return this; + } + + /** + * returns a built RemoteSearchResult instance. + * + * The builder is not reusable. + */ + public RemoteSearchResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RemoteSearchResult.Builder builder() { + return new RemoteSearchResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RemoteSearchResult.Builder toBuilder() { + return new RemoteSearchResult.Builder().name(getName()).providerIds(getProviderIds()) + .productionYear(getProductionYear()).indexNumber(getIndexNumber()).indexNumberEnd(getIndexNumberEnd()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()).imageUrl(getImageUrl()) + .searchProviderName(getSearchProviderName()).overview(getOverview()).albumArtist(getAlbumArtist()) + .artists(getArtists()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteSubtitleInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteSubtitleInfo.java new file mode 100644 index 0000000000000..bb31e6771857b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoteSubtitleInfo.java @@ -0,0 +1,809 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * RemoteSubtitleInfo + */ +@JsonPropertyOrder({ RemoteSubtitleInfo.JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME, + RemoteSubtitleInfo.JSON_PROPERTY_ID, RemoteSubtitleInfo.JSON_PROPERTY_PROVIDER_NAME, + RemoteSubtitleInfo.JSON_PROPERTY_NAME, RemoteSubtitleInfo.JSON_PROPERTY_FORMAT, + RemoteSubtitleInfo.JSON_PROPERTY_AUTHOR, RemoteSubtitleInfo.JSON_PROPERTY_COMMENT, + RemoteSubtitleInfo.JSON_PROPERTY_DATE_CREATED, RemoteSubtitleInfo.JSON_PROPERTY_COMMUNITY_RATING, + RemoteSubtitleInfo.JSON_PROPERTY_FRAME_RATE, RemoteSubtitleInfo.JSON_PROPERTY_DOWNLOAD_COUNT, + RemoteSubtitleInfo.JSON_PROPERTY_IS_HASH_MATCH, RemoteSubtitleInfo.JSON_PROPERTY_AI_TRANSLATED, + RemoteSubtitleInfo.JSON_PROPERTY_MACHINE_TRANSLATED, RemoteSubtitleInfo.JSON_PROPERTY_FORCED, + RemoteSubtitleInfo.JSON_PROPERTY_HEARING_IMPAIRED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RemoteSubtitleInfo { + public static final String JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME = "ThreeLetterISOLanguageName"; + @org.eclipse.jdt.annotation.NonNull + private String threeLetterISOLanguageName; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_PROVIDER_NAME = "ProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String providerName; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_FORMAT = "Format"; + @org.eclipse.jdt.annotation.NonNull + private String format; + + public static final String JSON_PROPERTY_AUTHOR = "Author"; + @org.eclipse.jdt.annotation.NonNull + private String author; + + public static final String JSON_PROPERTY_COMMENT = "Comment"; + @org.eclipse.jdt.annotation.NonNull + private String comment; + + public static final String JSON_PROPERTY_DATE_CREATED = "DateCreated"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateCreated; + + public static final String JSON_PROPERTY_COMMUNITY_RATING = "CommunityRating"; + @org.eclipse.jdt.annotation.NonNull + private Float communityRating; + + public static final String JSON_PROPERTY_FRAME_RATE = "FrameRate"; + @org.eclipse.jdt.annotation.NonNull + private Float frameRate; + + public static final String JSON_PROPERTY_DOWNLOAD_COUNT = "DownloadCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer downloadCount; + + public static final String JSON_PROPERTY_IS_HASH_MATCH = "IsHashMatch"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isHashMatch; + + public static final String JSON_PROPERTY_AI_TRANSLATED = "AiTranslated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean aiTranslated; + + public static final String JSON_PROPERTY_MACHINE_TRANSLATED = "MachineTranslated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean machineTranslated; + + public static final String JSON_PROPERTY_FORCED = "Forced"; + @org.eclipse.jdt.annotation.NonNull + private Boolean forced; + + public static final String JSON_PROPERTY_HEARING_IMPAIRED = "HearingImpaired"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hearingImpaired; + + public RemoteSubtitleInfo() { + } + + public RemoteSubtitleInfo threeLetterISOLanguageName( + @org.eclipse.jdt.annotation.NonNull String threeLetterISOLanguageName) { + this.threeLetterISOLanguageName = threeLetterISOLanguageName; + return this; + } + + /** + * Get threeLetterISOLanguageName + * + * @return threeLetterISOLanguageName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getThreeLetterISOLanguageName() { + return threeLetterISOLanguageName; + } + + @JsonProperty(JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThreeLetterISOLanguageName(@org.eclipse.jdt.annotation.NonNull String threeLetterISOLanguageName) { + this.threeLetterISOLanguageName = threeLetterISOLanguageName; + } + + public RemoteSubtitleInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public RemoteSubtitleInfo providerName(@org.eclipse.jdt.annotation.NonNull String providerName) { + this.providerName = providerName; + return this; + } + + /** + * Get providerName + * + * @return providerName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProviderName() { + return providerName; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderName(@org.eclipse.jdt.annotation.NonNull String providerName) { + this.providerName = providerName; + } + + public RemoteSubtitleInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public RemoteSubtitleInfo format(@org.eclipse.jdt.annotation.NonNull String format) { + this.format = format; + return this; + } + + /** + * Get format + * + * @return format + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFormat() { + return format; + } + + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormat(@org.eclipse.jdt.annotation.NonNull String format) { + this.format = format; + } + + public RemoteSubtitleInfo author(@org.eclipse.jdt.annotation.NonNull String author) { + this.author = author; + return this; + } + + /** + * Get author + * + * @return author + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTHOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthor() { + return author; + } + + @JsonProperty(JSON_PROPERTY_AUTHOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthor(@org.eclipse.jdt.annotation.NonNull String author) { + this.author = author; + } + + public RemoteSubtitleInfo comment(@org.eclipse.jdt.annotation.NonNull String comment) { + this.comment = comment; + return this; + } + + /** + * Get comment + * + * @return comment + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getComment() { + return comment; + } + + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComment(@org.eclipse.jdt.annotation.NonNull String comment) { + this.comment = comment; + } + + public RemoteSubtitleInfo dateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + return this; + } + + /** + * Get dateCreated + * + * @return dateCreated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateCreated() { + return dateCreated; + } + + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + } + + public RemoteSubtitleInfo communityRating(@org.eclipse.jdt.annotation.NonNull Float communityRating) { + this.communityRating = communityRating; + return this; + } + + /** + * Get communityRating + * + * @return communityRating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMMUNITY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getCommunityRating() { + return communityRating; + } + + @JsonProperty(JSON_PROPERTY_COMMUNITY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCommunityRating(@org.eclipse.jdt.annotation.NonNull Float communityRating) { + this.communityRating = communityRating; + } + + public RemoteSubtitleInfo frameRate(@org.eclipse.jdt.annotation.NonNull Float frameRate) { + this.frameRate = frameRate; + return this; + } + + /** + * Get frameRate + * + * @return frameRate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FRAME_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFrameRate() { + return frameRate; + } + + @JsonProperty(JSON_PROPERTY_FRAME_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFrameRate(@org.eclipse.jdt.annotation.NonNull Float frameRate) { + this.frameRate = frameRate; + } + + public RemoteSubtitleInfo downloadCount(@org.eclipse.jdt.annotation.NonNull Integer downloadCount) { + this.downloadCount = downloadCount; + return this; + } + + /** + * Get downloadCount + * + * @return downloadCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DOWNLOAD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDownloadCount() { + return downloadCount; + } + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadCount(@org.eclipse.jdt.annotation.NonNull Integer downloadCount) { + this.downloadCount = downloadCount; + } + + public RemoteSubtitleInfo isHashMatch(@org.eclipse.jdt.annotation.NonNull Boolean isHashMatch) { + this.isHashMatch = isHashMatch; + return this; + } + + /** + * Get isHashMatch + * + * @return isHashMatch + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_HASH_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsHashMatch() { + return isHashMatch; + } + + @JsonProperty(JSON_PROPERTY_IS_HASH_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsHashMatch(@org.eclipse.jdt.annotation.NonNull Boolean isHashMatch) { + this.isHashMatch = isHashMatch; + } + + public RemoteSubtitleInfo aiTranslated(@org.eclipse.jdt.annotation.NonNull Boolean aiTranslated) { + this.aiTranslated = aiTranslated; + return this; + } + + /** + * Get aiTranslated + * + * @return aiTranslated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AI_TRANSLATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAiTranslated() { + return aiTranslated; + } + + @JsonProperty(JSON_PROPERTY_AI_TRANSLATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAiTranslated(@org.eclipse.jdt.annotation.NonNull Boolean aiTranslated) { + this.aiTranslated = aiTranslated; + } + + public RemoteSubtitleInfo machineTranslated(@org.eclipse.jdt.annotation.NonNull Boolean machineTranslated) { + this.machineTranslated = machineTranslated; + return this; + } + + /** + * Get machineTranslated + * + * @return machineTranslated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MACHINE_TRANSLATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMachineTranslated() { + return machineTranslated; + } + + @JsonProperty(JSON_PROPERTY_MACHINE_TRANSLATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMachineTranslated(@org.eclipse.jdt.annotation.NonNull Boolean machineTranslated) { + this.machineTranslated = machineTranslated; + } + + public RemoteSubtitleInfo forced(@org.eclipse.jdt.annotation.NonNull Boolean forced) { + this.forced = forced; + return this; + } + + /** + * Get forced + * + * @return forced + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FORCED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForced() { + return forced; + } + + @JsonProperty(JSON_PROPERTY_FORCED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForced(@org.eclipse.jdt.annotation.NonNull Boolean forced) { + this.forced = forced; + } + + public RemoteSubtitleInfo hearingImpaired(@org.eclipse.jdt.annotation.NonNull Boolean hearingImpaired) { + this.hearingImpaired = hearingImpaired; + return this; + } + + /** + * Get hearingImpaired + * + * @return hearingImpaired + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEARING_IMPAIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHearingImpaired() { + return hearingImpaired; + } + + @JsonProperty(JSON_PROPERTY_HEARING_IMPAIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHearingImpaired(@org.eclipse.jdt.annotation.NonNull Boolean hearingImpaired) { + this.hearingImpaired = hearingImpaired; + } + + /** + * Return true if this RemoteSubtitleInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoteSubtitleInfo remoteSubtitleInfo = (RemoteSubtitleInfo) o; + return Objects.equals(this.threeLetterISOLanguageName, remoteSubtitleInfo.threeLetterISOLanguageName) + && Objects.equals(this.id, remoteSubtitleInfo.id) + && Objects.equals(this.providerName, remoteSubtitleInfo.providerName) + && Objects.equals(this.name, remoteSubtitleInfo.name) + && Objects.equals(this.format, remoteSubtitleInfo.format) + && Objects.equals(this.author, remoteSubtitleInfo.author) + && Objects.equals(this.comment, remoteSubtitleInfo.comment) + && Objects.equals(this.dateCreated, remoteSubtitleInfo.dateCreated) + && Objects.equals(this.communityRating, remoteSubtitleInfo.communityRating) + && Objects.equals(this.frameRate, remoteSubtitleInfo.frameRate) + && Objects.equals(this.downloadCount, remoteSubtitleInfo.downloadCount) + && Objects.equals(this.isHashMatch, remoteSubtitleInfo.isHashMatch) + && Objects.equals(this.aiTranslated, remoteSubtitleInfo.aiTranslated) + && Objects.equals(this.machineTranslated, remoteSubtitleInfo.machineTranslated) + && Objects.equals(this.forced, remoteSubtitleInfo.forced) + && Objects.equals(this.hearingImpaired, remoteSubtitleInfo.hearingImpaired); + } + + @Override + public int hashCode() { + return Objects.hash(threeLetterISOLanguageName, id, providerName, name, format, author, comment, dateCreated, + communityRating, frameRate, downloadCount, isHashMatch, aiTranslated, machineTranslated, forced, + hearingImpaired); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoteSubtitleInfo {\n"); + sb.append(" threeLetterISOLanguageName: ").append(toIndentedString(threeLetterISOLanguageName)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" author: ").append(toIndentedString(author)).append("\n"); + sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); + sb.append(" dateCreated: ").append(toIndentedString(dateCreated)).append("\n"); + sb.append(" communityRating: ").append(toIndentedString(communityRating)).append("\n"); + sb.append(" frameRate: ").append(toIndentedString(frameRate)).append("\n"); + sb.append(" downloadCount: ").append(toIndentedString(downloadCount)).append("\n"); + sb.append(" isHashMatch: ").append(toIndentedString(isHashMatch)).append("\n"); + sb.append(" aiTranslated: ").append(toIndentedString(aiTranslated)).append("\n"); + sb.append(" machineTranslated: ").append(toIndentedString(machineTranslated)).append("\n"); + sb.append(" forced: ").append(toIndentedString(forced)).append("\n"); + sb.append(" hearingImpaired: ").append(toIndentedString(hearingImpaired)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ThreeLetterISOLanguageName` to the URL query string + if (getThreeLetterISOLanguageName() != null) { + joiner.add(String.format("%sThreeLetterISOLanguageName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getThreeLetterISOLanguageName())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `ProviderName` to the URL query string + if (getProviderName() != null) { + joiner.add(String.format("%sProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProviderName())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Format` to the URL query string + if (getFormat() != null) { + joiner.add(String.format("%sFormat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFormat())))); + } + + // add `Author` to the URL query string + if (getAuthor() != null) { + joiner.add(String.format("%sAuthor%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAuthor())))); + } + + // add `Comment` to the URL query string + if (getComment() != null) { + joiner.add(String.format("%sComment%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getComment())))); + } + + // add `DateCreated` to the URL query string + if (getDateCreated() != null) { + joiner.add(String.format("%sDateCreated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateCreated())))); + } + + // add `CommunityRating` to the URL query string + if (getCommunityRating() != null) { + joiner.add(String.format("%sCommunityRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCommunityRating())))); + } + + // add `FrameRate` to the URL query string + if (getFrameRate() != null) { + joiner.add(String.format("%sFrameRate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFrameRate())))); + } + + // add `DownloadCount` to the URL query string + if (getDownloadCount() != null) { + joiner.add(String.format("%sDownloadCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDownloadCount())))); + } + + // add `IsHashMatch` to the URL query string + if (getIsHashMatch() != null) { + joiner.add(String.format("%sIsHashMatch%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsHashMatch())))); + } + + // add `AiTranslated` to the URL query string + if (getAiTranslated() != null) { + joiner.add(String.format("%sAiTranslated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAiTranslated())))); + } + + // add `MachineTranslated` to the URL query string + if (getMachineTranslated() != null) { + joiner.add(String.format("%sMachineTranslated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMachineTranslated())))); + } + + // add `Forced` to the URL query string + if (getForced() != null) { + joiner.add(String.format("%sForced%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getForced())))); + } + + // add `HearingImpaired` to the URL query string + if (getHearingImpaired() != null) { + joiner.add(String.format("%sHearingImpaired%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHearingImpaired())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private RemoteSubtitleInfo instance; + + public Builder() { + this(new RemoteSubtitleInfo()); + } + + protected Builder(RemoteSubtitleInfo instance) { + this.instance = instance; + } + + public RemoteSubtitleInfo.Builder threeLetterISOLanguageName(String threeLetterISOLanguageName) { + this.instance.threeLetterISOLanguageName = threeLetterISOLanguageName; + return this; + } + + public RemoteSubtitleInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public RemoteSubtitleInfo.Builder providerName(String providerName) { + this.instance.providerName = providerName; + return this; + } + + public RemoteSubtitleInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public RemoteSubtitleInfo.Builder format(String format) { + this.instance.format = format; + return this; + } + + public RemoteSubtitleInfo.Builder author(String author) { + this.instance.author = author; + return this; + } + + public RemoteSubtitleInfo.Builder comment(String comment) { + this.instance.comment = comment; + return this; + } + + public RemoteSubtitleInfo.Builder dateCreated(OffsetDateTime dateCreated) { + this.instance.dateCreated = dateCreated; + return this; + } + + public RemoteSubtitleInfo.Builder communityRating(Float communityRating) { + this.instance.communityRating = communityRating; + return this; + } + + public RemoteSubtitleInfo.Builder frameRate(Float frameRate) { + this.instance.frameRate = frameRate; + return this; + } + + public RemoteSubtitleInfo.Builder downloadCount(Integer downloadCount) { + this.instance.downloadCount = downloadCount; + return this; + } + + public RemoteSubtitleInfo.Builder isHashMatch(Boolean isHashMatch) { + this.instance.isHashMatch = isHashMatch; + return this; + } + + public RemoteSubtitleInfo.Builder aiTranslated(Boolean aiTranslated) { + this.instance.aiTranslated = aiTranslated; + return this; + } + + public RemoteSubtitleInfo.Builder machineTranslated(Boolean machineTranslated) { + this.instance.machineTranslated = machineTranslated; + return this; + } + + public RemoteSubtitleInfo.Builder forced(Boolean forced) { + this.instance.forced = forced; + return this; + } + + public RemoteSubtitleInfo.Builder hearingImpaired(Boolean hearingImpaired) { + this.instance.hearingImpaired = hearingImpaired; + return this; + } + + /** + * returns a built RemoteSubtitleInfo instance. + * + * The builder is not reusable. + */ + public RemoteSubtitleInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RemoteSubtitleInfo.Builder builder() { + return new RemoteSubtitleInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RemoteSubtitleInfo.Builder toBuilder() { + return new RemoteSubtitleInfo.Builder().threeLetterISOLanguageName(getThreeLetterISOLanguageName()).id(getId()) + .providerName(getProviderName()).name(getName()).format(getFormat()).author(getAuthor()) + .comment(getComment()).dateCreated(getDateCreated()).communityRating(getCommunityRating()) + .frameRate(getFrameRate()).downloadCount(getDownloadCount()).isHashMatch(getIsHashMatch()) + .aiTranslated(getAiTranslated()).machineTranslated(getMachineTranslated()).forced(getForced()) + .hearingImpaired(getHearingImpaired()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoveFromPlaylistRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoveFromPlaylistRequestDto.java new file mode 100644 index 0000000000000..c9e8f0c90cbea --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RemoveFromPlaylistRequestDto.java @@ -0,0 +1,293 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class RemoveFromPlaylistRequestDto. + */ +@JsonPropertyOrder({ RemoveFromPlaylistRequestDto.JSON_PROPERTY_PLAYLIST_ITEM_IDS, + RemoveFromPlaylistRequestDto.JSON_PROPERTY_CLEAR_PLAYLIST, + RemoveFromPlaylistRequestDto.JSON_PROPERTY_CLEAR_PLAYING_ITEM }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RemoveFromPlaylistRequestDto { + public static final String JSON_PROPERTY_PLAYLIST_ITEM_IDS = "PlaylistItemIds"; + @org.eclipse.jdt.annotation.NonNull + private List playlistItemIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_CLEAR_PLAYLIST = "ClearPlaylist"; + @org.eclipse.jdt.annotation.NonNull + private Boolean clearPlaylist; + + public static final String JSON_PROPERTY_CLEAR_PLAYING_ITEM = "ClearPlayingItem"; + @org.eclipse.jdt.annotation.NonNull + private Boolean clearPlayingItem; + + public RemoveFromPlaylistRequestDto() { + } + + public RemoveFromPlaylistRequestDto playlistItemIds( + @org.eclipse.jdt.annotation.NonNull List playlistItemIds) { + this.playlistItemIds = playlistItemIds; + return this; + } + + public RemoveFromPlaylistRequestDto addPlaylistItemIdsItem(UUID playlistItemIdsItem) { + if (this.playlistItemIds == null) { + this.playlistItemIds = new ArrayList<>(); + } + this.playlistItemIds.add(playlistItemIdsItem); + return this; + } + + /** + * Gets or sets the playlist identifiers of the items. Ignored when clearing the playlist. + * + * @return playlistItemIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPlaylistItemIds() { + return playlistItemIds; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemIds(@org.eclipse.jdt.annotation.NonNull List playlistItemIds) { + this.playlistItemIds = playlistItemIds; + } + + public RemoveFromPlaylistRequestDto clearPlaylist(@org.eclipse.jdt.annotation.NonNull Boolean clearPlaylist) { + this.clearPlaylist = clearPlaylist; + return this; + } + + /** + * Gets or sets a value indicating whether the entire playlist should be cleared. + * + * @return clearPlaylist + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CLEAR_PLAYLIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getClearPlaylist() { + return clearPlaylist; + } + + @JsonProperty(JSON_PROPERTY_CLEAR_PLAYLIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClearPlaylist(@org.eclipse.jdt.annotation.NonNull Boolean clearPlaylist) { + this.clearPlaylist = clearPlaylist; + } + + public RemoveFromPlaylistRequestDto clearPlayingItem(@org.eclipse.jdt.annotation.NonNull Boolean clearPlayingItem) { + this.clearPlayingItem = clearPlayingItem; + return this; + } + + /** + * Gets or sets a value indicating whether the playing item should be removed as well. Used only when clearing the + * playlist. + * + * @return clearPlayingItem + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CLEAR_PLAYING_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getClearPlayingItem() { + return clearPlayingItem; + } + + @JsonProperty(JSON_PROPERTY_CLEAR_PLAYING_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClearPlayingItem(@org.eclipse.jdt.annotation.NonNull Boolean clearPlayingItem) { + this.clearPlayingItem = clearPlayingItem; + } + + /** + * Return true if this RemoveFromPlaylistRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveFromPlaylistRequestDto removeFromPlaylistRequestDto = (RemoveFromPlaylistRequestDto) o; + return Objects.equals(this.playlistItemIds, removeFromPlaylistRequestDto.playlistItemIds) + && Objects.equals(this.clearPlaylist, removeFromPlaylistRequestDto.clearPlaylist) + && Objects.equals(this.clearPlayingItem, removeFromPlaylistRequestDto.clearPlayingItem); + } + + @Override + public int hashCode() { + return Objects.hash(playlistItemIds, clearPlaylist, clearPlayingItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveFromPlaylistRequestDto {\n"); + sb.append(" playlistItemIds: ").append(toIndentedString(playlistItemIds)).append("\n"); + sb.append(" clearPlaylist: ").append(toIndentedString(clearPlaylist)).append("\n"); + sb.append(" clearPlayingItem: ").append(toIndentedString(clearPlayingItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlaylistItemIds` to the URL query string + if (getPlaylistItemIds() != null) { + for (int i = 0; i < getPlaylistItemIds().size(); i++) { + if (getPlaylistItemIds().get(i) != null) { + joiner.add(String.format("%sPlaylistItemIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemIds().get(i))))); + } + } + } + + // add `ClearPlaylist` to the URL query string + if (getClearPlaylist() != null) { + joiner.add(String.format("%sClearPlaylist%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getClearPlaylist())))); + } + + // add `ClearPlayingItem` to the URL query string + if (getClearPlayingItem() != null) { + joiner.add(String.format("%sClearPlayingItem%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getClearPlayingItem())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private RemoveFromPlaylistRequestDto instance; + + public Builder() { + this(new RemoveFromPlaylistRequestDto()); + } + + protected Builder(RemoveFromPlaylistRequestDto instance) { + this.instance = instance; + } + + public RemoveFromPlaylistRequestDto.Builder playlistItemIds(List playlistItemIds) { + this.instance.playlistItemIds = playlistItemIds; + return this; + } + + public RemoveFromPlaylistRequestDto.Builder clearPlaylist(Boolean clearPlaylist) { + this.instance.clearPlaylist = clearPlaylist; + return this; + } + + public RemoveFromPlaylistRequestDto.Builder clearPlayingItem(Boolean clearPlayingItem) { + this.instance.clearPlayingItem = clearPlayingItem; + return this; + } + + /** + * returns a built RemoveFromPlaylistRequestDto instance. + * + * The builder is not reusable. + */ + public RemoveFromPlaylistRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RemoveFromPlaylistRequestDto.Builder builder() { + return new RemoveFromPlaylistRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RemoveFromPlaylistRequestDto.Builder toBuilder() { + return new RemoveFromPlaylistRequestDto.Builder().playlistItemIds(getPlaylistItemIds()) + .clearPlaylist(getClearPlaylist()).clearPlayingItem(getClearPlayingItem()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RepeatMode.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RepeatMode.java new file mode 100644 index 0000000000000..6064fedd72749 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RepeatMode.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets RepeatMode + */ +public enum RepeatMode { + + REPEAT_NONE("RepeatNone"), + + REPEAT_ALL("RepeatAll"), + + REPEAT_ONE("RepeatOne"); + + private String value; + + RepeatMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static RepeatMode fromValue(String value) { + for (RepeatMode b : RepeatMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RepositoryInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RepositoryInfo.java new file mode 100644 index 0000000000000..36bd8808d058a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RepositoryInfo.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class RepositoryInfo. + */ +@JsonPropertyOrder({ RepositoryInfo.JSON_PROPERTY_NAME, RepositoryInfo.JSON_PROPERTY_URL, + RepositoryInfo.JSON_PROPERTY_ENABLED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RepositoryInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_URL = "Url"; + @org.eclipse.jdt.annotation.NonNull + private String url; + + public static final String JSON_PROPERTY_ENABLED = "Enabled"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enabled; + + public RepositoryInfo() { + } + + public RepositoryInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public RepositoryInfo url(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + return this; + } + + /** + * Gets or sets the URL. + * + * @return url + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + } + + public RepositoryInfo enabled(@org.eclipse.jdt.annotation.NonNull Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Gets or sets a value indicating whether the repository is enabled. + * + * @return enabled + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabled(@org.eclipse.jdt.annotation.NonNull Boolean enabled) { + this.enabled = enabled; + } + + /** + * Return true if this RepositoryInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepositoryInfo repositoryInfo = (RepositoryInfo) o; + return Objects.equals(this.name, repositoryInfo.name) && Objects.equals(this.url, repositoryInfo.url) + && Objects.equals(this.enabled, repositoryInfo.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(name, url, enabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepositoryInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format("%sUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + // add `Enabled` to the URL query string + if (getEnabled() != null) { + joiner.add(String.format("%sEnabled%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnabled())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private RepositoryInfo instance; + + public Builder() { + this(new RepositoryInfo()); + } + + protected Builder(RepositoryInfo instance) { + this.instance = instance; + } + + public RepositoryInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public RepositoryInfo.Builder url(String url) { + this.instance.url = url; + return this; + } + + public RepositoryInfo.Builder enabled(Boolean enabled) { + this.instance.enabled = enabled; + return this; + } + + /** + * returns a built RepositoryInfo instance. + * + * The builder is not reusable. + */ + public RepositoryInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RepositoryInfo.Builder builder() { + return new RepositoryInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RepositoryInfo.Builder toBuilder() { + return new RepositoryInfo.Builder().name(getName()).url(getUrl()).enabled(getEnabled()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RestartRequiredMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RestartRequiredMessage.java new file mode 100644 index 0000000000000..d485fa61c0e11 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/RestartRequiredMessage.java @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Restart required. + */ +@JsonPropertyOrder({ RestartRequiredMessage.JSON_PROPERTY_MESSAGE_ID, + RestartRequiredMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RestartRequiredMessage { + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.RESTART_REQUIRED; + + public RestartRequiredMessage() { + } + + @JsonCreator + public RestartRequiredMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public RestartRequiredMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this RestartRequiredMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestartRequiredMessage restartRequiredMessage = (RestartRequiredMessage) o; + return Objects.equals(this.messageId, restartRequiredMessage.messageId) + && Objects.equals(this.messageType, restartRequiredMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestartRequiredMessage {\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private RestartRequiredMessage instance; + + public Builder() { + this(new RestartRequiredMessage()); + } + + protected Builder(RestartRequiredMessage instance) { + this.instance = instance; + } + + public RestartRequiredMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public RestartRequiredMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built RestartRequiredMessage instance. + * + * The builder is not reusable. + */ + public RestartRequiredMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RestartRequiredMessage.Builder builder() { + return new RestartRequiredMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RestartRequiredMessage.Builder toBuilder() { + return new RestartRequiredMessage.Builder().messageId(getMessageId()).messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScheduledTaskEndedMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScheduledTaskEndedMessage.java new file mode 100644 index 0000000000000..4e00a48df8f07 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScheduledTaskEndedMessage.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Scheduled task ended message. + */ +@JsonPropertyOrder({ ScheduledTaskEndedMessage.JSON_PROPERTY_DATA, ScheduledTaskEndedMessage.JSON_PROPERTY_MESSAGE_ID, + ScheduledTaskEndedMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ScheduledTaskEndedMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private TaskResult data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.SCHEDULED_TASK_ENDED; + + public ScheduledTaskEndedMessage() { + } + + @JsonCreator + public ScheduledTaskEndedMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public ScheduledTaskEndedMessage data(@org.eclipse.jdt.annotation.NonNull TaskResult data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TaskResult getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull TaskResult data) { + this.data = data; + } + + public ScheduledTaskEndedMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this ScheduledTaskEndedMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScheduledTaskEndedMessage scheduledTaskEndedMessage = (ScheduledTaskEndedMessage) o; + return Objects.equals(this.data, scheduledTaskEndedMessage.data) + && Objects.equals(this.messageId, scheduledTaskEndedMessage.messageId) + && Objects.equals(this.messageType, scheduledTaskEndedMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScheduledTaskEndedMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ScheduledTaskEndedMessage instance; + + public Builder() { + this(new ScheduledTaskEndedMessage()); + } + + protected Builder(ScheduledTaskEndedMessage instance) { + this.instance = instance; + } + + public ScheduledTaskEndedMessage.Builder data(TaskResult data) { + this.instance.data = data; + return this; + } + + public ScheduledTaskEndedMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public ScheduledTaskEndedMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built ScheduledTaskEndedMessage instance. + * + * The builder is not reusable. + */ + public ScheduledTaskEndedMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ScheduledTaskEndedMessage.Builder builder() { + return new ScheduledTaskEndedMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ScheduledTaskEndedMessage.Builder toBuilder() { + return new ScheduledTaskEndedMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScheduledTasksInfoMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScheduledTasksInfoMessage.java new file mode 100644 index 0000000000000..88d4a4e205e46 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScheduledTasksInfoMessage.java @@ -0,0 +1,285 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Scheduled tasks info message. + */ +@JsonPropertyOrder({ ScheduledTasksInfoMessage.JSON_PROPERTY_DATA, ScheduledTasksInfoMessage.JSON_PROPERTY_MESSAGE_ID, + ScheduledTasksInfoMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ScheduledTasksInfoMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private List data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.SCHEDULED_TASKS_INFO; + + public ScheduledTasksInfoMessage() { + } + + @JsonCreator + public ScheduledTasksInfoMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public ScheduledTasksInfoMessage data(@org.eclipse.jdt.annotation.NonNull List data) { + this.data = data; + return this; + } + + public ScheduledTasksInfoMessage addDataItem(TaskInfo dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull List data) { + this.data = data; + } + + public ScheduledTasksInfoMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this ScheduledTasksInfoMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScheduledTasksInfoMessage scheduledTasksInfoMessage = (ScheduledTasksInfoMessage) o; + return Objects.equals(this.data, scheduledTasksInfoMessage.data) + && Objects.equals(this.messageId, scheduledTasksInfoMessage.messageId) + && Objects.equals(this.messageType, scheduledTasksInfoMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScheduledTasksInfoMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + for (int i = 0; i < getData().size(); i++) { + if (getData().get(i) != null) { + joiner.add(getData().get(i).toUrlQueryString(String.format("%sData%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ScheduledTasksInfoMessage instance; + + public Builder() { + this(new ScheduledTasksInfoMessage()); + } + + protected Builder(ScheduledTasksInfoMessage instance) { + this.instance = instance; + } + + public ScheduledTasksInfoMessage.Builder data(List data) { + this.instance.data = data; + return this; + } + + public ScheduledTasksInfoMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public ScheduledTasksInfoMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built ScheduledTasksInfoMessage instance. + * + * The builder is not reusable. + */ + public ScheduledTasksInfoMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ScheduledTasksInfoMessage.Builder builder() { + return new ScheduledTasksInfoMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ScheduledTasksInfoMessage.Builder toBuilder() { + return new ScheduledTasksInfoMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScheduledTasksInfoStartMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScheduledTasksInfoStartMessage.java new file mode 100644 index 0000000000000..12859f84328ee --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScheduledTasksInfoStartMessage.java @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Scheduled tasks info start message. Data is the timing data encoded as \"$initialDelay,$interval\" in ms. + */ +@JsonPropertyOrder({ ScheduledTasksInfoStartMessage.JSON_PROPERTY_DATA, + ScheduledTasksInfoStartMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ScheduledTasksInfoStartMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private String data; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.SCHEDULED_TASKS_INFO_START; + + public ScheduledTasksInfoStartMessage() { + } + + @JsonCreator + public ScheduledTasksInfoStartMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public ScheduledTasksInfoStartMessage data(@org.eclipse.jdt.annotation.NonNull String data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull String data) { + this.data = data; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this ScheduledTasksInfoStartMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScheduledTasksInfoStartMessage scheduledTasksInfoStartMessage = (ScheduledTasksInfoStartMessage) o; + return Objects.equals(this.data, scheduledTasksInfoStartMessage.data) + && Objects.equals(this.messageType, scheduledTasksInfoStartMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScheduledTasksInfoStartMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(String.format("%sData%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getData())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ScheduledTasksInfoStartMessage instance; + + public Builder() { + this(new ScheduledTasksInfoStartMessage()); + } + + protected Builder(ScheduledTasksInfoStartMessage instance) { + this.instance = instance; + } + + public ScheduledTasksInfoStartMessage.Builder data(String data) { + this.instance.data = data; + return this; + } + + public ScheduledTasksInfoStartMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built ScheduledTasksInfoStartMessage instance. + * + * The builder is not reusable. + */ + public ScheduledTasksInfoStartMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ScheduledTasksInfoStartMessage.Builder builder() { + return new ScheduledTasksInfoStartMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ScheduledTasksInfoStartMessage.Builder toBuilder() { + return new ScheduledTasksInfoStartMessage.Builder().data(getData()).messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScheduledTasksInfoStopMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScheduledTasksInfoStopMessage.java new file mode 100644 index 0000000000000..bedf4a2b9ed28 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScheduledTasksInfoStopMessage.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Scheduled tasks info stop message. + */ +@JsonPropertyOrder({ ScheduledTasksInfoStopMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ScheduledTasksInfoStopMessage { + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.SCHEDULED_TASKS_INFO_STOP; + + public ScheduledTasksInfoStopMessage() { + } + + @JsonCreator + public ScheduledTasksInfoStopMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this ScheduledTasksInfoStopMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScheduledTasksInfoStopMessage scheduledTasksInfoStopMessage = (ScheduledTasksInfoStopMessage) o; + return Objects.equals(this.messageType, scheduledTasksInfoStopMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScheduledTasksInfoStopMessage {\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ScheduledTasksInfoStopMessage instance; + + public Builder() { + this(new ScheduledTasksInfoStopMessage()); + } + + protected Builder(ScheduledTasksInfoStopMessage instance) { + this.instance = instance; + } + + public ScheduledTasksInfoStopMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built ScheduledTasksInfoStopMessage instance. + * + * The builder is not reusable. + */ + public ScheduledTasksInfoStopMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ScheduledTasksInfoStopMessage.Builder builder() { + return new ScheduledTasksInfoStopMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ScheduledTasksInfoStopMessage.Builder toBuilder() { + return new ScheduledTasksInfoStopMessage.Builder().messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScrollDirection.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScrollDirection.java new file mode 100644 index 0000000000000..643361c66a1b9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ScrollDirection.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * An enum representing the axis that should be scrolled. + */ +public enum ScrollDirection { + + HORIZONTAL("Horizontal"), + + VERTICAL("Vertical"); + + private String value; + + ScrollDirection(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ScrollDirection fromValue(String value) { + for (ScrollDirection b : ScrollDirection.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SearchHint.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SearchHint.java new file mode 100644 index 0000000000000..2be14fe4a820b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SearchHint.java @@ -0,0 +1,1349 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SearchHintResult. + */ +@JsonPropertyOrder({ SearchHint.JSON_PROPERTY_ITEM_ID, SearchHint.JSON_PROPERTY_ID, SearchHint.JSON_PROPERTY_NAME, + SearchHint.JSON_PROPERTY_MATCHED_TERM, SearchHint.JSON_PROPERTY_INDEX_NUMBER, + SearchHint.JSON_PROPERTY_PRODUCTION_YEAR, SearchHint.JSON_PROPERTY_PARENT_INDEX_NUMBER, + SearchHint.JSON_PROPERTY_PRIMARY_IMAGE_TAG, SearchHint.JSON_PROPERTY_THUMB_IMAGE_TAG, + SearchHint.JSON_PROPERTY_THUMB_IMAGE_ITEM_ID, SearchHint.JSON_PROPERTY_BACKDROP_IMAGE_TAG, + SearchHint.JSON_PROPERTY_BACKDROP_IMAGE_ITEM_ID, SearchHint.JSON_PROPERTY_TYPE, + SearchHint.JSON_PROPERTY_IS_FOLDER, SearchHint.JSON_PROPERTY_RUN_TIME_TICKS, + SearchHint.JSON_PROPERTY_MEDIA_TYPE, SearchHint.JSON_PROPERTY_START_DATE, SearchHint.JSON_PROPERTY_END_DATE, + SearchHint.JSON_PROPERTY_SERIES, SearchHint.JSON_PROPERTY_STATUS, SearchHint.JSON_PROPERTY_ALBUM, + SearchHint.JSON_PROPERTY_ALBUM_ID, SearchHint.JSON_PROPERTY_ALBUM_ARTIST, SearchHint.JSON_PROPERTY_ARTISTS, + SearchHint.JSON_PROPERTY_SONG_COUNT, SearchHint.JSON_PROPERTY_EPISODE_COUNT, + SearchHint.JSON_PROPERTY_CHANNEL_ID, SearchHint.JSON_PROPERTY_CHANNEL_NAME, + SearchHint.JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SearchHint { + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_MATCHED_TERM = "MatchedTerm"; + @org.eclipse.jdt.annotation.NonNull + private String matchedTerm; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PRODUCTION_YEAR = "ProductionYear"; + @org.eclipse.jdt.annotation.NonNull + private Integer productionYear; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_TAG = "PrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String primaryImageTag; + + public static final String JSON_PROPERTY_THUMB_IMAGE_TAG = "ThumbImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String thumbImageTag; + + public static final String JSON_PROPERTY_THUMB_IMAGE_ITEM_ID = "ThumbImageItemId"; + @org.eclipse.jdt.annotation.NonNull + private String thumbImageItemId; + + public static final String JSON_PROPERTY_BACKDROP_IMAGE_TAG = "BackdropImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String backdropImageTag; + + public static final String JSON_PROPERTY_BACKDROP_IMAGE_ITEM_ID = "BackdropImageItemId"; + @org.eclipse.jdt.annotation.NonNull + private String backdropImageItemId; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemKind type; + + public static final String JSON_PROPERTY_IS_FOLDER = "IsFolder"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isFolder; + + public static final String JSON_PROPERTY_RUN_TIME_TICKS = "RunTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long runTimeTicks; + + public static final String JSON_PROPERTY_MEDIA_TYPE = "MediaType"; + @org.eclipse.jdt.annotation.NonNull + private MediaType mediaType = MediaType.UNKNOWN; + + public static final String JSON_PROPERTY_START_DATE = "StartDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime startDate; + + public static final String JSON_PROPERTY_END_DATE = "EndDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime endDate; + + public static final String JSON_PROPERTY_SERIES = "Series"; + @org.eclipse.jdt.annotation.NonNull + private String series; + + public static final String JSON_PROPERTY_STATUS = "Status"; + @org.eclipse.jdt.annotation.NonNull + private String status; + + public static final String JSON_PROPERTY_ALBUM = "Album"; + @org.eclipse.jdt.annotation.NonNull + private String album; + + public static final String JSON_PROPERTY_ALBUM_ID = "AlbumId"; + @org.eclipse.jdt.annotation.NonNull + private UUID albumId; + + public static final String JSON_PROPERTY_ALBUM_ARTIST = "AlbumArtist"; + @org.eclipse.jdt.annotation.NonNull + private String albumArtist; + + public static final String JSON_PROPERTY_ARTISTS = "Artists"; + @org.eclipse.jdt.annotation.NonNull + private List artists = new ArrayList<>(); + + public static final String JSON_PROPERTY_SONG_COUNT = "SongCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer songCount; + + public static final String JSON_PROPERTY_EPISODE_COUNT = "EpisodeCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer episodeCount; + + public static final String JSON_PROPERTY_CHANNEL_ID = "ChannelId"; + @org.eclipse.jdt.annotation.NonNull + private UUID channelId; + + public static final String JSON_PROPERTY_CHANNEL_NAME = "ChannelName"; + @org.eclipse.jdt.annotation.NonNull + private String channelName; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO = "PrimaryImageAspectRatio"; + @org.eclipse.jdt.annotation.NonNull + private Double primaryImageAspectRatio; + + public SearchHint() { + } + + public SearchHint itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item id. + * + * @return itemId + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public SearchHint id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Gets or sets the item id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public SearchHint name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public SearchHint matchedTerm(@org.eclipse.jdt.annotation.NonNull String matchedTerm) { + this.matchedTerm = matchedTerm; + return this; + } + + /** + * Gets or sets the matched term. + * + * @return matchedTerm + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MATCHED_TERM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMatchedTerm() { + return matchedTerm; + } + + @JsonProperty(JSON_PROPERTY_MATCHED_TERM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMatchedTerm(@org.eclipse.jdt.annotation.NonNull String matchedTerm) { + this.matchedTerm = matchedTerm; + } + + public SearchHint indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Gets or sets the index number. + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public SearchHint productionYear(@org.eclipse.jdt.annotation.NonNull Integer productionYear) { + this.productionYear = productionYear; + return this; + } + + /** + * Gets or sets the production year. + * + * @return productionYear + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRODUCTION_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getProductionYear() { + return productionYear; + } + + @JsonProperty(JSON_PROPERTY_PRODUCTION_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProductionYear(@org.eclipse.jdt.annotation.NonNull Integer productionYear) { + this.productionYear = productionYear; + } + + public SearchHint parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Gets or sets the parent index number. + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public SearchHint primaryImageTag(@org.eclipse.jdt.annotation.NonNull String primaryImageTag) { + this.primaryImageTag = primaryImageTag; + return this; + } + + /** + * Gets or sets the image tag. + * + * @return primaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryImageTag() { + return primaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String primaryImageTag) { + this.primaryImageTag = primaryImageTag; + } + + public SearchHint thumbImageTag(@org.eclipse.jdt.annotation.NonNull String thumbImageTag) { + this.thumbImageTag = thumbImageTag; + return this; + } + + /** + * Gets or sets the thumb image tag. + * + * @return thumbImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THUMB_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getThumbImageTag() { + return thumbImageTag; + } + + @JsonProperty(JSON_PROPERTY_THUMB_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThumbImageTag(@org.eclipse.jdt.annotation.NonNull String thumbImageTag) { + this.thumbImageTag = thumbImageTag; + } + + public SearchHint thumbImageItemId(@org.eclipse.jdt.annotation.NonNull String thumbImageItemId) { + this.thumbImageItemId = thumbImageItemId; + return this; + } + + /** + * Gets or sets the thumb image item identifier. + * + * @return thumbImageItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THUMB_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getThumbImageItemId() { + return thumbImageItemId; + } + + @JsonProperty(JSON_PROPERTY_THUMB_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThumbImageItemId(@org.eclipse.jdt.annotation.NonNull String thumbImageItemId) { + this.thumbImageItemId = thumbImageItemId; + } + + public SearchHint backdropImageTag(@org.eclipse.jdt.annotation.NonNull String backdropImageTag) { + this.backdropImageTag = backdropImageTag; + return this; + } + + /** + * Gets or sets the backdrop image tag. + * + * @return backdropImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BACKDROP_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBackdropImageTag() { + return backdropImageTag; + } + + @JsonProperty(JSON_PROPERTY_BACKDROP_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBackdropImageTag(@org.eclipse.jdt.annotation.NonNull String backdropImageTag) { + this.backdropImageTag = backdropImageTag; + } + + public SearchHint backdropImageItemId(@org.eclipse.jdt.annotation.NonNull String backdropImageItemId) { + this.backdropImageItemId = backdropImageItemId; + return this; + } + + /** + * Gets or sets the backdrop image item identifier. + * + * @return backdropImageItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BACKDROP_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBackdropImageItemId() { + return backdropImageItemId; + } + + @JsonProperty(JSON_PROPERTY_BACKDROP_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBackdropImageItemId(@org.eclipse.jdt.annotation.NonNull String backdropImageItemId) { + this.backdropImageItemId = backdropImageItemId; + } + + public SearchHint type(@org.eclipse.jdt.annotation.NonNull BaseItemKind type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemKind getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull BaseItemKind type) { + this.type = type; + } + + public SearchHint isFolder(@org.eclipse.jdt.annotation.NonNull Boolean isFolder) { + this.isFolder = isFolder; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is folder. + * + * @return isFolder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_FOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsFolder() { + return isFolder; + } + + @JsonProperty(JSON_PROPERTY_IS_FOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsFolder(@org.eclipse.jdt.annotation.NonNull Boolean isFolder) { + this.isFolder = isFolder; + } + + public SearchHint runTimeTicks(@org.eclipse.jdt.annotation.NonNull Long runTimeTicks) { + this.runTimeTicks = runTimeTicks; + return this; + } + + /** + * Gets or sets the run time ticks. + * + * @return runTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getRunTimeTicks() { + return runTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRunTimeTicks(@org.eclipse.jdt.annotation.NonNull Long runTimeTicks) { + this.runTimeTicks = runTimeTicks; + } + + public SearchHint mediaType(@org.eclipse.jdt.annotation.NonNull MediaType mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Gets or sets the type of the media. + * + * @return mediaType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaType getMediaType() { + return mediaType; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaType(@org.eclipse.jdt.annotation.NonNull MediaType mediaType) { + this.mediaType = mediaType; + } + + public SearchHint startDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Gets or sets the start date. + * + * @return startDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartDate() { + return startDate; + } + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + } + + public SearchHint endDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Gets or sets the end date. + * + * @return endDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndDate() { + return endDate; + } + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + } + + public SearchHint series(@org.eclipse.jdt.annotation.NonNull String series) { + this.series = series; + return this; + } + + /** + * Gets or sets the series. + * + * @return series + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeries() { + return series; + } + + @JsonProperty(JSON_PROPERTY_SERIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeries(@org.eclipse.jdt.annotation.NonNull String series) { + this.series = series; + } + + public SearchHint status(@org.eclipse.jdt.annotation.NonNull String status) { + this.status = status; + return this; + } + + /** + * Gets or sets the status. + * + * @return status + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@org.eclipse.jdt.annotation.NonNull String status) { + this.status = status; + } + + public SearchHint album(@org.eclipse.jdt.annotation.NonNull String album) { + this.album = album; + return this; + } + + /** + * Gets or sets the album. + * + * @return album + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlbum() { + return album; + } + + @JsonProperty(JSON_PROPERTY_ALBUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbum(@org.eclipse.jdt.annotation.NonNull String album) { + this.album = album; + } + + public SearchHint albumId(@org.eclipse.jdt.annotation.NonNull UUID albumId) { + this.albumId = albumId; + return this; + } + + /** + * Gets or sets the album id. + * + * @return albumId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getAlbumId() { + return albumId; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumId(@org.eclipse.jdt.annotation.NonNull UUID albumId) { + this.albumId = albumId; + } + + public SearchHint albumArtist(@org.eclipse.jdt.annotation.NonNull String albumArtist) { + this.albumArtist = albumArtist; + return this; + } + + /** + * Gets or sets the album artist. + * + * @return albumArtist + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ARTIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlbumArtist() { + return albumArtist; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ARTIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumArtist(@org.eclipse.jdt.annotation.NonNull String albumArtist) { + this.albumArtist = albumArtist; + } + + public SearchHint artists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + return this; + } + + public SearchHint addArtistsItem(String artistsItem) { + if (this.artists == null) { + this.artists = new ArrayList<>(); + } + this.artists.add(artistsItem); + return this; + } + + /** + * Gets or sets the artists. + * + * @return artists + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArtists() { + return artists; + } + + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + } + + public SearchHint songCount(@org.eclipse.jdt.annotation.NonNull Integer songCount) { + this.songCount = songCount; + return this; + } + + /** + * Gets or sets the song count. + * + * @return songCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SONG_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSongCount() { + return songCount; + } + + @JsonProperty(JSON_PROPERTY_SONG_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSongCount(@org.eclipse.jdt.annotation.NonNull Integer songCount) { + this.songCount = songCount; + } + + public SearchHint episodeCount(@org.eclipse.jdt.annotation.NonNull Integer episodeCount) { + this.episodeCount = episodeCount; + return this; + } + + /** + * Gets or sets the episode count. + * + * @return episodeCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EPISODE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getEpisodeCount() { + return episodeCount; + } + + @JsonProperty(JSON_PROPERTY_EPISODE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEpisodeCount(@org.eclipse.jdt.annotation.NonNull Integer episodeCount) { + this.episodeCount = episodeCount; + } + + public SearchHint channelId(@org.eclipse.jdt.annotation.NonNull UUID channelId) { + this.channelId = channelId; + return this; + } + + /** + * Gets or sets the channel identifier. + * + * @return channelId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getChannelId() { + return channelId; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelId(@org.eclipse.jdt.annotation.NonNull UUID channelId) { + this.channelId = channelId; + } + + public SearchHint channelName(@org.eclipse.jdt.annotation.NonNull String channelName) { + this.channelName = channelName; + return this; + } + + /** + * Gets or sets the name of the channel. + * + * @return channelName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelName() { + return channelName; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelName(@org.eclipse.jdt.annotation.NonNull String channelName) { + this.channelName = channelName; + } + + public SearchHint primaryImageAspectRatio(@org.eclipse.jdt.annotation.NonNull Double primaryImageAspectRatio) { + this.primaryImageAspectRatio = primaryImageAspectRatio; + return this; + } + + /** + * Gets or sets the primary image aspect ratio. + * + * @return primaryImageAspectRatio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getPrimaryImageAspectRatio() { + return primaryImageAspectRatio; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageAspectRatio(@org.eclipse.jdt.annotation.NonNull Double primaryImageAspectRatio) { + this.primaryImageAspectRatio = primaryImageAspectRatio; + } + + /** + * Return true if this SearchHint object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SearchHint searchHint = (SearchHint) o; + return Objects.equals(this.itemId, searchHint.itemId) && Objects.equals(this.id, searchHint.id) + && Objects.equals(this.name, searchHint.name) + && Objects.equals(this.matchedTerm, searchHint.matchedTerm) + && Objects.equals(this.indexNumber, searchHint.indexNumber) + && Objects.equals(this.productionYear, searchHint.productionYear) + && Objects.equals(this.parentIndexNumber, searchHint.parentIndexNumber) + && Objects.equals(this.primaryImageTag, searchHint.primaryImageTag) + && Objects.equals(this.thumbImageTag, searchHint.thumbImageTag) + && Objects.equals(this.thumbImageItemId, searchHint.thumbImageItemId) + && Objects.equals(this.backdropImageTag, searchHint.backdropImageTag) + && Objects.equals(this.backdropImageItemId, searchHint.backdropImageItemId) + && Objects.equals(this.type, searchHint.type) && Objects.equals(this.isFolder, searchHint.isFolder) + && Objects.equals(this.runTimeTicks, searchHint.runTimeTicks) + && Objects.equals(this.mediaType, searchHint.mediaType) + && Objects.equals(this.startDate, searchHint.startDate) + && Objects.equals(this.endDate, searchHint.endDate) && Objects.equals(this.series, searchHint.series) + && Objects.equals(this.status, searchHint.status) && Objects.equals(this.album, searchHint.album) + && Objects.equals(this.albumId, searchHint.albumId) + && Objects.equals(this.albumArtist, searchHint.albumArtist) + && Objects.equals(this.artists, searchHint.artists) + && Objects.equals(this.songCount, searchHint.songCount) + && Objects.equals(this.episodeCount, searchHint.episodeCount) + && Objects.equals(this.channelId, searchHint.channelId) + && Objects.equals(this.channelName, searchHint.channelName) + && Objects.equals(this.primaryImageAspectRatio, searchHint.primaryImageAspectRatio); + } + + @Override + public int hashCode() { + return Objects.hash(itemId, id, name, matchedTerm, indexNumber, productionYear, parentIndexNumber, + primaryImageTag, thumbImageTag, thumbImageItemId, backdropImageTag, backdropImageItemId, type, isFolder, + runTimeTicks, mediaType, startDate, endDate, series, status, album, albumId, albumArtist, artists, + songCount, episodeCount, channelId, channelName, primaryImageAspectRatio); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SearchHint {\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" matchedTerm: ").append(toIndentedString(matchedTerm)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" productionYear: ").append(toIndentedString(productionYear)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" primaryImageTag: ").append(toIndentedString(primaryImageTag)).append("\n"); + sb.append(" thumbImageTag: ").append(toIndentedString(thumbImageTag)).append("\n"); + sb.append(" thumbImageItemId: ").append(toIndentedString(thumbImageItemId)).append("\n"); + sb.append(" backdropImageTag: ").append(toIndentedString(backdropImageTag)).append("\n"); + sb.append(" backdropImageItemId: ").append(toIndentedString(backdropImageItemId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" isFolder: ").append(toIndentedString(isFolder)).append("\n"); + sb.append(" runTimeTicks: ").append(toIndentedString(runTimeTicks)).append("\n"); + sb.append(" mediaType: ").append(toIndentedString(mediaType)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" series: ").append(toIndentedString(series)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" album: ").append(toIndentedString(album)).append("\n"); + sb.append(" albumId: ").append(toIndentedString(albumId)).append("\n"); + sb.append(" albumArtist: ").append(toIndentedString(albumArtist)).append("\n"); + sb.append(" artists: ").append(toIndentedString(artists)).append("\n"); + sb.append(" songCount: ").append(toIndentedString(songCount)).append("\n"); + sb.append(" episodeCount: ").append(toIndentedString(episodeCount)).append("\n"); + sb.append(" channelId: ").append(toIndentedString(channelId)).append("\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" primaryImageAspectRatio: ").append(toIndentedString(primaryImageAspectRatio)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `MatchedTerm` to the URL query string + if (getMatchedTerm() != null) { + joiner.add(String.format("%sMatchedTerm%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMatchedTerm())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ProductionYear` to the URL query string + if (getProductionYear() != null) { + joiner.add(String.format("%sProductionYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProductionYear())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PrimaryImageTag` to the URL query string + if (getPrimaryImageTag() != null) { + joiner.add(String.format("%sPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageTag())))); + } + + // add `ThumbImageTag` to the URL query string + if (getThumbImageTag() != null) { + joiner.add(String.format("%sThumbImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getThumbImageTag())))); + } + + // add `ThumbImageItemId` to the URL query string + if (getThumbImageItemId() != null) { + joiner.add(String.format("%sThumbImageItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getThumbImageItemId())))); + } + + // add `BackdropImageTag` to the URL query string + if (getBackdropImageTag() != null) { + joiner.add(String.format("%sBackdropImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBackdropImageTag())))); + } + + // add `BackdropImageItemId` to the URL query string + if (getBackdropImageItemId() != null) { + joiner.add(String.format("%sBackdropImageItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBackdropImageItemId())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `IsFolder` to the URL query string + if (getIsFolder() != null) { + joiner.add(String.format("%sIsFolder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsFolder())))); + } + + // add `RunTimeTicks` to the URL query string + if (getRunTimeTicks() != null) { + joiner.add(String.format("%sRunTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRunTimeTicks())))); + } + + // add `MediaType` to the URL query string + if (getMediaType() != null) { + joiner.add(String.format("%sMediaType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaType())))); + } + + // add `StartDate` to the URL query string + if (getStartDate() != null) { + joiner.add(String.format("%sStartDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartDate())))); + } + + // add `EndDate` to the URL query string + if (getEndDate() != null) { + joiner.add(String.format("%sEndDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndDate())))); + } + + // add `Series` to the URL query string + if (getSeries() != null) { + joiner.add(String.format("%sSeries%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeries())))); + } + + // add `Status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sStatus%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `Album` to the URL query string + if (getAlbum() != null) { + joiner.add(String.format("%sAlbum%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbum())))); + } + + // add `AlbumId` to the URL query string + if (getAlbumId() != null) { + joiner.add(String.format("%sAlbumId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbumId())))); + } + + // add `AlbumArtist` to the URL query string + if (getAlbumArtist() != null) { + joiner.add(String.format("%sAlbumArtist%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbumArtist())))); + } + + // add `Artists` to the URL query string + if (getArtists() != null) { + for (int i = 0; i < getArtists().size(); i++) { + joiner.add(String.format("%sArtists%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArtists().get(i))))); + } + } + + // add `SongCount` to the URL query string + if (getSongCount() != null) { + joiner.add(String.format("%sSongCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSongCount())))); + } + + // add `EpisodeCount` to the URL query string + if (getEpisodeCount() != null) { + joiner.add(String.format("%sEpisodeCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEpisodeCount())))); + } + + // add `ChannelId` to the URL query string + if (getChannelId() != null) { + joiner.add(String.format("%sChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelId())))); + } + + // add `ChannelName` to the URL query string + if (getChannelName() != null) { + joiner.add(String.format("%sChannelName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelName())))); + } + + // add `PrimaryImageAspectRatio` to the URL query string + if (getPrimaryImageAspectRatio() != null) { + joiner.add(String.format("%sPrimaryImageAspectRatio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageAspectRatio())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SearchHint instance; + + public Builder() { + this(new SearchHint()); + } + + protected Builder(SearchHint instance) { + this.instance = instance; + } + + public SearchHint.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public SearchHint.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public SearchHint.Builder name(String name) { + this.instance.name = name; + return this; + } + + public SearchHint.Builder matchedTerm(String matchedTerm) { + this.instance.matchedTerm = matchedTerm; + return this; + } + + public SearchHint.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public SearchHint.Builder productionYear(Integer productionYear) { + this.instance.productionYear = productionYear; + return this; + } + + public SearchHint.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public SearchHint.Builder primaryImageTag(String primaryImageTag) { + this.instance.primaryImageTag = primaryImageTag; + return this; + } + + public SearchHint.Builder thumbImageTag(String thumbImageTag) { + this.instance.thumbImageTag = thumbImageTag; + return this; + } + + public SearchHint.Builder thumbImageItemId(String thumbImageItemId) { + this.instance.thumbImageItemId = thumbImageItemId; + return this; + } + + public SearchHint.Builder backdropImageTag(String backdropImageTag) { + this.instance.backdropImageTag = backdropImageTag; + return this; + } + + public SearchHint.Builder backdropImageItemId(String backdropImageItemId) { + this.instance.backdropImageItemId = backdropImageItemId; + return this; + } + + public SearchHint.Builder type(BaseItemKind type) { + this.instance.type = type; + return this; + } + + public SearchHint.Builder isFolder(Boolean isFolder) { + this.instance.isFolder = isFolder; + return this; + } + + public SearchHint.Builder runTimeTicks(Long runTimeTicks) { + this.instance.runTimeTicks = runTimeTicks; + return this; + } + + public SearchHint.Builder mediaType(MediaType mediaType) { + this.instance.mediaType = mediaType; + return this; + } + + public SearchHint.Builder startDate(OffsetDateTime startDate) { + this.instance.startDate = startDate; + return this; + } + + public SearchHint.Builder endDate(OffsetDateTime endDate) { + this.instance.endDate = endDate; + return this; + } + + public SearchHint.Builder series(String series) { + this.instance.series = series; + return this; + } + + public SearchHint.Builder status(String status) { + this.instance.status = status; + return this; + } + + public SearchHint.Builder album(String album) { + this.instance.album = album; + return this; + } + + public SearchHint.Builder albumId(UUID albumId) { + this.instance.albumId = albumId; + return this; + } + + public SearchHint.Builder albumArtist(String albumArtist) { + this.instance.albumArtist = albumArtist; + return this; + } + + public SearchHint.Builder artists(List artists) { + this.instance.artists = artists; + return this; + } + + public SearchHint.Builder songCount(Integer songCount) { + this.instance.songCount = songCount; + return this; + } + + public SearchHint.Builder episodeCount(Integer episodeCount) { + this.instance.episodeCount = episodeCount; + return this; + } + + public SearchHint.Builder channelId(UUID channelId) { + this.instance.channelId = channelId; + return this; + } + + public SearchHint.Builder channelName(String channelName) { + this.instance.channelName = channelName; + return this; + } + + public SearchHint.Builder primaryImageAspectRatio(Double primaryImageAspectRatio) { + this.instance.primaryImageAspectRatio = primaryImageAspectRatio; + return this; + } + + /** + * returns a built SearchHint instance. + * + * The builder is not reusable. + */ + public SearchHint build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SearchHint.Builder builder() { + return new SearchHint.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SearchHint.Builder toBuilder() { + return new SearchHint.Builder().itemId(getItemId()).id(getId()).name(getName()).matchedTerm(getMatchedTerm()) + .indexNumber(getIndexNumber()).productionYear(getProductionYear()) + .parentIndexNumber(getParentIndexNumber()).primaryImageTag(getPrimaryImageTag()) + .thumbImageTag(getThumbImageTag()).thumbImageItemId(getThumbImageItemId()) + .backdropImageTag(getBackdropImageTag()).backdropImageItemId(getBackdropImageItemId()).type(getType()) + .isFolder(getIsFolder()).runTimeTicks(getRunTimeTicks()).mediaType(getMediaType()) + .startDate(getStartDate()).endDate(getEndDate()).series(getSeries()).status(getStatus()) + .album(getAlbum()).albumId(getAlbumId()).albumArtist(getAlbumArtist()).artists(getArtists()) + .songCount(getSongCount()).episodeCount(getEpisodeCount()).channelId(getChannelId()) + .channelName(getChannelName()).primaryImageAspectRatio(getPrimaryImageAspectRatio()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SearchHintResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SearchHintResult.java new file mode 100644 index 0000000000000..20ef3f5805b7d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SearchHintResult.java @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SearchHintResult. + */ +@JsonPropertyOrder({ SearchHintResult.JSON_PROPERTY_SEARCH_HINTS, SearchHintResult.JSON_PROPERTY_TOTAL_RECORD_COUNT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SearchHintResult { + public static final String JSON_PROPERTY_SEARCH_HINTS = "SearchHints"; + @org.eclipse.jdt.annotation.NonNull + private List searchHints = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public SearchHintResult() { + } + + public SearchHintResult searchHints(@org.eclipse.jdt.annotation.NonNull List searchHints) { + this.searchHints = searchHints; + return this; + } + + public SearchHintResult addSearchHintsItem(SearchHint searchHintsItem) { + if (this.searchHints == null) { + this.searchHints = new ArrayList<>(); + } + this.searchHints.add(searchHintsItem); + return this; + } + + /** + * Gets the search hints. + * + * @return searchHints + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_HINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSearchHints() { + return searchHints; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_HINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchHints(@org.eclipse.jdt.annotation.NonNull List searchHints) { + this.searchHints = searchHints; + } + + public SearchHintResult totalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets the total record count. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + /** + * Return true if this SearchHintResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SearchHintResult searchHintResult = (SearchHintResult) o; + return Objects.equals(this.searchHints, searchHintResult.searchHints) + && Objects.equals(this.totalRecordCount, searchHintResult.totalRecordCount); + } + + @Override + public int hashCode() { + return Objects.hash(searchHints, totalRecordCount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SearchHintResult {\n"); + sb.append(" searchHints: ").append(toIndentedString(searchHints)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchHints` to the URL query string + if (getSearchHints() != null) { + for (int i = 0; i < getSearchHints().size(); i++) { + if (getSearchHints().get(i) != null) { + joiner.add(getSearchHints().get(i).toUrlQueryString(String.format("%sSearchHints%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SearchHintResult instance; + + public Builder() { + this(new SearchHintResult()); + } + + protected Builder(SearchHintResult instance) { + this.instance = instance; + } + + public SearchHintResult.Builder searchHints(List searchHints) { + this.instance.searchHints = searchHints; + return this; + } + + public SearchHintResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + /** + * returns a built SearchHintResult instance. + * + * The builder is not reusable. + */ + public SearchHintResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SearchHintResult.Builder builder() { + return new SearchHintResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SearchHintResult.Builder toBuilder() { + return new SearchHintResult.Builder().searchHints(getSearchHints()).totalRecordCount(getTotalRecordCount()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeekRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeekRequestDto.java new file mode 100644 index 0000000000000..f4cb5f67417e4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeekRequestDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SeekRequestDto. + */ +@JsonPropertyOrder({ SeekRequestDto.JSON_PROPERTY_POSITION_TICKS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SeekRequestDto { + public static final String JSON_PROPERTY_POSITION_TICKS = "PositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long positionTicks; + + public SeekRequestDto() { + } + + public SeekRequestDto positionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + return this; + } + + /** + * Gets or sets the position ticks. + * + * @return positionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPositionTicks() { + return positionTicks; + } + + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPositionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + } + + /** + * Return true if this SeekRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SeekRequestDto seekRequestDto = (SeekRequestDto) o; + return Objects.equals(this.positionTicks, seekRequestDto.positionTicks); + } + + @Override + public int hashCode() { + return Objects.hash(positionTicks); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SeekRequestDto {\n"); + sb.append(" positionTicks: ").append(toIndentedString(positionTicks)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PositionTicks` to the URL query string + if (getPositionTicks() != null) { + joiner.add(String.format("%sPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPositionTicks())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SeekRequestDto instance; + + public Builder() { + this(new SeekRequestDto()); + } + + protected Builder(SeekRequestDto instance) { + this.instance = instance; + } + + public SeekRequestDto.Builder positionTicks(Long positionTicks) { + this.instance.positionTicks = positionTicks; + return this; + } + + /** + * returns a built SeekRequestDto instance. + * + * The builder is not reusable. + */ + public SeekRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SeekRequestDto.Builder builder() { + return new SeekRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SeekRequestDto.Builder toBuilder() { + return new SeekRequestDto.Builder().positionTicks(getPositionTicks()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SendCommand.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SendCommand.java new file mode 100644 index 0000000000000..7ba22009d5599 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SendCommand.java @@ -0,0 +1,397 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SendCommand. + */ +@JsonPropertyOrder({ SendCommand.JSON_PROPERTY_GROUP_ID, SendCommand.JSON_PROPERTY_PLAYLIST_ITEM_ID, + SendCommand.JSON_PROPERTY_WHEN, SendCommand.JSON_PROPERTY_POSITION_TICKS, SendCommand.JSON_PROPERTY_COMMAND, + SendCommand.JSON_PROPERTY_EMITTED_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SendCommand { + public static final String JSON_PROPERTY_GROUP_ID = "GroupId"; + @org.eclipse.jdt.annotation.NonNull + private UUID groupId; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID playlistItemId; + + public static final String JSON_PROPERTY_WHEN = "When"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime when; + + public static final String JSON_PROPERTY_POSITION_TICKS = "PositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long positionTicks; + + public static final String JSON_PROPERTY_COMMAND = "Command"; + @org.eclipse.jdt.annotation.NonNull + private SendCommandType command; + + public static final String JSON_PROPERTY_EMITTED_AT = "EmittedAt"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime emittedAt; + + public SendCommand() { + } + + public SendCommand groupId(@org.eclipse.jdt.annotation.NonNull UUID groupId) { + this.groupId = groupId; + return this; + } + + /** + * Gets the group identifier. + * + * @return groupId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getGroupId() { + return groupId; + } + + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupId(@org.eclipse.jdt.annotation.NonNull UUID groupId) { + this.groupId = groupId; + } + + public SendCommand playlistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets the playlist identifier of the playing item. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + } + + public SendCommand when(@org.eclipse.jdt.annotation.NonNull OffsetDateTime when) { + this.when = when; + return this; + } + + /** + * Gets or sets the UTC time when to execute the command. + * + * @return when + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WHEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getWhen() { + return when; + } + + @JsonProperty(JSON_PROPERTY_WHEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhen(@org.eclipse.jdt.annotation.NonNull OffsetDateTime when) { + this.when = when; + } + + public SendCommand positionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + return this; + } + + /** + * Gets the position ticks. + * + * @return positionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPositionTicks() { + return positionTicks; + } + + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPositionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + } + + public SendCommand command(@org.eclipse.jdt.annotation.NonNull SendCommandType command) { + this.command = command; + return this; + } + + /** + * Gets the command. + * + * @return command + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SendCommandType getCommand() { + return command; + } + + @JsonProperty(JSON_PROPERTY_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCommand(@org.eclipse.jdt.annotation.NonNull SendCommandType command) { + this.command = command; + } + + public SendCommand emittedAt(@org.eclipse.jdt.annotation.NonNull OffsetDateTime emittedAt) { + this.emittedAt = emittedAt; + return this; + } + + /** + * Gets the UTC time when this command has been emitted. + * + * @return emittedAt + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EMITTED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEmittedAt() { + return emittedAt; + } + + @JsonProperty(JSON_PROPERTY_EMITTED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmittedAt(@org.eclipse.jdt.annotation.NonNull OffsetDateTime emittedAt) { + this.emittedAt = emittedAt; + } + + /** + * Return true if this SendCommand object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendCommand sendCommand = (SendCommand) o; + return Objects.equals(this.groupId, sendCommand.groupId) + && Objects.equals(this.playlistItemId, sendCommand.playlistItemId) + && Objects.equals(this.when, sendCommand.when) + && Objects.equals(this.positionTicks, sendCommand.positionTicks) + && Objects.equals(this.command, sendCommand.command) + && Objects.equals(this.emittedAt, sendCommand.emittedAt); + } + + @Override + public int hashCode() { + return Objects.hash(groupId, playlistItemId, when, positionTicks, command, emittedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendCommand {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append(" when: ").append(toIndentedString(when)).append("\n"); + sb.append(" positionTicks: ").append(toIndentedString(positionTicks)).append("\n"); + sb.append(" command: ").append(toIndentedString(command)).append("\n"); + sb.append(" emittedAt: ").append(toIndentedString(emittedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `GroupId` to the URL query string + if (getGroupId() != null) { + joiner.add(String.format("%sGroupId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGroupId())))); + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + // add `When` to the URL query string + if (getWhen() != null) { + joiner.add(String.format("%sWhen%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWhen())))); + } + + // add `PositionTicks` to the URL query string + if (getPositionTicks() != null) { + joiner.add(String.format("%sPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPositionTicks())))); + } + + // add `Command` to the URL query string + if (getCommand() != null) { + joiner.add(String.format("%sCommand%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCommand())))); + } + + // add `EmittedAt` to the URL query string + if (getEmittedAt() != null) { + joiner.add(String.format("%sEmittedAt%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEmittedAt())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SendCommand instance; + + public Builder() { + this(new SendCommand()); + } + + protected Builder(SendCommand instance) { + this.instance = instance; + } + + public SendCommand.Builder groupId(UUID groupId) { + this.instance.groupId = groupId; + return this; + } + + public SendCommand.Builder playlistItemId(UUID playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + public SendCommand.Builder when(OffsetDateTime when) { + this.instance.when = when; + return this; + } + + public SendCommand.Builder positionTicks(Long positionTicks) { + this.instance.positionTicks = positionTicks; + return this; + } + + public SendCommand.Builder command(SendCommandType command) { + this.instance.command = command; + return this; + } + + public SendCommand.Builder emittedAt(OffsetDateTime emittedAt) { + this.instance.emittedAt = emittedAt; + return this; + } + + /** + * returns a built SendCommand instance. + * + * The builder is not reusable. + */ + public SendCommand build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SendCommand.Builder builder() { + return new SendCommand.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SendCommand.Builder toBuilder() { + return new SendCommand.Builder().groupId(getGroupId()).playlistItemId(getPlaylistItemId()).when(getWhen()) + .positionTicks(getPositionTicks()).command(getCommand()).emittedAt(getEmittedAt()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SendCommandType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SendCommandType.java new file mode 100644 index 0000000000000..3591241837dfa --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SendCommandType.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum SendCommandType. + */ +public enum SendCommandType { + + UNPAUSE("Unpause"), + + PAUSE("Pause"), + + STOP("Stop"), + + SEEK("Seek"); + + private String value; + + SendCommandType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SendCommandType fromValue(String value) { + for (SendCommandType b : SendCommandType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesInfo.java new file mode 100644 index 0000000000000..0b8fd4df0e386 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesInfo.java @@ -0,0 +1,617 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * SeriesInfo + */ +@JsonPropertyOrder({ SeriesInfo.JSON_PROPERTY_NAME, SeriesInfo.JSON_PROPERTY_ORIGINAL_TITLE, + SeriesInfo.JSON_PROPERTY_PATH, SeriesInfo.JSON_PROPERTY_METADATA_LANGUAGE, + SeriesInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, SeriesInfo.JSON_PROPERTY_PROVIDER_IDS, + SeriesInfo.JSON_PROPERTY_YEAR, SeriesInfo.JSON_PROPERTY_INDEX_NUMBER, + SeriesInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, SeriesInfo.JSON_PROPERTY_PREMIERE_DATE, + SeriesInfo.JSON_PROPERTY_IS_AUTOMATED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SeriesInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public SeriesInfo() { + } + + public SeriesInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public SeriesInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public SeriesInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public SeriesInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public SeriesInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public SeriesInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public SeriesInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public SeriesInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public SeriesInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public SeriesInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public SeriesInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public SeriesInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + /** + * Return true if this SeriesInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SeriesInfo seriesInfo = (SeriesInfo) o; + return Objects.equals(this.name, seriesInfo.name) + && Objects.equals(this.originalTitle, seriesInfo.originalTitle) + && Objects.equals(this.path, seriesInfo.path) + && Objects.equals(this.metadataLanguage, seriesInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, seriesInfo.metadataCountryCode) + && Objects.equals(this.providerIds, seriesInfo.providerIds) + && Objects.equals(this.year, seriesInfo.year) + && Objects.equals(this.indexNumber, seriesInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, seriesInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, seriesInfo.premiereDate) + && Objects.equals(this.isAutomated, seriesInfo.isAutomated); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SeriesInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SeriesInfo instance; + + public Builder() { + this(new SeriesInfo()); + } + + protected Builder(SeriesInfo instance) { + this.instance = instance; + } + + public SeriesInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public SeriesInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public SeriesInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public SeriesInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public SeriesInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public SeriesInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public SeriesInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public SeriesInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public SeriesInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public SeriesInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public SeriesInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + /** + * returns a built SeriesInfo instance. + * + * The builder is not reusable. + */ + public SeriesInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SeriesInfo.Builder builder() { + return new SeriesInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SeriesInfo.Builder toBuilder() { + return new SeriesInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()) + .isAutomated(getIsAutomated()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..1f359c963480b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesInfoRemoteSearchQuery.java @@ -0,0 +1,318 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * SeriesInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ SeriesInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + SeriesInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, + SeriesInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + SeriesInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SeriesInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private SeriesInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public SeriesInfoRemoteSearchQuery() { + } + + public SeriesInfoRemoteSearchQuery searchInfo(@org.eclipse.jdt.annotation.NonNull SeriesInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SeriesInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull SeriesInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public SeriesInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public SeriesInfoRemoteSearchQuery searchProviderName( + @org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public SeriesInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this SeriesInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SeriesInfoRemoteSearchQuery seriesInfoRemoteSearchQuery = (SeriesInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, seriesInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, seriesInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, seriesInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, seriesInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SeriesInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SeriesInfoRemoteSearchQuery instance; + + public Builder() { + this(new SeriesInfoRemoteSearchQuery()); + } + + protected Builder(SeriesInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public SeriesInfoRemoteSearchQuery.Builder searchInfo(SeriesInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public SeriesInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public SeriesInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public SeriesInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built SeriesInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public SeriesInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SeriesInfoRemoteSearchQuery.Builder builder() { + return new SeriesInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SeriesInfoRemoteSearchQuery.Builder toBuilder() { + return new SeriesInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesStatus.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesStatus.java new file mode 100644 index 0000000000000..d45fe8d44b697 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesStatus.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The status of a series. + */ +public enum SeriesStatus { + + CONTINUING("Continuing"), + + ENDED("Ended"), + + UNRELEASED("Unreleased"); + + private String value; + + SeriesStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SeriesStatus fromValue(String value) { + for (SeriesStatus b : SeriesStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesTimerCancelledMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesTimerCancelledMessage.java new file mode 100644 index 0000000000000..0207c54ba251d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesTimerCancelledMessage.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Series timer cancelled message. + */ +@JsonPropertyOrder({ SeriesTimerCancelledMessage.JSON_PROPERTY_DATA, + SeriesTimerCancelledMessage.JSON_PROPERTY_MESSAGE_ID, SeriesTimerCancelledMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SeriesTimerCancelledMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private TimerEventInfo data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.SERIES_TIMER_CANCELLED; + + public SeriesTimerCancelledMessage() { + } + + @JsonCreator + public SeriesTimerCancelledMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public SeriesTimerCancelledMessage data(@org.eclipse.jdt.annotation.NonNull TimerEventInfo data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TimerEventInfo getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull TimerEventInfo data) { + this.data = data; + } + + public SeriesTimerCancelledMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this SeriesTimerCancelledMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SeriesTimerCancelledMessage seriesTimerCancelledMessage = (SeriesTimerCancelledMessage) o; + return Objects.equals(this.data, seriesTimerCancelledMessage.data) + && Objects.equals(this.messageId, seriesTimerCancelledMessage.messageId) + && Objects.equals(this.messageType, seriesTimerCancelledMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SeriesTimerCancelledMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SeriesTimerCancelledMessage instance; + + public Builder() { + this(new SeriesTimerCancelledMessage()); + } + + protected Builder(SeriesTimerCancelledMessage instance) { + this.instance = instance; + } + + public SeriesTimerCancelledMessage.Builder data(TimerEventInfo data) { + this.instance.data = data; + return this; + } + + public SeriesTimerCancelledMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public SeriesTimerCancelledMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built SeriesTimerCancelledMessage instance. + * + * The builder is not reusable. + */ + public SeriesTimerCancelledMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SeriesTimerCancelledMessage.Builder builder() { + return new SeriesTimerCancelledMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SeriesTimerCancelledMessage.Builder toBuilder() { + return new SeriesTimerCancelledMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesTimerCreatedMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesTimerCreatedMessage.java new file mode 100644 index 0000000000000..7674384ecfb5b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesTimerCreatedMessage.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Series timer created message. + */ +@JsonPropertyOrder({ SeriesTimerCreatedMessage.JSON_PROPERTY_DATA, SeriesTimerCreatedMessage.JSON_PROPERTY_MESSAGE_ID, + SeriesTimerCreatedMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SeriesTimerCreatedMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private TimerEventInfo data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.SERIES_TIMER_CREATED; + + public SeriesTimerCreatedMessage() { + } + + @JsonCreator + public SeriesTimerCreatedMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public SeriesTimerCreatedMessage data(@org.eclipse.jdt.annotation.NonNull TimerEventInfo data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TimerEventInfo getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull TimerEventInfo data) { + this.data = data; + } + + public SeriesTimerCreatedMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this SeriesTimerCreatedMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SeriesTimerCreatedMessage seriesTimerCreatedMessage = (SeriesTimerCreatedMessage) o; + return Objects.equals(this.data, seriesTimerCreatedMessage.data) + && Objects.equals(this.messageId, seriesTimerCreatedMessage.messageId) + && Objects.equals(this.messageType, seriesTimerCreatedMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SeriesTimerCreatedMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SeriesTimerCreatedMessage instance; + + public Builder() { + this(new SeriesTimerCreatedMessage()); + } + + protected Builder(SeriesTimerCreatedMessage instance) { + this.instance = instance; + } + + public SeriesTimerCreatedMessage.Builder data(TimerEventInfo data) { + this.instance.data = data; + return this; + } + + public SeriesTimerCreatedMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public SeriesTimerCreatedMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built SeriesTimerCreatedMessage instance. + * + * The builder is not reusable. + */ + public SeriesTimerCreatedMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SeriesTimerCreatedMessage.Builder builder() { + return new SeriesTimerCreatedMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SeriesTimerCreatedMessage.Builder toBuilder() { + return new SeriesTimerCreatedMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesTimerInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesTimerInfoDto.java new file mode 100644 index 0000000000000..f4692ad953db6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesTimerInfoDto.java @@ -0,0 +1,1634 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SeriesTimerInfoDto. + */ +@JsonPropertyOrder({ SeriesTimerInfoDto.JSON_PROPERTY_ID, SeriesTimerInfoDto.JSON_PROPERTY_TYPE, + SeriesTimerInfoDto.JSON_PROPERTY_SERVER_ID, SeriesTimerInfoDto.JSON_PROPERTY_EXTERNAL_ID, + SeriesTimerInfoDto.JSON_PROPERTY_CHANNEL_ID, SeriesTimerInfoDto.JSON_PROPERTY_EXTERNAL_CHANNEL_ID, + SeriesTimerInfoDto.JSON_PROPERTY_CHANNEL_NAME, SeriesTimerInfoDto.JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG, + SeriesTimerInfoDto.JSON_PROPERTY_PROGRAM_ID, SeriesTimerInfoDto.JSON_PROPERTY_EXTERNAL_PROGRAM_ID, + SeriesTimerInfoDto.JSON_PROPERTY_NAME, SeriesTimerInfoDto.JSON_PROPERTY_OVERVIEW, + SeriesTimerInfoDto.JSON_PROPERTY_START_DATE, SeriesTimerInfoDto.JSON_PROPERTY_END_DATE, + SeriesTimerInfoDto.JSON_PROPERTY_SERVICE_NAME, SeriesTimerInfoDto.JSON_PROPERTY_PRIORITY, + SeriesTimerInfoDto.JSON_PROPERTY_PRE_PADDING_SECONDS, SeriesTimerInfoDto.JSON_PROPERTY_POST_PADDING_SECONDS, + SeriesTimerInfoDto.JSON_PROPERTY_IS_PRE_PADDING_REQUIRED, + SeriesTimerInfoDto.JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID, + SeriesTimerInfoDto.JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS, + SeriesTimerInfoDto.JSON_PROPERTY_IS_POST_PADDING_REQUIRED, SeriesTimerInfoDto.JSON_PROPERTY_KEEP_UNTIL, + SeriesTimerInfoDto.JSON_PROPERTY_RECORD_ANY_TIME, SeriesTimerInfoDto.JSON_PROPERTY_SKIP_EPISODES_IN_LIBRARY, + SeriesTimerInfoDto.JSON_PROPERTY_RECORD_ANY_CHANNEL, SeriesTimerInfoDto.JSON_PROPERTY_KEEP_UP_TO, + SeriesTimerInfoDto.JSON_PROPERTY_RECORD_NEW_ONLY, SeriesTimerInfoDto.JSON_PROPERTY_DAYS, + SeriesTimerInfoDto.JSON_PROPERTY_DAY_PATTERN, SeriesTimerInfoDto.JSON_PROPERTY_IMAGE_TAGS, + SeriesTimerInfoDto.JSON_PROPERTY_PARENT_THUMB_ITEM_ID, SeriesTimerInfoDto.JSON_PROPERTY_PARENT_THUMB_IMAGE_TAG, + SeriesTimerInfoDto.JSON_PROPERTY_PARENT_PRIMARY_IMAGE_ITEM_ID, + SeriesTimerInfoDto.JSON_PROPERTY_PARENT_PRIMARY_IMAGE_TAG }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SeriesTimerInfoDto { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_SERVER_ID = "ServerId"; + @org.eclipse.jdt.annotation.NonNull + private String serverId; + + public static final String JSON_PROPERTY_EXTERNAL_ID = "ExternalId"; + @org.eclipse.jdt.annotation.NonNull + private String externalId; + + public static final String JSON_PROPERTY_CHANNEL_ID = "ChannelId"; + @org.eclipse.jdt.annotation.NonNull + private UUID channelId; + + public static final String JSON_PROPERTY_EXTERNAL_CHANNEL_ID = "ExternalChannelId"; + @org.eclipse.jdt.annotation.NonNull + private String externalChannelId; + + public static final String JSON_PROPERTY_CHANNEL_NAME = "ChannelName"; + @org.eclipse.jdt.annotation.NonNull + private String channelName; + + public static final String JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG = "ChannelPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String channelPrimaryImageTag; + + public static final String JSON_PROPERTY_PROGRAM_ID = "ProgramId"; + @org.eclipse.jdt.annotation.NonNull + private String programId; + + public static final String JSON_PROPERTY_EXTERNAL_PROGRAM_ID = "ExternalProgramId"; + @org.eclipse.jdt.annotation.NonNull + private String externalProgramId; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_OVERVIEW = "Overview"; + @org.eclipse.jdt.annotation.NonNull + private String overview; + + public static final String JSON_PROPERTY_START_DATE = "StartDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime startDate; + + public static final String JSON_PROPERTY_END_DATE = "EndDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime endDate; + + public static final String JSON_PROPERTY_SERVICE_NAME = "ServiceName"; + @org.eclipse.jdt.annotation.NonNull + private String serviceName; + + public static final String JSON_PROPERTY_PRIORITY = "Priority"; + @org.eclipse.jdt.annotation.NonNull + private Integer priority; + + public static final String JSON_PROPERTY_PRE_PADDING_SECONDS = "PrePaddingSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer prePaddingSeconds; + + public static final String JSON_PROPERTY_POST_PADDING_SECONDS = "PostPaddingSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer postPaddingSeconds; + + public static final String JSON_PROPERTY_IS_PRE_PADDING_REQUIRED = "IsPrePaddingRequired"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPrePaddingRequired; + + public static final String JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID = "ParentBackdropItemId"; + @org.eclipse.jdt.annotation.NonNull + private String parentBackdropItemId; + + public static final String JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS = "ParentBackdropImageTags"; + @org.eclipse.jdt.annotation.NonNull + private List parentBackdropImageTags; + + public static final String JSON_PROPERTY_IS_POST_PADDING_REQUIRED = "IsPostPaddingRequired"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPostPaddingRequired; + + public static final String JSON_PROPERTY_KEEP_UNTIL = "KeepUntil"; + @org.eclipse.jdt.annotation.NonNull + private KeepUntil keepUntil; + + public static final String JSON_PROPERTY_RECORD_ANY_TIME = "RecordAnyTime"; + @org.eclipse.jdt.annotation.NonNull + private Boolean recordAnyTime; + + public static final String JSON_PROPERTY_SKIP_EPISODES_IN_LIBRARY = "SkipEpisodesInLibrary"; + @org.eclipse.jdt.annotation.NonNull + private Boolean skipEpisodesInLibrary; + + public static final String JSON_PROPERTY_RECORD_ANY_CHANNEL = "RecordAnyChannel"; + @org.eclipse.jdt.annotation.NonNull + private Boolean recordAnyChannel; + + public static final String JSON_PROPERTY_KEEP_UP_TO = "KeepUpTo"; + @org.eclipse.jdt.annotation.NonNull + private Integer keepUpTo; + + public static final String JSON_PROPERTY_RECORD_NEW_ONLY = "RecordNewOnly"; + @org.eclipse.jdt.annotation.NonNull + private Boolean recordNewOnly; + + public static final String JSON_PROPERTY_DAYS = "Days"; + @org.eclipse.jdt.annotation.NonNull + private List days; + + public static final String JSON_PROPERTY_DAY_PATTERN = "DayPattern"; + @org.eclipse.jdt.annotation.NonNull + private DayPattern dayPattern; + + public static final String JSON_PROPERTY_IMAGE_TAGS = "ImageTags"; + @org.eclipse.jdt.annotation.NonNull + private Map imageTags; + + public static final String JSON_PROPERTY_PARENT_THUMB_ITEM_ID = "ParentThumbItemId"; + @org.eclipse.jdt.annotation.NonNull + private String parentThumbItemId; + + public static final String JSON_PROPERTY_PARENT_THUMB_IMAGE_TAG = "ParentThumbImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String parentThumbImageTag; + + public static final String JSON_PROPERTY_PARENT_PRIMARY_IMAGE_ITEM_ID = "ParentPrimaryImageItemId"; + @org.eclipse.jdt.annotation.NonNull + private String parentPrimaryImageItemId; + + public static final String JSON_PROPERTY_PARENT_PRIMARY_IMAGE_TAG = "ParentPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String parentPrimaryImageTag; + + public SeriesTimerInfoDto() { + } + + public SeriesTimerInfoDto id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the Id of the recording. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public SeriesTimerInfoDto type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public SeriesTimerInfoDto serverId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + return this; + } + + /** + * Gets or sets the server identifier. + * + * @return serverId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerId() { + return serverId; + } + + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + } + + public SeriesTimerInfoDto externalId(@org.eclipse.jdt.annotation.NonNull String externalId) { + this.externalId = externalId; + return this; + } + + /** + * Gets or sets the external identifier. + * + * @return externalId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExternalId() { + return externalId; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalId(@org.eclipse.jdt.annotation.NonNull String externalId) { + this.externalId = externalId; + } + + public SeriesTimerInfoDto channelId(@org.eclipse.jdt.annotation.NonNull UUID channelId) { + this.channelId = channelId; + return this; + } + + /** + * Gets or sets the channel id of the recording. + * + * @return channelId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getChannelId() { + return channelId; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelId(@org.eclipse.jdt.annotation.NonNull UUID channelId) { + this.channelId = channelId; + } + + public SeriesTimerInfoDto externalChannelId(@org.eclipse.jdt.annotation.NonNull String externalChannelId) { + this.externalChannelId = externalChannelId; + return this; + } + + /** + * Gets or sets the external channel identifier. + * + * @return externalChannelId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExternalChannelId() { + return externalChannelId; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalChannelId(@org.eclipse.jdt.annotation.NonNull String externalChannelId) { + this.externalChannelId = externalChannelId; + } + + public SeriesTimerInfoDto channelName(@org.eclipse.jdt.annotation.NonNull String channelName) { + this.channelName = channelName; + return this; + } + + /** + * Gets or sets the channel name of the recording. + * + * @return channelName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelName() { + return channelName; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelName(@org.eclipse.jdt.annotation.NonNull String channelName) { + this.channelName = channelName; + } + + public SeriesTimerInfoDto channelPrimaryImageTag( + @org.eclipse.jdt.annotation.NonNull String channelPrimaryImageTag) { + this.channelPrimaryImageTag = channelPrimaryImageTag; + return this; + } + + /** + * Get channelPrimaryImageTag + * + * @return channelPrimaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelPrimaryImageTag() { + return channelPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String channelPrimaryImageTag) { + this.channelPrimaryImageTag = channelPrimaryImageTag; + } + + public SeriesTimerInfoDto programId(@org.eclipse.jdt.annotation.NonNull String programId) { + this.programId = programId; + return this; + } + + /** + * Gets or sets the program identifier. + * + * @return programId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProgramId() { + return programId; + } + + @JsonProperty(JSON_PROPERTY_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgramId(@org.eclipse.jdt.annotation.NonNull String programId) { + this.programId = programId; + } + + public SeriesTimerInfoDto externalProgramId(@org.eclipse.jdt.annotation.NonNull String externalProgramId) { + this.externalProgramId = externalProgramId; + return this; + } + + /** + * Gets or sets the external program identifier. + * + * @return externalProgramId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExternalProgramId() { + return externalProgramId; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalProgramId(@org.eclipse.jdt.annotation.NonNull String externalProgramId) { + this.externalProgramId = externalProgramId; + } + + public SeriesTimerInfoDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name of the recording. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public SeriesTimerInfoDto overview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + return this; + } + + /** + * Gets or sets the description of the recording. + * + * @return overview + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOverview() { + return overview; + } + + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOverview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + } + + public SeriesTimerInfoDto startDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Gets or sets the start date of the recording, in UTC. + * + * @return startDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartDate() { + return startDate; + } + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + } + + public SeriesTimerInfoDto endDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Gets or sets the end date of the recording, in UTC. + * + * @return endDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndDate() { + return endDate; + } + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + } + + public SeriesTimerInfoDto serviceName(@org.eclipse.jdt.annotation.NonNull String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Gets or sets the name of the service. + * + * @return serviceName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServiceName() { + return serviceName; + } + + @JsonProperty(JSON_PROPERTY_SERVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServiceName(@org.eclipse.jdt.annotation.NonNull String serviceName) { + this.serviceName = serviceName; + } + + public SeriesTimerInfoDto priority(@org.eclipse.jdt.annotation.NonNull Integer priority) { + this.priority = priority; + return this; + } + + /** + * Gets or sets the priority. + * + * @return priority + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPriority() { + return priority; + } + + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPriority(@org.eclipse.jdt.annotation.NonNull Integer priority) { + this.priority = priority; + } + + public SeriesTimerInfoDto prePaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer prePaddingSeconds) { + this.prePaddingSeconds = prePaddingSeconds; + return this; + } + + /** + * Gets or sets the pre padding seconds. + * + * @return prePaddingSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRE_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrePaddingSeconds() { + return prePaddingSeconds; + } + + @JsonProperty(JSON_PROPERTY_PRE_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrePaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer prePaddingSeconds) { + this.prePaddingSeconds = prePaddingSeconds; + } + + public SeriesTimerInfoDto postPaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer postPaddingSeconds) { + this.postPaddingSeconds = postPaddingSeconds; + return this; + } + + /** + * Gets or sets the post padding seconds. + * + * @return postPaddingSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POST_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPostPaddingSeconds() { + return postPaddingSeconds; + } + + @JsonProperty(JSON_PROPERTY_POST_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPostPaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer postPaddingSeconds) { + this.postPaddingSeconds = postPaddingSeconds; + } + + public SeriesTimerInfoDto isPrePaddingRequired(@org.eclipse.jdt.annotation.NonNull Boolean isPrePaddingRequired) { + this.isPrePaddingRequired = isPrePaddingRequired; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is pre padding required. + * + * @return isPrePaddingRequired + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PRE_PADDING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPrePaddingRequired() { + return isPrePaddingRequired; + } + + @JsonProperty(JSON_PROPERTY_IS_PRE_PADDING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPrePaddingRequired(@org.eclipse.jdt.annotation.NonNull Boolean isPrePaddingRequired) { + this.isPrePaddingRequired = isPrePaddingRequired; + } + + public SeriesTimerInfoDto parentBackdropItemId(@org.eclipse.jdt.annotation.NonNull String parentBackdropItemId) { + this.parentBackdropItemId = parentBackdropItemId; + return this; + } + + /** + * Gets or sets the Id of the Parent that has a backdrop if the item does not have one. + * + * @return parentBackdropItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentBackdropItemId() { + return parentBackdropItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentBackdropItemId(@org.eclipse.jdt.annotation.NonNull String parentBackdropItemId) { + this.parentBackdropItemId = parentBackdropItemId; + } + + public SeriesTimerInfoDto parentBackdropImageTags( + @org.eclipse.jdt.annotation.NonNull List parentBackdropImageTags) { + this.parentBackdropImageTags = parentBackdropImageTags; + return this; + } + + public SeriesTimerInfoDto addParentBackdropImageTagsItem(String parentBackdropImageTagsItem) { + if (this.parentBackdropImageTags == null) { + this.parentBackdropImageTags = new ArrayList<>(); + } + this.parentBackdropImageTags.add(parentBackdropImageTagsItem); + return this; + } + + /** + * Gets or sets the parent backdrop image tags. + * + * @return parentBackdropImageTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getParentBackdropImageTags() { + return parentBackdropImageTags; + } + + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentBackdropImageTags(@org.eclipse.jdt.annotation.NonNull List parentBackdropImageTags) { + this.parentBackdropImageTags = parentBackdropImageTags; + } + + public SeriesTimerInfoDto isPostPaddingRequired(@org.eclipse.jdt.annotation.NonNull Boolean isPostPaddingRequired) { + this.isPostPaddingRequired = isPostPaddingRequired; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is post padding required. + * + * @return isPostPaddingRequired + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_POST_PADDING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPostPaddingRequired() { + return isPostPaddingRequired; + } + + @JsonProperty(JSON_PROPERTY_IS_POST_PADDING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPostPaddingRequired(@org.eclipse.jdt.annotation.NonNull Boolean isPostPaddingRequired) { + this.isPostPaddingRequired = isPostPaddingRequired; + } + + public SeriesTimerInfoDto keepUntil(@org.eclipse.jdt.annotation.NonNull KeepUntil keepUntil) { + this.keepUntil = keepUntil; + return this; + } + + /** + * Get keepUntil + * + * @return keepUntil + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KEEP_UNTIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public KeepUntil getKeepUntil() { + return keepUntil; + } + + @JsonProperty(JSON_PROPERTY_KEEP_UNTIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKeepUntil(@org.eclipse.jdt.annotation.NonNull KeepUntil keepUntil) { + this.keepUntil = keepUntil; + } + + public SeriesTimerInfoDto recordAnyTime(@org.eclipse.jdt.annotation.NonNull Boolean recordAnyTime) { + this.recordAnyTime = recordAnyTime; + return this; + } + + /** + * Gets or sets a value indicating whether [record any time]. + * + * @return recordAnyTime + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RECORD_ANY_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRecordAnyTime() { + return recordAnyTime; + } + + @JsonProperty(JSON_PROPERTY_RECORD_ANY_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecordAnyTime(@org.eclipse.jdt.annotation.NonNull Boolean recordAnyTime) { + this.recordAnyTime = recordAnyTime; + } + + public SeriesTimerInfoDto skipEpisodesInLibrary(@org.eclipse.jdt.annotation.NonNull Boolean skipEpisodesInLibrary) { + this.skipEpisodesInLibrary = skipEpisodesInLibrary; + return this; + } + + /** + * Get skipEpisodesInLibrary + * + * @return skipEpisodesInLibrary + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SKIP_EPISODES_IN_LIBRARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSkipEpisodesInLibrary() { + return skipEpisodesInLibrary; + } + + @JsonProperty(JSON_PROPERTY_SKIP_EPISODES_IN_LIBRARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipEpisodesInLibrary(@org.eclipse.jdt.annotation.NonNull Boolean skipEpisodesInLibrary) { + this.skipEpisodesInLibrary = skipEpisodesInLibrary; + } + + public SeriesTimerInfoDto recordAnyChannel(@org.eclipse.jdt.annotation.NonNull Boolean recordAnyChannel) { + this.recordAnyChannel = recordAnyChannel; + return this; + } + + /** + * Gets or sets a value indicating whether [record any channel]. + * + * @return recordAnyChannel + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RECORD_ANY_CHANNEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRecordAnyChannel() { + return recordAnyChannel; + } + + @JsonProperty(JSON_PROPERTY_RECORD_ANY_CHANNEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecordAnyChannel(@org.eclipse.jdt.annotation.NonNull Boolean recordAnyChannel) { + this.recordAnyChannel = recordAnyChannel; + } + + public SeriesTimerInfoDto keepUpTo(@org.eclipse.jdt.annotation.NonNull Integer keepUpTo) { + this.keepUpTo = keepUpTo; + return this; + } + + /** + * Get keepUpTo + * + * @return keepUpTo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KEEP_UP_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getKeepUpTo() { + return keepUpTo; + } + + @JsonProperty(JSON_PROPERTY_KEEP_UP_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKeepUpTo(@org.eclipse.jdt.annotation.NonNull Integer keepUpTo) { + this.keepUpTo = keepUpTo; + } + + public SeriesTimerInfoDto recordNewOnly(@org.eclipse.jdt.annotation.NonNull Boolean recordNewOnly) { + this.recordNewOnly = recordNewOnly; + return this; + } + + /** + * Gets or sets a value indicating whether [record new only]. + * + * @return recordNewOnly + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RECORD_NEW_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRecordNewOnly() { + return recordNewOnly; + } + + @JsonProperty(JSON_PROPERTY_RECORD_NEW_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecordNewOnly(@org.eclipse.jdt.annotation.NonNull Boolean recordNewOnly) { + this.recordNewOnly = recordNewOnly; + } + + public SeriesTimerInfoDto days(@org.eclipse.jdt.annotation.NonNull List days) { + this.days = days; + return this; + } + + public SeriesTimerInfoDto addDaysItem(DayOfWeek daysItem) { + if (this.days == null) { + this.days = new ArrayList<>(); + } + this.days.add(daysItem); + return this; + } + + /** + * Gets or sets the days. + * + * @return days + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDays() { + return days; + } + + @JsonProperty(JSON_PROPERTY_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDays(@org.eclipse.jdt.annotation.NonNull List days) { + this.days = days; + } + + public SeriesTimerInfoDto dayPattern(@org.eclipse.jdt.annotation.NonNull DayPattern dayPattern) { + this.dayPattern = dayPattern; + return this; + } + + /** + * Gets or sets the day pattern. + * + * @return dayPattern + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DAY_PATTERN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DayPattern getDayPattern() { + return dayPattern; + } + + @JsonProperty(JSON_PROPERTY_DAY_PATTERN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDayPattern(@org.eclipse.jdt.annotation.NonNull DayPattern dayPattern) { + this.dayPattern = dayPattern; + } + + public SeriesTimerInfoDto imageTags(@org.eclipse.jdt.annotation.NonNull Map imageTags) { + this.imageTags = imageTags; + return this; + } + + public SeriesTimerInfoDto putImageTagsItem(String key, String imageTagsItem) { + if (this.imageTags == null) { + this.imageTags = new HashMap<>(); + } + this.imageTags.put(key, imageTagsItem); + return this; + } + + /** + * Gets or sets the image tags. + * + * @return imageTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getImageTags() { + return imageTags; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageTags(@org.eclipse.jdt.annotation.NonNull Map imageTags) { + this.imageTags = imageTags; + } + + public SeriesTimerInfoDto parentThumbItemId(@org.eclipse.jdt.annotation.NonNull String parentThumbItemId) { + this.parentThumbItemId = parentThumbItemId; + return this; + } + + /** + * Gets or sets the parent thumb item id. + * + * @return parentThumbItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_THUMB_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentThumbItemId() { + return parentThumbItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_THUMB_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentThumbItemId(@org.eclipse.jdt.annotation.NonNull String parentThumbItemId) { + this.parentThumbItemId = parentThumbItemId; + } + + public SeriesTimerInfoDto parentThumbImageTag(@org.eclipse.jdt.annotation.NonNull String parentThumbImageTag) { + this.parentThumbImageTag = parentThumbImageTag; + return this; + } + + /** + * Gets or sets the parent thumb image tag. + * + * @return parentThumbImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_THUMB_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentThumbImageTag() { + return parentThumbImageTag; + } + + @JsonProperty(JSON_PROPERTY_PARENT_THUMB_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentThumbImageTag(@org.eclipse.jdt.annotation.NonNull String parentThumbImageTag) { + this.parentThumbImageTag = parentThumbImageTag; + } + + public SeriesTimerInfoDto parentPrimaryImageItemId( + @org.eclipse.jdt.annotation.NonNull String parentPrimaryImageItemId) { + this.parentPrimaryImageItemId = parentPrimaryImageItemId; + return this; + } + + /** + * Gets or sets the parent primary image item identifier. + * + * @return parentPrimaryImageItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_PRIMARY_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentPrimaryImageItemId() { + return parentPrimaryImageItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_PRIMARY_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentPrimaryImageItemId(@org.eclipse.jdt.annotation.NonNull String parentPrimaryImageItemId) { + this.parentPrimaryImageItemId = parentPrimaryImageItemId; + } + + public SeriesTimerInfoDto parentPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String parentPrimaryImageTag) { + this.parentPrimaryImageTag = parentPrimaryImageTag; + return this; + } + + /** + * Gets or sets the parent primary image tag. + * + * @return parentPrimaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentPrimaryImageTag() { + return parentPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_PARENT_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String parentPrimaryImageTag) { + this.parentPrimaryImageTag = parentPrimaryImageTag; + } + + /** + * Return true if this SeriesTimerInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SeriesTimerInfoDto seriesTimerInfoDto = (SeriesTimerInfoDto) o; + return Objects.equals(this.id, seriesTimerInfoDto.id) && Objects.equals(this.type, seriesTimerInfoDto.type) + && Objects.equals(this.serverId, seriesTimerInfoDto.serverId) + && Objects.equals(this.externalId, seriesTimerInfoDto.externalId) + && Objects.equals(this.channelId, seriesTimerInfoDto.channelId) + && Objects.equals(this.externalChannelId, seriesTimerInfoDto.externalChannelId) + && Objects.equals(this.channelName, seriesTimerInfoDto.channelName) + && Objects.equals(this.channelPrimaryImageTag, seriesTimerInfoDto.channelPrimaryImageTag) + && Objects.equals(this.programId, seriesTimerInfoDto.programId) + && Objects.equals(this.externalProgramId, seriesTimerInfoDto.externalProgramId) + && Objects.equals(this.name, seriesTimerInfoDto.name) + && Objects.equals(this.overview, seriesTimerInfoDto.overview) + && Objects.equals(this.startDate, seriesTimerInfoDto.startDate) + && Objects.equals(this.endDate, seriesTimerInfoDto.endDate) + && Objects.equals(this.serviceName, seriesTimerInfoDto.serviceName) + && Objects.equals(this.priority, seriesTimerInfoDto.priority) + && Objects.equals(this.prePaddingSeconds, seriesTimerInfoDto.prePaddingSeconds) + && Objects.equals(this.postPaddingSeconds, seriesTimerInfoDto.postPaddingSeconds) + && Objects.equals(this.isPrePaddingRequired, seriesTimerInfoDto.isPrePaddingRequired) + && Objects.equals(this.parentBackdropItemId, seriesTimerInfoDto.parentBackdropItemId) + && Objects.equals(this.parentBackdropImageTags, seriesTimerInfoDto.parentBackdropImageTags) + && Objects.equals(this.isPostPaddingRequired, seriesTimerInfoDto.isPostPaddingRequired) + && Objects.equals(this.keepUntil, seriesTimerInfoDto.keepUntil) + && Objects.equals(this.recordAnyTime, seriesTimerInfoDto.recordAnyTime) + && Objects.equals(this.skipEpisodesInLibrary, seriesTimerInfoDto.skipEpisodesInLibrary) + && Objects.equals(this.recordAnyChannel, seriesTimerInfoDto.recordAnyChannel) + && Objects.equals(this.keepUpTo, seriesTimerInfoDto.keepUpTo) + && Objects.equals(this.recordNewOnly, seriesTimerInfoDto.recordNewOnly) + && Objects.equals(this.days, seriesTimerInfoDto.days) + && Objects.equals(this.dayPattern, seriesTimerInfoDto.dayPattern) + && Objects.equals(this.imageTags, seriesTimerInfoDto.imageTags) + && Objects.equals(this.parentThumbItemId, seriesTimerInfoDto.parentThumbItemId) + && Objects.equals(this.parentThumbImageTag, seriesTimerInfoDto.parentThumbImageTag) + && Objects.equals(this.parentPrimaryImageItemId, seriesTimerInfoDto.parentPrimaryImageItemId) + && Objects.equals(this.parentPrimaryImageTag, seriesTimerInfoDto.parentPrimaryImageTag); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, serverId, externalId, channelId, externalChannelId, channelName, + channelPrimaryImageTag, programId, externalProgramId, name, overview, startDate, endDate, serviceName, + priority, prePaddingSeconds, postPaddingSeconds, isPrePaddingRequired, parentBackdropItemId, + parentBackdropImageTags, isPostPaddingRequired, keepUntil, recordAnyTime, skipEpisodesInLibrary, + recordAnyChannel, keepUpTo, recordNewOnly, days, dayPattern, imageTags, parentThumbItemId, + parentThumbImageTag, parentPrimaryImageItemId, parentPrimaryImageTag); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SeriesTimerInfoDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n"); + sb.append(" channelId: ").append(toIndentedString(channelId)).append("\n"); + sb.append(" externalChannelId: ").append(toIndentedString(externalChannelId)).append("\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" channelPrimaryImageTag: ").append(toIndentedString(channelPrimaryImageTag)).append("\n"); + sb.append(" programId: ").append(toIndentedString(programId)).append("\n"); + sb.append(" externalProgramId: ").append(toIndentedString(externalProgramId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" overview: ").append(toIndentedString(overview)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" serviceName: ").append(toIndentedString(serviceName)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" prePaddingSeconds: ").append(toIndentedString(prePaddingSeconds)).append("\n"); + sb.append(" postPaddingSeconds: ").append(toIndentedString(postPaddingSeconds)).append("\n"); + sb.append(" isPrePaddingRequired: ").append(toIndentedString(isPrePaddingRequired)).append("\n"); + sb.append(" parentBackdropItemId: ").append(toIndentedString(parentBackdropItemId)).append("\n"); + sb.append(" parentBackdropImageTags: ").append(toIndentedString(parentBackdropImageTags)).append("\n"); + sb.append(" isPostPaddingRequired: ").append(toIndentedString(isPostPaddingRequired)).append("\n"); + sb.append(" keepUntil: ").append(toIndentedString(keepUntil)).append("\n"); + sb.append(" recordAnyTime: ").append(toIndentedString(recordAnyTime)).append("\n"); + sb.append(" skipEpisodesInLibrary: ").append(toIndentedString(skipEpisodesInLibrary)).append("\n"); + sb.append(" recordAnyChannel: ").append(toIndentedString(recordAnyChannel)).append("\n"); + sb.append(" keepUpTo: ").append(toIndentedString(keepUpTo)).append("\n"); + sb.append(" recordNewOnly: ").append(toIndentedString(recordNewOnly)).append("\n"); + sb.append(" days: ").append(toIndentedString(days)).append("\n"); + sb.append(" dayPattern: ").append(toIndentedString(dayPattern)).append("\n"); + sb.append(" imageTags: ").append(toIndentedString(imageTags)).append("\n"); + sb.append(" parentThumbItemId: ").append(toIndentedString(parentThumbItemId)).append("\n"); + sb.append(" parentThumbImageTag: ").append(toIndentedString(parentThumbImageTag)).append("\n"); + sb.append(" parentPrimaryImageItemId: ").append(toIndentedString(parentPrimaryImageItemId)).append("\n"); + sb.append(" parentPrimaryImageTag: ").append(toIndentedString(parentPrimaryImageTag)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `ServerId` to the URL query string + if (getServerId() != null) { + joiner.add(String.format("%sServerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerId())))); + } + + // add `ExternalId` to the URL query string + if (getExternalId() != null) { + joiner.add(String.format("%sExternalId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExternalId())))); + } + + // add `ChannelId` to the URL query string + if (getChannelId() != null) { + joiner.add(String.format("%sChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelId())))); + } + + // add `ExternalChannelId` to the URL query string + if (getExternalChannelId() != null) { + joiner.add(String.format("%sExternalChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExternalChannelId())))); + } + + // add `ChannelName` to the URL query string + if (getChannelName() != null) { + joiner.add(String.format("%sChannelName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelName())))); + } + + // add `ChannelPrimaryImageTag` to the URL query string + if (getChannelPrimaryImageTag() != null) { + joiner.add(String.format("%sChannelPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelPrimaryImageTag())))); + } + + // add `ProgramId` to the URL query string + if (getProgramId() != null) { + joiner.add(String.format("%sProgramId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProgramId())))); + } + + // add `ExternalProgramId` to the URL query string + if (getExternalProgramId() != null) { + joiner.add(String.format("%sExternalProgramId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExternalProgramId())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Overview` to the URL query string + if (getOverview() != null) { + joiner.add(String.format("%sOverview%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOverview())))); + } + + // add `StartDate` to the URL query string + if (getStartDate() != null) { + joiner.add(String.format("%sStartDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartDate())))); + } + + // add `EndDate` to the URL query string + if (getEndDate() != null) { + joiner.add(String.format("%sEndDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndDate())))); + } + + // add `ServiceName` to the URL query string + if (getServiceName() != null) { + joiner.add(String.format("%sServiceName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServiceName())))); + } + + // add `Priority` to the URL query string + if (getPriority() != null) { + joiner.add(String.format("%sPriority%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPriority())))); + } + + // add `PrePaddingSeconds` to the URL query string + if (getPrePaddingSeconds() != null) { + joiner.add(String.format("%sPrePaddingSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrePaddingSeconds())))); + } + + // add `PostPaddingSeconds` to the URL query string + if (getPostPaddingSeconds() != null) { + joiner.add(String.format("%sPostPaddingSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPostPaddingSeconds())))); + } + + // add `IsPrePaddingRequired` to the URL query string + if (getIsPrePaddingRequired() != null) { + joiner.add(String.format("%sIsPrePaddingRequired%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPrePaddingRequired())))); + } + + // add `ParentBackdropItemId` to the URL query string + if (getParentBackdropItemId() != null) { + joiner.add(String.format("%sParentBackdropItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentBackdropItemId())))); + } + + // add `ParentBackdropImageTags` to the URL query string + if (getParentBackdropImageTags() != null) { + for (int i = 0; i < getParentBackdropImageTags().size(); i++) { + joiner.add(String.format("%sParentBackdropImageTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getParentBackdropImageTags().get(i))))); + } + } + + // add `IsPostPaddingRequired` to the URL query string + if (getIsPostPaddingRequired() != null) { + joiner.add(String.format("%sIsPostPaddingRequired%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPostPaddingRequired())))); + } + + // add `KeepUntil` to the URL query string + if (getKeepUntil() != null) { + joiner.add(String.format("%sKeepUntil%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getKeepUntil())))); + } + + // add `RecordAnyTime` to the URL query string + if (getRecordAnyTime() != null) { + joiner.add(String.format("%sRecordAnyTime%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRecordAnyTime())))); + } + + // add `SkipEpisodesInLibrary` to the URL query string + if (getSkipEpisodesInLibrary() != null) { + joiner.add(String.format("%sSkipEpisodesInLibrary%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSkipEpisodesInLibrary())))); + } + + // add `RecordAnyChannel` to the URL query string + if (getRecordAnyChannel() != null) { + joiner.add(String.format("%sRecordAnyChannel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRecordAnyChannel())))); + } + + // add `KeepUpTo` to the URL query string + if (getKeepUpTo() != null) { + joiner.add(String.format("%sKeepUpTo%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getKeepUpTo())))); + } + + // add `RecordNewOnly` to the URL query string + if (getRecordNewOnly() != null) { + joiner.add(String.format("%sRecordNewOnly%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRecordNewOnly())))); + } + + // add `Days` to the URL query string + if (getDays() != null) { + for (int i = 0; i < getDays().size(); i++) { + if (getDays().get(i) != null) { + joiner.add(String.format("%sDays%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDays().get(i))))); + } + } + } + + // add `DayPattern` to the URL query string + if (getDayPattern() != null) { + joiner.add(String.format("%sDayPattern%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDayPattern())))); + } + + // add `ImageTags` to the URL query string + if (getImageTags() != null) { + for (String _key : getImageTags().keySet()) { + joiner.add(String.format("%sImageTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getImageTags().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getImageTags().get(_key))))); + } + } + + // add `ParentThumbItemId` to the URL query string + if (getParentThumbItemId() != null) { + joiner.add(String.format("%sParentThumbItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentThumbItemId())))); + } + + // add `ParentThumbImageTag` to the URL query string + if (getParentThumbImageTag() != null) { + joiner.add(String.format("%sParentThumbImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentThumbImageTag())))); + } + + // add `ParentPrimaryImageItemId` to the URL query string + if (getParentPrimaryImageItemId() != null) { + joiner.add(String.format("%sParentPrimaryImageItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentPrimaryImageItemId())))); + } + + // add `ParentPrimaryImageTag` to the URL query string + if (getParentPrimaryImageTag() != null) { + joiner.add(String.format("%sParentPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentPrimaryImageTag())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SeriesTimerInfoDto instance; + + public Builder() { + this(new SeriesTimerInfoDto()); + } + + protected Builder(SeriesTimerInfoDto instance) { + this.instance = instance; + } + + public SeriesTimerInfoDto.Builder id(String id) { + this.instance.id = id; + return this; + } + + public SeriesTimerInfoDto.Builder type(String type) { + this.instance.type = type; + return this; + } + + public SeriesTimerInfoDto.Builder serverId(String serverId) { + this.instance.serverId = serverId; + return this; + } + + public SeriesTimerInfoDto.Builder externalId(String externalId) { + this.instance.externalId = externalId; + return this; + } + + public SeriesTimerInfoDto.Builder channelId(UUID channelId) { + this.instance.channelId = channelId; + return this; + } + + public SeriesTimerInfoDto.Builder externalChannelId(String externalChannelId) { + this.instance.externalChannelId = externalChannelId; + return this; + } + + public SeriesTimerInfoDto.Builder channelName(String channelName) { + this.instance.channelName = channelName; + return this; + } + + public SeriesTimerInfoDto.Builder channelPrimaryImageTag(String channelPrimaryImageTag) { + this.instance.channelPrimaryImageTag = channelPrimaryImageTag; + return this; + } + + public SeriesTimerInfoDto.Builder programId(String programId) { + this.instance.programId = programId; + return this; + } + + public SeriesTimerInfoDto.Builder externalProgramId(String externalProgramId) { + this.instance.externalProgramId = externalProgramId; + return this; + } + + public SeriesTimerInfoDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public SeriesTimerInfoDto.Builder overview(String overview) { + this.instance.overview = overview; + return this; + } + + public SeriesTimerInfoDto.Builder startDate(OffsetDateTime startDate) { + this.instance.startDate = startDate; + return this; + } + + public SeriesTimerInfoDto.Builder endDate(OffsetDateTime endDate) { + this.instance.endDate = endDate; + return this; + } + + public SeriesTimerInfoDto.Builder serviceName(String serviceName) { + this.instance.serviceName = serviceName; + return this; + } + + public SeriesTimerInfoDto.Builder priority(Integer priority) { + this.instance.priority = priority; + return this; + } + + public SeriesTimerInfoDto.Builder prePaddingSeconds(Integer prePaddingSeconds) { + this.instance.prePaddingSeconds = prePaddingSeconds; + return this; + } + + public SeriesTimerInfoDto.Builder postPaddingSeconds(Integer postPaddingSeconds) { + this.instance.postPaddingSeconds = postPaddingSeconds; + return this; + } + + public SeriesTimerInfoDto.Builder isPrePaddingRequired(Boolean isPrePaddingRequired) { + this.instance.isPrePaddingRequired = isPrePaddingRequired; + return this; + } + + public SeriesTimerInfoDto.Builder parentBackdropItemId(String parentBackdropItemId) { + this.instance.parentBackdropItemId = parentBackdropItemId; + return this; + } + + public SeriesTimerInfoDto.Builder parentBackdropImageTags(List parentBackdropImageTags) { + this.instance.parentBackdropImageTags = parentBackdropImageTags; + return this; + } + + public SeriesTimerInfoDto.Builder isPostPaddingRequired(Boolean isPostPaddingRequired) { + this.instance.isPostPaddingRequired = isPostPaddingRequired; + return this; + } + + public SeriesTimerInfoDto.Builder keepUntil(KeepUntil keepUntil) { + this.instance.keepUntil = keepUntil; + return this; + } + + public SeriesTimerInfoDto.Builder recordAnyTime(Boolean recordAnyTime) { + this.instance.recordAnyTime = recordAnyTime; + return this; + } + + public SeriesTimerInfoDto.Builder skipEpisodesInLibrary(Boolean skipEpisodesInLibrary) { + this.instance.skipEpisodesInLibrary = skipEpisodesInLibrary; + return this; + } + + public SeriesTimerInfoDto.Builder recordAnyChannel(Boolean recordAnyChannel) { + this.instance.recordAnyChannel = recordAnyChannel; + return this; + } + + public SeriesTimerInfoDto.Builder keepUpTo(Integer keepUpTo) { + this.instance.keepUpTo = keepUpTo; + return this; + } + + public SeriesTimerInfoDto.Builder recordNewOnly(Boolean recordNewOnly) { + this.instance.recordNewOnly = recordNewOnly; + return this; + } + + public SeriesTimerInfoDto.Builder days(List days) { + this.instance.days = days; + return this; + } + + public SeriesTimerInfoDto.Builder dayPattern(DayPattern dayPattern) { + this.instance.dayPattern = dayPattern; + return this; + } + + public SeriesTimerInfoDto.Builder imageTags(Map imageTags) { + this.instance.imageTags = imageTags; + return this; + } + + public SeriesTimerInfoDto.Builder parentThumbItemId(String parentThumbItemId) { + this.instance.parentThumbItemId = parentThumbItemId; + return this; + } + + public SeriesTimerInfoDto.Builder parentThumbImageTag(String parentThumbImageTag) { + this.instance.parentThumbImageTag = parentThumbImageTag; + return this; + } + + public SeriesTimerInfoDto.Builder parentPrimaryImageItemId(String parentPrimaryImageItemId) { + this.instance.parentPrimaryImageItemId = parentPrimaryImageItemId; + return this; + } + + public SeriesTimerInfoDto.Builder parentPrimaryImageTag(String parentPrimaryImageTag) { + this.instance.parentPrimaryImageTag = parentPrimaryImageTag; + return this; + } + + /** + * returns a built SeriesTimerInfoDto instance. + * + * The builder is not reusable. + */ + public SeriesTimerInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SeriesTimerInfoDto.Builder builder() { + return new SeriesTimerInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SeriesTimerInfoDto.Builder toBuilder() { + return new SeriesTimerInfoDto.Builder().id(getId()).type(getType()).serverId(getServerId()) + .externalId(getExternalId()).channelId(getChannelId()).externalChannelId(getExternalChannelId()) + .channelName(getChannelName()).channelPrimaryImageTag(getChannelPrimaryImageTag()) + .programId(getProgramId()).externalProgramId(getExternalProgramId()).name(getName()) + .overview(getOverview()).startDate(getStartDate()).endDate(getEndDate()).serviceName(getServiceName()) + .priority(getPriority()).prePaddingSeconds(getPrePaddingSeconds()) + .postPaddingSeconds(getPostPaddingSeconds()).isPrePaddingRequired(getIsPrePaddingRequired()) + .parentBackdropItemId(getParentBackdropItemId()).parentBackdropImageTags(getParentBackdropImageTags()) + .isPostPaddingRequired(getIsPostPaddingRequired()).keepUntil(getKeepUntil()) + .recordAnyTime(getRecordAnyTime()).skipEpisodesInLibrary(getSkipEpisodesInLibrary()) + .recordAnyChannel(getRecordAnyChannel()).keepUpTo(getKeepUpTo()).recordNewOnly(getRecordNewOnly()) + .days(getDays()).dayPattern(getDayPattern()).imageTags(getImageTags()) + .parentThumbItemId(getParentThumbItemId()).parentThumbImageTag(getParentThumbImageTag()) + .parentPrimaryImageItemId(getParentPrimaryImageItemId()) + .parentPrimaryImageTag(getParentPrimaryImageTag()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesTimerInfoDtoQueryResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesTimerInfoDtoQueryResult.java new file mode 100644 index 0000000000000..809cc08299b8f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SeriesTimerInfoDtoQueryResult.java @@ -0,0 +1,290 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Query result container. + */ +@JsonPropertyOrder({ SeriesTimerInfoDtoQueryResult.JSON_PROPERTY_ITEMS, + SeriesTimerInfoDtoQueryResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, + SeriesTimerInfoDtoQueryResult.JSON_PROPERTY_START_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SeriesTimerInfoDtoQueryResult { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public SeriesTimerInfoDtoQueryResult() { + } + + public SeriesTimerInfoDtoQueryResult items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public SeriesTimerInfoDtoQueryResult addItemsItem(SeriesTimerInfoDto itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Gets or sets the items. + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public SeriesTimerInfoDtoQueryResult totalRecordCount( + @org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total number of records available. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public SeriesTimerInfoDtoQueryResult startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the index of the first record in Items. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + /** + * Return true if this SeriesTimerInfoDtoQueryResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SeriesTimerInfoDtoQueryResult seriesTimerInfoDtoQueryResult = (SeriesTimerInfoDtoQueryResult) o; + return Objects.equals(this.items, seriesTimerInfoDtoQueryResult.items) + && Objects.equals(this.totalRecordCount, seriesTimerInfoDtoQueryResult.totalRecordCount) + && Objects.equals(this.startIndex, seriesTimerInfoDtoQueryResult.startIndex); + } + + @Override + public int hashCode() { + return Objects.hash(items, totalRecordCount, startIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SeriesTimerInfoDtoQueryResult {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SeriesTimerInfoDtoQueryResult instance; + + public Builder() { + this(new SeriesTimerInfoDtoQueryResult()); + } + + protected Builder(SeriesTimerInfoDtoQueryResult instance) { + this.instance = instance; + } + + public SeriesTimerInfoDtoQueryResult.Builder items(List items) { + this.instance.items = items; + return this; + } + + public SeriesTimerInfoDtoQueryResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public SeriesTimerInfoDtoQueryResult.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + /** + * returns a built SeriesTimerInfoDtoQueryResult instance. + * + * The builder is not reusable. + */ + public SeriesTimerInfoDtoQueryResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SeriesTimerInfoDtoQueryResult.Builder builder() { + return new SeriesTimerInfoDtoQueryResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SeriesTimerInfoDtoQueryResult.Builder toBuilder() { + return new SeriesTimerInfoDtoQueryResult.Builder().items(getItems()).totalRecordCount(getTotalRecordCount()) + .startIndex(getStartIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ServerConfiguration.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ServerConfiguration.java new file mode 100644 index 0000000000000..8420df21aafa2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ServerConfiguration.java @@ -0,0 +1,2577 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Represents the server configuration. + */ +@JsonPropertyOrder({ ServerConfiguration.JSON_PROPERTY_LOG_FILE_RETENTION_DAYS, + ServerConfiguration.JSON_PROPERTY_IS_STARTUP_WIZARD_COMPLETED, ServerConfiguration.JSON_PROPERTY_CACHE_PATH, + ServerConfiguration.JSON_PROPERTY_PREVIOUS_VERSION, ServerConfiguration.JSON_PROPERTY_PREVIOUS_VERSION_STR, + ServerConfiguration.JSON_PROPERTY_ENABLE_METRICS, + ServerConfiguration.JSON_PROPERTY_ENABLE_NORMALIZED_ITEM_BY_NAME_IDS, + ServerConfiguration.JSON_PROPERTY_IS_PORT_AUTHORIZED, ServerConfiguration.JSON_PROPERTY_QUICK_CONNECT_AVAILABLE, + ServerConfiguration.JSON_PROPERTY_ENABLE_CASE_SENSITIVE_ITEM_IDS, + ServerConfiguration.JSON_PROPERTY_DISABLE_LIVE_TV_CHANNEL_USER_DATA_NAME, + ServerConfiguration.JSON_PROPERTY_METADATA_PATH, ServerConfiguration.JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE, + ServerConfiguration.JSON_PROPERTY_METADATA_COUNTRY_CODE, + ServerConfiguration.JSON_PROPERTY_SORT_REPLACE_CHARACTERS, + ServerConfiguration.JSON_PROPERTY_SORT_REMOVE_CHARACTERS, ServerConfiguration.JSON_PROPERTY_SORT_REMOVE_WORDS, + ServerConfiguration.JSON_PROPERTY_MIN_RESUME_PCT, ServerConfiguration.JSON_PROPERTY_MAX_RESUME_PCT, + ServerConfiguration.JSON_PROPERTY_MIN_RESUME_DURATION_SECONDS, + ServerConfiguration.JSON_PROPERTY_MIN_AUDIOBOOK_RESUME, ServerConfiguration.JSON_PROPERTY_MAX_AUDIOBOOK_RESUME, + ServerConfiguration.JSON_PROPERTY_INACTIVE_SESSION_THRESHOLD, + ServerConfiguration.JSON_PROPERTY_LIBRARY_MONITOR_DELAY, + ServerConfiguration.JSON_PROPERTY_LIBRARY_UPDATE_DURATION, + ServerConfiguration.JSON_PROPERTY_IMAGE_SAVING_CONVENTION, ServerConfiguration.JSON_PROPERTY_METADATA_OPTIONS, + ServerConfiguration.JSON_PROPERTY_SKIP_DESERIALIZATION_FOR_BASIC_TYPES, + ServerConfiguration.JSON_PROPERTY_SERVER_NAME, ServerConfiguration.JSON_PROPERTY_UI_CULTURE, + ServerConfiguration.JSON_PROPERTY_SAVE_METADATA_HIDDEN, ServerConfiguration.JSON_PROPERTY_CONTENT_TYPES, + ServerConfiguration.JSON_PROPERTY_REMOTE_CLIENT_BITRATE_LIMIT, + ServerConfiguration.JSON_PROPERTY_ENABLE_FOLDER_VIEW, + ServerConfiguration.JSON_PROPERTY_ENABLE_GROUPING_INTO_COLLECTIONS, + ServerConfiguration.JSON_PROPERTY_DISPLAY_SPECIALS_WITHIN_SEASONS, + ServerConfiguration.JSON_PROPERTY_CODECS_USED, ServerConfiguration.JSON_PROPERTY_PLUGIN_REPOSITORIES, + ServerConfiguration.JSON_PROPERTY_ENABLE_EXTERNAL_CONTENT_IN_SUGGESTIONS, + ServerConfiguration.JSON_PROPERTY_IMAGE_EXTRACTION_TIMEOUT_MS, + ServerConfiguration.JSON_PROPERTY_PATH_SUBSTITUTIONS, + ServerConfiguration.JSON_PROPERTY_ENABLE_SLOW_RESPONSE_WARNING, + ServerConfiguration.JSON_PROPERTY_SLOW_RESPONSE_THRESHOLD_MS, ServerConfiguration.JSON_PROPERTY_CORS_HOSTS, + ServerConfiguration.JSON_PROPERTY_ACTIVITY_LOG_RETENTION_DAYS, + ServerConfiguration.JSON_PROPERTY_LIBRARY_SCAN_FANOUT_CONCURRENCY, + ServerConfiguration.JSON_PROPERTY_LIBRARY_METADATA_REFRESH_CONCURRENCY, + ServerConfiguration.JSON_PROPERTY_REMOVE_OLD_PLUGINS, ServerConfiguration.JSON_PROPERTY_ALLOW_CLIENT_LOG_UPLOAD, + ServerConfiguration.JSON_PROPERTY_DUMMY_CHAPTER_DURATION, + ServerConfiguration.JSON_PROPERTY_CHAPTER_IMAGE_RESOLUTION, + ServerConfiguration.JSON_PROPERTY_PARALLEL_IMAGE_ENCODING_LIMIT, + ServerConfiguration.JSON_PROPERTY_CAST_RECEIVER_APPLICATIONS, + ServerConfiguration.JSON_PROPERTY_TRICKPLAY_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ServerConfiguration { + public static final String JSON_PROPERTY_LOG_FILE_RETENTION_DAYS = "LogFileRetentionDays"; + @org.eclipse.jdt.annotation.NonNull + private Integer logFileRetentionDays; + + public static final String JSON_PROPERTY_IS_STARTUP_WIZARD_COMPLETED = "IsStartupWizardCompleted"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isStartupWizardCompleted; + + public static final String JSON_PROPERTY_CACHE_PATH = "CachePath"; + @org.eclipse.jdt.annotation.NonNull + private String cachePath; + + public static final String JSON_PROPERTY_PREVIOUS_VERSION = "PreviousVersion"; + @org.eclipse.jdt.annotation.NonNull + private String previousVersion; + + public static final String JSON_PROPERTY_PREVIOUS_VERSION_STR = "PreviousVersionStr"; + @org.eclipse.jdt.annotation.NonNull + private String previousVersionStr; + + public static final String JSON_PROPERTY_ENABLE_METRICS = "EnableMetrics"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableMetrics; + + public static final String JSON_PROPERTY_ENABLE_NORMALIZED_ITEM_BY_NAME_IDS = "EnableNormalizedItemByNameIds"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableNormalizedItemByNameIds; + + public static final String JSON_PROPERTY_IS_PORT_AUTHORIZED = "IsPortAuthorized"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPortAuthorized; + + public static final String JSON_PROPERTY_QUICK_CONNECT_AVAILABLE = "QuickConnectAvailable"; + @org.eclipse.jdt.annotation.NonNull + private Boolean quickConnectAvailable; + + public static final String JSON_PROPERTY_ENABLE_CASE_SENSITIVE_ITEM_IDS = "EnableCaseSensitiveItemIds"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableCaseSensitiveItemIds; + + public static final String JSON_PROPERTY_DISABLE_LIVE_TV_CHANNEL_USER_DATA_NAME = "DisableLiveTvChannelUserDataName"; + @org.eclipse.jdt.annotation.NonNull + private Boolean disableLiveTvChannelUserDataName; + + public static final String JSON_PROPERTY_METADATA_PATH = "MetadataPath"; + @org.eclipse.jdt.annotation.NonNull + private String metadataPath; + + public static final String JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE = "PreferredMetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String preferredMetadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_SORT_REPLACE_CHARACTERS = "SortReplaceCharacters"; + @org.eclipse.jdt.annotation.NonNull + private List sortReplaceCharacters = new ArrayList<>(); + + public static final String JSON_PROPERTY_SORT_REMOVE_CHARACTERS = "SortRemoveCharacters"; + @org.eclipse.jdt.annotation.NonNull + private List sortRemoveCharacters = new ArrayList<>(); + + public static final String JSON_PROPERTY_SORT_REMOVE_WORDS = "SortRemoveWords"; + @org.eclipse.jdt.annotation.NonNull + private List sortRemoveWords = new ArrayList<>(); + + public static final String JSON_PROPERTY_MIN_RESUME_PCT = "MinResumePct"; + @org.eclipse.jdt.annotation.NonNull + private Integer minResumePct; + + public static final String JSON_PROPERTY_MAX_RESUME_PCT = "MaxResumePct"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxResumePct; + + public static final String JSON_PROPERTY_MIN_RESUME_DURATION_SECONDS = "MinResumeDurationSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer minResumeDurationSeconds; + + public static final String JSON_PROPERTY_MIN_AUDIOBOOK_RESUME = "MinAudiobookResume"; + @org.eclipse.jdt.annotation.NonNull + private Integer minAudiobookResume; + + public static final String JSON_PROPERTY_MAX_AUDIOBOOK_RESUME = "MaxAudiobookResume"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxAudiobookResume; + + public static final String JSON_PROPERTY_INACTIVE_SESSION_THRESHOLD = "InactiveSessionThreshold"; + @org.eclipse.jdt.annotation.NonNull + private Integer inactiveSessionThreshold; + + public static final String JSON_PROPERTY_LIBRARY_MONITOR_DELAY = "LibraryMonitorDelay"; + @org.eclipse.jdt.annotation.NonNull + private Integer libraryMonitorDelay; + + public static final String JSON_PROPERTY_LIBRARY_UPDATE_DURATION = "LibraryUpdateDuration"; + @org.eclipse.jdt.annotation.NonNull + private Integer libraryUpdateDuration; + + public static final String JSON_PROPERTY_IMAGE_SAVING_CONVENTION = "ImageSavingConvention"; + @org.eclipse.jdt.annotation.NonNull + private ImageSavingConvention imageSavingConvention; + + public static final String JSON_PROPERTY_METADATA_OPTIONS = "MetadataOptions"; + @org.eclipse.jdt.annotation.NonNull + private List metadataOptions = new ArrayList<>(); + + public static final String JSON_PROPERTY_SKIP_DESERIALIZATION_FOR_BASIC_TYPES = "SkipDeserializationForBasicTypes"; + @org.eclipse.jdt.annotation.NonNull + private Boolean skipDeserializationForBasicTypes; + + public static final String JSON_PROPERTY_SERVER_NAME = "ServerName"; + @org.eclipse.jdt.annotation.NonNull + private String serverName; + + public static final String JSON_PROPERTY_UI_CULTURE = "UICulture"; + @org.eclipse.jdt.annotation.NonNull + private String uiCulture; + + public static final String JSON_PROPERTY_SAVE_METADATA_HIDDEN = "SaveMetadataHidden"; + @org.eclipse.jdt.annotation.NonNull + private Boolean saveMetadataHidden; + + public static final String JSON_PROPERTY_CONTENT_TYPES = "ContentTypes"; + @org.eclipse.jdt.annotation.NonNull + private List contentTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_REMOTE_CLIENT_BITRATE_LIMIT = "RemoteClientBitrateLimit"; + @org.eclipse.jdt.annotation.NonNull + private Integer remoteClientBitrateLimit; + + public static final String JSON_PROPERTY_ENABLE_FOLDER_VIEW = "EnableFolderView"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableFolderView; + + public static final String JSON_PROPERTY_ENABLE_GROUPING_INTO_COLLECTIONS = "EnableGroupingIntoCollections"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableGroupingIntoCollections; + + public static final String JSON_PROPERTY_DISPLAY_SPECIALS_WITHIN_SEASONS = "DisplaySpecialsWithinSeasons"; + @org.eclipse.jdt.annotation.NonNull + private Boolean displaySpecialsWithinSeasons; + + public static final String JSON_PROPERTY_CODECS_USED = "CodecsUsed"; + @org.eclipse.jdt.annotation.NonNull + private List codecsUsed = new ArrayList<>(); + + public static final String JSON_PROPERTY_PLUGIN_REPOSITORIES = "PluginRepositories"; + @org.eclipse.jdt.annotation.NonNull + private List pluginRepositories = new ArrayList<>(); + + public static final String JSON_PROPERTY_ENABLE_EXTERNAL_CONTENT_IN_SUGGESTIONS = "EnableExternalContentInSuggestions"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableExternalContentInSuggestions; + + public static final String JSON_PROPERTY_IMAGE_EXTRACTION_TIMEOUT_MS = "ImageExtractionTimeoutMs"; + @org.eclipse.jdt.annotation.NonNull + private Integer imageExtractionTimeoutMs; + + public static final String JSON_PROPERTY_PATH_SUBSTITUTIONS = "PathSubstitutions"; + @org.eclipse.jdt.annotation.NonNull + private List pathSubstitutions = new ArrayList<>(); + + public static final String JSON_PROPERTY_ENABLE_SLOW_RESPONSE_WARNING = "EnableSlowResponseWarning"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableSlowResponseWarning; + + public static final String JSON_PROPERTY_SLOW_RESPONSE_THRESHOLD_MS = "SlowResponseThresholdMs"; + @org.eclipse.jdt.annotation.NonNull + private Long slowResponseThresholdMs; + + public static final String JSON_PROPERTY_CORS_HOSTS = "CorsHosts"; + @org.eclipse.jdt.annotation.NonNull + private List corsHosts = new ArrayList<>(); + + public static final String JSON_PROPERTY_ACTIVITY_LOG_RETENTION_DAYS = "ActivityLogRetentionDays"; + @org.eclipse.jdt.annotation.NonNull + private Integer activityLogRetentionDays; + + public static final String JSON_PROPERTY_LIBRARY_SCAN_FANOUT_CONCURRENCY = "LibraryScanFanoutConcurrency"; + @org.eclipse.jdt.annotation.NonNull + private Integer libraryScanFanoutConcurrency; + + public static final String JSON_PROPERTY_LIBRARY_METADATA_REFRESH_CONCURRENCY = "LibraryMetadataRefreshConcurrency"; + @org.eclipse.jdt.annotation.NonNull + private Integer libraryMetadataRefreshConcurrency; + + public static final String JSON_PROPERTY_REMOVE_OLD_PLUGINS = "RemoveOldPlugins"; + @org.eclipse.jdt.annotation.NonNull + private Boolean removeOldPlugins; + + public static final String JSON_PROPERTY_ALLOW_CLIENT_LOG_UPLOAD = "AllowClientLogUpload"; + @org.eclipse.jdt.annotation.NonNull + private Boolean allowClientLogUpload; + + public static final String JSON_PROPERTY_DUMMY_CHAPTER_DURATION = "DummyChapterDuration"; + @org.eclipse.jdt.annotation.NonNull + private Integer dummyChapterDuration; + + public static final String JSON_PROPERTY_CHAPTER_IMAGE_RESOLUTION = "ChapterImageResolution"; + @org.eclipse.jdt.annotation.NonNull + private ImageResolution chapterImageResolution; + + public static final String JSON_PROPERTY_PARALLEL_IMAGE_ENCODING_LIMIT = "ParallelImageEncodingLimit"; + @org.eclipse.jdt.annotation.NonNull + private Integer parallelImageEncodingLimit; + + public static final String JSON_PROPERTY_CAST_RECEIVER_APPLICATIONS = "CastReceiverApplications"; + @org.eclipse.jdt.annotation.NonNull + private List castReceiverApplications = new ArrayList<>(); + + public static final String JSON_PROPERTY_TRICKPLAY_OPTIONS = "TrickplayOptions"; + @org.eclipse.jdt.annotation.NonNull + private TrickplayOptions trickplayOptions; + + public ServerConfiguration() { + } + + public ServerConfiguration logFileRetentionDays(@org.eclipse.jdt.annotation.NonNull Integer logFileRetentionDays) { + this.logFileRetentionDays = logFileRetentionDays; + return this; + } + + /** + * Gets or sets the number of days we should retain log files. + * + * @return logFileRetentionDays + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOG_FILE_RETENTION_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLogFileRetentionDays() { + return logFileRetentionDays; + } + + @JsonProperty(JSON_PROPERTY_LOG_FILE_RETENTION_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogFileRetentionDays(@org.eclipse.jdt.annotation.NonNull Integer logFileRetentionDays) { + this.logFileRetentionDays = logFileRetentionDays; + } + + public ServerConfiguration isStartupWizardCompleted( + @org.eclipse.jdt.annotation.NonNull Boolean isStartupWizardCompleted) { + this.isStartupWizardCompleted = isStartupWizardCompleted; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is first run. + * + * @return isStartupWizardCompleted + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_STARTUP_WIZARD_COMPLETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsStartupWizardCompleted() { + return isStartupWizardCompleted; + } + + @JsonProperty(JSON_PROPERTY_IS_STARTUP_WIZARD_COMPLETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsStartupWizardCompleted(@org.eclipse.jdt.annotation.NonNull Boolean isStartupWizardCompleted) { + this.isStartupWizardCompleted = isStartupWizardCompleted; + } + + public ServerConfiguration cachePath(@org.eclipse.jdt.annotation.NonNull String cachePath) { + this.cachePath = cachePath; + return this; + } + + /** + * Gets or sets the cache path. + * + * @return cachePath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CACHE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCachePath() { + return cachePath; + } + + @JsonProperty(JSON_PROPERTY_CACHE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCachePath(@org.eclipse.jdt.annotation.NonNull String cachePath) { + this.cachePath = cachePath; + } + + public ServerConfiguration previousVersion(@org.eclipse.jdt.annotation.NonNull String previousVersion) { + this.previousVersion = previousVersion; + return this; + } + + /** + * Gets or sets the last known version that was ran using the configuration. + * + * @return previousVersion + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREVIOUS_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPreviousVersion() { + return previousVersion; + } + + @JsonProperty(JSON_PROPERTY_PREVIOUS_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreviousVersion(@org.eclipse.jdt.annotation.NonNull String previousVersion) { + this.previousVersion = previousVersion; + } + + public ServerConfiguration previousVersionStr(@org.eclipse.jdt.annotation.NonNull String previousVersionStr) { + this.previousVersionStr = previousVersionStr; + return this; + } + + /** + * Gets or sets the stringified PreviousVersion to be stored/loaded, because System.Version itself isn't + * xml-serializable. + * + * @return previousVersionStr + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREVIOUS_VERSION_STR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPreviousVersionStr() { + return previousVersionStr; + } + + @JsonProperty(JSON_PROPERTY_PREVIOUS_VERSION_STR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreviousVersionStr(@org.eclipse.jdt.annotation.NonNull String previousVersionStr) { + this.previousVersionStr = previousVersionStr; + } + + public ServerConfiguration enableMetrics(@org.eclipse.jdt.annotation.NonNull Boolean enableMetrics) { + this.enableMetrics = enableMetrics; + return this; + } + + /** + * Gets or sets a value indicating whether to enable prometheus metrics exporting. + * + * @return enableMetrics + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_METRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableMetrics() { + return enableMetrics; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_METRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableMetrics(@org.eclipse.jdt.annotation.NonNull Boolean enableMetrics) { + this.enableMetrics = enableMetrics; + } + + public ServerConfiguration enableNormalizedItemByNameIds( + @org.eclipse.jdt.annotation.NonNull Boolean enableNormalizedItemByNameIds) { + this.enableNormalizedItemByNameIds = enableNormalizedItemByNameIds; + return this; + } + + /** + * Get enableNormalizedItemByNameIds + * + * @return enableNormalizedItemByNameIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_NORMALIZED_ITEM_BY_NAME_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableNormalizedItemByNameIds() { + return enableNormalizedItemByNameIds; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_NORMALIZED_ITEM_BY_NAME_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableNormalizedItemByNameIds( + @org.eclipse.jdt.annotation.NonNull Boolean enableNormalizedItemByNameIds) { + this.enableNormalizedItemByNameIds = enableNormalizedItemByNameIds; + } + + public ServerConfiguration isPortAuthorized(@org.eclipse.jdt.annotation.NonNull Boolean isPortAuthorized) { + this.isPortAuthorized = isPortAuthorized; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is port authorized. + * + * @return isPortAuthorized + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PORT_AUTHORIZED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPortAuthorized() { + return isPortAuthorized; + } + + @JsonProperty(JSON_PROPERTY_IS_PORT_AUTHORIZED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPortAuthorized(@org.eclipse.jdt.annotation.NonNull Boolean isPortAuthorized) { + this.isPortAuthorized = isPortAuthorized; + } + + public ServerConfiguration quickConnectAvailable( + @org.eclipse.jdt.annotation.NonNull Boolean quickConnectAvailable) { + this.quickConnectAvailable = quickConnectAvailable; + return this; + } + + /** + * Gets or sets a value indicating whether quick connect is available for use on this server. + * + * @return quickConnectAvailable + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_QUICK_CONNECT_AVAILABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getQuickConnectAvailable() { + return quickConnectAvailable; + } + + @JsonProperty(JSON_PROPERTY_QUICK_CONNECT_AVAILABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuickConnectAvailable(@org.eclipse.jdt.annotation.NonNull Boolean quickConnectAvailable) { + this.quickConnectAvailable = quickConnectAvailable; + } + + public ServerConfiguration enableCaseSensitiveItemIds( + @org.eclipse.jdt.annotation.NonNull Boolean enableCaseSensitiveItemIds) { + this.enableCaseSensitiveItemIds = enableCaseSensitiveItemIds; + return this; + } + + /** + * Gets or sets a value indicating whether [enable case sensitive item ids]. + * + * @return enableCaseSensitiveItemIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_CASE_SENSITIVE_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableCaseSensitiveItemIds() { + return enableCaseSensitiveItemIds; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_CASE_SENSITIVE_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableCaseSensitiveItemIds(@org.eclipse.jdt.annotation.NonNull Boolean enableCaseSensitiveItemIds) { + this.enableCaseSensitiveItemIds = enableCaseSensitiveItemIds; + } + + public ServerConfiguration disableLiveTvChannelUserDataName( + @org.eclipse.jdt.annotation.NonNull Boolean disableLiveTvChannelUserDataName) { + this.disableLiveTvChannelUserDataName = disableLiveTvChannelUserDataName; + return this; + } + + /** + * Get disableLiveTvChannelUserDataName + * + * @return disableLiveTvChannelUserDataName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISABLE_LIVE_TV_CHANNEL_USER_DATA_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDisableLiveTvChannelUserDataName() { + return disableLiveTvChannelUserDataName; + } + + @JsonProperty(JSON_PROPERTY_DISABLE_LIVE_TV_CHANNEL_USER_DATA_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisableLiveTvChannelUserDataName( + @org.eclipse.jdt.annotation.NonNull Boolean disableLiveTvChannelUserDataName) { + this.disableLiveTvChannelUserDataName = disableLiveTvChannelUserDataName; + } + + public ServerConfiguration metadataPath(@org.eclipse.jdt.annotation.NonNull String metadataPath) { + this.metadataPath = metadataPath; + return this; + } + + /** + * Gets or sets the metadata path. + * + * @return metadataPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataPath() { + return metadataPath; + } + + @JsonProperty(JSON_PROPERTY_METADATA_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataPath(@org.eclipse.jdt.annotation.NonNull String metadataPath) { + this.metadataPath = metadataPath; + } + + public ServerConfiguration preferredMetadataLanguage( + @org.eclipse.jdt.annotation.NonNull String preferredMetadataLanguage) { + this.preferredMetadataLanguage = preferredMetadataLanguage; + return this; + } + + /** + * Gets or sets the preferred metadata language. + * + * @return preferredMetadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPreferredMetadataLanguage() { + return preferredMetadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreferredMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String preferredMetadataLanguage) { + this.preferredMetadataLanguage = preferredMetadataLanguage; + } + + public ServerConfiguration metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public ServerConfiguration sortReplaceCharacters( + @org.eclipse.jdt.annotation.NonNull List sortReplaceCharacters) { + this.sortReplaceCharacters = sortReplaceCharacters; + return this; + } + + public ServerConfiguration addSortReplaceCharactersItem(String sortReplaceCharactersItem) { + if (this.sortReplaceCharacters == null) { + this.sortReplaceCharacters = new ArrayList<>(); + } + this.sortReplaceCharacters.add(sortReplaceCharactersItem); + return this; + } + + /** + * Gets or sets characters to be replaced with a ' ' in strings to create a sort name. + * + * @return sortReplaceCharacters + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SORT_REPLACE_CHARACTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSortReplaceCharacters() { + return sortReplaceCharacters; + } + + @JsonProperty(JSON_PROPERTY_SORT_REPLACE_CHARACTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortReplaceCharacters(@org.eclipse.jdt.annotation.NonNull List sortReplaceCharacters) { + this.sortReplaceCharacters = sortReplaceCharacters; + } + + public ServerConfiguration sortRemoveCharacters( + @org.eclipse.jdt.annotation.NonNull List sortRemoveCharacters) { + this.sortRemoveCharacters = sortRemoveCharacters; + return this; + } + + public ServerConfiguration addSortRemoveCharactersItem(String sortRemoveCharactersItem) { + if (this.sortRemoveCharacters == null) { + this.sortRemoveCharacters = new ArrayList<>(); + } + this.sortRemoveCharacters.add(sortRemoveCharactersItem); + return this; + } + + /** + * Gets or sets characters to be removed from strings to create a sort name. + * + * @return sortRemoveCharacters + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SORT_REMOVE_CHARACTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSortRemoveCharacters() { + return sortRemoveCharacters; + } + + @JsonProperty(JSON_PROPERTY_SORT_REMOVE_CHARACTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortRemoveCharacters(@org.eclipse.jdt.annotation.NonNull List sortRemoveCharacters) { + this.sortRemoveCharacters = sortRemoveCharacters; + } + + public ServerConfiguration sortRemoveWords(@org.eclipse.jdt.annotation.NonNull List sortRemoveWords) { + this.sortRemoveWords = sortRemoveWords; + return this; + } + + public ServerConfiguration addSortRemoveWordsItem(String sortRemoveWordsItem) { + if (this.sortRemoveWords == null) { + this.sortRemoveWords = new ArrayList<>(); + } + this.sortRemoveWords.add(sortRemoveWordsItem); + return this; + } + + /** + * Gets or sets words to be removed from strings to create a sort name. + * + * @return sortRemoveWords + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SORT_REMOVE_WORDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSortRemoveWords() { + return sortRemoveWords; + } + + @JsonProperty(JSON_PROPERTY_SORT_REMOVE_WORDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortRemoveWords(@org.eclipse.jdt.annotation.NonNull List sortRemoveWords) { + this.sortRemoveWords = sortRemoveWords; + } + + public ServerConfiguration minResumePct(@org.eclipse.jdt.annotation.NonNull Integer minResumePct) { + this.minResumePct = minResumePct; + return this; + } + + /** + * Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated. + * + * @return minResumePct + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIN_RESUME_PCT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMinResumePct() { + return minResumePct; + } + + @JsonProperty(JSON_PROPERTY_MIN_RESUME_PCT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinResumePct(@org.eclipse.jdt.annotation.NonNull Integer minResumePct) { + this.minResumePct = minResumePct; + } + + public ServerConfiguration maxResumePct(@org.eclipse.jdt.annotation.NonNull Integer maxResumePct) { + this.maxResumePct = maxResumePct; + return this; + } + + /** + * Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this + * percentage is crossed playstate will be reset to the beginning and the item will be marked watched. + * + * @return maxResumePct + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_RESUME_PCT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxResumePct() { + return maxResumePct; + } + + @JsonProperty(JSON_PROPERTY_MAX_RESUME_PCT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxResumePct(@org.eclipse.jdt.annotation.NonNull Integer maxResumePct) { + this.maxResumePct = maxResumePct; + } + + public ServerConfiguration minResumeDurationSeconds( + @org.eclipse.jdt.annotation.NonNull Integer minResumeDurationSeconds) { + this.minResumeDurationSeconds = minResumeDurationSeconds; + return this; + } + + /** + * Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates.. + * + * @return minResumeDurationSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIN_RESUME_DURATION_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMinResumeDurationSeconds() { + return minResumeDurationSeconds; + } + + @JsonProperty(JSON_PROPERTY_MIN_RESUME_DURATION_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinResumeDurationSeconds(@org.eclipse.jdt.annotation.NonNull Integer minResumeDurationSeconds) { + this.minResumeDurationSeconds = minResumeDurationSeconds; + } + + public ServerConfiguration minAudiobookResume(@org.eclipse.jdt.annotation.NonNull Integer minAudiobookResume) { + this.minAudiobookResume = minAudiobookResume; + return this; + } + + /** + * Gets or sets the minimum minutes of a book that must be played in order for playstate to be updated. + * + * @return minAudiobookResume + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIN_AUDIOBOOK_RESUME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMinAudiobookResume() { + return minAudiobookResume; + } + + @JsonProperty(JSON_PROPERTY_MIN_AUDIOBOOK_RESUME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinAudiobookResume(@org.eclipse.jdt.annotation.NonNull Integer minAudiobookResume) { + this.minAudiobookResume = minAudiobookResume; + } + + public ServerConfiguration maxAudiobookResume(@org.eclipse.jdt.annotation.NonNull Integer maxAudiobookResume) { + this.maxAudiobookResume = maxAudiobookResume; + return this; + } + + /** + * Gets or sets the remaining minutes of a book that can be played while still saving playstate. If this percentage + * is crossed playstate will be reset to the beginning and the item will be marked watched. + * + * @return maxAudiobookResume + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_AUDIOBOOK_RESUME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxAudiobookResume() { + return maxAudiobookResume; + } + + @JsonProperty(JSON_PROPERTY_MAX_AUDIOBOOK_RESUME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxAudiobookResume(@org.eclipse.jdt.annotation.NonNull Integer maxAudiobookResume) { + this.maxAudiobookResume = maxAudiobookResume; + } + + public ServerConfiguration inactiveSessionThreshold( + @org.eclipse.jdt.annotation.NonNull Integer inactiveSessionThreshold) { + this.inactiveSessionThreshold = inactiveSessionThreshold; + return this; + } + + /** + * Gets or sets the threshold in minutes after a inactive session gets closed automatically. If set to 0 the check + * for inactive sessions gets disabled. + * + * @return inactiveSessionThreshold + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INACTIVE_SESSION_THRESHOLD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInactiveSessionThreshold() { + return inactiveSessionThreshold; + } + + @JsonProperty(JSON_PROPERTY_INACTIVE_SESSION_THRESHOLD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInactiveSessionThreshold(@org.eclipse.jdt.annotation.NonNull Integer inactiveSessionThreshold) { + this.inactiveSessionThreshold = inactiveSessionThreshold; + } + + public ServerConfiguration libraryMonitorDelay(@org.eclipse.jdt.annotation.NonNull Integer libraryMonitorDelay) { + this.libraryMonitorDelay = libraryMonitorDelay; + return this; + } + + /** + * Gets or sets the delay in seconds that we will wait after a file system change to try and discover what has been + * added/removed Some delay is necessary with some items because their creation is not atomic. It involves the + * creation of several different directories and files. + * + * @return libraryMonitorDelay + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIBRARY_MONITOR_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLibraryMonitorDelay() { + return libraryMonitorDelay; + } + + @JsonProperty(JSON_PROPERTY_LIBRARY_MONITOR_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLibraryMonitorDelay(@org.eclipse.jdt.annotation.NonNull Integer libraryMonitorDelay) { + this.libraryMonitorDelay = libraryMonitorDelay; + } + + public ServerConfiguration libraryUpdateDuration( + @org.eclipse.jdt.annotation.NonNull Integer libraryUpdateDuration) { + this.libraryUpdateDuration = libraryUpdateDuration; + return this; + } + + /** + * Gets or sets the duration in seconds that we will wait after a library updated event before executing the library + * changed notification. + * + * @return libraryUpdateDuration + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIBRARY_UPDATE_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLibraryUpdateDuration() { + return libraryUpdateDuration; + } + + @JsonProperty(JSON_PROPERTY_LIBRARY_UPDATE_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLibraryUpdateDuration(@org.eclipse.jdt.annotation.NonNull Integer libraryUpdateDuration) { + this.libraryUpdateDuration = libraryUpdateDuration; + } + + public ServerConfiguration imageSavingConvention( + @org.eclipse.jdt.annotation.NonNull ImageSavingConvention imageSavingConvention) { + this.imageSavingConvention = imageSavingConvention; + return this; + } + + /** + * Gets or sets the image saving convention. + * + * @return imageSavingConvention + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_SAVING_CONVENTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ImageSavingConvention getImageSavingConvention() { + return imageSavingConvention; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_SAVING_CONVENTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageSavingConvention( + @org.eclipse.jdt.annotation.NonNull ImageSavingConvention imageSavingConvention) { + this.imageSavingConvention = imageSavingConvention; + } + + public ServerConfiguration metadataOptions( + @org.eclipse.jdt.annotation.NonNull List metadataOptions) { + this.metadataOptions = metadataOptions; + return this; + } + + public ServerConfiguration addMetadataOptionsItem(MetadataOptions metadataOptionsItem) { + if (this.metadataOptions == null) { + this.metadataOptions = new ArrayList<>(); + } + this.metadataOptions.add(metadataOptionsItem); + return this; + } + + /** + * Get metadataOptions + * + * @return metadataOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMetadataOptions() { + return metadataOptions; + } + + @JsonProperty(JSON_PROPERTY_METADATA_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataOptions(@org.eclipse.jdt.annotation.NonNull List metadataOptions) { + this.metadataOptions = metadataOptions; + } + + public ServerConfiguration skipDeserializationForBasicTypes( + @org.eclipse.jdt.annotation.NonNull Boolean skipDeserializationForBasicTypes) { + this.skipDeserializationForBasicTypes = skipDeserializationForBasicTypes; + return this; + } + + /** + * Get skipDeserializationForBasicTypes + * + * @return skipDeserializationForBasicTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SKIP_DESERIALIZATION_FOR_BASIC_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSkipDeserializationForBasicTypes() { + return skipDeserializationForBasicTypes; + } + + @JsonProperty(JSON_PROPERTY_SKIP_DESERIALIZATION_FOR_BASIC_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipDeserializationForBasicTypes( + @org.eclipse.jdt.annotation.NonNull Boolean skipDeserializationForBasicTypes) { + this.skipDeserializationForBasicTypes = skipDeserializationForBasicTypes; + } + + public ServerConfiguration serverName(@org.eclipse.jdt.annotation.NonNull String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get serverName + * + * @return serverName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerName() { + return serverName; + } + + @JsonProperty(JSON_PROPERTY_SERVER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerName(@org.eclipse.jdt.annotation.NonNull String serverName) { + this.serverName = serverName; + } + + public ServerConfiguration uiCulture(@org.eclipse.jdt.annotation.NonNull String uiCulture) { + this.uiCulture = uiCulture; + return this; + } + + /** + * Get uiCulture + * + * @return uiCulture + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_UI_CULTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUiCulture() { + return uiCulture; + } + + @JsonProperty(JSON_PROPERTY_UI_CULTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUiCulture(@org.eclipse.jdt.annotation.NonNull String uiCulture) { + this.uiCulture = uiCulture; + } + + public ServerConfiguration saveMetadataHidden(@org.eclipse.jdt.annotation.NonNull Boolean saveMetadataHidden) { + this.saveMetadataHidden = saveMetadataHidden; + return this; + } + + /** + * Get saveMetadataHidden + * + * @return saveMetadataHidden + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SAVE_METADATA_HIDDEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSaveMetadataHidden() { + return saveMetadataHidden; + } + + @JsonProperty(JSON_PROPERTY_SAVE_METADATA_HIDDEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaveMetadataHidden(@org.eclipse.jdt.annotation.NonNull Boolean saveMetadataHidden) { + this.saveMetadataHidden = saveMetadataHidden; + } + + public ServerConfiguration contentTypes(@org.eclipse.jdt.annotation.NonNull List contentTypes) { + this.contentTypes = contentTypes; + return this; + } + + public ServerConfiguration addContentTypesItem(NameValuePair contentTypesItem) { + if (this.contentTypes == null) { + this.contentTypes = new ArrayList<>(); + } + this.contentTypes.add(contentTypesItem); + return this; + } + + /** + * Get contentTypes + * + * @return contentTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTENT_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getContentTypes() { + return contentTypes; + } + + @JsonProperty(JSON_PROPERTY_CONTENT_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentTypes(@org.eclipse.jdt.annotation.NonNull List contentTypes) { + this.contentTypes = contentTypes; + } + + public ServerConfiguration remoteClientBitrateLimit( + @org.eclipse.jdt.annotation.NonNull Integer remoteClientBitrateLimit) { + this.remoteClientBitrateLimit = remoteClientBitrateLimit; + return this; + } + + /** + * Get remoteClientBitrateLimit + * + * @return remoteClientBitrateLimit + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMOTE_CLIENT_BITRATE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRemoteClientBitrateLimit() { + return remoteClientBitrateLimit; + } + + @JsonProperty(JSON_PROPERTY_REMOTE_CLIENT_BITRATE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemoteClientBitrateLimit(@org.eclipse.jdt.annotation.NonNull Integer remoteClientBitrateLimit) { + this.remoteClientBitrateLimit = remoteClientBitrateLimit; + } + + public ServerConfiguration enableFolderView(@org.eclipse.jdt.annotation.NonNull Boolean enableFolderView) { + this.enableFolderView = enableFolderView; + return this; + } + + /** + * Get enableFolderView + * + * @return enableFolderView + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_FOLDER_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableFolderView() { + return enableFolderView; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_FOLDER_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableFolderView(@org.eclipse.jdt.annotation.NonNull Boolean enableFolderView) { + this.enableFolderView = enableFolderView; + } + + public ServerConfiguration enableGroupingIntoCollections( + @org.eclipse.jdt.annotation.NonNull Boolean enableGroupingIntoCollections) { + this.enableGroupingIntoCollections = enableGroupingIntoCollections; + return this; + } + + /** + * Get enableGroupingIntoCollections + * + * @return enableGroupingIntoCollections + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_GROUPING_INTO_COLLECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableGroupingIntoCollections() { + return enableGroupingIntoCollections; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_GROUPING_INTO_COLLECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableGroupingIntoCollections( + @org.eclipse.jdt.annotation.NonNull Boolean enableGroupingIntoCollections) { + this.enableGroupingIntoCollections = enableGroupingIntoCollections; + } + + public ServerConfiguration displaySpecialsWithinSeasons( + @org.eclipse.jdt.annotation.NonNull Boolean displaySpecialsWithinSeasons) { + this.displaySpecialsWithinSeasons = displaySpecialsWithinSeasons; + return this; + } + + /** + * Get displaySpecialsWithinSeasons + * + * @return displaySpecialsWithinSeasons + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_SPECIALS_WITHIN_SEASONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDisplaySpecialsWithinSeasons() { + return displaySpecialsWithinSeasons; + } + + @JsonProperty(JSON_PROPERTY_DISPLAY_SPECIALS_WITHIN_SEASONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplaySpecialsWithinSeasons( + @org.eclipse.jdt.annotation.NonNull Boolean displaySpecialsWithinSeasons) { + this.displaySpecialsWithinSeasons = displaySpecialsWithinSeasons; + } + + public ServerConfiguration codecsUsed(@org.eclipse.jdt.annotation.NonNull List codecsUsed) { + this.codecsUsed = codecsUsed; + return this; + } + + public ServerConfiguration addCodecsUsedItem(String codecsUsedItem) { + if (this.codecsUsed == null) { + this.codecsUsed = new ArrayList<>(); + } + this.codecsUsed.add(codecsUsedItem); + return this; + } + + /** + * Get codecsUsed + * + * @return codecsUsed + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODECS_USED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCodecsUsed() { + return codecsUsed; + } + + @JsonProperty(JSON_PROPERTY_CODECS_USED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCodecsUsed(@org.eclipse.jdt.annotation.NonNull List codecsUsed) { + this.codecsUsed = codecsUsed; + } + + public ServerConfiguration pluginRepositories( + @org.eclipse.jdt.annotation.NonNull List pluginRepositories) { + this.pluginRepositories = pluginRepositories; + return this; + } + + public ServerConfiguration addPluginRepositoriesItem(RepositoryInfo pluginRepositoriesItem) { + if (this.pluginRepositories == null) { + this.pluginRepositories = new ArrayList<>(); + } + this.pluginRepositories.add(pluginRepositoriesItem); + return this; + } + + /** + * Get pluginRepositories + * + * @return pluginRepositories + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLUGIN_REPOSITORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPluginRepositories() { + return pluginRepositories; + } + + @JsonProperty(JSON_PROPERTY_PLUGIN_REPOSITORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPluginRepositories(@org.eclipse.jdt.annotation.NonNull List pluginRepositories) { + this.pluginRepositories = pluginRepositories; + } + + public ServerConfiguration enableExternalContentInSuggestions( + @org.eclipse.jdt.annotation.NonNull Boolean enableExternalContentInSuggestions) { + this.enableExternalContentInSuggestions = enableExternalContentInSuggestions; + return this; + } + + /** + * Get enableExternalContentInSuggestions + * + * @return enableExternalContentInSuggestions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_EXTERNAL_CONTENT_IN_SUGGESTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableExternalContentInSuggestions() { + return enableExternalContentInSuggestions; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_EXTERNAL_CONTENT_IN_SUGGESTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableExternalContentInSuggestions( + @org.eclipse.jdt.annotation.NonNull Boolean enableExternalContentInSuggestions) { + this.enableExternalContentInSuggestions = enableExternalContentInSuggestions; + } + + public ServerConfiguration imageExtractionTimeoutMs( + @org.eclipse.jdt.annotation.NonNull Integer imageExtractionTimeoutMs) { + this.imageExtractionTimeoutMs = imageExtractionTimeoutMs; + return this; + } + + /** + * Get imageExtractionTimeoutMs + * + * @return imageExtractionTimeoutMs + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_EXTRACTION_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getImageExtractionTimeoutMs() { + return imageExtractionTimeoutMs; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_EXTRACTION_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageExtractionTimeoutMs(@org.eclipse.jdt.annotation.NonNull Integer imageExtractionTimeoutMs) { + this.imageExtractionTimeoutMs = imageExtractionTimeoutMs; + } + + public ServerConfiguration pathSubstitutions( + @org.eclipse.jdt.annotation.NonNull List pathSubstitutions) { + this.pathSubstitutions = pathSubstitutions; + return this; + } + + public ServerConfiguration addPathSubstitutionsItem(PathSubstitution pathSubstitutionsItem) { + if (this.pathSubstitutions == null) { + this.pathSubstitutions = new ArrayList<>(); + } + this.pathSubstitutions.add(pathSubstitutionsItem); + return this; + } + + /** + * Get pathSubstitutions + * + * @return pathSubstitutions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH_SUBSTITUTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPathSubstitutions() { + return pathSubstitutions; + } + + @JsonProperty(JSON_PROPERTY_PATH_SUBSTITUTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPathSubstitutions(@org.eclipse.jdt.annotation.NonNull List pathSubstitutions) { + this.pathSubstitutions = pathSubstitutions; + } + + public ServerConfiguration enableSlowResponseWarning( + @org.eclipse.jdt.annotation.NonNull Boolean enableSlowResponseWarning) { + this.enableSlowResponseWarning = enableSlowResponseWarning; + return this; + } + + /** + * Gets or sets a value indicating whether slow server responses should be logged as a warning. + * + * @return enableSlowResponseWarning + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_SLOW_RESPONSE_WARNING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableSlowResponseWarning() { + return enableSlowResponseWarning; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_SLOW_RESPONSE_WARNING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableSlowResponseWarning(@org.eclipse.jdt.annotation.NonNull Boolean enableSlowResponseWarning) { + this.enableSlowResponseWarning = enableSlowResponseWarning; + } + + public ServerConfiguration slowResponseThresholdMs( + @org.eclipse.jdt.annotation.NonNull Long slowResponseThresholdMs) { + this.slowResponseThresholdMs = slowResponseThresholdMs; + return this; + } + + /** + * Gets or sets the threshold for the slow response time warning in ms. + * + * @return slowResponseThresholdMs + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SLOW_RESPONSE_THRESHOLD_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSlowResponseThresholdMs() { + return slowResponseThresholdMs; + } + + @JsonProperty(JSON_PROPERTY_SLOW_RESPONSE_THRESHOLD_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSlowResponseThresholdMs(@org.eclipse.jdt.annotation.NonNull Long slowResponseThresholdMs) { + this.slowResponseThresholdMs = slowResponseThresholdMs; + } + + public ServerConfiguration corsHosts(@org.eclipse.jdt.annotation.NonNull List corsHosts) { + this.corsHosts = corsHosts; + return this; + } + + public ServerConfiguration addCorsHostsItem(String corsHostsItem) { + if (this.corsHosts == null) { + this.corsHosts = new ArrayList<>(); + } + this.corsHosts.add(corsHostsItem); + return this; + } + + /** + * Gets or sets the cors hosts. + * + * @return corsHosts + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CORS_HOSTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCorsHosts() { + return corsHosts; + } + + @JsonProperty(JSON_PROPERTY_CORS_HOSTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCorsHosts(@org.eclipse.jdt.annotation.NonNull List corsHosts) { + this.corsHosts = corsHosts; + } + + public ServerConfiguration activityLogRetentionDays( + @org.eclipse.jdt.annotation.NonNull Integer activityLogRetentionDays) { + this.activityLogRetentionDays = activityLogRetentionDays; + return this; + } + + /** + * Gets or sets the number of days we should retain activity logs. + * + * @return activityLogRetentionDays + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ACTIVITY_LOG_RETENTION_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getActivityLogRetentionDays() { + return activityLogRetentionDays; + } + + @JsonProperty(JSON_PROPERTY_ACTIVITY_LOG_RETENTION_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setActivityLogRetentionDays(@org.eclipse.jdt.annotation.NonNull Integer activityLogRetentionDays) { + this.activityLogRetentionDays = activityLogRetentionDays; + } + + public ServerConfiguration libraryScanFanoutConcurrency( + @org.eclipse.jdt.annotation.NonNull Integer libraryScanFanoutConcurrency) { + this.libraryScanFanoutConcurrency = libraryScanFanoutConcurrency; + return this; + } + + /** + * Gets or sets the how the library scan fans out. + * + * @return libraryScanFanoutConcurrency + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIBRARY_SCAN_FANOUT_CONCURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLibraryScanFanoutConcurrency() { + return libraryScanFanoutConcurrency; + } + + @JsonProperty(JSON_PROPERTY_LIBRARY_SCAN_FANOUT_CONCURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLibraryScanFanoutConcurrency( + @org.eclipse.jdt.annotation.NonNull Integer libraryScanFanoutConcurrency) { + this.libraryScanFanoutConcurrency = libraryScanFanoutConcurrency; + } + + public ServerConfiguration libraryMetadataRefreshConcurrency( + @org.eclipse.jdt.annotation.NonNull Integer libraryMetadataRefreshConcurrency) { + this.libraryMetadataRefreshConcurrency = libraryMetadataRefreshConcurrency; + return this; + } + + /** + * Gets or sets the how many metadata refreshes can run concurrently. + * + * @return libraryMetadataRefreshConcurrency + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIBRARY_METADATA_REFRESH_CONCURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLibraryMetadataRefreshConcurrency() { + return libraryMetadataRefreshConcurrency; + } + + @JsonProperty(JSON_PROPERTY_LIBRARY_METADATA_REFRESH_CONCURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLibraryMetadataRefreshConcurrency( + @org.eclipse.jdt.annotation.NonNull Integer libraryMetadataRefreshConcurrency) { + this.libraryMetadataRefreshConcurrency = libraryMetadataRefreshConcurrency; + } + + public ServerConfiguration removeOldPlugins(@org.eclipse.jdt.annotation.NonNull Boolean removeOldPlugins) { + this.removeOldPlugins = removeOldPlugins; + return this; + } + + /** + * Gets or sets a value indicating whether older plugins should automatically be deleted from the plugin folder. + * + * @return removeOldPlugins + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMOVE_OLD_PLUGINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRemoveOldPlugins() { + return removeOldPlugins; + } + + @JsonProperty(JSON_PROPERTY_REMOVE_OLD_PLUGINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemoveOldPlugins(@org.eclipse.jdt.annotation.NonNull Boolean removeOldPlugins) { + this.removeOldPlugins = removeOldPlugins; + } + + public ServerConfiguration allowClientLogUpload(@org.eclipse.jdt.annotation.NonNull Boolean allowClientLogUpload) { + this.allowClientLogUpload = allowClientLogUpload; + return this; + } + + /** + * Gets or sets a value indicating whether clients should be allowed to upload logs. + * + * @return allowClientLogUpload + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_CLIENT_LOG_UPLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowClientLogUpload() { + return allowClientLogUpload; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_CLIENT_LOG_UPLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowClientLogUpload(@org.eclipse.jdt.annotation.NonNull Boolean allowClientLogUpload) { + this.allowClientLogUpload = allowClientLogUpload; + } + + public ServerConfiguration dummyChapterDuration(@org.eclipse.jdt.annotation.NonNull Integer dummyChapterDuration) { + this.dummyChapterDuration = dummyChapterDuration; + return this; + } + + /** + * Gets or sets the dummy chapter duration in seconds, use 0 (zero) or less to disable generation alltogether. + * + * @return dummyChapterDuration + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DUMMY_CHAPTER_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDummyChapterDuration() { + return dummyChapterDuration; + } + + @JsonProperty(JSON_PROPERTY_DUMMY_CHAPTER_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDummyChapterDuration(@org.eclipse.jdt.annotation.NonNull Integer dummyChapterDuration) { + this.dummyChapterDuration = dummyChapterDuration; + } + + public ServerConfiguration chapterImageResolution( + @org.eclipse.jdt.annotation.NonNull ImageResolution chapterImageResolution) { + this.chapterImageResolution = chapterImageResolution; + return this; + } + + /** + * Gets or sets the chapter image resolution. + * + * @return chapterImageResolution + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHAPTER_IMAGE_RESOLUTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ImageResolution getChapterImageResolution() { + return chapterImageResolution; + } + + @JsonProperty(JSON_PROPERTY_CHAPTER_IMAGE_RESOLUTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChapterImageResolution(@org.eclipse.jdt.annotation.NonNull ImageResolution chapterImageResolution) { + this.chapterImageResolution = chapterImageResolution; + } + + public ServerConfiguration parallelImageEncodingLimit( + @org.eclipse.jdt.annotation.NonNull Integer parallelImageEncodingLimit) { + this.parallelImageEncodingLimit = parallelImageEncodingLimit; + return this; + } + + /** + * Gets or sets the limit for parallel image encoding. + * + * @return parallelImageEncodingLimit + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARALLEL_IMAGE_ENCODING_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParallelImageEncodingLimit() { + return parallelImageEncodingLimit; + } + + @JsonProperty(JSON_PROPERTY_PARALLEL_IMAGE_ENCODING_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParallelImageEncodingLimit(@org.eclipse.jdt.annotation.NonNull Integer parallelImageEncodingLimit) { + this.parallelImageEncodingLimit = parallelImageEncodingLimit; + } + + public ServerConfiguration castReceiverApplications( + @org.eclipse.jdt.annotation.NonNull List castReceiverApplications) { + this.castReceiverApplications = castReceiverApplications; + return this; + } + + public ServerConfiguration addCastReceiverApplicationsItem(CastReceiverApplication castReceiverApplicationsItem) { + if (this.castReceiverApplications == null) { + this.castReceiverApplications = new ArrayList<>(); + } + this.castReceiverApplications.add(castReceiverApplicationsItem); + return this; + } + + /** + * Gets or sets the list of cast receiver applications. + * + * @return castReceiverApplications + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAST_RECEIVER_APPLICATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCastReceiverApplications() { + return castReceiverApplications; + } + + @JsonProperty(JSON_PROPERTY_CAST_RECEIVER_APPLICATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCastReceiverApplications( + @org.eclipse.jdt.annotation.NonNull List castReceiverApplications) { + this.castReceiverApplications = castReceiverApplications; + } + + public ServerConfiguration trickplayOptions(@org.eclipse.jdt.annotation.NonNull TrickplayOptions trickplayOptions) { + this.trickplayOptions = trickplayOptions; + return this; + } + + /** + * Gets or sets the trickplay options. + * + * @return trickplayOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRICKPLAY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TrickplayOptions getTrickplayOptions() { + return trickplayOptions; + } + + @JsonProperty(JSON_PROPERTY_TRICKPLAY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrickplayOptions(@org.eclipse.jdt.annotation.NonNull TrickplayOptions trickplayOptions) { + this.trickplayOptions = trickplayOptions; + } + + /** + * Return true if this ServerConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServerConfiguration serverConfiguration = (ServerConfiguration) o; + return Objects.equals(this.logFileRetentionDays, serverConfiguration.logFileRetentionDays) + && Objects.equals(this.isStartupWizardCompleted, serverConfiguration.isStartupWizardCompleted) + && Objects.equals(this.cachePath, serverConfiguration.cachePath) + && Objects.equals(this.previousVersion, serverConfiguration.previousVersion) + && Objects.equals(this.previousVersionStr, serverConfiguration.previousVersionStr) + && Objects.equals(this.enableMetrics, serverConfiguration.enableMetrics) + && Objects.equals(this.enableNormalizedItemByNameIds, serverConfiguration.enableNormalizedItemByNameIds) + && Objects.equals(this.isPortAuthorized, serverConfiguration.isPortAuthorized) + && Objects.equals(this.quickConnectAvailable, serverConfiguration.quickConnectAvailable) + && Objects.equals(this.enableCaseSensitiveItemIds, serverConfiguration.enableCaseSensitiveItemIds) + && Objects.equals(this.disableLiveTvChannelUserDataName, + serverConfiguration.disableLiveTvChannelUserDataName) + && Objects.equals(this.metadataPath, serverConfiguration.metadataPath) + && Objects.equals(this.preferredMetadataLanguage, serverConfiguration.preferredMetadataLanguage) + && Objects.equals(this.metadataCountryCode, serverConfiguration.metadataCountryCode) + && Objects.equals(this.sortReplaceCharacters, serverConfiguration.sortReplaceCharacters) + && Objects.equals(this.sortRemoveCharacters, serverConfiguration.sortRemoveCharacters) + && Objects.equals(this.sortRemoveWords, serverConfiguration.sortRemoveWords) + && Objects.equals(this.minResumePct, serverConfiguration.minResumePct) + && Objects.equals(this.maxResumePct, serverConfiguration.maxResumePct) + && Objects.equals(this.minResumeDurationSeconds, serverConfiguration.minResumeDurationSeconds) + && Objects.equals(this.minAudiobookResume, serverConfiguration.minAudiobookResume) + && Objects.equals(this.maxAudiobookResume, serverConfiguration.maxAudiobookResume) + && Objects.equals(this.inactiveSessionThreshold, serverConfiguration.inactiveSessionThreshold) + && Objects.equals(this.libraryMonitorDelay, serverConfiguration.libraryMonitorDelay) + && Objects.equals(this.libraryUpdateDuration, serverConfiguration.libraryUpdateDuration) + && Objects.equals(this.imageSavingConvention, serverConfiguration.imageSavingConvention) + && Objects.equals(this.metadataOptions, serverConfiguration.metadataOptions) + && Objects.equals(this.skipDeserializationForBasicTypes, + serverConfiguration.skipDeserializationForBasicTypes) + && Objects.equals(this.serverName, serverConfiguration.serverName) + && Objects.equals(this.uiCulture, serverConfiguration.uiCulture) + && Objects.equals(this.saveMetadataHidden, serverConfiguration.saveMetadataHidden) + && Objects.equals(this.contentTypes, serverConfiguration.contentTypes) + && Objects.equals(this.remoteClientBitrateLimit, serverConfiguration.remoteClientBitrateLimit) + && Objects.equals(this.enableFolderView, serverConfiguration.enableFolderView) + && Objects.equals(this.enableGroupingIntoCollections, serverConfiguration.enableGroupingIntoCollections) + && Objects.equals(this.displaySpecialsWithinSeasons, serverConfiguration.displaySpecialsWithinSeasons) + && Objects.equals(this.codecsUsed, serverConfiguration.codecsUsed) + && Objects.equals(this.pluginRepositories, serverConfiguration.pluginRepositories) + && Objects.equals(this.enableExternalContentInSuggestions, + serverConfiguration.enableExternalContentInSuggestions) + && Objects.equals(this.imageExtractionTimeoutMs, serverConfiguration.imageExtractionTimeoutMs) + && Objects.equals(this.pathSubstitutions, serverConfiguration.pathSubstitutions) + && Objects.equals(this.enableSlowResponseWarning, serverConfiguration.enableSlowResponseWarning) + && Objects.equals(this.slowResponseThresholdMs, serverConfiguration.slowResponseThresholdMs) + && Objects.equals(this.corsHosts, serverConfiguration.corsHosts) + && Objects.equals(this.activityLogRetentionDays, serverConfiguration.activityLogRetentionDays) + && Objects.equals(this.libraryScanFanoutConcurrency, serverConfiguration.libraryScanFanoutConcurrency) + && Objects.equals(this.libraryMetadataRefreshConcurrency, + serverConfiguration.libraryMetadataRefreshConcurrency) + && Objects.equals(this.removeOldPlugins, serverConfiguration.removeOldPlugins) + && Objects.equals(this.allowClientLogUpload, serverConfiguration.allowClientLogUpload) + && Objects.equals(this.dummyChapterDuration, serverConfiguration.dummyChapterDuration) + && Objects.equals(this.chapterImageResolution, serverConfiguration.chapterImageResolution) + && Objects.equals(this.parallelImageEncodingLimit, serverConfiguration.parallelImageEncodingLimit) + && Objects.equals(this.castReceiverApplications, serverConfiguration.castReceiverApplications) + && Objects.equals(this.trickplayOptions, serverConfiguration.trickplayOptions); + } + + @Override + public int hashCode() { + return Objects.hash(logFileRetentionDays, isStartupWizardCompleted, cachePath, previousVersion, + previousVersionStr, enableMetrics, enableNormalizedItemByNameIds, isPortAuthorized, + quickConnectAvailable, enableCaseSensitiveItemIds, disableLiveTvChannelUserDataName, metadataPath, + preferredMetadataLanguage, metadataCountryCode, sortReplaceCharacters, sortRemoveCharacters, + sortRemoveWords, minResumePct, maxResumePct, minResumeDurationSeconds, minAudiobookResume, + maxAudiobookResume, inactiveSessionThreshold, libraryMonitorDelay, libraryUpdateDuration, + imageSavingConvention, metadataOptions, skipDeserializationForBasicTypes, serverName, uiCulture, + saveMetadataHidden, contentTypes, remoteClientBitrateLimit, enableFolderView, + enableGroupingIntoCollections, displaySpecialsWithinSeasons, codecsUsed, pluginRepositories, + enableExternalContentInSuggestions, imageExtractionTimeoutMs, pathSubstitutions, + enableSlowResponseWarning, slowResponseThresholdMs, corsHosts, activityLogRetentionDays, + libraryScanFanoutConcurrency, libraryMetadataRefreshConcurrency, removeOldPlugins, allowClientLogUpload, + dummyChapterDuration, chapterImageResolution, parallelImageEncodingLimit, castReceiverApplications, + trickplayOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServerConfiguration {\n"); + sb.append(" logFileRetentionDays: ").append(toIndentedString(logFileRetentionDays)).append("\n"); + sb.append(" isStartupWizardCompleted: ").append(toIndentedString(isStartupWizardCompleted)).append("\n"); + sb.append(" cachePath: ").append(toIndentedString(cachePath)).append("\n"); + sb.append(" previousVersion: ").append(toIndentedString(previousVersion)).append("\n"); + sb.append(" previousVersionStr: ").append(toIndentedString(previousVersionStr)).append("\n"); + sb.append(" enableMetrics: ").append(toIndentedString(enableMetrics)).append("\n"); + sb.append(" enableNormalizedItemByNameIds: ").append(toIndentedString(enableNormalizedItemByNameIds)) + .append("\n"); + sb.append(" isPortAuthorized: ").append(toIndentedString(isPortAuthorized)).append("\n"); + sb.append(" quickConnectAvailable: ").append(toIndentedString(quickConnectAvailable)).append("\n"); + sb.append(" enableCaseSensitiveItemIds: ").append(toIndentedString(enableCaseSensitiveItemIds)).append("\n"); + sb.append(" disableLiveTvChannelUserDataName: ").append(toIndentedString(disableLiveTvChannelUserDataName)) + .append("\n"); + sb.append(" metadataPath: ").append(toIndentedString(metadataPath)).append("\n"); + sb.append(" preferredMetadataLanguage: ").append(toIndentedString(preferredMetadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" sortReplaceCharacters: ").append(toIndentedString(sortReplaceCharacters)).append("\n"); + sb.append(" sortRemoveCharacters: ").append(toIndentedString(sortRemoveCharacters)).append("\n"); + sb.append(" sortRemoveWords: ").append(toIndentedString(sortRemoveWords)).append("\n"); + sb.append(" minResumePct: ").append(toIndentedString(minResumePct)).append("\n"); + sb.append(" maxResumePct: ").append(toIndentedString(maxResumePct)).append("\n"); + sb.append(" minResumeDurationSeconds: ").append(toIndentedString(minResumeDurationSeconds)).append("\n"); + sb.append(" minAudiobookResume: ").append(toIndentedString(minAudiobookResume)).append("\n"); + sb.append(" maxAudiobookResume: ").append(toIndentedString(maxAudiobookResume)).append("\n"); + sb.append(" inactiveSessionThreshold: ").append(toIndentedString(inactiveSessionThreshold)).append("\n"); + sb.append(" libraryMonitorDelay: ").append(toIndentedString(libraryMonitorDelay)).append("\n"); + sb.append(" libraryUpdateDuration: ").append(toIndentedString(libraryUpdateDuration)).append("\n"); + sb.append(" imageSavingConvention: ").append(toIndentedString(imageSavingConvention)).append("\n"); + sb.append(" metadataOptions: ").append(toIndentedString(metadataOptions)).append("\n"); + sb.append(" skipDeserializationForBasicTypes: ").append(toIndentedString(skipDeserializationForBasicTypes)) + .append("\n"); + sb.append(" serverName: ").append(toIndentedString(serverName)).append("\n"); + sb.append(" uiCulture: ").append(toIndentedString(uiCulture)).append("\n"); + sb.append(" saveMetadataHidden: ").append(toIndentedString(saveMetadataHidden)).append("\n"); + sb.append(" contentTypes: ").append(toIndentedString(contentTypes)).append("\n"); + sb.append(" remoteClientBitrateLimit: ").append(toIndentedString(remoteClientBitrateLimit)).append("\n"); + sb.append(" enableFolderView: ").append(toIndentedString(enableFolderView)).append("\n"); + sb.append(" enableGroupingIntoCollections: ").append(toIndentedString(enableGroupingIntoCollections)) + .append("\n"); + sb.append(" displaySpecialsWithinSeasons: ").append(toIndentedString(displaySpecialsWithinSeasons)) + .append("\n"); + sb.append(" codecsUsed: ").append(toIndentedString(codecsUsed)).append("\n"); + sb.append(" pluginRepositories: ").append(toIndentedString(pluginRepositories)).append("\n"); + sb.append(" enableExternalContentInSuggestions: ") + .append(toIndentedString(enableExternalContentInSuggestions)).append("\n"); + sb.append(" imageExtractionTimeoutMs: ").append(toIndentedString(imageExtractionTimeoutMs)).append("\n"); + sb.append(" pathSubstitutions: ").append(toIndentedString(pathSubstitutions)).append("\n"); + sb.append(" enableSlowResponseWarning: ").append(toIndentedString(enableSlowResponseWarning)).append("\n"); + sb.append(" slowResponseThresholdMs: ").append(toIndentedString(slowResponseThresholdMs)).append("\n"); + sb.append(" corsHosts: ").append(toIndentedString(corsHosts)).append("\n"); + sb.append(" activityLogRetentionDays: ").append(toIndentedString(activityLogRetentionDays)).append("\n"); + sb.append(" libraryScanFanoutConcurrency: ").append(toIndentedString(libraryScanFanoutConcurrency)) + .append("\n"); + sb.append(" libraryMetadataRefreshConcurrency: ").append(toIndentedString(libraryMetadataRefreshConcurrency)) + .append("\n"); + sb.append(" removeOldPlugins: ").append(toIndentedString(removeOldPlugins)).append("\n"); + sb.append(" allowClientLogUpload: ").append(toIndentedString(allowClientLogUpload)).append("\n"); + sb.append(" dummyChapterDuration: ").append(toIndentedString(dummyChapterDuration)).append("\n"); + sb.append(" chapterImageResolution: ").append(toIndentedString(chapterImageResolution)).append("\n"); + sb.append(" parallelImageEncodingLimit: ").append(toIndentedString(parallelImageEncodingLimit)).append("\n"); + sb.append(" castReceiverApplications: ").append(toIndentedString(castReceiverApplications)).append("\n"); + sb.append(" trickplayOptions: ").append(toIndentedString(trickplayOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `LogFileRetentionDays` to the URL query string + if (getLogFileRetentionDays() != null) { + joiner.add(String.format("%sLogFileRetentionDays%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLogFileRetentionDays())))); + } + + // add `IsStartupWizardCompleted` to the URL query string + if (getIsStartupWizardCompleted() != null) { + joiner.add(String.format("%sIsStartupWizardCompleted%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsStartupWizardCompleted())))); + } + + // add `CachePath` to the URL query string + if (getCachePath() != null) { + joiner.add(String.format("%sCachePath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCachePath())))); + } + + // add `PreviousVersion` to the URL query string + if (getPreviousVersion() != null) { + joiner.add(String.format("%sPreviousVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreviousVersion())))); + } + + // add `PreviousVersionStr` to the URL query string + if (getPreviousVersionStr() != null) { + joiner.add(String.format("%sPreviousVersionStr%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreviousVersionStr())))); + } + + // add `EnableMetrics` to the URL query string + if (getEnableMetrics() != null) { + joiner.add(String.format("%sEnableMetrics%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableMetrics())))); + } + + // add `EnableNormalizedItemByNameIds` to the URL query string + if (getEnableNormalizedItemByNameIds() != null) { + joiner.add(String.format("%sEnableNormalizedItemByNameIds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableNormalizedItemByNameIds())))); + } + + // add `IsPortAuthorized` to the URL query string + if (getIsPortAuthorized() != null) { + joiner.add(String.format("%sIsPortAuthorized%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPortAuthorized())))); + } + + // add `QuickConnectAvailable` to the URL query string + if (getQuickConnectAvailable() != null) { + joiner.add(String.format("%sQuickConnectAvailable%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getQuickConnectAvailable())))); + } + + // add `EnableCaseSensitiveItemIds` to the URL query string + if (getEnableCaseSensitiveItemIds() != null) { + joiner.add(String.format("%sEnableCaseSensitiveItemIds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableCaseSensitiveItemIds())))); + } + + // add `DisableLiveTvChannelUserDataName` to the URL query string + if (getDisableLiveTvChannelUserDataName() != null) { + joiner.add(String.format("%sDisableLiveTvChannelUserDataName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisableLiveTvChannelUserDataName())))); + } + + // add `MetadataPath` to the URL query string + if (getMetadataPath() != null) { + joiner.add(String.format("%sMetadataPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataPath())))); + } + + // add `PreferredMetadataLanguage` to the URL query string + if (getPreferredMetadataLanguage() != null) { + joiner.add(String.format("%sPreferredMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreferredMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `SortReplaceCharacters` to the URL query string + if (getSortReplaceCharacters() != null) { + for (int i = 0; i < getSortReplaceCharacters().size(); i++) { + joiner.add(String.format("%sSortReplaceCharacters%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSortReplaceCharacters().get(i))))); + } + } + + // add `SortRemoveCharacters` to the URL query string + if (getSortRemoveCharacters() != null) { + for (int i = 0; i < getSortRemoveCharacters().size(); i++) { + joiner.add(String.format("%sSortRemoveCharacters%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSortRemoveCharacters().get(i))))); + } + } + + // add `SortRemoveWords` to the URL query string + if (getSortRemoveWords() != null) { + for (int i = 0; i < getSortRemoveWords().size(); i++) { + joiner.add(String.format("%sSortRemoveWords%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSortRemoveWords().get(i))))); + } + } + + // add `MinResumePct` to the URL query string + if (getMinResumePct() != null) { + joiner.add(String.format("%sMinResumePct%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMinResumePct())))); + } + + // add `MaxResumePct` to the URL query string + if (getMaxResumePct() != null) { + joiner.add(String.format("%sMaxResumePct%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxResumePct())))); + } + + // add `MinResumeDurationSeconds` to the URL query string + if (getMinResumeDurationSeconds() != null) { + joiner.add(String.format("%sMinResumeDurationSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMinResumeDurationSeconds())))); + } + + // add `MinAudiobookResume` to the URL query string + if (getMinAudiobookResume() != null) { + joiner.add(String.format("%sMinAudiobookResume%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMinAudiobookResume())))); + } + + // add `MaxAudiobookResume` to the URL query string + if (getMaxAudiobookResume() != null) { + joiner.add(String.format("%sMaxAudiobookResume%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxAudiobookResume())))); + } + + // add `InactiveSessionThreshold` to the URL query string + if (getInactiveSessionThreshold() != null) { + joiner.add(String.format("%sInactiveSessionThreshold%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getInactiveSessionThreshold())))); + } + + // add `LibraryMonitorDelay` to the URL query string + if (getLibraryMonitorDelay() != null) { + joiner.add(String.format("%sLibraryMonitorDelay%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLibraryMonitorDelay())))); + } + + // add `LibraryUpdateDuration` to the URL query string + if (getLibraryUpdateDuration() != null) { + joiner.add(String.format("%sLibraryUpdateDuration%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLibraryUpdateDuration())))); + } + + // add `ImageSavingConvention` to the URL query string + if (getImageSavingConvention() != null) { + joiner.add(String.format("%sImageSavingConvention%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageSavingConvention())))); + } + + // add `MetadataOptions` to the URL query string + if (getMetadataOptions() != null) { + for (int i = 0; i < getMetadataOptions().size(); i++) { + if (getMetadataOptions().get(i) != null) { + joiner.add(getMetadataOptions().get(i).toUrlQueryString(String.format("%sMetadataOptions%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `SkipDeserializationForBasicTypes` to the URL query string + if (getSkipDeserializationForBasicTypes() != null) { + joiner.add(String.format("%sSkipDeserializationForBasicTypes%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSkipDeserializationForBasicTypes())))); + } + + // add `ServerName` to the URL query string + if (getServerName() != null) { + joiner.add(String.format("%sServerName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerName())))); + } + + // add `UICulture` to the URL query string + if (getUiCulture() != null) { + joiner.add(String.format("%sUICulture%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUiCulture())))); + } + + // add `SaveMetadataHidden` to the URL query string + if (getSaveMetadataHidden() != null) { + joiner.add(String.format("%sSaveMetadataHidden%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSaveMetadataHidden())))); + } + + // add `ContentTypes` to the URL query string + if (getContentTypes() != null) { + for (int i = 0; i < getContentTypes().size(); i++) { + if (getContentTypes().get(i) != null) { + joiner.add(getContentTypes().get(i).toUrlQueryString(String.format("%sContentTypes%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `RemoteClientBitrateLimit` to the URL query string + if (getRemoteClientBitrateLimit() != null) { + joiner.add(String.format("%sRemoteClientBitrateLimit%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRemoteClientBitrateLimit())))); + } + + // add `EnableFolderView` to the URL query string + if (getEnableFolderView() != null) { + joiner.add(String.format("%sEnableFolderView%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableFolderView())))); + } + + // add `EnableGroupingIntoCollections` to the URL query string + if (getEnableGroupingIntoCollections() != null) { + joiner.add(String.format("%sEnableGroupingIntoCollections%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableGroupingIntoCollections())))); + } + + // add `DisplaySpecialsWithinSeasons` to the URL query string + if (getDisplaySpecialsWithinSeasons() != null) { + joiner.add(String.format("%sDisplaySpecialsWithinSeasons%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplaySpecialsWithinSeasons())))); + } + + // add `CodecsUsed` to the URL query string + if (getCodecsUsed() != null) { + for (int i = 0; i < getCodecsUsed().size(); i++) { + joiner.add(String.format("%sCodecsUsed%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getCodecsUsed().get(i))))); + } + } + + // add `PluginRepositories` to the URL query string + if (getPluginRepositories() != null) { + for (int i = 0; i < getPluginRepositories().size(); i++) { + if (getPluginRepositories().get(i) != null) { + joiner.add(getPluginRepositories().get(i).toUrlQueryString(String.format("%sPluginRepositories%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `EnableExternalContentInSuggestions` to the URL query string + if (getEnableExternalContentInSuggestions() != null) { + joiner.add(String.format("%sEnableExternalContentInSuggestions%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableExternalContentInSuggestions())))); + } + + // add `ImageExtractionTimeoutMs` to the URL query string + if (getImageExtractionTimeoutMs() != null) { + joiner.add(String.format("%sImageExtractionTimeoutMs%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageExtractionTimeoutMs())))); + } + + // add `PathSubstitutions` to the URL query string + if (getPathSubstitutions() != null) { + for (int i = 0; i < getPathSubstitutions().size(); i++) { + if (getPathSubstitutions().get(i) != null) { + joiner.add(getPathSubstitutions().get(i).toUrlQueryString(String.format("%sPathSubstitutions%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `EnableSlowResponseWarning` to the URL query string + if (getEnableSlowResponseWarning() != null) { + joiner.add(String.format("%sEnableSlowResponseWarning%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableSlowResponseWarning())))); + } + + // add `SlowResponseThresholdMs` to the URL query string + if (getSlowResponseThresholdMs() != null) { + joiner.add(String.format("%sSlowResponseThresholdMs%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSlowResponseThresholdMs())))); + } + + // add `CorsHosts` to the URL query string + if (getCorsHosts() != null) { + for (int i = 0; i < getCorsHosts().size(); i++) { + joiner.add(String.format("%sCorsHosts%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getCorsHosts().get(i))))); + } + } + + // add `ActivityLogRetentionDays` to the URL query string + if (getActivityLogRetentionDays() != null) { + joiner.add(String.format("%sActivityLogRetentionDays%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getActivityLogRetentionDays())))); + } + + // add `LibraryScanFanoutConcurrency` to the URL query string + if (getLibraryScanFanoutConcurrency() != null) { + joiner.add(String.format("%sLibraryScanFanoutConcurrency%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLibraryScanFanoutConcurrency())))); + } + + // add `LibraryMetadataRefreshConcurrency` to the URL query string + if (getLibraryMetadataRefreshConcurrency() != null) { + joiner.add(String.format("%sLibraryMetadataRefreshConcurrency%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLibraryMetadataRefreshConcurrency())))); + } + + // add `RemoveOldPlugins` to the URL query string + if (getRemoveOldPlugins() != null) { + joiner.add(String.format("%sRemoveOldPlugins%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRemoveOldPlugins())))); + } + + // add `AllowClientLogUpload` to the URL query string + if (getAllowClientLogUpload() != null) { + joiner.add(String.format("%sAllowClientLogUpload%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAllowClientLogUpload())))); + } + + // add `DummyChapterDuration` to the URL query string + if (getDummyChapterDuration() != null) { + joiner.add(String.format("%sDummyChapterDuration%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDummyChapterDuration())))); + } + + // add `ChapterImageResolution` to the URL query string + if (getChapterImageResolution() != null) { + joiner.add(String.format("%sChapterImageResolution%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChapterImageResolution())))); + } + + // add `ParallelImageEncodingLimit` to the URL query string + if (getParallelImageEncodingLimit() != null) { + joiner.add(String.format("%sParallelImageEncodingLimit%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParallelImageEncodingLimit())))); + } + + // add `CastReceiverApplications` to the URL query string + if (getCastReceiverApplications() != null) { + for (int i = 0; i < getCastReceiverApplications().size(); i++) { + if (getCastReceiverApplications().get(i) != null) { + joiner.add(getCastReceiverApplications().get(i).toUrlQueryString(String.format( + "%sCastReceiverApplications%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TrickplayOptions` to the URL query string + if (getTrickplayOptions() != null) { + joiner.add(getTrickplayOptions().toUrlQueryString(prefix + "TrickplayOptions" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private ServerConfiguration instance; + + public Builder() { + this(new ServerConfiguration()); + } + + protected Builder(ServerConfiguration instance) { + this.instance = instance; + } + + public ServerConfiguration.Builder logFileRetentionDays(Integer logFileRetentionDays) { + this.instance.logFileRetentionDays = logFileRetentionDays; + return this; + } + + public ServerConfiguration.Builder isStartupWizardCompleted(Boolean isStartupWizardCompleted) { + this.instance.isStartupWizardCompleted = isStartupWizardCompleted; + return this; + } + + public ServerConfiguration.Builder cachePath(String cachePath) { + this.instance.cachePath = cachePath; + return this; + } + + public ServerConfiguration.Builder previousVersion(String previousVersion) { + this.instance.previousVersion = previousVersion; + return this; + } + + public ServerConfiguration.Builder previousVersionStr(String previousVersionStr) { + this.instance.previousVersionStr = previousVersionStr; + return this; + } + + public ServerConfiguration.Builder enableMetrics(Boolean enableMetrics) { + this.instance.enableMetrics = enableMetrics; + return this; + } + + public ServerConfiguration.Builder enableNormalizedItemByNameIds(Boolean enableNormalizedItemByNameIds) { + this.instance.enableNormalizedItemByNameIds = enableNormalizedItemByNameIds; + return this; + } + + public ServerConfiguration.Builder isPortAuthorized(Boolean isPortAuthorized) { + this.instance.isPortAuthorized = isPortAuthorized; + return this; + } + + public ServerConfiguration.Builder quickConnectAvailable(Boolean quickConnectAvailable) { + this.instance.quickConnectAvailable = quickConnectAvailable; + return this; + } + + public ServerConfiguration.Builder enableCaseSensitiveItemIds(Boolean enableCaseSensitiveItemIds) { + this.instance.enableCaseSensitiveItemIds = enableCaseSensitiveItemIds; + return this; + } + + public ServerConfiguration.Builder disableLiveTvChannelUserDataName(Boolean disableLiveTvChannelUserDataName) { + this.instance.disableLiveTvChannelUserDataName = disableLiveTvChannelUserDataName; + return this; + } + + public ServerConfiguration.Builder metadataPath(String metadataPath) { + this.instance.metadataPath = metadataPath; + return this; + } + + public ServerConfiguration.Builder preferredMetadataLanguage(String preferredMetadataLanguage) { + this.instance.preferredMetadataLanguage = preferredMetadataLanguage; + return this; + } + + public ServerConfiguration.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public ServerConfiguration.Builder sortReplaceCharacters(List sortReplaceCharacters) { + this.instance.sortReplaceCharacters = sortReplaceCharacters; + return this; + } + + public ServerConfiguration.Builder sortRemoveCharacters(List sortRemoveCharacters) { + this.instance.sortRemoveCharacters = sortRemoveCharacters; + return this; + } + + public ServerConfiguration.Builder sortRemoveWords(List sortRemoveWords) { + this.instance.sortRemoveWords = sortRemoveWords; + return this; + } + + public ServerConfiguration.Builder minResumePct(Integer minResumePct) { + this.instance.minResumePct = minResumePct; + return this; + } + + public ServerConfiguration.Builder maxResumePct(Integer maxResumePct) { + this.instance.maxResumePct = maxResumePct; + return this; + } + + public ServerConfiguration.Builder minResumeDurationSeconds(Integer minResumeDurationSeconds) { + this.instance.minResumeDurationSeconds = minResumeDurationSeconds; + return this; + } + + public ServerConfiguration.Builder minAudiobookResume(Integer minAudiobookResume) { + this.instance.minAudiobookResume = minAudiobookResume; + return this; + } + + public ServerConfiguration.Builder maxAudiobookResume(Integer maxAudiobookResume) { + this.instance.maxAudiobookResume = maxAudiobookResume; + return this; + } + + public ServerConfiguration.Builder inactiveSessionThreshold(Integer inactiveSessionThreshold) { + this.instance.inactiveSessionThreshold = inactiveSessionThreshold; + return this; + } + + public ServerConfiguration.Builder libraryMonitorDelay(Integer libraryMonitorDelay) { + this.instance.libraryMonitorDelay = libraryMonitorDelay; + return this; + } + + public ServerConfiguration.Builder libraryUpdateDuration(Integer libraryUpdateDuration) { + this.instance.libraryUpdateDuration = libraryUpdateDuration; + return this; + } + + public ServerConfiguration.Builder imageSavingConvention(ImageSavingConvention imageSavingConvention) { + this.instance.imageSavingConvention = imageSavingConvention; + return this; + } + + public ServerConfiguration.Builder metadataOptions(List metadataOptions) { + this.instance.metadataOptions = metadataOptions; + return this; + } + + public ServerConfiguration.Builder skipDeserializationForBasicTypes(Boolean skipDeserializationForBasicTypes) { + this.instance.skipDeserializationForBasicTypes = skipDeserializationForBasicTypes; + return this; + } + + public ServerConfiguration.Builder serverName(String serverName) { + this.instance.serverName = serverName; + return this; + } + + public ServerConfiguration.Builder uiCulture(String uiCulture) { + this.instance.uiCulture = uiCulture; + return this; + } + + public ServerConfiguration.Builder saveMetadataHidden(Boolean saveMetadataHidden) { + this.instance.saveMetadataHidden = saveMetadataHidden; + return this; + } + + public ServerConfiguration.Builder contentTypes(List contentTypes) { + this.instance.contentTypes = contentTypes; + return this; + } + + public ServerConfiguration.Builder remoteClientBitrateLimit(Integer remoteClientBitrateLimit) { + this.instance.remoteClientBitrateLimit = remoteClientBitrateLimit; + return this; + } + + public ServerConfiguration.Builder enableFolderView(Boolean enableFolderView) { + this.instance.enableFolderView = enableFolderView; + return this; + } + + public ServerConfiguration.Builder enableGroupingIntoCollections(Boolean enableGroupingIntoCollections) { + this.instance.enableGroupingIntoCollections = enableGroupingIntoCollections; + return this; + } + + public ServerConfiguration.Builder displaySpecialsWithinSeasons(Boolean displaySpecialsWithinSeasons) { + this.instance.displaySpecialsWithinSeasons = displaySpecialsWithinSeasons; + return this; + } + + public ServerConfiguration.Builder codecsUsed(List codecsUsed) { + this.instance.codecsUsed = codecsUsed; + return this; + } + + public ServerConfiguration.Builder pluginRepositories(List pluginRepositories) { + this.instance.pluginRepositories = pluginRepositories; + return this; + } + + public ServerConfiguration.Builder enableExternalContentInSuggestions( + Boolean enableExternalContentInSuggestions) { + this.instance.enableExternalContentInSuggestions = enableExternalContentInSuggestions; + return this; + } + + public ServerConfiguration.Builder imageExtractionTimeoutMs(Integer imageExtractionTimeoutMs) { + this.instance.imageExtractionTimeoutMs = imageExtractionTimeoutMs; + return this; + } + + public ServerConfiguration.Builder pathSubstitutions(List pathSubstitutions) { + this.instance.pathSubstitutions = pathSubstitutions; + return this; + } + + public ServerConfiguration.Builder enableSlowResponseWarning(Boolean enableSlowResponseWarning) { + this.instance.enableSlowResponseWarning = enableSlowResponseWarning; + return this; + } + + public ServerConfiguration.Builder slowResponseThresholdMs(Long slowResponseThresholdMs) { + this.instance.slowResponseThresholdMs = slowResponseThresholdMs; + return this; + } + + public ServerConfiguration.Builder corsHosts(List corsHosts) { + this.instance.corsHosts = corsHosts; + return this; + } + + public ServerConfiguration.Builder activityLogRetentionDays(Integer activityLogRetentionDays) { + this.instance.activityLogRetentionDays = activityLogRetentionDays; + return this; + } + + public ServerConfiguration.Builder libraryScanFanoutConcurrency(Integer libraryScanFanoutConcurrency) { + this.instance.libraryScanFanoutConcurrency = libraryScanFanoutConcurrency; + return this; + } + + public ServerConfiguration.Builder libraryMetadataRefreshConcurrency( + Integer libraryMetadataRefreshConcurrency) { + this.instance.libraryMetadataRefreshConcurrency = libraryMetadataRefreshConcurrency; + return this; + } + + public ServerConfiguration.Builder removeOldPlugins(Boolean removeOldPlugins) { + this.instance.removeOldPlugins = removeOldPlugins; + return this; + } + + public ServerConfiguration.Builder allowClientLogUpload(Boolean allowClientLogUpload) { + this.instance.allowClientLogUpload = allowClientLogUpload; + return this; + } + + public ServerConfiguration.Builder dummyChapterDuration(Integer dummyChapterDuration) { + this.instance.dummyChapterDuration = dummyChapterDuration; + return this; + } + + public ServerConfiguration.Builder chapterImageResolution(ImageResolution chapterImageResolution) { + this.instance.chapterImageResolution = chapterImageResolution; + return this; + } + + public ServerConfiguration.Builder parallelImageEncodingLimit(Integer parallelImageEncodingLimit) { + this.instance.parallelImageEncodingLimit = parallelImageEncodingLimit; + return this; + } + + public ServerConfiguration.Builder castReceiverApplications( + List castReceiverApplications) { + this.instance.castReceiverApplications = castReceiverApplications; + return this; + } + + public ServerConfiguration.Builder trickplayOptions(TrickplayOptions trickplayOptions) { + this.instance.trickplayOptions = trickplayOptions; + return this; + } + + /** + * returns a built ServerConfiguration instance. + * + * The builder is not reusable. + */ + public ServerConfiguration build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ServerConfiguration.Builder builder() { + return new ServerConfiguration.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ServerConfiguration.Builder toBuilder() { + return new ServerConfiguration.Builder().logFileRetentionDays(getLogFileRetentionDays()) + .isStartupWizardCompleted(getIsStartupWizardCompleted()).cachePath(getCachePath()) + .previousVersion(getPreviousVersion()).previousVersionStr(getPreviousVersionStr()) + .enableMetrics(getEnableMetrics()).enableNormalizedItemByNameIds(getEnableNormalizedItemByNameIds()) + .isPortAuthorized(getIsPortAuthorized()).quickConnectAvailable(getQuickConnectAvailable()) + .enableCaseSensitiveItemIds(getEnableCaseSensitiveItemIds()) + .disableLiveTvChannelUserDataName(getDisableLiveTvChannelUserDataName()).metadataPath(getMetadataPath()) + .preferredMetadataLanguage(getPreferredMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .sortReplaceCharacters(getSortReplaceCharacters()).sortRemoveCharacters(getSortRemoveCharacters()) + .sortRemoveWords(getSortRemoveWords()).minResumePct(getMinResumePct()).maxResumePct(getMaxResumePct()) + .minResumeDurationSeconds(getMinResumeDurationSeconds()).minAudiobookResume(getMinAudiobookResume()) + .maxAudiobookResume(getMaxAudiobookResume()).inactiveSessionThreshold(getInactiveSessionThreshold()) + .libraryMonitorDelay(getLibraryMonitorDelay()).libraryUpdateDuration(getLibraryUpdateDuration()) + .imageSavingConvention(getImageSavingConvention()).metadataOptions(getMetadataOptions()) + .skipDeserializationForBasicTypes(getSkipDeserializationForBasicTypes()).serverName(getServerName()) + .uiCulture(getUiCulture()).saveMetadataHidden(getSaveMetadataHidden()).contentTypes(getContentTypes()) + .remoteClientBitrateLimit(getRemoteClientBitrateLimit()).enableFolderView(getEnableFolderView()) + .enableGroupingIntoCollections(getEnableGroupingIntoCollections()) + .displaySpecialsWithinSeasons(getDisplaySpecialsWithinSeasons()).codecsUsed(getCodecsUsed()) + .pluginRepositories(getPluginRepositories()) + .enableExternalContentInSuggestions(getEnableExternalContentInSuggestions()) + .imageExtractionTimeoutMs(getImageExtractionTimeoutMs()).pathSubstitutions(getPathSubstitutions()) + .enableSlowResponseWarning(getEnableSlowResponseWarning()) + .slowResponseThresholdMs(getSlowResponseThresholdMs()).corsHosts(getCorsHosts()) + .activityLogRetentionDays(getActivityLogRetentionDays()) + .libraryScanFanoutConcurrency(getLibraryScanFanoutConcurrency()) + .libraryMetadataRefreshConcurrency(getLibraryMetadataRefreshConcurrency()) + .removeOldPlugins(getRemoveOldPlugins()).allowClientLogUpload(getAllowClientLogUpload()) + .dummyChapterDuration(getDummyChapterDuration()).chapterImageResolution(getChapterImageResolution()) + .parallelImageEncodingLimit(getParallelImageEncodingLimit()) + .castReceiverApplications(getCastReceiverApplications()).trickplayOptions(getTrickplayOptions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ServerDiscoveryInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ServerDiscoveryInfo.java new file mode 100644 index 0000000000000..331b7ed37d365 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ServerDiscoveryInfo.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The server discovery info model. + */ +@JsonPropertyOrder({ ServerDiscoveryInfo.JSON_PROPERTY_ADDRESS, ServerDiscoveryInfo.JSON_PROPERTY_ID, + ServerDiscoveryInfo.JSON_PROPERTY_NAME, ServerDiscoveryInfo.JSON_PROPERTY_ENDPOINT_ADDRESS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ServerDiscoveryInfo { + public static final String JSON_PROPERTY_ADDRESS = "Address"; + @org.eclipse.jdt.annotation.NonNull + private String address; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ENDPOINT_ADDRESS = "EndpointAddress"; + @org.eclipse.jdt.annotation.NonNull + private String endpointAddress; + + public ServerDiscoveryInfo() { + } + + public ServerDiscoveryInfo address(@org.eclipse.jdt.annotation.NonNull String address) { + this.address = address; + return this; + } + + /** + * Gets the address. + * + * @return address + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAddress() { + return address; + } + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAddress(@org.eclipse.jdt.annotation.NonNull String address) { + this.address = address; + } + + public ServerDiscoveryInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets the server identifier. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public ServerDiscoveryInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ServerDiscoveryInfo endpointAddress(@org.eclipse.jdt.annotation.NonNull String endpointAddress) { + this.endpointAddress = endpointAddress; + return this; + } + + /** + * Gets the endpoint address. + * + * @return endpointAddress + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENDPOINT_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEndpointAddress() { + return endpointAddress; + } + + @JsonProperty(JSON_PROPERTY_ENDPOINT_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpointAddress(@org.eclipse.jdt.annotation.NonNull String endpointAddress) { + this.endpointAddress = endpointAddress; + } + + /** + * Return true if this ServerDiscoveryInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServerDiscoveryInfo serverDiscoveryInfo = (ServerDiscoveryInfo) o; + return Objects.equals(this.address, serverDiscoveryInfo.address) + && Objects.equals(this.id, serverDiscoveryInfo.id) + && Objects.equals(this.name, serverDiscoveryInfo.name) + && Objects.equals(this.endpointAddress, serverDiscoveryInfo.endpointAddress); + } + + @Override + public int hashCode() { + return Objects.hash(address, id, name, endpointAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServerDiscoveryInfo {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" endpointAddress: ").append(toIndentedString(endpointAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Address` to the URL query string + if (getAddress() != null) { + joiner.add(String.format("%sAddress%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAddress())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `EndpointAddress` to the URL query string + if (getEndpointAddress() != null) { + joiner.add(String.format("%sEndpointAddress%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndpointAddress())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ServerDiscoveryInfo instance; + + public Builder() { + this(new ServerDiscoveryInfo()); + } + + protected Builder(ServerDiscoveryInfo instance) { + this.instance = instance; + } + + public ServerDiscoveryInfo.Builder address(String address) { + this.instance.address = address; + return this; + } + + public ServerDiscoveryInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public ServerDiscoveryInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ServerDiscoveryInfo.Builder endpointAddress(String endpointAddress) { + this.instance.endpointAddress = endpointAddress; + return this; + } + + /** + * returns a built ServerDiscoveryInfo instance. + * + * The builder is not reusable. + */ + public ServerDiscoveryInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ServerDiscoveryInfo.Builder builder() { + return new ServerDiscoveryInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ServerDiscoveryInfo.Builder toBuilder() { + return new ServerDiscoveryInfo.Builder().address(getAddress()).id(getId()).name(getName()) + .endpointAddress(getEndpointAddress()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ServerRestartingMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ServerRestartingMessage.java new file mode 100644 index 0000000000000..ce6503671362f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ServerRestartingMessage.java @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Server restarting down message. + */ +@JsonPropertyOrder({ ServerRestartingMessage.JSON_PROPERTY_MESSAGE_ID, + ServerRestartingMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ServerRestartingMessage { + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.SERVER_RESTARTING; + + public ServerRestartingMessage() { + } + + @JsonCreator + public ServerRestartingMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public ServerRestartingMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this ServerRestartingMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServerRestartingMessage serverRestartingMessage = (ServerRestartingMessage) o; + return Objects.equals(this.messageId, serverRestartingMessage.messageId) + && Objects.equals(this.messageType, serverRestartingMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServerRestartingMessage {\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ServerRestartingMessage instance; + + public Builder() { + this(new ServerRestartingMessage()); + } + + protected Builder(ServerRestartingMessage instance) { + this.instance = instance; + } + + public ServerRestartingMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public ServerRestartingMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built ServerRestartingMessage instance. + * + * The builder is not reusable. + */ + public ServerRestartingMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ServerRestartingMessage.Builder builder() { + return new ServerRestartingMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ServerRestartingMessage.Builder toBuilder() { + return new ServerRestartingMessage.Builder().messageId(getMessageId()).messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ServerShuttingDownMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ServerShuttingDownMessage.java new file mode 100644 index 0000000000000..ee81c88c46f9f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ServerShuttingDownMessage.java @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Server shutting down message. + */ +@JsonPropertyOrder({ ServerShuttingDownMessage.JSON_PROPERTY_MESSAGE_ID, + ServerShuttingDownMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ServerShuttingDownMessage { + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.SERVER_SHUTTING_DOWN; + + public ServerShuttingDownMessage() { + } + + @JsonCreator + public ServerShuttingDownMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public ServerShuttingDownMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this ServerShuttingDownMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServerShuttingDownMessage serverShuttingDownMessage = (ServerShuttingDownMessage) o; + return Objects.equals(this.messageId, serverShuttingDownMessage.messageId) + && Objects.equals(this.messageType, serverShuttingDownMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServerShuttingDownMessage {\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ServerShuttingDownMessage instance; + + public Builder() { + this(new ServerShuttingDownMessage()); + } + + protected Builder(ServerShuttingDownMessage instance) { + this.instance = instance; + } + + public ServerShuttingDownMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public ServerShuttingDownMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built ServerShuttingDownMessage instance. + * + * The builder is not reusable. + */ + public ServerShuttingDownMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ServerShuttingDownMessage.Builder builder() { + return new ServerShuttingDownMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ServerShuttingDownMessage.Builder toBuilder() { + return new ServerShuttingDownMessage.Builder().messageId(getMessageId()).messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionInfoDto.java new file mode 100644 index 0000000000000..44ac6c1388399 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionInfoDto.java @@ -0,0 +1,1408 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Session info DTO. + */ +@JsonPropertyOrder({ SessionInfoDto.JSON_PROPERTY_PLAY_STATE, SessionInfoDto.JSON_PROPERTY_ADDITIONAL_USERS, + SessionInfoDto.JSON_PROPERTY_CAPABILITIES, SessionInfoDto.JSON_PROPERTY_REMOTE_END_POINT, + SessionInfoDto.JSON_PROPERTY_PLAYABLE_MEDIA_TYPES, SessionInfoDto.JSON_PROPERTY_ID, + SessionInfoDto.JSON_PROPERTY_USER_ID, SessionInfoDto.JSON_PROPERTY_USER_NAME, + SessionInfoDto.JSON_PROPERTY_CLIENT, SessionInfoDto.JSON_PROPERTY_LAST_ACTIVITY_DATE, + SessionInfoDto.JSON_PROPERTY_LAST_PLAYBACK_CHECK_IN, SessionInfoDto.JSON_PROPERTY_LAST_PAUSED_DATE, + SessionInfoDto.JSON_PROPERTY_DEVICE_NAME, SessionInfoDto.JSON_PROPERTY_DEVICE_TYPE, + SessionInfoDto.JSON_PROPERTY_NOW_PLAYING_ITEM, SessionInfoDto.JSON_PROPERTY_NOW_VIEWING_ITEM, + SessionInfoDto.JSON_PROPERTY_DEVICE_ID, SessionInfoDto.JSON_PROPERTY_APPLICATION_VERSION, + SessionInfoDto.JSON_PROPERTY_TRANSCODING_INFO, SessionInfoDto.JSON_PROPERTY_IS_ACTIVE, + SessionInfoDto.JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL, SessionInfoDto.JSON_PROPERTY_SUPPORTS_REMOTE_CONTROL, + SessionInfoDto.JSON_PROPERTY_NOW_PLAYING_QUEUE, SessionInfoDto.JSON_PROPERTY_NOW_PLAYING_QUEUE_FULL_ITEMS, + SessionInfoDto.JSON_PROPERTY_HAS_CUSTOM_DEVICE_NAME, SessionInfoDto.JSON_PROPERTY_PLAYLIST_ITEM_ID, + SessionInfoDto.JSON_PROPERTY_SERVER_ID, SessionInfoDto.JSON_PROPERTY_USER_PRIMARY_IMAGE_TAG, + SessionInfoDto.JSON_PROPERTY_SUPPORTED_COMMANDS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SessionInfoDto { + public static final String JSON_PROPERTY_PLAY_STATE = "PlayState"; + @org.eclipse.jdt.annotation.NonNull + private PlayerStateInfo playState; + + public static final String JSON_PROPERTY_ADDITIONAL_USERS = "AdditionalUsers"; + @org.eclipse.jdt.annotation.NonNull + private List additionalUsers; + + public static final String JSON_PROPERTY_CAPABILITIES = "Capabilities"; + @org.eclipse.jdt.annotation.NonNull + private ClientCapabilitiesDto capabilities; + + public static final String JSON_PROPERTY_REMOTE_END_POINT = "RemoteEndPoint"; + @org.eclipse.jdt.annotation.NonNull + private String remoteEndPoint; + + public static final String JSON_PROPERTY_PLAYABLE_MEDIA_TYPES = "PlayableMediaTypes"; + @org.eclipse.jdt.annotation.NonNull + private List playableMediaTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_USER_NAME = "UserName"; + @org.eclipse.jdt.annotation.NonNull + private String userName; + + public static final String JSON_PROPERTY_CLIENT = "Client"; + @org.eclipse.jdt.annotation.NonNull + private String client; + + public static final String JSON_PROPERTY_LAST_ACTIVITY_DATE = "LastActivityDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime lastActivityDate; + + public static final String JSON_PROPERTY_LAST_PLAYBACK_CHECK_IN = "LastPlaybackCheckIn"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime lastPlaybackCheckIn; + + public static final String JSON_PROPERTY_LAST_PAUSED_DATE = "LastPausedDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime lastPausedDate; + + public static final String JSON_PROPERTY_DEVICE_NAME = "DeviceName"; + @org.eclipse.jdt.annotation.NonNull + private String deviceName; + + public static final String JSON_PROPERTY_DEVICE_TYPE = "DeviceType"; + @org.eclipse.jdt.annotation.NonNull + private String deviceType; + + public static final String JSON_PROPERTY_NOW_PLAYING_ITEM = "NowPlayingItem"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemDto nowPlayingItem; + + public static final String JSON_PROPERTY_NOW_VIEWING_ITEM = "NowViewingItem"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemDto nowViewingItem; + + public static final String JSON_PROPERTY_DEVICE_ID = "DeviceId"; + @org.eclipse.jdt.annotation.NonNull + private String deviceId; + + public static final String JSON_PROPERTY_APPLICATION_VERSION = "ApplicationVersion"; + @org.eclipse.jdt.annotation.NonNull + private String applicationVersion; + + public static final String JSON_PROPERTY_TRANSCODING_INFO = "TranscodingInfo"; + @org.eclipse.jdt.annotation.NonNull + private TranscodingInfo transcodingInfo; + + public static final String JSON_PROPERTY_IS_ACTIVE = "IsActive"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isActive; + + public static final String JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL = "SupportsMediaControl"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsMediaControl; + + public static final String JSON_PROPERTY_SUPPORTS_REMOTE_CONTROL = "SupportsRemoteControl"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsRemoteControl; + + public static final String JSON_PROPERTY_NOW_PLAYING_QUEUE = "NowPlayingQueue"; + @org.eclipse.jdt.annotation.NonNull + private List nowPlayingQueue; + + public static final String JSON_PROPERTY_NOW_PLAYING_QUEUE_FULL_ITEMS = "NowPlayingQueueFullItems"; + @org.eclipse.jdt.annotation.NonNull + private List nowPlayingQueueFullItems; + + public static final String JSON_PROPERTY_HAS_CUSTOM_DEVICE_NAME = "HasCustomDeviceName"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasCustomDeviceName; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private String playlistItemId; + + public static final String JSON_PROPERTY_SERVER_ID = "ServerId"; + @org.eclipse.jdt.annotation.NonNull + private String serverId; + + public static final String JSON_PROPERTY_USER_PRIMARY_IMAGE_TAG = "UserPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String userPrimaryImageTag; + + public static final String JSON_PROPERTY_SUPPORTED_COMMANDS = "SupportedCommands"; + @org.eclipse.jdt.annotation.NonNull + private List supportedCommands = new ArrayList<>(); + + public SessionInfoDto() { + } + + public SessionInfoDto playState(@org.eclipse.jdt.annotation.NonNull PlayerStateInfo playState) { + this.playState = playState; + return this; + } + + /** + * Gets or sets the play state. + * + * @return playState + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlayerStateInfo getPlayState() { + return playState; + } + + @JsonProperty(JSON_PROPERTY_PLAY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayState(@org.eclipse.jdt.annotation.NonNull PlayerStateInfo playState) { + this.playState = playState; + } + + public SessionInfoDto additionalUsers(@org.eclipse.jdt.annotation.NonNull List additionalUsers) { + this.additionalUsers = additionalUsers; + return this; + } + + public SessionInfoDto addAdditionalUsersItem(SessionUserInfo additionalUsersItem) { + if (this.additionalUsers == null) { + this.additionalUsers = new ArrayList<>(); + } + this.additionalUsers.add(additionalUsersItem); + return this; + } + + /** + * Gets or sets the additional users. + * + * @return additionalUsers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ADDITIONAL_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAdditionalUsers() { + return additionalUsers; + } + + @JsonProperty(JSON_PROPERTY_ADDITIONAL_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdditionalUsers(@org.eclipse.jdt.annotation.NonNull List additionalUsers) { + this.additionalUsers = additionalUsers; + } + + public SessionInfoDto capabilities(@org.eclipse.jdt.annotation.NonNull ClientCapabilitiesDto capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Gets or sets the client capabilities. + * + * @return capabilities + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAPABILITIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ClientCapabilitiesDto getCapabilities() { + return capabilities; + } + + @JsonProperty(JSON_PROPERTY_CAPABILITIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapabilities(@org.eclipse.jdt.annotation.NonNull ClientCapabilitiesDto capabilities) { + this.capabilities = capabilities; + } + + public SessionInfoDto remoteEndPoint(@org.eclipse.jdt.annotation.NonNull String remoteEndPoint) { + this.remoteEndPoint = remoteEndPoint; + return this; + } + + /** + * Gets or sets the remote end point. + * + * @return remoteEndPoint + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMOTE_END_POINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRemoteEndPoint() { + return remoteEndPoint; + } + + @JsonProperty(JSON_PROPERTY_REMOTE_END_POINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemoteEndPoint(@org.eclipse.jdt.annotation.NonNull String remoteEndPoint) { + this.remoteEndPoint = remoteEndPoint; + } + + public SessionInfoDto playableMediaTypes(@org.eclipse.jdt.annotation.NonNull List playableMediaTypes) { + this.playableMediaTypes = playableMediaTypes; + return this; + } + + public SessionInfoDto addPlayableMediaTypesItem(MediaType playableMediaTypesItem) { + if (this.playableMediaTypes == null) { + this.playableMediaTypes = new ArrayList<>(); + } + this.playableMediaTypes.add(playableMediaTypesItem); + return this; + } + + /** + * Gets or sets the playable media types. + * + * @return playableMediaTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYABLE_MEDIA_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPlayableMediaTypes() { + return playableMediaTypes; + } + + @JsonProperty(JSON_PROPERTY_PLAYABLE_MEDIA_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayableMediaTypes(@org.eclipse.jdt.annotation.NonNull List playableMediaTypes) { + this.playableMediaTypes = playableMediaTypes; + } + + public SessionInfoDto id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public SessionInfoDto userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the user id. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public SessionInfoDto userName(@org.eclipse.jdt.annotation.NonNull String userName) { + this.userName = userName; + return this; + } + + /** + * Gets or sets the username. + * + * @return userName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserName() { + return userName; + } + + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserName(@org.eclipse.jdt.annotation.NonNull String userName) { + this.userName = userName; + } + + public SessionInfoDto client(@org.eclipse.jdt.annotation.NonNull String client) { + this.client = client; + return this; + } + + /** + * Gets or sets the type of the client. + * + * @return client + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { + return client; + } + + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClient(@org.eclipse.jdt.annotation.NonNull String client) { + this.client = client; + } + + public SessionInfoDto lastActivityDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastActivityDate) { + this.lastActivityDate = lastActivityDate; + return this; + } + + /** + * Gets or sets the last activity date. + * + * @return lastActivityDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_ACTIVITY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastActivityDate() { + return lastActivityDate; + } + + @JsonProperty(JSON_PROPERTY_LAST_ACTIVITY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastActivityDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastActivityDate) { + this.lastActivityDate = lastActivityDate; + } + + public SessionInfoDto lastPlaybackCheckIn(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastPlaybackCheckIn) { + this.lastPlaybackCheckIn = lastPlaybackCheckIn; + return this; + } + + /** + * Gets or sets the last playback check in. + * + * @return lastPlaybackCheckIn + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_PLAYBACK_CHECK_IN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastPlaybackCheckIn() { + return lastPlaybackCheckIn; + } + + @JsonProperty(JSON_PROPERTY_LAST_PLAYBACK_CHECK_IN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastPlaybackCheckIn(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastPlaybackCheckIn) { + this.lastPlaybackCheckIn = lastPlaybackCheckIn; + } + + public SessionInfoDto lastPausedDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastPausedDate) { + this.lastPausedDate = lastPausedDate; + return this; + } + + /** + * Gets or sets the last paused date. + * + * @return lastPausedDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_PAUSED_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastPausedDate() { + return lastPausedDate; + } + + @JsonProperty(JSON_PROPERTY_LAST_PAUSED_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastPausedDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastPausedDate) { + this.lastPausedDate = lastPausedDate; + } + + public SessionInfoDto deviceName(@org.eclipse.jdt.annotation.NonNull String deviceName) { + this.deviceName = deviceName; + return this; + } + + /** + * Gets or sets the name of the device. + * + * @return deviceName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceName() { + return deviceName; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceName(@org.eclipse.jdt.annotation.NonNull String deviceName) { + this.deviceName = deviceName; + } + + public SessionInfoDto deviceType(@org.eclipse.jdt.annotation.NonNull String deviceType) { + this.deviceType = deviceType; + return this; + } + + /** + * Gets or sets the type of the device. + * + * @return deviceType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceType() { + return deviceType; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceType(@org.eclipse.jdt.annotation.NonNull String deviceType) { + this.deviceType = deviceType; + } + + public SessionInfoDto nowPlayingItem(@org.eclipse.jdt.annotation.NonNull BaseItemDto nowPlayingItem) { + this.nowPlayingItem = nowPlayingItem; + return this; + } + + /** + * Gets or sets the now playing item. + * + * @return nowPlayingItem + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemDto getNowPlayingItem() { + return nowPlayingItem; + } + + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNowPlayingItem(@org.eclipse.jdt.annotation.NonNull BaseItemDto nowPlayingItem) { + this.nowPlayingItem = nowPlayingItem; + } + + public SessionInfoDto nowViewingItem(@org.eclipse.jdt.annotation.NonNull BaseItemDto nowViewingItem) { + this.nowViewingItem = nowViewingItem; + return this; + } + + /** + * Gets or sets the now viewing item. + * + * @return nowViewingItem + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NOW_VIEWING_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemDto getNowViewingItem() { + return nowViewingItem; + } + + @JsonProperty(JSON_PROPERTY_NOW_VIEWING_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNowViewingItem(@org.eclipse.jdt.annotation.NonNull BaseItemDto nowViewingItem) { + this.nowViewingItem = nowViewingItem; + } + + public SessionInfoDto deviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Gets or sets the device id. + * + * @return deviceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceId() { + return deviceId; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + } + + public SessionInfoDto applicationVersion(@org.eclipse.jdt.annotation.NonNull String applicationVersion) { + this.applicationVersion = applicationVersion; + return this; + } + + /** + * Gets or sets the application version. + * + * @return applicationVersion + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APPLICATION_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getApplicationVersion() { + return applicationVersion; + } + + @JsonProperty(JSON_PROPERTY_APPLICATION_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApplicationVersion(@org.eclipse.jdt.annotation.NonNull String applicationVersion) { + this.applicationVersion = applicationVersion; + } + + public SessionInfoDto transcodingInfo(@org.eclipse.jdt.annotation.NonNull TranscodingInfo transcodingInfo) { + this.transcodingInfo = transcodingInfo; + return this; + } + + /** + * Gets or sets the transcoding info. + * + * @return transcodingInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODING_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TranscodingInfo getTranscodingInfo() { + return transcodingInfo; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODING_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodingInfo(@org.eclipse.jdt.annotation.NonNull TranscodingInfo transcodingInfo) { + this.transcodingInfo = transcodingInfo; + } + + public SessionInfoDto isActive(@org.eclipse.jdt.annotation.NonNull Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Gets or sets a value indicating whether this session is active. + * + * @return isActive + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsActive() { + return isActive; + } + + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsActive(@org.eclipse.jdt.annotation.NonNull Boolean isActive) { + this.isActive = isActive; + } + + public SessionInfoDto supportsMediaControl(@org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl) { + this.supportsMediaControl = supportsMediaControl; + return this; + } + + /** + * Gets or sets a value indicating whether the session supports media control. + * + * @return supportsMediaControl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsMediaControl() { + return supportsMediaControl; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsMediaControl(@org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl) { + this.supportsMediaControl = supportsMediaControl; + } + + public SessionInfoDto supportsRemoteControl(@org.eclipse.jdt.annotation.NonNull Boolean supportsRemoteControl) { + this.supportsRemoteControl = supportsRemoteControl; + return this; + } + + /** + * Gets or sets a value indicating whether the session supports remote control. + * + * @return supportsRemoteControl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_REMOTE_CONTROL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsRemoteControl() { + return supportsRemoteControl; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_REMOTE_CONTROL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsRemoteControl(@org.eclipse.jdt.annotation.NonNull Boolean supportsRemoteControl) { + this.supportsRemoteControl = supportsRemoteControl; + } + + public SessionInfoDto nowPlayingQueue(@org.eclipse.jdt.annotation.NonNull List nowPlayingQueue) { + this.nowPlayingQueue = nowPlayingQueue; + return this; + } + + public SessionInfoDto addNowPlayingQueueItem(QueueItem nowPlayingQueueItem) { + if (this.nowPlayingQueue == null) { + this.nowPlayingQueue = new ArrayList<>(); + } + this.nowPlayingQueue.add(nowPlayingQueueItem); + return this; + } + + /** + * Gets or sets the now playing queue. + * + * @return nowPlayingQueue + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNowPlayingQueue() { + return nowPlayingQueue; + } + + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNowPlayingQueue(@org.eclipse.jdt.annotation.NonNull List nowPlayingQueue) { + this.nowPlayingQueue = nowPlayingQueue; + } + + public SessionInfoDto nowPlayingQueueFullItems( + @org.eclipse.jdt.annotation.NonNull List nowPlayingQueueFullItems) { + this.nowPlayingQueueFullItems = nowPlayingQueueFullItems; + return this; + } + + public SessionInfoDto addNowPlayingQueueFullItemsItem(BaseItemDto nowPlayingQueueFullItemsItem) { + if (this.nowPlayingQueueFullItems == null) { + this.nowPlayingQueueFullItems = new ArrayList<>(); + } + this.nowPlayingQueueFullItems.add(nowPlayingQueueFullItemsItem); + return this; + } + + /** + * Gets or sets the now playing queue full items. + * + * @return nowPlayingQueueFullItems + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE_FULL_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNowPlayingQueueFullItems() { + return nowPlayingQueueFullItems; + } + + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE_FULL_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNowPlayingQueueFullItems( + @org.eclipse.jdt.annotation.NonNull List nowPlayingQueueFullItems) { + this.nowPlayingQueueFullItems = nowPlayingQueueFullItems; + } + + public SessionInfoDto hasCustomDeviceName(@org.eclipse.jdt.annotation.NonNull Boolean hasCustomDeviceName) { + this.hasCustomDeviceName = hasCustomDeviceName; + return this; + } + + /** + * Gets or sets a value indicating whether the session has a custom device name. + * + * @return hasCustomDeviceName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_CUSTOM_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasCustomDeviceName() { + return hasCustomDeviceName; + } + + @JsonProperty(JSON_PROPERTY_HAS_CUSTOM_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasCustomDeviceName(@org.eclipse.jdt.annotation.NonNull Boolean hasCustomDeviceName) { + this.hasCustomDeviceName = hasCustomDeviceName; + } + + public SessionInfoDto playlistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets or sets the playlist item id. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + } + + public SessionInfoDto serverId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + return this; + } + + /** + * Gets or sets the server id. + * + * @return serverId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerId() { + return serverId; + } + + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + } + + public SessionInfoDto userPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String userPrimaryImageTag) { + this.userPrimaryImageTag = userPrimaryImageTag; + return this; + } + + /** + * Gets or sets the user primary image tag. + * + * @return userPrimaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserPrimaryImageTag() { + return userPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_USER_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String userPrimaryImageTag) { + this.userPrimaryImageTag = userPrimaryImageTag; + } + + public SessionInfoDto supportedCommands( + @org.eclipse.jdt.annotation.NonNull List supportedCommands) { + this.supportedCommands = supportedCommands; + return this; + } + + public SessionInfoDto addSupportedCommandsItem(GeneralCommandType supportedCommandsItem) { + if (this.supportedCommands == null) { + this.supportedCommands = new ArrayList<>(); + } + this.supportedCommands.add(supportedCommandsItem); + return this; + } + + /** + * Gets or sets the supported commands. + * + * @return supportedCommands + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTED_COMMANDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSupportedCommands() { + return supportedCommands; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTED_COMMANDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportedCommands(@org.eclipse.jdt.annotation.NonNull List supportedCommands) { + this.supportedCommands = supportedCommands; + } + + /** + * Return true if this SessionInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionInfoDto sessionInfoDto = (SessionInfoDto) o; + return Objects.equals(this.playState, sessionInfoDto.playState) + && Objects.equals(this.additionalUsers, sessionInfoDto.additionalUsers) + && Objects.equals(this.capabilities, sessionInfoDto.capabilities) + && Objects.equals(this.remoteEndPoint, sessionInfoDto.remoteEndPoint) + && Objects.equals(this.playableMediaTypes, sessionInfoDto.playableMediaTypes) + && Objects.equals(this.id, sessionInfoDto.id) && Objects.equals(this.userId, sessionInfoDto.userId) + && Objects.equals(this.userName, sessionInfoDto.userName) + && Objects.equals(this.client, sessionInfoDto.client) + && Objects.equals(this.lastActivityDate, sessionInfoDto.lastActivityDate) + && Objects.equals(this.lastPlaybackCheckIn, sessionInfoDto.lastPlaybackCheckIn) + && Objects.equals(this.lastPausedDate, sessionInfoDto.lastPausedDate) + && Objects.equals(this.deviceName, sessionInfoDto.deviceName) + && Objects.equals(this.deviceType, sessionInfoDto.deviceType) + && Objects.equals(this.nowPlayingItem, sessionInfoDto.nowPlayingItem) + && Objects.equals(this.nowViewingItem, sessionInfoDto.nowViewingItem) + && Objects.equals(this.deviceId, sessionInfoDto.deviceId) + && Objects.equals(this.applicationVersion, sessionInfoDto.applicationVersion) + && Objects.equals(this.transcodingInfo, sessionInfoDto.transcodingInfo) + && Objects.equals(this.isActive, sessionInfoDto.isActive) + && Objects.equals(this.supportsMediaControl, sessionInfoDto.supportsMediaControl) + && Objects.equals(this.supportsRemoteControl, sessionInfoDto.supportsRemoteControl) + && Objects.equals(this.nowPlayingQueue, sessionInfoDto.nowPlayingQueue) + && Objects.equals(this.nowPlayingQueueFullItems, sessionInfoDto.nowPlayingQueueFullItems) + && Objects.equals(this.hasCustomDeviceName, sessionInfoDto.hasCustomDeviceName) + && Objects.equals(this.playlistItemId, sessionInfoDto.playlistItemId) + && Objects.equals(this.serverId, sessionInfoDto.serverId) + && Objects.equals(this.userPrimaryImageTag, sessionInfoDto.userPrimaryImageTag) + && Objects.equals(this.supportedCommands, sessionInfoDto.supportedCommands); + } + + @Override + public int hashCode() { + return Objects.hash(playState, additionalUsers, capabilities, remoteEndPoint, playableMediaTypes, id, userId, + userName, client, lastActivityDate, lastPlaybackCheckIn, lastPausedDate, deviceName, deviceType, + nowPlayingItem, nowViewingItem, deviceId, applicationVersion, transcodingInfo, isActive, + supportsMediaControl, supportsRemoteControl, nowPlayingQueue, nowPlayingQueueFullItems, + hasCustomDeviceName, playlistItemId, serverId, userPrimaryImageTag, supportedCommands); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionInfoDto {\n"); + sb.append(" playState: ").append(toIndentedString(playState)).append("\n"); + sb.append(" additionalUsers: ").append(toIndentedString(additionalUsers)).append("\n"); + sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); + sb.append(" remoteEndPoint: ").append(toIndentedString(remoteEndPoint)).append("\n"); + sb.append(" playableMediaTypes: ").append(toIndentedString(playableMediaTypes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append(" lastActivityDate: ").append(toIndentedString(lastActivityDate)).append("\n"); + sb.append(" lastPlaybackCheckIn: ").append(toIndentedString(lastPlaybackCheckIn)).append("\n"); + sb.append(" lastPausedDate: ").append(toIndentedString(lastPausedDate)).append("\n"); + sb.append(" deviceName: ").append(toIndentedString(deviceName)).append("\n"); + sb.append(" deviceType: ").append(toIndentedString(deviceType)).append("\n"); + sb.append(" nowPlayingItem: ").append(toIndentedString(nowPlayingItem)).append("\n"); + sb.append(" nowViewingItem: ").append(toIndentedString(nowViewingItem)).append("\n"); + sb.append(" deviceId: ").append(toIndentedString(deviceId)).append("\n"); + sb.append(" applicationVersion: ").append(toIndentedString(applicationVersion)).append("\n"); + sb.append(" transcodingInfo: ").append(toIndentedString(transcodingInfo)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" supportsMediaControl: ").append(toIndentedString(supportsMediaControl)).append("\n"); + sb.append(" supportsRemoteControl: ").append(toIndentedString(supportsRemoteControl)).append("\n"); + sb.append(" nowPlayingQueue: ").append(toIndentedString(nowPlayingQueue)).append("\n"); + sb.append(" nowPlayingQueueFullItems: ").append(toIndentedString(nowPlayingQueueFullItems)).append("\n"); + sb.append(" hasCustomDeviceName: ").append(toIndentedString(hasCustomDeviceName)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append(" userPrimaryImageTag: ").append(toIndentedString(userPrimaryImageTag)).append("\n"); + sb.append(" supportedCommands: ").append(toIndentedString(supportedCommands)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlayState` to the URL query string + if (getPlayState() != null) { + joiner.add(getPlayState().toUrlQueryString(prefix + "PlayState" + suffix)); + } + + // add `AdditionalUsers` to the URL query string + if (getAdditionalUsers() != null) { + for (int i = 0; i < getAdditionalUsers().size(); i++) { + if (getAdditionalUsers().get(i) != null) { + joiner.add(getAdditionalUsers().get(i).toUrlQueryString(String.format("%sAdditionalUsers%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Capabilities` to the URL query string + if (getCapabilities() != null) { + joiner.add(getCapabilities().toUrlQueryString(prefix + "Capabilities" + suffix)); + } + + // add `RemoteEndPoint` to the URL query string + if (getRemoteEndPoint() != null) { + joiner.add(String.format("%sRemoteEndPoint%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRemoteEndPoint())))); + } + + // add `PlayableMediaTypes` to the URL query string + if (getPlayableMediaTypes() != null) { + for (int i = 0; i < getPlayableMediaTypes().size(); i++) { + if (getPlayableMediaTypes().get(i) != null) { + joiner.add(String.format("%sPlayableMediaTypes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getPlayableMediaTypes().get(i))))); + } + } + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `UserName` to the URL query string + if (getUserName() != null) { + joiner.add(String.format("%sUserName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserName())))); + } + + // add `Client` to the URL query string + if (getClient() != null) { + joiner.add(String.format("%sClient%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getClient())))); + } + + // add `LastActivityDate` to the URL query string + if (getLastActivityDate() != null) { + joiner.add(String.format("%sLastActivityDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastActivityDate())))); + } + + // add `LastPlaybackCheckIn` to the URL query string + if (getLastPlaybackCheckIn() != null) { + joiner.add(String.format("%sLastPlaybackCheckIn%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastPlaybackCheckIn())))); + } + + // add `LastPausedDate` to the URL query string + if (getLastPausedDate() != null) { + joiner.add(String.format("%sLastPausedDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastPausedDate())))); + } + + // add `DeviceName` to the URL query string + if (getDeviceName() != null) { + joiner.add(String.format("%sDeviceName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceName())))); + } + + // add `DeviceType` to the URL query string + if (getDeviceType() != null) { + joiner.add(String.format("%sDeviceType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceType())))); + } + + // add `NowPlayingItem` to the URL query string + if (getNowPlayingItem() != null) { + joiner.add(getNowPlayingItem().toUrlQueryString(prefix + "NowPlayingItem" + suffix)); + } + + // add `NowViewingItem` to the URL query string + if (getNowViewingItem() != null) { + joiner.add(getNowViewingItem().toUrlQueryString(prefix + "NowViewingItem" + suffix)); + } + + // add `DeviceId` to the URL query string + if (getDeviceId() != null) { + joiner.add(String.format("%sDeviceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceId())))); + } + + // add `ApplicationVersion` to the URL query string + if (getApplicationVersion() != null) { + joiner.add(String.format("%sApplicationVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getApplicationVersion())))); + } + + // add `TranscodingInfo` to the URL query string + if (getTranscodingInfo() != null) { + joiner.add(getTranscodingInfo().toUrlQueryString(prefix + "TranscodingInfo" + suffix)); + } + + // add `IsActive` to the URL query string + if (getIsActive() != null) { + joiner.add(String.format("%sIsActive%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsActive())))); + } + + // add `SupportsMediaControl` to the URL query string + if (getSupportsMediaControl() != null) { + joiner.add(String.format("%sSupportsMediaControl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsMediaControl())))); + } + + // add `SupportsRemoteControl` to the URL query string + if (getSupportsRemoteControl() != null) { + joiner.add(String.format("%sSupportsRemoteControl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsRemoteControl())))); + } + + // add `NowPlayingQueue` to the URL query string + if (getNowPlayingQueue() != null) { + for (int i = 0; i < getNowPlayingQueue().size(); i++) { + if (getNowPlayingQueue().get(i) != null) { + joiner.add(getNowPlayingQueue().get(i).toUrlQueryString(String.format("%sNowPlayingQueue%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `NowPlayingQueueFullItems` to the URL query string + if (getNowPlayingQueueFullItems() != null) { + for (int i = 0; i < getNowPlayingQueueFullItems().size(); i++) { + if (getNowPlayingQueueFullItems().get(i) != null) { + joiner.add(getNowPlayingQueueFullItems().get(i).toUrlQueryString(String.format( + "%sNowPlayingQueueFullItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `HasCustomDeviceName` to the URL query string + if (getHasCustomDeviceName() != null) { + joiner.add(String.format("%sHasCustomDeviceName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasCustomDeviceName())))); + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + // add `ServerId` to the URL query string + if (getServerId() != null) { + joiner.add(String.format("%sServerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerId())))); + } + + // add `UserPrimaryImageTag` to the URL query string + if (getUserPrimaryImageTag() != null) { + joiner.add(String.format("%sUserPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserPrimaryImageTag())))); + } + + // add `SupportedCommands` to the URL query string + if (getSupportedCommands() != null) { + for (int i = 0; i < getSupportedCommands().size(); i++) { + if (getSupportedCommands().get(i) != null) { + joiner.add(String.format("%sSupportedCommands%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSupportedCommands().get(i))))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private SessionInfoDto instance; + + public Builder() { + this(new SessionInfoDto()); + } + + protected Builder(SessionInfoDto instance) { + this.instance = instance; + } + + public SessionInfoDto.Builder playState(PlayerStateInfo playState) { + this.instance.playState = playState; + return this; + } + + public SessionInfoDto.Builder additionalUsers(List additionalUsers) { + this.instance.additionalUsers = additionalUsers; + return this; + } + + public SessionInfoDto.Builder capabilities(ClientCapabilitiesDto capabilities) { + this.instance.capabilities = capabilities; + return this; + } + + public SessionInfoDto.Builder remoteEndPoint(String remoteEndPoint) { + this.instance.remoteEndPoint = remoteEndPoint; + return this; + } + + public SessionInfoDto.Builder playableMediaTypes(List playableMediaTypes) { + this.instance.playableMediaTypes = playableMediaTypes; + return this; + } + + public SessionInfoDto.Builder id(String id) { + this.instance.id = id; + return this; + } + + public SessionInfoDto.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public SessionInfoDto.Builder userName(String userName) { + this.instance.userName = userName; + return this; + } + + public SessionInfoDto.Builder client(String client) { + this.instance.client = client; + return this; + } + + public SessionInfoDto.Builder lastActivityDate(OffsetDateTime lastActivityDate) { + this.instance.lastActivityDate = lastActivityDate; + return this; + } + + public SessionInfoDto.Builder lastPlaybackCheckIn(OffsetDateTime lastPlaybackCheckIn) { + this.instance.lastPlaybackCheckIn = lastPlaybackCheckIn; + return this; + } + + public SessionInfoDto.Builder lastPausedDate(OffsetDateTime lastPausedDate) { + this.instance.lastPausedDate = lastPausedDate; + return this; + } + + public SessionInfoDto.Builder deviceName(String deviceName) { + this.instance.deviceName = deviceName; + return this; + } + + public SessionInfoDto.Builder deviceType(String deviceType) { + this.instance.deviceType = deviceType; + return this; + } + + public SessionInfoDto.Builder nowPlayingItem(BaseItemDto nowPlayingItem) { + this.instance.nowPlayingItem = nowPlayingItem; + return this; + } + + public SessionInfoDto.Builder nowViewingItem(BaseItemDto nowViewingItem) { + this.instance.nowViewingItem = nowViewingItem; + return this; + } + + public SessionInfoDto.Builder deviceId(String deviceId) { + this.instance.deviceId = deviceId; + return this; + } + + public SessionInfoDto.Builder applicationVersion(String applicationVersion) { + this.instance.applicationVersion = applicationVersion; + return this; + } + + public SessionInfoDto.Builder transcodingInfo(TranscodingInfo transcodingInfo) { + this.instance.transcodingInfo = transcodingInfo; + return this; + } + + public SessionInfoDto.Builder isActive(Boolean isActive) { + this.instance.isActive = isActive; + return this; + } + + public SessionInfoDto.Builder supportsMediaControl(Boolean supportsMediaControl) { + this.instance.supportsMediaControl = supportsMediaControl; + return this; + } + + public SessionInfoDto.Builder supportsRemoteControl(Boolean supportsRemoteControl) { + this.instance.supportsRemoteControl = supportsRemoteControl; + return this; + } + + public SessionInfoDto.Builder nowPlayingQueue(List nowPlayingQueue) { + this.instance.nowPlayingQueue = nowPlayingQueue; + return this; + } + + public SessionInfoDto.Builder nowPlayingQueueFullItems(List nowPlayingQueueFullItems) { + this.instance.nowPlayingQueueFullItems = nowPlayingQueueFullItems; + return this; + } + + public SessionInfoDto.Builder hasCustomDeviceName(Boolean hasCustomDeviceName) { + this.instance.hasCustomDeviceName = hasCustomDeviceName; + return this; + } + + public SessionInfoDto.Builder playlistItemId(String playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + public SessionInfoDto.Builder serverId(String serverId) { + this.instance.serverId = serverId; + return this; + } + + public SessionInfoDto.Builder userPrimaryImageTag(String userPrimaryImageTag) { + this.instance.userPrimaryImageTag = userPrimaryImageTag; + return this; + } + + public SessionInfoDto.Builder supportedCommands(List supportedCommands) { + this.instance.supportedCommands = supportedCommands; + return this; + } + + /** + * returns a built SessionInfoDto instance. + * + * The builder is not reusable. + */ + public SessionInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SessionInfoDto.Builder builder() { + return new SessionInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SessionInfoDto.Builder toBuilder() { + return new SessionInfoDto.Builder().playState(getPlayState()).additionalUsers(getAdditionalUsers()) + .capabilities(getCapabilities()).remoteEndPoint(getRemoteEndPoint()) + .playableMediaTypes(getPlayableMediaTypes()).id(getId()).userId(getUserId()).userName(getUserName()) + .client(getClient()).lastActivityDate(getLastActivityDate()) + .lastPlaybackCheckIn(getLastPlaybackCheckIn()).lastPausedDate(getLastPausedDate()) + .deviceName(getDeviceName()).deviceType(getDeviceType()).nowPlayingItem(getNowPlayingItem()) + .nowViewingItem(getNowViewingItem()).deviceId(getDeviceId()).applicationVersion(getApplicationVersion()) + .transcodingInfo(getTranscodingInfo()).isActive(getIsActive()) + .supportsMediaControl(getSupportsMediaControl()).supportsRemoteControl(getSupportsRemoteControl()) + .nowPlayingQueue(getNowPlayingQueue()).nowPlayingQueueFullItems(getNowPlayingQueueFullItems()) + .hasCustomDeviceName(getHasCustomDeviceName()).playlistItemId(getPlaylistItemId()) + .serverId(getServerId()).userPrimaryImageTag(getUserPrimaryImageTag()) + .supportedCommands(getSupportedCommands()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionMessageType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionMessageType.java new file mode 100644 index 0000000000000..e0337068c07c3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionMessageType.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The different kinds of messages that are used in the WebSocket api. + */ +public enum SessionMessageType { + + FORCE_KEEP_ALIVE("ForceKeepAlive"), + + GENERAL_COMMAND("GeneralCommand"), + + USER_DATA_CHANGED("UserDataChanged"), + + SESSIONS("Sessions"), + + PLAY("Play"), + + SYNC_PLAY_COMMAND("SyncPlayCommand"), + + SYNC_PLAY_GROUP_UPDATE("SyncPlayGroupUpdate"), + + PLAYSTATE("Playstate"), + + RESTART_REQUIRED("RestartRequired"), + + SERVER_SHUTTING_DOWN("ServerShuttingDown"), + + SERVER_RESTARTING("ServerRestarting"), + + LIBRARY_CHANGED("LibraryChanged"), + + USER_DELETED("UserDeleted"), + + USER_UPDATED("UserUpdated"), + + SERIES_TIMER_CREATED("SeriesTimerCreated"), + + TIMER_CREATED("TimerCreated"), + + SERIES_TIMER_CANCELLED("SeriesTimerCancelled"), + + TIMER_CANCELLED("TimerCancelled"), + + REFRESH_PROGRESS("RefreshProgress"), + + SCHEDULED_TASK_ENDED("ScheduledTaskEnded"), + + PACKAGE_INSTALLATION_CANCELLED("PackageInstallationCancelled"), + + PACKAGE_INSTALLATION_FAILED("PackageInstallationFailed"), + + PACKAGE_INSTALLATION_COMPLETED("PackageInstallationCompleted"), + + PACKAGE_INSTALLING("PackageInstalling"), + + PACKAGE_UNINSTALLED("PackageUninstalled"), + + ACTIVITY_LOG_ENTRY("ActivityLogEntry"), + + SCHEDULED_TASKS_INFO("ScheduledTasksInfo"), + + ACTIVITY_LOG_ENTRY_START("ActivityLogEntryStart"), + + ACTIVITY_LOG_ENTRY_STOP("ActivityLogEntryStop"), + + SESSIONS_START("SessionsStart"), + + SESSIONS_STOP("SessionsStop"), + + SCHEDULED_TASKS_INFO_START("ScheduledTasksInfoStart"), + + SCHEDULED_TASKS_INFO_STOP("ScheduledTasksInfoStop"), + + KEEP_ALIVE("KeepAlive"); + + private String value; + + SessionMessageType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SessionMessageType fromValue(String value) { + for (SessionMessageType b : SessionMessageType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionUserInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionUserInfo.java new file mode 100644 index 0000000000000..c2ba7e976022a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionUserInfo.java @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SessionUserInfo. + */ +@JsonPropertyOrder({ SessionUserInfo.JSON_PROPERTY_USER_ID, SessionUserInfo.JSON_PROPERTY_USER_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SessionUserInfo { + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_USER_NAME = "UserName"; + @org.eclipse.jdt.annotation.NonNull + private String userName; + + public SessionUserInfo() { + } + + public SessionUserInfo userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the user identifier. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public SessionUserInfo userName(@org.eclipse.jdt.annotation.NonNull String userName) { + this.userName = userName; + return this; + } + + /** + * Gets or sets the name of the user. + * + * @return userName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserName() { + return userName; + } + + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserName(@org.eclipse.jdt.annotation.NonNull String userName) { + this.userName = userName; + } + + /** + * Return true if this SessionUserInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionUserInfo sessionUserInfo = (SessionUserInfo) o; + return Objects.equals(this.userId, sessionUserInfo.userId) + && Objects.equals(this.userName, sessionUserInfo.userName); + } + + @Override + public int hashCode() { + return Objects.hash(userId, userName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionUserInfo {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `UserName` to the URL query string + if (getUserName() != null) { + joiner.add(String.format("%sUserName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SessionUserInfo instance; + + public Builder() { + this(new SessionUserInfo()); + } + + protected Builder(SessionUserInfo instance) { + this.instance = instance; + } + + public SessionUserInfo.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public SessionUserInfo.Builder userName(String userName) { + this.instance.userName = userName; + return this; + } + + /** + * returns a built SessionUserInfo instance. + * + * The builder is not reusable. + */ + public SessionUserInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SessionUserInfo.Builder builder() { + return new SessionUserInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SessionUserInfo.Builder toBuilder() { + return new SessionUserInfo.Builder().userId(getUserId()).userName(getUserName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionsMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionsMessage.java new file mode 100644 index 0000000000000..4428181a6f53c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionsMessage.java @@ -0,0 +1,284 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Sessions message. + */ +@JsonPropertyOrder({ SessionsMessage.JSON_PROPERTY_DATA, SessionsMessage.JSON_PROPERTY_MESSAGE_ID, + SessionsMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SessionsMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private List data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.SESSIONS; + + public SessionsMessage() { + } + + @JsonCreator + public SessionsMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public SessionsMessage data(@org.eclipse.jdt.annotation.NonNull List data) { + this.data = data; + return this; + } + + public SessionsMessage addDataItem(SessionInfoDto dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull List data) { + this.data = data; + } + + public SessionsMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this SessionsMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionsMessage sessionsMessage = (SessionsMessage) o; + return Objects.equals(this.data, sessionsMessage.data) + && Objects.equals(this.messageId, sessionsMessage.messageId) + && Objects.equals(this.messageType, sessionsMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionsMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + for (int i = 0; i < getData().size(); i++) { + if (getData().get(i) != null) { + joiner.add(getData().get(i).toUrlQueryString(String.format("%sData%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SessionsMessage instance; + + public Builder() { + this(new SessionsMessage()); + } + + protected Builder(SessionsMessage instance) { + this.instance = instance; + } + + public SessionsMessage.Builder data(List data) { + this.instance.data = data; + return this; + } + + public SessionsMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public SessionsMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built SessionsMessage instance. + * + * The builder is not reusable. + */ + public SessionsMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SessionsMessage.Builder builder() { + return new SessionsMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SessionsMessage.Builder toBuilder() { + return new SessionsMessage.Builder().data(getData()).messageId(getMessageId()).messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionsStartMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionsStartMessage.java new file mode 100644 index 0000000000000..35d87fbc19f96 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionsStartMessage.java @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Sessions start message. Data is the timing data encoded as \"$initialDelay,$interval\" in ms. + */ +@JsonPropertyOrder({ SessionsStartMessage.JSON_PROPERTY_DATA, SessionsStartMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SessionsStartMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private String data; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.SESSIONS_START; + + public SessionsStartMessage() { + } + + @JsonCreator + public SessionsStartMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public SessionsStartMessage data(@org.eclipse.jdt.annotation.NonNull String data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull String data) { + this.data = data; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this SessionsStartMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionsStartMessage sessionsStartMessage = (SessionsStartMessage) o; + return Objects.equals(this.data, sessionsStartMessage.data) + && Objects.equals(this.messageType, sessionsStartMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionsStartMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(String.format("%sData%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getData())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SessionsStartMessage instance; + + public Builder() { + this(new SessionsStartMessage()); + } + + protected Builder(SessionsStartMessage instance) { + this.instance = instance; + } + + public SessionsStartMessage.Builder data(String data) { + this.instance.data = data; + return this; + } + + public SessionsStartMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built SessionsStartMessage instance. + * + * The builder is not reusable. + */ + public SessionsStartMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SessionsStartMessage.Builder builder() { + return new SessionsStartMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SessionsStartMessage.Builder toBuilder() { + return new SessionsStartMessage.Builder().data(getData()).messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionsStopMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionsStopMessage.java new file mode 100644 index 0000000000000..6bfa1daec5d0a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SessionsStopMessage.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Sessions stop message. + */ +@JsonPropertyOrder({ SessionsStopMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SessionsStopMessage { + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.SESSIONS_STOP; + + public SessionsStopMessage() { + } + + @JsonCreator + public SessionsStopMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this SessionsStopMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionsStopMessage sessionsStopMessage = (SessionsStopMessage) o; + return Objects.equals(this.messageType, sessionsStopMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionsStopMessage {\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SessionsStopMessage instance; + + public Builder() { + this(new SessionsStopMessage()); + } + + protected Builder(SessionsStopMessage instance) { + this.instance = instance; + } + + public SessionsStopMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built SessionsStopMessage instance. + * + * The builder is not reusable. + */ + public SessionsStopMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SessionsStopMessage.Builder builder() { + return new SessionsStopMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SessionsStopMessage.Builder toBuilder() { + return new SessionsStopMessage.Builder().messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SetChannelMappingDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SetChannelMappingDto.java new file mode 100644 index 0000000000000..e4d49484ec744 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SetChannelMappingDto.java @@ -0,0 +1,274 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Set channel mapping dto. + */ +@JsonPropertyOrder({ SetChannelMappingDto.JSON_PROPERTY_PROVIDER_ID, + SetChannelMappingDto.JSON_PROPERTY_TUNER_CHANNEL_ID, SetChannelMappingDto.JSON_PROPERTY_PROVIDER_CHANNEL_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SetChannelMappingDto { + public static final String JSON_PROPERTY_PROVIDER_ID = "ProviderId"; + @org.eclipse.jdt.annotation.Nullable + private String providerId; + + public static final String JSON_PROPERTY_TUNER_CHANNEL_ID = "TunerChannelId"; + @org.eclipse.jdt.annotation.Nullable + private String tunerChannelId; + + public static final String JSON_PROPERTY_PROVIDER_CHANNEL_ID = "ProviderChannelId"; + @org.eclipse.jdt.annotation.Nullable + private String providerChannelId; + + public SetChannelMappingDto() { + } + + public SetChannelMappingDto providerId(@org.eclipse.jdt.annotation.Nullable String providerId) { + this.providerId = providerId; + return this; + } + + /** + * Gets or sets the provider id. + * + * @return providerId + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProviderId() { + return providerId; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProviderId(@org.eclipse.jdt.annotation.Nullable String providerId) { + this.providerId = providerId; + } + + public SetChannelMappingDto tunerChannelId(@org.eclipse.jdt.annotation.Nullable String tunerChannelId) { + this.tunerChannelId = tunerChannelId; + return this; + } + + /** + * Gets or sets the tuner channel id. + * + * @return tunerChannelId + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TUNER_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTunerChannelId() { + return tunerChannelId; + } + + @JsonProperty(JSON_PROPERTY_TUNER_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTunerChannelId(@org.eclipse.jdt.annotation.Nullable String tunerChannelId) { + this.tunerChannelId = tunerChannelId; + } + + public SetChannelMappingDto providerChannelId(@org.eclipse.jdt.annotation.Nullable String providerChannelId) { + this.providerChannelId = providerChannelId; + return this; + } + + /** + * Gets or sets the provider channel id. + * + * @return providerChannelId + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROVIDER_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProviderChannelId() { + return providerChannelId; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProviderChannelId(@org.eclipse.jdt.annotation.Nullable String providerChannelId) { + this.providerChannelId = providerChannelId; + } + + /** + * Return true if this SetChannelMappingDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetChannelMappingDto setChannelMappingDto = (SetChannelMappingDto) o; + return Objects.equals(this.providerId, setChannelMappingDto.providerId) + && Objects.equals(this.tunerChannelId, setChannelMappingDto.tunerChannelId) + && Objects.equals(this.providerChannelId, setChannelMappingDto.providerChannelId); + } + + @Override + public int hashCode() { + return Objects.hash(providerId, tunerChannelId, providerChannelId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetChannelMappingDto {\n"); + sb.append(" providerId: ").append(toIndentedString(providerId)).append("\n"); + sb.append(" tunerChannelId: ").append(toIndentedString(tunerChannelId)).append("\n"); + sb.append(" providerChannelId: ").append(toIndentedString(providerChannelId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ProviderId` to the URL query string + if (getProviderId() != null) { + joiner.add(String.format("%sProviderId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProviderId())))); + } + + // add `TunerChannelId` to the URL query string + if (getTunerChannelId() != null) { + joiner.add(String.format("%sTunerChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTunerChannelId())))); + } + + // add `ProviderChannelId` to the URL query string + if (getProviderChannelId() != null) { + joiner.add(String.format("%sProviderChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProviderChannelId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SetChannelMappingDto instance; + + public Builder() { + this(new SetChannelMappingDto()); + } + + protected Builder(SetChannelMappingDto instance) { + this.instance = instance; + } + + public SetChannelMappingDto.Builder providerId(String providerId) { + this.instance.providerId = providerId; + return this; + } + + public SetChannelMappingDto.Builder tunerChannelId(String tunerChannelId) { + this.instance.tunerChannelId = tunerChannelId; + return this; + } + + public SetChannelMappingDto.Builder providerChannelId(String providerChannelId) { + this.instance.providerChannelId = providerChannelId; + return this; + } + + /** + * returns a built SetChannelMappingDto instance. + * + * The builder is not reusable. + */ + public SetChannelMappingDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SetChannelMappingDto.Builder builder() { + return new SetChannelMappingDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SetChannelMappingDto.Builder toBuilder() { + return new SetChannelMappingDto.Builder().providerId(getProviderId()).tunerChannelId(getTunerChannelId()) + .providerChannelId(getProviderChannelId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SetPlaylistItemRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SetPlaylistItemRequestDto.java new file mode 100644 index 0000000000000..7445f83c22821 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SetPlaylistItemRequestDto.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SetPlaylistItemRequestDto. + */ +@JsonPropertyOrder({ SetPlaylistItemRequestDto.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SetPlaylistItemRequestDto { + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID playlistItemId; + + public SetPlaylistItemRequestDto() { + } + + public SetPlaylistItemRequestDto playlistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets or sets the playlist identifier of the playing item. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + } + + /** + * Return true if this SetPlaylistItemRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetPlaylistItemRequestDto setPlaylistItemRequestDto = (SetPlaylistItemRequestDto) o; + return Objects.equals(this.playlistItemId, setPlaylistItemRequestDto.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetPlaylistItemRequestDto {\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SetPlaylistItemRequestDto instance; + + public Builder() { + this(new SetPlaylistItemRequestDto()); + } + + protected Builder(SetPlaylistItemRequestDto instance) { + this.instance = instance; + } + + public SetPlaylistItemRequestDto.Builder playlistItemId(UUID playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built SetPlaylistItemRequestDto instance. + * + * The builder is not reusable. + */ + public SetPlaylistItemRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SetPlaylistItemRequestDto.Builder builder() { + return new SetPlaylistItemRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SetPlaylistItemRequestDto.Builder toBuilder() { + return new SetPlaylistItemRequestDto.Builder().playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SetRepeatModeRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SetRepeatModeRequestDto.java new file mode 100644 index 0000000000000..568aed0e39939 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SetRepeatModeRequestDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SetRepeatModeRequestDto. + */ +@JsonPropertyOrder({ SetRepeatModeRequestDto.JSON_PROPERTY_MODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SetRepeatModeRequestDto { + public static final String JSON_PROPERTY_MODE = "Mode"; + @org.eclipse.jdt.annotation.NonNull + private GroupRepeatMode mode; + + public SetRepeatModeRequestDto() { + } + + public SetRepeatModeRequestDto mode(@org.eclipse.jdt.annotation.NonNull GroupRepeatMode mode) { + this.mode = mode; + return this; + } + + /** + * Enum GroupRepeatMode. + * + * @return mode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupRepeatMode getMode() { + return mode; + } + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(@org.eclipse.jdt.annotation.NonNull GroupRepeatMode mode) { + this.mode = mode; + } + + /** + * Return true if this SetRepeatModeRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetRepeatModeRequestDto setRepeatModeRequestDto = (SetRepeatModeRequestDto) o; + return Objects.equals(this.mode, setRepeatModeRequestDto.mode); + } + + @Override + public int hashCode() { + return Objects.hash(mode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetRepeatModeRequestDto {\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Mode` to the URL query string + if (getMode() != null) { + joiner.add(String.format("%sMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMode())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SetRepeatModeRequestDto instance; + + public Builder() { + this(new SetRepeatModeRequestDto()); + } + + protected Builder(SetRepeatModeRequestDto instance) { + this.instance = instance; + } + + public SetRepeatModeRequestDto.Builder mode(GroupRepeatMode mode) { + this.instance.mode = mode; + return this; + } + + /** + * returns a built SetRepeatModeRequestDto instance. + * + * The builder is not reusable. + */ + public SetRepeatModeRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SetRepeatModeRequestDto.Builder builder() { + return new SetRepeatModeRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SetRepeatModeRequestDto.Builder toBuilder() { + return new SetRepeatModeRequestDto.Builder().mode(getMode()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SetShuffleModeRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SetShuffleModeRequestDto.java new file mode 100644 index 0000000000000..2fe47773d18b5 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SetShuffleModeRequestDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SetShuffleModeRequestDto. + */ +@JsonPropertyOrder({ SetShuffleModeRequestDto.JSON_PROPERTY_MODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SetShuffleModeRequestDto { + public static final String JSON_PROPERTY_MODE = "Mode"; + @org.eclipse.jdt.annotation.NonNull + private GroupShuffleMode mode; + + public SetShuffleModeRequestDto() { + } + + public SetShuffleModeRequestDto mode(@org.eclipse.jdt.annotation.NonNull GroupShuffleMode mode) { + this.mode = mode; + return this; + } + + /** + * Enum GroupShuffleMode. + * + * @return mode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupShuffleMode getMode() { + return mode; + } + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(@org.eclipse.jdt.annotation.NonNull GroupShuffleMode mode) { + this.mode = mode; + } + + /** + * Return true if this SetShuffleModeRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetShuffleModeRequestDto setShuffleModeRequestDto = (SetShuffleModeRequestDto) o; + return Objects.equals(this.mode, setShuffleModeRequestDto.mode); + } + + @Override + public int hashCode() { + return Objects.hash(mode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetShuffleModeRequestDto {\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Mode` to the URL query string + if (getMode() != null) { + joiner.add(String.format("%sMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMode())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SetShuffleModeRequestDto instance; + + public Builder() { + this(new SetShuffleModeRequestDto()); + } + + protected Builder(SetShuffleModeRequestDto instance) { + this.instance = instance; + } + + public SetShuffleModeRequestDto.Builder mode(GroupShuffleMode mode) { + this.instance.mode = mode; + return this; + } + + /** + * returns a built SetShuffleModeRequestDto instance. + * + * The builder is not reusable. + */ + public SetShuffleModeRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SetShuffleModeRequestDto.Builder builder() { + return new SetShuffleModeRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SetShuffleModeRequestDto.Builder toBuilder() { + return new SetShuffleModeRequestDto.Builder().mode(getMode()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SongInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SongInfo.java new file mode 100644 index 0000000000000..9b52618568c7a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SongInfo.java @@ -0,0 +1,758 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * SongInfo + */ +@JsonPropertyOrder({ SongInfo.JSON_PROPERTY_NAME, SongInfo.JSON_PROPERTY_ORIGINAL_TITLE, SongInfo.JSON_PROPERTY_PATH, + SongInfo.JSON_PROPERTY_METADATA_LANGUAGE, SongInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, + SongInfo.JSON_PROPERTY_PROVIDER_IDS, SongInfo.JSON_PROPERTY_YEAR, SongInfo.JSON_PROPERTY_INDEX_NUMBER, + SongInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, SongInfo.JSON_PROPERTY_PREMIERE_DATE, + SongInfo.JSON_PROPERTY_IS_AUTOMATED, SongInfo.JSON_PROPERTY_ALBUM_ARTISTS, SongInfo.JSON_PROPERTY_ALBUM, + SongInfo.JSON_PROPERTY_ARTISTS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SongInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public static final String JSON_PROPERTY_ALBUM_ARTISTS = "AlbumArtists"; + @org.eclipse.jdt.annotation.NonNull + private List albumArtists; + + public static final String JSON_PROPERTY_ALBUM = "Album"; + @org.eclipse.jdt.annotation.NonNull + private String album; + + public static final String JSON_PROPERTY_ARTISTS = "Artists"; + @org.eclipse.jdt.annotation.NonNull + private List artists; + + public SongInfo() { + } + + public SongInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public SongInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public SongInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public SongInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public SongInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public SongInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public SongInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public SongInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public SongInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public SongInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public SongInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public SongInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + public SongInfo albumArtists(@org.eclipse.jdt.annotation.NonNull List albumArtists) { + this.albumArtists = albumArtists; + return this; + } + + public SongInfo addAlbumArtistsItem(String albumArtistsItem) { + if (this.albumArtists == null) { + this.albumArtists = new ArrayList<>(); + } + this.albumArtists.add(albumArtistsItem); + return this; + } + + /** + * Get albumArtists + * + * @return albumArtists + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAlbumArtists() { + return albumArtists; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumArtists(@org.eclipse.jdt.annotation.NonNull List albumArtists) { + this.albumArtists = albumArtists; + } + + public SongInfo album(@org.eclipse.jdt.annotation.NonNull String album) { + this.album = album; + return this; + } + + /** + * Get album + * + * @return album + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlbum() { + return album; + } + + @JsonProperty(JSON_PROPERTY_ALBUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbum(@org.eclipse.jdt.annotation.NonNull String album) { + this.album = album; + } + + public SongInfo artists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + return this; + } + + public SongInfo addArtistsItem(String artistsItem) { + if (this.artists == null) { + this.artists = new ArrayList<>(); + } + this.artists.add(artistsItem); + return this; + } + + /** + * Get artists + * + * @return artists + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArtists() { + return artists; + } + + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + } + + /** + * Return true if this SongInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SongInfo songInfo = (SongInfo) o; + return Objects.equals(this.name, songInfo.name) && Objects.equals(this.originalTitle, songInfo.originalTitle) + && Objects.equals(this.path, songInfo.path) + && Objects.equals(this.metadataLanguage, songInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, songInfo.metadataCountryCode) + && Objects.equals(this.providerIds, songInfo.providerIds) && Objects.equals(this.year, songInfo.year) + && Objects.equals(this.indexNumber, songInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, songInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, songInfo.premiereDate) + && Objects.equals(this.isAutomated, songInfo.isAutomated) + && Objects.equals(this.albumArtists, songInfo.albumArtists) + && Objects.equals(this.album, songInfo.album) && Objects.equals(this.artists, songInfo.artists); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated, albumArtists, album, artists); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SongInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append(" albumArtists: ").append(toIndentedString(albumArtists)).append("\n"); + sb.append(" album: ").append(toIndentedString(album)).append("\n"); + sb.append(" artists: ").append(toIndentedString(artists)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + // add `AlbumArtists` to the URL query string + if (getAlbumArtists() != null) { + for (int i = 0; i < getAlbumArtists().size(); i++) { + joiner.add(String.format("%sAlbumArtists%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getAlbumArtists().get(i))))); + } + } + + // add `Album` to the URL query string + if (getAlbum() != null) { + joiner.add(String.format("%sAlbum%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbum())))); + } + + // add `Artists` to the URL query string + if (getArtists() != null) { + for (int i = 0; i < getArtists().size(); i++) { + joiner.add(String.format("%sArtists%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArtists().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private SongInfo instance; + + public Builder() { + this(new SongInfo()); + } + + protected Builder(SongInfo instance) { + this.instance = instance; + } + + public SongInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public SongInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public SongInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public SongInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public SongInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public SongInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public SongInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public SongInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public SongInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public SongInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public SongInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + public SongInfo.Builder albumArtists(List albumArtists) { + this.instance.albumArtists = albumArtists; + return this; + } + + public SongInfo.Builder album(String album) { + this.instance.album = album; + return this; + } + + public SongInfo.Builder artists(List artists) { + this.instance.artists = artists; + return this; + } + + /** + * returns a built SongInfo instance. + * + * The builder is not reusable. + */ + public SongInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SongInfo.Builder builder() { + return new SongInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SongInfo.Builder toBuilder() { + return new SongInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()).isAutomated(getIsAutomated()) + .albumArtists(getAlbumArtists()).album(getAlbum()).artists(getArtists()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SortOrder.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SortOrder.java new file mode 100644 index 0000000000000..7652dc4dd4d8a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SortOrder.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * An enum representing the sorting order. + */ +public enum SortOrder { + + ASCENDING("Ascending"), + + DESCENDING("Descending"); + + private String value; + + SortOrder(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SortOrder fromValue(String value) { + for (SortOrder b : SortOrder.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SpecialViewOptionDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SpecialViewOptionDto.java new file mode 100644 index 0000000000000..e0a8ca4c06cf8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SpecialViewOptionDto.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Special view option dto. + */ +@JsonPropertyOrder({ SpecialViewOptionDto.JSON_PROPERTY_NAME, SpecialViewOptionDto.JSON_PROPERTY_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SpecialViewOptionDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public SpecialViewOptionDto() { + } + + public SpecialViewOptionDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets view option name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public SpecialViewOptionDto id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets view option id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + /** + * Return true if this SpecialViewOptionDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialViewOptionDto specialViewOptionDto = (SpecialViewOptionDto) o; + return Objects.equals(this.name, specialViewOptionDto.name) && Objects.equals(this.id, specialViewOptionDto.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialViewOptionDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SpecialViewOptionDto instance; + + public Builder() { + this(new SpecialViewOptionDto()); + } + + protected Builder(SpecialViewOptionDto instance) { + this.instance = instance; + } + + public SpecialViewOptionDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public SpecialViewOptionDto.Builder id(String id) { + this.instance.id = id; + return this; + } + + /** + * returns a built SpecialViewOptionDto instance. + * + * The builder is not reusable. + */ + public SpecialViewOptionDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SpecialViewOptionDto.Builder builder() { + return new SpecialViewOptionDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SpecialViewOptionDto.Builder toBuilder() { + return new SpecialViewOptionDto.Builder().name(getName()).id(getId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/StartupConfigurationDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/StartupConfigurationDto.java new file mode 100644 index 0000000000000..8065b694dd8c2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/StartupConfigurationDto.java @@ -0,0 +1,277 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The startup configuration DTO. + */ +@JsonPropertyOrder({ StartupConfigurationDto.JSON_PROPERTY_UI_CULTURE, + StartupConfigurationDto.JSON_PROPERTY_METADATA_COUNTRY_CODE, + StartupConfigurationDto.JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class StartupConfigurationDto { + public static final String JSON_PROPERTY_UI_CULTURE = "UICulture"; + @org.eclipse.jdt.annotation.NonNull + private String uiCulture; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE = "PreferredMetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String preferredMetadataLanguage; + + public StartupConfigurationDto() { + } + + public StartupConfigurationDto uiCulture(@org.eclipse.jdt.annotation.NonNull String uiCulture) { + this.uiCulture = uiCulture; + return this; + } + + /** + * Gets or sets UI language culture. + * + * @return uiCulture + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_UI_CULTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUiCulture() { + return uiCulture; + } + + @JsonProperty(JSON_PROPERTY_UI_CULTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUiCulture(@org.eclipse.jdt.annotation.NonNull String uiCulture) { + this.uiCulture = uiCulture; + } + + public StartupConfigurationDto metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public StartupConfigurationDto preferredMetadataLanguage( + @org.eclipse.jdt.annotation.NonNull String preferredMetadataLanguage) { + this.preferredMetadataLanguage = preferredMetadataLanguage; + return this; + } + + /** + * Gets or sets the preferred language for the metadata. + * + * @return preferredMetadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPreferredMetadataLanguage() { + return preferredMetadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreferredMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String preferredMetadataLanguage) { + this.preferredMetadataLanguage = preferredMetadataLanguage; + } + + /** + * Return true if this StartupConfigurationDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartupConfigurationDto startupConfigurationDto = (StartupConfigurationDto) o; + return Objects.equals(this.uiCulture, startupConfigurationDto.uiCulture) + && Objects.equals(this.metadataCountryCode, startupConfigurationDto.metadataCountryCode) + && Objects.equals(this.preferredMetadataLanguage, startupConfigurationDto.preferredMetadataLanguage); + } + + @Override + public int hashCode() { + return Objects.hash(uiCulture, metadataCountryCode, preferredMetadataLanguage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StartupConfigurationDto {\n"); + sb.append(" uiCulture: ").append(toIndentedString(uiCulture)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" preferredMetadataLanguage: ").append(toIndentedString(preferredMetadataLanguage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `UICulture` to the URL query string + if (getUiCulture() != null) { + joiner.add(String.format("%sUICulture%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUiCulture())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `PreferredMetadataLanguage` to the URL query string + if (getPreferredMetadataLanguage() != null) { + joiner.add(String.format("%sPreferredMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreferredMetadataLanguage())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private StartupConfigurationDto instance; + + public Builder() { + this(new StartupConfigurationDto()); + } + + protected Builder(StartupConfigurationDto instance) { + this.instance = instance; + } + + public StartupConfigurationDto.Builder uiCulture(String uiCulture) { + this.instance.uiCulture = uiCulture; + return this; + } + + public StartupConfigurationDto.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public StartupConfigurationDto.Builder preferredMetadataLanguage(String preferredMetadataLanguage) { + this.instance.preferredMetadataLanguage = preferredMetadataLanguage; + return this; + } + + /** + * returns a built StartupConfigurationDto instance. + * + * The builder is not reusable. + */ + public StartupConfigurationDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static StartupConfigurationDto.Builder builder() { + return new StartupConfigurationDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public StartupConfigurationDto.Builder toBuilder() { + return new StartupConfigurationDto.Builder().uiCulture(getUiCulture()) + .metadataCountryCode(getMetadataCountryCode()) + .preferredMetadataLanguage(getPreferredMetadataLanguage()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/StartupRemoteAccessDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/StartupRemoteAccessDto.java new file mode 100644 index 0000000000000..c2e26d1e3a7d1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/StartupRemoteAccessDto.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Startup remote access dto. + */ +@JsonPropertyOrder({ StartupRemoteAccessDto.JSON_PROPERTY_ENABLE_REMOTE_ACCESS, + StartupRemoteAccessDto.JSON_PROPERTY_ENABLE_AUTOMATIC_PORT_MAPPING }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class StartupRemoteAccessDto { + public static final String JSON_PROPERTY_ENABLE_REMOTE_ACCESS = "EnableRemoteAccess"; + @org.eclipse.jdt.annotation.Nullable + private Boolean enableRemoteAccess; + + public static final String JSON_PROPERTY_ENABLE_AUTOMATIC_PORT_MAPPING = "EnableAutomaticPortMapping"; + @org.eclipse.jdt.annotation.Nullable + private Boolean enableAutomaticPortMapping; + + public StartupRemoteAccessDto() { + } + + public StartupRemoteAccessDto enableRemoteAccess(@org.eclipse.jdt.annotation.Nullable Boolean enableRemoteAccess) { + this.enableRemoteAccess = enableRemoteAccess; + return this; + } + + /** + * Gets or sets a value indicating whether enable remote access. + * + * @return enableRemoteAccess + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLE_REMOTE_ACCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getEnableRemoteAccess() { + return enableRemoteAccess; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_REMOTE_ACCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnableRemoteAccess(@org.eclipse.jdt.annotation.Nullable Boolean enableRemoteAccess) { + this.enableRemoteAccess = enableRemoteAccess; + } + + public StartupRemoteAccessDto enableAutomaticPortMapping( + @org.eclipse.jdt.annotation.Nullable Boolean enableAutomaticPortMapping) { + this.enableAutomaticPortMapping = enableAutomaticPortMapping; + return this; + } + + /** + * Gets or sets a value indicating whether enable automatic port mapping. + * + * @return enableAutomaticPortMapping + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLE_AUTOMATIC_PORT_MAPPING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getEnableAutomaticPortMapping() { + return enableAutomaticPortMapping; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_AUTOMATIC_PORT_MAPPING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnableAutomaticPortMapping(@org.eclipse.jdt.annotation.Nullable Boolean enableAutomaticPortMapping) { + this.enableAutomaticPortMapping = enableAutomaticPortMapping; + } + + /** + * Return true if this StartupRemoteAccessDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartupRemoteAccessDto startupRemoteAccessDto = (StartupRemoteAccessDto) o; + return Objects.equals(this.enableRemoteAccess, startupRemoteAccessDto.enableRemoteAccess) + && Objects.equals(this.enableAutomaticPortMapping, startupRemoteAccessDto.enableAutomaticPortMapping); + } + + @Override + public int hashCode() { + return Objects.hash(enableRemoteAccess, enableAutomaticPortMapping); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StartupRemoteAccessDto {\n"); + sb.append(" enableRemoteAccess: ").append(toIndentedString(enableRemoteAccess)).append("\n"); + sb.append(" enableAutomaticPortMapping: ").append(toIndentedString(enableAutomaticPortMapping)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `EnableRemoteAccess` to the URL query string + if (getEnableRemoteAccess() != null) { + joiner.add(String.format("%sEnableRemoteAccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableRemoteAccess())))); + } + + // add `EnableAutomaticPortMapping` to the URL query string + if (getEnableAutomaticPortMapping() != null) { + joiner.add(String.format("%sEnableAutomaticPortMapping%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAutomaticPortMapping())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private StartupRemoteAccessDto instance; + + public Builder() { + this(new StartupRemoteAccessDto()); + } + + protected Builder(StartupRemoteAccessDto instance) { + this.instance = instance; + } + + public StartupRemoteAccessDto.Builder enableRemoteAccess(Boolean enableRemoteAccess) { + this.instance.enableRemoteAccess = enableRemoteAccess; + return this; + } + + public StartupRemoteAccessDto.Builder enableAutomaticPortMapping(Boolean enableAutomaticPortMapping) { + this.instance.enableAutomaticPortMapping = enableAutomaticPortMapping; + return this; + } + + /** + * returns a built StartupRemoteAccessDto instance. + * + * The builder is not reusable. + */ + public StartupRemoteAccessDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static StartupRemoteAccessDto.Builder builder() { + return new StartupRemoteAccessDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public StartupRemoteAccessDto.Builder toBuilder() { + return new StartupRemoteAccessDto.Builder().enableRemoteAccess(getEnableRemoteAccess()) + .enableAutomaticPortMapping(getEnableAutomaticPortMapping()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/StartupUserDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/StartupUserDto.java new file mode 100644 index 0000000000000..30113cb2eb43e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/StartupUserDto.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The startup user DTO. + */ +@JsonPropertyOrder({ StartupUserDto.JSON_PROPERTY_NAME, StartupUserDto.JSON_PROPERTY_PASSWORD }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class StartupUserDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_PASSWORD = "Password"; + @org.eclipse.jdt.annotation.NonNull + private String password; + + public StartupUserDto() { + } + + public StartupUserDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the username. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public StartupUserDto password(@org.eclipse.jdt.annotation.NonNull String password) { + this.password = password; + return this; + } + + /** + * Gets or sets the user's password. + * + * @return password + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(@org.eclipse.jdt.annotation.NonNull String password) { + this.password = password; + } + + /** + * Return true if this StartupUserDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartupUserDto startupUserDto = (StartupUserDto) o; + return Objects.equals(this.name, startupUserDto.name) && Objects.equals(this.password, startupUserDto.password); + } + + @Override + public int hashCode() { + return Objects.hash(name, password); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StartupUserDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Password` to the URL query string + if (getPassword() != null) { + joiner.add(String.format("%sPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPassword())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private StartupUserDto instance; + + public Builder() { + this(new StartupUserDto()); + } + + protected Builder(StartupUserDto instance) { + this.instance = instance; + } + + public StartupUserDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public StartupUserDto.Builder password(String password) { + this.instance.password = password; + return this; + } + + /** + * returns a built StartupUserDto instance. + * + * The builder is not reusable. + */ + public StartupUserDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static StartupUserDto.Builder builder() { + return new StartupUserDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public StartupUserDto.Builder toBuilder() { + return new StartupUserDto.Builder().name(getName()).password(getPassword()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/StringGroupUpdate.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/StringGroupUpdate.java new file mode 100644 index 0000000000000..6c835911f5a75 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/StringGroupUpdate.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class GroupUpdate. + */ +@JsonPropertyOrder({ StringGroupUpdate.JSON_PROPERTY_GROUP_ID, StringGroupUpdate.JSON_PROPERTY_TYPE, + StringGroupUpdate.JSON_PROPERTY_DATA }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class StringGroupUpdate { + public static final String JSON_PROPERTY_GROUP_ID = "GroupId"; + @org.eclipse.jdt.annotation.NonNull + private UUID groupId; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private GroupUpdateType type; + + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private String data; + + public StringGroupUpdate() { + } + + @JsonCreator + public StringGroupUpdate(@JsonProperty(JSON_PROPERTY_GROUP_ID) UUID groupId) { + this(); + this.groupId = groupId; + } + + /** + * Gets the group identifier. + * + * @return groupId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getGroupId() { + return groupId; + } + + public StringGroupUpdate type(@org.eclipse.jdt.annotation.NonNull GroupUpdateType type) { + this.type = type; + return this; + } + + /** + * Gets the update type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupUpdateType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull GroupUpdateType type) { + this.type = type; + } + + public StringGroupUpdate data(@org.eclipse.jdt.annotation.NonNull String data) { + this.data = data; + return this; + } + + /** + * Gets the update data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull String data) { + this.data = data; + } + + /** + * Return true if this StringGroupUpdate object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StringGroupUpdate stringGroupUpdate = (StringGroupUpdate) o; + return Objects.equals(this.groupId, stringGroupUpdate.groupId) + && Objects.equals(this.type, stringGroupUpdate.type) + && Objects.equals(this.data, stringGroupUpdate.data); + } + + @Override + public int hashCode() { + return Objects.hash(groupId, type, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringGroupUpdate {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `GroupId` to the URL query string + if (getGroupId() != null) { + joiner.add(String.format("%sGroupId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGroupId())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(String.format("%sData%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getData())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private StringGroupUpdate instance; + + public Builder() { + this(new StringGroupUpdate()); + } + + protected Builder(StringGroupUpdate instance) { + this.instance = instance; + } + + public StringGroupUpdate.Builder groupId(UUID groupId) { + this.instance.groupId = groupId; + return this; + } + + public StringGroupUpdate.Builder type(GroupUpdateType type) { + this.instance.type = type; + return this; + } + + public StringGroupUpdate.Builder data(String data) { + this.instance.data = data; + return this; + } + + /** + * returns a built StringGroupUpdate instance. + * + * The builder is not reusable. + */ + public StringGroupUpdate build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static StringGroupUpdate.Builder builder() { + return new StringGroupUpdate.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public StringGroupUpdate.Builder toBuilder() { + return new StringGroupUpdate.Builder().groupId(getGroupId()).type(getType()).data(getData()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SubtitleDeliveryMethod.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SubtitleDeliveryMethod.java new file mode 100644 index 0000000000000..c242fe4ced770 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SubtitleDeliveryMethod.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Delivery method to use during playback of a specific subtitle format. + */ +public enum SubtitleDeliveryMethod { + + ENCODE("Encode"), + + EMBED("Embed"), + + EXTERNAL("External"), + + HLS("Hls"), + + DROP("Drop"); + + private String value; + + SubtitleDeliveryMethod(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SubtitleDeliveryMethod fromValue(String value) { + for (SubtitleDeliveryMethod b : SubtitleDeliveryMethod.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SubtitleOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SubtitleOptions.java new file mode 100644 index 0000000000000..8fa6329c4784e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SubtitleOptions.java @@ -0,0 +1,546 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * SubtitleOptions + */ +@JsonPropertyOrder({ SubtitleOptions.JSON_PROPERTY_SKIP_IF_EMBEDDED_SUBTITLES_PRESENT, + SubtitleOptions.JSON_PROPERTY_SKIP_IF_AUDIO_TRACK_MATCHES, SubtitleOptions.JSON_PROPERTY_DOWNLOAD_LANGUAGES, + SubtitleOptions.JSON_PROPERTY_DOWNLOAD_MOVIE_SUBTITLES, + SubtitleOptions.JSON_PROPERTY_DOWNLOAD_EPISODE_SUBTITLES, SubtitleOptions.JSON_PROPERTY_OPEN_SUBTITLES_USERNAME, + SubtitleOptions.JSON_PROPERTY_OPEN_SUBTITLES_PASSWORD_HASH, + SubtitleOptions.JSON_PROPERTY_IS_OPEN_SUBTITLE_VIP_ACCOUNT, + SubtitleOptions.JSON_PROPERTY_REQUIRE_PERFECT_MATCH }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SubtitleOptions { + public static final String JSON_PROPERTY_SKIP_IF_EMBEDDED_SUBTITLES_PRESENT = "SkipIfEmbeddedSubtitlesPresent"; + @org.eclipse.jdt.annotation.NonNull + private Boolean skipIfEmbeddedSubtitlesPresent; + + public static final String JSON_PROPERTY_SKIP_IF_AUDIO_TRACK_MATCHES = "SkipIfAudioTrackMatches"; + @org.eclipse.jdt.annotation.NonNull + private Boolean skipIfAudioTrackMatches; + + public static final String JSON_PROPERTY_DOWNLOAD_LANGUAGES = "DownloadLanguages"; + @org.eclipse.jdt.annotation.NonNull + private List downloadLanguages; + + public static final String JSON_PROPERTY_DOWNLOAD_MOVIE_SUBTITLES = "DownloadMovieSubtitles"; + @org.eclipse.jdt.annotation.NonNull + private Boolean downloadMovieSubtitles; + + public static final String JSON_PROPERTY_DOWNLOAD_EPISODE_SUBTITLES = "DownloadEpisodeSubtitles"; + @org.eclipse.jdt.annotation.NonNull + private Boolean downloadEpisodeSubtitles; + + public static final String JSON_PROPERTY_OPEN_SUBTITLES_USERNAME = "OpenSubtitlesUsername"; + @org.eclipse.jdt.annotation.NonNull + private String openSubtitlesUsername; + + public static final String JSON_PROPERTY_OPEN_SUBTITLES_PASSWORD_HASH = "OpenSubtitlesPasswordHash"; + @org.eclipse.jdt.annotation.NonNull + private String openSubtitlesPasswordHash; + + public static final String JSON_PROPERTY_IS_OPEN_SUBTITLE_VIP_ACCOUNT = "IsOpenSubtitleVipAccount"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isOpenSubtitleVipAccount; + + public static final String JSON_PROPERTY_REQUIRE_PERFECT_MATCH = "RequirePerfectMatch"; + @org.eclipse.jdt.annotation.NonNull + private Boolean requirePerfectMatch; + + public SubtitleOptions() { + } + + public SubtitleOptions skipIfEmbeddedSubtitlesPresent( + @org.eclipse.jdt.annotation.NonNull Boolean skipIfEmbeddedSubtitlesPresent) { + this.skipIfEmbeddedSubtitlesPresent = skipIfEmbeddedSubtitlesPresent; + return this; + } + + /** + * Get skipIfEmbeddedSubtitlesPresent + * + * @return skipIfEmbeddedSubtitlesPresent + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SKIP_IF_EMBEDDED_SUBTITLES_PRESENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSkipIfEmbeddedSubtitlesPresent() { + return skipIfEmbeddedSubtitlesPresent; + } + + @JsonProperty(JSON_PROPERTY_SKIP_IF_EMBEDDED_SUBTITLES_PRESENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipIfEmbeddedSubtitlesPresent( + @org.eclipse.jdt.annotation.NonNull Boolean skipIfEmbeddedSubtitlesPresent) { + this.skipIfEmbeddedSubtitlesPresent = skipIfEmbeddedSubtitlesPresent; + } + + public SubtitleOptions skipIfAudioTrackMatches( + @org.eclipse.jdt.annotation.NonNull Boolean skipIfAudioTrackMatches) { + this.skipIfAudioTrackMatches = skipIfAudioTrackMatches; + return this; + } + + /** + * Get skipIfAudioTrackMatches + * + * @return skipIfAudioTrackMatches + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SKIP_IF_AUDIO_TRACK_MATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSkipIfAudioTrackMatches() { + return skipIfAudioTrackMatches; + } + + @JsonProperty(JSON_PROPERTY_SKIP_IF_AUDIO_TRACK_MATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipIfAudioTrackMatches(@org.eclipse.jdt.annotation.NonNull Boolean skipIfAudioTrackMatches) { + this.skipIfAudioTrackMatches = skipIfAudioTrackMatches; + } + + public SubtitleOptions downloadLanguages(@org.eclipse.jdt.annotation.NonNull List downloadLanguages) { + this.downloadLanguages = downloadLanguages; + return this; + } + + public SubtitleOptions addDownloadLanguagesItem(String downloadLanguagesItem) { + if (this.downloadLanguages == null) { + this.downloadLanguages = new ArrayList<>(); + } + this.downloadLanguages.add(downloadLanguagesItem); + return this; + } + + /** + * Get downloadLanguages + * + * @return downloadLanguages + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DOWNLOAD_LANGUAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDownloadLanguages() { + return downloadLanguages; + } + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_LANGUAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadLanguages(@org.eclipse.jdt.annotation.NonNull List downloadLanguages) { + this.downloadLanguages = downloadLanguages; + } + + public SubtitleOptions downloadMovieSubtitles(@org.eclipse.jdt.annotation.NonNull Boolean downloadMovieSubtitles) { + this.downloadMovieSubtitles = downloadMovieSubtitles; + return this; + } + + /** + * Get downloadMovieSubtitles + * + * @return downloadMovieSubtitles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DOWNLOAD_MOVIE_SUBTITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDownloadMovieSubtitles() { + return downloadMovieSubtitles; + } + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_MOVIE_SUBTITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadMovieSubtitles(@org.eclipse.jdt.annotation.NonNull Boolean downloadMovieSubtitles) { + this.downloadMovieSubtitles = downloadMovieSubtitles; + } + + public SubtitleOptions downloadEpisodeSubtitles( + @org.eclipse.jdt.annotation.NonNull Boolean downloadEpisodeSubtitles) { + this.downloadEpisodeSubtitles = downloadEpisodeSubtitles; + return this; + } + + /** + * Get downloadEpisodeSubtitles + * + * @return downloadEpisodeSubtitles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DOWNLOAD_EPISODE_SUBTITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDownloadEpisodeSubtitles() { + return downloadEpisodeSubtitles; + } + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_EPISODE_SUBTITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadEpisodeSubtitles(@org.eclipse.jdt.annotation.NonNull Boolean downloadEpisodeSubtitles) { + this.downloadEpisodeSubtitles = downloadEpisodeSubtitles; + } + + public SubtitleOptions openSubtitlesUsername(@org.eclipse.jdt.annotation.NonNull String openSubtitlesUsername) { + this.openSubtitlesUsername = openSubtitlesUsername; + return this; + } + + /** + * Get openSubtitlesUsername + * + * @return openSubtitlesUsername + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OPEN_SUBTITLES_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOpenSubtitlesUsername() { + return openSubtitlesUsername; + } + + @JsonProperty(JSON_PROPERTY_OPEN_SUBTITLES_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpenSubtitlesUsername(@org.eclipse.jdt.annotation.NonNull String openSubtitlesUsername) { + this.openSubtitlesUsername = openSubtitlesUsername; + } + + public SubtitleOptions openSubtitlesPasswordHash( + @org.eclipse.jdt.annotation.NonNull String openSubtitlesPasswordHash) { + this.openSubtitlesPasswordHash = openSubtitlesPasswordHash; + return this; + } + + /** + * Get openSubtitlesPasswordHash + * + * @return openSubtitlesPasswordHash + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OPEN_SUBTITLES_PASSWORD_HASH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOpenSubtitlesPasswordHash() { + return openSubtitlesPasswordHash; + } + + @JsonProperty(JSON_PROPERTY_OPEN_SUBTITLES_PASSWORD_HASH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpenSubtitlesPasswordHash(@org.eclipse.jdt.annotation.NonNull String openSubtitlesPasswordHash) { + this.openSubtitlesPasswordHash = openSubtitlesPasswordHash; + } + + public SubtitleOptions isOpenSubtitleVipAccount( + @org.eclipse.jdt.annotation.NonNull Boolean isOpenSubtitleVipAccount) { + this.isOpenSubtitleVipAccount = isOpenSubtitleVipAccount; + return this; + } + + /** + * Get isOpenSubtitleVipAccount + * + * @return isOpenSubtitleVipAccount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_OPEN_SUBTITLE_VIP_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsOpenSubtitleVipAccount() { + return isOpenSubtitleVipAccount; + } + + @JsonProperty(JSON_PROPERTY_IS_OPEN_SUBTITLE_VIP_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsOpenSubtitleVipAccount(@org.eclipse.jdt.annotation.NonNull Boolean isOpenSubtitleVipAccount) { + this.isOpenSubtitleVipAccount = isOpenSubtitleVipAccount; + } + + public SubtitleOptions requirePerfectMatch(@org.eclipse.jdt.annotation.NonNull Boolean requirePerfectMatch) { + this.requirePerfectMatch = requirePerfectMatch; + return this; + } + + /** + * Get requirePerfectMatch + * + * @return requirePerfectMatch + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUIRE_PERFECT_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequirePerfectMatch() { + return requirePerfectMatch; + } + + @JsonProperty(JSON_PROPERTY_REQUIRE_PERFECT_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequirePerfectMatch(@org.eclipse.jdt.annotation.NonNull Boolean requirePerfectMatch) { + this.requirePerfectMatch = requirePerfectMatch; + } + + /** + * Return true if this SubtitleOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubtitleOptions subtitleOptions = (SubtitleOptions) o; + return Objects.equals(this.skipIfEmbeddedSubtitlesPresent, subtitleOptions.skipIfEmbeddedSubtitlesPresent) + && Objects.equals(this.skipIfAudioTrackMatches, subtitleOptions.skipIfAudioTrackMatches) + && Objects.equals(this.downloadLanguages, subtitleOptions.downloadLanguages) + && Objects.equals(this.downloadMovieSubtitles, subtitleOptions.downloadMovieSubtitles) + && Objects.equals(this.downloadEpisodeSubtitles, subtitleOptions.downloadEpisodeSubtitles) + && Objects.equals(this.openSubtitlesUsername, subtitleOptions.openSubtitlesUsername) + && Objects.equals(this.openSubtitlesPasswordHash, subtitleOptions.openSubtitlesPasswordHash) + && Objects.equals(this.isOpenSubtitleVipAccount, subtitleOptions.isOpenSubtitleVipAccount) + && Objects.equals(this.requirePerfectMatch, subtitleOptions.requirePerfectMatch); + } + + @Override + public int hashCode() { + return Objects.hash(skipIfEmbeddedSubtitlesPresent, skipIfAudioTrackMatches, downloadLanguages, + downloadMovieSubtitles, downloadEpisodeSubtitles, openSubtitlesUsername, openSubtitlesPasswordHash, + isOpenSubtitleVipAccount, requirePerfectMatch); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubtitleOptions {\n"); + sb.append(" skipIfEmbeddedSubtitlesPresent: ").append(toIndentedString(skipIfEmbeddedSubtitlesPresent)) + .append("\n"); + sb.append(" skipIfAudioTrackMatches: ").append(toIndentedString(skipIfAudioTrackMatches)).append("\n"); + sb.append(" downloadLanguages: ").append(toIndentedString(downloadLanguages)).append("\n"); + sb.append(" downloadMovieSubtitles: ").append(toIndentedString(downloadMovieSubtitles)).append("\n"); + sb.append(" downloadEpisodeSubtitles: ").append(toIndentedString(downloadEpisodeSubtitles)).append("\n"); + sb.append(" openSubtitlesUsername: ").append(toIndentedString(openSubtitlesUsername)).append("\n"); + sb.append(" openSubtitlesPasswordHash: ").append(toIndentedString(openSubtitlesPasswordHash)).append("\n"); + sb.append(" isOpenSubtitleVipAccount: ").append(toIndentedString(isOpenSubtitleVipAccount)).append("\n"); + sb.append(" requirePerfectMatch: ").append(toIndentedString(requirePerfectMatch)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SkipIfEmbeddedSubtitlesPresent` to the URL query string + if (getSkipIfEmbeddedSubtitlesPresent() != null) { + joiner.add(String.format("%sSkipIfEmbeddedSubtitlesPresent%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSkipIfEmbeddedSubtitlesPresent())))); + } + + // add `SkipIfAudioTrackMatches` to the URL query string + if (getSkipIfAudioTrackMatches() != null) { + joiner.add(String.format("%sSkipIfAudioTrackMatches%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSkipIfAudioTrackMatches())))); + } + + // add `DownloadLanguages` to the URL query string + if (getDownloadLanguages() != null) { + for (int i = 0; i < getDownloadLanguages().size(); i++) { + joiner.add(String.format("%sDownloadLanguages%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDownloadLanguages().get(i))))); + } + } + + // add `DownloadMovieSubtitles` to the URL query string + if (getDownloadMovieSubtitles() != null) { + joiner.add(String.format("%sDownloadMovieSubtitles%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDownloadMovieSubtitles())))); + } + + // add `DownloadEpisodeSubtitles` to the URL query string + if (getDownloadEpisodeSubtitles() != null) { + joiner.add(String.format("%sDownloadEpisodeSubtitles%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDownloadEpisodeSubtitles())))); + } + + // add `OpenSubtitlesUsername` to the URL query string + if (getOpenSubtitlesUsername() != null) { + joiner.add(String.format("%sOpenSubtitlesUsername%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOpenSubtitlesUsername())))); + } + + // add `OpenSubtitlesPasswordHash` to the URL query string + if (getOpenSubtitlesPasswordHash() != null) { + joiner.add(String.format("%sOpenSubtitlesPasswordHash%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOpenSubtitlesPasswordHash())))); + } + + // add `IsOpenSubtitleVipAccount` to the URL query string + if (getIsOpenSubtitleVipAccount() != null) { + joiner.add(String.format("%sIsOpenSubtitleVipAccount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsOpenSubtitleVipAccount())))); + } + + // add `RequirePerfectMatch` to the URL query string + if (getRequirePerfectMatch() != null) { + joiner.add(String.format("%sRequirePerfectMatch%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRequirePerfectMatch())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SubtitleOptions instance; + + public Builder() { + this(new SubtitleOptions()); + } + + protected Builder(SubtitleOptions instance) { + this.instance = instance; + } + + public SubtitleOptions.Builder skipIfEmbeddedSubtitlesPresent(Boolean skipIfEmbeddedSubtitlesPresent) { + this.instance.skipIfEmbeddedSubtitlesPresent = skipIfEmbeddedSubtitlesPresent; + return this; + } + + public SubtitleOptions.Builder skipIfAudioTrackMatches(Boolean skipIfAudioTrackMatches) { + this.instance.skipIfAudioTrackMatches = skipIfAudioTrackMatches; + return this; + } + + public SubtitleOptions.Builder downloadLanguages(List downloadLanguages) { + this.instance.downloadLanguages = downloadLanguages; + return this; + } + + public SubtitleOptions.Builder downloadMovieSubtitles(Boolean downloadMovieSubtitles) { + this.instance.downloadMovieSubtitles = downloadMovieSubtitles; + return this; + } + + public SubtitleOptions.Builder downloadEpisodeSubtitles(Boolean downloadEpisodeSubtitles) { + this.instance.downloadEpisodeSubtitles = downloadEpisodeSubtitles; + return this; + } + + public SubtitleOptions.Builder openSubtitlesUsername(String openSubtitlesUsername) { + this.instance.openSubtitlesUsername = openSubtitlesUsername; + return this; + } + + public SubtitleOptions.Builder openSubtitlesPasswordHash(String openSubtitlesPasswordHash) { + this.instance.openSubtitlesPasswordHash = openSubtitlesPasswordHash; + return this; + } + + public SubtitleOptions.Builder isOpenSubtitleVipAccount(Boolean isOpenSubtitleVipAccount) { + this.instance.isOpenSubtitleVipAccount = isOpenSubtitleVipAccount; + return this; + } + + public SubtitleOptions.Builder requirePerfectMatch(Boolean requirePerfectMatch) { + this.instance.requirePerfectMatch = requirePerfectMatch; + return this; + } + + /** + * returns a built SubtitleOptions instance. + * + * The builder is not reusable. + */ + public SubtitleOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SubtitleOptions.Builder builder() { + return new SubtitleOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SubtitleOptions.Builder toBuilder() { + return new SubtitleOptions.Builder().skipIfEmbeddedSubtitlesPresent(getSkipIfEmbeddedSubtitlesPresent()) + .skipIfAudioTrackMatches(getSkipIfAudioTrackMatches()).downloadLanguages(getDownloadLanguages()) + .downloadMovieSubtitles(getDownloadMovieSubtitles()) + .downloadEpisodeSubtitles(getDownloadEpisodeSubtitles()) + .openSubtitlesUsername(getOpenSubtitlesUsername()) + .openSubtitlesPasswordHash(getOpenSubtitlesPasswordHash()) + .isOpenSubtitleVipAccount(getIsOpenSubtitleVipAccount()).requirePerfectMatch(getRequirePerfectMatch()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SubtitlePlaybackMode.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SubtitlePlaybackMode.java new file mode 100644 index 0000000000000..4e92a5f6326e0 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SubtitlePlaybackMode.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * An enum representing a subtitle playback mode. + */ +public enum SubtitlePlaybackMode { + + DEFAULT("Default"), + + ALWAYS("Always"), + + ONLY_FORCED("OnlyForced"), + + NONE("None"), + + SMART("Smart"); + + private String value; + + SubtitlePlaybackMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SubtitlePlaybackMode fromValue(String value) { + for (SubtitlePlaybackMode b : SubtitlePlaybackMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SubtitleProfile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SubtitleProfile.java new file mode 100644 index 0000000000000..de69fa39b1ae5 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SubtitleProfile.java @@ -0,0 +1,355 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * A class for subtitle profile information. + */ +@JsonPropertyOrder({ SubtitleProfile.JSON_PROPERTY_FORMAT, SubtitleProfile.JSON_PROPERTY_METHOD, + SubtitleProfile.JSON_PROPERTY_DIDL_MODE, SubtitleProfile.JSON_PROPERTY_LANGUAGE, + SubtitleProfile.JSON_PROPERTY_CONTAINER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SubtitleProfile { + public static final String JSON_PROPERTY_FORMAT = "Format"; + @org.eclipse.jdt.annotation.NonNull + private String format; + + public static final String JSON_PROPERTY_METHOD = "Method"; + @org.eclipse.jdt.annotation.NonNull + private SubtitleDeliveryMethod method; + + public static final String JSON_PROPERTY_DIDL_MODE = "DidlMode"; + @org.eclipse.jdt.annotation.NonNull + private String didlMode; + + public static final String JSON_PROPERTY_LANGUAGE = "Language"; + @org.eclipse.jdt.annotation.NonNull + private String language; + + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public SubtitleProfile() { + } + + public SubtitleProfile format(@org.eclipse.jdt.annotation.NonNull String format) { + this.format = format; + return this; + } + + /** + * Gets or sets the format. + * + * @return format + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFormat() { + return format; + } + + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormat(@org.eclipse.jdt.annotation.NonNull String format) { + this.format = format; + } + + public SubtitleProfile method(@org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod method) { + this.method = method; + return this; + } + + /** + * Gets or sets the delivery method. + * + * @return method + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubtitleDeliveryMethod getMethod() { + return method; + } + + @JsonProperty(JSON_PROPERTY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMethod(@org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod method) { + this.method = method; + } + + public SubtitleProfile didlMode(@org.eclipse.jdt.annotation.NonNull String didlMode) { + this.didlMode = didlMode; + return this; + } + + /** + * Gets or sets the DIDL mode. + * + * @return didlMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DIDL_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDidlMode() { + return didlMode; + } + + @JsonProperty(JSON_PROPERTY_DIDL_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDidlMode(@org.eclipse.jdt.annotation.NonNull String didlMode) { + this.didlMode = didlMode; + } + + public SubtitleProfile language(@org.eclipse.jdt.annotation.NonNull String language) { + this.language = language; + return this; + } + + /** + * Gets or sets the language. + * + * @return language + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLanguage() { + return language; + } + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLanguage(@org.eclipse.jdt.annotation.NonNull String language) { + this.language = language; + } + + public SubtitleProfile container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Gets or sets the container. + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + /** + * Return true if this SubtitleProfile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubtitleProfile subtitleProfile = (SubtitleProfile) o; + return Objects.equals(this.format, subtitleProfile.format) + && Objects.equals(this.method, subtitleProfile.method) + && Objects.equals(this.didlMode, subtitleProfile.didlMode) + && Objects.equals(this.language, subtitleProfile.language) + && Objects.equals(this.container, subtitleProfile.container); + } + + @Override + public int hashCode() { + return Objects.hash(format, method, didlMode, language, container); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubtitleProfile {\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" didlMode: ").append(toIndentedString(didlMode)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Format` to the URL query string + if (getFormat() != null) { + joiner.add(String.format("%sFormat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFormat())))); + } + + // add `Method` to the URL query string + if (getMethod() != null) { + joiner.add(String.format("%sMethod%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMethod())))); + } + + // add `DidlMode` to the URL query string + if (getDidlMode() != null) { + joiner.add(String.format("%sDidlMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDidlMode())))); + } + + // add `Language` to the URL query string + if (getLanguage() != null) { + joiner.add(String.format("%sLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLanguage())))); + } + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SubtitleProfile instance; + + public Builder() { + this(new SubtitleProfile()); + } + + protected Builder(SubtitleProfile instance) { + this.instance = instance; + } + + public SubtitleProfile.Builder format(String format) { + this.instance.format = format; + return this; + } + + public SubtitleProfile.Builder method(SubtitleDeliveryMethod method) { + this.instance.method = method; + return this; + } + + public SubtitleProfile.Builder didlMode(String didlMode) { + this.instance.didlMode = didlMode; + return this; + } + + public SubtitleProfile.Builder language(String language) { + this.instance.language = language; + return this; + } + + public SubtitleProfile.Builder container(String container) { + this.instance.container = container; + return this; + } + + /** + * returns a built SubtitleProfile instance. + * + * The builder is not reusable. + */ + public SubtitleProfile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SubtitleProfile.Builder builder() { + return new SubtitleProfile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SubtitleProfile.Builder toBuilder() { + return new SubtitleProfile.Builder().format(getFormat()).method(getMethod()).didlMode(getDidlMode()) + .language(getLanguage()).container(getContainer()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SyncPlayCommandMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SyncPlayCommandMessage.java new file mode 100644 index 0000000000000..50ea3c218859b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SyncPlayCommandMessage.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Sync play command. + */ +@JsonPropertyOrder({ SyncPlayCommandMessage.JSON_PROPERTY_DATA, SyncPlayCommandMessage.JSON_PROPERTY_MESSAGE_ID, + SyncPlayCommandMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SyncPlayCommandMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private SendCommand data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.SYNC_PLAY_COMMAND; + + public SyncPlayCommandMessage() { + } + + @JsonCreator + public SyncPlayCommandMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public SyncPlayCommandMessage data(@org.eclipse.jdt.annotation.NonNull SendCommand data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SendCommand getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull SendCommand data) { + this.data = data; + } + + public SyncPlayCommandMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this SyncPlayCommandMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyncPlayCommandMessage syncPlayCommandMessage = (SyncPlayCommandMessage) o; + return Objects.equals(this.data, syncPlayCommandMessage.data) + && Objects.equals(this.messageId, syncPlayCommandMessage.messageId) + && Objects.equals(this.messageType, syncPlayCommandMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyncPlayCommandMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SyncPlayCommandMessage instance; + + public Builder() { + this(new SyncPlayCommandMessage()); + } + + protected Builder(SyncPlayCommandMessage instance) { + this.instance = instance; + } + + public SyncPlayCommandMessage.Builder data(SendCommand data) { + this.instance.data = data; + return this; + } + + public SyncPlayCommandMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public SyncPlayCommandMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built SyncPlayCommandMessage instance. + * + * The builder is not reusable. + */ + public SyncPlayCommandMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SyncPlayCommandMessage.Builder builder() { + return new SyncPlayCommandMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SyncPlayCommandMessage.Builder toBuilder() { + return new SyncPlayCommandMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SyncPlayGroupUpdateCommandMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SyncPlayGroupUpdateCommandMessage.java new file mode 100644 index 0000000000000..1ae98f2d40b79 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SyncPlayGroupUpdateCommandMessage.java @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Untyped sync play command. + */ +@JsonPropertyOrder({ SyncPlayGroupUpdateCommandMessage.JSON_PROPERTY_DATA, + SyncPlayGroupUpdateCommandMessage.JSON_PROPERTY_MESSAGE_ID, + SyncPlayGroupUpdateCommandMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SyncPlayGroupUpdateCommandMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private GroupUpdate data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.SYNC_PLAY_GROUP_UPDATE; + + public SyncPlayGroupUpdateCommandMessage() { + } + + @JsonCreator + public SyncPlayGroupUpdateCommandMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public SyncPlayGroupUpdateCommandMessage data(@org.eclipse.jdt.annotation.NonNull GroupUpdate data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupUpdate getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull GroupUpdate data) { + this.data = data; + } + + public SyncPlayGroupUpdateCommandMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this SyncPlayGroupUpdateCommandMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyncPlayGroupUpdateCommandMessage syncPlayGroupUpdateCommandMessage = (SyncPlayGroupUpdateCommandMessage) o; + return Objects.equals(this.data, syncPlayGroupUpdateCommandMessage.data) + && Objects.equals(this.messageId, syncPlayGroupUpdateCommandMessage.messageId) + && Objects.equals(this.messageType, syncPlayGroupUpdateCommandMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyncPlayGroupUpdateCommandMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SyncPlayGroupUpdateCommandMessage instance; + + public Builder() { + this(new SyncPlayGroupUpdateCommandMessage()); + } + + protected Builder(SyncPlayGroupUpdateCommandMessage instance) { + this.instance = instance; + } + + public SyncPlayGroupUpdateCommandMessage.Builder data(GroupUpdate data) { + this.instance.data = data; + return this; + } + + public SyncPlayGroupUpdateCommandMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public SyncPlayGroupUpdateCommandMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built SyncPlayGroupUpdateCommandMessage instance. + * + * The builder is not reusable. + */ + public SyncPlayGroupUpdateCommandMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SyncPlayGroupUpdateCommandMessage.Builder builder() { + return new SyncPlayGroupUpdateCommandMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SyncPlayGroupUpdateCommandMessage.Builder toBuilder() { + return new SyncPlayGroupUpdateCommandMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SyncPlayQueueItem.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SyncPlayQueueItem.java new file mode 100644 index 0000000000000..7805afc93829d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SyncPlayQueueItem.java @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class QueueItem. + */ +@JsonPropertyOrder({ SyncPlayQueueItem.JSON_PROPERTY_ITEM_ID, SyncPlayQueueItem.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SyncPlayQueueItem { + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID playlistItemId; + + public SyncPlayQueueItem() { + } + + @JsonCreator + public SyncPlayQueueItem(@JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) UUID playlistItemId) { + this(); + this.playlistItemId = playlistItemId; + } + + public SyncPlayQueueItem itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets the item identifier. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + /** + * Gets the playlist identifier of the item. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPlaylistItemId() { + return playlistItemId; + } + + /** + * Return true if this SyncPlayQueueItem object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyncPlayQueueItem syncPlayQueueItem = (SyncPlayQueueItem) o; + return Objects.equals(this.itemId, syncPlayQueueItem.itemId) + && Objects.equals(this.playlistItemId, syncPlayQueueItem.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(itemId, playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyncPlayQueueItem {\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SyncPlayQueueItem instance; + + public Builder() { + this(new SyncPlayQueueItem()); + } + + protected Builder(SyncPlayQueueItem instance) { + this.instance = instance; + } + + public SyncPlayQueueItem.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public SyncPlayQueueItem.Builder playlistItemId(UUID playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built SyncPlayQueueItem instance. + * + * The builder is not reusable. + */ + public SyncPlayQueueItem build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SyncPlayQueueItem.Builder builder() { + return new SyncPlayQueueItem.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SyncPlayQueueItem.Builder toBuilder() { + return new SyncPlayQueueItem.Builder().itemId(getItemId()).playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SyncPlayUserAccessType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SyncPlayUserAccessType.java new file mode 100644 index 0000000000000..c9e74fb8ad8d2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SyncPlayUserAccessType.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum SyncPlayUserAccessType. + */ +public enum SyncPlayUserAccessType { + + CREATE_AND_JOIN_GROUPS("CreateAndJoinGroups"), + + JOIN_GROUPS("JoinGroups"), + + NONE("None"); + + private String value; + + SyncPlayUserAccessType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SyncPlayUserAccessType fromValue(String value) { + for (SyncPlayUserAccessType b : SyncPlayUserAccessType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SystemInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SystemInfo.java new file mode 100644 index 0000000000000..840722e07a754 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/SystemInfo.java @@ -0,0 +1,1308 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SystemInfo. + */ +@JsonPropertyOrder({ SystemInfo.JSON_PROPERTY_LOCAL_ADDRESS, SystemInfo.JSON_PROPERTY_SERVER_NAME, + SystemInfo.JSON_PROPERTY_VERSION, SystemInfo.JSON_PROPERTY_PRODUCT_NAME, + SystemInfo.JSON_PROPERTY_OPERATING_SYSTEM, SystemInfo.JSON_PROPERTY_ID, + SystemInfo.JSON_PROPERTY_STARTUP_WIZARD_COMPLETED, SystemInfo.JSON_PROPERTY_OPERATING_SYSTEM_DISPLAY_NAME, + SystemInfo.JSON_PROPERTY_PACKAGE_NAME, SystemInfo.JSON_PROPERTY_HAS_PENDING_RESTART, + SystemInfo.JSON_PROPERTY_IS_SHUTTING_DOWN, SystemInfo.JSON_PROPERTY_SUPPORTS_LIBRARY_MONITOR, + SystemInfo.JSON_PROPERTY_WEB_SOCKET_PORT_NUMBER, SystemInfo.JSON_PROPERTY_COMPLETED_INSTALLATIONS, + SystemInfo.JSON_PROPERTY_CAN_SELF_RESTART, SystemInfo.JSON_PROPERTY_CAN_LAUNCH_WEB_BROWSER, + SystemInfo.JSON_PROPERTY_PROGRAM_DATA_PATH, SystemInfo.JSON_PROPERTY_WEB_PATH, + SystemInfo.JSON_PROPERTY_ITEMS_BY_NAME_PATH, SystemInfo.JSON_PROPERTY_CACHE_PATH, + SystemInfo.JSON_PROPERTY_LOG_PATH, SystemInfo.JSON_PROPERTY_INTERNAL_METADATA_PATH, + SystemInfo.JSON_PROPERTY_TRANSCODING_TEMP_PATH, SystemInfo.JSON_PROPERTY_CAST_RECEIVER_APPLICATIONS, + SystemInfo.JSON_PROPERTY_HAS_UPDATE_AVAILABLE, SystemInfo.JSON_PROPERTY_ENCODER_LOCATION, + SystemInfo.JSON_PROPERTY_SYSTEM_ARCHITECTURE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SystemInfo { + public static final String JSON_PROPERTY_LOCAL_ADDRESS = "LocalAddress"; + @org.eclipse.jdt.annotation.NonNull + private String localAddress; + + public static final String JSON_PROPERTY_SERVER_NAME = "ServerName"; + @org.eclipse.jdt.annotation.NonNull + private String serverName; + + public static final String JSON_PROPERTY_VERSION = "Version"; + @org.eclipse.jdt.annotation.NonNull + private String version; + + public static final String JSON_PROPERTY_PRODUCT_NAME = "ProductName"; + @org.eclipse.jdt.annotation.NonNull + private String productName; + + public static final String JSON_PROPERTY_OPERATING_SYSTEM = "OperatingSystem"; + @org.eclipse.jdt.annotation.NonNull + private String operatingSystem; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_STARTUP_WIZARD_COMPLETED = "StartupWizardCompleted"; + @org.eclipse.jdt.annotation.NonNull + private Boolean startupWizardCompleted; + + public static final String JSON_PROPERTY_OPERATING_SYSTEM_DISPLAY_NAME = "OperatingSystemDisplayName"; + @org.eclipse.jdt.annotation.NonNull + private String operatingSystemDisplayName; + + public static final String JSON_PROPERTY_PACKAGE_NAME = "PackageName"; + @org.eclipse.jdt.annotation.NonNull + private String packageName; + + public static final String JSON_PROPERTY_HAS_PENDING_RESTART = "HasPendingRestart"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasPendingRestart; + + public static final String JSON_PROPERTY_IS_SHUTTING_DOWN = "IsShuttingDown"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isShuttingDown; + + public static final String JSON_PROPERTY_SUPPORTS_LIBRARY_MONITOR = "SupportsLibraryMonitor"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsLibraryMonitor; + + public static final String JSON_PROPERTY_WEB_SOCKET_PORT_NUMBER = "WebSocketPortNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer webSocketPortNumber; + + public static final String JSON_PROPERTY_COMPLETED_INSTALLATIONS = "CompletedInstallations"; + @org.eclipse.jdt.annotation.NonNull + private List completedInstallations; + + public static final String JSON_PROPERTY_CAN_SELF_RESTART = "CanSelfRestart"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canSelfRestart = true; + + public static final String JSON_PROPERTY_CAN_LAUNCH_WEB_BROWSER = "CanLaunchWebBrowser"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canLaunchWebBrowser = false; + + public static final String JSON_PROPERTY_PROGRAM_DATA_PATH = "ProgramDataPath"; + @org.eclipse.jdt.annotation.NonNull + private String programDataPath; + + public static final String JSON_PROPERTY_WEB_PATH = "WebPath"; + @org.eclipse.jdt.annotation.NonNull + private String webPath; + + public static final String JSON_PROPERTY_ITEMS_BY_NAME_PATH = "ItemsByNamePath"; + @org.eclipse.jdt.annotation.NonNull + private String itemsByNamePath; + + public static final String JSON_PROPERTY_CACHE_PATH = "CachePath"; + @org.eclipse.jdt.annotation.NonNull + private String cachePath; + + public static final String JSON_PROPERTY_LOG_PATH = "LogPath"; + @org.eclipse.jdt.annotation.NonNull + private String logPath; + + public static final String JSON_PROPERTY_INTERNAL_METADATA_PATH = "InternalMetadataPath"; + @org.eclipse.jdt.annotation.NonNull + private String internalMetadataPath; + + public static final String JSON_PROPERTY_TRANSCODING_TEMP_PATH = "TranscodingTempPath"; + @org.eclipse.jdt.annotation.NonNull + private String transcodingTempPath; + + public static final String JSON_PROPERTY_CAST_RECEIVER_APPLICATIONS = "CastReceiverApplications"; + @org.eclipse.jdt.annotation.NonNull + private List castReceiverApplications; + + public static final String JSON_PROPERTY_HAS_UPDATE_AVAILABLE = "HasUpdateAvailable"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasUpdateAvailable = false; + + public static final String JSON_PROPERTY_ENCODER_LOCATION = "EncoderLocation"; + @org.eclipse.jdt.annotation.NonNull + private String encoderLocation = "System"; + + public static final String JSON_PROPERTY_SYSTEM_ARCHITECTURE = "SystemArchitecture"; + @org.eclipse.jdt.annotation.NonNull + private String systemArchitecture = "X64"; + + public SystemInfo() { + } + + public SystemInfo localAddress(@org.eclipse.jdt.annotation.NonNull String localAddress) { + this.localAddress = localAddress; + return this; + } + + /** + * Gets or sets the local address. + * + * @return localAddress + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCAL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocalAddress() { + return localAddress; + } + + @JsonProperty(JSON_PROPERTY_LOCAL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalAddress(@org.eclipse.jdt.annotation.NonNull String localAddress) { + this.localAddress = localAddress; + } + + public SystemInfo serverName(@org.eclipse.jdt.annotation.NonNull String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Gets or sets the name of the server. + * + * @return serverName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerName() { + return serverName; + } + + @JsonProperty(JSON_PROPERTY_SERVER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerName(@org.eclipse.jdt.annotation.NonNull String serverName) { + this.serverName = serverName; + } + + public SystemInfo version(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + return this; + } + + /** + * Gets or sets the server version. + * + * @return version + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + } + + public SystemInfo productName(@org.eclipse.jdt.annotation.NonNull String productName) { + this.productName = productName; + return this; + } + + /** + * Gets or sets the product name. This is the AssemblyProduct name. + * + * @return productName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRODUCT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProductName() { + return productName; + } + + @JsonProperty(JSON_PROPERTY_PRODUCT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProductName(@org.eclipse.jdt.annotation.NonNull String productName) { + this.productName = productName; + } + + public SystemInfo operatingSystem(@org.eclipse.jdt.annotation.NonNull String operatingSystem) { + this.operatingSystem = operatingSystem; + return this; + } + + /** + * Gets or sets the operating system. + * + * @return operatingSystem + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OPERATING_SYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOperatingSystem() { + return operatingSystem; + } + + @JsonProperty(JSON_PROPERTY_OPERATING_SYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOperatingSystem(@org.eclipse.jdt.annotation.NonNull String operatingSystem) { + this.operatingSystem = operatingSystem; + } + + public SystemInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public SystemInfo startupWizardCompleted(@org.eclipse.jdt.annotation.NonNull Boolean startupWizardCompleted) { + this.startupWizardCompleted = startupWizardCompleted; + return this; + } + + /** + * Gets or sets a value indicating whether the startup wizard is completed. + * + * @return startupWizardCompleted + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STARTUP_WIZARD_COMPLETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStartupWizardCompleted() { + return startupWizardCompleted; + } + + @JsonProperty(JSON_PROPERTY_STARTUP_WIZARD_COMPLETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartupWizardCompleted(@org.eclipse.jdt.annotation.NonNull Boolean startupWizardCompleted) { + this.startupWizardCompleted = startupWizardCompleted; + } + + public SystemInfo operatingSystemDisplayName( + @org.eclipse.jdt.annotation.NonNull String operatingSystemDisplayName) { + this.operatingSystemDisplayName = operatingSystemDisplayName; + return this; + } + + /** + * Gets or sets the display name of the operating system. + * + * @return operatingSystemDisplayName + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OPERATING_SYSTEM_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOperatingSystemDisplayName() { + return operatingSystemDisplayName; + } + + @JsonProperty(JSON_PROPERTY_OPERATING_SYSTEM_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOperatingSystemDisplayName(@org.eclipse.jdt.annotation.NonNull String operatingSystemDisplayName) { + this.operatingSystemDisplayName = operatingSystemDisplayName; + } + + public SystemInfo packageName(@org.eclipse.jdt.annotation.NonNull String packageName) { + this.packageName = packageName; + return this; + } + + /** + * Gets or sets the package name. + * + * @return packageName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PACKAGE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPackageName() { + return packageName; + } + + @JsonProperty(JSON_PROPERTY_PACKAGE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPackageName(@org.eclipse.jdt.annotation.NonNull String packageName) { + this.packageName = packageName; + } + + public SystemInfo hasPendingRestart(@org.eclipse.jdt.annotation.NonNull Boolean hasPendingRestart) { + this.hasPendingRestart = hasPendingRestart; + return this; + } + + /** + * Gets or sets a value indicating whether this instance has pending restart. + * + * @return hasPendingRestart + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_PENDING_RESTART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasPendingRestart() { + return hasPendingRestart; + } + + @JsonProperty(JSON_PROPERTY_HAS_PENDING_RESTART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasPendingRestart(@org.eclipse.jdt.annotation.NonNull Boolean hasPendingRestart) { + this.hasPendingRestart = hasPendingRestart; + } + + public SystemInfo isShuttingDown(@org.eclipse.jdt.annotation.NonNull Boolean isShuttingDown) { + this.isShuttingDown = isShuttingDown; + return this; + } + + /** + * Get isShuttingDown + * + * @return isShuttingDown + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_SHUTTING_DOWN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsShuttingDown() { + return isShuttingDown; + } + + @JsonProperty(JSON_PROPERTY_IS_SHUTTING_DOWN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsShuttingDown(@org.eclipse.jdt.annotation.NonNull Boolean isShuttingDown) { + this.isShuttingDown = isShuttingDown; + } + + public SystemInfo supportsLibraryMonitor(@org.eclipse.jdt.annotation.NonNull Boolean supportsLibraryMonitor) { + this.supportsLibraryMonitor = supportsLibraryMonitor; + return this; + } + + /** + * Gets or sets a value indicating whether [supports library monitor]. + * + * @return supportsLibraryMonitor + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_LIBRARY_MONITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsLibraryMonitor() { + return supportsLibraryMonitor; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_LIBRARY_MONITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsLibraryMonitor(@org.eclipse.jdt.annotation.NonNull Boolean supportsLibraryMonitor) { + this.supportsLibraryMonitor = supportsLibraryMonitor; + } + + public SystemInfo webSocketPortNumber(@org.eclipse.jdt.annotation.NonNull Integer webSocketPortNumber) { + this.webSocketPortNumber = webSocketPortNumber; + return this; + } + + /** + * Gets or sets the web socket port number. + * + * @return webSocketPortNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WEB_SOCKET_PORT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWebSocketPortNumber() { + return webSocketPortNumber; + } + + @JsonProperty(JSON_PROPERTY_WEB_SOCKET_PORT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWebSocketPortNumber(@org.eclipse.jdt.annotation.NonNull Integer webSocketPortNumber) { + this.webSocketPortNumber = webSocketPortNumber; + } + + public SystemInfo completedInstallations( + @org.eclipse.jdt.annotation.NonNull List completedInstallations) { + this.completedInstallations = completedInstallations; + return this; + } + + public SystemInfo addCompletedInstallationsItem(InstallationInfo completedInstallationsItem) { + if (this.completedInstallations == null) { + this.completedInstallations = new ArrayList<>(); + } + this.completedInstallations.add(completedInstallationsItem); + return this; + } + + /** + * Gets or sets the completed installations. + * + * @return completedInstallations + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMPLETED_INSTALLATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCompletedInstallations() { + return completedInstallations; + } + + @JsonProperty(JSON_PROPERTY_COMPLETED_INSTALLATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompletedInstallations( + @org.eclipse.jdt.annotation.NonNull List completedInstallations) { + this.completedInstallations = completedInstallations; + } + + public SystemInfo canSelfRestart(@org.eclipse.jdt.annotation.NonNull Boolean canSelfRestart) { + this.canSelfRestart = canSelfRestart; + return this; + } + + /** + * Gets or sets a value indicating whether this instance can self restart. + * + * @return canSelfRestart + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_SELF_RESTART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanSelfRestart() { + return canSelfRestart; + } + + @JsonProperty(JSON_PROPERTY_CAN_SELF_RESTART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanSelfRestart(@org.eclipse.jdt.annotation.NonNull Boolean canSelfRestart) { + this.canSelfRestart = canSelfRestart; + } + + public SystemInfo canLaunchWebBrowser(@org.eclipse.jdt.annotation.NonNull Boolean canLaunchWebBrowser) { + this.canLaunchWebBrowser = canLaunchWebBrowser; + return this; + } + + /** + * Get canLaunchWebBrowser + * + * @return canLaunchWebBrowser + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_LAUNCH_WEB_BROWSER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanLaunchWebBrowser() { + return canLaunchWebBrowser; + } + + @JsonProperty(JSON_PROPERTY_CAN_LAUNCH_WEB_BROWSER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanLaunchWebBrowser(@org.eclipse.jdt.annotation.NonNull Boolean canLaunchWebBrowser) { + this.canLaunchWebBrowser = canLaunchWebBrowser; + } + + public SystemInfo programDataPath(@org.eclipse.jdt.annotation.NonNull String programDataPath) { + this.programDataPath = programDataPath; + return this; + } + + /** + * Gets or sets the program data path. + * + * @return programDataPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROGRAM_DATA_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProgramDataPath() { + return programDataPath; + } + + @JsonProperty(JSON_PROPERTY_PROGRAM_DATA_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgramDataPath(@org.eclipse.jdt.annotation.NonNull String programDataPath) { + this.programDataPath = programDataPath; + } + + public SystemInfo webPath(@org.eclipse.jdt.annotation.NonNull String webPath) { + this.webPath = webPath; + return this; + } + + /** + * Gets or sets the web UI resources path. + * + * @return webPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WEB_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWebPath() { + return webPath; + } + + @JsonProperty(JSON_PROPERTY_WEB_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWebPath(@org.eclipse.jdt.annotation.NonNull String webPath) { + this.webPath = webPath; + } + + public SystemInfo itemsByNamePath(@org.eclipse.jdt.annotation.NonNull String itemsByNamePath) { + this.itemsByNamePath = itemsByNamePath; + return this; + } + + /** + * Gets or sets the items by name path. + * + * @return itemsByNamePath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS_BY_NAME_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getItemsByNamePath() { + return itemsByNamePath; + } + + @JsonProperty(JSON_PROPERTY_ITEMS_BY_NAME_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemsByNamePath(@org.eclipse.jdt.annotation.NonNull String itemsByNamePath) { + this.itemsByNamePath = itemsByNamePath; + } + + public SystemInfo cachePath(@org.eclipse.jdt.annotation.NonNull String cachePath) { + this.cachePath = cachePath; + return this; + } + + /** + * Gets or sets the cache path. + * + * @return cachePath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CACHE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCachePath() { + return cachePath; + } + + @JsonProperty(JSON_PROPERTY_CACHE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCachePath(@org.eclipse.jdt.annotation.NonNull String cachePath) { + this.cachePath = cachePath; + } + + public SystemInfo logPath(@org.eclipse.jdt.annotation.NonNull String logPath) { + this.logPath = logPath; + return this; + } + + /** + * Gets or sets the log path. + * + * @return logPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOG_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLogPath() { + return logPath; + } + + @JsonProperty(JSON_PROPERTY_LOG_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogPath(@org.eclipse.jdt.annotation.NonNull String logPath) { + this.logPath = logPath; + } + + public SystemInfo internalMetadataPath(@org.eclipse.jdt.annotation.NonNull String internalMetadataPath) { + this.internalMetadataPath = internalMetadataPath; + return this; + } + + /** + * Gets or sets the internal metadata path. + * + * @return internalMetadataPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INTERNAL_METADATA_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInternalMetadataPath() { + return internalMetadataPath; + } + + @JsonProperty(JSON_PROPERTY_INTERNAL_METADATA_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInternalMetadataPath(@org.eclipse.jdt.annotation.NonNull String internalMetadataPath) { + this.internalMetadataPath = internalMetadataPath; + } + + public SystemInfo transcodingTempPath(@org.eclipse.jdt.annotation.NonNull String transcodingTempPath) { + this.transcodingTempPath = transcodingTempPath; + return this; + } + + /** + * Gets or sets the transcode path. + * + * @return transcodingTempPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODING_TEMP_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTranscodingTempPath() { + return transcodingTempPath; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODING_TEMP_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodingTempPath(@org.eclipse.jdt.annotation.NonNull String transcodingTempPath) { + this.transcodingTempPath = transcodingTempPath; + } + + public SystemInfo castReceiverApplications( + @org.eclipse.jdt.annotation.NonNull List castReceiverApplications) { + this.castReceiverApplications = castReceiverApplications; + return this; + } + + public SystemInfo addCastReceiverApplicationsItem(CastReceiverApplication castReceiverApplicationsItem) { + if (this.castReceiverApplications == null) { + this.castReceiverApplications = new ArrayList<>(); + } + this.castReceiverApplications.add(castReceiverApplicationsItem); + return this; + } + + /** + * Gets or sets the list of cast receiver applications. + * + * @return castReceiverApplications + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAST_RECEIVER_APPLICATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCastReceiverApplications() { + return castReceiverApplications; + } + + @JsonProperty(JSON_PROPERTY_CAST_RECEIVER_APPLICATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCastReceiverApplications( + @org.eclipse.jdt.annotation.NonNull List castReceiverApplications) { + this.castReceiverApplications = castReceiverApplications; + } + + public SystemInfo hasUpdateAvailable(@org.eclipse.jdt.annotation.NonNull Boolean hasUpdateAvailable) { + this.hasUpdateAvailable = hasUpdateAvailable; + return this; + } + + /** + * Gets or sets a value indicating whether this instance has update available. + * + * @return hasUpdateAvailable + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_UPDATE_AVAILABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasUpdateAvailable() { + return hasUpdateAvailable; + } + + @JsonProperty(JSON_PROPERTY_HAS_UPDATE_AVAILABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasUpdateAvailable(@org.eclipse.jdt.annotation.NonNull Boolean hasUpdateAvailable) { + this.hasUpdateAvailable = hasUpdateAvailable; + } + + public SystemInfo encoderLocation(@org.eclipse.jdt.annotation.NonNull String encoderLocation) { + this.encoderLocation = encoderLocation; + return this; + } + + /** + * Get encoderLocation + * + * @return encoderLocation + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENCODER_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEncoderLocation() { + return encoderLocation; + } + + @JsonProperty(JSON_PROPERTY_ENCODER_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncoderLocation(@org.eclipse.jdt.annotation.NonNull String encoderLocation) { + this.encoderLocation = encoderLocation; + } + + public SystemInfo systemArchitecture(@org.eclipse.jdt.annotation.NonNull String systemArchitecture) { + this.systemArchitecture = systemArchitecture; + return this; + } + + /** + * Get systemArchitecture + * + * @return systemArchitecture + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SYSTEM_ARCHITECTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSystemArchitecture() { + return systemArchitecture; + } + + @JsonProperty(JSON_PROPERTY_SYSTEM_ARCHITECTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSystemArchitecture(@org.eclipse.jdt.annotation.NonNull String systemArchitecture) { + this.systemArchitecture = systemArchitecture; + } + + /** + * Return true if this SystemInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SystemInfo systemInfo = (SystemInfo) o; + return Objects.equals(this.localAddress, systemInfo.localAddress) + && Objects.equals(this.serverName, systemInfo.serverName) + && Objects.equals(this.version, systemInfo.version) + && Objects.equals(this.productName, systemInfo.productName) + && Objects.equals(this.operatingSystem, systemInfo.operatingSystem) + && Objects.equals(this.id, systemInfo.id) + && Objects.equals(this.startupWizardCompleted, systemInfo.startupWizardCompleted) + && Objects.equals(this.operatingSystemDisplayName, systemInfo.operatingSystemDisplayName) + && Objects.equals(this.packageName, systemInfo.packageName) + && Objects.equals(this.hasPendingRestart, systemInfo.hasPendingRestart) + && Objects.equals(this.isShuttingDown, systemInfo.isShuttingDown) + && Objects.equals(this.supportsLibraryMonitor, systemInfo.supportsLibraryMonitor) + && Objects.equals(this.webSocketPortNumber, systemInfo.webSocketPortNumber) + && Objects.equals(this.completedInstallations, systemInfo.completedInstallations) + && Objects.equals(this.canSelfRestart, systemInfo.canSelfRestart) + && Objects.equals(this.canLaunchWebBrowser, systemInfo.canLaunchWebBrowser) + && Objects.equals(this.programDataPath, systemInfo.programDataPath) + && Objects.equals(this.webPath, systemInfo.webPath) + && Objects.equals(this.itemsByNamePath, systemInfo.itemsByNamePath) + && Objects.equals(this.cachePath, systemInfo.cachePath) + && Objects.equals(this.logPath, systemInfo.logPath) + && Objects.equals(this.internalMetadataPath, systemInfo.internalMetadataPath) + && Objects.equals(this.transcodingTempPath, systemInfo.transcodingTempPath) + && Objects.equals(this.castReceiverApplications, systemInfo.castReceiverApplications) + && Objects.equals(this.hasUpdateAvailable, systemInfo.hasUpdateAvailable) + && Objects.equals(this.encoderLocation, systemInfo.encoderLocation) + && Objects.equals(this.systemArchitecture, systemInfo.systemArchitecture); + } + + @Override + public int hashCode() { + return Objects.hash(localAddress, serverName, version, productName, operatingSystem, id, startupWizardCompleted, + operatingSystemDisplayName, packageName, hasPendingRestart, isShuttingDown, supportsLibraryMonitor, + webSocketPortNumber, completedInstallations, canSelfRestart, canLaunchWebBrowser, programDataPath, + webPath, itemsByNamePath, cachePath, logPath, internalMetadataPath, transcodingTempPath, + castReceiverApplications, hasUpdateAvailable, encoderLocation, systemArchitecture); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SystemInfo {\n"); + sb.append(" localAddress: ").append(toIndentedString(localAddress)).append("\n"); + sb.append(" serverName: ").append(toIndentedString(serverName)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" productName: ").append(toIndentedString(productName)).append("\n"); + sb.append(" operatingSystem: ").append(toIndentedString(operatingSystem)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" startupWizardCompleted: ").append(toIndentedString(startupWizardCompleted)).append("\n"); + sb.append(" operatingSystemDisplayName: ").append(toIndentedString(operatingSystemDisplayName)).append("\n"); + sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); + sb.append(" hasPendingRestart: ").append(toIndentedString(hasPendingRestart)).append("\n"); + sb.append(" isShuttingDown: ").append(toIndentedString(isShuttingDown)).append("\n"); + sb.append(" supportsLibraryMonitor: ").append(toIndentedString(supportsLibraryMonitor)).append("\n"); + sb.append(" webSocketPortNumber: ").append(toIndentedString(webSocketPortNumber)).append("\n"); + sb.append(" completedInstallations: ").append(toIndentedString(completedInstallations)).append("\n"); + sb.append(" canSelfRestart: ").append(toIndentedString(canSelfRestart)).append("\n"); + sb.append(" canLaunchWebBrowser: ").append(toIndentedString(canLaunchWebBrowser)).append("\n"); + sb.append(" programDataPath: ").append(toIndentedString(programDataPath)).append("\n"); + sb.append(" webPath: ").append(toIndentedString(webPath)).append("\n"); + sb.append(" itemsByNamePath: ").append(toIndentedString(itemsByNamePath)).append("\n"); + sb.append(" cachePath: ").append(toIndentedString(cachePath)).append("\n"); + sb.append(" logPath: ").append(toIndentedString(logPath)).append("\n"); + sb.append(" internalMetadataPath: ").append(toIndentedString(internalMetadataPath)).append("\n"); + sb.append(" transcodingTempPath: ").append(toIndentedString(transcodingTempPath)).append("\n"); + sb.append(" castReceiverApplications: ").append(toIndentedString(castReceiverApplications)).append("\n"); + sb.append(" hasUpdateAvailable: ").append(toIndentedString(hasUpdateAvailable)).append("\n"); + sb.append(" encoderLocation: ").append(toIndentedString(encoderLocation)).append("\n"); + sb.append(" systemArchitecture: ").append(toIndentedString(systemArchitecture)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `LocalAddress` to the URL query string + if (getLocalAddress() != null) { + joiner.add(String.format("%sLocalAddress%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocalAddress())))); + } + + // add `ServerName` to the URL query string + if (getServerName() != null) { + joiner.add(String.format("%sServerName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerName())))); + } + + // add `Version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format("%sVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `ProductName` to the URL query string + if (getProductName() != null) { + joiner.add(String.format("%sProductName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProductName())))); + } + + // add `OperatingSystem` to the URL query string + if (getOperatingSystem() != null) { + joiner.add(String.format("%sOperatingSystem%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOperatingSystem())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `StartupWizardCompleted` to the URL query string + if (getStartupWizardCompleted() != null) { + joiner.add(String.format("%sStartupWizardCompleted%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartupWizardCompleted())))); + } + + // add `OperatingSystemDisplayName` to the URL query string + if (getOperatingSystemDisplayName() != null) { + joiner.add(String.format("%sOperatingSystemDisplayName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOperatingSystemDisplayName())))); + } + + // add `PackageName` to the URL query string + if (getPackageName() != null) { + joiner.add(String.format("%sPackageName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPackageName())))); + } + + // add `HasPendingRestart` to the URL query string + if (getHasPendingRestart() != null) { + joiner.add(String.format("%sHasPendingRestart%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasPendingRestart())))); + } + + // add `IsShuttingDown` to the URL query string + if (getIsShuttingDown() != null) { + joiner.add(String.format("%sIsShuttingDown%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsShuttingDown())))); + } + + // add `SupportsLibraryMonitor` to the URL query string + if (getSupportsLibraryMonitor() != null) { + joiner.add(String.format("%sSupportsLibraryMonitor%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsLibraryMonitor())))); + } + + // add `WebSocketPortNumber` to the URL query string + if (getWebSocketPortNumber() != null) { + joiner.add(String.format("%sWebSocketPortNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWebSocketPortNumber())))); + } + + // add `CompletedInstallations` to the URL query string + if (getCompletedInstallations() != null) { + for (int i = 0; i < getCompletedInstallations().size(); i++) { + if (getCompletedInstallations().get(i) != null) { + joiner.add(getCompletedInstallations().get(i).toUrlQueryString(String.format( + "%sCompletedInstallations%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `CanSelfRestart` to the URL query string + if (getCanSelfRestart() != null) { + joiner.add(String.format("%sCanSelfRestart%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanSelfRestart())))); + } + + // add `CanLaunchWebBrowser` to the URL query string + if (getCanLaunchWebBrowser() != null) { + joiner.add(String.format("%sCanLaunchWebBrowser%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanLaunchWebBrowser())))); + } + + // add `ProgramDataPath` to the URL query string + if (getProgramDataPath() != null) { + joiner.add(String.format("%sProgramDataPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProgramDataPath())))); + } + + // add `WebPath` to the URL query string + if (getWebPath() != null) { + joiner.add(String.format("%sWebPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWebPath())))); + } + + // add `ItemsByNamePath` to the URL query string + if (getItemsByNamePath() != null) { + joiner.add(String.format("%sItemsByNamePath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemsByNamePath())))); + } + + // add `CachePath` to the URL query string + if (getCachePath() != null) { + joiner.add(String.format("%sCachePath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCachePath())))); + } + + // add `LogPath` to the URL query string + if (getLogPath() != null) { + joiner.add(String.format("%sLogPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLogPath())))); + } + + // add `InternalMetadataPath` to the URL query string + if (getInternalMetadataPath() != null) { + joiner.add(String.format("%sInternalMetadataPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getInternalMetadataPath())))); + } + + // add `TranscodingTempPath` to the URL query string + if (getTranscodingTempPath() != null) { + joiner.add(String.format("%sTranscodingTempPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTranscodingTempPath())))); + } + + // add `CastReceiverApplications` to the URL query string + if (getCastReceiverApplications() != null) { + for (int i = 0; i < getCastReceiverApplications().size(); i++) { + if (getCastReceiverApplications().get(i) != null) { + joiner.add(getCastReceiverApplications().get(i).toUrlQueryString(String.format( + "%sCastReceiverApplications%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `HasUpdateAvailable` to the URL query string + if (getHasUpdateAvailable() != null) { + joiner.add(String.format("%sHasUpdateAvailable%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasUpdateAvailable())))); + } + + // add `EncoderLocation` to the URL query string + if (getEncoderLocation() != null) { + joiner.add(String.format("%sEncoderLocation%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEncoderLocation())))); + } + + // add `SystemArchitecture` to the URL query string + if (getSystemArchitecture() != null) { + joiner.add(String.format("%sSystemArchitecture%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSystemArchitecture())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SystemInfo instance; + + public Builder() { + this(new SystemInfo()); + } + + protected Builder(SystemInfo instance) { + this.instance = instance; + } + + public SystemInfo.Builder localAddress(String localAddress) { + this.instance.localAddress = localAddress; + return this; + } + + public SystemInfo.Builder serverName(String serverName) { + this.instance.serverName = serverName; + return this; + } + + public SystemInfo.Builder version(String version) { + this.instance.version = version; + return this; + } + + public SystemInfo.Builder productName(String productName) { + this.instance.productName = productName; + return this; + } + + public SystemInfo.Builder operatingSystem(String operatingSystem) { + this.instance.operatingSystem = operatingSystem; + return this; + } + + public SystemInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public SystemInfo.Builder startupWizardCompleted(Boolean startupWizardCompleted) { + this.instance.startupWizardCompleted = startupWizardCompleted; + return this; + } + + public SystemInfo.Builder operatingSystemDisplayName(String operatingSystemDisplayName) { + this.instance.operatingSystemDisplayName = operatingSystemDisplayName; + return this; + } + + public SystemInfo.Builder packageName(String packageName) { + this.instance.packageName = packageName; + return this; + } + + public SystemInfo.Builder hasPendingRestart(Boolean hasPendingRestart) { + this.instance.hasPendingRestart = hasPendingRestart; + return this; + } + + public SystemInfo.Builder isShuttingDown(Boolean isShuttingDown) { + this.instance.isShuttingDown = isShuttingDown; + return this; + } + + public SystemInfo.Builder supportsLibraryMonitor(Boolean supportsLibraryMonitor) { + this.instance.supportsLibraryMonitor = supportsLibraryMonitor; + return this; + } + + public SystemInfo.Builder webSocketPortNumber(Integer webSocketPortNumber) { + this.instance.webSocketPortNumber = webSocketPortNumber; + return this; + } + + public SystemInfo.Builder completedInstallations(List completedInstallations) { + this.instance.completedInstallations = completedInstallations; + return this; + } + + public SystemInfo.Builder canSelfRestart(Boolean canSelfRestart) { + this.instance.canSelfRestart = canSelfRestart; + return this; + } + + public SystemInfo.Builder canLaunchWebBrowser(Boolean canLaunchWebBrowser) { + this.instance.canLaunchWebBrowser = canLaunchWebBrowser; + return this; + } + + public SystemInfo.Builder programDataPath(String programDataPath) { + this.instance.programDataPath = programDataPath; + return this; + } + + public SystemInfo.Builder webPath(String webPath) { + this.instance.webPath = webPath; + return this; + } + + public SystemInfo.Builder itemsByNamePath(String itemsByNamePath) { + this.instance.itemsByNamePath = itemsByNamePath; + return this; + } + + public SystemInfo.Builder cachePath(String cachePath) { + this.instance.cachePath = cachePath; + return this; + } + + public SystemInfo.Builder logPath(String logPath) { + this.instance.logPath = logPath; + return this; + } + + public SystemInfo.Builder internalMetadataPath(String internalMetadataPath) { + this.instance.internalMetadataPath = internalMetadataPath; + return this; + } + + public SystemInfo.Builder transcodingTempPath(String transcodingTempPath) { + this.instance.transcodingTempPath = transcodingTempPath; + return this; + } + + public SystemInfo.Builder castReceiverApplications(List castReceiverApplications) { + this.instance.castReceiverApplications = castReceiverApplications; + return this; + } + + public SystemInfo.Builder hasUpdateAvailable(Boolean hasUpdateAvailable) { + this.instance.hasUpdateAvailable = hasUpdateAvailable; + return this; + } + + public SystemInfo.Builder encoderLocation(String encoderLocation) { + this.instance.encoderLocation = encoderLocation; + return this; + } + + public SystemInfo.Builder systemArchitecture(String systemArchitecture) { + this.instance.systemArchitecture = systemArchitecture; + return this; + } + + /** + * returns a built SystemInfo instance. + * + * The builder is not reusable. + */ + public SystemInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SystemInfo.Builder builder() { + return new SystemInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SystemInfo.Builder toBuilder() { + return new SystemInfo.Builder().localAddress(getLocalAddress()).serverName(getServerName()) + .version(getVersion()).productName(getProductName()).operatingSystem(getOperatingSystem()).id(getId()) + .startupWizardCompleted(getStartupWizardCompleted()) + .operatingSystemDisplayName(getOperatingSystemDisplayName()).packageName(getPackageName()) + .hasPendingRestart(getHasPendingRestart()).isShuttingDown(getIsShuttingDown()) + .supportsLibraryMonitor(getSupportsLibraryMonitor()).webSocketPortNumber(getWebSocketPortNumber()) + .completedInstallations(getCompletedInstallations()).canSelfRestart(getCanSelfRestart()) + .canLaunchWebBrowser(getCanLaunchWebBrowser()).programDataPath(getProgramDataPath()) + .webPath(getWebPath()).itemsByNamePath(getItemsByNamePath()).cachePath(getCachePath()) + .logPath(getLogPath()).internalMetadataPath(getInternalMetadataPath()) + .transcodingTempPath(getTranscodingTempPath()).castReceiverApplications(getCastReceiverApplications()) + .hasUpdateAvailable(getHasUpdateAvailable()).encoderLocation(getEncoderLocation()) + .systemArchitecture(getSystemArchitecture()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskCompletionStatus.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskCompletionStatus.java new file mode 100644 index 0000000000000..f941da6cfca08 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskCompletionStatus.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum TaskCompletionStatus. + */ +public enum TaskCompletionStatus { + + COMPLETED("Completed"), + + FAILED("Failed"), + + CANCELLED("Cancelled"), + + ABORTED("Aborted"); + + private String value; + + TaskCompletionStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TaskCompletionStatus fromValue(String value) { + for (TaskCompletionStatus b : TaskCompletionStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskInfo.java new file mode 100644 index 0000000000000..f45355e8b62b2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskInfo.java @@ -0,0 +1,571 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class TaskInfo. + */ +@JsonPropertyOrder({ TaskInfo.JSON_PROPERTY_NAME, TaskInfo.JSON_PROPERTY_STATE, + TaskInfo.JSON_PROPERTY_CURRENT_PROGRESS_PERCENTAGE, TaskInfo.JSON_PROPERTY_ID, + TaskInfo.JSON_PROPERTY_LAST_EXECUTION_RESULT, TaskInfo.JSON_PROPERTY_TRIGGERS, + TaskInfo.JSON_PROPERTY_DESCRIPTION, TaskInfo.JSON_PROPERTY_CATEGORY, TaskInfo.JSON_PROPERTY_IS_HIDDEN, + TaskInfo.JSON_PROPERTY_KEY }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TaskInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_STATE = "State"; + @org.eclipse.jdt.annotation.NonNull + private TaskState state; + + public static final String JSON_PROPERTY_CURRENT_PROGRESS_PERCENTAGE = "CurrentProgressPercentage"; + @org.eclipse.jdt.annotation.NonNull + private Double currentProgressPercentage; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_LAST_EXECUTION_RESULT = "LastExecutionResult"; + @org.eclipse.jdt.annotation.NonNull + private TaskResult lastExecutionResult; + + public static final String JSON_PROPERTY_TRIGGERS = "Triggers"; + @org.eclipse.jdt.annotation.NonNull + private List triggers; + + public static final String JSON_PROPERTY_DESCRIPTION = "Description"; + @org.eclipse.jdt.annotation.NonNull + private String description; + + public static final String JSON_PROPERTY_CATEGORY = "Category"; + @org.eclipse.jdt.annotation.NonNull + private String category; + + public static final String JSON_PROPERTY_IS_HIDDEN = "IsHidden"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isHidden; + + public static final String JSON_PROPERTY_KEY = "Key"; + @org.eclipse.jdt.annotation.NonNull + private String key; + + public TaskInfo() { + } + + public TaskInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public TaskInfo state(@org.eclipse.jdt.annotation.NonNull TaskState state) { + this.state = state; + return this; + } + + /** + * Gets or sets the state of the task. + * + * @return state + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TaskState getState() { + return state; + } + + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setState(@org.eclipse.jdt.annotation.NonNull TaskState state) { + this.state = state; + } + + public TaskInfo currentProgressPercentage(@org.eclipse.jdt.annotation.NonNull Double currentProgressPercentage) { + this.currentProgressPercentage = currentProgressPercentage; + return this; + } + + /** + * Gets or sets the progress. + * + * @return currentProgressPercentage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CURRENT_PROGRESS_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getCurrentProgressPercentage() { + return currentProgressPercentage; + } + + @JsonProperty(JSON_PROPERTY_CURRENT_PROGRESS_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrentProgressPercentage(@org.eclipse.jdt.annotation.NonNull Double currentProgressPercentage) { + this.currentProgressPercentage = currentProgressPercentage; + } + + public TaskInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public TaskInfo lastExecutionResult(@org.eclipse.jdt.annotation.NonNull TaskResult lastExecutionResult) { + this.lastExecutionResult = lastExecutionResult; + return this; + } + + /** + * Gets or sets the last execution result. + * + * @return lastExecutionResult + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_EXECUTION_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TaskResult getLastExecutionResult() { + return lastExecutionResult; + } + + @JsonProperty(JSON_PROPERTY_LAST_EXECUTION_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastExecutionResult(@org.eclipse.jdt.annotation.NonNull TaskResult lastExecutionResult) { + this.lastExecutionResult = lastExecutionResult; + } + + public TaskInfo triggers(@org.eclipse.jdt.annotation.NonNull List triggers) { + this.triggers = triggers; + return this; + } + + public TaskInfo addTriggersItem(TaskTriggerInfo triggersItem) { + if (this.triggers == null) { + this.triggers = new ArrayList<>(); + } + this.triggers.add(triggersItem); + return this; + } + + /** + * Gets or sets the triggers. + * + * @return triggers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRIGGERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTriggers() { + return triggers; + } + + @JsonProperty(JSON_PROPERTY_TRIGGERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTriggers(@org.eclipse.jdt.annotation.NonNull List triggers) { + this.triggers = triggers; + } + + public TaskInfo description(@org.eclipse.jdt.annotation.NonNull String description) { + this.description = description; + return this; + } + + /** + * Gets or sets the description. + * + * @return description + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@org.eclipse.jdt.annotation.NonNull String description) { + this.description = description; + } + + public TaskInfo category(@org.eclipse.jdt.annotation.NonNull String category) { + this.category = category; + return this; + } + + /** + * Gets or sets the category. + * + * @return category + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCategory() { + return category; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(@org.eclipse.jdt.annotation.NonNull String category) { + this.category = category; + } + + public TaskInfo isHidden(@org.eclipse.jdt.annotation.NonNull Boolean isHidden) { + this.isHidden = isHidden; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is hidden. + * + * @return isHidden + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_HIDDEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsHidden() { + return isHidden; + } + + @JsonProperty(JSON_PROPERTY_IS_HIDDEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsHidden(@org.eclipse.jdt.annotation.NonNull Boolean isHidden) { + this.isHidden = isHidden; + } + + public TaskInfo key(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + return this; + } + + /** + * Gets or sets the key. + * + * @return key + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + } + + /** + * Return true if this TaskInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TaskInfo taskInfo = (TaskInfo) o; + return Objects.equals(this.name, taskInfo.name) && Objects.equals(this.state, taskInfo.state) + && Objects.equals(this.currentProgressPercentage, taskInfo.currentProgressPercentage) + && Objects.equals(this.id, taskInfo.id) + && Objects.equals(this.lastExecutionResult, taskInfo.lastExecutionResult) + && Objects.equals(this.triggers, taskInfo.triggers) + && Objects.equals(this.description, taskInfo.description) + && Objects.equals(this.category, taskInfo.category) && Objects.equals(this.isHidden, taskInfo.isHidden) + && Objects.equals(this.key, taskInfo.key); + } + + @Override + public int hashCode() { + return Objects.hash(name, state, currentProgressPercentage, id, lastExecutionResult, triggers, description, + category, isHidden, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TaskInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" currentProgressPercentage: ").append(toIndentedString(currentProgressPercentage)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" lastExecutionResult: ").append(toIndentedString(lastExecutionResult)).append("\n"); + sb.append(" triggers: ").append(toIndentedString(triggers)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" isHidden: ").append(toIndentedString(isHidden)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `State` to the URL query string + if (getState() != null) { + joiner.add(String.format("%sState%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getState())))); + } + + // add `CurrentProgressPercentage` to the URL query string + if (getCurrentProgressPercentage() != null) { + joiner.add(String.format("%sCurrentProgressPercentage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCurrentProgressPercentage())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `LastExecutionResult` to the URL query string + if (getLastExecutionResult() != null) { + joiner.add(getLastExecutionResult().toUrlQueryString(prefix + "LastExecutionResult" + suffix)); + } + + // add `Triggers` to the URL query string + if (getTriggers() != null) { + for (int i = 0; i < getTriggers().size(); i++) { + if (getTriggers().get(i) != null) { + joiner.add(getTriggers().get(i).toUrlQueryString(String.format("%sTriggers%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sDescription%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `Category` to the URL query string + if (getCategory() != null) { + joiner.add(String.format("%sCategory%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCategory())))); + } + + // add `IsHidden` to the URL query string + if (getIsHidden() != null) { + joiner.add(String.format("%sIsHidden%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsHidden())))); + } + + // add `Key` to the URL query string + if (getKey() != null) { + joiner.add(String.format("%sKey%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getKey())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TaskInfo instance; + + public Builder() { + this(new TaskInfo()); + } + + protected Builder(TaskInfo instance) { + this.instance = instance; + } + + public TaskInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public TaskInfo.Builder state(TaskState state) { + this.instance.state = state; + return this; + } + + public TaskInfo.Builder currentProgressPercentage(Double currentProgressPercentage) { + this.instance.currentProgressPercentage = currentProgressPercentage; + return this; + } + + public TaskInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public TaskInfo.Builder lastExecutionResult(TaskResult lastExecutionResult) { + this.instance.lastExecutionResult = lastExecutionResult; + return this; + } + + public TaskInfo.Builder triggers(List triggers) { + this.instance.triggers = triggers; + return this; + } + + public TaskInfo.Builder description(String description) { + this.instance.description = description; + return this; + } + + public TaskInfo.Builder category(String category) { + this.instance.category = category; + return this; + } + + public TaskInfo.Builder isHidden(Boolean isHidden) { + this.instance.isHidden = isHidden; + return this; + } + + public TaskInfo.Builder key(String key) { + this.instance.key = key; + return this; + } + + /** + * returns a built TaskInfo instance. + * + * The builder is not reusable. + */ + public TaskInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TaskInfo.Builder builder() { + return new TaskInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TaskInfo.Builder toBuilder() { + return new TaskInfo.Builder().name(getName()).state(getState()) + .currentProgressPercentage(getCurrentProgressPercentage()).id(getId()) + .lastExecutionResult(getLastExecutionResult()).triggers(getTriggers()).description(getDescription()) + .category(getCategory()).isHidden(getIsHidden()).key(getKey()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskResult.java new file mode 100644 index 0000000000000..9929067950dee --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskResult.java @@ -0,0 +1,476 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class TaskExecutionInfo. + */ +@JsonPropertyOrder({ TaskResult.JSON_PROPERTY_START_TIME_UTC, TaskResult.JSON_PROPERTY_END_TIME_UTC, + TaskResult.JSON_PROPERTY_STATUS, TaskResult.JSON_PROPERTY_NAME, TaskResult.JSON_PROPERTY_KEY, + TaskResult.JSON_PROPERTY_ID, TaskResult.JSON_PROPERTY_ERROR_MESSAGE, + TaskResult.JSON_PROPERTY_LONG_ERROR_MESSAGE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TaskResult { + public static final String JSON_PROPERTY_START_TIME_UTC = "StartTimeUtc"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime startTimeUtc; + + public static final String JSON_PROPERTY_END_TIME_UTC = "EndTimeUtc"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime endTimeUtc; + + public static final String JSON_PROPERTY_STATUS = "Status"; + @org.eclipse.jdt.annotation.NonNull + private TaskCompletionStatus status; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_KEY = "Key"; + @org.eclipse.jdt.annotation.NonNull + private String key; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_ERROR_MESSAGE = "ErrorMessage"; + @org.eclipse.jdt.annotation.NonNull + private String errorMessage; + + public static final String JSON_PROPERTY_LONG_ERROR_MESSAGE = "LongErrorMessage"; + @org.eclipse.jdt.annotation.NonNull + private String longErrorMessage; + + public TaskResult() { + } + + public TaskResult startTimeUtc(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startTimeUtc) { + this.startTimeUtc = startTimeUtc; + return this; + } + + /** + * Gets or sets the start time UTC. + * + * @return startTimeUtc + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_TIME_UTC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartTimeUtc() { + return startTimeUtc; + } + + @JsonProperty(JSON_PROPERTY_START_TIME_UTC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartTimeUtc(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startTimeUtc) { + this.startTimeUtc = startTimeUtc; + } + + public TaskResult endTimeUtc(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endTimeUtc) { + this.endTimeUtc = endTimeUtc; + return this; + } + + /** + * Gets or sets the end time UTC. + * + * @return endTimeUtc + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_END_TIME_UTC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndTimeUtc() { + return endTimeUtc; + } + + @JsonProperty(JSON_PROPERTY_END_TIME_UTC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndTimeUtc(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endTimeUtc) { + this.endTimeUtc = endTimeUtc; + } + + public TaskResult status(@org.eclipse.jdt.annotation.NonNull TaskCompletionStatus status) { + this.status = status; + return this; + } + + /** + * Gets or sets the status. + * + * @return status + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TaskCompletionStatus getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@org.eclipse.jdt.annotation.NonNull TaskCompletionStatus status) { + this.status = status; + } + + public TaskResult name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public TaskResult key(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + return this; + } + + /** + * Gets or sets the key. + * + * @return key + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + } + + public TaskResult id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public TaskResult errorMessage(@org.eclipse.jdt.annotation.NonNull String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Gets or sets the error message. + * + * @return errorMessage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ERROR_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getErrorMessage() { + return errorMessage; + } + + @JsonProperty(JSON_PROPERTY_ERROR_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorMessage(@org.eclipse.jdt.annotation.NonNull String errorMessage) { + this.errorMessage = errorMessage; + } + + public TaskResult longErrorMessage(@org.eclipse.jdt.annotation.NonNull String longErrorMessage) { + this.longErrorMessage = longErrorMessage; + return this; + } + + /** + * Gets or sets the long error message. + * + * @return longErrorMessage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LONG_ERROR_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLongErrorMessage() { + return longErrorMessage; + } + + @JsonProperty(JSON_PROPERTY_LONG_ERROR_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLongErrorMessage(@org.eclipse.jdt.annotation.NonNull String longErrorMessage) { + this.longErrorMessage = longErrorMessage; + } + + /** + * Return true if this TaskResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TaskResult taskResult = (TaskResult) o; + return Objects.equals(this.startTimeUtc, taskResult.startTimeUtc) + && Objects.equals(this.endTimeUtc, taskResult.endTimeUtc) + && Objects.equals(this.status, taskResult.status) && Objects.equals(this.name, taskResult.name) + && Objects.equals(this.key, taskResult.key) && Objects.equals(this.id, taskResult.id) + && Objects.equals(this.errorMessage, taskResult.errorMessage) + && Objects.equals(this.longErrorMessage, taskResult.longErrorMessage); + } + + @Override + public int hashCode() { + return Objects.hash(startTimeUtc, endTimeUtc, status, name, key, id, errorMessage, longErrorMessage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TaskResult {\n"); + sb.append(" startTimeUtc: ").append(toIndentedString(startTimeUtc)).append("\n"); + sb.append(" endTimeUtc: ").append(toIndentedString(endTimeUtc)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" longErrorMessage: ").append(toIndentedString(longErrorMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `StartTimeUtc` to the URL query string + if (getStartTimeUtc() != null) { + joiner.add(String.format("%sStartTimeUtc%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartTimeUtc())))); + } + + // add `EndTimeUtc` to the URL query string + if (getEndTimeUtc() != null) { + joiner.add(String.format("%sEndTimeUtc%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndTimeUtc())))); + } + + // add `Status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sStatus%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Key` to the URL query string + if (getKey() != null) { + joiner.add(String.format("%sKey%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getKey())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `ErrorMessage` to the URL query string + if (getErrorMessage() != null) { + joiner.add(String.format("%sErrorMessage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getErrorMessage())))); + } + + // add `LongErrorMessage` to the URL query string + if (getLongErrorMessage() != null) { + joiner.add(String.format("%sLongErrorMessage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLongErrorMessage())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TaskResult instance; + + public Builder() { + this(new TaskResult()); + } + + protected Builder(TaskResult instance) { + this.instance = instance; + } + + public TaskResult.Builder startTimeUtc(OffsetDateTime startTimeUtc) { + this.instance.startTimeUtc = startTimeUtc; + return this; + } + + public TaskResult.Builder endTimeUtc(OffsetDateTime endTimeUtc) { + this.instance.endTimeUtc = endTimeUtc; + return this; + } + + public TaskResult.Builder status(TaskCompletionStatus status) { + this.instance.status = status; + return this; + } + + public TaskResult.Builder name(String name) { + this.instance.name = name; + return this; + } + + public TaskResult.Builder key(String key) { + this.instance.key = key; + return this; + } + + public TaskResult.Builder id(String id) { + this.instance.id = id; + return this; + } + + public TaskResult.Builder errorMessage(String errorMessage) { + this.instance.errorMessage = errorMessage; + return this; + } + + public TaskResult.Builder longErrorMessage(String longErrorMessage) { + this.instance.longErrorMessage = longErrorMessage; + return this; + } + + /** + * returns a built TaskResult instance. + * + * The builder is not reusable. + */ + public TaskResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TaskResult.Builder builder() { + return new TaskResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TaskResult.Builder toBuilder() { + return new TaskResult.Builder().startTimeUtc(getStartTimeUtc()).endTimeUtc(getEndTimeUtc()).status(getStatus()) + .name(getName()).key(getKey()).id(getId()).errorMessage(getErrorMessage()) + .longErrorMessage(getLongErrorMessage()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskState.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskState.java new file mode 100644 index 0000000000000..9bc3ffd7fcd62 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskState.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum TaskState. + */ +public enum TaskState { + + IDLE("Idle"), + + CANCELLING("Cancelling"), + + RUNNING("Running"); + + private String value; + + TaskState(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TaskState fromValue(String value) { + for (TaskState b : TaskState.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskTriggerInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskTriggerInfo.java new file mode 100644 index 0000000000000..df31da760ce56 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TaskTriggerInfo.java @@ -0,0 +1,355 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class TaskTriggerInfo. + */ +@JsonPropertyOrder({ TaskTriggerInfo.JSON_PROPERTY_TYPE, TaskTriggerInfo.JSON_PROPERTY_TIME_OF_DAY_TICKS, + TaskTriggerInfo.JSON_PROPERTY_INTERVAL_TICKS, TaskTriggerInfo.JSON_PROPERTY_DAY_OF_WEEK, + TaskTriggerInfo.JSON_PROPERTY_MAX_RUNTIME_TICKS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TaskTriggerInfo { + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_TIME_OF_DAY_TICKS = "TimeOfDayTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long timeOfDayTicks; + + public static final String JSON_PROPERTY_INTERVAL_TICKS = "IntervalTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long intervalTicks; + + public static final String JSON_PROPERTY_DAY_OF_WEEK = "DayOfWeek"; + @org.eclipse.jdt.annotation.NonNull + private DayOfWeek dayOfWeek; + + public static final String JSON_PROPERTY_MAX_RUNTIME_TICKS = "MaxRuntimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long maxRuntimeTicks; + + public TaskTriggerInfo() { + } + + public TaskTriggerInfo type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public TaskTriggerInfo timeOfDayTicks(@org.eclipse.jdt.annotation.NonNull Long timeOfDayTicks) { + this.timeOfDayTicks = timeOfDayTicks; + return this; + } + + /** + * Gets or sets the time of day. + * + * @return timeOfDayTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TIME_OF_DAY_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTimeOfDayTicks() { + return timeOfDayTicks; + } + + @JsonProperty(JSON_PROPERTY_TIME_OF_DAY_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimeOfDayTicks(@org.eclipse.jdt.annotation.NonNull Long timeOfDayTicks) { + this.timeOfDayTicks = timeOfDayTicks; + } + + public TaskTriggerInfo intervalTicks(@org.eclipse.jdt.annotation.NonNull Long intervalTicks) { + this.intervalTicks = intervalTicks; + return this; + } + + /** + * Gets or sets the interval. + * + * @return intervalTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INTERVAL_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getIntervalTicks() { + return intervalTicks; + } + + @JsonProperty(JSON_PROPERTY_INTERVAL_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIntervalTicks(@org.eclipse.jdt.annotation.NonNull Long intervalTicks) { + this.intervalTicks = intervalTicks; + } + + public TaskTriggerInfo dayOfWeek(@org.eclipse.jdt.annotation.NonNull DayOfWeek dayOfWeek) { + this.dayOfWeek = dayOfWeek; + return this; + } + + /** + * Gets or sets the day of week. + * + * @return dayOfWeek + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DAY_OF_WEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DayOfWeek getDayOfWeek() { + return dayOfWeek; + } + + @JsonProperty(JSON_PROPERTY_DAY_OF_WEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDayOfWeek(@org.eclipse.jdt.annotation.NonNull DayOfWeek dayOfWeek) { + this.dayOfWeek = dayOfWeek; + } + + public TaskTriggerInfo maxRuntimeTicks(@org.eclipse.jdt.annotation.NonNull Long maxRuntimeTicks) { + this.maxRuntimeTicks = maxRuntimeTicks; + return this; + } + + /** + * Gets or sets the maximum runtime ticks. + * + * @return maxRuntimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_RUNTIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getMaxRuntimeTicks() { + return maxRuntimeTicks; + } + + @JsonProperty(JSON_PROPERTY_MAX_RUNTIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxRuntimeTicks(@org.eclipse.jdt.annotation.NonNull Long maxRuntimeTicks) { + this.maxRuntimeTicks = maxRuntimeTicks; + } + + /** + * Return true if this TaskTriggerInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TaskTriggerInfo taskTriggerInfo = (TaskTriggerInfo) o; + return Objects.equals(this.type, taskTriggerInfo.type) + && Objects.equals(this.timeOfDayTicks, taskTriggerInfo.timeOfDayTicks) + && Objects.equals(this.intervalTicks, taskTriggerInfo.intervalTicks) + && Objects.equals(this.dayOfWeek, taskTriggerInfo.dayOfWeek) + && Objects.equals(this.maxRuntimeTicks, taskTriggerInfo.maxRuntimeTicks); + } + + @Override + public int hashCode() { + return Objects.hash(type, timeOfDayTicks, intervalTicks, dayOfWeek, maxRuntimeTicks); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TaskTriggerInfo {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" timeOfDayTicks: ").append(toIndentedString(timeOfDayTicks)).append("\n"); + sb.append(" intervalTicks: ").append(toIndentedString(intervalTicks)).append("\n"); + sb.append(" dayOfWeek: ").append(toIndentedString(dayOfWeek)).append("\n"); + sb.append(" maxRuntimeTicks: ").append(toIndentedString(maxRuntimeTicks)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `TimeOfDayTicks` to the URL query string + if (getTimeOfDayTicks() != null) { + joiner.add(String.format("%sTimeOfDayTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTimeOfDayTicks())))); + } + + // add `IntervalTicks` to the URL query string + if (getIntervalTicks() != null) { + joiner.add(String.format("%sIntervalTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIntervalTicks())))); + } + + // add `DayOfWeek` to the URL query string + if (getDayOfWeek() != null) { + joiner.add(String.format("%sDayOfWeek%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDayOfWeek())))); + } + + // add `MaxRuntimeTicks` to the URL query string + if (getMaxRuntimeTicks() != null) { + joiner.add(String.format("%sMaxRuntimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxRuntimeTicks())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TaskTriggerInfo instance; + + public Builder() { + this(new TaskTriggerInfo()); + } + + protected Builder(TaskTriggerInfo instance) { + this.instance = instance; + } + + public TaskTriggerInfo.Builder type(String type) { + this.instance.type = type; + return this; + } + + public TaskTriggerInfo.Builder timeOfDayTicks(Long timeOfDayTicks) { + this.instance.timeOfDayTicks = timeOfDayTicks; + return this; + } + + public TaskTriggerInfo.Builder intervalTicks(Long intervalTicks) { + this.instance.intervalTicks = intervalTicks; + return this; + } + + public TaskTriggerInfo.Builder dayOfWeek(DayOfWeek dayOfWeek) { + this.instance.dayOfWeek = dayOfWeek; + return this; + } + + public TaskTriggerInfo.Builder maxRuntimeTicks(Long maxRuntimeTicks) { + this.instance.maxRuntimeTicks = maxRuntimeTicks; + return this; + } + + /** + * returns a built TaskTriggerInfo instance. + * + * The builder is not reusable. + */ + public TaskTriggerInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TaskTriggerInfo.Builder builder() { + return new TaskTriggerInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TaskTriggerInfo.Builder toBuilder() { + return new TaskTriggerInfo.Builder().type(getType()).timeOfDayTicks(getTimeOfDayTicks()) + .intervalTicks(getIntervalTicks()).dayOfWeek(getDayOfWeek()).maxRuntimeTicks(getMaxRuntimeTicks()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ThemeMediaResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ThemeMediaResult.java new file mode 100644 index 0000000000000..23453140a672b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ThemeMediaResult.java @@ -0,0 +1,329 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class ThemeMediaResult. + */ +@JsonPropertyOrder({ ThemeMediaResult.JSON_PROPERTY_ITEMS, ThemeMediaResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, + ThemeMediaResult.JSON_PROPERTY_START_INDEX, ThemeMediaResult.JSON_PROPERTY_OWNER_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ThemeMediaResult { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public static final String JSON_PROPERTY_OWNER_ID = "OwnerId"; + @org.eclipse.jdt.annotation.NonNull + private UUID ownerId; + + public ThemeMediaResult() { + } + + public ThemeMediaResult items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public ThemeMediaResult addItemsItem(BaseItemDto itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Gets or sets the items. + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public ThemeMediaResult totalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total number of records available. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public ThemeMediaResult startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the index of the first record in Items. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + public ThemeMediaResult ownerId(@org.eclipse.jdt.annotation.NonNull UUID ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Gets or sets the owner id. + * + * @return ownerId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OWNER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getOwnerId() { + return ownerId; + } + + @JsonProperty(JSON_PROPERTY_OWNER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOwnerId(@org.eclipse.jdt.annotation.NonNull UUID ownerId) { + this.ownerId = ownerId; + } + + /** + * Return true if this ThemeMediaResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ThemeMediaResult themeMediaResult = (ThemeMediaResult) o; + return Objects.equals(this.items, themeMediaResult.items) + && Objects.equals(this.totalRecordCount, themeMediaResult.totalRecordCount) + && Objects.equals(this.startIndex, themeMediaResult.startIndex) + && Objects.equals(this.ownerId, themeMediaResult.ownerId); + } + + @Override + public int hashCode() { + return Objects.hash(items, totalRecordCount, startIndex, ownerId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ThemeMediaResult {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + // add `OwnerId` to the URL query string + if (getOwnerId() != null) { + joiner.add(String.format("%sOwnerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOwnerId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ThemeMediaResult instance; + + public Builder() { + this(new ThemeMediaResult()); + } + + protected Builder(ThemeMediaResult instance) { + this.instance = instance; + } + + public ThemeMediaResult.Builder items(List items) { + this.instance.items = items; + return this; + } + + public ThemeMediaResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public ThemeMediaResult.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + public ThemeMediaResult.Builder ownerId(UUID ownerId) { + this.instance.ownerId = ownerId; + return this; + } + + /** + * returns a built ThemeMediaResult instance. + * + * The builder is not reusable. + */ + public ThemeMediaResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ThemeMediaResult.Builder builder() { + return new ThemeMediaResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ThemeMediaResult.Builder toBuilder() { + return new ThemeMediaResult.Builder().items(getItems()).totalRecordCount(getTotalRecordCount()) + .startIndex(getStartIndex()).ownerId(getOwnerId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerCancelledMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerCancelledMessage.java new file mode 100644 index 0000000000000..a9579b8a55afe --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerCancelledMessage.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Timer cancelled message. + */ +@JsonPropertyOrder({ TimerCancelledMessage.JSON_PROPERTY_DATA, TimerCancelledMessage.JSON_PROPERTY_MESSAGE_ID, + TimerCancelledMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TimerCancelledMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private TimerEventInfo data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.TIMER_CANCELLED; + + public TimerCancelledMessage() { + } + + @JsonCreator + public TimerCancelledMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public TimerCancelledMessage data(@org.eclipse.jdt.annotation.NonNull TimerEventInfo data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TimerEventInfo getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull TimerEventInfo data) { + this.data = data; + } + + public TimerCancelledMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this TimerCancelledMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimerCancelledMessage timerCancelledMessage = (TimerCancelledMessage) o; + return Objects.equals(this.data, timerCancelledMessage.data) + && Objects.equals(this.messageId, timerCancelledMessage.messageId) + && Objects.equals(this.messageType, timerCancelledMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimerCancelledMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TimerCancelledMessage instance; + + public Builder() { + this(new TimerCancelledMessage()); + } + + protected Builder(TimerCancelledMessage instance) { + this.instance = instance; + } + + public TimerCancelledMessage.Builder data(TimerEventInfo data) { + this.instance.data = data; + return this; + } + + public TimerCancelledMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public TimerCancelledMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built TimerCancelledMessage instance. + * + * The builder is not reusable. + */ + public TimerCancelledMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TimerCancelledMessage.Builder builder() { + return new TimerCancelledMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TimerCancelledMessage.Builder toBuilder() { + return new TimerCancelledMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerCreatedMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerCreatedMessage.java new file mode 100644 index 0000000000000..857e3ef3973be --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerCreatedMessage.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Timer created message. + */ +@JsonPropertyOrder({ TimerCreatedMessage.JSON_PROPERTY_DATA, TimerCreatedMessage.JSON_PROPERTY_MESSAGE_ID, + TimerCreatedMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TimerCreatedMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private TimerEventInfo data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.TIMER_CREATED; + + public TimerCreatedMessage() { + } + + @JsonCreator + public TimerCreatedMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public TimerCreatedMessage data(@org.eclipse.jdt.annotation.NonNull TimerEventInfo data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TimerEventInfo getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull TimerEventInfo data) { + this.data = data; + } + + public TimerCreatedMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this TimerCreatedMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimerCreatedMessage timerCreatedMessage = (TimerCreatedMessage) o; + return Objects.equals(this.data, timerCreatedMessage.data) + && Objects.equals(this.messageId, timerCreatedMessage.messageId) + && Objects.equals(this.messageType, timerCreatedMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimerCreatedMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TimerCreatedMessage instance; + + public Builder() { + this(new TimerCreatedMessage()); + } + + protected Builder(TimerCreatedMessage instance) { + this.instance = instance; + } + + public TimerCreatedMessage.Builder data(TimerEventInfo data) { + this.instance.data = data; + return this; + } + + public TimerCreatedMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public TimerCreatedMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built TimerCreatedMessage instance. + * + * The builder is not reusable. + */ + public TimerCreatedMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TimerCreatedMessage.Builder builder() { + return new TimerCreatedMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TimerCreatedMessage.Builder toBuilder() { + return new TimerCreatedMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerEventInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerEventInfo.java new file mode 100644 index 0000000000000..6e18b8664812e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerEventInfo.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TimerEventInfo + */ +@JsonPropertyOrder({ TimerEventInfo.JSON_PROPERTY_ID, TimerEventInfo.JSON_PROPERTY_PROGRAM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TimerEventInfo { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_PROGRAM_ID = "ProgramId"; + @org.eclipse.jdt.annotation.NonNull + private UUID programId; + + public TimerEventInfo() { + } + + public TimerEventInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public TimerEventInfo programId(@org.eclipse.jdt.annotation.NonNull UUID programId) { + this.programId = programId; + return this; + } + + /** + * Get programId + * + * @return programId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getProgramId() { + return programId; + } + + @JsonProperty(JSON_PROPERTY_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgramId(@org.eclipse.jdt.annotation.NonNull UUID programId) { + this.programId = programId; + } + + /** + * Return true if this TimerEventInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimerEventInfo timerEventInfo = (TimerEventInfo) o; + return Objects.equals(this.id, timerEventInfo.id) && Objects.equals(this.programId, timerEventInfo.programId); + } + + @Override + public int hashCode() { + return Objects.hash(id, programId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimerEventInfo {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" programId: ").append(toIndentedString(programId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `ProgramId` to the URL query string + if (getProgramId() != null) { + joiner.add(String.format("%sProgramId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProgramId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TimerEventInfo instance; + + public Builder() { + this(new TimerEventInfo()); + } + + protected Builder(TimerEventInfo instance) { + this.instance = instance; + } + + public TimerEventInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public TimerEventInfo.Builder programId(UUID programId) { + this.instance.programId = programId; + return this; + } + + /** + * returns a built TimerEventInfo instance. + * + * The builder is not reusable. + */ + public TimerEventInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TimerEventInfo.Builder builder() { + return new TimerEventInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TimerEventInfo.Builder toBuilder() { + return new TimerEventInfo.Builder().id(getId()).programId(getProgramId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerInfoDto.java new file mode 100644 index 0000000000000..60d829a6f289f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerInfoDto.java @@ -0,0 +1,1312 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TimerInfoDto + */ +@JsonPropertyOrder({ TimerInfoDto.JSON_PROPERTY_ID, TimerInfoDto.JSON_PROPERTY_TYPE, + TimerInfoDto.JSON_PROPERTY_SERVER_ID, TimerInfoDto.JSON_PROPERTY_EXTERNAL_ID, + TimerInfoDto.JSON_PROPERTY_CHANNEL_ID, TimerInfoDto.JSON_PROPERTY_EXTERNAL_CHANNEL_ID, + TimerInfoDto.JSON_PROPERTY_CHANNEL_NAME, TimerInfoDto.JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG, + TimerInfoDto.JSON_PROPERTY_PROGRAM_ID, TimerInfoDto.JSON_PROPERTY_EXTERNAL_PROGRAM_ID, + TimerInfoDto.JSON_PROPERTY_NAME, TimerInfoDto.JSON_PROPERTY_OVERVIEW, TimerInfoDto.JSON_PROPERTY_START_DATE, + TimerInfoDto.JSON_PROPERTY_END_DATE, TimerInfoDto.JSON_PROPERTY_SERVICE_NAME, + TimerInfoDto.JSON_PROPERTY_PRIORITY, TimerInfoDto.JSON_PROPERTY_PRE_PADDING_SECONDS, + TimerInfoDto.JSON_PROPERTY_POST_PADDING_SECONDS, TimerInfoDto.JSON_PROPERTY_IS_PRE_PADDING_REQUIRED, + TimerInfoDto.JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID, TimerInfoDto.JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS, + TimerInfoDto.JSON_PROPERTY_IS_POST_PADDING_REQUIRED, TimerInfoDto.JSON_PROPERTY_KEEP_UNTIL, + TimerInfoDto.JSON_PROPERTY_STATUS, TimerInfoDto.JSON_PROPERTY_SERIES_TIMER_ID, + TimerInfoDto.JSON_PROPERTY_EXTERNAL_SERIES_TIMER_ID, TimerInfoDto.JSON_PROPERTY_RUN_TIME_TICKS, + TimerInfoDto.JSON_PROPERTY_PROGRAM_INFO }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TimerInfoDto { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_SERVER_ID = "ServerId"; + @org.eclipse.jdt.annotation.NonNull + private String serverId; + + public static final String JSON_PROPERTY_EXTERNAL_ID = "ExternalId"; + @org.eclipse.jdt.annotation.NonNull + private String externalId; + + public static final String JSON_PROPERTY_CHANNEL_ID = "ChannelId"; + @org.eclipse.jdt.annotation.NonNull + private UUID channelId; + + public static final String JSON_PROPERTY_EXTERNAL_CHANNEL_ID = "ExternalChannelId"; + @org.eclipse.jdt.annotation.NonNull + private String externalChannelId; + + public static final String JSON_PROPERTY_CHANNEL_NAME = "ChannelName"; + @org.eclipse.jdt.annotation.NonNull + private String channelName; + + public static final String JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG = "ChannelPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String channelPrimaryImageTag; + + public static final String JSON_PROPERTY_PROGRAM_ID = "ProgramId"; + @org.eclipse.jdt.annotation.NonNull + private String programId; + + public static final String JSON_PROPERTY_EXTERNAL_PROGRAM_ID = "ExternalProgramId"; + @org.eclipse.jdt.annotation.NonNull + private String externalProgramId; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_OVERVIEW = "Overview"; + @org.eclipse.jdt.annotation.NonNull + private String overview; + + public static final String JSON_PROPERTY_START_DATE = "StartDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime startDate; + + public static final String JSON_PROPERTY_END_DATE = "EndDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime endDate; + + public static final String JSON_PROPERTY_SERVICE_NAME = "ServiceName"; + @org.eclipse.jdt.annotation.NonNull + private String serviceName; + + public static final String JSON_PROPERTY_PRIORITY = "Priority"; + @org.eclipse.jdt.annotation.NonNull + private Integer priority; + + public static final String JSON_PROPERTY_PRE_PADDING_SECONDS = "PrePaddingSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer prePaddingSeconds; + + public static final String JSON_PROPERTY_POST_PADDING_SECONDS = "PostPaddingSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer postPaddingSeconds; + + public static final String JSON_PROPERTY_IS_PRE_PADDING_REQUIRED = "IsPrePaddingRequired"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPrePaddingRequired; + + public static final String JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID = "ParentBackdropItemId"; + @org.eclipse.jdt.annotation.NonNull + private String parentBackdropItemId; + + public static final String JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS = "ParentBackdropImageTags"; + @org.eclipse.jdt.annotation.NonNull + private List parentBackdropImageTags; + + public static final String JSON_PROPERTY_IS_POST_PADDING_REQUIRED = "IsPostPaddingRequired"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPostPaddingRequired; + + public static final String JSON_PROPERTY_KEEP_UNTIL = "KeepUntil"; + @org.eclipse.jdt.annotation.NonNull + private KeepUntil keepUntil; + + public static final String JSON_PROPERTY_STATUS = "Status"; + @org.eclipse.jdt.annotation.NonNull + private RecordingStatus status; + + public static final String JSON_PROPERTY_SERIES_TIMER_ID = "SeriesTimerId"; + @org.eclipse.jdt.annotation.NonNull + private String seriesTimerId; + + public static final String JSON_PROPERTY_EXTERNAL_SERIES_TIMER_ID = "ExternalSeriesTimerId"; + @org.eclipse.jdt.annotation.NonNull + private String externalSeriesTimerId; + + public static final String JSON_PROPERTY_RUN_TIME_TICKS = "RunTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long runTimeTicks; + + public static final String JSON_PROPERTY_PROGRAM_INFO = "ProgramInfo"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemDto programInfo; + + public TimerInfoDto() { + } + + public TimerInfoDto id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the Id of the recording. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public TimerInfoDto type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public TimerInfoDto serverId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + return this; + } + + /** + * Gets or sets the server identifier. + * + * @return serverId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerId() { + return serverId; + } + + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + } + + public TimerInfoDto externalId(@org.eclipse.jdt.annotation.NonNull String externalId) { + this.externalId = externalId; + return this; + } + + /** + * Gets or sets the external identifier. + * + * @return externalId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExternalId() { + return externalId; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalId(@org.eclipse.jdt.annotation.NonNull String externalId) { + this.externalId = externalId; + } + + public TimerInfoDto channelId(@org.eclipse.jdt.annotation.NonNull UUID channelId) { + this.channelId = channelId; + return this; + } + + /** + * Gets or sets the channel id of the recording. + * + * @return channelId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getChannelId() { + return channelId; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelId(@org.eclipse.jdt.annotation.NonNull UUID channelId) { + this.channelId = channelId; + } + + public TimerInfoDto externalChannelId(@org.eclipse.jdt.annotation.NonNull String externalChannelId) { + this.externalChannelId = externalChannelId; + return this; + } + + /** + * Gets or sets the external channel identifier. + * + * @return externalChannelId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExternalChannelId() { + return externalChannelId; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalChannelId(@org.eclipse.jdt.annotation.NonNull String externalChannelId) { + this.externalChannelId = externalChannelId; + } + + public TimerInfoDto channelName(@org.eclipse.jdt.annotation.NonNull String channelName) { + this.channelName = channelName; + return this; + } + + /** + * Gets or sets the channel name of the recording. + * + * @return channelName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelName() { + return channelName; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelName(@org.eclipse.jdt.annotation.NonNull String channelName) { + this.channelName = channelName; + } + + public TimerInfoDto channelPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String channelPrimaryImageTag) { + this.channelPrimaryImageTag = channelPrimaryImageTag; + return this; + } + + /** + * Get channelPrimaryImageTag + * + * @return channelPrimaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelPrimaryImageTag() { + return channelPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String channelPrimaryImageTag) { + this.channelPrimaryImageTag = channelPrimaryImageTag; + } + + public TimerInfoDto programId(@org.eclipse.jdt.annotation.NonNull String programId) { + this.programId = programId; + return this; + } + + /** + * Gets or sets the program identifier. + * + * @return programId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProgramId() { + return programId; + } + + @JsonProperty(JSON_PROPERTY_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgramId(@org.eclipse.jdt.annotation.NonNull String programId) { + this.programId = programId; + } + + public TimerInfoDto externalProgramId(@org.eclipse.jdt.annotation.NonNull String externalProgramId) { + this.externalProgramId = externalProgramId; + return this; + } + + /** + * Gets or sets the external program identifier. + * + * @return externalProgramId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExternalProgramId() { + return externalProgramId; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalProgramId(@org.eclipse.jdt.annotation.NonNull String externalProgramId) { + this.externalProgramId = externalProgramId; + } + + public TimerInfoDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name of the recording. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public TimerInfoDto overview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + return this; + } + + /** + * Gets or sets the description of the recording. + * + * @return overview + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOverview() { + return overview; + } + + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOverview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + } + + public TimerInfoDto startDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Gets or sets the start date of the recording, in UTC. + * + * @return startDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartDate() { + return startDate; + } + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + } + + public TimerInfoDto endDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Gets or sets the end date of the recording, in UTC. + * + * @return endDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndDate() { + return endDate; + } + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + } + + public TimerInfoDto serviceName(@org.eclipse.jdt.annotation.NonNull String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Gets or sets the name of the service. + * + * @return serviceName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServiceName() { + return serviceName; + } + + @JsonProperty(JSON_PROPERTY_SERVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServiceName(@org.eclipse.jdt.annotation.NonNull String serviceName) { + this.serviceName = serviceName; + } + + public TimerInfoDto priority(@org.eclipse.jdt.annotation.NonNull Integer priority) { + this.priority = priority; + return this; + } + + /** + * Gets or sets the priority. + * + * @return priority + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPriority() { + return priority; + } + + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPriority(@org.eclipse.jdt.annotation.NonNull Integer priority) { + this.priority = priority; + } + + public TimerInfoDto prePaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer prePaddingSeconds) { + this.prePaddingSeconds = prePaddingSeconds; + return this; + } + + /** + * Gets or sets the pre padding seconds. + * + * @return prePaddingSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRE_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrePaddingSeconds() { + return prePaddingSeconds; + } + + @JsonProperty(JSON_PROPERTY_PRE_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrePaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer prePaddingSeconds) { + this.prePaddingSeconds = prePaddingSeconds; + } + + public TimerInfoDto postPaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer postPaddingSeconds) { + this.postPaddingSeconds = postPaddingSeconds; + return this; + } + + /** + * Gets or sets the post padding seconds. + * + * @return postPaddingSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POST_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPostPaddingSeconds() { + return postPaddingSeconds; + } + + @JsonProperty(JSON_PROPERTY_POST_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPostPaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer postPaddingSeconds) { + this.postPaddingSeconds = postPaddingSeconds; + } + + public TimerInfoDto isPrePaddingRequired(@org.eclipse.jdt.annotation.NonNull Boolean isPrePaddingRequired) { + this.isPrePaddingRequired = isPrePaddingRequired; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is pre padding required. + * + * @return isPrePaddingRequired + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PRE_PADDING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPrePaddingRequired() { + return isPrePaddingRequired; + } + + @JsonProperty(JSON_PROPERTY_IS_PRE_PADDING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPrePaddingRequired(@org.eclipse.jdt.annotation.NonNull Boolean isPrePaddingRequired) { + this.isPrePaddingRequired = isPrePaddingRequired; + } + + public TimerInfoDto parentBackdropItemId(@org.eclipse.jdt.annotation.NonNull String parentBackdropItemId) { + this.parentBackdropItemId = parentBackdropItemId; + return this; + } + + /** + * Gets or sets the Id of the Parent that has a backdrop if the item does not have one. + * + * @return parentBackdropItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentBackdropItemId() { + return parentBackdropItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentBackdropItemId(@org.eclipse.jdt.annotation.NonNull String parentBackdropItemId) { + this.parentBackdropItemId = parentBackdropItemId; + } + + public TimerInfoDto parentBackdropImageTags( + @org.eclipse.jdt.annotation.NonNull List parentBackdropImageTags) { + this.parentBackdropImageTags = parentBackdropImageTags; + return this; + } + + public TimerInfoDto addParentBackdropImageTagsItem(String parentBackdropImageTagsItem) { + if (this.parentBackdropImageTags == null) { + this.parentBackdropImageTags = new ArrayList<>(); + } + this.parentBackdropImageTags.add(parentBackdropImageTagsItem); + return this; + } + + /** + * Gets or sets the parent backdrop image tags. + * + * @return parentBackdropImageTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getParentBackdropImageTags() { + return parentBackdropImageTags; + } + + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentBackdropImageTags(@org.eclipse.jdt.annotation.NonNull List parentBackdropImageTags) { + this.parentBackdropImageTags = parentBackdropImageTags; + } + + public TimerInfoDto isPostPaddingRequired(@org.eclipse.jdt.annotation.NonNull Boolean isPostPaddingRequired) { + this.isPostPaddingRequired = isPostPaddingRequired; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is post padding required. + * + * @return isPostPaddingRequired + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_POST_PADDING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPostPaddingRequired() { + return isPostPaddingRequired; + } + + @JsonProperty(JSON_PROPERTY_IS_POST_PADDING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPostPaddingRequired(@org.eclipse.jdt.annotation.NonNull Boolean isPostPaddingRequired) { + this.isPostPaddingRequired = isPostPaddingRequired; + } + + public TimerInfoDto keepUntil(@org.eclipse.jdt.annotation.NonNull KeepUntil keepUntil) { + this.keepUntil = keepUntil; + return this; + } + + /** + * Get keepUntil + * + * @return keepUntil + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KEEP_UNTIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public KeepUntil getKeepUntil() { + return keepUntil; + } + + @JsonProperty(JSON_PROPERTY_KEEP_UNTIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKeepUntil(@org.eclipse.jdt.annotation.NonNull KeepUntil keepUntil) { + this.keepUntil = keepUntil; + } + + public TimerInfoDto status(@org.eclipse.jdt.annotation.NonNull RecordingStatus status) { + this.status = status; + return this; + } + + /** + * Gets or sets the status. + * + * @return status + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RecordingStatus getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@org.eclipse.jdt.annotation.NonNull RecordingStatus status) { + this.status = status; + } + + public TimerInfoDto seriesTimerId(@org.eclipse.jdt.annotation.NonNull String seriesTimerId) { + this.seriesTimerId = seriesTimerId; + return this; + } + + /** + * Gets or sets the series timer identifier. + * + * @return seriesTimerId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesTimerId() { + return seriesTimerId; + } + + @JsonProperty(JSON_PROPERTY_SERIES_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesTimerId(@org.eclipse.jdt.annotation.NonNull String seriesTimerId) { + this.seriesTimerId = seriesTimerId; + } + + public TimerInfoDto externalSeriesTimerId(@org.eclipse.jdt.annotation.NonNull String externalSeriesTimerId) { + this.externalSeriesTimerId = externalSeriesTimerId; + return this; + } + + /** + * Gets or sets the external series timer identifier. + * + * @return externalSeriesTimerId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_SERIES_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExternalSeriesTimerId() { + return externalSeriesTimerId; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_SERIES_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalSeriesTimerId(@org.eclipse.jdt.annotation.NonNull String externalSeriesTimerId) { + this.externalSeriesTimerId = externalSeriesTimerId; + } + + public TimerInfoDto runTimeTicks(@org.eclipse.jdt.annotation.NonNull Long runTimeTicks) { + this.runTimeTicks = runTimeTicks; + return this; + } + + /** + * Gets or sets the run time ticks. + * + * @return runTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getRunTimeTicks() { + return runTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRunTimeTicks(@org.eclipse.jdt.annotation.NonNull Long runTimeTicks) { + this.runTimeTicks = runTimeTicks; + } + + public TimerInfoDto programInfo(@org.eclipse.jdt.annotation.NonNull BaseItemDto programInfo) { + this.programInfo = programInfo; + return this; + } + + /** + * Gets or sets the program information. + * + * @return programInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROGRAM_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemDto getProgramInfo() { + return programInfo; + } + + @JsonProperty(JSON_PROPERTY_PROGRAM_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgramInfo(@org.eclipse.jdt.annotation.NonNull BaseItemDto programInfo) { + this.programInfo = programInfo; + } + + /** + * Return true if this TimerInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimerInfoDto timerInfoDto = (TimerInfoDto) o; + return Objects.equals(this.id, timerInfoDto.id) && Objects.equals(this.type, timerInfoDto.type) + && Objects.equals(this.serverId, timerInfoDto.serverId) + && Objects.equals(this.externalId, timerInfoDto.externalId) + && Objects.equals(this.channelId, timerInfoDto.channelId) + && Objects.equals(this.externalChannelId, timerInfoDto.externalChannelId) + && Objects.equals(this.channelName, timerInfoDto.channelName) + && Objects.equals(this.channelPrimaryImageTag, timerInfoDto.channelPrimaryImageTag) + && Objects.equals(this.programId, timerInfoDto.programId) + && Objects.equals(this.externalProgramId, timerInfoDto.externalProgramId) + && Objects.equals(this.name, timerInfoDto.name) && Objects.equals(this.overview, timerInfoDto.overview) + && Objects.equals(this.startDate, timerInfoDto.startDate) + && Objects.equals(this.endDate, timerInfoDto.endDate) + && Objects.equals(this.serviceName, timerInfoDto.serviceName) + && Objects.equals(this.priority, timerInfoDto.priority) + && Objects.equals(this.prePaddingSeconds, timerInfoDto.prePaddingSeconds) + && Objects.equals(this.postPaddingSeconds, timerInfoDto.postPaddingSeconds) + && Objects.equals(this.isPrePaddingRequired, timerInfoDto.isPrePaddingRequired) + && Objects.equals(this.parentBackdropItemId, timerInfoDto.parentBackdropItemId) + && Objects.equals(this.parentBackdropImageTags, timerInfoDto.parentBackdropImageTags) + && Objects.equals(this.isPostPaddingRequired, timerInfoDto.isPostPaddingRequired) + && Objects.equals(this.keepUntil, timerInfoDto.keepUntil) + && Objects.equals(this.status, timerInfoDto.status) + && Objects.equals(this.seriesTimerId, timerInfoDto.seriesTimerId) + && Objects.equals(this.externalSeriesTimerId, timerInfoDto.externalSeriesTimerId) + && Objects.equals(this.runTimeTicks, timerInfoDto.runTimeTicks) + && Objects.equals(this.programInfo, timerInfoDto.programInfo); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, serverId, externalId, channelId, externalChannelId, channelName, + channelPrimaryImageTag, programId, externalProgramId, name, overview, startDate, endDate, serviceName, + priority, prePaddingSeconds, postPaddingSeconds, isPrePaddingRequired, parentBackdropItemId, + parentBackdropImageTags, isPostPaddingRequired, keepUntil, status, seriesTimerId, externalSeriesTimerId, + runTimeTicks, programInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimerInfoDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n"); + sb.append(" channelId: ").append(toIndentedString(channelId)).append("\n"); + sb.append(" externalChannelId: ").append(toIndentedString(externalChannelId)).append("\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" channelPrimaryImageTag: ").append(toIndentedString(channelPrimaryImageTag)).append("\n"); + sb.append(" programId: ").append(toIndentedString(programId)).append("\n"); + sb.append(" externalProgramId: ").append(toIndentedString(externalProgramId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" overview: ").append(toIndentedString(overview)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" serviceName: ").append(toIndentedString(serviceName)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" prePaddingSeconds: ").append(toIndentedString(prePaddingSeconds)).append("\n"); + sb.append(" postPaddingSeconds: ").append(toIndentedString(postPaddingSeconds)).append("\n"); + sb.append(" isPrePaddingRequired: ").append(toIndentedString(isPrePaddingRequired)).append("\n"); + sb.append(" parentBackdropItemId: ").append(toIndentedString(parentBackdropItemId)).append("\n"); + sb.append(" parentBackdropImageTags: ").append(toIndentedString(parentBackdropImageTags)).append("\n"); + sb.append(" isPostPaddingRequired: ").append(toIndentedString(isPostPaddingRequired)).append("\n"); + sb.append(" keepUntil: ").append(toIndentedString(keepUntil)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" seriesTimerId: ").append(toIndentedString(seriesTimerId)).append("\n"); + sb.append(" externalSeriesTimerId: ").append(toIndentedString(externalSeriesTimerId)).append("\n"); + sb.append(" runTimeTicks: ").append(toIndentedString(runTimeTicks)).append("\n"); + sb.append(" programInfo: ").append(toIndentedString(programInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `ServerId` to the URL query string + if (getServerId() != null) { + joiner.add(String.format("%sServerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerId())))); + } + + // add `ExternalId` to the URL query string + if (getExternalId() != null) { + joiner.add(String.format("%sExternalId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExternalId())))); + } + + // add `ChannelId` to the URL query string + if (getChannelId() != null) { + joiner.add(String.format("%sChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelId())))); + } + + // add `ExternalChannelId` to the URL query string + if (getExternalChannelId() != null) { + joiner.add(String.format("%sExternalChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExternalChannelId())))); + } + + // add `ChannelName` to the URL query string + if (getChannelName() != null) { + joiner.add(String.format("%sChannelName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelName())))); + } + + // add `ChannelPrimaryImageTag` to the URL query string + if (getChannelPrimaryImageTag() != null) { + joiner.add(String.format("%sChannelPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelPrimaryImageTag())))); + } + + // add `ProgramId` to the URL query string + if (getProgramId() != null) { + joiner.add(String.format("%sProgramId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProgramId())))); + } + + // add `ExternalProgramId` to the URL query string + if (getExternalProgramId() != null) { + joiner.add(String.format("%sExternalProgramId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExternalProgramId())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Overview` to the URL query string + if (getOverview() != null) { + joiner.add(String.format("%sOverview%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOverview())))); + } + + // add `StartDate` to the URL query string + if (getStartDate() != null) { + joiner.add(String.format("%sStartDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartDate())))); + } + + // add `EndDate` to the URL query string + if (getEndDate() != null) { + joiner.add(String.format("%sEndDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndDate())))); + } + + // add `ServiceName` to the URL query string + if (getServiceName() != null) { + joiner.add(String.format("%sServiceName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServiceName())))); + } + + // add `Priority` to the URL query string + if (getPriority() != null) { + joiner.add(String.format("%sPriority%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPriority())))); + } + + // add `PrePaddingSeconds` to the URL query string + if (getPrePaddingSeconds() != null) { + joiner.add(String.format("%sPrePaddingSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrePaddingSeconds())))); + } + + // add `PostPaddingSeconds` to the URL query string + if (getPostPaddingSeconds() != null) { + joiner.add(String.format("%sPostPaddingSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPostPaddingSeconds())))); + } + + // add `IsPrePaddingRequired` to the URL query string + if (getIsPrePaddingRequired() != null) { + joiner.add(String.format("%sIsPrePaddingRequired%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPrePaddingRequired())))); + } + + // add `ParentBackdropItemId` to the URL query string + if (getParentBackdropItemId() != null) { + joiner.add(String.format("%sParentBackdropItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentBackdropItemId())))); + } + + // add `ParentBackdropImageTags` to the URL query string + if (getParentBackdropImageTags() != null) { + for (int i = 0; i < getParentBackdropImageTags().size(); i++) { + joiner.add(String.format("%sParentBackdropImageTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getParentBackdropImageTags().get(i))))); + } + } + + // add `IsPostPaddingRequired` to the URL query string + if (getIsPostPaddingRequired() != null) { + joiner.add(String.format("%sIsPostPaddingRequired%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPostPaddingRequired())))); + } + + // add `KeepUntil` to the URL query string + if (getKeepUntil() != null) { + joiner.add(String.format("%sKeepUntil%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getKeepUntil())))); + } + + // add `Status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sStatus%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `SeriesTimerId` to the URL query string + if (getSeriesTimerId() != null) { + joiner.add(String.format("%sSeriesTimerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesTimerId())))); + } + + // add `ExternalSeriesTimerId` to the URL query string + if (getExternalSeriesTimerId() != null) { + joiner.add(String.format("%sExternalSeriesTimerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExternalSeriesTimerId())))); + } + + // add `RunTimeTicks` to the URL query string + if (getRunTimeTicks() != null) { + joiner.add(String.format("%sRunTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRunTimeTicks())))); + } + + // add `ProgramInfo` to the URL query string + if (getProgramInfo() != null) { + joiner.add(getProgramInfo().toUrlQueryString(prefix + "ProgramInfo" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private TimerInfoDto instance; + + public Builder() { + this(new TimerInfoDto()); + } + + protected Builder(TimerInfoDto instance) { + this.instance = instance; + } + + public TimerInfoDto.Builder id(String id) { + this.instance.id = id; + return this; + } + + public TimerInfoDto.Builder type(String type) { + this.instance.type = type; + return this; + } + + public TimerInfoDto.Builder serverId(String serverId) { + this.instance.serverId = serverId; + return this; + } + + public TimerInfoDto.Builder externalId(String externalId) { + this.instance.externalId = externalId; + return this; + } + + public TimerInfoDto.Builder channelId(UUID channelId) { + this.instance.channelId = channelId; + return this; + } + + public TimerInfoDto.Builder externalChannelId(String externalChannelId) { + this.instance.externalChannelId = externalChannelId; + return this; + } + + public TimerInfoDto.Builder channelName(String channelName) { + this.instance.channelName = channelName; + return this; + } + + public TimerInfoDto.Builder channelPrimaryImageTag(String channelPrimaryImageTag) { + this.instance.channelPrimaryImageTag = channelPrimaryImageTag; + return this; + } + + public TimerInfoDto.Builder programId(String programId) { + this.instance.programId = programId; + return this; + } + + public TimerInfoDto.Builder externalProgramId(String externalProgramId) { + this.instance.externalProgramId = externalProgramId; + return this; + } + + public TimerInfoDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public TimerInfoDto.Builder overview(String overview) { + this.instance.overview = overview; + return this; + } + + public TimerInfoDto.Builder startDate(OffsetDateTime startDate) { + this.instance.startDate = startDate; + return this; + } + + public TimerInfoDto.Builder endDate(OffsetDateTime endDate) { + this.instance.endDate = endDate; + return this; + } + + public TimerInfoDto.Builder serviceName(String serviceName) { + this.instance.serviceName = serviceName; + return this; + } + + public TimerInfoDto.Builder priority(Integer priority) { + this.instance.priority = priority; + return this; + } + + public TimerInfoDto.Builder prePaddingSeconds(Integer prePaddingSeconds) { + this.instance.prePaddingSeconds = prePaddingSeconds; + return this; + } + + public TimerInfoDto.Builder postPaddingSeconds(Integer postPaddingSeconds) { + this.instance.postPaddingSeconds = postPaddingSeconds; + return this; + } + + public TimerInfoDto.Builder isPrePaddingRequired(Boolean isPrePaddingRequired) { + this.instance.isPrePaddingRequired = isPrePaddingRequired; + return this; + } + + public TimerInfoDto.Builder parentBackdropItemId(String parentBackdropItemId) { + this.instance.parentBackdropItemId = parentBackdropItemId; + return this; + } + + public TimerInfoDto.Builder parentBackdropImageTags(List parentBackdropImageTags) { + this.instance.parentBackdropImageTags = parentBackdropImageTags; + return this; + } + + public TimerInfoDto.Builder isPostPaddingRequired(Boolean isPostPaddingRequired) { + this.instance.isPostPaddingRequired = isPostPaddingRequired; + return this; + } + + public TimerInfoDto.Builder keepUntil(KeepUntil keepUntil) { + this.instance.keepUntil = keepUntil; + return this; + } + + public TimerInfoDto.Builder status(RecordingStatus status) { + this.instance.status = status; + return this; + } + + public TimerInfoDto.Builder seriesTimerId(String seriesTimerId) { + this.instance.seriesTimerId = seriesTimerId; + return this; + } + + public TimerInfoDto.Builder externalSeriesTimerId(String externalSeriesTimerId) { + this.instance.externalSeriesTimerId = externalSeriesTimerId; + return this; + } + + public TimerInfoDto.Builder runTimeTicks(Long runTimeTicks) { + this.instance.runTimeTicks = runTimeTicks; + return this; + } + + public TimerInfoDto.Builder programInfo(BaseItemDto programInfo) { + this.instance.programInfo = programInfo; + return this; + } + + /** + * returns a built TimerInfoDto instance. + * + * The builder is not reusable. + */ + public TimerInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TimerInfoDto.Builder builder() { + return new TimerInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TimerInfoDto.Builder toBuilder() { + return new TimerInfoDto.Builder().id(getId()).type(getType()).serverId(getServerId()) + .externalId(getExternalId()).channelId(getChannelId()).externalChannelId(getExternalChannelId()) + .channelName(getChannelName()).channelPrimaryImageTag(getChannelPrimaryImageTag()) + .programId(getProgramId()).externalProgramId(getExternalProgramId()).name(getName()) + .overview(getOverview()).startDate(getStartDate()).endDate(getEndDate()).serviceName(getServiceName()) + .priority(getPriority()).prePaddingSeconds(getPrePaddingSeconds()) + .postPaddingSeconds(getPostPaddingSeconds()).isPrePaddingRequired(getIsPrePaddingRequired()) + .parentBackdropItemId(getParentBackdropItemId()).parentBackdropImageTags(getParentBackdropImageTags()) + .isPostPaddingRequired(getIsPostPaddingRequired()).keepUntil(getKeepUntil()).status(getStatus()) + .seriesTimerId(getSeriesTimerId()).externalSeriesTimerId(getExternalSeriesTimerId()) + .runTimeTicks(getRunTimeTicks()).programInfo(getProgramInfo()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerInfoDtoQueryResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerInfoDtoQueryResult.java new file mode 100644 index 0000000000000..533b058aaa1be --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TimerInfoDtoQueryResult.java @@ -0,0 +1,288 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Query result container. + */ +@JsonPropertyOrder({ TimerInfoDtoQueryResult.JSON_PROPERTY_ITEMS, + TimerInfoDtoQueryResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, TimerInfoDtoQueryResult.JSON_PROPERTY_START_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TimerInfoDtoQueryResult { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public TimerInfoDtoQueryResult() { + } + + public TimerInfoDtoQueryResult items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public TimerInfoDtoQueryResult addItemsItem(TimerInfoDto itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Gets or sets the items. + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public TimerInfoDtoQueryResult totalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total number of records available. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public TimerInfoDtoQueryResult startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the index of the first record in Items. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + /** + * Return true if this TimerInfoDtoQueryResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimerInfoDtoQueryResult timerInfoDtoQueryResult = (TimerInfoDtoQueryResult) o; + return Objects.equals(this.items, timerInfoDtoQueryResult.items) + && Objects.equals(this.totalRecordCount, timerInfoDtoQueryResult.totalRecordCount) + && Objects.equals(this.startIndex, timerInfoDtoQueryResult.startIndex); + } + + @Override + public int hashCode() { + return Objects.hash(items, totalRecordCount, startIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimerInfoDtoQueryResult {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TimerInfoDtoQueryResult instance; + + public Builder() { + this(new TimerInfoDtoQueryResult()); + } + + protected Builder(TimerInfoDtoQueryResult instance) { + this.instance = instance; + } + + public TimerInfoDtoQueryResult.Builder items(List items) { + this.instance.items = items; + return this; + } + + public TimerInfoDtoQueryResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public TimerInfoDtoQueryResult.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + /** + * returns a built TimerInfoDtoQueryResult instance. + * + * The builder is not reusable. + */ + public TimerInfoDtoQueryResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TimerInfoDtoQueryResult.Builder builder() { + return new TimerInfoDtoQueryResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TimerInfoDtoQueryResult.Builder toBuilder() { + return new TimerInfoDtoQueryResult.Builder().items(getItems()).totalRecordCount(getTotalRecordCount()) + .startIndex(getStartIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TonemappingAlgorithm.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TonemappingAlgorithm.java new file mode 100644 index 0000000000000..ec31d46235572 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TonemappingAlgorithm.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum containing tonemapping algorithms. + */ +public enum TonemappingAlgorithm { + + NONE("none"), + + CLIP("clip"), + + LINEAR("linear"), + + GAMMA("gamma"), + + REINHARD("reinhard"), + + HABLE("hable"), + + MOBIUS("mobius"), + + BT2390("bt2390"); + + private String value; + + TonemappingAlgorithm(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TonemappingAlgorithm fromValue(String value) { + for (TonemappingAlgorithm b : TonemappingAlgorithm.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TonemappingMode.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TonemappingMode.java new file mode 100644 index 0000000000000..8065d2b9f4584 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TonemappingMode.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum containing tonemapping modes. + */ +public enum TonemappingMode { + + AUTO("auto"), + + MAX("max"), + + RGB("rgb"), + + LUM("lum"), + + ITP("itp"); + + private String value; + + TonemappingMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TonemappingMode fromValue(String value) { + for (TonemappingMode b : TonemappingMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TonemappingRange.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TonemappingRange.java new file mode 100644 index 0000000000000..1d67034a11185 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TonemappingRange.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum containing tonemapping ranges. + */ +public enum TonemappingRange { + + AUTO("auto"), + + TV("tv"), + + PC("pc"); + + private String value; + + TonemappingRange(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TonemappingRange fromValue(String value) { + for (TonemappingRange b : TonemappingRange.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrailerInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrailerInfo.java new file mode 100644 index 0000000000000..5ad95dd6b4936 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrailerInfo.java @@ -0,0 +1,617 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TrailerInfo + */ +@JsonPropertyOrder({ TrailerInfo.JSON_PROPERTY_NAME, TrailerInfo.JSON_PROPERTY_ORIGINAL_TITLE, + TrailerInfo.JSON_PROPERTY_PATH, TrailerInfo.JSON_PROPERTY_METADATA_LANGUAGE, + TrailerInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, TrailerInfo.JSON_PROPERTY_PROVIDER_IDS, + TrailerInfo.JSON_PROPERTY_YEAR, TrailerInfo.JSON_PROPERTY_INDEX_NUMBER, + TrailerInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, TrailerInfo.JSON_PROPERTY_PREMIERE_DATE, + TrailerInfo.JSON_PROPERTY_IS_AUTOMATED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TrailerInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public TrailerInfo() { + } + + public TrailerInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public TrailerInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public TrailerInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public TrailerInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public TrailerInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public TrailerInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public TrailerInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public TrailerInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public TrailerInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public TrailerInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public TrailerInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public TrailerInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + /** + * Return true if this TrailerInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrailerInfo trailerInfo = (TrailerInfo) o; + return Objects.equals(this.name, trailerInfo.name) + && Objects.equals(this.originalTitle, trailerInfo.originalTitle) + && Objects.equals(this.path, trailerInfo.path) + && Objects.equals(this.metadataLanguage, trailerInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, trailerInfo.metadataCountryCode) + && Objects.equals(this.providerIds, trailerInfo.providerIds) + && Objects.equals(this.year, trailerInfo.year) + && Objects.equals(this.indexNumber, trailerInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, trailerInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, trailerInfo.premiereDate) + && Objects.equals(this.isAutomated, trailerInfo.isAutomated); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrailerInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TrailerInfo instance; + + public Builder() { + this(new TrailerInfo()); + } + + protected Builder(TrailerInfo instance) { + this.instance = instance; + } + + public TrailerInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public TrailerInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public TrailerInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public TrailerInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public TrailerInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public TrailerInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public TrailerInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public TrailerInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public TrailerInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public TrailerInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public TrailerInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + /** + * returns a built TrailerInfo instance. + * + * The builder is not reusable. + */ + public TrailerInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TrailerInfo.Builder builder() { + return new TrailerInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TrailerInfo.Builder toBuilder() { + return new TrailerInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()) + .isAutomated(getIsAutomated()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrailerInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrailerInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..77586acf5e625 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrailerInfoRemoteSearchQuery.java @@ -0,0 +1,318 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TrailerInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ TrailerInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + TrailerInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, + TrailerInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + TrailerInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TrailerInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private TrailerInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public TrailerInfoRemoteSearchQuery() { + } + + public TrailerInfoRemoteSearchQuery searchInfo(@org.eclipse.jdt.annotation.NonNull TrailerInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TrailerInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull TrailerInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public TrailerInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public TrailerInfoRemoteSearchQuery searchProviderName( + @org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public TrailerInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this TrailerInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrailerInfoRemoteSearchQuery trailerInfoRemoteSearchQuery = (TrailerInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, trailerInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, trailerInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, trailerInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, trailerInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrailerInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TrailerInfoRemoteSearchQuery instance; + + public Builder() { + this(new TrailerInfoRemoteSearchQuery()); + } + + protected Builder(TrailerInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public TrailerInfoRemoteSearchQuery.Builder searchInfo(TrailerInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public TrailerInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public TrailerInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public TrailerInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built TrailerInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public TrailerInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TrailerInfoRemoteSearchQuery.Builder builder() { + return new TrailerInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TrailerInfoRemoteSearchQuery.Builder toBuilder() { + return new TrailerInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TranscodeReason.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TranscodeReason.java new file mode 100644 index 0000000000000..c3ad70423ccf1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TranscodeReason.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets TranscodeReason + */ +public enum TranscodeReason { + + CONTAINER_NOT_SUPPORTED("ContainerNotSupported"), + + VIDEO_CODEC_NOT_SUPPORTED("VideoCodecNotSupported"), + + AUDIO_CODEC_NOT_SUPPORTED("AudioCodecNotSupported"), + + SUBTITLE_CODEC_NOT_SUPPORTED("SubtitleCodecNotSupported"), + + AUDIO_IS_EXTERNAL("AudioIsExternal"), + + SECONDARY_AUDIO_NOT_SUPPORTED("SecondaryAudioNotSupported"), + + VIDEO_PROFILE_NOT_SUPPORTED("VideoProfileNotSupported"), + + VIDEO_LEVEL_NOT_SUPPORTED("VideoLevelNotSupported"), + + VIDEO_RESOLUTION_NOT_SUPPORTED("VideoResolutionNotSupported"), + + VIDEO_BIT_DEPTH_NOT_SUPPORTED("VideoBitDepthNotSupported"), + + VIDEO_FRAMERATE_NOT_SUPPORTED("VideoFramerateNotSupported"), + + REF_FRAMES_NOT_SUPPORTED("RefFramesNotSupported"), + + ANAMORPHIC_VIDEO_NOT_SUPPORTED("AnamorphicVideoNotSupported"), + + INTERLACED_VIDEO_NOT_SUPPORTED("InterlacedVideoNotSupported"), + + AUDIO_CHANNELS_NOT_SUPPORTED("AudioChannelsNotSupported"), + + AUDIO_PROFILE_NOT_SUPPORTED("AudioProfileNotSupported"), + + AUDIO_SAMPLE_RATE_NOT_SUPPORTED("AudioSampleRateNotSupported"), + + AUDIO_BIT_DEPTH_NOT_SUPPORTED("AudioBitDepthNotSupported"), + + CONTAINER_BITRATE_EXCEEDS_LIMIT("ContainerBitrateExceedsLimit"), + + VIDEO_BITRATE_NOT_SUPPORTED("VideoBitrateNotSupported"), + + AUDIO_BITRATE_NOT_SUPPORTED("AudioBitrateNotSupported"), + + UNKNOWN_VIDEO_STREAM_INFO("UnknownVideoStreamInfo"), + + UNKNOWN_AUDIO_STREAM_INFO("UnknownAudioStreamInfo"), + + DIRECT_PLAY_ERROR("DirectPlayError"), + + VIDEO_RANGE_TYPE_NOT_SUPPORTED("VideoRangeTypeNotSupported"), + + VIDEO_CODEC_TAG_NOT_SUPPORTED("VideoCodecTagNotSupported"); + + private String value; + + TranscodeReason(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TranscodeReason fromValue(String value) { + for (TranscodeReason b : TranscodeReason.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TranscodeSeekInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TranscodeSeekInfo.java new file mode 100644 index 0000000000000..5414fb303656d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TranscodeSeekInfo.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets TranscodeSeekInfo + */ +public enum TranscodeSeekInfo { + + AUTO("Auto"), + + BYTES("Bytes"); + + private String value; + + TranscodeSeekInfo(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TranscodeSeekInfo fromValue(String value) { + for (TranscodeSeekInfo b : TranscodeSeekInfo.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TranscodingInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TranscodingInfo.java new file mode 100644 index 0000000000000..b71464088b733 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TranscodingInfo.java @@ -0,0 +1,701 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class holding information on a runnning transcode. + */ +@JsonPropertyOrder({ TranscodingInfo.JSON_PROPERTY_AUDIO_CODEC, TranscodingInfo.JSON_PROPERTY_VIDEO_CODEC, + TranscodingInfo.JSON_PROPERTY_CONTAINER, TranscodingInfo.JSON_PROPERTY_IS_VIDEO_DIRECT, + TranscodingInfo.JSON_PROPERTY_IS_AUDIO_DIRECT, TranscodingInfo.JSON_PROPERTY_BITRATE, + TranscodingInfo.JSON_PROPERTY_FRAMERATE, TranscodingInfo.JSON_PROPERTY_COMPLETION_PERCENTAGE, + TranscodingInfo.JSON_PROPERTY_WIDTH, TranscodingInfo.JSON_PROPERTY_HEIGHT, + TranscodingInfo.JSON_PROPERTY_AUDIO_CHANNELS, TranscodingInfo.JSON_PROPERTY_HARDWARE_ACCELERATION_TYPE, + TranscodingInfo.JSON_PROPERTY_TRANSCODE_REASONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TranscodingInfo { + public static final String JSON_PROPERTY_AUDIO_CODEC = "AudioCodec"; + @org.eclipse.jdt.annotation.NonNull + private String audioCodec; + + public static final String JSON_PROPERTY_VIDEO_CODEC = "VideoCodec"; + @org.eclipse.jdt.annotation.NonNull + private String videoCodec; + + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public static final String JSON_PROPERTY_IS_VIDEO_DIRECT = "IsVideoDirect"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isVideoDirect; + + public static final String JSON_PROPERTY_IS_AUDIO_DIRECT = "IsAudioDirect"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAudioDirect; + + public static final String JSON_PROPERTY_BITRATE = "Bitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer bitrate; + + public static final String JSON_PROPERTY_FRAMERATE = "Framerate"; + @org.eclipse.jdt.annotation.NonNull + private Float framerate; + + public static final String JSON_PROPERTY_COMPLETION_PERCENTAGE = "CompletionPercentage"; + @org.eclipse.jdt.annotation.NonNull + private Double completionPercentage; + + public static final String JSON_PROPERTY_WIDTH = "Width"; + @org.eclipse.jdt.annotation.NonNull + private Integer width; + + public static final String JSON_PROPERTY_HEIGHT = "Height"; + @org.eclipse.jdt.annotation.NonNull + private Integer height; + + public static final String JSON_PROPERTY_AUDIO_CHANNELS = "AudioChannels"; + @org.eclipse.jdt.annotation.NonNull + private Integer audioChannels; + + public static final String JSON_PROPERTY_HARDWARE_ACCELERATION_TYPE = "HardwareAccelerationType"; + @org.eclipse.jdt.annotation.NonNull + private HardwareAccelerationType hardwareAccelerationType; + + public static final String JSON_PROPERTY_TRANSCODE_REASONS = "TranscodeReasons"; + @org.eclipse.jdt.annotation.NonNull + private List transcodeReasons = new ArrayList<>(); + + public TranscodingInfo() { + } + + public TranscodingInfo audioCodec(@org.eclipse.jdt.annotation.NonNull String audioCodec) { + this.audioCodec = audioCodec; + return this; + } + + /** + * Gets or sets the thread count used for encoding. + * + * @return audioCodec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAudioCodec() { + return audioCodec; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioCodec(@org.eclipse.jdt.annotation.NonNull String audioCodec) { + this.audioCodec = audioCodec; + } + + public TranscodingInfo videoCodec(@org.eclipse.jdt.annotation.NonNull String videoCodec) { + this.videoCodec = videoCodec; + return this; + } + + /** + * Gets or sets the thread count used for encoding. + * + * @return videoCodec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVideoCodec() { + return videoCodec; + } + + @JsonProperty(JSON_PROPERTY_VIDEO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVideoCodec(@org.eclipse.jdt.annotation.NonNull String videoCodec) { + this.videoCodec = videoCodec; + } + + public TranscodingInfo container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Gets or sets the thread count used for encoding. + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + public TranscodingInfo isVideoDirect(@org.eclipse.jdt.annotation.NonNull Boolean isVideoDirect) { + this.isVideoDirect = isVideoDirect; + return this; + } + + /** + * Gets or sets a value indicating whether the video is passed through. + * + * @return isVideoDirect + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_VIDEO_DIRECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsVideoDirect() { + return isVideoDirect; + } + + @JsonProperty(JSON_PROPERTY_IS_VIDEO_DIRECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsVideoDirect(@org.eclipse.jdt.annotation.NonNull Boolean isVideoDirect) { + this.isVideoDirect = isVideoDirect; + } + + public TranscodingInfo isAudioDirect(@org.eclipse.jdt.annotation.NonNull Boolean isAudioDirect) { + this.isAudioDirect = isAudioDirect; + return this; + } + + /** + * Gets or sets a value indicating whether the audio is passed through. + * + * @return isAudioDirect + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUDIO_DIRECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAudioDirect() { + return isAudioDirect; + } + + @JsonProperty(JSON_PROPERTY_IS_AUDIO_DIRECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAudioDirect(@org.eclipse.jdt.annotation.NonNull Boolean isAudioDirect) { + this.isAudioDirect = isAudioDirect; + } + + public TranscodingInfo bitrate(@org.eclipse.jdt.annotation.NonNull Integer bitrate) { + this.bitrate = bitrate; + return this; + } + + /** + * Gets or sets the bitrate. + * + * @return bitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBitrate() { + return bitrate; + } + + @JsonProperty(JSON_PROPERTY_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBitrate(@org.eclipse.jdt.annotation.NonNull Integer bitrate) { + this.bitrate = bitrate; + } + + public TranscodingInfo framerate(@org.eclipse.jdt.annotation.NonNull Float framerate) { + this.framerate = framerate; + return this; + } + + /** + * Gets or sets the framerate. + * + * @return framerate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FRAMERATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFramerate() { + return framerate; + } + + @JsonProperty(JSON_PROPERTY_FRAMERATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFramerate(@org.eclipse.jdt.annotation.NonNull Float framerate) { + this.framerate = framerate; + } + + public TranscodingInfo completionPercentage(@org.eclipse.jdt.annotation.NonNull Double completionPercentage) { + this.completionPercentage = completionPercentage; + return this; + } + + /** + * Gets or sets the completion percentage. + * + * @return completionPercentage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMPLETION_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getCompletionPercentage() { + return completionPercentage; + } + + @JsonProperty(JSON_PROPERTY_COMPLETION_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompletionPercentage(@org.eclipse.jdt.annotation.NonNull Double completionPercentage) { + this.completionPercentage = completionPercentage; + } + + public TranscodingInfo width(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + return this; + } + + /** + * Gets or sets the video width. + * + * @return width + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + } + + public TranscodingInfo height(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + return this; + } + + /** + * Gets or sets the video height. + * + * @return height + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHeight() { + return height; + } + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + } + + public TranscodingInfo audioChannels(@org.eclipse.jdt.annotation.NonNull Integer audioChannels) { + this.audioChannels = audioChannels; + return this; + } + + /** + * Gets or sets the audio channels. + * + * @return audioChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAudioChannels() { + return audioChannels; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioChannels(@org.eclipse.jdt.annotation.NonNull Integer audioChannels) { + this.audioChannels = audioChannels; + } + + public TranscodingInfo hardwareAccelerationType( + @org.eclipse.jdt.annotation.NonNull HardwareAccelerationType hardwareAccelerationType) { + this.hardwareAccelerationType = hardwareAccelerationType; + return this; + } + + /** + * Gets or sets the hardware acceleration type. + * + * @return hardwareAccelerationType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HARDWARE_ACCELERATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public HardwareAccelerationType getHardwareAccelerationType() { + return hardwareAccelerationType; + } + + @JsonProperty(JSON_PROPERTY_HARDWARE_ACCELERATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHardwareAccelerationType( + @org.eclipse.jdt.annotation.NonNull HardwareAccelerationType hardwareAccelerationType) { + this.hardwareAccelerationType = hardwareAccelerationType; + } + + public TranscodingInfo transcodeReasons( + @org.eclipse.jdt.annotation.NonNull List transcodeReasons) { + this.transcodeReasons = transcodeReasons; + return this; + } + + public TranscodingInfo addTranscodeReasonsItem(TranscodeReason transcodeReasonsItem) { + if (this.transcodeReasons == null) { + this.transcodeReasons = new ArrayList<>(); + } + this.transcodeReasons.add(transcodeReasonsItem); + return this; + } + + /** + * Gets or sets the transcode reasons. + * + * @return transcodeReasons + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODE_REASONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTranscodeReasons() { + return transcodeReasons; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODE_REASONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodeReasons(@org.eclipse.jdt.annotation.NonNull List transcodeReasons) { + this.transcodeReasons = transcodeReasons; + } + + /** + * Return true if this TranscodingInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TranscodingInfo transcodingInfo = (TranscodingInfo) o; + return Objects.equals(this.audioCodec, transcodingInfo.audioCodec) + && Objects.equals(this.videoCodec, transcodingInfo.videoCodec) + && Objects.equals(this.container, transcodingInfo.container) + && Objects.equals(this.isVideoDirect, transcodingInfo.isVideoDirect) + && Objects.equals(this.isAudioDirect, transcodingInfo.isAudioDirect) + && Objects.equals(this.bitrate, transcodingInfo.bitrate) + && Objects.equals(this.framerate, transcodingInfo.framerate) + && Objects.equals(this.completionPercentage, transcodingInfo.completionPercentage) + && Objects.equals(this.width, transcodingInfo.width) + && Objects.equals(this.height, transcodingInfo.height) + && Objects.equals(this.audioChannels, transcodingInfo.audioChannels) + && Objects.equals(this.hardwareAccelerationType, transcodingInfo.hardwareAccelerationType) + && Objects.equals(this.transcodeReasons, transcodingInfo.transcodeReasons); + } + + @Override + public int hashCode() { + return Objects.hash(audioCodec, videoCodec, container, isVideoDirect, isAudioDirect, bitrate, framerate, + completionPercentage, width, height, audioChannels, hardwareAccelerationType, transcodeReasons); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TranscodingInfo {\n"); + sb.append(" audioCodec: ").append(toIndentedString(audioCodec)).append("\n"); + sb.append(" videoCodec: ").append(toIndentedString(videoCodec)).append("\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" isVideoDirect: ").append(toIndentedString(isVideoDirect)).append("\n"); + sb.append(" isAudioDirect: ").append(toIndentedString(isAudioDirect)).append("\n"); + sb.append(" bitrate: ").append(toIndentedString(bitrate)).append("\n"); + sb.append(" framerate: ").append(toIndentedString(framerate)).append("\n"); + sb.append(" completionPercentage: ").append(toIndentedString(completionPercentage)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" audioChannels: ").append(toIndentedString(audioChannels)).append("\n"); + sb.append(" hardwareAccelerationType: ").append(toIndentedString(hardwareAccelerationType)).append("\n"); + sb.append(" transcodeReasons: ").append(toIndentedString(transcodeReasons)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `AudioCodec` to the URL query string + if (getAudioCodec() != null) { + joiner.add(String.format("%sAudioCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioCodec())))); + } + + // add `VideoCodec` to the URL query string + if (getVideoCodec() != null) { + joiner.add(String.format("%sVideoCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoCodec())))); + } + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + // add `IsVideoDirect` to the URL query string + if (getIsVideoDirect() != null) { + joiner.add(String.format("%sIsVideoDirect%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsVideoDirect())))); + } + + // add `IsAudioDirect` to the URL query string + if (getIsAudioDirect() != null) { + joiner.add(String.format("%sIsAudioDirect%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAudioDirect())))); + } + + // add `Bitrate` to the URL query string + if (getBitrate() != null) { + joiner.add(String.format("%sBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBitrate())))); + } + + // add `Framerate` to the URL query string + if (getFramerate() != null) { + joiner.add(String.format("%sFramerate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFramerate())))); + } + + // add `CompletionPercentage` to the URL query string + if (getCompletionPercentage() != null) { + joiner.add(String.format("%sCompletionPercentage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCompletionPercentage())))); + } + + // add `Width` to the URL query string + if (getWidth() != null) { + joiner.add(String.format("%sWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWidth())))); + } + + // add `Height` to the URL query string + if (getHeight() != null) { + joiner.add(String.format("%sHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHeight())))); + } + + // add `AudioChannels` to the URL query string + if (getAudioChannels() != null) { + joiner.add(String.format("%sAudioChannels%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioChannels())))); + } + + // add `HardwareAccelerationType` to the URL query string + if (getHardwareAccelerationType() != null) { + joiner.add(String.format("%sHardwareAccelerationType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHardwareAccelerationType())))); + } + + // add `TranscodeReasons` to the URL query string + if (getTranscodeReasons() != null) { + for (int i = 0; i < getTranscodeReasons().size(); i++) { + if (getTranscodeReasons().get(i) != null) { + joiner.add(String.format("%sTranscodeReasons%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getTranscodeReasons().get(i))))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private TranscodingInfo instance; + + public Builder() { + this(new TranscodingInfo()); + } + + protected Builder(TranscodingInfo instance) { + this.instance = instance; + } + + public TranscodingInfo.Builder audioCodec(String audioCodec) { + this.instance.audioCodec = audioCodec; + return this; + } + + public TranscodingInfo.Builder videoCodec(String videoCodec) { + this.instance.videoCodec = videoCodec; + return this; + } + + public TranscodingInfo.Builder container(String container) { + this.instance.container = container; + return this; + } + + public TranscodingInfo.Builder isVideoDirect(Boolean isVideoDirect) { + this.instance.isVideoDirect = isVideoDirect; + return this; + } + + public TranscodingInfo.Builder isAudioDirect(Boolean isAudioDirect) { + this.instance.isAudioDirect = isAudioDirect; + return this; + } + + public TranscodingInfo.Builder bitrate(Integer bitrate) { + this.instance.bitrate = bitrate; + return this; + } + + public TranscodingInfo.Builder framerate(Float framerate) { + this.instance.framerate = framerate; + return this; + } + + public TranscodingInfo.Builder completionPercentage(Double completionPercentage) { + this.instance.completionPercentage = completionPercentage; + return this; + } + + public TranscodingInfo.Builder width(Integer width) { + this.instance.width = width; + return this; + } + + public TranscodingInfo.Builder height(Integer height) { + this.instance.height = height; + return this; + } + + public TranscodingInfo.Builder audioChannels(Integer audioChannels) { + this.instance.audioChannels = audioChannels; + return this; + } + + public TranscodingInfo.Builder hardwareAccelerationType(HardwareAccelerationType hardwareAccelerationType) { + this.instance.hardwareAccelerationType = hardwareAccelerationType; + return this; + } + + public TranscodingInfo.Builder transcodeReasons(List transcodeReasons) { + this.instance.transcodeReasons = transcodeReasons; + return this; + } + + /** + * returns a built TranscodingInfo instance. + * + * The builder is not reusable. + */ + public TranscodingInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TranscodingInfo.Builder builder() { + return new TranscodingInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TranscodingInfo.Builder toBuilder() { + return new TranscodingInfo.Builder().audioCodec(getAudioCodec()).videoCodec(getVideoCodec()) + .container(getContainer()).isVideoDirect(getIsVideoDirect()).isAudioDirect(getIsAudioDirect()) + .bitrate(getBitrate()).framerate(getFramerate()).completionPercentage(getCompletionPercentage()) + .width(getWidth()).height(getHeight()).audioChannels(getAudioChannels()) + .hardwareAccelerationType(getHardwareAccelerationType()).transcodeReasons(getTranscodeReasons()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TranscodingProfile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TranscodingProfile.java new file mode 100644 index 0000000000000..5379da828053f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TranscodingProfile.java @@ -0,0 +1,867 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * A class for transcoding profile information. Note for client developers: Conditions defined in + * MediaBrowser.Model.Dlna.CodecProfile has higher priority and can override values defined here. + */ +@JsonPropertyOrder({ TranscodingProfile.JSON_PROPERTY_CONTAINER, TranscodingProfile.JSON_PROPERTY_TYPE, + TranscodingProfile.JSON_PROPERTY_VIDEO_CODEC, TranscodingProfile.JSON_PROPERTY_AUDIO_CODEC, + TranscodingProfile.JSON_PROPERTY_PROTOCOL, TranscodingProfile.JSON_PROPERTY_ESTIMATE_CONTENT_LENGTH, + TranscodingProfile.JSON_PROPERTY_ENABLE_MPEGTS_M2_TS_MODE, TranscodingProfile.JSON_PROPERTY_TRANSCODE_SEEK_INFO, + TranscodingProfile.JSON_PROPERTY_COPY_TIMESTAMPS, TranscodingProfile.JSON_PROPERTY_CONTEXT, + TranscodingProfile.JSON_PROPERTY_ENABLE_SUBTITLES_IN_MANIFEST, + TranscodingProfile.JSON_PROPERTY_MAX_AUDIO_CHANNELS, TranscodingProfile.JSON_PROPERTY_MIN_SEGMENTS, + TranscodingProfile.JSON_PROPERTY_SEGMENT_LENGTH, TranscodingProfile.JSON_PROPERTY_BREAK_ON_NON_KEY_FRAMES, + TranscodingProfile.JSON_PROPERTY_CONDITIONS, TranscodingProfile.JSON_PROPERTY_ENABLE_AUDIO_VBR_ENCODING }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TranscodingProfile { + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private DlnaProfileType type; + + public static final String JSON_PROPERTY_VIDEO_CODEC = "VideoCodec"; + @org.eclipse.jdt.annotation.NonNull + private String videoCodec; + + public static final String JSON_PROPERTY_AUDIO_CODEC = "AudioCodec"; + @org.eclipse.jdt.annotation.NonNull + private String audioCodec; + + public static final String JSON_PROPERTY_PROTOCOL = "Protocol"; + @org.eclipse.jdt.annotation.NonNull + private MediaStreamProtocol protocol; + + public static final String JSON_PROPERTY_ESTIMATE_CONTENT_LENGTH = "EstimateContentLength"; + @org.eclipse.jdt.annotation.NonNull + private Boolean estimateContentLength = false; + + public static final String JSON_PROPERTY_ENABLE_MPEGTS_M2_TS_MODE = "EnableMpegtsM2TsMode"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableMpegtsM2TsMode = false; + + public static final String JSON_PROPERTY_TRANSCODE_SEEK_INFO = "TranscodeSeekInfo"; + @org.eclipse.jdt.annotation.NonNull + private TranscodeSeekInfo transcodeSeekInfo = TranscodeSeekInfo.AUTO; + + public static final String JSON_PROPERTY_COPY_TIMESTAMPS = "CopyTimestamps"; + @org.eclipse.jdt.annotation.NonNull + private Boolean copyTimestamps = false; + + public static final String JSON_PROPERTY_CONTEXT = "Context"; + @org.eclipse.jdt.annotation.NonNull + private EncodingContext context = EncodingContext.STREAMING; + + public static final String JSON_PROPERTY_ENABLE_SUBTITLES_IN_MANIFEST = "EnableSubtitlesInManifest"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableSubtitlesInManifest = false; + + public static final String JSON_PROPERTY_MAX_AUDIO_CHANNELS = "MaxAudioChannels"; + @org.eclipse.jdt.annotation.NonNull + private String maxAudioChannels; + + public static final String JSON_PROPERTY_MIN_SEGMENTS = "MinSegments"; + @org.eclipse.jdt.annotation.NonNull + private Integer minSegments = 0; + + public static final String JSON_PROPERTY_SEGMENT_LENGTH = "SegmentLength"; + @org.eclipse.jdt.annotation.NonNull + private Integer segmentLength = 0; + + public static final String JSON_PROPERTY_BREAK_ON_NON_KEY_FRAMES = "BreakOnNonKeyFrames"; + @org.eclipse.jdt.annotation.NonNull + private Boolean breakOnNonKeyFrames = false; + + public static final String JSON_PROPERTY_CONDITIONS = "Conditions"; + @org.eclipse.jdt.annotation.NonNull + private List conditions = new ArrayList<>(); + + public static final String JSON_PROPERTY_ENABLE_AUDIO_VBR_ENCODING = "EnableAudioVbrEncoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAudioVbrEncoding = true; + + public TranscodingProfile() { + } + + public TranscodingProfile container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Gets or sets the container. + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + public TranscodingProfile type(@org.eclipse.jdt.annotation.NonNull DlnaProfileType type) { + this.type = type; + return this; + } + + /** + * Gets or sets the DLNA profile type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DlnaProfileType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull DlnaProfileType type) { + this.type = type; + } + + public TranscodingProfile videoCodec(@org.eclipse.jdt.annotation.NonNull String videoCodec) { + this.videoCodec = videoCodec; + return this; + } + + /** + * Gets or sets the video codec. + * + * @return videoCodec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVideoCodec() { + return videoCodec; + } + + @JsonProperty(JSON_PROPERTY_VIDEO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVideoCodec(@org.eclipse.jdt.annotation.NonNull String videoCodec) { + this.videoCodec = videoCodec; + } + + public TranscodingProfile audioCodec(@org.eclipse.jdt.annotation.NonNull String audioCodec) { + this.audioCodec = audioCodec; + return this; + } + + /** + * Gets or sets the audio codec. + * + * @return audioCodec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAudioCodec() { + return audioCodec; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioCodec(@org.eclipse.jdt.annotation.NonNull String audioCodec) { + this.audioCodec = audioCodec; + } + + public TranscodingProfile protocol(@org.eclipse.jdt.annotation.NonNull MediaStreamProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Gets or sets the protocol. + * + * @return protocol + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaStreamProtocol getProtocol() { + return protocol; + } + + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtocol(@org.eclipse.jdt.annotation.NonNull MediaStreamProtocol protocol) { + this.protocol = protocol; + } + + public TranscodingProfile estimateContentLength(@org.eclipse.jdt.annotation.NonNull Boolean estimateContentLength) { + this.estimateContentLength = estimateContentLength; + return this; + } + + /** + * Gets or sets a value indicating whether the content length should be estimated. + * + * @return estimateContentLength + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ESTIMATE_CONTENT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEstimateContentLength() { + return estimateContentLength; + } + + @JsonProperty(JSON_PROPERTY_ESTIMATE_CONTENT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEstimateContentLength(@org.eclipse.jdt.annotation.NonNull Boolean estimateContentLength) { + this.estimateContentLength = estimateContentLength; + } + + public TranscodingProfile enableMpegtsM2TsMode(@org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode) { + this.enableMpegtsM2TsMode = enableMpegtsM2TsMode; + return this; + } + + /** + * Gets or sets a value indicating whether M2TS mode is enabled. + * + * @return enableMpegtsM2TsMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_MPEGTS_M2_TS_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableMpegtsM2TsMode() { + return enableMpegtsM2TsMode; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_MPEGTS_M2_TS_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableMpegtsM2TsMode(@org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode) { + this.enableMpegtsM2TsMode = enableMpegtsM2TsMode; + } + + public TranscodingProfile transcodeSeekInfo( + @org.eclipse.jdt.annotation.NonNull TranscodeSeekInfo transcodeSeekInfo) { + this.transcodeSeekInfo = transcodeSeekInfo; + return this; + } + + /** + * Gets or sets the transcoding seek info mode. + * + * @return transcodeSeekInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODE_SEEK_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TranscodeSeekInfo getTranscodeSeekInfo() { + return transcodeSeekInfo; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODE_SEEK_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodeSeekInfo(@org.eclipse.jdt.annotation.NonNull TranscodeSeekInfo transcodeSeekInfo) { + this.transcodeSeekInfo = transcodeSeekInfo; + } + + public TranscodingProfile copyTimestamps(@org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps) { + this.copyTimestamps = copyTimestamps; + return this; + } + + /** + * Gets or sets a value indicating whether timestamps should be copied. + * + * @return copyTimestamps + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COPY_TIMESTAMPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCopyTimestamps() { + return copyTimestamps; + } + + @JsonProperty(JSON_PROPERTY_COPY_TIMESTAMPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCopyTimestamps(@org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps) { + this.copyTimestamps = copyTimestamps; + } + + public TranscodingProfile context(@org.eclipse.jdt.annotation.NonNull EncodingContext context) { + this.context = context; + return this; + } + + /** + * Gets or sets the encoding context. + * + * @return context + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EncodingContext getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@org.eclipse.jdt.annotation.NonNull EncodingContext context) { + this.context = context; + } + + public TranscodingProfile enableSubtitlesInManifest( + @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest) { + this.enableSubtitlesInManifest = enableSubtitlesInManifest; + return this; + } + + /** + * Gets or sets a value indicating whether subtitles are allowed in the manifest. + * + * @return enableSubtitlesInManifest + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_SUBTITLES_IN_MANIFEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableSubtitlesInManifest() { + return enableSubtitlesInManifest; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_SUBTITLES_IN_MANIFEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableSubtitlesInManifest(@org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest) { + this.enableSubtitlesInManifest = enableSubtitlesInManifest; + } + + public TranscodingProfile maxAudioChannels(@org.eclipse.jdt.annotation.NonNull String maxAudioChannels) { + this.maxAudioChannels = maxAudioChannels; + return this; + } + + /** + * Gets or sets the maximum audio channels. + * + * @return maxAudioChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_AUDIO_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMaxAudioChannels() { + return maxAudioChannels; + } + + @JsonProperty(JSON_PROPERTY_MAX_AUDIO_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxAudioChannels(@org.eclipse.jdt.annotation.NonNull String maxAudioChannels) { + this.maxAudioChannels = maxAudioChannels; + } + + public TranscodingProfile minSegments(@org.eclipse.jdt.annotation.NonNull Integer minSegments) { + this.minSegments = minSegments; + return this; + } + + /** + * Gets or sets the minimum amount of segments. + * + * @return minSegments + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIN_SEGMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMinSegments() { + return minSegments; + } + + @JsonProperty(JSON_PROPERTY_MIN_SEGMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinSegments(@org.eclipse.jdt.annotation.NonNull Integer minSegments) { + this.minSegments = minSegments; + } + + public TranscodingProfile segmentLength(@org.eclipse.jdt.annotation.NonNull Integer segmentLength) { + this.segmentLength = segmentLength; + return this; + } + + /** + * Gets or sets the segment length. + * + * @return segmentLength + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEGMENT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSegmentLength() { + return segmentLength; + } + + @JsonProperty(JSON_PROPERTY_SEGMENT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSegmentLength(@org.eclipse.jdt.annotation.NonNull Integer segmentLength) { + this.segmentLength = segmentLength; + } + + public TranscodingProfile breakOnNonKeyFrames(@org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames) { + this.breakOnNonKeyFrames = breakOnNonKeyFrames; + return this; + } + + /** + * Gets or sets a value indicating whether breaking the video stream on non-keyframes is supported. + * + * @return breakOnNonKeyFrames + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BREAK_ON_NON_KEY_FRAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getBreakOnNonKeyFrames() { + return breakOnNonKeyFrames; + } + + @JsonProperty(JSON_PROPERTY_BREAK_ON_NON_KEY_FRAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBreakOnNonKeyFrames(@org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames) { + this.breakOnNonKeyFrames = breakOnNonKeyFrames; + } + + public TranscodingProfile conditions(@org.eclipse.jdt.annotation.NonNull List conditions) { + this.conditions = conditions; + return this; + } + + public TranscodingProfile addConditionsItem(ProfileCondition conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * Gets or sets the profile conditions. + * + * @return conditions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getConditions() { + return conditions; + } + + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConditions(@org.eclipse.jdt.annotation.NonNull List conditions) { + this.conditions = conditions; + } + + public TranscodingProfile enableAudioVbrEncoding( + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) { + this.enableAudioVbrEncoding = enableAudioVbrEncoding; + return this; + } + + /** + * Gets or sets a value indicating whether variable bitrate encoding is supported. + * + * @return enableAudioVbrEncoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_AUDIO_VBR_ENCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAudioVbrEncoding() { + return enableAudioVbrEncoding; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_AUDIO_VBR_ENCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAudioVbrEncoding(@org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) { + this.enableAudioVbrEncoding = enableAudioVbrEncoding; + } + + /** + * Return true if this TranscodingProfile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TranscodingProfile transcodingProfile = (TranscodingProfile) o; + return Objects.equals(this.container, transcodingProfile.container) + && Objects.equals(this.type, transcodingProfile.type) + && Objects.equals(this.videoCodec, transcodingProfile.videoCodec) + && Objects.equals(this.audioCodec, transcodingProfile.audioCodec) + && Objects.equals(this.protocol, transcodingProfile.protocol) + && Objects.equals(this.estimateContentLength, transcodingProfile.estimateContentLength) + && Objects.equals(this.enableMpegtsM2TsMode, transcodingProfile.enableMpegtsM2TsMode) + && Objects.equals(this.transcodeSeekInfo, transcodingProfile.transcodeSeekInfo) + && Objects.equals(this.copyTimestamps, transcodingProfile.copyTimestamps) + && Objects.equals(this.context, transcodingProfile.context) + && Objects.equals(this.enableSubtitlesInManifest, transcodingProfile.enableSubtitlesInManifest) + && Objects.equals(this.maxAudioChannels, transcodingProfile.maxAudioChannels) + && Objects.equals(this.minSegments, transcodingProfile.minSegments) + && Objects.equals(this.segmentLength, transcodingProfile.segmentLength) + && Objects.equals(this.breakOnNonKeyFrames, transcodingProfile.breakOnNonKeyFrames) + && Objects.equals(this.conditions, transcodingProfile.conditions) + && Objects.equals(this.enableAudioVbrEncoding, transcodingProfile.enableAudioVbrEncoding); + } + + @Override + public int hashCode() { + return Objects.hash(container, type, videoCodec, audioCodec, protocol, estimateContentLength, + enableMpegtsM2TsMode, transcodeSeekInfo, copyTimestamps, context, enableSubtitlesInManifest, + maxAudioChannels, minSegments, segmentLength, breakOnNonKeyFrames, conditions, enableAudioVbrEncoding); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TranscodingProfile {\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" videoCodec: ").append(toIndentedString(videoCodec)).append("\n"); + sb.append(" audioCodec: ").append(toIndentedString(audioCodec)).append("\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append(" estimateContentLength: ").append(toIndentedString(estimateContentLength)).append("\n"); + sb.append(" enableMpegtsM2TsMode: ").append(toIndentedString(enableMpegtsM2TsMode)).append("\n"); + sb.append(" transcodeSeekInfo: ").append(toIndentedString(transcodeSeekInfo)).append("\n"); + sb.append(" copyTimestamps: ").append(toIndentedString(copyTimestamps)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" enableSubtitlesInManifest: ").append(toIndentedString(enableSubtitlesInManifest)).append("\n"); + sb.append(" maxAudioChannels: ").append(toIndentedString(maxAudioChannels)).append("\n"); + sb.append(" minSegments: ").append(toIndentedString(minSegments)).append("\n"); + sb.append(" segmentLength: ").append(toIndentedString(segmentLength)).append("\n"); + sb.append(" breakOnNonKeyFrames: ").append(toIndentedString(breakOnNonKeyFrames)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" enableAudioVbrEncoding: ").append(toIndentedString(enableAudioVbrEncoding)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `VideoCodec` to the URL query string + if (getVideoCodec() != null) { + joiner.add(String.format("%sVideoCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoCodec())))); + } + + // add `AudioCodec` to the URL query string + if (getAudioCodec() != null) { + joiner.add(String.format("%sAudioCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioCodec())))); + } + + // add `Protocol` to the URL query string + if (getProtocol() != null) { + joiner.add(String.format("%sProtocol%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProtocol())))); + } + + // add `EstimateContentLength` to the URL query string + if (getEstimateContentLength() != null) { + joiner.add(String.format("%sEstimateContentLength%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEstimateContentLength())))); + } + + // add `EnableMpegtsM2TsMode` to the URL query string + if (getEnableMpegtsM2TsMode() != null) { + joiner.add(String.format("%sEnableMpegtsM2TsMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableMpegtsM2TsMode())))); + } + + // add `TranscodeSeekInfo` to the URL query string + if (getTranscodeSeekInfo() != null) { + joiner.add(String.format("%sTranscodeSeekInfo%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTranscodeSeekInfo())))); + } + + // add `CopyTimestamps` to the URL query string + if (getCopyTimestamps() != null) { + joiner.add(String.format("%sCopyTimestamps%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCopyTimestamps())))); + } + + // add `Context` to the URL query string + if (getContext() != null) { + joiner.add(String.format("%sContext%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContext())))); + } + + // add `EnableSubtitlesInManifest` to the URL query string + if (getEnableSubtitlesInManifest() != null) { + joiner.add(String.format("%sEnableSubtitlesInManifest%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableSubtitlesInManifest())))); + } + + // add `MaxAudioChannels` to the URL query string + if (getMaxAudioChannels() != null) { + joiner.add(String.format("%sMaxAudioChannels%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxAudioChannels())))); + } + + // add `MinSegments` to the URL query string + if (getMinSegments() != null) { + joiner.add(String.format("%sMinSegments%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMinSegments())))); + } + + // add `SegmentLength` to the URL query string + if (getSegmentLength() != null) { + joiner.add(String.format("%sSegmentLength%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSegmentLength())))); + } + + // add `BreakOnNonKeyFrames` to the URL query string + if (getBreakOnNonKeyFrames() != null) { + joiner.add(String.format("%sBreakOnNonKeyFrames%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBreakOnNonKeyFrames())))); + } + + // add `Conditions` to the URL query string + if (getConditions() != null) { + for (int i = 0; i < getConditions().size(); i++) { + if (getConditions().get(i) != null) { + joiner.add(getConditions().get(i).toUrlQueryString(String.format("%sConditions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `EnableAudioVbrEncoding` to the URL query string + if (getEnableAudioVbrEncoding() != null) { + joiner.add(String.format("%sEnableAudioVbrEncoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAudioVbrEncoding())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TranscodingProfile instance; + + public Builder() { + this(new TranscodingProfile()); + } + + protected Builder(TranscodingProfile instance) { + this.instance = instance; + } + + public TranscodingProfile.Builder container(String container) { + this.instance.container = container; + return this; + } + + public TranscodingProfile.Builder type(DlnaProfileType type) { + this.instance.type = type; + return this; + } + + public TranscodingProfile.Builder videoCodec(String videoCodec) { + this.instance.videoCodec = videoCodec; + return this; + } + + public TranscodingProfile.Builder audioCodec(String audioCodec) { + this.instance.audioCodec = audioCodec; + return this; + } + + public TranscodingProfile.Builder protocol(MediaStreamProtocol protocol) { + this.instance.protocol = protocol; + return this; + } + + public TranscodingProfile.Builder estimateContentLength(Boolean estimateContentLength) { + this.instance.estimateContentLength = estimateContentLength; + return this; + } + + public TranscodingProfile.Builder enableMpegtsM2TsMode(Boolean enableMpegtsM2TsMode) { + this.instance.enableMpegtsM2TsMode = enableMpegtsM2TsMode; + return this; + } + + public TranscodingProfile.Builder transcodeSeekInfo(TranscodeSeekInfo transcodeSeekInfo) { + this.instance.transcodeSeekInfo = transcodeSeekInfo; + return this; + } + + public TranscodingProfile.Builder copyTimestamps(Boolean copyTimestamps) { + this.instance.copyTimestamps = copyTimestamps; + return this; + } + + public TranscodingProfile.Builder context(EncodingContext context) { + this.instance.context = context; + return this; + } + + public TranscodingProfile.Builder enableSubtitlesInManifest(Boolean enableSubtitlesInManifest) { + this.instance.enableSubtitlesInManifest = enableSubtitlesInManifest; + return this; + } + + public TranscodingProfile.Builder maxAudioChannels(String maxAudioChannels) { + this.instance.maxAudioChannels = maxAudioChannels; + return this; + } + + public TranscodingProfile.Builder minSegments(Integer minSegments) { + this.instance.minSegments = minSegments; + return this; + } + + public TranscodingProfile.Builder segmentLength(Integer segmentLength) { + this.instance.segmentLength = segmentLength; + return this; + } + + public TranscodingProfile.Builder breakOnNonKeyFrames(Boolean breakOnNonKeyFrames) { + this.instance.breakOnNonKeyFrames = breakOnNonKeyFrames; + return this; + } + + public TranscodingProfile.Builder conditions(List conditions) { + this.instance.conditions = conditions; + return this; + } + + public TranscodingProfile.Builder enableAudioVbrEncoding(Boolean enableAudioVbrEncoding) { + this.instance.enableAudioVbrEncoding = enableAudioVbrEncoding; + return this; + } + + /** + * returns a built TranscodingProfile instance. + * + * The builder is not reusable. + */ + public TranscodingProfile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TranscodingProfile.Builder builder() { + return new TranscodingProfile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TranscodingProfile.Builder toBuilder() { + return new TranscodingProfile.Builder().container(getContainer()).type(getType()).videoCodec(getVideoCodec()) + .audioCodec(getAudioCodec()).protocol(getProtocol()).estimateContentLength(getEstimateContentLength()) + .enableMpegtsM2TsMode(getEnableMpegtsM2TsMode()).transcodeSeekInfo(getTranscodeSeekInfo()) + .copyTimestamps(getCopyTimestamps()).context(getContext()) + .enableSubtitlesInManifest(getEnableSubtitlesInManifest()).maxAudioChannels(getMaxAudioChannels()) + .minSegments(getMinSegments()).segmentLength(getSegmentLength()) + .breakOnNonKeyFrames(getBreakOnNonKeyFrames()).conditions(getConditions()) + .enableAudioVbrEncoding(getEnableAudioVbrEncoding()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TransportStreamTimestamp.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TransportStreamTimestamp.java new file mode 100644 index 0000000000000..44900c5692af8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TransportStreamTimestamp.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets TransportStreamTimestamp + */ +public enum TransportStreamTimestamp { + + NONE("None"), + + ZERO("Zero"), + + VALID("Valid"); + + private String value; + + TransportStreamTimestamp(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TransportStreamTimestamp fromValue(String value) { + for (TransportStreamTimestamp b : TransportStreamTimestamp.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrickplayInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrickplayInfo.java new file mode 100644 index 0000000000000..a68e035deef53 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrickplayInfo.java @@ -0,0 +1,436 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * An entity representing the metadata for a group of trickplay tiles. + */ +@JsonPropertyOrder({ TrickplayInfo.JSON_PROPERTY_WIDTH, TrickplayInfo.JSON_PROPERTY_HEIGHT, + TrickplayInfo.JSON_PROPERTY_TILE_WIDTH, TrickplayInfo.JSON_PROPERTY_TILE_HEIGHT, + TrickplayInfo.JSON_PROPERTY_THUMBNAIL_COUNT, TrickplayInfo.JSON_PROPERTY_INTERVAL, + TrickplayInfo.JSON_PROPERTY_BANDWIDTH }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TrickplayInfo { + public static final String JSON_PROPERTY_WIDTH = "Width"; + @org.eclipse.jdt.annotation.NonNull + private Integer width; + + public static final String JSON_PROPERTY_HEIGHT = "Height"; + @org.eclipse.jdt.annotation.NonNull + private Integer height; + + public static final String JSON_PROPERTY_TILE_WIDTH = "TileWidth"; + @org.eclipse.jdt.annotation.NonNull + private Integer tileWidth; + + public static final String JSON_PROPERTY_TILE_HEIGHT = "TileHeight"; + @org.eclipse.jdt.annotation.NonNull + private Integer tileHeight; + + public static final String JSON_PROPERTY_THUMBNAIL_COUNT = "ThumbnailCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer thumbnailCount; + + public static final String JSON_PROPERTY_INTERVAL = "Interval"; + @org.eclipse.jdt.annotation.NonNull + private Integer interval; + + public static final String JSON_PROPERTY_BANDWIDTH = "Bandwidth"; + @org.eclipse.jdt.annotation.NonNull + private Integer bandwidth; + + public TrickplayInfo() { + } + + public TrickplayInfo width(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + return this; + } + + /** + * Gets or sets width of an individual thumbnail. + * + * @return width + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + } + + public TrickplayInfo height(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + return this; + } + + /** + * Gets or sets height of an individual thumbnail. + * + * @return height + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHeight() { + return height; + } + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + } + + public TrickplayInfo tileWidth(@org.eclipse.jdt.annotation.NonNull Integer tileWidth) { + this.tileWidth = tileWidth; + return this; + } + + /** + * Gets or sets amount of thumbnails per row. + * + * @return tileWidth + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TILE_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTileWidth() { + return tileWidth; + } + + @JsonProperty(JSON_PROPERTY_TILE_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTileWidth(@org.eclipse.jdt.annotation.NonNull Integer tileWidth) { + this.tileWidth = tileWidth; + } + + public TrickplayInfo tileHeight(@org.eclipse.jdt.annotation.NonNull Integer tileHeight) { + this.tileHeight = tileHeight; + return this; + } + + /** + * Gets or sets amount of thumbnails per column. + * + * @return tileHeight + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TILE_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTileHeight() { + return tileHeight; + } + + @JsonProperty(JSON_PROPERTY_TILE_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTileHeight(@org.eclipse.jdt.annotation.NonNull Integer tileHeight) { + this.tileHeight = tileHeight; + } + + public TrickplayInfo thumbnailCount(@org.eclipse.jdt.annotation.NonNull Integer thumbnailCount) { + this.thumbnailCount = thumbnailCount; + return this; + } + + /** + * Gets or sets total amount of non-black thumbnails. + * + * @return thumbnailCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THUMBNAIL_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getThumbnailCount() { + return thumbnailCount; + } + + @JsonProperty(JSON_PROPERTY_THUMBNAIL_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThumbnailCount(@org.eclipse.jdt.annotation.NonNull Integer thumbnailCount) { + this.thumbnailCount = thumbnailCount; + } + + public TrickplayInfo interval(@org.eclipse.jdt.annotation.NonNull Integer interval) { + this.interval = interval; + return this; + } + + /** + * Gets or sets interval in milliseconds between each trickplay thumbnail. + * + * @return interval + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INTERVAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInterval() { + return interval; + } + + @JsonProperty(JSON_PROPERTY_INTERVAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInterval(@org.eclipse.jdt.annotation.NonNull Integer interval) { + this.interval = interval; + } + + public TrickplayInfo bandwidth(@org.eclipse.jdt.annotation.NonNull Integer bandwidth) { + this.bandwidth = bandwidth; + return this; + } + + /** + * Gets or sets peak bandwith usage in bits per second. + * + * @return bandwidth + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BANDWIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBandwidth() { + return bandwidth; + } + + @JsonProperty(JSON_PROPERTY_BANDWIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBandwidth(@org.eclipse.jdt.annotation.NonNull Integer bandwidth) { + this.bandwidth = bandwidth; + } + + /** + * Return true if this TrickplayInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrickplayInfo trickplayInfo = (TrickplayInfo) o; + return Objects.equals(this.width, trickplayInfo.width) && Objects.equals(this.height, trickplayInfo.height) + && Objects.equals(this.tileWidth, trickplayInfo.tileWidth) + && Objects.equals(this.tileHeight, trickplayInfo.tileHeight) + && Objects.equals(this.thumbnailCount, trickplayInfo.thumbnailCount) + && Objects.equals(this.interval, trickplayInfo.interval) + && Objects.equals(this.bandwidth, trickplayInfo.bandwidth); + } + + @Override + public int hashCode() { + return Objects.hash(width, height, tileWidth, tileHeight, thumbnailCount, interval, bandwidth); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrickplayInfo {\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" tileWidth: ").append(toIndentedString(tileWidth)).append("\n"); + sb.append(" tileHeight: ").append(toIndentedString(tileHeight)).append("\n"); + sb.append(" thumbnailCount: ").append(toIndentedString(thumbnailCount)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" bandwidth: ").append(toIndentedString(bandwidth)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Width` to the URL query string + if (getWidth() != null) { + joiner.add(String.format("%sWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWidth())))); + } + + // add `Height` to the URL query string + if (getHeight() != null) { + joiner.add(String.format("%sHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHeight())))); + } + + // add `TileWidth` to the URL query string + if (getTileWidth() != null) { + joiner.add(String.format("%sTileWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTileWidth())))); + } + + // add `TileHeight` to the URL query string + if (getTileHeight() != null) { + joiner.add(String.format("%sTileHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTileHeight())))); + } + + // add `ThumbnailCount` to the URL query string + if (getThumbnailCount() != null) { + joiner.add(String.format("%sThumbnailCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getThumbnailCount())))); + } + + // add `Interval` to the URL query string + if (getInterval() != null) { + joiner.add(String.format("%sInterval%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getInterval())))); + } + + // add `Bandwidth` to the URL query string + if (getBandwidth() != null) { + joiner.add(String.format("%sBandwidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBandwidth())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TrickplayInfo instance; + + public Builder() { + this(new TrickplayInfo()); + } + + protected Builder(TrickplayInfo instance) { + this.instance = instance; + } + + public TrickplayInfo.Builder width(Integer width) { + this.instance.width = width; + return this; + } + + public TrickplayInfo.Builder height(Integer height) { + this.instance.height = height; + return this; + } + + public TrickplayInfo.Builder tileWidth(Integer tileWidth) { + this.instance.tileWidth = tileWidth; + return this; + } + + public TrickplayInfo.Builder tileHeight(Integer tileHeight) { + this.instance.tileHeight = tileHeight; + return this; + } + + public TrickplayInfo.Builder thumbnailCount(Integer thumbnailCount) { + this.instance.thumbnailCount = thumbnailCount; + return this; + } + + public TrickplayInfo.Builder interval(Integer interval) { + this.instance.interval = interval; + return this; + } + + public TrickplayInfo.Builder bandwidth(Integer bandwidth) { + this.instance.bandwidth = bandwidth; + return this; + } + + /** + * returns a built TrickplayInfo instance. + * + * The builder is not reusable. + */ + public TrickplayInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TrickplayInfo.Builder builder() { + return new TrickplayInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TrickplayInfo.Builder toBuilder() { + return new TrickplayInfo.Builder().width(getWidth()).height(getHeight()).tileWidth(getTileWidth()) + .tileHeight(getTileHeight()).thumbnailCount(getThumbnailCount()).interval(getInterval()) + .bandwidth(getBandwidth()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrickplayOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrickplayOptions.java new file mode 100644 index 0000000000000..565df587b4ee0 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrickplayOptions.java @@ -0,0 +1,661 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class TrickplayOptions. + */ +@JsonPropertyOrder({ TrickplayOptions.JSON_PROPERTY_ENABLE_HW_ACCELERATION, + TrickplayOptions.JSON_PROPERTY_ENABLE_HW_ENCODING, + TrickplayOptions.JSON_PROPERTY_ENABLE_KEY_FRAME_ONLY_EXTRACTION, TrickplayOptions.JSON_PROPERTY_SCAN_BEHAVIOR, + TrickplayOptions.JSON_PROPERTY_PROCESS_PRIORITY, TrickplayOptions.JSON_PROPERTY_INTERVAL, + TrickplayOptions.JSON_PROPERTY_WIDTH_RESOLUTIONS, TrickplayOptions.JSON_PROPERTY_TILE_WIDTH, + TrickplayOptions.JSON_PROPERTY_TILE_HEIGHT, TrickplayOptions.JSON_PROPERTY_QSCALE, + TrickplayOptions.JSON_PROPERTY_JPEG_QUALITY, TrickplayOptions.JSON_PROPERTY_PROCESS_THREADS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TrickplayOptions { + public static final String JSON_PROPERTY_ENABLE_HW_ACCELERATION = "EnableHwAcceleration"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableHwAcceleration; + + public static final String JSON_PROPERTY_ENABLE_HW_ENCODING = "EnableHwEncoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableHwEncoding; + + public static final String JSON_PROPERTY_ENABLE_KEY_FRAME_ONLY_EXTRACTION = "EnableKeyFrameOnlyExtraction"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableKeyFrameOnlyExtraction; + + public static final String JSON_PROPERTY_SCAN_BEHAVIOR = "ScanBehavior"; + @org.eclipse.jdt.annotation.NonNull + private TrickplayScanBehavior scanBehavior; + + public static final String JSON_PROPERTY_PROCESS_PRIORITY = "ProcessPriority"; + @org.eclipse.jdt.annotation.NonNull + private ProcessPriorityClass processPriority; + + public static final String JSON_PROPERTY_INTERVAL = "Interval"; + @org.eclipse.jdt.annotation.NonNull + private Integer interval; + + public static final String JSON_PROPERTY_WIDTH_RESOLUTIONS = "WidthResolutions"; + @org.eclipse.jdt.annotation.NonNull + private List widthResolutions = new ArrayList<>(); + + public static final String JSON_PROPERTY_TILE_WIDTH = "TileWidth"; + @org.eclipse.jdt.annotation.NonNull + private Integer tileWidth; + + public static final String JSON_PROPERTY_TILE_HEIGHT = "TileHeight"; + @org.eclipse.jdt.annotation.NonNull + private Integer tileHeight; + + public static final String JSON_PROPERTY_QSCALE = "Qscale"; + @org.eclipse.jdt.annotation.NonNull + private Integer qscale; + + public static final String JSON_PROPERTY_JPEG_QUALITY = "JpegQuality"; + @org.eclipse.jdt.annotation.NonNull + private Integer jpegQuality; + + public static final String JSON_PROPERTY_PROCESS_THREADS = "ProcessThreads"; + @org.eclipse.jdt.annotation.NonNull + private Integer processThreads; + + public TrickplayOptions() { + } + + public TrickplayOptions enableHwAcceleration(@org.eclipse.jdt.annotation.NonNull Boolean enableHwAcceleration) { + this.enableHwAcceleration = enableHwAcceleration; + return this; + } + + /** + * Gets or sets a value indicating whether or not to use HW acceleration. + * + * @return enableHwAcceleration + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_HW_ACCELERATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableHwAcceleration() { + return enableHwAcceleration; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_HW_ACCELERATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableHwAcceleration(@org.eclipse.jdt.annotation.NonNull Boolean enableHwAcceleration) { + this.enableHwAcceleration = enableHwAcceleration; + } + + public TrickplayOptions enableHwEncoding(@org.eclipse.jdt.annotation.NonNull Boolean enableHwEncoding) { + this.enableHwEncoding = enableHwEncoding; + return this; + } + + /** + * Gets or sets a value indicating whether or not to use HW accelerated MJPEG encoding. + * + * @return enableHwEncoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_HW_ENCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableHwEncoding() { + return enableHwEncoding; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_HW_ENCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableHwEncoding(@org.eclipse.jdt.annotation.NonNull Boolean enableHwEncoding) { + this.enableHwEncoding = enableHwEncoding; + } + + public TrickplayOptions enableKeyFrameOnlyExtraction( + @org.eclipse.jdt.annotation.NonNull Boolean enableKeyFrameOnlyExtraction) { + this.enableKeyFrameOnlyExtraction = enableKeyFrameOnlyExtraction; + return this; + } + + /** + * Gets or sets a value indicating whether to only extract key frames. Significantly faster, but is not compatible + * with all decoders and/or video files. + * + * @return enableKeyFrameOnlyExtraction + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_KEY_FRAME_ONLY_EXTRACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableKeyFrameOnlyExtraction() { + return enableKeyFrameOnlyExtraction; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_KEY_FRAME_ONLY_EXTRACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableKeyFrameOnlyExtraction( + @org.eclipse.jdt.annotation.NonNull Boolean enableKeyFrameOnlyExtraction) { + this.enableKeyFrameOnlyExtraction = enableKeyFrameOnlyExtraction; + } + + public TrickplayOptions scanBehavior(@org.eclipse.jdt.annotation.NonNull TrickplayScanBehavior scanBehavior) { + this.scanBehavior = scanBehavior; + return this; + } + + /** + * Gets or sets the behavior used by trickplay provider on library scan/update. + * + * @return scanBehavior + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SCAN_BEHAVIOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TrickplayScanBehavior getScanBehavior() { + return scanBehavior; + } + + @JsonProperty(JSON_PROPERTY_SCAN_BEHAVIOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScanBehavior(@org.eclipse.jdt.annotation.NonNull TrickplayScanBehavior scanBehavior) { + this.scanBehavior = scanBehavior; + } + + public TrickplayOptions processPriority(@org.eclipse.jdt.annotation.NonNull ProcessPriorityClass processPriority) { + this.processPriority = processPriority; + return this; + } + + /** + * Gets or sets the process priority for the ffmpeg process. + * + * @return processPriority + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROCESS_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProcessPriorityClass getProcessPriority() { + return processPriority; + } + + @JsonProperty(JSON_PROPERTY_PROCESS_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProcessPriority(@org.eclipse.jdt.annotation.NonNull ProcessPriorityClass processPriority) { + this.processPriority = processPriority; + } + + public TrickplayOptions interval(@org.eclipse.jdt.annotation.NonNull Integer interval) { + this.interval = interval; + return this; + } + + /** + * Gets or sets the interval, in ms, between each new trickplay image. + * + * @return interval + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INTERVAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInterval() { + return interval; + } + + @JsonProperty(JSON_PROPERTY_INTERVAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInterval(@org.eclipse.jdt.annotation.NonNull Integer interval) { + this.interval = interval; + } + + public TrickplayOptions widthResolutions(@org.eclipse.jdt.annotation.NonNull List widthResolutions) { + this.widthResolutions = widthResolutions; + return this; + } + + public TrickplayOptions addWidthResolutionsItem(Integer widthResolutionsItem) { + if (this.widthResolutions == null) { + this.widthResolutions = new ArrayList<>(); + } + this.widthResolutions.add(widthResolutionsItem); + return this; + } + + /** + * Gets or sets the target width resolutions, in px, to generates preview images for. + * + * @return widthResolutions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WIDTH_RESOLUTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWidthResolutions() { + return widthResolutions; + } + + @JsonProperty(JSON_PROPERTY_WIDTH_RESOLUTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidthResolutions(@org.eclipse.jdt.annotation.NonNull List widthResolutions) { + this.widthResolutions = widthResolutions; + } + + public TrickplayOptions tileWidth(@org.eclipse.jdt.annotation.NonNull Integer tileWidth) { + this.tileWidth = tileWidth; + return this; + } + + /** + * Gets or sets number of tile images to allow in X dimension. + * + * @return tileWidth + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TILE_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTileWidth() { + return tileWidth; + } + + @JsonProperty(JSON_PROPERTY_TILE_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTileWidth(@org.eclipse.jdt.annotation.NonNull Integer tileWidth) { + this.tileWidth = tileWidth; + } + + public TrickplayOptions tileHeight(@org.eclipse.jdt.annotation.NonNull Integer tileHeight) { + this.tileHeight = tileHeight; + return this; + } + + /** + * Gets or sets number of tile images to allow in Y dimension. + * + * @return tileHeight + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TILE_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTileHeight() { + return tileHeight; + } + + @JsonProperty(JSON_PROPERTY_TILE_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTileHeight(@org.eclipse.jdt.annotation.NonNull Integer tileHeight) { + this.tileHeight = tileHeight; + } + + public TrickplayOptions qscale(@org.eclipse.jdt.annotation.NonNull Integer qscale) { + this.qscale = qscale; + return this; + } + + /** + * Gets or sets the ffmpeg output quality level. + * + * @return qscale + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_QSCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQscale() { + return qscale; + } + + @JsonProperty(JSON_PROPERTY_QSCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQscale(@org.eclipse.jdt.annotation.NonNull Integer qscale) { + this.qscale = qscale; + } + + public TrickplayOptions jpegQuality(@org.eclipse.jdt.annotation.NonNull Integer jpegQuality) { + this.jpegQuality = jpegQuality; + return this; + } + + /** + * Gets or sets the jpeg quality to use for image tiles. + * + * @return jpegQuality + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_JPEG_QUALITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getJpegQuality() { + return jpegQuality; + } + + @JsonProperty(JSON_PROPERTY_JPEG_QUALITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setJpegQuality(@org.eclipse.jdt.annotation.NonNull Integer jpegQuality) { + this.jpegQuality = jpegQuality; + } + + public TrickplayOptions processThreads(@org.eclipse.jdt.annotation.NonNull Integer processThreads) { + this.processThreads = processThreads; + return this; + } + + /** + * Gets or sets the number of threads to be used by ffmpeg. + * + * @return processThreads + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROCESS_THREADS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getProcessThreads() { + return processThreads; + } + + @JsonProperty(JSON_PROPERTY_PROCESS_THREADS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProcessThreads(@org.eclipse.jdt.annotation.NonNull Integer processThreads) { + this.processThreads = processThreads; + } + + /** + * Return true if this TrickplayOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrickplayOptions trickplayOptions = (TrickplayOptions) o; + return Objects.equals(this.enableHwAcceleration, trickplayOptions.enableHwAcceleration) + && Objects.equals(this.enableHwEncoding, trickplayOptions.enableHwEncoding) + && Objects.equals(this.enableKeyFrameOnlyExtraction, trickplayOptions.enableKeyFrameOnlyExtraction) + && Objects.equals(this.scanBehavior, trickplayOptions.scanBehavior) + && Objects.equals(this.processPriority, trickplayOptions.processPriority) + && Objects.equals(this.interval, trickplayOptions.interval) + && Objects.equals(this.widthResolutions, trickplayOptions.widthResolutions) + && Objects.equals(this.tileWidth, trickplayOptions.tileWidth) + && Objects.equals(this.tileHeight, trickplayOptions.tileHeight) + && Objects.equals(this.qscale, trickplayOptions.qscale) + && Objects.equals(this.jpegQuality, trickplayOptions.jpegQuality) + && Objects.equals(this.processThreads, trickplayOptions.processThreads); + } + + @Override + public int hashCode() { + return Objects.hash(enableHwAcceleration, enableHwEncoding, enableKeyFrameOnlyExtraction, scanBehavior, + processPriority, interval, widthResolutions, tileWidth, tileHeight, qscale, jpegQuality, + processThreads); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrickplayOptions {\n"); + sb.append(" enableHwAcceleration: ").append(toIndentedString(enableHwAcceleration)).append("\n"); + sb.append(" enableHwEncoding: ").append(toIndentedString(enableHwEncoding)).append("\n"); + sb.append(" enableKeyFrameOnlyExtraction: ").append(toIndentedString(enableKeyFrameOnlyExtraction)) + .append("\n"); + sb.append(" scanBehavior: ").append(toIndentedString(scanBehavior)).append("\n"); + sb.append(" processPriority: ").append(toIndentedString(processPriority)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" widthResolutions: ").append(toIndentedString(widthResolutions)).append("\n"); + sb.append(" tileWidth: ").append(toIndentedString(tileWidth)).append("\n"); + sb.append(" tileHeight: ").append(toIndentedString(tileHeight)).append("\n"); + sb.append(" qscale: ").append(toIndentedString(qscale)).append("\n"); + sb.append(" jpegQuality: ").append(toIndentedString(jpegQuality)).append("\n"); + sb.append(" processThreads: ").append(toIndentedString(processThreads)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `EnableHwAcceleration` to the URL query string + if (getEnableHwAcceleration() != null) { + joiner.add(String.format("%sEnableHwAcceleration%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableHwAcceleration())))); + } + + // add `EnableHwEncoding` to the URL query string + if (getEnableHwEncoding() != null) { + joiner.add(String.format("%sEnableHwEncoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableHwEncoding())))); + } + + // add `EnableKeyFrameOnlyExtraction` to the URL query string + if (getEnableKeyFrameOnlyExtraction() != null) { + joiner.add(String.format("%sEnableKeyFrameOnlyExtraction%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableKeyFrameOnlyExtraction())))); + } + + // add `ScanBehavior` to the URL query string + if (getScanBehavior() != null) { + joiner.add(String.format("%sScanBehavior%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getScanBehavior())))); + } + + // add `ProcessPriority` to the URL query string + if (getProcessPriority() != null) { + joiner.add(String.format("%sProcessPriority%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProcessPriority())))); + } + + // add `Interval` to the URL query string + if (getInterval() != null) { + joiner.add(String.format("%sInterval%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getInterval())))); + } + + // add `WidthResolutions` to the URL query string + if (getWidthResolutions() != null) { + for (int i = 0; i < getWidthResolutions().size(); i++) { + joiner.add(String.format("%sWidthResolutions%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getWidthResolutions().get(i))))); + } + } + + // add `TileWidth` to the URL query string + if (getTileWidth() != null) { + joiner.add(String.format("%sTileWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTileWidth())))); + } + + // add `TileHeight` to the URL query string + if (getTileHeight() != null) { + joiner.add(String.format("%sTileHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTileHeight())))); + } + + // add `Qscale` to the URL query string + if (getQscale() != null) { + joiner.add(String.format("%sQscale%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getQscale())))); + } + + // add `JpegQuality` to the URL query string + if (getJpegQuality() != null) { + joiner.add(String.format("%sJpegQuality%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getJpegQuality())))); + } + + // add `ProcessThreads` to the URL query string + if (getProcessThreads() != null) { + joiner.add(String.format("%sProcessThreads%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProcessThreads())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TrickplayOptions instance; + + public Builder() { + this(new TrickplayOptions()); + } + + protected Builder(TrickplayOptions instance) { + this.instance = instance; + } + + public TrickplayOptions.Builder enableHwAcceleration(Boolean enableHwAcceleration) { + this.instance.enableHwAcceleration = enableHwAcceleration; + return this; + } + + public TrickplayOptions.Builder enableHwEncoding(Boolean enableHwEncoding) { + this.instance.enableHwEncoding = enableHwEncoding; + return this; + } + + public TrickplayOptions.Builder enableKeyFrameOnlyExtraction(Boolean enableKeyFrameOnlyExtraction) { + this.instance.enableKeyFrameOnlyExtraction = enableKeyFrameOnlyExtraction; + return this; + } + + public TrickplayOptions.Builder scanBehavior(TrickplayScanBehavior scanBehavior) { + this.instance.scanBehavior = scanBehavior; + return this; + } + + public TrickplayOptions.Builder processPriority(ProcessPriorityClass processPriority) { + this.instance.processPriority = processPriority; + return this; + } + + public TrickplayOptions.Builder interval(Integer interval) { + this.instance.interval = interval; + return this; + } + + public TrickplayOptions.Builder widthResolutions(List widthResolutions) { + this.instance.widthResolutions = widthResolutions; + return this; + } + + public TrickplayOptions.Builder tileWidth(Integer tileWidth) { + this.instance.tileWidth = tileWidth; + return this; + } + + public TrickplayOptions.Builder tileHeight(Integer tileHeight) { + this.instance.tileHeight = tileHeight; + return this; + } + + public TrickplayOptions.Builder qscale(Integer qscale) { + this.instance.qscale = qscale; + return this; + } + + public TrickplayOptions.Builder jpegQuality(Integer jpegQuality) { + this.instance.jpegQuality = jpegQuality; + return this; + } + + public TrickplayOptions.Builder processThreads(Integer processThreads) { + this.instance.processThreads = processThreads; + return this; + } + + /** + * returns a built TrickplayOptions instance. + * + * The builder is not reusable. + */ + public TrickplayOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TrickplayOptions.Builder builder() { + return new TrickplayOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TrickplayOptions.Builder toBuilder() { + return new TrickplayOptions.Builder().enableHwAcceleration(getEnableHwAcceleration()) + .enableHwEncoding(getEnableHwEncoding()).enableKeyFrameOnlyExtraction(getEnableKeyFrameOnlyExtraction()) + .scanBehavior(getScanBehavior()).processPriority(getProcessPriority()).interval(getInterval()) + .widthResolutions(getWidthResolutions()).tileWidth(getTileWidth()).tileHeight(getTileHeight()) + .qscale(getQscale()).jpegQuality(getJpegQuality()).processThreads(getProcessThreads()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrickplayScanBehavior.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrickplayScanBehavior.java new file mode 100644 index 0000000000000..067fe023c9422 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TrickplayScanBehavior.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum TrickplayScanBehavior. + */ +public enum TrickplayScanBehavior { + + BLOCKING("Blocking"), + + NON_BLOCKING("NonBlocking"); + + private String value; + + TrickplayScanBehavior(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TrickplayScanBehavior fromValue(String value) { + for (TrickplayScanBehavior b : TrickplayScanBehavior.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TunerChannelMapping.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TunerChannelMapping.java new file mode 100644 index 0000000000000..00799ab99a5b0 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TunerChannelMapping.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TunerChannelMapping + */ +@JsonPropertyOrder({ TunerChannelMapping.JSON_PROPERTY_NAME, TunerChannelMapping.JSON_PROPERTY_PROVIDER_CHANNEL_NAME, + TunerChannelMapping.JSON_PROPERTY_PROVIDER_CHANNEL_ID, TunerChannelMapping.JSON_PROPERTY_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TunerChannelMapping { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_PROVIDER_CHANNEL_NAME = "ProviderChannelName"; + @org.eclipse.jdt.annotation.NonNull + private String providerChannelName; + + public static final String JSON_PROPERTY_PROVIDER_CHANNEL_ID = "ProviderChannelId"; + @org.eclipse.jdt.annotation.NonNull + private String providerChannelId; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public TunerChannelMapping() { + } + + public TunerChannelMapping name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public TunerChannelMapping providerChannelName(@org.eclipse.jdt.annotation.NonNull String providerChannelName) { + this.providerChannelName = providerChannelName; + return this; + } + + /** + * Get providerChannelName + * + * @return providerChannelName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProviderChannelName() { + return providerChannelName; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderChannelName(@org.eclipse.jdt.annotation.NonNull String providerChannelName) { + this.providerChannelName = providerChannelName; + } + + public TunerChannelMapping providerChannelId(@org.eclipse.jdt.annotation.NonNull String providerChannelId) { + this.providerChannelId = providerChannelId; + return this; + } + + /** + * Get providerChannelId + * + * @return providerChannelId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProviderChannelId() { + return providerChannelId; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderChannelId(@org.eclipse.jdt.annotation.NonNull String providerChannelId) { + this.providerChannelId = providerChannelId; + } + + public TunerChannelMapping id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + /** + * Return true if this TunerChannelMapping object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TunerChannelMapping tunerChannelMapping = (TunerChannelMapping) o; + return Objects.equals(this.name, tunerChannelMapping.name) + && Objects.equals(this.providerChannelName, tunerChannelMapping.providerChannelName) + && Objects.equals(this.providerChannelId, tunerChannelMapping.providerChannelId) + && Objects.equals(this.id, tunerChannelMapping.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, providerChannelName, providerChannelId, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TunerChannelMapping {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" providerChannelName: ").append(toIndentedString(providerChannelName)).append("\n"); + sb.append(" providerChannelId: ").append(toIndentedString(providerChannelId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `ProviderChannelName` to the URL query string + if (getProviderChannelName() != null) { + joiner.add(String.format("%sProviderChannelName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProviderChannelName())))); + } + + // add `ProviderChannelId` to the URL query string + if (getProviderChannelId() != null) { + joiner.add(String.format("%sProviderChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProviderChannelId())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TunerChannelMapping instance; + + public Builder() { + this(new TunerChannelMapping()); + } + + protected Builder(TunerChannelMapping instance) { + this.instance = instance; + } + + public TunerChannelMapping.Builder name(String name) { + this.instance.name = name; + return this; + } + + public TunerChannelMapping.Builder providerChannelName(String providerChannelName) { + this.instance.providerChannelName = providerChannelName; + return this; + } + + public TunerChannelMapping.Builder providerChannelId(String providerChannelId) { + this.instance.providerChannelId = providerChannelId; + return this; + } + + public TunerChannelMapping.Builder id(String id) { + this.instance.id = id; + return this; + } + + /** + * returns a built TunerChannelMapping instance. + * + * The builder is not reusable. + */ + public TunerChannelMapping build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TunerChannelMapping.Builder builder() { + return new TunerChannelMapping.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TunerChannelMapping.Builder toBuilder() { + return new TunerChannelMapping.Builder().name(getName()).providerChannelName(getProviderChannelName()) + .providerChannelId(getProviderChannelId()).id(getId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TunerHostInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TunerHostInfo.java new file mode 100644 index 0000000000000..9c7e133c0ef30 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TunerHostInfo.java @@ -0,0 +1,772 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TunerHostInfo + */ +@JsonPropertyOrder({ TunerHostInfo.JSON_PROPERTY_ID, TunerHostInfo.JSON_PROPERTY_URL, TunerHostInfo.JSON_PROPERTY_TYPE, + TunerHostInfo.JSON_PROPERTY_DEVICE_ID, TunerHostInfo.JSON_PROPERTY_FRIENDLY_NAME, + TunerHostInfo.JSON_PROPERTY_IMPORT_FAVORITES_ONLY, TunerHostInfo.JSON_PROPERTY_ALLOW_H_W_TRANSCODING, + TunerHostInfo.JSON_PROPERTY_ALLOW_FMP4_TRANSCODING_CONTAINER, TunerHostInfo.JSON_PROPERTY_ALLOW_STREAM_SHARING, + TunerHostInfo.JSON_PROPERTY_FALLBACK_MAX_STREAMING_BITRATE, TunerHostInfo.JSON_PROPERTY_ENABLE_STREAM_LOOPING, + TunerHostInfo.JSON_PROPERTY_SOURCE, TunerHostInfo.JSON_PROPERTY_TUNER_COUNT, + TunerHostInfo.JSON_PROPERTY_USER_AGENT, TunerHostInfo.JSON_PROPERTY_IGNORE_DTS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TunerHostInfo { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_URL = "Url"; + @org.eclipse.jdt.annotation.NonNull + private String url; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_DEVICE_ID = "DeviceId"; + @org.eclipse.jdt.annotation.NonNull + private String deviceId; + + public static final String JSON_PROPERTY_FRIENDLY_NAME = "FriendlyName"; + @org.eclipse.jdt.annotation.NonNull + private String friendlyName; + + public static final String JSON_PROPERTY_IMPORT_FAVORITES_ONLY = "ImportFavoritesOnly"; + @org.eclipse.jdt.annotation.NonNull + private Boolean importFavoritesOnly; + + public static final String JSON_PROPERTY_ALLOW_H_W_TRANSCODING = "AllowHWTranscoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean allowHWTranscoding; + + public static final String JSON_PROPERTY_ALLOW_FMP4_TRANSCODING_CONTAINER = "AllowFmp4TranscodingContainer"; + @org.eclipse.jdt.annotation.NonNull + private Boolean allowFmp4TranscodingContainer; + + public static final String JSON_PROPERTY_ALLOW_STREAM_SHARING = "AllowStreamSharing"; + @org.eclipse.jdt.annotation.NonNull + private Boolean allowStreamSharing; + + public static final String JSON_PROPERTY_FALLBACK_MAX_STREAMING_BITRATE = "FallbackMaxStreamingBitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer fallbackMaxStreamingBitrate; + + public static final String JSON_PROPERTY_ENABLE_STREAM_LOOPING = "EnableStreamLooping"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableStreamLooping; + + public static final String JSON_PROPERTY_SOURCE = "Source"; + @org.eclipse.jdt.annotation.NonNull + private String source; + + public static final String JSON_PROPERTY_TUNER_COUNT = "TunerCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer tunerCount; + + public static final String JSON_PROPERTY_USER_AGENT = "UserAgent"; + @org.eclipse.jdt.annotation.NonNull + private String userAgent; + + public static final String JSON_PROPERTY_IGNORE_DTS = "IgnoreDts"; + @org.eclipse.jdt.annotation.NonNull + private Boolean ignoreDts; + + public TunerHostInfo() { + } + + public TunerHostInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public TunerHostInfo url(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + return this; + } + + /** + * Get url + * + * @return url + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + } + + public TunerHostInfo type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public TunerHostInfo deviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Get deviceId + * + * @return deviceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceId() { + return deviceId; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + } + + public TunerHostInfo friendlyName(@org.eclipse.jdt.annotation.NonNull String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get friendlyName + * + * @return friendlyName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FRIENDLY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFriendlyName() { + return friendlyName; + } + + @JsonProperty(JSON_PROPERTY_FRIENDLY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFriendlyName(@org.eclipse.jdt.annotation.NonNull String friendlyName) { + this.friendlyName = friendlyName; + } + + public TunerHostInfo importFavoritesOnly(@org.eclipse.jdt.annotation.NonNull Boolean importFavoritesOnly) { + this.importFavoritesOnly = importFavoritesOnly; + return this; + } + + /** + * Get importFavoritesOnly + * + * @return importFavoritesOnly + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMPORT_FAVORITES_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getImportFavoritesOnly() { + return importFavoritesOnly; + } + + @JsonProperty(JSON_PROPERTY_IMPORT_FAVORITES_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImportFavoritesOnly(@org.eclipse.jdt.annotation.NonNull Boolean importFavoritesOnly) { + this.importFavoritesOnly = importFavoritesOnly; + } + + public TunerHostInfo allowHWTranscoding(@org.eclipse.jdt.annotation.NonNull Boolean allowHWTranscoding) { + this.allowHWTranscoding = allowHWTranscoding; + return this; + } + + /** + * Get allowHWTranscoding + * + * @return allowHWTranscoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_H_W_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowHWTranscoding() { + return allowHWTranscoding; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_H_W_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowHWTranscoding(@org.eclipse.jdt.annotation.NonNull Boolean allowHWTranscoding) { + this.allowHWTranscoding = allowHWTranscoding; + } + + public TunerHostInfo allowFmp4TranscodingContainer( + @org.eclipse.jdt.annotation.NonNull Boolean allowFmp4TranscodingContainer) { + this.allowFmp4TranscodingContainer = allowFmp4TranscodingContainer; + return this; + } + + /** + * Get allowFmp4TranscodingContainer + * + * @return allowFmp4TranscodingContainer + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_FMP4_TRANSCODING_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowFmp4TranscodingContainer() { + return allowFmp4TranscodingContainer; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_FMP4_TRANSCODING_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowFmp4TranscodingContainer( + @org.eclipse.jdt.annotation.NonNull Boolean allowFmp4TranscodingContainer) { + this.allowFmp4TranscodingContainer = allowFmp4TranscodingContainer; + } + + public TunerHostInfo allowStreamSharing(@org.eclipse.jdt.annotation.NonNull Boolean allowStreamSharing) { + this.allowStreamSharing = allowStreamSharing; + return this; + } + + /** + * Get allowStreamSharing + * + * @return allowStreamSharing + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_STREAM_SHARING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowStreamSharing() { + return allowStreamSharing; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_STREAM_SHARING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowStreamSharing(@org.eclipse.jdt.annotation.NonNull Boolean allowStreamSharing) { + this.allowStreamSharing = allowStreamSharing; + } + + public TunerHostInfo fallbackMaxStreamingBitrate( + @org.eclipse.jdt.annotation.NonNull Integer fallbackMaxStreamingBitrate) { + this.fallbackMaxStreamingBitrate = fallbackMaxStreamingBitrate; + return this; + } + + /** + * Get fallbackMaxStreamingBitrate + * + * @return fallbackMaxStreamingBitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FALLBACK_MAX_STREAMING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getFallbackMaxStreamingBitrate() { + return fallbackMaxStreamingBitrate; + } + + @JsonProperty(JSON_PROPERTY_FALLBACK_MAX_STREAMING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFallbackMaxStreamingBitrate( + @org.eclipse.jdt.annotation.NonNull Integer fallbackMaxStreamingBitrate) { + this.fallbackMaxStreamingBitrate = fallbackMaxStreamingBitrate; + } + + public TunerHostInfo enableStreamLooping(@org.eclipse.jdt.annotation.NonNull Boolean enableStreamLooping) { + this.enableStreamLooping = enableStreamLooping; + return this; + } + + /** + * Get enableStreamLooping + * + * @return enableStreamLooping + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_STREAM_LOOPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableStreamLooping() { + return enableStreamLooping; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_STREAM_LOOPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableStreamLooping(@org.eclipse.jdt.annotation.NonNull Boolean enableStreamLooping) { + this.enableStreamLooping = enableStreamLooping; + } + + public TunerHostInfo source(@org.eclipse.jdt.annotation.NonNull String source) { + this.source = source; + return this; + } + + /** + * Get source + * + * @return source + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSource() { + return source; + } + + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSource(@org.eclipse.jdt.annotation.NonNull String source) { + this.source = source; + } + + public TunerHostInfo tunerCount(@org.eclipse.jdt.annotation.NonNull Integer tunerCount) { + this.tunerCount = tunerCount; + return this; + } + + /** + * Get tunerCount + * + * @return tunerCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TUNER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTunerCount() { + return tunerCount; + } + + @JsonProperty(JSON_PROPERTY_TUNER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTunerCount(@org.eclipse.jdt.annotation.NonNull Integer tunerCount) { + this.tunerCount = tunerCount; + } + + public TunerHostInfo userAgent(@org.eclipse.jdt.annotation.NonNull String userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + * Get userAgent + * + * @return userAgent + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_AGENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserAgent() { + return userAgent; + } + + @JsonProperty(JSON_PROPERTY_USER_AGENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserAgent(@org.eclipse.jdt.annotation.NonNull String userAgent) { + this.userAgent = userAgent; + } + + public TunerHostInfo ignoreDts(@org.eclipse.jdt.annotation.NonNull Boolean ignoreDts) { + this.ignoreDts = ignoreDts; + return this; + } + + /** + * Get ignoreDts + * + * @return ignoreDts + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IGNORE_DTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIgnoreDts() { + return ignoreDts; + } + + @JsonProperty(JSON_PROPERTY_IGNORE_DTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIgnoreDts(@org.eclipse.jdt.annotation.NonNull Boolean ignoreDts) { + this.ignoreDts = ignoreDts; + } + + /** + * Return true if this TunerHostInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TunerHostInfo tunerHostInfo = (TunerHostInfo) o; + return Objects.equals(this.id, tunerHostInfo.id) && Objects.equals(this.url, tunerHostInfo.url) + && Objects.equals(this.type, tunerHostInfo.type) + && Objects.equals(this.deviceId, tunerHostInfo.deviceId) + && Objects.equals(this.friendlyName, tunerHostInfo.friendlyName) + && Objects.equals(this.importFavoritesOnly, tunerHostInfo.importFavoritesOnly) + && Objects.equals(this.allowHWTranscoding, tunerHostInfo.allowHWTranscoding) + && Objects.equals(this.allowFmp4TranscodingContainer, tunerHostInfo.allowFmp4TranscodingContainer) + && Objects.equals(this.allowStreamSharing, tunerHostInfo.allowStreamSharing) + && Objects.equals(this.fallbackMaxStreamingBitrate, tunerHostInfo.fallbackMaxStreamingBitrate) + && Objects.equals(this.enableStreamLooping, tunerHostInfo.enableStreamLooping) + && Objects.equals(this.source, tunerHostInfo.source) + && Objects.equals(this.tunerCount, tunerHostInfo.tunerCount) + && Objects.equals(this.userAgent, tunerHostInfo.userAgent) + && Objects.equals(this.ignoreDts, tunerHostInfo.ignoreDts); + } + + @Override + public int hashCode() { + return Objects.hash(id, url, type, deviceId, friendlyName, importFavoritesOnly, allowHWTranscoding, + allowFmp4TranscodingContainer, allowStreamSharing, fallbackMaxStreamingBitrate, enableStreamLooping, + source, tunerCount, userAgent, ignoreDts); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TunerHostInfo {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" deviceId: ").append(toIndentedString(deviceId)).append("\n"); + sb.append(" friendlyName: ").append(toIndentedString(friendlyName)).append("\n"); + sb.append(" importFavoritesOnly: ").append(toIndentedString(importFavoritesOnly)).append("\n"); + sb.append(" allowHWTranscoding: ").append(toIndentedString(allowHWTranscoding)).append("\n"); + sb.append(" allowFmp4TranscodingContainer: ").append(toIndentedString(allowFmp4TranscodingContainer)) + .append("\n"); + sb.append(" allowStreamSharing: ").append(toIndentedString(allowStreamSharing)).append("\n"); + sb.append(" fallbackMaxStreamingBitrate: ").append(toIndentedString(fallbackMaxStreamingBitrate)) + .append("\n"); + sb.append(" enableStreamLooping: ").append(toIndentedString(enableStreamLooping)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" tunerCount: ").append(toIndentedString(tunerCount)).append("\n"); + sb.append(" userAgent: ").append(toIndentedString(userAgent)).append("\n"); + sb.append(" ignoreDts: ").append(toIndentedString(ignoreDts)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format("%sUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `DeviceId` to the URL query string + if (getDeviceId() != null) { + joiner.add(String.format("%sDeviceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceId())))); + } + + // add `FriendlyName` to the URL query string + if (getFriendlyName() != null) { + joiner.add(String.format("%sFriendlyName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFriendlyName())))); + } + + // add `ImportFavoritesOnly` to the URL query string + if (getImportFavoritesOnly() != null) { + joiner.add(String.format("%sImportFavoritesOnly%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImportFavoritesOnly())))); + } + + // add `AllowHWTranscoding` to the URL query string + if (getAllowHWTranscoding() != null) { + joiner.add(String.format("%sAllowHWTranscoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAllowHWTranscoding())))); + } + + // add `AllowFmp4TranscodingContainer` to the URL query string + if (getAllowFmp4TranscodingContainer() != null) { + joiner.add(String.format("%sAllowFmp4TranscodingContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAllowFmp4TranscodingContainer())))); + } + + // add `AllowStreamSharing` to the URL query string + if (getAllowStreamSharing() != null) { + joiner.add(String.format("%sAllowStreamSharing%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAllowStreamSharing())))); + } + + // add `FallbackMaxStreamingBitrate` to the URL query string + if (getFallbackMaxStreamingBitrate() != null) { + joiner.add(String.format("%sFallbackMaxStreamingBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFallbackMaxStreamingBitrate())))); + } + + // add `EnableStreamLooping` to the URL query string + if (getEnableStreamLooping() != null) { + joiner.add(String.format("%sEnableStreamLooping%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableStreamLooping())))); + } + + // add `Source` to the URL query string + if (getSource() != null) { + joiner.add(String.format("%sSource%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSource())))); + } + + // add `TunerCount` to the URL query string + if (getTunerCount() != null) { + joiner.add(String.format("%sTunerCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTunerCount())))); + } + + // add `UserAgent` to the URL query string + if (getUserAgent() != null) { + joiner.add(String.format("%sUserAgent%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserAgent())))); + } + + // add `IgnoreDts` to the URL query string + if (getIgnoreDts() != null) { + joiner.add(String.format("%sIgnoreDts%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIgnoreDts())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TunerHostInfo instance; + + public Builder() { + this(new TunerHostInfo()); + } + + protected Builder(TunerHostInfo instance) { + this.instance = instance; + } + + public TunerHostInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public TunerHostInfo.Builder url(String url) { + this.instance.url = url; + return this; + } + + public TunerHostInfo.Builder type(String type) { + this.instance.type = type; + return this; + } + + public TunerHostInfo.Builder deviceId(String deviceId) { + this.instance.deviceId = deviceId; + return this; + } + + public TunerHostInfo.Builder friendlyName(String friendlyName) { + this.instance.friendlyName = friendlyName; + return this; + } + + public TunerHostInfo.Builder importFavoritesOnly(Boolean importFavoritesOnly) { + this.instance.importFavoritesOnly = importFavoritesOnly; + return this; + } + + public TunerHostInfo.Builder allowHWTranscoding(Boolean allowHWTranscoding) { + this.instance.allowHWTranscoding = allowHWTranscoding; + return this; + } + + public TunerHostInfo.Builder allowFmp4TranscodingContainer(Boolean allowFmp4TranscodingContainer) { + this.instance.allowFmp4TranscodingContainer = allowFmp4TranscodingContainer; + return this; + } + + public TunerHostInfo.Builder allowStreamSharing(Boolean allowStreamSharing) { + this.instance.allowStreamSharing = allowStreamSharing; + return this; + } + + public TunerHostInfo.Builder fallbackMaxStreamingBitrate(Integer fallbackMaxStreamingBitrate) { + this.instance.fallbackMaxStreamingBitrate = fallbackMaxStreamingBitrate; + return this; + } + + public TunerHostInfo.Builder enableStreamLooping(Boolean enableStreamLooping) { + this.instance.enableStreamLooping = enableStreamLooping; + return this; + } + + public TunerHostInfo.Builder source(String source) { + this.instance.source = source; + return this; + } + + public TunerHostInfo.Builder tunerCount(Integer tunerCount) { + this.instance.tunerCount = tunerCount; + return this; + } + + public TunerHostInfo.Builder userAgent(String userAgent) { + this.instance.userAgent = userAgent; + return this; + } + + public TunerHostInfo.Builder ignoreDts(Boolean ignoreDts) { + this.instance.ignoreDts = ignoreDts; + return this; + } + + /** + * returns a built TunerHostInfo instance. + * + * The builder is not reusable. + */ + public TunerHostInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TunerHostInfo.Builder builder() { + return new TunerHostInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TunerHostInfo.Builder toBuilder() { + return new TunerHostInfo.Builder().id(getId()).url(getUrl()).type(getType()).deviceId(getDeviceId()) + .friendlyName(getFriendlyName()).importFavoritesOnly(getImportFavoritesOnly()) + .allowHWTranscoding(getAllowHWTranscoding()) + .allowFmp4TranscodingContainer(getAllowFmp4TranscodingContainer()) + .allowStreamSharing(getAllowStreamSharing()) + .fallbackMaxStreamingBitrate(getFallbackMaxStreamingBitrate()) + .enableStreamLooping(getEnableStreamLooping()).source(getSource()).tunerCount(getTunerCount()) + .userAgent(getUserAgent()).ignoreDts(getIgnoreDts()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TypeOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TypeOptions.java new file mode 100644 index 0000000000000..8450ba51f3a84 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/TypeOptions.java @@ -0,0 +1,456 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TypeOptions + */ +@JsonPropertyOrder({ TypeOptions.JSON_PROPERTY_TYPE, TypeOptions.JSON_PROPERTY_METADATA_FETCHERS, + TypeOptions.JSON_PROPERTY_METADATA_FETCHER_ORDER, TypeOptions.JSON_PROPERTY_IMAGE_FETCHERS, + TypeOptions.JSON_PROPERTY_IMAGE_FETCHER_ORDER, TypeOptions.JSON_PROPERTY_IMAGE_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TypeOptions { + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_METADATA_FETCHERS = "MetadataFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List metadataFetchers; + + public static final String JSON_PROPERTY_METADATA_FETCHER_ORDER = "MetadataFetcherOrder"; + @org.eclipse.jdt.annotation.NonNull + private List metadataFetcherOrder; + + public static final String JSON_PROPERTY_IMAGE_FETCHERS = "ImageFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List imageFetchers; + + public static final String JSON_PROPERTY_IMAGE_FETCHER_ORDER = "ImageFetcherOrder"; + @org.eclipse.jdt.annotation.NonNull + private List imageFetcherOrder; + + public static final String JSON_PROPERTY_IMAGE_OPTIONS = "ImageOptions"; + @org.eclipse.jdt.annotation.NonNull + private List imageOptions; + + public TypeOptions() { + } + + public TypeOptions type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public TypeOptions metadataFetchers(@org.eclipse.jdt.annotation.NonNull List metadataFetchers) { + this.metadataFetchers = metadataFetchers; + return this; + } + + public TypeOptions addMetadataFetchersItem(String metadataFetchersItem) { + if (this.metadataFetchers == null) { + this.metadataFetchers = new ArrayList<>(); + } + this.metadataFetchers.add(metadataFetchersItem); + return this; + } + + /** + * Get metadataFetchers + * + * @return metadataFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMetadataFetchers() { + return metadataFetchers; + } + + @JsonProperty(JSON_PROPERTY_METADATA_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataFetchers(@org.eclipse.jdt.annotation.NonNull List metadataFetchers) { + this.metadataFetchers = metadataFetchers; + } + + public TypeOptions metadataFetcherOrder(@org.eclipse.jdt.annotation.NonNull List metadataFetcherOrder) { + this.metadataFetcherOrder = metadataFetcherOrder; + return this; + } + + public TypeOptions addMetadataFetcherOrderItem(String metadataFetcherOrderItem) { + if (this.metadataFetcherOrder == null) { + this.metadataFetcherOrder = new ArrayList<>(); + } + this.metadataFetcherOrder.add(metadataFetcherOrderItem); + return this; + } + + /** + * Get metadataFetcherOrder + * + * @return metadataFetcherOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMetadataFetcherOrder() { + return metadataFetcherOrder; + } + + @JsonProperty(JSON_PROPERTY_METADATA_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataFetcherOrder(@org.eclipse.jdt.annotation.NonNull List metadataFetcherOrder) { + this.metadataFetcherOrder = metadataFetcherOrder; + } + + public TypeOptions imageFetchers(@org.eclipse.jdt.annotation.NonNull List imageFetchers) { + this.imageFetchers = imageFetchers; + return this; + } + + public TypeOptions addImageFetchersItem(String imageFetchersItem) { + if (this.imageFetchers == null) { + this.imageFetchers = new ArrayList<>(); + } + this.imageFetchers.add(imageFetchersItem); + return this; + } + + /** + * Get imageFetchers + * + * @return imageFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getImageFetchers() { + return imageFetchers; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageFetchers(@org.eclipse.jdt.annotation.NonNull List imageFetchers) { + this.imageFetchers = imageFetchers; + } + + public TypeOptions imageFetcherOrder(@org.eclipse.jdt.annotation.NonNull List imageFetcherOrder) { + this.imageFetcherOrder = imageFetcherOrder; + return this; + } + + public TypeOptions addImageFetcherOrderItem(String imageFetcherOrderItem) { + if (this.imageFetcherOrder == null) { + this.imageFetcherOrder = new ArrayList<>(); + } + this.imageFetcherOrder.add(imageFetcherOrderItem); + return this; + } + + /** + * Get imageFetcherOrder + * + * @return imageFetcherOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getImageFetcherOrder() { + return imageFetcherOrder; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageFetcherOrder(@org.eclipse.jdt.annotation.NonNull List imageFetcherOrder) { + this.imageFetcherOrder = imageFetcherOrder; + } + + public TypeOptions imageOptions(@org.eclipse.jdt.annotation.NonNull List imageOptions) { + this.imageOptions = imageOptions; + return this; + } + + public TypeOptions addImageOptionsItem(ImageOption imageOptionsItem) { + if (this.imageOptions == null) { + this.imageOptions = new ArrayList<>(); + } + this.imageOptions.add(imageOptionsItem); + return this; + } + + /** + * Get imageOptions + * + * @return imageOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getImageOptions() { + return imageOptions; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageOptions(@org.eclipse.jdt.annotation.NonNull List imageOptions) { + this.imageOptions = imageOptions; + } + + /** + * Return true if this TypeOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeOptions typeOptions = (TypeOptions) o; + return Objects.equals(this.type, typeOptions.type) + && Objects.equals(this.metadataFetchers, typeOptions.metadataFetchers) + && Objects.equals(this.metadataFetcherOrder, typeOptions.metadataFetcherOrder) + && Objects.equals(this.imageFetchers, typeOptions.imageFetchers) + && Objects.equals(this.imageFetcherOrder, typeOptions.imageFetcherOrder) + && Objects.equals(this.imageOptions, typeOptions.imageOptions); + } + + @Override + public int hashCode() { + return Objects.hash(type, metadataFetchers, metadataFetcherOrder, imageFetchers, imageFetcherOrder, + imageOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeOptions {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" metadataFetchers: ").append(toIndentedString(metadataFetchers)).append("\n"); + sb.append(" metadataFetcherOrder: ").append(toIndentedString(metadataFetcherOrder)).append("\n"); + sb.append(" imageFetchers: ").append(toIndentedString(imageFetchers)).append("\n"); + sb.append(" imageFetcherOrder: ").append(toIndentedString(imageFetcherOrder)).append("\n"); + sb.append(" imageOptions: ").append(toIndentedString(imageOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `MetadataFetchers` to the URL query string + if (getMetadataFetchers() != null) { + for (int i = 0; i < getMetadataFetchers().size(); i++) { + joiner.add(String.format("%sMetadataFetchers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMetadataFetchers().get(i))))); + } + } + + // add `MetadataFetcherOrder` to the URL query string + if (getMetadataFetcherOrder() != null) { + for (int i = 0; i < getMetadataFetcherOrder().size(); i++) { + joiner.add(String.format("%sMetadataFetcherOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMetadataFetcherOrder().get(i))))); + } + } + + // add `ImageFetchers` to the URL query string + if (getImageFetchers() != null) { + for (int i = 0; i < getImageFetchers().size(); i++) { + joiner.add(String.format("%sImageFetchers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getImageFetchers().get(i))))); + } + } + + // add `ImageFetcherOrder` to the URL query string + if (getImageFetcherOrder() != null) { + for (int i = 0; i < getImageFetcherOrder().size(); i++) { + joiner.add(String.format("%sImageFetcherOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getImageFetcherOrder().get(i))))); + } + } + + // add `ImageOptions` to the URL query string + if (getImageOptions() != null) { + for (int i = 0; i < getImageOptions().size(); i++) { + if (getImageOptions().get(i) != null) { + joiner.add(getImageOptions().get(i).toUrlQueryString(String.format("%sImageOptions%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private TypeOptions instance; + + public Builder() { + this(new TypeOptions()); + } + + protected Builder(TypeOptions instance) { + this.instance = instance; + } + + public TypeOptions.Builder type(String type) { + this.instance.type = type; + return this; + } + + public TypeOptions.Builder metadataFetchers(List metadataFetchers) { + this.instance.metadataFetchers = metadataFetchers; + return this; + } + + public TypeOptions.Builder metadataFetcherOrder(List metadataFetcherOrder) { + this.instance.metadataFetcherOrder = metadataFetcherOrder; + return this; + } + + public TypeOptions.Builder imageFetchers(List imageFetchers) { + this.instance.imageFetchers = imageFetchers; + return this; + } + + public TypeOptions.Builder imageFetcherOrder(List imageFetcherOrder) { + this.instance.imageFetcherOrder = imageFetcherOrder; + return this; + } + + public TypeOptions.Builder imageOptions(List imageOptions) { + this.instance.imageOptions = imageOptions; + return this; + } + + /** + * returns a built TypeOptions instance. + * + * The builder is not reusable. + */ + public TypeOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TypeOptions.Builder builder() { + return new TypeOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TypeOptions.Builder toBuilder() { + return new TypeOptions.Builder().type(getType()).metadataFetchers(getMetadataFetchers()) + .metadataFetcherOrder(getMetadataFetcherOrder()).imageFetchers(getImageFetchers()) + .imageFetcherOrder(getImageFetcherOrder()).imageOptions(getImageOptions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UnratedItem.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UnratedItem.java new file mode 100644 index 0000000000000..cde679111f73a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UnratedItem.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * An enum representing an unrated item. + */ +public enum UnratedItem { + + MOVIE("Movie"), + + TRAILER("Trailer"), + + SERIES("Series"), + + MUSIC("Music"), + + BOOK("Book"), + + LIVE_TV_CHANNEL("LiveTvChannel"), + + LIVE_TV_PROGRAM("LiveTvProgram"), + + CHANNEL_CONTENT("ChannelContent"), + + OTHER("Other"); + + private String value; + + UnratedItem(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static UnratedItem fromValue(String value) { + for (UnratedItem b : UnratedItem.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdateLibraryOptionsDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdateLibraryOptionsDto.java new file mode 100644 index 0000000000000..d13e8fad08278 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdateLibraryOptionsDto.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Update library options dto. + */ +@JsonPropertyOrder({ UpdateLibraryOptionsDto.JSON_PROPERTY_ID, UpdateLibraryOptionsDto.JSON_PROPERTY_LIBRARY_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UpdateLibraryOptionsDto { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_LIBRARY_OPTIONS = "LibraryOptions"; + @org.eclipse.jdt.annotation.NonNull + private LibraryOptions libraryOptions; + + public UpdateLibraryOptionsDto() { + } + + public UpdateLibraryOptionsDto id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Gets or sets the library item id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public UpdateLibraryOptionsDto libraryOptions(@org.eclipse.jdt.annotation.NonNull LibraryOptions libraryOptions) { + this.libraryOptions = libraryOptions; + return this; + } + + /** + * Gets or sets library options. + * + * @return libraryOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIBRARY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LibraryOptions getLibraryOptions() { + return libraryOptions; + } + + @JsonProperty(JSON_PROPERTY_LIBRARY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLibraryOptions(@org.eclipse.jdt.annotation.NonNull LibraryOptions libraryOptions) { + this.libraryOptions = libraryOptions; + } + + /** + * Return true if this UpdateLibraryOptionsDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateLibraryOptionsDto updateLibraryOptionsDto = (UpdateLibraryOptionsDto) o; + return Objects.equals(this.id, updateLibraryOptionsDto.id) + && Objects.equals(this.libraryOptions, updateLibraryOptionsDto.libraryOptions); + } + + @Override + public int hashCode() { + return Objects.hash(id, libraryOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateLibraryOptionsDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" libraryOptions: ").append(toIndentedString(libraryOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `LibraryOptions` to the URL query string + if (getLibraryOptions() != null) { + joiner.add(getLibraryOptions().toUrlQueryString(prefix + "LibraryOptions" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private UpdateLibraryOptionsDto instance; + + public Builder() { + this(new UpdateLibraryOptionsDto()); + } + + protected Builder(UpdateLibraryOptionsDto instance) { + this.instance = instance; + } + + public UpdateLibraryOptionsDto.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public UpdateLibraryOptionsDto.Builder libraryOptions(LibraryOptions libraryOptions) { + this.instance.libraryOptions = libraryOptions; + return this; + } + + /** + * returns a built UpdateLibraryOptionsDto instance. + * + * The builder is not reusable. + */ + public UpdateLibraryOptionsDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UpdateLibraryOptionsDto.Builder builder() { + return new UpdateLibraryOptionsDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UpdateLibraryOptionsDto.Builder toBuilder() { + return new UpdateLibraryOptionsDto.Builder().id(getId()).libraryOptions(getLibraryOptions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdateMediaPathRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdateMediaPathRequestDto.java new file mode 100644 index 0000000000000..e33094cce54a6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdateMediaPathRequestDto.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Update library options dto. + */ +@JsonPropertyOrder({ UpdateMediaPathRequestDto.JSON_PROPERTY_NAME, UpdateMediaPathRequestDto.JSON_PROPERTY_PATH_INFO }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UpdateMediaPathRequestDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_PATH_INFO = "PathInfo"; + @org.eclipse.jdt.annotation.Nullable + private MediaPathInfo pathInfo; + + public UpdateMediaPathRequestDto() { + } + + public UpdateMediaPathRequestDto name(@org.eclipse.jdt.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the library name. + * + * @return name + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@org.eclipse.jdt.annotation.Nullable String name) { + this.name = name; + } + + public UpdateMediaPathRequestDto pathInfo(@org.eclipse.jdt.annotation.Nullable MediaPathInfo pathInfo) { + this.pathInfo = pathInfo; + return this; + } + + /** + * Gets or sets library folder path information. + * + * @return pathInfo + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATH_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MediaPathInfo getPathInfo() { + return pathInfo; + } + + @JsonProperty(JSON_PROPERTY_PATH_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPathInfo(@org.eclipse.jdt.annotation.Nullable MediaPathInfo pathInfo) { + this.pathInfo = pathInfo; + } + + /** + * Return true if this UpdateMediaPathRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateMediaPathRequestDto updateMediaPathRequestDto = (UpdateMediaPathRequestDto) o; + return Objects.equals(this.name, updateMediaPathRequestDto.name) + && Objects.equals(this.pathInfo, updateMediaPathRequestDto.pathInfo); + } + + @Override + public int hashCode() { + return Objects.hash(name, pathInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateMediaPathRequestDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" pathInfo: ").append(toIndentedString(pathInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `PathInfo` to the URL query string + if (getPathInfo() != null) { + joiner.add(getPathInfo().toUrlQueryString(prefix + "PathInfo" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private UpdateMediaPathRequestDto instance; + + public Builder() { + this(new UpdateMediaPathRequestDto()); + } + + protected Builder(UpdateMediaPathRequestDto instance) { + this.instance = instance; + } + + public UpdateMediaPathRequestDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public UpdateMediaPathRequestDto.Builder pathInfo(MediaPathInfo pathInfo) { + this.instance.pathInfo = pathInfo; + return this; + } + + /** + * returns a built UpdateMediaPathRequestDto instance. + * + * The builder is not reusable. + */ + public UpdateMediaPathRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UpdateMediaPathRequestDto.Builder builder() { + return new UpdateMediaPathRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UpdateMediaPathRequestDto.Builder toBuilder() { + return new UpdateMediaPathRequestDto.Builder().name(getName()).pathInfo(getPathInfo()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdatePlaylistDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdatePlaylistDto.java new file mode 100644 index 0000000000000..225c14625f211 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdatePlaylistDto.java @@ -0,0 +1,340 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Update existing playlist dto. Fields set to `null` will not be updated and keep their current values. + */ +@JsonPropertyOrder({ UpdatePlaylistDto.JSON_PROPERTY_NAME, UpdatePlaylistDto.JSON_PROPERTY_IDS, + UpdatePlaylistDto.JSON_PROPERTY_USERS, UpdatePlaylistDto.JSON_PROPERTY_IS_PUBLIC }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UpdatePlaylistDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_IDS = "Ids"; + @org.eclipse.jdt.annotation.NonNull + private List ids; + + public static final String JSON_PROPERTY_USERS = "Users"; + @org.eclipse.jdt.annotation.NonNull + private List users; + + public static final String JSON_PROPERTY_IS_PUBLIC = "IsPublic"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPublic; + + public UpdatePlaylistDto() { + } + + public UpdatePlaylistDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name of the new playlist. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public UpdatePlaylistDto ids(@org.eclipse.jdt.annotation.NonNull List ids) { + this.ids = ids; + return this; + } + + public UpdatePlaylistDto addIdsItem(UUID idsItem) { + if (this.ids == null) { + this.ids = new ArrayList<>(); + } + this.ids.add(idsItem); + return this; + } + + /** + * Gets or sets item ids of the playlist. + * + * @return ids + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIds() { + return ids; + } + + @JsonProperty(JSON_PROPERTY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIds(@org.eclipse.jdt.annotation.NonNull List ids) { + this.ids = ids; + } + + public UpdatePlaylistDto users(@org.eclipse.jdt.annotation.NonNull List users) { + this.users = users; + return this; + } + + public UpdatePlaylistDto addUsersItem(PlaylistUserPermissions usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + return this; + } + + /** + * Gets or sets the playlist users. + * + * @return users + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getUsers() { + return users; + } + + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsers(@org.eclipse.jdt.annotation.NonNull List users) { + this.users = users; + } + + public UpdatePlaylistDto isPublic(@org.eclipse.jdt.annotation.NonNull Boolean isPublic) { + this.isPublic = isPublic; + return this; + } + + /** + * Gets or sets a value indicating whether the playlist is public. + * + * @return isPublic + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PUBLIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPublic() { + return isPublic; + } + + @JsonProperty(JSON_PROPERTY_IS_PUBLIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPublic(@org.eclipse.jdt.annotation.NonNull Boolean isPublic) { + this.isPublic = isPublic; + } + + /** + * Return true if this UpdatePlaylistDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePlaylistDto updatePlaylistDto = (UpdatePlaylistDto) o; + return Objects.equals(this.name, updatePlaylistDto.name) && Objects.equals(this.ids, updatePlaylistDto.ids) + && Objects.equals(this.users, updatePlaylistDto.users) + && Objects.equals(this.isPublic, updatePlaylistDto.isPublic); + } + + @Override + public int hashCode() { + return Objects.hash(name, ids, users, isPublic); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdatePlaylistDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ids: ").append(toIndentedString(ids)).append("\n"); + sb.append(" users: ").append(toIndentedString(users)).append("\n"); + sb.append(" isPublic: ").append(toIndentedString(isPublic)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Ids` to the URL query string + if (getIds() != null) { + for (int i = 0; i < getIds().size(); i++) { + if (getIds().get(i) != null) { + joiner.add(String.format("%sIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getIds().get(i))))); + } + } + } + + // add `Users` to the URL query string + if (getUsers() != null) { + for (int i = 0; i < getUsers().size(); i++) { + if (getUsers().get(i) != null) { + joiner.add(getUsers().get(i).toUrlQueryString(String.format("%sUsers%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `IsPublic` to the URL query string + if (getIsPublic() != null) { + joiner.add(String.format("%sIsPublic%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPublic())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UpdatePlaylistDto instance; + + public Builder() { + this(new UpdatePlaylistDto()); + } + + protected Builder(UpdatePlaylistDto instance) { + this.instance = instance; + } + + public UpdatePlaylistDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public UpdatePlaylistDto.Builder ids(List ids) { + this.instance.ids = ids; + return this; + } + + public UpdatePlaylistDto.Builder users(List users) { + this.instance.users = users; + return this; + } + + public UpdatePlaylistDto.Builder isPublic(Boolean isPublic) { + this.instance.isPublic = isPublic; + return this; + } + + /** + * returns a built UpdatePlaylistDto instance. + * + * The builder is not reusable. + */ + public UpdatePlaylistDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UpdatePlaylistDto.Builder builder() { + return new UpdatePlaylistDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UpdatePlaylistDto.Builder toBuilder() { + return new UpdatePlaylistDto.Builder().name(getName()).ids(getIds()).users(getUsers()).isPublic(getIsPublic()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdatePlaylistUserDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdatePlaylistUserDto.java new file mode 100644 index 0000000000000..ca1dbc38120d6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdatePlaylistUserDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values. + */ +@JsonPropertyOrder({ UpdatePlaylistUserDto.JSON_PROPERTY_CAN_EDIT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UpdatePlaylistUserDto { + public static final String JSON_PROPERTY_CAN_EDIT = "CanEdit"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canEdit; + + public UpdatePlaylistUserDto() { + } + + public UpdatePlaylistUserDto canEdit(@org.eclipse.jdt.annotation.NonNull Boolean canEdit) { + this.canEdit = canEdit; + return this; + } + + /** + * Gets or sets a value indicating whether the user can edit the playlist. + * + * @return canEdit + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_EDIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanEdit() { + return canEdit; + } + + @JsonProperty(JSON_PROPERTY_CAN_EDIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanEdit(@org.eclipse.jdt.annotation.NonNull Boolean canEdit) { + this.canEdit = canEdit; + } + + /** + * Return true if this UpdatePlaylistUserDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePlaylistUserDto updatePlaylistUserDto = (UpdatePlaylistUserDto) o; + return Objects.equals(this.canEdit, updatePlaylistUserDto.canEdit); + } + + @Override + public int hashCode() { + return Objects.hash(canEdit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdatePlaylistUserDto {\n"); + sb.append(" canEdit: ").append(toIndentedString(canEdit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `CanEdit` to the URL query string + if (getCanEdit() != null) { + joiner.add(String.format("%sCanEdit%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanEdit())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UpdatePlaylistUserDto instance; + + public Builder() { + this(new UpdatePlaylistUserDto()); + } + + protected Builder(UpdatePlaylistUserDto instance) { + this.instance = instance; + } + + public UpdatePlaylistUserDto.Builder canEdit(Boolean canEdit) { + this.instance.canEdit = canEdit; + return this; + } + + /** + * returns a built UpdatePlaylistUserDto instance. + * + * The builder is not reusable. + */ + public UpdatePlaylistUserDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UpdatePlaylistUserDto.Builder builder() { + return new UpdatePlaylistUserDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UpdatePlaylistUserDto.Builder toBuilder() { + return new UpdatePlaylistUserDto.Builder().canEdit(getCanEdit()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdateUserItemDataDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdateUserItemDataDto.java new file mode 100644 index 0000000000000..a5ffe99265781 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdateUserItemDataDto.java @@ -0,0 +1,602 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * This is used by the api to get information about a item user data. + */ +@JsonPropertyOrder({ UpdateUserItemDataDto.JSON_PROPERTY_RATING, UpdateUserItemDataDto.JSON_PROPERTY_PLAYED_PERCENTAGE, + UpdateUserItemDataDto.JSON_PROPERTY_UNPLAYED_ITEM_COUNT, + UpdateUserItemDataDto.JSON_PROPERTY_PLAYBACK_POSITION_TICKS, UpdateUserItemDataDto.JSON_PROPERTY_PLAY_COUNT, + UpdateUserItemDataDto.JSON_PROPERTY_IS_FAVORITE, UpdateUserItemDataDto.JSON_PROPERTY_LIKES, + UpdateUserItemDataDto.JSON_PROPERTY_LAST_PLAYED_DATE, UpdateUserItemDataDto.JSON_PROPERTY_PLAYED, + UpdateUserItemDataDto.JSON_PROPERTY_KEY, UpdateUserItemDataDto.JSON_PROPERTY_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UpdateUserItemDataDto { + public static final String JSON_PROPERTY_RATING = "Rating"; + @org.eclipse.jdt.annotation.NonNull + private Double rating; + + public static final String JSON_PROPERTY_PLAYED_PERCENTAGE = "PlayedPercentage"; + @org.eclipse.jdt.annotation.NonNull + private Double playedPercentage; + + public static final String JSON_PROPERTY_UNPLAYED_ITEM_COUNT = "UnplayedItemCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer unplayedItemCount; + + public static final String JSON_PROPERTY_PLAYBACK_POSITION_TICKS = "PlaybackPositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long playbackPositionTicks; + + public static final String JSON_PROPERTY_PLAY_COUNT = "PlayCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer playCount; + + public static final String JSON_PROPERTY_IS_FAVORITE = "IsFavorite"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isFavorite; + + public static final String JSON_PROPERTY_LIKES = "Likes"; + @org.eclipse.jdt.annotation.NonNull + private Boolean likes; + + public static final String JSON_PROPERTY_LAST_PLAYED_DATE = "LastPlayedDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime lastPlayedDate; + + public static final String JSON_PROPERTY_PLAYED = "Played"; + @org.eclipse.jdt.annotation.NonNull + private Boolean played; + + public static final String JSON_PROPERTY_KEY = "Key"; + @org.eclipse.jdt.annotation.NonNull + private String key; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private String itemId; + + public UpdateUserItemDataDto() { + } + + public UpdateUserItemDataDto rating(@org.eclipse.jdt.annotation.NonNull Double rating) { + this.rating = rating; + return this; + } + + /** + * Gets or sets the rating. + * + * @return rating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getRating() { + return rating; + } + + @JsonProperty(JSON_PROPERTY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRating(@org.eclipse.jdt.annotation.NonNull Double rating) { + this.rating = rating; + } + + public UpdateUserItemDataDto playedPercentage(@org.eclipse.jdt.annotation.NonNull Double playedPercentage) { + this.playedPercentage = playedPercentage; + return this; + } + + /** + * Gets or sets the played percentage. + * + * @return playedPercentage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYED_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getPlayedPercentage() { + return playedPercentage; + } + + @JsonProperty(JSON_PROPERTY_PLAYED_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayedPercentage(@org.eclipse.jdt.annotation.NonNull Double playedPercentage) { + this.playedPercentage = playedPercentage; + } + + public UpdateUserItemDataDto unplayedItemCount(@org.eclipse.jdt.annotation.NonNull Integer unplayedItemCount) { + this.unplayedItemCount = unplayedItemCount; + return this; + } + + /** + * Gets or sets the unplayed item count. + * + * @return unplayedItemCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_UNPLAYED_ITEM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUnplayedItemCount() { + return unplayedItemCount; + } + + @JsonProperty(JSON_PROPERTY_UNPLAYED_ITEM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnplayedItemCount(@org.eclipse.jdt.annotation.NonNull Integer unplayedItemCount) { + this.unplayedItemCount = unplayedItemCount; + } + + public UpdateUserItemDataDto playbackPositionTicks(@org.eclipse.jdt.annotation.NonNull Long playbackPositionTicks) { + this.playbackPositionTicks = playbackPositionTicks; + return this; + } + + /** + * Gets or sets the playback position ticks. + * + * @return playbackPositionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYBACK_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPlaybackPositionTicks() { + return playbackPositionTicks; + } + + @JsonProperty(JSON_PROPERTY_PLAYBACK_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaybackPositionTicks(@org.eclipse.jdt.annotation.NonNull Long playbackPositionTicks) { + this.playbackPositionTicks = playbackPositionTicks; + } + + public UpdateUserItemDataDto playCount(@org.eclipse.jdt.annotation.NonNull Integer playCount) { + this.playCount = playCount; + return this; + } + + /** + * Gets or sets the play count. + * + * @return playCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPlayCount() { + return playCount; + } + + @JsonProperty(JSON_PROPERTY_PLAY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayCount(@org.eclipse.jdt.annotation.NonNull Integer playCount) { + this.playCount = playCount; + } + + public UpdateUserItemDataDto isFavorite(@org.eclipse.jdt.annotation.NonNull Boolean isFavorite) { + this.isFavorite = isFavorite; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is favorite. + * + * @return isFavorite + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_FAVORITE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsFavorite() { + return isFavorite; + } + + @JsonProperty(JSON_PROPERTY_IS_FAVORITE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsFavorite(@org.eclipse.jdt.annotation.NonNull Boolean isFavorite) { + this.isFavorite = isFavorite; + } + + public UpdateUserItemDataDto likes(@org.eclipse.jdt.annotation.NonNull Boolean likes) { + this.likes = likes; + return this; + } + + /** + * Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UpdateUserItemDataDto is likes. + * + * @return likes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIKES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getLikes() { + return likes; + } + + @JsonProperty(JSON_PROPERTY_LIKES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLikes(@org.eclipse.jdt.annotation.NonNull Boolean likes) { + this.likes = likes; + } + + public UpdateUserItemDataDto lastPlayedDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastPlayedDate) { + this.lastPlayedDate = lastPlayedDate; + return this; + } + + /** + * Gets or sets the last played date. + * + * @return lastPlayedDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_PLAYED_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastPlayedDate() { + return lastPlayedDate; + } + + @JsonProperty(JSON_PROPERTY_LAST_PLAYED_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastPlayedDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastPlayedDate) { + this.lastPlayedDate = lastPlayedDate; + } + + public UpdateUserItemDataDto played(@org.eclipse.jdt.annotation.NonNull Boolean played) { + this.played = played; + return this; + } + + /** + * Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played. + * + * @return played + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPlayed() { + return played; + } + + @JsonProperty(JSON_PROPERTY_PLAYED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayed(@org.eclipse.jdt.annotation.NonNull Boolean played) { + this.played = played; + } + + public UpdateUserItemDataDto key(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + return this; + } + + /** + * Gets or sets the key. + * + * @return key + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + } + + public UpdateUserItemDataDto itemId(@org.eclipse.jdt.annotation.NonNull String itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item identifier. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull String itemId) { + this.itemId = itemId; + } + + /** + * Return true if this UpdateUserItemDataDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserItemDataDto updateUserItemDataDto = (UpdateUserItemDataDto) o; + return Objects.equals(this.rating, updateUserItemDataDto.rating) + && Objects.equals(this.playedPercentage, updateUserItemDataDto.playedPercentage) + && Objects.equals(this.unplayedItemCount, updateUserItemDataDto.unplayedItemCount) + && Objects.equals(this.playbackPositionTicks, updateUserItemDataDto.playbackPositionTicks) + && Objects.equals(this.playCount, updateUserItemDataDto.playCount) + && Objects.equals(this.isFavorite, updateUserItemDataDto.isFavorite) + && Objects.equals(this.likes, updateUserItemDataDto.likes) + && Objects.equals(this.lastPlayedDate, updateUserItemDataDto.lastPlayedDate) + && Objects.equals(this.played, updateUserItemDataDto.played) + && Objects.equals(this.key, updateUserItemDataDto.key) + && Objects.equals(this.itemId, updateUserItemDataDto.itemId); + } + + @Override + public int hashCode() { + return Objects.hash(rating, playedPercentage, unplayedItemCount, playbackPositionTicks, playCount, isFavorite, + likes, lastPlayedDate, played, key, itemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateUserItemDataDto {\n"); + sb.append(" rating: ").append(toIndentedString(rating)).append("\n"); + sb.append(" playedPercentage: ").append(toIndentedString(playedPercentage)).append("\n"); + sb.append(" unplayedItemCount: ").append(toIndentedString(unplayedItemCount)).append("\n"); + sb.append(" playbackPositionTicks: ").append(toIndentedString(playbackPositionTicks)).append("\n"); + sb.append(" playCount: ").append(toIndentedString(playCount)).append("\n"); + sb.append(" isFavorite: ").append(toIndentedString(isFavorite)).append("\n"); + sb.append(" likes: ").append(toIndentedString(likes)).append("\n"); + sb.append(" lastPlayedDate: ").append(toIndentedString(lastPlayedDate)).append("\n"); + sb.append(" played: ").append(toIndentedString(played)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Rating` to the URL query string + if (getRating() != null) { + joiner.add(String.format("%sRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRating())))); + } + + // add `PlayedPercentage` to the URL query string + if (getPlayedPercentage() != null) { + joiner.add(String.format("%sPlayedPercentage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayedPercentage())))); + } + + // add `UnplayedItemCount` to the URL query string + if (getUnplayedItemCount() != null) { + joiner.add(String.format("%sUnplayedItemCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUnplayedItemCount())))); + } + + // add `PlaybackPositionTicks` to the URL query string + if (getPlaybackPositionTicks() != null) { + joiner.add(String.format("%sPlaybackPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaybackPositionTicks())))); + } + + // add `PlayCount` to the URL query string + if (getPlayCount() != null) { + joiner.add(String.format("%sPlayCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayCount())))); + } + + // add `IsFavorite` to the URL query string + if (getIsFavorite() != null) { + joiner.add(String.format("%sIsFavorite%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsFavorite())))); + } + + // add `Likes` to the URL query string + if (getLikes() != null) { + joiner.add(String.format("%sLikes%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLikes())))); + } + + // add `LastPlayedDate` to the URL query string + if (getLastPlayedDate() != null) { + joiner.add(String.format("%sLastPlayedDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastPlayedDate())))); + } + + // add `Played` to the URL query string + if (getPlayed() != null) { + joiner.add(String.format("%sPlayed%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayed())))); + } + + // add `Key` to the URL query string + if (getKey() != null) { + joiner.add(String.format("%sKey%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getKey())))); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UpdateUserItemDataDto instance; + + public Builder() { + this(new UpdateUserItemDataDto()); + } + + protected Builder(UpdateUserItemDataDto instance) { + this.instance = instance; + } + + public UpdateUserItemDataDto.Builder rating(Double rating) { + this.instance.rating = rating; + return this; + } + + public UpdateUserItemDataDto.Builder playedPercentage(Double playedPercentage) { + this.instance.playedPercentage = playedPercentage; + return this; + } + + public UpdateUserItemDataDto.Builder unplayedItemCount(Integer unplayedItemCount) { + this.instance.unplayedItemCount = unplayedItemCount; + return this; + } + + public UpdateUserItemDataDto.Builder playbackPositionTicks(Long playbackPositionTicks) { + this.instance.playbackPositionTicks = playbackPositionTicks; + return this; + } + + public UpdateUserItemDataDto.Builder playCount(Integer playCount) { + this.instance.playCount = playCount; + return this; + } + + public UpdateUserItemDataDto.Builder isFavorite(Boolean isFavorite) { + this.instance.isFavorite = isFavorite; + return this; + } + + public UpdateUserItemDataDto.Builder likes(Boolean likes) { + this.instance.likes = likes; + return this; + } + + public UpdateUserItemDataDto.Builder lastPlayedDate(OffsetDateTime lastPlayedDate) { + this.instance.lastPlayedDate = lastPlayedDate; + return this; + } + + public UpdateUserItemDataDto.Builder played(Boolean played) { + this.instance.played = played; + return this; + } + + public UpdateUserItemDataDto.Builder key(String key) { + this.instance.key = key; + return this; + } + + public UpdateUserItemDataDto.Builder itemId(String itemId) { + this.instance.itemId = itemId; + return this; + } + + /** + * returns a built UpdateUserItemDataDto instance. + * + * The builder is not reusable. + */ + public UpdateUserItemDataDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UpdateUserItemDataDto.Builder builder() { + return new UpdateUserItemDataDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UpdateUserItemDataDto.Builder toBuilder() { + return new UpdateUserItemDataDto.Builder().rating(getRating()).playedPercentage(getPlayedPercentage()) + .unplayedItemCount(getUnplayedItemCount()).playbackPositionTicks(getPlaybackPositionTicks()) + .playCount(getPlayCount()).isFavorite(getIsFavorite()).likes(getLikes()) + .lastPlayedDate(getLastPlayedDate()).played(getPlayed()).key(getKey()).itemId(getItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdateUserPassword.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdateUserPassword.java new file mode 100644 index 0000000000000..afd580c39d65b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UpdateUserPassword.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The update user password request body. + */ +@JsonPropertyOrder({ UpdateUserPassword.JSON_PROPERTY_CURRENT_PASSWORD, UpdateUserPassword.JSON_PROPERTY_CURRENT_PW, + UpdateUserPassword.JSON_PROPERTY_NEW_PW, UpdateUserPassword.JSON_PROPERTY_RESET_PASSWORD }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UpdateUserPassword { + public static final String JSON_PROPERTY_CURRENT_PASSWORD = "CurrentPassword"; + @org.eclipse.jdt.annotation.NonNull + private String currentPassword; + + public static final String JSON_PROPERTY_CURRENT_PW = "CurrentPw"; + @org.eclipse.jdt.annotation.NonNull + private String currentPw; + + public static final String JSON_PROPERTY_NEW_PW = "NewPw"; + @org.eclipse.jdt.annotation.NonNull + private String newPw; + + public static final String JSON_PROPERTY_RESET_PASSWORD = "ResetPassword"; + @org.eclipse.jdt.annotation.NonNull + private Boolean resetPassword; + + public UpdateUserPassword() { + } + + public UpdateUserPassword currentPassword(@org.eclipse.jdt.annotation.NonNull String currentPassword) { + this.currentPassword = currentPassword; + return this; + } + + /** + * Gets or sets the current sha1-hashed password. + * + * @return currentPassword + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CURRENT_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrentPassword() { + return currentPassword; + } + + @JsonProperty(JSON_PROPERTY_CURRENT_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrentPassword(@org.eclipse.jdt.annotation.NonNull String currentPassword) { + this.currentPassword = currentPassword; + } + + public UpdateUserPassword currentPw(@org.eclipse.jdt.annotation.NonNull String currentPw) { + this.currentPw = currentPw; + return this; + } + + /** + * Gets or sets the current plain text password. + * + * @return currentPw + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CURRENT_PW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrentPw() { + return currentPw; + } + + @JsonProperty(JSON_PROPERTY_CURRENT_PW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrentPw(@org.eclipse.jdt.annotation.NonNull String currentPw) { + this.currentPw = currentPw; + } + + public UpdateUserPassword newPw(@org.eclipse.jdt.annotation.NonNull String newPw) { + this.newPw = newPw; + return this; + } + + /** + * Gets or sets the new plain text password. + * + * @return newPw + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NEW_PW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNewPw() { + return newPw; + } + + @JsonProperty(JSON_PROPERTY_NEW_PW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewPw(@org.eclipse.jdt.annotation.NonNull String newPw) { + this.newPw = newPw; + } + + public UpdateUserPassword resetPassword(@org.eclipse.jdt.annotation.NonNull Boolean resetPassword) { + this.resetPassword = resetPassword; + return this; + } + + /** + * Gets or sets a value indicating whether to reset the password. + * + * @return resetPassword + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RESET_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getResetPassword() { + return resetPassword; + } + + @JsonProperty(JSON_PROPERTY_RESET_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResetPassword(@org.eclipse.jdt.annotation.NonNull Boolean resetPassword) { + this.resetPassword = resetPassword; + } + + /** + * Return true if this UpdateUserPassword object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserPassword updateUserPassword = (UpdateUserPassword) o; + return Objects.equals(this.currentPassword, updateUserPassword.currentPassword) + && Objects.equals(this.currentPw, updateUserPassword.currentPw) + && Objects.equals(this.newPw, updateUserPassword.newPw) + && Objects.equals(this.resetPassword, updateUserPassword.resetPassword); + } + + @Override + public int hashCode() { + return Objects.hash(currentPassword, currentPw, newPw, resetPassword); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateUserPassword {\n"); + sb.append(" currentPassword: ").append(toIndentedString(currentPassword)).append("\n"); + sb.append(" currentPw: ").append(toIndentedString(currentPw)).append("\n"); + sb.append(" newPw: ").append(toIndentedString(newPw)).append("\n"); + sb.append(" resetPassword: ").append(toIndentedString(resetPassword)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `CurrentPassword` to the URL query string + if (getCurrentPassword() != null) { + joiner.add(String.format("%sCurrentPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCurrentPassword())))); + } + + // add `CurrentPw` to the URL query string + if (getCurrentPw() != null) { + joiner.add(String.format("%sCurrentPw%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCurrentPw())))); + } + + // add `NewPw` to the URL query string + if (getNewPw() != null) { + joiner.add(String.format("%sNewPw%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getNewPw())))); + } + + // add `ResetPassword` to the URL query string + if (getResetPassword() != null) { + joiner.add(String.format("%sResetPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getResetPassword())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UpdateUserPassword instance; + + public Builder() { + this(new UpdateUserPassword()); + } + + protected Builder(UpdateUserPassword instance) { + this.instance = instance; + } + + public UpdateUserPassword.Builder currentPassword(String currentPassword) { + this.instance.currentPassword = currentPassword; + return this; + } + + public UpdateUserPassword.Builder currentPw(String currentPw) { + this.instance.currentPw = currentPw; + return this; + } + + public UpdateUserPassword.Builder newPw(String newPw) { + this.instance.newPw = newPw; + return this; + } + + public UpdateUserPassword.Builder resetPassword(Boolean resetPassword) { + this.instance.resetPassword = resetPassword; + return this; + } + + /** + * returns a built UpdateUserPassword instance. + * + * The builder is not reusable. + */ + public UpdateUserPassword build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UpdateUserPassword.Builder builder() { + return new UpdateUserPassword.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UpdateUserPassword.Builder toBuilder() { + return new UpdateUserPassword.Builder().currentPassword(getCurrentPassword()).currentPw(getCurrentPw()) + .newPw(getNewPw()).resetPassword(getResetPassword()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UploadSubtitleDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UploadSubtitleDto.java new file mode 100644 index 0000000000000..3878be567c3cf --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UploadSubtitleDto.java @@ -0,0 +1,355 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Upload subtitles dto. + */ +@JsonPropertyOrder({ UploadSubtitleDto.JSON_PROPERTY_LANGUAGE, UploadSubtitleDto.JSON_PROPERTY_FORMAT, + UploadSubtitleDto.JSON_PROPERTY_IS_FORCED, UploadSubtitleDto.JSON_PROPERTY_IS_HEARING_IMPAIRED, + UploadSubtitleDto.JSON_PROPERTY_DATA }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UploadSubtitleDto { + public static final String JSON_PROPERTY_LANGUAGE = "Language"; + @org.eclipse.jdt.annotation.Nullable + private String language; + + public static final String JSON_PROPERTY_FORMAT = "Format"; + @org.eclipse.jdt.annotation.Nullable + private String format; + + public static final String JSON_PROPERTY_IS_FORCED = "IsForced"; + @org.eclipse.jdt.annotation.Nullable + private Boolean isForced; + + public static final String JSON_PROPERTY_IS_HEARING_IMPAIRED = "IsHearingImpaired"; + @org.eclipse.jdt.annotation.Nullable + private Boolean isHearingImpaired; + + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.Nullable + private String data; + + public UploadSubtitleDto() { + } + + public UploadSubtitleDto language(@org.eclipse.jdt.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * Gets or sets the subtitle language. + * + * @return language + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getLanguage() { + return language; + } + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLanguage(@org.eclipse.jdt.annotation.Nullable String language) { + this.language = language; + } + + public UploadSubtitleDto format(@org.eclipse.jdt.annotation.Nullable String format) { + this.format = format; + return this; + } + + /** + * Gets or sets the subtitle format. + * + * @return format + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFormat() { + return format; + } + + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFormat(@org.eclipse.jdt.annotation.Nullable String format) { + this.format = format; + } + + public UploadSubtitleDto isForced(@org.eclipse.jdt.annotation.Nullable Boolean isForced) { + this.isForced = isForced; + return this; + } + + /** + * Gets or sets a value indicating whether the subtitle is forced. + * + * @return isForced + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_FORCED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsForced() { + return isForced; + } + + @JsonProperty(JSON_PROPERTY_IS_FORCED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsForced(@org.eclipse.jdt.annotation.Nullable Boolean isForced) { + this.isForced = isForced; + } + + public UploadSubtitleDto isHearingImpaired(@org.eclipse.jdt.annotation.Nullable Boolean isHearingImpaired) { + this.isHearingImpaired = isHearingImpaired; + return this; + } + + /** + * Gets or sets a value indicating whether the subtitle is for hearing impaired. + * + * @return isHearingImpaired + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_HEARING_IMPAIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsHearingImpaired() { + return isHearingImpaired; + } + + @JsonProperty(JSON_PROPERTY_IS_HEARING_IMPAIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsHearingImpaired(@org.eclipse.jdt.annotation.Nullable Boolean isHearingImpaired) { + this.isHearingImpaired = isHearingImpaired; + } + + public UploadSubtitleDto data(@org.eclipse.jdt.annotation.Nullable String data) { + this.data = data; + return this; + } + + /** + * Gets or sets the subtitle data. + * + * @return data + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setData(@org.eclipse.jdt.annotation.Nullable String data) { + this.data = data; + } + + /** + * Return true if this UploadSubtitleDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UploadSubtitleDto uploadSubtitleDto = (UploadSubtitleDto) o; + return Objects.equals(this.language, uploadSubtitleDto.language) + && Objects.equals(this.format, uploadSubtitleDto.format) + && Objects.equals(this.isForced, uploadSubtitleDto.isForced) + && Objects.equals(this.isHearingImpaired, uploadSubtitleDto.isHearingImpaired) + && Objects.equals(this.data, uploadSubtitleDto.data); + } + + @Override + public int hashCode() { + return Objects.hash(language, format, isForced, isHearingImpaired, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UploadSubtitleDto {\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" isForced: ").append(toIndentedString(isForced)).append("\n"); + sb.append(" isHearingImpaired: ").append(toIndentedString(isHearingImpaired)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Language` to the URL query string + if (getLanguage() != null) { + joiner.add(String.format("%sLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLanguage())))); + } + + // add `Format` to the URL query string + if (getFormat() != null) { + joiner.add(String.format("%sFormat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFormat())))); + } + + // add `IsForced` to the URL query string + if (getIsForced() != null) { + joiner.add(String.format("%sIsForced%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsForced())))); + } + + // add `IsHearingImpaired` to the URL query string + if (getIsHearingImpaired() != null) { + joiner.add(String.format("%sIsHearingImpaired%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsHearingImpaired())))); + } + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(String.format("%sData%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getData())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UploadSubtitleDto instance; + + public Builder() { + this(new UploadSubtitleDto()); + } + + protected Builder(UploadSubtitleDto instance) { + this.instance = instance; + } + + public UploadSubtitleDto.Builder language(String language) { + this.instance.language = language; + return this; + } + + public UploadSubtitleDto.Builder format(String format) { + this.instance.format = format; + return this; + } + + public UploadSubtitleDto.Builder isForced(Boolean isForced) { + this.instance.isForced = isForced; + return this; + } + + public UploadSubtitleDto.Builder isHearingImpaired(Boolean isHearingImpaired) { + this.instance.isHearingImpaired = isHearingImpaired; + return this; + } + + public UploadSubtitleDto.Builder data(String data) { + this.instance.data = data; + return this; + } + + /** + * returns a built UploadSubtitleDto instance. + * + * The builder is not reusable. + */ + public UploadSubtitleDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UploadSubtitleDto.Builder builder() { + return new UploadSubtitleDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UploadSubtitleDto.Builder toBuilder() { + return new UploadSubtitleDto.Builder().language(getLanguage()).format(getFormat()).isForced(getIsForced()) + .isHearingImpaired(getIsHearingImpaired()).data(getData()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserConfiguration.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserConfiguration.java new file mode 100644 index 0000000000000..404694f1d8990 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserConfiguration.java @@ -0,0 +1,877 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class UserConfiguration. + */ +@JsonPropertyOrder({ UserConfiguration.JSON_PROPERTY_AUDIO_LANGUAGE_PREFERENCE, + UserConfiguration.JSON_PROPERTY_PLAY_DEFAULT_AUDIO_TRACK, + UserConfiguration.JSON_PROPERTY_SUBTITLE_LANGUAGE_PREFERENCE, + UserConfiguration.JSON_PROPERTY_DISPLAY_MISSING_EPISODES, UserConfiguration.JSON_PROPERTY_GROUPED_FOLDERS, + UserConfiguration.JSON_PROPERTY_SUBTITLE_MODE, UserConfiguration.JSON_PROPERTY_DISPLAY_COLLECTIONS_VIEW, + UserConfiguration.JSON_PROPERTY_ENABLE_LOCAL_PASSWORD, UserConfiguration.JSON_PROPERTY_ORDERED_VIEWS, + UserConfiguration.JSON_PROPERTY_LATEST_ITEMS_EXCLUDES, UserConfiguration.JSON_PROPERTY_MY_MEDIA_EXCLUDES, + UserConfiguration.JSON_PROPERTY_HIDE_PLAYED_IN_LATEST, + UserConfiguration.JSON_PROPERTY_REMEMBER_AUDIO_SELECTIONS, + UserConfiguration.JSON_PROPERTY_REMEMBER_SUBTITLE_SELECTIONS, + UserConfiguration.JSON_PROPERTY_ENABLE_NEXT_EPISODE_AUTO_PLAY, + UserConfiguration.JSON_PROPERTY_CAST_RECEIVER_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserConfiguration { + public static final String JSON_PROPERTY_AUDIO_LANGUAGE_PREFERENCE = "AudioLanguagePreference"; + @org.eclipse.jdt.annotation.NonNull + private String audioLanguagePreference; + + public static final String JSON_PROPERTY_PLAY_DEFAULT_AUDIO_TRACK = "PlayDefaultAudioTrack"; + @org.eclipse.jdt.annotation.NonNull + private Boolean playDefaultAudioTrack; + + public static final String JSON_PROPERTY_SUBTITLE_LANGUAGE_PREFERENCE = "SubtitleLanguagePreference"; + @org.eclipse.jdt.annotation.NonNull + private String subtitleLanguagePreference; + + public static final String JSON_PROPERTY_DISPLAY_MISSING_EPISODES = "DisplayMissingEpisodes"; + @org.eclipse.jdt.annotation.NonNull + private Boolean displayMissingEpisodes; + + public static final String JSON_PROPERTY_GROUPED_FOLDERS = "GroupedFolders"; + @org.eclipse.jdt.annotation.NonNull + private List groupedFolders = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUBTITLE_MODE = "SubtitleMode"; + @org.eclipse.jdt.annotation.NonNull + private SubtitlePlaybackMode subtitleMode; + + public static final String JSON_PROPERTY_DISPLAY_COLLECTIONS_VIEW = "DisplayCollectionsView"; + @org.eclipse.jdt.annotation.NonNull + private Boolean displayCollectionsView; + + public static final String JSON_PROPERTY_ENABLE_LOCAL_PASSWORD = "EnableLocalPassword"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableLocalPassword; + + public static final String JSON_PROPERTY_ORDERED_VIEWS = "OrderedViews"; + @org.eclipse.jdt.annotation.NonNull + private List orderedViews = new ArrayList<>(); + + public static final String JSON_PROPERTY_LATEST_ITEMS_EXCLUDES = "LatestItemsExcludes"; + @org.eclipse.jdt.annotation.NonNull + private List latestItemsExcludes = new ArrayList<>(); + + public static final String JSON_PROPERTY_MY_MEDIA_EXCLUDES = "MyMediaExcludes"; + @org.eclipse.jdt.annotation.NonNull + private List myMediaExcludes = new ArrayList<>(); + + public static final String JSON_PROPERTY_HIDE_PLAYED_IN_LATEST = "HidePlayedInLatest"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hidePlayedInLatest; + + public static final String JSON_PROPERTY_REMEMBER_AUDIO_SELECTIONS = "RememberAudioSelections"; + @org.eclipse.jdt.annotation.NonNull + private Boolean rememberAudioSelections; + + public static final String JSON_PROPERTY_REMEMBER_SUBTITLE_SELECTIONS = "RememberSubtitleSelections"; + @org.eclipse.jdt.annotation.NonNull + private Boolean rememberSubtitleSelections; + + public static final String JSON_PROPERTY_ENABLE_NEXT_EPISODE_AUTO_PLAY = "EnableNextEpisodeAutoPlay"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableNextEpisodeAutoPlay; + + public static final String JSON_PROPERTY_CAST_RECEIVER_ID = "CastReceiverId"; + @org.eclipse.jdt.annotation.NonNull + private String castReceiverId; + + public UserConfiguration() { + } + + public UserConfiguration audioLanguagePreference( + @org.eclipse.jdt.annotation.NonNull String audioLanguagePreference) { + this.audioLanguagePreference = audioLanguagePreference; + return this; + } + + /** + * Gets or sets the audio language preference. + * + * @return audioLanguagePreference + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_LANGUAGE_PREFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAudioLanguagePreference() { + return audioLanguagePreference; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_LANGUAGE_PREFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioLanguagePreference(@org.eclipse.jdt.annotation.NonNull String audioLanguagePreference) { + this.audioLanguagePreference = audioLanguagePreference; + } + + public UserConfiguration playDefaultAudioTrack(@org.eclipse.jdt.annotation.NonNull Boolean playDefaultAudioTrack) { + this.playDefaultAudioTrack = playDefaultAudioTrack; + return this; + } + + /** + * Gets or sets a value indicating whether [play default audio track]. + * + * @return playDefaultAudioTrack + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_DEFAULT_AUDIO_TRACK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPlayDefaultAudioTrack() { + return playDefaultAudioTrack; + } + + @JsonProperty(JSON_PROPERTY_PLAY_DEFAULT_AUDIO_TRACK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayDefaultAudioTrack(@org.eclipse.jdt.annotation.NonNull Boolean playDefaultAudioTrack) { + this.playDefaultAudioTrack = playDefaultAudioTrack; + } + + public UserConfiguration subtitleLanguagePreference( + @org.eclipse.jdt.annotation.NonNull String subtitleLanguagePreference) { + this.subtitleLanguagePreference = subtitleLanguagePreference; + return this; + } + + /** + * Gets or sets the subtitle language preference. + * + * @return subtitleLanguagePreference + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_LANGUAGE_PREFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubtitleLanguagePreference() { + return subtitleLanguagePreference; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_LANGUAGE_PREFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleLanguagePreference(@org.eclipse.jdt.annotation.NonNull String subtitleLanguagePreference) { + this.subtitleLanguagePreference = subtitleLanguagePreference; + } + + public UserConfiguration displayMissingEpisodes( + @org.eclipse.jdt.annotation.NonNull Boolean displayMissingEpisodes) { + this.displayMissingEpisodes = displayMissingEpisodes; + return this; + } + + /** + * Get displayMissingEpisodes + * + * @return displayMissingEpisodes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_MISSING_EPISODES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDisplayMissingEpisodes() { + return displayMissingEpisodes; + } + + @JsonProperty(JSON_PROPERTY_DISPLAY_MISSING_EPISODES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayMissingEpisodes(@org.eclipse.jdt.annotation.NonNull Boolean displayMissingEpisodes) { + this.displayMissingEpisodes = displayMissingEpisodes; + } + + public UserConfiguration groupedFolders(@org.eclipse.jdt.annotation.NonNull List groupedFolders) { + this.groupedFolders = groupedFolders; + return this; + } + + public UserConfiguration addGroupedFoldersItem(UUID groupedFoldersItem) { + if (this.groupedFolders == null) { + this.groupedFolders = new ArrayList<>(); + } + this.groupedFolders.add(groupedFoldersItem); + return this; + } + + /** + * Get groupedFolders + * + * @return groupedFolders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUPED_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGroupedFolders() { + return groupedFolders; + } + + @JsonProperty(JSON_PROPERTY_GROUPED_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupedFolders(@org.eclipse.jdt.annotation.NonNull List groupedFolders) { + this.groupedFolders = groupedFolders; + } + + public UserConfiguration subtitleMode(@org.eclipse.jdt.annotation.NonNull SubtitlePlaybackMode subtitleMode) { + this.subtitleMode = subtitleMode; + return this; + } + + /** + * An enum representing a subtitle playback mode. + * + * @return subtitleMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubtitlePlaybackMode getSubtitleMode() { + return subtitleMode; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleMode(@org.eclipse.jdt.annotation.NonNull SubtitlePlaybackMode subtitleMode) { + this.subtitleMode = subtitleMode; + } + + public UserConfiguration displayCollectionsView( + @org.eclipse.jdt.annotation.NonNull Boolean displayCollectionsView) { + this.displayCollectionsView = displayCollectionsView; + return this; + } + + /** + * Get displayCollectionsView + * + * @return displayCollectionsView + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_COLLECTIONS_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDisplayCollectionsView() { + return displayCollectionsView; + } + + @JsonProperty(JSON_PROPERTY_DISPLAY_COLLECTIONS_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayCollectionsView(@org.eclipse.jdt.annotation.NonNull Boolean displayCollectionsView) { + this.displayCollectionsView = displayCollectionsView; + } + + public UserConfiguration enableLocalPassword(@org.eclipse.jdt.annotation.NonNull Boolean enableLocalPassword) { + this.enableLocalPassword = enableLocalPassword; + return this; + } + + /** + * Get enableLocalPassword + * + * @return enableLocalPassword + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_LOCAL_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableLocalPassword() { + return enableLocalPassword; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_LOCAL_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableLocalPassword(@org.eclipse.jdt.annotation.NonNull Boolean enableLocalPassword) { + this.enableLocalPassword = enableLocalPassword; + } + + public UserConfiguration orderedViews(@org.eclipse.jdt.annotation.NonNull List orderedViews) { + this.orderedViews = orderedViews; + return this; + } + + public UserConfiguration addOrderedViewsItem(UUID orderedViewsItem) { + if (this.orderedViews == null) { + this.orderedViews = new ArrayList<>(); + } + this.orderedViews.add(orderedViewsItem); + return this; + } + + /** + * Get orderedViews + * + * @return orderedViews + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORDERED_VIEWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getOrderedViews() { + return orderedViews; + } + + @JsonProperty(JSON_PROPERTY_ORDERED_VIEWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrderedViews(@org.eclipse.jdt.annotation.NonNull List orderedViews) { + this.orderedViews = orderedViews; + } + + public UserConfiguration latestItemsExcludes(@org.eclipse.jdt.annotation.NonNull List latestItemsExcludes) { + this.latestItemsExcludes = latestItemsExcludes; + return this; + } + + public UserConfiguration addLatestItemsExcludesItem(UUID latestItemsExcludesItem) { + if (this.latestItemsExcludes == null) { + this.latestItemsExcludes = new ArrayList<>(); + } + this.latestItemsExcludes.add(latestItemsExcludesItem); + return this; + } + + /** + * Get latestItemsExcludes + * + * @return latestItemsExcludes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LATEST_ITEMS_EXCLUDES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLatestItemsExcludes() { + return latestItemsExcludes; + } + + @JsonProperty(JSON_PROPERTY_LATEST_ITEMS_EXCLUDES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLatestItemsExcludes(@org.eclipse.jdt.annotation.NonNull List latestItemsExcludes) { + this.latestItemsExcludes = latestItemsExcludes; + } + + public UserConfiguration myMediaExcludes(@org.eclipse.jdt.annotation.NonNull List myMediaExcludes) { + this.myMediaExcludes = myMediaExcludes; + return this; + } + + public UserConfiguration addMyMediaExcludesItem(UUID myMediaExcludesItem) { + if (this.myMediaExcludes == null) { + this.myMediaExcludes = new ArrayList<>(); + } + this.myMediaExcludes.add(myMediaExcludesItem); + return this; + } + + /** + * Get myMediaExcludes + * + * @return myMediaExcludes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MY_MEDIA_EXCLUDES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMyMediaExcludes() { + return myMediaExcludes; + } + + @JsonProperty(JSON_PROPERTY_MY_MEDIA_EXCLUDES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyMediaExcludes(@org.eclipse.jdt.annotation.NonNull List myMediaExcludes) { + this.myMediaExcludes = myMediaExcludes; + } + + public UserConfiguration hidePlayedInLatest(@org.eclipse.jdt.annotation.NonNull Boolean hidePlayedInLatest) { + this.hidePlayedInLatest = hidePlayedInLatest; + return this; + } + + /** + * Get hidePlayedInLatest + * + * @return hidePlayedInLatest + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HIDE_PLAYED_IN_LATEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHidePlayedInLatest() { + return hidePlayedInLatest; + } + + @JsonProperty(JSON_PROPERTY_HIDE_PLAYED_IN_LATEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHidePlayedInLatest(@org.eclipse.jdt.annotation.NonNull Boolean hidePlayedInLatest) { + this.hidePlayedInLatest = hidePlayedInLatest; + } + + public UserConfiguration rememberAudioSelections( + @org.eclipse.jdt.annotation.NonNull Boolean rememberAudioSelections) { + this.rememberAudioSelections = rememberAudioSelections; + return this; + } + + /** + * Get rememberAudioSelections + * + * @return rememberAudioSelections + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMEMBER_AUDIO_SELECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRememberAudioSelections() { + return rememberAudioSelections; + } + + @JsonProperty(JSON_PROPERTY_REMEMBER_AUDIO_SELECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRememberAudioSelections(@org.eclipse.jdt.annotation.NonNull Boolean rememberAudioSelections) { + this.rememberAudioSelections = rememberAudioSelections; + } + + public UserConfiguration rememberSubtitleSelections( + @org.eclipse.jdt.annotation.NonNull Boolean rememberSubtitleSelections) { + this.rememberSubtitleSelections = rememberSubtitleSelections; + return this; + } + + /** + * Get rememberSubtitleSelections + * + * @return rememberSubtitleSelections + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMEMBER_SUBTITLE_SELECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRememberSubtitleSelections() { + return rememberSubtitleSelections; + } + + @JsonProperty(JSON_PROPERTY_REMEMBER_SUBTITLE_SELECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRememberSubtitleSelections(@org.eclipse.jdt.annotation.NonNull Boolean rememberSubtitleSelections) { + this.rememberSubtitleSelections = rememberSubtitleSelections; + } + + public UserConfiguration enableNextEpisodeAutoPlay( + @org.eclipse.jdt.annotation.NonNull Boolean enableNextEpisodeAutoPlay) { + this.enableNextEpisodeAutoPlay = enableNextEpisodeAutoPlay; + return this; + } + + /** + * Get enableNextEpisodeAutoPlay + * + * @return enableNextEpisodeAutoPlay + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_NEXT_EPISODE_AUTO_PLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableNextEpisodeAutoPlay() { + return enableNextEpisodeAutoPlay; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_NEXT_EPISODE_AUTO_PLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableNextEpisodeAutoPlay(@org.eclipse.jdt.annotation.NonNull Boolean enableNextEpisodeAutoPlay) { + this.enableNextEpisodeAutoPlay = enableNextEpisodeAutoPlay; + } + + public UserConfiguration castReceiverId(@org.eclipse.jdt.annotation.NonNull String castReceiverId) { + this.castReceiverId = castReceiverId; + return this; + } + + /** + * Gets or sets the id of the selected cast receiver. + * + * @return castReceiverId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAST_RECEIVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCastReceiverId() { + return castReceiverId; + } + + @JsonProperty(JSON_PROPERTY_CAST_RECEIVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCastReceiverId(@org.eclipse.jdt.annotation.NonNull String castReceiverId) { + this.castReceiverId = castReceiverId; + } + + /** + * Return true if this UserConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserConfiguration userConfiguration = (UserConfiguration) o; + return Objects.equals(this.audioLanguagePreference, userConfiguration.audioLanguagePreference) + && Objects.equals(this.playDefaultAudioTrack, userConfiguration.playDefaultAudioTrack) + && Objects.equals(this.subtitleLanguagePreference, userConfiguration.subtitleLanguagePreference) + && Objects.equals(this.displayMissingEpisodes, userConfiguration.displayMissingEpisodes) + && Objects.equals(this.groupedFolders, userConfiguration.groupedFolders) + && Objects.equals(this.subtitleMode, userConfiguration.subtitleMode) + && Objects.equals(this.displayCollectionsView, userConfiguration.displayCollectionsView) + && Objects.equals(this.enableLocalPassword, userConfiguration.enableLocalPassword) + && Objects.equals(this.orderedViews, userConfiguration.orderedViews) + && Objects.equals(this.latestItemsExcludes, userConfiguration.latestItemsExcludes) + && Objects.equals(this.myMediaExcludes, userConfiguration.myMediaExcludes) + && Objects.equals(this.hidePlayedInLatest, userConfiguration.hidePlayedInLatest) + && Objects.equals(this.rememberAudioSelections, userConfiguration.rememberAudioSelections) + && Objects.equals(this.rememberSubtitleSelections, userConfiguration.rememberSubtitleSelections) + && Objects.equals(this.enableNextEpisodeAutoPlay, userConfiguration.enableNextEpisodeAutoPlay) + && Objects.equals(this.castReceiverId, userConfiguration.castReceiverId); + } + + @Override + public int hashCode() { + return Objects.hash(audioLanguagePreference, playDefaultAudioTrack, subtitleLanguagePreference, + displayMissingEpisodes, groupedFolders, subtitleMode, displayCollectionsView, enableLocalPassword, + orderedViews, latestItemsExcludes, myMediaExcludes, hidePlayedInLatest, rememberAudioSelections, + rememberSubtitleSelections, enableNextEpisodeAutoPlay, castReceiverId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserConfiguration {\n"); + sb.append(" audioLanguagePreference: ").append(toIndentedString(audioLanguagePreference)).append("\n"); + sb.append(" playDefaultAudioTrack: ").append(toIndentedString(playDefaultAudioTrack)).append("\n"); + sb.append(" subtitleLanguagePreference: ").append(toIndentedString(subtitleLanguagePreference)).append("\n"); + sb.append(" displayMissingEpisodes: ").append(toIndentedString(displayMissingEpisodes)).append("\n"); + sb.append(" groupedFolders: ").append(toIndentedString(groupedFolders)).append("\n"); + sb.append(" subtitleMode: ").append(toIndentedString(subtitleMode)).append("\n"); + sb.append(" displayCollectionsView: ").append(toIndentedString(displayCollectionsView)).append("\n"); + sb.append(" enableLocalPassword: ").append(toIndentedString(enableLocalPassword)).append("\n"); + sb.append(" orderedViews: ").append(toIndentedString(orderedViews)).append("\n"); + sb.append(" latestItemsExcludes: ").append(toIndentedString(latestItemsExcludes)).append("\n"); + sb.append(" myMediaExcludes: ").append(toIndentedString(myMediaExcludes)).append("\n"); + sb.append(" hidePlayedInLatest: ").append(toIndentedString(hidePlayedInLatest)).append("\n"); + sb.append(" rememberAudioSelections: ").append(toIndentedString(rememberAudioSelections)).append("\n"); + sb.append(" rememberSubtitleSelections: ").append(toIndentedString(rememberSubtitleSelections)).append("\n"); + sb.append(" enableNextEpisodeAutoPlay: ").append(toIndentedString(enableNextEpisodeAutoPlay)).append("\n"); + sb.append(" castReceiverId: ").append(toIndentedString(castReceiverId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `AudioLanguagePreference` to the URL query string + if (getAudioLanguagePreference() != null) { + joiner.add(String.format("%sAudioLanguagePreference%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioLanguagePreference())))); + } + + // add `PlayDefaultAudioTrack` to the URL query string + if (getPlayDefaultAudioTrack() != null) { + joiner.add(String.format("%sPlayDefaultAudioTrack%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayDefaultAudioTrack())))); + } + + // add `SubtitleLanguagePreference` to the URL query string + if (getSubtitleLanguagePreference() != null) { + joiner.add(String.format("%sSubtitleLanguagePreference%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleLanguagePreference())))); + } + + // add `DisplayMissingEpisodes` to the URL query string + if (getDisplayMissingEpisodes() != null) { + joiner.add(String.format("%sDisplayMissingEpisodes%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplayMissingEpisodes())))); + } + + // add `GroupedFolders` to the URL query string + if (getGroupedFolders() != null) { + for (int i = 0; i < getGroupedFolders().size(); i++) { + if (getGroupedFolders().get(i) != null) { + joiner.add(String.format("%sGroupedFolders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getGroupedFolders().get(i))))); + } + } + } + + // add `SubtitleMode` to the URL query string + if (getSubtitleMode() != null) { + joiner.add(String.format("%sSubtitleMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleMode())))); + } + + // add `DisplayCollectionsView` to the URL query string + if (getDisplayCollectionsView() != null) { + joiner.add(String.format("%sDisplayCollectionsView%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplayCollectionsView())))); + } + + // add `EnableLocalPassword` to the URL query string + if (getEnableLocalPassword() != null) { + joiner.add(String.format("%sEnableLocalPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableLocalPassword())))); + } + + // add `OrderedViews` to the URL query string + if (getOrderedViews() != null) { + for (int i = 0; i < getOrderedViews().size(); i++) { + if (getOrderedViews().get(i) != null) { + joiner.add(String.format("%sOrderedViews%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getOrderedViews().get(i))))); + } + } + } + + // add `LatestItemsExcludes` to the URL query string + if (getLatestItemsExcludes() != null) { + for (int i = 0; i < getLatestItemsExcludes().size(); i++) { + if (getLatestItemsExcludes().get(i) != null) { + joiner.add(String.format("%sLatestItemsExcludes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLatestItemsExcludes().get(i))))); + } + } + } + + // add `MyMediaExcludes` to the URL query string + if (getMyMediaExcludes() != null) { + for (int i = 0; i < getMyMediaExcludes().size(); i++) { + if (getMyMediaExcludes().get(i) != null) { + joiner.add(String.format("%sMyMediaExcludes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMyMediaExcludes().get(i))))); + } + } + } + + // add `HidePlayedInLatest` to the URL query string + if (getHidePlayedInLatest() != null) { + joiner.add(String.format("%sHidePlayedInLatest%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHidePlayedInLatest())))); + } + + // add `RememberAudioSelections` to the URL query string + if (getRememberAudioSelections() != null) { + joiner.add(String.format("%sRememberAudioSelections%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRememberAudioSelections())))); + } + + // add `RememberSubtitleSelections` to the URL query string + if (getRememberSubtitleSelections() != null) { + joiner.add(String.format("%sRememberSubtitleSelections%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRememberSubtitleSelections())))); + } + + // add `EnableNextEpisodeAutoPlay` to the URL query string + if (getEnableNextEpisodeAutoPlay() != null) { + joiner.add(String.format("%sEnableNextEpisodeAutoPlay%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableNextEpisodeAutoPlay())))); + } + + // add `CastReceiverId` to the URL query string + if (getCastReceiverId() != null) { + joiner.add(String.format("%sCastReceiverId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCastReceiverId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UserConfiguration instance; + + public Builder() { + this(new UserConfiguration()); + } + + protected Builder(UserConfiguration instance) { + this.instance = instance; + } + + public UserConfiguration.Builder audioLanguagePreference(String audioLanguagePreference) { + this.instance.audioLanguagePreference = audioLanguagePreference; + return this; + } + + public UserConfiguration.Builder playDefaultAudioTrack(Boolean playDefaultAudioTrack) { + this.instance.playDefaultAudioTrack = playDefaultAudioTrack; + return this; + } + + public UserConfiguration.Builder subtitleLanguagePreference(String subtitleLanguagePreference) { + this.instance.subtitleLanguagePreference = subtitleLanguagePreference; + return this; + } + + public UserConfiguration.Builder displayMissingEpisodes(Boolean displayMissingEpisodes) { + this.instance.displayMissingEpisodes = displayMissingEpisodes; + return this; + } + + public UserConfiguration.Builder groupedFolders(List groupedFolders) { + this.instance.groupedFolders = groupedFolders; + return this; + } + + public UserConfiguration.Builder subtitleMode(SubtitlePlaybackMode subtitleMode) { + this.instance.subtitleMode = subtitleMode; + return this; + } + + public UserConfiguration.Builder displayCollectionsView(Boolean displayCollectionsView) { + this.instance.displayCollectionsView = displayCollectionsView; + return this; + } + + public UserConfiguration.Builder enableLocalPassword(Boolean enableLocalPassword) { + this.instance.enableLocalPassword = enableLocalPassword; + return this; + } + + public UserConfiguration.Builder orderedViews(List orderedViews) { + this.instance.orderedViews = orderedViews; + return this; + } + + public UserConfiguration.Builder latestItemsExcludes(List latestItemsExcludes) { + this.instance.latestItemsExcludes = latestItemsExcludes; + return this; + } + + public UserConfiguration.Builder myMediaExcludes(List myMediaExcludes) { + this.instance.myMediaExcludes = myMediaExcludes; + return this; + } + + public UserConfiguration.Builder hidePlayedInLatest(Boolean hidePlayedInLatest) { + this.instance.hidePlayedInLatest = hidePlayedInLatest; + return this; + } + + public UserConfiguration.Builder rememberAudioSelections(Boolean rememberAudioSelections) { + this.instance.rememberAudioSelections = rememberAudioSelections; + return this; + } + + public UserConfiguration.Builder rememberSubtitleSelections(Boolean rememberSubtitleSelections) { + this.instance.rememberSubtitleSelections = rememberSubtitleSelections; + return this; + } + + public UserConfiguration.Builder enableNextEpisodeAutoPlay(Boolean enableNextEpisodeAutoPlay) { + this.instance.enableNextEpisodeAutoPlay = enableNextEpisodeAutoPlay; + return this; + } + + public UserConfiguration.Builder castReceiverId(String castReceiverId) { + this.instance.castReceiverId = castReceiverId; + return this; + } + + /** + * returns a built UserConfiguration instance. + * + * The builder is not reusable. + */ + public UserConfiguration build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UserConfiguration.Builder builder() { + return new UserConfiguration.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UserConfiguration.Builder toBuilder() { + return new UserConfiguration.Builder().audioLanguagePreference(getAudioLanguagePreference()) + .playDefaultAudioTrack(getPlayDefaultAudioTrack()) + .subtitleLanguagePreference(getSubtitleLanguagePreference()) + .displayMissingEpisodes(getDisplayMissingEpisodes()).groupedFolders(getGroupedFolders()) + .subtitleMode(getSubtitleMode()).displayCollectionsView(getDisplayCollectionsView()) + .enableLocalPassword(getEnableLocalPassword()).orderedViews(getOrderedViews()) + .latestItemsExcludes(getLatestItemsExcludes()).myMediaExcludes(getMyMediaExcludes()) + .hidePlayedInLatest(getHidePlayedInLatest()).rememberAudioSelections(getRememberAudioSelections()) + .rememberSubtitleSelections(getRememberSubtitleSelections()) + .enableNextEpisodeAutoPlay(getEnableNextEpisodeAutoPlay()).castReceiverId(getCastReceiverId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserDataChangeInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserDataChangeInfo.java new file mode 100644 index 0000000000000..825d5a7124add --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserDataChangeInfo.java @@ -0,0 +1,248 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class UserDataChangeInfo. + */ +@JsonPropertyOrder({ UserDataChangeInfo.JSON_PROPERTY_USER_ID, UserDataChangeInfo.JSON_PROPERTY_USER_DATA_LIST }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserDataChangeInfo { + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_USER_DATA_LIST = "UserDataList"; + @org.eclipse.jdt.annotation.NonNull + private List userDataList = new ArrayList<>(); + + public UserDataChangeInfo() { + } + + public UserDataChangeInfo userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the user id. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public UserDataChangeInfo userDataList(@org.eclipse.jdt.annotation.NonNull List userDataList) { + this.userDataList = userDataList; + return this; + } + + public UserDataChangeInfo addUserDataListItem(UserItemDataDto userDataListItem) { + if (this.userDataList == null) { + this.userDataList = new ArrayList<>(); + } + this.userDataList.add(userDataListItem); + return this; + } + + /** + * Gets or sets the user data list. + * + * @return userDataList + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_DATA_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getUserDataList() { + return userDataList; + } + + @JsonProperty(JSON_PROPERTY_USER_DATA_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserDataList(@org.eclipse.jdt.annotation.NonNull List userDataList) { + this.userDataList = userDataList; + } + + /** + * Return true if this UserDataChangeInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserDataChangeInfo userDataChangeInfo = (UserDataChangeInfo) o; + return Objects.equals(this.userId, userDataChangeInfo.userId) + && Objects.equals(this.userDataList, userDataChangeInfo.userDataList); + } + + @Override + public int hashCode() { + return Objects.hash(userId, userDataList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserDataChangeInfo {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" userDataList: ").append(toIndentedString(userDataList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `UserDataList` to the URL query string + if (getUserDataList() != null) { + for (int i = 0; i < getUserDataList().size(); i++) { + if (getUserDataList().get(i) != null) { + joiner.add(getUserDataList().get(i).toUrlQueryString(String.format("%sUserDataList%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private UserDataChangeInfo instance; + + public Builder() { + this(new UserDataChangeInfo()); + } + + protected Builder(UserDataChangeInfo instance) { + this.instance = instance; + } + + public UserDataChangeInfo.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public UserDataChangeInfo.Builder userDataList(List userDataList) { + this.instance.userDataList = userDataList; + return this; + } + + /** + * returns a built UserDataChangeInfo instance. + * + * The builder is not reusable. + */ + public UserDataChangeInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UserDataChangeInfo.Builder builder() { + return new UserDataChangeInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UserDataChangeInfo.Builder toBuilder() { + return new UserDataChangeInfo.Builder().userId(getUserId()).userDataList(getUserDataList()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserDataChangedMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserDataChangedMessage.java new file mode 100644 index 0000000000000..31a76a2ef310f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserDataChangedMessage.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * User data changed message. + */ +@JsonPropertyOrder({ UserDataChangedMessage.JSON_PROPERTY_DATA, UserDataChangedMessage.JSON_PROPERTY_MESSAGE_ID, + UserDataChangedMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserDataChangedMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private UserDataChangeInfo data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.USER_DATA_CHANGED; + + public UserDataChangedMessage() { + } + + @JsonCreator + public UserDataChangedMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public UserDataChangedMessage data(@org.eclipse.jdt.annotation.NonNull UserDataChangeInfo data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserDataChangeInfo getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull UserDataChangeInfo data) { + this.data = data; + } + + public UserDataChangedMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this UserDataChangedMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserDataChangedMessage userDataChangedMessage = (UserDataChangedMessage) o; + return Objects.equals(this.data, userDataChangedMessage.data) + && Objects.equals(this.messageId, userDataChangedMessage.messageId) + && Objects.equals(this.messageType, userDataChangedMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserDataChangedMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UserDataChangedMessage instance; + + public Builder() { + this(new UserDataChangedMessage()); + } + + protected Builder(UserDataChangedMessage instance) { + this.instance = instance; + } + + public UserDataChangedMessage.Builder data(UserDataChangeInfo data) { + this.instance.data = data; + return this; + } + + public UserDataChangedMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public UserDataChangedMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built UserDataChangedMessage instance. + * + * The builder is not reusable. + */ + public UserDataChangedMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UserDataChangedMessage.Builder builder() { + return new UserDataChangedMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UserDataChangedMessage.Builder toBuilder() { + return new UserDataChangedMessage.Builder().data(getData()).messageId(getMessageId()) + .messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserDeletedMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserDeletedMessage.java new file mode 100644 index 0000000000000..a6c3369e4697d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserDeletedMessage.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * User deleted message. + */ +@JsonPropertyOrder({ UserDeletedMessage.JSON_PROPERTY_DATA, UserDeletedMessage.JSON_PROPERTY_MESSAGE_ID, + UserDeletedMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserDeletedMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private UUID data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.USER_DELETED; + + public UserDeletedMessage() { + } + + @JsonCreator + public UserDeletedMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public UserDeletedMessage data(@org.eclipse.jdt.annotation.NonNull UUID data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull UUID data) { + this.data = data; + } + + public UserDeletedMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this UserDeletedMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserDeletedMessage userDeletedMessage = (UserDeletedMessage) o; + return Objects.equals(this.data, userDeletedMessage.data) + && Objects.equals(this.messageId, userDeletedMessage.messageId) + && Objects.equals(this.messageType, userDeletedMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserDeletedMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(String.format("%sData%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getData())))); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UserDeletedMessage instance; + + public Builder() { + this(new UserDeletedMessage()); + } + + protected Builder(UserDeletedMessage instance) { + this.instance = instance; + } + + public UserDeletedMessage.Builder data(UUID data) { + this.instance.data = data; + return this; + } + + public UserDeletedMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public UserDeletedMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built UserDeletedMessage instance. + * + * The builder is not reusable. + */ + public UserDeletedMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UserDeletedMessage.Builder builder() { + return new UserDeletedMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UserDeletedMessage.Builder toBuilder() { + return new UserDeletedMessage.Builder().data(getData()).messageId(getMessageId()).messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserDto.java new file mode 100644 index 0000000000000..b6c8c9e254aed --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserDto.java @@ -0,0 +1,725 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class UserDto. + */ +@JsonPropertyOrder({ UserDto.JSON_PROPERTY_NAME, UserDto.JSON_PROPERTY_SERVER_ID, UserDto.JSON_PROPERTY_SERVER_NAME, + UserDto.JSON_PROPERTY_ID, UserDto.JSON_PROPERTY_PRIMARY_IMAGE_TAG, UserDto.JSON_PROPERTY_HAS_PASSWORD, + UserDto.JSON_PROPERTY_HAS_CONFIGURED_PASSWORD, UserDto.JSON_PROPERTY_HAS_CONFIGURED_EASY_PASSWORD, + UserDto.JSON_PROPERTY_ENABLE_AUTO_LOGIN, UserDto.JSON_PROPERTY_LAST_LOGIN_DATE, + UserDto.JSON_PROPERTY_LAST_ACTIVITY_DATE, UserDto.JSON_PROPERTY_CONFIGURATION, UserDto.JSON_PROPERTY_POLICY, + UserDto.JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_SERVER_ID = "ServerId"; + @org.eclipse.jdt.annotation.NonNull + private String serverId; + + public static final String JSON_PROPERTY_SERVER_NAME = "ServerName"; + @org.eclipse.jdt.annotation.NonNull + private String serverName; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_TAG = "PrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String primaryImageTag; + + public static final String JSON_PROPERTY_HAS_PASSWORD = "HasPassword"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasPassword; + + public static final String JSON_PROPERTY_HAS_CONFIGURED_PASSWORD = "HasConfiguredPassword"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasConfiguredPassword; + + public static final String JSON_PROPERTY_HAS_CONFIGURED_EASY_PASSWORD = "HasConfiguredEasyPassword"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasConfiguredEasyPassword; + + public static final String JSON_PROPERTY_ENABLE_AUTO_LOGIN = "EnableAutoLogin"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAutoLogin; + + public static final String JSON_PROPERTY_LAST_LOGIN_DATE = "LastLoginDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime lastLoginDate; + + public static final String JSON_PROPERTY_LAST_ACTIVITY_DATE = "LastActivityDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime lastActivityDate; + + public static final String JSON_PROPERTY_CONFIGURATION = "Configuration"; + @org.eclipse.jdt.annotation.NonNull + private UserConfiguration _configuration; + + public static final String JSON_PROPERTY_POLICY = "Policy"; + @org.eclipse.jdt.annotation.NonNull + private UserPolicy policy; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO = "PrimaryImageAspectRatio"; + @org.eclipse.jdt.annotation.NonNull + private Double primaryImageAspectRatio; + + public UserDto() { + } + + public UserDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public UserDto serverId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + return this; + } + + /** + * Gets or sets the server identifier. + * + * @return serverId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerId() { + return serverId; + } + + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + } + + public UserDto serverName(@org.eclipse.jdt.annotation.NonNull String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Gets or sets the name of the server. This is not used by the server and is for client-side usage only. + * + * @return serverName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerName() { + return serverName; + } + + @JsonProperty(JSON_PROPERTY_SERVER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerName(@org.eclipse.jdt.annotation.NonNull String serverName) { + this.serverName = serverName; + } + + public UserDto id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public UserDto primaryImageTag(@org.eclipse.jdt.annotation.NonNull String primaryImageTag) { + this.primaryImageTag = primaryImageTag; + return this; + } + + /** + * Gets or sets the primary image tag. + * + * @return primaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryImageTag() { + return primaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String primaryImageTag) { + this.primaryImageTag = primaryImageTag; + } + + public UserDto hasPassword(@org.eclipse.jdt.annotation.NonNull Boolean hasPassword) { + this.hasPassword = hasPassword; + return this; + } + + /** + * Gets or sets a value indicating whether this instance has password. + * + * @return hasPassword + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasPassword() { + return hasPassword; + } + + @JsonProperty(JSON_PROPERTY_HAS_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasPassword(@org.eclipse.jdt.annotation.NonNull Boolean hasPassword) { + this.hasPassword = hasPassword; + } + + public UserDto hasConfiguredPassword(@org.eclipse.jdt.annotation.NonNull Boolean hasConfiguredPassword) { + this.hasConfiguredPassword = hasConfiguredPassword; + return this; + } + + /** + * Gets or sets a value indicating whether this instance has configured password. + * + * @return hasConfiguredPassword + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_CONFIGURED_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasConfiguredPassword() { + return hasConfiguredPassword; + } + + @JsonProperty(JSON_PROPERTY_HAS_CONFIGURED_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasConfiguredPassword(@org.eclipse.jdt.annotation.NonNull Boolean hasConfiguredPassword) { + this.hasConfiguredPassword = hasConfiguredPassword; + } + + public UserDto hasConfiguredEasyPassword(@org.eclipse.jdt.annotation.NonNull Boolean hasConfiguredEasyPassword) { + this.hasConfiguredEasyPassword = hasConfiguredEasyPassword; + return this; + } + + /** + * Gets or sets a value indicating whether this instance has configured easy password. + * + * @return hasConfiguredEasyPassword + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_CONFIGURED_EASY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasConfiguredEasyPassword() { + return hasConfiguredEasyPassword; + } + + @JsonProperty(JSON_PROPERTY_HAS_CONFIGURED_EASY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasConfiguredEasyPassword(@org.eclipse.jdt.annotation.NonNull Boolean hasConfiguredEasyPassword) { + this.hasConfiguredEasyPassword = hasConfiguredEasyPassword; + } + + public UserDto enableAutoLogin(@org.eclipse.jdt.annotation.NonNull Boolean enableAutoLogin) { + this.enableAutoLogin = enableAutoLogin; + return this; + } + + /** + * Gets or sets whether async login is enabled or not. + * + * @return enableAutoLogin + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_AUTO_LOGIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAutoLogin() { + return enableAutoLogin; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_AUTO_LOGIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAutoLogin(@org.eclipse.jdt.annotation.NonNull Boolean enableAutoLogin) { + this.enableAutoLogin = enableAutoLogin; + } + + public UserDto lastLoginDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + return this; + } + + /** + * Gets or sets the last login date. + * + * @return lastLoginDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_LOGIN_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastLoginDate() { + return lastLoginDate; + } + + @JsonProperty(JSON_PROPERTY_LAST_LOGIN_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastLoginDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + } + + public UserDto lastActivityDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastActivityDate) { + this.lastActivityDate = lastActivityDate; + return this; + } + + /** + * Gets or sets the last activity date. + * + * @return lastActivityDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_ACTIVITY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastActivityDate() { + return lastActivityDate; + } + + @JsonProperty(JSON_PROPERTY_LAST_ACTIVITY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastActivityDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastActivityDate) { + this.lastActivityDate = lastActivityDate; + } + + public UserDto _configuration(@org.eclipse.jdt.annotation.NonNull UserConfiguration _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * Gets or sets the configuration. + * + * @return _configuration + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserConfiguration getConfiguration() { + return _configuration; + } + + @JsonProperty(JSON_PROPERTY_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfiguration(@org.eclipse.jdt.annotation.NonNull UserConfiguration _configuration) { + this._configuration = _configuration; + } + + public UserDto policy(@org.eclipse.jdt.annotation.NonNull UserPolicy policy) { + this.policy = policy; + return this; + } + + /** + * Gets or sets the policy. + * + * @return policy + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POLICY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserPolicy getPolicy() { + return policy; + } + + @JsonProperty(JSON_PROPERTY_POLICY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPolicy(@org.eclipse.jdt.annotation.NonNull UserPolicy policy) { + this.policy = policy; + } + + public UserDto primaryImageAspectRatio(@org.eclipse.jdt.annotation.NonNull Double primaryImageAspectRatio) { + this.primaryImageAspectRatio = primaryImageAspectRatio; + return this; + } + + /** + * Gets or sets the primary image aspect ratio. + * + * @return primaryImageAspectRatio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getPrimaryImageAspectRatio() { + return primaryImageAspectRatio; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageAspectRatio(@org.eclipse.jdt.annotation.NonNull Double primaryImageAspectRatio) { + this.primaryImageAspectRatio = primaryImageAspectRatio; + } + + /** + * Return true if this UserDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserDto userDto = (UserDto) o; + return Objects.equals(this.name, userDto.name) && Objects.equals(this.serverId, userDto.serverId) + && Objects.equals(this.serverName, userDto.serverName) && Objects.equals(this.id, userDto.id) + && Objects.equals(this.primaryImageTag, userDto.primaryImageTag) + && Objects.equals(this.hasPassword, userDto.hasPassword) + && Objects.equals(this.hasConfiguredPassword, userDto.hasConfiguredPassword) + && Objects.equals(this.hasConfiguredEasyPassword, userDto.hasConfiguredEasyPassword) + && Objects.equals(this.enableAutoLogin, userDto.enableAutoLogin) + && Objects.equals(this.lastLoginDate, userDto.lastLoginDate) + && Objects.equals(this.lastActivityDate, userDto.lastActivityDate) + && Objects.equals(this._configuration, userDto._configuration) + && Objects.equals(this.policy, userDto.policy) + && Objects.equals(this.primaryImageAspectRatio, userDto.primaryImageAspectRatio); + } + + @Override + public int hashCode() { + return Objects.hash(name, serverId, serverName, id, primaryImageTag, hasPassword, hasConfiguredPassword, + hasConfiguredEasyPassword, enableAutoLogin, lastLoginDate, lastActivityDate, _configuration, policy, + primaryImageAspectRatio); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append(" serverName: ").append(toIndentedString(serverName)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" primaryImageTag: ").append(toIndentedString(primaryImageTag)).append("\n"); + sb.append(" hasPassword: ").append(toIndentedString(hasPassword)).append("\n"); + sb.append(" hasConfiguredPassword: ").append(toIndentedString(hasConfiguredPassword)).append("\n"); + sb.append(" hasConfiguredEasyPassword: ").append(toIndentedString(hasConfiguredEasyPassword)).append("\n"); + sb.append(" enableAutoLogin: ").append(toIndentedString(enableAutoLogin)).append("\n"); + sb.append(" lastLoginDate: ").append(toIndentedString(lastLoginDate)).append("\n"); + sb.append(" lastActivityDate: ").append(toIndentedString(lastActivityDate)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + sb.append(" policy: ").append(toIndentedString(policy)).append("\n"); + sb.append(" primaryImageAspectRatio: ").append(toIndentedString(primaryImageAspectRatio)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `ServerId` to the URL query string + if (getServerId() != null) { + joiner.add(String.format("%sServerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerId())))); + } + + // add `ServerName` to the URL query string + if (getServerName() != null) { + joiner.add(String.format("%sServerName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerName())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `PrimaryImageTag` to the URL query string + if (getPrimaryImageTag() != null) { + joiner.add(String.format("%sPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageTag())))); + } + + // add `HasPassword` to the URL query string + if (getHasPassword() != null) { + joiner.add(String.format("%sHasPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasPassword())))); + } + + // add `HasConfiguredPassword` to the URL query string + if (getHasConfiguredPassword() != null) { + joiner.add(String.format("%sHasConfiguredPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasConfiguredPassword())))); + } + + // add `HasConfiguredEasyPassword` to the URL query string + if (getHasConfiguredEasyPassword() != null) { + joiner.add(String.format("%sHasConfiguredEasyPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasConfiguredEasyPassword())))); + } + + // add `EnableAutoLogin` to the URL query string + if (getEnableAutoLogin() != null) { + joiner.add(String.format("%sEnableAutoLogin%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAutoLogin())))); + } + + // add `LastLoginDate` to the URL query string + if (getLastLoginDate() != null) { + joiner.add(String.format("%sLastLoginDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastLoginDate())))); + } + + // add `LastActivityDate` to the URL query string + if (getLastActivityDate() != null) { + joiner.add(String.format("%sLastActivityDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastActivityDate())))); + } + + // add `Configuration` to the URL query string + if (getConfiguration() != null) { + joiner.add(getConfiguration().toUrlQueryString(prefix + "Configuration" + suffix)); + } + + // add `Policy` to the URL query string + if (getPolicy() != null) { + joiner.add(getPolicy().toUrlQueryString(prefix + "Policy" + suffix)); + } + + // add `PrimaryImageAspectRatio` to the URL query string + if (getPrimaryImageAspectRatio() != null) { + joiner.add(String.format("%sPrimaryImageAspectRatio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageAspectRatio())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UserDto instance; + + public Builder() { + this(new UserDto()); + } + + protected Builder(UserDto instance) { + this.instance = instance; + } + + public UserDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public UserDto.Builder serverId(String serverId) { + this.instance.serverId = serverId; + return this; + } + + public UserDto.Builder serverName(String serverName) { + this.instance.serverName = serverName; + return this; + } + + public UserDto.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public UserDto.Builder primaryImageTag(String primaryImageTag) { + this.instance.primaryImageTag = primaryImageTag; + return this; + } + + public UserDto.Builder hasPassword(Boolean hasPassword) { + this.instance.hasPassword = hasPassword; + return this; + } + + public UserDto.Builder hasConfiguredPassword(Boolean hasConfiguredPassword) { + this.instance.hasConfiguredPassword = hasConfiguredPassword; + return this; + } + + public UserDto.Builder hasConfiguredEasyPassword(Boolean hasConfiguredEasyPassword) { + this.instance.hasConfiguredEasyPassword = hasConfiguredEasyPassword; + return this; + } + + public UserDto.Builder enableAutoLogin(Boolean enableAutoLogin) { + this.instance.enableAutoLogin = enableAutoLogin; + return this; + } + + public UserDto.Builder lastLoginDate(OffsetDateTime lastLoginDate) { + this.instance.lastLoginDate = lastLoginDate; + return this; + } + + public UserDto.Builder lastActivityDate(OffsetDateTime lastActivityDate) { + this.instance.lastActivityDate = lastActivityDate; + return this; + } + + public UserDto.Builder _configuration(UserConfiguration _configuration) { + this.instance._configuration = _configuration; + return this; + } + + public UserDto.Builder policy(UserPolicy policy) { + this.instance.policy = policy; + return this; + } + + public UserDto.Builder primaryImageAspectRatio(Double primaryImageAspectRatio) { + this.instance.primaryImageAspectRatio = primaryImageAspectRatio; + return this; + } + + /** + * returns a built UserDto instance. + * + * The builder is not reusable. + */ + public UserDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UserDto.Builder builder() { + return new UserDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UserDto.Builder toBuilder() { + return new UserDto.Builder().name(getName()).serverId(getServerId()).serverName(getServerName()).id(getId()) + .primaryImageTag(getPrimaryImageTag()).hasPassword(getHasPassword()) + .hasConfiguredPassword(getHasConfiguredPassword()) + .hasConfiguredEasyPassword(getHasConfiguredEasyPassword()).enableAutoLogin(getEnableAutoLogin()) + .lastLoginDate(getLastLoginDate()).lastActivityDate(getLastActivityDate()) + ._configuration(getConfiguration()).policy(getPolicy()) + .primaryImageAspectRatio(getPrimaryImageAspectRatio()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserItemDataDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserItemDataDto.java new file mode 100644 index 0000000000000..dd8dce359fe9b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserItemDataDto.java @@ -0,0 +1,602 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class UserItemDataDto. + */ +@JsonPropertyOrder({ UserItemDataDto.JSON_PROPERTY_RATING, UserItemDataDto.JSON_PROPERTY_PLAYED_PERCENTAGE, + UserItemDataDto.JSON_PROPERTY_UNPLAYED_ITEM_COUNT, UserItemDataDto.JSON_PROPERTY_PLAYBACK_POSITION_TICKS, + UserItemDataDto.JSON_PROPERTY_PLAY_COUNT, UserItemDataDto.JSON_PROPERTY_IS_FAVORITE, + UserItemDataDto.JSON_PROPERTY_LIKES, UserItemDataDto.JSON_PROPERTY_LAST_PLAYED_DATE, + UserItemDataDto.JSON_PROPERTY_PLAYED, UserItemDataDto.JSON_PROPERTY_KEY, + UserItemDataDto.JSON_PROPERTY_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserItemDataDto { + public static final String JSON_PROPERTY_RATING = "Rating"; + @org.eclipse.jdt.annotation.NonNull + private Double rating; + + public static final String JSON_PROPERTY_PLAYED_PERCENTAGE = "PlayedPercentage"; + @org.eclipse.jdt.annotation.NonNull + private Double playedPercentage; + + public static final String JSON_PROPERTY_UNPLAYED_ITEM_COUNT = "UnplayedItemCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer unplayedItemCount; + + public static final String JSON_PROPERTY_PLAYBACK_POSITION_TICKS = "PlaybackPositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long playbackPositionTicks; + + public static final String JSON_PROPERTY_PLAY_COUNT = "PlayCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer playCount; + + public static final String JSON_PROPERTY_IS_FAVORITE = "IsFavorite"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isFavorite; + + public static final String JSON_PROPERTY_LIKES = "Likes"; + @org.eclipse.jdt.annotation.NonNull + private Boolean likes; + + public static final String JSON_PROPERTY_LAST_PLAYED_DATE = "LastPlayedDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime lastPlayedDate; + + public static final String JSON_PROPERTY_PLAYED = "Played"; + @org.eclipse.jdt.annotation.NonNull + private Boolean played; + + public static final String JSON_PROPERTY_KEY = "Key"; + @org.eclipse.jdt.annotation.NonNull + private String key; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public UserItemDataDto() { + } + + public UserItemDataDto rating(@org.eclipse.jdt.annotation.NonNull Double rating) { + this.rating = rating; + return this; + } + + /** + * Gets or sets the rating. + * + * @return rating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getRating() { + return rating; + } + + @JsonProperty(JSON_PROPERTY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRating(@org.eclipse.jdt.annotation.NonNull Double rating) { + this.rating = rating; + } + + public UserItemDataDto playedPercentage(@org.eclipse.jdt.annotation.NonNull Double playedPercentage) { + this.playedPercentage = playedPercentage; + return this; + } + + /** + * Gets or sets the played percentage. + * + * @return playedPercentage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYED_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getPlayedPercentage() { + return playedPercentage; + } + + @JsonProperty(JSON_PROPERTY_PLAYED_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayedPercentage(@org.eclipse.jdt.annotation.NonNull Double playedPercentage) { + this.playedPercentage = playedPercentage; + } + + public UserItemDataDto unplayedItemCount(@org.eclipse.jdt.annotation.NonNull Integer unplayedItemCount) { + this.unplayedItemCount = unplayedItemCount; + return this; + } + + /** + * Gets or sets the unplayed item count. + * + * @return unplayedItemCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_UNPLAYED_ITEM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUnplayedItemCount() { + return unplayedItemCount; + } + + @JsonProperty(JSON_PROPERTY_UNPLAYED_ITEM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnplayedItemCount(@org.eclipse.jdt.annotation.NonNull Integer unplayedItemCount) { + this.unplayedItemCount = unplayedItemCount; + } + + public UserItemDataDto playbackPositionTicks(@org.eclipse.jdt.annotation.NonNull Long playbackPositionTicks) { + this.playbackPositionTicks = playbackPositionTicks; + return this; + } + + /** + * Gets or sets the playback position ticks. + * + * @return playbackPositionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYBACK_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPlaybackPositionTicks() { + return playbackPositionTicks; + } + + @JsonProperty(JSON_PROPERTY_PLAYBACK_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaybackPositionTicks(@org.eclipse.jdt.annotation.NonNull Long playbackPositionTicks) { + this.playbackPositionTicks = playbackPositionTicks; + } + + public UserItemDataDto playCount(@org.eclipse.jdt.annotation.NonNull Integer playCount) { + this.playCount = playCount; + return this; + } + + /** + * Gets or sets the play count. + * + * @return playCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPlayCount() { + return playCount; + } + + @JsonProperty(JSON_PROPERTY_PLAY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayCount(@org.eclipse.jdt.annotation.NonNull Integer playCount) { + this.playCount = playCount; + } + + public UserItemDataDto isFavorite(@org.eclipse.jdt.annotation.NonNull Boolean isFavorite) { + this.isFavorite = isFavorite; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is favorite. + * + * @return isFavorite + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_FAVORITE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsFavorite() { + return isFavorite; + } + + @JsonProperty(JSON_PROPERTY_IS_FAVORITE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsFavorite(@org.eclipse.jdt.annotation.NonNull Boolean isFavorite) { + this.isFavorite = isFavorite; + } + + public UserItemDataDto likes(@org.eclipse.jdt.annotation.NonNull Boolean likes) { + this.likes = likes; + return this; + } + + /** + * Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is likes. + * + * @return likes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIKES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getLikes() { + return likes; + } + + @JsonProperty(JSON_PROPERTY_LIKES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLikes(@org.eclipse.jdt.annotation.NonNull Boolean likes) { + this.likes = likes; + } + + public UserItemDataDto lastPlayedDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastPlayedDate) { + this.lastPlayedDate = lastPlayedDate; + return this; + } + + /** + * Gets or sets the last played date. + * + * @return lastPlayedDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_PLAYED_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastPlayedDate() { + return lastPlayedDate; + } + + @JsonProperty(JSON_PROPERTY_LAST_PLAYED_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastPlayedDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastPlayedDate) { + this.lastPlayedDate = lastPlayedDate; + } + + public UserItemDataDto played(@org.eclipse.jdt.annotation.NonNull Boolean played) { + this.played = played; + return this; + } + + /** + * Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played. + * + * @return played + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPlayed() { + return played; + } + + @JsonProperty(JSON_PROPERTY_PLAYED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayed(@org.eclipse.jdt.annotation.NonNull Boolean played) { + this.played = played; + } + + public UserItemDataDto key(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + return this; + } + + /** + * Gets or sets the key. + * + * @return key + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + } + + public UserItemDataDto itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item identifier. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + /** + * Return true if this UserItemDataDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserItemDataDto userItemDataDto = (UserItemDataDto) o; + return Objects.equals(this.rating, userItemDataDto.rating) + && Objects.equals(this.playedPercentage, userItemDataDto.playedPercentage) + && Objects.equals(this.unplayedItemCount, userItemDataDto.unplayedItemCount) + && Objects.equals(this.playbackPositionTicks, userItemDataDto.playbackPositionTicks) + && Objects.equals(this.playCount, userItemDataDto.playCount) + && Objects.equals(this.isFavorite, userItemDataDto.isFavorite) + && Objects.equals(this.likes, userItemDataDto.likes) + && Objects.equals(this.lastPlayedDate, userItemDataDto.lastPlayedDate) + && Objects.equals(this.played, userItemDataDto.played) && Objects.equals(this.key, userItemDataDto.key) + && Objects.equals(this.itemId, userItemDataDto.itemId); + } + + @Override + public int hashCode() { + return Objects.hash(rating, playedPercentage, unplayedItemCount, playbackPositionTicks, playCount, isFavorite, + likes, lastPlayedDate, played, key, itemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserItemDataDto {\n"); + sb.append(" rating: ").append(toIndentedString(rating)).append("\n"); + sb.append(" playedPercentage: ").append(toIndentedString(playedPercentage)).append("\n"); + sb.append(" unplayedItemCount: ").append(toIndentedString(unplayedItemCount)).append("\n"); + sb.append(" playbackPositionTicks: ").append(toIndentedString(playbackPositionTicks)).append("\n"); + sb.append(" playCount: ").append(toIndentedString(playCount)).append("\n"); + sb.append(" isFavorite: ").append(toIndentedString(isFavorite)).append("\n"); + sb.append(" likes: ").append(toIndentedString(likes)).append("\n"); + sb.append(" lastPlayedDate: ").append(toIndentedString(lastPlayedDate)).append("\n"); + sb.append(" played: ").append(toIndentedString(played)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Rating` to the URL query string + if (getRating() != null) { + joiner.add(String.format("%sRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRating())))); + } + + // add `PlayedPercentage` to the URL query string + if (getPlayedPercentage() != null) { + joiner.add(String.format("%sPlayedPercentage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayedPercentage())))); + } + + // add `UnplayedItemCount` to the URL query string + if (getUnplayedItemCount() != null) { + joiner.add(String.format("%sUnplayedItemCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUnplayedItemCount())))); + } + + // add `PlaybackPositionTicks` to the URL query string + if (getPlaybackPositionTicks() != null) { + joiner.add(String.format("%sPlaybackPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaybackPositionTicks())))); + } + + // add `PlayCount` to the URL query string + if (getPlayCount() != null) { + joiner.add(String.format("%sPlayCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayCount())))); + } + + // add `IsFavorite` to the URL query string + if (getIsFavorite() != null) { + joiner.add(String.format("%sIsFavorite%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsFavorite())))); + } + + // add `Likes` to the URL query string + if (getLikes() != null) { + joiner.add(String.format("%sLikes%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLikes())))); + } + + // add `LastPlayedDate` to the URL query string + if (getLastPlayedDate() != null) { + joiner.add(String.format("%sLastPlayedDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastPlayedDate())))); + } + + // add `Played` to the URL query string + if (getPlayed() != null) { + joiner.add(String.format("%sPlayed%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayed())))); + } + + // add `Key` to the URL query string + if (getKey() != null) { + joiner.add(String.format("%sKey%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getKey())))); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UserItemDataDto instance; + + public Builder() { + this(new UserItemDataDto()); + } + + protected Builder(UserItemDataDto instance) { + this.instance = instance; + } + + public UserItemDataDto.Builder rating(Double rating) { + this.instance.rating = rating; + return this; + } + + public UserItemDataDto.Builder playedPercentage(Double playedPercentage) { + this.instance.playedPercentage = playedPercentage; + return this; + } + + public UserItemDataDto.Builder unplayedItemCount(Integer unplayedItemCount) { + this.instance.unplayedItemCount = unplayedItemCount; + return this; + } + + public UserItemDataDto.Builder playbackPositionTicks(Long playbackPositionTicks) { + this.instance.playbackPositionTicks = playbackPositionTicks; + return this; + } + + public UserItemDataDto.Builder playCount(Integer playCount) { + this.instance.playCount = playCount; + return this; + } + + public UserItemDataDto.Builder isFavorite(Boolean isFavorite) { + this.instance.isFavorite = isFavorite; + return this; + } + + public UserItemDataDto.Builder likes(Boolean likes) { + this.instance.likes = likes; + return this; + } + + public UserItemDataDto.Builder lastPlayedDate(OffsetDateTime lastPlayedDate) { + this.instance.lastPlayedDate = lastPlayedDate; + return this; + } + + public UserItemDataDto.Builder played(Boolean played) { + this.instance.played = played; + return this; + } + + public UserItemDataDto.Builder key(String key) { + this.instance.key = key; + return this; + } + + public UserItemDataDto.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + /** + * returns a built UserItemDataDto instance. + * + * The builder is not reusable. + */ + public UserItemDataDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UserItemDataDto.Builder builder() { + return new UserItemDataDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UserItemDataDto.Builder toBuilder() { + return new UserItemDataDto.Builder().rating(getRating()).playedPercentage(getPlayedPercentage()) + .unplayedItemCount(getUnplayedItemCount()).playbackPositionTicks(getPlaybackPositionTicks()) + .playCount(getPlayCount()).isFavorite(getIsFavorite()).likes(getLikes()) + .lastPlayedDate(getLastPlayedDate()).played(getPlayed()).key(getKey()).itemId(getItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserPolicy.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserPolicy.java new file mode 100644 index 0000000000000..042b0833e9e0c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserPolicy.java @@ -0,0 +1,2074 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * UserPolicy + */ +@JsonPropertyOrder({ UserPolicy.JSON_PROPERTY_IS_ADMINISTRATOR, UserPolicy.JSON_PROPERTY_IS_HIDDEN, + UserPolicy.JSON_PROPERTY_ENABLE_COLLECTION_MANAGEMENT, UserPolicy.JSON_PROPERTY_ENABLE_SUBTITLE_MANAGEMENT, + UserPolicy.JSON_PROPERTY_ENABLE_LYRIC_MANAGEMENT, UserPolicy.JSON_PROPERTY_IS_DISABLED, + UserPolicy.JSON_PROPERTY_MAX_PARENTAL_RATING, UserPolicy.JSON_PROPERTY_BLOCKED_TAGS, + UserPolicy.JSON_PROPERTY_ALLOWED_TAGS, UserPolicy.JSON_PROPERTY_ENABLE_USER_PREFERENCE_ACCESS, + UserPolicy.JSON_PROPERTY_ACCESS_SCHEDULES, UserPolicy.JSON_PROPERTY_BLOCK_UNRATED_ITEMS, + UserPolicy.JSON_PROPERTY_ENABLE_REMOTE_CONTROL_OF_OTHER_USERS, + UserPolicy.JSON_PROPERTY_ENABLE_SHARED_DEVICE_CONTROL, UserPolicy.JSON_PROPERTY_ENABLE_REMOTE_ACCESS, + UserPolicy.JSON_PROPERTY_ENABLE_LIVE_TV_MANAGEMENT, UserPolicy.JSON_PROPERTY_ENABLE_LIVE_TV_ACCESS, + UserPolicy.JSON_PROPERTY_ENABLE_MEDIA_PLAYBACK, UserPolicy.JSON_PROPERTY_ENABLE_AUDIO_PLAYBACK_TRANSCODING, + UserPolicy.JSON_PROPERTY_ENABLE_VIDEO_PLAYBACK_TRANSCODING, UserPolicy.JSON_PROPERTY_ENABLE_PLAYBACK_REMUXING, + UserPolicy.JSON_PROPERTY_FORCE_REMOTE_SOURCE_TRANSCODING, UserPolicy.JSON_PROPERTY_ENABLE_CONTENT_DELETION, + UserPolicy.JSON_PROPERTY_ENABLE_CONTENT_DELETION_FROM_FOLDERS, + UserPolicy.JSON_PROPERTY_ENABLE_CONTENT_DOWNLOADING, UserPolicy.JSON_PROPERTY_ENABLE_SYNC_TRANSCODING, + UserPolicy.JSON_PROPERTY_ENABLE_MEDIA_CONVERSION, UserPolicy.JSON_PROPERTY_ENABLED_DEVICES, + UserPolicy.JSON_PROPERTY_ENABLE_ALL_DEVICES, UserPolicy.JSON_PROPERTY_ENABLED_CHANNELS, + UserPolicy.JSON_PROPERTY_ENABLE_ALL_CHANNELS, UserPolicy.JSON_PROPERTY_ENABLED_FOLDERS, + UserPolicy.JSON_PROPERTY_ENABLE_ALL_FOLDERS, UserPolicy.JSON_PROPERTY_INVALID_LOGIN_ATTEMPT_COUNT, + UserPolicy.JSON_PROPERTY_LOGIN_ATTEMPTS_BEFORE_LOCKOUT, UserPolicy.JSON_PROPERTY_MAX_ACTIVE_SESSIONS, + UserPolicy.JSON_PROPERTY_ENABLE_PUBLIC_SHARING, UserPolicy.JSON_PROPERTY_BLOCKED_MEDIA_FOLDERS, + UserPolicy.JSON_PROPERTY_BLOCKED_CHANNELS, UserPolicy.JSON_PROPERTY_REMOTE_CLIENT_BITRATE_LIMIT, + UserPolicy.JSON_PROPERTY_AUTHENTICATION_PROVIDER_ID, UserPolicy.JSON_PROPERTY_PASSWORD_RESET_PROVIDER_ID, + UserPolicy.JSON_PROPERTY_SYNC_PLAY_ACCESS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserPolicy { + public static final String JSON_PROPERTY_IS_ADMINISTRATOR = "IsAdministrator"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAdministrator; + + public static final String JSON_PROPERTY_IS_HIDDEN = "IsHidden"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isHidden; + + public static final String JSON_PROPERTY_ENABLE_COLLECTION_MANAGEMENT = "EnableCollectionManagement"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableCollectionManagement = false; + + public static final String JSON_PROPERTY_ENABLE_SUBTITLE_MANAGEMENT = "EnableSubtitleManagement"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableSubtitleManagement = false; + + public static final String JSON_PROPERTY_ENABLE_LYRIC_MANAGEMENT = "EnableLyricManagement"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableLyricManagement = false; + + public static final String JSON_PROPERTY_IS_DISABLED = "IsDisabled"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isDisabled; + + public static final String JSON_PROPERTY_MAX_PARENTAL_RATING = "MaxParentalRating"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxParentalRating; + + public static final String JSON_PROPERTY_BLOCKED_TAGS = "BlockedTags"; + @org.eclipse.jdt.annotation.NonNull + private List blockedTags; + + public static final String JSON_PROPERTY_ALLOWED_TAGS = "AllowedTags"; + @org.eclipse.jdt.annotation.NonNull + private List allowedTags; + + public static final String JSON_PROPERTY_ENABLE_USER_PREFERENCE_ACCESS = "EnableUserPreferenceAccess"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableUserPreferenceAccess; + + public static final String JSON_PROPERTY_ACCESS_SCHEDULES = "AccessSchedules"; + @org.eclipse.jdt.annotation.NonNull + private List accessSchedules; + + public static final String JSON_PROPERTY_BLOCK_UNRATED_ITEMS = "BlockUnratedItems"; + @org.eclipse.jdt.annotation.NonNull + private List blockUnratedItems; + + public static final String JSON_PROPERTY_ENABLE_REMOTE_CONTROL_OF_OTHER_USERS = "EnableRemoteControlOfOtherUsers"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableRemoteControlOfOtherUsers; + + public static final String JSON_PROPERTY_ENABLE_SHARED_DEVICE_CONTROL = "EnableSharedDeviceControl"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableSharedDeviceControl; + + public static final String JSON_PROPERTY_ENABLE_REMOTE_ACCESS = "EnableRemoteAccess"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableRemoteAccess; + + public static final String JSON_PROPERTY_ENABLE_LIVE_TV_MANAGEMENT = "EnableLiveTvManagement"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableLiveTvManagement; + + public static final String JSON_PROPERTY_ENABLE_LIVE_TV_ACCESS = "EnableLiveTvAccess"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableLiveTvAccess; + + public static final String JSON_PROPERTY_ENABLE_MEDIA_PLAYBACK = "EnableMediaPlayback"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableMediaPlayback; + + public static final String JSON_PROPERTY_ENABLE_AUDIO_PLAYBACK_TRANSCODING = "EnableAudioPlaybackTranscoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAudioPlaybackTranscoding; + + public static final String JSON_PROPERTY_ENABLE_VIDEO_PLAYBACK_TRANSCODING = "EnableVideoPlaybackTranscoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableVideoPlaybackTranscoding; + + public static final String JSON_PROPERTY_ENABLE_PLAYBACK_REMUXING = "EnablePlaybackRemuxing"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enablePlaybackRemuxing; + + public static final String JSON_PROPERTY_FORCE_REMOTE_SOURCE_TRANSCODING = "ForceRemoteSourceTranscoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean forceRemoteSourceTranscoding; + + public static final String JSON_PROPERTY_ENABLE_CONTENT_DELETION = "EnableContentDeletion"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableContentDeletion; + + public static final String JSON_PROPERTY_ENABLE_CONTENT_DELETION_FROM_FOLDERS = "EnableContentDeletionFromFolders"; + @org.eclipse.jdt.annotation.NonNull + private List enableContentDeletionFromFolders; + + public static final String JSON_PROPERTY_ENABLE_CONTENT_DOWNLOADING = "EnableContentDownloading"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableContentDownloading; + + public static final String JSON_PROPERTY_ENABLE_SYNC_TRANSCODING = "EnableSyncTranscoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableSyncTranscoding; + + public static final String JSON_PROPERTY_ENABLE_MEDIA_CONVERSION = "EnableMediaConversion"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableMediaConversion; + + public static final String JSON_PROPERTY_ENABLED_DEVICES = "EnabledDevices"; + @org.eclipse.jdt.annotation.NonNull + private List enabledDevices; + + public static final String JSON_PROPERTY_ENABLE_ALL_DEVICES = "EnableAllDevices"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAllDevices; + + public static final String JSON_PROPERTY_ENABLED_CHANNELS = "EnabledChannels"; + @org.eclipse.jdt.annotation.NonNull + private List enabledChannels; + + public static final String JSON_PROPERTY_ENABLE_ALL_CHANNELS = "EnableAllChannels"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAllChannels; + + public static final String JSON_PROPERTY_ENABLED_FOLDERS = "EnabledFolders"; + @org.eclipse.jdt.annotation.NonNull + private List enabledFolders; + + public static final String JSON_PROPERTY_ENABLE_ALL_FOLDERS = "EnableAllFolders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAllFolders; + + public static final String JSON_PROPERTY_INVALID_LOGIN_ATTEMPT_COUNT = "InvalidLoginAttemptCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer invalidLoginAttemptCount; + + public static final String JSON_PROPERTY_LOGIN_ATTEMPTS_BEFORE_LOCKOUT = "LoginAttemptsBeforeLockout"; + @org.eclipse.jdt.annotation.NonNull + private Integer loginAttemptsBeforeLockout; + + public static final String JSON_PROPERTY_MAX_ACTIVE_SESSIONS = "MaxActiveSessions"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxActiveSessions; + + public static final String JSON_PROPERTY_ENABLE_PUBLIC_SHARING = "EnablePublicSharing"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enablePublicSharing; + + public static final String JSON_PROPERTY_BLOCKED_MEDIA_FOLDERS = "BlockedMediaFolders"; + @org.eclipse.jdt.annotation.NonNull + private List blockedMediaFolders; + + public static final String JSON_PROPERTY_BLOCKED_CHANNELS = "BlockedChannels"; + @org.eclipse.jdt.annotation.NonNull + private List blockedChannels; + + public static final String JSON_PROPERTY_REMOTE_CLIENT_BITRATE_LIMIT = "RemoteClientBitrateLimit"; + @org.eclipse.jdt.annotation.NonNull + private Integer remoteClientBitrateLimit; + + public static final String JSON_PROPERTY_AUTHENTICATION_PROVIDER_ID = "AuthenticationProviderId"; + @org.eclipse.jdt.annotation.Nullable + private String authenticationProviderId; + + public static final String JSON_PROPERTY_PASSWORD_RESET_PROVIDER_ID = "PasswordResetProviderId"; + @org.eclipse.jdt.annotation.Nullable + private String passwordResetProviderId; + + public static final String JSON_PROPERTY_SYNC_PLAY_ACCESS = "SyncPlayAccess"; + @org.eclipse.jdt.annotation.NonNull + private SyncPlayUserAccessType syncPlayAccess; + + public UserPolicy() { + } + + public UserPolicy isAdministrator(@org.eclipse.jdt.annotation.NonNull Boolean isAdministrator) { + this.isAdministrator = isAdministrator; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is administrator. + * + * @return isAdministrator + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_ADMINISTRATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAdministrator() { + return isAdministrator; + } + + @JsonProperty(JSON_PROPERTY_IS_ADMINISTRATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAdministrator(@org.eclipse.jdt.annotation.NonNull Boolean isAdministrator) { + this.isAdministrator = isAdministrator; + } + + public UserPolicy isHidden(@org.eclipse.jdt.annotation.NonNull Boolean isHidden) { + this.isHidden = isHidden; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is hidden. + * + * @return isHidden + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_HIDDEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsHidden() { + return isHidden; + } + + @JsonProperty(JSON_PROPERTY_IS_HIDDEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsHidden(@org.eclipse.jdt.annotation.NonNull Boolean isHidden) { + this.isHidden = isHidden; + } + + public UserPolicy enableCollectionManagement( + @org.eclipse.jdt.annotation.NonNull Boolean enableCollectionManagement) { + this.enableCollectionManagement = enableCollectionManagement; + return this; + } + + /** + * Gets or sets a value indicating whether this instance can manage collections. + * + * @return enableCollectionManagement + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_COLLECTION_MANAGEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableCollectionManagement() { + return enableCollectionManagement; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_COLLECTION_MANAGEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableCollectionManagement(@org.eclipse.jdt.annotation.NonNull Boolean enableCollectionManagement) { + this.enableCollectionManagement = enableCollectionManagement; + } + + public UserPolicy enableSubtitleManagement(@org.eclipse.jdt.annotation.NonNull Boolean enableSubtitleManagement) { + this.enableSubtitleManagement = enableSubtitleManagement; + return this; + } + + /** + * Gets or sets a value indicating whether this instance can manage subtitles. + * + * @return enableSubtitleManagement + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_SUBTITLE_MANAGEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableSubtitleManagement() { + return enableSubtitleManagement; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_SUBTITLE_MANAGEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableSubtitleManagement(@org.eclipse.jdt.annotation.NonNull Boolean enableSubtitleManagement) { + this.enableSubtitleManagement = enableSubtitleManagement; + } + + public UserPolicy enableLyricManagement(@org.eclipse.jdt.annotation.NonNull Boolean enableLyricManagement) { + this.enableLyricManagement = enableLyricManagement; + return this; + } + + /** + * Gets or sets a value indicating whether this user can manage lyrics. + * + * @return enableLyricManagement + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_LYRIC_MANAGEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableLyricManagement() { + return enableLyricManagement; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_LYRIC_MANAGEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableLyricManagement(@org.eclipse.jdt.annotation.NonNull Boolean enableLyricManagement) { + this.enableLyricManagement = enableLyricManagement; + } + + public UserPolicy isDisabled(@org.eclipse.jdt.annotation.NonNull Boolean isDisabled) { + this.isDisabled = isDisabled; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is disabled. + * + * @return isDisabled + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_DISABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsDisabled() { + return isDisabled; + } + + @JsonProperty(JSON_PROPERTY_IS_DISABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDisabled(@org.eclipse.jdt.annotation.NonNull Boolean isDisabled) { + this.isDisabled = isDisabled; + } + + public UserPolicy maxParentalRating(@org.eclipse.jdt.annotation.NonNull Integer maxParentalRating) { + this.maxParentalRating = maxParentalRating; + return this; + } + + /** + * Gets or sets the max parental rating. + * + * @return maxParentalRating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_PARENTAL_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxParentalRating() { + return maxParentalRating; + } + + @JsonProperty(JSON_PROPERTY_MAX_PARENTAL_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxParentalRating(@org.eclipse.jdt.annotation.NonNull Integer maxParentalRating) { + this.maxParentalRating = maxParentalRating; + } + + public UserPolicy blockedTags(@org.eclipse.jdt.annotation.NonNull List blockedTags) { + this.blockedTags = blockedTags; + return this; + } + + public UserPolicy addBlockedTagsItem(String blockedTagsItem) { + if (this.blockedTags == null) { + this.blockedTags = new ArrayList<>(); + } + this.blockedTags.add(blockedTagsItem); + return this; + } + + /** + * Get blockedTags + * + * @return blockedTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BLOCKED_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBlockedTags() { + return blockedTags; + } + + @JsonProperty(JSON_PROPERTY_BLOCKED_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlockedTags(@org.eclipse.jdt.annotation.NonNull List blockedTags) { + this.blockedTags = blockedTags; + } + + public UserPolicy allowedTags(@org.eclipse.jdt.annotation.NonNull List allowedTags) { + this.allowedTags = allowedTags; + return this; + } + + public UserPolicy addAllowedTagsItem(String allowedTagsItem) { + if (this.allowedTags == null) { + this.allowedTags = new ArrayList<>(); + } + this.allowedTags.add(allowedTagsItem); + return this; + } + + /** + * Get allowedTags + * + * @return allowedTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOWED_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAllowedTags() { + return allowedTags; + } + + @JsonProperty(JSON_PROPERTY_ALLOWED_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowedTags(@org.eclipse.jdt.annotation.NonNull List allowedTags) { + this.allowedTags = allowedTags; + } + + public UserPolicy enableUserPreferenceAccess( + @org.eclipse.jdt.annotation.NonNull Boolean enableUserPreferenceAccess) { + this.enableUserPreferenceAccess = enableUserPreferenceAccess; + return this; + } + + /** + * Get enableUserPreferenceAccess + * + * @return enableUserPreferenceAccess + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_USER_PREFERENCE_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableUserPreferenceAccess() { + return enableUserPreferenceAccess; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_USER_PREFERENCE_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableUserPreferenceAccess(@org.eclipse.jdt.annotation.NonNull Boolean enableUserPreferenceAccess) { + this.enableUserPreferenceAccess = enableUserPreferenceAccess; + } + + public UserPolicy accessSchedules(@org.eclipse.jdt.annotation.NonNull List accessSchedules) { + this.accessSchedules = accessSchedules; + return this; + } + + public UserPolicy addAccessSchedulesItem(AccessSchedule accessSchedulesItem) { + if (this.accessSchedules == null) { + this.accessSchedules = new ArrayList<>(); + } + this.accessSchedules.add(accessSchedulesItem); + return this; + } + + /** + * Get accessSchedules + * + * @return accessSchedules + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ACCESS_SCHEDULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAccessSchedules() { + return accessSchedules; + } + + @JsonProperty(JSON_PROPERTY_ACCESS_SCHEDULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessSchedules(@org.eclipse.jdt.annotation.NonNull List accessSchedules) { + this.accessSchedules = accessSchedules; + } + + public UserPolicy blockUnratedItems(@org.eclipse.jdt.annotation.NonNull List blockUnratedItems) { + this.blockUnratedItems = blockUnratedItems; + return this; + } + + public UserPolicy addBlockUnratedItemsItem(UnratedItem blockUnratedItemsItem) { + if (this.blockUnratedItems == null) { + this.blockUnratedItems = new ArrayList<>(); + } + this.blockUnratedItems.add(blockUnratedItemsItem); + return this; + } + + /** + * Get blockUnratedItems + * + * @return blockUnratedItems + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BLOCK_UNRATED_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBlockUnratedItems() { + return blockUnratedItems; + } + + @JsonProperty(JSON_PROPERTY_BLOCK_UNRATED_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlockUnratedItems(@org.eclipse.jdt.annotation.NonNull List blockUnratedItems) { + this.blockUnratedItems = blockUnratedItems; + } + + public UserPolicy enableRemoteControlOfOtherUsers( + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteControlOfOtherUsers) { + this.enableRemoteControlOfOtherUsers = enableRemoteControlOfOtherUsers; + return this; + } + + /** + * Get enableRemoteControlOfOtherUsers + * + * @return enableRemoteControlOfOtherUsers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_REMOTE_CONTROL_OF_OTHER_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableRemoteControlOfOtherUsers() { + return enableRemoteControlOfOtherUsers; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_REMOTE_CONTROL_OF_OTHER_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableRemoteControlOfOtherUsers( + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteControlOfOtherUsers) { + this.enableRemoteControlOfOtherUsers = enableRemoteControlOfOtherUsers; + } + + public UserPolicy enableSharedDeviceControl(@org.eclipse.jdt.annotation.NonNull Boolean enableSharedDeviceControl) { + this.enableSharedDeviceControl = enableSharedDeviceControl; + return this; + } + + /** + * Get enableSharedDeviceControl + * + * @return enableSharedDeviceControl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_SHARED_DEVICE_CONTROL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableSharedDeviceControl() { + return enableSharedDeviceControl; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_SHARED_DEVICE_CONTROL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableSharedDeviceControl(@org.eclipse.jdt.annotation.NonNull Boolean enableSharedDeviceControl) { + this.enableSharedDeviceControl = enableSharedDeviceControl; + } + + public UserPolicy enableRemoteAccess(@org.eclipse.jdt.annotation.NonNull Boolean enableRemoteAccess) { + this.enableRemoteAccess = enableRemoteAccess; + return this; + } + + /** + * Get enableRemoteAccess + * + * @return enableRemoteAccess + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_REMOTE_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableRemoteAccess() { + return enableRemoteAccess; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_REMOTE_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableRemoteAccess(@org.eclipse.jdt.annotation.NonNull Boolean enableRemoteAccess) { + this.enableRemoteAccess = enableRemoteAccess; + } + + public UserPolicy enableLiveTvManagement(@org.eclipse.jdt.annotation.NonNull Boolean enableLiveTvManagement) { + this.enableLiveTvManagement = enableLiveTvManagement; + return this; + } + + /** + * Get enableLiveTvManagement + * + * @return enableLiveTvManagement + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_LIVE_TV_MANAGEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableLiveTvManagement() { + return enableLiveTvManagement; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_LIVE_TV_MANAGEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableLiveTvManagement(@org.eclipse.jdt.annotation.NonNull Boolean enableLiveTvManagement) { + this.enableLiveTvManagement = enableLiveTvManagement; + } + + public UserPolicy enableLiveTvAccess(@org.eclipse.jdt.annotation.NonNull Boolean enableLiveTvAccess) { + this.enableLiveTvAccess = enableLiveTvAccess; + return this; + } + + /** + * Get enableLiveTvAccess + * + * @return enableLiveTvAccess + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_LIVE_TV_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableLiveTvAccess() { + return enableLiveTvAccess; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_LIVE_TV_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableLiveTvAccess(@org.eclipse.jdt.annotation.NonNull Boolean enableLiveTvAccess) { + this.enableLiveTvAccess = enableLiveTvAccess; + } + + public UserPolicy enableMediaPlayback(@org.eclipse.jdt.annotation.NonNull Boolean enableMediaPlayback) { + this.enableMediaPlayback = enableMediaPlayback; + return this; + } + + /** + * Get enableMediaPlayback + * + * @return enableMediaPlayback + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_MEDIA_PLAYBACK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableMediaPlayback() { + return enableMediaPlayback; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_MEDIA_PLAYBACK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableMediaPlayback(@org.eclipse.jdt.annotation.NonNull Boolean enableMediaPlayback) { + this.enableMediaPlayback = enableMediaPlayback; + } + + public UserPolicy enableAudioPlaybackTranscoding( + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioPlaybackTranscoding) { + this.enableAudioPlaybackTranscoding = enableAudioPlaybackTranscoding; + return this; + } + + /** + * Get enableAudioPlaybackTranscoding + * + * @return enableAudioPlaybackTranscoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_AUDIO_PLAYBACK_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAudioPlaybackTranscoding() { + return enableAudioPlaybackTranscoding; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_AUDIO_PLAYBACK_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAudioPlaybackTranscoding( + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioPlaybackTranscoding) { + this.enableAudioPlaybackTranscoding = enableAudioPlaybackTranscoding; + } + + public UserPolicy enableVideoPlaybackTranscoding( + @org.eclipse.jdt.annotation.NonNull Boolean enableVideoPlaybackTranscoding) { + this.enableVideoPlaybackTranscoding = enableVideoPlaybackTranscoding; + return this; + } + + /** + * Get enableVideoPlaybackTranscoding + * + * @return enableVideoPlaybackTranscoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_VIDEO_PLAYBACK_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableVideoPlaybackTranscoding() { + return enableVideoPlaybackTranscoding; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_VIDEO_PLAYBACK_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableVideoPlaybackTranscoding( + @org.eclipse.jdt.annotation.NonNull Boolean enableVideoPlaybackTranscoding) { + this.enableVideoPlaybackTranscoding = enableVideoPlaybackTranscoding; + } + + public UserPolicy enablePlaybackRemuxing(@org.eclipse.jdt.annotation.NonNull Boolean enablePlaybackRemuxing) { + this.enablePlaybackRemuxing = enablePlaybackRemuxing; + return this; + } + + /** + * Get enablePlaybackRemuxing + * + * @return enablePlaybackRemuxing + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_PLAYBACK_REMUXING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnablePlaybackRemuxing() { + return enablePlaybackRemuxing; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_PLAYBACK_REMUXING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnablePlaybackRemuxing(@org.eclipse.jdt.annotation.NonNull Boolean enablePlaybackRemuxing) { + this.enablePlaybackRemuxing = enablePlaybackRemuxing; + } + + public UserPolicy forceRemoteSourceTranscoding( + @org.eclipse.jdt.annotation.NonNull Boolean forceRemoteSourceTranscoding) { + this.forceRemoteSourceTranscoding = forceRemoteSourceTranscoding; + return this; + } + + /** + * Get forceRemoteSourceTranscoding + * + * @return forceRemoteSourceTranscoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FORCE_REMOTE_SOURCE_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForceRemoteSourceTranscoding() { + return forceRemoteSourceTranscoding; + } + + @JsonProperty(JSON_PROPERTY_FORCE_REMOTE_SOURCE_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceRemoteSourceTranscoding( + @org.eclipse.jdt.annotation.NonNull Boolean forceRemoteSourceTranscoding) { + this.forceRemoteSourceTranscoding = forceRemoteSourceTranscoding; + } + + public UserPolicy enableContentDeletion(@org.eclipse.jdt.annotation.NonNull Boolean enableContentDeletion) { + this.enableContentDeletion = enableContentDeletion; + return this; + } + + /** + * Get enableContentDeletion + * + * @return enableContentDeletion + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_CONTENT_DELETION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableContentDeletion() { + return enableContentDeletion; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_CONTENT_DELETION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableContentDeletion(@org.eclipse.jdt.annotation.NonNull Boolean enableContentDeletion) { + this.enableContentDeletion = enableContentDeletion; + } + + public UserPolicy enableContentDeletionFromFolders( + @org.eclipse.jdt.annotation.NonNull List enableContentDeletionFromFolders) { + this.enableContentDeletionFromFolders = enableContentDeletionFromFolders; + return this; + } + + public UserPolicy addEnableContentDeletionFromFoldersItem(String enableContentDeletionFromFoldersItem) { + if (this.enableContentDeletionFromFolders == null) { + this.enableContentDeletionFromFolders = new ArrayList<>(); + } + this.enableContentDeletionFromFolders.add(enableContentDeletionFromFoldersItem); + return this; + } + + /** + * Get enableContentDeletionFromFolders + * + * @return enableContentDeletionFromFolders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_CONTENT_DELETION_FROM_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnableContentDeletionFromFolders() { + return enableContentDeletionFromFolders; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_CONTENT_DELETION_FROM_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableContentDeletionFromFolders( + @org.eclipse.jdt.annotation.NonNull List enableContentDeletionFromFolders) { + this.enableContentDeletionFromFolders = enableContentDeletionFromFolders; + } + + public UserPolicy enableContentDownloading(@org.eclipse.jdt.annotation.NonNull Boolean enableContentDownloading) { + this.enableContentDownloading = enableContentDownloading; + return this; + } + + /** + * Get enableContentDownloading + * + * @return enableContentDownloading + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_CONTENT_DOWNLOADING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableContentDownloading() { + return enableContentDownloading; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_CONTENT_DOWNLOADING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableContentDownloading(@org.eclipse.jdt.annotation.NonNull Boolean enableContentDownloading) { + this.enableContentDownloading = enableContentDownloading; + } + + public UserPolicy enableSyncTranscoding(@org.eclipse.jdt.annotation.NonNull Boolean enableSyncTranscoding) { + this.enableSyncTranscoding = enableSyncTranscoding; + return this; + } + + /** + * Gets or sets a value indicating whether [enable synchronize]. + * + * @return enableSyncTranscoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_SYNC_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableSyncTranscoding() { + return enableSyncTranscoding; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_SYNC_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableSyncTranscoding(@org.eclipse.jdt.annotation.NonNull Boolean enableSyncTranscoding) { + this.enableSyncTranscoding = enableSyncTranscoding; + } + + public UserPolicy enableMediaConversion(@org.eclipse.jdt.annotation.NonNull Boolean enableMediaConversion) { + this.enableMediaConversion = enableMediaConversion; + return this; + } + + /** + * Get enableMediaConversion + * + * @return enableMediaConversion + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_MEDIA_CONVERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableMediaConversion() { + return enableMediaConversion; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_MEDIA_CONVERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableMediaConversion(@org.eclipse.jdt.annotation.NonNull Boolean enableMediaConversion) { + this.enableMediaConversion = enableMediaConversion; + } + + public UserPolicy enabledDevices(@org.eclipse.jdt.annotation.NonNull List enabledDevices) { + this.enabledDevices = enabledDevices; + return this; + } + + public UserPolicy addEnabledDevicesItem(String enabledDevicesItem) { + if (this.enabledDevices == null) { + this.enabledDevices = new ArrayList<>(); + } + this.enabledDevices.add(enabledDevicesItem); + return this; + } + + /** + * Get enabledDevices + * + * @return enabledDevices + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLED_DEVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnabledDevices() { + return enabledDevices; + } + + @JsonProperty(JSON_PROPERTY_ENABLED_DEVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabledDevices(@org.eclipse.jdt.annotation.NonNull List enabledDevices) { + this.enabledDevices = enabledDevices; + } + + public UserPolicy enableAllDevices(@org.eclipse.jdt.annotation.NonNull Boolean enableAllDevices) { + this.enableAllDevices = enableAllDevices; + return this; + } + + /** + * Get enableAllDevices + * + * @return enableAllDevices + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_ALL_DEVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAllDevices() { + return enableAllDevices; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_ALL_DEVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAllDevices(@org.eclipse.jdt.annotation.NonNull Boolean enableAllDevices) { + this.enableAllDevices = enableAllDevices; + } + + public UserPolicy enabledChannels(@org.eclipse.jdt.annotation.NonNull List enabledChannels) { + this.enabledChannels = enabledChannels; + return this; + } + + public UserPolicy addEnabledChannelsItem(UUID enabledChannelsItem) { + if (this.enabledChannels == null) { + this.enabledChannels = new ArrayList<>(); + } + this.enabledChannels.add(enabledChannelsItem); + return this; + } + + /** + * Get enabledChannels + * + * @return enabledChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLED_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnabledChannels() { + return enabledChannels; + } + + @JsonProperty(JSON_PROPERTY_ENABLED_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabledChannels(@org.eclipse.jdt.annotation.NonNull List enabledChannels) { + this.enabledChannels = enabledChannels; + } + + public UserPolicy enableAllChannels(@org.eclipse.jdt.annotation.NonNull Boolean enableAllChannels) { + this.enableAllChannels = enableAllChannels; + return this; + } + + /** + * Get enableAllChannels + * + * @return enableAllChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_ALL_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAllChannels() { + return enableAllChannels; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_ALL_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAllChannels(@org.eclipse.jdt.annotation.NonNull Boolean enableAllChannels) { + this.enableAllChannels = enableAllChannels; + } + + public UserPolicy enabledFolders(@org.eclipse.jdt.annotation.NonNull List enabledFolders) { + this.enabledFolders = enabledFolders; + return this; + } + + public UserPolicy addEnabledFoldersItem(UUID enabledFoldersItem) { + if (this.enabledFolders == null) { + this.enabledFolders = new ArrayList<>(); + } + this.enabledFolders.add(enabledFoldersItem); + return this; + } + + /** + * Get enabledFolders + * + * @return enabledFolders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLED_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnabledFolders() { + return enabledFolders; + } + + @JsonProperty(JSON_PROPERTY_ENABLED_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabledFolders(@org.eclipse.jdt.annotation.NonNull List enabledFolders) { + this.enabledFolders = enabledFolders; + } + + public UserPolicy enableAllFolders(@org.eclipse.jdt.annotation.NonNull Boolean enableAllFolders) { + this.enableAllFolders = enableAllFolders; + return this; + } + + /** + * Get enableAllFolders + * + * @return enableAllFolders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_ALL_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAllFolders() { + return enableAllFolders; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_ALL_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAllFolders(@org.eclipse.jdt.annotation.NonNull Boolean enableAllFolders) { + this.enableAllFolders = enableAllFolders; + } + + public UserPolicy invalidLoginAttemptCount(@org.eclipse.jdt.annotation.NonNull Integer invalidLoginAttemptCount) { + this.invalidLoginAttemptCount = invalidLoginAttemptCount; + return this; + } + + /** + * Get invalidLoginAttemptCount + * + * @return invalidLoginAttemptCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INVALID_LOGIN_ATTEMPT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInvalidLoginAttemptCount() { + return invalidLoginAttemptCount; + } + + @JsonProperty(JSON_PROPERTY_INVALID_LOGIN_ATTEMPT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInvalidLoginAttemptCount(@org.eclipse.jdt.annotation.NonNull Integer invalidLoginAttemptCount) { + this.invalidLoginAttemptCount = invalidLoginAttemptCount; + } + + public UserPolicy loginAttemptsBeforeLockout( + @org.eclipse.jdt.annotation.NonNull Integer loginAttemptsBeforeLockout) { + this.loginAttemptsBeforeLockout = loginAttemptsBeforeLockout; + return this; + } + + /** + * Get loginAttemptsBeforeLockout + * + * @return loginAttemptsBeforeLockout + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOGIN_ATTEMPTS_BEFORE_LOCKOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLoginAttemptsBeforeLockout() { + return loginAttemptsBeforeLockout; + } + + @JsonProperty(JSON_PROPERTY_LOGIN_ATTEMPTS_BEFORE_LOCKOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoginAttemptsBeforeLockout(@org.eclipse.jdt.annotation.NonNull Integer loginAttemptsBeforeLockout) { + this.loginAttemptsBeforeLockout = loginAttemptsBeforeLockout; + } + + public UserPolicy maxActiveSessions(@org.eclipse.jdt.annotation.NonNull Integer maxActiveSessions) { + this.maxActiveSessions = maxActiveSessions; + return this; + } + + /** + * Get maxActiveSessions + * + * @return maxActiveSessions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_ACTIVE_SESSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxActiveSessions() { + return maxActiveSessions; + } + + @JsonProperty(JSON_PROPERTY_MAX_ACTIVE_SESSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxActiveSessions(@org.eclipse.jdt.annotation.NonNull Integer maxActiveSessions) { + this.maxActiveSessions = maxActiveSessions; + } + + public UserPolicy enablePublicSharing(@org.eclipse.jdt.annotation.NonNull Boolean enablePublicSharing) { + this.enablePublicSharing = enablePublicSharing; + return this; + } + + /** + * Get enablePublicSharing + * + * @return enablePublicSharing + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_PUBLIC_SHARING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnablePublicSharing() { + return enablePublicSharing; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_PUBLIC_SHARING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnablePublicSharing(@org.eclipse.jdt.annotation.NonNull Boolean enablePublicSharing) { + this.enablePublicSharing = enablePublicSharing; + } + + public UserPolicy blockedMediaFolders(@org.eclipse.jdt.annotation.NonNull List blockedMediaFolders) { + this.blockedMediaFolders = blockedMediaFolders; + return this; + } + + public UserPolicy addBlockedMediaFoldersItem(UUID blockedMediaFoldersItem) { + if (this.blockedMediaFolders == null) { + this.blockedMediaFolders = new ArrayList<>(); + } + this.blockedMediaFolders.add(blockedMediaFoldersItem); + return this; + } + + /** + * Get blockedMediaFolders + * + * @return blockedMediaFolders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BLOCKED_MEDIA_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBlockedMediaFolders() { + return blockedMediaFolders; + } + + @JsonProperty(JSON_PROPERTY_BLOCKED_MEDIA_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlockedMediaFolders(@org.eclipse.jdt.annotation.NonNull List blockedMediaFolders) { + this.blockedMediaFolders = blockedMediaFolders; + } + + public UserPolicy blockedChannels(@org.eclipse.jdt.annotation.NonNull List blockedChannels) { + this.blockedChannels = blockedChannels; + return this; + } + + public UserPolicy addBlockedChannelsItem(UUID blockedChannelsItem) { + if (this.blockedChannels == null) { + this.blockedChannels = new ArrayList<>(); + } + this.blockedChannels.add(blockedChannelsItem); + return this; + } + + /** + * Get blockedChannels + * + * @return blockedChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BLOCKED_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBlockedChannels() { + return blockedChannels; + } + + @JsonProperty(JSON_PROPERTY_BLOCKED_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlockedChannels(@org.eclipse.jdt.annotation.NonNull List blockedChannels) { + this.blockedChannels = blockedChannels; + } + + public UserPolicy remoteClientBitrateLimit(@org.eclipse.jdt.annotation.NonNull Integer remoteClientBitrateLimit) { + this.remoteClientBitrateLimit = remoteClientBitrateLimit; + return this; + } + + /** + * Get remoteClientBitrateLimit + * + * @return remoteClientBitrateLimit + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMOTE_CLIENT_BITRATE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRemoteClientBitrateLimit() { + return remoteClientBitrateLimit; + } + + @JsonProperty(JSON_PROPERTY_REMOTE_CLIENT_BITRATE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemoteClientBitrateLimit(@org.eclipse.jdt.annotation.NonNull Integer remoteClientBitrateLimit) { + this.remoteClientBitrateLimit = remoteClientBitrateLimit; + } + + public UserPolicy authenticationProviderId(@org.eclipse.jdt.annotation.Nullable String authenticationProviderId) { + this.authenticationProviderId = authenticationProviderId; + return this; + } + + /** + * Get authenticationProviderId + * + * @return authenticationProviderId + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTHENTICATION_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAuthenticationProviderId() { + return authenticationProviderId; + } + + @JsonProperty(JSON_PROPERTY_AUTHENTICATION_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAuthenticationProviderId(@org.eclipse.jdt.annotation.Nullable String authenticationProviderId) { + this.authenticationProviderId = authenticationProviderId; + } + + public UserPolicy passwordResetProviderId(@org.eclipse.jdt.annotation.Nullable String passwordResetProviderId) { + this.passwordResetProviderId = passwordResetProviderId; + return this; + } + + /** + * Get passwordResetProviderId + * + * @return passwordResetProviderId + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD_RESET_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPasswordResetProviderId() { + return passwordResetProviderId; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD_RESET_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPasswordResetProviderId(@org.eclipse.jdt.annotation.Nullable String passwordResetProviderId) { + this.passwordResetProviderId = passwordResetProviderId; + } + + public UserPolicy syncPlayAccess(@org.eclipse.jdt.annotation.NonNull SyncPlayUserAccessType syncPlayAccess) { + this.syncPlayAccess = syncPlayAccess; + return this; + } + + /** + * Gets or sets a value indicating what SyncPlay features the user can access. + * + * @return syncPlayAccess + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SYNC_PLAY_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyncPlayUserAccessType getSyncPlayAccess() { + return syncPlayAccess; + } + + @JsonProperty(JSON_PROPERTY_SYNC_PLAY_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSyncPlayAccess(@org.eclipse.jdt.annotation.NonNull SyncPlayUserAccessType syncPlayAccess) { + this.syncPlayAccess = syncPlayAccess; + } + + /** + * Return true if this UserPolicy object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserPolicy userPolicy = (UserPolicy) o; + return Objects.equals(this.isAdministrator, userPolicy.isAdministrator) + && Objects.equals(this.isHidden, userPolicy.isHidden) + && Objects.equals(this.enableCollectionManagement, userPolicy.enableCollectionManagement) + && Objects.equals(this.enableSubtitleManagement, userPolicy.enableSubtitleManagement) + && Objects.equals(this.enableLyricManagement, userPolicy.enableLyricManagement) + && Objects.equals(this.isDisabled, userPolicy.isDisabled) + && Objects.equals(this.maxParentalRating, userPolicy.maxParentalRating) + && Objects.equals(this.blockedTags, userPolicy.blockedTags) + && Objects.equals(this.allowedTags, userPolicy.allowedTags) + && Objects.equals(this.enableUserPreferenceAccess, userPolicy.enableUserPreferenceAccess) + && Objects.equals(this.accessSchedules, userPolicy.accessSchedules) + && Objects.equals(this.blockUnratedItems, userPolicy.blockUnratedItems) + && Objects.equals(this.enableRemoteControlOfOtherUsers, userPolicy.enableRemoteControlOfOtherUsers) + && Objects.equals(this.enableSharedDeviceControl, userPolicy.enableSharedDeviceControl) + && Objects.equals(this.enableRemoteAccess, userPolicy.enableRemoteAccess) + && Objects.equals(this.enableLiveTvManagement, userPolicy.enableLiveTvManagement) + && Objects.equals(this.enableLiveTvAccess, userPolicy.enableLiveTvAccess) + && Objects.equals(this.enableMediaPlayback, userPolicy.enableMediaPlayback) + && Objects.equals(this.enableAudioPlaybackTranscoding, userPolicy.enableAudioPlaybackTranscoding) + && Objects.equals(this.enableVideoPlaybackTranscoding, userPolicy.enableVideoPlaybackTranscoding) + && Objects.equals(this.enablePlaybackRemuxing, userPolicy.enablePlaybackRemuxing) + && Objects.equals(this.forceRemoteSourceTranscoding, userPolicy.forceRemoteSourceTranscoding) + && Objects.equals(this.enableContentDeletion, userPolicy.enableContentDeletion) + && Objects.equals(this.enableContentDeletionFromFolders, userPolicy.enableContentDeletionFromFolders) + && Objects.equals(this.enableContentDownloading, userPolicy.enableContentDownloading) + && Objects.equals(this.enableSyncTranscoding, userPolicy.enableSyncTranscoding) + && Objects.equals(this.enableMediaConversion, userPolicy.enableMediaConversion) + && Objects.equals(this.enabledDevices, userPolicy.enabledDevices) + && Objects.equals(this.enableAllDevices, userPolicy.enableAllDevices) + && Objects.equals(this.enabledChannels, userPolicy.enabledChannels) + && Objects.equals(this.enableAllChannels, userPolicy.enableAllChannels) + && Objects.equals(this.enabledFolders, userPolicy.enabledFolders) + && Objects.equals(this.enableAllFolders, userPolicy.enableAllFolders) + && Objects.equals(this.invalidLoginAttemptCount, userPolicy.invalidLoginAttemptCount) + && Objects.equals(this.loginAttemptsBeforeLockout, userPolicy.loginAttemptsBeforeLockout) + && Objects.equals(this.maxActiveSessions, userPolicy.maxActiveSessions) + && Objects.equals(this.enablePublicSharing, userPolicy.enablePublicSharing) + && Objects.equals(this.blockedMediaFolders, userPolicy.blockedMediaFolders) + && Objects.equals(this.blockedChannels, userPolicy.blockedChannels) + && Objects.equals(this.remoteClientBitrateLimit, userPolicy.remoteClientBitrateLimit) + && Objects.equals(this.authenticationProviderId, userPolicy.authenticationProviderId) + && Objects.equals(this.passwordResetProviderId, userPolicy.passwordResetProviderId) + && Objects.equals(this.syncPlayAccess, userPolicy.syncPlayAccess); + } + + @Override + public int hashCode() { + return Objects.hash(isAdministrator, isHidden, enableCollectionManagement, enableSubtitleManagement, + enableLyricManagement, isDisabled, maxParentalRating, blockedTags, allowedTags, + enableUserPreferenceAccess, accessSchedules, blockUnratedItems, enableRemoteControlOfOtherUsers, + enableSharedDeviceControl, enableRemoteAccess, enableLiveTvManagement, enableLiveTvAccess, + enableMediaPlayback, enableAudioPlaybackTranscoding, enableVideoPlaybackTranscoding, + enablePlaybackRemuxing, forceRemoteSourceTranscoding, enableContentDeletion, + enableContentDeletionFromFolders, enableContentDownloading, enableSyncTranscoding, + enableMediaConversion, enabledDevices, enableAllDevices, enabledChannels, enableAllChannels, + enabledFolders, enableAllFolders, invalidLoginAttemptCount, loginAttemptsBeforeLockout, + maxActiveSessions, enablePublicSharing, blockedMediaFolders, blockedChannels, remoteClientBitrateLimit, + authenticationProviderId, passwordResetProviderId, syncPlayAccess); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserPolicy {\n"); + sb.append(" isAdministrator: ").append(toIndentedString(isAdministrator)).append("\n"); + sb.append(" isHidden: ").append(toIndentedString(isHidden)).append("\n"); + sb.append(" enableCollectionManagement: ").append(toIndentedString(enableCollectionManagement)).append("\n"); + sb.append(" enableSubtitleManagement: ").append(toIndentedString(enableSubtitleManagement)).append("\n"); + sb.append(" enableLyricManagement: ").append(toIndentedString(enableLyricManagement)).append("\n"); + sb.append(" isDisabled: ").append(toIndentedString(isDisabled)).append("\n"); + sb.append(" maxParentalRating: ").append(toIndentedString(maxParentalRating)).append("\n"); + sb.append(" blockedTags: ").append(toIndentedString(blockedTags)).append("\n"); + sb.append(" allowedTags: ").append(toIndentedString(allowedTags)).append("\n"); + sb.append(" enableUserPreferenceAccess: ").append(toIndentedString(enableUserPreferenceAccess)).append("\n"); + sb.append(" accessSchedules: ").append(toIndentedString(accessSchedules)).append("\n"); + sb.append(" blockUnratedItems: ").append(toIndentedString(blockUnratedItems)).append("\n"); + sb.append(" enableRemoteControlOfOtherUsers: ").append(toIndentedString(enableRemoteControlOfOtherUsers)) + .append("\n"); + sb.append(" enableSharedDeviceControl: ").append(toIndentedString(enableSharedDeviceControl)).append("\n"); + sb.append(" enableRemoteAccess: ").append(toIndentedString(enableRemoteAccess)).append("\n"); + sb.append(" enableLiveTvManagement: ").append(toIndentedString(enableLiveTvManagement)).append("\n"); + sb.append(" enableLiveTvAccess: ").append(toIndentedString(enableLiveTvAccess)).append("\n"); + sb.append(" enableMediaPlayback: ").append(toIndentedString(enableMediaPlayback)).append("\n"); + sb.append(" enableAudioPlaybackTranscoding: ").append(toIndentedString(enableAudioPlaybackTranscoding)) + .append("\n"); + sb.append(" enableVideoPlaybackTranscoding: ").append(toIndentedString(enableVideoPlaybackTranscoding)) + .append("\n"); + sb.append(" enablePlaybackRemuxing: ").append(toIndentedString(enablePlaybackRemuxing)).append("\n"); + sb.append(" forceRemoteSourceTranscoding: ").append(toIndentedString(forceRemoteSourceTranscoding)) + .append("\n"); + sb.append(" enableContentDeletion: ").append(toIndentedString(enableContentDeletion)).append("\n"); + sb.append(" enableContentDeletionFromFolders: ").append(toIndentedString(enableContentDeletionFromFolders)) + .append("\n"); + sb.append(" enableContentDownloading: ").append(toIndentedString(enableContentDownloading)).append("\n"); + sb.append(" enableSyncTranscoding: ").append(toIndentedString(enableSyncTranscoding)).append("\n"); + sb.append(" enableMediaConversion: ").append(toIndentedString(enableMediaConversion)).append("\n"); + sb.append(" enabledDevices: ").append(toIndentedString(enabledDevices)).append("\n"); + sb.append(" enableAllDevices: ").append(toIndentedString(enableAllDevices)).append("\n"); + sb.append(" enabledChannels: ").append(toIndentedString(enabledChannels)).append("\n"); + sb.append(" enableAllChannels: ").append(toIndentedString(enableAllChannels)).append("\n"); + sb.append(" enabledFolders: ").append(toIndentedString(enabledFolders)).append("\n"); + sb.append(" enableAllFolders: ").append(toIndentedString(enableAllFolders)).append("\n"); + sb.append(" invalidLoginAttemptCount: ").append(toIndentedString(invalidLoginAttemptCount)).append("\n"); + sb.append(" loginAttemptsBeforeLockout: ").append(toIndentedString(loginAttemptsBeforeLockout)).append("\n"); + sb.append(" maxActiveSessions: ").append(toIndentedString(maxActiveSessions)).append("\n"); + sb.append(" enablePublicSharing: ").append(toIndentedString(enablePublicSharing)).append("\n"); + sb.append(" blockedMediaFolders: ").append(toIndentedString(blockedMediaFolders)).append("\n"); + sb.append(" blockedChannels: ").append(toIndentedString(blockedChannels)).append("\n"); + sb.append(" remoteClientBitrateLimit: ").append(toIndentedString(remoteClientBitrateLimit)).append("\n"); + sb.append(" authenticationProviderId: ").append(toIndentedString(authenticationProviderId)).append("\n"); + sb.append(" passwordResetProviderId: ").append(toIndentedString(passwordResetProviderId)).append("\n"); + sb.append(" syncPlayAccess: ").append(toIndentedString(syncPlayAccess)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `IsAdministrator` to the URL query string + if (getIsAdministrator() != null) { + joiner.add(String.format("%sIsAdministrator%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAdministrator())))); + } + + // add `IsHidden` to the URL query string + if (getIsHidden() != null) { + joiner.add(String.format("%sIsHidden%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsHidden())))); + } + + // add `EnableCollectionManagement` to the URL query string + if (getEnableCollectionManagement() != null) { + joiner.add(String.format("%sEnableCollectionManagement%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableCollectionManagement())))); + } + + // add `EnableSubtitleManagement` to the URL query string + if (getEnableSubtitleManagement() != null) { + joiner.add(String.format("%sEnableSubtitleManagement%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableSubtitleManagement())))); + } + + // add `EnableLyricManagement` to the URL query string + if (getEnableLyricManagement() != null) { + joiner.add(String.format("%sEnableLyricManagement%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableLyricManagement())))); + } + + // add `IsDisabled` to the URL query string + if (getIsDisabled() != null) { + joiner.add(String.format("%sIsDisabled%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsDisabled())))); + } + + // add `MaxParentalRating` to the URL query string + if (getMaxParentalRating() != null) { + joiner.add(String.format("%sMaxParentalRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxParentalRating())))); + } + + // add `BlockedTags` to the URL query string + if (getBlockedTags() != null) { + for (int i = 0; i < getBlockedTags().size(); i++) { + joiner.add(String.format("%sBlockedTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getBlockedTags().get(i))))); + } + } + + // add `AllowedTags` to the URL query string + if (getAllowedTags() != null) { + for (int i = 0; i < getAllowedTags().size(); i++) { + joiner.add(String.format("%sAllowedTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getAllowedTags().get(i))))); + } + } + + // add `EnableUserPreferenceAccess` to the URL query string + if (getEnableUserPreferenceAccess() != null) { + joiner.add(String.format("%sEnableUserPreferenceAccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableUserPreferenceAccess())))); + } + + // add `AccessSchedules` to the URL query string + if (getAccessSchedules() != null) { + for (int i = 0; i < getAccessSchedules().size(); i++) { + if (getAccessSchedules().get(i) != null) { + joiner.add(getAccessSchedules().get(i).toUrlQueryString(String.format("%sAccessSchedules%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `BlockUnratedItems` to the URL query string + if (getBlockUnratedItems() != null) { + for (int i = 0; i < getBlockUnratedItems().size(); i++) { + if (getBlockUnratedItems().get(i) != null) { + joiner.add(String.format("%sBlockUnratedItems%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getBlockUnratedItems().get(i))))); + } + } + } + + // add `EnableRemoteControlOfOtherUsers` to the URL query string + if (getEnableRemoteControlOfOtherUsers() != null) { + joiner.add(String.format("%sEnableRemoteControlOfOtherUsers%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableRemoteControlOfOtherUsers())))); + } + + // add `EnableSharedDeviceControl` to the URL query string + if (getEnableSharedDeviceControl() != null) { + joiner.add(String.format("%sEnableSharedDeviceControl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableSharedDeviceControl())))); + } + + // add `EnableRemoteAccess` to the URL query string + if (getEnableRemoteAccess() != null) { + joiner.add(String.format("%sEnableRemoteAccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableRemoteAccess())))); + } + + // add `EnableLiveTvManagement` to the URL query string + if (getEnableLiveTvManagement() != null) { + joiner.add(String.format("%sEnableLiveTvManagement%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableLiveTvManagement())))); + } + + // add `EnableLiveTvAccess` to the URL query string + if (getEnableLiveTvAccess() != null) { + joiner.add(String.format("%sEnableLiveTvAccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableLiveTvAccess())))); + } + + // add `EnableMediaPlayback` to the URL query string + if (getEnableMediaPlayback() != null) { + joiner.add(String.format("%sEnableMediaPlayback%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableMediaPlayback())))); + } + + // add `EnableAudioPlaybackTranscoding` to the URL query string + if (getEnableAudioPlaybackTranscoding() != null) { + joiner.add(String.format("%sEnableAudioPlaybackTranscoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAudioPlaybackTranscoding())))); + } + + // add `EnableVideoPlaybackTranscoding` to the URL query string + if (getEnableVideoPlaybackTranscoding() != null) { + joiner.add(String.format("%sEnableVideoPlaybackTranscoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableVideoPlaybackTranscoding())))); + } + + // add `EnablePlaybackRemuxing` to the URL query string + if (getEnablePlaybackRemuxing() != null) { + joiner.add(String.format("%sEnablePlaybackRemuxing%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnablePlaybackRemuxing())))); + } + + // add `ForceRemoteSourceTranscoding` to the URL query string + if (getForceRemoteSourceTranscoding() != null) { + joiner.add(String.format("%sForceRemoteSourceTranscoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getForceRemoteSourceTranscoding())))); + } + + // add `EnableContentDeletion` to the URL query string + if (getEnableContentDeletion() != null) { + joiner.add(String.format("%sEnableContentDeletion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableContentDeletion())))); + } + + // add `EnableContentDeletionFromFolders` to the URL query string + if (getEnableContentDeletionFromFolders() != null) { + for (int i = 0; i < getEnableContentDeletionFromFolders().size(); i++) { + joiner.add(String.format("%sEnableContentDeletionFromFolders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEnableContentDeletionFromFolders().get(i))))); + } + } + + // add `EnableContentDownloading` to the URL query string + if (getEnableContentDownloading() != null) { + joiner.add(String.format("%sEnableContentDownloading%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableContentDownloading())))); + } + + // add `EnableSyncTranscoding` to the URL query string + if (getEnableSyncTranscoding() != null) { + joiner.add(String.format("%sEnableSyncTranscoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableSyncTranscoding())))); + } + + // add `EnableMediaConversion` to the URL query string + if (getEnableMediaConversion() != null) { + joiner.add(String.format("%sEnableMediaConversion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableMediaConversion())))); + } + + // add `EnabledDevices` to the URL query string + if (getEnabledDevices() != null) { + for (int i = 0; i < getEnabledDevices().size(); i++) { + joiner.add(String.format("%sEnabledDevices%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEnabledDevices().get(i))))); + } + } + + // add `EnableAllDevices` to the URL query string + if (getEnableAllDevices() != null) { + joiner.add(String.format("%sEnableAllDevices%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAllDevices())))); + } + + // add `EnabledChannels` to the URL query string + if (getEnabledChannels() != null) { + for (int i = 0; i < getEnabledChannels().size(); i++) { + if (getEnabledChannels().get(i) != null) { + joiner.add(String.format("%sEnabledChannels%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEnabledChannels().get(i))))); + } + } + } + + // add `EnableAllChannels` to the URL query string + if (getEnableAllChannels() != null) { + joiner.add(String.format("%sEnableAllChannels%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAllChannels())))); + } + + // add `EnabledFolders` to the URL query string + if (getEnabledFolders() != null) { + for (int i = 0; i < getEnabledFolders().size(); i++) { + if (getEnabledFolders().get(i) != null) { + joiner.add(String.format("%sEnabledFolders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEnabledFolders().get(i))))); + } + } + } + + // add `EnableAllFolders` to the URL query string + if (getEnableAllFolders() != null) { + joiner.add(String.format("%sEnableAllFolders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAllFolders())))); + } + + // add `InvalidLoginAttemptCount` to the URL query string + if (getInvalidLoginAttemptCount() != null) { + joiner.add(String.format("%sInvalidLoginAttemptCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getInvalidLoginAttemptCount())))); + } + + // add `LoginAttemptsBeforeLockout` to the URL query string + if (getLoginAttemptsBeforeLockout() != null) { + joiner.add(String.format("%sLoginAttemptsBeforeLockout%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLoginAttemptsBeforeLockout())))); + } + + // add `MaxActiveSessions` to the URL query string + if (getMaxActiveSessions() != null) { + joiner.add(String.format("%sMaxActiveSessions%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxActiveSessions())))); + } + + // add `EnablePublicSharing` to the URL query string + if (getEnablePublicSharing() != null) { + joiner.add(String.format("%sEnablePublicSharing%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnablePublicSharing())))); + } + + // add `BlockedMediaFolders` to the URL query string + if (getBlockedMediaFolders() != null) { + for (int i = 0; i < getBlockedMediaFolders().size(); i++) { + if (getBlockedMediaFolders().get(i) != null) { + joiner.add(String.format("%sBlockedMediaFolders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getBlockedMediaFolders().get(i))))); + } + } + } + + // add `BlockedChannels` to the URL query string + if (getBlockedChannels() != null) { + for (int i = 0; i < getBlockedChannels().size(); i++) { + if (getBlockedChannels().get(i) != null) { + joiner.add(String.format("%sBlockedChannels%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getBlockedChannels().get(i))))); + } + } + } + + // add `RemoteClientBitrateLimit` to the URL query string + if (getRemoteClientBitrateLimit() != null) { + joiner.add(String.format("%sRemoteClientBitrateLimit%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRemoteClientBitrateLimit())))); + } + + // add `AuthenticationProviderId` to the URL query string + if (getAuthenticationProviderId() != null) { + joiner.add(String.format("%sAuthenticationProviderId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAuthenticationProviderId())))); + } + + // add `PasswordResetProviderId` to the URL query string + if (getPasswordResetProviderId() != null) { + joiner.add(String.format("%sPasswordResetProviderId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPasswordResetProviderId())))); + } + + // add `SyncPlayAccess` to the URL query string + if (getSyncPlayAccess() != null) { + joiner.add(String.format("%sSyncPlayAccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSyncPlayAccess())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UserPolicy instance; + + public Builder() { + this(new UserPolicy()); + } + + protected Builder(UserPolicy instance) { + this.instance = instance; + } + + public UserPolicy.Builder isAdministrator(Boolean isAdministrator) { + this.instance.isAdministrator = isAdministrator; + return this; + } + + public UserPolicy.Builder isHidden(Boolean isHidden) { + this.instance.isHidden = isHidden; + return this; + } + + public UserPolicy.Builder enableCollectionManagement(Boolean enableCollectionManagement) { + this.instance.enableCollectionManagement = enableCollectionManagement; + return this; + } + + public UserPolicy.Builder enableSubtitleManagement(Boolean enableSubtitleManagement) { + this.instance.enableSubtitleManagement = enableSubtitleManagement; + return this; + } + + public UserPolicy.Builder enableLyricManagement(Boolean enableLyricManagement) { + this.instance.enableLyricManagement = enableLyricManagement; + return this; + } + + public UserPolicy.Builder isDisabled(Boolean isDisabled) { + this.instance.isDisabled = isDisabled; + return this; + } + + public UserPolicy.Builder maxParentalRating(Integer maxParentalRating) { + this.instance.maxParentalRating = maxParentalRating; + return this; + } + + public UserPolicy.Builder blockedTags(List blockedTags) { + this.instance.blockedTags = blockedTags; + return this; + } + + public UserPolicy.Builder allowedTags(List allowedTags) { + this.instance.allowedTags = allowedTags; + return this; + } + + public UserPolicy.Builder enableUserPreferenceAccess(Boolean enableUserPreferenceAccess) { + this.instance.enableUserPreferenceAccess = enableUserPreferenceAccess; + return this; + } + + public UserPolicy.Builder accessSchedules(List accessSchedules) { + this.instance.accessSchedules = accessSchedules; + return this; + } + + public UserPolicy.Builder blockUnratedItems(List blockUnratedItems) { + this.instance.blockUnratedItems = blockUnratedItems; + return this; + } + + public UserPolicy.Builder enableRemoteControlOfOtherUsers(Boolean enableRemoteControlOfOtherUsers) { + this.instance.enableRemoteControlOfOtherUsers = enableRemoteControlOfOtherUsers; + return this; + } + + public UserPolicy.Builder enableSharedDeviceControl(Boolean enableSharedDeviceControl) { + this.instance.enableSharedDeviceControl = enableSharedDeviceControl; + return this; + } + + public UserPolicy.Builder enableRemoteAccess(Boolean enableRemoteAccess) { + this.instance.enableRemoteAccess = enableRemoteAccess; + return this; + } + + public UserPolicy.Builder enableLiveTvManagement(Boolean enableLiveTvManagement) { + this.instance.enableLiveTvManagement = enableLiveTvManagement; + return this; + } + + public UserPolicy.Builder enableLiveTvAccess(Boolean enableLiveTvAccess) { + this.instance.enableLiveTvAccess = enableLiveTvAccess; + return this; + } + + public UserPolicy.Builder enableMediaPlayback(Boolean enableMediaPlayback) { + this.instance.enableMediaPlayback = enableMediaPlayback; + return this; + } + + public UserPolicy.Builder enableAudioPlaybackTranscoding(Boolean enableAudioPlaybackTranscoding) { + this.instance.enableAudioPlaybackTranscoding = enableAudioPlaybackTranscoding; + return this; + } + + public UserPolicy.Builder enableVideoPlaybackTranscoding(Boolean enableVideoPlaybackTranscoding) { + this.instance.enableVideoPlaybackTranscoding = enableVideoPlaybackTranscoding; + return this; + } + + public UserPolicy.Builder enablePlaybackRemuxing(Boolean enablePlaybackRemuxing) { + this.instance.enablePlaybackRemuxing = enablePlaybackRemuxing; + return this; + } + + public UserPolicy.Builder forceRemoteSourceTranscoding(Boolean forceRemoteSourceTranscoding) { + this.instance.forceRemoteSourceTranscoding = forceRemoteSourceTranscoding; + return this; + } + + public UserPolicy.Builder enableContentDeletion(Boolean enableContentDeletion) { + this.instance.enableContentDeletion = enableContentDeletion; + return this; + } + + public UserPolicy.Builder enableContentDeletionFromFolders(List enableContentDeletionFromFolders) { + this.instance.enableContentDeletionFromFolders = enableContentDeletionFromFolders; + return this; + } + + public UserPolicy.Builder enableContentDownloading(Boolean enableContentDownloading) { + this.instance.enableContentDownloading = enableContentDownloading; + return this; + } + + public UserPolicy.Builder enableSyncTranscoding(Boolean enableSyncTranscoding) { + this.instance.enableSyncTranscoding = enableSyncTranscoding; + return this; + } + + public UserPolicy.Builder enableMediaConversion(Boolean enableMediaConversion) { + this.instance.enableMediaConversion = enableMediaConversion; + return this; + } + + public UserPolicy.Builder enabledDevices(List enabledDevices) { + this.instance.enabledDevices = enabledDevices; + return this; + } + + public UserPolicy.Builder enableAllDevices(Boolean enableAllDevices) { + this.instance.enableAllDevices = enableAllDevices; + return this; + } + + public UserPolicy.Builder enabledChannels(List enabledChannels) { + this.instance.enabledChannels = enabledChannels; + return this; + } + + public UserPolicy.Builder enableAllChannels(Boolean enableAllChannels) { + this.instance.enableAllChannels = enableAllChannels; + return this; + } + + public UserPolicy.Builder enabledFolders(List enabledFolders) { + this.instance.enabledFolders = enabledFolders; + return this; + } + + public UserPolicy.Builder enableAllFolders(Boolean enableAllFolders) { + this.instance.enableAllFolders = enableAllFolders; + return this; + } + + public UserPolicy.Builder invalidLoginAttemptCount(Integer invalidLoginAttemptCount) { + this.instance.invalidLoginAttemptCount = invalidLoginAttemptCount; + return this; + } + + public UserPolicy.Builder loginAttemptsBeforeLockout(Integer loginAttemptsBeforeLockout) { + this.instance.loginAttemptsBeforeLockout = loginAttemptsBeforeLockout; + return this; + } + + public UserPolicy.Builder maxActiveSessions(Integer maxActiveSessions) { + this.instance.maxActiveSessions = maxActiveSessions; + return this; + } + + public UserPolicy.Builder enablePublicSharing(Boolean enablePublicSharing) { + this.instance.enablePublicSharing = enablePublicSharing; + return this; + } + + public UserPolicy.Builder blockedMediaFolders(List blockedMediaFolders) { + this.instance.blockedMediaFolders = blockedMediaFolders; + return this; + } + + public UserPolicy.Builder blockedChannels(List blockedChannels) { + this.instance.blockedChannels = blockedChannels; + return this; + } + + public UserPolicy.Builder remoteClientBitrateLimit(Integer remoteClientBitrateLimit) { + this.instance.remoteClientBitrateLimit = remoteClientBitrateLimit; + return this; + } + + public UserPolicy.Builder authenticationProviderId(String authenticationProviderId) { + this.instance.authenticationProviderId = authenticationProviderId; + return this; + } + + public UserPolicy.Builder passwordResetProviderId(String passwordResetProviderId) { + this.instance.passwordResetProviderId = passwordResetProviderId; + return this; + } + + public UserPolicy.Builder syncPlayAccess(SyncPlayUserAccessType syncPlayAccess) { + this.instance.syncPlayAccess = syncPlayAccess; + return this; + } + + /** + * returns a built UserPolicy instance. + * + * The builder is not reusable. + */ + public UserPolicy build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UserPolicy.Builder builder() { + return new UserPolicy.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UserPolicy.Builder toBuilder() { + return new UserPolicy.Builder().isAdministrator(getIsAdministrator()).isHidden(getIsHidden()) + .enableCollectionManagement(getEnableCollectionManagement()) + .enableSubtitleManagement(getEnableSubtitleManagement()) + .enableLyricManagement(getEnableLyricManagement()).isDisabled(getIsDisabled()) + .maxParentalRating(getMaxParentalRating()).blockedTags(getBlockedTags()).allowedTags(getAllowedTags()) + .enableUserPreferenceAccess(getEnableUserPreferenceAccess()).accessSchedules(getAccessSchedules()) + .blockUnratedItems(getBlockUnratedItems()) + .enableRemoteControlOfOtherUsers(getEnableRemoteControlOfOtherUsers()) + .enableSharedDeviceControl(getEnableSharedDeviceControl()).enableRemoteAccess(getEnableRemoteAccess()) + .enableLiveTvManagement(getEnableLiveTvManagement()).enableLiveTvAccess(getEnableLiveTvAccess()) + .enableMediaPlayback(getEnableMediaPlayback()) + .enableAudioPlaybackTranscoding(getEnableAudioPlaybackTranscoding()) + .enableVideoPlaybackTranscoding(getEnableVideoPlaybackTranscoding()) + .enablePlaybackRemuxing(getEnablePlaybackRemuxing()) + .forceRemoteSourceTranscoding(getForceRemoteSourceTranscoding()) + .enableContentDeletion(getEnableContentDeletion()) + .enableContentDeletionFromFolders(getEnableContentDeletionFromFolders()) + .enableContentDownloading(getEnableContentDownloading()) + .enableSyncTranscoding(getEnableSyncTranscoding()).enableMediaConversion(getEnableMediaConversion()) + .enabledDevices(getEnabledDevices()).enableAllDevices(getEnableAllDevices()) + .enabledChannels(getEnabledChannels()).enableAllChannels(getEnableAllChannels()) + .enabledFolders(getEnabledFolders()).enableAllFolders(getEnableAllFolders()) + .invalidLoginAttemptCount(getInvalidLoginAttemptCount()) + .loginAttemptsBeforeLockout(getLoginAttemptsBeforeLockout()).maxActiveSessions(getMaxActiveSessions()) + .enablePublicSharing(getEnablePublicSharing()).blockedMediaFolders(getBlockedMediaFolders()) + .blockedChannels(getBlockedChannels()).remoteClientBitrateLimit(getRemoteClientBitrateLimit()) + .authenticationProviderId(getAuthenticationProviderId()) + .passwordResetProviderId(getPasswordResetProviderId()).syncPlayAccess(getSyncPlayAccess()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserUpdatedMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserUpdatedMessage.java new file mode 100644 index 0000000000000..1a5e85f5b26dd --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UserUpdatedMessage.java @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * User updated message. + */ +@JsonPropertyOrder({ UserUpdatedMessage.JSON_PROPERTY_DATA, UserUpdatedMessage.JSON_PROPERTY_MESSAGE_ID, + UserUpdatedMessage.JSON_PROPERTY_MESSAGE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserUpdatedMessage { + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private UserDto data; + + public static final String JSON_PROPERTY_MESSAGE_ID = "MessageId"; + @org.eclipse.jdt.annotation.NonNull + private UUID messageId; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + @org.eclipse.jdt.annotation.NonNull + private SessionMessageType messageType = SessionMessageType.USER_UPDATED; + + public UserUpdatedMessage() { + } + + @JsonCreator + public UserUpdatedMessage(@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) SessionMessageType messageType) { + this(); + this.messageType = messageType; + } + + public UserUpdatedMessage data(@org.eclipse.jdt.annotation.NonNull UserDto data) { + this.data = data; + return this; + } + + /** + * Gets or sets the data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserDto getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull UserDto data) { + this.data = data; + } + + public UserUpdatedMessage messageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + return this; + } + + /** + * Gets or sets the message id. + * + * @return messageId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getMessageId() { + return messageId; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(@org.eclipse.jdt.annotation.NonNull UUID messageId) { + this.messageId = messageId; + } + + /** + * The different kinds of messages that are used in the WebSocket api. + * + * @return messageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionMessageType getMessageType() { + return messageType; + } + + /** + * Return true if this UserUpdatedMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserUpdatedMessage userUpdatedMessage = (UserUpdatedMessage) o; + return Objects.equals(this.data, userUpdatedMessage.data) + && Objects.equals(this.messageId, userUpdatedMessage.messageId) + && Objects.equals(this.messageType, userUpdatedMessage.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(data, messageId, messageType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserUpdatedMessage {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "Data" + suffix)); + } + + // add `MessageId` to the URL query string + if (getMessageId() != null) { + joiner.add(String.format("%sMessageId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageId())))); + } + + // add `MessageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UserUpdatedMessage instance; + + public Builder() { + this(new UserUpdatedMessage()); + } + + protected Builder(UserUpdatedMessage instance) { + this.instance = instance; + } + + public UserUpdatedMessage.Builder data(UserDto data) { + this.instance.data = data; + return this; + } + + public UserUpdatedMessage.Builder messageId(UUID messageId) { + this.instance.messageId = messageId; + return this; + } + + public UserUpdatedMessage.Builder messageType(SessionMessageType messageType) { + this.instance.messageType = messageType; + return this; + } + + /** + * returns a built UserUpdatedMessage instance. + * + * The builder is not reusable. + */ + public UserUpdatedMessage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UserUpdatedMessage.Builder builder() { + return new UserUpdatedMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UserUpdatedMessage.Builder toBuilder() { + return new UserUpdatedMessage.Builder().data(getData()).messageId(getMessageId()).messageType(getMessageType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UtcTimeResponse.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UtcTimeResponse.java new file mode 100644 index 0000000000000..07e78905df64b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/UtcTimeResponse.java @@ -0,0 +1,238 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class UtcTimeResponse. + */ +@JsonPropertyOrder({ UtcTimeResponse.JSON_PROPERTY_REQUEST_RECEPTION_TIME, + UtcTimeResponse.JSON_PROPERTY_RESPONSE_TRANSMISSION_TIME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UtcTimeResponse { + public static final String JSON_PROPERTY_REQUEST_RECEPTION_TIME = "RequestReceptionTime"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime requestReceptionTime; + + public static final String JSON_PROPERTY_RESPONSE_TRANSMISSION_TIME = "ResponseTransmissionTime"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime responseTransmissionTime; + + public UtcTimeResponse() { + } + + public UtcTimeResponse requestReceptionTime( + @org.eclipse.jdt.annotation.NonNull OffsetDateTime requestReceptionTime) { + this.requestReceptionTime = requestReceptionTime; + return this; + } + + /** + * Gets the UTC time when request has been received. + * + * @return requestReceptionTime + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUEST_RECEPTION_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getRequestReceptionTime() { + return requestReceptionTime; + } + + @JsonProperty(JSON_PROPERTY_REQUEST_RECEPTION_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestReceptionTime(@org.eclipse.jdt.annotation.NonNull OffsetDateTime requestReceptionTime) { + this.requestReceptionTime = requestReceptionTime; + } + + public UtcTimeResponse responseTransmissionTime( + @org.eclipse.jdt.annotation.NonNull OffsetDateTime responseTransmissionTime) { + this.responseTransmissionTime = responseTransmissionTime; + return this; + } + + /** + * Gets the UTC time when response has been sent. + * + * @return responseTransmissionTime + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RESPONSE_TRANSMISSION_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getResponseTransmissionTime() { + return responseTransmissionTime; + } + + @JsonProperty(JSON_PROPERTY_RESPONSE_TRANSMISSION_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponseTransmissionTime( + @org.eclipse.jdt.annotation.NonNull OffsetDateTime responseTransmissionTime) { + this.responseTransmissionTime = responseTransmissionTime; + } + + /** + * Return true if this UtcTimeResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UtcTimeResponse utcTimeResponse = (UtcTimeResponse) o; + return Objects.equals(this.requestReceptionTime, utcTimeResponse.requestReceptionTime) + && Objects.equals(this.responseTransmissionTime, utcTimeResponse.responseTransmissionTime); + } + + @Override + public int hashCode() { + return Objects.hash(requestReceptionTime, responseTransmissionTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UtcTimeResponse {\n"); + sb.append(" requestReceptionTime: ").append(toIndentedString(requestReceptionTime)).append("\n"); + sb.append(" responseTransmissionTime: ").append(toIndentedString(responseTransmissionTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `RequestReceptionTime` to the URL query string + if (getRequestReceptionTime() != null) { + joiner.add(String.format("%sRequestReceptionTime%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRequestReceptionTime())))); + } + + // add `ResponseTransmissionTime` to the URL query string + if (getResponseTransmissionTime() != null) { + joiner.add(String.format("%sResponseTransmissionTime%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getResponseTransmissionTime())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UtcTimeResponse instance; + + public Builder() { + this(new UtcTimeResponse()); + } + + protected Builder(UtcTimeResponse instance) { + this.instance = instance; + } + + public UtcTimeResponse.Builder requestReceptionTime(OffsetDateTime requestReceptionTime) { + this.instance.requestReceptionTime = requestReceptionTime; + return this; + } + + public UtcTimeResponse.Builder responseTransmissionTime(OffsetDateTime responseTransmissionTime) { + this.instance.responseTransmissionTime = responseTransmissionTime; + return this; + } + + /** + * returns a built UtcTimeResponse instance. + * + * The builder is not reusable. + */ + public UtcTimeResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UtcTimeResponse.Builder builder() { + return new UtcTimeResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UtcTimeResponse.Builder toBuilder() { + return new UtcTimeResponse.Builder().requestReceptionTime(getRequestReceptionTime()) + .responseTransmissionTime(getResponseTransmissionTime()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ValidatePathDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ValidatePathDto.java new file mode 100644 index 0000000000000..0a14c87e3c247 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ValidatePathDto.java @@ -0,0 +1,274 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Validate path object. + */ +@JsonPropertyOrder({ ValidatePathDto.JSON_PROPERTY_VALIDATE_WRITABLE, ValidatePathDto.JSON_PROPERTY_PATH, + ValidatePathDto.JSON_PROPERTY_IS_FILE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ValidatePathDto { + public static final String JSON_PROPERTY_VALIDATE_WRITABLE = "ValidateWritable"; + @org.eclipse.jdt.annotation.NonNull + private Boolean validateWritable; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_IS_FILE = "IsFile"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isFile; + + public ValidatePathDto() { + } + + public ValidatePathDto validateWritable(@org.eclipse.jdt.annotation.NonNull Boolean validateWritable) { + this.validateWritable = validateWritable; + return this; + } + + /** + * Gets or sets a value indicating whether validate if path is writable. + * + * @return validateWritable + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VALIDATE_WRITABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getValidateWritable() { + return validateWritable; + } + + @JsonProperty(JSON_PROPERTY_VALIDATE_WRITABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidateWritable(@org.eclipse.jdt.annotation.NonNull Boolean validateWritable) { + this.validateWritable = validateWritable; + } + + public ValidatePathDto path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public ValidatePathDto isFile(@org.eclipse.jdt.annotation.NonNull Boolean isFile) { + this.isFile = isFile; + return this; + } + + /** + * Gets or sets is path file. + * + * @return isFile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsFile() { + return isFile; + } + + @JsonProperty(JSON_PROPERTY_IS_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsFile(@org.eclipse.jdt.annotation.NonNull Boolean isFile) { + this.isFile = isFile; + } + + /** + * Return true if this ValidatePathDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidatePathDto validatePathDto = (ValidatePathDto) o; + return Objects.equals(this.validateWritable, validatePathDto.validateWritable) + && Objects.equals(this.path, validatePathDto.path) + && Objects.equals(this.isFile, validatePathDto.isFile); + } + + @Override + public int hashCode() { + return Objects.hash(validateWritable, path, isFile); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValidatePathDto {\n"); + sb.append(" validateWritable: ").append(toIndentedString(validateWritable)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" isFile: ").append(toIndentedString(isFile)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ValidateWritable` to the URL query string + if (getValidateWritable() != null) { + joiner.add(String.format("%sValidateWritable%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getValidateWritable())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `IsFile` to the URL query string + if (getIsFile() != null) { + joiner.add(String.format("%sIsFile%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsFile())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ValidatePathDto instance; + + public Builder() { + this(new ValidatePathDto()); + } + + protected Builder(ValidatePathDto instance) { + this.instance = instance; + } + + public ValidatePathDto.Builder validateWritable(Boolean validateWritable) { + this.instance.validateWritable = validateWritable; + return this; + } + + public ValidatePathDto.Builder path(String path) { + this.instance.path = path; + return this; + } + + public ValidatePathDto.Builder isFile(Boolean isFile) { + this.instance.isFile = isFile; + return this; + } + + /** + * returns a built ValidatePathDto instance. + * + * The builder is not reusable. + */ + public ValidatePathDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ValidatePathDto.Builder builder() { + return new ValidatePathDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ValidatePathDto.Builder toBuilder() { + return new ValidatePathDto.Builder().validateWritable(getValidateWritable()).path(getPath()) + .isFile(getIsFile()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VersionInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VersionInfo.java new file mode 100644 index 0000000000000..dde360e799c53 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VersionInfo.java @@ -0,0 +1,514 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines the MediaBrowser.Model.Updates.VersionInfo class. + */ +@JsonPropertyOrder({ VersionInfo.JSON_PROPERTY_VERSION, VersionInfo.JSON_PROPERTY_VERSION_NUMBER, + VersionInfo.JSON_PROPERTY_CHANGELOG, VersionInfo.JSON_PROPERTY_TARGET_ABI, VersionInfo.JSON_PROPERTY_SOURCE_URL, + VersionInfo.JSON_PROPERTY_CHECKSUM, VersionInfo.JSON_PROPERTY_TIMESTAMP, + VersionInfo.JSON_PROPERTY_REPOSITORY_NAME, VersionInfo.JSON_PROPERTY_REPOSITORY_URL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class VersionInfo { + public static final String JSON_PROPERTY_VERSION = "version"; + @org.eclipse.jdt.annotation.NonNull + private String version; + + public static final String JSON_PROPERTY_VERSION_NUMBER = "VersionNumber"; + @org.eclipse.jdt.annotation.NonNull + private String versionNumber; + + public static final String JSON_PROPERTY_CHANGELOG = "changelog"; + @org.eclipse.jdt.annotation.NonNull + private String changelog; + + public static final String JSON_PROPERTY_TARGET_ABI = "targetAbi"; + @org.eclipse.jdt.annotation.NonNull + private String targetAbi; + + public static final String JSON_PROPERTY_SOURCE_URL = "sourceUrl"; + @org.eclipse.jdt.annotation.NonNull + private String sourceUrl; + + public static final String JSON_PROPERTY_CHECKSUM = "checksum"; + @org.eclipse.jdt.annotation.NonNull + private String checksum; + + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; + @org.eclipse.jdt.annotation.NonNull + private String timestamp; + + public static final String JSON_PROPERTY_REPOSITORY_NAME = "repositoryName"; + @org.eclipse.jdt.annotation.NonNull + private String repositoryName; + + public static final String JSON_PROPERTY_REPOSITORY_URL = "repositoryUrl"; + @org.eclipse.jdt.annotation.NonNull + private String repositoryUrl; + + public VersionInfo() { + } + + @JsonCreator + public VersionInfo(@JsonProperty(JSON_PROPERTY_VERSION_NUMBER) String versionNumber) { + this(); + this.versionNumber = versionNumber; + } + + public VersionInfo version(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + return this; + } + + /** + * Gets or sets the version. + * + * @return version + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + } + + /** + * Gets the version as a System.Version. + * + * @return versionNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersionNumber() { + return versionNumber; + } + + public VersionInfo changelog(@org.eclipse.jdt.annotation.NonNull String changelog) { + this.changelog = changelog; + return this; + } + + /** + * Gets or sets the changelog for this version. + * + * @return changelog + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANGELOG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChangelog() { + return changelog; + } + + @JsonProperty(JSON_PROPERTY_CHANGELOG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChangelog(@org.eclipse.jdt.annotation.NonNull String changelog) { + this.changelog = changelog; + } + + public VersionInfo targetAbi(@org.eclipse.jdt.annotation.NonNull String targetAbi) { + this.targetAbi = targetAbi; + return this; + } + + /** + * Gets or sets the ABI that this version was built against. + * + * @return targetAbi + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TARGET_ABI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTargetAbi() { + return targetAbi; + } + + @JsonProperty(JSON_PROPERTY_TARGET_ABI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTargetAbi(@org.eclipse.jdt.annotation.NonNull String targetAbi) { + this.targetAbi = targetAbi; + } + + public VersionInfo sourceUrl(@org.eclipse.jdt.annotation.NonNull String sourceUrl) { + this.sourceUrl = sourceUrl; + return this; + } + + /** + * Gets or sets the source URL. + * + * @return sourceUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SOURCE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceUrl() { + return sourceUrl; + } + + @JsonProperty(JSON_PROPERTY_SOURCE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceUrl(@org.eclipse.jdt.annotation.NonNull String sourceUrl) { + this.sourceUrl = sourceUrl; + } + + public VersionInfo checksum(@org.eclipse.jdt.annotation.NonNull String checksum) { + this.checksum = checksum; + return this; + } + + /** + * Gets or sets a checksum for the binary. + * + * @return checksum + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHECKSUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChecksum() { + return checksum; + } + + @JsonProperty(JSON_PROPERTY_CHECKSUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChecksum(@org.eclipse.jdt.annotation.NonNull String checksum) { + this.checksum = checksum; + } + + public VersionInfo timestamp(@org.eclipse.jdt.annotation.NonNull String timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Gets or sets a timestamp of when the binary was built. + * + * @return timestamp + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTimestamp() { + return timestamp; + } + + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimestamp(@org.eclipse.jdt.annotation.NonNull String timestamp) { + this.timestamp = timestamp; + } + + public VersionInfo repositoryName(@org.eclipse.jdt.annotation.NonNull String repositoryName) { + this.repositoryName = repositoryName; + return this; + } + + /** + * Gets or sets the repository name. + * + * @return repositoryName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REPOSITORY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRepositoryName() { + return repositoryName; + } + + @JsonProperty(JSON_PROPERTY_REPOSITORY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepositoryName(@org.eclipse.jdt.annotation.NonNull String repositoryName) { + this.repositoryName = repositoryName; + } + + public VersionInfo repositoryUrl(@org.eclipse.jdt.annotation.NonNull String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Gets or sets the repository url. + * + * @return repositoryUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REPOSITORY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRepositoryUrl() { + return repositoryUrl; + } + + @JsonProperty(JSON_PROPERTY_REPOSITORY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepositoryUrl(@org.eclipse.jdt.annotation.NonNull String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + } + + /** + * Return true if this VersionInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VersionInfo versionInfo = (VersionInfo) o; + return Objects.equals(this.version, versionInfo.version) + && Objects.equals(this.versionNumber, versionInfo.versionNumber) + && Objects.equals(this.changelog, versionInfo.changelog) + && Objects.equals(this.targetAbi, versionInfo.targetAbi) + && Objects.equals(this.sourceUrl, versionInfo.sourceUrl) + && Objects.equals(this.checksum, versionInfo.checksum) + && Objects.equals(this.timestamp, versionInfo.timestamp) + && Objects.equals(this.repositoryName, versionInfo.repositoryName) + && Objects.equals(this.repositoryUrl, versionInfo.repositoryUrl); + } + + @Override + public int hashCode() { + return Objects.hash(version, versionNumber, changelog, targetAbi, sourceUrl, checksum, timestamp, + repositoryName, repositoryUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VersionInfo {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" versionNumber: ").append(toIndentedString(versionNumber)).append("\n"); + sb.append(" changelog: ").append(toIndentedString(changelog)).append("\n"); + sb.append(" targetAbi: ").append(toIndentedString(targetAbi)).append("\n"); + sb.append(" sourceUrl: ").append(toIndentedString(sourceUrl)).append("\n"); + sb.append(" checksum: ").append(toIndentedString(checksum)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" repositoryName: ").append(toIndentedString(repositoryName)).append("\n"); + sb.append(" repositoryUrl: ").append(toIndentedString(repositoryUrl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format("%sversion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `VersionNumber` to the URL query string + if (getVersionNumber() != null) { + joiner.add(String.format("%sVersionNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersionNumber())))); + } + + // add `changelog` to the URL query string + if (getChangelog() != null) { + joiner.add(String.format("%schangelog%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChangelog())))); + } + + // add `targetAbi` to the URL query string + if (getTargetAbi() != null) { + joiner.add(String.format("%stargetAbi%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTargetAbi())))); + } + + // add `sourceUrl` to the URL query string + if (getSourceUrl() != null) { + joiner.add(String.format("%ssourceUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSourceUrl())))); + } + + // add `checksum` to the URL query string + if (getChecksum() != null) { + joiner.add(String.format("%schecksum%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChecksum())))); + } + + // add `timestamp` to the URL query string + if (getTimestamp() != null) { + joiner.add(String.format("%stimestamp%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTimestamp())))); + } + + // add `repositoryName` to the URL query string + if (getRepositoryName() != null) { + joiner.add(String.format("%srepositoryName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRepositoryName())))); + } + + // add `repositoryUrl` to the URL query string + if (getRepositoryUrl() != null) { + joiner.add(String.format("%srepositoryUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRepositoryUrl())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private VersionInfo instance; + + public Builder() { + this(new VersionInfo()); + } + + protected Builder(VersionInfo instance) { + this.instance = instance; + } + + public VersionInfo.Builder version(String version) { + this.instance.version = version; + return this; + } + + public VersionInfo.Builder versionNumber(String versionNumber) { + this.instance.versionNumber = versionNumber; + return this; + } + + public VersionInfo.Builder changelog(String changelog) { + this.instance.changelog = changelog; + return this; + } + + public VersionInfo.Builder targetAbi(String targetAbi) { + this.instance.targetAbi = targetAbi; + return this; + } + + public VersionInfo.Builder sourceUrl(String sourceUrl) { + this.instance.sourceUrl = sourceUrl; + return this; + } + + public VersionInfo.Builder checksum(String checksum) { + this.instance.checksum = checksum; + return this; + } + + public VersionInfo.Builder timestamp(String timestamp) { + this.instance.timestamp = timestamp; + return this; + } + + public VersionInfo.Builder repositoryName(String repositoryName) { + this.instance.repositoryName = repositoryName; + return this; + } + + public VersionInfo.Builder repositoryUrl(String repositoryUrl) { + this.instance.repositoryUrl = repositoryUrl; + return this; + } + + /** + * returns a built VersionInfo instance. + * + * The builder is not reusable. + */ + public VersionInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static VersionInfo.Builder builder() { + return new VersionInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public VersionInfo.Builder toBuilder() { + return new VersionInfo.Builder().version(getVersion()).versionNumber(getVersionNumber()) + .changelog(getChangelog()).targetAbi(getTargetAbi()).sourceUrl(getSourceUrl()).checksum(getChecksum()) + .timestamp(getTimestamp()).repositoryName(getRepositoryName()).repositoryUrl(getRepositoryUrl()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/Video3DFormat.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/Video3DFormat.java new file mode 100644 index 0000000000000..36986037f1c85 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/Video3DFormat.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets Video3DFormat + */ +public enum Video3DFormat { + + HALF_SIDE_BY_SIDE("HalfSideBySide"), + + FULL_SIDE_BY_SIDE("FullSideBySide"), + + FULL_TOP_AND_BOTTOM("FullTopAndBottom"), + + HALF_TOP_AND_BOTTOM("HalfTopAndBottom"), + + MVC("MVC"); + + private String value; + + Video3DFormat(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Video3DFormat fromValue(String value) { + for (Video3DFormat b : Video3DFormat.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VideoRange.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VideoRange.java new file mode 100644 index 0000000000000..f4b6c0b23bebe --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VideoRange.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * An enum representing video ranges. + */ +public enum VideoRange { + + UNKNOWN("Unknown"), + + SDR("SDR"), + + HDR("HDR"); + + private String value; + + VideoRange(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static VideoRange fromValue(String value) { + for (VideoRange b : VideoRange.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VideoRangeType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VideoRangeType.java new file mode 100644 index 0000000000000..2a5e2cbcdf6b5 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VideoRangeType.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * An enum representing types of video ranges. + */ +public enum VideoRangeType { + + UNKNOWN("Unknown"), + + SDR("SDR"), + + HDR10("HDR10"), + + HLG("HLG"), + + DOVI("DOVI"), + + DOVI_WITH_HDR10("DOVIWithHDR10"), + + DOVI_WITH_HLG("DOVIWithHLG"), + + DOVI_WITH_SDR("DOVIWithSDR"), + + HDR10_PLUS("HDR10Plus"); + + private String value; + + VideoRangeType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static VideoRangeType fromValue(String value) { + for (VideoRangeType b : VideoRangeType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VideoType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VideoType.java new file mode 100644 index 0000000000000..08e03b4d73df7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VideoType.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum VideoType. + */ +public enum VideoType { + + VIDEO_FILE("VideoFile"), + + ISO("Iso"), + + DVD("Dvd"), + + BLU_RAY("BluRay"); + + private String value; + + VideoType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static VideoType fromValue(String value) { + for (VideoType b : VideoType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VirtualFolderInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VirtualFolderInfo.java new file mode 100644 index 0000000000000..1dec314bef0c2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/VirtualFolderInfo.java @@ -0,0 +1,491 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Used to hold information about a user's list of configured virtual folders. + */ +@JsonPropertyOrder({ VirtualFolderInfo.JSON_PROPERTY_NAME, VirtualFolderInfo.JSON_PROPERTY_LOCATIONS, + VirtualFolderInfo.JSON_PROPERTY_COLLECTION_TYPE, VirtualFolderInfo.JSON_PROPERTY_LIBRARY_OPTIONS, + VirtualFolderInfo.JSON_PROPERTY_ITEM_ID, VirtualFolderInfo.JSON_PROPERTY_PRIMARY_IMAGE_ITEM_ID, + VirtualFolderInfo.JSON_PROPERTY_REFRESH_PROGRESS, VirtualFolderInfo.JSON_PROPERTY_REFRESH_STATUS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class VirtualFolderInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_LOCATIONS = "Locations"; + @org.eclipse.jdt.annotation.NonNull + private List locations; + + public static final String JSON_PROPERTY_COLLECTION_TYPE = "CollectionType"; + @org.eclipse.jdt.annotation.NonNull + private CollectionTypeOptions collectionType; + + public static final String JSON_PROPERTY_LIBRARY_OPTIONS = "LibraryOptions"; + @org.eclipse.jdt.annotation.NonNull + private LibraryOptions libraryOptions; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private String itemId; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_ITEM_ID = "PrimaryImageItemId"; + @org.eclipse.jdt.annotation.NonNull + private String primaryImageItemId; + + public static final String JSON_PROPERTY_REFRESH_PROGRESS = "RefreshProgress"; + @org.eclipse.jdt.annotation.NonNull + private Double refreshProgress; + + public static final String JSON_PROPERTY_REFRESH_STATUS = "RefreshStatus"; + @org.eclipse.jdt.annotation.NonNull + private String refreshStatus; + + public VirtualFolderInfo() { + } + + public VirtualFolderInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public VirtualFolderInfo locations(@org.eclipse.jdt.annotation.NonNull List locations) { + this.locations = locations; + return this; + } + + public VirtualFolderInfo addLocationsItem(String locationsItem) { + if (this.locations == null) { + this.locations = new ArrayList<>(); + } + this.locations.add(locationsItem); + return this; + } + + /** + * Gets or sets the locations. + * + * @return locations + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLocations() { + return locations; + } + + @JsonProperty(JSON_PROPERTY_LOCATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocations(@org.eclipse.jdt.annotation.NonNull List locations) { + this.locations = locations; + } + + public VirtualFolderInfo collectionType(@org.eclipse.jdt.annotation.NonNull CollectionTypeOptions collectionType) { + this.collectionType = collectionType; + return this; + } + + /** + * Gets or sets the type of the collection. + * + * @return collectionType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COLLECTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CollectionTypeOptions getCollectionType() { + return collectionType; + } + + @JsonProperty(JSON_PROPERTY_COLLECTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCollectionType(@org.eclipse.jdt.annotation.NonNull CollectionTypeOptions collectionType) { + this.collectionType = collectionType; + } + + public VirtualFolderInfo libraryOptions(@org.eclipse.jdt.annotation.NonNull LibraryOptions libraryOptions) { + this.libraryOptions = libraryOptions; + return this; + } + + /** + * Get libraryOptions + * + * @return libraryOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIBRARY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LibraryOptions getLibraryOptions() { + return libraryOptions; + } + + @JsonProperty(JSON_PROPERTY_LIBRARY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLibraryOptions(@org.eclipse.jdt.annotation.NonNull LibraryOptions libraryOptions) { + this.libraryOptions = libraryOptions; + } + + public VirtualFolderInfo itemId(@org.eclipse.jdt.annotation.NonNull String itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item identifier. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull String itemId) { + this.itemId = itemId; + } + + public VirtualFolderInfo primaryImageItemId(@org.eclipse.jdt.annotation.NonNull String primaryImageItemId) { + this.primaryImageItemId = primaryImageItemId; + return this; + } + + /** + * Gets or sets the primary image item identifier. + * + * @return primaryImageItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryImageItemId() { + return primaryImageItemId; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageItemId(@org.eclipse.jdt.annotation.NonNull String primaryImageItemId) { + this.primaryImageItemId = primaryImageItemId; + } + + public VirtualFolderInfo refreshProgress(@org.eclipse.jdt.annotation.NonNull Double refreshProgress) { + this.refreshProgress = refreshProgress; + return this; + } + + /** + * Get refreshProgress + * + * @return refreshProgress + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REFRESH_PROGRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getRefreshProgress() { + return refreshProgress; + } + + @JsonProperty(JSON_PROPERTY_REFRESH_PROGRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRefreshProgress(@org.eclipse.jdt.annotation.NonNull Double refreshProgress) { + this.refreshProgress = refreshProgress; + } + + public VirtualFolderInfo refreshStatus(@org.eclipse.jdt.annotation.NonNull String refreshStatus) { + this.refreshStatus = refreshStatus; + return this; + } + + /** + * Get refreshStatus + * + * @return refreshStatus + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REFRESH_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRefreshStatus() { + return refreshStatus; + } + + @JsonProperty(JSON_PROPERTY_REFRESH_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRefreshStatus(@org.eclipse.jdt.annotation.NonNull String refreshStatus) { + this.refreshStatus = refreshStatus; + } + + /** + * Return true if this VirtualFolderInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VirtualFolderInfo virtualFolderInfo = (VirtualFolderInfo) o; + return Objects.equals(this.name, virtualFolderInfo.name) + && Objects.equals(this.locations, virtualFolderInfo.locations) + && Objects.equals(this.collectionType, virtualFolderInfo.collectionType) + && Objects.equals(this.libraryOptions, virtualFolderInfo.libraryOptions) + && Objects.equals(this.itemId, virtualFolderInfo.itemId) + && Objects.equals(this.primaryImageItemId, virtualFolderInfo.primaryImageItemId) + && Objects.equals(this.refreshProgress, virtualFolderInfo.refreshProgress) + && Objects.equals(this.refreshStatus, virtualFolderInfo.refreshStatus); + } + + @Override + public int hashCode() { + return Objects.hash(name, locations, collectionType, libraryOptions, itemId, primaryImageItemId, + refreshProgress, refreshStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VirtualFolderInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" locations: ").append(toIndentedString(locations)).append("\n"); + sb.append(" collectionType: ").append(toIndentedString(collectionType)).append("\n"); + sb.append(" libraryOptions: ").append(toIndentedString(libraryOptions)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" primaryImageItemId: ").append(toIndentedString(primaryImageItemId)).append("\n"); + sb.append(" refreshProgress: ").append(toIndentedString(refreshProgress)).append("\n"); + sb.append(" refreshStatus: ").append(toIndentedString(refreshStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Locations` to the URL query string + if (getLocations() != null) { + for (int i = 0; i < getLocations().size(); i++) { + joiner.add(String.format("%sLocations%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLocations().get(i))))); + } + } + + // add `CollectionType` to the URL query string + if (getCollectionType() != null) { + joiner.add(String.format("%sCollectionType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCollectionType())))); + } + + // add `LibraryOptions` to the URL query string + if (getLibraryOptions() != null) { + joiner.add(getLibraryOptions().toUrlQueryString(prefix + "LibraryOptions" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `PrimaryImageItemId` to the URL query string + if (getPrimaryImageItemId() != null) { + joiner.add(String.format("%sPrimaryImageItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageItemId())))); + } + + // add `RefreshProgress` to the URL query string + if (getRefreshProgress() != null) { + joiner.add(String.format("%sRefreshProgress%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRefreshProgress())))); + } + + // add `RefreshStatus` to the URL query string + if (getRefreshStatus() != null) { + joiner.add(String.format("%sRefreshStatus%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRefreshStatus())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private VirtualFolderInfo instance; + + public Builder() { + this(new VirtualFolderInfo()); + } + + protected Builder(VirtualFolderInfo instance) { + this.instance = instance; + } + + public VirtualFolderInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public VirtualFolderInfo.Builder locations(List locations) { + this.instance.locations = locations; + return this; + } + + public VirtualFolderInfo.Builder collectionType(CollectionTypeOptions collectionType) { + this.instance.collectionType = collectionType; + return this; + } + + public VirtualFolderInfo.Builder libraryOptions(LibraryOptions libraryOptions) { + this.instance.libraryOptions = libraryOptions; + return this; + } + + public VirtualFolderInfo.Builder itemId(String itemId) { + this.instance.itemId = itemId; + return this; + } + + public VirtualFolderInfo.Builder primaryImageItemId(String primaryImageItemId) { + this.instance.primaryImageItemId = primaryImageItemId; + return this; + } + + public VirtualFolderInfo.Builder refreshProgress(Double refreshProgress) { + this.instance.refreshProgress = refreshProgress; + return this; + } + + public VirtualFolderInfo.Builder refreshStatus(String refreshStatus) { + this.instance.refreshStatus = refreshStatus; + return this; + } + + /** + * returns a built VirtualFolderInfo instance. + * + * The builder is not reusable. + */ + public VirtualFolderInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static VirtualFolderInfo.Builder builder() { + return new VirtualFolderInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public VirtualFolderInfo.Builder toBuilder() { + return new VirtualFolderInfo.Builder().name(getName()).locations(getLocations()) + .collectionType(getCollectionType()).libraryOptions(getLibraryOptions()).itemId(getItemId()) + .primaryImageItemId(getPrimaryImageItemId()).refreshProgress(getRefreshProgress()) + .refreshStatus(getRefreshStatus()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/WakeOnLanInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/WakeOnLanInfo.java new file mode 100644 index 0000000000000..d06c5ec183c80 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/WakeOnLanInfo.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Provides the MAC address and port for wake-on-LAN functionality. + */ +@JsonPropertyOrder({ WakeOnLanInfo.JSON_PROPERTY_MAC_ADDRESS, WakeOnLanInfo.JSON_PROPERTY_PORT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class WakeOnLanInfo { + public static final String JSON_PROPERTY_MAC_ADDRESS = "MacAddress"; + @org.eclipse.jdt.annotation.NonNull + private String macAddress; + + public static final String JSON_PROPERTY_PORT = "Port"; + @org.eclipse.jdt.annotation.NonNull + private Integer port; + + public WakeOnLanInfo() { + } + + public WakeOnLanInfo macAddress(@org.eclipse.jdt.annotation.NonNull String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * Gets the MAC address of the device. + * + * @return macAddress + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAC_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMacAddress() { + return macAddress; + } + + @JsonProperty(JSON_PROPERTY_MAC_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMacAddress(@org.eclipse.jdt.annotation.NonNull String macAddress) { + this.macAddress = macAddress; + } + + public WakeOnLanInfo port(@org.eclipse.jdt.annotation.NonNull Integer port) { + this.port = port; + return this; + } + + /** + * Gets or sets the wake-on-LAN port. + * + * @return port + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPort() { + return port; + } + + @JsonProperty(JSON_PROPERTY_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPort(@org.eclipse.jdt.annotation.NonNull Integer port) { + this.port = port; + } + + /** + * Return true if this WakeOnLanInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WakeOnLanInfo wakeOnLanInfo = (WakeOnLanInfo) o; + return Objects.equals(this.macAddress, wakeOnLanInfo.macAddress) + && Objects.equals(this.port, wakeOnLanInfo.port); + } + + @Override + public int hashCode() { + return Objects.hash(macAddress, port); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WakeOnLanInfo {\n"); + sb.append(" macAddress: ").append(toIndentedString(macAddress)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MacAddress` to the URL query string + if (getMacAddress() != null) { + joiner.add(String.format("%sMacAddress%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMacAddress())))); + } + + // add `Port` to the URL query string + if (getPort() != null) { + joiner.add(String.format("%sPort%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPort())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private WakeOnLanInfo instance; + + public Builder() { + this(new WakeOnLanInfo()); + } + + protected Builder(WakeOnLanInfo instance) { + this.instance = instance; + } + + public WakeOnLanInfo.Builder macAddress(String macAddress) { + this.instance.macAddress = macAddress; + return this; + } + + public WakeOnLanInfo.Builder port(Integer port) { + this.instance.port = port; + return this; + } + + /** + * returns a built WakeOnLanInfo instance. + * + * The builder is not reusable. + */ + public WakeOnLanInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static WakeOnLanInfo.Builder builder() { + return new WakeOnLanInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public WakeOnLanInfo.Builder toBuilder() { + return new WakeOnLanInfo.Builder().macAddress(getMacAddress()).port(getPort()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/WebSocketMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/WebSocketMessage.java new file mode 100644 index 0000000000000..13d6668a03074 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/WebSocketMessage.java @@ -0,0 +1,338 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.StringJoiner; +import java.util.logging.Level; +import java.util.logging.Logger; + +import org.openhab.binding.jellyfin.internal.api.generated.JSON; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +@JsonDeserialize(using = WebSocketMessage.WebSocketMessageDeserializer.class) +@JsonSerialize(using = WebSocketMessage.WebSocketMessageSerializer.class) +public class WebSocketMessage extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(WebSocketMessage.class.getName()); + + public static class WebSocketMessageSerializer extends StdSerializer { + public WebSocketMessageSerializer(Class t) { + super(t); + } + + public WebSocketMessageSerializer() { + this(null); + } + + @Override + public void serialize(WebSocketMessage value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class WebSocketMessageDeserializer extends StdDeserializer { + public WebSocketMessageDeserializer() { + this(WebSocketMessage.class); + } + + public WebSocketMessageDeserializer(Class vc) { + super(vc); + } + + @Override + public WebSocketMessage deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize InboundWebSocketMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (InboundWebSocketMessage.class.equals(Integer.class) + || InboundWebSocketMessage.class.equals(Long.class) + || InboundWebSocketMessage.class.equals(Float.class) + || InboundWebSocketMessage.class.equals(Double.class) + || InboundWebSocketMessage.class.equals(Boolean.class) + || InboundWebSocketMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((InboundWebSocketMessage.class.equals(Integer.class) + || InboundWebSocketMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((InboundWebSocketMessage.class.equals(Float.class) + || InboundWebSocketMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (InboundWebSocketMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (InboundWebSocketMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(InboundWebSocketMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'InboundWebSocketMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'InboundWebSocketMessage'", e); + } + + // deserialize OutboundWebSocketMessage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (OutboundWebSocketMessage.class.equals(Integer.class) + || OutboundWebSocketMessage.class.equals(Long.class) + || OutboundWebSocketMessage.class.equals(Float.class) + || OutboundWebSocketMessage.class.equals(Double.class) + || OutboundWebSocketMessage.class.equals(Boolean.class) + || OutboundWebSocketMessage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((OutboundWebSocketMessage.class.equals(Integer.class) + || OutboundWebSocketMessage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((OutboundWebSocketMessage.class.equals(Float.class) + || OutboundWebSocketMessage.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (OutboundWebSocketMessage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (OutboundWebSocketMessage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(OutboundWebSocketMessage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'OutboundWebSocketMessage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'OutboundWebSocketMessage'", e); + } + + if (match == 1) { + WebSocketMessage ret = new WebSocketMessage(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String + .format("Failed deserialization for WebSocketMessage: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public WebSocketMessage getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "WebSocketMessage cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public WebSocketMessage() { + super("oneOf", Boolean.FALSE); + } + + public WebSocketMessage(InboundWebSocketMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public WebSocketMessage(OutboundWebSocketMessage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("InboundWebSocketMessage", InboundWebSocketMessage.class); + schemas.put("OutboundWebSocketMessage", OutboundWebSocketMessage.class); + JSON.registerDescendants(WebSocketMessage.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("ActivityLogEntry", ActivityLogEntryMessage.class); + mappings.put("ForceKeepAlive", ForceKeepAliveMessage.class); + mappings.put("GeneralCommand", GeneralCommandMessage.class); + mappings.put("KeepAlive", OutboundKeepAliveMessage.class); + mappings.put("LibraryChanged", LibraryChangedMessage.class); + mappings.put("PackageInstallationCancelled", PluginInstallationCancelledMessage.class); + mappings.put("PackageInstallationCompleted", PluginInstallationCompletedMessage.class); + mappings.put("PackageInstallationFailed", PluginInstallationFailedMessage.class); + mappings.put("PackageInstalling", PluginInstallingMessage.class); + mappings.put("PackageUninstalled", PluginUninstalledMessage.class); + mappings.put("Play", PlayMessage.class); + mappings.put("Playstate", PlaystateMessage.class); + mappings.put("RefreshProgress", RefreshProgressMessage.class); + mappings.put("RestartRequired", RestartRequiredMessage.class); + mappings.put("ScheduledTaskEnded", ScheduledTaskEndedMessage.class); + mappings.put("ScheduledTasksInfo", ScheduledTasksInfoMessage.class); + mappings.put("SeriesTimerCancelled", SeriesTimerCancelledMessage.class); + mappings.put("SeriesTimerCreated", SeriesTimerCreatedMessage.class); + mappings.put("ServerRestarting", ServerRestartingMessage.class); + mappings.put("ServerShuttingDown", ServerShuttingDownMessage.class); + mappings.put("Sessions", SessionsMessage.class); + mappings.put("SyncPlayCommand", SyncPlayCommandMessage.class); + mappings.put("SyncPlayGroupUpdate", SyncPlayGroupUpdateCommandMessage.class); + mappings.put("TimerCancelled", TimerCancelledMessage.class); + mappings.put("TimerCreated", TimerCreatedMessage.class); + mappings.put("UserDataChanged", UserDataChangedMessage.class); + mappings.put("UserDeleted", UserDeletedMessage.class); + mappings.put("UserUpdated", UserUpdatedMessage.class); + mappings.put("InboundWebSocketMessage", InboundWebSocketMessage.class); + mappings.put("OutboundWebSocketMessage", OutboundWebSocketMessage.class); + mappings.put("WebSocketMessage", WebSocketMessage.class); + JSON.registerDiscriminator(WebSocketMessage.class, "MessageType", mappings); + } + + @Override + public Map> getSchemas() { + return WebSocketMessage.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * InboundWebSocketMessage, OutboundWebSocketMessage + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(InboundWebSocketMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(OutboundWebSocketMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be InboundWebSocketMessage, OutboundWebSocketMessage"); + } + + /** + * Get the actual instance, which can be the following: + * InboundWebSocketMessage, OutboundWebSocketMessage + * + * @return The actual instance (InboundWebSocketMessage, OutboundWebSocketMessage) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `InboundWebSocketMessage`. If the actual instance is not `InboundWebSocketMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `InboundWebSocketMessage` + * @throws ClassCastException if the instance is not `InboundWebSocketMessage` + */ + public InboundWebSocketMessage getInboundWebSocketMessage() throws ClassCastException { + return (InboundWebSocketMessage) super.getActualInstance(); + } + + /** + * Get the actual instance of `OutboundWebSocketMessage`. If the actual instance is not `OutboundWebSocketMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `OutboundWebSocketMessage` + * @throws ClassCastException if the instance is not `OutboundWebSocketMessage` + */ + public OutboundWebSocketMessage getOutboundWebSocketMessage() throws ClassCastException { + return (OutboundWebSocketMessage) super.getActualInstance(); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof InboundWebSocketMessage) { + if (getActualInstance() != null) { + joiner.add( + ((InboundWebSocketMessage) getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof OutboundWebSocketMessage) { + if (getActualInstance() != null) { + joiner.add(((OutboundWebSocketMessage) getActualInstance()) + .toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + return null; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/XbmcMetadataOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/XbmcMetadataOptions.java new file mode 100644 index 0000000000000..ffd32eef1b5ab --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/XbmcMetadataOptions.java @@ -0,0 +1,362 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.current.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * XbmcMetadataOptions + */ +@JsonPropertyOrder({ XbmcMetadataOptions.JSON_PROPERTY_USER_ID, XbmcMetadataOptions.JSON_PROPERTY_RELEASE_DATE_FORMAT, + XbmcMetadataOptions.JSON_PROPERTY_SAVE_IMAGE_PATHS_IN_NFO, + XbmcMetadataOptions.JSON_PROPERTY_ENABLE_PATH_SUBSTITUTION, + XbmcMetadataOptions.JSON_PROPERTY_ENABLE_EXTRA_THUMBS_DUPLICATION }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class XbmcMetadataOptions { + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private String userId; + + public static final String JSON_PROPERTY_RELEASE_DATE_FORMAT = "ReleaseDateFormat"; + @org.eclipse.jdt.annotation.NonNull + private String releaseDateFormat; + + public static final String JSON_PROPERTY_SAVE_IMAGE_PATHS_IN_NFO = "SaveImagePathsInNfo"; + @org.eclipse.jdt.annotation.NonNull + private Boolean saveImagePathsInNfo; + + public static final String JSON_PROPERTY_ENABLE_PATH_SUBSTITUTION = "EnablePathSubstitution"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enablePathSubstitution; + + public static final String JSON_PROPERTY_ENABLE_EXTRA_THUMBS_DUPLICATION = "EnableExtraThumbsDuplication"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableExtraThumbsDuplication; + + public XbmcMetadataOptions() { + } + + public XbmcMetadataOptions userId(@org.eclipse.jdt.annotation.NonNull String userId) { + this.userId = userId; + return this; + } + + /** + * Get userId + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull String userId) { + this.userId = userId; + } + + public XbmcMetadataOptions releaseDateFormat(@org.eclipse.jdt.annotation.NonNull String releaseDateFormat) { + this.releaseDateFormat = releaseDateFormat; + return this; + } + + /** + * Get releaseDateFormat + * + * @return releaseDateFormat + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RELEASE_DATE_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReleaseDateFormat() { + return releaseDateFormat; + } + + @JsonProperty(JSON_PROPERTY_RELEASE_DATE_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReleaseDateFormat(@org.eclipse.jdt.annotation.NonNull String releaseDateFormat) { + this.releaseDateFormat = releaseDateFormat; + } + + public XbmcMetadataOptions saveImagePathsInNfo(@org.eclipse.jdt.annotation.NonNull Boolean saveImagePathsInNfo) { + this.saveImagePathsInNfo = saveImagePathsInNfo; + return this; + } + + /** + * Get saveImagePathsInNfo + * + * @return saveImagePathsInNfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SAVE_IMAGE_PATHS_IN_NFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSaveImagePathsInNfo() { + return saveImagePathsInNfo; + } + + @JsonProperty(JSON_PROPERTY_SAVE_IMAGE_PATHS_IN_NFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaveImagePathsInNfo(@org.eclipse.jdt.annotation.NonNull Boolean saveImagePathsInNfo) { + this.saveImagePathsInNfo = saveImagePathsInNfo; + } + + public XbmcMetadataOptions enablePathSubstitution( + @org.eclipse.jdt.annotation.NonNull Boolean enablePathSubstitution) { + this.enablePathSubstitution = enablePathSubstitution; + return this; + } + + /** + * Get enablePathSubstitution + * + * @return enablePathSubstitution + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_PATH_SUBSTITUTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnablePathSubstitution() { + return enablePathSubstitution; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_PATH_SUBSTITUTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnablePathSubstitution(@org.eclipse.jdt.annotation.NonNull Boolean enablePathSubstitution) { + this.enablePathSubstitution = enablePathSubstitution; + } + + public XbmcMetadataOptions enableExtraThumbsDuplication( + @org.eclipse.jdt.annotation.NonNull Boolean enableExtraThumbsDuplication) { + this.enableExtraThumbsDuplication = enableExtraThumbsDuplication; + return this; + } + + /** + * Get enableExtraThumbsDuplication + * + * @return enableExtraThumbsDuplication + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_EXTRA_THUMBS_DUPLICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableExtraThumbsDuplication() { + return enableExtraThumbsDuplication; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_EXTRA_THUMBS_DUPLICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableExtraThumbsDuplication( + @org.eclipse.jdt.annotation.NonNull Boolean enableExtraThumbsDuplication) { + this.enableExtraThumbsDuplication = enableExtraThumbsDuplication; + } + + /** + * Return true if this XbmcMetadataOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XbmcMetadataOptions xbmcMetadataOptions = (XbmcMetadataOptions) o; + return Objects.equals(this.userId, xbmcMetadataOptions.userId) + && Objects.equals(this.releaseDateFormat, xbmcMetadataOptions.releaseDateFormat) + && Objects.equals(this.saveImagePathsInNfo, xbmcMetadataOptions.saveImagePathsInNfo) + && Objects.equals(this.enablePathSubstitution, xbmcMetadataOptions.enablePathSubstitution) + && Objects.equals(this.enableExtraThumbsDuplication, xbmcMetadataOptions.enableExtraThumbsDuplication); + } + + @Override + public int hashCode() { + return Objects.hash(userId, releaseDateFormat, saveImagePathsInNfo, enablePathSubstitution, + enableExtraThumbsDuplication); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XbmcMetadataOptions {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" releaseDateFormat: ").append(toIndentedString(releaseDateFormat)).append("\n"); + sb.append(" saveImagePathsInNfo: ").append(toIndentedString(saveImagePathsInNfo)).append("\n"); + sb.append(" enablePathSubstitution: ").append(toIndentedString(enablePathSubstitution)).append("\n"); + sb.append(" enableExtraThumbsDuplication: ").append(toIndentedString(enableExtraThumbsDuplication)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `ReleaseDateFormat` to the URL query string + if (getReleaseDateFormat() != null) { + joiner.add(String.format("%sReleaseDateFormat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getReleaseDateFormat())))); + } + + // add `SaveImagePathsInNfo` to the URL query string + if (getSaveImagePathsInNfo() != null) { + joiner.add(String.format("%sSaveImagePathsInNfo%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSaveImagePathsInNfo())))); + } + + // add `EnablePathSubstitution` to the URL query string + if (getEnablePathSubstitution() != null) { + joiner.add(String.format("%sEnablePathSubstitution%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnablePathSubstitution())))); + } + + // add `EnableExtraThumbsDuplication` to the URL query string + if (getEnableExtraThumbsDuplication() != null) { + joiner.add(String.format("%sEnableExtraThumbsDuplication%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableExtraThumbsDuplication())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private XbmcMetadataOptions instance; + + public Builder() { + this(new XbmcMetadataOptions()); + } + + protected Builder(XbmcMetadataOptions instance) { + this.instance = instance; + } + + public XbmcMetadataOptions.Builder userId(String userId) { + this.instance.userId = userId; + return this; + } + + public XbmcMetadataOptions.Builder releaseDateFormat(String releaseDateFormat) { + this.instance.releaseDateFormat = releaseDateFormat; + return this; + } + + public XbmcMetadataOptions.Builder saveImagePathsInNfo(Boolean saveImagePathsInNfo) { + this.instance.saveImagePathsInNfo = saveImagePathsInNfo; + return this; + } + + public XbmcMetadataOptions.Builder enablePathSubstitution(Boolean enablePathSubstitution) { + this.instance.enablePathSubstitution = enablePathSubstitution; + return this; + } + + public XbmcMetadataOptions.Builder enableExtraThumbsDuplication(Boolean enableExtraThumbsDuplication) { + this.instance.enableExtraThumbsDuplication = enableExtraThumbsDuplication; + return this; + } + + /** + * returns a built XbmcMetadataOptions instance. + * + * The builder is not reusable. + */ + public XbmcMetadataOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static XbmcMetadataOptions.Builder builder() { + return new XbmcMetadataOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public XbmcMetadataOptions.Builder toBuilder() { + return new XbmcMetadataOptions.Builder().userId(getUserId()).releaseDateFormat(getReleaseDateFormat()) + .saveImagePathsInNfo(getSaveImagePathsInNfo()).enablePathSubstitution(getEnablePathSubstitution()) + .enableExtraThumbsDuplication(getEnableExtraThumbsDuplication()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/Jellyfin._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/Jellyfin._ new file mode 100644 index 0000000000000..7fec0e99feaa2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/Jellyfin._ @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client; + +import org.openhab.binding.jellyfin.internal.client.api.client.ApiClient; +import org.openhab.binding.jellyfin.internal.client.api.client.HttpClientOptions; +import org.openhab.binding.jellyfin.internal.client.discovery.DiscoveryService; +import org.openhab.binding.jellyfin.internal.client.model.ClientInfo; +import org.openhab.binding.jellyfin.internal.client.model.DeviceInfo; +import org.openhab.binding.jellyfin.internal.client.model.ServerVersion; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Main Jellyfin client class for interacting with Jellyfin servers + * + * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude + * Sonnet 3.7") + */ +public class Jellyfin { + + private final Logger logger = LoggerFactory.getLogger(Jellyfin.class); + private final JellyfinOptions options; + + /** + * Create a new Jellyfin client instance + * + * @param options Configuration options for the client + */ + public Jellyfin(JellyfinOptions options) { + this.options = options; + } + + /** + * Create a new Jellyfin client instance + * + * @param optionsBuilder Builder for configuration options + */ + public Jellyfin(JellyfinOptions.Builder optionsBuilder) { + this(optionsBuilder.build()); + } + + /** + * Get the device information + * + * @return Device information or null if not set + */ + public DeviceInfo getDeviceInfo() { + return options.getDeviceInfo(); + } + + /** + * Get the client information + * + * @return Client information or null if not set + */ + public ClientInfo getClientInfo() { + return options.getClientInfo(); + } + + /** + * Get the discovery service to help with normalizing server addresses and find servers in the local network + * + * @return The discovery service instance + */ + public DiscoveryService getDiscovery() { + // Note: In a real implementation, this would be lazily instantiated + return new DiscoveryService(this); + } + + /** + * Create a new API client instance to use in API services. + * The clientInfo and deviceInfo parameters are required when not passed as option in JellyfinOptions. + * The baseUrl is only required when HTTP calls are made. + * + * @param baseUrl The base URL of the Jellyfin server + * @param accessToken Access token for authentication + * @param clientInfo Client information + * @param deviceInfo Device information + * @param httpClientOptions HTTP client options + * @return A new API client instance + * @throws IllegalArgumentException If required parameters are missing + */ + public ApiClient createApi(String baseUrl, String accessToken, ClientInfo clientInfo, DeviceInfo deviceInfo, + HttpClientOptions httpClientOptions) { + + if (clientInfo == null) { + clientInfo = options.getClientInfo(); + } + + if (deviceInfo == null) { + deviceInfo = options.getDeviceInfo(); + } + + if (clientInfo == null) { + throw new IllegalArgumentException( + "ClientInfo needs to be set when calling createApi() or by providing it when constructing the Jellyfin instance"); + } + + if (deviceInfo == null) { + throw new IllegalArgumentException( + "DeviceInfo needs to be set when calling createApi() or by providing it when constructing the Jellyfin instance"); + } + + return options.getApiClientFactory().create(baseUrl, accessToken, clientInfo, deviceInfo, httpClientOptions); + } + + /** + * Create a new API client with default HTTP options + * + * @param baseUrl The base URL of the Jellyfin server + * @param accessToken Access token for authentication + * @return A new API client instance + */ + public ApiClient createApi(String baseUrl, String accessToken) { + return createApi(baseUrl, accessToken, null, null, new HttpClientOptions()); + } + + /** + * Get the minimum server version expected to work + * + * @return The minimum supported server version + */ + public static ServerVersion getMinimumVersion() { + return new ServerVersion(10, 10, 0, 0); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/JellyfinClientFactory._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/JellyfinClientFactory._ new file mode 100644 index 0000000000000..354e4e4d13d25 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/JellyfinClientFactory._ @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client; + +import java.util.UUID; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.jetty.util.ssl.SslContextFactory; +import org.openhab.binding.jellyfin.internal.client.api.client.impl.JettyApiClientFactory; +import org.openhab.binding.jellyfin.internal.client.model.ClientInfo; +import org.openhab.binding.jellyfin.internal.client.model.DeviceInfo; +import org.openhab.core.io.net.http.HttpClientFactory; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Factory for creating Jellyfin client instances + * + * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude + * Sonnet 3.7") + */ +@Component(service = JellyfinClientFactory.class) +@NonNullByDefault +public class JellyfinClientFactory { + + private final Logger logger = LoggerFactory.getLogger(JellyfinClientFactory.class); + + private static final String CLIENT_NAME = "openHAB"; + private static final String CLIENT_VERSION = "1.0.0"; + private static final String DEVICE_NAME = "openHAB Binding"; + + private final HttpClient httpClient; + + @Activate + public JellyfinClientFactory(@Reference HttpClientFactory httpClientFactory) { + SslContextFactory.Client sslContextFactory = new SslContextFactory.Client(); + sslContextFactory.setEndpointIdentificationAlgorithm(null); + this.httpClient = httpClientFactory.getCommonHttpClient(); + + try { + if (!httpClient.isStarted()) { + httpClient.start(); + } + } catch (Exception e) { + logger.error("Failed to start HTTP client: {}", e.getMessage()); + } + } + + /** + * Create a new Jellyfin client instance + * + * @param deviceId The device ID to use, or null to generate a random one + * @return A new Jellyfin client instance + */ + public Jellyfin createJellyfinClient(String deviceId) { + if (deviceId == null || deviceId.trim().isEmpty()) { + deviceId = UUID.randomUUID().toString(); + } + + ClientInfo clientInfo = new ClientInfo(CLIENT_NAME, CLIENT_VERSION); + DeviceInfo deviceInfo = new DeviceInfo(deviceId, DEVICE_NAME); + + JettyApiClientFactory apiClientFactory = new JettyApiClientFactory(httpClient); + + JellyfinOptions options = new JellyfinOptions.Builder().setClientInfo(clientInfo).setDeviceInfo(deviceInfo) + .setApiClientFactory(apiClientFactory).build(); + + return new Jellyfin(options); + } + + /** + * Create a new Jellyfin client instance with a random device ID + * + * @return A new Jellyfin client instance + */ + public Jellyfin createJellyfinClient() { + return createJellyfinClient(null); + } + + /** + * Clean up resources + */ + public void dispose() { + try { + if (httpClient.isStarted()) { + httpClient.stop(); + } + } catch (Exception e) { + logger.error("Failed to stop HTTP client: {}", e.getMessage()); + } + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/JellyfinOptions._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/JellyfinOptions._ new file mode 100644 index 0000000000000..1310918c3c1fe --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/JellyfinOptions._ @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client; + +import java.util.Objects; + +import org.openhab.binding.jellyfin.internal.client.api.client.ApiClientFactory; +import org.openhab.binding.jellyfin.internal.client.model.ClientInfo; +import org.openhab.binding.jellyfin.internal.client.model.DeviceInfo; +import org.openhab.binding.jellyfin.internal.client.model.ServerVersion; + +/** + * Configuration options for the Jellyfin client + * + * @author Patrik Gfeller, Initial contribution (based on Android SDK by Peter Feller) + */ +public class JellyfinOptions { + private final ClientInfo clientInfo; + private final DeviceInfo deviceInfo; + private final ApiClientFactory apiClientFactory; + private final ServerVersion minimumServerVersion; + + /** + * Create a new JellyfinOptions instance + * + * @param clientInfo Client information or null + * @param deviceInfo Device information or null + * @param apiClientFactory Factory for creating API clients + * @param minimumServerVersion Minimum supported server version + */ + public JellyfinOptions(ClientInfo clientInfo, DeviceInfo deviceInfo, ApiClientFactory apiClientFactory, + ServerVersion minimumServerVersion) { + this.clientInfo = clientInfo; + this.deviceInfo = deviceInfo; + this.apiClientFactory = apiClientFactory; + this.minimumServerVersion = minimumServerVersion; + } + + /** + * Get the client information + * + * @return Client information or null if not set + */ + public ClientInfo getClientInfo() { + return clientInfo; + } + + /** + * Get the device information + * + * @return Device information or null if not set + */ + public DeviceInfo getDeviceInfo() { + return deviceInfo; + } + + /** + * Get the API client factory + * + * @return The API client factory + */ + public ApiClientFactory getApiClientFactory() { + return apiClientFactory; + } + + /** + * Get the minimum supported server version + * + * @return The minimum supported server version + */ + public ServerVersion getMinimumServerVersion() { + return minimumServerVersion; + } + + /** + * Builder for JellyfinOptions + */ + public static class Builder { + private ClientInfo clientInfo; + private DeviceInfo deviceInfo; + private ApiClientFactory apiClientFactory; + private ServerVersion minimumServerVersion = Jellyfin.getMinimumVersion(); + + /** + * Create a new builder instance + */ + public Builder() { + } + + /** + * Set the client information + * + * @param clientInfo Client information + * @return This builder for method chaining + */ + public Builder setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Set the device information + * + * @param deviceInfo Device information + * @return This builder for method chaining + */ + public Builder setDeviceInfo(DeviceInfo deviceInfo) { + this.deviceInfo = deviceInfo; + return this; + } + + /** + * Set the API client factory + * + * @param apiClientFactory API client factory + * @return This builder for method chaining + */ + public Builder setApiClientFactory(ApiClientFactory apiClientFactory) { + this.apiClientFactory = apiClientFactory; + return this; + } + + /** + * Set the minimum supported server version + * + * @param minimumServerVersion Minimum supported server version + * @return This builder for method chaining + */ + public Builder setMinimumServerVersion(ServerVersion minimumServerVersion) { + this.minimumServerVersion = minimumServerVersion; + return this; + } + + /** + * Build a JellyfinOptions instance + * + * @return The new JellyfinOptions instance + */ + public JellyfinOptions build() { + Objects.requireNonNull(apiClientFactory, "API client factory must be set"); + Objects.requireNonNull(minimumServerVersion, "Minimum server version must be set"); + + return new JellyfinOptions(clientInfo, deviceInfo, apiClientFactory, minimumServerVersion); + } + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/ApiClient._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/ApiClient._ new file mode 100644 index 0000000000000..c9640edbd703b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/ApiClient._ @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client.api.client; + +import java.util.Collections; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +import org.openhab.binding.jellyfin.internal.client.api.client.exception.MissingBaseUrlException; +import org.openhab.binding.jellyfin.internal.client.model.ClientInfo; +import org.openhab.binding.jellyfin.internal.client.model.DeviceInfo; + +/** + * Interface for the Jellyfin API client + * + * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude + * Sonnet 3.7") + */ +public abstract class ApiClient { + + /** + * The query parameter to use for access tokens. + */ + public static final String QUERY_ACCESS_TOKEN = "ApiKey"; + + /** + * The recommended value for the accept header. It prefers JSON followed by octet stream and finally + * everything. The "any MIME type" (* / *) is required for some endpoints in the server. + */ + public static final String HEADER_ACCEPT = "application/json, application/octet-stream;q=0.9, */*;q=0.8"; + + /** + * URL to use as base for API endpoints. Should include the protocol and may contain a path. + * + * @return The base URL or null if not set + */ + public abstract String getBaseUrl(); + + /** + * Access token to use for requests. Appended to all requests if set. + * + * @return The access token or null if not set + */ + public abstract String getAccessToken(); + + /** + * Information about the client / application send in all API requests. + * + * @return Client information + */ + public abstract ClientInfo getClientInfo(); + + /** + * Information about the device send in all API requests. Only a single session is allowed per + * device id. + * + * @return Device information + */ + public abstract DeviceInfo getDeviceInfo(); + + /** + * HTTP Options for this ApiClient. + * + * @return HTTP client options + */ + public abstract HttpClientOptions getHttpClientOptions(); + + /** + * Change the authorization values used in this ApiClient instance. + * + * @param baseUrl The new base URL or null + * @param accessToken The new access token or null + * @param clientInfo The new client information + * @param deviceInfo The new device information + */ + public abstract void update(String baseUrl, String accessToken, ClientInfo clientInfo, DeviceInfo deviceInfo); + + /** + * Create a complete URL based on the base URL and given parameters. + * + * @param pathTemplate Path template with optional placeholders + * @param pathParameters Map of path parameters to replace placeholders + * @param queryParameters Map of query parameters to append + * @param ignorePathParameters Whether to ignore path parameters and use the template as-is + * @return The complete URL + * @throws MissingBaseUrlException If the base URL is missing + */ + public String createUrl(String pathTemplate, Map pathParameters, + Map queryParameters, boolean ignorePathParameters) throws MissingBaseUrlException { + + String baseUrl = getBaseUrl(); + if (baseUrl == null) { + throw new MissingBaseUrlException(); + } + + // In a real implementation, you would need to implement URL building logic here + // For this basic example, we'll just append the path to the base URL + return baseUrl + pathTemplate; + } + + /** + * Simplified createUrl variant with default parameters + * + * @param pathTemplate Path template + * @return The complete URL + * @throws MissingBaseUrlException If the base URL is missing + */ + public String createUrl(String pathTemplate) throws MissingBaseUrlException { + return createUrl(pathTemplate, Collections.emptyMap(), Collections.emptyMap(), true); + } + + /** + * Send an API request + * + * @param method HTTP method + * @param pathTemplate Path template + * @param pathParameters Path parameters + * @param queryParameters Query parameters + * @param requestBody Request body object + * @return Future with the raw response + */ + public abstract CompletableFuture request(HttpMethod method, String pathTemplate, + Map pathParameters, Map queryParameters, Object requestBody); + + /** + * Send a GET request + * + * @param pathTemplate Path template + * @return Future with the raw response + */ + public CompletableFuture get(String pathTemplate) { + return request(HttpMethod.GET, pathTemplate, Collections.emptyMap(), Collections.emptyMap(), null); + } + + /** + * Send a POST request + * + * @param pathTemplate Path template + * @param requestBody Request body object + * @return Future with the raw response + */ + public CompletableFuture post(String pathTemplate, Object requestBody) { + return request(HttpMethod.POST, pathTemplate, Collections.emptyMap(), Collections.emptyMap(), requestBody); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/ApiClientFactory._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/ApiClientFactory._ new file mode 100644 index 0000000000000..59de7e3e01778 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/ApiClientFactory._ @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client.api.client; + +import org.openhab.binding.jellyfin.internal.client.model.ClientInfo; +import org.openhab.binding.jellyfin.internal.client.model.DeviceInfo; + +/** + * Factory interface for creating API clients + * + * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude + * Sonnet 3.7") + */ +public interface ApiClientFactory { + + /** + * Create a new API client + * + * @param baseUrl The base URL of the Jellyfin server + * @param accessToken Access token for authentication + * @param clientInfo Client information + * @param deviceInfo Device information + * @param httpClientOptions HTTP client options + * @return A new API client + */ + ApiClient create(String baseUrl, String accessToken, ClientInfo clientInfo, DeviceInfo deviceInfo, + HttpClientOptions httpClientOptions); +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/HttpClientOptions._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/HttpClientOptions._ new file mode 100644 index 0000000000000..bd16f478340f9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/HttpClientOptions._ @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client.api.client; + +import java.time.Duration; + +/** + * Configuration options for the Jellyfin API HTTP client + * + * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude + * Sonnet 3.7") + */ +public class HttpClientOptions { + + private boolean followRedirects = true; + private Duration connectTimeout = Duration.ofSeconds(10); + private Duration requestTimeout = Duration.ofSeconds(60); + private Duration socketTimeout = Duration.ofMinutes(5); + + /** + * Creates a new HttpClientOptions with default values + */ + public HttpClientOptions() { + } + + /** + * Check if the client should follow redirects + * + * @return True if redirects should be followed + */ + public boolean isFollowRedirects() { + return followRedirects; + } + + /** + * Set whether the client should follow redirects + * + * @param followRedirects True to follow redirects + * @return This instance for method chaining + */ + public HttpClientOptions setFollowRedirects(boolean followRedirects) { + this.followRedirects = followRedirects; + return this; + } + + /** + * Get the connection timeout duration + * + * @return The connection timeout + */ + public Duration getConnectTimeout() { + return connectTimeout; + } + + /** + * Set the connection timeout duration + * + * @param connectTimeout The connection timeout + * @return This instance for method chaining + */ + public HttpClientOptions setConnectTimeout(Duration connectTimeout) { + this.connectTimeout = connectTimeout; + return this; + } + + /** + * Get the request timeout duration + * + * @return The request timeout + */ + public Duration getRequestTimeout() { + return requestTimeout; + } + + /** + * Set the request timeout duration + * + * @param requestTimeout The request timeout + * @return This instance for method chaining + */ + public HttpClientOptions setRequestTimeout(Duration requestTimeout) { + this.requestTimeout = requestTimeout; + return this; + } + + /** + * Get the socket timeout duration + * + * @return The socket timeout + */ + public Duration getSocketTimeout() { + return socketTimeout; + } + + /** + * Set the socket timeout duration + * + * @param socketTimeout The socket timeout + * @return This instance for method chaining + */ + public HttpClientOptions setSocketTimeout(Duration socketTimeout) { + this.socketTimeout = socketTimeout; + return this; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/HttpMethod._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/HttpMethod._ new file mode 100644 index 0000000000000..1f516700f24f4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/HttpMethod._ @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client.api.client; + +/** + * Enum representing HTTP methods for the Jellyfin API client + * + * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude + * Sonnet 3.7") + */ +public enum HttpMethod { + GET, + POST, + PUT, + DELETE, + PATCH +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/RawResponse._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/RawResponse._ new file mode 100644 index 0000000000000..f6c7ddbfb105c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/RawResponse._ @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client.api.client; + +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.util.Map; + +/** + * Raw API response container + * + * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude + * Sonnet 3.7") + */ +public class RawResponse { + + private final int status; + private final Map headers; + private final ByteBuffer body; + + /** + * Create a new raw response + * + * @param status HTTP status code + * @param headers Response headers + * @param body Response body as ByteBuffer + */ + public RawResponse(int status, Map headers, ByteBuffer body) { + this.status = status; + this.headers = headers; + this.body = body; + } + + /** + * Get the HTTP status code + * + * @return HTTP status code + */ + public int getStatus() { + return status; + } + + /** + * Get the response headers + * + * @return Map of response headers + */ + public Map getHeaders() { + return headers; + } + + /** + * Get the response body as ByteBuffer + * + * @return ByteBuffer containing the response body + */ + public ByteBuffer getBody() { + return body; + } + + /** + * Get the response body as a String using UTF-8 encoding + * + * @return String representation of the body + */ + public String getBodyAsString() { + if (body == null) { + return null; + } + + ByteBuffer duplicate = body.duplicate(); + byte[] bytes = new byte[duplicate.remaining()]; + duplicate.get(bytes); + return new String(bytes, StandardCharsets.UTF_8); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/exception/ApiClientException._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/exception/ApiClientException._ new file mode 100644 index 0000000000000..ba2efb952af46 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/exception/ApiClientException._ @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client.api.client.exception; + +/** + * Base exception for all API client exceptions + * + * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude + * Sonnet 3.7") + */ +public class ApiClientException extends Exception { + + private static final long serialVersionUID = 4499822310456934151L; + + /** + * Create a new API client exception + * + * @param message The exception message + */ + public ApiClientException(String message) { + super(message); + } + + /** + * Create a new API client exception + * + * @param message The exception message + * @param cause The cause of the exception + */ + public ApiClientException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/exception/MissingBaseUrlException._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/exception/MissingBaseUrlException._ new file mode 100644 index 0000000000000..7da6da766b395 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/exception/MissingBaseUrlException._ @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client.api.client.exception; + +/** + * Exception thrown when the base URL is missing when required + * + * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude + * Sonnet 3.7") + */ +public class MissingBaseUrlException extends ApiClientException { + + private static final long serialVersionUID = -831061596991416260L; + + /** + * Create a new missing base URL exception + */ + public MissingBaseUrlException() { + super("Base URL is missing but required for this operation"); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/impl/JettyApiClient._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/impl/JettyApiClient._ new file mode 100644 index 0000000000000..789f1d5b9ded8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/impl/JettyApiClient._ @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client.api.client.impl; + +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.ByteBuffer; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.jetty.client.api.ContentResponse; +import org.eclipse.jetty.client.api.Request; +import org.eclipse.jetty.client.util.StringContentProvider; +import org.eclipse.jetty.http.HttpHeader; +import org.openhab.binding.jellyfin.internal.client.api.client.ApiClient; +import org.openhab.binding.jellyfin.internal.client.api.client.HttpClientOptions; +import org.openhab.binding.jellyfin.internal.client.api.client.HttpMethod; +import org.openhab.binding.jellyfin.internal.client.api.client.RawResponse; +import org.openhab.binding.jellyfin.internal.client.api.client.exception.MissingBaseUrlException; +import org.openhab.binding.jellyfin.internal.client.model.ClientInfo; +import org.openhab.binding.jellyfin.internal.client.model.DeviceInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Implementation of the Jellyfin API client using Jetty HTTP client + * + * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude + * Sonnet 3.7") + */ +@NonNullByDefault +public class JettyApiClient extends ApiClient { + + private final Logger logger = LoggerFactory.getLogger(JettyApiClient.class); + private final HttpClient httpClient; + + private String baseUrl; + private String accessToken; + private ClientInfo clientInfo; + private DeviceInfo deviceInfo; + private final HttpClientOptions httpClientOptions; + + /** + * Create a new Jetty-based API client + * + * @param httpClient The Jetty HTTP client + * @param baseUrl The base URL of the Jellyfin server + * @param accessToken Access token for authentication + * @param clientInfo Client information + * @param deviceInfo Device information + * @param httpClientOptions HTTP client options + */ + public JettyApiClient(HttpClient httpClient, String baseUrl, String accessToken, ClientInfo clientInfo, + DeviceInfo deviceInfo, HttpClientOptions httpClientOptions) { + this.httpClient = httpClient; + this.baseUrl = baseUrl; + this.accessToken = accessToken; + this.clientInfo = clientInfo; + this.deviceInfo = deviceInfo; + this.httpClientOptions = httpClientOptions; + } + + @Override + public String getBaseUrl() { + return baseUrl; + } + + @Override + public String getAccessToken() { + return accessToken; + } + + @Override + public ClientInfo getClientInfo() { + return clientInfo; + } + + @Override + public DeviceInfo getDeviceInfo() { + return deviceInfo; + } + + @Override + public HttpClientOptions getHttpClientOptions() { + return httpClientOptions; + } + + @Override + public void update(String baseUrl, String accessToken, ClientInfo clientInfo, DeviceInfo deviceInfo) { + this.baseUrl = baseUrl; + this.accessToken = accessToken; + this.clientInfo = clientInfo; + this.deviceInfo = deviceInfo; + } + + @Override + public String createUrl(String pathTemplate, Map pathParameters, + Map queryParameters, boolean ignorePathParameters) throws MissingBaseUrlException { + if (baseUrl == null || baseUrl.isEmpty()) { + throw new MissingBaseUrlException(); + } + + try { + // Simple URL builder for this example + URI uri = new URI(baseUrl).resolve(pathTemplate); + + // Add query parameters if present + if (!queryParameters.isEmpty()) { + StringBuilder sb = new StringBuilder(uri.toString()); + sb.append(uri.toString().contains("?") ? "&" : "?"); + + boolean first = true; + for (Map.Entry entry : queryParameters.entrySet()) { + if (!first) { + sb.append("&"); + } + sb.append(entry.getKey()).append("=").append(entry.getValue()); + first = false; + } + + // Add access token as query param if available + if (accessToken != null && !accessToken.isEmpty()) { + sb.append(first ? "" : "&").append(QUERY_ACCESS_TOKEN).append("=").append(accessToken); + } + + return sb.toString(); + } else if (accessToken != null && !accessToken.isEmpty()) { + // Add just the access token + return uri + (uri.toString().contains("?") ? "&" : "?") + QUERY_ACCESS_TOKEN + "=" + accessToken; + } + + return uri.toString(); + } catch (URISyntaxException e) { + logger.error("Failed to create URL: {}", e.getMessage()); + throw new IllegalArgumentException("Invalid URL template: " + pathTemplate, e); + } + } + + @Override + public CompletableFuture request(HttpMethod method, String pathTemplate, + Map pathParameters, Map queryParameters, Object requestBody) { + + return CompletableFuture.supplyAsync(() -> { + try { + String url = createUrl(pathTemplate, pathParameters, queryParameters, false); + + Request request; + switch (method) { + case GET: + request = httpClient.newRequest(url).method("GET"); + break; + case POST: + request = httpClient.newRequest(url).method("POST"); + break; + case PUT: + request = httpClient.newRequest(url).method("PUT"); + break; + case DELETE: + request = httpClient.newRequest(url).method("DELETE"); + break; + case PATCH: + request = httpClient.newRequest(url).method("PATCH"); + break; + default: + throw new IllegalArgumentException("Unsupported HTTP method: " + method); + } + + // Add common headers + request.header(HttpHeader.ACCEPT, HEADER_ACCEPT); + request.header("X-Emby-Authorization", buildAuthHeader()); + + // Add request body if present + if (requestBody != null) { + if (requestBody instanceof String) { + request.content(new StringContentProvider((String) requestBody), "application/json"); + } else { + // In a real implementation, a JSON serializer would be used here + request.content(new StringContentProvider(requestBody.toString()), "application/json"); + } + } + + // Set timeouts + request.timeout(httpClientOptions.getRequestTimeout().toMillis(), + httpClientOptions.getSocketTimeout().toMillis()); + + // Execute the request + ContentResponse response = request.send(); + + // Create response object + Map headers = new HashMap<>(); + response.getHeaders().forEach(field -> headers.put(field.getName(), field.getValue())); + + ByteBuffer body = ByteBuffer.wrap(response.getContent()); + + return new RawResponse(response.getStatus(), headers, body); + } catch (Exception e) { + throw new CompletionException("Request failed: " + e.getMessage(), e); + } + }); + } + + /** + * Build the authentication header for Jellyfin requests + * + * @return The formatted authorization header value + */ + private String buildAuthHeader() { + StringBuilder sb = new StringBuilder(); + + // MediaBrowser Client="ClientName", Device="DeviceName", DeviceId="DeviceId", Version="Version" + sb.append("MediaBrowser "); + sb.append("Client=\"").append(clientInfo.getName()).append("\", "); + sb.append("Device=\"").append(deviceInfo.getName()).append("\", "); + sb.append("DeviceId=\"").append(deviceInfo.getId()).append("\", "); + sb.append("Version=\"").append(clientInfo.getVersion()).append("\""); + + if (accessToken != null && !accessToken.isEmpty()) { + sb.append(", Token=\"").append(accessToken).append("\""); + } + + return sb.toString(); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/impl/JettyApiClientFactory._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/impl/JettyApiClientFactory._ new file mode 100644 index 0000000000000..74eebc5664a62 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/impl/JettyApiClientFactory._ @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client.api.client.impl; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jetty.client.HttpClient; +import org.openhab.binding.jellyfin.internal.client.api.client.ApiClient; +import org.openhab.binding.jellyfin.internal.client.api.client.ApiClientFactory; +import org.openhab.binding.jellyfin.internal.client.api.client.HttpClientOptions; +import org.openhab.binding.jellyfin.internal.client.model.ClientInfo; +import org.openhab.binding.jellyfin.internal.client.model.DeviceInfo; + +/** + * Factory for creating Jetty-based API clients + * + * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude + * Sonnet 3.7") + */ +@NonNullByDefault +public class JettyApiClientFactory implements ApiClientFactory { + + private final HttpClient httpClient; + + /** + * Create a new Jetty API client factory + * + * @param httpClient The Jetty HTTP client + */ + public JettyApiClientFactory(HttpClient httpClient) { + this.httpClient = httpClient; + } + + @Override + public ApiClient create(String baseUrl, String accessToken, ClientInfo clientInfo, DeviceInfo deviceInfo, + HttpClientOptions httpClientOptions) { + return new JettyApiClient(httpClient, baseUrl, accessToken, clientInfo, deviceInfo, httpClientOptions); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/discovery/DiscoveryService._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/discovery/DiscoveryService._ new file mode 100644 index 0000000000000..c4541b100993d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/discovery/DiscoveryService._ @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client.discovery; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +import org.openhab.binding.jellyfin.internal.client.Jellyfin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Service for discovering Jellyfin servers and normalizing server addresses + * + * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude + * Sonnet 3.7") + */ +public class DiscoveryService { + + private final Logger logger = LoggerFactory.getLogger(DiscoveryService.class); + private final Jellyfin jellyfin; + + /** + * Create a new discovery service + * + * @param jellyfin The Jellyfin client instance + */ + public DiscoveryService(Jellyfin jellyfin) { + this.jellyfin = jellyfin; + } + + /** + * Normalize a server URL to ensure it has the correct format + * + * @param url The server URL to normalize + * @return The normalized URL or null if invalid + */ + public String normalizeUrl(String url) { + if (url == null || url.trim().isEmpty()) { + return null; + } + + try { + // Add http:// if no protocol is specified + if (!url.startsWith("http://") && !url.startsWith("https://")) { + url = "http://" + url; + } + + URI uri = new URI(url); + + // Ensure we have a valid hostname or IP + if (uri.getHost() == null || uri.getHost().isEmpty()) { + return null; + } + + // Remove trailing slashes from path + String path = uri.getPath(); + while (path != null && !path.isEmpty() && path.endsWith("/")) { + path = path.substring(0, path.length() - 1); + } + + // Build the normalized URL + return new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), path, uri.getQuery(), + uri.getFragment()).toString(); + } catch (URISyntaxException e) { + logger.debug("Failed to normalize URL: {}", url, e); + return null; + } + } + + /** + * Search for Jellyfin servers on the local network + * + * @return CompletableFuture with list of discovered servers + */ + public CompletableFuture> discoverLocalServers() { + // In a real implementation, this would perform server discovery + // For this example, we'll return an empty list + return CompletableFuture.completedFuture(new ArrayList<>()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/discovery/ServerDiscoveryInfo._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/discovery/ServerDiscoveryInfo._ new file mode 100644 index 0000000000000..9b3d1007863c6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/discovery/ServerDiscoveryInfo._ @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client.discovery; + +import java.util.Objects; + +/** + * Information about a discovered Jellyfin server + * + * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude + * Sonnet 3.7") + */ +public class ServerDiscoveryInfo { + + private final String id; + private final String name; + private final String address; + + /** + * Create a new server discovery info instance + * + * @param id The server ID + * @param name The server name + * @param address The server address + */ + public ServerDiscoveryInfo(String id, String name, String address) { + this.id = id; + this.name = name; + this.address = address; + } + + /** + * Get the server ID + * + * @return The server ID + */ + public String getId() { + return id; + } + + /** + * Get the server name + * + * @return The server name + */ + public String getName() { + return name; + } + + /** + * Get the server address + * + * @return The server address + */ + public String getAddress() { + return address; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + + ServerDiscoveryInfo that = (ServerDiscoveryInfo) o; + return Objects.equals(id, that.id) && Objects.equals(name, that.name) && Objects.equals(address, that.address); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, address); + } + + @Override + public String toString() { + return "ServerDiscoveryInfo{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", address='" + address + '\'' + + '}'; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/ClientInfo._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/ClientInfo._ new file mode 100644 index 0000000000000..00edd427e65e8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/ClientInfo._ @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client.model; + +import java.util.Objects; + +/** + * The client information is used to identify the client. + * + * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude + * Sonnet 3.7") + */ +public class ClientInfo { + + private final String name; + private final String version; + + /** + * Create a new ClientInfo instance + * + * @param name Name of the client, this should normally not change + * @param version The version of the client + */ + public ClientInfo(String name, String version) { + this.name = name; + this.version = version; + } + + /** + * Get the name of the client + * + * @return The client name + */ + public String getName() { + return name; + } + + /** + * Get the version of the client + * + * @return The client version + */ + public String getVersion() { + return version; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + + ClientInfo that = (ClientInfo) o; + return Objects.equals(name, that.name) && Objects.equals(version, that.version); + } + + @Override + public int hashCode() { + return Objects.hash(name, version); + } + + @Override + public String toString() { + return "ClientInfo{" + "name='" + name + '\'' + ", version='" + version + '\'' + '}'; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/DeviceInfo._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/DeviceInfo._ new file mode 100644 index 0000000000000..9f6e4504e8440 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/DeviceInfo._ @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client.model; + +import java.util.Objects; + +/** + * The device information is used to identify the device the client application is running on. + * + * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude + * Sonnet 3.7") + */ +public class DeviceInfo { + + private final String id; + private final String name; + + /** + * Create a new DeviceInfo instance + * + * @param id Unique id of the device. Only one user may be authenticated per device. + * It is recommended to generate a unique value for each user in the client. + * @param name Name of the device + */ + public DeviceInfo(String id, String name) { + this.id = id; + this.name = name; + } + + /** + * Get the device id + * + * @return The unique device id + */ + public String getId() { + return id; + } + + /** + * Get the device name + * + * @return The device name + */ + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + + DeviceInfo that = (DeviceInfo) o; + return Objects.equals(id, that.id) && Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + return "DeviceInfo{" + "id='" + id + '\'' + ", name='" + name + '\'' + '}'; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/ServerVersion._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/ServerVersion._ new file mode 100644 index 0000000000000..fe483eece8648 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/ServerVersion._ @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.client.model; + +import java.util.Comparator; +import java.util.Objects; +import java.util.regex.Pattern; + +/** + * Model to help with Jellyfin server versions. The format is similar to SemVer. + * + * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude + * Sonnet 3.7") + */ +public class ServerVersion implements Comparable { + + private static final Comparator COMPARATOR = Comparator.comparing(ServerVersion::getMajor) + .thenComparing(ServerVersion::getMinor).thenComparing(ServerVersion::getPatch) + .thenComparing(version -> version.getBuild() != null ? version.getBuild() : 0); + + private static final Pattern VERSION_PATTERN = Pattern.compile("^\\d+\\.\\d+\\.\\d+(?:\\.\\d+)?$"); + + private final int major; + private final int minor; + private final int patch; + private final Integer build; + + /** + * Create a new ServerVersion + * + * @param major The major version number + * @param minor The minor version number + * @param patch The patch version number + */ + public ServerVersion(int major, int minor, int patch) { + this(major, minor, patch, null); + } + + /** + * Create a new ServerVersion + * + * @param major The major version number + * @param minor The minor version number + * @param patch The patch version number + * @param build The optional build number + */ + public ServerVersion(int major, int minor, int patch, Integer build) { + this.major = major; + this.minor = minor; + this.patch = patch; + this.build = build; + } + + /** + * Get the major version number + * + * @return The major version number + */ + public int getMajor() { + return major; + } + + /** + * Get the minor version number + * + * @return The minor version number + */ + public int getMinor() { + return minor; + } + + /** + * Get the patch version number + * + * @return The patch version number + */ + public int getPatch() { + return patch; + } + + /** + * Get the build number + * + * @return The build number, or null if not set + */ + public Integer getBuild() { + return build; + } + + @Override + public int compareTo(ServerVersion other) { + return COMPARATOR.compare(this, other); + } + + /** + * Convert version to string. Format is "[major].[minor].[patch].[build]". + * [build] is omitted if null. + * + * @return The formatted version string + */ + @Override + public String toString() { + if (build != null) { + return String.format("%d.%d.%d.%d", major, minor, patch, build); + } else { + return String.format("%d.%d.%d", major, minor, patch); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + + ServerVersion that = (ServerVersion) o; + return major == that.major && minor == that.minor && patch == that.patch && Objects.equals(build, that.build); + } + + @Override + public int hashCode() { + return Objects.hash(major, minor, patch, build); + } + + /** + * Create an instance of ServerVersion from a string. The string must be in the format + * "^\d+\.\d+\.\d+(?:\.\d+)?$". Example: 1.0.0, 10.6.4 or 10.7.0.0 + * + * @param str The version string to parse + * @return A ServerVersion instance, or null if the string couldn't be parsed + */ + public static ServerVersion fromString(String str) { + if (str == null || !VERSION_PATTERN.matcher(str).matches()) { + return null; + } + + String[] parts = str.split("\\."); + + try { + int major = Integer.parseInt(parts[0]); + int minor = Integer.parseInt(parts[1]); + int patch = Integer.parseInt(parts[2]); + Integer build = parts.length > 3 ? Integer.parseInt(parts[3]) : null; + + return new ServerVersion(major, minor, patch, build); + } catch (NumberFormatException e) { + return null; + } + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/JellyfinClientDiscoveryService.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/JellyfinClientDiscoveryService._ similarity index 94% rename from bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/JellyfinClientDiscoveryService.java rename to bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/JellyfinClientDiscoveryService._ index 7a5223a13e152..827c62170e8eb 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/JellyfinClientDiscoveryService.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/JellyfinClientDiscoveryService._ @@ -21,9 +21,6 @@ import java.util.Set; import org.eclipse.jdt.annotation.NonNullByDefault; -import org.jellyfin.sdk.api.client.exception.ApiClientException; -import org.jellyfin.sdk.api.client.exception.InvalidStatusException; -import org.jellyfin.sdk.model.api.SessionInfo; import org.openhab.binding.jellyfin.internal.handler.JellyfinServerHandler; import org.openhab.binding.jellyfin.internal.util.SyncCallback; import org.openhab.core.config.discovery.AbstractThingHandlerDiscoveryService; @@ -39,7 +36,7 @@ /** * The {@link JellyfinClientDiscoveryService} discover Jellyfin clients connected to the server. * - * @author Miguel Alvarez - Initial contribution + * @author Miguel Álvarez - Initial contribution */ @Component(scope = ServiceScope.PROTOTYPE, service = JellyfinClientDiscoveryService.class) @NonNullByDefault diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/JellyfinServerDiscoveryService.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/JellyfinServerDiscoveryService._ similarity index 87% rename from bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/JellyfinServerDiscoveryService.java rename to bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/JellyfinServerDiscoveryService._ index 3c05e103a9a43..d09101d931fa0 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/JellyfinServerDiscoveryService.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/JellyfinServerDiscoveryService._ @@ -12,8 +12,6 @@ */ package org.openhab.binding.jellyfin.internal.discovery; -import static org.openhab.binding.jellyfin.internal.JellyfinBindingConstants.*; - import java.net.URI; import java.net.URISyntaxException; import java.util.HashMap; @@ -23,18 +21,6 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import org.jellyfin.sdk.Jellyfin; -import org.jellyfin.sdk.JellyfinOptions; -import org.jellyfin.sdk.api.client.exception.ApiClientException; -import org.jellyfin.sdk.api.operations.SystemApi; -import org.jellyfin.sdk.compatibility.JavaFlow; -import org.jellyfin.sdk.compatibility.JavaFlow.FlowJob; -import org.jellyfin.sdk.model.ClientInfo; -import org.jellyfin.sdk.model.DeviceInfo; -import org.jellyfin.sdk.model.api.PublicSystemInfo; -import org.jellyfin.sdk.model.api.ServerDiscoveryInfo; -import org.openhab.binding.jellyfin.internal.util.SyncCallback; -import org.openhab.binding.jellyfin.internal.util.SyncResponse; import org.openhab.core.OpenHAB; import org.openhab.core.config.discovery.AbstractDiscoveryService; import org.openhab.core.config.discovery.DiscoveryResultBuilder; @@ -48,7 +34,7 @@ /** * The {@link JellyfinServerDiscoveryService} discover Jellyfin servers in the network. * - * @author Miguel Alvarez - Initial contribution + * @author Miguel Álvarez - Initial contribution */ @NonNullByDefault @Component(service = DiscoveryService.class, configurationPid = "discovery.jellyfin") diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryHelper.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryHelper.java new file mode 100644 index 0000000000000..15c246a6cff72 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryHelper.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.discovery; + +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetAddress; +import java.net.InterfaceAddress; +import java.net.NetworkInterface; +import java.net.SocketException; +import java.net.SocketTimeoutException; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Patrik Gfeller - Initial Contribution + */ +@NonNullByDefault +class ServerDiscoveryHelper { + private static final int DISCOVERY_PORT = 7359; + private static final int TIMEOUT_MS = 2000; + private static final String DISCOVERY_MESSAGE = "who is JellyfinServer?"; + + private final Logger logger = LoggerFactory.getLogger(ServerDiscoveryHelper.class); + + private final List serverList = new CopyOnWriteArrayList<>(); + private final ExecutorService executorService = Executors.newCachedThreadPool(); + + public List discoverServers() { + serverList.clear(); + try { + Enumeration interfaces = NetworkInterface.getNetworkInterfaces(); + + while (interfaces.hasMoreElements()) { + NetworkInterface networkInterface = interfaces.nextElement(); + if (networkInterface.isLoopback() || !networkInterface.isUp()) { + logger.trace("Interface {} ignored.", networkInterface.getDisplayName()); + continue; + } + + for (InterfaceAddress interfaceAddress : networkInterface.getInterfaceAddresses()) { + InetAddress broadcast = interfaceAddress.getBroadcast(); + if (broadcast != null) { + executorService.submit(() -> sendDiscoveryPacket(broadcast)); + } + } + } + // Give some time for responses to come back + Thread.sleep(TIMEOUT_MS + 500); // Wait a bit longer than the timeout + } catch (SocketException | InterruptedException e) { + logger.error("Error during network interface enumeration or sleep: {}", e.getMessage()); + } finally { + executorService.shutdown(); + } + return new ArrayList<>(serverList); + } + + private void sendDiscoveryPacket(InetAddress broadcastAddress) { + try (DatagramSocket socket = new DatagramSocket()) { + socket.setBroadcast(true); + socket.setSoTimeout(TIMEOUT_MS); // Set a timeout for receiving responses + + byte[] sendData = DISCOVERY_MESSAGE.getBytes(); + DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, broadcastAddress, DISCOVERY_PORT); + socket.send(sendPacket); + + logger.trace("Sent discovery packet to {}:{}", broadcastAddress.getHostAddress(), DISCOVERY_PORT); + + // Listen for responses + byte[] receiveData = new byte[1024]; + while (true) { + try { + DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length); + socket.receive(receivePacket); + String response = new String(receivePacket.getData(), 0, receivePacket.getLength()); + + logger.debug("Discovered Jellyfin Server: {}", response); + + serverList.add(ServerDiscoveryResult.fromJson(response)); + } catch (SocketTimeoutException e) { + // No more responses within the timeout + break; + } catch (IOException e) { + logger.error("Error receiving discovery response: {}", e.getMessage()); + break; + } + } + } catch (IOException e) { + logger.error("Error creating or sending discovery socket: {}", e.getMessage()); + } + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryResult.java new file mode 100644 index 0000000000000..e0a3636c25711 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryResult.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.discovery; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +/** + * @author Patrik Gfeller - Initial Contribution + */ +@NonNullByDefault +class ServerDiscoveryResult { + private String address; + private String id; + private String name; + private String endpointAddress; + + ServerDiscoveryResult(String address, String id, String name, String endpointAddress) { + this.address = address; + this.id = id; + this.name = name; + this.endpointAddress = endpointAddress; + } + + public String getAddress() { + return address; + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getEndpointAddress() { + return endpointAddress; + } + + /** + * Parse JSON string into a ServerDiscoveryResult object + * + * @param jsonData The JSON formatted string to parse + * @return ServerDiscoveryResult instance with parsed values + */ + public static ServerDiscoveryResult fromJson(String jsonData) { + JsonObject jsonObject = JsonParser.parseString(jsonData).getAsJsonObject(); + + String address = jsonObject.get("Address").getAsString(); + String id = jsonObject.get("Id").getAsString(); + String name = jsonObject.get("Name").getAsString(); + String endpointAddress = jsonObject.has("EndpointAddress") && !jsonObject.get("EndpointAddress").isJsonNull() + ? jsonObject.get("EndpointAddress").getAsString() + : null; + + return new ServerDiscoveryResult(address, id, name, endpointAddress); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java new file mode 100644 index 0000000000000..6d12c4cb0bc7d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.discovery; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.jellyfin.internal.Constants; +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.current.SystemApi; +import org.openhab.core.config.discovery.AbstractDiscoveryService; +import org.openhab.core.config.discovery.DiscoveryResultBuilder; +import org.openhab.core.config.discovery.DiscoveryService; +import org.openhab.core.thing.Thing; +import org.openhab.core.thing.ThingUID; +import org.osgi.service.component.annotations.Component; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link ServerDiscoveryService} discover Jellyfin servers in the network. + * + * @author Miguel Álvarez - Initial contribution + * @author Patrik Gfeller - Adjustments to work independently of the Android SDK + * and respective runtime + */ +@NonNullByDefault +@Component(service = DiscoveryService.class, immediate = true, configurationPid = "discovery.jellyfin") +public class ServerDiscoveryService extends AbstractDiscoveryService { + private final Logger logger = LoggerFactory.getLogger(ServerDiscoveryService.class); + + public ServerDiscoveryService() throws IllegalArgumentException { + super(Set.of(Constants.THING_TYPE_SERVER), 60, false); + } + + @Override + protected synchronized void startScan() { + ServerDiscoveryHelper discoverer = new ServerDiscoveryHelper(); + + List servers = discoverer.discoverServers(); + + if (!servers.isEmpty()) { + for (ServerDiscoveryResult server : servers) { + logger.debug("Server {} @ {}", server.getName(), server.getAddress()); + + var uid = new ThingUID(Constants.THING_TYPE_SERVER, server.getId()); + var properties = this.getProperties(server); + var resultBuilder = DiscoveryResultBuilder.create(uid).withProperties(properties) + .withRepresentationProperty(Thing.PROPERTY_SERIAL_NUMBER).withLabel(server.getName()) + .withTTL(Constants.DISCOVERY_RESULT_TTL_SEC); + + var result = resultBuilder.build(); + + this.thingDiscovered(result); + } + } + } + + private Map getProperties(ServerDiscoveryResult server) { + Map properties = new HashMap<>(); + + try { + var client = new ApiClient(); + client.updateBaseUri(server.getAddress()); + + var systemApi = new SystemApi(client); + var systemInformation = systemApi.getPublicSystemInfo(); + + properties.put(Thing.PROPERTY_SERIAL_NUMBER, systemInformation.getId()); + properties.put(Thing.PROPERTY_FIRMWARE_VERSION, systemInformation.getVersion()); + properties.put(Thing.PROPERTY_VENDOR, "https://jellyfin.org"); + } catch (ApiException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + return properties; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/JellyfinException.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/JellyfinException.java new file mode 100644 index 0000000000000..11b45ce8d36ab --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/JellyfinException.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.exceptions; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.jellyfin.internal.i18n.ResourceHelper; + +/** + * Base class for all JellyfinExceptions. + * + * @author Patrik Gfeller - Initial Contribution + */ +@NonNullByDefault +public abstract class JellyfinException extends Exception { + private static final long serialVersionUID = 0L; + + public JellyfinException(String message) { + super(message.startsWith("@text") ? ResourceHelper.getResourceString(message) : message); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java new file mode 100644 index 0000000000000..ac7b4e05e72d2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.handler; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.jellyfin.internal.Constants; +import org.openhab.core.thing.Bridge; +import org.openhab.core.thing.Thing; +import org.openhab.core.thing.ThingTypeUID; +import org.openhab.core.thing.binding.BaseThingHandlerFactory; +import org.openhab.core.thing.binding.ThingHandler; +import org.openhab.core.thing.binding.ThingHandlerFactory; +import org.osgi.service.component.annotations.Component; + +/** + * The {@link HandlerFactory} is responsible for creating things and thing + * handlers. + * + * @author Miguel Álvarez - Initial contribution + * @author Patrik Gfeller - Adjustments to work independently of the Android SDK + * and respective runtime + */ +@NonNullByDefault +@Component(configurationPid = "binding.jellyfin", service = ThingHandlerFactory.class) +public class HandlerFactory extends BaseThingHandlerFactory { + + @Override + public boolean supportsThingType(ThingTypeUID thingTypeUID) { + return Constants.SUPPORTED_THING_TYPES.contains(thingTypeUID); + } + + @Override + protected @Nullable ThingHandler createHandler(Thing thing) { + ThingTypeUID thingTypeUID = thing.getThingTypeUID(); + + if (Constants.THING_TYPE_SERVER.equals(thingTypeUID)) { + return new ServerHandler((Bridge) thing); + } + + return null; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinClientHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinClientHandler._ similarity index 98% rename from bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinClientHandler.java rename to bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinClientHandler._ index 51e63de9b0379..b285aeaf235e7 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinClientHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinClientHandler._ @@ -44,13 +44,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import org.jellyfin.sdk.api.client.exception.ApiClientException; -import org.jellyfin.sdk.model.api.BaseItemDto; -import org.jellyfin.sdk.model.api.BaseItemKind; -import org.jellyfin.sdk.model.api.PlayCommand; -import org.jellyfin.sdk.model.api.PlayerStateInfo; -import org.jellyfin.sdk.model.api.PlaystateCommand; -import org.jellyfin.sdk.model.api.SessionInfo; +import org.openhab.binding.jellyfin.internal.exceptions.ApiClientException; import org.openhab.binding.jellyfin.internal.util.SyncCallback; import org.openhab.core.library.types.DecimalType; import org.openhab.core.library.types.NextPreviousType; diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinServerHandler._ similarity index 93% rename from bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinServerHandler.java rename to bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinServerHandler._ index 46663a4d59268..2f56202e42f6d 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/JellyfinServerHandler._ @@ -24,29 +24,6 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import org.jellyfin.sdk.Jellyfin; -import org.jellyfin.sdk.JellyfinOptions; -import org.jellyfin.sdk.api.client.ApiClient; -import org.jellyfin.sdk.api.client.exception.ApiClientException; -import org.jellyfin.sdk.api.client.exception.InvalidStatusException; -import org.jellyfin.sdk.api.client.exception.MissingUserIdException; -import org.jellyfin.sdk.api.operations.ItemsApi; -import org.jellyfin.sdk.api.operations.SessionApi; -import org.jellyfin.sdk.api.operations.SystemApi; -import org.jellyfin.sdk.api.operations.TvShowsApi; -import org.jellyfin.sdk.api.operations.UserApi; -import org.jellyfin.sdk.model.ClientInfo; -import org.jellyfin.sdk.model.api.AuthenticateUserByName; -import org.jellyfin.sdk.model.api.AuthenticationResult; -import org.jellyfin.sdk.model.api.BaseItemDto; -import org.jellyfin.sdk.model.api.BaseItemDtoQueryResult; -import org.jellyfin.sdk.model.api.BaseItemKind; -import org.jellyfin.sdk.model.api.ItemFields; -import org.jellyfin.sdk.model.api.MessageCommand; -import org.jellyfin.sdk.model.api.PlayCommand; -import org.jellyfin.sdk.model.api.PlaystateCommand; -import org.jellyfin.sdk.model.api.SessionInfo; -import org.jellyfin.sdk.model.api.SystemInfo; import org.openhab.binding.jellyfin.internal.JellyfinServerConfiguration; import org.openhab.binding.jellyfin.internal.discovery.JellyfinClientDiscoveryService; import org.openhab.binding.jellyfin.internal.util.EmptySyncResponse; @@ -65,14 +42,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.ktor.http.URLBuilder; -import io.ktor.http.URLProtocol; - /** * The {@link JellyfinServerHandler} is responsible for handling commands, which are * sent to one of the channels. * * @author Miguel Álvarez - Initial contribution + * @author Patrik Gfeller - Refactoring to avoid the use of the Android SDK + * */ @NonNullByDefault public class JellyfinServerHandler extends BaseBridgeHandler { @@ -87,7 +63,7 @@ public JellyfinServerHandler(Bridge bridge) { super(bridge); var options = new JellyfinOptions.Builder(); options.setClientInfo(new ClientInfo("openHAB", OpenHAB.getVersion())); - options.setDeviceInfo(new org.jellyfin.sdk.model.DeviceInfo(getThing().getUID().getId(), "openHAB")); + options.setDeviceInfo(new DeviceInfo(getThing().getUID().getId(), "openHAB")); jellyApiClient = new Jellyfin(options.build()).createApi(); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java new file mode 100644 index 0000000000000..de810f4206cee --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.handler; + +import java.util.Map; +import java.util.concurrent.ScheduledFuture; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.jellyfin.internal.types.JellyfinExceptionHandler; +import org.openhab.core.thing.Bridge; +import org.openhab.core.thing.ChannelUID; +import org.openhab.core.thing.binding.BaseBridgeHandler; +import org.openhab.core.types.Command; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link ServerHandler} is responsible for handling commands, which + * are sent to one of the channels. + * + * @author Miguel Álvarez - Initial contribution + * @author Patrik Gfeller - Adjustments to work independently of the Android SDK + * and respective runtime + * + */ +@NonNullByDefault +public class ServerHandler extends BaseBridgeHandler { + private final Logger logger = LoggerFactory.getLogger(ServerHandler.class); + private final ExceptionHandler exceptionHandler; + + public static class TASKS { + public static final String CONNECT = "Connect"; + public static final String REGISTER = "Registration"; + public static final String POLL = "Update"; + + public static Map delays = Map.ofEntries(Map.entry(TASKS.CONNECT, 0), + Map.entry(TASKS.REGISTER, 5), Map.entry(TASKS.POLL, 10)); + public static Map intervals = Map.ofEntries(Map.entry(TASKS.CONNECT, 10), + Map.entry(TASKS.REGISTER, 1), Map.entry(TASKS.POLL, 10)); + } + + /** + * Exception handler implementation + * + * @author Patrik Gfeller - Initial contribution + */ + private class ExceptionHandler implements JellyfinExceptionHandler { + private final ServerHandler handler; + + private ExceptionHandler(ServerHandler handler) { + this.handler = handler; + } + + @Override + public void handle(Exception exception) { + } + } + + public ServerHandler(Bridge bridge) { + super(bridge); + + this.exceptionHandler = new ExceptionHandler(this); + } + + @Override + public void initialize() { + try { + scheduler.execute(initializeHandler()); + } catch (Exception e) { + this.logger.warn("{}", e.getMessage()); + } + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + } + + @Override + public void dispose() { + super.dispose(); + } + + private synchronized Runnable initializeHandler() { + return () -> { + this.stopTasks(); + this.startTasks(); + }; + } + + private synchronized void stopTasks() { + } + + private synchronized void startTasks() { + } + + private synchronized void stopTask(@Nullable ScheduledFuture task) { + if (task == null || task.isCancelled() || task.isDone()) { + return; + } + + task.cancel(true); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/i18n/ResourceHelper.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/i18n/ResourceHelper.java new file mode 100644 index 0000000000000..206e60ab810ae --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/i18n/ResourceHelper.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.i18n; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.i18n.TranslationProvider; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; +import org.osgi.framework.ServiceReference; + +/** + * + * @author Patrik Gfeller - Initial Contribution + */ +@NonNullByDefault +public class ResourceHelper { + private static final BundleContext BUNDLE_CONTEXT = FrameworkUtil.getBundle(ResourceHelper.class) + .getBundleContext(); + private static final ServiceReference SERVICE_REFERENCE = BUNDLE_CONTEXT + .getServiceReference(TranslationProvider.class); + private static final Bundle BUNDLE = BUNDLE_CONTEXT.getBundle(); + private static final TranslationProvider TRANSLATION_PROVIDER = BUNDLE_CONTEXT.getService(SERVICE_REFERENCE); + + public static String getResourceString(String key) { + String lookupKey = key.replace("@text/", ""); + + String missingKey = "Missing Translation: " + key; + + var localizedString = TRANSLATION_PROVIDER.getText(BUNDLE, lookupKey, missingKey, null); + + return localizedString == null ? missingKey : localizedString; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/servlet/JellyfinBridgeServlet.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/servlet/JellyfinBridgeServlet.java deleted file mode 100644 index ddcf4b9906f15..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/servlet/JellyfinBridgeServlet.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.servlet; - -import java.io.IOException; - -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.jellyfin.sdk.api.client.exception.ApiClientException; -import org.jetbrains.annotations.NotNull; -import org.openhab.binding.jellyfin.internal.handler.JellyfinServerHandler; -import org.openhab.binding.jellyfin.internal.util.SyncCallback; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The {@link JellyfinBridgeServlet} is responsible for handling user login. - * - * @author Miguel Álvarez - Initial contribution - */ -@NonNullByDefault -public class JellyfinBridgeServlet extends HttpServlet { - private final Logger logger = LoggerFactory.getLogger(JellyfinBridgeServlet.class); - private static final long serialVersionUID = 2157912759968949550L; - private final JellyfinServerHandler server; - - public JellyfinBridgeServlet(JellyfinServerHandler server) { - this.server = server; - } - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String requestUri = req.getRequestURI(); - if (requestUri == null) { - return; - } - String user = req.getParameter("username"); - String password = req.getParameter("password"); - if (user != null && password != null && !user.isBlank() && !password.isBlank()) { - try { - server.updateCredentials(server.login(user, password)); - } catch (SyncCallback.SyncCallbackError | ApiClientException e) { - logger.warn("Server error while login: {}", e.getMessage()); - } - } - String newUri = req.getServletPath() + "/"; - resp.sendRedirect(newUri); - } - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String requestUri = req.getRequestURI(); - if (requestUri == null) { - return; - } - String uri = requestUri.substring(this.getServletContext().getContextPath().length()); - logger.debug("doGet {}", uri); - if (!uri.endsWith("/")) { - String newUri = req.getServletPath() + "/"; - resp.sendRedirect(newUri); - return; - } - String serverUrl = server.getServerUrl(); - String label = server.getThing().getLabel(); - String serverName = label != null ? label : "Jellyfin Binding"; - boolean online = server.isOnline(); - boolean authenticated = online && server.isAuthenticated(); - String html = renderPage(serverUrl, serverName, online, authenticated); - resp.addHeader("content-type", "text/html;charset=UTF-8"); - try { - resp.getWriter().write(html); - } catch (IOException e) { - logger.warn("return html failed with uri syntax error", e); - } - } - - @NotNull - private String renderPage(String serverUrl, String serverName, boolean online, boolean authenticated) { - StringBuilder html = new StringBuilder(); - html.append("OpenHAB Jellyfin Binding"); - // open container - html.append("
"); - // add logos and title - html.append("

").append(serverName).append("

"); - if (online) { - if (!authenticated) { - // add form - html.append( - "
"); - } else { - html.append("

✅ Connected

"); - } - } else { - html.append("

❌ Offline

"); - } - // close container - html.append("
"); - // add server link - html.append(""); - html.append(""); - return html.toString(); - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/util/EmptySyncResponse.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/types/JellyfinExceptionHandler.java similarity index 62% rename from bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/util/EmptySyncResponse.java rename to bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/types/JellyfinExceptionHandler.java index 0ecbdc85e48a0..861e7eeb251fb 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/util/EmptySyncResponse.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/types/JellyfinExceptionHandler.java @@ -10,17 +10,16 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.openhab.binding.jellyfin.internal.util; +package org.openhab.binding.jellyfin.internal.types; import org.eclipse.jdt.annotation.NonNullByDefault; -import kotlin.Unit; - /** - * The {@link EmptySyncResponse} util to consume util to consume sdk api calls with no content. - * - * @author Miguel Álvarez - Initial contribution + * Marker interface for exception handler implementations + * + * @author Patrik Gfeller - Initial contribution */ @NonNullByDefault -public class EmptySyncResponse extends SyncResponse { +public interface JellyfinExceptionHandler { + void handle(Exception exception); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/util/SyncCallback.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/util/SyncCallback.java deleted file mode 100644 index fd37e2d565282..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/util/SyncCallback.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.util; - -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jdt.annotation.Nullable; -import org.jellyfin.sdk.compatibility.JavaContinuation; - -/** - * The {@link SyncCallback} util to consume kotlin suspend functions. - * - * @author Miguel Álvarez - Initial contribution - */ -@NonNullByDefault -public abstract class SyncCallback extends JavaContinuation<@Nullable T> { - private final CountDownLatch latch; - @Nullable - private T result; - @Nullable - private Throwable error; - - protected SyncCallback() { - latch = new CountDownLatch(1); - } - - @Override - public void onSuccess(@Nullable T result) { - this.result = result; - latch.countDown(); - } - - @Override - public void onError(@Nullable Throwable error) { - this.error = error; - latch.countDown(); - } - - public T awaitResult() throws SyncCallbackError { - return awaitResult(10); - } - - public T awaitResult(int timeoutSecs) throws SyncCallbackError { - try { - if (!latch.await(timeoutSecs, TimeUnit.SECONDS)) { - throw new SyncCallbackError("Execution timeout"); - } - } catch (InterruptedException e) { - throw new SyncCallbackError(e); - } - var error = this.error; - if (error != null) { - throw new SyncCallbackError(error); - } - var result = this.result; - if (result == null) { - throw new SyncCallbackError("Missing result"); - } - return result; - } - - public static class SyncCallbackError extends Exception { - private static final long serialVersionUID = 2157912759968949551L; - - protected SyncCallbackError(String message) { - super(message); - } - - protected SyncCallbackError(Throwable original) { - super(original); - } - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/util/SyncResponse.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/util/SyncResponse.java deleted file mode 100644 index c2fd6ba062aa6..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/util/SyncResponse.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.util; - -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.jellyfin.sdk.api.client.Response; -import org.jellyfin.sdk.api.client.exception.ApiClientException; - -/** - * The {@link SyncResponse} util to consume sdk api calls. - * - * @author Miguel Álvarez - Initial contribution - */ -@NonNullByDefault -public class SyncResponse extends SyncCallback> { - public Response awaitResponse() throws ApiClientException, SyncCallbackError { - try { - return awaitResult(); - } catch (SyncCallbackError e) { - var cause = e.getCause(); - if (cause instanceof ApiClientException apiClientException) { - throw apiClientException; - } - throw e; - } - } - - public T awaitContent() throws ApiClientException, SyncCallbackError { - var responseContent = awaitResponse().getContent(); - if (responseContent == null) { - throw new SyncCallbackError("Missing content"); - } - return responseContent; - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/i18n/jellyfin.properties b/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/i18n/jellyfin.properties index fe1ad084aef3f..2c7e447d6a8c2 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/i18n/jellyfin.properties +++ b/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/i18n/jellyfin.properties @@ -16,10 +16,10 @@ thing-type.config.jellyfin.server.clientActiveWithInSeconds.label = Client Activ thing-type.config.jellyfin.server.clientActiveWithInSeconds.description = Amount off seconds allowed since the last client activity to assert it's online (0 disabled) thing-type.config.jellyfin.server.hostname.label = Hostname/IP thing-type.config.jellyfin.server.hostname.description = Hostname or IP address of the server -thing-type.config.jellyfin.server.port.label = Port -thing-type.config.jellyfin.server.port.description = Port of the server thing-type.config.jellyfin.server.path.label = Base Path thing-type.config.jellyfin.server.path.description = Base path of the server +thing-type.config.jellyfin.server.port.label = Port +thing-type.config.jellyfin.server.port.description = Port of the server thing-type.config.jellyfin.server.refreshSeconds.label = Refresh Seconds thing-type.config.jellyfin.server.refreshSeconds.description = Interval to pull devices state from the server thing-type.config.jellyfin.server.ssl.label = SSL diff --git a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/environment.ini b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/environment.ini new file mode 100644 index 0000000000000..344869b4fd4fb --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/environment.ini @@ -0,0 +1 @@ +JAVA_POST_PROCESS_FILE=/usr/local/bin/clang-format -i diff --git a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/generate.sh b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/generate.sh new file mode 100755 index 0000000000000..15e508df368d2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/generate.sh @@ -0,0 +1,134 @@ +#!/usr/bin/bash + +if [[ "${1:-}" == "--debug" ]]; then + set -x +fi + +set -euo pipefail + +# INFO: +# If you generate the API on a windows system using git bash some additional software is required: +# +# > winget install GNU.Wget2 --silent +# > winget install MikeFarah.yq --silent +# > winget install jqlang.jq --silent + +# improve compatibility with windows systems (using git bash) +export MSYS_NO_PATHCONV=1 +if ! type wget &>/dev/null; then + alias wget=wget2 +fi + +REQUIRED=("wget" "yq" "docker" "curl" "jq" "awk" "sed" "grep" "sort" "tail" "mvn" "docker" "npm") + +function checkEnvironment() { + for i in "${REQUIRED[@]}"; do + if ! type $i &>/dev/null; then + echo "⚠️ [${i}] could not be found" + exit 127 + fi + done +} + +checkEnvironment + +# Get the latest stable release tag from GitHub for openapi-generator +LATEST_OPENAPI_GENERATOR_CLI_TAG=$(curl -s "https://api.github.com/repos/OpenAPITools/openapi-generator/releases/latest" | + jq -r '.tag_name' | + sed 's/^v//') + +echo -e "ℹ️ - Latest openapi-generator-cli version: \033[1m$LATEST_OPENAPI_GENERATOR_CLI_TAG\033[0m" + +DOCKER_IMAGE_OPENAPI="openapitools/openapi-generator-cli:v${LATEST_OPENAPI_GENERATOR_CLI_TAG}" + +if docker images --format '{{.Repository}}:{{.Tag}}' | grep -q "^openapitools/openapi-generator-cli:v${LATEST_OPENAPI_GENERATOR_CLI_TAG}$"; then + echo "ℹ️ - Local docker image found" +else + echo "ℹ️ - Get openAPI builder docker image for version ${LATEST_OPENAPI_GENERATOR_CLI_TAG}" + docker pull $DOCKER_IMAGE_OPENAPI +fi + +LATEST=$(curl -sL https://repo.jellyfin.org/releases/openapi/jellyfin-openapi-stable.json | jq -r .info.version) +echo -e "ℹ️ - Latest stable Jellyfin API - Version: \033[1m${LATEST}\033[0m" + +# VERSIONS=("10.8.13" "10.10.7") +# VERSION_ALIAS=("legacy" "current") +VERSIONS=("10.10.7") +VERSION_ALIAS=("current") + + +DOCKER_VOLUME_WORK="/work" + +ROOT=$(pwd) + +OPENAPI_JAVA_CONFIG="tools/generate-sources/scripts/java.config.json" +OPENAPI_SPECIFICATION_DIR="tools/generate-sources/scripts/specifications" +FILENAME_ENDPOINTS=logs/endpoints/${i}.txt + +if ! npx list openapi-filter &>/dev/null; then + echo "ℹ️ - Installing openapi-filter@3.2.3" + npm install --save-dev --no-audit --no-fund openapi-filter@3.2.3 1>/dev/null || { + echo "❌ Error: Failed to install openapi-filter" + exit 1 + } +fi + +OUTPUT=. + +INDEX=0 +for i in "${VERSIONS[@]}"; do + ALIAS=${VERSION_ALIAS[INDEX++]} + PACKAGE=org.openhab.binding.jellyfin.internal.api.generated.${ALIAS} + PACKAGE_API=$PACKAGE + PACKAGE_MODEL=$PACKAGE.model + + echo -e " ➡️ generating API Version $i as \033[1m${ALIAS}\033[0m: ${PACKAGE_API}" + + FILENAME_JSON=${ROOT}/${OPENAPI_SPECIFICATION_DIR}/json/jellyfin-openapi-${i}.json + FILENAME_YAML=${ROOT}/${OPENAPI_SPECIFICATION_DIR}/yaml/jellyfin-openapi-${i}.yaml + + mkdir -p logs/endpoints + jq ".paths | to_entries[] | {path: .key, methods: (.value | keys)}" ${FILENAME_JSON} | grep \"path\" >logs/endpoints/${i}.txt + + if [ ! -e "${FILENAME_JSON}" ]; then + echo " ⏬ - Downloading OPENAPI definition for Version ${i}" + + URL=https://repo.jellyfin.org/files/openapi/stable/jellyfin-openapi-${i}.json + + wget \ + --no-verbose \ + --output-document=${FILENAME_JSON} \ + ${URL} || { + rm ${FILENAME_JSON} + echo " ❌ Error: Failed to download API definition from ${URL}" + exit 1 + } + fi + + if [ ! -e "${FILENAME_YAML}" ]; then + echo "⚙️: json ➡️ yaml" + + yq -oy ${FILENAME_JSON} >${FILENAME_YAML} + fi + + docker run --rm --interactive \ + --user $(id -u):$(id -g) \ + --volume ${ROOT}:${DOCKER_VOLUME_WORK} \ + --workdir ${DOCKER_VOLUME_WORK} \ + --env JAVA_POST_PROCESS_FILE=/usr/local/bin/clang-format -i \ + $DOCKER_IMAGE_OPENAPI generate \ + --generator-name java \ + --global-property apiDocs=false,modelDocs=false,apiTests=false,modelTests=false \ + --api-package ${PACKAGE_API} \ + --model-package ${PACKAGE_MODEL} \ + --config ${OPENAPI_JAVA_CONFIG} \ + --input-spec ${OPENAPI_SPECIFICATION_DIR}/yaml/jellyfin-openapi-${i}.yaml -o ${OUTPUT} \ + >/dev/null +done + +cd ${ROOT} + +MVN_OPT="--quiet" +echo "" +echo "🧹 apply formatting to generated code" +mvn spotless:apply $MVN_OPT diff --git a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/java.config.json b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/java.config.json new file mode 100644 index 0000000000000..b2f8824202764 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/java.config.json @@ -0,0 +1,19 @@ +{ + "annotationLibrary": "none", + "library": "native", + "dateLibrary": "java8", + "serializationLibrary": "jackson", + "developerEmail": "patrik.gfeller@gmail.com", + "developerName": "Patrik Gfeller", + "developerOrganization": "openHAB project", + "developerOrganizationUrl": "https://www.openhab.org", + "documentationProvider": "none", + "failOnUnknownProperties": false, + "generateBuilders": true, + "generatedAnnotation": false, + "hideGenerationTimestamp": true, + "ignoreAnyOfInEnum": true, + "openApiNullable": false, + "templateDir": "tools/generate-sources/scripts/templates", + "outputEncoding": "UTF-8" +} \ No newline at end of file diff --git a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/json/jellyfin-openapi-10.10.7.json b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/json/jellyfin-openapi-10.10.7.json new file mode 100644 index 0000000000000..b38dcb7f467c2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/json/jellyfin-openapi-10.10.7.json @@ -0,0 +1,59316 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Jellyfin API", + "version": "10.10.7", + "x-jellyfin-version": "10.10.7" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/System/ActivityLog/Entries": { + "get": { + "tags": [ + "ActivityLog" + ], + "summary": "Gets activity log entries.", + "operationId": "GetLogEntries", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minDate", + "in": "query", + "description": "Optional. The minimum date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasUserId", + "in": "query", + "description": "Optional. Filter log entries if it has user id, or not.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Activity log returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActivityLogEntryQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ActivityLogEntryQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ActivityLogEntryQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Auth/Keys": { + "get": { + "tags": [ + "ApiKey" + ], + "summary": "Get all keys.", + "operationId": "GetKeys", + "responses": { + "200": { + "description": "Api keys retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationInfoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationInfoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationInfoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "ApiKey" + ], + "summary": "Create a new api key.", + "operationId": "CreateKey", + "parameters": [ + { + "name": "app", + "in": "query", + "description": "Name of the app using the authentication key.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Api key created." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Auth/Keys/{key}": { + "delete": { + "tags": [ + "ApiKey" + ], + "summary": "Remove an api key.", + "operationId": "RevokeKey", + "parameters": [ + { + "name": "key", + "in": "path", + "description": "The access token to delete.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Api key deleted." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Artists": { + "get": { + "tags": [ + "Artists" + ], + "summary": "Gets all artists from a given item, folder, or the entire library.", + "operationId": "GetArtists", + "parameters": [ + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Artists returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/{name}": { + "get": { + "tags": [ + "Artists" + ], + "summary": "Gets an artist by name.", + "operationId": "GetArtistByName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Artist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/AlbumArtists": { + "get": { + "tags": [ + "Artists" + ], + "summary": "Gets all album artists from a given item, folder, or the entire library.", + "operationId": "GetAlbumArtists", + "parameters": [ + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Album artists returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/stream": { + "get": { + "tags": [ + "Audio" + ], + "summary": "Gets an audio stream.", + "operationId": "GetAudioStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The audio container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "head": { + "tags": [ + "Audio" + ], + "summary": "Gets an audio stream.", + "operationId": "HeadAudioStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The audio container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/Audio/{itemId}/stream.{container}": { + "get": { + "tags": [ + "Audio" + ], + "summary": "Gets an audio stream.", + "operationId": "GetAudioStreamByContainer", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "path", + "description": "The audio container.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamporphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "head": { + "tags": [ + "Audio" + ], + "summary": "Gets an audio stream.", + "operationId": "HeadAudioStreamByContainer", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "path", + "description": "The audio container.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamporphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/Branding/Configuration": { + "get": { + "tags": [ + "Branding" + ], + "summary": "Gets branding configuration.", + "operationId": "GetBrandingOptions", + "responses": { + "200": { + "description": "Branding configuration returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BrandingOptions" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BrandingOptions" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BrandingOptions" + } + } + } + } + } + } + }, + "/Branding/Css": { + "get": { + "tags": [ + "Branding" + ], + "summary": "Gets branding css.", + "operationId": "GetBrandingCss", + "responses": { + "200": { + "description": "Branding css returned.", + "content": { + "text/css": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + }, + "204": { + "description": "No branding css configured." + } + } + } + }, + "/Branding/Css.css": { + "get": { + "tags": [ + "Branding" + ], + "summary": "Gets branding css.", + "operationId": "GetBrandingCss_2", + "responses": { + "200": { + "description": "Branding css returned.", + "content": { + "text/css": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + }, + "204": { + "description": "No branding css configured." + } + } + } + }, + "/Channels": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Gets available channels.", + "operationId": "GetChannels", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User Id to filter by. Use System.Guid.Empty to not filter by user.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "supportsLatestItems", + "in": "query", + "description": "Optional. Filter by channels that support getting latest items.", + "schema": { + "type": "boolean" + } + }, + { + "name": "supportsMediaDeletion", + "in": "query", + "description": "Optional. Filter by channels that support media deletion.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional. Filter by channels that are favorite.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Channels returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Channels/{channelId}/Features": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Get channel features.", + "operationId": "GetChannelFeatures", + "parameters": [ + { + "name": "channelId", + "in": "path", + "description": "Channel id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Channel features returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChannelFeatures" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ChannelFeatures" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ChannelFeatures" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Channels/{channelId}/Items": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Get channel items.", + "operationId": "GetChannelItems", + "parameters": [ + { + "name": "channelId", + "in": "path", + "description": "Channel Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "folderId", + "in": "query", + "description": "Optional. Folder Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Channel items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Channels/Features": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Get all channel features.", + "operationId": "GetAllChannelFeatures", + "responses": { + "200": { + "description": "All channel features returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelFeatures" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelFeatures" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelFeatures" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Channels/Items/Latest": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Gets latest channel items.", + "operationId": "GetLatestChannelItems", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "channelIds", + "in": "query", + "description": "Optional. Specify one or more channel id's, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "200": { + "description": "Latest channel items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/ClientLog/Document": { + "post": { + "tags": [ + "ClientLog" + ], + "summary": "Upload a document.", + "operationId": "LogFile", + "requestBody": { + "content": { + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "200": { + "description": "Document saved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientLogDocumentResponseDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ClientLogDocumentResponseDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ClientLogDocumentResponseDto" + } + } + } + }, + "403": { + "description": "Event logging disabled.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "413": { + "description": "Upload size too large.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Collections": { + "post": { + "tags": [ + "Collection" + ], + "summary": "Creates a new collection.", + "operationId": "CreateCollection", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the collection.", + "schema": { + "type": "string" + } + }, + { + "name": "ids", + "in": "query", + "description": "Item Ids to add to the collection.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Create the collection within a specific folder.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isLocked", + "in": "query", + "description": "Whether or not to lock the new collection.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Collection created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionCreationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/CollectionCreationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/CollectionCreationResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "CollectionManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Collections/{collectionId}/Items": { + "post": { + "tags": [ + "Collection" + ], + "summary": "Adds items to a collection.", + "operationId": "AddToCollection", + "parameters": [ + { + "name": "collectionId", + "in": "path", + "description": "The collection id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ids", + "in": "query", + "description": "Item ids, comma delimited.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "204": { + "description": "Items added to collection." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "CollectionManagement", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Collection" + ], + "summary": "Removes items from a collection.", + "operationId": "RemoveFromCollection", + "parameters": [ + { + "name": "collectionId", + "in": "path", + "description": "The collection id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ids", + "in": "query", + "description": "Item ids, comma delimited.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "204": { + "description": "Items removed from collection." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "CollectionManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Configuration": { + "get": { + "tags": [ + "Configuration" + ], + "summary": "Gets application configuration.", + "operationId": "GetConfiguration", + "responses": { + "200": { + "description": "Application configuration returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServerConfiguration" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ServerConfiguration" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ServerConfiguration" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Configuration" + ], + "summary": "Updates application configuration.", + "operationId": "UpdateConfiguration", + "requestBody": { + "description": "Configuration.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServerConfiguration" + } + ], + "description": "Represents the server configuration." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServerConfiguration" + } + ], + "description": "Represents the server configuration." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServerConfiguration" + } + ], + "description": "Represents the server configuration." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Configuration updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Configuration/{key}": { + "get": { + "tags": [ + "Configuration" + ], + "summary": "Gets a named configuration.", + "operationId": "GetNamedConfiguration", + "parameters": [ + { + "name": "key", + "in": "path", + "description": "Configuration key.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Configuration returned.", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Configuration" + ], + "summary": "Updates named configuration.", + "operationId": "UpdateNamedConfiguration", + "parameters": [ + { + "name": "key", + "in": "path", + "description": "Configuration key.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Configuration.", + "content": { + "application/json": { + "schema": {} + }, + "text/json": { + "schema": {} + }, + "application/*+json": { + "schema": {} + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Named configuration updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Configuration/MetadataOptions/Default": { + "get": { + "tags": [ + "Configuration" + ], + "summary": "Gets a default MetadataOptions object.", + "operationId": "GetDefaultMetadataOptions", + "responses": { + "200": { + "description": "Metadata options returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataOptions" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/MetadataOptions" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/MetadataOptions" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/web/ConfigurationPage": { + "get": { + "tags": [ + "Dashboard" + ], + "summary": "Gets a dashboard configuration page.", + "operationId": "GetDashboardConfigurationPage", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the page.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "ConfigurationPage returned.", + "content": { + "text/html": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/x-javascript": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Plugin configuration page not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/web/ConfigurationPages": { + "get": { + "tags": [ + "Dashboard" + ], + "summary": "Gets the configuration pages.", + "operationId": "GetConfigurationPages", + "parameters": [ + { + "name": "enableInMainMenu", + "in": "query", + "description": "Whether to enable in the main menu.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "ConfigurationPages returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigurationPageInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigurationPageInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigurationPageInfo" + } + } + } + } + }, + "404": { + "description": "Server still loading.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Devices": { + "get": { + "tags": [ + "Devices" + ], + "summary": "Get Devices.", + "operationId": "GetDevices", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Gets or sets the user identifier.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Devices retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "Devices" + ], + "summary": "Deletes a device.", + "operationId": "DeleteDevice", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Device Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Device deleted." + }, + "404": { + "description": "Device not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Devices/Info": { + "get": { + "tags": [ + "Devices" + ], + "summary": "Get info for a device.", + "operationId": "GetDeviceInfo", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Device Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Device info retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDto" + } + } + } + }, + "404": { + "description": "Device not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Devices/Options": { + "get": { + "tags": [ + "Devices" + ], + "summary": "Get options for a device.", + "operationId": "GetDeviceOptions", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Device Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Device options retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + } + } + }, + "404": { + "description": "Device not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Devices" + ], + "summary": "Update device options.", + "operationId": "UpdateDeviceOptions", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Device Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Device Options.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + ], + "description": "A dto representing custom options for a device." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + ], + "description": "A dto representing custom options for a device." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + ], + "description": "A dto representing custom options for a device." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Device options updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/DisplayPreferences/{displayPreferencesId}": { + "get": { + "tags": [ + "DisplayPreferences" + ], + "summary": "Get Display Preferences.", + "operationId": "GetDisplayPreferences", + "parameters": [ + { + "name": "displayPreferencesId", + "in": "path", + "description": "Display preferences id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "client", + "in": "query", + "description": "Client.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Display preferences retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "DisplayPreferences" + ], + "summary": "Update Display Preferences.", + "operationId": "UpdateDisplayPreferences", + "parameters": [ + { + "name": "displayPreferencesId", + "in": "path", + "description": "Display preferences id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "client", + "in": "query", + "description": "Client.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "New Display Preferences object.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + ], + "description": "Defines the display preferences for any item that supports them (usually Folders)." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + ], + "description": "Defines the display preferences for any item that supports them (usually Folders)." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + ], + "description": "Defines the display preferences for any item that supports them (usually Folders)." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Display preferences updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/hls1/{playlistId}/{segmentId}.{container}": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video stream using HTTP live streaming.", + "operationId": "GetHlsAudioSegment", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "container", + "in": "path", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "runtimeTicks", + "in": "query", + "description": "The position of the requested segment in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "actualSegmentLengthTicks", + "in": "query", + "description": "The length of the requested segment in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/main.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets an audio stream using HTTP live streaming.", + "operationId": "GetVariantHlsAudioPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/master.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets an audio hls playlist stream.", + "operationId": "GetMasterHlsAudioPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAdaptiveBitrateStreaming", + "in": "query", + "description": "Enable adaptive bitrate streaming.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "head": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets an audio hls playlist stream.", + "operationId": "HeadMasterHlsAudioPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAdaptiveBitrateStreaming", + "in": "query", + "description": "Enable adaptive bitrate streaming.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/hls1/{playlistId}/{segmentId}.{container}": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video stream using HTTP live streaming.", + "operationId": "GetHlsVideoSegment", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "container", + "in": "path", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "runtimeTicks", + "in": "query", + "description": "The position of the requested segment in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "actualSegmentLengthTicks", + "in": "query", + "description": "The length of the requested segment in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The desired segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Whether to always burn in subtitles when transcoding.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/live.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a hls live stream.", + "operationId": "GetLiveHlsStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The audio container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The max width.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The max height.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableSubtitlesInManifest", + "in": "query", + "description": "Optional. Whether to enable subtitles in the manifest.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Whether to always burn in subtitles when transcoding.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Hls live stream retrieved.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/main.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video stream using HTTP live streaming.", + "operationId": "GetVariantHlsVideoPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Whether to always burn in subtitles when transcoding.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/master.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video hls playlist stream.", + "operationId": "GetMasterHlsVideoPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAdaptiveBitrateStreaming", + "in": "query", + "description": "Enable adaptive bitrate streaming.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTrickplay", + "in": "query", + "description": "Enable trickplay image playlists being added to master playlist.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Whether to always burn in subtitles when transcoding.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "head": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video hls playlist stream.", + "operationId": "HeadMasterHlsVideoPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAdaptiveBitrateStreaming", + "in": "query", + "description": "Enable adaptive bitrate streaming.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTrickplay", + "in": "query", + "description": "Enable trickplay image playlists being added to master playlist.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Whether to always burn in subtitles when transcoding.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/DefaultDirectoryBrowser": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Get Default directory browser.", + "operationId": "GetDefaultDirectoryBrowser", + "responses": { + "200": { + "description": "Default directory browser returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultDirectoryBrowserInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DefaultDirectoryBrowserInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DefaultDirectoryBrowserInfoDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/DirectoryContents": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Gets the contents of a given directory in the file system.", + "operationId": "GetDirectoryContents", + "parameters": [ + { + "name": "path", + "in": "query", + "description": "The path.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "includeFiles", + "in": "query", + "description": "An optional filter to include or exclude files from the results. true/false.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "includeDirectories", + "in": "query", + "description": "An optional filter to include or exclude folders from the results. true/false.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Directory contents returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/Drives": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Gets available drives from the server's file system.", + "operationId": "GetDrives", + "responses": { + "200": { + "description": "List of entries returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/NetworkShares": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Gets network paths.", + "operationId": "GetNetworkShares", + "responses": { + "200": { + "description": "Empty array returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/ParentPath": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Gets the parent path of a given path.", + "operationId": "GetParentPath", + "parameters": [ + { + "name": "path", + "in": "query", + "description": "The path.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/ValidatePath": { + "post": { + "tags": [ + "Environment" + ], + "summary": "Validates path.", + "operationId": "ValidatePath", + "requestBody": { + "description": "Validate request object.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatePathDto" + } + ], + "description": "Validate path object." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatePathDto" + } + ], + "description": "Validate path object." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatePathDto" + } + ], + "description": "Validate path object." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Path validated." + }, + "404": { + "description": "Path not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Filters": { + "get": { + "tags": [ + "Filter" + ], + "summary": "Gets legacy query filters.", + "operationId": "GetQueryFiltersLegacy", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Parent id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional. Filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + } + ], + "responses": { + "200": { + "description": "Legacy filters retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueryFiltersLegacy" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/QueryFiltersLegacy" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/QueryFiltersLegacy" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Filters2": { + "get": { + "tags": [ + "Filter" + ], + "summary": "Gets query filters.", + "operationId": "GetQueryFilters", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isAiring", + "in": "query", + "description": "Optional. Is item airing.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Is item movie.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Is item sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Is item kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Is item news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Is item series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "recursive", + "in": "query", + "description": "Optional. Search recursive.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Filters retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueryFilters" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/QueryFilters" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/QueryFilters" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Genres": { + "get": { + "tags": [ + "Genres" + ], + "summary": "Gets all genres from a given item, folder, or the entire library.", + "operationId": "GetGenres", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Include total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Genres returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Genres/{genreName}": { + "get": { + "tags": [ + "Genres" + ], + "summary": "Gets a genre, by name.", + "operationId": "GetGenre", + "parameters": [ + { + "name": "genreName", + "in": "path", + "description": "The genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Genres returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/hls/{segmentId}/stream.aac": { + "get": { + "tags": [ + "HlsSegment" + ], + "summary": "Gets the specified audio segment for an audio item.", + "operationId": "GetHlsAudioSegmentLegacyAac", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Hls audio segment returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/Audio/{itemId}/hls/{segmentId}/stream.mp3": { + "get": { + "tags": [ + "HlsSegment" + ], + "summary": "Gets the specified audio segment for an audio item.", + "operationId": "GetHlsAudioSegmentLegacyMp3", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Hls audio segment returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/Videos/{itemId}/hls/{playlistId}/{segmentId}.{segmentContainer}": { + "get": { + "tags": [ + "HlsSegment" + ], + "summary": "Gets a hls video segment.", + "operationId": "GetHlsVideoSegmentLegacy", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "path", + "description": "The segment container.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Hls video segment returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Hls segment not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Videos/{itemId}/hls/{playlistId}/stream.m3u8": { + "get": { + "tags": [ + "HlsSegment" + ], + "summary": "Gets a hls video playlist.", + "operationId": "GetHlsPlaylistLegacy", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The video id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Hls video playlist returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/ActiveEncodings": { + "delete": { + "tags": [ + "HlsSegment" + ], + "summary": "Stops an active encoding.", + "operationId": "StopEncodingProcess", + "parameters": [ + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Encoding stopped successfully." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get artist image by name.", + "operationId": "GetArtistImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Artist name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get artist image by name.", + "operationId": "HeadArtistImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Artist name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Branding/Splashscreen": { + "get": { + "tags": [ + "Image" + ], + "summary": "Generates or gets the splashscreen.", + "operationId": "GetSplashscreen", + "parameters": [ + { + "name": "tag", + "in": "query", + "description": "Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "quality", + "in": "query", + "description": "Quality setting, from 0-100.", + "schema": { + "maximum": 100, + "minimum": 0, + "type": "integer", + "format": "int32", + "default": 90 + } + } + ], + "responses": { + "200": { + "description": "Splashscreen returned successfully.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "post": { + "tags": [ + "Image" + ], + "summary": "Uploads a custom splashscreen.\r\nThe body is expected to the image contents base64 encoded.", + "operationId": "UploadCustomSplashscreen", + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Successfully uploaded new splashscreen." + }, + "400": { + "description": "Error reading MimeType from uploaded image.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User does not have permission to upload splashscreen..", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete a custom splashscreen.", + "operationId": "DeleteCustomSplashscreen", + "responses": { + "204": { + "description": "Successfully deleted the custom splashscreen." + }, + "403": { + "description": "User does not have permission to delete splashscreen.." + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Genres/{name}/Images/{imageType}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get genre image by name.", + "operationId": "GetGenreImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get genre image by name.", + "operationId": "HeadGenreImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Genres/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get genre image by name.", + "operationId": "GetGenreImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get genre image by name.", + "operationId": "HeadGenreImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Items/{itemId}/Images": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get item image infos.", + "operationId": "GetItemImageInfos", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item images returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageInfo" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Images/{imageType}": { + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete an item's image.", + "operationId": "DeleteItemImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "The image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Image deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Image" + ], + "summary": "Set item image.", + "operationId": "SetItemImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + } + ], + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Image saved." + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "get": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "GetItemImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "HeadItemImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Items/{itemId}/Images/{imageType}/{imageIndex}": { + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete an item's image.", + "operationId": "DeleteItemImageByIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "The image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Image deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Image" + ], + "summary": "Set item image.", + "operationId": "SetItemImageByIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "(Unused) Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Image saved." + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "get": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "GetItemImageByIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "HeadItemImageByIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "GetItemImage2", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "maxWidth", + "in": "path", + "description": "The maximum image width to return.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "path", + "description": "The maximum image height to return.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "path", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "path", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "required": true, + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ], + "description": "Enum ImageOutputFormat." + } + }, + { + "name": "percentPlayed", + "in": "path", + "description": "Optional. Percent to render for the percent played overlay.", + "required": true, + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "path", + "description": "Optional. Unplayed count overlay to render.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "HeadItemImage2", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "maxWidth", + "in": "path", + "description": "The maximum image width to return.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "path", + "description": "The maximum image height to return.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "path", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "path", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "required": true, + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ], + "description": "Enum ImageOutputFormat." + } + }, + { + "name": "percentPlayed", + "in": "path", + "description": "Optional. Percent to render for the percent played overlay.", + "required": true, + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "path", + "description": "Optional. Unplayed count overlay to render.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Items/{itemId}/Images/{imageType}/{imageIndex}/Index": { + "post": { + "tags": [ + "Image" + ], + "summary": "Updates the index for an item image.", + "operationId": "UpdateItemImageIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Old image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "newIndex", + "in": "query", + "description": "New image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Image index updated." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/MusicGenres/{name}/Images/{imageType}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get music genre image by name.", + "operationId": "GetMusicGenreImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Music genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get music genre image by name.", + "operationId": "HeadMusicGenreImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Music genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/MusicGenres/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get music genre image by name.", + "operationId": "GetMusicGenreImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Music genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get music genre image by name.", + "operationId": "HeadMusicGenreImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Music genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Persons/{name}/Images/{imageType}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get person image by name.", + "operationId": "GetPersonImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get person image by name.", + "operationId": "HeadPersonImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Persons/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get person image by name.", + "operationId": "GetPersonImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get person image by name.", + "operationId": "HeadPersonImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Studios/{name}/Images/{imageType}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get studio image by name.", + "operationId": "GetStudioImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get studio image by name.", + "operationId": "HeadStudioImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Studios/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get studio image by name.", + "operationId": "GetStudioImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get studio image by name.", + "operationId": "HeadStudioImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/UserImage": { + "post": { + "tags": [ + "Image" + ], + "summary": "Sets the user image.", + "operationId": "PostUserImage", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Image updated." + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User does not have permission to delete the image.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete the user's image.", + "operationId": "DeleteUserImage", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Image deleted." + }, + "403": { + "description": "User does not have permission to delete the image.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "get": { + "tags": [ + "Image" + ], + "summary": "Get user profile image.", + "operationId": "GetUserImage", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "400": { + "description": "User id not provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get user profile image.", + "operationId": "HeadUserImage", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "400": { + "description": "User id not provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Albums/{itemId}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given album.", + "operationId": "GetInstantMixFromAlbum", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/{itemId}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given artist.", + "operationId": "GetInstantMixFromArtists", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given artist.", + "operationId": "GetInstantMixFromArtists2", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given item.", + "operationId": "GetInstantMixFromItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MusicGenres/{name}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given genre.", + "operationId": "GetInstantMixFromMusicGenreByName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MusicGenres/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given genre.", + "operationId": "GetInstantMixFromMusicGenreById", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{itemId}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given playlist.", + "operationId": "GetInstantMixFromPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Songs/{itemId}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given song.", + "operationId": "GetInstantMixFromSong", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ExternalIdInfos": { + "get": { + "tags": [ + "ItemLookup" + ], + "summary": "Get the item's external id info.", + "operationId": "GetExternalIdInfos", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "External id info retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalIdInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalIdInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalIdInfo" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Apply/{itemId}": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Applies search criteria to an item and refreshes metadata.", + "operationId": "ApplySearchCriteria", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "replaceAllImages", + "in": "query", + "description": "Optional. Whether or not to replace all images. Default: True.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "requestBody": { + "description": "The remote search result.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoteSearchResult" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoteSearchResult" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoteSearchResult" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Item metadata refreshed." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Book": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get book remote search.", + "operationId": "GetBookRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BookInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BookInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BookInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Book remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/BoxSet": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get box set remote search.", + "operationId": "GetBoxSetRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BoxSetInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BoxSetInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BoxSetInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Box set remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Movie": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get movie remote search.", + "operationId": "GetMovieRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovieInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovieInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovieInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Movie remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/MusicAlbum": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get music album remote search.", + "operationId": "GetMusicAlbumRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AlbumInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AlbumInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AlbumInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Music album remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/MusicArtist": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get music artist remote search.", + "operationId": "GetMusicArtistRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ArtistInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ArtistInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ArtistInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Music artist remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/MusicVideo": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get music video remote search.", + "operationId": "GetMusicVideoRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MusicVideoInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MusicVideoInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MusicVideoInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Music video remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Person": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get person remote search.", + "operationId": "GetPersonRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PersonLookupInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PersonLookupInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PersonLookupInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Person remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Series": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get series remote search.", + "operationId": "GetSeriesRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Series remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Trailer": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get trailer remote search.", + "operationId": "GetTrailerRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TrailerInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TrailerInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TrailerInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Trailer remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Refresh": { + "post": { + "tags": [ + "ItemRefresh" + ], + "summary": "Refreshes metadata for an item.", + "operationId": "RefreshItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "metadataRefreshMode", + "in": "query", + "description": "(Optional) Specifies the metadata refresh mode.", + "schema": { + "enum": [ + "None", + "ValidationOnly", + "Default", + "FullRefresh" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MetadataRefreshMode" + } + ], + "default": "None" + } + }, + { + "name": "imageRefreshMode", + "in": "query", + "description": "(Optional) Specifies the image refresh mode.", + "schema": { + "enum": [ + "None", + "ValidationOnly", + "Default", + "FullRefresh" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MetadataRefreshMode" + } + ], + "default": "None" + } + }, + { + "name": "replaceAllMetadata", + "in": "query", + "description": "(Optional) Determines if metadata should be replaced. Only applicable if mode is FullRefresh.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "replaceAllImages", + "in": "query", + "description": "(Optional) Determines if images should be replaced. Only applicable if mode is FullRefresh.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "regenerateTrickplay", + "in": "query", + "description": "(Optional) Determines if trickplay images should be replaced. Only applicable if mode is FullRefresh.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Item metadata refresh queued." + }, + "404": { + "description": "Item to refresh not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Items": { + "get": { + "tags": [ + "Items" + ], + "summary": "Gets items based on a query.", + "operationId": "GetItems", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id supplied as query parameter; this is required when not using an API key.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "maxOfficialRating", + "in": "query", + "description": "Optional filter by maximum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "hasThemeSong", + "in": "query", + "description": "Optional filter by items with theme songs.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasThemeVideo", + "in": "query", + "description": "Optional filter by items with theme videos.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSubtitles", + "in": "query", + "description": "Optional filter by items with subtitles.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSpecialFeature", + "in": "query", + "description": "Optional filter by items with special features.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTrailer", + "in": "query", + "description": "Optional filter by items with trailers.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "indexNumber", + "in": "query", + "description": "Optional filter by index number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "parentIndexNumber", + "in": "query", + "description": "Optional filter by parent index number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "hasParentalRating", + "in": "query", + "description": "Optional filter by items that have or do not have a parental rating.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isHd", + "in": "query", + "description": "Optional filter by items that are HD or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "is4K", + "in": "query", + "description": "Optional filter by items that are 4K or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "locationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "excludeLocationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isUnaired", + "in": "query", + "description": "Optional filter by items that are unaired episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minCriticRating", + "in": "query", + "description": "Optional filter by minimum critic rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minPremiereDate", + "in": "query", + "description": "Optional. The minimum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSaved", + "in": "query", + "description": "Optional. The minimum last saved date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSavedForUser", + "in": "query", + "description": "Optional. The minimum last saved date for the current user. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "maxPremiereDate", + "in": "query", + "description": "Optional. The maximum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasOverview", + "in": "query", + "description": "Optional filter by items that have an overview or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasImdbId", + "in": "query", + "description": "Optional filter by items that have an IMDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTmdbId", + "in": "query", + "description": "Optional filter by items that have a TMDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTvdbId", + "in": "query", + "description": "Optional filter by items that have a TVDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional filter for live tv movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional filter for live tv series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional filter for live tv news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional filter for live tv kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional filter for live tv sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "excludeItemIds", + "in": "query", + "description": "Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "recursive", + "in": "query", + "description": "When searching within folders, this determines whether or not the search will be recursive. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Filter based on a search term.", + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending, Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "imageTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "isPlayed", + "in": "query", + "description": "Optional filter by items that are played, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "artists", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "artistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albumArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified album artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "contributingArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified contributing artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albums", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "albumIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "ids", + "in": "query", + "description": "Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "videoTypes", + "in": "query", + "description": "Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VideoType" + } + } + }, + { + "name": "minOfficialRating", + "in": "query", + "description": "Optional filter by minimum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "isLocked", + "in": "query", + "description": "Optional filter by items that are locked.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isPlaceHolder", + "in": "query", + "description": "Optional filter by items that are placeholders.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasOfficialRating", + "in": "query", + "description": "Optional filter by items that have official ratings.", + "schema": { + "type": "boolean" + } + }, + { + "name": "collapseBoxSetItems", + "in": "query", + "description": "Whether or not to hide items behind their boxsets.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minWidth", + "in": "query", + "description": "Optional. Filter by the minimum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minHeight", + "in": "query", + "description": "Optional. Filter by the minimum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. Filter by the maximum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. Filter by the maximum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "is3D", + "in": "query", + "description": "Optional filter by items that are 3D, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesStatus", + "in": "query", + "description": "Optional filter by Series Status. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SeriesStatus" + } + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Enable the total record count.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Library" + ], + "summary": "Deletes items from the library and filesystem.", + "operationId": "DeleteItems", + "parameters": [ + { + "name": "ids", + "in": "query", + "description": "The item ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "204": { + "description": "Items deleted." + }, + "401": { + "description": "Unauthorized access.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserItems/{itemId}/UserData": { + "get": { + "tags": [ + "Items" + ], + "summary": "Get Item User Data.", + "operationId": "GetItemUserData", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "return item user data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "404": { + "description": "Item is not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Items" + ], + "summary": "Update Item User Data.", + "operationId": "UpdateItemUserData", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "New user data object.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserItemDataDto" + } + ], + "description": "This is used by the api to get information about a item user data." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserItemDataDto" + } + ], + "description": "This is used by the api to get information about a item user data." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserItemDataDto" + } + ], + "description": "This is used by the api to get information about a item user data." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "return updated user item data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "404": { + "description": "Item is not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserItems/Resume": { + "get": { + "tags": [ + "Items" + ], + "summary": "Gets items based on a query.", + "operationId": "GetResumeItems", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "The start index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "The item limit.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional. Filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Enable the total record count.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "excludeActiveSessions", + "in": "query", + "description": "Optional. Whether to exclude the currently active sessions.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}": { + "post": { + "tags": [ + "ItemUpdate" + ], + "summary": "Updates an item.", + "operationId": "UpdateItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The new item properties.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Item updated." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "Library" + ], + "summary": "Deletes an item from the library and filesystem.", + "operationId": "DeleteItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Item deleted." + }, + "401": { + "description": "Unauthorized access.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets an item from a user's library.", + "operationId": "GetItem", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ContentType": { + "post": { + "tags": [ + "ItemUpdate" + ], + "summary": "Updates an item's content type.", + "operationId": "UpdateItemContentType", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "contentType", + "in": "query", + "description": "The content type of the item.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Item content type updated." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Items/{itemId}/MetadataEditor": { + "get": { + "tags": [ + "ItemUpdate" + ], + "summary": "Gets metadata editor info for an item.", + "operationId": "GetMetadataEditorInfo", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item metadata editor returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataEditorInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/MetadataEditorInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/MetadataEditorInfo" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Albums/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarAlbums", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarArtists", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Ancestors": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets all parents of an item.", + "operationId": "GetAncestors", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item parents returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/CriticReviews": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets critic review for an item.", + "operationId": "GetCriticReviews", + "parameters": [ + { + "name": "itemId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Critic reviews returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Download": { + "get": { + "tags": [ + "Library" + ], + "summary": "Downloads item media.", + "operationId": "GetDownload", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Media downloaded.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "Download", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/File": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get the original file of an item.", + "operationId": "GetFile", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "File stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarItems", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ThemeMedia": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get theme songs and videos for an item.", + "operationId": "GetThemeMedia", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "inheritFromParent", + "in": "query", + "description": "Optional. Determines whether or not parent items should be searched for theme media.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort Order - Ascending, Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + } + ], + "responses": { + "200": { + "description": "Theme songs and videos returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AllThemeMediaResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AllThemeMediaResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AllThemeMediaResult" + } + } + } + }, + "404": { + "description": "Item not found." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ThemeSongs": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get theme songs for an item.", + "operationId": "GetThemeSongs", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "inheritFromParent", + "in": "query", + "description": "Optional. Determines whether or not parent items should be searched for theme media.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort Order - Ascending, Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + } + ], + "responses": { + "200": { + "description": "Theme songs returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ThemeVideos": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get theme videos for an item.", + "operationId": "GetThemeVideos", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "inheritFromParent", + "in": "query", + "description": "Optional. Determines whether or not parent items should be searched for theme media.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort Order - Ascending, Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + } + ], + "responses": { + "200": { + "description": "Theme videos returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Counts": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get item counts.", + "operationId": "GetItemCounts", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. Get counts from a specific user's library.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional. Get counts of favorite items.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Item counts returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ItemCounts" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ItemCounts" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ItemCounts" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Libraries/AvailableOptions": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets the library options info.", + "operationId": "GetLibraryOptionsInfo", + "parameters": [ + { + "name": "libraryContentType", + "in": "query", + "description": "Library content type.", + "schema": { + "enum": [ + "unknown", + "movies", + "tvshows", + "music", + "musicvideos", + "trailers", + "homevideos", + "boxsets", + "books", + "photos", + "livetv", + "playlists", + "folders" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CollectionType" + } + ] + } + }, + { + "name": "isNewLibrary", + "in": "query", + "description": "Whether this is a new library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Library options info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LibraryOptionsResultDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LibraryOptionsResultDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LibraryOptionsResultDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/Media/Updated": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new movies have been added by an external source.", + "operationId": "PostUpdatedMedia", + "requestBody": { + "description": "The update paths.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaUpdateInfoDto" + } + ], + "description": "Media Update Info Dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaUpdateInfoDto" + } + ], + "description": "Media Update Info Dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaUpdateInfoDto" + } + ], + "description": "Media Update Info Dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Report success." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/MediaFolders": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets all user media folders.", + "operationId": "GetMediaFolders", + "parameters": [ + { + "name": "isHidden", + "in": "query", + "description": "Optional. Filter by folders that are marked hidden, or not.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Media folders returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Library/Movies/Added": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new movies have been added by an external source.", + "operationId": "PostAddedMovies", + "parameters": [ + { + "name": "tmdbId", + "in": "query", + "description": "The tmdbId.", + "schema": { + "type": "string" + } + }, + { + "name": "imdbId", + "in": "query", + "description": "The imdbId.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Report success." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/Movies/Updated": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new movies have been added by an external source.", + "operationId": "PostUpdatedMovies", + "parameters": [ + { + "name": "tmdbId", + "in": "query", + "description": "The tmdbId.", + "schema": { + "type": "string" + } + }, + { + "name": "imdbId", + "in": "query", + "description": "The imdbId.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Report success." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/PhysicalPaths": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets a list of physical paths from virtual folders.", + "operationId": "GetPhysicalPaths", + "responses": { + "200": { + "description": "Physical paths returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Library/Refresh": { + "post": { + "tags": [ + "Library" + ], + "summary": "Starts a library scan.", + "operationId": "RefreshLibrary", + "responses": { + "204": { + "description": "Library scan started." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Library/Series/Added": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new episodes of a series have been added by an external source.", + "operationId": "PostAddedSeries", + "parameters": [ + { + "name": "tvdbId", + "in": "query", + "description": "The tvdbId.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Report success." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/Series/Updated": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new episodes of a series have been added by an external source.", + "operationId": "PostUpdatedSeries", + "parameters": [ + { + "name": "tvdbId", + "in": "query", + "description": "The tvdbId.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Report success." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Movies/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarMovies", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarShows", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Trailers/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarTrailers", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/VirtualFolders": { + "get": { + "tags": [ + "LibraryStructure" + ], + "summary": "Gets all virtual folders.", + "operationId": "GetVirtualFolders", + "responses": { + "200": { + "description": "Virtual folders retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VirtualFolderInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VirtualFolderInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VirtualFolderInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Adds a virtual folder.", + "operationId": "AddVirtualFolder", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the virtual folder.", + "schema": { + "type": "string" + } + }, + { + "name": "collectionType", + "in": "query", + "description": "The type of the collection.", + "schema": { + "enum": [ + "movies", + "tvshows", + "music", + "musicvideos", + "homevideos", + "boxsets", + "books", + "mixed" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CollectionTypeOptions" + } + ] + } + }, + { + "name": "paths", + "in": "query", + "description": "The paths of the virtual folder.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "The library options.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AddVirtualFolderDto" + } + ], + "description": "Add virtual folder dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AddVirtualFolderDto" + } + ], + "description": "Add virtual folder dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AddVirtualFolderDto" + } + ], + "description": "Add virtual folder dto." + } + } + } + }, + "responses": { + "204": { + "description": "Folder added." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LibraryStructure" + ], + "summary": "Removes a virtual folder.", + "operationId": "RemoveVirtualFolder", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the folder.", + "schema": { + "type": "string" + } + }, + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Folder removed." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/VirtualFolders/LibraryOptions": { + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Update library options.", + "operationId": "UpdateLibraryOptions", + "requestBody": { + "description": "The library name and options.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateLibraryOptionsDto" + } + ], + "description": "Update library options dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateLibraryOptionsDto" + } + ], + "description": "Update library options dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateLibraryOptionsDto" + } + ], + "description": "Update library options dto." + } + } + } + }, + "responses": { + "204": { + "description": "Library updated." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/VirtualFolders/Name": { + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Renames a virtual folder.", + "operationId": "RenameVirtualFolder", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the virtual folder.", + "schema": { + "type": "string" + } + }, + { + "name": "newName", + "in": "query", + "description": "The new name.", + "schema": { + "type": "string" + } + }, + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Folder renamed." + }, + "404": { + "description": "Library doesn't exist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "409": { + "description": "Library already exists.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/VirtualFolders/Paths": { + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Add a media path to a library.", + "operationId": "AddMediaPath", + "parameters": [ + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "The media path dto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathDto" + } + ], + "description": "Media Path dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathDto" + } + ], + "description": "Media Path dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathDto" + } + ], + "description": "Media Path dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Media path added." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LibraryStructure" + ], + "summary": "Remove a media path.", + "operationId": "RemoveMediaPath", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the library.", + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "The path to remove.", + "schema": { + "type": "string" + } + }, + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Media path removed." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/VirtualFolders/Paths/Update": { + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Updates a media path.", + "operationId": "UpdateMediaPath", + "requestBody": { + "description": "The name of the library and path infos.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateMediaPathRequestDto" + } + ], + "description": "Update library options dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateMediaPathRequestDto" + } + ], + "description": "Update library options dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateMediaPathRequestDto" + } + ], + "description": "Update library options dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Media path updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ChannelMappingOptions": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Get channel mapping options.", + "operationId": "GetChannelMappingOptions", + "parameters": [ + { + "name": "providerId", + "in": "query", + "description": "Provider id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Channel mapping options returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChannelMappingOptionsDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ChannelMappingOptionsDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ChannelMappingOptionsDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ChannelMappings": { + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Set channel mappings.", + "operationId": "SetChannelMapping", + "requestBody": { + "description": "The set channel mapping dto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetChannelMappingDto" + } + ], + "description": "Set channel mapping dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetChannelMappingDto" + } + ], + "description": "Set channel mapping dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetChannelMappingDto" + } + ], + "description": "Set channel mapping dto." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Created channel mapping returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TunerChannelMapping" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TunerChannelMapping" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TunerChannelMapping" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Channels": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available live tv channels.", + "operationId": "GetLiveTvChannels", + "parameters": [ + { + "name": "type", + "in": "query", + "description": "Optional. Filter by channel type.", + "schema": { + "enum": [ + "TV", + "Radio" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ChannelType" + } + ] + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional. Filter by channels that are favorites, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isLiked", + "in": "query", + "description": "Optional. Filter by channels that are liked, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isDisliked", + "in": "query", + "description": "Optional. Filter by channels that are disliked, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "\"Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Key to sort by.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort order.", + "schema": { + "enum": [ + "Ascending", + "Descending" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SortOrder" + } + ] + } + }, + { + "name": "enableFavoriteSorting", + "in": "query", + "description": "Optional. Incorporate favorite and like status into channel sorting.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "addCurrentProgram", + "in": "query", + "description": "Optional. Adds current program info to each channel.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Available live tv channels returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Channels/{channelId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv channel.", + "operationId": "GetChannel", + "parameters": [ + { + "name": "channelId", + "in": "path", + "description": "Channel id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Live tv channel returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/GuideInfo": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Get guid info.", + "operationId": "GetGuideInfo", + "responses": { + "200": { + "description": "Guid info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GuideInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/GuideInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/GuideInfo" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Info": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available live tv services.", + "operationId": "GetLiveTvInfo", + "responses": { + "200": { + "description": "Available live tv services returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiveTvInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LiveTvInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LiveTvInfo" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ListingProviders": { + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Adds a listings provider.", + "operationId": "AddListingProvider", + "parameters": [ + { + "name": "pw", + "in": "query", + "description": "Password.", + "schema": { + "type": "string" + } + }, + { + "name": "validateListings", + "in": "query", + "description": "Validate listings.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "validateLogin", + "in": "query", + "description": "Validate login.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "New listings info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Created listings provider returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Delete listing provider.", + "operationId": "DeleteListingProvider", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Listing provider id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Listing provider deleted." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ListingProviders/Default": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets default listings provider info.", + "operationId": "GetDefaultListingProvider", + "responses": { + "200": { + "description": "Default listings provider info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ListingProviders/Lineups": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available lineups.", + "operationId": "GetLineups", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Provider id.", + "schema": { + "type": "string" + } + }, + { + "name": "type", + "in": "query", + "description": "Provider type.", + "schema": { + "type": "string" + } + }, + { + "name": "location", + "in": "query", + "description": "Location.", + "schema": { + "type": "string" + } + }, + { + "name": "country", + "in": "query", + "description": "Country.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Available lineups returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ListingProviders/SchedulesDirect/Countries": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available countries.", + "operationId": "GetSchedulesDirectCountries", + "responses": { + "200": { + "description": "Available countries returned.", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/LiveRecordings/{recordingId}/stream": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv recording stream.", + "operationId": "GetLiveRecordingFile", + "parameters": [ + { + "name": "recordingId", + "in": "path", + "description": "Recording id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Recording stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Recording not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/LiveTv/LiveStreamFiles/{streamId}/stream.{container}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv channel stream.", + "operationId": "GetLiveStreamFile", + "parameters": [ + { + "name": "streamId", + "in": "path", + "description": "Stream id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "container", + "in": "path", + "description": "Container type.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Stream not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/LiveTv/Programs": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available live tv epgs.", + "operationId": "GetLiveTvPrograms", + "parameters": [ + { + "name": "channelIds", + "in": "query", + "description": "The channels to return guide information for.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "minStartDate", + "in": "query", + "description": "Optional. The minimum premiere start date.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasAired", + "in": "query", + "description": "Optional. Filter by programs that have completed airing, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isAiring", + "in": "query", + "description": "Optional. Filter by programs that are currently airing, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "maxStartDate", + "in": "query", + "description": "Optional. The maximum premiere start date.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minEndDate", + "in": "query", + "description": "Optional. The minimum premiere end date.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "maxEndDate", + "in": "query", + "description": "Optional. The maximum premiere end date.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "genres", + "in": "query", + "description": "The genres to return guide information for.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "The genre ids to return guide information for.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesTimerId", + "in": "query", + "description": "Optional. Filter by series timer id.", + "schema": { + "type": "string" + } + }, + { + "name": "librarySeriesId", + "in": "query", + "description": "Optional. Filter by library series id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Retrieve total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Live tv epgs returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available live tv epgs.", + "operationId": "GetPrograms", + "requestBody": { + "description": "Request body.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GetProgramsDto" + } + ], + "description": "Get programs dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GetProgramsDto" + } + ], + "description": "Get programs dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GetProgramsDto" + } + ], + "description": "Get programs dto." + } + } + } + }, + "responses": { + "200": { + "description": "Live tv epgs returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Programs/{programId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv program.", + "operationId": "GetProgram", + "parameters": [ + { + "name": "programId", + "in": "path", + "description": "Program id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Program returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Programs/Recommended": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets recommended live tv epgs.", + "operationId": "GetRecommendedPrograms", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. filter by user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "isAiring", + "in": "query", + "description": "Optional. Filter by programs that are currently airing, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasAired", + "in": "query", + "description": "Optional. Filter by programs that have completed airing, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "The genres to return guide information for.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Retrieve total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Recommended epgs returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets live tv recordings.", + "operationId": "GetRecordings", + "parameters": [ + { + "name": "channelId", + "in": "query", + "description": "Optional. Filter by channel id.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "status", + "in": "query", + "description": "Optional. Filter by recording status.", + "schema": { + "enum": [ + "New", + "InProgress", + "Completed", + "Cancelled", + "ConflictedOk", + "ConflictedNotOk", + "Error" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RecordingStatus" + } + ] + } + }, + { + "name": "isInProgress", + "in": "query", + "description": "Optional. Filter by recordings that are in progress, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesTimerId", + "in": "query", + "description": "Optional. Filter by recordings belonging to a series timer.", + "schema": { + "type": "string" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isLibraryItem", + "in": "query", + "description": "Optional. Filter for is library item.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Return total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Live tv recordings returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings/{recordingId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv recording.", + "operationId": "GetRecording", + "parameters": [ + { + "name": "recordingId", + "in": "path", + "description": "Recording id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Recording returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Deletes a live tv recording.", + "operationId": "DeleteRecording", + "parameters": [ + { + "name": "recordingId", + "in": "path", + "description": "Recording id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Recording deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings/Folders": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets recording folders.", + "operationId": "GetRecordingFolders", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Recording folders returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings/Groups": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets live tv recording groups.", + "operationId": "GetRecordingGroups", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Recording groups returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings/Groups/{groupId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Get recording group.", + "operationId": "GetRecordingGroup", + "parameters": [ + { + "name": "groupId", + "in": "path", + "description": "Group id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings/Series": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets live tv recording series.", + "operationId": "GetRecordingsSeries", + "parameters": [ + { + "name": "channelId", + "in": "query", + "description": "Optional. Filter by channel id.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "groupId", + "in": "query", + "description": "Optional. Filter by recording group.", + "schema": { + "type": "string" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "status", + "in": "query", + "description": "Optional. Filter by recording status.", + "schema": { + "enum": [ + "New", + "InProgress", + "Completed", + "Cancelled", + "ConflictedOk", + "ConflictedNotOk", + "Error" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RecordingStatus" + } + ] + } + }, + { + "name": "isInProgress", + "in": "query", + "description": "Optional. Filter by recordings that are in progress, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesTimerId", + "in": "query", + "description": "Optional. Filter by recordings belonging to a series timer.", + "schema": { + "type": "string" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Return total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Live tv recordings returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/SeriesTimers": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets live tv series timers.", + "operationId": "GetSeriesTimers", + "parameters": [ + { + "name": "sortBy", + "in": "query", + "description": "Optional. Sort by SortName or Priority.", + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort in Ascending or Descending order.", + "schema": { + "enum": [ + "Ascending", + "Descending" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SortOrder" + } + ] + } + } + ], + "responses": { + "200": { + "description": "Timers returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Creates a live tv series timer.", + "operationId": "CreateSeriesTimer", + "requestBody": { + "description": "New series timer info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + } + } + }, + "responses": { + "204": { + "description": "Series timer info created." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/SeriesTimers/{timerId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv series timer.", + "operationId": "GetSeriesTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Series timer returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + } + } + }, + "404": { + "description": "Series timer not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Cancels a live tv series timer.", + "operationId": "CancelSeriesTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Timer cancelled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Updates a live tv series timer.", + "operationId": "UpdateSeriesTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "New series timer info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + } + } + }, + "responses": { + "204": { + "description": "Series timer updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Timers": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets the live tv timers.", + "operationId": "GetTimers", + "parameters": [ + { + "name": "channelId", + "in": "query", + "description": "Optional. Filter by channel id.", + "schema": { + "type": "string" + } + }, + { + "name": "seriesTimerId", + "in": "query", + "description": "Optional. Filter by timers belonging to a series timer.", + "schema": { + "type": "string" + } + }, + { + "name": "isActive", + "in": "query", + "description": "Optional. Filter by timers that are active.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isScheduled", + "in": "query", + "description": "Optional. Filter by timers that are scheduled.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Creates a live tv timer.", + "operationId": "CreateTimer", + "requestBody": { + "description": "New timer info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + } + } + }, + "responses": { + "204": { + "description": "Timer created." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Timers/{timerId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a timer.", + "operationId": "GetTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Timer returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Cancels a live tv timer.", + "operationId": "CancelTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Timer deleted." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Updates a live tv timer.", + "operationId": "UpdateTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "New timer info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + } + } + }, + "responses": { + "204": { + "description": "Timer updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Timers/Defaults": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets the default values for a new timer.", + "operationId": "GetDefaultTimer", + "parameters": [ + { + "name": "programId", + "in": "query", + "description": "Optional. To attach default values based on a program.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Default values returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/TunerHosts": { + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Adds a tuner host.", + "operationId": "AddTunerHost", + "requestBody": { + "description": "New tuner host.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TunerHostInfo" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TunerHostInfo" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TunerHostInfo" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Created tuner host returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TunerHostInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TunerHostInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Deletes a tuner host.", + "operationId": "DeleteTunerHost", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Tuner host id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Tuner host deleted." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/TunerHosts/Types": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Get tuner host types.", + "operationId": "GetTunerHostTypes", + "responses": { + "200": { + "description": "Tuner host types returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Tuners/{tunerId}/Reset": { + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Resets a tv tuner.", + "operationId": "ResetTuner", + "parameters": [ + { + "name": "tunerId", + "in": "path", + "description": "Tuner id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Tuner reset." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Tuners/Discover": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Discover tuners.", + "operationId": "DiscoverTuners", + "parameters": [ + { + "name": "newDevicesOnly", + "in": "query", + "description": "Only discover new tuners.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Tuners returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Tuners/Discvover": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Discover tuners.", + "operationId": "DiscvoverTuners", + "parameters": [ + { + "name": "newDevicesOnly", + "in": "query", + "description": "Only discover new tuners.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Tuners returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Localization/Countries": { + "get": { + "tags": [ + "Localization" + ], + "summary": "Gets known countries.", + "operationId": "GetCountries", + "responses": { + "200": { + "description": "Known countries returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CountryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CountryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CountryInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Localization/Cultures": { + "get": { + "tags": [ + "Localization" + ], + "summary": "Gets known cultures.", + "operationId": "GetCultures", + "responses": { + "200": { + "description": "Known cultures returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CultureDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CultureDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CultureDto" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Localization/Options": { + "get": { + "tags": [ + "Localization" + ], + "summary": "Gets localization options.", + "operationId": "GetLocalizationOptions", + "responses": { + "200": { + "description": "Localization options returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocalizationOption" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocalizationOption" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocalizationOption" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Localization/ParentalRatings": { + "get": { + "tags": [ + "Localization" + ], + "summary": "Gets known parental ratings.", + "operationId": "GetParentalRatings", + "responses": { + "200": { + "description": "Known parental ratings returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParentalRating" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParentalRating" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParentalRating" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/Lyrics": { + "get": { + "tags": [ + "Lyrics" + ], + "summary": "Gets an item's lyrics.", + "operationId": "GetLyrics", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Lyrics returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + } + } + }, + "404": { + "description": "Something went wrong. No Lyrics will be returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Lyrics" + ], + "summary": "Upload an external lyric file.", + "operationId": "UploadLyrics", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item the lyric belongs to.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fileName", + "in": "query", + "description": "Name of the file being uploaded.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "200": { + "description": "Lyrics uploaded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + } + } + }, + "400": { + "description": "Error processing upload.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LyricManagement", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Lyrics" + ], + "summary": "Deletes an external lyric file.", + "operationId": "DeleteLyrics", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Lyric deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LyricManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/RemoteSearch/Lyrics": { + "get": { + "tags": [ + "Lyrics" + ], + "summary": "Search remote lyrics.", + "operationId": "SearchRemoteLyrics", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Lyrics retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteLyricInfoDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteLyricInfoDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteLyricInfoDto" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LyricManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/RemoteSearch/Lyrics/{lyricId}": { + "post": { + "tags": [ + "Lyrics" + ], + "summary": "Downloads a remote lyric.", + "operationId": "DownloadRemoteLyrics", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "lyricId", + "in": "path", + "description": "The lyric id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Lyric downloaded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LyricManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Providers/Lyrics/{lyricId}": { + "get": { + "tags": [ + "Lyrics" + ], + "summary": "Gets the remote lyrics.", + "operationId": "GetRemoteLyrics", + "parameters": [ + { + "name": "lyricId", + "in": "path", + "description": "The remote provider item id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "File returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + } + } + }, + "404": { + "description": "Lyric not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LyricManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/PlaybackInfo": { + "get": { + "tags": [ + "MediaInfo" + ], + "summary": "Gets live playback media info for an item.", + "operationId": "GetPlaybackInfo", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Playback info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "MediaInfo" + ], + "summary": "Gets live playback media info for an item.", + "description": "For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.\r\nQuery parameters are obsolete.", + "operationId": "GetPostedPlaybackInfo", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "deprecated": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "The maximum streaming bitrate.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "The start time in ticks.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "The audio stream index.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "The subtitle stream index.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "The maximum number of audio channels.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media source id.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The livestream id.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "autoOpenLiveStream", + "in": "query", + "description": "Whether to auto open the livestream.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "enableDirectPlay", + "in": "query", + "description": "Whether to enable direct play. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "enableDirectStream", + "in": "query", + "description": "Whether to enable direct stream. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "enableTranscoding", + "in": "query", + "description": "Whether to enable transcoding. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether to allow to copy the video stream. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether to allow to copy the audio stream. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "description": "The playback info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackInfoDto" + } + ], + "description": "Plabyback info dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackInfoDto" + } + ], + "description": "Plabyback info dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackInfoDto" + } + ], + "description": "Plabyback info dto." + } + } + } + }, + "responses": { + "200": { + "description": "Playback info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveStreams/Close": { + "post": { + "tags": [ + "MediaInfo" + ], + "summary": "Closes a media source.", + "operationId": "CloseLiveStream", + "parameters": [ + { + "name": "liveStreamId", + "in": "query", + "description": "The livestream id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Livestream closed." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveStreams/Open": { + "post": { + "tags": [ + "MediaInfo" + ], + "summary": "Opens a media source.", + "operationId": "OpenLiveStream", + "parameters": [ + { + "name": "openToken", + "in": "query", + "description": "The open token.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "The start time in ticks.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "The audio stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "The subtitle stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "The maximum number of audio channels.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "itemId", + "in": "query", + "description": "The item id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableDirectPlay", + "in": "query", + "description": "Whether to enable direct play. Default: true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableDirectStream", + "in": "query", + "description": "Whether to enable direct stream. Default: true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Always burn-in subtitle when transcoding.", + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "description": "The open live stream dto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenLiveStreamDto" + } + ], + "description": "Open live stream dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenLiveStreamDto" + } + ], + "description": "Open live stream dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenLiveStreamDto" + } + ], + "description": "Open live stream dto." + } + } + } + }, + "responses": { + "200": { + "description": "Media source opened.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiveStreamResponse" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LiveStreamResponse" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LiveStreamResponse" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playback/BitrateTest": { + "get": { + "tags": [ + "MediaInfo" + ], + "summary": "Tests the network with a request with the size of the bitrate.", + "operationId": "GetBitrateTestBytes", + "parameters": [ + { + "name": "size", + "in": "query", + "description": "The bitrate. Defaults to 102400.", + "schema": { + "maximum": 100000000, + "minimum": 1, + "type": "integer", + "format": "int32", + "default": 102400 + } + } + ], + "responses": { + "200": { + "description": "Test buffer returned.", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MediaSegments/{itemId}": { + "get": { + "tags": [ + "MediaSegments" + ], + "summary": "Gets all media segments based on an itemId.", + "operationId": "GetItemSegments", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The ItemId.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeSegmentTypes", + "in": "query", + "description": "Optional filter of requested segment types.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaSegmentType" + } + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MediaSegmentDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/MediaSegmentDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/MediaSegmentDtoQueryResult" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Movies/Recommendations": { + "get": { + "tags": [ + "Movies" + ], + "summary": "Gets movie recommendations.", + "operationId": "GetMovieRecommendations", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. The fields to return.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "categoryLimit", + "in": "query", + "description": "The max number of categories to return.", + "schema": { + "type": "integer", + "format": "int32", + "default": 5 + } + }, + { + "name": "itemLimit", + "in": "query", + "description": "The max number of items to return per category.", + "schema": { + "type": "integer", + "format": "int32", + "default": 8 + } + } + ], + "responses": { + "200": { + "description": "Movie recommendations returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecommendationDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecommendationDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecommendationDto" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MusicGenres": { + "get": { + "tags": [ + "MusicGenres" + ], + "summary": "Gets all music genres from a given item, folder, or the entire library.", + "operationId": "GetMusicGenres", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Include total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Music genres returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MusicGenres/{genreName}": { + "get": { + "tags": [ + "MusicGenres" + ], + "summary": "Gets a music genre, by name.", + "operationId": "GetMusicGenre", + "parameters": [ + { + "name": "genreName", + "in": "path", + "description": "The genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Packages": { + "get": { + "tags": [ + "Package" + ], + "summary": "Gets available packages.", + "operationId": "GetPackages", + "responses": { + "200": { + "description": "Available packages returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PackageInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PackageInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PackageInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Packages/{name}": { + "get": { + "tags": [ + "Package" + ], + "summary": "Gets a package by name or assembly GUID.", + "operationId": "GetPackageInfo", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the package.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "assemblyGuid", + "in": "query", + "description": "The GUID of the associated assembly.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Package retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PackageInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PackageInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PackageInfo" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Packages/Installed/{name}": { + "post": { + "tags": [ + "Package" + ], + "summary": "Installs a package.", + "operationId": "InstallPackage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Package name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "assemblyGuid", + "in": "query", + "description": "GUID of the associated assembly.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "query", + "description": "Optional version. Defaults to latest version.", + "schema": { + "type": "string" + } + }, + { + "name": "repositoryUrl", + "in": "query", + "description": "Optional. Specify the repository to install from.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Package found." + }, + "404": { + "description": "Package not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Packages/Installing/{packageId}": { + "delete": { + "tags": [ + "Package" + ], + "summary": "Cancels a package installation.", + "operationId": "CancelPackageInstallation", + "parameters": [ + { + "name": "packageId", + "in": "path", + "description": "Installation Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Installation cancelled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Repositories": { + "get": { + "tags": [ + "Package" + ], + "summary": "Gets all package repositories.", + "operationId": "GetRepositories", + "responses": { + "200": { + "description": "Package repositories returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Package" + ], + "summary": "Sets the enabled and existing package repositories.", + "operationId": "SetRepositories", + "requestBody": { + "description": "The list of package repositories.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Package repositories saved." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Persons": { + "get": { + "tags": [ + "Persons" + ], + "summary": "Gets all persons.", + "operationId": "GetPersons", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term.", + "schema": { + "type": "string" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not. userId is required.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "excludePersonTypes", + "in": "query", + "description": "Optional. If specified results will be filtered to exclude those containing the specified PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified results will be filtered to include only those containing the specified PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "appearsInItemId", + "in": "query", + "description": "Optional. If specified, person results will be filtered on items related to said persons.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Persons returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Persons/{name}": { + "get": { + "tags": [ + "Persons" + ], + "summary": "Get person by name.", + "operationId": "GetPerson", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Person returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "404": { + "description": "Person not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists": { + "post": { + "tags": [ + "Playlists" + ], + "summary": "Creates a new playlist.", + "description": "For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.\r\nQuery parameters are obsolete.", + "operationId": "CreatePlaylist", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The playlist name.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "ids", + "in": "query", + "description": "The item ids.", + "deprecated": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "deprecated": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaType", + "in": "query", + "description": "The media type.", + "deprecated": true, + "schema": { + "enum": [ + "Unknown", + "Video", + "Audio", + "Photo", + "Book" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaType" + } + ] + } + } + ], + "requestBody": { + "description": "The create playlist payload.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreatePlaylistDto" + } + ], + "description": "Create new playlist dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreatePlaylistDto" + } + ], + "description": "Create new playlist dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreatePlaylistDto" + } + ], + "description": "Create new playlist dto." + } + } + } + }, + "responses": { + "200": { + "description": "Playlist created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaylistCreationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistCreationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistCreationResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}": { + "post": { + "tags": [ + "Playlists" + ], + "summary": "Updates a playlist.", + "operationId": "UpdatePlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistDto id.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistDto" + } + ], + "description": "Update existing playlist dto. Fields set to `null` will not be updated and keep their current values." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistDto" + } + ], + "description": "Update existing playlist dto. Fields set to `null` will not be updated and keep their current values." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistDto" + } + ], + "description": "Update existing playlist dto. Fields set to `null` will not be updated and keep their current values." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Playlist updated." + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "get": { + "tags": [ + "Playlists" + ], + "summary": "Get a playlist.", + "operationId": "GetPlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "The playlist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaylistDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistDto" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}/Items": { + "post": { + "tags": [ + "Playlists" + ], + "summary": "Adds items to a playlist.", + "operationId": "AddItemToPlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ids", + "in": "query", + "description": "Item id, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "The userId.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Items added to playlist." + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Playlists" + ], + "summary": "Removes items from a playlist.", + "operationId": "RemoveItemFromPlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "entryIds", + "in": "query", + "description": "The item ids, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "204": { + "description": "Items removed." + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "get": { + "tags": [ + "Playlists" + ], + "summary": "Gets the original items of a playlist.", + "operationId": "GetPlaylistItems", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Original playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}/Items/{itemId}/Move/{newIndex}": { + "post": { + "tags": [ + "Playlists" + ], + "summary": "Moves a playlist item.", + "operationId": "MoveItem", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "newIndex", + "in": "path", + "description": "The new index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Item moved to new index." + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}/Users": { + "get": { + "tags": [ + "Playlists" + ], + "summary": "Get a playlist's users.", + "operationId": "GetPlaylistUsers", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Found shares.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + } + } + } + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}/Users/{userId}": { + "get": { + "tags": [ + "Playlists" + ], + "summary": "Get a playlist user.", + "operationId": "GetPlaylistUser", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "User permission found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + } + } + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Playlists" + ], + "summary": "Modify a user of a playlist's users.", + "operationId": "UpdatePlaylistUser", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistUserDto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistUserDto" + } + ], + "description": "Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistUserDto" + } + ], + "description": "Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistUserDto" + } + ], + "description": "Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "User's permissions modified." + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Playlists" + ], + "summary": "Remove a user from a playlist's users.", + "operationId": "RemoveUserFromPlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "User permissions removed from playlist." + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "No playlist or user permissions found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized access." + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/PlayingItems/{itemId}": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports that a session has begun playing an item.", + "operationId": "OnPlaybackStart", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The id of the MediaSource.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "The audio stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "The subtitle stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "playMethod", + "in": "query", + "description": "The play method.", + "schema": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ] + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "canSeek", + "in": "query", + "description": "Indicates if the client can seek.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Play start recorded." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Playstate" + ], + "summary": "Reports that a session has stopped playing an item.", + "operationId": "OnPlaybackStopped", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The id of the MediaSource.", + "schema": { + "type": "string" + } + }, + { + "name": "nextMediaType", + "in": "query", + "description": "The next media type that will play.", + "schema": { + "type": "string" + } + }, + { + "name": "positionTicks", + "in": "query", + "description": "Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Playback stop recorded." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/PlayingItems/{itemId}/Progress": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports a session's playback progress.", + "operationId": "OnPlaybackProgress", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The id of the MediaSource.", + "schema": { + "type": "string" + } + }, + { + "name": "positionTicks", + "in": "query", + "description": "Optional. The current position, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "The audio stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "The subtitle stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "volumeLevel", + "in": "query", + "description": "Scale of 0-100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "playMethod", + "in": "query", + "description": "The play method.", + "schema": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ] + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "repeatMode", + "in": "query", + "description": "The repeat mode.", + "schema": { + "enum": [ + "RepeatNone", + "RepeatAll", + "RepeatOne" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RepeatMode" + } + ] + } + }, + { + "name": "isPaused", + "in": "query", + "description": "Indicates if the player is paused.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "isMuted", + "in": "query", + "description": "Indicates if the player is muted.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Play progress recorded." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Playing": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports playback has started within a session.", + "operationId": "ReportPlaybackStart", + "requestBody": { + "description": "The playback start info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStartInfo" + } + ], + "description": "Class PlaybackStartInfo." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStartInfo" + } + ], + "description": "Class PlaybackStartInfo." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStartInfo" + } + ], + "description": "Class PlaybackStartInfo." + } + } + } + }, + "responses": { + "204": { + "description": "Playback start recorded." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Playing/Ping": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Pings a playback session.", + "operationId": "PingPlaybackSession", + "parameters": [ + { + "name": "playSessionId", + "in": "query", + "description": "Playback session id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Playback session pinged." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Playing/Progress": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports playback progress within a session.", + "operationId": "ReportPlaybackProgress", + "requestBody": { + "description": "The playback progress info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackProgressInfo" + } + ], + "description": "Class PlaybackProgressInfo." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackProgressInfo" + } + ], + "description": "Class PlaybackProgressInfo." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackProgressInfo" + } + ], + "description": "Class PlaybackProgressInfo." + } + } + } + }, + "responses": { + "204": { + "description": "Playback progress recorded." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Playing/Stopped": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports playback has stopped within a session.", + "operationId": "ReportPlaybackStopped", + "requestBody": { + "description": "The playback stop info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStopInfo" + } + ], + "description": "Class PlaybackStopInfo." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStopInfo" + } + ], + "description": "Class PlaybackStopInfo." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStopInfo" + } + ], + "description": "Class PlaybackStopInfo." + } + } + } + }, + "responses": { + "204": { + "description": "Playback stop recorded." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserPlayedItems/{itemId}": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Marks an item as played for user.", + "operationId": "MarkPlayedItem", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "datePlayed", + "in": "query", + "description": "Optional. The date the item was played.", + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "Item marked as played.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Playstate" + ], + "summary": "Marks an item as unplayed for user.", + "operationId": "MarkUnplayedItem", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item marked as unplayed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Plugins": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "Gets a list of currently installed plugins.", + "operationId": "GetPlugins", + "responses": { + "200": { + "description": "Installed plugins returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}": { + "delete": { + "tags": [ + "Plugins" + ], + "summary": "Uninstalls a plugin.", + "operationId": "UninstallPlugin", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Plugin uninstalled." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/{version}": { + "delete": { + "tags": [ + "Plugins" + ], + "summary": "Uninstalls a plugin by version.", + "operationId": "UninstallPluginByVersion", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "path", + "description": "Plugin version.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Plugin uninstalled." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/{version}/Disable": { + "post": { + "tags": [ + "Plugins" + ], + "summary": "Disable a plugin.", + "operationId": "DisablePlugin", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "path", + "description": "Plugin version.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Plugin disabled." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/{version}/Enable": { + "post": { + "tags": [ + "Plugins" + ], + "summary": "Enables a disabled plugin.", + "operationId": "EnablePlugin", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "path", + "description": "Plugin version.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Plugin enabled." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/{version}/Image": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "Gets a plugin's image.", + "operationId": "GetPluginImage", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "path", + "description": "Plugin version.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Plugin image returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/Configuration": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "Gets plugin configuration.", + "operationId": "GetPluginConfiguration", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Plugin configuration returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BasePluginConfiguration" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BasePluginConfiguration" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BasePluginConfiguration" + } + } + } + }, + "404": { + "description": "Plugin not found or plugin configuration not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Plugins" + ], + "summary": "Updates plugin configuration.", + "description": "Accepts plugin configuration as JSON body.", + "operationId": "UpdatePluginConfiguration", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Plugin configuration updated." + }, + "404": { + "description": "Plugin not found or plugin does not have configuration.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/Manifest": { + "post": { + "tags": [ + "Plugins" + ], + "summary": "Gets a plugin's manifest.", + "operationId": "GetPluginManifest", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Plugin manifest returned." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/QuickConnect/Authorize": { + "post": { + "tags": [ + "QuickConnect" + ], + "summary": "Authorizes a pending quick connect request.", + "operationId": "AuthorizeQuickConnect", + "parameters": [ + { + "name": "code", + "in": "query", + "description": "Quick connect code to authorize.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user the authorize. Access to the requested user is required.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Quick connect result authorized successfully.", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "boolean" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "boolean" + } + } + } + }, + "403": { + "description": "Unknown user id.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/QuickConnect/Connect": { + "get": { + "tags": [ + "QuickConnect" + ], + "summary": "Attempts to retrieve authentication information.", + "operationId": "GetQuickConnectState", + "parameters": [ + { + "name": "secret", + "in": "query", + "description": "Secret previously returned from the Initiate endpoint.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Quick connect result returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + } + } + }, + "404": { + "description": "Unknown quick connect secret.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/QuickConnect/Enabled": { + "get": { + "tags": [ + "QuickConnect" + ], + "summary": "Gets the current quick connect state.", + "operationId": "GetQuickConnectEnabled", + "responses": { + "200": { + "description": "Quick connect state returned.", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "boolean" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "boolean" + } + } + } + } + } + } + }, + "/QuickConnect/Initiate": { + "post": { + "tags": [ + "QuickConnect" + ], + "summary": "Initiate a new quick connect request.", + "operationId": "InitiateQuickConnect", + "responses": { + "200": { + "description": "Quick connect request successfully created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + } + } + }, + "401": { + "description": "Quick connect is not active on this server." + } + } + } + }, + "/Items/{itemId}/RemoteImages": { + "get": { + "tags": [ + "RemoteImage" + ], + "summary": "Gets available remote images for an item.", + "operationId": "GetRemoteImages", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "type", + "in": "query", + "description": "The image type.", + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ] + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "providerName", + "in": "query", + "description": "Optional. The image provider to use.", + "schema": { + "type": "string" + } + }, + { + "name": "includeAllLanguages", + "in": "query", + "description": "Optional. Include all languages.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Remote Images returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RemoteImageResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/RemoteImageResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/RemoteImageResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/RemoteImages/Download": { + "post": { + "tags": [ + "RemoteImage" + ], + "summary": "Downloads a remote image for an item.", + "operationId": "DownloadRemoteImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "type", + "in": "query", + "description": "The image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageUrl", + "in": "query", + "description": "The image url.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Remote image downloaded." + }, + "404": { + "description": "Remote image not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Items/{itemId}/RemoteImages/Providers": { + "get": { + "tags": [ + "RemoteImage" + ], + "summary": "Gets available remote image providers for an item.", + "operationId": "GetRemoteImageProviders", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Returned remote image providers.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageProviderInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageProviderInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageProviderInfo" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/ScheduledTasks": { + "get": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Get tasks.", + "operationId": "GetTasks", + "parameters": [ + { + "name": "isHidden", + "in": "query", + "description": "Optional filter tasks that are hidden, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isEnabled", + "in": "query", + "description": "Optional filter tasks that are enabled, or not.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Scheduled tasks retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/ScheduledTasks/{taskId}": { + "get": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Get task by id.", + "operationId": "GetTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "description": "Task Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Task retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaskInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TaskInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TaskInfo" + } + } + } + }, + "404": { + "description": "Task not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/ScheduledTasks/{taskId}/Triggers": { + "post": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Update specified task triggers.", + "operationId": "UpdateTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "description": "Task Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Triggers.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskTriggerInfo" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskTriggerInfo" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskTriggerInfo" + } + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Task triggers updated." + }, + "404": { + "description": "Task not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/ScheduledTasks/Running/{taskId}": { + "post": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Start specified task.", + "operationId": "StartTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "description": "Task Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Task started." + }, + "404": { + "description": "Task not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Stop specified task.", + "operationId": "StopTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "description": "Task Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Task stopped." + }, + "404": { + "description": "Task not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Search/Hints": { + "get": { + "tags": [ + "Search" + ], + "summary": "Gets the search hint result.", + "operationId": "GetSearchHints", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Supply a user id to search within a user's library or omit to search all.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term to filter on.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "If specified, only results with the specified item types are returned. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "If specified, results with these item types are filtered out. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "If specified, only results with the specified media types are returned. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "If specified, only children of the parent are returned.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "includePeople", + "in": "query", + "description": "Optional filter whether to include people.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "includeMedia", + "in": "query", + "description": "Optional filter whether to include media.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "includeGenres", + "in": "query", + "description": "Optional filter whether to include genres.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "includeStudios", + "in": "query", + "description": "Optional filter whether to include studios.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "includeArtists", + "in": "query", + "description": "Optional filter whether to include artists.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Search hint returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchHintResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SearchHintResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SearchHintResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Auth/PasswordResetProviders": { + "get": { + "tags": [ + "Session" + ], + "summary": "Get all password reset providers.", + "operationId": "GetPasswordResetProviders", + "responses": { + "200": { + "description": "Password reset providers retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Auth/Providers": { + "get": { + "tags": [ + "Session" + ], + "summary": "Get all auth providers.", + "operationId": "GetAuthProviders", + "responses": { + "200": { + "description": "Auth providers retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Sessions": { + "get": { + "tags": [ + "Session" + ], + "summary": "Gets a list of sessions.", + "operationId": "GetSessions", + "parameters": [ + { + "name": "controllableByUserId", + "in": "query", + "description": "Filter by sessions that a given user is allowed to remote control.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "Filter by device Id.", + "schema": { + "type": "string" + } + }, + { + "name": "activeWithinSeconds", + "in": "query", + "description": "Optional. Filter by sessions that were active in the last n seconds.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "List of sessions returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionInfoDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionInfoDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionInfoDto" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Command": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a full general command to a client.", + "operationId": "SendFullGeneralCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The MediaBrowser.Model.Session.GeneralCommand.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommand" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommand" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommand" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Full general command sent to session." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Command/{command}": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a general command to a client.", + "operationId": "SendGeneralCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "command", + "in": "path", + "description": "The command to send.", + "required": true, + "schema": { + "enum": [ + "MoveUp", + "MoveDown", + "MoveLeft", + "MoveRight", + "PageUp", + "PageDown", + "PreviousLetter", + "NextLetter", + "ToggleOsd", + "ToggleContextMenu", + "Select", + "Back", + "TakeScreenshot", + "SendKey", + "SendString", + "GoHome", + "GoToSettings", + "VolumeUp", + "VolumeDown", + "Mute", + "Unmute", + "ToggleMute", + "SetVolume", + "SetAudioStreamIndex", + "SetSubtitleStreamIndex", + "ToggleFullscreen", + "DisplayContent", + "GoToSearch", + "DisplayMessage", + "SetRepeatMode", + "ChannelUp", + "ChannelDown", + "Guide", + "ToggleStats", + "PlayMediaSource", + "PlayTrailers", + "SetShuffleQueue", + "PlayState", + "PlayNext", + "ToggleOsdMenu", + "Play", + "SetMaxStreamingBitrate", + "SetPlaybackOrder" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommandType" + } + ], + "description": "This exists simply to identify a set of known commands." + } + } + ], + "responses": { + "204": { + "description": "General command sent to session." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Message": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a command to a client to display a message to the user.", + "operationId": "SendMessageCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and TimeoutMs.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MessageCommand" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MessageCommand" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MessageCommand" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Message sent." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Playing": { + "post": { + "tags": [ + "Session" + ], + "summary": "Instructs a session to play an item.", + "operationId": "Play", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "playCommand", + "in": "query", + "description": "The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet implemented play next and play last may play now.", + "required": true, + "schema": { + "enum": [ + "PlayNow", + "PlayNext", + "PlayLast", + "PlayInstantMix", + "PlayShuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayCommand" + } + ], + "description": "Enum PlayCommand." + } + }, + { + "name": "itemIds", + "in": "query", + "description": "The ids of the items to play, comma delimited.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "startPositionTicks", + "in": "query", + "description": "The starting position of the first item.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "Optional. The media source id.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to play.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to play.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The start index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Instruction sent to session." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Playing/{command}": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a playstate command to a client.", + "operationId": "SendPlaystateCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "command", + "in": "path", + "description": "The MediaBrowser.Model.Session.PlaystateCommand.", + "required": true, + "schema": { + "enum": [ + "Stop", + "Pause", + "Unpause", + "NextTrack", + "PreviousTrack", + "Seek", + "Rewind", + "FastForward", + "PlayPause" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaystateCommand" + } + ], + "description": "Enum PlaystateCommand." + } + }, + { + "name": "seekPositionTicks", + "in": "query", + "description": "The optional position ticks.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "controllingUserId", + "in": "query", + "description": "The optional controlling user id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Playstate command sent to session." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/System/{command}": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a system command to a client.", + "operationId": "SendSystemCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "command", + "in": "path", + "description": "The command to send.", + "required": true, + "schema": { + "enum": [ + "MoveUp", + "MoveDown", + "MoveLeft", + "MoveRight", + "PageUp", + "PageDown", + "PreviousLetter", + "NextLetter", + "ToggleOsd", + "ToggleContextMenu", + "Select", + "Back", + "TakeScreenshot", + "SendKey", + "SendString", + "GoHome", + "GoToSettings", + "VolumeUp", + "VolumeDown", + "Mute", + "Unmute", + "ToggleMute", + "SetVolume", + "SetAudioStreamIndex", + "SetSubtitleStreamIndex", + "ToggleFullscreen", + "DisplayContent", + "GoToSearch", + "DisplayMessage", + "SetRepeatMode", + "ChannelUp", + "ChannelDown", + "Guide", + "ToggleStats", + "PlayMediaSource", + "PlayTrailers", + "SetShuffleQueue", + "PlayState", + "PlayNext", + "ToggleOsdMenu", + "Play", + "SetMaxStreamingBitrate", + "SetPlaybackOrder" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommandType" + } + ], + "description": "This exists simply to identify a set of known commands." + } + } + ], + "responses": { + "204": { + "description": "System command sent to session." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/User/{userId}": { + "post": { + "tags": [ + "Session" + ], + "summary": "Adds an additional user to a session.", + "operationId": "AddUserToSession", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "User added to session." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Session" + ], + "summary": "Removes an additional user from a session.", + "operationId": "RemoveUserFromSession", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "User removed from session." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Viewing": { + "post": { + "tags": [ + "Session" + ], + "summary": "Instructs a session to browse to an item or view.", + "operationId": "DisplayContent", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session Id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemType", + "in": "query", + "description": "The type of item to browse to.", + "required": true, + "schema": { + "enum": [ + "AggregateFolder", + "Audio", + "AudioBook", + "BasePluginFolder", + "Book", + "BoxSet", + "Channel", + "ChannelFolderItem", + "CollectionFolder", + "Episode", + "Folder", + "Genre", + "ManualPlaylistsFolder", + "Movie", + "LiveTvChannel", + "LiveTvProgram", + "MusicAlbum", + "MusicArtist", + "MusicGenre", + "MusicVideo", + "Person", + "Photo", + "PhotoAlbum", + "Playlist", + "PlaylistsFolder", + "Program", + "Recording", + "Season", + "Series", + "Studio", + "Trailer", + "TvChannel", + "TvProgram", + "UserRootFolder", + "UserView", + "Video", + "Year" + ], + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemKind" + } + ], + "description": "The base item kind." + } + }, + { + "name": "itemId", + "in": "query", + "description": "The Id of the item.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemName", + "in": "query", + "description": "The name of the item.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Instruction sent to session." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Capabilities": { + "post": { + "tags": [ + "Session" + ], + "summary": "Updates capabilities for a device.", + "operationId": "PostCapabilities", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The session id.", + "schema": { + "type": "string" + } + }, + { + "name": "playableMediaTypes", + "in": "query", + "description": "A list of playable media types, comma delimited. Audio, Video, Book, Photo.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "supportedCommands", + "in": "query", + "description": "A list of supported remote control commands, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneralCommandType" + } + } + }, + { + "name": "supportsMediaControl", + "in": "query", + "description": "Determines whether media can be played remotely..", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "supportsPersistentIdentifier", + "in": "query", + "description": "Determines whether the device supports a unique identifier.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "204": { + "description": "Capabilities posted." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Capabilities/Full": { + "post": { + "tags": [ + "Session" + ], + "summary": "Updates capabilities for a device.", + "operationId": "PostFullCapabilities", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The session id.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The MediaBrowser.Model.Session.ClientCapabilities.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Client capabilities dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Client capabilities dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Client capabilities dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Capabilities updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Logout": { + "post": { + "tags": [ + "Session" + ], + "summary": "Reports that a session has ended.", + "operationId": "ReportSessionEnded", + "responses": { + "204": { + "description": "Session end reported to server." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Viewing": { + "post": { + "tags": [ + "Session" + ], + "summary": "Reports that a session is viewing an item.", + "operationId": "ReportViewing", + "parameters": [ + { + "name": "sessionId", + "in": "query", + "description": "The session id.", + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "query", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Session reported to server." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Startup/Complete": { + "post": { + "tags": [ + "Startup" + ], + "summary": "Completes the startup wizard.", + "operationId": "CompleteWizard", + "responses": { + "204": { + "description": "Startup wizard completed." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Startup/Configuration": { + "get": { + "tags": [ + "Startup" + ], + "summary": "Gets the initial startup wizard configuration.", + "operationId": "GetStartupConfiguration", + "responses": { + "200": { + "description": "Initial startup wizard configuration retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Startup" + ], + "summary": "Sets the initial startup wizard configuration.", + "operationId": "UpdateInitialConfiguration", + "requestBody": { + "description": "The updated startup configuration.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + ], + "description": "The startup configuration DTO." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + ], + "description": "The startup configuration DTO." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + ], + "description": "The startup configuration DTO." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Configuration saved." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Startup/FirstUser": { + "get": { + "tags": [ + "Startup" + ], + "summary": "Gets the first user.", + "operationId": "GetFirstUser_2", + "responses": { + "200": { + "description": "Initial user retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Startup/RemoteAccess": { + "post": { + "tags": [ + "Startup" + ], + "summary": "Sets remote access and UPnP.", + "operationId": "SetRemoteAccess", + "requestBody": { + "description": "The startup remote access dto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupRemoteAccessDto" + } + ], + "description": "Startup remote access dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupRemoteAccessDto" + } + ], + "description": "Startup remote access dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupRemoteAccessDto" + } + ], + "description": "Startup remote access dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Configuration saved." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Startup/User": { + "get": { + "tags": [ + "Startup" + ], + "summary": "Gets the first user.", + "operationId": "GetFirstUser", + "responses": { + "200": { + "description": "Initial user retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Startup" + ], + "summary": "Sets the user name and password.", + "operationId": "UpdateStartupUser", + "requestBody": { + "description": "The DTO containing username and password.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupUserDto" + } + ], + "description": "The startup user DTO." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupUserDto" + } + ], + "description": "The startup user DTO." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupUserDto" + } + ], + "description": "The startup user DTO." + } + } + } + }, + "responses": { + "204": { + "description": "Updated user name and password." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Studios": { + "get": { + "tags": [ + "Studios" + ], + "summary": "Gets all studios from a given item, folder, or the entire library.", + "operationId": "GetStudios", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Studios returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Studios/{name}": { + "get": { + "tags": [ + "Studios" + ], + "summary": "Gets a studio by name.", + "operationId": "GetStudio", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Studio returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/FallbackFont/Fonts": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets a list of available fallback font files.", + "operationId": "GetFallbackFontList", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FontFile" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FontFile" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FontFile" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/FallbackFont/Fonts/{name}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets a fallback font file.", + "operationId": "GetFallbackFont", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the fallback font file to get.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Fallback font file retrieved.", + "content": { + "font/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/RemoteSearch/Subtitles/{language}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Search remote subtitles.", + "operationId": "SearchRemoteSubtitles", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "language", + "in": "path", + "description": "The language of the subtitles.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "isPerfectMatch", + "in": "query", + "description": "Optional. Only show subtitles which are a perfect match.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Subtitles retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSubtitleInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSubtitleInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSubtitleInfo" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SubtitleManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/RemoteSearch/Subtitles/{subtitleId}": { + "post": { + "tags": [ + "Subtitle" + ], + "summary": "Downloads a remote subtitle.", + "operationId": "DownloadRemoteSubtitles", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "subtitleId", + "in": "path", + "description": "The subtitle id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Subtitle downloaded." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SubtitleManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Providers/Subtitles/Subtitles/{subtitleId}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets the remote subtitles.", + "operationId": "GetRemoteSubtitles", + "parameters": [ + { + "name": "subtitleId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "File returned.", + "content": { + "text/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SubtitleManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/{mediaSourceId}/Subtitles/{index}/subtitles.m3u8": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets an HLS subtitle playlist.", + "operationId": "GetSubtitlePlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "index", + "in": "path", + "description": "The subtitle stream index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "path", + "description": "The media source id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The subtitle segment length.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Subtitle playlist retrieved.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/Subtitles": { + "post": { + "tags": [ + "Subtitle" + ], + "summary": "Upload an external subtitle file.", + "operationId": "UploadSubtitle", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item the subtitle belongs to.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The request body.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UploadSubtitleDto" + } + ], + "description": "Upload subtitles dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UploadSubtitleDto" + } + ], + "description": "Upload subtitles dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UploadSubtitleDto" + } + ], + "description": "Upload subtitles dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Subtitle uploaded." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SubtitleManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/Subtitles/{index}": { + "delete": { + "tags": [ + "Subtitle" + ], + "summary": "Deletes an external subtitle file.", + "operationId": "DeleteSubtitle", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "index", + "in": "path", + "description": "The index of the subtitle file.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Subtitle deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/{routeStartPositionTicks}/Stream.{routeFormat}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets subtitles in a specified format.", + "operationId": "GetSubtitleWithTicks", + "parameters": [ + { + "name": "routeItemId", + "in": "path", + "description": "The (route) item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "routeMediaSourceId", + "in": "path", + "description": "The (route) media source id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "routeIndex", + "in": "path", + "description": "The (route) subtitle stream index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "routeStartPositionTicks", + "in": "path", + "description": "The (route) start position of the subtitle in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "routeFormat", + "in": "path", + "description": "The (route) format of the returned subtitle.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "query", + "description": "The item id.", + "deprecated": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media source id.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "index", + "in": "query", + "description": "The subtitle stream index.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startPositionTicks", + "in": "query", + "description": "The start position of the subtitle in ticks.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "format", + "in": "query", + "description": "The format of the returned subtitle.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "endPositionTicks", + "in": "query", + "description": "Optional. The end position of the subtitle in ticks.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Optional. Whether to copy the timestamps.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "addVttTimeMap", + "in": "query", + "description": "Optional. Whether to add a VTT time map.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "File returned.", + "content": { + "text/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/Stream.{routeFormat}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets subtitles in a specified format.", + "operationId": "GetSubtitle", + "parameters": [ + { + "name": "routeItemId", + "in": "path", + "description": "The (route) item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "routeMediaSourceId", + "in": "path", + "description": "The (route) media source id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "routeIndex", + "in": "path", + "description": "The (route) subtitle stream index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "routeFormat", + "in": "path", + "description": "The (route) format of the returned subtitle.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "query", + "description": "The item id.", + "deprecated": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media source id.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "index", + "in": "query", + "description": "The subtitle stream index.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "format", + "in": "query", + "description": "The format of the returned subtitle.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "endPositionTicks", + "in": "query", + "description": "Optional. The end position of the subtitle in ticks.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Optional. Whether to copy the timestamps.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "addVttTimeMap", + "in": "query", + "description": "Optional. Whether to add a VTT time map.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "startPositionTicks", + "in": "query", + "description": "The start position of the subtitle in ticks.", + "schema": { + "type": "integer", + "format": "int64", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "File returned.", + "content": { + "text/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/Items/Suggestions": { + "get": { + "tags": [ + "Suggestions" + ], + "summary": "Gets suggestions.", + "operationId": "GetSuggestions", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaType", + "in": "query", + "description": "The media types.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "type", + "in": "query", + "description": "The type.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The start index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The limit.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Whether to enable the total record count.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Suggestions returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Buffering": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Notify SyncPlay group that member is buffering.", + "operationId": "SyncPlayBuffering", + "requestBody": { + "description": "The player status.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BufferRequestDto" + } + ], + "description": "Class BufferRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BufferRequestDto" + } + ], + "description": "Class BufferRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BufferRequestDto" + } + ], + "description": "Class BufferRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Group state update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Join": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Join an existing SyncPlay group.", + "operationId": "SyncPlayJoinGroup", + "requestBody": { + "description": "The group to join.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/JoinGroupRequestDto" + } + ], + "description": "Class JoinGroupRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/JoinGroupRequestDto" + } + ], + "description": "Class JoinGroupRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/JoinGroupRequestDto" + } + ], + "description": "Class JoinGroupRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Group join successful." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayJoinGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Leave": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Leave the joined SyncPlay group.", + "operationId": "SyncPlayLeaveGroup", + "responses": { + "204": { + "description": "Group leave successful." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/List": { + "get": { + "tags": [ + "SyncPlay" + ], + "summary": "Gets all SyncPlay groups.", + "operationId": "SyncPlayGetGroups", + "responses": { + "200": { + "description": "Groups returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupInfoDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupInfoDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupInfoDto" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayJoinGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/MovePlaylistItem": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to move an item in the playlist in SyncPlay group.", + "operationId": "SyncPlayMovePlaylistItem", + "requestBody": { + "description": "The new position for the item.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovePlaylistItemRequestDto" + } + ], + "description": "Class MovePlaylistItemRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovePlaylistItemRequestDto" + } + ], + "description": "Class MovePlaylistItemRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovePlaylistItemRequestDto" + } + ], + "description": "Class MovePlaylistItemRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/New": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Create a new SyncPlay group.", + "operationId": "SyncPlayCreateGroup", + "requestBody": { + "description": "The settings of the new group.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NewGroupRequestDto" + } + ], + "description": "Class NewGroupRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NewGroupRequestDto" + } + ], + "description": "Class NewGroupRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NewGroupRequestDto" + } + ], + "description": "Class NewGroupRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "New group created." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayCreateGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/NextItem": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request next item in SyncPlay group.", + "operationId": "SyncPlayNextItem", + "requestBody": { + "description": "The current item information.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NextItemRequestDto" + } + ], + "description": "Class NextItemRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NextItemRequestDto" + } + ], + "description": "Class NextItemRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NextItemRequestDto" + } + ], + "description": "Class NextItemRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Next item update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Pause": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request pause in SyncPlay group.", + "operationId": "SyncPlayPause", + "responses": { + "204": { + "description": "Pause update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Ping": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Update session ping.", + "operationId": "SyncPlayPing", + "requestBody": { + "description": "The new ping.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PingRequestDto" + } + ], + "description": "Class PingRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PingRequestDto" + } + ], + "description": "Class PingRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PingRequestDto" + } + ], + "description": "Class PingRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Ping updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/PreviousItem": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request previous item in SyncPlay group.", + "operationId": "SyncPlayPreviousItem", + "requestBody": { + "description": "The current item information.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PreviousItemRequestDto" + } + ], + "description": "Class PreviousItemRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PreviousItemRequestDto" + } + ], + "description": "Class PreviousItemRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PreviousItemRequestDto" + } + ], + "description": "Class PreviousItemRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Previous item update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Queue": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to queue items to the playlist of a SyncPlay group.", + "operationId": "SyncPlayQueue", + "requestBody": { + "description": "The items to add.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QueueRequestDto" + } + ], + "description": "Class QueueRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QueueRequestDto" + } + ], + "description": "Class QueueRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QueueRequestDto" + } + ], + "description": "Class QueueRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Ready": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Notify SyncPlay group that member is ready for playback.", + "operationId": "SyncPlayReady", + "requestBody": { + "description": "The player status.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ReadyRequestDto" + } + ], + "description": "Class ReadyRequest." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ReadyRequestDto" + } + ], + "description": "Class ReadyRequest." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ReadyRequestDto" + } + ], + "description": "Class ReadyRequest." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Group state update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/RemoveFromPlaylist": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to remove items from the playlist in SyncPlay group.", + "operationId": "SyncPlayRemoveFromPlaylist", + "requestBody": { + "description": "The items to remove.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoveFromPlaylistRequestDto" + } + ], + "description": "Class RemoveFromPlaylistRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoveFromPlaylistRequestDto" + } + ], + "description": "Class RemoveFromPlaylistRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoveFromPlaylistRequestDto" + } + ], + "description": "Class RemoveFromPlaylistRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Seek": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request seek in SyncPlay group.", + "operationId": "SyncPlaySeek", + "requestBody": { + "description": "The new playback position.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeekRequestDto" + } + ], + "description": "Class SeekRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeekRequestDto" + } + ], + "description": "Class SeekRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeekRequestDto" + } + ], + "description": "Class SeekRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Seek update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/SetIgnoreWait": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request SyncPlay group to ignore member during group-wait.", + "operationId": "SyncPlaySetIgnoreWait", + "requestBody": { + "description": "The settings to set.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/IgnoreWaitRequestDto" + } + ], + "description": "Class IgnoreWaitRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/IgnoreWaitRequestDto" + } + ], + "description": "Class IgnoreWaitRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/IgnoreWaitRequestDto" + } + ], + "description": "Class IgnoreWaitRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Member state updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/SetNewQueue": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to set new playlist in SyncPlay group.", + "operationId": "SyncPlaySetNewQueue", + "requestBody": { + "description": "The new playlist to play in the group.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayRequestDto" + } + ], + "description": "Class PlayRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayRequestDto" + } + ], + "description": "Class PlayRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayRequestDto" + } + ], + "description": "Class PlayRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/SetPlaylistItem": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to change playlist item in SyncPlay group.", + "operationId": "SyncPlaySetPlaylistItem", + "requestBody": { + "description": "The new item to play.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetPlaylistItemRequestDto" + } + ], + "description": "Class SetPlaylistItemRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetPlaylistItemRequestDto" + } + ], + "description": "Class SetPlaylistItemRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetPlaylistItemRequestDto" + } + ], + "description": "Class SetPlaylistItemRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/SetRepeatMode": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to set repeat mode in SyncPlay group.", + "operationId": "SyncPlaySetRepeatMode", + "requestBody": { + "description": "The new repeat mode.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetRepeatModeRequestDto" + } + ], + "description": "Class SetRepeatModeRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetRepeatModeRequestDto" + } + ], + "description": "Class SetRepeatModeRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetRepeatModeRequestDto" + } + ], + "description": "Class SetRepeatModeRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Play queue update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/SetShuffleMode": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to set shuffle mode in SyncPlay group.", + "operationId": "SyncPlaySetShuffleMode", + "requestBody": { + "description": "The new shuffle mode.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetShuffleModeRequestDto" + } + ], + "description": "Class SetShuffleModeRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetShuffleModeRequestDto" + } + ], + "description": "Class SetShuffleModeRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetShuffleModeRequestDto" + } + ], + "description": "Class SetShuffleModeRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Play queue update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Stop": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request stop in SyncPlay group.", + "operationId": "SyncPlayStop", + "responses": { + "204": { + "description": "Stop update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Unpause": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request unpause in SyncPlay group.", + "operationId": "SyncPlayUnpause", + "responses": { + "204": { + "description": "Unpause update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Endpoint": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets information about the request endpoint.", + "operationId": "GetEndpointInfo", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndPointInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/EndPointInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/EndPointInfo" + } + } + } + }, + "403": { + "description": "User does not have permission to get endpoint information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Info": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets information about the server.", + "operationId": "GetSystemInfo", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + } + } + }, + "403": { + "description": "User does not have permission to retrieve information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrIgnoreParentalControl", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Info/Public": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets public information about the server.", + "operationId": "GetPublicSystemInfo", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublicSystemInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PublicSystemInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PublicSystemInfo" + } + } + } + } + } + } + }, + "/System/Logs": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets a list of available server log files.", + "operationId": "GetServerLogs", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogFile" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogFile" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogFile" + } + } + } + } + }, + "403": { + "description": "User does not have permission to get server logs.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/System/Logs/Log": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets a log file.", + "operationId": "GetLogFile", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the log file to get.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Log file retrieved.", + "content": { + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "403": { + "description": "User does not have permission to get log files.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Could not find a log file with the name.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/System/Ping": { + "get": { + "tags": [ + "System" + ], + "summary": "Pings the system.", + "operationId": "GetPingSystem", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "System" + ], + "summary": "Pings the system.", + "operationId": "PostPingSystem", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/System/Restart": { + "post": { + "tags": [ + "System" + ], + "summary": "Restarts the application.", + "operationId": "RestartApplication", + "responses": { + "204": { + "description": "Server restarted." + }, + "403": { + "description": "User does not have permission to restart server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LocalAccessOrRequiresElevation" + ] + } + ] + } + }, + "/System/Shutdown": { + "post": { + "tags": [ + "System" + ], + "summary": "Shuts down the application.", + "operationId": "ShutdownApplication", + "responses": { + "204": { + "description": "Server shut down." + }, + "403": { + "description": "User does not have permission to shutdown server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/System/WakeOnLanInfo": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets wake on lan information.", + "operationId": "GetWakeOnLanInfo", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WakeOnLanInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WakeOnLanInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WakeOnLanInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/GetUtcTime": { + "get": { + "tags": [ + "TimeSync" + ], + "summary": "Gets the current UTC time.", + "operationId": "GetUtcTime", + "responses": { + "200": { + "description": "Time returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UtcTimeResponse" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UtcTimeResponse" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UtcTimeResponse" + } + } + } + } + } + } + }, + "/Tmdb/ClientConfiguration": { + "get": { + "tags": [ + "Tmdb" + ], + "summary": "Gets the TMDb image configuration options.", + "operationId": "TmdbClientConfiguration", + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigImageTypes" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Trailers": { + "get": { + "tags": [ + "Trailers" + ], + "summary": "Finds movies and trailers similar to a given trailer.", + "operationId": "GetTrailers", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id supplied as query parameter; this is required when not using an API key.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "maxOfficialRating", + "in": "query", + "description": "Optional filter by maximum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "hasThemeSong", + "in": "query", + "description": "Optional filter by items with theme songs.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasThemeVideo", + "in": "query", + "description": "Optional filter by items with theme videos.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSubtitles", + "in": "query", + "description": "Optional filter by items with subtitles.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSpecialFeature", + "in": "query", + "description": "Optional filter by items with special features.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTrailer", + "in": "query", + "description": "Optional filter by items with trailers.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentIndexNumber", + "in": "query", + "description": "Optional filter by parent index number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "hasParentalRating", + "in": "query", + "description": "Optional filter by items that have or do not have a parental rating.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isHd", + "in": "query", + "description": "Optional filter by items that are HD or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "is4K", + "in": "query", + "description": "Optional filter by items that are 4K or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "locationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "excludeLocationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isUnaired", + "in": "query", + "description": "Optional filter by items that are unaired episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minCriticRating", + "in": "query", + "description": "Optional filter by minimum critic rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minPremiereDate", + "in": "query", + "description": "Optional. The minimum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSaved", + "in": "query", + "description": "Optional. The minimum last saved date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSavedForUser", + "in": "query", + "description": "Optional. The minimum last saved date for the current user. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "maxPremiereDate", + "in": "query", + "description": "Optional. The maximum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasOverview", + "in": "query", + "description": "Optional filter by items that have an overview or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasImdbId", + "in": "query", + "description": "Optional filter by items that have an IMDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTmdbId", + "in": "query", + "description": "Optional filter by items that have a TMDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTvdbId", + "in": "query", + "description": "Optional filter by items that have a TVDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional filter for live tv movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional filter for live tv series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional filter for live tv news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional filter for live tv kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional filter for live tv sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "excludeItemIds", + "in": "query", + "description": "Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "recursive", + "in": "query", + "description": "When searching within folders, this determines whether or not the search will be recursive. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Filter based on a search term.", + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending, Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "imageTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "isPlayed", + "in": "query", + "description": "Optional filter by items that are played, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "artists", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "artistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albumArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified album artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "contributingArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified contributing artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albums", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "albumIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "ids", + "in": "query", + "description": "Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "videoTypes", + "in": "query", + "description": "Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VideoType" + } + } + }, + { + "name": "minOfficialRating", + "in": "query", + "description": "Optional filter by minimum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "isLocked", + "in": "query", + "description": "Optional filter by items that are locked.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isPlaceHolder", + "in": "query", + "description": "Optional filter by items that are placeholders.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasOfficialRating", + "in": "query", + "description": "Optional filter by items that have official ratings.", + "schema": { + "type": "boolean" + } + }, + { + "name": "collapseBoxSetItems", + "in": "query", + "description": "Whether or not to hide items behind their boxsets.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minWidth", + "in": "query", + "description": "Optional. Filter by the minimum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minHeight", + "in": "query", + "description": "Optional. Filter by the minimum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. Filter by the maximum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. Filter by the maximum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "is3D", + "in": "query", + "description": "Optional filter by items that are 3D, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesStatus", + "in": "query", + "description": "Optional filter by Series Status. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SeriesStatus" + } + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Enable the total record count.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/Trickplay/{width}/{index}.jpg": { + "get": { + "tags": [ + "Trickplay" + ], + "summary": "Gets a trickplay tile image.", + "operationId": "GetTrickplayTileImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "width", + "in": "path", + "description": "The width of a single tile.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "index", + "in": "path", + "description": "The index of the desired tile.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if using an alternate version.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Tile image not found at specified index.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/Trickplay/{width}/tiles.m3u8": { + "get": { + "tags": [ + "Trickplay" + ], + "summary": "Gets an image tiles playlist for trickplay.", + "operationId": "GetTrickplayHlsPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "width", + "in": "path", + "description": "The width of a single tile.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if using an alternate version.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Tiles playlist returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/{seriesId}/Episodes": { + "get": { + "tags": [ + "TvShows" + ], + "summary": "Gets episodes for a tv season.", + "operationId": "GetEpisodes", + "parameters": [ + { + "name": "seriesId", + "in": "path", + "description": "The series id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "season", + "in": "query", + "description": "Optional filter by season number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "seasonId", + "in": "query", + "description": "Optional. Filter by season id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional. Filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startItemId", + "in": "query", + "description": "Optional. Skip through the list until a given item is found.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "enum": [ + "Default", + "AiredEpisodeOrder", + "Album", + "AlbumArtist", + "Artist", + "DateCreated", + "OfficialRating", + "DatePlayed", + "PremiereDate", + "StartDate", + "SortName", + "Name", + "Random", + "Runtime", + "CommunityRating", + "ProductionYear", + "PlayCount", + "CriticRating", + "IsFolder", + "IsUnplayed", + "IsPlayed", + "SeriesSortName", + "VideoBitRate", + "AirTime", + "Studio", + "IsFavoriteOrLiked", + "DateLastContentAdded", + "SeriesDatePlayed", + "ParentIndexNumber", + "IndexNumber", + "SimilarityScore", + "SearchScore" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ItemSortBy" + } + ] + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/{seriesId}/Seasons": { + "get": { + "tags": [ + "TvShows" + ], + "summary": "Gets seasons for a tv series.", + "operationId": "GetSeasons", + "parameters": [ + { + "name": "seriesId", + "in": "path", + "description": "The series id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "isSpecialSeason", + "in": "query", + "description": "Optional. Filter by special season.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional. Filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/NextUp": { + "get": { + "tags": [ + "TvShows" + ], + "summary": "Gets a list of next up episodes.", + "operationId": "GetNextUp", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id of the user to get the next up episodes for.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "seriesId", + "in": "query", + "description": "Optional. Filter by series id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "nextUpDateCutoff", + "in": "query", + "description": "Optional. Starting date of shows to show in Next Up section.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Whether to enable the total records count. Defaults to true.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "disableFirstEpisode", + "in": "query", + "description": "Whether to disable sending the first episode in a series as next up.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableResumable", + "in": "query", + "description": "Whether to include resumable episodes in next up results.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableRewatching", + "in": "query", + "description": "Whether to include watched episodes in next up results.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/Upcoming": { + "get": { + "tags": [ + "TvShows" + ], + "summary": "Gets a list of upcoming episodes.", + "operationId": "GetUpcomingEpisodes", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id of the user to get the upcoming episodes for.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/universal": { + "get": { + "tags": [ + "UniversalAudio" + ], + "summary": "Gets an audio stream.", + "operationId": "GetUniversalAudioStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "Optional. The audio container.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. The audio codec to transcode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "transcodingAudioChannels", + "in": "query", + "description": "Optional. The number of how many audio channels to transcode to.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "transcodingContainer", + "in": "query", + "description": "Optional. The container to transcode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodingProtocol", + "in": "query", + "description": "Optional. The transcoding protocol.", + "schema": { + "enum": [ + "http", + "hls" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaStreamProtocol" + } + ] + } + }, + { + "name": "maxAudioSampleRate", + "in": "query", + "description": "Optional. The maximum audio sample rate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableRemoteMedia", + "in": "query", + "description": "Optional. Whether to enable remote media.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableRedirection", + "in": "query", + "description": "Whether to enable redirection. Defaults to true.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "302": { + "description": "Redirected to remote audio stream." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "head": { + "tags": [ + "UniversalAudio" + ], + "summary": "Gets an audio stream.", + "operationId": "HeadUniversalAudioStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "Optional. The audio container.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. The audio codec to transcode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "transcodingAudioChannels", + "in": "query", + "description": "Optional. The number of how many audio channels to transcode to.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "transcodingContainer", + "in": "query", + "description": "Optional. The container to transcode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodingProtocol", + "in": "query", + "description": "Optional. The transcoding protocol.", + "schema": { + "enum": [ + "http", + "hls" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaStreamProtocol" + } + ] + } + }, + { + "name": "maxAudioSampleRate", + "in": "query", + "description": "Optional. The maximum audio sample rate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableRemoteMedia", + "in": "query", + "description": "Optional. Whether to enable remote media.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableRedirection", + "in": "query", + "description": "Whether to enable redirection. Defaults to true.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "302": { + "description": "Redirected to remote audio stream." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users": { + "get": { + "tags": [ + "User" + ], + "summary": "Gets a list of users.", + "operationId": "GetUsers", + "parameters": [ + { + "name": "isHidden", + "in": "query", + "description": "Optional filter by IsHidden=true or false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isDisabled", + "in": "query", + "description": "Optional filter by IsDisabled=true or false.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Users returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user.", + "operationId": "UpdateUser", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The updated user model.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "User updated." + }, + "400": { + "description": "User information was not supplied.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User update forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}": { + "get": { + "tags": [ + "User" + ], + "summary": "Gets a user by Id.", + "operationId": "GetUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "User returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + } + } + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "IgnoreParentalControl", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "User" + ], + "summary": "Deletes a user.", + "operationId": "DeleteUser", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "User deleted." + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Users/{userId}/Policy": { + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user policy.", + "operationId": "UpdateUserPolicy", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The new user policy.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserPolicy" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserPolicy" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserPolicy" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "User policy updated." + }, + "400": { + "description": "User policy was not supplied.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User policy update forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Users/AuthenticateByName": { + "post": { + "tags": [ + "User" + ], + "summary": "Authenticates a user by name.", + "operationId": "AuthenticateUserByName", + "requestBody": { + "description": "The M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) request.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AuthenticateUserByName" + } + ], + "description": "The authenticate user by name request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AuthenticateUserByName" + } + ], + "description": "The authenticate user by name request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AuthenticateUserByName" + } + ], + "description": "The authenticate user by name request body." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "User authenticated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + } + } + } + } + } + }, + "/Users/AuthenticateWithQuickConnect": { + "post": { + "tags": [ + "User" + ], + "summary": "Authenticates a user with quick connect.", + "operationId": "AuthenticateWithQuickConnect", + "requestBody": { + "description": "The Jellyfin.Api.Models.UserDtos.QuickConnectDto request.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QuickConnectDto" + } + ], + "description": "The quick connect request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QuickConnectDto" + } + ], + "description": "The quick connect request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QuickConnectDto" + } + ], + "description": "The quick connect request body." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "User authenticated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + } + } + }, + "400": { + "description": "Missing token." + } + } + } + }, + "/Users/Configuration": { + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user configuration.", + "operationId": "UpdateUserConfiguration", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The new user configuration.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserConfiguration" + } + ], + "description": "Class UserConfiguration." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserConfiguration" + } + ], + "description": "Class UserConfiguration." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserConfiguration" + } + ], + "description": "Class UserConfiguration." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "User configuration updated." + }, + "403": { + "description": "User configuration update forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/ForgotPassword": { + "post": { + "tags": [ + "User" + ], + "summary": "Initiates the forgot password process for a local user.", + "operationId": "ForgotPassword", + "requestBody": { + "description": "The forgot password request containing the entered username.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordDto" + } + ], + "description": "Forgot Password request body DTO." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordDto" + } + ], + "description": "Forgot Password request body DTO." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordDto" + } + ], + "description": "Forgot Password request body DTO." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Password reset process started.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForgotPasswordResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ForgotPasswordResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ForgotPasswordResult" + } + } + } + } + } + } + }, + "/Users/ForgotPassword/Pin": { + "post": { + "tags": [ + "User" + ], + "summary": "Redeems a forgot password pin.", + "operationId": "ForgotPasswordPin", + "requestBody": { + "description": "The forgot password pin request containing the entered pin.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordPinDto" + } + ], + "description": "Forgot Password Pin enter request body DTO." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordPinDto" + } + ], + "description": "Forgot Password Pin enter request body DTO." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordPinDto" + } + ], + "description": "Forgot Password Pin enter request body DTO." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Pin reset process started.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PinRedeemResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PinRedeemResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PinRedeemResult" + } + } + } + } + } + } + }, + "/Users/Me": { + "get": { + "tags": [ + "User" + ], + "summary": "Gets the user based on auth token.", + "operationId": "GetCurrentUser", + "responses": { + "200": { + "description": "User returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + } + } + }, + "400": { + "description": "Token is not owned by a user.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/New": { + "post": { + "tags": [ + "User" + ], + "summary": "Creates a user.", + "operationId": "CreateUserByName", + "requestBody": { + "description": "The create user by name request body.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreateUserByName" + } + ], + "description": "The create user by name request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreateUserByName" + } + ], + "description": "The create user by name request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreateUserByName" + } + ], + "description": "The create user by name request body." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "User created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Users/Password": { + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user's password.", + "operationId": "UpdateUserPassword", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Nullable{System.Guid},Jellyfin.Api.Models.UserDtos.UpdateUserPassword) request.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserPassword" + } + ], + "description": "The update user password request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserPassword" + } + ], + "description": "The update user password request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserPassword" + } + ], + "description": "The update user password request body." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Password successfully reset." + }, + "403": { + "description": "User is not allowed to update the password.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/Public": { + "get": { + "tags": [ + "User" + ], + "summary": "Gets a list of publicly visible users for display on a login screen.", + "operationId": "GetPublicUsers", + "responses": { + "200": { + "description": "Public users returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + } + } + } + } + } + }, + "/Items/{itemId}/Intros": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets intros to play before the main media item plays.", + "operationId": "GetIntros", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Intros returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/LocalTrailers": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets local trailers for an item.", + "operationId": "GetLocalTrailers", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "An Microsoft.AspNetCore.Mvc.OkResult containing the item's local trailers.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/SpecialFeatures": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets special features for an item.", + "operationId": "GetSpecialFeatures", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Special features returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Latest": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets latest media.", + "operationId": "GetLatestMedia", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isPlayed", + "in": "query", + "description": "Filter by items that are played, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "limit", + "in": "query", + "description": "Return item limit.", + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + } + }, + { + "name": "groupItems", + "in": "query", + "description": "Whether or not to group items into a parent container.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Latest media returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Root": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets the root folder from a user's library.", + "operationId": "GetRootFolder", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Root folder returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserFavoriteItems/{itemId}": { + "post": { + "tags": [ + "UserLibrary" + ], + "summary": "Marks an item as a favorite.", + "operationId": "MarkFavoriteItem", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item marked as favorite.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "UserLibrary" + ], + "summary": "Unmarks item as a favorite.", + "operationId": "UnmarkFavoriteItem", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item unmarked as favorite.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserItems/{itemId}/Rating": { + "delete": { + "tags": [ + "UserLibrary" + ], + "summary": "Deletes a user's saved personal rating for an item.", + "operationId": "DeleteUserItemRating", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Personal rating removed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "UserLibrary" + ], + "summary": "Updates a user's rating for an item.", + "operationId": "UpdateUserItemRating", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "likes", + "in": "query", + "description": "Whether this M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Nullable{System.Guid},System.Guid,System.Nullable{System.Boolean}) is likes.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Item rating updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserViews": { + "get": { + "tags": [ + "UserViews" + ], + "summary": "Get user views.", + "operationId": "GetUserViews", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeExternalContent", + "in": "query", + "description": "Whether or not to include external views such as channels or live tv.", + "schema": { + "type": "boolean" + } + }, + { + "name": "presetViews", + "in": "query", + "description": "Preset views.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CollectionType" + } + } + }, + { + "name": "includeHidden", + "in": "query", + "description": "Whether or not to include hidden content.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "User views returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserViews/GroupingOptions": { + "get": { + "tags": [ + "UserViews" + ], + "summary": "Get user view grouping options.", + "operationId": "GetGroupingOptions", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "User view grouping options returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SpecialViewOptionDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SpecialViewOptionDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SpecialViewOptionDto" + } + } + } + } + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{videoId}/{mediaSourceId}/Attachments/{index}": { + "get": { + "tags": [ + "VideoAttachments" + ], + "summary": "Get video attachment.", + "operationId": "GetAttachment", + "parameters": [ + { + "name": "videoId", + "in": "path", + "description": "Video ID.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "path", + "description": "Media Source ID.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "index", + "in": "path", + "description": "Attachment Index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Attachment retrieved.", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Video or attachment not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Videos/{itemId}/AdditionalParts": { + "get": { + "tags": [ + "Videos" + ], + "summary": "Gets additional parts for a video.", + "operationId": "GetAdditionalPart", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Additional parts returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/AlternateSources": { + "delete": { + "tags": [ + "Videos" + ], + "summary": "Removes alternate video sources.", + "operationId": "DeleteAlternateSources", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Alternate sources deleted." + }, + "404": { + "description": "Video not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Videos/{itemId}/stream": { + "get": { + "tags": [ + "Videos" + ], + "summary": "Gets a video stream.", + "operationId": "GetVideoStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "head": { + "tags": [ + "Videos" + ], + "summary": "Gets a video stream.", + "operationId": "HeadVideoStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/Videos/{itemId}/stream.{container}": { + "get": { + "tags": [ + "Videos" + ], + "summary": "Gets a video stream.", + "operationId": "GetVideoStreamByContainer", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "path", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "head": { + "tags": [ + "Videos" + ], + "summary": "Gets a video stream.", + "operationId": "HeadVideoStreamByContainer", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "path", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/Videos/MergeVersions": { + "post": { + "tags": [ + "Videos" + ], + "summary": "Merges videos into a single record.", + "operationId": "MergeVersions", + "parameters": [ + { + "name": "ids", + "in": "query", + "description": "Item id list. This allows multiple, comma delimited.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "204": { + "description": "Videos merged." + }, + "400": { + "description": "Supply at least 2 video ids.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Years": { + "get": { + "tags": [ + "Years" + ], + "summary": "Get years.", + "operationId": "GetYears", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Skips over a given number of items within the results. Use for paging.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be excluded based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be included based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional. Filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "recursive", + "in": "query", + "description": "Search recursively.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Year query returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Years/{year}": { + "get": { + "tags": [ + "Years" + ], + "summary": "Gets a year.", + "operationId": "GetYear", + "parameters": [ + { + "name": "year", + "in": "path", + "description": "The year.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Year returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "404": { + "description": "Year not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "AccessSchedule": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets the id of this instance.", + "format": "int32", + "readOnly": true + }, + "UserId": { + "type": "string", + "description": "Gets the id of the associated user.", + "format": "uuid" + }, + "DayOfWeek": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Everyday", + "Weekday", + "Weekend" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DynamicDayOfWeek" + } + ], + "description": "Gets or sets the day of week." + }, + "StartHour": { + "type": "number", + "description": "Gets or sets the start hour.", + "format": "double" + }, + "EndHour": { + "type": "number", + "description": "Gets or sets the end hour.", + "format": "double" + } + }, + "additionalProperties": false, + "description": "An entity representing a user's access schedule." + }, + "ActivityLogEntry": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets or sets the identifier.", + "format": "int64" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "Overview": { + "type": "string", + "description": "Gets or sets the overview.", + "nullable": true + }, + "ShortOverview": { + "type": "string", + "description": "Gets or sets the short overview.", + "nullable": true + }, + "Type": { + "type": "string", + "description": "Gets or sets the type." + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "nullable": true + }, + "Date": { + "type": "string", + "description": "Gets or sets the date.", + "format": "date-time" + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user identifier.", + "format": "uuid" + }, + "UserPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the user primary image tag.", + "nullable": true, + "deprecated": true + }, + "Severity": { + "enum": [ + "Trace", + "Debug", + "Information", + "Warning", + "Error", + "Critical", + "None" + ], + "allOf": [ + { + "$ref": "#/components/schemas/LogLevel" + } + ], + "description": "Gets or sets the log severity." + } + }, + "additionalProperties": false, + "description": "An activity log entry." + }, + "ActivityLogEntryMessage": { + "type": "object", + "properties": { + "Data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ActivityLogEntry" + }, + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ActivityLogEntry", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Activity log created message." + }, + "ActivityLogEntryQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ActivityLogEntry" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "ActivityLogEntryStartMessage": { + "type": "object", + "properties": { + "Data": { + "type": "string", + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ActivityLogEntryStart", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Activity log entry start message.\r\nData is the timing data encoded as \"$initialDelay,$interval\" in ms." + }, + "ActivityLogEntryStopMessage": { + "type": "object", + "properties": { + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ActivityLogEntryStop", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Activity log entry stop message." + }, + "AddVirtualFolderDto": { + "type": "object", + "properties": { + "LibraryOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/LibraryOptions" + } + ], + "description": "Gets or sets library options.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Add virtual folder dto." + }, + "AlbumInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "AlbumArtists": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the album artist." + }, + "ArtistProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the artist provider ids." + }, + "SongInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SongInfo" + } + } + }, + "additionalProperties": false + }, + "AlbumInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/AlbumInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "AllThemeMediaResult": { + "type": "object", + "properties": { + "ThemeVideosResult": { + "allOf": [ + { + "$ref": "#/components/schemas/ThemeMediaResult" + } + ], + "description": "Class ThemeMediaResult.", + "nullable": true + }, + "ThemeSongsResult": { + "allOf": [ + { + "$ref": "#/components/schemas/ThemeMediaResult" + } + ], + "description": "Class ThemeMediaResult.", + "nullable": true + }, + "SoundtrackSongsResult": { + "allOf": [ + { + "$ref": "#/components/schemas/ThemeMediaResult" + } + ], + "description": "Class ThemeMediaResult.", + "nullable": true + } + }, + "additionalProperties": false + }, + "ArtistInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "SongInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SongInfo" + } + } + }, + "additionalProperties": false + }, + "ArtistInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/ArtistInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "AudioSpatialFormat": { + "enum": [ + "None", + "DolbyAtmos", + "DTSX" + ], + "type": "string", + "description": "An enum representing formats of spatial audio." + }, + "AuthenticateUserByName": { + "type": "object", + "properties": { + "Username": { + "type": "string", + "description": "Gets or sets the username.", + "nullable": true + }, + "Pw": { + "type": "string", + "description": "Gets or sets the plain text password.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The authenticate user by name request body." + }, + "AuthenticationInfo": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets or sets the identifier.", + "format": "int64" + }, + "AccessToken": { + "type": "string", + "description": "Gets or sets the access token.", + "nullable": true + }, + "DeviceId": { + "type": "string", + "description": "Gets or sets the device identifier.", + "nullable": true + }, + "AppName": { + "type": "string", + "description": "Gets or sets the name of the application.", + "nullable": true + }, + "AppVersion": { + "type": "string", + "description": "Gets or sets the application version.", + "nullable": true + }, + "DeviceName": { + "type": "string", + "description": "Gets or sets the name of the device.", + "nullable": true + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user identifier.", + "format": "uuid" + }, + "IsActive": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is active." + }, + "DateCreated": { + "type": "string", + "description": "Gets or sets the date created.", + "format": "date-time" + }, + "DateRevoked": { + "type": "string", + "description": "Gets or sets the date revoked.", + "format": "date-time", + "nullable": true + }, + "DateLastActivity": { + "type": "string", + "format": "date-time" + }, + "UserName": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "AuthenticationInfoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AuthenticationInfo" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "AuthenticationResult": { + "type": "object", + "properties": { + "User": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Gets or sets the user.", + "nullable": true + }, + "SessionInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/SessionInfoDto" + } + ], + "description": "Gets or sets the session info.", + "nullable": true + }, + "AccessToken": { + "type": "string", + "description": "Gets or sets the access token.", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server id.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "A class representing an authentication result." + }, + "BaseItemDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server identifier.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "format": "uuid" + }, + "Etag": { + "type": "string", + "description": "Gets or sets the etag.", + "nullable": true + }, + "SourceType": { + "type": "string", + "description": "Gets or sets the type of the source.", + "nullable": true + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist item identifier.", + "nullable": true + }, + "DateCreated": { + "type": "string", + "description": "Gets or sets the date created.", + "format": "date-time", + "nullable": true + }, + "DateLastMediaAdded": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "ExtraType": { + "enum": [ + "Unknown", + "Clip", + "Trailer", + "BehindTheScenes", + "DeletedScene", + "Interview", + "Scene", + "Sample", + "ThemeSong", + "ThemeVideo", + "Featurette", + "Short" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ExtraType" + } + ], + "nullable": true + }, + "AirsBeforeSeasonNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AirsAfterSeasonNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AirsBeforeEpisodeNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "CanDelete": { + "type": "boolean", + "nullable": true + }, + "CanDownload": { + "type": "boolean", + "nullable": true + }, + "HasLyrics": { + "type": "boolean", + "nullable": true + }, + "HasSubtitles": { + "type": "boolean", + "nullable": true + }, + "PreferredMetadataLanguage": { + "type": "string", + "nullable": true + }, + "PreferredMetadataCountryCode": { + "type": "string", + "nullable": true + }, + "Container": { + "type": "string", + "nullable": true + }, + "SortName": { + "type": "string", + "description": "Gets or sets the name of the sort.", + "nullable": true + }, + "ForcedSortName": { + "type": "string", + "nullable": true + }, + "Video3DFormat": { + "enum": [ + "HalfSideBySide", + "FullSideBySide", + "FullTopAndBottom", + "HalfTopAndBottom", + "MVC" + ], + "allOf": [ + { + "$ref": "#/components/schemas/Video3DFormat" + } + ], + "description": "Gets or sets the video3 D format.", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "description": "Gets or sets the premiere date.", + "format": "date-time", + "nullable": true + }, + "ExternalUrls": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalUrl" + }, + "description": "Gets or sets the external urls.", + "nullable": true + }, + "MediaSources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaSourceInfo" + }, + "description": "Gets or sets the media versions.", + "nullable": true + }, + "CriticRating": { + "type": "number", + "description": "Gets or sets the critic rating.", + "format": "float", + "nullable": true + }, + "ProductionLocations": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "EnableMediaSourceDisplay": { + "type": "boolean", + "nullable": true + }, + "OfficialRating": { + "type": "string", + "description": "Gets or sets the official rating.", + "nullable": true + }, + "CustomRating": { + "type": "string", + "description": "Gets or sets the custom rating.", + "nullable": true + }, + "ChannelId": { + "type": "string", + "description": "Gets or sets the channel identifier.", + "format": "uuid", + "nullable": true + }, + "ChannelName": { + "type": "string", + "nullable": true + }, + "Overview": { + "type": "string", + "description": "Gets or sets the overview.", + "nullable": true + }, + "Taglines": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the taglines.", + "nullable": true + }, + "Genres": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the genres.", + "nullable": true + }, + "CommunityRating": { + "type": "number", + "description": "Gets or sets the community rating.", + "format": "float", + "nullable": true + }, + "CumulativeRunTimeTicks": { + "type": "integer", + "description": "Gets or sets the cumulative run time ticks.", + "format": "int64", + "nullable": true + }, + "RunTimeTicks": { + "type": "integer", + "description": "Gets or sets the run time ticks.", + "format": "int64", + "nullable": true + }, + "PlayAccess": { + "enum": [ + "Full", + "None" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayAccess" + } + ], + "description": "Gets or sets the play access.", + "nullable": true + }, + "AspectRatio": { + "type": "string", + "description": "Gets or sets the aspect ratio.", + "nullable": true + }, + "ProductionYear": { + "type": "integer", + "description": "Gets or sets the production year.", + "format": "int32", + "nullable": true + }, + "IsPlaceHolder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is place holder.", + "nullable": true + }, + "Number": { + "type": "string", + "description": "Gets or sets the number.", + "nullable": true + }, + "ChannelNumber": { + "type": "string", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "description": "Gets or sets the index number.", + "format": "int32", + "nullable": true + }, + "IndexNumberEnd": { + "type": "integer", + "description": "Gets or sets the index number end.", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "description": "Gets or sets the parent index number.", + "format": "int32", + "nullable": true + }, + "RemoteTrailers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaUrl" + }, + "description": "Gets or sets the trailer urls.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "IsHD": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is HD.", + "nullable": true + }, + "IsFolder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is folder.", + "nullable": true + }, + "ParentId": { + "type": "string", + "description": "Gets or sets the parent id.", + "format": "uuid", + "nullable": true + }, + "Type": { + "enum": [ + "AggregateFolder", + "Audio", + "AudioBook", + "BasePluginFolder", + "Book", + "BoxSet", + "Channel", + "ChannelFolderItem", + "CollectionFolder", + "Episode", + "Folder", + "Genre", + "ManualPlaylistsFolder", + "Movie", + "LiveTvChannel", + "LiveTvProgram", + "MusicAlbum", + "MusicArtist", + "MusicGenre", + "MusicVideo", + "Person", + "Photo", + "PhotoAlbum", + "Playlist", + "PlaylistsFolder", + "Program", + "Recording", + "Season", + "Series", + "Studio", + "Trailer", + "TvChannel", + "TvProgram", + "UserRootFolder", + "UserView", + "Video", + "Year" + ], + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemKind" + } + ], + "description": "Gets or sets the type." + }, + "People": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemPerson" + }, + "description": "Gets or sets the people.", + "nullable": true + }, + "Studios": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "description": "Gets or sets the studios.", + "nullable": true + }, + "GenreItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "nullable": true + }, + "ParentLogoItemId": { + "type": "string", + "description": "Gets or sets whether the item has a logo, this will hold the Id of the Parent that has one.", + "format": "uuid", + "nullable": true + }, + "ParentBackdropItemId": { + "type": "string", + "description": "Gets or sets whether the item has any backdrops, this will hold the Id of the Parent that has one.", + "format": "uuid", + "nullable": true + }, + "ParentBackdropImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the parent backdrop image tags.", + "nullable": true + }, + "LocalTrailerCount": { + "type": "integer", + "description": "Gets or sets the local trailer count.", + "format": "int32", + "nullable": true + }, + "UserData": { + "allOf": [ + { + "$ref": "#/components/schemas/UserItemDataDto" + } + ], + "description": "Gets or sets the user data for this item based on the user it's being requested for.", + "nullable": true + }, + "RecursiveItemCount": { + "type": "integer", + "description": "Gets or sets the recursive item count.", + "format": "int32", + "nullable": true + }, + "ChildCount": { + "type": "integer", + "description": "Gets or sets the child count.", + "format": "int32", + "nullable": true + }, + "SeriesName": { + "type": "string", + "description": "Gets or sets the name of the series.", + "nullable": true + }, + "SeriesId": { + "type": "string", + "description": "Gets or sets the series id.", + "format": "uuid", + "nullable": true + }, + "SeasonId": { + "type": "string", + "description": "Gets or sets the season identifier.", + "format": "uuid", + "nullable": true + }, + "SpecialFeatureCount": { + "type": "integer", + "description": "Gets or sets the special feature count.", + "format": "int32", + "nullable": true + }, + "DisplayPreferencesId": { + "type": "string", + "description": "Gets or sets the display preferences id.", + "nullable": true + }, + "Status": { + "type": "string", + "description": "Gets or sets the status.", + "nullable": true + }, + "AirTime": { + "type": "string", + "description": "Gets or sets the air time.", + "nullable": true + }, + "AirDays": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DayOfWeek" + }, + "description": "Gets or sets the air days.", + "nullable": true + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the tags.", + "nullable": true + }, + "PrimaryImageAspectRatio": { + "type": "number", + "description": "Gets or sets the primary image aspect ratio, after image enhancements.", + "format": "double", + "nullable": true + }, + "Artists": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the artists.", + "nullable": true + }, + "ArtistItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "description": "Gets or sets the artist items.", + "nullable": true + }, + "Album": { + "type": "string", + "description": "Gets or sets the album.", + "nullable": true + }, + "CollectionType": { + "enum": [ + "unknown", + "movies", + "tvshows", + "music", + "musicvideos", + "trailers", + "homevideos", + "boxsets", + "books", + "photos", + "livetv", + "playlists", + "folders" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CollectionType" + } + ], + "description": "Gets or sets the type of the collection.", + "nullable": true + }, + "DisplayOrder": { + "type": "string", + "description": "Gets or sets the display order.", + "nullable": true + }, + "AlbumId": { + "type": "string", + "description": "Gets or sets the album id.", + "format": "uuid", + "nullable": true + }, + "AlbumPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the album image tag.", + "nullable": true + }, + "SeriesPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the series primary image tag.", + "nullable": true + }, + "AlbumArtist": { + "type": "string", + "description": "Gets or sets the album artist.", + "nullable": true + }, + "AlbumArtists": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "description": "Gets or sets the album artists.", + "nullable": true + }, + "SeasonName": { + "type": "string", + "description": "Gets or sets the name of the season.", + "nullable": true + }, + "MediaStreams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaStream" + }, + "description": "Gets or sets the media streams.", + "nullable": true + }, + "VideoType": { + "enum": [ + "VideoFile", + "Iso", + "Dvd", + "BluRay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/VideoType" + } + ], + "description": "Gets or sets the type of the video.", + "nullable": true + }, + "PartCount": { + "type": "integer", + "description": "Gets or sets the part count.", + "format": "int32", + "nullable": true + }, + "MediaSourceCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ImageTags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Gets or sets the image tags.", + "nullable": true + }, + "BackdropImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the backdrop image tags.", + "nullable": true + }, + "ScreenshotImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the screenshot image tags.", + "nullable": true + }, + "ParentLogoImageTag": { + "type": "string", + "description": "Gets or sets the parent logo image tag.", + "nullable": true + }, + "ParentArtItemId": { + "type": "string", + "description": "Gets or sets whether the item has fan art, this will hold the Id of the Parent that has one.", + "format": "uuid", + "nullable": true + }, + "ParentArtImageTag": { + "type": "string", + "description": "Gets or sets the parent art image tag.", + "nullable": true + }, + "SeriesThumbImageTag": { + "type": "string", + "description": "Gets or sets the series thumb image tag.", + "nullable": true + }, + "ImageBlurHashes": { + "type": "object", + "properties": { + "Primary": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Art": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Backdrop": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Banner": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Logo": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Thumb": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Disc": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Box": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Screenshot": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Menu": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Chapter": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "BoxRear": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Profile": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "Gets or sets the blurhashes for the image tags.\r\nMaps image type to dictionary mapping image tag to blurhash value.", + "nullable": true + }, + "SeriesStudio": { + "type": "string", + "description": "Gets or sets the series studio.", + "nullable": true + }, + "ParentThumbItemId": { + "type": "string", + "description": "Gets or sets the parent thumb item id.", + "format": "uuid", + "nullable": true + }, + "ParentThumbImageTag": { + "type": "string", + "description": "Gets or sets the parent thumb image tag.", + "nullable": true + }, + "ParentPrimaryImageItemId": { + "type": "string", + "description": "Gets or sets the parent primary image item identifier.", + "nullable": true + }, + "ParentPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the parent primary image tag.", + "nullable": true + }, + "Chapters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChapterInfo" + }, + "description": "Gets or sets the chapters.", + "nullable": true + }, + "Trickplay": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/TrickplayInfo" + } + }, + "description": "Gets or sets the trickplay manifest.", + "nullable": true + }, + "LocationType": { + "enum": [ + "FileSystem", + "Remote", + "Virtual", + "Offline" + ], + "allOf": [ + { + "$ref": "#/components/schemas/LocationType" + } + ], + "description": "Gets or sets the type of the location.", + "nullable": true + }, + "IsoType": { + "enum": [ + "Dvd", + "BluRay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/IsoType" + } + ], + "description": "Gets or sets the type of the iso.", + "nullable": true + }, + "MediaType": { + "enum": [ + "Unknown", + "Video", + "Audio", + "Photo", + "Book" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaType" + } + ], + "description": "Gets or sets the type of the media.", + "default": "Unknown" + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date.", + "format": "date-time", + "nullable": true + }, + "LockedFields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetadataField" + }, + "description": "Gets or sets the locked fields.", + "nullable": true + }, + "TrailerCount": { + "type": "integer", + "description": "Gets or sets the trailer count.", + "format": "int32", + "nullable": true + }, + "MovieCount": { + "type": "integer", + "description": "Gets or sets the movie count.", + "format": "int32", + "nullable": true + }, + "SeriesCount": { + "type": "integer", + "description": "Gets or sets the series count.", + "format": "int32", + "nullable": true + }, + "ProgramCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "EpisodeCount": { + "type": "integer", + "description": "Gets or sets the episode count.", + "format": "int32", + "nullable": true + }, + "SongCount": { + "type": "integer", + "description": "Gets or sets the song count.", + "format": "int32", + "nullable": true + }, + "AlbumCount": { + "type": "integer", + "description": "Gets or sets the album count.", + "format": "int32", + "nullable": true + }, + "ArtistCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "MusicVideoCount": { + "type": "integer", + "description": "Gets or sets the music video count.", + "format": "int32", + "nullable": true + }, + "LockData": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [enable internet providers].", + "nullable": true + }, + "Width": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "Height": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "CameraMake": { + "type": "string", + "nullable": true + }, + "CameraModel": { + "type": "string", + "nullable": true + }, + "Software": { + "type": "string", + "nullable": true + }, + "ExposureTime": { + "type": "number", + "format": "double", + "nullable": true + }, + "FocalLength": { + "type": "number", + "format": "double", + "nullable": true + }, + "ImageOrientation": { + "enum": [ + "TopLeft", + "TopRight", + "BottomRight", + "BottomLeft", + "LeftTop", + "RightTop", + "RightBottom", + "LeftBottom" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageOrientation" + } + ], + "nullable": true + }, + "Aperture": { + "type": "number", + "format": "double", + "nullable": true + }, + "ShutterSpeed": { + "type": "number", + "format": "double", + "nullable": true + }, + "Latitude": { + "type": "number", + "format": "double", + "nullable": true + }, + "Longitude": { + "type": "number", + "format": "double", + "nullable": true + }, + "Altitude": { + "type": "number", + "format": "double", + "nullable": true + }, + "IsoSpeedRating": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "SeriesTimerId": { + "type": "string", + "description": "Gets or sets the series timer identifier.", + "nullable": true + }, + "ProgramId": { + "type": "string", + "description": "Gets or sets the program identifier.", + "nullable": true + }, + "ChannelPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the channel primary image tag.", + "nullable": true + }, + "StartDate": { + "type": "string", + "description": "Gets or sets the start date of the recording, in UTC.", + "format": "date-time", + "nullable": true + }, + "CompletionPercentage": { + "type": "number", + "description": "Gets or sets the completion percentage.", + "format": "double", + "nullable": true + }, + "IsRepeat": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is repeat.", + "nullable": true + }, + "EpisodeTitle": { + "type": "string", + "description": "Gets or sets the episode title.", + "nullable": true + }, + "ChannelType": { + "enum": [ + "TV", + "Radio" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ChannelType" + } + ], + "description": "Gets or sets the type of the channel.", + "nullable": true + }, + "Audio": { + "enum": [ + "Mono", + "Stereo", + "Dolby", + "DolbyDigital", + "Thx", + "Atmos" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ProgramAudio" + } + ], + "description": "Gets or sets the audio.", + "nullable": true + }, + "IsMovie": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is movie.", + "nullable": true + }, + "IsSports": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is sports.", + "nullable": true + }, + "IsSeries": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is series.", + "nullable": true + }, + "IsLive": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is live.", + "nullable": true + }, + "IsNews": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is news.", + "nullable": true + }, + "IsKids": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is kids.", + "nullable": true + }, + "IsPremiere": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is premiere.", + "nullable": true + }, + "TimerId": { + "type": "string", + "description": "Gets or sets the timer identifier.", + "nullable": true + }, + "NormalizationGain": { + "type": "number", + "description": "Gets or sets the gain required for audio normalization.", + "format": "float", + "nullable": true + }, + "CurrentProgram": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the current program.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + }, + "BaseItemDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "BaseItemKind": { + "enum": [ + "AggregateFolder", + "Audio", + "AudioBook", + "BasePluginFolder", + "Book", + "BoxSet", + "Channel", + "ChannelFolderItem", + "CollectionFolder", + "Episode", + "Folder", + "Genre", + "ManualPlaylistsFolder", + "Movie", + "LiveTvChannel", + "LiveTvProgram", + "MusicAlbum", + "MusicArtist", + "MusicGenre", + "MusicVideo", + "Person", + "Photo", + "PhotoAlbum", + "Playlist", + "PlaylistsFolder", + "Program", + "Recording", + "Season", + "Series", + "Studio", + "Trailer", + "TvChannel", + "TvProgram", + "UserRootFolder", + "UserView", + "Video", + "Year" + ], + "type": "string", + "description": "The base item kind." + }, + "BaseItemPerson": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "format": "uuid" + }, + "Role": { + "type": "string", + "description": "Gets or sets the role.", + "nullable": true + }, + "Type": { + "enum": [ + "Unknown", + "Actor", + "Director", + "Composer", + "Writer", + "GuestStar", + "Producer", + "Conductor", + "Lyricist", + "Arranger", + "Engineer", + "Mixer", + "Remixer", + "Creator", + "Artist", + "AlbumArtist", + "Author", + "Illustrator", + "Penciller", + "Inker", + "Colorist", + "Letterer", + "CoverArtist", + "Editor", + "Translator" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PersonKind" + } + ], + "description": "Gets or sets the type.", + "default": "Unknown" + }, + "PrimaryImageTag": { + "type": "string", + "description": "Gets or sets the primary image tag.", + "nullable": true + }, + "ImageBlurHashes": { + "type": "object", + "properties": { + "Primary": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Art": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Backdrop": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Banner": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Logo": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Thumb": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Disc": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Box": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Screenshot": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Menu": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Chapter": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "BoxRear": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Profile": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "Gets or sets the primary image blurhash.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This is used by the api to get information about a Person within a BaseItem." + }, + "BasePluginConfiguration": { + "type": "object", + "additionalProperties": false, + "description": "Class BasePluginConfiguration." + }, + "BookInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "SeriesName": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "BookInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/BookInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "BoxSetInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "BoxSetInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/BoxSetInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "BrandingOptions": { + "type": "object", + "properties": { + "LoginDisclaimer": { + "type": "string", + "description": "Gets or sets the login disclaimer.", + "nullable": true + }, + "CustomCss": { + "type": "string", + "description": "Gets or sets the custom CSS.", + "nullable": true + }, + "SplashscreenEnabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable the splashscreen." + } + }, + "additionalProperties": false, + "description": "The branding options." + }, + "BufferRequestDto": { + "type": "object", + "properties": { + "When": { + "type": "string", + "description": "Gets or sets when the request has been made by the client.", + "format": "date-time" + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64" + }, + "IsPlaying": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the client playback is unpaused." + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist item identifier of the playing item.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class BufferRequestDto." + }, + "CastReceiverApplication": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the cast receiver application id." + }, + "Name": { + "type": "string", + "description": "Gets or sets the cast receiver application name." + } + }, + "additionalProperties": false, + "description": "The cast receiver application model." + }, + "ChannelFeatures": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "format": "uuid" + }, + "CanSearch": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can search." + }, + "MediaTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelMediaType" + }, + "description": "Gets or sets the media types." + }, + "ContentTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelMediaContentType" + }, + "description": "Gets or sets the content types." + }, + "MaxPageSize": { + "type": "integer", + "description": "Gets or sets the maximum number of records the channel allows retrieving at a time.", + "format": "int32", + "nullable": true + }, + "AutoRefreshLevels": { + "type": "integer", + "description": "Gets or sets the automatic refresh levels.", + "format": "int32", + "nullable": true + }, + "DefaultSortFields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelItemSortField" + }, + "description": "Gets or sets the default sort orders." + }, + "SupportsSortOrderToggle": { + "type": "boolean", + "description": "Gets or sets a value indicating whether a sort ascending/descending toggle is supported." + }, + "SupportsLatestMedia": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports latest media]." + }, + "CanFilter": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can filter." + }, + "SupportsContentDownloading": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports content downloading]." + } + }, + "additionalProperties": false + }, + "ChannelItemSortField": { + "enum": [ + "Name", + "CommunityRating", + "PremiereDate", + "DateCreated", + "Runtime", + "PlayCount", + "CommunityPlayCount" + ], + "type": "string" + }, + "ChannelMappingOptionsDto": { + "type": "object", + "properties": { + "TunerChannels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerChannelMapping" + }, + "description": "Gets or sets list of tuner channels." + }, + "ProviderChannels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + }, + "description": "Gets or sets list of provider channels." + }, + "Mappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameValuePair" + }, + "description": "Gets or sets list of mappings." + }, + "ProviderName": { + "type": "string", + "description": "Gets or sets provider name.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Channel mapping options dto." + }, + "ChannelMediaContentType": { + "enum": [ + "Clip", + "Podcast", + "Trailer", + "Movie", + "Episode", + "Song", + "MovieExtra", + "TvExtra" + ], + "type": "string" + }, + "ChannelMediaType": { + "enum": [ + "Audio", + "Video", + "Photo" + ], + "type": "string" + }, + "ChannelType": { + "enum": [ + "TV", + "Radio" + ], + "type": "string", + "description": "Enum ChannelType." + }, + "ChapterInfo": { + "type": "object", + "properties": { + "StartPositionTicks": { + "type": "integer", + "description": "Gets or sets the start position ticks.", + "format": "int64" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "ImagePath": { + "type": "string", + "description": "Gets or sets the image path.", + "nullable": true + }, + "ImageDateModified": { + "type": "string", + "format": "date-time" + }, + "ImageTag": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class ChapterInfo." + }, + "ClientCapabilitiesDto": { + "type": "object", + "properties": { + "PlayableMediaTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + }, + "description": "Gets or sets the list of playable media types." + }, + "SupportedCommands": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneralCommandType" + }, + "description": "Gets or sets the list of supported commands." + }, + "SupportsMediaControl": { + "type": "boolean", + "description": "Gets or sets a value indicating whether session supports media control." + }, + "SupportsPersistentIdentifier": { + "type": "boolean", + "description": "Gets or sets a value indicating whether session supports a persistent identifier." + }, + "DeviceProfile": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "Gets or sets the device profile.", + "nullable": true + }, + "AppStoreUrl": { + "type": "string", + "description": "Gets or sets the app store url.", + "nullable": true + }, + "IconUrl": { + "type": "string", + "description": "Gets or sets the icon url.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Client capabilities dto." + }, + "ClientLogDocumentResponseDto": { + "type": "object", + "properties": { + "FileName": { + "type": "string", + "description": "Gets the resulting filename." + } + }, + "additionalProperties": false, + "description": "Client log document response dto." + }, + "CodecProfile": { + "type": "object", + "properties": { + "Type": { + "enum": [ + "Video", + "VideoAudio", + "Audio" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CodecType" + } + ], + "description": "Gets or sets the MediaBrowser.Model.Dlna.CodecType which this container must meet." + }, + "Conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + }, + "description": "Gets or sets the list of MediaBrowser.Model.Dlna.ProfileCondition which this profile must meet." + }, + "ApplyConditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + }, + "description": "Gets or sets the list of MediaBrowser.Model.Dlna.ProfileCondition to apply if this profile is met." + }, + "Codec": { + "type": "string", + "description": "Gets or sets the codec(s) that this profile applies to.", + "nullable": true + }, + "Container": { + "type": "string", + "description": "Gets or sets the container(s) which this profile will be applied to.", + "nullable": true + }, + "SubContainer": { + "type": "string", + "description": "Gets or sets the sub-container(s) which this profile will be applied to.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Dlna.CodecProfile." + }, + "CodecType": { + "enum": [ + "Video", + "VideoAudio", + "Audio" + ], + "type": "string" + }, + "CollectionCreationResult": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "CollectionType": { + "enum": [ + "unknown", + "movies", + "tvshows", + "music", + "musicvideos", + "trailers", + "homevideos", + "boxsets", + "books", + "photos", + "livetv", + "playlists", + "folders" + ], + "type": "string", + "description": "Collection type." + }, + "CollectionTypeOptions": { + "enum": [ + "movies", + "tvshows", + "music", + "musicvideos", + "homevideos", + "boxsets", + "books", + "mixed" + ], + "type": "string", + "description": "The collection type options." + }, + "ConfigImageTypes": { + "type": "object", + "properties": { + "BackdropSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "BaseUrl": { + "type": "string", + "nullable": true + }, + "LogoSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "PosterSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ProfileSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "SecureBaseUrl": { + "type": "string", + "nullable": true + }, + "StillSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "ConfigurationPageInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "EnableInMainMenu": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the configurations page is enabled in the main menu." + }, + "MenuSection": { + "type": "string", + "description": "Gets or sets the menu section.", + "nullable": true + }, + "MenuIcon": { + "type": "string", + "description": "Gets or sets the menu icon.", + "nullable": true + }, + "DisplayName": { + "type": "string", + "description": "Gets or sets the display name.", + "nullable": true + }, + "PluginId": { + "type": "string", + "description": "Gets or sets the plugin id.", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The configuration page info." + }, + "ContainerProfile": { + "type": "object", + "properties": { + "Type": { + "enum": [ + "Audio", + "Video", + "Photo", + "Subtitle", + "Lyric" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DlnaProfileType" + } + ], + "description": "Gets or sets the MediaBrowser.Model.Dlna.DlnaProfileType which this container must meet." + }, + "Conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + }, + "description": "Gets or sets the list of MediaBrowser.Model.Dlna.ProfileCondition which this container will be applied to." + }, + "Container": { + "type": "string", + "description": "Gets or sets the container(s) which this container must meet.", + "nullable": true + }, + "SubContainer": { + "type": "string", + "description": "Gets or sets the sub container(s) which this container must meet.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Dlna.ContainerProfile." + }, + "CountryInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "DisplayName": { + "type": "string", + "description": "Gets or sets the display name.", + "nullable": true + }, + "TwoLetterISORegionName": { + "type": "string", + "description": "Gets or sets the name of the two letter ISO region.", + "nullable": true + }, + "ThreeLetterISORegionName": { + "type": "string", + "description": "Gets or sets the name of the three letter ISO region.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class CountryInfo." + }, + "CreatePlaylistDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name of the new playlist." + }, + "Ids": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets item ids to add to the playlist." + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid", + "nullable": true + }, + "MediaType": { + "enum": [ + "Unknown", + "Video", + "Audio", + "Photo", + "Book" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaType" + } + ], + "description": "Gets or sets the media type.", + "nullable": true + }, + "Users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + }, + "description": "Gets or sets the playlist users." + }, + "IsPublic": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the playlist is public." + } + }, + "additionalProperties": false, + "description": "Create new playlist dto." + }, + "CreateUserByName": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the username." + }, + "Password": { + "type": "string", + "description": "Gets or sets the password.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The create user by name request body." + }, + "CultureDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets the name." + }, + "DisplayName": { + "type": "string", + "description": "Gets the display name." + }, + "TwoLetterISOLanguageName": { + "type": "string", + "description": "Gets the name of the two letter ISO language." + }, + "ThreeLetterISOLanguageName": { + "type": "string", + "description": "Gets the name of the three letter ISO language.", + "nullable": true, + "readOnly": true + }, + "ThreeLetterISOLanguageNames": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "description": "Class CultureDto." + }, + "DayOfWeek": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + "type": "string" + }, + "DayPattern": { + "enum": [ + "Daily", + "Weekdays", + "Weekends" + ], + "type": "string" + }, + "DefaultDirectoryBrowserInfoDto": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Default directory browser info." + }, + "DeinterlaceMethod": { + "enum": [ + "yadif", + "bwdif" + ], + "type": "string", + "description": "Enum containing deinterlace methods." + }, + "DeviceInfoDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "CustomName": { + "type": "string", + "description": "Gets or sets the custom name.", + "nullable": true + }, + "AccessToken": { + "type": "string", + "description": "Gets or sets the access token.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "nullable": true + }, + "LastUserName": { + "type": "string", + "description": "Gets or sets the last name of the user.", + "nullable": true + }, + "AppName": { + "type": "string", + "description": "Gets or sets the name of the application.", + "nullable": true + }, + "AppVersion": { + "type": "string", + "description": "Gets or sets the application version.", + "nullable": true + }, + "LastUserId": { + "type": "string", + "description": "Gets or sets the last user identifier.", + "format": "uuid", + "nullable": true + }, + "DateLastActivity": { + "type": "string", + "description": "Gets or sets the date last modified.", + "format": "date-time", + "nullable": true + }, + "Capabilities": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Gets or sets the capabilities." + }, + "IconUrl": { + "type": "string", + "description": "Gets or sets the icon URL.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "A DTO representing device information." + }, + "DeviceInfoDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeviceInfoDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "DeviceOptionsDto": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets or sets the id.", + "format": "int32" + }, + "DeviceId": { + "type": "string", + "description": "Gets or sets the device id.", + "nullable": true + }, + "CustomName": { + "type": "string", + "description": "Gets or sets the custom name.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "A dto representing custom options for a device." + }, + "DeviceProfile": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name of this device profile. User profiles must have a unique name.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the unique internal identifier.", + "format": "uuid", + "nullable": true + }, + "MaxStreamingBitrate": { + "type": "integer", + "description": "Gets or sets the maximum allowed bitrate for all streamed content.", + "format": "int32", + "nullable": true + }, + "MaxStaticBitrate": { + "type": "integer", + "description": "Gets or sets the maximum allowed bitrate for statically streamed content (= direct played files).", + "format": "int32", + "nullable": true + }, + "MusicStreamingTranscodingBitrate": { + "type": "integer", + "description": "Gets or sets the maximum allowed bitrate for transcoded music streams.", + "format": "int32", + "nullable": true + }, + "MaxStaticMusicBitrate": { + "type": "integer", + "description": "Gets or sets the maximum allowed bitrate for statically streamed (= direct played) music files.", + "format": "int32", + "nullable": true + }, + "DirectPlayProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DirectPlayProfile" + }, + "description": "Gets or sets the direct play profiles." + }, + "TranscodingProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TranscodingProfile" + }, + "description": "Gets or sets the transcoding profiles." + }, + "ContainerProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerProfile" + }, + "description": "Gets or sets the container profiles. Failing to meet these optional conditions causes transcoding to occur." + }, + "CodecProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CodecProfile" + }, + "description": "Gets or sets the codec profiles." + }, + "SubtitleProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubtitleProfile" + }, + "description": "Gets or sets the subtitle profiles." + } + }, + "additionalProperties": false, + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + }, + "DirectPlayProfile": { + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "Gets or sets the container." + }, + "AudioCodec": { + "type": "string", + "description": "Gets or sets the audio codec.", + "nullable": true + }, + "VideoCodec": { + "type": "string", + "description": "Gets or sets the video codec.", + "nullable": true + }, + "Type": { + "enum": [ + "Audio", + "Video", + "Photo", + "Subtitle", + "Lyric" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DlnaProfileType" + } + ], + "description": "Gets or sets the Dlna profile type." + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Dlna.DirectPlayProfile." + }, + "DisplayPreferencesDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the user id.", + "nullable": true + }, + "ViewType": { + "type": "string", + "description": "Gets or sets the type of the view.", + "nullable": true + }, + "SortBy": { + "type": "string", + "description": "Gets or sets the sort by.", + "nullable": true + }, + "IndexBy": { + "type": "string", + "description": "Gets or sets the index by.", + "nullable": true + }, + "RememberIndexing": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [remember indexing]." + }, + "PrimaryImageHeight": { + "type": "integer", + "description": "Gets or sets the height of the primary image.", + "format": "int32" + }, + "PrimaryImageWidth": { + "type": "integer", + "description": "Gets or sets the width of the primary image.", + "format": "int32" + }, + "CustomPrefs": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the custom prefs." + }, + "ScrollDirection": { + "enum": [ + "Horizontal", + "Vertical" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ScrollDirection" + } + ], + "description": "Gets or sets the scroll direction." + }, + "ShowBackdrop": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to show backdrops on this item." + }, + "RememberSorting": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [remember sorting]." + }, + "SortOrder": { + "enum": [ + "Ascending", + "Descending" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SortOrder" + } + ], + "description": "Gets or sets the sort order." + }, + "ShowSidebar": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [show sidebar]." + }, + "Client": { + "type": "string", + "description": "Gets or sets the client.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Defines the display preferences for any item that supports them (usually Folders)." + }, + "DlnaProfileType": { + "enum": [ + "Audio", + "Video", + "Photo", + "Subtitle", + "Lyric" + ], + "type": "string" + }, + "DownMixStereoAlgorithms": { + "enum": [ + "None", + "Dave750", + "NightmodeDialogue", + "Rfc7845", + "Ac4" + ], + "type": "string", + "description": "An enum representing an algorithm to downmix surround sound to stereo." + }, + "DynamicDayOfWeek": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Everyday", + "Weekday", + "Weekend" + ], + "type": "string", + "description": "An enum that represents a day of the week, weekdays, weekends, or all days." + }, + "EmbeddedSubtitleOptions": { + "enum": [ + "AllowAll", + "AllowText", + "AllowImage", + "AllowNone" + ], + "type": "string", + "description": "An enum representing the options to disable embedded subs." + }, + "EncoderPreset": { + "enum": [ + "auto", + "placebo", + "veryslow", + "slower", + "slow", + "medium", + "fast", + "faster", + "veryfast", + "superfast", + "ultrafast" + ], + "type": "string", + "description": "Enum containing encoder presets." + }, + "EncodingContext": { + "enum": [ + "Streaming", + "Static" + ], + "type": "string" + }, + "EncodingOptions": { + "type": "object", + "properties": { + "EncodingThreadCount": { + "type": "integer", + "description": "Gets or sets the thread count used for encoding.", + "format": "int32" + }, + "TranscodingTempPath": { + "type": "string", + "description": "Gets or sets the temporary transcoding path.", + "nullable": true + }, + "FallbackFontPath": { + "type": "string", + "description": "Gets or sets the path to the fallback font.", + "nullable": true + }, + "EnableFallbackFont": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to use the fallback font." + }, + "EnableAudioVbr": { + "type": "boolean", + "description": "Gets or sets a value indicating whether audio VBR is enabled." + }, + "DownMixAudioBoost": { + "type": "number", + "description": "Gets or sets the audio boost applied when downmixing audio.", + "format": "double" + }, + "DownMixStereoAlgorithm": { + "enum": [ + "None", + "Dave750", + "NightmodeDialogue", + "Rfc7845", + "Ac4" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DownMixStereoAlgorithms" + } + ], + "description": "Gets or sets the algorithm used for downmixing audio to stereo." + }, + "MaxMuxingQueueSize": { + "type": "integer", + "description": "Gets or sets the maximum size of the muxing queue.", + "format": "int32" + }, + "EnableThrottling": { + "type": "boolean", + "description": "Gets or sets a value indicating whether throttling is enabled." + }, + "ThrottleDelaySeconds": { + "type": "integer", + "description": "Gets or sets the delay after which throttling happens.", + "format": "int32" + }, + "EnableSegmentDeletion": { + "type": "boolean", + "description": "Gets or sets a value indicating whether segment deletion is enabled." + }, + "SegmentKeepSeconds": { + "type": "integer", + "description": "Gets or sets seconds for which segments should be kept before being deleted.", + "format": "int32" + }, + "HardwareAccelerationType": { + "enum": [ + "none", + "amf", + "qsv", + "nvenc", + "v4l2m2m", + "vaapi", + "videotoolbox", + "rkmpp" + ], + "allOf": [ + { + "$ref": "#/components/schemas/HardwareAccelerationType" + } + ], + "description": "Gets or sets the hardware acceleration type." + }, + "EncoderAppPath": { + "type": "string", + "description": "Gets or sets the FFmpeg path as set by the user via the UI.", + "nullable": true + }, + "EncoderAppPathDisplay": { + "type": "string", + "description": "Gets or sets the current FFmpeg path being used by the system and displayed on the transcode page.", + "nullable": true + }, + "VaapiDevice": { + "type": "string", + "description": "Gets or sets the VA-API device.", + "nullable": true + }, + "QsvDevice": { + "type": "string", + "description": "Gets or sets the QSV device.", + "nullable": true + }, + "EnableTonemapping": { + "type": "boolean", + "description": "Gets or sets a value indicating whether tonemapping is enabled." + }, + "EnableVppTonemapping": { + "type": "boolean", + "description": "Gets or sets a value indicating whether VPP tonemapping is enabled." + }, + "EnableVideoToolboxTonemapping": { + "type": "boolean", + "description": "Gets or sets a value indicating whether videotoolbox tonemapping is enabled." + }, + "TonemappingAlgorithm": { + "enum": [ + "none", + "clip", + "linear", + "gamma", + "reinhard", + "hable", + "mobius", + "bt2390" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TonemappingAlgorithm" + } + ], + "description": "Gets or sets the tone-mapping algorithm." + }, + "TonemappingMode": { + "enum": [ + "auto", + "max", + "rgb", + "lum", + "itp" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TonemappingMode" + } + ], + "description": "Gets or sets the tone-mapping mode." + }, + "TonemappingRange": { + "enum": [ + "auto", + "tv", + "pc" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TonemappingRange" + } + ], + "description": "Gets or sets the tone-mapping range." + }, + "TonemappingDesat": { + "type": "number", + "description": "Gets or sets the tone-mapping desaturation.", + "format": "double" + }, + "TonemappingPeak": { + "type": "number", + "description": "Gets or sets the tone-mapping peak.", + "format": "double" + }, + "TonemappingParam": { + "type": "number", + "description": "Gets or sets the tone-mapping parameters.", + "format": "double" + }, + "VppTonemappingBrightness": { + "type": "number", + "description": "Gets or sets the VPP tone-mapping brightness.", + "format": "double" + }, + "VppTonemappingContrast": { + "type": "number", + "description": "Gets or sets the VPP tone-mapping contrast.", + "format": "double" + }, + "H264Crf": { + "type": "integer", + "description": "Gets or sets the H264 CRF.", + "format": "int32" + }, + "H265Crf": { + "type": "integer", + "description": "Gets or sets the H265 CRF.", + "format": "int32" + }, + "EncoderPreset": { + "enum": [ + "auto", + "placebo", + "veryslow", + "slower", + "slow", + "medium", + "fast", + "faster", + "veryfast", + "superfast", + "ultrafast" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncoderPreset" + } + ], + "description": "Gets or sets the encoder preset.", + "nullable": true + }, + "DeinterlaceDoubleRate": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the framerate is doubled when deinterlacing." + }, + "DeinterlaceMethod": { + "enum": [ + "yadif", + "bwdif" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DeinterlaceMethod" + } + ], + "description": "Gets or sets the deinterlace method." + }, + "EnableDecodingColorDepth10Hevc": { + "type": "boolean", + "description": "Gets or sets a value indicating whether 10bit HEVC decoding is enabled." + }, + "EnableDecodingColorDepth10Vp9": { + "type": "boolean", + "description": "Gets or sets a value indicating whether 10bit VP9 decoding is enabled." + }, + "EnableDecodingColorDepth10HevcRext": { + "type": "boolean", + "description": "Gets or sets a value indicating whether 8/10bit HEVC RExt decoding is enabled." + }, + "EnableDecodingColorDepth12HevcRext": { + "type": "boolean", + "description": "Gets or sets a value indicating whether 12bit HEVC RExt decoding is enabled." + }, + "EnableEnhancedNvdecDecoder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the enhanced NVDEC is enabled." + }, + "PreferSystemNativeHwDecoder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the system native hardware decoder should be used." + }, + "EnableIntelLowPowerH264HwEncoder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the Intel H264 low-power hardware encoder should be used." + }, + "EnableIntelLowPowerHevcHwEncoder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the Intel HEVC low-power hardware encoder should be used." + }, + "EnableHardwareEncoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether hardware encoding is enabled." + }, + "AllowHevcEncoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether HEVC encoding is enabled." + }, + "AllowAv1Encoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether AV1 encoding is enabled." + }, + "EnableSubtitleExtraction": { + "type": "boolean", + "description": "Gets or sets a value indicating whether subtitle extraction is enabled." + }, + "HardwareDecodingCodecs": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the codecs hardware encoding is used for.", + "nullable": true + }, + "AllowOnDemandMetadataBasedKeyframeExtractionForExtensions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the file extensions on-demand metadata based keyframe extraction is enabled for.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class EncodingOptions." + }, + "EndPointInfo": { + "type": "object", + "properties": { + "IsLocal": { + "type": "boolean" + }, + "IsInNetwork": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "ExternalIdInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the display name of the external id provider (IE: IMDB, MusicBrainz, etc)." + }, + "Key": { + "type": "string", + "description": "Gets or sets the unique key for this id. This key should be unique across all providers." + }, + "Type": { + "enum": [ + "Album", + "AlbumArtist", + "Artist", + "BoxSet", + "Episode", + "Movie", + "OtherArtist", + "Person", + "ReleaseGroup", + "Season", + "Series", + "Track", + "Book" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ExternalIdMediaType" + } + ], + "description": "Gets or sets the specific media type for this id. This is used to distinguish between the different\r\nexternal id types for providers with multiple ids.\r\nA null value indicates there is no specific media type associated with the external id, or this is the\r\ndefault id for the external provider so there is no need to specify a type.", + "nullable": true + }, + "UrlFormatString": { + "type": "string", + "description": "Gets or sets the URL format string.", + "nullable": true, + "deprecated": true + } + }, + "additionalProperties": false, + "description": "Represents the external id information for serialization to the client." + }, + "ExternalIdMediaType": { + "enum": [ + "Album", + "AlbumArtist", + "Artist", + "BoxSet", + "Episode", + "Movie", + "OtherArtist", + "Person", + "ReleaseGroup", + "Season", + "Series", + "Track", + "Book" + ], + "type": "string", + "description": "The specific media type of an MediaBrowser.Model.Providers.ExternalIdInfo." + }, + "ExternalUrl": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Url": { + "type": "string", + "description": "Gets or sets the type of the item.", + "nullable": true + } + }, + "additionalProperties": false + }, + "ExtraType": { + "enum": [ + "Unknown", + "Clip", + "Trailer", + "BehindTheScenes", + "DeletedScene", + "Interview", + "Scene", + "Sample", + "ThemeSong", + "ThemeVideo", + "Featurette", + "Short" + ], + "type": "string" + }, + "FileSystemEntryInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets the name." + }, + "Path": { + "type": "string", + "description": "Gets the path." + }, + "Type": { + "enum": [ + "File", + "Directory", + "NetworkComputer", + "NetworkShare" + ], + "allOf": [ + { + "$ref": "#/components/schemas/FileSystemEntryType" + } + ], + "description": "Gets the type." + } + }, + "additionalProperties": false, + "description": "Class FileSystemEntryInfo." + }, + "FileSystemEntryType": { + "enum": [ + "File", + "Directory", + "NetworkComputer", + "NetworkShare" + ], + "type": "string", + "description": "Enum FileSystemEntryType." + }, + "FontFile": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Size": { + "type": "integer", + "description": "Gets or sets the size.", + "format": "int64" + }, + "DateCreated": { + "type": "string", + "description": "Gets or sets the date created.", + "format": "date-time" + }, + "DateModified": { + "type": "string", + "description": "Gets or sets the date modified.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Class FontFile." + }, + "ForceKeepAliveMessage": { + "type": "object", + "properties": { + "Data": { + "type": "integer", + "description": "Gets or sets the data.", + "format": "int32" + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ForceKeepAlive", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Force keep alive websocket messages." + }, + "ForgotPasswordAction": { + "enum": [ + "ContactAdmin", + "PinCode", + "InNetworkRequired" + ], + "type": "string" + }, + "ForgotPasswordDto": { + "required": [ + "EnteredUsername" + ], + "type": "object", + "properties": { + "EnteredUsername": { + "type": "string", + "description": "Gets or sets the entered username to have its password reset." + } + }, + "additionalProperties": false, + "description": "Forgot Password request body DTO." + }, + "ForgotPasswordPinDto": { + "required": [ + "Pin" + ], + "type": "object", + "properties": { + "Pin": { + "type": "string", + "description": "Gets or sets the entered pin to have the password reset." + } + }, + "additionalProperties": false, + "description": "Forgot Password Pin enter request body DTO." + }, + "ForgotPasswordResult": { + "type": "object", + "properties": { + "Action": { + "enum": [ + "ContactAdmin", + "PinCode", + "InNetworkRequired" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordAction" + } + ], + "description": "Gets or sets the action." + }, + "PinFile": { + "type": "string", + "description": "Gets or sets the pin file.", + "nullable": true + }, + "PinExpirationDate": { + "type": "string", + "description": "Gets or sets the pin expiration date.", + "format": "date-time", + "nullable": true + } + }, + "additionalProperties": false + }, + "GeneralCommand": { + "type": "object", + "properties": { + "Name": { + "enum": [ + "MoveUp", + "MoveDown", + "MoveLeft", + "MoveRight", + "PageUp", + "PageDown", + "PreviousLetter", + "NextLetter", + "ToggleOsd", + "ToggleContextMenu", + "Select", + "Back", + "TakeScreenshot", + "SendKey", + "SendString", + "GoHome", + "GoToSettings", + "VolumeUp", + "VolumeDown", + "Mute", + "Unmute", + "ToggleMute", + "SetVolume", + "SetAudioStreamIndex", + "SetSubtitleStreamIndex", + "ToggleFullscreen", + "DisplayContent", + "GoToSearch", + "DisplayMessage", + "SetRepeatMode", + "ChannelUp", + "ChannelDown", + "Guide", + "ToggleStats", + "PlayMediaSource", + "PlayTrailers", + "SetShuffleQueue", + "PlayState", + "PlayNext", + "ToggleOsdMenu", + "Play", + "SetMaxStreamingBitrate", + "SetPlaybackOrder" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommandType" + } + ], + "description": "This exists simply to identify a set of known commands." + }, + "ControllingUserId": { + "type": "string", + "format": "uuid" + }, + "Arguments": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + "additionalProperties": false + }, + "GeneralCommandMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommand" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "GeneralCommand", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "General command websocket message." + }, + "GeneralCommandType": { + "enum": [ + "MoveUp", + "MoveDown", + "MoveLeft", + "MoveRight", + "PageUp", + "PageDown", + "PreviousLetter", + "NextLetter", + "ToggleOsd", + "ToggleContextMenu", + "Select", + "Back", + "TakeScreenshot", + "SendKey", + "SendString", + "GoHome", + "GoToSettings", + "VolumeUp", + "VolumeDown", + "Mute", + "Unmute", + "ToggleMute", + "SetVolume", + "SetAudioStreamIndex", + "SetSubtitleStreamIndex", + "ToggleFullscreen", + "DisplayContent", + "GoToSearch", + "DisplayMessage", + "SetRepeatMode", + "ChannelUp", + "ChannelDown", + "Guide", + "ToggleStats", + "PlayMediaSource", + "PlayTrailers", + "SetShuffleQueue", + "PlayState", + "PlayNext", + "ToggleOsdMenu", + "Play", + "SetMaxStreamingBitrate", + "SetPlaybackOrder" + ], + "type": "string", + "description": "This exists simply to identify a set of known commands." + }, + "GetProgramsDto": { + "type": "object", + "properties": { + "ChannelIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the channels to return guide information for.", + "nullable": true + }, + "UserId": { + "type": "string", + "description": "Gets or sets optional. Filter by user id.", + "format": "uuid", + "nullable": true + }, + "MinStartDate": { + "type": "string", + "description": "Gets or sets the minimum premiere start date.", + "format": "date-time", + "nullable": true + }, + "HasAired": { + "type": "boolean", + "description": "Gets or sets filter by programs that have completed airing, or not.", + "nullable": true + }, + "IsAiring": { + "type": "boolean", + "description": "Gets or sets filter by programs that are currently airing, or not.", + "nullable": true + }, + "MaxStartDate": { + "type": "string", + "description": "Gets or sets the maximum premiere start date.", + "format": "date-time", + "nullable": true + }, + "MinEndDate": { + "type": "string", + "description": "Gets or sets the minimum premiere end date.", + "format": "date-time", + "nullable": true + }, + "MaxEndDate": { + "type": "string", + "description": "Gets or sets the maximum premiere end date.", + "format": "date-time", + "nullable": true + }, + "IsMovie": { + "type": "boolean", + "description": "Gets or sets filter for movies.", + "nullable": true + }, + "IsSeries": { + "type": "boolean", + "description": "Gets or sets filter for series.", + "nullable": true + }, + "IsNews": { + "type": "boolean", + "description": "Gets or sets filter for news.", + "nullable": true + }, + "IsKids": { + "type": "boolean", + "description": "Gets or sets filter for kids.", + "nullable": true + }, + "IsSports": { + "type": "boolean", + "description": "Gets or sets filter for sports.", + "nullable": true + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the record index to start at. All items with a lower index will be dropped from the results.", + "format": "int32", + "nullable": true + }, + "Limit": { + "type": "integer", + "description": "Gets or sets the maximum number of records to return.", + "format": "int32", + "nullable": true + }, + "SortBy": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + }, + "description": "Gets or sets specify one or more sort orders, comma delimited. Options: Name, StartDate.", + "nullable": true + }, + "SortOrder": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + }, + "description": "Gets or sets sort order.", + "nullable": true + }, + "Genres": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the genres to return guide information for.", + "nullable": true + }, + "GenreIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the genre ids to return guide information for.", + "nullable": true + }, + "EnableImages": { + "type": "boolean", + "description": "Gets or sets include image information in output.", + "nullable": true + }, + "EnableTotalRecordCount": { + "type": "boolean", + "description": "Gets or sets a value indicating whether retrieve total record count.", + "default": true + }, + "ImageTypeLimit": { + "type": "integer", + "description": "Gets or sets the max number of images to return, per image type.", + "format": "int32", + "nullable": true + }, + "EnableImageTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + }, + "description": "Gets or sets the image types to include in the output.", + "nullable": true + }, + "EnableUserData": { + "type": "boolean", + "description": "Gets or sets include user data.", + "nullable": true + }, + "SeriesTimerId": { + "type": "string", + "description": "Gets or sets filter by series timer id.", + "nullable": true + }, + "LibrarySeriesId": { + "type": "string", + "description": "Gets or sets filter by library series id.", + "format": "uuid", + "nullable": true + }, + "Fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + }, + "description": "Gets or sets specify additional fields of information to return in the output.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Get programs dto." + }, + "GroupInfoDto": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid" + }, + "GroupName": { + "type": "string", + "description": "Gets the group name." + }, + "State": { + "enum": [ + "Idle", + "Waiting", + "Paused", + "Playing" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupStateType" + } + ], + "description": "Gets the group state." + }, + "Participants": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets the participants." + }, + "LastUpdatedAt": { + "type": "string", + "description": "Gets the date when this DTO has been created.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Class GroupInfoDto." + }, + "GroupInfoDtoGroupUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "CreateGroupDenied", + "JoinGroupDenied", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Gets the update type." + }, + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/GroupInfoDto" + } + ], + "description": "Gets the update data." + } + }, + "additionalProperties": false, + "description": "Class GroupUpdate." + }, + "GroupQueueMode": { + "enum": [ + "Queue", + "QueueNext" + ], + "type": "string", + "description": "Enum GroupQueueMode." + }, + "GroupRepeatMode": { + "enum": [ + "RepeatOne", + "RepeatAll", + "RepeatNone" + ], + "type": "string", + "description": "Enum GroupRepeatMode." + }, + "GroupShuffleMode": { + "enum": [ + "Sorted", + "Shuffle" + ], + "type": "string", + "description": "Enum GroupShuffleMode." + }, + "GroupStateType": { + "enum": [ + "Idle", + "Waiting", + "Paused", + "Playing" + ], + "type": "string", + "description": "Enum GroupState." + }, + "GroupStateUpdate": { + "type": "object", + "properties": { + "State": { + "enum": [ + "Idle", + "Waiting", + "Paused", + "Playing" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupStateType" + } + ], + "description": "Gets the state of the group." + }, + "Reason": { + "enum": [ + "Play", + "SetPlaylistItem", + "RemoveFromPlaylist", + "MovePlaylistItem", + "Queue", + "Unpause", + "Pause", + "Stop", + "Seek", + "Buffer", + "Ready", + "NextItem", + "PreviousItem", + "SetRepeatMode", + "SetShuffleMode", + "Ping", + "IgnoreWait" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackRequestType" + } + ], + "description": "Gets the reason of the state change." + } + }, + "additionalProperties": false, + "description": "Class GroupStateUpdate." + }, + "GroupStateUpdateGroupUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "CreateGroupDenied", + "JoinGroupDenied", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Gets the update type." + }, + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/GroupStateUpdate" + } + ], + "description": "Gets the update data." + } + }, + "additionalProperties": false, + "description": "Class GroupUpdate." + }, + "GroupUpdate": { + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/GroupInfoDtoGroupUpdate" + }, + { + "$ref": "#/components/schemas/GroupStateUpdateGroupUpdate" + }, + { + "$ref": "#/components/schemas/StringGroupUpdate" + }, + { + "$ref": "#/components/schemas/PlayQueueUpdateGroupUpdate" + } + ], + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "CreateGroupDenied", + "JoinGroupDenied", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Gets the update type." + } + }, + "additionalProperties": false, + "description": "Group update without data.", + "discriminator": { + "propertyName": "Type", + "mapping": { + "UserJoined": "#/components/schemas/StringGroupUpdate", + "UserLeft": "#/components/schemas/StringGroupUpdate", + "GroupJoined": "#/components/schemas/GroupInfoDtoGroupUpdate", + "GroupLeft": "#/components/schemas/StringGroupUpdate", + "StateUpdate": "#/components/schemas/GroupStateUpdateGroupUpdate", + "PlayQueue": "#/components/schemas/PlayQueueUpdateGroupUpdate", + "NotInGroup": "#/components/schemas/StringGroupUpdate", + "GroupDoesNotExist": "#/components/schemas/StringGroupUpdate", + "LibraryAccessDenied": "#/components/schemas/StringGroupUpdate" + } + } + }, + "GroupUpdateType": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "CreateGroupDenied", + "JoinGroupDenied", + "LibraryAccessDenied" + ], + "type": "string", + "description": "Enum GroupUpdateType." + }, + "GuideInfo": { + "type": "object", + "properties": { + "StartDate": { + "type": "string", + "description": "Gets or sets the start date.", + "format": "date-time" + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date.", + "format": "date-time" + } + }, + "additionalProperties": false + }, + "HardwareAccelerationType": { + "enum": [ + "none", + "amf", + "qsv", + "nvenc", + "v4l2m2m", + "vaapi", + "videotoolbox", + "rkmpp" + ], + "type": "string", + "description": "Enum containing hardware acceleration types." + }, + "IgnoreWaitRequestDto": { + "type": "object", + "properties": { + "IgnoreWait": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the client should be ignored." + } + }, + "additionalProperties": false, + "description": "Class IgnoreWaitRequestDto." + }, + "ImageFormat": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "type": "string", + "description": "Enum ImageOutputFormat." + }, + "ImageInfo": { + "type": "object", + "properties": { + "ImageType": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Gets or sets the type of the image." + }, + "ImageIndex": { + "type": "integer", + "description": "Gets or sets the index of the image.", + "format": "int32", + "nullable": true + }, + "ImageTag": { + "type": "string", + "description": "Gets or sets the image tag.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "BlurHash": { + "type": "string", + "description": "Gets or sets the blurhash.", + "nullable": true + }, + "Height": { + "type": "integer", + "description": "Gets or sets the height.", + "format": "int32", + "nullable": true + }, + "Width": { + "type": "integer", + "description": "Gets or sets the width.", + "format": "int32", + "nullable": true + }, + "Size": { + "type": "integer", + "description": "Gets or sets the size.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Class ImageInfo." + }, + "ImageOption": { + "type": "object", + "properties": { + "Type": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Gets or sets the type." + }, + "Limit": { + "type": "integer", + "description": "Gets or sets the limit.", + "format": "int32" + }, + "MinWidth": { + "type": "integer", + "description": "Gets or sets the minimum width.", + "format": "int32" + } + }, + "additionalProperties": false + }, + "ImageOrientation": { + "enum": [ + "TopLeft", + "TopRight", + "BottomRight", + "BottomLeft", + "LeftTop", + "RightTop", + "RightBottom", + "LeftBottom" + ], + "type": "string" + }, + "ImageProviderInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets the name." + }, + "SupportedImages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + }, + "description": "Gets the supported image types." + } + }, + "additionalProperties": false, + "description": "Class ImageProviderInfo." + }, + "ImageResolution": { + "enum": [ + "MatchSource", + "P144", + "P240", + "P360", + "P480", + "P720", + "P1080", + "P1440", + "P2160" + ], + "type": "string", + "description": "Enum ImageResolution." + }, + "ImageSavingConvention": { + "enum": [ + "Legacy", + "Compatible" + ], + "type": "string" + }, + "ImageType": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "type": "string", + "description": "Enum ImageType." + }, + "InboundKeepAliveMessage": { + "type": "object", + "properties": { + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "KeepAlive", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Keep alive websocket messages." + }, + "InboundWebSocketMessage": { + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/ActivityLogEntryStartMessage" + }, + { + "$ref": "#/components/schemas/ActivityLogEntryStopMessage" + }, + { + "$ref": "#/components/schemas/InboundKeepAliveMessage" + }, + { + "$ref": "#/components/schemas/ScheduledTasksInfoStartMessage" + }, + { + "$ref": "#/components/schemas/ScheduledTasksInfoStopMessage" + }, + { + "$ref": "#/components/schemas/SessionsStartMessage" + }, + { + "$ref": "#/components/schemas/SessionsStopMessage" + } + ], + "description": "Represents the list of possible inbound websocket types", + "discriminator": { + "propertyName": "MessageType", + "mapping": { + "ActivityLogEntryStart": "#/components/schemas/ActivityLogEntryStartMessage", + "ActivityLogEntryStop": "#/components/schemas/ActivityLogEntryStopMessage", + "KeepAlive": "#/components/schemas/InboundKeepAliveMessage", + "ScheduledTasksInfoStart": "#/components/schemas/ScheduledTasksInfoStartMessage", + "ScheduledTasksInfoStop": "#/components/schemas/ScheduledTasksInfoStopMessage", + "SessionsStart": "#/components/schemas/SessionsStartMessage", + "SessionsStop": "#/components/schemas/SessionsStopMessage" + } + } + }, + "InstallationInfo": { + "type": "object", + "properties": { + "Guid": { + "type": "string", + "description": "Gets or sets the Id.", + "format": "uuid" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the version.", + "nullable": true + }, + "Changelog": { + "type": "string", + "description": "Gets or sets the changelog for this version.", + "nullable": true + }, + "SourceUrl": { + "type": "string", + "description": "Gets or sets the source URL.", + "nullable": true + }, + "Checksum": { + "type": "string", + "description": "Gets or sets a checksum for the binary.", + "nullable": true + }, + "PackageInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/PackageInfo" + } + ], + "description": "Gets or sets package information for the installation.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class InstallationInfo." + }, + "IPlugin": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets the name of the plugin.", + "nullable": true, + "readOnly": true + }, + "Description": { + "type": "string", + "description": "Gets the Description.", + "nullable": true, + "readOnly": true + }, + "Id": { + "type": "string", + "description": "Gets the unique id.", + "format": "uuid", + "readOnly": true + }, + "Version": { + "type": "string", + "description": "Gets the plugin version.", + "nullable": true, + "readOnly": true + }, + "AssemblyFilePath": { + "type": "string", + "description": "Gets the path to the assembly file.", + "nullable": true, + "readOnly": true + }, + "CanUninstall": { + "type": "boolean", + "description": "Gets a value indicating whether the plugin can be uninstalled.", + "readOnly": true + }, + "DataFolderPath": { + "type": "string", + "description": "Gets the full path to the data folder, where the plugin can store any miscellaneous files needed.", + "nullable": true, + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Common.Plugins.IPlugin." + }, + "IsoType": { + "enum": [ + "Dvd", + "BluRay" + ], + "type": "string", + "description": "Enum IsoType." + }, + "ItemCounts": { + "type": "object", + "properties": { + "MovieCount": { + "type": "integer", + "description": "Gets or sets the movie count.", + "format": "int32" + }, + "SeriesCount": { + "type": "integer", + "description": "Gets or sets the series count.", + "format": "int32" + }, + "EpisodeCount": { + "type": "integer", + "description": "Gets or sets the episode count.", + "format": "int32" + }, + "ArtistCount": { + "type": "integer", + "description": "Gets or sets the artist count.", + "format": "int32" + }, + "ProgramCount": { + "type": "integer", + "description": "Gets or sets the program count.", + "format": "int32" + }, + "TrailerCount": { + "type": "integer", + "description": "Gets or sets the trailer count.", + "format": "int32" + }, + "SongCount": { + "type": "integer", + "description": "Gets or sets the song count.", + "format": "int32" + }, + "AlbumCount": { + "type": "integer", + "description": "Gets or sets the album count.", + "format": "int32" + }, + "MusicVideoCount": { + "type": "integer", + "description": "Gets or sets the music video count.", + "format": "int32" + }, + "BoxSetCount": { + "type": "integer", + "description": "Gets or sets the box set count.", + "format": "int32" + }, + "BookCount": { + "type": "integer", + "description": "Gets or sets the book count.", + "format": "int32" + }, + "ItemCount": { + "type": "integer", + "description": "Gets or sets the item count.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Class LibrarySummary." + }, + "ItemFields": { + "enum": [ + "AirTime", + "CanDelete", + "CanDownload", + "ChannelInfo", + "Chapters", + "Trickplay", + "ChildCount", + "CumulativeRunTimeTicks", + "CustomRating", + "DateCreated", + "DateLastMediaAdded", + "DisplayPreferencesId", + "Etag", + "ExternalUrls", + "Genres", + "HomePageUrl", + "ItemCounts", + "MediaSourceCount", + "MediaSources", + "OriginalTitle", + "Overview", + "ParentId", + "Path", + "People", + "PlayAccess", + "ProductionLocations", + "ProviderIds", + "PrimaryImageAspectRatio", + "RecursiveItemCount", + "Settings", + "ScreenshotImageTags", + "SeriesPrimaryImage", + "SeriesStudio", + "SortName", + "SpecialEpisodeNumbers", + "Studios", + "Taglines", + "Tags", + "RemoteTrailers", + "MediaStreams", + "SeasonUserData", + "ServiceName", + "ThemeSongIds", + "ThemeVideoIds", + "ExternalEtag", + "PresentationUniqueKey", + "InheritedParentalRatingValue", + "ExternalSeriesId", + "SeriesPresentationUniqueKey", + "DateLastRefreshed", + "DateLastSaved", + "RefreshState", + "ChannelImage", + "EnableMediaSourceDisplay", + "Width", + "Height", + "ExtraIds", + "LocalTrailerCount", + "IsHD", + "SpecialFeatureCount" + ], + "type": "string", + "description": "Used to control the data that gets attached to DtoBaseItems." + }, + "ItemFilter": { + "enum": [ + "IsFolder", + "IsNotFolder", + "IsUnplayed", + "IsPlayed", + "IsFavorite", + "IsResumable", + "Likes", + "Dislikes", + "IsFavoriteOrLikes" + ], + "type": "string", + "description": "Enum ItemFilter." + }, + "ItemSortBy": { + "enum": [ + "Default", + "AiredEpisodeOrder", + "Album", + "AlbumArtist", + "Artist", + "DateCreated", + "OfficialRating", + "DatePlayed", + "PremiereDate", + "StartDate", + "SortName", + "Name", + "Random", + "Runtime", + "CommunityRating", + "ProductionYear", + "PlayCount", + "CriticRating", + "IsFolder", + "IsUnplayed", + "IsPlayed", + "SeriesSortName", + "VideoBitRate", + "AirTime", + "Studio", + "IsFavoriteOrLiked", + "DateLastContentAdded", + "SeriesDatePlayed", + "ParentIndexNumber", + "IndexNumber", + "SimilarityScore", + "SearchScore" + ], + "type": "string", + "description": "These represent sort orders." + }, + "JoinGroupRequestDto": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets or sets the group identifier.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class JoinGroupRequestDto." + }, + "KeepUntil": { + "enum": [ + "UntilDeleted", + "UntilSpaceNeeded", + "UntilWatched", + "UntilDate" + ], + "type": "string" + }, + "LibraryChangedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/LibraryUpdateInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "LibraryChanged", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Library changed message." + }, + "LibraryOptionInfoDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets name.", + "nullable": true + }, + "DefaultEnabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether default enabled." + } + }, + "additionalProperties": false, + "description": "Library option info dto." + }, + "LibraryOptions": { + "type": "object", + "properties": { + "Enabled": { + "type": "boolean" + }, + "EnablePhotos": { + "type": "boolean" + }, + "EnableRealtimeMonitor": { + "type": "boolean" + }, + "EnableLUFSScan": { + "type": "boolean" + }, + "EnableChapterImageExtraction": { + "type": "boolean" + }, + "ExtractChapterImagesDuringLibraryScan": { + "type": "boolean" + }, + "EnableTrickplayImageExtraction": { + "type": "boolean" + }, + "ExtractTrickplayImagesDuringLibraryScan": { + "type": "boolean" + }, + "PathInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaPathInfo" + } + }, + "SaveLocalMetadata": { + "type": "boolean" + }, + "EnableInternetProviders": { + "type": "boolean", + "deprecated": true + }, + "EnableAutomaticSeriesGrouping": { + "type": "boolean" + }, + "EnableEmbeddedTitles": { + "type": "boolean" + }, + "EnableEmbeddedExtrasTitles": { + "type": "boolean" + }, + "EnableEmbeddedEpisodeInfos": { + "type": "boolean" + }, + "AutomaticRefreshIntervalDays": { + "type": "integer", + "format": "int32" + }, + "PreferredMetadataLanguage": { + "type": "string", + "description": "Gets or sets the preferred metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "SeasonZeroDisplayName": { + "type": "string" + }, + "MetadataSavers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DisabledLocalMetadataReaders": { + "type": "array", + "items": { + "type": "string" + } + }, + "LocalMetadataReaderOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DisabledSubtitleFetchers": { + "type": "array", + "items": { + "type": "string" + } + }, + "SubtitleFetcherOrder": { + "type": "array", + "items": { + "type": "string" + } + }, + "DisabledMediaSegmentProviders": { + "type": "array", + "items": { + "type": "string" + } + }, + "MediaSegmentProvideOrder": { + "type": "array", + "items": { + "type": "string" + } + }, + "SkipSubtitlesIfEmbeddedSubtitlesPresent": { + "type": "boolean" + }, + "SkipSubtitlesIfAudioTrackMatches": { + "type": "boolean" + }, + "SubtitleDownloadLanguages": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "RequirePerfectSubtitleMatch": { + "type": "boolean" + }, + "SaveSubtitlesWithMedia": { + "type": "boolean" + }, + "SaveLyricsWithMedia": { + "type": "boolean", + "default": false + }, + "SaveTrickplayWithMedia": { + "type": "boolean", + "default": false + }, + "DisabledLyricFetchers": { + "type": "array", + "items": { + "type": "string" + } + }, + "LyricFetcherOrder": { + "type": "array", + "items": { + "type": "string" + } + }, + "PreferNonstandardArtistsTag": { + "type": "boolean", + "default": false + }, + "UseCustomTagDelimiters": { + "type": "boolean", + "default": false + }, + "CustomTagDelimiters": { + "type": "array", + "items": { + "type": "string" + } + }, + "DelimiterWhitelist": { + "type": "array", + "items": { + "type": "string" + } + }, + "AutomaticallyAddToCollection": { + "type": "boolean" + }, + "AllowEmbeddedSubtitles": { + "enum": [ + "AllowAll", + "AllowText", + "AllowImage", + "AllowNone" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EmbeddedSubtitleOptions" + } + ], + "description": "An enum representing the options to disable embedded subs." + }, + "TypeOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TypeOptions" + } + } + }, + "additionalProperties": false + }, + "LibraryOptionsResultDto": { + "type": "object", + "properties": { + "MetadataSavers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the metadata savers." + }, + "MetadataReaders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the metadata readers." + }, + "SubtitleFetchers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the subtitle fetchers." + }, + "LyricFetchers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the list of lyric fetchers." + }, + "TypeOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryTypeOptionsDto" + }, + "description": "Gets or sets the type options." + } + }, + "additionalProperties": false, + "description": "Library options result dto." + }, + "LibraryTypeOptionsDto": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "description": "Gets or sets the type.", + "nullable": true + }, + "MetadataFetchers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the metadata fetchers." + }, + "ImageFetchers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the image fetchers." + }, + "SupportedImageTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + }, + "description": "Gets or sets the supported image types." + }, + "DefaultImageOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageOption" + }, + "description": "Gets or sets the default image options." + } + }, + "additionalProperties": false, + "description": "Library type options dto." + }, + "LibraryUpdateInfo": { + "type": "object", + "properties": { + "FoldersAddedTo": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the folders added to." + }, + "FoldersRemovedFrom": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the folders removed from." + }, + "ItemsAdded": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the items added." + }, + "ItemsRemoved": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the items removed." + }, + "ItemsUpdated": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the items updated." + }, + "CollectionFolders": { + "type": "array", + "items": { + "type": "string" + } + }, + "IsEmpty": { + "type": "boolean", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Class LibraryUpdateInfo." + }, + "ListingsProviderInfo": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": true + }, + "Type": { + "type": "string", + "nullable": true + }, + "Username": { + "type": "string", + "nullable": true + }, + "Password": { + "type": "string", + "nullable": true + }, + "ListingsId": { + "type": "string", + "nullable": true + }, + "ZipCode": { + "type": "string", + "nullable": true + }, + "Country": { + "type": "string", + "nullable": true + }, + "Path": { + "type": "string", + "nullable": true + }, + "EnabledTuners": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "EnableAllTuners": { + "type": "boolean" + }, + "NewsCategories": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "SportsCategories": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "KidsCategories": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "MovieCategories": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ChannelMappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameValuePair" + }, + "nullable": true + }, + "MoviePrefix": { + "type": "string", + "nullable": true + }, + "PreferredLanguage": { + "type": "string", + "nullable": true + }, + "UserAgent": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "LiveStreamResponse": { + "type": "object", + "properties": { + "MediaSource": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaSourceInfo" + } + ] + } + }, + "additionalProperties": false + }, + "LiveTvInfo": { + "type": "object", + "properties": { + "Services": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LiveTvServiceInfo" + }, + "description": "Gets or sets the services." + }, + "IsEnabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is enabled." + }, + "EnabledUsers": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the enabled users." + } + }, + "additionalProperties": false + }, + "LiveTvOptions": { + "type": "object", + "properties": { + "GuideDays": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "RecordingPath": { + "type": "string", + "nullable": true + }, + "MovieRecordingPath": { + "type": "string", + "nullable": true + }, + "SeriesRecordingPath": { + "type": "string", + "nullable": true + }, + "EnableRecordingSubfolders": { + "type": "boolean" + }, + "EnableOriginalAudioWithEncodedRecordings": { + "type": "boolean" + }, + "TunerHosts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + }, + "nullable": true + }, + "ListingProviders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ListingsProviderInfo" + }, + "nullable": true + }, + "PrePaddingSeconds": { + "type": "integer", + "format": "int32" + }, + "PostPaddingSeconds": { + "type": "integer", + "format": "int32" + }, + "MediaLocationsCreated": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "RecordingPostProcessor": { + "type": "string", + "nullable": true + }, + "RecordingPostProcessorArguments": { + "type": "string", + "nullable": true + }, + "SaveRecordingNFO": { + "type": "boolean" + }, + "SaveRecordingImages": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "LiveTvServiceInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "HomePageUrl": { + "type": "string", + "description": "Gets or sets the home page URL.", + "nullable": true + }, + "Status": { + "enum": [ + "Ok", + "Unavailable" + ], + "allOf": [ + { + "$ref": "#/components/schemas/LiveTvServiceStatus" + } + ], + "description": "Gets or sets the status." + }, + "StatusMessage": { + "type": "string", + "description": "Gets or sets the status message.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the version.", + "nullable": true + }, + "HasUpdateAvailable": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has update available." + }, + "IsVisible": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is visible." + }, + "Tuners": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class ServiceInfo." + }, + "LiveTvServiceStatus": { + "enum": [ + "Ok", + "Unavailable" + ], + "type": "string" + }, + "LocalizationOption": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "Value": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "LocationType": { + "enum": [ + "FileSystem", + "Remote", + "Virtual", + "Offline" + ], + "type": "string", + "description": "Enum LocationType." + }, + "LogFile": { + "type": "object", + "properties": { + "DateCreated": { + "type": "string", + "description": "Gets or sets the date created.", + "format": "date-time" + }, + "DateModified": { + "type": "string", + "description": "Gets or sets the date modified.", + "format": "date-time" + }, + "Size": { + "type": "integer", + "description": "Gets or sets the size.", + "format": "int64" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name." + } + }, + "additionalProperties": false + }, + "LogLevel": { + "enum": [ + "Trace", + "Debug", + "Information", + "Warning", + "Error", + "Critical", + "None" + ], + "type": "string" + }, + "LyricDto": { + "type": "object", + "properties": { + "Metadata": { + "allOf": [ + { + "$ref": "#/components/schemas/LyricMetadata" + } + ], + "description": "Gets or sets Metadata for the lyrics." + }, + "Lyrics": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LyricLine" + }, + "description": "Gets or sets a collection of individual lyric lines." + } + }, + "additionalProperties": false, + "description": "LyricResponse model." + }, + "LyricLine": { + "type": "object", + "properties": { + "Text": { + "type": "string", + "description": "Gets the text of this lyric line." + }, + "Start": { + "type": "integer", + "description": "Gets the start time in ticks.", + "format": "int64", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Lyric model." + }, + "LyricMetadata": { + "type": "object", + "properties": { + "Artist": { + "type": "string", + "description": "Gets or sets the song artist.", + "nullable": true + }, + "Album": { + "type": "string", + "description": "Gets or sets the album this song is on.", + "nullable": true + }, + "Title": { + "type": "string", + "description": "Gets or sets the title of the song.", + "nullable": true + }, + "Author": { + "type": "string", + "description": "Gets or sets the author of the lyric data.", + "nullable": true + }, + "Length": { + "type": "integer", + "description": "Gets or sets the length of the song in ticks.", + "format": "int64", + "nullable": true + }, + "By": { + "type": "string", + "description": "Gets or sets who the LRC file was created by.", + "nullable": true + }, + "Offset": { + "type": "integer", + "description": "Gets or sets the lyric offset compared to audio in ticks.", + "format": "int64", + "nullable": true + }, + "Creator": { + "type": "string", + "description": "Gets or sets the software used to create the LRC file.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the version of the creator used.", + "nullable": true + }, + "IsSynced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this lyric is synced.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "LyricMetadata model." + }, + "MediaAttachment": { + "type": "object", + "properties": { + "Codec": { + "type": "string", + "description": "Gets or sets the codec.", + "nullable": true + }, + "CodecTag": { + "type": "string", + "description": "Gets or sets the codec tag.", + "nullable": true + }, + "Comment": { + "type": "string", + "description": "Gets or sets the comment.", + "nullable": true + }, + "Index": { + "type": "integer", + "description": "Gets or sets the index.", + "format": "int32" + }, + "FileName": { + "type": "string", + "description": "Gets or sets the filename.", + "nullable": true + }, + "MimeType": { + "type": "string", + "description": "Gets or sets the MIME type.", + "nullable": true + }, + "DeliveryUrl": { + "type": "string", + "description": "Gets or sets the delivery URL.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class MediaAttachment." + }, + "MediaPathDto": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name of the library." + }, + "Path": { + "type": "string", + "description": "Gets or sets the path to add.", + "nullable": true + }, + "PathInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathInfo" + } + ], + "description": "Gets or sets the path info.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Media Path dto." + }, + "MediaPathInfo": { + "type": "object", + "properties": { + "Path": { + "type": "string" + } + }, + "additionalProperties": false + }, + "MediaProtocol": { + "enum": [ + "File", + "Http", + "Rtmp", + "Rtsp", + "Udp", + "Rtp", + "Ftp" + ], + "type": "string" + }, + "MediaSegmentDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the id of the media segment.", + "format": "uuid" + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the id of the associated item.", + "format": "uuid" + }, + "Type": { + "enum": [ + "Unknown", + "Commercial", + "Preview", + "Recap", + "Outro", + "Intro" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaSegmentType" + } + ], + "description": "Gets or sets the type of content this segment defines.", + "default": "Unknown" + }, + "StartTicks": { + "type": "integer", + "description": "Gets or sets the start of the segment.", + "format": "int64" + }, + "EndTicks": { + "type": "integer", + "description": "Gets or sets the end of the segment.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Api model for MediaSegment's." + }, + "MediaSegmentDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaSegmentDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "MediaSegmentType": { + "enum": [ + "Unknown", + "Commercial", + "Preview", + "Recap", + "Outro", + "Intro" + ], + "type": "string", + "description": "Defines the types of content an individual Jellyfin.Data.Entities.MediaSegment represents." + }, + "MediaSourceInfo": { + "type": "object", + "properties": { + "Protocol": { + "enum": [ + "File", + "Http", + "Rtmp", + "Rtsp", + "Udp", + "Rtp", + "Ftp" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaProtocol" + } + ] + }, + "Id": { + "type": "string", + "nullable": true + }, + "Path": { + "type": "string", + "nullable": true + }, + "EncoderPath": { + "type": "string", + "nullable": true + }, + "EncoderProtocol": { + "enum": [ + "File", + "Http", + "Rtmp", + "Rtsp", + "Udp", + "Rtp", + "Ftp" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaProtocol" + } + ], + "nullable": true + }, + "Type": { + "enum": [ + "Default", + "Grouping", + "Placeholder" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaSourceType" + } + ] + }, + "Container": { + "type": "string", + "nullable": true + }, + "Size": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "Name": { + "type": "string", + "nullable": true + }, + "IsRemote": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the media is remote.\r\nDifferentiate internet url vs local network." + }, + "ETag": { + "type": "string", + "nullable": true + }, + "RunTimeTicks": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "ReadAtNativeFramerate": { + "type": "boolean" + }, + "IgnoreDts": { + "type": "boolean" + }, + "IgnoreIndex": { + "type": "boolean" + }, + "GenPtsInput": { + "type": "boolean" + }, + "SupportsTranscoding": { + "type": "boolean" + }, + "SupportsDirectStream": { + "type": "boolean" + }, + "SupportsDirectPlay": { + "type": "boolean" + }, + "IsInfiniteStream": { + "type": "boolean" + }, + "UseMostCompatibleTranscodingProfile": { + "type": "boolean", + "default": false + }, + "RequiresOpening": { + "type": "boolean" + }, + "OpenToken": { + "type": "string", + "nullable": true + }, + "RequiresClosing": { + "type": "boolean" + }, + "LiveStreamId": { + "type": "string", + "nullable": true + }, + "BufferMs": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "RequiresLooping": { + "type": "boolean" + }, + "SupportsProbing": { + "type": "boolean" + }, + "VideoType": { + "enum": [ + "VideoFile", + "Iso", + "Dvd", + "BluRay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/VideoType" + } + ], + "nullable": true + }, + "IsoType": { + "enum": [ + "Dvd", + "BluRay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/IsoType" + } + ], + "nullable": true + }, + "Video3DFormat": { + "enum": [ + "HalfSideBySide", + "FullSideBySide", + "FullTopAndBottom", + "HalfTopAndBottom", + "MVC" + ], + "allOf": [ + { + "$ref": "#/components/schemas/Video3DFormat" + } + ], + "nullable": true + }, + "MediaStreams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaStream" + }, + "nullable": true + }, + "MediaAttachments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaAttachment" + }, + "nullable": true + }, + "Formats": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Bitrate": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "FallbackMaxStreamingBitrate": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "Timestamp": { + "enum": [ + "None", + "Zero", + "Valid" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TransportStreamTimestamp" + } + ], + "nullable": true + }, + "RequiredHttpHeaders": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "nullable": true + }, + "TranscodingUrl": { + "type": "string", + "nullable": true + }, + "TranscodingSubProtocol": { + "enum": [ + "http", + "hls" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaStreamProtocol" + } + ], + "description": "Media streaming protocol.\r\nLowercase for backwards compatibility." + }, + "TranscodingContainer": { + "type": "string", + "nullable": true + }, + "AnalyzeDurationMs": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "DefaultAudioStreamIndex": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "DefaultSubtitleStreamIndex": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "HasSegments": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "MediaSourceType": { + "enum": [ + "Default", + "Grouping", + "Placeholder" + ], + "type": "string" + }, + "MediaStream": { + "type": "object", + "properties": { + "Codec": { + "type": "string", + "description": "Gets or sets the codec.", + "nullable": true + }, + "CodecTag": { + "type": "string", + "description": "Gets or sets the codec tag.", + "nullable": true + }, + "Language": { + "type": "string", + "description": "Gets or sets the language.", + "nullable": true + }, + "ColorRange": { + "type": "string", + "description": "Gets or sets the color range.", + "nullable": true + }, + "ColorSpace": { + "type": "string", + "description": "Gets or sets the color space.", + "nullable": true + }, + "ColorTransfer": { + "type": "string", + "description": "Gets or sets the color transfer.", + "nullable": true + }, + "ColorPrimaries": { + "type": "string", + "description": "Gets or sets the color primaries.", + "nullable": true + }, + "DvVersionMajor": { + "type": "integer", + "description": "Gets or sets the Dolby Vision version major.", + "format": "int32", + "nullable": true + }, + "DvVersionMinor": { + "type": "integer", + "description": "Gets or sets the Dolby Vision version minor.", + "format": "int32", + "nullable": true + }, + "DvProfile": { + "type": "integer", + "description": "Gets or sets the Dolby Vision profile.", + "format": "int32", + "nullable": true + }, + "DvLevel": { + "type": "integer", + "description": "Gets or sets the Dolby Vision level.", + "format": "int32", + "nullable": true + }, + "RpuPresentFlag": { + "type": "integer", + "description": "Gets or sets the Dolby Vision rpu present flag.", + "format": "int32", + "nullable": true + }, + "ElPresentFlag": { + "type": "integer", + "description": "Gets or sets the Dolby Vision el present flag.", + "format": "int32", + "nullable": true + }, + "BlPresentFlag": { + "type": "integer", + "description": "Gets or sets the Dolby Vision bl present flag.", + "format": "int32", + "nullable": true + }, + "DvBlSignalCompatibilityId": { + "type": "integer", + "description": "Gets or sets the Dolby Vision bl signal compatibility id.", + "format": "int32", + "nullable": true + }, + "Rotation": { + "type": "integer", + "description": "Gets or sets the Rotation in degrees.", + "format": "int32", + "nullable": true + }, + "Comment": { + "type": "string", + "description": "Gets or sets the comment.", + "nullable": true + }, + "TimeBase": { + "type": "string", + "description": "Gets or sets the time base.", + "nullable": true + }, + "CodecTimeBase": { + "type": "string", + "description": "Gets or sets the codec time base.", + "nullable": true + }, + "Title": { + "type": "string", + "description": "Gets or sets the title.", + "nullable": true + }, + "VideoRange": { + "enum": [ + "Unknown", + "SDR", + "HDR" + ], + "allOf": [ + { + "$ref": "#/components/schemas/VideoRange" + } + ], + "description": "Gets the video range.", + "default": "Unknown", + "readOnly": true + }, + "VideoRangeType": { + "enum": [ + "Unknown", + "SDR", + "HDR10", + "HLG", + "DOVI", + "DOVIWithHDR10", + "DOVIWithHLG", + "DOVIWithSDR", + "HDR10Plus" + ], + "allOf": [ + { + "$ref": "#/components/schemas/VideoRangeType" + } + ], + "description": "Gets the video range type.", + "default": "Unknown", + "readOnly": true + }, + "VideoDoViTitle": { + "type": "string", + "description": "Gets the video dovi title.", + "nullable": true, + "readOnly": true + }, + "AudioSpatialFormat": { + "enum": [ + "None", + "DolbyAtmos", + "DTSX" + ], + "allOf": [ + { + "$ref": "#/components/schemas/AudioSpatialFormat" + } + ], + "description": "Gets the audio spatial format.", + "default": "None", + "readOnly": true + }, + "LocalizedUndefined": { + "type": "string", + "nullable": true + }, + "LocalizedDefault": { + "type": "string", + "nullable": true + }, + "LocalizedForced": { + "type": "string", + "nullable": true + }, + "LocalizedExternal": { + "type": "string", + "nullable": true + }, + "LocalizedHearingImpaired": { + "type": "string", + "nullable": true + }, + "DisplayTitle": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "NalLengthSize": { + "type": "string", + "nullable": true + }, + "IsInterlaced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is interlaced." + }, + "IsAVC": { + "type": "boolean", + "nullable": true + }, + "ChannelLayout": { + "type": "string", + "description": "Gets or sets the channel layout.", + "nullable": true + }, + "BitRate": { + "type": "integer", + "description": "Gets or sets the bit rate.", + "format": "int32", + "nullable": true + }, + "BitDepth": { + "type": "integer", + "description": "Gets or sets the bit depth.", + "format": "int32", + "nullable": true + }, + "RefFrames": { + "type": "integer", + "description": "Gets or sets the reference frames.", + "format": "int32", + "nullable": true + }, + "PacketLength": { + "type": "integer", + "description": "Gets or sets the length of the packet.", + "format": "int32", + "nullable": true + }, + "Channels": { + "type": "integer", + "description": "Gets or sets the channels.", + "format": "int32", + "nullable": true + }, + "SampleRate": { + "type": "integer", + "description": "Gets or sets the sample rate.", + "format": "int32", + "nullable": true + }, + "IsDefault": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is default." + }, + "IsForced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is forced." + }, + "IsHearingImpaired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is for the hearing impaired." + }, + "Height": { + "type": "integer", + "description": "Gets or sets the height.", + "format": "int32", + "nullable": true + }, + "Width": { + "type": "integer", + "description": "Gets or sets the width.", + "format": "int32", + "nullable": true + }, + "AverageFrameRate": { + "type": "number", + "description": "Gets or sets the average frame rate.", + "format": "float", + "nullable": true + }, + "RealFrameRate": { + "type": "number", + "description": "Gets or sets the real frame rate.", + "format": "float", + "nullable": true + }, + "ReferenceFrameRate": { + "type": "number", + "description": "Gets the framerate used as reference.\r\nPrefer AverageFrameRate, if that is null or an unrealistic value\r\nthen fallback to RealFrameRate.", + "format": "float", + "nullable": true, + "readOnly": true + }, + "Profile": { + "type": "string", + "description": "Gets or sets the profile.", + "nullable": true + }, + "Type": { + "enum": [ + "Audio", + "Video", + "Subtitle", + "EmbeddedImage", + "Data", + "Lyric" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaStreamType" + } + ], + "description": "Gets or sets the type." + }, + "AspectRatio": { + "type": "string", + "description": "Gets or sets the aspect ratio.", + "nullable": true + }, + "Index": { + "type": "integer", + "description": "Gets or sets the index.", + "format": "int32" + }, + "Score": { + "type": "integer", + "description": "Gets or sets the score.", + "format": "int32", + "nullable": true + }, + "IsExternal": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is external." + }, + "DeliveryMethod": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ], + "description": "Gets or sets the method.", + "nullable": true + }, + "DeliveryUrl": { + "type": "string", + "description": "Gets or sets the delivery URL.", + "nullable": true + }, + "IsExternalUrl": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is external URL.", + "nullable": true + }, + "IsTextSubtitleStream": { + "type": "boolean", + "readOnly": true + }, + "SupportsExternalStream": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports external stream]." + }, + "Path": { + "type": "string", + "description": "Gets or sets the filename.", + "nullable": true + }, + "PixelFormat": { + "type": "string", + "description": "Gets or sets the pixel format.", + "nullable": true + }, + "Level": { + "type": "number", + "description": "Gets or sets the level.", + "format": "double", + "nullable": true + }, + "IsAnamorphic": { + "type": "boolean", + "description": "Gets or sets whether this instance is anamorphic.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class MediaStream." + }, + "MediaStreamProtocol": { + "enum": [ + "http", + "hls" + ], + "type": "string", + "description": "Media streaming protocol.\r\nLowercase for backwards compatibility." + }, + "MediaStreamType": { + "enum": [ + "Audio", + "Video", + "Subtitle", + "EmbeddedImage", + "Data", + "Lyric" + ], + "type": "string", + "description": "Enum MediaStreamType." + }, + "MediaType": { + "enum": [ + "Unknown", + "Video", + "Audio", + "Photo", + "Book" + ], + "type": "string", + "description": "Media types." + }, + "MediaUpdateInfoDto": { + "type": "object", + "properties": { + "Updates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaUpdateInfoPathDto" + }, + "description": "Gets or sets the list of updates." + } + }, + "additionalProperties": false, + "description": "Media Update Info Dto." + }, + "MediaUpdateInfoPathDto": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Gets or sets media path.", + "nullable": true + }, + "UpdateType": { + "type": "string", + "description": "Gets or sets media update type.\r\nCreated, Modified, Deleted.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The media update info path." + }, + "MediaUrl": { + "type": "object", + "properties": { + "Url": { + "type": "string", + "nullable": true + }, + "Name": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "MessageCommand": { + "required": [ + "Text" + ], + "type": "object", + "properties": { + "Header": { + "type": "string", + "nullable": true + }, + "Text": { + "type": "string" + }, + "TimeoutMs": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + "additionalProperties": false + }, + "MetadataConfiguration": { + "type": "object", + "properties": { + "UseFileCreationTimeForDateAdded": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "MetadataEditorInfo": { + "type": "object", + "properties": { + "ParentalRatingOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParentalRating" + } + }, + "Countries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CountryInfo" + } + }, + "Cultures": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CultureDto" + } + }, + "ExternalIdInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalIdInfo" + } + }, + "ContentType": { + "enum": [ + "unknown", + "movies", + "tvshows", + "music", + "musicvideos", + "trailers", + "homevideos", + "boxsets", + "books", + "photos", + "livetv", + "playlists", + "folders" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CollectionType" + } + ], + "nullable": true + }, + "ContentTypeOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameValuePair" + } + } + }, + "additionalProperties": false + }, + "MetadataField": { + "enum": [ + "Cast", + "Genres", + "ProductionLocations", + "Studios", + "Tags", + "Name", + "Overview", + "Runtime", + "OfficialRating" + ], + "type": "string", + "description": "Enum MetadataFields." + }, + "MetadataOptions": { + "type": "object", + "properties": { + "ItemType": { + "type": "string", + "nullable": true + }, + "DisabledMetadataSavers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "LocalMetadataReaderOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DisabledMetadataFetchers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "MetadataFetcherOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DisabledImageFetchers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ImageFetcherOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class MetadataOptions." + }, + "MetadataRefreshMode": { + "enum": [ + "None", + "ValidationOnly", + "Default", + "FullRefresh" + ], + "type": "string" + }, + "MovePlaylistItemRequestDto": { + "type": "object", + "properties": { + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist identifier of the item.", + "format": "uuid" + }, + "NewIndex": { + "type": "integer", + "description": "Gets or sets the new position.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Class MovePlaylistItemRequestDto." + }, + "MovieInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "MovieInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/MovieInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "MusicVideoInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "Artists": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "MusicVideoInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/MusicVideoInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "NameGuidPair": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "Id": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "NameIdPair": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "nullable": true + } + }, + "additionalProperties": false + }, + "NameValuePair": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Value": { + "type": "string", + "description": "Gets or sets the value.", + "nullable": true + } + }, + "additionalProperties": false + }, + "NetworkConfiguration": { + "type": "object", + "properties": { + "BaseUrl": { + "type": "string", + "description": "Gets or sets a value used to specify the URL prefix that your Jellyfin instance can be accessed at." + }, + "EnableHttps": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to use HTTPS." + }, + "RequireHttps": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the server should force connections over HTTPS." + }, + "CertificatePath": { + "type": "string", + "description": "Gets or sets the filesystem path of an X.509 certificate to use for SSL." + }, + "CertificatePassword": { + "type": "string", + "description": "Gets or sets the password required to access the X.509 certificate data in the file specified by MediaBrowser.Common.Net.NetworkConfiguration.CertificatePath." + }, + "InternalHttpPort": { + "type": "integer", + "description": "Gets or sets the internal HTTP server port.", + "format": "int32" + }, + "InternalHttpsPort": { + "type": "integer", + "description": "Gets or sets the internal HTTPS server port.", + "format": "int32" + }, + "PublicHttpPort": { + "type": "integer", + "description": "Gets or sets the public HTTP port.", + "format": "int32" + }, + "PublicHttpsPort": { + "type": "integer", + "description": "Gets or sets the public HTTPS port.", + "format": "int32" + }, + "AutoDiscovery": { + "type": "boolean", + "description": "Gets or sets a value indicating whether Autodiscovery is enabled." + }, + "EnableUPnP": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable automatic port forwarding." + }, + "EnableIPv4": { + "type": "boolean", + "description": "Gets or sets a value indicating whether IPv6 is enabled." + }, + "EnableIPv6": { + "type": "boolean", + "description": "Gets or sets a value indicating whether IPv6 is enabled." + }, + "EnableRemoteAccess": { + "type": "boolean", + "description": "Gets or sets a value indicating whether access from outside of the LAN is permitted." + }, + "LocalNetworkSubnets": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the subnets that are deemed to make up the LAN." + }, + "LocalNetworkAddresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the interface addresses which Jellyfin will bind to. If empty, all interfaces will be used." + }, + "KnownProxies": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the known proxies." + }, + "IgnoreVirtualInterfaces": { + "type": "boolean", + "description": "Gets or sets a value indicating whether address names that match MediaBrowser.Common.Net.NetworkConfiguration.VirtualInterfaceNames should be ignored for the purposes of binding." + }, + "VirtualInterfaceNames": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets a value indicating the interface name prefixes that should be ignored. The list can be comma separated and values are case-insensitive. ." + }, + "EnablePublishedServerUriByRequest": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the published server uri is based on information in HTTP requests." + }, + "PublishedServerUriBySubnet": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the PublishedServerUriBySubnet\r\nGets or sets PublishedServerUri to advertise for specific subnets." + }, + "RemoteIPFilter": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the filter for remote IP connectivity. Used in conjunction with ." + }, + "IsRemoteIPFilterBlacklist": { + "type": "boolean", + "description": "Gets or sets a value indicating whether contains a blacklist or a whitelist. Default is a whitelist." + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Common.Net.NetworkConfiguration." + }, + "NewGroupRequestDto": { + "type": "object", + "properties": { + "GroupName": { + "type": "string", + "description": "Gets or sets the group name." + } + }, + "additionalProperties": false, + "description": "Class NewGroupRequestDto." + }, + "NextItemRequestDto": { + "type": "object", + "properties": { + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playing item identifier.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class NextItemRequestDto." + }, + "OpenLiveStreamDto": { + "type": "object", + "properties": { + "OpenToken": { + "type": "string", + "description": "Gets or sets the open token.", + "nullable": true + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid", + "nullable": true + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session id.", + "nullable": true + }, + "MaxStreamingBitrate": { + "type": "integer", + "description": "Gets or sets the max streaming bitrate.", + "format": "int32", + "nullable": true + }, + "StartTimeTicks": { + "type": "integer", + "description": "Gets or sets the start time in ticks.", + "format": "int64", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the audio stream index.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the subtitle stream index.", + "format": "int32", + "nullable": true + }, + "MaxAudioChannels": { + "type": "integer", + "description": "Gets or sets the max audio channels.", + "format": "int32", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item id.", + "format": "uuid", + "nullable": true + }, + "EnableDirectPlay": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable direct play.", + "nullable": true + }, + "EnableDirectStream": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enale direct stream.", + "nullable": true + }, + "AlwaysBurnInSubtitleWhenTranscoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether always burn in subtitles when transcoding.", + "nullable": true + }, + "DeviceProfile": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't.", + "nullable": true + }, + "DirectPlayProtocols": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaProtocol" + }, + "description": "Gets or sets the device play protocols." + } + }, + "additionalProperties": false, + "description": "Open live stream dto." + }, + "OutboundKeepAliveMessage": { + "type": "object", + "properties": { + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "KeepAlive", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Keep alive websocket messages." + }, + "OutboundWebSocketMessage": { + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/ActivityLogEntryMessage" + }, + { + "$ref": "#/components/schemas/ForceKeepAliveMessage" + }, + { + "$ref": "#/components/schemas/GeneralCommandMessage" + }, + { + "$ref": "#/components/schemas/LibraryChangedMessage" + }, + { + "$ref": "#/components/schemas/OutboundKeepAliveMessage" + }, + { + "$ref": "#/components/schemas/PlayMessage" + }, + { + "$ref": "#/components/schemas/PlaystateMessage" + }, + { + "$ref": "#/components/schemas/PluginInstallationCancelledMessage" + }, + { + "$ref": "#/components/schemas/PluginInstallationCompletedMessage" + }, + { + "$ref": "#/components/schemas/PluginInstallationFailedMessage" + }, + { + "$ref": "#/components/schemas/PluginInstallingMessage" + }, + { + "$ref": "#/components/schemas/PluginUninstalledMessage" + }, + { + "$ref": "#/components/schemas/RefreshProgressMessage" + }, + { + "$ref": "#/components/schemas/RestartRequiredMessage" + }, + { + "$ref": "#/components/schemas/ScheduledTaskEndedMessage" + }, + { + "$ref": "#/components/schemas/ScheduledTasksInfoMessage" + }, + { + "$ref": "#/components/schemas/SeriesTimerCancelledMessage" + }, + { + "$ref": "#/components/schemas/SeriesTimerCreatedMessage" + }, + { + "$ref": "#/components/schemas/ServerRestartingMessage" + }, + { + "$ref": "#/components/schemas/ServerShuttingDownMessage" + }, + { + "$ref": "#/components/schemas/SessionsMessage" + }, + { + "$ref": "#/components/schemas/SyncPlayCommandMessage" + }, + { + "$ref": "#/components/schemas/SyncPlayGroupUpdateCommandMessage" + }, + { + "$ref": "#/components/schemas/TimerCancelledMessage" + }, + { + "$ref": "#/components/schemas/TimerCreatedMessage" + }, + { + "$ref": "#/components/schemas/UserDataChangedMessage" + }, + { + "$ref": "#/components/schemas/UserDeletedMessage" + }, + { + "$ref": "#/components/schemas/UserUpdatedMessage" + } + ], + "description": "Represents the list of possible outbound websocket types", + "discriminator": { + "propertyName": "MessageType", + "mapping": { + "ActivityLogEntry": "#/components/schemas/ActivityLogEntryMessage", + "ForceKeepAlive": "#/components/schemas/ForceKeepAliveMessage", + "GeneralCommand": "#/components/schemas/GeneralCommandMessage", + "LibraryChanged": "#/components/schemas/LibraryChangedMessage", + "KeepAlive": "#/components/schemas/OutboundKeepAliveMessage", + "Play": "#/components/schemas/PlayMessage", + "Playstate": "#/components/schemas/PlaystateMessage", + "PackageInstallationCancelled": "#/components/schemas/PluginInstallationCancelledMessage", + "PackageInstallationCompleted": "#/components/schemas/PluginInstallationCompletedMessage", + "PackageInstallationFailed": "#/components/schemas/PluginInstallationFailedMessage", + "PackageInstalling": "#/components/schemas/PluginInstallingMessage", + "PackageUninstalled": "#/components/schemas/PluginUninstalledMessage", + "RefreshProgress": "#/components/schemas/RefreshProgressMessage", + "RestartRequired": "#/components/schemas/RestartRequiredMessage", + "ScheduledTaskEnded": "#/components/schemas/ScheduledTaskEndedMessage", + "ScheduledTasksInfo": "#/components/schemas/ScheduledTasksInfoMessage", + "SeriesTimerCancelled": "#/components/schemas/SeriesTimerCancelledMessage", + "SeriesTimerCreated": "#/components/schemas/SeriesTimerCreatedMessage", + "ServerRestarting": "#/components/schemas/ServerRestartingMessage", + "ServerShuttingDown": "#/components/schemas/ServerShuttingDownMessage", + "Sessions": "#/components/schemas/SessionsMessage", + "SyncPlayCommand": "#/components/schemas/SyncPlayCommandMessage", + "SyncPlayGroupUpdate": "#/components/schemas/SyncPlayGroupUpdateCommandMessage", + "TimerCancelled": "#/components/schemas/TimerCancelledMessage", + "TimerCreated": "#/components/schemas/TimerCreatedMessage", + "UserDataChanged": "#/components/schemas/UserDataChangedMessage", + "UserDeleted": "#/components/schemas/UserDeletedMessage", + "UserUpdated": "#/components/schemas/UserUpdatedMessage" + } + } + }, + "PackageInfo": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Gets or sets the name." + }, + "description": { + "type": "string", + "description": "Gets or sets a long description of the plugin containing features or helpful explanations." + }, + "overview": { + "type": "string", + "description": "Gets or sets a short overview of what the plugin does." + }, + "owner": { + "type": "string", + "description": "Gets or sets the owner." + }, + "category": { + "type": "string", + "description": "Gets or sets the category." + }, + "guid": { + "type": "string", + "description": "Gets or sets the guid of the assembly associated with this plugin.\r\nThis is used to identify the proper item for automatic updates.", + "format": "uuid" + }, + "versions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VersionInfo" + }, + "description": "Gets or sets the versions." + }, + "imageUrl": { + "type": "string", + "description": "Gets or sets the image url for the package.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PackageInfo." + }, + "ParentalRating": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Value": { + "type": "integer", + "description": "Gets or sets the value.", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class ParentalRating." + }, + "PathSubstitution": { + "type": "object", + "properties": { + "From": { + "type": "string", + "description": "Gets or sets the value to substitute." + }, + "To": { + "type": "string", + "description": "Gets or sets the value to substitution with." + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Configuration.PathSubstitution." + }, + "PersonKind": { + "enum": [ + "Unknown", + "Actor", + "Director", + "Composer", + "Writer", + "GuestStar", + "Producer", + "Conductor", + "Lyricist", + "Arranger", + "Engineer", + "Mixer", + "Remixer", + "Creator", + "Artist", + "AlbumArtist", + "Author", + "Illustrator", + "Penciller", + "Inker", + "Colorist", + "Letterer", + "CoverArtist", + "Editor", + "Translator" + ], + "type": "string", + "description": "The person kind." + }, + "PersonLookupInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "PersonLookupInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/PersonLookupInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "PingRequestDto": { + "type": "object", + "properties": { + "Ping": { + "type": "integer", + "description": "Gets or sets the ping time.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Class PingRequestDto." + }, + "PinRedeemResult": { + "type": "object", + "properties": { + "Success": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Users.PinRedeemResult is success." + }, + "UsersReset": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the users reset." + } + }, + "additionalProperties": false + }, + "PlayAccess": { + "enum": [ + "Full", + "None" + ], + "type": "string" + }, + "PlaybackErrorCode": { + "enum": [ + "NotAllowed", + "NoCompatibleStream", + "RateLimitExceeded" + ], + "type": "string" + }, + "PlaybackInfoDto": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "description": "Gets or sets the playback userId.", + "format": "uuid", + "nullable": true + }, + "MaxStreamingBitrate": { + "type": "integer", + "description": "Gets or sets the max streaming bitrate.", + "format": "int32", + "nullable": true + }, + "StartTimeTicks": { + "type": "integer", + "description": "Gets or sets the start time in ticks.", + "format": "int64", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the audio stream index.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the subtitle stream index.", + "format": "int32", + "nullable": true + }, + "MaxAudioChannels": { + "type": "integer", + "description": "Gets or sets the max audio channels.", + "format": "int32", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the media source id.", + "nullable": true + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the live stream id.", + "nullable": true + }, + "DeviceProfile": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't.", + "nullable": true + }, + "EnableDirectPlay": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable direct play.", + "nullable": true + }, + "EnableDirectStream": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable direct stream.", + "nullable": true + }, + "EnableTranscoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable transcoding.", + "nullable": true + }, + "AllowVideoStreamCopy": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable video stream copy.", + "nullable": true + }, + "AllowAudioStreamCopy": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to allow audio stream copy.", + "nullable": true + }, + "AutoOpenLiveStream": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to auto open the live stream.", + "nullable": true + }, + "AlwaysBurnInSubtitleWhenTranscoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether always burn in subtitles when transcoding.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Plabyback info dto." + }, + "PlaybackInfoResponse": { + "type": "object", + "properties": { + "MediaSources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaSourceInfo" + }, + "description": "Gets or sets the media sources." + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session identifier.", + "nullable": true + }, + "ErrorCode": { + "enum": [ + "NotAllowed", + "NoCompatibleStream", + "RateLimitExceeded" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackErrorCode" + } + ], + "description": "Gets or sets the error code.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlaybackInfoResponse." + }, + "PlaybackOrder": { + "enum": [ + "Default", + "Shuffle" + ], + "type": "string", + "description": "Enum PlaybackOrder." + }, + "PlaybackProgressInfo": { + "type": "object", + "properties": { + "CanSeek": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can seek." + }, + "Item": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the item.", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "format": "uuid" + }, + "SessionId": { + "type": "string", + "description": "Gets or sets the session id.", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the media version identifier.", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the audio stream.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the subtitle stream.", + "format": "int32", + "nullable": true + }, + "IsPaused": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is paused." + }, + "IsMuted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is muted." + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64", + "nullable": true + }, + "PlaybackStartTimeTicks": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "VolumeLevel": { + "type": "integer", + "description": "Gets or sets the volume level.", + "format": "int32", + "nullable": true + }, + "Brightness": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AspectRatio": { + "type": "string", + "nullable": true + }, + "PlayMethod": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ], + "description": "Gets or sets the play method." + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the live stream identifier.", + "nullable": true + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session identifier.", + "nullable": true + }, + "RepeatMode": { + "enum": [ + "RepeatNone", + "RepeatAll", + "RepeatOne" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RepeatMode" + } + ], + "description": "Gets or sets the repeat mode." + }, + "PlaybackOrder": { + "enum": [ + "Default", + "Shuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackOrder" + } + ], + "description": "Gets or sets the playback order." + }, + "NowPlayingQueue": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueItem" + }, + "nullable": true + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlaybackProgressInfo." + }, + "PlaybackRequestType": { + "enum": [ + "Play", + "SetPlaylistItem", + "RemoveFromPlaylist", + "MovePlaylistItem", + "Queue", + "Unpause", + "Pause", + "Stop", + "Seek", + "Buffer", + "Ready", + "NextItem", + "PreviousItem", + "SetRepeatMode", + "SetShuffleMode", + "Ping", + "IgnoreWait" + ], + "type": "string", + "description": "Enum PlaybackRequestType." + }, + "PlaybackStartInfo": { + "type": "object", + "properties": { + "CanSeek": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can seek." + }, + "Item": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the item.", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "format": "uuid" + }, + "SessionId": { + "type": "string", + "description": "Gets or sets the session id.", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the media version identifier.", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the audio stream.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the subtitle stream.", + "format": "int32", + "nullable": true + }, + "IsPaused": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is paused." + }, + "IsMuted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is muted." + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64", + "nullable": true + }, + "PlaybackStartTimeTicks": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "VolumeLevel": { + "type": "integer", + "description": "Gets or sets the volume level.", + "format": "int32", + "nullable": true + }, + "Brightness": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AspectRatio": { + "type": "string", + "nullable": true + }, + "PlayMethod": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ], + "description": "Gets or sets the play method." + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the live stream identifier.", + "nullable": true + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session identifier.", + "nullable": true + }, + "RepeatMode": { + "enum": [ + "RepeatNone", + "RepeatAll", + "RepeatOne" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RepeatMode" + } + ], + "description": "Gets or sets the repeat mode." + }, + "PlaybackOrder": { + "enum": [ + "Default", + "Shuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackOrder" + } + ], + "description": "Gets or sets the playback order." + }, + "NowPlayingQueue": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueItem" + }, + "nullable": true + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlaybackStartInfo." + }, + "PlaybackStopInfo": { + "type": "object", + "properties": { + "Item": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the item.", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "format": "uuid" + }, + "SessionId": { + "type": "string", + "description": "Gets or sets the session id.", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the media version identifier.", + "nullable": true + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64", + "nullable": true + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the live stream identifier.", + "nullable": true + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session identifier.", + "nullable": true + }, + "Failed": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Session.PlaybackStopInfo is failed." + }, + "NextMediaType": { + "type": "string", + "nullable": true + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + }, + "NowPlayingQueue": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueItem" + }, + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlaybackStopInfo." + }, + "PlayCommand": { + "enum": [ + "PlayNow", + "PlayNext", + "PlayLast", + "PlayInstantMix", + "PlayShuffle" + ], + "type": "string", + "description": "Enum PlayCommand." + }, + "PlayerStateInfo": { + "type": "object", + "properties": { + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the now playing position ticks.", + "format": "int64", + "nullable": true + }, + "CanSeek": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can seek." + }, + "IsPaused": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is paused." + }, + "IsMuted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is muted." + }, + "VolumeLevel": { + "type": "integer", + "description": "Gets or sets the volume level.", + "format": "int32", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the now playing audio stream.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the now playing subtitle stream.", + "format": "int32", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the now playing media version identifier.", + "nullable": true + }, + "PlayMethod": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ], + "description": "Gets or sets the play method.", + "nullable": true + }, + "RepeatMode": { + "enum": [ + "RepeatNone", + "RepeatAll", + "RepeatOne" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RepeatMode" + } + ], + "description": "Gets or sets the repeat mode." + }, + "PlaybackOrder": { + "enum": [ + "Default", + "Shuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackOrder" + } + ], + "description": "Gets or sets the playback order." + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the now playing live stream identifier.", + "nullable": true + } + }, + "additionalProperties": false + }, + "PlaylistCreationResult": { + "type": "object", + "properties": { + "Id": { + "type": "string" + } + }, + "additionalProperties": false + }, + "PlaylistDto": { + "type": "object", + "properties": { + "OpenAccess": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the playlist is publicly readable." + }, + "Shares": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + }, + "description": "Gets or sets the share permissions." + }, + "ItemIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the item ids." + } + }, + "additionalProperties": false, + "description": "DTO for playlists." + }, + "PlaylistUserPermissions": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid" + }, + "CanEdit": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the user has edit permissions." + } + }, + "additionalProperties": false, + "description": "Class to hold data on user permissions for playlists." + }, + "PlayMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayRequest" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "Play", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Play command websocket message." + }, + "PlayMethod": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "type": "string" + }, + "PlayQueueUpdate": { + "type": "object", + "properties": { + "Reason": { + "enum": [ + "NewPlaylist", + "SetCurrentItem", + "RemoveItems", + "MoveItem", + "Queue", + "QueueNext", + "NextItem", + "PreviousItem", + "RepeatMode", + "ShuffleMode" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayQueueUpdateReason" + } + ], + "description": "Gets the request type that originated this update." + }, + "LastUpdate": { + "type": "string", + "description": "Gets the UTC time of the last change to the playing queue.", + "format": "date-time" + }, + "Playlist": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SyncPlayQueueItem" + }, + "description": "Gets the playlist." + }, + "PlayingItemIndex": { + "type": "integer", + "description": "Gets the playing item index in the playlist.", + "format": "int32" + }, + "StartPositionTicks": { + "type": "integer", + "description": "Gets the start position ticks.", + "format": "int64" + }, + "IsPlaying": { + "type": "boolean", + "description": "Gets a value indicating whether the current item is playing." + }, + "ShuffleMode": { + "enum": [ + "Sorted", + "Shuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupShuffleMode" + } + ], + "description": "Gets the shuffle mode." + }, + "RepeatMode": { + "enum": [ + "RepeatOne", + "RepeatAll", + "RepeatNone" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupRepeatMode" + } + ], + "description": "Gets the repeat mode." + } + }, + "additionalProperties": false, + "description": "Class PlayQueueUpdate." + }, + "PlayQueueUpdateGroupUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "CreateGroupDenied", + "JoinGroupDenied", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Gets the update type." + }, + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayQueueUpdate" + } + ], + "description": "Gets the update data." + } + }, + "additionalProperties": false, + "description": "Class GroupUpdate." + }, + "PlayQueueUpdateReason": { + "enum": [ + "NewPlaylist", + "SetCurrentItem", + "RemoveItems", + "MoveItem", + "Queue", + "QueueNext", + "NextItem", + "PreviousItem", + "RepeatMode", + "ShuffleMode" + ], + "type": "string", + "description": "Enum PlayQueueUpdateReason." + }, + "PlayRequest": { + "type": "object", + "properties": { + "ItemIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the item ids.", + "nullable": true + }, + "StartPositionTicks": { + "type": "integer", + "description": "Gets or sets the start position ticks that the first item should be played at.", + "format": "int64", + "nullable": true + }, + "PlayCommand": { + "enum": [ + "PlayNow", + "PlayNext", + "PlayLast", + "PlayInstantMix", + "PlayShuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayCommand" + } + ], + "description": "Gets or sets the play command." + }, + "ControllingUserId": { + "type": "string", + "description": "Gets or sets the controlling user identifier.", + "format": "uuid" + }, + "SubtitleStreamIndex": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "nullable": true + }, + "StartIndex": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlayRequest." + }, + "PlayRequestDto": { + "type": "object", + "properties": { + "PlayingQueue": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the playing queue." + }, + "PlayingItemPosition": { + "type": "integer", + "description": "Gets or sets the position of the playing item in the queue.", + "format": "int32" + }, + "StartPositionTicks": { + "type": "integer", + "description": "Gets or sets the start position ticks.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Class PlayRequestDto." + }, + "PlaystateCommand": { + "enum": [ + "Stop", + "Pause", + "Unpause", + "NextTrack", + "PreviousTrack", + "Seek", + "Rewind", + "FastForward", + "PlayPause" + ], + "type": "string", + "description": "Enum PlaystateCommand." + }, + "PlaystateMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaystateRequest" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "Playstate", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Playstate message." + }, + "PlaystateRequest": { + "type": "object", + "properties": { + "Command": { + "enum": [ + "Stop", + "Pause", + "Unpause", + "NextTrack", + "PreviousTrack", + "Seek", + "Rewind", + "FastForward", + "PlayPause" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaystateCommand" + } + ], + "description": "Enum PlaystateCommand." + }, + "SeekPositionTicks": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "ControllingUserId": { + "type": "string", + "description": "Gets or sets the controlling user identifier.", + "nullable": true + } + }, + "additionalProperties": false + }, + "PluginInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "Version": { + "type": "string", + "description": "Gets or sets the version." + }, + "ConfigurationFileName": { + "type": "string", + "description": "Gets or sets the name of the configuration file.", + "nullable": true + }, + "Description": { + "type": "string", + "description": "Gets or sets the description." + }, + "Id": { + "type": "string", + "description": "Gets or sets the unique id.", + "format": "uuid" + }, + "CanUninstall": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the plugin can be uninstalled." + }, + "HasImage": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this plugin has a valid image." + }, + "Status": { + "enum": [ + "Active", + "Restart", + "Deleted", + "Superceded", + "Malfunctioned", + "NotSupported", + "Disabled" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PluginStatus" + } + ], + "description": "Gets or sets a value indicating the status of the plugin." + } + }, + "additionalProperties": false, + "description": "This is a serializable stub class that is used by the api to provide information about installed plugins." + }, + "PluginInstallationCancelledMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/InstallationInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "PackageInstallationCancelled", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Plugin installation cancelled message." + }, + "PluginInstallationCompletedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/InstallationInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "PackageInstallationCompleted", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Plugin installation completed message." + }, + "PluginInstallationFailedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/InstallationInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "PackageInstallationFailed", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Plugin installation failed message." + }, + "PluginInstallingMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/InstallationInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "PackageInstalling", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Package installing message." + }, + "PluginStatus": { + "enum": [ + "Active", + "Restart", + "Deleted", + "Superceded", + "Malfunctioned", + "NotSupported", + "Disabled" + ], + "type": "string", + "description": "Plugin load status." + }, + "PluginUninstalledMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/PluginInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "PackageUninstalled", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Plugin uninstalled message." + }, + "PreviousItemRequestDto": { + "type": "object", + "properties": { + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playing item identifier.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class PreviousItemRequestDto." + }, + "ProblemDetails": { + "type": "object", + "properties": { + "type": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "status": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "detail": { + "type": "string", + "nullable": true + }, + "instance": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": {} + }, + "ProcessPriorityClass": { + "enum": [ + "Normal", + "Idle", + "High", + "RealTime", + "BelowNormal", + "AboveNormal" + ], + "type": "string" + }, + "ProfileCondition": { + "type": "object", + "properties": { + "Condition": { + "enum": [ + "Equals", + "NotEquals", + "LessThanEqual", + "GreaterThanEqual", + "EqualsAny" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ProfileConditionType" + } + ] + }, + "Property": { + "enum": [ + "AudioChannels", + "AudioBitrate", + "AudioProfile", + "Width", + "Height", + "Has64BitOffsets", + "PacketLength", + "VideoBitDepth", + "VideoBitrate", + "VideoFramerate", + "VideoLevel", + "VideoProfile", + "VideoTimestamp", + "IsAnamorphic", + "RefFrames", + "NumAudioStreams", + "NumVideoStreams", + "IsSecondaryAudio", + "VideoCodecTag", + "IsAvc", + "IsInterlaced", + "AudioSampleRate", + "AudioBitDepth", + "VideoRangeType" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ProfileConditionValue" + } + ] + }, + "Value": { + "type": "string", + "nullable": true + }, + "IsRequired": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "ProfileConditionType": { + "enum": [ + "Equals", + "NotEquals", + "LessThanEqual", + "GreaterThanEqual", + "EqualsAny" + ], + "type": "string" + }, + "ProfileConditionValue": { + "enum": [ + "AudioChannels", + "AudioBitrate", + "AudioProfile", + "Width", + "Height", + "Has64BitOffsets", + "PacketLength", + "VideoBitDepth", + "VideoBitrate", + "VideoFramerate", + "VideoLevel", + "VideoProfile", + "VideoTimestamp", + "IsAnamorphic", + "RefFrames", + "NumAudioStreams", + "NumVideoStreams", + "IsSecondaryAudio", + "VideoCodecTag", + "IsAvc", + "IsInterlaced", + "AudioSampleRate", + "AudioBitDepth", + "VideoRangeType" + ], + "type": "string" + }, + "ProgramAudio": { + "enum": [ + "Mono", + "Stereo", + "Dolby", + "DolbyDigital", + "Thx", + "Atmos" + ], + "type": "string" + }, + "PublicSystemInfo": { + "type": "object", + "properties": { + "LocalAddress": { + "type": "string", + "description": "Gets or sets the local address.", + "nullable": true + }, + "ServerName": { + "type": "string", + "description": "Gets or sets the name of the server.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the server version.", + "nullable": true + }, + "ProductName": { + "type": "string", + "description": "Gets or sets the product name. This is the AssemblyProduct name.", + "nullable": true + }, + "OperatingSystem": { + "type": "string", + "description": "Gets or sets the operating system.", + "nullable": true, + "deprecated": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "StartupWizardCompleted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the startup wizard is completed.", + "nullable": true + } + }, + "additionalProperties": false + }, + "QueryFilters": { + "type": "object", + "properties": { + "Genres": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "nullable": true + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "QueryFiltersLegacy": { + "type": "object", + "properties": { + "Genres": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "OfficialRatings": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Years": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "QueueItem": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "format": "uuid" + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "QueueRequestDto": { + "type": "object", + "properties": { + "ItemIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the items to enqueue." + }, + "Mode": { + "enum": [ + "Queue", + "QueueNext" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupQueueMode" + } + ], + "description": "Enum GroupQueueMode." + } + }, + "additionalProperties": false, + "description": "Class QueueRequestDto." + }, + "QuickConnectDto": { + "required": [ + "Secret" + ], + "type": "object", + "properties": { + "Secret": { + "type": "string", + "description": "Gets or sets the quick connect secret." + } + }, + "additionalProperties": false, + "description": "The quick connect request body." + }, + "QuickConnectResult": { + "type": "object", + "properties": { + "Authenticated": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this request is authorized." + }, + "Secret": { + "type": "string", + "description": "Gets the secret value used to uniquely identify this request. Can be used to retrieve authentication information." + }, + "Code": { + "type": "string", + "description": "Gets the user facing code used so the user can quickly differentiate this request from others." + }, + "DeviceId": { + "type": "string", + "description": "Gets the requesting device id." + }, + "DeviceName": { + "type": "string", + "description": "Gets the requesting device name." + }, + "AppName": { + "type": "string", + "description": "Gets the requesting app name." + }, + "AppVersion": { + "type": "string", + "description": "Gets the requesting app version." + }, + "DateAdded": { + "type": "string", + "description": "Gets or sets the DateTime that this request was created.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Stores the state of an quick connect request." + }, + "RatingType": { + "enum": [ + "Score", + "Likes" + ], + "type": "string" + }, + "ReadyRequestDto": { + "type": "object", + "properties": { + "When": { + "type": "string", + "description": "Gets or sets when the request has been made by the client.", + "format": "date-time" + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64" + }, + "IsPlaying": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the client playback is unpaused." + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist item identifier of the playing item.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class ReadyRequest." + }, + "RecommendationDto": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + }, + "nullable": true + }, + "RecommendationType": { + "enum": [ + "SimilarToRecentlyPlayed", + "SimilarToLikedItem", + "HasDirectorFromRecentlyPlayed", + "HasActorFromRecentlyPlayed", + "HasLikedDirector", + "HasLikedActor" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RecommendationType" + } + ] + }, + "BaselineItemName": { + "type": "string", + "nullable": true + }, + "CategoryId": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "RecommendationType": { + "enum": [ + "SimilarToRecentlyPlayed", + "SimilarToLikedItem", + "HasDirectorFromRecentlyPlayed", + "HasActorFromRecentlyPlayed", + "HasLikedDirector", + "HasLikedActor" + ], + "type": "string" + }, + "RecordingStatus": { + "enum": [ + "New", + "InProgress", + "Completed", + "Cancelled", + "ConflictedOk", + "ConflictedNotOk", + "Error" + ], + "type": "string" + }, + "RefreshProgressMessage": { + "type": "object", + "properties": { + "Data": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "RefreshProgress", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Refresh progress message." + }, + "RemoteImageInfo": { + "type": "object", + "properties": { + "ProviderName": { + "type": "string", + "description": "Gets or sets the name of the provider.", + "nullable": true + }, + "Url": { + "type": "string", + "description": "Gets or sets the URL.", + "nullable": true + }, + "ThumbnailUrl": { + "type": "string", + "description": "Gets or sets a url used for previewing a smaller version.", + "nullable": true + }, + "Height": { + "type": "integer", + "description": "Gets or sets the height.", + "format": "int32", + "nullable": true + }, + "Width": { + "type": "integer", + "description": "Gets or sets the width.", + "format": "int32", + "nullable": true + }, + "CommunityRating": { + "type": "number", + "description": "Gets or sets the community rating.", + "format": "double", + "nullable": true + }, + "VoteCount": { + "type": "integer", + "description": "Gets or sets the vote count.", + "format": "int32", + "nullable": true + }, + "Language": { + "type": "string", + "description": "Gets or sets the language.", + "nullable": true + }, + "Type": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Gets or sets the type." + }, + "RatingType": { + "enum": [ + "Score", + "Likes" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RatingType" + } + ], + "description": "Gets or sets the type of the rating." + } + }, + "additionalProperties": false, + "description": "Class RemoteImageInfo." + }, + "RemoteImageResult": { + "type": "object", + "properties": { + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteImageInfo" + }, + "description": "Gets or sets the images.", + "nullable": true + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total record count.", + "format": "int32" + }, + "Providers": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the providers.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class RemoteImageResult." + }, + "RemoteLyricInfoDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the id for the lyric." + }, + "ProviderName": { + "type": "string", + "description": "Gets the provider name." + }, + "Lyrics": { + "allOf": [ + { + "$ref": "#/components/schemas/LyricDto" + } + ], + "description": "Gets the lyrics." + } + }, + "additionalProperties": false, + "description": "The remote lyric info dto." + }, + "RemoteSearchResult": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "ProductionYear": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "IndexNumberEnd": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "ImageUrl": { + "type": "string", + "nullable": true + }, + "SearchProviderName": { + "type": "string", + "nullable": true + }, + "Overview": { + "type": "string", + "nullable": true + }, + "AlbumArtist": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoteSearchResult" + } + ], + "nullable": true + }, + "Artists": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "RemoteSubtitleInfo": { + "type": "object", + "properties": { + "ThreeLetterISOLanguageName": { + "type": "string", + "nullable": true + }, + "Id": { + "type": "string", + "nullable": true + }, + "ProviderName": { + "type": "string", + "nullable": true + }, + "Name": { + "type": "string", + "nullable": true + }, + "Format": { + "type": "string", + "nullable": true + }, + "Author": { + "type": "string", + "nullable": true + }, + "Comment": { + "type": "string", + "nullable": true + }, + "DateCreated": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "CommunityRating": { + "type": "number", + "format": "float", + "nullable": true + }, + "FrameRate": { + "type": "number", + "format": "float", + "nullable": true + }, + "DownloadCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "IsHashMatch": { + "type": "boolean", + "nullable": true + }, + "AiTranslated": { + "type": "boolean", + "nullable": true + }, + "MachineTranslated": { + "type": "boolean", + "nullable": true + }, + "Forced": { + "type": "boolean", + "nullable": true + }, + "HearingImpaired": { + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": false + }, + "RemoveFromPlaylistRequestDto": { + "type": "object", + "properties": { + "PlaylistItemIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the playlist identifiers of the items. Ignored when clearing the playlist." + }, + "ClearPlaylist": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the entire playlist should be cleared." + }, + "ClearPlayingItem": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the playing item should be removed as well. Used only when clearing the playlist." + } + }, + "additionalProperties": false, + "description": "Class RemoveFromPlaylistRequestDto." + }, + "RepeatMode": { + "enum": [ + "RepeatNone", + "RepeatAll", + "RepeatOne" + ], + "type": "string" + }, + "RepositoryInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Url": { + "type": "string", + "description": "Gets or sets the URL.", + "nullable": true + }, + "Enabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the repository is enabled." + } + }, + "additionalProperties": false, + "description": "Class RepositoryInfo." + }, + "RestartRequiredMessage": { + "type": "object", + "properties": { + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "RestartRequired", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Restart required." + }, + "ScheduledTaskEndedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskResult" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ScheduledTaskEnded", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Scheduled task ended message." + }, + "ScheduledTasksInfoMessage": { + "type": "object", + "properties": { + "Data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskInfo" + }, + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ScheduledTasksInfo", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Scheduled tasks info message." + }, + "ScheduledTasksInfoStartMessage": { + "type": "object", + "properties": { + "Data": { + "type": "string", + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ScheduledTasksInfoStart", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Scheduled tasks info start message.\r\nData is the timing data encoded as \"$initialDelay,$interval\" in ms." + }, + "ScheduledTasksInfoStopMessage": { + "type": "object", + "properties": { + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ScheduledTasksInfoStop", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Scheduled tasks info stop message." + }, + "ScrollDirection": { + "enum": [ + "Horizontal", + "Vertical" + ], + "type": "string", + "description": "An enum representing the axis that should be scrolled." + }, + "SearchHint": { + "type": "object", + "properties": { + "ItemId": { + "type": "string", + "description": "Gets or sets the item id.", + "format": "uuid", + "deprecated": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the item id.", + "format": "uuid" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "MatchedTerm": { + "type": "string", + "description": "Gets or sets the matched term.", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "description": "Gets or sets the index number.", + "format": "int32", + "nullable": true + }, + "ProductionYear": { + "type": "integer", + "description": "Gets or sets the production year.", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "description": "Gets or sets the parent index number.", + "format": "int32", + "nullable": true + }, + "PrimaryImageTag": { + "type": "string", + "description": "Gets or sets the image tag.", + "nullable": true + }, + "ThumbImageTag": { + "type": "string", + "description": "Gets or sets the thumb image tag.", + "nullable": true + }, + "ThumbImageItemId": { + "type": "string", + "description": "Gets or sets the thumb image item identifier.", + "nullable": true + }, + "BackdropImageTag": { + "type": "string", + "description": "Gets or sets the backdrop image tag.", + "nullable": true + }, + "BackdropImageItemId": { + "type": "string", + "description": "Gets or sets the backdrop image item identifier.", + "nullable": true + }, + "Type": { + "enum": [ + "AggregateFolder", + "Audio", + "AudioBook", + "BasePluginFolder", + "Book", + "BoxSet", + "Channel", + "ChannelFolderItem", + "CollectionFolder", + "Episode", + "Folder", + "Genre", + "ManualPlaylistsFolder", + "Movie", + "LiveTvChannel", + "LiveTvProgram", + "MusicAlbum", + "MusicArtist", + "MusicGenre", + "MusicVideo", + "Person", + "Photo", + "PhotoAlbum", + "Playlist", + "PlaylistsFolder", + "Program", + "Recording", + "Season", + "Series", + "Studio", + "Trailer", + "TvChannel", + "TvProgram", + "UserRootFolder", + "UserView", + "Video", + "Year" + ], + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemKind" + } + ], + "description": "Gets or sets the type." + }, + "IsFolder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is folder.", + "nullable": true + }, + "RunTimeTicks": { + "type": "integer", + "description": "Gets or sets the run time ticks.", + "format": "int64", + "nullable": true + }, + "MediaType": { + "enum": [ + "Unknown", + "Video", + "Audio", + "Photo", + "Book" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaType" + } + ], + "description": "Gets or sets the type of the media.", + "default": "Unknown" + }, + "StartDate": { + "type": "string", + "description": "Gets or sets the start date.", + "format": "date-time", + "nullable": true + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date.", + "format": "date-time", + "nullable": true + }, + "Series": { + "type": "string", + "description": "Gets or sets the series.", + "nullable": true + }, + "Status": { + "type": "string", + "description": "Gets or sets the status.", + "nullable": true + }, + "Album": { + "type": "string", + "description": "Gets or sets the album.", + "nullable": true + }, + "AlbumId": { + "type": "string", + "description": "Gets or sets the album id.", + "format": "uuid", + "nullable": true + }, + "AlbumArtist": { + "type": "string", + "description": "Gets or sets the album artist.", + "nullable": true + }, + "Artists": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the artists." + }, + "SongCount": { + "type": "integer", + "description": "Gets or sets the song count.", + "format": "int32", + "nullable": true + }, + "EpisodeCount": { + "type": "integer", + "description": "Gets or sets the episode count.", + "format": "int32", + "nullable": true + }, + "ChannelId": { + "type": "string", + "description": "Gets or sets the channel identifier.", + "format": "uuid", + "nullable": true + }, + "ChannelName": { + "type": "string", + "description": "Gets or sets the name of the channel.", + "nullable": true + }, + "PrimaryImageAspectRatio": { + "type": "number", + "description": "Gets or sets the primary image aspect ratio.", + "format": "double", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class SearchHintResult." + }, + "SearchHintResult": { + "type": "object", + "properties": { + "SearchHints": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SearchHint" + }, + "description": "Gets the search hints." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets the total record count.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Class SearchHintResult." + }, + "SeekRequestDto": { + "type": "object", + "properties": { + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Class SeekRequestDto." + }, + "SendCommand": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid" + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets the playlist identifier of the playing item.", + "format": "uuid" + }, + "When": { + "type": "string", + "description": "Gets or sets the UTC time when to execute the command.", + "format": "date-time" + }, + "PositionTicks": { + "type": "integer", + "description": "Gets the position ticks.", + "format": "int64", + "nullable": true + }, + "Command": { + "enum": [ + "Unpause", + "Pause", + "Stop", + "Seek" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SendCommandType" + } + ], + "description": "Gets the command." + }, + "EmittedAt": { + "type": "string", + "description": "Gets the UTC time when this command has been emitted.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Class SendCommand." + }, + "SendCommandType": { + "enum": [ + "Unpause", + "Pause", + "Stop", + "Seek" + ], + "type": "string", + "description": "Enum SendCommandType." + }, + "SeriesInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "SeriesInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "SeriesStatus": { + "enum": [ + "Continuing", + "Ended", + "Unreleased" + ], + "type": "string", + "description": "The status of a series." + }, + "SeriesTimerCancelledMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerEventInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SeriesTimerCancelled", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Series timer cancelled message." + }, + "SeriesTimerCreatedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerEventInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SeriesTimerCreated", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Series timer created message." + }, + "SeriesTimerInfoDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the Id of the recording.", + "nullable": true + }, + "Type": { + "type": "string", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server identifier.", + "nullable": true + }, + "ExternalId": { + "type": "string", + "description": "Gets or sets the external identifier.", + "nullable": true + }, + "ChannelId": { + "type": "string", + "description": "Gets or sets the channel id of the recording.", + "format": "uuid" + }, + "ExternalChannelId": { + "type": "string", + "description": "Gets or sets the external channel identifier.", + "nullable": true + }, + "ChannelName": { + "type": "string", + "description": "Gets or sets the channel name of the recording.", + "nullable": true + }, + "ChannelPrimaryImageTag": { + "type": "string", + "nullable": true + }, + "ProgramId": { + "type": "string", + "description": "Gets or sets the program identifier.", + "nullable": true + }, + "ExternalProgramId": { + "type": "string", + "description": "Gets or sets the external program identifier.", + "nullable": true + }, + "Name": { + "type": "string", + "description": "Gets or sets the name of the recording.", + "nullable": true + }, + "Overview": { + "type": "string", + "description": "Gets or sets the description of the recording.", + "nullable": true + }, + "StartDate": { + "type": "string", + "description": "Gets or sets the start date of the recording, in UTC.", + "format": "date-time" + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date of the recording, in UTC.", + "format": "date-time" + }, + "ServiceName": { + "type": "string", + "description": "Gets or sets the name of the service.", + "nullable": true + }, + "Priority": { + "type": "integer", + "description": "Gets or sets the priority.", + "format": "int32" + }, + "PrePaddingSeconds": { + "type": "integer", + "description": "Gets or sets the pre padding seconds.", + "format": "int32" + }, + "PostPaddingSeconds": { + "type": "integer", + "description": "Gets or sets the post padding seconds.", + "format": "int32" + }, + "IsPrePaddingRequired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is pre padding required." + }, + "ParentBackdropItemId": { + "type": "string", + "description": "Gets or sets the Id of the Parent that has a backdrop if the item does not have one.", + "nullable": true + }, + "ParentBackdropImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the parent backdrop image tags.", + "nullable": true + }, + "IsPostPaddingRequired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is post padding required." + }, + "KeepUntil": { + "enum": [ + "UntilDeleted", + "UntilSpaceNeeded", + "UntilWatched", + "UntilDate" + ], + "allOf": [ + { + "$ref": "#/components/schemas/KeepUntil" + } + ] + }, + "RecordAnyTime": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [record any time]." + }, + "SkipEpisodesInLibrary": { + "type": "boolean" + }, + "RecordAnyChannel": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [record any channel]." + }, + "KeepUpTo": { + "type": "integer", + "format": "int32" + }, + "RecordNewOnly": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [record new only]." + }, + "Days": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DayOfWeek" + }, + "description": "Gets or sets the days.", + "nullable": true + }, + "DayPattern": { + "enum": [ + "Daily", + "Weekdays", + "Weekends" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DayPattern" + } + ], + "description": "Gets or sets the day pattern.", + "nullable": true + }, + "ImageTags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Gets or sets the image tags.", + "nullable": true + }, + "ParentThumbItemId": { + "type": "string", + "description": "Gets or sets the parent thumb item id.", + "nullable": true + }, + "ParentThumbImageTag": { + "type": "string", + "description": "Gets or sets the parent thumb image tag.", + "nullable": true + }, + "ParentPrimaryImageItemId": { + "type": "string", + "description": "Gets or sets the parent primary image item identifier.", + "nullable": true + }, + "ParentPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the parent primary image tag.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class SeriesTimerInfoDto." + }, + "SeriesTimerInfoDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "ServerConfiguration": { + "type": "object", + "properties": { + "LogFileRetentionDays": { + "type": "integer", + "description": "Gets or sets the number of days we should retain log files.", + "format": "int32" + }, + "IsStartupWizardCompleted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is first run." + }, + "CachePath": { + "type": "string", + "description": "Gets or sets the cache path.", + "nullable": true + }, + "PreviousVersion": { + "type": "string", + "description": "Gets or sets the last known version that was ran using the configuration.", + "nullable": true + }, + "PreviousVersionStr": { + "type": "string", + "description": "Gets or sets the stringified PreviousVersion to be stored/loaded,\r\nbecause System.Version itself isn't xml-serializable.", + "nullable": true + }, + "EnableMetrics": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable prometheus metrics exporting." + }, + "EnableNormalizedItemByNameIds": { + "type": "boolean" + }, + "IsPortAuthorized": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is port authorized." + }, + "QuickConnectAvailable": { + "type": "boolean", + "description": "Gets or sets a value indicating whether quick connect is available for use on this server." + }, + "EnableCaseSensitiveItemIds": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [enable case sensitive item ids]." + }, + "DisableLiveTvChannelUserDataName": { + "type": "boolean" + }, + "MetadataPath": { + "type": "string", + "description": "Gets or sets the metadata path." + }, + "PreferredMetadataLanguage": { + "type": "string", + "description": "Gets or sets the preferred metadata language." + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code." + }, + "SortReplaceCharacters": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets characters to be replaced with a ' ' in strings to create a sort name." + }, + "SortRemoveCharacters": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets characters to be removed from strings to create a sort name." + }, + "SortRemoveWords": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets words to be removed from strings to create a sort name." + }, + "MinResumePct": { + "type": "integer", + "description": "Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated.", + "format": "int32" + }, + "MaxResumePct": { + "type": "integer", + "description": "Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched.", + "format": "int32" + }, + "MinResumeDurationSeconds": { + "type": "integer", + "description": "Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates..", + "format": "int32" + }, + "MinAudiobookResume": { + "type": "integer", + "description": "Gets or sets the minimum minutes of a book that must be played in order for playstate to be updated.", + "format": "int32" + }, + "MaxAudiobookResume": { + "type": "integer", + "description": "Gets or sets the remaining minutes of a book that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched.", + "format": "int32" + }, + "InactiveSessionThreshold": { + "type": "integer", + "description": "Gets or sets the threshold in minutes after a inactive session gets closed automatically.\r\nIf set to 0 the check for inactive sessions gets disabled.", + "format": "int32" + }, + "LibraryMonitorDelay": { + "type": "integer", + "description": "Gets or sets the delay in seconds that we will wait after a file system change to try and discover what has been added/removed\r\nSome delay is necessary with some items because their creation is not atomic. It involves the creation of several\r\ndifferent directories and files.", + "format": "int32" + }, + "LibraryUpdateDuration": { + "type": "integer", + "description": "Gets or sets the duration in seconds that we will wait after a library updated event before executing the library changed notification.", + "format": "int32" + }, + "ImageSavingConvention": { + "enum": [ + "Legacy", + "Compatible" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageSavingConvention" + } + ], + "description": "Gets or sets the image saving convention." + }, + "MetadataOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetadataOptions" + } + }, + "SkipDeserializationForBasicTypes": { + "type": "boolean" + }, + "ServerName": { + "type": "string" + }, + "UICulture": { + "type": "string" + }, + "SaveMetadataHidden": { + "type": "boolean" + }, + "ContentTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameValuePair" + } + }, + "RemoteClientBitrateLimit": { + "type": "integer", + "format": "int32" + }, + "EnableFolderView": { + "type": "boolean" + }, + "EnableGroupingIntoCollections": { + "type": "boolean" + }, + "DisplaySpecialsWithinSeasons": { + "type": "boolean" + }, + "CodecsUsed": { + "type": "array", + "items": { + "type": "string" + } + }, + "PluginRepositories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + }, + "EnableExternalContentInSuggestions": { + "type": "boolean" + }, + "ImageExtractionTimeoutMs": { + "type": "integer", + "format": "int32" + }, + "PathSubstitutions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PathSubstitution" + } + }, + "EnableSlowResponseWarning": { + "type": "boolean", + "description": "Gets or sets a value indicating whether slow server responses should be logged as a warning." + }, + "SlowResponseThresholdMs": { + "type": "integer", + "description": "Gets or sets the threshold for the slow response time warning in ms.", + "format": "int64" + }, + "CorsHosts": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the cors hosts." + }, + "ActivityLogRetentionDays": { + "type": "integer", + "description": "Gets or sets the number of days we should retain activity logs.", + "format": "int32", + "nullable": true + }, + "LibraryScanFanoutConcurrency": { + "type": "integer", + "description": "Gets or sets the how the library scan fans out.", + "format": "int32" + }, + "LibraryMetadataRefreshConcurrency": { + "type": "integer", + "description": "Gets or sets the how many metadata refreshes can run concurrently.", + "format": "int32" + }, + "RemoveOldPlugins": { + "type": "boolean", + "description": "Gets or sets a value indicating whether older plugins should automatically be deleted from the plugin folder." + }, + "AllowClientLogUpload": { + "type": "boolean", + "description": "Gets or sets a value indicating whether clients should be allowed to upload logs." + }, + "DummyChapterDuration": { + "type": "integer", + "description": "Gets or sets the dummy chapter duration in seconds, use 0 (zero) or less to disable generation alltogether.", + "format": "int32" + }, + "ChapterImageResolution": { + "enum": [ + "MatchSource", + "P144", + "P240", + "P360", + "P480", + "P720", + "P1080", + "P1440", + "P2160" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageResolution" + } + ], + "description": "Gets or sets the chapter image resolution." + }, + "ParallelImageEncodingLimit": { + "type": "integer", + "description": "Gets or sets the limit for parallel image encoding.", + "format": "int32" + }, + "CastReceiverApplications": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CastReceiverApplication" + }, + "description": "Gets or sets the list of cast receiver applications." + }, + "TrickplayOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/TrickplayOptions" + } + ], + "description": "Gets or sets the trickplay options." + } + }, + "additionalProperties": false, + "description": "Represents the server configuration." + }, + "ServerDiscoveryInfo": { + "type": "object", + "properties": { + "Address": { + "type": "string", + "description": "Gets the address." + }, + "Id": { + "type": "string", + "description": "Gets the server identifier." + }, + "Name": { + "type": "string", + "description": "Gets the name." + }, + "EndpointAddress": { + "type": "string", + "description": "Gets the endpoint address.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The server discovery info model." + }, + "ServerRestartingMessage": { + "type": "object", + "properties": { + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ServerRestarting", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Server restarting down message." + }, + "ServerShuttingDownMessage": { + "type": "object", + "properties": { + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ServerShuttingDown", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Server shutting down message." + }, + "SessionInfoDto": { + "type": "object", + "properties": { + "PlayState": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayerStateInfo" + } + ], + "description": "Gets or sets the play state.", + "nullable": true + }, + "AdditionalUsers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionUserInfo" + }, + "description": "Gets or sets the additional users.", + "nullable": true + }, + "Capabilities": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Gets or sets the client capabilities.", + "nullable": true + }, + "RemoteEndPoint": { + "type": "string", + "description": "Gets or sets the remote end point.", + "nullable": true + }, + "PlayableMediaTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + }, + "description": "Gets or sets the playable media types." + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid" + }, + "UserName": { + "type": "string", + "description": "Gets or sets the username.", + "nullable": true + }, + "Client": { + "type": "string", + "description": "Gets or sets the type of the client.", + "nullable": true + }, + "LastActivityDate": { + "type": "string", + "description": "Gets or sets the last activity date.", + "format": "date-time" + }, + "LastPlaybackCheckIn": { + "type": "string", + "description": "Gets or sets the last playback check in.", + "format": "date-time" + }, + "LastPausedDate": { + "type": "string", + "description": "Gets or sets the last paused date.", + "format": "date-time", + "nullable": true + }, + "DeviceName": { + "type": "string", + "description": "Gets or sets the name of the device.", + "nullable": true + }, + "DeviceType": { + "type": "string", + "description": "Gets or sets the type of the device.", + "nullable": true + }, + "NowPlayingItem": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the now playing item.", + "nullable": true + }, + "NowViewingItem": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the now viewing item.", + "nullable": true + }, + "DeviceId": { + "type": "string", + "description": "Gets or sets the device id.", + "nullable": true + }, + "ApplicationVersion": { + "type": "string", + "description": "Gets or sets the application version.", + "nullable": true + }, + "TranscodingInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/TranscodingInfo" + } + ], + "description": "Gets or sets the transcoding info.", + "nullable": true + }, + "IsActive": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this session is active." + }, + "SupportsMediaControl": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the session supports media control." + }, + "SupportsRemoteControl": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the session supports remote control." + }, + "NowPlayingQueue": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueItem" + }, + "description": "Gets or sets the now playing queue.", + "nullable": true + }, + "NowPlayingQueueFullItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + }, + "description": "Gets or sets the now playing queue full items.", + "nullable": true + }, + "HasCustomDeviceName": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the session has a custom device name." + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist item id.", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server id.", + "nullable": true + }, + "UserPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the user primary image tag.", + "nullable": true + }, + "SupportedCommands": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneralCommandType" + }, + "description": "Gets or sets the supported commands." + } + }, + "additionalProperties": false, + "description": "Session info DTO." + }, + "SessionMessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "type": "string", + "description": "The different kinds of messages that are used in the WebSocket api." + }, + "SessionsMessage": { + "type": "object", + "properties": { + "Data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionInfoDto" + }, + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "Sessions", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Sessions message." + }, + "SessionsStartMessage": { + "type": "object", + "properties": { + "Data": { + "type": "string", + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SessionsStart", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Sessions start message.\r\nData is the timing data encoded as \"$initialDelay,$interval\" in ms." + }, + "SessionsStopMessage": { + "type": "object", + "properties": { + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SessionsStop", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Sessions stop message." + }, + "SessionUserInfo": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "description": "Gets or sets the user identifier.", + "format": "uuid" + }, + "UserName": { + "type": "string", + "description": "Gets or sets the name of the user.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class SessionUserInfo." + }, + "SetChannelMappingDto": { + "required": [ + "ProviderChannelId", + "ProviderId", + "TunerChannelId" + ], + "type": "object", + "properties": { + "ProviderId": { + "type": "string", + "description": "Gets or sets the provider id." + }, + "TunerChannelId": { + "type": "string", + "description": "Gets or sets the tuner channel id." + }, + "ProviderChannelId": { + "type": "string", + "description": "Gets or sets the provider channel id." + } + }, + "additionalProperties": false, + "description": "Set channel mapping dto." + }, + "SetPlaylistItemRequestDto": { + "type": "object", + "properties": { + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist identifier of the playing item.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class SetPlaylistItemRequestDto." + }, + "SetRepeatModeRequestDto": { + "type": "object", + "properties": { + "Mode": { + "enum": [ + "RepeatOne", + "RepeatAll", + "RepeatNone" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupRepeatMode" + } + ], + "description": "Enum GroupRepeatMode." + } + }, + "additionalProperties": false, + "description": "Class SetRepeatModeRequestDto." + }, + "SetShuffleModeRequestDto": { + "type": "object", + "properties": { + "Mode": { + "enum": [ + "Sorted", + "Shuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupShuffleMode" + } + ], + "description": "Enum GroupShuffleMode." + } + }, + "additionalProperties": false, + "description": "Class SetShuffleModeRequestDto." + }, + "SongInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "AlbumArtists": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Album": { + "type": "string", + "nullable": true + }, + "Artists": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "SortOrder": { + "enum": [ + "Ascending", + "Descending" + ], + "type": "string", + "description": "An enum representing the sorting order." + }, + "SpecialViewOptionDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets view option name.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets view option id.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Special view option dto." + }, + "StartupConfigurationDto": { + "type": "object", + "properties": { + "UICulture": { + "type": "string", + "description": "Gets or sets UI language culture.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "PreferredMetadataLanguage": { + "type": "string", + "description": "Gets or sets the preferred language for the metadata.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The startup configuration DTO." + }, + "StartupRemoteAccessDto": { + "required": [ + "EnableAutomaticPortMapping", + "EnableRemoteAccess" + ], + "type": "object", + "properties": { + "EnableRemoteAccess": { + "type": "boolean", + "description": "Gets or sets a value indicating whether enable remote access." + }, + "EnableAutomaticPortMapping": { + "type": "boolean", + "description": "Gets or sets a value indicating whether enable automatic port mapping." + } + }, + "additionalProperties": false, + "description": "Startup remote access dto." + }, + "StartupUserDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the username.", + "nullable": true + }, + "Password": { + "type": "string", + "description": "Gets or sets the user's password.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The startup user DTO." + }, + "StringGroupUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "CreateGroupDenied", + "JoinGroupDenied", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Gets the update type." + }, + "Data": { + "type": "string", + "description": "Gets the update data." + } + }, + "additionalProperties": false, + "description": "Class GroupUpdate." + }, + "SubtitleDeliveryMethod": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "type": "string", + "description": "Delivery method to use during playback of a specific subtitle format." + }, + "SubtitleOptions": { + "type": "object", + "properties": { + "SkipIfEmbeddedSubtitlesPresent": { + "type": "boolean" + }, + "SkipIfAudioTrackMatches": { + "type": "boolean" + }, + "DownloadLanguages": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DownloadMovieSubtitles": { + "type": "boolean" + }, + "DownloadEpisodeSubtitles": { + "type": "boolean" + }, + "OpenSubtitlesUsername": { + "type": "string", + "nullable": true + }, + "OpenSubtitlesPasswordHash": { + "type": "string", + "nullable": true + }, + "IsOpenSubtitleVipAccount": { + "type": "boolean" + }, + "RequirePerfectMatch": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "SubtitlePlaybackMode": { + "enum": [ + "Default", + "Always", + "OnlyForced", + "None", + "Smart" + ], + "type": "string", + "description": "An enum representing a subtitle playback mode." + }, + "SubtitleProfile": { + "type": "object", + "properties": { + "Format": { + "type": "string", + "description": "Gets or sets the format.", + "nullable": true + }, + "Method": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ], + "description": "Gets or sets the delivery method." + }, + "DidlMode": { + "type": "string", + "description": "Gets or sets the DIDL mode.", + "nullable": true + }, + "Language": { + "type": "string", + "description": "Gets or sets the language.", + "nullable": true + }, + "Container": { + "type": "string", + "description": "Gets or sets the container.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "A class for subtitle profile information." + }, + "SyncPlayCommandMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/SendCommand" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SyncPlayCommand", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Sync play command." + }, + "SyncPlayGroupUpdateCommandMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdate" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SyncPlayGroupUpdate", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Untyped sync play command." + }, + "SyncPlayQueueItem": { + "type": "object", + "properties": { + "ItemId": { + "type": "string", + "description": "Gets the item identifier.", + "format": "uuid" + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets the playlist identifier of the item.", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Class QueueItem." + }, + "SyncPlayUserAccessType": { + "enum": [ + "CreateAndJoinGroups", + "JoinGroups", + "None" + ], + "type": "string", + "description": "Enum SyncPlayUserAccessType." + }, + "SystemInfo": { + "type": "object", + "properties": { + "LocalAddress": { + "type": "string", + "description": "Gets or sets the local address.", + "nullable": true + }, + "ServerName": { + "type": "string", + "description": "Gets or sets the name of the server.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the server version.", + "nullable": true + }, + "ProductName": { + "type": "string", + "description": "Gets or sets the product name. This is the AssemblyProduct name.", + "nullable": true + }, + "OperatingSystem": { + "type": "string", + "description": "Gets or sets the operating system.", + "nullable": true, + "deprecated": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "StartupWizardCompleted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the startup wizard is completed.", + "nullable": true + }, + "OperatingSystemDisplayName": { + "type": "string", + "description": "Gets or sets the display name of the operating system.", + "nullable": true, + "deprecated": true + }, + "PackageName": { + "type": "string", + "description": "Gets or sets the package name.", + "nullable": true + }, + "HasPendingRestart": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has pending restart." + }, + "IsShuttingDown": { + "type": "boolean" + }, + "SupportsLibraryMonitor": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports library monitor]." + }, + "WebSocketPortNumber": { + "type": "integer", + "description": "Gets or sets the web socket port number.", + "format": "int32" + }, + "CompletedInstallations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InstallationInfo" + }, + "description": "Gets or sets the completed installations.", + "nullable": true + }, + "CanSelfRestart": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can self restart.", + "default": true, + "deprecated": true + }, + "CanLaunchWebBrowser": { + "type": "boolean", + "default": false, + "deprecated": true + }, + "ProgramDataPath": { + "type": "string", + "description": "Gets or sets the program data path.", + "nullable": true + }, + "WebPath": { + "type": "string", + "description": "Gets or sets the web UI resources path.", + "nullable": true + }, + "ItemsByNamePath": { + "type": "string", + "description": "Gets or sets the items by name path.", + "nullable": true + }, + "CachePath": { + "type": "string", + "description": "Gets or sets the cache path.", + "nullable": true + }, + "LogPath": { + "type": "string", + "description": "Gets or sets the log path.", + "nullable": true + }, + "InternalMetadataPath": { + "type": "string", + "description": "Gets or sets the internal metadata path.", + "nullable": true + }, + "TranscodingTempPath": { + "type": "string", + "description": "Gets or sets the transcode path.", + "nullable": true + }, + "CastReceiverApplications": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CastReceiverApplication" + }, + "description": "Gets or sets the list of cast receiver applications.", + "nullable": true + }, + "HasUpdateAvailable": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has update available.", + "default": false, + "deprecated": true + }, + "EncoderLocation": { + "type": "string", + "default": "System", + "nullable": true, + "deprecated": true + }, + "SystemArchitecture": { + "type": "string", + "default": "X64", + "nullable": true, + "deprecated": true + } + }, + "additionalProperties": false, + "description": "Class SystemInfo." + }, + "TaskCompletionStatus": { + "enum": [ + "Completed", + "Failed", + "Cancelled", + "Aborted" + ], + "type": "string", + "description": "Enum TaskCompletionStatus." + }, + "TaskInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "State": { + "enum": [ + "Idle", + "Cancelling", + "Running" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TaskState" + } + ], + "description": "Gets or sets the state of the task." + }, + "CurrentProgressPercentage": { + "type": "number", + "description": "Gets or sets the progress.", + "format": "double", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "LastExecutionResult": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskResult" + } + ], + "description": "Gets or sets the last execution result.", + "nullable": true + }, + "Triggers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskTriggerInfo" + }, + "description": "Gets or sets the triggers.", + "nullable": true + }, + "Description": { + "type": "string", + "description": "Gets or sets the description.", + "nullable": true + }, + "Category": { + "type": "string", + "description": "Gets or sets the category.", + "nullable": true + }, + "IsHidden": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is hidden." + }, + "Key": { + "type": "string", + "description": "Gets or sets the key.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class TaskInfo." + }, + "TaskResult": { + "type": "object", + "properties": { + "StartTimeUtc": { + "type": "string", + "description": "Gets or sets the start time UTC.", + "format": "date-time" + }, + "EndTimeUtc": { + "type": "string", + "description": "Gets or sets the end time UTC.", + "format": "date-time" + }, + "Status": { + "enum": [ + "Completed", + "Failed", + "Cancelled", + "Aborted" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TaskCompletionStatus" + } + ], + "description": "Gets or sets the status." + }, + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Key": { + "type": "string", + "description": "Gets or sets the key.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "ErrorMessage": { + "type": "string", + "description": "Gets or sets the error message.", + "nullable": true + }, + "LongErrorMessage": { + "type": "string", + "description": "Gets or sets the long error message.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class TaskExecutionInfo." + }, + "TaskState": { + "enum": [ + "Idle", + "Cancelling", + "Running" + ], + "type": "string", + "description": "Enum TaskState." + }, + "TaskTriggerInfo": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "description": "Gets or sets the type.", + "nullable": true + }, + "TimeOfDayTicks": { + "type": "integer", + "description": "Gets or sets the time of day.", + "format": "int64", + "nullable": true + }, + "IntervalTicks": { + "type": "integer", + "description": "Gets or sets the interval.", + "format": "int64", + "nullable": true + }, + "DayOfWeek": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DayOfWeek" + } + ], + "description": "Gets or sets the day of week.", + "nullable": true + }, + "MaxRuntimeTicks": { + "type": "integer", + "description": "Gets or sets the maximum runtime ticks.", + "format": "int64", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class TaskTriggerInfo." + }, + "ThemeMediaResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + }, + "OwnerId": { + "type": "string", + "description": "Gets or sets the owner id.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class ThemeMediaResult." + }, + "TimerCancelledMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerEventInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "TimerCancelled", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Timer cancelled message." + }, + "TimerCreatedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerEventInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "TimerCreated", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Timer created message." + }, + "TimerEventInfo": { + "type": "object", + "properties": { + "Id": { + "type": "string" + }, + "ProgramId": { + "type": "string", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "TimerInfoDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the Id of the recording.", + "nullable": true + }, + "Type": { + "type": "string", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server identifier.", + "nullable": true + }, + "ExternalId": { + "type": "string", + "description": "Gets or sets the external identifier.", + "nullable": true + }, + "ChannelId": { + "type": "string", + "description": "Gets or sets the channel id of the recording.", + "format": "uuid" + }, + "ExternalChannelId": { + "type": "string", + "description": "Gets or sets the external channel identifier.", + "nullable": true + }, + "ChannelName": { + "type": "string", + "description": "Gets or sets the channel name of the recording.", + "nullable": true + }, + "ChannelPrimaryImageTag": { + "type": "string", + "nullable": true + }, + "ProgramId": { + "type": "string", + "description": "Gets or sets the program identifier.", + "nullable": true + }, + "ExternalProgramId": { + "type": "string", + "description": "Gets or sets the external program identifier.", + "nullable": true + }, + "Name": { + "type": "string", + "description": "Gets or sets the name of the recording.", + "nullable": true + }, + "Overview": { + "type": "string", + "description": "Gets or sets the description of the recording.", + "nullable": true + }, + "StartDate": { + "type": "string", + "description": "Gets or sets the start date of the recording, in UTC.", + "format": "date-time" + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date of the recording, in UTC.", + "format": "date-time" + }, + "ServiceName": { + "type": "string", + "description": "Gets or sets the name of the service.", + "nullable": true + }, + "Priority": { + "type": "integer", + "description": "Gets or sets the priority.", + "format": "int32" + }, + "PrePaddingSeconds": { + "type": "integer", + "description": "Gets or sets the pre padding seconds.", + "format": "int32" + }, + "PostPaddingSeconds": { + "type": "integer", + "description": "Gets or sets the post padding seconds.", + "format": "int32" + }, + "IsPrePaddingRequired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is pre padding required." + }, + "ParentBackdropItemId": { + "type": "string", + "description": "Gets or sets the Id of the Parent that has a backdrop if the item does not have one.", + "nullable": true + }, + "ParentBackdropImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the parent backdrop image tags.", + "nullable": true + }, + "IsPostPaddingRequired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is post padding required." + }, + "KeepUntil": { + "enum": [ + "UntilDeleted", + "UntilSpaceNeeded", + "UntilWatched", + "UntilDate" + ], + "allOf": [ + { + "$ref": "#/components/schemas/KeepUntil" + } + ] + }, + "Status": { + "enum": [ + "New", + "InProgress", + "Completed", + "Cancelled", + "ConflictedOk", + "ConflictedNotOk", + "Error" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RecordingStatus" + } + ], + "description": "Gets or sets the status." + }, + "SeriesTimerId": { + "type": "string", + "description": "Gets or sets the series timer identifier.", + "nullable": true + }, + "ExternalSeriesTimerId": { + "type": "string", + "description": "Gets or sets the external series timer identifier.", + "nullable": true + }, + "RunTimeTicks": { + "type": "integer", + "description": "Gets or sets the run time ticks.", + "format": "int64", + "nullable": true + }, + "ProgramInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the program information.", + "nullable": true + } + }, + "additionalProperties": false + }, + "TimerInfoDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TimerInfoDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "TonemappingAlgorithm": { + "enum": [ + "none", + "clip", + "linear", + "gamma", + "reinhard", + "hable", + "mobius", + "bt2390" + ], + "type": "string", + "description": "Enum containing tonemapping algorithms." + }, + "TonemappingMode": { + "enum": [ + "auto", + "max", + "rgb", + "lum", + "itp" + ], + "type": "string", + "description": "Enum containing tonemapping modes." + }, + "TonemappingRange": { + "enum": [ + "auto", + "tv", + "pc" + ], + "type": "string", + "description": "Enum containing tonemapping ranges." + }, + "TrailerInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "TrailerInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/TrailerInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "TranscodeReason": { + "enum": [ + "ContainerNotSupported", + "VideoCodecNotSupported", + "AudioCodecNotSupported", + "SubtitleCodecNotSupported", + "AudioIsExternal", + "SecondaryAudioNotSupported", + "VideoProfileNotSupported", + "VideoLevelNotSupported", + "VideoResolutionNotSupported", + "VideoBitDepthNotSupported", + "VideoFramerateNotSupported", + "RefFramesNotSupported", + "AnamorphicVideoNotSupported", + "InterlacedVideoNotSupported", + "AudioChannelsNotSupported", + "AudioProfileNotSupported", + "AudioSampleRateNotSupported", + "AudioBitDepthNotSupported", + "ContainerBitrateExceedsLimit", + "VideoBitrateNotSupported", + "AudioBitrateNotSupported", + "UnknownVideoStreamInfo", + "UnknownAudioStreamInfo", + "DirectPlayError", + "VideoRangeTypeNotSupported", + "VideoCodecTagNotSupported" + ], + "type": "string" + }, + "TranscodeSeekInfo": { + "enum": [ + "Auto", + "Bytes" + ], + "type": "string" + }, + "TranscodingInfo": { + "type": "object", + "properties": { + "AudioCodec": { + "type": "string", + "description": "Gets or sets the thread count used for encoding.", + "nullable": true + }, + "VideoCodec": { + "type": "string", + "description": "Gets or sets the thread count used for encoding.", + "nullable": true + }, + "Container": { + "type": "string", + "description": "Gets or sets the thread count used for encoding.", + "nullable": true + }, + "IsVideoDirect": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the video is passed through." + }, + "IsAudioDirect": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the audio is passed through." + }, + "Bitrate": { + "type": "integer", + "description": "Gets or sets the bitrate.", + "format": "int32", + "nullable": true + }, + "Framerate": { + "type": "number", + "description": "Gets or sets the framerate.", + "format": "float", + "nullable": true + }, + "CompletionPercentage": { + "type": "number", + "description": "Gets or sets the completion percentage.", + "format": "double", + "nullable": true + }, + "Width": { + "type": "integer", + "description": "Gets or sets the video width.", + "format": "int32", + "nullable": true + }, + "Height": { + "type": "integer", + "description": "Gets or sets the video height.", + "format": "int32", + "nullable": true + }, + "AudioChannels": { + "type": "integer", + "description": "Gets or sets the audio channels.", + "format": "int32", + "nullable": true + }, + "HardwareAccelerationType": { + "enum": [ + "none", + "amf", + "qsv", + "nvenc", + "v4l2m2m", + "vaapi", + "videotoolbox", + "rkmpp" + ], + "allOf": [ + { + "$ref": "#/components/schemas/HardwareAccelerationType" + } + ], + "description": "Gets or sets the hardware acceleration type.", + "nullable": true + }, + "TranscodeReasons": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TranscodeReason" + }, + "description": "Gets or sets the transcode reasons." + } + }, + "additionalProperties": false, + "description": "Class holding information on a runnning transcode." + }, + "TranscodingProfile": { + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "Gets or sets the container." + }, + "Type": { + "enum": [ + "Audio", + "Video", + "Photo", + "Subtitle", + "Lyric" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DlnaProfileType" + } + ], + "description": "Gets or sets the DLNA profile type." + }, + "VideoCodec": { + "type": "string", + "description": "Gets or sets the video codec." + }, + "AudioCodec": { + "type": "string", + "description": "Gets or sets the audio codec." + }, + "Protocol": { + "enum": [ + "http", + "hls" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaStreamProtocol" + } + ], + "description": "Gets or sets the protocol." + }, + "EstimateContentLength": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the content length should be estimated.", + "default": false + }, + "EnableMpegtsM2TsMode": { + "type": "boolean", + "description": "Gets or sets a value indicating whether M2TS mode is enabled.", + "default": false + }, + "TranscodeSeekInfo": { + "enum": [ + "Auto", + "Bytes" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TranscodeSeekInfo" + } + ], + "description": "Gets or sets the transcoding seek info mode.", + "default": "Auto" + }, + "CopyTimestamps": { + "type": "boolean", + "description": "Gets or sets a value indicating whether timestamps should be copied.", + "default": false + }, + "Context": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ], + "description": "Gets or sets the encoding context.", + "default": "Streaming" + }, + "EnableSubtitlesInManifest": { + "type": "boolean", + "description": "Gets or sets a value indicating whether subtitles are allowed in the manifest.", + "default": false + }, + "MaxAudioChannels": { + "type": "string", + "description": "Gets or sets the maximum audio channels.", + "nullable": true + }, + "MinSegments": { + "type": "integer", + "description": "Gets or sets the minimum amount of segments.", + "format": "int32", + "default": 0 + }, + "SegmentLength": { + "type": "integer", + "description": "Gets or sets the segment length.", + "format": "int32", + "default": 0 + }, + "BreakOnNonKeyFrames": { + "type": "boolean", + "description": "Gets or sets a value indicating whether breaking the video stream on non-keyframes is supported.", + "default": false + }, + "Conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + }, + "description": "Gets or sets the profile conditions." + }, + "EnableAudioVbrEncoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether variable bitrate encoding is supported.", + "default": true + } + }, + "additionalProperties": false, + "description": "A class for transcoding profile information.\r\nNote for client developers: Conditions defined in MediaBrowser.Model.Dlna.CodecProfile has higher priority and can override values defined here." + }, + "TransportStreamTimestamp": { + "enum": [ + "None", + "Zero", + "Valid" + ], + "type": "string" + }, + "TrickplayInfo": { + "type": "object", + "properties": { + "Width": { + "type": "integer", + "description": "Gets or sets width of an individual thumbnail.", + "format": "int32" + }, + "Height": { + "type": "integer", + "description": "Gets or sets height of an individual thumbnail.", + "format": "int32" + }, + "TileWidth": { + "type": "integer", + "description": "Gets or sets amount of thumbnails per row.", + "format": "int32" + }, + "TileHeight": { + "type": "integer", + "description": "Gets or sets amount of thumbnails per column.", + "format": "int32" + }, + "ThumbnailCount": { + "type": "integer", + "description": "Gets or sets total amount of non-black thumbnails.", + "format": "int32" + }, + "Interval": { + "type": "integer", + "description": "Gets or sets interval in milliseconds between each trickplay thumbnail.", + "format": "int32" + }, + "Bandwidth": { + "type": "integer", + "description": "Gets or sets peak bandwith usage in bits per second.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "An entity representing the metadata for a group of trickplay tiles." + }, + "TrickplayOptions": { + "type": "object", + "properties": { + "EnableHwAcceleration": { + "type": "boolean", + "description": "Gets or sets a value indicating whether or not to use HW acceleration." + }, + "EnableHwEncoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether or not to use HW accelerated MJPEG encoding." + }, + "EnableKeyFrameOnlyExtraction": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to only extract key frames.\r\nSignificantly faster, but is not compatible with all decoders and/or video files." + }, + "ScanBehavior": { + "enum": [ + "Blocking", + "NonBlocking" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TrickplayScanBehavior" + } + ], + "description": "Gets or sets the behavior used by trickplay provider on library scan/update." + }, + "ProcessPriority": { + "enum": [ + "Normal", + "Idle", + "High", + "RealTime", + "BelowNormal", + "AboveNormal" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ProcessPriorityClass" + } + ], + "description": "Gets or sets the process priority for the ffmpeg process." + }, + "Interval": { + "type": "integer", + "description": "Gets or sets the interval, in ms, between each new trickplay image.", + "format": "int32" + }, + "WidthResolutions": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "Gets or sets the target width resolutions, in px, to generates preview images for." + }, + "TileWidth": { + "type": "integer", + "description": "Gets or sets number of tile images to allow in X dimension.", + "format": "int32" + }, + "TileHeight": { + "type": "integer", + "description": "Gets or sets number of tile images to allow in Y dimension.", + "format": "int32" + }, + "Qscale": { + "type": "integer", + "description": "Gets or sets the ffmpeg output quality level.", + "format": "int32" + }, + "JpegQuality": { + "type": "integer", + "description": "Gets or sets the jpeg quality to use for image tiles.", + "format": "int32" + }, + "ProcessThreads": { + "type": "integer", + "description": "Gets or sets the number of threads to be used by ffmpeg.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Class TrickplayOptions." + }, + "TrickplayScanBehavior": { + "enum": [ + "Blocking", + "NonBlocking" + ], + "type": "string", + "description": "Enum TrickplayScanBehavior." + }, + "TunerChannelMapping": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "ProviderChannelName": { + "type": "string", + "nullable": true + }, + "ProviderChannelId": { + "type": "string", + "nullable": true + }, + "Id": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "TunerHostInfo": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": true + }, + "Url": { + "type": "string", + "nullable": true + }, + "Type": { + "type": "string", + "nullable": true + }, + "DeviceId": { + "type": "string", + "nullable": true + }, + "FriendlyName": { + "type": "string", + "nullable": true + }, + "ImportFavoritesOnly": { + "type": "boolean" + }, + "AllowHWTranscoding": { + "type": "boolean" + }, + "AllowFmp4TranscodingContainer": { + "type": "boolean" + }, + "AllowStreamSharing": { + "type": "boolean" + }, + "FallbackMaxStreamingBitrate": { + "type": "integer", + "format": "int32" + }, + "EnableStreamLooping": { + "type": "boolean" + }, + "Source": { + "type": "string", + "nullable": true + }, + "TunerCount": { + "type": "integer", + "format": "int32" + }, + "UserAgent": { + "type": "string", + "nullable": true + }, + "IgnoreDts": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "TypeOptions": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": true + }, + "MetadataFetchers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "MetadataFetcherOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ImageFetchers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ImageFetcherOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ImageOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageOption" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "UnratedItem": { + "enum": [ + "Movie", + "Trailer", + "Series", + "Music", + "Book", + "LiveTvChannel", + "LiveTvProgram", + "ChannelContent", + "Other" + ], + "type": "string", + "description": "An enum representing an unrated item." + }, + "UpdateLibraryOptionsDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the library item id.", + "format": "uuid" + }, + "LibraryOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/LibraryOptions" + } + ], + "description": "Gets or sets library options.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Update library options dto." + }, + "UpdateMediaPathRequestDto": { + "required": [ + "Name", + "PathInfo" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the library name." + }, + "PathInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathInfo" + } + ], + "description": "Gets or sets library folder path information." + } + }, + "additionalProperties": false, + "description": "Update library options dto." + }, + "UpdatePlaylistDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name of the new playlist.", + "nullable": true + }, + "Ids": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets item ids of the playlist.", + "nullable": true + }, + "Users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + }, + "description": "Gets or sets the playlist users.", + "nullable": true + }, + "IsPublic": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the playlist is public.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Update existing playlist dto. Fields set to `null` will not be updated and keep their current values." + }, + "UpdatePlaylistUserDto": { + "type": "object", + "properties": { + "CanEdit": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the user can edit the playlist.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values." + }, + "UpdateUserItemDataDto": { + "type": "object", + "properties": { + "Rating": { + "type": "number", + "description": "Gets or sets the rating.", + "format": "double", + "nullable": true + }, + "PlayedPercentage": { + "type": "number", + "description": "Gets or sets the played percentage.", + "format": "double", + "nullable": true + }, + "UnplayedItemCount": { + "type": "integer", + "description": "Gets or sets the unplayed item count.", + "format": "int32", + "nullable": true + }, + "PlaybackPositionTicks": { + "type": "integer", + "description": "Gets or sets the playback position ticks.", + "format": "int64", + "nullable": true + }, + "PlayCount": { + "type": "integer", + "description": "Gets or sets the play count.", + "format": "int32", + "nullable": true + }, + "IsFavorite": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is favorite.", + "nullable": true + }, + "Likes": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UpdateUserItemDataDto is likes.", + "nullable": true + }, + "LastPlayedDate": { + "type": "string", + "description": "Gets or sets the last played date.", + "format": "date-time", + "nullable": true + }, + "Played": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played.", + "nullable": true + }, + "Key": { + "type": "string", + "description": "Gets or sets the key.", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This is used by the api to get information about a item user data." + }, + "UpdateUserPassword": { + "type": "object", + "properties": { + "CurrentPassword": { + "type": "string", + "description": "Gets or sets the current sha1-hashed password.", + "nullable": true + }, + "CurrentPw": { + "type": "string", + "description": "Gets or sets the current plain text password.", + "nullable": true + }, + "NewPw": { + "type": "string", + "description": "Gets or sets the new plain text password.", + "nullable": true + }, + "ResetPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to reset the password." + } + }, + "additionalProperties": false, + "description": "The update user password request body." + }, + "UploadSubtitleDto": { + "required": [ + "Data", + "Format", + "IsForced", + "IsHearingImpaired", + "Language" + ], + "type": "object", + "properties": { + "Language": { + "type": "string", + "description": "Gets or sets the subtitle language." + }, + "Format": { + "type": "string", + "description": "Gets or sets the subtitle format." + }, + "IsForced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the subtitle is forced." + }, + "IsHearingImpaired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the subtitle is for hearing impaired." + }, + "Data": { + "type": "string", + "description": "Gets or sets the subtitle data." + } + }, + "additionalProperties": false, + "description": "Upload subtitles dto." + }, + "UserConfiguration": { + "type": "object", + "properties": { + "AudioLanguagePreference": { + "type": "string", + "description": "Gets or sets the audio language preference.", + "nullable": true + }, + "PlayDefaultAudioTrack": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [play default audio track]." + }, + "SubtitleLanguagePreference": { + "type": "string", + "description": "Gets or sets the subtitle language preference.", + "nullable": true + }, + "DisplayMissingEpisodes": { + "type": "boolean" + }, + "GroupedFolders": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "SubtitleMode": { + "enum": [ + "Default", + "Always", + "OnlyForced", + "None", + "Smart" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitlePlaybackMode" + } + ], + "description": "An enum representing a subtitle playback mode." + }, + "DisplayCollectionsView": { + "type": "boolean" + }, + "EnableLocalPassword": { + "type": "boolean" + }, + "OrderedViews": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "LatestItemsExcludes": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "MyMediaExcludes": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "HidePlayedInLatest": { + "type": "boolean" + }, + "RememberAudioSelections": { + "type": "boolean" + }, + "RememberSubtitleSelections": { + "type": "boolean" + }, + "EnableNextEpisodeAutoPlay": { + "type": "boolean" + }, + "CastReceiverId": { + "type": "string", + "description": "Gets or sets the id of the selected cast receiver.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class UserConfiguration." + }, + "UserDataChangedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDataChangeInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "UserDataChanged", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "User data changed message." + }, + "UserDataChangeInfo": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid" + }, + "UserDataList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserItemDataDto" + }, + "description": "Gets or sets the user data list." + } + }, + "additionalProperties": false, + "description": "Class UserDataChangeInfo." + }, + "UserDeletedMessage": { + "type": "object", + "properties": { + "Data": { + "type": "string", + "description": "Gets or sets the data.", + "format": "uuid" + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "UserDeleted", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "User deleted message." + }, + "UserDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server identifier.", + "nullable": true + }, + "ServerName": { + "type": "string", + "description": "Gets or sets the name of the server.\r\nThis is not used by the server and is for client-side usage only.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "format": "uuid" + }, + "PrimaryImageTag": { + "type": "string", + "description": "Gets or sets the primary image tag.", + "nullable": true + }, + "HasPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has password." + }, + "HasConfiguredPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has configured password." + }, + "HasConfiguredEasyPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has configured easy password.", + "deprecated": true + }, + "EnableAutoLogin": { + "type": "boolean", + "description": "Gets or sets whether async login is enabled or not.", + "nullable": true + }, + "LastLoginDate": { + "type": "string", + "description": "Gets or sets the last login date.", + "format": "date-time", + "nullable": true + }, + "LastActivityDate": { + "type": "string", + "description": "Gets or sets the last activity date.", + "format": "date-time", + "nullable": true + }, + "Configuration": { + "allOf": [ + { + "$ref": "#/components/schemas/UserConfiguration" + } + ], + "description": "Gets or sets the configuration.", + "nullable": true + }, + "Policy": { + "allOf": [ + { + "$ref": "#/components/schemas/UserPolicy" + } + ], + "description": "Gets or sets the policy.", + "nullable": true + }, + "PrimaryImageAspectRatio": { + "type": "number", + "description": "Gets or sets the primary image aspect ratio.", + "format": "double", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class UserDto." + }, + "UserItemDataDto": { + "type": "object", + "properties": { + "Rating": { + "type": "number", + "description": "Gets or sets the rating.", + "format": "double", + "nullable": true + }, + "PlayedPercentage": { + "type": "number", + "description": "Gets or sets the played percentage.", + "format": "double", + "nullable": true + }, + "UnplayedItemCount": { + "type": "integer", + "description": "Gets or sets the unplayed item count.", + "format": "int32", + "nullable": true + }, + "PlaybackPositionTicks": { + "type": "integer", + "description": "Gets or sets the playback position ticks.", + "format": "int64" + }, + "PlayCount": { + "type": "integer", + "description": "Gets or sets the play count.", + "format": "int32" + }, + "IsFavorite": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is favorite." + }, + "Likes": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is likes.", + "nullable": true + }, + "LastPlayedDate": { + "type": "string", + "description": "Gets or sets the last played date.", + "format": "date-time", + "nullable": true + }, + "Played": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played." + }, + "Key": { + "type": "string", + "description": "Gets or sets the key." + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class UserItemDataDto." + }, + "UserPolicy": { + "required": [ + "AuthenticationProviderId", + "PasswordResetProviderId" + ], + "type": "object", + "properties": { + "IsAdministrator": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is administrator." + }, + "IsHidden": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is hidden." + }, + "EnableCollectionManagement": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can manage collections.", + "default": false + }, + "EnableSubtitleManagement": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can manage subtitles.", + "default": false + }, + "EnableLyricManagement": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this user can manage lyrics.", + "default": false + }, + "IsDisabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is disabled." + }, + "MaxParentalRating": { + "type": "integer", + "description": "Gets or sets the max parental rating.", + "format": "int32", + "nullable": true + }, + "BlockedTags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "AllowedTags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "EnableUserPreferenceAccess": { + "type": "boolean" + }, + "AccessSchedules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccessSchedule" + }, + "nullable": true + }, + "BlockUnratedItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UnratedItem" + }, + "nullable": true + }, + "EnableRemoteControlOfOtherUsers": { + "type": "boolean" + }, + "EnableSharedDeviceControl": { + "type": "boolean" + }, + "EnableRemoteAccess": { + "type": "boolean" + }, + "EnableLiveTvManagement": { + "type": "boolean" + }, + "EnableLiveTvAccess": { + "type": "boolean" + }, + "EnableMediaPlayback": { + "type": "boolean" + }, + "EnableAudioPlaybackTranscoding": { + "type": "boolean" + }, + "EnableVideoPlaybackTranscoding": { + "type": "boolean" + }, + "EnablePlaybackRemuxing": { + "type": "boolean" + }, + "ForceRemoteSourceTranscoding": { + "type": "boolean" + }, + "EnableContentDeletion": { + "type": "boolean" + }, + "EnableContentDeletionFromFolders": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "EnableContentDownloading": { + "type": "boolean" + }, + "EnableSyncTranscoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [enable synchronize]." + }, + "EnableMediaConversion": { + "type": "boolean" + }, + "EnabledDevices": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "EnableAllDevices": { + "type": "boolean" + }, + "EnabledChannels": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "EnableAllChannels": { + "type": "boolean" + }, + "EnabledFolders": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "EnableAllFolders": { + "type": "boolean" + }, + "InvalidLoginAttemptCount": { + "type": "integer", + "format": "int32" + }, + "LoginAttemptsBeforeLockout": { + "type": "integer", + "format": "int32" + }, + "MaxActiveSessions": { + "type": "integer", + "format": "int32" + }, + "EnablePublicSharing": { + "type": "boolean" + }, + "BlockedMediaFolders": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "BlockedChannels": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "RemoteClientBitrateLimit": { + "type": "integer", + "format": "int32" + }, + "AuthenticationProviderId": { + "type": "string" + }, + "PasswordResetProviderId": { + "type": "string" + }, + "SyncPlayAccess": { + "enum": [ + "CreateAndJoinGroups", + "JoinGroups", + "None" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SyncPlayUserAccessType" + } + ], + "description": "Gets or sets a value indicating what SyncPlay features the user can access." + } + }, + "additionalProperties": false + }, + "UserUpdatedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "UserUpdated", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "User updated message." + }, + "UtcTimeResponse": { + "type": "object", + "properties": { + "RequestReceptionTime": { + "type": "string", + "description": "Gets the UTC time when request has been received.", + "format": "date-time" + }, + "ResponseTransmissionTime": { + "type": "string", + "description": "Gets the UTC time when response has been sent.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Class UtcTimeResponse." + }, + "ValidatePathDto": { + "type": "object", + "properties": { + "ValidateWritable": { + "type": "boolean", + "description": "Gets or sets a value indicating whether validate if path is writable." + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "IsFile": { + "type": "boolean", + "description": "Gets or sets is path file.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Validate path object." + }, + "VersionInfo": { + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Gets or sets the version." + }, + "VersionNumber": { + "type": "string", + "description": "Gets the version as a System.Version.", + "readOnly": true + }, + "changelog": { + "type": "string", + "description": "Gets or sets the changelog for this version.", + "nullable": true + }, + "targetAbi": { + "type": "string", + "description": "Gets or sets the ABI that this version was built against.", + "nullable": true + }, + "sourceUrl": { + "type": "string", + "description": "Gets or sets the source URL.", + "nullable": true + }, + "checksum": { + "type": "string", + "description": "Gets or sets a checksum for the binary.", + "nullable": true + }, + "timestamp": { + "type": "string", + "description": "Gets or sets a timestamp of when the binary was built.", + "nullable": true + }, + "repositoryName": { + "type": "string", + "description": "Gets or sets the repository name." + }, + "repositoryUrl": { + "type": "string", + "description": "Gets or sets the repository url." + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Updates.VersionInfo class." + }, + "Video3DFormat": { + "enum": [ + "HalfSideBySide", + "FullSideBySide", + "FullTopAndBottom", + "HalfTopAndBottom", + "MVC" + ], + "type": "string" + }, + "VideoRange": { + "enum": [ + "Unknown", + "SDR", + "HDR" + ], + "type": "string", + "description": "An enum representing video ranges." + }, + "VideoRangeType": { + "enum": [ + "Unknown", + "SDR", + "HDR10", + "HLG", + "DOVI", + "DOVIWithHDR10", + "DOVIWithHLG", + "DOVIWithSDR", + "HDR10Plus" + ], + "type": "string", + "description": "An enum representing types of video ranges." + }, + "VideoType": { + "enum": [ + "VideoFile", + "Iso", + "Dvd", + "BluRay" + ], + "type": "string", + "description": "Enum VideoType." + }, + "VirtualFolderInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Locations": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the locations.", + "nullable": true + }, + "CollectionType": { + "enum": [ + "movies", + "tvshows", + "music", + "musicvideos", + "homevideos", + "boxsets", + "books", + "mixed" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CollectionTypeOptions" + } + ], + "description": "Gets or sets the type of the collection.", + "nullable": true + }, + "LibraryOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/LibraryOptions" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "nullable": true + }, + "PrimaryImageItemId": { + "type": "string", + "description": "Gets or sets the primary image item identifier.", + "nullable": true + }, + "RefreshProgress": { + "type": "number", + "format": "double", + "nullable": true + }, + "RefreshStatus": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to hold information about a user's list of configured virtual folders." + }, + "WakeOnLanInfo": { + "type": "object", + "properties": { + "MacAddress": { + "type": "string", + "description": "Gets the MAC address of the device.", + "nullable": true + }, + "Port": { + "type": "integer", + "description": "Gets or sets the wake-on-LAN port.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Provides the MAC address and port for wake-on-LAN functionality." + }, + "WebSocketMessage": { + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/InboundWebSocketMessage" + }, + { + "$ref": "#/components/schemas/OutboundWebSocketMessage" + } + ], + "description": "Represents the possible websocket types" + }, + "XbmcMetadataOptions": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "nullable": true + }, + "ReleaseDateFormat": { + "type": "string" + }, + "SaveImagePathsInNfo": { + "type": "boolean" + }, + "EnablePathSubstitution": { + "type": "boolean" + }, + "EnableExtraThumbsDuplication": { + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + "securitySchemes": { + "CustomAuthentication": { + "type": "apiKey", + "description": "API key header parameter", + "name": "Authorization", + "in": "header" + } + } + } +} \ No newline at end of file diff --git a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/json/jellyfin-openapi-10.11.0.json b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/json/jellyfin-openapi-10.11.0.json new file mode 100644 index 0000000000000..2e52dd47baa44 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/json/jellyfin-openapi-10.11.0.json @@ -0,0 +1,66652 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Jellyfin API", + "version": "10.11.0", + "x-jellyfin-version": "10.11.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/System/ActivityLog/Entries": { + "get": { + "tags": [ + "ActivityLog" + ], + "summary": "Gets activity log entries.", + "operationId": "GetLogEntries", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minDate", + "in": "query", + "description": "Optional. The minimum date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasUserId", + "in": "query", + "description": "Optional. Filter log entries if it has user id, or not.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Activity log returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActivityLogEntryQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ActivityLogEntryQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ActivityLogEntryQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Auth/Keys": { + "get": { + "tags": [ + "ApiKey" + ], + "summary": "Get all keys.", + "operationId": "GetKeys", + "responses": { + "200": { + "description": "Api keys retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationInfoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationInfoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationInfoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "ApiKey" + ], + "summary": "Create a new api key.", + "operationId": "CreateKey", + "parameters": [ + { + "name": "app", + "in": "query", + "description": "Name of the app using the authentication key.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Api key created." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Auth/Keys/{key}": { + "delete": { + "tags": [ + "ApiKey" + ], + "summary": "Remove an api key.", + "operationId": "RevokeKey", + "parameters": [ + { + "name": "key", + "in": "path", + "description": "The access token to delete.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Api key deleted." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Artists": { + "get": { + "tags": [ + "Artists" + ], + "summary": "Gets all artists from a given item, folder, or the entire library.", + "operationId": "GetArtists", + "parameters": [ + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Artists returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/{name}": { + "get": { + "tags": [ + "Artists" + ], + "summary": "Gets an artist by name.", + "operationId": "GetArtistByName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Artist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/AlbumArtists": { + "get": { + "tags": [ + "Artists" + ], + "summary": "Gets all album artists from a given item, folder, or the entire library.", + "operationId": "GetAlbumArtists", + "parameters": [ + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Album artists returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/stream": { + "get": { + "tags": [ + "Audio" + ], + "summary": "Gets an audio stream.", + "operationId": "GetAudioStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The audio container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Audio" + ], + "summary": "Gets an audio stream.", + "operationId": "HeadAudioStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The audio container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Audio/{itemId}/stream.{container}": { + "get": { + "tags": [ + "Audio" + ], + "summary": "Gets an audio stream.", + "operationId": "GetAudioStreamByContainer", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "path", + "description": "The audio container.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Audio" + ], + "summary": "Gets an audio stream.", + "operationId": "HeadAudioStreamByContainer", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "path", + "description": "The audio container.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Backup": { + "get": { + "tags": [ + "Backup" + ], + "summary": "Gets a list of all currently present backups in the backup directory.", + "operationId": "ListBackups", + "responses": { + "200": { + "description": "Backups available.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BackupManifestDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BackupManifestDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BackupManifestDto" + } + } + } + } + }, + "403": { + "description": "User does not have permission to retrieve information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Backup/Create": { + "post": { + "tags": [ + "Backup" + ], + "summary": "Creates a new Backup.", + "operationId": "CreateBackup", + "requestBody": { + "description": "The backup options.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BackupOptionsDto" + } + ], + "description": "Defines the optional contents of the backup archive." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BackupOptionsDto" + } + ], + "description": "Defines the optional contents of the backup archive." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BackupOptionsDto" + } + ], + "description": "Defines the optional contents of the backup archive." + } + } + } + }, + "responses": { + "200": { + "description": "Backup created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BackupManifestDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BackupManifestDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BackupManifestDto" + } + } + } + }, + "403": { + "description": "User does not have permission to retrieve information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Backup/Manifest": { + "get": { + "tags": [ + "Backup" + ], + "summary": "Gets the descriptor from an existing archive is present.", + "operationId": "GetBackup", + "parameters": [ + { + "name": "path", + "in": "query", + "description": "The data to start a restore process.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Backup archive manifest.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BackupManifestDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BackupManifestDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BackupManifestDto" + } + } + } + }, + "204": { + "description": "Not a valid jellyfin Archive." + }, + "404": { + "description": "Not a valid path.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User does not have permission to retrieve information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Backup/Restore": { + "post": { + "tags": [ + "Backup" + ], + "summary": "Restores to a backup by restarting the server and applying the backup.", + "operationId": "StartRestoreBackup", + "requestBody": { + "description": "The data to start a restore process.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BackupRestoreRequestDto" + } + ], + "description": "Defines properties used to start a restore process." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BackupRestoreRequestDto" + } + ], + "description": "Defines properties used to start a restore process." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BackupRestoreRequestDto" + } + ], + "description": "Defines properties used to start a restore process." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Backup restore started." + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User does not have permission to retrieve information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Branding/Configuration": { + "get": { + "tags": [ + "Branding" + ], + "summary": "Gets branding configuration.", + "operationId": "GetBrandingOptions", + "responses": { + "200": { + "description": "Branding configuration returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BrandingOptionsDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BrandingOptionsDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BrandingOptionsDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Branding/Css": { + "get": { + "tags": [ + "Branding" + ], + "summary": "Gets branding css.", + "operationId": "GetBrandingCss", + "responses": { + "200": { + "description": "Branding css returned.", + "content": { + "text/css": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + }, + "204": { + "description": "No branding css configured." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Branding/Css.css": { + "get": { + "tags": [ + "Branding" + ], + "summary": "Gets branding css.", + "operationId": "GetBrandingCss_2", + "responses": { + "200": { + "description": "Branding css returned.", + "content": { + "text/css": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + }, + "204": { + "description": "No branding css configured." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Channels": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Gets available channels.", + "operationId": "GetChannels", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User Id to filter by. Use System.Guid.Empty to not filter by user.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "supportsLatestItems", + "in": "query", + "description": "Optional. Filter by channels that support getting latest items.", + "schema": { + "type": "boolean" + } + }, + { + "name": "supportsMediaDeletion", + "in": "query", + "description": "Optional. Filter by channels that support media deletion.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional. Filter by channels that are favorite.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Channels returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Channels/{channelId}/Features": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Get channel features.", + "operationId": "GetChannelFeatures", + "parameters": [ + { + "name": "channelId", + "in": "path", + "description": "Channel id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Channel features returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChannelFeatures" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ChannelFeatures" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ChannelFeatures" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Channels/{channelId}/Items": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Get channel items.", + "operationId": "GetChannelItems", + "parameters": [ + { + "name": "channelId", + "in": "path", + "description": "Channel Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "folderId", + "in": "query", + "description": "Optional. Folder Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Channel items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Channels/Features": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Get all channel features.", + "operationId": "GetAllChannelFeatures", + "responses": { + "200": { + "description": "All channel features returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelFeatures" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelFeatures" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelFeatures" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Channels/Items/Latest": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Gets latest channel items.", + "operationId": "GetLatestChannelItems", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "channelIds", + "in": "query", + "description": "Optional. Specify one or more channel id's, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "200": { + "description": "Latest channel items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/ClientLog/Document": { + "post": { + "tags": [ + "ClientLog" + ], + "summary": "Upload a document.", + "operationId": "LogFile", + "requestBody": { + "content": { + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "200": { + "description": "Document saved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientLogDocumentResponseDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ClientLogDocumentResponseDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ClientLogDocumentResponseDto" + } + } + } + }, + "403": { + "description": "Event logging disabled.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "413": { + "description": "Upload size too large.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Collections": { + "post": { + "tags": [ + "Collection" + ], + "summary": "Creates a new collection.", + "operationId": "CreateCollection", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the collection.", + "schema": { + "type": "string" + } + }, + { + "name": "ids", + "in": "query", + "description": "Item Ids to add to the collection.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Create the collection within a specific folder.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isLocked", + "in": "query", + "description": "Whether or not to lock the new collection.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Collection created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionCreationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/CollectionCreationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/CollectionCreationResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "CollectionManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Collections/{collectionId}/Items": { + "post": { + "tags": [ + "Collection" + ], + "summary": "Adds items to a collection.", + "operationId": "AddToCollection", + "parameters": [ + { + "name": "collectionId", + "in": "path", + "description": "The collection id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ids", + "in": "query", + "description": "Item ids, comma delimited.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "204": { + "description": "Items added to collection." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "CollectionManagement", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Collection" + ], + "summary": "Removes items from a collection.", + "operationId": "RemoveFromCollection", + "parameters": [ + { + "name": "collectionId", + "in": "path", + "description": "The collection id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ids", + "in": "query", + "description": "Item ids, comma delimited.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "204": { + "description": "Items removed from collection." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "CollectionManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Configuration": { + "get": { + "tags": [ + "Configuration" + ], + "summary": "Gets application configuration.", + "operationId": "GetConfiguration", + "responses": { + "200": { + "description": "Application configuration returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServerConfiguration" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ServerConfiguration" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ServerConfiguration" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Configuration" + ], + "summary": "Updates application configuration.", + "operationId": "UpdateConfiguration", + "requestBody": { + "description": "Configuration.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServerConfiguration" + } + ], + "description": "Represents the server configuration." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServerConfiguration" + } + ], + "description": "Represents the server configuration." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServerConfiguration" + } + ], + "description": "Represents the server configuration." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Configuration updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Configuration/{key}": { + "get": { + "tags": [ + "Configuration" + ], + "summary": "Gets a named configuration.", + "operationId": "GetNamedConfiguration", + "parameters": [ + { + "name": "key", + "in": "path", + "description": "Configuration key.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Configuration returned.", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Configuration" + ], + "summary": "Updates named configuration.", + "operationId": "UpdateNamedConfiguration", + "parameters": [ + { + "name": "key", + "in": "path", + "description": "Configuration key.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Configuration.", + "content": { + "application/json": { + "schema": { } + }, + "text/json": { + "schema": { } + }, + "application/*+json": { + "schema": { } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Named configuration updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Configuration/Branding": { + "post": { + "tags": [ + "Configuration" + ], + "summary": "Updates branding configuration.", + "operationId": "UpdateBrandingConfiguration", + "requestBody": { + "description": "Branding configuration.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BrandingOptionsDto" + } + ], + "description": "The branding options DTO for API use.\r\nThis DTO excludes SplashscreenLocation to prevent it from being updated via API." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BrandingOptionsDto" + } + ], + "description": "The branding options DTO for API use.\r\nThis DTO excludes SplashscreenLocation to prevent it from being updated via API." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BrandingOptionsDto" + } + ], + "description": "The branding options DTO for API use.\r\nThis DTO excludes SplashscreenLocation to prevent it from being updated via API." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Branding configuration updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Configuration/MetadataOptions/Default": { + "get": { + "tags": [ + "Configuration" + ], + "summary": "Gets a default MetadataOptions object.", + "operationId": "GetDefaultMetadataOptions", + "responses": { + "200": { + "description": "Metadata options returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataOptions" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/MetadataOptions" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/MetadataOptions" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/web/ConfigurationPage": { + "get": { + "tags": [ + "Dashboard" + ], + "summary": "Gets a dashboard configuration page.", + "operationId": "GetDashboardConfigurationPage", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the page.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "ConfigurationPage returned.", + "content": { + "text/html": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/x-javascript": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Plugin configuration page not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/web/ConfigurationPages": { + "get": { + "tags": [ + "Dashboard" + ], + "summary": "Gets the configuration pages.", + "operationId": "GetConfigurationPages", + "parameters": [ + { + "name": "enableInMainMenu", + "in": "query", + "description": "Whether to enable in the main menu.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "ConfigurationPages returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigurationPageInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigurationPageInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigurationPageInfo" + } + } + } + } + }, + "404": { + "description": "Server still loading.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Devices": { + "get": { + "tags": [ + "Devices" + ], + "summary": "Get Devices.", + "operationId": "GetDevices", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Gets or sets the user identifier.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Devices retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "Devices" + ], + "summary": "Deletes a device.", + "operationId": "DeleteDevice", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Device Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Device deleted." + }, + "404": { + "description": "Device not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Devices/Info": { + "get": { + "tags": [ + "Devices" + ], + "summary": "Get info for a device.", + "operationId": "GetDeviceInfo", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Device Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Device info retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDto" + } + } + } + }, + "404": { + "description": "Device not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Devices/Options": { + "get": { + "tags": [ + "Devices" + ], + "summary": "Get options for a device.", + "operationId": "GetDeviceOptions", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Device Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Device options retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + } + } + }, + "404": { + "description": "Device not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Devices" + ], + "summary": "Update device options.", + "operationId": "UpdateDeviceOptions", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Device Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Device Options.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + ], + "description": "A dto representing custom options for a device." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + ], + "description": "A dto representing custom options for a device." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + ], + "description": "A dto representing custom options for a device." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Device options updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/DisplayPreferences/{displayPreferencesId}": { + "get": { + "tags": [ + "DisplayPreferences" + ], + "summary": "Get Display Preferences.", + "operationId": "GetDisplayPreferences", + "parameters": [ + { + "name": "displayPreferencesId", + "in": "path", + "description": "Display preferences id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "client", + "in": "query", + "description": "Client.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Display preferences retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "DisplayPreferences" + ], + "summary": "Update Display Preferences.", + "operationId": "UpdateDisplayPreferences", + "parameters": [ + { + "name": "displayPreferencesId", + "in": "path", + "description": "Display preferences id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "client", + "in": "query", + "description": "Client.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "New Display Preferences object.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + ], + "description": "Defines the display preferences for any item that supports them (usually Folders)." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + ], + "description": "Defines the display preferences for any item that supports them (usually Folders)." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + ], + "description": "Defines the display preferences for any item that supports them (usually Folders)." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Display preferences updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/hls1/{playlistId}/{segmentId}.{container}": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video stream using HTTP live streaming.", + "operationId": "GetHlsAudioSegment", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "container", + "in": "path", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "runtimeTicks", + "in": "query", + "description": "The position of the requested segment in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "actualSegmentLengthTicks", + "in": "query", + "description": "The length of the requested segment in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/main.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets an audio stream using HTTP live streaming.", + "operationId": "GetVariantHlsAudioPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/master.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets an audio hls playlist stream.", + "operationId": "GetMasterHlsAudioPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAdaptiveBitrateStreaming", + "in": "query", + "description": "Enable adaptive bitrate streaming.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "head": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets an audio hls playlist stream.", + "operationId": "HeadMasterHlsAudioPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAdaptiveBitrateStreaming", + "in": "query", + "description": "Enable adaptive bitrate streaming.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/hls1/{playlistId}/{segmentId}.{container}": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video stream using HTTP live streaming.", + "operationId": "GetHlsVideoSegment", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "container", + "in": "path", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "runtimeTicks", + "in": "query", + "description": "The position of the requested segment in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "actualSegmentLengthTicks", + "in": "query", + "description": "The length of the requested segment in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The desired segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Whether to always burn in subtitles when transcoding.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/live.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a hls live stream.", + "operationId": "GetLiveHlsStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The audio container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The max width.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The max height.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableSubtitlesInManifest", + "in": "query", + "description": "Optional. Whether to enable subtitles in the manifest.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Whether to always burn in subtitles when transcoding.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Hls live stream retrieved.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/main.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video stream using HTTP live streaming.", + "operationId": "GetVariantHlsVideoPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Whether to always burn in subtitles when transcoding.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/master.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video hls playlist stream.", + "operationId": "GetMasterHlsVideoPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAdaptiveBitrateStreaming", + "in": "query", + "description": "Enable adaptive bitrate streaming.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableTrickplay", + "in": "query", + "description": "Enable trickplay image playlists being added to master playlist.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Whether to always burn in subtitles when transcoding.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "head": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video hls playlist stream.", + "operationId": "HeadMasterHlsVideoPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAdaptiveBitrateStreaming", + "in": "query", + "description": "Enable adaptive bitrate streaming.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableTrickplay", + "in": "query", + "description": "Enable trickplay image playlists being added to master playlist.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Whether to always burn in subtitles when transcoding.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/DefaultDirectoryBrowser": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Get Default directory browser.", + "operationId": "GetDefaultDirectoryBrowser", + "responses": { + "200": { + "description": "Default directory browser returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultDirectoryBrowserInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DefaultDirectoryBrowserInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DefaultDirectoryBrowserInfoDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/DirectoryContents": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Gets the contents of a given directory in the file system.", + "operationId": "GetDirectoryContents", + "parameters": [ + { + "name": "path", + "in": "query", + "description": "The path.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "includeFiles", + "in": "query", + "description": "An optional filter to include or exclude files from the results. true/false.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "includeDirectories", + "in": "query", + "description": "An optional filter to include or exclude folders from the results. true/false.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Directory contents returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/Drives": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Gets available drives from the server's file system.", + "operationId": "GetDrives", + "responses": { + "200": { + "description": "List of entries returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/NetworkShares": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Gets network paths.", + "operationId": "GetNetworkShares", + "responses": { + "200": { + "description": "Empty array returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/ParentPath": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Gets the parent path of a given path.", + "operationId": "GetParentPath", + "parameters": [ + { + "name": "path", + "in": "query", + "description": "The path.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/ValidatePath": { + "post": { + "tags": [ + "Environment" + ], + "summary": "Validates path.", + "operationId": "ValidatePath", + "requestBody": { + "description": "Validate request object.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatePathDto" + } + ], + "description": "Validate path object." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatePathDto" + } + ], + "description": "Validate path object." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatePathDto" + } + ], + "description": "Validate path object." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Path validated." + }, + "404": { + "description": "Path not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Filters": { + "get": { + "tags": [ + "Filter" + ], + "summary": "Gets legacy query filters.", + "operationId": "GetQueryFiltersLegacy", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Parent id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional. Filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + } + ], + "responses": { + "200": { + "description": "Legacy filters retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueryFiltersLegacy" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/QueryFiltersLegacy" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/QueryFiltersLegacy" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Filters2": { + "get": { + "tags": [ + "Filter" + ], + "summary": "Gets query filters.", + "operationId": "GetQueryFilters", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isAiring", + "in": "query", + "description": "Optional. Is item airing.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Is item movie.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Is item sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Is item kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Is item news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Is item series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "recursive", + "in": "query", + "description": "Optional. Search recursive.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Filters retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueryFilters" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/QueryFilters" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/QueryFilters" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Genres": { + "get": { + "tags": [ + "Genres" + ], + "summary": "Gets all genres from a given item, folder, or the entire library.", + "operationId": "GetGenres", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Include total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Genres returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Genres/{genreName}": { + "get": { + "tags": [ + "Genres" + ], + "summary": "Gets a genre, by name.", + "operationId": "GetGenre", + "parameters": [ + { + "name": "genreName", + "in": "path", + "description": "The genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Genres returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/hls/{segmentId}/stream.aac": { + "get": { + "tags": [ + "HlsSegment" + ], + "summary": "Gets the specified audio segment for an audio item.", + "operationId": "GetHlsAudioSegmentLegacyAac", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Hls audio segment returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Audio/{itemId}/hls/{segmentId}/stream.mp3": { + "get": { + "tags": [ + "HlsSegment" + ], + "summary": "Gets the specified audio segment for an audio item.", + "operationId": "GetHlsAudioSegmentLegacyMp3", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Hls audio segment returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Videos/{itemId}/hls/{playlistId}/{segmentId}.{segmentContainer}": { + "get": { + "tags": [ + "HlsSegment" + ], + "summary": "Gets a hls video segment.", + "operationId": "GetHlsVideoSegmentLegacy", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "path", + "description": "The segment container.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Hls video segment returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Hls segment not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Videos/{itemId}/hls/{playlistId}/stream.m3u8": { + "get": { + "tags": [ + "HlsSegment" + ], + "summary": "Gets a hls video playlist.", + "operationId": "GetHlsPlaylistLegacy", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The video id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Hls video playlist returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/ActiveEncodings": { + "delete": { + "tags": [ + "HlsSegment" + ], + "summary": "Stops an active encoding.", + "operationId": "StopEncodingProcess", + "parameters": [ + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Encoding stopped successfully." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get artist image by name.", + "operationId": "GetArtistImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Artist name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get artist image by name.", + "operationId": "HeadArtistImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Artist name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Branding/Splashscreen": { + "get": { + "tags": [ + "Image" + ], + "summary": "Generates or gets the splashscreen.", + "operationId": "GetSplashscreen", + "parameters": [ + { + "name": "tag", + "in": "query", + "description": "Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "quality", + "in": "query", + "description": "Quality setting, from 0-100.", + "schema": { + "maximum": 100, + "minimum": 0, + "type": "integer", + "format": "int32", + "default": 90 + } + } + ], + "responses": { + "200": { + "description": "Splashscreen returned successfully.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "post": { + "tags": [ + "Image" + ], + "summary": "Uploads a custom splashscreen.\r\nThe body is expected to the image contents base64 encoded.", + "operationId": "UploadCustomSplashscreen", + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Successfully uploaded new splashscreen." + }, + "400": { + "description": "Error reading MimeType from uploaded image.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User does not have permission to upload splashscreen..", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete a custom splashscreen.", + "operationId": "DeleteCustomSplashscreen", + "responses": { + "204": { + "description": "Successfully deleted the custom splashscreen." + }, + "403": { + "description": "User does not have permission to delete splashscreen.." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Genres/{name}/Images/{imageType}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get genre image by name.", + "operationId": "GetGenreImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get genre image by name.", + "operationId": "HeadGenreImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Genres/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get genre image by name.", + "operationId": "GetGenreImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get genre image by name.", + "operationId": "HeadGenreImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Items/{itemId}/Images": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get item image infos.", + "operationId": "GetItemImageInfos", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item images returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageInfo" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Images/{imageType}": { + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete an item's image.", + "operationId": "DeleteItemImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "The image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Image deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Image" + ], + "summary": "Set item image.", + "operationId": "SetItemImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + } + ], + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Image saved." + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "get": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "GetItemImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "HeadItemImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Items/{itemId}/Images/{imageType}/{imageIndex}": { + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete an item's image.", + "operationId": "DeleteItemImageByIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "The image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Image deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Image" + ], + "summary": "Set item image.", + "operationId": "SetItemImageByIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "(Unused) Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Image saved." + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "get": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "GetItemImageByIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "HeadItemImageByIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "GetItemImage2", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "maxWidth", + "in": "path", + "description": "The maximum image width to return.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "path", + "description": "The maximum image height to return.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "path", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "path", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "required": true, + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ], + "description": "Enum ImageOutputFormat." + } + }, + { + "name": "percentPlayed", + "in": "path", + "description": "Optional. Percent to render for the percent played overlay.", + "required": true, + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "path", + "description": "Optional. Unplayed count overlay to render.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "HeadItemImage2", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "maxWidth", + "in": "path", + "description": "The maximum image width to return.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "path", + "description": "The maximum image height to return.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "path", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "path", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "required": true, + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ], + "description": "Enum ImageOutputFormat." + } + }, + { + "name": "percentPlayed", + "in": "path", + "description": "Optional. Percent to render for the percent played overlay.", + "required": true, + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "path", + "description": "Optional. Unplayed count overlay to render.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Items/{itemId}/Images/{imageType}/{imageIndex}/Index": { + "post": { + "tags": [ + "Image" + ], + "summary": "Updates the index for an item image.", + "operationId": "UpdateItemImageIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Old image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "newIndex", + "in": "query", + "description": "New image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Image index updated." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/MusicGenres/{name}/Images/{imageType}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get music genre image by name.", + "operationId": "GetMusicGenreImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Music genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get music genre image by name.", + "operationId": "HeadMusicGenreImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Music genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/MusicGenres/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get music genre image by name.", + "operationId": "GetMusicGenreImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Music genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get music genre image by name.", + "operationId": "HeadMusicGenreImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Music genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Persons/{name}/Images/{imageType}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get person image by name.", + "operationId": "GetPersonImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get person image by name.", + "operationId": "HeadPersonImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Persons/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get person image by name.", + "operationId": "GetPersonImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get person image by name.", + "operationId": "HeadPersonImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Studios/{name}/Images/{imageType}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get studio image by name.", + "operationId": "GetStudioImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get studio image by name.", + "operationId": "HeadStudioImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Studios/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get studio image by name.", + "operationId": "GetStudioImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get studio image by name.", + "operationId": "HeadStudioImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/UserImage": { + "post": { + "tags": [ + "Image" + ], + "summary": "Sets the user image.", + "operationId": "PostUserImage", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Image updated." + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User does not have permission to delete the image.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete the user's image.", + "operationId": "DeleteUserImage", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Image deleted." + }, + "403": { + "description": "User does not have permission to delete the image.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "get": { + "tags": [ + "Image" + ], + "summary": "Get user profile image.", + "operationId": "GetUserImage", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "400": { + "description": "User id not provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get user profile image.", + "operationId": "HeadUserImage", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "400": { + "description": "User id not provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Albums/{itemId}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given album.", + "operationId": "GetInstantMixFromAlbum", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/{itemId}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given artist.", + "operationId": "GetInstantMixFromArtists", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given artist.", + "operationId": "GetInstantMixFromArtists2", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given item.", + "operationId": "GetInstantMixFromItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MusicGenres/{name}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given genre.", + "operationId": "GetInstantMixFromMusicGenreByName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MusicGenres/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given genre.", + "operationId": "GetInstantMixFromMusicGenreById", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{itemId}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given playlist.", + "operationId": "GetInstantMixFromPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Songs/{itemId}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given song.", + "operationId": "GetInstantMixFromSong", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ExternalIdInfos": { + "get": { + "tags": [ + "ItemLookup" + ], + "summary": "Get the item's external id info.", + "operationId": "GetExternalIdInfos", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "External id info retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalIdInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalIdInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalIdInfo" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Apply/{itemId}": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Applies search criteria to an item and refreshes metadata.", + "operationId": "ApplySearchCriteria", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "replaceAllImages", + "in": "query", + "description": "Optional. Whether or not to replace all images. Default: True.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "requestBody": { + "description": "The remote search result.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoteSearchResult" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoteSearchResult" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoteSearchResult" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Item metadata refreshed." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Book": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get book remote search.", + "operationId": "GetBookRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BookInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BookInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BookInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Book remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/BoxSet": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get box set remote search.", + "operationId": "GetBoxSetRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BoxSetInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BoxSetInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BoxSetInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Box set remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Movie": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get movie remote search.", + "operationId": "GetMovieRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovieInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovieInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovieInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Movie remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/MusicAlbum": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get music album remote search.", + "operationId": "GetMusicAlbumRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AlbumInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AlbumInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AlbumInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Music album remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/MusicArtist": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get music artist remote search.", + "operationId": "GetMusicArtistRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ArtistInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ArtistInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ArtistInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Music artist remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/MusicVideo": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get music video remote search.", + "operationId": "GetMusicVideoRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MusicVideoInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MusicVideoInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MusicVideoInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Music video remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Person": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get person remote search.", + "operationId": "GetPersonRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PersonLookupInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PersonLookupInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PersonLookupInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Person remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Series": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get series remote search.", + "operationId": "GetSeriesRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Series remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Trailer": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get trailer remote search.", + "operationId": "GetTrailerRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TrailerInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TrailerInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TrailerInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Trailer remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Refresh": { + "post": { + "tags": [ + "ItemRefresh" + ], + "summary": "Refreshes metadata for an item.", + "operationId": "RefreshItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "metadataRefreshMode", + "in": "query", + "description": "(Optional) Specifies the metadata refresh mode.", + "schema": { + "enum": [ + "None", + "ValidationOnly", + "Default", + "FullRefresh" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MetadataRefreshMode" + } + ], + "default": "None" + } + }, + { + "name": "imageRefreshMode", + "in": "query", + "description": "(Optional) Specifies the image refresh mode.", + "schema": { + "enum": [ + "None", + "ValidationOnly", + "Default", + "FullRefresh" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MetadataRefreshMode" + } + ], + "default": "None" + } + }, + { + "name": "replaceAllMetadata", + "in": "query", + "description": "(Optional) Determines if metadata should be replaced. Only applicable if mode is FullRefresh.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "replaceAllImages", + "in": "query", + "description": "(Optional) Determines if images should be replaced. Only applicable if mode is FullRefresh.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "regenerateTrickplay", + "in": "query", + "description": "(Optional) Determines if trickplay images should be replaced. Only applicable if mode is FullRefresh.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Item metadata refresh queued." + }, + "404": { + "description": "Item to refresh not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Items": { + "get": { + "tags": [ + "Items" + ], + "summary": "Gets items based on a query.", + "operationId": "GetItems", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id supplied as query parameter; this is required when not using an API key.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "maxOfficialRating", + "in": "query", + "description": "Optional filter by maximum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "hasThemeSong", + "in": "query", + "description": "Optional filter by items with theme songs.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasThemeVideo", + "in": "query", + "description": "Optional filter by items with theme videos.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSubtitles", + "in": "query", + "description": "Optional filter by items with subtitles.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSpecialFeature", + "in": "query", + "description": "Optional filter by items with special features.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTrailer", + "in": "query", + "description": "Optional filter by items with trailers.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "indexNumber", + "in": "query", + "description": "Optional filter by index number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "parentIndexNumber", + "in": "query", + "description": "Optional filter by parent index number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "hasParentalRating", + "in": "query", + "description": "Optional filter by items that have or do not have a parental rating.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isHd", + "in": "query", + "description": "Optional filter by items that are HD or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "is4K", + "in": "query", + "description": "Optional filter by items that are 4K or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "locationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "excludeLocationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isUnaired", + "in": "query", + "description": "Optional filter by items that are unaired episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minCriticRating", + "in": "query", + "description": "Optional filter by minimum critic rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minPremiereDate", + "in": "query", + "description": "Optional. The minimum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSaved", + "in": "query", + "description": "Optional. The minimum last saved date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSavedForUser", + "in": "query", + "description": "Optional. The minimum last saved date for the current user. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "maxPremiereDate", + "in": "query", + "description": "Optional. The maximum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasOverview", + "in": "query", + "description": "Optional filter by items that have an overview or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasImdbId", + "in": "query", + "description": "Optional filter by items that have an IMDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTmdbId", + "in": "query", + "description": "Optional filter by items that have a TMDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTvdbId", + "in": "query", + "description": "Optional filter by items that have a TVDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional filter for live tv movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional filter for live tv series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional filter for live tv news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional filter for live tv kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional filter for live tv sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "excludeItemIds", + "in": "query", + "description": "Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "recursive", + "in": "query", + "description": "When searching within folders, this determines whether or not the search will be recursive. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Filter based on a search term.", + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending, Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "imageTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "isPlayed", + "in": "query", + "description": "Optional filter by items that are played, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "artists", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "artistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albumArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified album artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "contributingArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified contributing artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albums", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "albumIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "ids", + "in": "query", + "description": "Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "videoTypes", + "in": "query", + "description": "Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VideoType" + } + } + }, + { + "name": "minOfficialRating", + "in": "query", + "description": "Optional filter by minimum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "isLocked", + "in": "query", + "description": "Optional filter by items that are locked.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isPlaceHolder", + "in": "query", + "description": "Optional filter by items that are placeholders.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasOfficialRating", + "in": "query", + "description": "Optional filter by items that have official ratings.", + "schema": { + "type": "boolean" + } + }, + { + "name": "collapseBoxSetItems", + "in": "query", + "description": "Whether or not to hide items behind their boxsets.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minWidth", + "in": "query", + "description": "Optional. Filter by the minimum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minHeight", + "in": "query", + "description": "Optional. Filter by the minimum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. Filter by the maximum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. Filter by the maximum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "is3D", + "in": "query", + "description": "Optional filter by items that are 3D, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesStatus", + "in": "query", + "description": "Optional filter by Series Status. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SeriesStatus" + } + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Enable the total record count.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Library" + ], + "summary": "Deletes items from the library and filesystem.", + "operationId": "DeleteItems", + "parameters": [ + { + "name": "ids", + "in": "query", + "description": "The item ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "204": { + "description": "Items deleted." + }, + "401": { + "description": "Unauthorized access.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserItems/{itemId}/UserData": { + "get": { + "tags": [ + "Items" + ], + "summary": "Get Item User Data.", + "operationId": "GetItemUserData", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "return item user data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "404": { + "description": "Item is not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Items" + ], + "summary": "Update Item User Data.", + "operationId": "UpdateItemUserData", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "New user data object.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserItemDataDto" + } + ], + "description": "This is used by the api to get information about a item user data." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserItemDataDto" + } + ], + "description": "This is used by the api to get information about a item user data." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserItemDataDto" + } + ], + "description": "This is used by the api to get information about a item user data." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "return updated user item data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "404": { + "description": "Item is not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserItems/Resume": { + "get": { + "tags": [ + "Items" + ], + "summary": "Gets items based on a query.", + "operationId": "GetResumeItems", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "The start index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "The item limit.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional. Filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Enable the total record count.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "excludeActiveSessions", + "in": "query", + "description": "Optional. Whether to exclude the currently active sessions.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}": { + "post": { + "tags": [ + "ItemUpdate" + ], + "summary": "Updates an item.", + "operationId": "UpdateItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The new item properties.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Item updated." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "Library" + ], + "summary": "Deletes an item from the library and filesystem.", + "operationId": "DeleteItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Item deleted." + }, + "401": { + "description": "Unauthorized access.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets an item from a user's library.", + "operationId": "GetItem", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ContentType": { + "post": { + "tags": [ + "ItemUpdate" + ], + "summary": "Updates an item's content type.", + "operationId": "UpdateItemContentType", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "contentType", + "in": "query", + "description": "The content type of the item.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Item content type updated." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Items/{itemId}/MetadataEditor": { + "get": { + "tags": [ + "ItemUpdate" + ], + "summary": "Gets metadata editor info for an item.", + "operationId": "GetMetadataEditorInfo", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item metadata editor returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataEditorInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/MetadataEditorInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/MetadataEditorInfo" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Albums/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarAlbums", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarArtists", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Ancestors": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets all parents of an item.", + "operationId": "GetAncestors", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item parents returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/CriticReviews": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets critic review for an item.", + "operationId": "GetCriticReviews", + "parameters": [ + { + "name": "itemId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Critic reviews returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Download": { + "get": { + "tags": [ + "Library" + ], + "summary": "Downloads item media.", + "operationId": "GetDownload", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Media downloaded.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "Download", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/File": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get the original file of an item.", + "operationId": "GetFile", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "File stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarItems", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ThemeMedia": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get theme songs and videos for an item.", + "operationId": "GetThemeMedia", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "inheritFromParent", + "in": "query", + "description": "Optional. Determines whether or not parent items should be searched for theme media.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort Order - Ascending, Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + } + ], + "responses": { + "200": { + "description": "Theme songs and videos returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AllThemeMediaResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AllThemeMediaResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AllThemeMediaResult" + } + } + } + }, + "404": { + "description": "Item not found." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ThemeSongs": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get theme songs for an item.", + "operationId": "GetThemeSongs", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "inheritFromParent", + "in": "query", + "description": "Optional. Determines whether or not parent items should be searched for theme media.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort Order - Ascending, Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + } + ], + "responses": { + "200": { + "description": "Theme songs returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ThemeVideos": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get theme videos for an item.", + "operationId": "GetThemeVideos", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "inheritFromParent", + "in": "query", + "description": "Optional. Determines whether or not parent items should be searched for theme media.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort Order - Ascending, Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + } + ], + "responses": { + "200": { + "description": "Theme videos returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Counts": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get item counts.", + "operationId": "GetItemCounts", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. Get counts from a specific user's library.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional. Get counts of favorite items.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Item counts returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ItemCounts" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ItemCounts" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ItemCounts" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Libraries/AvailableOptions": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets the library options info.", + "operationId": "GetLibraryOptionsInfo", + "parameters": [ + { + "name": "libraryContentType", + "in": "query", + "description": "Library content type.", + "schema": { + "enum": [ + "unknown", + "movies", + "tvshows", + "music", + "musicvideos", + "trailers", + "homevideos", + "boxsets", + "books", + "photos", + "livetv", + "playlists", + "folders" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CollectionType" + } + ] + } + }, + { + "name": "isNewLibrary", + "in": "query", + "description": "Whether this is a new library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Library options info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LibraryOptionsResultDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LibraryOptionsResultDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LibraryOptionsResultDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/Media/Updated": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new movies have been added by an external source.", + "operationId": "PostUpdatedMedia", + "requestBody": { + "description": "The update paths.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaUpdateInfoDto" + } + ], + "description": "Media Update Info Dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaUpdateInfoDto" + } + ], + "description": "Media Update Info Dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaUpdateInfoDto" + } + ], + "description": "Media Update Info Dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Report success." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/MediaFolders": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets all user media folders.", + "operationId": "GetMediaFolders", + "parameters": [ + { + "name": "isHidden", + "in": "query", + "description": "Optional. Filter by folders that are marked hidden, or not.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Media folders returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Library/Movies/Added": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new movies have been added by an external source.", + "operationId": "PostAddedMovies", + "parameters": [ + { + "name": "tmdbId", + "in": "query", + "description": "The tmdbId.", + "schema": { + "type": "string" + } + }, + { + "name": "imdbId", + "in": "query", + "description": "The imdbId.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Report success." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/Movies/Updated": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new movies have been added by an external source.", + "operationId": "PostUpdatedMovies", + "parameters": [ + { + "name": "tmdbId", + "in": "query", + "description": "The tmdbId.", + "schema": { + "type": "string" + } + }, + { + "name": "imdbId", + "in": "query", + "description": "The imdbId.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Report success." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/PhysicalPaths": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets a list of physical paths from virtual folders.", + "operationId": "GetPhysicalPaths", + "responses": { + "200": { + "description": "Physical paths returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Library/Refresh": { + "post": { + "tags": [ + "Library" + ], + "summary": "Starts a library scan.", + "operationId": "RefreshLibrary", + "responses": { + "204": { + "description": "Library scan started." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Library/Series/Added": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new episodes of a series have been added by an external source.", + "operationId": "PostAddedSeries", + "parameters": [ + { + "name": "tvdbId", + "in": "query", + "description": "The tvdbId.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Report success." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/Series/Updated": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new episodes of a series have been added by an external source.", + "operationId": "PostUpdatedSeries", + "parameters": [ + { + "name": "tvdbId", + "in": "query", + "description": "The tvdbId.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Report success." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Movies/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarMovies", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarShows", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Trailers/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarTrailers", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/VirtualFolders": { + "get": { + "tags": [ + "LibraryStructure" + ], + "summary": "Gets all virtual folders.", + "operationId": "GetVirtualFolders", + "responses": { + "200": { + "description": "Virtual folders retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VirtualFolderInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VirtualFolderInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VirtualFolderInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Adds a virtual folder.", + "operationId": "AddVirtualFolder", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the virtual folder.", + "schema": { + "type": "string" + } + }, + { + "name": "collectionType", + "in": "query", + "description": "The type of the collection.", + "schema": { + "enum": [ + "movies", + "tvshows", + "music", + "musicvideos", + "homevideos", + "boxsets", + "books", + "mixed" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CollectionTypeOptions" + } + ] + } + }, + { + "name": "paths", + "in": "query", + "description": "The paths of the virtual folder.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "The library options.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AddVirtualFolderDto" + } + ], + "description": "Add virtual folder dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AddVirtualFolderDto" + } + ], + "description": "Add virtual folder dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AddVirtualFolderDto" + } + ], + "description": "Add virtual folder dto." + } + } + } + }, + "responses": { + "204": { + "description": "Folder added." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LibraryStructure" + ], + "summary": "Removes a virtual folder.", + "operationId": "RemoveVirtualFolder", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the folder.", + "schema": { + "type": "string" + } + }, + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Folder removed." + }, + "404": { + "description": "Folder not found." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/VirtualFolders/LibraryOptions": { + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Update library options.", + "operationId": "UpdateLibraryOptions", + "requestBody": { + "description": "The library name and options.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateLibraryOptionsDto" + } + ], + "description": "Update library options dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateLibraryOptionsDto" + } + ], + "description": "Update library options dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateLibraryOptionsDto" + } + ], + "description": "Update library options dto." + } + } + } + }, + "responses": { + "204": { + "description": "Library updated." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/VirtualFolders/Name": { + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Renames a virtual folder.", + "operationId": "RenameVirtualFolder", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the virtual folder.", + "schema": { + "type": "string" + } + }, + { + "name": "newName", + "in": "query", + "description": "The new name.", + "schema": { + "type": "string" + } + }, + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Folder renamed." + }, + "404": { + "description": "Library doesn't exist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "409": { + "description": "Library already exists.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/VirtualFolders/Paths": { + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Add a media path to a library.", + "operationId": "AddMediaPath", + "parameters": [ + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "The media path dto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathDto" + } + ], + "description": "Media Path dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathDto" + } + ], + "description": "Media Path dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathDto" + } + ], + "description": "Media Path dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Media path added." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LibraryStructure" + ], + "summary": "Remove a media path.", + "operationId": "RemoveMediaPath", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the library.", + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "The path to remove.", + "schema": { + "type": "string" + } + }, + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Media path removed." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/VirtualFolders/Paths/Update": { + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Updates a media path.", + "operationId": "UpdateMediaPath", + "requestBody": { + "description": "The name of the library and path infos.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateMediaPathRequestDto" + } + ], + "description": "Update library options dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateMediaPathRequestDto" + } + ], + "description": "Update library options dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateMediaPathRequestDto" + } + ], + "description": "Update library options dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Media path updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ChannelMappingOptions": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Get channel mapping options.", + "operationId": "GetChannelMappingOptions", + "parameters": [ + { + "name": "providerId", + "in": "query", + "description": "Provider id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Channel mapping options returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChannelMappingOptionsDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ChannelMappingOptionsDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ChannelMappingOptionsDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ChannelMappings": { + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Set channel mappings.", + "operationId": "SetChannelMapping", + "requestBody": { + "description": "The set channel mapping dto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetChannelMappingDto" + } + ], + "description": "Set channel mapping dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetChannelMappingDto" + } + ], + "description": "Set channel mapping dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetChannelMappingDto" + } + ], + "description": "Set channel mapping dto." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Created channel mapping returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TunerChannelMapping" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TunerChannelMapping" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TunerChannelMapping" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Channels": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available live tv channels.", + "operationId": "GetLiveTvChannels", + "parameters": [ + { + "name": "type", + "in": "query", + "description": "Optional. Filter by channel type.", + "schema": { + "enum": [ + "TV", + "Radio" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ChannelType" + } + ] + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional. Filter by channels that are favorites, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isLiked", + "in": "query", + "description": "Optional. Filter by channels that are liked, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isDisliked", + "in": "query", + "description": "Optional. Filter by channels that are disliked, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "\"Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Key to sort by.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort order.", + "schema": { + "enum": [ + "Ascending", + "Descending" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SortOrder" + } + ] + } + }, + { + "name": "enableFavoriteSorting", + "in": "query", + "description": "Optional. Incorporate favorite and like status into channel sorting.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "addCurrentProgram", + "in": "query", + "description": "Optional. Adds current program info to each channel.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Available live tv channels returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Channels/{channelId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv channel.", + "operationId": "GetChannel", + "parameters": [ + { + "name": "channelId", + "in": "path", + "description": "Channel id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Live tv channel returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/GuideInfo": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Get guide info.", + "operationId": "GetGuideInfo", + "responses": { + "200": { + "description": "Guide info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GuideInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/GuideInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/GuideInfo" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Info": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available live tv services.", + "operationId": "GetLiveTvInfo", + "responses": { + "200": { + "description": "Available live tv services returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiveTvInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LiveTvInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LiveTvInfo" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ListingProviders": { + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Adds a listings provider.", + "operationId": "AddListingProvider", + "parameters": [ + { + "name": "pw", + "in": "query", + "description": "Password.", + "schema": { + "type": "string" + } + }, + { + "name": "validateListings", + "in": "query", + "description": "Validate listings.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "validateLogin", + "in": "query", + "description": "Validate login.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "New listings info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Created listings provider returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Delete listing provider.", + "operationId": "DeleteListingProvider", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Listing provider id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Listing provider deleted." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ListingProviders/Default": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets default listings provider info.", + "operationId": "GetDefaultListingProvider", + "responses": { + "200": { + "description": "Default listings provider info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ListingProviders/Lineups": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available lineups.", + "operationId": "GetLineups", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Provider id.", + "schema": { + "type": "string" + } + }, + { + "name": "type", + "in": "query", + "description": "Provider type.", + "schema": { + "type": "string" + } + }, + { + "name": "location", + "in": "query", + "description": "Location.", + "schema": { + "type": "string" + } + }, + { + "name": "country", + "in": "query", + "description": "Country.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Available lineups returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ListingProviders/SchedulesDirect/Countries": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available countries.", + "operationId": "GetSchedulesDirectCountries", + "responses": { + "200": { + "description": "Available countries returned.", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/LiveRecordings/{recordingId}/stream": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv recording stream.", + "operationId": "GetLiveRecordingFile", + "parameters": [ + { + "name": "recordingId", + "in": "path", + "description": "Recording id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Recording stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Recording not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/LiveTv/LiveStreamFiles/{streamId}/stream.{container}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv channel stream.", + "operationId": "GetLiveStreamFile", + "parameters": [ + { + "name": "streamId", + "in": "path", + "description": "Stream id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "container", + "in": "path", + "description": "Container type.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Stream not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/LiveTv/Programs": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available live tv epgs.", + "operationId": "GetLiveTvPrograms", + "parameters": [ + { + "name": "channelIds", + "in": "query", + "description": "The channels to return guide information for.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "minStartDate", + "in": "query", + "description": "Optional. The minimum premiere start date.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasAired", + "in": "query", + "description": "Optional. Filter by programs that have completed airing, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isAiring", + "in": "query", + "description": "Optional. Filter by programs that are currently airing, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "maxStartDate", + "in": "query", + "description": "Optional. The maximum premiere start date.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minEndDate", + "in": "query", + "description": "Optional. The minimum premiere end date.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "maxEndDate", + "in": "query", + "description": "Optional. The maximum premiere end date.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "genres", + "in": "query", + "description": "The genres to return guide information for.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "The genre ids to return guide information for.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesTimerId", + "in": "query", + "description": "Optional. Filter by series timer id.", + "schema": { + "type": "string" + } + }, + { + "name": "librarySeriesId", + "in": "query", + "description": "Optional. Filter by library series id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Retrieve total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Live tv epgs returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available live tv epgs.", + "operationId": "GetPrograms", + "requestBody": { + "description": "Request body.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GetProgramsDto" + } + ], + "description": "Get programs dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GetProgramsDto" + } + ], + "description": "Get programs dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GetProgramsDto" + } + ], + "description": "Get programs dto." + } + } + } + }, + "responses": { + "200": { + "description": "Live tv epgs returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Programs/{programId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv program.", + "operationId": "GetProgram", + "parameters": [ + { + "name": "programId", + "in": "path", + "description": "Program id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Program returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Programs/Recommended": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets recommended live tv epgs.", + "operationId": "GetRecommendedPrograms", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. filter by user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "isAiring", + "in": "query", + "description": "Optional. Filter by programs that are currently airing, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasAired", + "in": "query", + "description": "Optional. Filter by programs that have completed airing, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "The genres to return guide information for.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Retrieve total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Recommended epgs returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets live tv recordings.", + "operationId": "GetRecordings", + "parameters": [ + { + "name": "channelId", + "in": "query", + "description": "Optional. Filter by channel id.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "status", + "in": "query", + "description": "Optional. Filter by recording status.", + "schema": { + "enum": [ + "New", + "InProgress", + "Completed", + "Cancelled", + "ConflictedOk", + "ConflictedNotOk", + "Error" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RecordingStatus" + } + ] + } + }, + { + "name": "isInProgress", + "in": "query", + "description": "Optional. Filter by recordings that are in progress, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesTimerId", + "in": "query", + "description": "Optional. Filter by recordings belonging to a series timer.", + "schema": { + "type": "string" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isLibraryItem", + "in": "query", + "description": "Optional. Filter for is library item.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Return total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Live tv recordings returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings/{recordingId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv recording.", + "operationId": "GetRecording", + "parameters": [ + { + "name": "recordingId", + "in": "path", + "description": "Recording id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Recording returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Deletes a live tv recording.", + "operationId": "DeleteRecording", + "parameters": [ + { + "name": "recordingId", + "in": "path", + "description": "Recording id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Recording deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings/Folders": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets recording folders.", + "operationId": "GetRecordingFolders", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Recording folders returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings/Groups": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets live tv recording groups.", + "operationId": "GetRecordingGroups", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Recording groups returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings/Groups/{groupId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Get recording group.", + "operationId": "GetRecordingGroup", + "parameters": [ + { + "name": "groupId", + "in": "path", + "description": "Group id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings/Series": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets live tv recording series.", + "operationId": "GetRecordingsSeries", + "parameters": [ + { + "name": "channelId", + "in": "query", + "description": "Optional. Filter by channel id.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "groupId", + "in": "query", + "description": "Optional. Filter by recording group.", + "schema": { + "type": "string" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "status", + "in": "query", + "description": "Optional. Filter by recording status.", + "schema": { + "enum": [ + "New", + "InProgress", + "Completed", + "Cancelled", + "ConflictedOk", + "ConflictedNotOk", + "Error" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RecordingStatus" + } + ] + } + }, + { + "name": "isInProgress", + "in": "query", + "description": "Optional. Filter by recordings that are in progress, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesTimerId", + "in": "query", + "description": "Optional. Filter by recordings belonging to a series timer.", + "schema": { + "type": "string" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Return total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Live tv recordings returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/SeriesTimers": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets live tv series timers.", + "operationId": "GetSeriesTimers", + "parameters": [ + { + "name": "sortBy", + "in": "query", + "description": "Optional. Sort by SortName or Priority.", + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort in Ascending or Descending order.", + "schema": { + "enum": [ + "Ascending", + "Descending" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SortOrder" + } + ] + } + } + ], + "responses": { + "200": { + "description": "Timers returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Creates a live tv series timer.", + "operationId": "CreateSeriesTimer", + "requestBody": { + "description": "New series timer info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + } + } + }, + "responses": { + "204": { + "description": "Series timer info created." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/SeriesTimers/{timerId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv series timer.", + "operationId": "GetSeriesTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Series timer returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + } + } + }, + "404": { + "description": "Series timer not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Cancels a live tv series timer.", + "operationId": "CancelSeriesTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Timer cancelled." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Updates a live tv series timer.", + "operationId": "UpdateSeriesTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "New series timer info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + } + } + }, + "responses": { + "204": { + "description": "Series timer updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Timers": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets the live tv timers.", + "operationId": "GetTimers", + "parameters": [ + { + "name": "channelId", + "in": "query", + "description": "Optional. Filter by channel id.", + "schema": { + "type": "string" + } + }, + { + "name": "seriesTimerId", + "in": "query", + "description": "Optional. Filter by timers belonging to a series timer.", + "schema": { + "type": "string" + } + }, + { + "name": "isActive", + "in": "query", + "description": "Optional. Filter by timers that are active.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isScheduled", + "in": "query", + "description": "Optional. Filter by timers that are scheduled.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Creates a live tv timer.", + "operationId": "CreateTimer", + "requestBody": { + "description": "New timer info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + } + } + }, + "responses": { + "204": { + "description": "Timer created." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Timers/{timerId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a timer.", + "operationId": "GetTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Timer returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Cancels a live tv timer.", + "operationId": "CancelTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Timer deleted." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Updates a live tv timer.", + "operationId": "UpdateTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "New timer info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + } + } + }, + "responses": { + "204": { + "description": "Timer updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Timers/Defaults": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets the default values for a new timer.", + "operationId": "GetDefaultTimer", + "parameters": [ + { + "name": "programId", + "in": "query", + "description": "Optional. To attach default values based on a program.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Default values returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/TunerHosts": { + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Adds a tuner host.", + "operationId": "AddTunerHost", + "requestBody": { + "description": "New tuner host.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TunerHostInfo" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TunerHostInfo" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TunerHostInfo" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Created tuner host returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TunerHostInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TunerHostInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Deletes a tuner host.", + "operationId": "DeleteTunerHost", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Tuner host id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Tuner host deleted." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/TunerHosts/Types": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Get tuner host types.", + "operationId": "GetTunerHostTypes", + "responses": { + "200": { + "description": "Tuner host types returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Tuners/{tunerId}/Reset": { + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Resets a tv tuner.", + "operationId": "ResetTuner", + "parameters": [ + { + "name": "tunerId", + "in": "path", + "description": "Tuner id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Tuner reset." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Tuners/Discover": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Discover tuners.", + "operationId": "DiscoverTuners", + "parameters": [ + { + "name": "newDevicesOnly", + "in": "query", + "description": "Only discover new tuners.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Tuners returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Tuners/Discvover": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Discover tuners.", + "operationId": "DiscvoverTuners", + "parameters": [ + { + "name": "newDevicesOnly", + "in": "query", + "description": "Only discover new tuners.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Tuners returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Localization/Countries": { + "get": { + "tags": [ + "Localization" + ], + "summary": "Gets known countries.", + "operationId": "GetCountries", + "responses": { + "200": { + "description": "Known countries returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CountryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CountryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CountryInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Localization/Cultures": { + "get": { + "tags": [ + "Localization" + ], + "summary": "Gets known cultures.", + "operationId": "GetCultures", + "responses": { + "200": { + "description": "Known cultures returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CultureDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CultureDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CultureDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Localization/Options": { + "get": { + "tags": [ + "Localization" + ], + "summary": "Gets localization options.", + "operationId": "GetLocalizationOptions", + "responses": { + "200": { + "description": "Localization options returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocalizationOption" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocalizationOption" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocalizationOption" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Localization/ParentalRatings": { + "get": { + "tags": [ + "Localization" + ], + "summary": "Gets known parental ratings.", + "operationId": "GetParentalRatings", + "responses": { + "200": { + "description": "Known parental ratings returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParentalRating" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParentalRating" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParentalRating" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/Lyrics": { + "get": { + "tags": [ + "Lyrics" + ], + "summary": "Gets an item's lyrics.", + "operationId": "GetLyrics", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Lyrics returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + } + } + }, + "404": { + "description": "Something went wrong. No Lyrics will be returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Lyrics" + ], + "summary": "Upload an external lyric file.", + "operationId": "UploadLyrics", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item the lyric belongs to.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fileName", + "in": "query", + "description": "Name of the file being uploaded.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "200": { + "description": "Lyrics uploaded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + } + } + }, + "400": { + "description": "Error processing upload.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LyricManagement", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Lyrics" + ], + "summary": "Deletes an external lyric file.", + "operationId": "DeleteLyrics", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Lyric deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LyricManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/RemoteSearch/Lyrics": { + "get": { + "tags": [ + "Lyrics" + ], + "summary": "Search remote lyrics.", + "operationId": "SearchRemoteLyrics", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Lyrics retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteLyricInfoDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteLyricInfoDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteLyricInfoDto" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LyricManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/RemoteSearch/Lyrics/{lyricId}": { + "post": { + "tags": [ + "Lyrics" + ], + "summary": "Downloads a remote lyric.", + "operationId": "DownloadRemoteLyrics", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "lyricId", + "in": "path", + "description": "The lyric id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Lyric downloaded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LyricManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Providers/Lyrics/{lyricId}": { + "get": { + "tags": [ + "Lyrics" + ], + "summary": "Gets the remote lyrics.", + "operationId": "GetRemoteLyrics", + "parameters": [ + { + "name": "lyricId", + "in": "path", + "description": "The remote provider item id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "File returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + } + } + }, + "404": { + "description": "Lyric not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LyricManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/PlaybackInfo": { + "get": { + "tags": [ + "MediaInfo" + ], + "summary": "Gets live playback media info for an item.", + "operationId": "GetPlaybackInfo", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Playback info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "MediaInfo" + ], + "summary": "Gets live playback media info for an item.", + "description": "For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.\r\nQuery parameters are obsolete.", + "operationId": "GetPostedPlaybackInfo", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "deprecated": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "The maximum streaming bitrate.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "The start time in ticks.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "The audio stream index.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "The subtitle stream index.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "The maximum number of audio channels.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media source id.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The livestream id.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "autoOpenLiveStream", + "in": "query", + "description": "Whether to auto open the livestream.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "enableDirectPlay", + "in": "query", + "description": "Whether to enable direct play. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "enableDirectStream", + "in": "query", + "description": "Whether to enable direct stream. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "enableTranscoding", + "in": "query", + "description": "Whether to enable transcoding. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether to allow to copy the video stream. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether to allow to copy the audio stream. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "description": "The playback info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackInfoDto" + } + ], + "description": "Playback info dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackInfoDto" + } + ], + "description": "Playback info dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackInfoDto" + } + ], + "description": "Playback info dto." + } + } + } + }, + "responses": { + "200": { + "description": "Playback info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveStreams/Close": { + "post": { + "tags": [ + "MediaInfo" + ], + "summary": "Closes a media source.", + "operationId": "CloseLiveStream", + "parameters": [ + { + "name": "liveStreamId", + "in": "query", + "description": "The livestream id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Livestream closed." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveStreams/Open": { + "post": { + "tags": [ + "MediaInfo" + ], + "summary": "Opens a media source.", + "operationId": "OpenLiveStream", + "parameters": [ + { + "name": "openToken", + "in": "query", + "description": "The open token.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "The start time in ticks.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "The audio stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "The subtitle stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "The maximum number of audio channels.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "itemId", + "in": "query", + "description": "The item id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableDirectPlay", + "in": "query", + "description": "Whether to enable direct play. Default: true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableDirectStream", + "in": "query", + "description": "Whether to enable direct stream. Default: true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Always burn-in subtitle when transcoding.", + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "description": "The open live stream dto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenLiveStreamDto" + } + ], + "description": "Open live stream dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenLiveStreamDto" + } + ], + "description": "Open live stream dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenLiveStreamDto" + } + ], + "description": "Open live stream dto." + } + } + } + }, + "responses": { + "200": { + "description": "Media source opened.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiveStreamResponse" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LiveStreamResponse" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LiveStreamResponse" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playback/BitrateTest": { + "get": { + "tags": [ + "MediaInfo" + ], + "summary": "Tests the network with a request with the size of the bitrate.", + "operationId": "GetBitrateTestBytes", + "parameters": [ + { + "name": "size", + "in": "query", + "description": "The bitrate. Defaults to 102400.", + "schema": { + "maximum": 100000000, + "minimum": 1, + "type": "integer", + "format": "int32", + "default": 102400 + } + } + ], + "responses": { + "200": { + "description": "Test buffer returned.", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MediaSegments/{itemId}": { + "get": { + "tags": [ + "MediaSegments" + ], + "summary": "Gets all media segments based on an itemId.", + "operationId": "GetItemSegments", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The ItemId.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeSegmentTypes", + "in": "query", + "description": "Optional filter of requested segment types.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaSegmentType" + } + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MediaSegmentDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/MediaSegmentDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/MediaSegmentDtoQueryResult" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Movies/Recommendations": { + "get": { + "tags": [ + "Movies" + ], + "summary": "Gets movie recommendations.", + "operationId": "GetMovieRecommendations", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. The fields to return.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "categoryLimit", + "in": "query", + "description": "The max number of categories to return.", + "schema": { + "type": "integer", + "format": "int32", + "default": 5 + } + }, + { + "name": "itemLimit", + "in": "query", + "description": "The max number of items to return per category.", + "schema": { + "type": "integer", + "format": "int32", + "default": 8 + } + } + ], + "responses": { + "200": { + "description": "Movie recommendations returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecommendationDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecommendationDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecommendationDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MusicGenres": { + "get": { + "tags": [ + "MusicGenres" + ], + "summary": "Gets all music genres from a given item, folder, or the entire library.", + "operationId": "GetMusicGenres", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Include total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Music genres returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MusicGenres/{genreName}": { + "get": { + "tags": [ + "MusicGenres" + ], + "summary": "Gets a music genre, by name.", + "operationId": "GetMusicGenre", + "parameters": [ + { + "name": "genreName", + "in": "path", + "description": "The genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Packages": { + "get": { + "tags": [ + "Package" + ], + "summary": "Gets available packages.", + "operationId": "GetPackages", + "responses": { + "200": { + "description": "Available packages returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PackageInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PackageInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PackageInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Packages/{name}": { + "get": { + "tags": [ + "Package" + ], + "summary": "Gets a package by name or assembly GUID.", + "operationId": "GetPackageInfo", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the package.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "assemblyGuid", + "in": "query", + "description": "The GUID of the associated assembly.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Package retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PackageInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PackageInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PackageInfo" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Packages/Installed/{name}": { + "post": { + "tags": [ + "Package" + ], + "summary": "Installs a package.", + "operationId": "InstallPackage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Package name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "assemblyGuid", + "in": "query", + "description": "GUID of the associated assembly.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "query", + "description": "Optional version. Defaults to latest version.", + "schema": { + "type": "string" + } + }, + { + "name": "repositoryUrl", + "in": "query", + "description": "Optional. Specify the repository to install from.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Package found." + }, + "404": { + "description": "Package not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Packages/Installing/{packageId}": { + "delete": { + "tags": [ + "Package" + ], + "summary": "Cancels a package installation.", + "operationId": "CancelPackageInstallation", + "parameters": [ + { + "name": "packageId", + "in": "path", + "description": "Installation Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Installation cancelled." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Repositories": { + "get": { + "tags": [ + "Package" + ], + "summary": "Gets all package repositories.", + "operationId": "GetRepositories", + "responses": { + "200": { + "description": "Package repositories returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Package" + ], + "summary": "Sets the enabled and existing package repositories.", + "operationId": "SetRepositories", + "requestBody": { + "description": "The list of package repositories.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Package repositories saved." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Persons": { + "get": { + "tags": [ + "Persons" + ], + "summary": "Gets all persons.", + "operationId": "GetPersons", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term.", + "schema": { + "type": "string" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not. userId is required.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "excludePersonTypes", + "in": "query", + "description": "Optional. If specified results will be filtered to exclude those containing the specified PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified results will be filtered to include only those containing the specified PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "appearsInItemId", + "in": "query", + "description": "Optional. If specified, person results will be filtered on items related to said persons.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Persons returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Persons/{name}": { + "get": { + "tags": [ + "Persons" + ], + "summary": "Get person by name.", + "operationId": "GetPerson", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Person returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "404": { + "description": "Person not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists": { + "post": { + "tags": [ + "Playlists" + ], + "summary": "Creates a new playlist.", + "description": "For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.\r\nQuery parameters are obsolete.", + "operationId": "CreatePlaylist", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The playlist name.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "ids", + "in": "query", + "description": "The item ids.", + "deprecated": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "deprecated": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaType", + "in": "query", + "description": "The media type.", + "deprecated": true, + "schema": { + "enum": [ + "Unknown", + "Video", + "Audio", + "Photo", + "Book" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaType" + } + ] + } + } + ], + "requestBody": { + "description": "The create playlist payload.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreatePlaylistDto" + } + ], + "description": "Create new playlist dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreatePlaylistDto" + } + ], + "description": "Create new playlist dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreatePlaylistDto" + } + ], + "description": "Create new playlist dto." + } + } + } + }, + "responses": { + "200": { + "description": "Playlist created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaylistCreationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistCreationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistCreationResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}": { + "post": { + "tags": [ + "Playlists" + ], + "summary": "Updates a playlist.", + "operationId": "UpdatePlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistDto id.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistDto" + } + ], + "description": "Update existing playlist dto. Fields set to `null` will not be updated and keep their current values." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistDto" + } + ], + "description": "Update existing playlist dto. Fields set to `null` will not be updated and keep their current values." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistDto" + } + ], + "description": "Update existing playlist dto. Fields set to `null` will not be updated and keep their current values." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Playlist updated." + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "get": { + "tags": [ + "Playlists" + ], + "summary": "Get a playlist.", + "operationId": "GetPlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "The playlist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaylistDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistDto" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}/Items": { + "post": { + "tags": [ + "Playlists" + ], + "summary": "Adds items to a playlist.", + "operationId": "AddItemToPlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ids", + "in": "query", + "description": "Item id, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "The userId.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Items added to playlist." + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Playlists" + ], + "summary": "Removes items from a playlist.", + "operationId": "RemoveItemFromPlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "entryIds", + "in": "query", + "description": "The item ids, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "204": { + "description": "Items removed." + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "get": { + "tags": [ + "Playlists" + ], + "summary": "Gets the original items of a playlist.", + "operationId": "GetPlaylistItems", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Original playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}/Items/{itemId}/Move/{newIndex}": { + "post": { + "tags": [ + "Playlists" + ], + "summary": "Moves a playlist item.", + "operationId": "MoveItem", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "newIndex", + "in": "path", + "description": "The new index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Item moved to new index." + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}/Users": { + "get": { + "tags": [ + "Playlists" + ], + "summary": "Get a playlist's users.", + "operationId": "GetPlaylistUsers", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Found shares.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + } + } + } + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}/Users/{userId}": { + "get": { + "tags": [ + "Playlists" + ], + "summary": "Get a playlist user.", + "operationId": "GetPlaylistUser", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "User permission found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + } + } + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Playlists" + ], + "summary": "Modify a user of a playlist's users.", + "operationId": "UpdatePlaylistUser", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistUserDto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistUserDto" + } + ], + "description": "Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistUserDto" + } + ], + "description": "Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistUserDto" + } + ], + "description": "Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "User's permissions modified." + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Playlists" + ], + "summary": "Remove a user from a playlist's users.", + "operationId": "RemoveUserFromPlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "User permissions removed from playlist." + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "No playlist or user permissions found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized access." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/PlayingItems/{itemId}": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports that a session has begun playing an item.", + "operationId": "OnPlaybackStart", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The id of the MediaSource.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "The audio stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "The subtitle stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "playMethod", + "in": "query", + "description": "The play method.", + "schema": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ] + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "canSeek", + "in": "query", + "description": "Indicates if the client can seek.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Play start recorded." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Playstate" + ], + "summary": "Reports that a session has stopped playing an item.", + "operationId": "OnPlaybackStopped", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The id of the MediaSource.", + "schema": { + "type": "string" + } + }, + { + "name": "nextMediaType", + "in": "query", + "description": "The next media type that will play.", + "schema": { + "type": "string" + } + }, + { + "name": "positionTicks", + "in": "query", + "description": "Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Playback stop recorded." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/PlayingItems/{itemId}/Progress": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports a session's playback progress.", + "operationId": "OnPlaybackProgress", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The id of the MediaSource.", + "schema": { + "type": "string" + } + }, + { + "name": "positionTicks", + "in": "query", + "description": "Optional. The current position, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "The audio stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "The subtitle stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "volumeLevel", + "in": "query", + "description": "Scale of 0-100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "playMethod", + "in": "query", + "description": "The play method.", + "schema": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ] + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "repeatMode", + "in": "query", + "description": "The repeat mode.", + "schema": { + "enum": [ + "RepeatNone", + "RepeatAll", + "RepeatOne" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RepeatMode" + } + ] + } + }, + { + "name": "isPaused", + "in": "query", + "description": "Indicates if the player is paused.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "isMuted", + "in": "query", + "description": "Indicates if the player is muted.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Play progress recorded." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Playing": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports playback has started within a session.", + "operationId": "ReportPlaybackStart", + "requestBody": { + "description": "The playback start info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStartInfo" + } + ], + "description": "Class PlaybackStartInfo." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStartInfo" + } + ], + "description": "Class PlaybackStartInfo." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStartInfo" + } + ], + "description": "Class PlaybackStartInfo." + } + } + } + }, + "responses": { + "204": { + "description": "Playback start recorded." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Playing/Ping": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Pings a playback session.", + "operationId": "PingPlaybackSession", + "parameters": [ + { + "name": "playSessionId", + "in": "query", + "description": "Playback session id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Playback session pinged." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Playing/Progress": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports playback progress within a session.", + "operationId": "ReportPlaybackProgress", + "requestBody": { + "description": "The playback progress info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackProgressInfo" + } + ], + "description": "Class PlaybackProgressInfo." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackProgressInfo" + } + ], + "description": "Class PlaybackProgressInfo." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackProgressInfo" + } + ], + "description": "Class PlaybackProgressInfo." + } + } + } + }, + "responses": { + "204": { + "description": "Playback progress recorded." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Playing/Stopped": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports playback has stopped within a session.", + "operationId": "ReportPlaybackStopped", + "requestBody": { + "description": "The playback stop info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStopInfo" + } + ], + "description": "Class PlaybackStopInfo." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStopInfo" + } + ], + "description": "Class PlaybackStopInfo." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStopInfo" + } + ], + "description": "Class PlaybackStopInfo." + } + } + } + }, + "responses": { + "204": { + "description": "Playback stop recorded." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserPlayedItems/{itemId}": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Marks an item as played for user.", + "operationId": "MarkPlayedItem", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "datePlayed", + "in": "query", + "description": "Optional. The date the item was played.", + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "Item marked as played.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Playstate" + ], + "summary": "Marks an item as unplayed for user.", + "operationId": "MarkUnplayedItem", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item marked as unplayed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Plugins": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "Gets a list of currently installed plugins.", + "operationId": "GetPlugins", + "responses": { + "200": { + "description": "Installed plugins returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}": { + "delete": { + "tags": [ + "Plugins" + ], + "summary": "Uninstalls a plugin.", + "operationId": "UninstallPlugin", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Plugin uninstalled." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/{version}": { + "delete": { + "tags": [ + "Plugins" + ], + "summary": "Uninstalls a plugin by version.", + "operationId": "UninstallPluginByVersion", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "path", + "description": "Plugin version.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Plugin uninstalled." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/{version}/Disable": { + "post": { + "tags": [ + "Plugins" + ], + "summary": "Disable a plugin.", + "operationId": "DisablePlugin", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "path", + "description": "Plugin version.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Plugin disabled." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/{version}/Enable": { + "post": { + "tags": [ + "Plugins" + ], + "summary": "Enables a disabled plugin.", + "operationId": "EnablePlugin", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "path", + "description": "Plugin version.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Plugin enabled." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/{version}/Image": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "Gets a plugin's image.", + "operationId": "GetPluginImage", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "path", + "description": "Plugin version.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Plugin image returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/Configuration": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "Gets plugin configuration.", + "operationId": "GetPluginConfiguration", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Plugin configuration returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BasePluginConfiguration" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BasePluginConfiguration" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BasePluginConfiguration" + } + } + } + }, + "404": { + "description": "Plugin not found or plugin configuration not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Plugins" + ], + "summary": "Updates plugin configuration.", + "description": "Accepts plugin configuration as JSON body.", + "operationId": "UpdatePluginConfiguration", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Plugin configuration updated." + }, + "404": { + "description": "Plugin not found or plugin does not have configuration.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/Manifest": { + "post": { + "tags": [ + "Plugins" + ], + "summary": "Gets a plugin's manifest.", + "operationId": "GetPluginManifest", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Plugin manifest returned." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/QuickConnect/Authorize": { + "post": { + "tags": [ + "QuickConnect" + ], + "summary": "Authorizes a pending quick connect request.", + "operationId": "AuthorizeQuickConnect", + "parameters": [ + { + "name": "code", + "in": "query", + "description": "Quick connect code to authorize.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user the authorize. Access to the requested user is required.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Quick connect result authorized successfully.", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "boolean" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "boolean" + } + } + } + }, + "403": { + "description": "Unknown user id.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/QuickConnect/Connect": { + "get": { + "tags": [ + "QuickConnect" + ], + "summary": "Attempts to retrieve authentication information.", + "operationId": "GetQuickConnectState", + "parameters": [ + { + "name": "secret", + "in": "query", + "description": "Secret previously returned from the Initiate endpoint.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Quick connect result returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + } + } + }, + "404": { + "description": "Unknown quick connect secret.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/QuickConnect/Enabled": { + "get": { + "tags": [ + "QuickConnect" + ], + "summary": "Gets the current quick connect state.", + "operationId": "GetQuickConnectEnabled", + "responses": { + "200": { + "description": "Quick connect state returned.", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "boolean" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "boolean" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/QuickConnect/Initiate": { + "post": { + "tags": [ + "QuickConnect" + ], + "summary": "Initiate a new quick connect request.", + "operationId": "InitiateQuickConnect", + "responses": { + "200": { + "description": "Quick connect request successfully created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + } + } + }, + "401": { + "description": "Quick connect is not active on this server." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Items/{itemId}/RemoteImages": { + "get": { + "tags": [ + "RemoteImage" + ], + "summary": "Gets available remote images for an item.", + "operationId": "GetRemoteImages", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "type", + "in": "query", + "description": "The image type.", + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ] + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "providerName", + "in": "query", + "description": "Optional. The image provider to use.", + "schema": { + "type": "string" + } + }, + { + "name": "includeAllLanguages", + "in": "query", + "description": "Optional. Include all languages.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Remote Images returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RemoteImageResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/RemoteImageResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/RemoteImageResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/RemoteImages/Download": { + "post": { + "tags": [ + "RemoteImage" + ], + "summary": "Downloads a remote image for an item.", + "operationId": "DownloadRemoteImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "type", + "in": "query", + "description": "The image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageUrl", + "in": "query", + "description": "The image url.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Remote image downloaded." + }, + "404": { + "description": "Remote image not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Items/{itemId}/RemoteImages/Providers": { + "get": { + "tags": [ + "RemoteImage" + ], + "summary": "Gets available remote image providers for an item.", + "operationId": "GetRemoteImageProviders", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Returned remote image providers.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageProviderInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageProviderInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageProviderInfo" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/ScheduledTasks": { + "get": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Get tasks.", + "operationId": "GetTasks", + "parameters": [ + { + "name": "isHidden", + "in": "query", + "description": "Optional filter tasks that are hidden, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isEnabled", + "in": "query", + "description": "Optional filter tasks that are enabled, or not.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Scheduled tasks retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/ScheduledTasks/{taskId}": { + "get": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Get task by id.", + "operationId": "GetTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "description": "Task Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Task retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaskInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TaskInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TaskInfo" + } + } + } + }, + "404": { + "description": "Task not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/ScheduledTasks/{taskId}/Triggers": { + "post": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Update specified task triggers.", + "operationId": "UpdateTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "description": "Task Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Triggers.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskTriggerInfo" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskTriggerInfo" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskTriggerInfo" + } + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Task triggers updated." + }, + "404": { + "description": "Task not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/ScheduledTasks/Running/{taskId}": { + "post": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Start specified task.", + "operationId": "StartTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "description": "Task Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Task started." + }, + "404": { + "description": "Task not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Stop specified task.", + "operationId": "StopTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "description": "Task Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Task stopped." + }, + "404": { + "description": "Task not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Search/Hints": { + "get": { + "tags": [ + "Search" + ], + "summary": "Gets the search hint result.", + "operationId": "GetSearchHints", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Supply a user id to search within a user's library or omit to search all.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term to filter on.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "If specified, only results with the specified item types are returned. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "If specified, results with these item types are filtered out. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "If specified, only results with the specified media types are returned. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "If specified, only children of the parent are returned.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "includePeople", + "in": "query", + "description": "Optional filter whether to include people.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "includeMedia", + "in": "query", + "description": "Optional filter whether to include media.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "includeGenres", + "in": "query", + "description": "Optional filter whether to include genres.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "includeStudios", + "in": "query", + "description": "Optional filter whether to include studios.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "includeArtists", + "in": "query", + "description": "Optional filter whether to include artists.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Search hint returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchHintResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SearchHintResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SearchHintResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Auth/PasswordResetProviders": { + "get": { + "tags": [ + "Session" + ], + "summary": "Get all password reset providers.", + "operationId": "GetPasswordResetProviders", + "responses": { + "200": { + "description": "Password reset providers retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Auth/Providers": { + "get": { + "tags": [ + "Session" + ], + "summary": "Get all auth providers.", + "operationId": "GetAuthProviders", + "responses": { + "200": { + "description": "Auth providers retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Sessions": { + "get": { + "tags": [ + "Session" + ], + "summary": "Gets a list of sessions.", + "operationId": "GetSessions", + "parameters": [ + { + "name": "controllableByUserId", + "in": "query", + "description": "Filter by sessions that a given user is allowed to remote control.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "Filter by device Id.", + "schema": { + "type": "string" + } + }, + { + "name": "activeWithinSeconds", + "in": "query", + "description": "Optional. Filter by sessions that were active in the last n seconds.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "List of sessions returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionInfoDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionInfoDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionInfoDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Command": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a full general command to a client.", + "operationId": "SendFullGeneralCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The MediaBrowser.Model.Session.GeneralCommand.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommand" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommand" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommand" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Full general command sent to session." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Command/{command}": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a general command to a client.", + "operationId": "SendGeneralCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "command", + "in": "path", + "description": "The command to send.", + "required": true, + "schema": { + "enum": [ + "MoveUp", + "MoveDown", + "MoveLeft", + "MoveRight", + "PageUp", + "PageDown", + "PreviousLetter", + "NextLetter", + "ToggleOsd", + "ToggleContextMenu", + "Select", + "Back", + "TakeScreenshot", + "SendKey", + "SendString", + "GoHome", + "GoToSettings", + "VolumeUp", + "VolumeDown", + "Mute", + "Unmute", + "ToggleMute", + "SetVolume", + "SetAudioStreamIndex", + "SetSubtitleStreamIndex", + "ToggleFullscreen", + "DisplayContent", + "GoToSearch", + "DisplayMessage", + "SetRepeatMode", + "ChannelUp", + "ChannelDown", + "Guide", + "ToggleStats", + "PlayMediaSource", + "PlayTrailers", + "SetShuffleQueue", + "PlayState", + "PlayNext", + "ToggleOsdMenu", + "Play", + "SetMaxStreamingBitrate", + "SetPlaybackOrder" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommandType" + } + ], + "description": "This exists simply to identify a set of known commands." + } + } + ], + "responses": { + "204": { + "description": "General command sent to session." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Message": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a command to a client to display a message to the user.", + "operationId": "SendMessageCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and TimeoutMs.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MessageCommand" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MessageCommand" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MessageCommand" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Message sent." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Playing": { + "post": { + "tags": [ + "Session" + ], + "summary": "Instructs a session to play an item.", + "operationId": "Play", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "playCommand", + "in": "query", + "description": "The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet implemented play next and play last may play now.", + "required": true, + "schema": { + "enum": [ + "PlayNow", + "PlayNext", + "PlayLast", + "PlayInstantMix", + "PlayShuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayCommand" + } + ], + "description": "Enum PlayCommand." + } + }, + { + "name": "itemIds", + "in": "query", + "description": "The ids of the items to play, comma delimited.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "startPositionTicks", + "in": "query", + "description": "The starting position of the first item.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "Optional. The media source id.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to play.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to play.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The start index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Instruction sent to session." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Playing/{command}": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a playstate command to a client.", + "operationId": "SendPlaystateCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "command", + "in": "path", + "description": "The MediaBrowser.Model.Session.PlaystateCommand.", + "required": true, + "schema": { + "enum": [ + "Stop", + "Pause", + "Unpause", + "NextTrack", + "PreviousTrack", + "Seek", + "Rewind", + "FastForward", + "PlayPause" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaystateCommand" + } + ], + "description": "Enum PlaystateCommand." + } + }, + { + "name": "seekPositionTicks", + "in": "query", + "description": "The optional position ticks.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "controllingUserId", + "in": "query", + "description": "The optional controlling user id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Playstate command sent to session." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/System/{command}": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a system command to a client.", + "operationId": "SendSystemCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "command", + "in": "path", + "description": "The command to send.", + "required": true, + "schema": { + "enum": [ + "MoveUp", + "MoveDown", + "MoveLeft", + "MoveRight", + "PageUp", + "PageDown", + "PreviousLetter", + "NextLetter", + "ToggleOsd", + "ToggleContextMenu", + "Select", + "Back", + "TakeScreenshot", + "SendKey", + "SendString", + "GoHome", + "GoToSettings", + "VolumeUp", + "VolumeDown", + "Mute", + "Unmute", + "ToggleMute", + "SetVolume", + "SetAudioStreamIndex", + "SetSubtitleStreamIndex", + "ToggleFullscreen", + "DisplayContent", + "GoToSearch", + "DisplayMessage", + "SetRepeatMode", + "ChannelUp", + "ChannelDown", + "Guide", + "ToggleStats", + "PlayMediaSource", + "PlayTrailers", + "SetShuffleQueue", + "PlayState", + "PlayNext", + "ToggleOsdMenu", + "Play", + "SetMaxStreamingBitrate", + "SetPlaybackOrder" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommandType" + } + ], + "description": "This exists simply to identify a set of known commands." + } + } + ], + "responses": { + "204": { + "description": "System command sent to session." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/User/{userId}": { + "post": { + "tags": [ + "Session" + ], + "summary": "Adds an additional user to a session.", + "operationId": "AddUserToSession", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "User added to session." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Session" + ], + "summary": "Removes an additional user from a session.", + "operationId": "RemoveUserFromSession", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "User removed from session." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Viewing": { + "post": { + "tags": [ + "Session" + ], + "summary": "Instructs a session to browse to an item or view.", + "operationId": "DisplayContent", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session Id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemType", + "in": "query", + "description": "The type of item to browse to.", + "required": true, + "schema": { + "enum": [ + "AggregateFolder", + "Audio", + "AudioBook", + "BasePluginFolder", + "Book", + "BoxSet", + "Channel", + "ChannelFolderItem", + "CollectionFolder", + "Episode", + "Folder", + "Genre", + "ManualPlaylistsFolder", + "Movie", + "LiveTvChannel", + "LiveTvProgram", + "MusicAlbum", + "MusicArtist", + "MusicGenre", + "MusicVideo", + "Person", + "Photo", + "PhotoAlbum", + "Playlist", + "PlaylistsFolder", + "Program", + "Recording", + "Season", + "Series", + "Studio", + "Trailer", + "TvChannel", + "TvProgram", + "UserRootFolder", + "UserView", + "Video", + "Year" + ], + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemKind" + } + ], + "description": "The base item kind." + } + }, + { + "name": "itemId", + "in": "query", + "description": "The Id of the item.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemName", + "in": "query", + "description": "The name of the item.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Instruction sent to session." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Capabilities": { + "post": { + "tags": [ + "Session" + ], + "summary": "Updates capabilities for a device.", + "operationId": "PostCapabilities", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The session id.", + "schema": { + "type": "string" + } + }, + { + "name": "playableMediaTypes", + "in": "query", + "description": "A list of playable media types, comma delimited. Audio, Video, Book, Photo.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "supportedCommands", + "in": "query", + "description": "A list of supported remote control commands, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneralCommandType" + } + } + }, + { + "name": "supportsMediaControl", + "in": "query", + "description": "Determines whether media can be played remotely..", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "supportsPersistentIdentifier", + "in": "query", + "description": "Determines whether the device supports a unique identifier.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "204": { + "description": "Capabilities posted." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Capabilities/Full": { + "post": { + "tags": [ + "Session" + ], + "summary": "Updates capabilities for a device.", + "operationId": "PostFullCapabilities", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The session id.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The MediaBrowser.Model.Session.ClientCapabilities.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Client capabilities dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Client capabilities dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Client capabilities dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Capabilities updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Logout": { + "post": { + "tags": [ + "Session" + ], + "summary": "Reports that a session has ended.", + "operationId": "ReportSessionEnded", + "responses": { + "204": { + "description": "Session end reported to server." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Viewing": { + "post": { + "tags": [ + "Session" + ], + "summary": "Reports that a session is viewing an item.", + "operationId": "ReportViewing", + "parameters": [ + { + "name": "sessionId", + "in": "query", + "description": "The session id.", + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "query", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Session reported to server." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Startup/Complete": { + "post": { + "tags": [ + "Startup" + ], + "summary": "Completes the startup wizard.", + "operationId": "CompleteWizard", + "responses": { + "204": { + "description": "Startup wizard completed." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Startup/Configuration": { + "get": { + "tags": [ + "Startup" + ], + "summary": "Gets the initial startup wizard configuration.", + "operationId": "GetStartupConfiguration", + "responses": { + "200": { + "description": "Initial startup wizard configuration retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Startup" + ], + "summary": "Sets the initial startup wizard configuration.", + "operationId": "UpdateInitialConfiguration", + "requestBody": { + "description": "The updated startup configuration.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + ], + "description": "The startup configuration DTO." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + ], + "description": "The startup configuration DTO." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + ], + "description": "The startup configuration DTO." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Configuration saved." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Startup/FirstUser": { + "get": { + "tags": [ + "Startup" + ], + "summary": "Gets the first user.", + "operationId": "GetFirstUser_2", + "responses": { + "200": { + "description": "Initial user retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Startup/RemoteAccess": { + "post": { + "tags": [ + "Startup" + ], + "summary": "Sets remote access and UPnP.", + "operationId": "SetRemoteAccess", + "requestBody": { + "description": "The startup remote access dto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupRemoteAccessDto" + } + ], + "description": "Startup remote access dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupRemoteAccessDto" + } + ], + "description": "Startup remote access dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupRemoteAccessDto" + } + ], + "description": "Startup remote access dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Configuration saved." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Startup/User": { + "get": { + "tags": [ + "Startup" + ], + "summary": "Gets the first user.", + "operationId": "GetFirstUser", + "responses": { + "200": { + "description": "Initial user retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Startup" + ], + "summary": "Sets the user name and password.", + "operationId": "UpdateStartupUser", + "requestBody": { + "description": "The DTO containing username and password.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupUserDto" + } + ], + "description": "The startup user DTO." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupUserDto" + } + ], + "description": "The startup user DTO." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupUserDto" + } + ], + "description": "The startup user DTO." + } + } + } + }, + "responses": { + "204": { + "description": "Updated user name and password." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Studios": { + "get": { + "tags": [ + "Studios" + ], + "summary": "Gets all studios from a given item, folder, or the entire library.", + "operationId": "GetStudios", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Studios returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Studios/{name}": { + "get": { + "tags": [ + "Studios" + ], + "summary": "Gets a studio by name.", + "operationId": "GetStudio", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Studio returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/FallbackFont/Fonts": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets a list of available fallback font files.", + "operationId": "GetFallbackFontList", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FontFile" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FontFile" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FontFile" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/FallbackFont/Fonts/{name}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets a fallback font file.", + "operationId": "GetFallbackFont", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the fallback font file to get.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Fallback font file retrieved.", + "content": { + "font/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/RemoteSearch/Subtitles/{language}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Search remote subtitles.", + "operationId": "SearchRemoteSubtitles", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "language", + "in": "path", + "description": "The language of the subtitles.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "isPerfectMatch", + "in": "query", + "description": "Optional. Only show subtitles which are a perfect match.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Subtitles retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSubtitleInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSubtitleInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSubtitleInfo" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SubtitleManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/RemoteSearch/Subtitles/{subtitleId}": { + "post": { + "tags": [ + "Subtitle" + ], + "summary": "Downloads a remote subtitle.", + "operationId": "DownloadRemoteSubtitles", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "subtitleId", + "in": "path", + "description": "The subtitle id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Subtitle downloaded." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SubtitleManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Providers/Subtitles/Subtitles/{subtitleId}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets the remote subtitles.", + "operationId": "GetRemoteSubtitles", + "parameters": [ + { + "name": "subtitleId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "File returned.", + "content": { + "text/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SubtitleManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/{mediaSourceId}/Subtitles/{index}/subtitles.m3u8": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets an HLS subtitle playlist.", + "operationId": "GetSubtitlePlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "index", + "in": "path", + "description": "The subtitle stream index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "path", + "description": "The media source id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The subtitle segment length.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Subtitle playlist retrieved.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/Subtitles": { + "post": { + "tags": [ + "Subtitle" + ], + "summary": "Upload an external subtitle file.", + "operationId": "UploadSubtitle", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item the subtitle belongs to.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The request body.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UploadSubtitleDto" + } + ], + "description": "Upload subtitles dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UploadSubtitleDto" + } + ], + "description": "Upload subtitles dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UploadSubtitleDto" + } + ], + "description": "Upload subtitles dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Subtitle uploaded." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SubtitleManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/Subtitles/{index}": { + "delete": { + "tags": [ + "Subtitle" + ], + "summary": "Deletes an external subtitle file.", + "operationId": "DeleteSubtitle", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "index", + "in": "path", + "description": "The index of the subtitle file.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Subtitle deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/{routeStartPositionTicks}/Stream.{routeFormat}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets subtitles in a specified format.", + "operationId": "GetSubtitleWithTicks", + "parameters": [ + { + "name": "routeItemId", + "in": "path", + "description": "The (route) item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "routeMediaSourceId", + "in": "path", + "description": "The (route) media source id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "routeIndex", + "in": "path", + "description": "The (route) subtitle stream index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "routeStartPositionTicks", + "in": "path", + "description": "The (route) start position of the subtitle in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "routeFormat", + "in": "path", + "description": "The (route) format of the returned subtitle.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "query", + "description": "The item id.", + "deprecated": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media source id.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "index", + "in": "query", + "description": "The subtitle stream index.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startPositionTicks", + "in": "query", + "description": "The start position of the subtitle in ticks.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "format", + "in": "query", + "description": "The format of the returned subtitle.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "endPositionTicks", + "in": "query", + "description": "Optional. The end position of the subtitle in ticks.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Optional. Whether to copy the timestamps.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "addVttTimeMap", + "in": "query", + "description": "Optional. Whether to add a VTT time map.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "File returned.", + "content": { + "text/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/Stream.{routeFormat}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets subtitles in a specified format.", + "operationId": "GetSubtitle", + "parameters": [ + { + "name": "routeItemId", + "in": "path", + "description": "The (route) item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "routeMediaSourceId", + "in": "path", + "description": "The (route) media source id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "routeIndex", + "in": "path", + "description": "The (route) subtitle stream index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "routeFormat", + "in": "path", + "description": "The (route) format of the returned subtitle.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "query", + "description": "The item id.", + "deprecated": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media source id.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "index", + "in": "query", + "description": "The subtitle stream index.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "format", + "in": "query", + "description": "The format of the returned subtitle.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "endPositionTicks", + "in": "query", + "description": "Optional. The end position of the subtitle in ticks.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Optional. Whether to copy the timestamps.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "addVttTimeMap", + "in": "query", + "description": "Optional. Whether to add a VTT time map.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "startPositionTicks", + "in": "query", + "description": "The start position of the subtitle in ticks.", + "schema": { + "type": "integer", + "format": "int64", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "File returned.", + "content": { + "text/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Items/Suggestions": { + "get": { + "tags": [ + "Suggestions" + ], + "summary": "Gets suggestions.", + "operationId": "GetSuggestions", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaType", + "in": "query", + "description": "The media types.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "type", + "in": "query", + "description": "The type.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The start index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The limit.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Whether to enable the total record count.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Suggestions returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/{id}": { + "get": { + "tags": [ + "SyncPlay" + ], + "summary": "Gets a SyncPlay group by id.", + "operationId": "SyncPlayGetGroup", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The id of the group.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Group returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GroupInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/GroupInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/GroupInfoDto" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayJoinGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Buffering": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Notify SyncPlay group that member is buffering.", + "operationId": "SyncPlayBuffering", + "requestBody": { + "description": "The player status.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BufferRequestDto" + } + ], + "description": "Class BufferRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BufferRequestDto" + } + ], + "description": "Class BufferRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BufferRequestDto" + } + ], + "description": "Class BufferRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Group state update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Join": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Join an existing SyncPlay group.", + "operationId": "SyncPlayJoinGroup", + "requestBody": { + "description": "The group to join.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/JoinGroupRequestDto" + } + ], + "description": "Class JoinGroupRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/JoinGroupRequestDto" + } + ], + "description": "Class JoinGroupRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/JoinGroupRequestDto" + } + ], + "description": "Class JoinGroupRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Group join successful." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayJoinGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Leave": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Leave the joined SyncPlay group.", + "operationId": "SyncPlayLeaveGroup", + "responses": { + "204": { + "description": "Group leave successful." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/List": { + "get": { + "tags": [ + "SyncPlay" + ], + "summary": "Gets all SyncPlay groups.", + "operationId": "SyncPlayGetGroups", + "responses": { + "200": { + "description": "Groups returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupInfoDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupInfoDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupInfoDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayJoinGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/MovePlaylistItem": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to move an item in the playlist in SyncPlay group.", + "operationId": "SyncPlayMovePlaylistItem", + "requestBody": { + "description": "The new position for the item.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovePlaylistItemRequestDto" + } + ], + "description": "Class MovePlaylistItemRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovePlaylistItemRequestDto" + } + ], + "description": "Class MovePlaylistItemRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovePlaylistItemRequestDto" + } + ], + "description": "Class MovePlaylistItemRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/New": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Create a new SyncPlay group.", + "operationId": "SyncPlayCreateGroup", + "requestBody": { + "description": "The settings of the new group.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NewGroupRequestDto" + } + ], + "description": "Class NewGroupRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NewGroupRequestDto" + } + ], + "description": "Class NewGroupRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NewGroupRequestDto" + } + ], + "description": "Class NewGroupRequestDto." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GroupInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/GroupInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/GroupInfoDto" + } + } + } + }, + "204": { + "description": "New group created." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayCreateGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/NextItem": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request next item in SyncPlay group.", + "operationId": "SyncPlayNextItem", + "requestBody": { + "description": "The current item information.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NextItemRequestDto" + } + ], + "description": "Class NextItemRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NextItemRequestDto" + } + ], + "description": "Class NextItemRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NextItemRequestDto" + } + ], + "description": "Class NextItemRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Next item update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Pause": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request pause in SyncPlay group.", + "operationId": "SyncPlayPause", + "responses": { + "204": { + "description": "Pause update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Ping": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Update session ping.", + "operationId": "SyncPlayPing", + "requestBody": { + "description": "The new ping.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PingRequestDto" + } + ], + "description": "Class PingRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PingRequestDto" + } + ], + "description": "Class PingRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PingRequestDto" + } + ], + "description": "Class PingRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Ping updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/PreviousItem": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request previous item in SyncPlay group.", + "operationId": "SyncPlayPreviousItem", + "requestBody": { + "description": "The current item information.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PreviousItemRequestDto" + } + ], + "description": "Class PreviousItemRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PreviousItemRequestDto" + } + ], + "description": "Class PreviousItemRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PreviousItemRequestDto" + } + ], + "description": "Class PreviousItemRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Previous item update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Queue": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to queue items to the playlist of a SyncPlay group.", + "operationId": "SyncPlayQueue", + "requestBody": { + "description": "The items to add.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QueueRequestDto" + } + ], + "description": "Class QueueRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QueueRequestDto" + } + ], + "description": "Class QueueRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QueueRequestDto" + } + ], + "description": "Class QueueRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Ready": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Notify SyncPlay group that member is ready for playback.", + "operationId": "SyncPlayReady", + "requestBody": { + "description": "The player status.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ReadyRequestDto" + } + ], + "description": "Class ReadyRequest." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ReadyRequestDto" + } + ], + "description": "Class ReadyRequest." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ReadyRequestDto" + } + ], + "description": "Class ReadyRequest." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Group state update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/RemoveFromPlaylist": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to remove items from the playlist in SyncPlay group.", + "operationId": "SyncPlayRemoveFromPlaylist", + "requestBody": { + "description": "The items to remove.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoveFromPlaylistRequestDto" + } + ], + "description": "Class RemoveFromPlaylistRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoveFromPlaylistRequestDto" + } + ], + "description": "Class RemoveFromPlaylistRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoveFromPlaylistRequestDto" + } + ], + "description": "Class RemoveFromPlaylistRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Seek": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request seek in SyncPlay group.", + "operationId": "SyncPlaySeek", + "requestBody": { + "description": "The new playback position.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeekRequestDto" + } + ], + "description": "Class SeekRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeekRequestDto" + } + ], + "description": "Class SeekRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeekRequestDto" + } + ], + "description": "Class SeekRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Seek update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/SetIgnoreWait": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request SyncPlay group to ignore member during group-wait.", + "operationId": "SyncPlaySetIgnoreWait", + "requestBody": { + "description": "The settings to set.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/IgnoreWaitRequestDto" + } + ], + "description": "Class IgnoreWaitRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/IgnoreWaitRequestDto" + } + ], + "description": "Class IgnoreWaitRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/IgnoreWaitRequestDto" + } + ], + "description": "Class IgnoreWaitRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Member state updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/SetNewQueue": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to set new playlist in SyncPlay group.", + "operationId": "SyncPlaySetNewQueue", + "requestBody": { + "description": "The new playlist to play in the group.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayRequestDto" + } + ], + "description": "Class PlayRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayRequestDto" + } + ], + "description": "Class PlayRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayRequestDto" + } + ], + "description": "Class PlayRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/SetPlaylistItem": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to change playlist item in SyncPlay group.", + "operationId": "SyncPlaySetPlaylistItem", + "requestBody": { + "description": "The new item to play.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetPlaylistItemRequestDto" + } + ], + "description": "Class SetPlaylistItemRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetPlaylistItemRequestDto" + } + ], + "description": "Class SetPlaylistItemRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetPlaylistItemRequestDto" + } + ], + "description": "Class SetPlaylistItemRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/SetRepeatMode": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to set repeat mode in SyncPlay group.", + "operationId": "SyncPlaySetRepeatMode", + "requestBody": { + "description": "The new repeat mode.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetRepeatModeRequestDto" + } + ], + "description": "Class SetRepeatModeRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetRepeatModeRequestDto" + } + ], + "description": "Class SetRepeatModeRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetRepeatModeRequestDto" + } + ], + "description": "Class SetRepeatModeRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Play queue update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/SetShuffleMode": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to set shuffle mode in SyncPlay group.", + "operationId": "SyncPlaySetShuffleMode", + "requestBody": { + "description": "The new shuffle mode.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetShuffleModeRequestDto" + } + ], + "description": "Class SetShuffleModeRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetShuffleModeRequestDto" + } + ], + "description": "Class SetShuffleModeRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetShuffleModeRequestDto" + } + ], + "description": "Class SetShuffleModeRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Play queue update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Stop": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request stop in SyncPlay group.", + "operationId": "SyncPlayStop", + "responses": { + "204": { + "description": "Stop update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Unpause": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request unpause in SyncPlay group.", + "operationId": "SyncPlayUnpause", + "responses": { + "204": { + "description": "Unpause update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Endpoint": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets information about the request endpoint.", + "operationId": "GetEndpointInfo", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndPointInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/EndPointInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/EndPointInfo" + } + } + } + }, + "403": { + "description": "User does not have permission to get endpoint information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Info": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets information about the server.", + "operationId": "GetSystemInfo", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + } + } + }, + "403": { + "description": "User does not have permission to retrieve information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrIgnoreParentalControl", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Info/Public": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets public information about the server.", + "operationId": "GetPublicSystemInfo", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublicSystemInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PublicSystemInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PublicSystemInfo" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/System/Info/Storage": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets information about the server.", + "operationId": "GetSystemStorage", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemStorageDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SystemStorageDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SystemStorageDto" + } + } + } + }, + "403": { + "description": "User does not have permission to retrieve information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/System/Logs": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets a list of available server log files.", + "operationId": "GetServerLogs", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogFile" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogFile" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogFile" + } + } + } + } + }, + "403": { + "description": "User does not have permission to get server logs.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/System/Logs/Log": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets a log file.", + "operationId": "GetLogFile", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the log file to get.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Log file retrieved.", + "content": { + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "403": { + "description": "User does not have permission to get log files.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Could not find a log file with the name.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/System/Ping": { + "get": { + "tags": [ + "System" + ], + "summary": "Pings the system.", + "operationId": "GetPingSystem", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "post": { + "tags": [ + "System" + ], + "summary": "Pings the system.", + "operationId": "PostPingSystem", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/System/Restart": { + "post": { + "tags": [ + "System" + ], + "summary": "Restarts the application.", + "operationId": "RestartApplication", + "responses": { + "204": { + "description": "Server restarted." + }, + "403": { + "description": "User does not have permission to restart server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LocalAccessOrRequiresElevation" + ] + } + ] + } + }, + "/System/Shutdown": { + "post": { + "tags": [ + "System" + ], + "summary": "Shuts down the application.", + "operationId": "ShutdownApplication", + "responses": { + "204": { + "description": "Server shut down." + }, + "403": { + "description": "User does not have permission to shutdown server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/GetUtcTime": { + "get": { + "tags": [ + "TimeSync" + ], + "summary": "Gets the current UTC time.", + "operationId": "GetUtcTime", + "responses": { + "200": { + "description": "Time returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UtcTimeResponse" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UtcTimeResponse" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UtcTimeResponse" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Tmdb/ClientConfiguration": { + "get": { + "tags": [ + "Tmdb" + ], + "summary": "Gets the TMDb image configuration options.", + "operationId": "TmdbClientConfiguration", + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigImageTypes" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Trailers": { + "get": { + "tags": [ + "Trailers" + ], + "summary": "Finds movies and trailers similar to a given trailer.", + "operationId": "GetTrailers", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id supplied as query parameter; this is required when not using an API key.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "maxOfficialRating", + "in": "query", + "description": "Optional filter by maximum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "hasThemeSong", + "in": "query", + "description": "Optional filter by items with theme songs.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasThemeVideo", + "in": "query", + "description": "Optional filter by items with theme videos.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSubtitles", + "in": "query", + "description": "Optional filter by items with subtitles.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSpecialFeature", + "in": "query", + "description": "Optional filter by items with special features.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTrailer", + "in": "query", + "description": "Optional filter by items with trailers.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentIndexNumber", + "in": "query", + "description": "Optional filter by parent index number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "hasParentalRating", + "in": "query", + "description": "Optional filter by items that have or do not have a parental rating.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isHd", + "in": "query", + "description": "Optional filter by items that are HD or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "is4K", + "in": "query", + "description": "Optional filter by items that are 4K or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "locationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "excludeLocationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isUnaired", + "in": "query", + "description": "Optional filter by items that are unaired episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minCriticRating", + "in": "query", + "description": "Optional filter by minimum critic rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minPremiereDate", + "in": "query", + "description": "Optional. The minimum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSaved", + "in": "query", + "description": "Optional. The minimum last saved date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSavedForUser", + "in": "query", + "description": "Optional. The minimum last saved date for the current user. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "maxPremiereDate", + "in": "query", + "description": "Optional. The maximum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasOverview", + "in": "query", + "description": "Optional filter by items that have an overview or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasImdbId", + "in": "query", + "description": "Optional filter by items that have an IMDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTmdbId", + "in": "query", + "description": "Optional filter by items that have a TMDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTvdbId", + "in": "query", + "description": "Optional filter by items that have a TVDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional filter for live tv movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional filter for live tv series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional filter for live tv news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional filter for live tv kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional filter for live tv sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "excludeItemIds", + "in": "query", + "description": "Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "recursive", + "in": "query", + "description": "When searching within folders, this determines whether or not the search will be recursive. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Filter based on a search term.", + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending, Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "imageTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "isPlayed", + "in": "query", + "description": "Optional filter by items that are played, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "artists", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "artistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albumArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified album artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "contributingArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified contributing artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albums", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "albumIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "ids", + "in": "query", + "description": "Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "videoTypes", + "in": "query", + "description": "Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VideoType" + } + } + }, + { + "name": "minOfficialRating", + "in": "query", + "description": "Optional filter by minimum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "isLocked", + "in": "query", + "description": "Optional filter by items that are locked.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isPlaceHolder", + "in": "query", + "description": "Optional filter by items that are placeholders.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasOfficialRating", + "in": "query", + "description": "Optional filter by items that have official ratings.", + "schema": { + "type": "boolean" + } + }, + { + "name": "collapseBoxSetItems", + "in": "query", + "description": "Whether or not to hide items behind their boxsets.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minWidth", + "in": "query", + "description": "Optional. Filter by the minimum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minHeight", + "in": "query", + "description": "Optional. Filter by the minimum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. Filter by the maximum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. Filter by the maximum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "is3D", + "in": "query", + "description": "Optional filter by items that are 3D, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesStatus", + "in": "query", + "description": "Optional filter by Series Status. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SeriesStatus" + } + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Enable the total record count.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/Trickplay/{width}/{index}.jpg": { + "get": { + "tags": [ + "Trickplay" + ], + "summary": "Gets a trickplay tile image.", + "operationId": "GetTrickplayTileImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "width", + "in": "path", + "description": "The width of a single tile.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "index", + "in": "path", + "description": "The index of the desired tile.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if using an alternate version.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Tile image not found at specified index.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/Trickplay/{width}/tiles.m3u8": { + "get": { + "tags": [ + "Trickplay" + ], + "summary": "Gets an image tiles playlist for trickplay.", + "operationId": "GetTrickplayHlsPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "width", + "in": "path", + "description": "The width of a single tile.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if using an alternate version.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Tiles playlist returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/{seriesId}/Episodes": { + "get": { + "tags": [ + "TvShows" + ], + "summary": "Gets episodes for a tv season.", + "operationId": "GetEpisodes", + "parameters": [ + { + "name": "seriesId", + "in": "path", + "description": "The series id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "season", + "in": "query", + "description": "Optional filter by season number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "seasonId", + "in": "query", + "description": "Optional. Filter by season id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional. Filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startItemId", + "in": "query", + "description": "Optional. Skip through the list until a given item is found.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "enum": [ + "Default", + "AiredEpisodeOrder", + "Album", + "AlbumArtist", + "Artist", + "DateCreated", + "OfficialRating", + "DatePlayed", + "PremiereDate", + "StartDate", + "SortName", + "Name", + "Random", + "Runtime", + "CommunityRating", + "ProductionYear", + "PlayCount", + "CriticRating", + "IsFolder", + "IsUnplayed", + "IsPlayed", + "SeriesSortName", + "VideoBitRate", + "AirTime", + "Studio", + "IsFavoriteOrLiked", + "DateLastContentAdded", + "SeriesDatePlayed", + "ParentIndexNumber", + "IndexNumber" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ItemSortBy" + } + ] + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/{seriesId}/Seasons": { + "get": { + "tags": [ + "TvShows" + ], + "summary": "Gets seasons for a tv series.", + "operationId": "GetSeasons", + "parameters": [ + { + "name": "seriesId", + "in": "path", + "description": "The series id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "isSpecialSeason", + "in": "query", + "description": "Optional. Filter by special season.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional. Filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/NextUp": { + "get": { + "tags": [ + "TvShows" + ], + "summary": "Gets a list of next up episodes.", + "operationId": "GetNextUp", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id of the user to get the next up episodes for.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "seriesId", + "in": "query", + "description": "Optional. Filter by series id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "nextUpDateCutoff", + "in": "query", + "description": "Optional. Starting date of shows to show in Next Up section.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Whether to enable the total records count. Defaults to true.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "disableFirstEpisode", + "in": "query", + "description": "Whether to disable sending the first episode in a series as next up.", + "deprecated": true, + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableResumable", + "in": "query", + "description": "Whether to include resumable episodes in next up results.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableRewatching", + "in": "query", + "description": "Whether to include watched episodes in next up results.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/Upcoming": { + "get": { + "tags": [ + "TvShows" + ], + "summary": "Gets a list of upcoming episodes.", + "operationId": "GetUpcomingEpisodes", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id of the user to get the upcoming episodes for.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/universal": { + "get": { + "tags": [ + "UniversalAudio" + ], + "summary": "Gets an audio stream.", + "operationId": "GetUniversalAudioStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "Optional. The audio container.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. The audio codec to transcode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "transcodingAudioChannels", + "in": "query", + "description": "Optional. The number of how many audio channels to transcode to.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "transcodingContainer", + "in": "query", + "description": "Optional. The container to transcode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodingProtocol", + "in": "query", + "description": "Optional. The transcoding protocol.", + "schema": { + "enum": [ + "http", + "hls" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaStreamProtocol" + } + ] + } + }, + { + "name": "maxAudioSampleRate", + "in": "query", + "description": "Optional. The maximum audio sample rate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableRemoteMedia", + "in": "query", + "description": "Optional. Whether to enable remote media.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableRedirection", + "in": "query", + "description": "Whether to enable redirection. Defaults to true.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "302": { + "description": "Redirected to remote audio stream." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "head": { + "tags": [ + "UniversalAudio" + ], + "summary": "Gets an audio stream.", + "operationId": "HeadUniversalAudioStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "Optional. The audio container.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. The audio codec to transcode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "transcodingAudioChannels", + "in": "query", + "description": "Optional. The number of how many audio channels to transcode to.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "transcodingContainer", + "in": "query", + "description": "Optional. The container to transcode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodingProtocol", + "in": "query", + "description": "Optional. The transcoding protocol.", + "schema": { + "enum": [ + "http", + "hls" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaStreamProtocol" + } + ] + } + }, + { + "name": "maxAudioSampleRate", + "in": "query", + "description": "Optional. The maximum audio sample rate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableRemoteMedia", + "in": "query", + "description": "Optional. Whether to enable remote media.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableRedirection", + "in": "query", + "description": "Whether to enable redirection. Defaults to true.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "302": { + "description": "Redirected to remote audio stream." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users": { + "get": { + "tags": [ + "User" + ], + "summary": "Gets a list of users.", + "operationId": "GetUsers", + "parameters": [ + { + "name": "isHidden", + "in": "query", + "description": "Optional filter by IsHidden=true or false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isDisabled", + "in": "query", + "description": "Optional filter by IsDisabled=true or false.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Users returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user.", + "operationId": "UpdateUser", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The updated user model.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "User updated." + }, + "400": { + "description": "User information was not supplied.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User update forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}": { + "get": { + "tags": [ + "User" + ], + "summary": "Gets a user by Id.", + "operationId": "GetUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "User returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + } + } + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "IgnoreParentalControl", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "User" + ], + "summary": "Deletes a user.", + "operationId": "DeleteUser", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "User deleted." + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Users/{userId}/Policy": { + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user policy.", + "operationId": "UpdateUserPolicy", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The new user policy.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserPolicy" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserPolicy" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserPolicy" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "User policy updated." + }, + "400": { + "description": "User policy was not supplied.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User policy update forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Users/AuthenticateByName": { + "post": { + "tags": [ + "User" + ], + "summary": "Authenticates a user by name.", + "operationId": "AuthenticateUserByName", + "requestBody": { + "description": "The M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) request.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AuthenticateUserByName" + } + ], + "description": "The authenticate user by name request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AuthenticateUserByName" + } + ], + "description": "The authenticate user by name request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AuthenticateUserByName" + } + ], + "description": "The authenticate user by name request body." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "User authenticated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Users/AuthenticateWithQuickConnect": { + "post": { + "tags": [ + "User" + ], + "summary": "Authenticates a user with quick connect.", + "operationId": "AuthenticateWithQuickConnect", + "requestBody": { + "description": "The Jellyfin.Api.Models.UserDtos.QuickConnectDto request.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QuickConnectDto" + } + ], + "description": "The quick connect request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QuickConnectDto" + } + ], + "description": "The quick connect request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QuickConnectDto" + } + ], + "description": "The quick connect request body." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "User authenticated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + } + } + }, + "400": { + "description": "Missing token." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Users/Configuration": { + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user configuration.", + "operationId": "UpdateUserConfiguration", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The new user configuration.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserConfiguration" + } + ], + "description": "Class UserConfiguration." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserConfiguration" + } + ], + "description": "Class UserConfiguration." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserConfiguration" + } + ], + "description": "Class UserConfiguration." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "User configuration updated." + }, + "403": { + "description": "User configuration update forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/ForgotPassword": { + "post": { + "tags": [ + "User" + ], + "summary": "Initiates the forgot password process for a local user.", + "operationId": "ForgotPassword", + "requestBody": { + "description": "The forgot password request containing the entered username.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordDto" + } + ], + "description": "Forgot Password request body DTO." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordDto" + } + ], + "description": "Forgot Password request body DTO." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordDto" + } + ], + "description": "Forgot Password request body DTO." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Password reset process started.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForgotPasswordResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ForgotPasswordResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ForgotPasswordResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Users/ForgotPassword/Pin": { + "post": { + "tags": [ + "User" + ], + "summary": "Redeems a forgot password pin.", + "operationId": "ForgotPasswordPin", + "requestBody": { + "description": "The forgot password pin request containing the entered pin.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordPinDto" + } + ], + "description": "Forgot Password Pin enter request body DTO." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordPinDto" + } + ], + "description": "Forgot Password Pin enter request body DTO." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordPinDto" + } + ], + "description": "Forgot Password Pin enter request body DTO." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Pin reset process started.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PinRedeemResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PinRedeemResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PinRedeemResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Users/Me": { + "get": { + "tags": [ + "User" + ], + "summary": "Gets the user based on auth token.", + "operationId": "GetCurrentUser", + "responses": { + "200": { + "description": "User returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + } + } + }, + "400": { + "description": "Token is not owned by a user.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/New": { + "post": { + "tags": [ + "User" + ], + "summary": "Creates a user.", + "operationId": "CreateUserByName", + "requestBody": { + "description": "The create user by name request body.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreateUserByName" + } + ], + "description": "The create user by name request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreateUserByName" + } + ], + "description": "The create user by name request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreateUserByName" + } + ], + "description": "The create user by name request body." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "User created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Users/Password": { + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user's password.", + "operationId": "UpdateUserPassword", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Nullable{System.Guid},Jellyfin.Api.Models.UserDtos.UpdateUserPassword) request.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserPassword" + } + ], + "description": "The update user password request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserPassword" + } + ], + "description": "The update user password request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserPassword" + } + ], + "description": "The update user password request body." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Password successfully reset." + }, + "403": { + "description": "User is not allowed to update the password.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/Public": { + "get": { + "tags": [ + "User" + ], + "summary": "Gets a list of publicly visible users for display on a login screen.", + "operationId": "GetPublicUsers", + "responses": { + "200": { + "description": "Public users returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Items/{itemId}/Intros": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets intros to play before the main media item plays.", + "operationId": "GetIntros", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Intros returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/LocalTrailers": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets local trailers for an item.", + "operationId": "GetLocalTrailers", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "An Microsoft.AspNetCore.Mvc.OkResult containing the item's local trailers.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/SpecialFeatures": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets special features for an item.", + "operationId": "GetSpecialFeatures", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Special features returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Latest": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets latest media.", + "operationId": "GetLatestMedia", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isPlayed", + "in": "query", + "description": "Filter by items that are played, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "limit", + "in": "query", + "description": "Return item limit.", + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + } + }, + { + "name": "groupItems", + "in": "query", + "description": "Whether or not to group items into a parent container.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Latest media returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Root": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets the root folder from a user's library.", + "operationId": "GetRootFolder", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Root folder returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserFavoriteItems/{itemId}": { + "post": { + "tags": [ + "UserLibrary" + ], + "summary": "Marks an item as a favorite.", + "operationId": "MarkFavoriteItem", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item marked as favorite.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "UserLibrary" + ], + "summary": "Unmarks item as a favorite.", + "operationId": "UnmarkFavoriteItem", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item unmarked as favorite.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserItems/{itemId}/Rating": { + "delete": { + "tags": [ + "UserLibrary" + ], + "summary": "Deletes a user's saved personal rating for an item.", + "operationId": "DeleteUserItemRating", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Personal rating removed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "UserLibrary" + ], + "summary": "Updates a user's rating for an item.", + "operationId": "UpdateUserItemRating", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "likes", + "in": "query", + "description": "Whether this M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Nullable{System.Guid},System.Guid,System.Nullable{System.Boolean}) is likes.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Item rating updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserViews": { + "get": { + "tags": [ + "UserViews" + ], + "summary": "Get user views.", + "operationId": "GetUserViews", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeExternalContent", + "in": "query", + "description": "Whether or not to include external views such as channels or live tv.", + "schema": { + "type": "boolean" + } + }, + { + "name": "presetViews", + "in": "query", + "description": "Preset views.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CollectionType" + } + } + }, + { + "name": "includeHidden", + "in": "query", + "description": "Whether or not to include hidden content.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "User views returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserViews/GroupingOptions": { + "get": { + "tags": [ + "UserViews" + ], + "summary": "Get user view grouping options.", + "operationId": "GetGroupingOptions", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "User view grouping options returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SpecialViewOptionDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SpecialViewOptionDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SpecialViewOptionDto" + } + } + } + } + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{videoId}/{mediaSourceId}/Attachments/{index}": { + "get": { + "tags": [ + "VideoAttachments" + ], + "summary": "Get video attachment.", + "operationId": "GetAttachment", + "parameters": [ + { + "name": "videoId", + "in": "path", + "description": "Video ID.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "path", + "description": "Media Source ID.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "index", + "in": "path", + "description": "Attachment Index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Attachment retrieved.", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Video or attachment not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Videos/{itemId}/AdditionalParts": { + "get": { + "tags": [ + "Videos" + ], + "summary": "Gets additional parts for a video.", + "operationId": "GetAdditionalPart", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Additional parts returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/AlternateSources": { + "delete": { + "tags": [ + "Videos" + ], + "summary": "Removes alternate video sources.", + "operationId": "DeleteAlternateSources", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Alternate sources deleted." + }, + "404": { + "description": "Video not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Videos/{itemId}/stream": { + "get": { + "tags": [ + "Videos" + ], + "summary": "Gets a video stream.", + "operationId": "GetVideoStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Videos" + ], + "summary": "Gets a video stream.", + "operationId": "HeadVideoStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Videos/{itemId}/stream.{container}": { + "get": { + "tags": [ + "Videos" + ], + "summary": "Gets a video stream.", + "operationId": "GetVideoStreamByContainer", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "path", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Videos" + ], + "summary": "Gets a video stream.", + "operationId": "HeadVideoStreamByContainer", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "path", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Videos/MergeVersions": { + "post": { + "tags": [ + "Videos" + ], + "summary": "Merges videos into a single record.", + "operationId": "MergeVersions", + "parameters": [ + { + "name": "ids", + "in": "query", + "description": "Item id list. This allows multiple, comma delimited.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "204": { + "description": "Videos merged." + }, + "400": { + "description": "Supply at least 2 video ids.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Years": { + "get": { + "tags": [ + "Years" + ], + "summary": "Get years.", + "operationId": "GetYears", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Skips over a given number of items within the results. Use for paging.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be excluded based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be included based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional. Filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "recursive", + "in": "query", + "description": "Search recursively.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Year query returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Years/{year}": { + "get": { + "tags": [ + "Years" + ], + "summary": "Gets a year.", + "operationId": "GetYear", + "parameters": [ + { + "name": "year", + "in": "path", + "description": "The year.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Year returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "404": { + "description": "Year not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "AccessSchedule": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets the id of this instance.", + "format": "int32", + "readOnly": true + }, + "UserId": { + "type": "string", + "description": "Gets the id of the associated user.", + "format": "uuid" + }, + "DayOfWeek": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Everyday", + "Weekday", + "Weekend" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DynamicDayOfWeek" + } + ], + "description": "Gets or sets the day of week." + }, + "StartHour": { + "type": "number", + "description": "Gets or sets the start hour.", + "format": "double" + }, + "EndHour": { + "type": "number", + "description": "Gets or sets the end hour.", + "format": "double" + } + }, + "additionalProperties": false, + "description": "An entity representing a user's access schedule." + }, + "ActivityLogEntry": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets or sets the identifier.", + "format": "int64" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "Overview": { + "type": "string", + "description": "Gets or sets the overview.", + "nullable": true + }, + "ShortOverview": { + "type": "string", + "description": "Gets or sets the short overview.", + "nullable": true + }, + "Type": { + "type": "string", + "description": "Gets or sets the type." + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "nullable": true + }, + "Date": { + "type": "string", + "description": "Gets or sets the date.", + "format": "date-time" + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user identifier.", + "format": "uuid" + }, + "UserPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the user primary image tag.", + "nullable": true, + "deprecated": true + }, + "Severity": { + "enum": [ + "Trace", + "Debug", + "Information", + "Warning", + "Error", + "Critical", + "None" + ], + "allOf": [ + { + "$ref": "#/components/schemas/LogLevel" + } + ], + "description": "Gets or sets the log severity." + } + }, + "additionalProperties": false, + "description": "An activity log entry." + }, + "ActivityLogEntryMessage": { + "type": "object", + "properties": { + "Data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ActivityLogEntry" + }, + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ActivityLogEntry", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Activity log created message." + }, + "ActivityLogEntryQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ActivityLogEntry" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "ActivityLogEntryStartMessage": { + "type": "object", + "properties": { + "Data": { + "type": "string", + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ActivityLogEntryStart", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Activity log entry start message.\r\nData is the timing data encoded as \"$initialDelay,$interval\" in ms." + }, + "ActivityLogEntryStopMessage": { + "type": "object", + "properties": { + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ActivityLogEntryStop", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Activity log entry stop message." + }, + "AddVirtualFolderDto": { + "type": "object", + "properties": { + "LibraryOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/LibraryOptions" + } + ], + "description": "Gets or sets library options.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Add virtual folder dto." + }, + "AlbumInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "AlbumArtists": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the album artist." + }, + "ArtistProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the artist provider ids." + }, + "SongInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SongInfo" + } + } + }, + "additionalProperties": false + }, + "AlbumInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/AlbumInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "AllThemeMediaResult": { + "type": "object", + "properties": { + "ThemeVideosResult": { + "allOf": [ + { + "$ref": "#/components/schemas/ThemeMediaResult" + } + ], + "description": "Class ThemeMediaResult.", + "nullable": true + }, + "ThemeSongsResult": { + "allOf": [ + { + "$ref": "#/components/schemas/ThemeMediaResult" + } + ], + "description": "Class ThemeMediaResult.", + "nullable": true + }, + "SoundtrackSongsResult": { + "allOf": [ + { + "$ref": "#/components/schemas/ThemeMediaResult" + } + ], + "description": "Class ThemeMediaResult.", + "nullable": true + } + }, + "additionalProperties": false + }, + "ArtistInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "SongInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SongInfo" + } + } + }, + "additionalProperties": false + }, + "ArtistInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/ArtistInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "AudioSpatialFormat": { + "enum": [ + "None", + "DolbyAtmos", + "DTSX" + ], + "type": "string", + "description": "An enum representing formats of spatial audio." + }, + "AuthenticateUserByName": { + "type": "object", + "properties": { + "Username": { + "type": "string", + "description": "Gets or sets the username.", + "nullable": true + }, + "Pw": { + "type": "string", + "description": "Gets or sets the plain text password.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The authenticate user by name request body." + }, + "AuthenticationInfo": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets or sets the identifier.", + "format": "int64" + }, + "AccessToken": { + "type": "string", + "description": "Gets or sets the access token.", + "nullable": true + }, + "DeviceId": { + "type": "string", + "description": "Gets or sets the device identifier.", + "nullable": true + }, + "AppName": { + "type": "string", + "description": "Gets or sets the name of the application.", + "nullable": true + }, + "AppVersion": { + "type": "string", + "description": "Gets or sets the application version.", + "nullable": true + }, + "DeviceName": { + "type": "string", + "description": "Gets or sets the name of the device.", + "nullable": true + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user identifier.", + "format": "uuid" + }, + "IsActive": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is active." + }, + "DateCreated": { + "type": "string", + "description": "Gets or sets the date created.", + "format": "date-time" + }, + "DateRevoked": { + "type": "string", + "description": "Gets or sets the date revoked.", + "format": "date-time", + "nullable": true + }, + "DateLastActivity": { + "type": "string", + "format": "date-time" + }, + "UserName": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "AuthenticationInfoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AuthenticationInfo" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "AuthenticationResult": { + "type": "object", + "properties": { + "User": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto.", + "nullable": true + }, + "SessionInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/SessionInfoDto" + } + ], + "description": "Session info DTO.", + "nullable": true + }, + "AccessToken": { + "type": "string", + "description": "Gets or sets the access token.", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server id.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "A class representing an authentication result." + }, + "BackupManifestDto": { + "type": "object", + "properties": { + "ServerVersion": { + "type": "string", + "description": "Gets or sets the jellyfin version this backup was created with." + }, + "BackupEngineVersion": { + "type": "string", + "description": "Gets or sets the backup engine version this backup was created with." + }, + "DateCreated": { + "type": "string", + "description": "Gets or sets the date this backup was created with.", + "format": "date-time" + }, + "Path": { + "type": "string", + "description": "Gets or sets the path to the backup on the system." + }, + "Options": { + "allOf": [ + { + "$ref": "#/components/schemas/BackupOptionsDto" + } + ], + "description": "Gets or sets the contents of the backup archive." + } + }, + "additionalProperties": false, + "description": "Manifest type for backups internal structure." + }, + "BackupOptionsDto": { + "type": "object", + "properties": { + "Metadata": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the archive contains the Metadata contents." + }, + "Trickplay": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the archive contains the Trickplay contents." + }, + "Subtitles": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the archive contains the Subtitle contents." + }, + "Database": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the archive contains the Database contents." + } + }, + "additionalProperties": false, + "description": "Defines the optional contents of the backup archive." + }, + "BackupRestoreRequestDto": { + "type": "object", + "properties": { + "ArchiveFileName": { + "type": "string", + "description": "Gets or Sets the name of the backup archive to restore from. Must be present in MediaBrowser.Common.Configuration.IApplicationPaths.BackupPath." + } + }, + "additionalProperties": false, + "description": "Defines properties used to start a restore process." + }, + "BaseItemDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server identifier.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "format": "uuid" + }, + "Etag": { + "type": "string", + "description": "Gets or sets the etag.", + "nullable": true + }, + "SourceType": { + "type": "string", + "description": "Gets or sets the type of the source.", + "nullable": true + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist item identifier.", + "nullable": true + }, + "DateCreated": { + "type": "string", + "description": "Gets or sets the date created.", + "format": "date-time", + "nullable": true + }, + "DateLastMediaAdded": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "ExtraType": { + "enum": [ + "Unknown", + "Clip", + "Trailer", + "BehindTheScenes", + "DeletedScene", + "Interview", + "Scene", + "Sample", + "ThemeSong", + "ThemeVideo", + "Featurette", + "Short" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ExtraType" + } + ], + "nullable": true + }, + "AirsBeforeSeasonNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AirsAfterSeasonNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AirsBeforeEpisodeNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "CanDelete": { + "type": "boolean", + "nullable": true + }, + "CanDownload": { + "type": "boolean", + "nullable": true + }, + "HasLyrics": { + "type": "boolean", + "nullable": true + }, + "HasSubtitles": { + "type": "boolean", + "nullable": true + }, + "PreferredMetadataLanguage": { + "type": "string", + "nullable": true + }, + "PreferredMetadataCountryCode": { + "type": "string", + "nullable": true + }, + "Container": { + "type": "string", + "nullable": true + }, + "SortName": { + "type": "string", + "description": "Gets or sets the name of the sort.", + "nullable": true + }, + "ForcedSortName": { + "type": "string", + "nullable": true + }, + "Video3DFormat": { + "enum": [ + "HalfSideBySide", + "FullSideBySide", + "FullTopAndBottom", + "HalfTopAndBottom", + "MVC" + ], + "allOf": [ + { + "$ref": "#/components/schemas/Video3DFormat" + } + ], + "description": "Gets or sets the video3 D format.", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "description": "Gets or sets the premiere date.", + "format": "date-time", + "nullable": true + }, + "ExternalUrls": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalUrl" + }, + "description": "Gets or sets the external urls.", + "nullable": true + }, + "MediaSources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaSourceInfo" + }, + "description": "Gets or sets the media versions.", + "nullable": true + }, + "CriticRating": { + "type": "number", + "description": "Gets or sets the critic rating.", + "format": "float", + "nullable": true + }, + "ProductionLocations": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "EnableMediaSourceDisplay": { + "type": "boolean", + "nullable": true + }, + "OfficialRating": { + "type": "string", + "description": "Gets or sets the official rating.", + "nullable": true + }, + "CustomRating": { + "type": "string", + "description": "Gets or sets the custom rating.", + "nullable": true + }, + "ChannelId": { + "type": "string", + "description": "Gets or sets the channel identifier.", + "format": "uuid", + "nullable": true + }, + "ChannelName": { + "type": "string", + "nullable": true + }, + "Overview": { + "type": "string", + "description": "Gets or sets the overview.", + "nullable": true + }, + "Taglines": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the taglines.", + "nullable": true + }, + "Genres": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the genres.", + "nullable": true + }, + "CommunityRating": { + "type": "number", + "description": "Gets or sets the community rating.", + "format": "float", + "nullable": true + }, + "CumulativeRunTimeTicks": { + "type": "integer", + "description": "Gets or sets the cumulative run time ticks.", + "format": "int64", + "nullable": true + }, + "RunTimeTicks": { + "type": "integer", + "description": "Gets or sets the run time ticks.", + "format": "int64", + "nullable": true + }, + "PlayAccess": { + "enum": [ + "Full", + "None" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayAccess" + } + ], + "description": "Gets or sets the play access.", + "nullable": true + }, + "AspectRatio": { + "type": "string", + "description": "Gets or sets the aspect ratio.", + "nullable": true + }, + "ProductionYear": { + "type": "integer", + "description": "Gets or sets the production year.", + "format": "int32", + "nullable": true + }, + "IsPlaceHolder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is place holder.", + "nullable": true + }, + "Number": { + "type": "string", + "description": "Gets or sets the number.", + "nullable": true + }, + "ChannelNumber": { + "type": "string", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "description": "Gets or sets the index number.", + "format": "int32", + "nullable": true + }, + "IndexNumberEnd": { + "type": "integer", + "description": "Gets or sets the index number end.", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "description": "Gets or sets the parent index number.", + "format": "int32", + "nullable": true + }, + "RemoteTrailers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaUrl" + }, + "description": "Gets or sets the trailer urls.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "IsHD": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is HD.", + "nullable": true + }, + "IsFolder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is folder.", + "nullable": true + }, + "ParentId": { + "type": "string", + "description": "Gets or sets the parent id.", + "format": "uuid", + "nullable": true + }, + "Type": { + "enum": [ + "AggregateFolder", + "Audio", + "AudioBook", + "BasePluginFolder", + "Book", + "BoxSet", + "Channel", + "ChannelFolderItem", + "CollectionFolder", + "Episode", + "Folder", + "Genre", + "ManualPlaylistsFolder", + "Movie", + "LiveTvChannel", + "LiveTvProgram", + "MusicAlbum", + "MusicArtist", + "MusicGenre", + "MusicVideo", + "Person", + "Photo", + "PhotoAlbum", + "Playlist", + "PlaylistsFolder", + "Program", + "Recording", + "Season", + "Series", + "Studio", + "Trailer", + "TvChannel", + "TvProgram", + "UserRootFolder", + "UserView", + "Video", + "Year" + ], + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemKind" + } + ], + "description": "The base item kind." + }, + "People": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemPerson" + }, + "description": "Gets or sets the people.", + "nullable": true + }, + "Studios": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "description": "Gets or sets the studios.", + "nullable": true + }, + "GenreItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "nullable": true + }, + "ParentLogoItemId": { + "type": "string", + "description": "Gets or sets whether the item has a logo, this will hold the Id of the Parent that has one.", + "format": "uuid", + "nullable": true + }, + "ParentBackdropItemId": { + "type": "string", + "description": "Gets or sets whether the item has any backdrops, this will hold the Id of the Parent that has one.", + "format": "uuid", + "nullable": true + }, + "ParentBackdropImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the parent backdrop image tags.", + "nullable": true + }, + "LocalTrailerCount": { + "type": "integer", + "description": "Gets or sets the local trailer count.", + "format": "int32", + "nullable": true + }, + "UserData": { + "allOf": [ + { + "$ref": "#/components/schemas/UserItemDataDto" + } + ], + "description": "Gets or sets the user data for this item based on the user it's being requested for.", + "nullable": true + }, + "RecursiveItemCount": { + "type": "integer", + "description": "Gets or sets the recursive item count.", + "format": "int32", + "nullable": true + }, + "ChildCount": { + "type": "integer", + "description": "Gets or sets the child count.", + "format": "int32", + "nullable": true + }, + "SeriesName": { + "type": "string", + "description": "Gets or sets the name of the series.", + "nullable": true + }, + "SeriesId": { + "type": "string", + "description": "Gets or sets the series id.", + "format": "uuid", + "nullable": true + }, + "SeasonId": { + "type": "string", + "description": "Gets or sets the season identifier.", + "format": "uuid", + "nullable": true + }, + "SpecialFeatureCount": { + "type": "integer", + "description": "Gets or sets the special feature count.", + "format": "int32", + "nullable": true + }, + "DisplayPreferencesId": { + "type": "string", + "description": "Gets or sets the display preferences id.", + "nullable": true + }, + "Status": { + "type": "string", + "description": "Gets or sets the status.", + "nullable": true + }, + "AirTime": { + "type": "string", + "description": "Gets or sets the air time.", + "nullable": true + }, + "AirDays": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DayOfWeek" + }, + "description": "Gets or sets the air days.", + "nullable": true + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the tags.", + "nullable": true + }, + "PrimaryImageAspectRatio": { + "type": "number", + "description": "Gets or sets the primary image aspect ratio, after image enhancements.", + "format": "double", + "nullable": true + }, + "Artists": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the artists.", + "nullable": true + }, + "ArtistItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "description": "Gets or sets the artist items.", + "nullable": true + }, + "Album": { + "type": "string", + "description": "Gets or sets the album.", + "nullable": true + }, + "CollectionType": { + "enum": [ + "unknown", + "movies", + "tvshows", + "music", + "musicvideos", + "trailers", + "homevideos", + "boxsets", + "books", + "photos", + "livetv", + "playlists", + "folders" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CollectionType" + } + ], + "description": "Gets or sets the type of the collection.", + "nullable": true + }, + "DisplayOrder": { + "type": "string", + "description": "Gets or sets the display order.", + "nullable": true + }, + "AlbumId": { + "type": "string", + "description": "Gets or sets the album id.", + "format": "uuid", + "nullable": true + }, + "AlbumPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the album image tag.", + "nullable": true + }, + "SeriesPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the series primary image tag.", + "nullable": true + }, + "AlbumArtist": { + "type": "string", + "description": "Gets or sets the album artist.", + "nullable": true + }, + "AlbumArtists": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "description": "Gets or sets the album artists.", + "nullable": true + }, + "SeasonName": { + "type": "string", + "description": "Gets or sets the name of the season.", + "nullable": true + }, + "MediaStreams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaStream" + }, + "description": "Gets or sets the media streams.", + "nullable": true + }, + "VideoType": { + "enum": [ + "VideoFile", + "Iso", + "Dvd", + "BluRay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/VideoType" + } + ], + "description": "Gets or sets the type of the video.", + "nullable": true + }, + "PartCount": { + "type": "integer", + "description": "Gets or sets the part count.", + "format": "int32", + "nullable": true + }, + "MediaSourceCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ImageTags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Gets or sets the image tags.", + "nullable": true + }, + "BackdropImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the backdrop image tags.", + "nullable": true + }, + "ScreenshotImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the screenshot image tags.", + "nullable": true + }, + "ParentLogoImageTag": { + "type": "string", + "description": "Gets or sets the parent logo image tag.", + "nullable": true + }, + "ParentArtItemId": { + "type": "string", + "description": "Gets or sets whether the item has fan art, this will hold the Id of the Parent that has one.", + "format": "uuid", + "nullable": true + }, + "ParentArtImageTag": { + "type": "string", + "description": "Gets or sets the parent art image tag.", + "nullable": true + }, + "SeriesThumbImageTag": { + "type": "string", + "description": "Gets or sets the series thumb image tag.", + "nullable": true + }, + "ImageBlurHashes": { + "type": "object", + "properties": { + "Primary": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Art": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Backdrop": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Banner": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Logo": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Thumb": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Disc": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Box": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Screenshot": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Menu": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Chapter": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "BoxRear": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Profile": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "Gets or sets the blurhashes for the image tags.\r\nMaps image type to dictionary mapping image tag to blurhash value.", + "nullable": true + }, + "SeriesStudio": { + "type": "string", + "description": "Gets or sets the series studio.", + "nullable": true + }, + "ParentThumbItemId": { + "type": "string", + "description": "Gets or sets the parent thumb item id.", + "format": "uuid", + "nullable": true + }, + "ParentThumbImageTag": { + "type": "string", + "description": "Gets or sets the parent thumb image tag.", + "nullable": true + }, + "ParentPrimaryImageItemId": { + "type": "string", + "description": "Gets or sets the parent primary image item identifier.", + "format": "uuid", + "nullable": true + }, + "ParentPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the parent primary image tag.", + "nullable": true + }, + "Chapters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChapterInfo" + }, + "description": "Gets or sets the chapters.", + "nullable": true + }, + "Trickplay": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/TrickplayInfoDto" + } + }, + "description": "Gets or sets the trickplay manifest.", + "nullable": true + }, + "LocationType": { + "enum": [ + "FileSystem", + "Remote", + "Virtual", + "Offline" + ], + "allOf": [ + { + "$ref": "#/components/schemas/LocationType" + } + ], + "description": "Gets or sets the type of the location.", + "nullable": true + }, + "IsoType": { + "enum": [ + "Dvd", + "BluRay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/IsoType" + } + ], + "description": "Gets or sets the type of the iso.", + "nullable": true + }, + "MediaType": { + "enum": [ + "Unknown", + "Video", + "Audio", + "Photo", + "Book" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaType" + } + ], + "description": "Media types.", + "default": "Unknown" + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date.", + "format": "date-time", + "nullable": true + }, + "LockedFields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetadataField" + }, + "description": "Gets or sets the locked fields.", + "nullable": true + }, + "TrailerCount": { + "type": "integer", + "description": "Gets or sets the trailer count.", + "format": "int32", + "nullable": true + }, + "MovieCount": { + "type": "integer", + "description": "Gets or sets the movie count.", + "format": "int32", + "nullable": true + }, + "SeriesCount": { + "type": "integer", + "description": "Gets or sets the series count.", + "format": "int32", + "nullable": true + }, + "ProgramCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "EpisodeCount": { + "type": "integer", + "description": "Gets or sets the episode count.", + "format": "int32", + "nullable": true + }, + "SongCount": { + "type": "integer", + "description": "Gets or sets the song count.", + "format": "int32", + "nullable": true + }, + "AlbumCount": { + "type": "integer", + "description": "Gets or sets the album count.", + "format": "int32", + "nullable": true + }, + "ArtistCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "MusicVideoCount": { + "type": "integer", + "description": "Gets or sets the music video count.", + "format": "int32", + "nullable": true + }, + "LockData": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [enable internet providers].", + "nullable": true + }, + "Width": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "Height": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "CameraMake": { + "type": "string", + "nullable": true + }, + "CameraModel": { + "type": "string", + "nullable": true + }, + "Software": { + "type": "string", + "nullable": true + }, + "ExposureTime": { + "type": "number", + "format": "double", + "nullable": true + }, + "FocalLength": { + "type": "number", + "format": "double", + "nullable": true + }, + "ImageOrientation": { + "enum": [ + "TopLeft", + "TopRight", + "BottomRight", + "BottomLeft", + "LeftTop", + "RightTop", + "RightBottom", + "LeftBottom" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageOrientation" + } + ], + "nullable": true + }, + "Aperture": { + "type": "number", + "format": "double", + "nullable": true + }, + "ShutterSpeed": { + "type": "number", + "format": "double", + "nullable": true + }, + "Latitude": { + "type": "number", + "format": "double", + "nullable": true + }, + "Longitude": { + "type": "number", + "format": "double", + "nullable": true + }, + "Altitude": { + "type": "number", + "format": "double", + "nullable": true + }, + "IsoSpeedRating": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "SeriesTimerId": { + "type": "string", + "description": "Gets or sets the series timer identifier.", + "nullable": true + }, + "ProgramId": { + "type": "string", + "description": "Gets or sets the program identifier.", + "nullable": true + }, + "ChannelPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the channel primary image tag.", + "nullable": true + }, + "StartDate": { + "type": "string", + "description": "Gets or sets the start date of the recording, in UTC.", + "format": "date-time", + "nullable": true + }, + "CompletionPercentage": { + "type": "number", + "description": "Gets or sets the completion percentage.", + "format": "double", + "nullable": true + }, + "IsRepeat": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is repeat.", + "nullable": true + }, + "EpisodeTitle": { + "type": "string", + "description": "Gets or sets the episode title.", + "nullable": true + }, + "ChannelType": { + "enum": [ + "TV", + "Radio" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ChannelType" + } + ], + "description": "Gets or sets the type of the channel.", + "nullable": true + }, + "Audio": { + "enum": [ + "Mono", + "Stereo", + "Dolby", + "DolbyDigital", + "Thx", + "Atmos" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ProgramAudio" + } + ], + "description": "Gets or sets the audio.", + "nullable": true + }, + "IsMovie": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is movie.", + "nullable": true + }, + "IsSports": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is sports.", + "nullable": true + }, + "IsSeries": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is series.", + "nullable": true + }, + "IsLive": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is live.", + "nullable": true + }, + "IsNews": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is news.", + "nullable": true + }, + "IsKids": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is kids.", + "nullable": true + }, + "IsPremiere": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is premiere.", + "nullable": true + }, + "TimerId": { + "type": "string", + "description": "Gets or sets the timer identifier.", + "nullable": true + }, + "NormalizationGain": { + "type": "number", + "description": "Gets or sets the gain required for audio normalization.", + "format": "float", + "nullable": true + }, + "CurrentProgram": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the current program.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + }, + "BaseItemDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "BaseItemKind": { + "enum": [ + "AggregateFolder", + "Audio", + "AudioBook", + "BasePluginFolder", + "Book", + "BoxSet", + "Channel", + "ChannelFolderItem", + "CollectionFolder", + "Episode", + "Folder", + "Genre", + "ManualPlaylistsFolder", + "Movie", + "LiveTvChannel", + "LiveTvProgram", + "MusicAlbum", + "MusicArtist", + "MusicGenre", + "MusicVideo", + "Person", + "Photo", + "PhotoAlbum", + "Playlist", + "PlaylistsFolder", + "Program", + "Recording", + "Season", + "Series", + "Studio", + "Trailer", + "TvChannel", + "TvProgram", + "UserRootFolder", + "UserView", + "Video", + "Year" + ], + "type": "string", + "description": "The base item kind." + }, + "BaseItemPerson": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "format": "uuid" + }, + "Role": { + "type": "string", + "description": "Gets or sets the role.", + "nullable": true + }, + "Type": { + "enum": [ + "Unknown", + "Actor", + "Director", + "Composer", + "Writer", + "GuestStar", + "Producer", + "Conductor", + "Lyricist", + "Arranger", + "Engineer", + "Mixer", + "Remixer", + "Creator", + "Artist", + "AlbumArtist", + "Author", + "Illustrator", + "Penciller", + "Inker", + "Colorist", + "Letterer", + "CoverArtist", + "Editor", + "Translator" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PersonKind" + } + ], + "description": "The person kind.", + "default": "Unknown" + }, + "PrimaryImageTag": { + "type": "string", + "description": "Gets or sets the primary image tag.", + "nullable": true + }, + "ImageBlurHashes": { + "type": "object", + "properties": { + "Primary": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Art": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Backdrop": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Banner": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Logo": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Thumb": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Disc": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Box": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Screenshot": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Menu": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Chapter": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "BoxRear": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Profile": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "Gets or sets the primary image blurhash.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This is used by the api to get information about a Person within a BaseItem." + }, + "BasePluginConfiguration": { + "type": "object", + "additionalProperties": false, + "description": "Class BasePluginConfiguration." + }, + "BookInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "SeriesName": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "BookInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/BookInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "BoxSetInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "BoxSetInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/BoxSetInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "BrandingOptionsDto": { + "type": "object", + "properties": { + "LoginDisclaimer": { + "type": "string", + "description": "Gets or sets the login disclaimer.", + "nullable": true + }, + "CustomCss": { + "type": "string", + "description": "Gets or sets the custom CSS.", + "nullable": true + }, + "SplashscreenEnabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable the splashscreen." + } + }, + "additionalProperties": false, + "description": "The branding options DTO for API use.\r\nThis DTO excludes SplashscreenLocation to prevent it from being updated via API." + }, + "BufferRequestDto": { + "type": "object", + "properties": { + "When": { + "type": "string", + "description": "Gets or sets when the request has been made by the client.", + "format": "date-time" + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64" + }, + "IsPlaying": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the client playback is unpaused." + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist item identifier of the playing item.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class BufferRequestDto." + }, + "CastReceiverApplication": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the cast receiver application id." + }, + "Name": { + "type": "string", + "description": "Gets or sets the cast receiver application name." + } + }, + "additionalProperties": false, + "description": "The cast receiver application model." + }, + "ChannelFeatures": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "format": "uuid" + }, + "CanSearch": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can search." + }, + "MediaTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelMediaType" + }, + "description": "Gets or sets the media types." + }, + "ContentTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelMediaContentType" + }, + "description": "Gets or sets the content types." + }, + "MaxPageSize": { + "type": "integer", + "description": "Gets or sets the maximum number of records the channel allows retrieving at a time.", + "format": "int32", + "nullable": true + }, + "AutoRefreshLevels": { + "type": "integer", + "description": "Gets or sets the automatic refresh levels.", + "format": "int32", + "nullable": true + }, + "DefaultSortFields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelItemSortField" + }, + "description": "Gets or sets the default sort orders." + }, + "SupportsSortOrderToggle": { + "type": "boolean", + "description": "Gets or sets a value indicating whether a sort ascending/descending toggle is supported." + }, + "SupportsLatestMedia": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports latest media]." + }, + "CanFilter": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can filter." + }, + "SupportsContentDownloading": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports content downloading]." + } + }, + "additionalProperties": false + }, + "ChannelItemSortField": { + "enum": [ + "Name", + "CommunityRating", + "PremiereDate", + "DateCreated", + "Runtime", + "PlayCount", + "CommunityPlayCount" + ], + "type": "string" + }, + "ChannelMappingOptionsDto": { + "type": "object", + "properties": { + "TunerChannels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerChannelMapping" + }, + "description": "Gets or sets list of tuner channels." + }, + "ProviderChannels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + }, + "description": "Gets or sets list of provider channels." + }, + "Mappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameValuePair" + }, + "description": "Gets or sets list of mappings." + }, + "ProviderName": { + "type": "string", + "description": "Gets or sets provider name.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Channel mapping options dto." + }, + "ChannelMediaContentType": { + "enum": [ + "Clip", + "Podcast", + "Trailer", + "Movie", + "Episode", + "Song", + "MovieExtra", + "TvExtra" + ], + "type": "string" + }, + "ChannelMediaType": { + "enum": [ + "Audio", + "Video", + "Photo" + ], + "type": "string" + }, + "ChannelType": { + "enum": [ + "TV", + "Radio" + ], + "type": "string", + "description": "Enum ChannelType." + }, + "ChapterInfo": { + "type": "object", + "properties": { + "StartPositionTicks": { + "type": "integer", + "description": "Gets or sets the start position ticks.", + "format": "int64" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "ImagePath": { + "type": "string", + "description": "Gets or sets the image path.", + "nullable": true + }, + "ImageDateModified": { + "type": "string", + "format": "date-time" + }, + "ImageTag": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class ChapterInfo." + }, + "ClientCapabilitiesDto": { + "type": "object", + "properties": { + "PlayableMediaTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + }, + "description": "Gets or sets the list of playable media types." + }, + "SupportedCommands": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneralCommandType" + }, + "description": "Gets or sets the list of supported commands." + }, + "SupportsMediaControl": { + "type": "boolean", + "description": "Gets or sets a value indicating whether session supports media control." + }, + "SupportsPersistentIdentifier": { + "type": "boolean", + "description": "Gets or sets a value indicating whether session supports a persistent identifier." + }, + "DeviceProfile": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "Gets or sets the device profile.", + "nullable": true + }, + "AppStoreUrl": { + "type": "string", + "description": "Gets or sets the app store url.", + "nullable": true + }, + "IconUrl": { + "type": "string", + "description": "Gets or sets the icon url.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Client capabilities dto." + }, + "ClientLogDocumentResponseDto": { + "type": "object", + "properties": { + "FileName": { + "type": "string", + "description": "Gets the resulting filename." + } + }, + "additionalProperties": false, + "description": "Client log document response dto." + }, + "CodecProfile": { + "type": "object", + "properties": { + "Type": { + "enum": [ + "Video", + "VideoAudio", + "Audio" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CodecType" + } + ], + "description": "Gets or sets the MediaBrowser.Model.Dlna.CodecType which this container must meet." + }, + "Conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + }, + "description": "Gets or sets the list of MediaBrowser.Model.Dlna.ProfileCondition which this profile must meet." + }, + "ApplyConditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + }, + "description": "Gets or sets the list of MediaBrowser.Model.Dlna.ProfileCondition to apply if this profile is met." + }, + "Codec": { + "type": "string", + "description": "Gets or sets the codec(s) that this profile applies to.", + "nullable": true + }, + "Container": { + "type": "string", + "description": "Gets or sets the container(s) which this profile will be applied to.", + "nullable": true + }, + "SubContainer": { + "type": "string", + "description": "Gets or sets the sub-container(s) which this profile will be applied to.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Dlna.CodecProfile." + }, + "CodecType": { + "enum": [ + "Video", + "VideoAudio", + "Audio" + ], + "type": "string" + }, + "CollectionCreationResult": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "CollectionType": { + "enum": [ + "unknown", + "movies", + "tvshows", + "music", + "musicvideos", + "trailers", + "homevideos", + "boxsets", + "books", + "photos", + "livetv", + "playlists", + "folders" + ], + "type": "string", + "description": "Collection type." + }, + "CollectionTypeOptions": { + "enum": [ + "movies", + "tvshows", + "music", + "musicvideos", + "homevideos", + "boxsets", + "books", + "mixed" + ], + "type": "string", + "description": "The collection type options." + }, + "ConfigImageTypes": { + "type": "object", + "properties": { + "BackdropSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "BaseUrl": { + "type": "string", + "nullable": true + }, + "LogoSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "PosterSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ProfileSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "SecureBaseUrl": { + "type": "string", + "nullable": true + }, + "StillSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "ConfigurationPageInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "EnableInMainMenu": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the configurations page is enabled in the main menu." + }, + "MenuSection": { + "type": "string", + "description": "Gets or sets the menu section.", + "nullable": true + }, + "MenuIcon": { + "type": "string", + "description": "Gets or sets the menu icon.", + "nullable": true + }, + "DisplayName": { + "type": "string", + "description": "Gets or sets the display name.", + "nullable": true + }, + "PluginId": { + "type": "string", + "description": "Gets or sets the plugin id.", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The configuration page info." + }, + "ContainerProfile": { + "type": "object", + "properties": { + "Type": { + "enum": [ + "Audio", + "Video", + "Photo", + "Subtitle", + "Lyric" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DlnaProfileType" + } + ], + "description": "Gets or sets the MediaBrowser.Model.Dlna.DlnaProfileType which this container must meet." + }, + "Conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + }, + "description": "Gets or sets the list of MediaBrowser.Model.Dlna.ProfileCondition which this container will be applied to." + }, + "Container": { + "type": "string", + "description": "Gets or sets the container(s) which this container must meet.", + "nullable": true + }, + "SubContainer": { + "type": "string", + "description": "Gets or sets the sub container(s) which this container must meet.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Dlna.ContainerProfile." + }, + "CountryInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "DisplayName": { + "type": "string", + "description": "Gets or sets the display name.", + "nullable": true + }, + "TwoLetterISORegionName": { + "type": "string", + "description": "Gets or sets the name of the two letter ISO region.", + "nullable": true + }, + "ThreeLetterISORegionName": { + "type": "string", + "description": "Gets or sets the name of the three letter ISO region.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class CountryInfo." + }, + "CreatePlaylistDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name of the new playlist." + }, + "Ids": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets item ids to add to the playlist." + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid", + "nullable": true + }, + "MediaType": { + "enum": [ + "Unknown", + "Video", + "Audio", + "Photo", + "Book" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaType" + } + ], + "description": "Gets or sets the media type.", + "nullable": true + }, + "Users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + }, + "description": "Gets or sets the playlist users." + }, + "IsPublic": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the playlist is public." + } + }, + "additionalProperties": false, + "description": "Create new playlist dto." + }, + "CreateUserByName": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the username." + }, + "Password": { + "type": "string", + "description": "Gets or sets the password.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The create user by name request body." + }, + "CultureDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets the name." + }, + "DisplayName": { + "type": "string", + "description": "Gets the display name." + }, + "TwoLetterISOLanguageName": { + "type": "string", + "description": "Gets the name of the two letter ISO language." + }, + "ThreeLetterISOLanguageName": { + "type": "string", + "description": "Gets the name of the three letter ISO language.", + "nullable": true, + "readOnly": true + }, + "ThreeLetterISOLanguageNames": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "description": "Class CultureDto." + }, + "CustomDatabaseOption": { + "type": "object", + "properties": { + "Key": { + "type": "string", + "description": "Gets or sets the key of the value." + }, + "Value": { + "type": "string", + "description": "Gets or sets the value." + } + }, + "additionalProperties": false, + "description": "The custom value option for custom database providers." + }, + "CustomDatabaseOptions": { + "type": "object", + "properties": { + "PluginName": { + "type": "string", + "description": "Gets or sets the Plugin name to search for database providers." + }, + "PluginAssembly": { + "type": "string", + "description": "Gets or sets the plugin assembly to search for providers." + }, + "ConnectionString": { + "type": "string", + "description": "Gets or sets the connection string for the custom database provider." + }, + "Options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomDatabaseOption" + }, + "description": "Gets or sets the list of extra options for the custom provider." + } + }, + "additionalProperties": false, + "description": "Defines the options for a custom database connector." + }, + "DatabaseConfigurationOptions": { + "type": "object", + "properties": { + "DatabaseType": { + "type": "string", + "description": "Gets or Sets the type of database jellyfin should use." + }, + "CustomProviderOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/CustomDatabaseOptions" + } + ], + "description": "Gets or sets the options required to use a custom database provider.", + "nullable": true + }, + "LockingBehavior": { + "enum": [ + "NoLock", + "Pessimistic", + "Optimistic" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DatabaseLockingBehaviorTypes" + } + ], + "description": "Gets or Sets the kind of locking behavior jellyfin should perform. Possible options are \"NoLock\", \"Pessimistic\", \"Optimistic\".\r\nDefaults to \"NoLock\"." + } + }, + "additionalProperties": false, + "description": "Options to configure jellyfins managed database." + }, + "DatabaseLockingBehaviorTypes": { + "enum": [ + "NoLock", + "Pessimistic", + "Optimistic" + ], + "type": "string", + "description": "Defines all possible methods for locking database access for concurrent queries." + }, + "DayOfWeek": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + "type": "string" + }, + "DayPattern": { + "enum": [ + "Daily", + "Weekdays", + "Weekends" + ], + "type": "string" + }, + "DefaultDirectoryBrowserInfoDto": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Default directory browser info." + }, + "DeinterlaceMethod": { + "enum": [ + "yadif", + "bwdif" + ], + "type": "string", + "description": "Enum containing deinterlace methods." + }, + "DeviceInfoDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "CustomName": { + "type": "string", + "description": "Gets or sets the custom name.", + "nullable": true + }, + "AccessToken": { + "type": "string", + "description": "Gets or sets the access token.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "nullable": true + }, + "LastUserName": { + "type": "string", + "description": "Gets or sets the last name of the user.", + "nullable": true + }, + "AppName": { + "type": "string", + "description": "Gets or sets the name of the application.", + "nullable": true + }, + "AppVersion": { + "type": "string", + "description": "Gets or sets the application version.", + "nullable": true + }, + "LastUserId": { + "type": "string", + "description": "Gets or sets the last user identifier.", + "format": "uuid", + "nullable": true + }, + "DateLastActivity": { + "type": "string", + "description": "Gets or sets the date last modified.", + "format": "date-time", + "nullable": true + }, + "Capabilities": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Gets or sets the capabilities." + }, + "IconUrl": { + "type": "string", + "description": "Gets or sets the icon URL.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "A DTO representing device information." + }, + "DeviceInfoDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeviceInfoDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "DeviceOptionsDto": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets or sets the id.", + "format": "int32" + }, + "DeviceId": { + "type": "string", + "description": "Gets or sets the device id.", + "nullable": true + }, + "CustomName": { + "type": "string", + "description": "Gets or sets the custom name.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "A dto representing custom options for a device." + }, + "DeviceProfile": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name of this device profile. User profiles must have a unique name.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the unique internal identifier.", + "format": "uuid", + "nullable": true + }, + "MaxStreamingBitrate": { + "type": "integer", + "description": "Gets or sets the maximum allowed bitrate for all streamed content.", + "format": "int32", + "nullable": true + }, + "MaxStaticBitrate": { + "type": "integer", + "description": "Gets or sets the maximum allowed bitrate for statically streamed content (= direct played files).", + "format": "int32", + "nullable": true + }, + "MusicStreamingTranscodingBitrate": { + "type": "integer", + "description": "Gets or sets the maximum allowed bitrate for transcoded music streams.", + "format": "int32", + "nullable": true + }, + "MaxStaticMusicBitrate": { + "type": "integer", + "description": "Gets or sets the maximum allowed bitrate for statically streamed (= direct played) music files.", + "format": "int32", + "nullable": true + }, + "DirectPlayProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DirectPlayProfile" + }, + "description": "Gets or sets the direct play profiles." + }, + "TranscodingProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TranscodingProfile" + }, + "description": "Gets or sets the transcoding profiles." + }, + "ContainerProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerProfile" + }, + "description": "Gets or sets the container profiles. Failing to meet these optional conditions causes transcoding to occur." + }, + "CodecProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CodecProfile" + }, + "description": "Gets or sets the codec profiles." + }, + "SubtitleProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubtitleProfile" + }, + "description": "Gets or sets the subtitle profiles." + } + }, + "additionalProperties": false, + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + }, + "DirectPlayProfile": { + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "Gets or sets the container." + }, + "AudioCodec": { + "type": "string", + "description": "Gets or sets the audio codec.", + "nullable": true + }, + "VideoCodec": { + "type": "string", + "description": "Gets or sets the video codec.", + "nullable": true + }, + "Type": { + "enum": [ + "Audio", + "Video", + "Photo", + "Subtitle", + "Lyric" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DlnaProfileType" + } + ], + "description": "Gets or sets the Dlna profile type." + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Dlna.DirectPlayProfile." + }, + "DisplayPreferencesDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the user id.", + "nullable": true + }, + "ViewType": { + "type": "string", + "description": "Gets or sets the type of the view.", + "nullable": true + }, + "SortBy": { + "type": "string", + "description": "Gets or sets the sort by.", + "nullable": true + }, + "IndexBy": { + "type": "string", + "description": "Gets or sets the index by.", + "nullable": true + }, + "RememberIndexing": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [remember indexing]." + }, + "PrimaryImageHeight": { + "type": "integer", + "description": "Gets or sets the height of the primary image.", + "format": "int32" + }, + "PrimaryImageWidth": { + "type": "integer", + "description": "Gets or sets the width of the primary image.", + "format": "int32" + }, + "CustomPrefs": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the custom prefs." + }, + "ScrollDirection": { + "enum": [ + "Horizontal", + "Vertical" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ScrollDirection" + } + ], + "description": "Gets or sets the scroll direction." + }, + "ShowBackdrop": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to show backdrops on this item." + }, + "RememberSorting": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [remember sorting]." + }, + "SortOrder": { + "enum": [ + "Ascending", + "Descending" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SortOrder" + } + ], + "description": "Gets or sets the sort order." + }, + "ShowSidebar": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [show sidebar]." + }, + "Client": { + "type": "string", + "description": "Gets or sets the client.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Defines the display preferences for any item that supports them (usually Folders)." + }, + "DlnaProfileType": { + "enum": [ + "Audio", + "Video", + "Photo", + "Subtitle", + "Lyric" + ], + "type": "string" + }, + "DownMixStereoAlgorithms": { + "enum": [ + "None", + "Dave750", + "NightmodeDialogue", + "Rfc7845", + "Ac4" + ], + "type": "string", + "description": "An enum representing an algorithm to downmix surround sound to stereo." + }, + "DynamicDayOfWeek": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Everyday", + "Weekday", + "Weekend" + ], + "type": "string", + "description": "An enum that represents a day of the week, weekdays, weekends, or all days." + }, + "EmbeddedSubtitleOptions": { + "enum": [ + "AllowAll", + "AllowText", + "AllowImage", + "AllowNone" + ], + "type": "string", + "description": "An enum representing the options to disable embedded subs." + }, + "EncoderPreset": { + "enum": [ + "auto", + "placebo", + "veryslow", + "slower", + "slow", + "medium", + "fast", + "faster", + "veryfast", + "superfast", + "ultrafast" + ], + "type": "string", + "description": "Enum containing encoder presets." + }, + "EncodingContext": { + "enum": [ + "Streaming", + "Static" + ], + "type": "string" + }, + "EncodingOptions": { + "type": "object", + "properties": { + "EncodingThreadCount": { + "type": "integer", + "description": "Gets or sets the thread count used for encoding.", + "format": "int32" + }, + "TranscodingTempPath": { + "type": "string", + "description": "Gets or sets the temporary transcoding path.", + "nullable": true + }, + "FallbackFontPath": { + "type": "string", + "description": "Gets or sets the path to the fallback font.", + "nullable": true + }, + "EnableFallbackFont": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to use the fallback font." + }, + "EnableAudioVbr": { + "type": "boolean", + "description": "Gets or sets a value indicating whether audio VBR is enabled." + }, + "DownMixAudioBoost": { + "type": "number", + "description": "Gets or sets the audio boost applied when downmixing audio.", + "format": "double" + }, + "DownMixStereoAlgorithm": { + "enum": [ + "None", + "Dave750", + "NightmodeDialogue", + "Rfc7845", + "Ac4" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DownMixStereoAlgorithms" + } + ], + "description": "Gets or sets the algorithm used for downmixing audio to stereo." + }, + "MaxMuxingQueueSize": { + "type": "integer", + "description": "Gets or sets the maximum size of the muxing queue.", + "format": "int32" + }, + "EnableThrottling": { + "type": "boolean", + "description": "Gets or sets a value indicating whether throttling is enabled." + }, + "ThrottleDelaySeconds": { + "type": "integer", + "description": "Gets or sets the delay after which throttling happens.", + "format": "int32" + }, + "EnableSegmentDeletion": { + "type": "boolean", + "description": "Gets or sets a value indicating whether segment deletion is enabled." + }, + "SegmentKeepSeconds": { + "type": "integer", + "description": "Gets or sets seconds for which segments should be kept before being deleted.", + "format": "int32" + }, + "HardwareAccelerationType": { + "enum": [ + "none", + "amf", + "qsv", + "nvenc", + "v4l2m2m", + "vaapi", + "videotoolbox", + "rkmpp" + ], + "allOf": [ + { + "$ref": "#/components/schemas/HardwareAccelerationType" + } + ], + "description": "Gets or sets the hardware acceleration type." + }, + "EncoderAppPath": { + "type": "string", + "description": "Gets or sets the FFmpeg path as set by the user via the UI.", + "nullable": true + }, + "EncoderAppPathDisplay": { + "type": "string", + "description": "Gets or sets the current FFmpeg path being used by the system and displayed on the transcode page.", + "nullable": true + }, + "VaapiDevice": { + "type": "string", + "description": "Gets or sets the VA-API device.", + "nullable": true + }, + "QsvDevice": { + "type": "string", + "description": "Gets or sets the QSV device.", + "nullable": true + }, + "EnableTonemapping": { + "type": "boolean", + "description": "Gets or sets a value indicating whether tonemapping is enabled." + }, + "EnableVppTonemapping": { + "type": "boolean", + "description": "Gets or sets a value indicating whether VPP tonemapping is enabled." + }, + "EnableVideoToolboxTonemapping": { + "type": "boolean", + "description": "Gets or sets a value indicating whether videotoolbox tonemapping is enabled." + }, + "TonemappingAlgorithm": { + "enum": [ + "none", + "clip", + "linear", + "gamma", + "reinhard", + "hable", + "mobius", + "bt2390" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TonemappingAlgorithm" + } + ], + "description": "Gets or sets the tone-mapping algorithm." + }, + "TonemappingMode": { + "enum": [ + "auto", + "max", + "rgb", + "lum", + "itp" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TonemappingMode" + } + ], + "description": "Gets or sets the tone-mapping mode." + }, + "TonemappingRange": { + "enum": [ + "auto", + "tv", + "pc" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TonemappingRange" + } + ], + "description": "Gets or sets the tone-mapping range." + }, + "TonemappingDesat": { + "type": "number", + "description": "Gets or sets the tone-mapping desaturation.", + "format": "double" + }, + "TonemappingPeak": { + "type": "number", + "description": "Gets or sets the tone-mapping peak.", + "format": "double" + }, + "TonemappingParam": { + "type": "number", + "description": "Gets or sets the tone-mapping parameters.", + "format": "double" + }, + "VppTonemappingBrightness": { + "type": "number", + "description": "Gets or sets the VPP tone-mapping brightness.", + "format": "double" + }, + "VppTonemappingContrast": { + "type": "number", + "description": "Gets or sets the VPP tone-mapping contrast.", + "format": "double" + }, + "H264Crf": { + "type": "integer", + "description": "Gets or sets the H264 CRF.", + "format": "int32" + }, + "H265Crf": { + "type": "integer", + "description": "Gets or sets the H265 CRF.", + "format": "int32" + }, + "EncoderPreset": { + "enum": [ + "auto", + "placebo", + "veryslow", + "slower", + "slow", + "medium", + "fast", + "faster", + "veryfast", + "superfast", + "ultrafast" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncoderPreset" + } + ], + "description": "Gets or sets the encoder preset.", + "nullable": true + }, + "DeinterlaceDoubleRate": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the framerate is doubled when deinterlacing." + }, + "DeinterlaceMethod": { + "enum": [ + "yadif", + "bwdif" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DeinterlaceMethod" + } + ], + "description": "Gets or sets the deinterlace method." + }, + "EnableDecodingColorDepth10Hevc": { + "type": "boolean", + "description": "Gets or sets a value indicating whether 10bit HEVC decoding is enabled." + }, + "EnableDecodingColorDepth10Vp9": { + "type": "boolean", + "description": "Gets or sets a value indicating whether 10bit VP9 decoding is enabled." + }, + "EnableDecodingColorDepth10HevcRext": { + "type": "boolean", + "description": "Gets or sets a value indicating whether 8/10bit HEVC RExt decoding is enabled." + }, + "EnableDecodingColorDepth12HevcRext": { + "type": "boolean", + "description": "Gets or sets a value indicating whether 12bit HEVC RExt decoding is enabled." + }, + "EnableEnhancedNvdecDecoder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the enhanced NVDEC is enabled." + }, + "PreferSystemNativeHwDecoder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the system native hardware decoder should be used." + }, + "EnableIntelLowPowerH264HwEncoder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the Intel H264 low-power hardware encoder should be used." + }, + "EnableIntelLowPowerHevcHwEncoder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the Intel HEVC low-power hardware encoder should be used." + }, + "EnableHardwareEncoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether hardware encoding is enabled." + }, + "AllowHevcEncoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether HEVC encoding is enabled." + }, + "AllowAv1Encoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether AV1 encoding is enabled." + }, + "EnableSubtitleExtraction": { + "type": "boolean", + "description": "Gets or sets a value indicating whether subtitle extraction is enabled." + }, + "HardwareDecodingCodecs": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the codecs hardware encoding is used for.", + "nullable": true + }, + "AllowOnDemandMetadataBasedKeyframeExtractionForExtensions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the file extensions on-demand metadata based keyframe extraction is enabled for.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class EncodingOptions." + }, + "EndPointInfo": { + "type": "object", + "properties": { + "IsLocal": { + "type": "boolean" + }, + "IsInNetwork": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "ExternalIdInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the display name of the external id provider (IE: IMDB, MusicBrainz, etc)." + }, + "Key": { + "type": "string", + "description": "Gets or sets the unique key for this id. This key should be unique across all providers." + }, + "Type": { + "enum": [ + "Album", + "AlbumArtist", + "Artist", + "BoxSet", + "Episode", + "Movie", + "OtherArtist", + "Person", + "ReleaseGroup", + "Season", + "Series", + "Track", + "Book", + "Recording" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ExternalIdMediaType" + } + ], + "description": "Gets or sets the specific media type for this id. This is used to distinguish between the different\r\nexternal id types for providers with multiple ids.\r\nA null value indicates there is no specific media type associated with the external id, or this is the\r\ndefault id for the external provider so there is no need to specify a type.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Represents the external id information for serialization to the client." + }, + "ExternalIdMediaType": { + "enum": [ + "Album", + "AlbumArtist", + "Artist", + "BoxSet", + "Episode", + "Movie", + "OtherArtist", + "Person", + "ReleaseGroup", + "Season", + "Series", + "Track", + "Book", + "Recording" + ], + "type": "string", + "description": "The specific media type of an MediaBrowser.Model.Providers.ExternalIdInfo." + }, + "ExternalUrl": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Url": { + "type": "string", + "description": "Gets or sets the type of the item.", + "nullable": true + } + }, + "additionalProperties": false + }, + "ExtraType": { + "enum": [ + "Unknown", + "Clip", + "Trailer", + "BehindTheScenes", + "DeletedScene", + "Interview", + "Scene", + "Sample", + "ThemeSong", + "ThemeVideo", + "Featurette", + "Short" + ], + "type": "string" + }, + "FileSystemEntryInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets the name." + }, + "Path": { + "type": "string", + "description": "Gets the path." + }, + "Type": { + "enum": [ + "File", + "Directory", + "NetworkComputer", + "NetworkShare" + ], + "allOf": [ + { + "$ref": "#/components/schemas/FileSystemEntryType" + } + ], + "description": "Gets the type." + } + }, + "additionalProperties": false, + "description": "Class FileSystemEntryInfo." + }, + "FileSystemEntryType": { + "enum": [ + "File", + "Directory", + "NetworkComputer", + "NetworkShare" + ], + "type": "string", + "description": "Enum FileSystemEntryType." + }, + "FolderStorageDto": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Gets the path of the folder in question." + }, + "FreeSpace": { + "type": "integer", + "description": "Gets the free space of the underlying storage device of the Jellyfin.Api.Models.SystemInfoDtos.FolderStorageDto.Path.", + "format": "int64" + }, + "UsedSpace": { + "type": "integer", + "description": "Gets the used space of the underlying storage device of the Jellyfin.Api.Models.SystemInfoDtos.FolderStorageDto.Path.", + "format": "int64" + }, + "StorageType": { + "type": "string", + "description": "Gets the kind of storage device of the Jellyfin.Api.Models.SystemInfoDtos.FolderStorageDto.Path.", + "nullable": true + }, + "DeviceId": { + "type": "string", + "description": "Gets the Device Identifier.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Contains information about a specific folder." + }, + "FontFile": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Size": { + "type": "integer", + "description": "Gets or sets the size.", + "format": "int64" + }, + "DateCreated": { + "type": "string", + "description": "Gets or sets the date created.", + "format": "date-time" + }, + "DateModified": { + "type": "string", + "description": "Gets or sets the date modified.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Class FontFile." + }, + "ForceKeepAliveMessage": { + "type": "object", + "properties": { + "Data": { + "type": "integer", + "description": "Gets or sets the data.", + "format": "int32" + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ForceKeepAlive", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Force keep alive websocket messages." + }, + "ForgotPasswordAction": { + "enum": [ + "ContactAdmin", + "PinCode", + "InNetworkRequired" + ], + "type": "string" + }, + "ForgotPasswordDto": { + "required": [ + "EnteredUsername" + ], + "type": "object", + "properties": { + "EnteredUsername": { + "type": "string", + "description": "Gets or sets the entered username to have its password reset." + } + }, + "additionalProperties": false, + "description": "Forgot Password request body DTO." + }, + "ForgotPasswordPinDto": { + "required": [ + "Pin" + ], + "type": "object", + "properties": { + "Pin": { + "type": "string", + "description": "Gets or sets the entered pin to have the password reset." + } + }, + "additionalProperties": false, + "description": "Forgot Password Pin enter request body DTO." + }, + "ForgotPasswordResult": { + "type": "object", + "properties": { + "Action": { + "enum": [ + "ContactAdmin", + "PinCode", + "InNetworkRequired" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordAction" + } + ], + "description": "Gets or sets the action." + }, + "PinFile": { + "type": "string", + "description": "Gets or sets the pin file.", + "nullable": true + }, + "PinExpirationDate": { + "type": "string", + "description": "Gets or sets the pin expiration date.", + "format": "date-time", + "nullable": true + } + }, + "additionalProperties": false + }, + "GeneralCommand": { + "type": "object", + "properties": { + "Name": { + "enum": [ + "MoveUp", + "MoveDown", + "MoveLeft", + "MoveRight", + "PageUp", + "PageDown", + "PreviousLetter", + "NextLetter", + "ToggleOsd", + "ToggleContextMenu", + "Select", + "Back", + "TakeScreenshot", + "SendKey", + "SendString", + "GoHome", + "GoToSettings", + "VolumeUp", + "VolumeDown", + "Mute", + "Unmute", + "ToggleMute", + "SetVolume", + "SetAudioStreamIndex", + "SetSubtitleStreamIndex", + "ToggleFullscreen", + "DisplayContent", + "GoToSearch", + "DisplayMessage", + "SetRepeatMode", + "ChannelUp", + "ChannelDown", + "Guide", + "ToggleStats", + "PlayMediaSource", + "PlayTrailers", + "SetShuffleQueue", + "PlayState", + "PlayNext", + "ToggleOsdMenu", + "Play", + "SetMaxStreamingBitrate", + "SetPlaybackOrder" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommandType" + } + ], + "description": "This exists simply to identify a set of known commands." + }, + "ControllingUserId": { + "type": "string", + "format": "uuid" + }, + "Arguments": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + "additionalProperties": false + }, + "GeneralCommandMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommand" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "GeneralCommand", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "General command websocket message." + }, + "GeneralCommandType": { + "enum": [ + "MoveUp", + "MoveDown", + "MoveLeft", + "MoveRight", + "PageUp", + "PageDown", + "PreviousLetter", + "NextLetter", + "ToggleOsd", + "ToggleContextMenu", + "Select", + "Back", + "TakeScreenshot", + "SendKey", + "SendString", + "GoHome", + "GoToSettings", + "VolumeUp", + "VolumeDown", + "Mute", + "Unmute", + "ToggleMute", + "SetVolume", + "SetAudioStreamIndex", + "SetSubtitleStreamIndex", + "ToggleFullscreen", + "DisplayContent", + "GoToSearch", + "DisplayMessage", + "SetRepeatMode", + "ChannelUp", + "ChannelDown", + "Guide", + "ToggleStats", + "PlayMediaSource", + "PlayTrailers", + "SetShuffleQueue", + "PlayState", + "PlayNext", + "ToggleOsdMenu", + "Play", + "SetMaxStreamingBitrate", + "SetPlaybackOrder" + ], + "type": "string", + "description": "This exists simply to identify a set of known commands." + }, + "GetProgramsDto": { + "type": "object", + "properties": { + "ChannelIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the channels to return guide information for.", + "nullable": true + }, + "UserId": { + "type": "string", + "description": "Gets or sets optional. Filter by user id.", + "format": "uuid", + "nullable": true + }, + "MinStartDate": { + "type": "string", + "description": "Gets or sets the minimum premiere start date.", + "format": "date-time", + "nullable": true + }, + "HasAired": { + "type": "boolean", + "description": "Gets or sets filter by programs that have completed airing, or not.", + "nullable": true + }, + "IsAiring": { + "type": "boolean", + "description": "Gets or sets filter by programs that are currently airing, or not.", + "nullable": true + }, + "MaxStartDate": { + "type": "string", + "description": "Gets or sets the maximum premiere start date.", + "format": "date-time", + "nullable": true + }, + "MinEndDate": { + "type": "string", + "description": "Gets or sets the minimum premiere end date.", + "format": "date-time", + "nullable": true + }, + "MaxEndDate": { + "type": "string", + "description": "Gets or sets the maximum premiere end date.", + "format": "date-time", + "nullable": true + }, + "IsMovie": { + "type": "boolean", + "description": "Gets or sets filter for movies.", + "nullable": true + }, + "IsSeries": { + "type": "boolean", + "description": "Gets or sets filter for series.", + "nullable": true + }, + "IsNews": { + "type": "boolean", + "description": "Gets or sets filter for news.", + "nullable": true + }, + "IsKids": { + "type": "boolean", + "description": "Gets or sets filter for kids.", + "nullable": true + }, + "IsSports": { + "type": "boolean", + "description": "Gets or sets filter for sports.", + "nullable": true + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the record index to start at. All items with a lower index will be dropped from the results.", + "format": "int32", + "nullable": true + }, + "Limit": { + "type": "integer", + "description": "Gets or sets the maximum number of records to return.", + "format": "int32", + "nullable": true + }, + "SortBy": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + }, + "description": "Gets or sets specify one or more sort orders, comma delimited. Options: Name, StartDate.", + "nullable": true + }, + "SortOrder": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + }, + "description": "Gets or sets sort order.", + "nullable": true + }, + "Genres": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the genres to return guide information for.", + "nullable": true + }, + "GenreIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the genre ids to return guide information for.", + "nullable": true + }, + "EnableImages": { + "type": "boolean", + "description": "Gets or sets include image information in output.", + "nullable": true + }, + "EnableTotalRecordCount": { + "type": "boolean", + "description": "Gets or sets a value indicating whether retrieve total record count.", + "default": true + }, + "ImageTypeLimit": { + "type": "integer", + "description": "Gets or sets the max number of images to return, per image type.", + "format": "int32", + "nullable": true + }, + "EnableImageTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + }, + "description": "Gets or sets the image types to include in the output.", + "nullable": true + }, + "EnableUserData": { + "type": "boolean", + "description": "Gets or sets include user data.", + "nullable": true + }, + "SeriesTimerId": { + "type": "string", + "description": "Gets or sets filter by series timer id.", + "nullable": true + }, + "LibrarySeriesId": { + "type": "string", + "description": "Gets or sets filter by library series id.", + "format": "uuid", + "nullable": true + }, + "Fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + }, + "description": "Gets or sets specify additional fields of information to return in the output.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Get programs dto." + }, + "GroupInfoDto": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid" + }, + "GroupName": { + "type": "string", + "description": "Gets the group name." + }, + "State": { + "enum": [ + "Idle", + "Waiting", + "Paused", + "Playing" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupStateType" + } + ], + "description": "Gets the group state." + }, + "Participants": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets the participants." + }, + "LastUpdatedAt": { + "type": "string", + "description": "Gets the date when this DTO has been created.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Class GroupInfoDto." + }, + "GroupQueueMode": { + "enum": [ + "Queue", + "QueueNext" + ], + "type": "string", + "description": "Enum GroupQueueMode." + }, + "GroupRepeatMode": { + "enum": [ + "RepeatOne", + "RepeatAll", + "RepeatNone" + ], + "type": "string", + "description": "Enum GroupRepeatMode." + }, + "GroupShuffleMode": { + "enum": [ + "Sorted", + "Shuffle" + ], + "type": "string", + "description": "Enum GroupShuffleMode." + }, + "GroupStateType": { + "enum": [ + "Idle", + "Waiting", + "Paused", + "Playing" + ], + "type": "string", + "description": "Enum GroupState." + }, + "GroupStateUpdate": { + "type": "object", + "properties": { + "State": { + "enum": [ + "Idle", + "Waiting", + "Paused", + "Playing" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupStateType" + } + ], + "description": "Gets the state of the group." + }, + "Reason": { + "enum": [ + "Play", + "SetPlaylistItem", + "RemoveFromPlaylist", + "MovePlaylistItem", + "Queue", + "Unpause", + "Pause", + "Stop", + "Seek", + "Buffer", + "Ready", + "NextItem", + "PreviousItem", + "SetRepeatMode", + "SetShuffleMode", + "Ping", + "IgnoreWait" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackRequestType" + } + ], + "description": "Gets the reason of the state change." + } + }, + "additionalProperties": false, + "description": "Class GroupStateUpdate." + }, + "GroupUpdate": { + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/SyncPlayGroupDoesNotExistUpdate" + }, + { + "$ref": "#/components/schemas/SyncPlayGroupJoinedUpdate" + }, + { + "$ref": "#/components/schemas/SyncPlayGroupLeftUpdate" + }, + { + "$ref": "#/components/schemas/SyncPlayLibraryAccessDeniedUpdate" + }, + { + "$ref": "#/components/schemas/SyncPlayNotInGroupUpdate" + }, + { + "$ref": "#/components/schemas/SyncPlayPlayQueueUpdate" + }, + { + "$ref": "#/components/schemas/SyncPlayStateUpdate" + }, + { + "$ref": "#/components/schemas/SyncPlayUserJoinedUpdate" + }, + { + "$ref": "#/components/schemas/SyncPlayUserLeftUpdate" + } + ], + "description": "Represents the list of possible group update types", + "discriminator": { + "propertyName": "Type", + "mapping": { + "GroupDoesNotExist": "#/components/schemas/SyncPlayGroupDoesNotExistUpdate", + "GroupJoined": "#/components/schemas/SyncPlayGroupJoinedUpdate", + "GroupLeft": "#/components/schemas/SyncPlayGroupLeftUpdate", + "LibraryAccessDenied": "#/components/schemas/SyncPlayLibraryAccessDeniedUpdate", + "NotInGroup": "#/components/schemas/SyncPlayNotInGroupUpdate", + "PlayQueue": "#/components/schemas/SyncPlayPlayQueueUpdate", + "StateUpdate": "#/components/schemas/SyncPlayStateUpdate", + "UserJoined": "#/components/schemas/SyncPlayUserJoinedUpdate", + "UserLeft": "#/components/schemas/SyncPlayUserLeftUpdate" + } + } + }, + "GroupUpdateType": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "type": "string", + "description": "Enum GroupUpdateType." + }, + "GuideInfo": { + "type": "object", + "properties": { + "StartDate": { + "type": "string", + "description": "Gets or sets the start date.", + "format": "date-time" + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date.", + "format": "date-time" + } + }, + "additionalProperties": false + }, + "HardwareAccelerationType": { + "enum": [ + "none", + "amf", + "qsv", + "nvenc", + "v4l2m2m", + "vaapi", + "videotoolbox", + "rkmpp" + ], + "type": "string", + "description": "Enum containing hardware acceleration types." + }, + "IgnoreWaitRequestDto": { + "type": "object", + "properties": { + "IgnoreWait": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the client should be ignored." + } + }, + "additionalProperties": false, + "description": "Class IgnoreWaitRequestDto." + }, + "ImageFormat": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "type": "string", + "description": "Enum ImageOutputFormat." + }, + "ImageInfo": { + "type": "object", + "properties": { + "ImageType": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Gets or sets the type of the image." + }, + "ImageIndex": { + "type": "integer", + "description": "Gets or sets the index of the image.", + "format": "int32", + "nullable": true + }, + "ImageTag": { + "type": "string", + "description": "Gets or sets the image tag.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "BlurHash": { + "type": "string", + "description": "Gets or sets the blurhash.", + "nullable": true + }, + "Height": { + "type": "integer", + "description": "Gets or sets the height.", + "format": "int32", + "nullable": true + }, + "Width": { + "type": "integer", + "description": "Gets or sets the width.", + "format": "int32", + "nullable": true + }, + "Size": { + "type": "integer", + "description": "Gets or sets the size.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Class ImageInfo." + }, + "ImageOption": { + "type": "object", + "properties": { + "Type": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Gets or sets the type." + }, + "Limit": { + "type": "integer", + "description": "Gets or sets the limit.", + "format": "int32" + }, + "MinWidth": { + "type": "integer", + "description": "Gets or sets the minimum width.", + "format": "int32" + } + }, + "additionalProperties": false + }, + "ImageOrientation": { + "enum": [ + "TopLeft", + "TopRight", + "BottomRight", + "BottomLeft", + "LeftTop", + "RightTop", + "RightBottom", + "LeftBottom" + ], + "type": "string" + }, + "ImageProviderInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets the name." + }, + "SupportedImages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + }, + "description": "Gets the supported image types." + } + }, + "additionalProperties": false, + "description": "Class ImageProviderInfo." + }, + "ImageResolution": { + "enum": [ + "MatchSource", + "P144", + "P240", + "P360", + "P480", + "P720", + "P1080", + "P1440", + "P2160" + ], + "type": "string", + "description": "Enum ImageResolution." + }, + "ImageSavingConvention": { + "enum": [ + "Legacy", + "Compatible" + ], + "type": "string" + }, + "ImageType": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "type": "string", + "description": "Enum ImageType." + }, + "InboundKeepAliveMessage": { + "type": "object", + "properties": { + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "KeepAlive", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Keep alive websocket messages." + }, + "InboundWebSocketMessage": { + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/ActivityLogEntryStartMessage" + }, + { + "$ref": "#/components/schemas/ActivityLogEntryStopMessage" + }, + { + "$ref": "#/components/schemas/InboundKeepAliveMessage" + }, + { + "$ref": "#/components/schemas/ScheduledTasksInfoStartMessage" + }, + { + "$ref": "#/components/schemas/ScheduledTasksInfoStopMessage" + }, + { + "$ref": "#/components/schemas/SessionsStartMessage" + }, + { + "$ref": "#/components/schemas/SessionsStopMessage" + } + ], + "description": "Represents the list of possible inbound websocket types", + "discriminator": { + "propertyName": "MessageType", + "mapping": { + "ActivityLogEntryStart": "#/components/schemas/ActivityLogEntryStartMessage", + "ActivityLogEntryStop": "#/components/schemas/ActivityLogEntryStopMessage", + "KeepAlive": "#/components/schemas/InboundKeepAliveMessage", + "ScheduledTasksInfoStart": "#/components/schemas/ScheduledTasksInfoStartMessage", + "ScheduledTasksInfoStop": "#/components/schemas/ScheduledTasksInfoStopMessage", + "SessionsStart": "#/components/schemas/SessionsStartMessage", + "SessionsStop": "#/components/schemas/SessionsStopMessage" + } + } + }, + "InstallationInfo": { + "type": "object", + "properties": { + "Guid": { + "type": "string", + "description": "Gets or sets the Id.", + "format": "uuid" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the version.", + "nullable": true + }, + "Changelog": { + "type": "string", + "description": "Gets or sets the changelog for this version.", + "nullable": true + }, + "SourceUrl": { + "type": "string", + "description": "Gets or sets the source URL.", + "nullable": true + }, + "Checksum": { + "type": "string", + "description": "Gets or sets a checksum for the binary.", + "nullable": true + }, + "PackageInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/PackageInfo" + } + ], + "description": "Gets or sets package information for the installation.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class InstallationInfo." + }, + "IPlugin": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets the name of the plugin.", + "nullable": true, + "readOnly": true + }, + "Description": { + "type": "string", + "description": "Gets the Description.", + "nullable": true, + "readOnly": true + }, + "Id": { + "type": "string", + "description": "Gets the unique id.", + "format": "uuid", + "readOnly": true + }, + "Version": { + "type": "string", + "description": "Gets the plugin version.", + "nullable": true, + "readOnly": true + }, + "AssemblyFilePath": { + "type": "string", + "description": "Gets the path to the assembly file.", + "nullable": true, + "readOnly": true + }, + "CanUninstall": { + "type": "boolean", + "description": "Gets a value indicating whether the plugin can be uninstalled.", + "readOnly": true + }, + "DataFolderPath": { + "type": "string", + "description": "Gets the full path to the data folder, where the plugin can store any miscellaneous files needed.", + "nullable": true, + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Common.Plugins.IPlugin." + }, + "IsoType": { + "enum": [ + "Dvd", + "BluRay" + ], + "type": "string", + "description": "Enum IsoType." + }, + "ItemCounts": { + "type": "object", + "properties": { + "MovieCount": { + "type": "integer", + "description": "Gets or sets the movie count.", + "format": "int32" + }, + "SeriesCount": { + "type": "integer", + "description": "Gets or sets the series count.", + "format": "int32" + }, + "EpisodeCount": { + "type": "integer", + "description": "Gets or sets the episode count.", + "format": "int32" + }, + "ArtistCount": { + "type": "integer", + "description": "Gets or sets the artist count.", + "format": "int32" + }, + "ProgramCount": { + "type": "integer", + "description": "Gets or sets the program count.", + "format": "int32" + }, + "TrailerCount": { + "type": "integer", + "description": "Gets or sets the trailer count.", + "format": "int32" + }, + "SongCount": { + "type": "integer", + "description": "Gets or sets the song count.", + "format": "int32" + }, + "AlbumCount": { + "type": "integer", + "description": "Gets or sets the album count.", + "format": "int32" + }, + "MusicVideoCount": { + "type": "integer", + "description": "Gets or sets the music video count.", + "format": "int32" + }, + "BoxSetCount": { + "type": "integer", + "description": "Gets or sets the box set count.", + "format": "int32" + }, + "BookCount": { + "type": "integer", + "description": "Gets or sets the book count.", + "format": "int32" + }, + "ItemCount": { + "type": "integer", + "description": "Gets or sets the item count.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Class LibrarySummary." + }, + "ItemFields": { + "enum": [ + "AirTime", + "CanDelete", + "CanDownload", + "ChannelInfo", + "Chapters", + "Trickplay", + "ChildCount", + "CumulativeRunTimeTicks", + "CustomRating", + "DateCreated", + "DateLastMediaAdded", + "DisplayPreferencesId", + "Etag", + "ExternalUrls", + "Genres", + "ItemCounts", + "MediaSourceCount", + "MediaSources", + "OriginalTitle", + "Overview", + "ParentId", + "Path", + "People", + "PlayAccess", + "ProductionLocations", + "ProviderIds", + "PrimaryImageAspectRatio", + "RecursiveItemCount", + "Settings", + "SeriesStudio", + "SortName", + "SpecialEpisodeNumbers", + "Studios", + "Taglines", + "Tags", + "RemoteTrailers", + "MediaStreams", + "SeasonUserData", + "DateLastRefreshed", + "DateLastSaved", + "RefreshState", + "ChannelImage", + "EnableMediaSourceDisplay", + "Width", + "Height", + "ExtraIds", + "LocalTrailerCount", + "IsHD", + "SpecialFeatureCount" + ], + "type": "string", + "description": "Used to control the data that gets attached to DtoBaseItems." + }, + "ItemFilter": { + "enum": [ + "IsFolder", + "IsNotFolder", + "IsUnplayed", + "IsPlayed", + "IsFavorite", + "IsResumable", + "Likes", + "Dislikes", + "IsFavoriteOrLikes" + ], + "type": "string", + "description": "Enum ItemFilter." + }, + "ItemSortBy": { + "enum": [ + "Default", + "AiredEpisodeOrder", + "Album", + "AlbumArtist", + "Artist", + "DateCreated", + "OfficialRating", + "DatePlayed", + "PremiereDate", + "StartDate", + "SortName", + "Name", + "Random", + "Runtime", + "CommunityRating", + "ProductionYear", + "PlayCount", + "CriticRating", + "IsFolder", + "IsUnplayed", + "IsPlayed", + "SeriesSortName", + "VideoBitRate", + "AirTime", + "Studio", + "IsFavoriteOrLiked", + "DateLastContentAdded", + "SeriesDatePlayed", + "ParentIndexNumber", + "IndexNumber" + ], + "type": "string", + "description": "These represent sort orders." + }, + "JoinGroupRequestDto": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets or sets the group identifier.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class JoinGroupRequestDto." + }, + "KeepUntil": { + "enum": [ + "UntilDeleted", + "UntilSpaceNeeded", + "UntilWatched", + "UntilDate" + ], + "type": "string" + }, + "LibraryChangedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/LibraryUpdateInfo" + } + ], + "description": "Class LibraryUpdateInfo.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "LibraryChanged", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Library changed message." + }, + "LibraryOptionInfoDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets name.", + "nullable": true + }, + "DefaultEnabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether default enabled." + } + }, + "additionalProperties": false, + "description": "Library option info dto." + }, + "LibraryOptions": { + "type": "object", + "properties": { + "Enabled": { + "type": "boolean" + }, + "EnablePhotos": { + "type": "boolean" + }, + "EnableRealtimeMonitor": { + "type": "boolean" + }, + "EnableLUFSScan": { + "type": "boolean" + }, + "EnableChapterImageExtraction": { + "type": "boolean" + }, + "ExtractChapterImagesDuringLibraryScan": { + "type": "boolean" + }, + "EnableTrickplayImageExtraction": { + "type": "boolean" + }, + "ExtractTrickplayImagesDuringLibraryScan": { + "type": "boolean" + }, + "PathInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaPathInfo" + } + }, + "SaveLocalMetadata": { + "type": "boolean" + }, + "EnableInternetProviders": { + "type": "boolean", + "deprecated": true + }, + "EnableAutomaticSeriesGrouping": { + "type": "boolean" + }, + "EnableEmbeddedTitles": { + "type": "boolean" + }, + "EnableEmbeddedExtrasTitles": { + "type": "boolean" + }, + "EnableEmbeddedEpisodeInfos": { + "type": "boolean" + }, + "AutomaticRefreshIntervalDays": { + "type": "integer", + "format": "int32" + }, + "PreferredMetadataLanguage": { + "type": "string", + "description": "Gets or sets the preferred metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "SeasonZeroDisplayName": { + "type": "string" + }, + "MetadataSavers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DisabledLocalMetadataReaders": { + "type": "array", + "items": { + "type": "string" + } + }, + "LocalMetadataReaderOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DisabledSubtitleFetchers": { + "type": "array", + "items": { + "type": "string" + } + }, + "SubtitleFetcherOrder": { + "type": "array", + "items": { + "type": "string" + } + }, + "DisabledMediaSegmentProviders": { + "type": "array", + "items": { + "type": "string" + } + }, + "MediaSegmentProviderOrder": { + "type": "array", + "items": { + "type": "string" + } + }, + "SkipSubtitlesIfEmbeddedSubtitlesPresent": { + "type": "boolean" + }, + "SkipSubtitlesIfAudioTrackMatches": { + "type": "boolean" + }, + "SubtitleDownloadLanguages": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "RequirePerfectSubtitleMatch": { + "type": "boolean" + }, + "SaveSubtitlesWithMedia": { + "type": "boolean" + }, + "SaveLyricsWithMedia": { + "type": "boolean", + "default": false + }, + "SaveTrickplayWithMedia": { + "type": "boolean", + "default": false + }, + "DisabledLyricFetchers": { + "type": "array", + "items": { + "type": "string" + } + }, + "LyricFetcherOrder": { + "type": "array", + "items": { + "type": "string" + } + }, + "PreferNonstandardArtistsTag": { + "type": "boolean", + "default": false + }, + "UseCustomTagDelimiters": { + "type": "boolean", + "default": false + }, + "CustomTagDelimiters": { + "type": "array", + "items": { + "type": "string" + } + }, + "DelimiterWhitelist": { + "type": "array", + "items": { + "type": "string" + } + }, + "AutomaticallyAddToCollection": { + "type": "boolean" + }, + "AllowEmbeddedSubtitles": { + "enum": [ + "AllowAll", + "AllowText", + "AllowImage", + "AllowNone" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EmbeddedSubtitleOptions" + } + ], + "description": "An enum representing the options to disable embedded subs." + }, + "TypeOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TypeOptions" + } + } + }, + "additionalProperties": false + }, + "LibraryOptionsResultDto": { + "type": "object", + "properties": { + "MetadataSavers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the metadata savers." + }, + "MetadataReaders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the metadata readers." + }, + "SubtitleFetchers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the subtitle fetchers." + }, + "LyricFetchers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the list of lyric fetchers." + }, + "MediaSegmentProviders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the list of MediaSegment Providers." + }, + "TypeOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryTypeOptionsDto" + }, + "description": "Gets or sets the type options." + } + }, + "additionalProperties": false, + "description": "Library options result dto." + }, + "LibraryStorageDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the Library Id.", + "format": "uuid" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name of the library." + }, + "Folders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FolderStorageDto" + }, + "description": "Gets or sets the storage informations about the folders used in a library." + } + }, + "additionalProperties": false, + "description": "Contains informations about a libraries storage informations." + }, + "LibraryTypeOptionsDto": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "description": "Gets or sets the type.", + "nullable": true + }, + "MetadataFetchers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the metadata fetchers." + }, + "ImageFetchers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the image fetchers." + }, + "SupportedImageTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + }, + "description": "Gets or sets the supported image types." + }, + "DefaultImageOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageOption" + }, + "description": "Gets or sets the default image options." + } + }, + "additionalProperties": false, + "description": "Library type options dto." + }, + "LibraryUpdateInfo": { + "type": "object", + "properties": { + "FoldersAddedTo": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the folders added to." + }, + "FoldersRemovedFrom": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the folders removed from." + }, + "ItemsAdded": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the items added." + }, + "ItemsRemoved": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the items removed." + }, + "ItemsUpdated": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the items updated." + }, + "CollectionFolders": { + "type": "array", + "items": { + "type": "string" + } + }, + "IsEmpty": { + "type": "boolean", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Class LibraryUpdateInfo." + }, + "ListingsProviderInfo": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": true + }, + "Type": { + "type": "string", + "nullable": true + }, + "Username": { + "type": "string", + "nullable": true + }, + "Password": { + "type": "string", + "nullable": true + }, + "ListingsId": { + "type": "string", + "nullable": true + }, + "ZipCode": { + "type": "string", + "nullable": true + }, + "Country": { + "type": "string", + "nullable": true + }, + "Path": { + "type": "string", + "nullable": true + }, + "EnabledTuners": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "EnableAllTuners": { + "type": "boolean" + }, + "NewsCategories": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "SportsCategories": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "KidsCategories": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "MovieCategories": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ChannelMappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameValuePair" + }, + "nullable": true + }, + "MoviePrefix": { + "type": "string", + "nullable": true + }, + "PreferredLanguage": { + "type": "string", + "nullable": true + }, + "UserAgent": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "LiveStreamResponse": { + "type": "object", + "properties": { + "MediaSource": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaSourceInfo" + } + ] + } + }, + "additionalProperties": false + }, + "LiveTvInfo": { + "type": "object", + "properties": { + "Services": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LiveTvServiceInfo" + }, + "description": "Gets or sets the services." + }, + "IsEnabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is enabled." + }, + "EnabledUsers": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the enabled users." + } + }, + "additionalProperties": false + }, + "LiveTvOptions": { + "type": "object", + "properties": { + "GuideDays": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "RecordingPath": { + "type": "string", + "nullable": true + }, + "MovieRecordingPath": { + "type": "string", + "nullable": true + }, + "SeriesRecordingPath": { + "type": "string", + "nullable": true + }, + "EnableRecordingSubfolders": { + "type": "boolean" + }, + "EnableOriginalAudioWithEncodedRecordings": { + "type": "boolean" + }, + "TunerHosts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + }, + "nullable": true + }, + "ListingProviders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ListingsProviderInfo" + }, + "nullable": true + }, + "PrePaddingSeconds": { + "type": "integer", + "format": "int32" + }, + "PostPaddingSeconds": { + "type": "integer", + "format": "int32" + }, + "MediaLocationsCreated": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "RecordingPostProcessor": { + "type": "string", + "nullable": true + }, + "RecordingPostProcessorArguments": { + "type": "string", + "nullable": true + }, + "SaveRecordingNFO": { + "type": "boolean" + }, + "SaveRecordingImages": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "LiveTvServiceInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "HomePageUrl": { + "type": "string", + "description": "Gets or sets the home page URL.", + "nullable": true + }, + "Status": { + "enum": [ + "Ok", + "Unavailable" + ], + "allOf": [ + { + "$ref": "#/components/schemas/LiveTvServiceStatus" + } + ], + "description": "Gets or sets the status." + }, + "StatusMessage": { + "type": "string", + "description": "Gets or sets the status message.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the version.", + "nullable": true + }, + "HasUpdateAvailable": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has update available." + }, + "IsVisible": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is visible." + }, + "Tuners": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class ServiceInfo." + }, + "LiveTvServiceStatus": { + "enum": [ + "Ok", + "Unavailable" + ], + "type": "string" + }, + "LocalizationOption": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "Value": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "LocationType": { + "enum": [ + "FileSystem", + "Remote", + "Virtual", + "Offline" + ], + "type": "string", + "description": "Enum LocationType." + }, + "LogFile": { + "type": "object", + "properties": { + "DateCreated": { + "type": "string", + "description": "Gets or sets the date created.", + "format": "date-time" + }, + "DateModified": { + "type": "string", + "description": "Gets or sets the date modified.", + "format": "date-time" + }, + "Size": { + "type": "integer", + "description": "Gets or sets the size.", + "format": "int64" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name." + } + }, + "additionalProperties": false + }, + "LogLevel": { + "enum": [ + "Trace", + "Debug", + "Information", + "Warning", + "Error", + "Critical", + "None" + ], + "type": "string" + }, + "LyricDto": { + "type": "object", + "properties": { + "Metadata": { + "allOf": [ + { + "$ref": "#/components/schemas/LyricMetadata" + } + ], + "description": "Gets or sets Metadata for the lyrics." + }, + "Lyrics": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LyricLine" + }, + "description": "Gets or sets a collection of individual lyric lines." + } + }, + "additionalProperties": false, + "description": "LyricResponse model." + }, + "LyricLine": { + "type": "object", + "properties": { + "Text": { + "type": "string", + "description": "Gets the text of this lyric line." + }, + "Start": { + "type": "integer", + "description": "Gets the start time in ticks.", + "format": "int64", + "nullable": true + }, + "Cues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LyricLineCue" + }, + "description": "Gets the time-aligned cues for the song's lyrics.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Lyric model." + }, + "LyricLineCue": { + "type": "object", + "properties": { + "Position": { + "type": "integer", + "description": "Gets the start character index of the cue.", + "format": "int32" + }, + "EndPosition": { + "type": "integer", + "description": "Gets the end character index of the cue.", + "format": "int32" + }, + "Start": { + "type": "integer", + "description": "Gets the timestamp the lyric is synced to in ticks.", + "format": "int64" + }, + "End": { + "type": "integer", + "description": "Gets the end timestamp the lyric is synced to in ticks.", + "format": "int64", + "nullable": true + } + }, + "additionalProperties": false, + "description": "LyricLineCue model, holds information about the timing of words within a LyricLine." + }, + "LyricMetadata": { + "type": "object", + "properties": { + "Artist": { + "type": "string", + "description": "Gets or sets the song artist.", + "nullable": true + }, + "Album": { + "type": "string", + "description": "Gets or sets the album this song is on.", + "nullable": true + }, + "Title": { + "type": "string", + "description": "Gets or sets the title of the song.", + "nullable": true + }, + "Author": { + "type": "string", + "description": "Gets or sets the author of the lyric data.", + "nullable": true + }, + "Length": { + "type": "integer", + "description": "Gets or sets the length of the song in ticks.", + "format": "int64", + "nullable": true + }, + "By": { + "type": "string", + "description": "Gets or sets who the LRC file was created by.", + "nullable": true + }, + "Offset": { + "type": "integer", + "description": "Gets or sets the lyric offset compared to audio in ticks.", + "format": "int64", + "nullable": true + }, + "Creator": { + "type": "string", + "description": "Gets or sets the software used to create the LRC file.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the version of the creator used.", + "nullable": true + }, + "IsSynced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this lyric is synced.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "LyricMetadata model." + }, + "MediaAttachment": { + "type": "object", + "properties": { + "Codec": { + "type": "string", + "description": "Gets or sets the codec.", + "nullable": true + }, + "CodecTag": { + "type": "string", + "description": "Gets or sets the codec tag.", + "nullable": true + }, + "Comment": { + "type": "string", + "description": "Gets or sets the comment.", + "nullable": true + }, + "Index": { + "type": "integer", + "description": "Gets or sets the index.", + "format": "int32" + }, + "FileName": { + "type": "string", + "description": "Gets or sets the filename.", + "nullable": true + }, + "MimeType": { + "type": "string", + "description": "Gets or sets the MIME type.", + "nullable": true + }, + "DeliveryUrl": { + "type": "string", + "description": "Gets or sets the delivery URL.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class MediaAttachment." + }, + "MediaPathDto": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name of the library." + }, + "Path": { + "type": "string", + "description": "Gets or sets the path to add.", + "nullable": true + }, + "PathInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathInfo" + } + ], + "description": "Gets or sets the path info.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Media Path dto." + }, + "MediaPathInfo": { + "type": "object", + "properties": { + "Path": { + "type": "string" + } + }, + "additionalProperties": false + }, + "MediaProtocol": { + "enum": [ + "File", + "Http", + "Rtmp", + "Rtsp", + "Udp", + "Rtp", + "Ftp" + ], + "type": "string" + }, + "MediaSegmentDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the id of the media segment.", + "format": "uuid" + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the id of the associated item.", + "format": "uuid" + }, + "Type": { + "enum": [ + "Unknown", + "Commercial", + "Preview", + "Recap", + "Outro", + "Intro" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaSegmentType" + } + ], + "description": "Gets or sets the type of content this segment defines.", + "default": "Unknown" + }, + "StartTicks": { + "type": "integer", + "description": "Gets or sets the start of the segment.", + "format": "int64" + }, + "EndTicks": { + "type": "integer", + "description": "Gets or sets the end of the segment.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Api model for MediaSegment's." + }, + "MediaSegmentDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaSegmentDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "MediaSegmentType": { + "enum": [ + "Unknown", + "Commercial", + "Preview", + "Recap", + "Outro", + "Intro" + ], + "type": "string", + "description": "Defines the types of content an individual Jellyfin.Database.Implementations.Entities.MediaSegment represents." + }, + "MediaSourceInfo": { + "type": "object", + "properties": { + "Protocol": { + "enum": [ + "File", + "Http", + "Rtmp", + "Rtsp", + "Udp", + "Rtp", + "Ftp" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaProtocol" + } + ] + }, + "Id": { + "type": "string", + "nullable": true + }, + "Path": { + "type": "string", + "nullable": true + }, + "EncoderPath": { + "type": "string", + "nullable": true + }, + "EncoderProtocol": { + "enum": [ + "File", + "Http", + "Rtmp", + "Rtsp", + "Udp", + "Rtp", + "Ftp" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaProtocol" + } + ], + "nullable": true + }, + "Type": { + "enum": [ + "Default", + "Grouping", + "Placeholder" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaSourceType" + } + ] + }, + "Container": { + "type": "string", + "nullable": true + }, + "Size": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "Name": { + "type": "string", + "nullable": true + }, + "IsRemote": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the media is remote.\r\nDifferentiate internet url vs local network." + }, + "ETag": { + "type": "string", + "nullable": true + }, + "RunTimeTicks": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "ReadAtNativeFramerate": { + "type": "boolean" + }, + "IgnoreDts": { + "type": "boolean" + }, + "IgnoreIndex": { + "type": "boolean" + }, + "GenPtsInput": { + "type": "boolean" + }, + "SupportsTranscoding": { + "type": "boolean" + }, + "SupportsDirectStream": { + "type": "boolean" + }, + "SupportsDirectPlay": { + "type": "boolean" + }, + "IsInfiniteStream": { + "type": "boolean" + }, + "UseMostCompatibleTranscodingProfile": { + "type": "boolean", + "default": false + }, + "RequiresOpening": { + "type": "boolean" + }, + "OpenToken": { + "type": "string", + "nullable": true + }, + "RequiresClosing": { + "type": "boolean" + }, + "LiveStreamId": { + "type": "string", + "nullable": true + }, + "BufferMs": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "RequiresLooping": { + "type": "boolean" + }, + "SupportsProbing": { + "type": "boolean" + }, + "VideoType": { + "enum": [ + "VideoFile", + "Iso", + "Dvd", + "BluRay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/VideoType" + } + ], + "nullable": true + }, + "IsoType": { + "enum": [ + "Dvd", + "BluRay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/IsoType" + } + ], + "nullable": true + }, + "Video3DFormat": { + "enum": [ + "HalfSideBySide", + "FullSideBySide", + "FullTopAndBottom", + "HalfTopAndBottom", + "MVC" + ], + "allOf": [ + { + "$ref": "#/components/schemas/Video3DFormat" + } + ], + "nullable": true + }, + "MediaStreams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaStream" + }, + "nullable": true + }, + "MediaAttachments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaAttachment" + }, + "nullable": true + }, + "Formats": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Bitrate": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "FallbackMaxStreamingBitrate": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "Timestamp": { + "enum": [ + "None", + "Zero", + "Valid" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TransportStreamTimestamp" + } + ], + "nullable": true + }, + "RequiredHttpHeaders": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "nullable": true + }, + "TranscodingUrl": { + "type": "string", + "nullable": true + }, + "TranscodingSubProtocol": { + "enum": [ + "http", + "hls" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaStreamProtocol" + } + ], + "description": "Media streaming protocol.\r\nLowercase for backwards compatibility." + }, + "TranscodingContainer": { + "type": "string", + "nullable": true + }, + "AnalyzeDurationMs": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "DefaultAudioStreamIndex": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "DefaultSubtitleStreamIndex": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "HasSegments": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "MediaSourceType": { + "enum": [ + "Default", + "Grouping", + "Placeholder" + ], + "type": "string" + }, + "MediaStream": { + "type": "object", + "properties": { + "Codec": { + "type": "string", + "description": "Gets or sets the codec.", + "nullable": true + }, + "CodecTag": { + "type": "string", + "description": "Gets or sets the codec tag.", + "nullable": true + }, + "Language": { + "type": "string", + "description": "Gets or sets the language.", + "nullable": true + }, + "ColorRange": { + "type": "string", + "description": "Gets or sets the color range.", + "nullable": true + }, + "ColorSpace": { + "type": "string", + "description": "Gets or sets the color space.", + "nullable": true + }, + "ColorTransfer": { + "type": "string", + "description": "Gets or sets the color transfer.", + "nullable": true + }, + "ColorPrimaries": { + "type": "string", + "description": "Gets or sets the color primaries.", + "nullable": true + }, + "DvVersionMajor": { + "type": "integer", + "description": "Gets or sets the Dolby Vision version major.", + "format": "int32", + "nullable": true + }, + "DvVersionMinor": { + "type": "integer", + "description": "Gets or sets the Dolby Vision version minor.", + "format": "int32", + "nullable": true + }, + "DvProfile": { + "type": "integer", + "description": "Gets or sets the Dolby Vision profile.", + "format": "int32", + "nullable": true + }, + "DvLevel": { + "type": "integer", + "description": "Gets or sets the Dolby Vision level.", + "format": "int32", + "nullable": true + }, + "RpuPresentFlag": { + "type": "integer", + "description": "Gets or sets the Dolby Vision rpu present flag.", + "format": "int32", + "nullable": true + }, + "ElPresentFlag": { + "type": "integer", + "description": "Gets or sets the Dolby Vision el present flag.", + "format": "int32", + "nullable": true + }, + "BlPresentFlag": { + "type": "integer", + "description": "Gets or sets the Dolby Vision bl present flag.", + "format": "int32", + "nullable": true + }, + "DvBlSignalCompatibilityId": { + "type": "integer", + "description": "Gets or sets the Dolby Vision bl signal compatibility id.", + "format": "int32", + "nullable": true + }, + "Rotation": { + "type": "integer", + "description": "Gets or sets the Rotation in degrees.", + "format": "int32", + "nullable": true + }, + "Comment": { + "type": "string", + "description": "Gets or sets the comment.", + "nullable": true + }, + "TimeBase": { + "type": "string", + "description": "Gets or sets the time base.", + "nullable": true + }, + "CodecTimeBase": { + "type": "string", + "description": "Gets or sets the codec time base.", + "nullable": true + }, + "Title": { + "type": "string", + "description": "Gets or sets the title.", + "nullable": true + }, + "Hdr10PlusPresentFlag": { + "type": "boolean", + "nullable": true + }, + "VideoRange": { + "enum": [ + "Unknown", + "SDR", + "HDR" + ], + "allOf": [ + { + "$ref": "#/components/schemas/VideoRange" + } + ], + "description": "An enum representing video ranges.", + "default": "Unknown", + "readOnly": true + }, + "VideoRangeType": { + "enum": [ + "Unknown", + "SDR", + "HDR10", + "HLG", + "DOVI", + "DOVIWithHDR10", + "DOVIWithHLG", + "DOVIWithSDR", + "DOVIWithEL", + "DOVIWithHDR10Plus", + "DOVIWithELHDR10Plus", + "DOVIInvalid", + "HDR10Plus" + ], + "allOf": [ + { + "$ref": "#/components/schemas/VideoRangeType" + } + ], + "description": "An enum representing types of video ranges.", + "default": "Unknown", + "readOnly": true + }, + "VideoDoViTitle": { + "type": "string", + "description": "Gets the video dovi title.", + "nullable": true, + "readOnly": true + }, + "AudioSpatialFormat": { + "enum": [ + "None", + "DolbyAtmos", + "DTSX" + ], + "allOf": [ + { + "$ref": "#/components/schemas/AudioSpatialFormat" + } + ], + "description": "An enum representing formats of spatial audio.", + "default": "None", + "readOnly": true + }, + "LocalizedUndefined": { + "type": "string", + "nullable": true + }, + "LocalizedDefault": { + "type": "string", + "nullable": true + }, + "LocalizedForced": { + "type": "string", + "nullable": true + }, + "LocalizedExternal": { + "type": "string", + "nullable": true + }, + "LocalizedHearingImpaired": { + "type": "string", + "nullable": true + }, + "DisplayTitle": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "NalLengthSize": { + "type": "string", + "nullable": true + }, + "IsInterlaced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is interlaced." + }, + "IsAVC": { + "type": "boolean", + "nullable": true + }, + "ChannelLayout": { + "type": "string", + "description": "Gets or sets the channel layout.", + "nullable": true + }, + "BitRate": { + "type": "integer", + "description": "Gets or sets the bit rate.", + "format": "int32", + "nullable": true + }, + "BitDepth": { + "type": "integer", + "description": "Gets or sets the bit depth.", + "format": "int32", + "nullable": true + }, + "RefFrames": { + "type": "integer", + "description": "Gets or sets the reference frames.", + "format": "int32", + "nullable": true + }, + "PacketLength": { + "type": "integer", + "description": "Gets or sets the length of the packet.", + "format": "int32", + "nullable": true + }, + "Channels": { + "type": "integer", + "description": "Gets or sets the channels.", + "format": "int32", + "nullable": true + }, + "SampleRate": { + "type": "integer", + "description": "Gets or sets the sample rate.", + "format": "int32", + "nullable": true + }, + "IsDefault": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is default." + }, + "IsForced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is forced." + }, + "IsHearingImpaired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is for the hearing impaired." + }, + "Height": { + "type": "integer", + "description": "Gets or sets the height.", + "format": "int32", + "nullable": true + }, + "Width": { + "type": "integer", + "description": "Gets or sets the width.", + "format": "int32", + "nullable": true + }, + "AverageFrameRate": { + "type": "number", + "description": "Gets or sets the average frame rate.", + "format": "float", + "nullable": true + }, + "RealFrameRate": { + "type": "number", + "description": "Gets or sets the real frame rate.", + "format": "float", + "nullable": true + }, + "ReferenceFrameRate": { + "type": "number", + "description": "Gets the framerate used as reference.\r\nPrefer AverageFrameRate, if that is null or an unrealistic value\r\nthen fallback to RealFrameRate.", + "format": "float", + "nullable": true, + "readOnly": true + }, + "Profile": { + "type": "string", + "description": "Gets or sets the profile.", + "nullable": true + }, + "Type": { + "enum": [ + "Audio", + "Video", + "Subtitle", + "EmbeddedImage", + "Data", + "Lyric" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaStreamType" + } + ], + "description": "Gets or sets the type." + }, + "AspectRatio": { + "type": "string", + "description": "Gets or sets the aspect ratio.", + "nullable": true + }, + "Index": { + "type": "integer", + "description": "Gets or sets the index.", + "format": "int32" + }, + "Score": { + "type": "integer", + "description": "Gets or sets the score.", + "format": "int32", + "nullable": true + }, + "IsExternal": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is external." + }, + "DeliveryMethod": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ], + "description": "Gets or sets the method.", + "nullable": true + }, + "DeliveryUrl": { + "type": "string", + "description": "Gets or sets the delivery URL.", + "nullable": true + }, + "IsExternalUrl": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is external URL.", + "nullable": true + }, + "IsTextSubtitleStream": { + "type": "boolean", + "readOnly": true + }, + "SupportsExternalStream": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports external stream]." + }, + "Path": { + "type": "string", + "description": "Gets or sets the filename.", + "nullable": true + }, + "PixelFormat": { + "type": "string", + "description": "Gets or sets the pixel format.", + "nullable": true + }, + "Level": { + "type": "number", + "description": "Gets or sets the level.", + "format": "double", + "nullable": true + }, + "IsAnamorphic": { + "type": "boolean", + "description": "Gets or sets whether this instance is anamorphic.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class MediaStream." + }, + "MediaStreamProtocol": { + "enum": [ + "http", + "hls" + ], + "type": "string", + "description": "Media streaming protocol.\r\nLowercase for backwards compatibility." + }, + "MediaStreamType": { + "enum": [ + "Audio", + "Video", + "Subtitle", + "EmbeddedImage", + "Data", + "Lyric" + ], + "type": "string", + "description": "Enum MediaStreamType." + }, + "MediaType": { + "enum": [ + "Unknown", + "Video", + "Audio", + "Photo", + "Book" + ], + "type": "string", + "description": "Media types." + }, + "MediaUpdateInfoDto": { + "type": "object", + "properties": { + "Updates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaUpdateInfoPathDto" + }, + "description": "Gets or sets the list of updates." + } + }, + "additionalProperties": false, + "description": "Media Update Info Dto." + }, + "MediaUpdateInfoPathDto": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Gets or sets media path.", + "nullable": true + }, + "UpdateType": { + "type": "string", + "description": "Gets or sets media update type.\r\nCreated, Modified, Deleted.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The media update info path." + }, + "MediaUrl": { + "type": "object", + "properties": { + "Url": { + "type": "string", + "nullable": true + }, + "Name": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "MessageCommand": { + "required": [ + "Text" + ], + "type": "object", + "properties": { + "Header": { + "type": "string", + "nullable": true + }, + "Text": { + "type": "string" + }, + "TimeoutMs": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + "additionalProperties": false + }, + "MetadataConfiguration": { + "type": "object", + "properties": { + "UseFileCreationTimeForDateAdded": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "MetadataEditorInfo": { + "type": "object", + "properties": { + "ParentalRatingOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParentalRating" + }, + "description": "Gets or sets the parental rating options." + }, + "Countries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CountryInfo" + }, + "description": "Gets or sets the countries." + }, + "Cultures": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CultureDto" + }, + "description": "Gets or sets the cultures." + }, + "ExternalIdInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalIdInfo" + }, + "description": "Gets or sets the external id infos." + }, + "ContentType": { + "enum": [ + "unknown", + "movies", + "tvshows", + "music", + "musicvideos", + "trailers", + "homevideos", + "boxsets", + "books", + "photos", + "livetv", + "playlists", + "folders" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CollectionType" + } + ], + "description": "Gets or sets the content type.", + "nullable": true + }, + "ContentTypeOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameValuePair" + }, + "description": "Gets or sets the content type options." + } + }, + "additionalProperties": false, + "description": "A class representing metadata editor information." + }, + "MetadataField": { + "enum": [ + "Cast", + "Genres", + "ProductionLocations", + "Studios", + "Tags", + "Name", + "Overview", + "Runtime", + "OfficialRating" + ], + "type": "string", + "description": "Enum MetadataFields." + }, + "MetadataOptions": { + "type": "object", + "properties": { + "ItemType": { + "type": "string", + "nullable": true + }, + "DisabledMetadataSavers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "LocalMetadataReaderOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DisabledMetadataFetchers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "MetadataFetcherOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DisabledImageFetchers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ImageFetcherOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class MetadataOptions." + }, + "MetadataRefreshMode": { + "enum": [ + "None", + "ValidationOnly", + "Default", + "FullRefresh" + ], + "type": "string" + }, + "MovePlaylistItemRequestDto": { + "type": "object", + "properties": { + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist identifier of the item.", + "format": "uuid" + }, + "NewIndex": { + "type": "integer", + "description": "Gets or sets the new position.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Class MovePlaylistItemRequestDto." + }, + "MovieInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "MovieInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/MovieInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "MusicVideoInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "Artists": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "MusicVideoInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/MusicVideoInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "NameGuidPair": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "Id": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "NameIdPair": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "nullable": true + } + }, + "additionalProperties": false + }, + "NameValuePair": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Value": { + "type": "string", + "description": "Gets or sets the value.", + "nullable": true + } + }, + "additionalProperties": false + }, + "NetworkConfiguration": { + "type": "object", + "properties": { + "BaseUrl": { + "type": "string", + "description": "Gets or sets a value used to specify the URL prefix that your Jellyfin instance can be accessed at." + }, + "EnableHttps": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to use HTTPS." + }, + "RequireHttps": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the server should force connections over HTTPS." + }, + "CertificatePath": { + "type": "string", + "description": "Gets or sets the filesystem path of an X.509 certificate to use for SSL." + }, + "CertificatePassword": { + "type": "string", + "description": "Gets or sets the password required to access the X.509 certificate data in the file specified by MediaBrowser.Common.Net.NetworkConfiguration.CertificatePath." + }, + "InternalHttpPort": { + "type": "integer", + "description": "Gets or sets the internal HTTP server port.", + "format": "int32" + }, + "InternalHttpsPort": { + "type": "integer", + "description": "Gets or sets the internal HTTPS server port.", + "format": "int32" + }, + "PublicHttpPort": { + "type": "integer", + "description": "Gets or sets the public HTTP port.", + "format": "int32" + }, + "PublicHttpsPort": { + "type": "integer", + "description": "Gets or sets the public HTTPS port.", + "format": "int32" + }, + "AutoDiscovery": { + "type": "boolean", + "description": "Gets or sets a value indicating whether Autodiscovery is enabled." + }, + "EnableUPnP": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable automatic port forwarding.", + "deprecated": true + }, + "EnableIPv4": { + "type": "boolean", + "description": "Gets or sets a value indicating whether IPv6 is enabled." + }, + "EnableIPv6": { + "type": "boolean", + "description": "Gets or sets a value indicating whether IPv6 is enabled." + }, + "EnableRemoteAccess": { + "type": "boolean", + "description": "Gets or sets a value indicating whether access from outside of the LAN is permitted." + }, + "LocalNetworkSubnets": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the subnets that are deemed to make up the LAN." + }, + "LocalNetworkAddresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the interface addresses which Jellyfin will bind to. If empty, all interfaces will be used." + }, + "KnownProxies": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the known proxies." + }, + "IgnoreVirtualInterfaces": { + "type": "boolean", + "description": "Gets or sets a value indicating whether address names that match MediaBrowser.Common.Net.NetworkConfiguration.VirtualInterfaceNames should be ignored for the purposes of binding." + }, + "VirtualInterfaceNames": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets a value indicating the interface name prefixes that should be ignored. The list can be comma separated and values are case-insensitive. ." + }, + "EnablePublishedServerUriByRequest": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the published server uri is based on information in HTTP requests." + }, + "PublishedServerUriBySubnet": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the PublishedServerUriBySubnet\r\nGets or sets PublishedServerUri to advertise for specific subnets." + }, + "RemoteIPFilter": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the filter for remote IP connectivity. Used in conjunction with ." + }, + "IsRemoteIPFilterBlacklist": { + "type": "boolean", + "description": "Gets or sets a value indicating whether contains a blacklist or a whitelist. Default is a whitelist." + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Common.Net.NetworkConfiguration." + }, + "NewGroupRequestDto": { + "type": "object", + "properties": { + "GroupName": { + "type": "string", + "description": "Gets or sets the group name." + } + }, + "additionalProperties": false, + "description": "Class NewGroupRequestDto." + }, + "NextItemRequestDto": { + "type": "object", + "properties": { + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playing item identifier.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class NextItemRequestDto." + }, + "OpenLiveStreamDto": { + "type": "object", + "properties": { + "OpenToken": { + "type": "string", + "description": "Gets or sets the open token.", + "nullable": true + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid", + "nullable": true + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session id.", + "nullable": true + }, + "MaxStreamingBitrate": { + "type": "integer", + "description": "Gets or sets the max streaming bitrate.", + "format": "int32", + "nullable": true + }, + "StartTimeTicks": { + "type": "integer", + "description": "Gets or sets the start time in ticks.", + "format": "int64", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the audio stream index.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the subtitle stream index.", + "format": "int32", + "nullable": true + }, + "MaxAudioChannels": { + "type": "integer", + "description": "Gets or sets the max audio channels.", + "format": "int32", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item id.", + "format": "uuid", + "nullable": true + }, + "EnableDirectPlay": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable direct play.", + "nullable": true + }, + "EnableDirectStream": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable direct stream.", + "nullable": true + }, + "AlwaysBurnInSubtitleWhenTranscoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether always burn in subtitles when transcoding.", + "nullable": true + }, + "DeviceProfile": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't.", + "nullable": true + }, + "DirectPlayProtocols": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaProtocol" + }, + "description": "Gets or sets the device play protocols." + } + }, + "additionalProperties": false, + "description": "Open live stream dto." + }, + "OutboundKeepAliveMessage": { + "type": "object", + "properties": { + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "KeepAlive", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Keep alive websocket messages." + }, + "OutboundWebSocketMessage": { + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/ActivityLogEntryMessage" + }, + { + "$ref": "#/components/schemas/ForceKeepAliveMessage" + }, + { + "$ref": "#/components/schemas/GeneralCommandMessage" + }, + { + "$ref": "#/components/schemas/LibraryChangedMessage" + }, + { + "$ref": "#/components/schemas/OutboundKeepAliveMessage" + }, + { + "$ref": "#/components/schemas/PlayMessage" + }, + { + "$ref": "#/components/schemas/PlaystateMessage" + }, + { + "$ref": "#/components/schemas/PluginInstallationCancelledMessage" + }, + { + "$ref": "#/components/schemas/PluginInstallationCompletedMessage" + }, + { + "$ref": "#/components/schemas/PluginInstallationFailedMessage" + }, + { + "$ref": "#/components/schemas/PluginInstallingMessage" + }, + { + "$ref": "#/components/schemas/PluginUninstalledMessage" + }, + { + "$ref": "#/components/schemas/RefreshProgressMessage" + }, + { + "$ref": "#/components/schemas/RestartRequiredMessage" + }, + { + "$ref": "#/components/schemas/ScheduledTaskEndedMessage" + }, + { + "$ref": "#/components/schemas/ScheduledTasksInfoMessage" + }, + { + "$ref": "#/components/schemas/SeriesTimerCancelledMessage" + }, + { + "$ref": "#/components/schemas/SeriesTimerCreatedMessage" + }, + { + "$ref": "#/components/schemas/ServerRestartingMessage" + }, + { + "$ref": "#/components/schemas/ServerShuttingDownMessage" + }, + { + "$ref": "#/components/schemas/SessionsMessage" + }, + { + "$ref": "#/components/schemas/SyncPlayCommandMessage" + }, + { + "$ref": "#/components/schemas/TimerCancelledMessage" + }, + { + "$ref": "#/components/schemas/TimerCreatedMessage" + }, + { + "$ref": "#/components/schemas/UserDataChangedMessage" + }, + { + "$ref": "#/components/schemas/UserDeletedMessage" + }, + { + "$ref": "#/components/schemas/UserUpdatedMessage" + }, + { + "$ref": "#/components/schemas/SyncPlayGroupUpdateMessage" + } + ], + "description": "Represents the list of possible outbound websocket types", + "discriminator": { + "propertyName": "MessageType", + "mapping": { + "ActivityLogEntry": "#/components/schemas/ActivityLogEntryMessage", + "ForceKeepAlive": "#/components/schemas/ForceKeepAliveMessage", + "GeneralCommand": "#/components/schemas/GeneralCommandMessage", + "LibraryChanged": "#/components/schemas/LibraryChangedMessage", + "KeepAlive": "#/components/schemas/OutboundKeepAliveMessage", + "Play": "#/components/schemas/PlayMessage", + "Playstate": "#/components/schemas/PlaystateMessage", + "PackageInstallationCancelled": "#/components/schemas/PluginInstallationCancelledMessage", + "PackageInstallationCompleted": "#/components/schemas/PluginInstallationCompletedMessage", + "PackageInstallationFailed": "#/components/schemas/PluginInstallationFailedMessage", + "PackageInstalling": "#/components/schemas/PluginInstallingMessage", + "PackageUninstalled": "#/components/schemas/PluginUninstalledMessage", + "RefreshProgress": "#/components/schemas/RefreshProgressMessage", + "RestartRequired": "#/components/schemas/RestartRequiredMessage", + "ScheduledTaskEnded": "#/components/schemas/ScheduledTaskEndedMessage", + "ScheduledTasksInfo": "#/components/schemas/ScheduledTasksInfoMessage", + "SeriesTimerCancelled": "#/components/schemas/SeriesTimerCancelledMessage", + "SeriesTimerCreated": "#/components/schemas/SeriesTimerCreatedMessage", + "ServerRestarting": "#/components/schemas/ServerRestartingMessage", + "ServerShuttingDown": "#/components/schemas/ServerShuttingDownMessage", + "Sessions": "#/components/schemas/SessionsMessage", + "SyncPlayCommand": "#/components/schemas/SyncPlayCommandMessage", + "TimerCancelled": "#/components/schemas/TimerCancelledMessage", + "TimerCreated": "#/components/schemas/TimerCreatedMessage", + "UserDataChanged": "#/components/schemas/UserDataChangedMessage", + "UserDeleted": "#/components/schemas/UserDeletedMessage", + "UserUpdated": "#/components/schemas/UserUpdatedMessage", + "SyncPlayGroupUpdate": "#/components/schemas/SyncPlayGroupUpdateMessage" + } + } + }, + "PackageInfo": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Gets or sets the name." + }, + "description": { + "type": "string", + "description": "Gets or sets a long description of the plugin containing features or helpful explanations." + }, + "overview": { + "type": "string", + "description": "Gets or sets a short overview of what the plugin does." + }, + "owner": { + "type": "string", + "description": "Gets or sets the owner." + }, + "category": { + "type": "string", + "description": "Gets or sets the category." + }, + "guid": { + "type": "string", + "description": "Gets or sets the guid of the assembly associated with this plugin.\r\nThis is used to identify the proper item for automatic updates.", + "format": "uuid" + }, + "versions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VersionInfo" + }, + "description": "Gets or sets the versions." + }, + "imageUrl": { + "type": "string", + "description": "Gets or sets the image url for the package.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PackageInfo." + }, + "ParentalRating": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "Value": { + "type": "integer", + "description": "Gets or sets the value.", + "format": "int32", + "nullable": true + }, + "RatingScore": { + "allOf": [ + { + "$ref": "#/components/schemas/ParentalRatingScore" + } + ], + "description": "Gets or sets the rating score.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class ParentalRating." + }, + "ParentalRatingScore": { + "type": "object", + "properties": { + "score": { + "type": "integer", + "description": "Gets or sets the score.", + "format": "int32" + }, + "subScore": { + "type": "integer", + "description": "Gets or sets the sub score.", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false, + "description": "A class representing an parental rating score." + }, + "PathSubstitution": { + "type": "object", + "properties": { + "From": { + "type": "string", + "description": "Gets or sets the value to substitute." + }, + "To": { + "type": "string", + "description": "Gets or sets the value to substitution with." + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Configuration.PathSubstitution." + }, + "PersonKind": { + "enum": [ + "Unknown", + "Actor", + "Director", + "Composer", + "Writer", + "GuestStar", + "Producer", + "Conductor", + "Lyricist", + "Arranger", + "Engineer", + "Mixer", + "Remixer", + "Creator", + "Artist", + "AlbumArtist", + "Author", + "Illustrator", + "Penciller", + "Inker", + "Colorist", + "Letterer", + "CoverArtist", + "Editor", + "Translator" + ], + "type": "string", + "description": "The person kind." + }, + "PersonLookupInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "PersonLookupInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/PersonLookupInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "PingRequestDto": { + "type": "object", + "properties": { + "Ping": { + "type": "integer", + "description": "Gets or sets the ping time.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Class PingRequestDto." + }, + "PinRedeemResult": { + "type": "object", + "properties": { + "Success": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Users.PinRedeemResult is success." + }, + "UsersReset": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the users reset." + } + }, + "additionalProperties": false + }, + "PlayAccess": { + "enum": [ + "Full", + "None" + ], + "type": "string" + }, + "PlaybackErrorCode": { + "enum": [ + "NotAllowed", + "NoCompatibleStream", + "RateLimitExceeded" + ], + "type": "string" + }, + "PlaybackInfoDto": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "description": "Gets or sets the playback userId.", + "format": "uuid", + "nullable": true + }, + "MaxStreamingBitrate": { + "type": "integer", + "description": "Gets or sets the max streaming bitrate.", + "format": "int32", + "nullable": true + }, + "StartTimeTicks": { + "type": "integer", + "description": "Gets or sets the start time in ticks.", + "format": "int64", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the audio stream index.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the subtitle stream index.", + "format": "int32", + "nullable": true + }, + "MaxAudioChannels": { + "type": "integer", + "description": "Gets or sets the max audio channels.", + "format": "int32", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the media source id.", + "nullable": true + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the live stream id.", + "nullable": true + }, + "DeviceProfile": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't.", + "nullable": true + }, + "EnableDirectPlay": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable direct play.", + "nullable": true + }, + "EnableDirectStream": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable direct stream.", + "nullable": true + }, + "EnableTranscoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable transcoding.", + "nullable": true + }, + "AllowVideoStreamCopy": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable video stream copy.", + "nullable": true + }, + "AllowAudioStreamCopy": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to allow audio stream copy.", + "nullable": true + }, + "AutoOpenLiveStream": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to auto open the live stream.", + "nullable": true + }, + "AlwaysBurnInSubtitleWhenTranscoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether always burn in subtitles when transcoding.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Playback info dto." + }, + "PlaybackInfoResponse": { + "type": "object", + "properties": { + "MediaSources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaSourceInfo" + }, + "description": "Gets or sets the media sources." + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session identifier.", + "nullable": true + }, + "ErrorCode": { + "enum": [ + "NotAllowed", + "NoCompatibleStream", + "RateLimitExceeded" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackErrorCode" + } + ], + "description": "Gets or sets the error code.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlaybackInfoResponse." + }, + "PlaybackOrder": { + "enum": [ + "Default", + "Shuffle" + ], + "type": "string", + "description": "Enum PlaybackOrder." + }, + "PlaybackProgressInfo": { + "type": "object", + "properties": { + "CanSeek": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can seek." + }, + "Item": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the item.", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "format": "uuid" + }, + "SessionId": { + "type": "string", + "description": "Gets or sets the session id.", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the media version identifier.", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the audio stream.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the subtitle stream.", + "format": "int32", + "nullable": true + }, + "IsPaused": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is paused." + }, + "IsMuted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is muted." + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64", + "nullable": true + }, + "PlaybackStartTimeTicks": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "VolumeLevel": { + "type": "integer", + "description": "Gets or sets the volume level.", + "format": "int32", + "nullable": true + }, + "Brightness": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AspectRatio": { + "type": "string", + "nullable": true + }, + "PlayMethod": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ], + "description": "Gets or sets the play method." + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the live stream identifier.", + "nullable": true + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session identifier.", + "nullable": true + }, + "RepeatMode": { + "enum": [ + "RepeatNone", + "RepeatAll", + "RepeatOne" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RepeatMode" + } + ], + "description": "Gets or sets the repeat mode." + }, + "PlaybackOrder": { + "enum": [ + "Default", + "Shuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackOrder" + } + ], + "description": "Gets or sets the playback order." + }, + "NowPlayingQueue": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueItem" + }, + "nullable": true + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlaybackProgressInfo." + }, + "PlaybackRequestType": { + "enum": [ + "Play", + "SetPlaylistItem", + "RemoveFromPlaylist", + "MovePlaylistItem", + "Queue", + "Unpause", + "Pause", + "Stop", + "Seek", + "Buffer", + "Ready", + "NextItem", + "PreviousItem", + "SetRepeatMode", + "SetShuffleMode", + "Ping", + "IgnoreWait" + ], + "type": "string", + "description": "Enum PlaybackRequestType." + }, + "PlaybackStartInfo": { + "type": "object", + "properties": { + "CanSeek": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can seek." + }, + "Item": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the item.", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "format": "uuid" + }, + "SessionId": { + "type": "string", + "description": "Gets or sets the session id.", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the media version identifier.", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the audio stream.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the subtitle stream.", + "format": "int32", + "nullable": true + }, + "IsPaused": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is paused." + }, + "IsMuted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is muted." + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64", + "nullable": true + }, + "PlaybackStartTimeTicks": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "VolumeLevel": { + "type": "integer", + "description": "Gets or sets the volume level.", + "format": "int32", + "nullable": true + }, + "Brightness": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AspectRatio": { + "type": "string", + "nullable": true + }, + "PlayMethod": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ], + "description": "Gets or sets the play method." + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the live stream identifier.", + "nullable": true + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session identifier.", + "nullable": true + }, + "RepeatMode": { + "enum": [ + "RepeatNone", + "RepeatAll", + "RepeatOne" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RepeatMode" + } + ], + "description": "Gets or sets the repeat mode." + }, + "PlaybackOrder": { + "enum": [ + "Default", + "Shuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackOrder" + } + ], + "description": "Gets or sets the playback order." + }, + "NowPlayingQueue": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueItem" + }, + "nullable": true + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlaybackStartInfo." + }, + "PlaybackStopInfo": { + "type": "object", + "properties": { + "Item": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the item.", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "format": "uuid" + }, + "SessionId": { + "type": "string", + "description": "Gets or sets the session id.", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the media version identifier.", + "nullable": true + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64", + "nullable": true + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the live stream identifier.", + "nullable": true + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session identifier.", + "nullable": true + }, + "Failed": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Session.PlaybackStopInfo is failed." + }, + "NextMediaType": { + "type": "string", + "nullable": true + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + }, + "NowPlayingQueue": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueItem" + }, + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlaybackStopInfo." + }, + "PlayCommand": { + "enum": [ + "PlayNow", + "PlayNext", + "PlayLast", + "PlayInstantMix", + "PlayShuffle" + ], + "type": "string", + "description": "Enum PlayCommand." + }, + "PlayerStateInfo": { + "type": "object", + "properties": { + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the now playing position ticks.", + "format": "int64", + "nullable": true + }, + "CanSeek": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can seek." + }, + "IsPaused": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is paused." + }, + "IsMuted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is muted." + }, + "VolumeLevel": { + "type": "integer", + "description": "Gets or sets the volume level.", + "format": "int32", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the now playing audio stream.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the now playing subtitle stream.", + "format": "int32", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the now playing media version identifier.", + "nullable": true + }, + "PlayMethod": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ], + "description": "Gets or sets the play method.", + "nullable": true + }, + "RepeatMode": { + "enum": [ + "RepeatNone", + "RepeatAll", + "RepeatOne" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RepeatMode" + } + ], + "description": "Gets or sets the repeat mode." + }, + "PlaybackOrder": { + "enum": [ + "Default", + "Shuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackOrder" + } + ], + "description": "Gets or sets the playback order." + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the now playing live stream identifier.", + "nullable": true + } + }, + "additionalProperties": false + }, + "PlaylistCreationResult": { + "type": "object", + "properties": { + "Id": { + "type": "string" + } + }, + "additionalProperties": false + }, + "PlaylistDto": { + "type": "object", + "properties": { + "OpenAccess": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the playlist is publicly readable." + }, + "Shares": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + }, + "description": "Gets or sets the share permissions." + }, + "ItemIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the item ids." + } + }, + "additionalProperties": false, + "description": "DTO for playlists." + }, + "PlaylistUserPermissions": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid" + }, + "CanEdit": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the user has edit permissions." + } + }, + "additionalProperties": false, + "description": "Class to hold data on user permissions for playlists." + }, + "PlayMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayRequest" + } + ], + "description": "Class PlayRequest.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "Play", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Play command websocket message." + }, + "PlayMethod": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "type": "string" + }, + "PlayQueueUpdate": { + "type": "object", + "properties": { + "Reason": { + "enum": [ + "NewPlaylist", + "SetCurrentItem", + "RemoveItems", + "MoveItem", + "Queue", + "QueueNext", + "NextItem", + "PreviousItem", + "RepeatMode", + "ShuffleMode" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayQueueUpdateReason" + } + ], + "description": "Gets the request type that originated this update." + }, + "LastUpdate": { + "type": "string", + "description": "Gets the UTC time of the last change to the playing queue.", + "format": "date-time" + }, + "Playlist": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SyncPlayQueueItem" + }, + "description": "Gets the playlist." + }, + "PlayingItemIndex": { + "type": "integer", + "description": "Gets the playing item index in the playlist.", + "format": "int32" + }, + "StartPositionTicks": { + "type": "integer", + "description": "Gets the start position ticks.", + "format": "int64" + }, + "IsPlaying": { + "type": "boolean", + "description": "Gets a value indicating whether the current item is playing." + }, + "ShuffleMode": { + "enum": [ + "Sorted", + "Shuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupShuffleMode" + } + ], + "description": "Gets the shuffle mode." + }, + "RepeatMode": { + "enum": [ + "RepeatOne", + "RepeatAll", + "RepeatNone" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupRepeatMode" + } + ], + "description": "Gets the repeat mode." + } + }, + "additionalProperties": false, + "description": "Class PlayQueueUpdate." + }, + "PlayQueueUpdateReason": { + "enum": [ + "NewPlaylist", + "SetCurrentItem", + "RemoveItems", + "MoveItem", + "Queue", + "QueueNext", + "NextItem", + "PreviousItem", + "RepeatMode", + "ShuffleMode" + ], + "type": "string", + "description": "Enum PlayQueueUpdateReason." + }, + "PlayRequest": { + "type": "object", + "properties": { + "ItemIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the item ids.", + "nullable": true + }, + "StartPositionTicks": { + "type": "integer", + "description": "Gets or sets the start position ticks that the first item should be played at.", + "format": "int64", + "nullable": true + }, + "PlayCommand": { + "enum": [ + "PlayNow", + "PlayNext", + "PlayLast", + "PlayInstantMix", + "PlayShuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayCommand" + } + ], + "description": "Gets or sets the play command." + }, + "ControllingUserId": { + "type": "string", + "description": "Gets or sets the controlling user identifier.", + "format": "uuid" + }, + "SubtitleStreamIndex": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "nullable": true + }, + "StartIndex": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlayRequest." + }, + "PlayRequestDto": { + "type": "object", + "properties": { + "PlayingQueue": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the playing queue." + }, + "PlayingItemPosition": { + "type": "integer", + "description": "Gets or sets the position of the playing item in the queue.", + "format": "int32" + }, + "StartPositionTicks": { + "type": "integer", + "description": "Gets or sets the start position ticks.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Class PlayRequestDto." + }, + "PlaystateCommand": { + "enum": [ + "Stop", + "Pause", + "Unpause", + "NextTrack", + "PreviousTrack", + "Seek", + "Rewind", + "FastForward", + "PlayPause" + ], + "type": "string", + "description": "Enum PlaystateCommand." + }, + "PlaystateMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaystateRequest" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "Playstate", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Playstate message." + }, + "PlaystateRequest": { + "type": "object", + "properties": { + "Command": { + "enum": [ + "Stop", + "Pause", + "Unpause", + "NextTrack", + "PreviousTrack", + "Seek", + "Rewind", + "FastForward", + "PlayPause" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaystateCommand" + } + ], + "description": "Enum PlaystateCommand." + }, + "SeekPositionTicks": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "ControllingUserId": { + "type": "string", + "description": "Gets or sets the controlling user identifier.", + "nullable": true + } + }, + "additionalProperties": false + }, + "PluginInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "Version": { + "type": "string", + "description": "Gets or sets the version." + }, + "ConfigurationFileName": { + "type": "string", + "description": "Gets or sets the name of the configuration file.", + "nullable": true + }, + "Description": { + "type": "string", + "description": "Gets or sets the description." + }, + "Id": { + "type": "string", + "description": "Gets or sets the unique id.", + "format": "uuid" + }, + "CanUninstall": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the plugin can be uninstalled." + }, + "HasImage": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this plugin has a valid image." + }, + "Status": { + "enum": [ + "Active", + "Restart", + "Deleted", + "Superseded", + "Superceded", + "Malfunctioned", + "NotSupported", + "Disabled" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PluginStatus" + } + ], + "description": "Gets or sets a value indicating the status of the plugin." + } + }, + "additionalProperties": false, + "description": "This is a serializable stub class that is used by the api to provide information about installed plugins." + }, + "PluginInstallationCancelledMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/InstallationInfo" + } + ], + "description": "Class InstallationInfo.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "PackageInstallationCancelled", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Plugin installation cancelled message." + }, + "PluginInstallationCompletedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/InstallationInfo" + } + ], + "description": "Class InstallationInfo.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "PackageInstallationCompleted", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Plugin installation completed message." + }, + "PluginInstallationFailedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/InstallationInfo" + } + ], + "description": "Class InstallationInfo.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "PackageInstallationFailed", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Plugin installation failed message." + }, + "PluginInstallingMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/InstallationInfo" + } + ], + "description": "Class InstallationInfo.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "PackageInstalling", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Package installing message." + }, + "PluginStatus": { + "enum": [ + "Active", + "Restart", + "Deleted", + "Superseded", + "Superceded", + "Malfunctioned", + "NotSupported", + "Disabled" + ], + "type": "string", + "description": "Plugin load status." + }, + "PluginUninstalledMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/PluginInfo" + } + ], + "description": "This is a serializable stub class that is used by the api to provide information about installed plugins.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "PackageUninstalled", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Plugin uninstalled message." + }, + "PreviousItemRequestDto": { + "type": "object", + "properties": { + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playing item identifier.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class PreviousItemRequestDto." + }, + "ProblemDetails": { + "type": "object", + "properties": { + "type": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "status": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "detail": { + "type": "string", + "nullable": true + }, + "instance": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": { } + }, + "ProcessPriorityClass": { + "enum": [ + "Normal", + "Idle", + "High", + "RealTime", + "BelowNormal", + "AboveNormal" + ], + "type": "string" + }, + "ProfileCondition": { + "type": "object", + "properties": { + "Condition": { + "enum": [ + "Equals", + "NotEquals", + "LessThanEqual", + "GreaterThanEqual", + "EqualsAny" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ProfileConditionType" + } + ] + }, + "Property": { + "enum": [ + "AudioChannels", + "AudioBitrate", + "AudioProfile", + "Width", + "Height", + "Has64BitOffsets", + "PacketLength", + "VideoBitDepth", + "VideoBitrate", + "VideoFramerate", + "VideoLevel", + "VideoProfile", + "VideoTimestamp", + "IsAnamorphic", + "RefFrames", + "NumAudioStreams", + "NumVideoStreams", + "IsSecondaryAudio", + "VideoCodecTag", + "IsAvc", + "IsInterlaced", + "AudioSampleRate", + "AudioBitDepth", + "VideoRangeType", + "NumStreams" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ProfileConditionValue" + } + ] + }, + "Value": { + "type": "string", + "nullable": true + }, + "IsRequired": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "ProfileConditionType": { + "enum": [ + "Equals", + "NotEquals", + "LessThanEqual", + "GreaterThanEqual", + "EqualsAny" + ], + "type": "string" + }, + "ProfileConditionValue": { + "enum": [ + "AudioChannels", + "AudioBitrate", + "AudioProfile", + "Width", + "Height", + "Has64BitOffsets", + "PacketLength", + "VideoBitDepth", + "VideoBitrate", + "VideoFramerate", + "VideoLevel", + "VideoProfile", + "VideoTimestamp", + "IsAnamorphic", + "RefFrames", + "NumAudioStreams", + "NumVideoStreams", + "IsSecondaryAudio", + "VideoCodecTag", + "IsAvc", + "IsInterlaced", + "AudioSampleRate", + "AudioBitDepth", + "VideoRangeType", + "NumStreams" + ], + "type": "string" + }, + "ProgramAudio": { + "enum": [ + "Mono", + "Stereo", + "Dolby", + "DolbyDigital", + "Thx", + "Atmos" + ], + "type": "string" + }, + "PublicSystemInfo": { + "type": "object", + "properties": { + "LocalAddress": { + "type": "string", + "description": "Gets or sets the local address.", + "nullable": true + }, + "ServerName": { + "type": "string", + "description": "Gets or sets the name of the server.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the server version.", + "nullable": true + }, + "ProductName": { + "type": "string", + "description": "Gets or sets the product name. This is the AssemblyProduct name.", + "nullable": true + }, + "OperatingSystem": { + "type": "string", + "description": "Gets or sets the operating system.", + "nullable": true, + "deprecated": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "StartupWizardCompleted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the startup wizard is completed.", + "nullable": true + } + }, + "additionalProperties": false + }, + "QueryFilters": { + "type": "object", + "properties": { + "Genres": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "nullable": true + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "QueryFiltersLegacy": { + "type": "object", + "properties": { + "Genres": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "OfficialRatings": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Years": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "QueueItem": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "format": "uuid" + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "QueueRequestDto": { + "type": "object", + "properties": { + "ItemIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the items to enqueue." + }, + "Mode": { + "enum": [ + "Queue", + "QueueNext" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupQueueMode" + } + ], + "description": "Enum GroupQueueMode." + } + }, + "additionalProperties": false, + "description": "Class QueueRequestDto." + }, + "QuickConnectDto": { + "required": [ + "Secret" + ], + "type": "object", + "properties": { + "Secret": { + "type": "string", + "description": "Gets or sets the quick connect secret." + } + }, + "additionalProperties": false, + "description": "The quick connect request body." + }, + "QuickConnectResult": { + "type": "object", + "properties": { + "Authenticated": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this request is authorized." + }, + "Secret": { + "type": "string", + "description": "Gets the secret value used to uniquely identify this request. Can be used to retrieve authentication information." + }, + "Code": { + "type": "string", + "description": "Gets the user facing code used so the user can quickly differentiate this request from others." + }, + "DeviceId": { + "type": "string", + "description": "Gets the requesting device id." + }, + "DeviceName": { + "type": "string", + "description": "Gets the requesting device name." + }, + "AppName": { + "type": "string", + "description": "Gets the requesting app name." + }, + "AppVersion": { + "type": "string", + "description": "Gets the requesting app version." + }, + "DateAdded": { + "type": "string", + "description": "Gets or sets the DateTime that this request was created.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Stores the state of an quick connect request." + }, + "RatingType": { + "enum": [ + "Score", + "Likes" + ], + "type": "string" + }, + "ReadyRequestDto": { + "type": "object", + "properties": { + "When": { + "type": "string", + "description": "Gets or sets when the request has been made by the client.", + "format": "date-time" + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64" + }, + "IsPlaying": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the client playback is unpaused." + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist item identifier of the playing item.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class ReadyRequest." + }, + "RecommendationDto": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + }, + "nullable": true + }, + "RecommendationType": { + "enum": [ + "SimilarToRecentlyPlayed", + "SimilarToLikedItem", + "HasDirectorFromRecentlyPlayed", + "HasActorFromRecentlyPlayed", + "HasLikedDirector", + "HasLikedActor" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RecommendationType" + } + ] + }, + "BaselineItemName": { + "type": "string", + "nullable": true + }, + "CategoryId": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "RecommendationType": { + "enum": [ + "SimilarToRecentlyPlayed", + "SimilarToLikedItem", + "HasDirectorFromRecentlyPlayed", + "HasActorFromRecentlyPlayed", + "HasLikedDirector", + "HasLikedActor" + ], + "type": "string" + }, + "RecordingStatus": { + "enum": [ + "New", + "InProgress", + "Completed", + "Cancelled", + "ConflictedOk", + "ConflictedNotOk", + "Error" + ], + "type": "string" + }, + "RefreshProgressMessage": { + "type": "object", + "properties": { + "Data": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "RefreshProgress", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Refresh progress message." + }, + "RemoteImageInfo": { + "type": "object", + "properties": { + "ProviderName": { + "type": "string", + "description": "Gets or sets the name of the provider.", + "nullable": true + }, + "Url": { + "type": "string", + "description": "Gets or sets the URL.", + "nullable": true + }, + "ThumbnailUrl": { + "type": "string", + "description": "Gets or sets a url used for previewing a smaller version.", + "nullable": true + }, + "Height": { + "type": "integer", + "description": "Gets or sets the height.", + "format": "int32", + "nullable": true + }, + "Width": { + "type": "integer", + "description": "Gets or sets the width.", + "format": "int32", + "nullable": true + }, + "CommunityRating": { + "type": "number", + "description": "Gets or sets the community rating.", + "format": "double", + "nullable": true + }, + "VoteCount": { + "type": "integer", + "description": "Gets or sets the vote count.", + "format": "int32", + "nullable": true + }, + "Language": { + "type": "string", + "description": "Gets or sets the language.", + "nullable": true + }, + "Type": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Gets or sets the type." + }, + "RatingType": { + "enum": [ + "Score", + "Likes" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RatingType" + } + ], + "description": "Gets or sets the type of the rating." + } + }, + "additionalProperties": false, + "description": "Class RemoteImageInfo." + }, + "RemoteImageResult": { + "type": "object", + "properties": { + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteImageInfo" + }, + "description": "Gets or sets the images.", + "nullable": true + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total record count.", + "format": "int32" + }, + "Providers": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the providers.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class RemoteImageResult." + }, + "RemoteLyricInfoDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the id for the lyric." + }, + "ProviderName": { + "type": "string", + "description": "Gets the provider name." + }, + "Lyrics": { + "allOf": [ + { + "$ref": "#/components/schemas/LyricDto" + } + ], + "description": "Gets the lyrics." + } + }, + "additionalProperties": false, + "description": "The remote lyric info dto." + }, + "RemoteSearchResult": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "ProductionYear": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "IndexNumberEnd": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "ImageUrl": { + "type": "string", + "nullable": true + }, + "SearchProviderName": { + "type": "string", + "nullable": true + }, + "Overview": { + "type": "string", + "nullable": true + }, + "AlbumArtist": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoteSearchResult" + } + ], + "nullable": true + }, + "Artists": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "RemoteSubtitleInfo": { + "type": "object", + "properties": { + "ThreeLetterISOLanguageName": { + "type": "string", + "nullable": true + }, + "Id": { + "type": "string", + "nullable": true + }, + "ProviderName": { + "type": "string", + "nullable": true + }, + "Name": { + "type": "string", + "nullable": true + }, + "Format": { + "type": "string", + "nullable": true + }, + "Author": { + "type": "string", + "nullable": true + }, + "Comment": { + "type": "string", + "nullable": true + }, + "DateCreated": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "CommunityRating": { + "type": "number", + "format": "float", + "nullable": true + }, + "FrameRate": { + "type": "number", + "format": "float", + "nullable": true + }, + "DownloadCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "IsHashMatch": { + "type": "boolean", + "nullable": true + }, + "AiTranslated": { + "type": "boolean", + "nullable": true + }, + "MachineTranslated": { + "type": "boolean", + "nullable": true + }, + "Forced": { + "type": "boolean", + "nullable": true + }, + "HearingImpaired": { + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": false + }, + "RemoveFromPlaylistRequestDto": { + "type": "object", + "properties": { + "PlaylistItemIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the playlist identifiers of the items. Ignored when clearing the playlist." + }, + "ClearPlaylist": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the entire playlist should be cleared." + }, + "ClearPlayingItem": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the playing item should be removed as well. Used only when clearing the playlist." + } + }, + "additionalProperties": false, + "description": "Class RemoveFromPlaylistRequestDto." + }, + "RepeatMode": { + "enum": [ + "RepeatNone", + "RepeatAll", + "RepeatOne" + ], + "type": "string" + }, + "RepositoryInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Url": { + "type": "string", + "description": "Gets or sets the URL.", + "nullable": true + }, + "Enabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the repository is enabled." + } + }, + "additionalProperties": false, + "description": "Class RepositoryInfo." + }, + "RestartRequiredMessage": { + "type": "object", + "properties": { + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "RestartRequired", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Restart required." + }, + "ScheduledTaskEndedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskResult" + } + ], + "description": "Class TaskExecutionInfo.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ScheduledTaskEnded", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Scheduled task ended message." + }, + "ScheduledTasksInfoMessage": { + "type": "object", + "properties": { + "Data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskInfo" + }, + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ScheduledTasksInfo", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Scheduled tasks info message." + }, + "ScheduledTasksInfoStartMessage": { + "type": "object", + "properties": { + "Data": { + "type": "string", + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ScheduledTasksInfoStart", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Scheduled tasks info start message.\r\nData is the timing data encoded as \"$initialDelay,$interval\" in ms." + }, + "ScheduledTasksInfoStopMessage": { + "type": "object", + "properties": { + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ScheduledTasksInfoStop", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Scheduled tasks info stop message." + }, + "ScrollDirection": { + "enum": [ + "Horizontal", + "Vertical" + ], + "type": "string", + "description": "An enum representing the axis that should be scrolled." + }, + "SearchHint": { + "type": "object", + "properties": { + "ItemId": { + "type": "string", + "description": "Gets or sets the item id.", + "format": "uuid", + "deprecated": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the item id.", + "format": "uuid" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "MatchedTerm": { + "type": "string", + "description": "Gets or sets the matched term.", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "description": "Gets or sets the index number.", + "format": "int32", + "nullable": true + }, + "ProductionYear": { + "type": "integer", + "description": "Gets or sets the production year.", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "description": "Gets or sets the parent index number.", + "format": "int32", + "nullable": true + }, + "PrimaryImageTag": { + "type": "string", + "description": "Gets or sets the image tag.", + "nullable": true + }, + "ThumbImageTag": { + "type": "string", + "description": "Gets or sets the thumb image tag.", + "nullable": true + }, + "ThumbImageItemId": { + "type": "string", + "description": "Gets or sets the thumb image item identifier.", + "nullable": true + }, + "BackdropImageTag": { + "type": "string", + "description": "Gets or sets the backdrop image tag.", + "nullable": true + }, + "BackdropImageItemId": { + "type": "string", + "description": "Gets or sets the backdrop image item identifier.", + "nullable": true + }, + "Type": { + "enum": [ + "AggregateFolder", + "Audio", + "AudioBook", + "BasePluginFolder", + "Book", + "BoxSet", + "Channel", + "ChannelFolderItem", + "CollectionFolder", + "Episode", + "Folder", + "Genre", + "ManualPlaylistsFolder", + "Movie", + "LiveTvChannel", + "LiveTvProgram", + "MusicAlbum", + "MusicArtist", + "MusicGenre", + "MusicVideo", + "Person", + "Photo", + "PhotoAlbum", + "Playlist", + "PlaylistsFolder", + "Program", + "Recording", + "Season", + "Series", + "Studio", + "Trailer", + "TvChannel", + "TvProgram", + "UserRootFolder", + "UserView", + "Video", + "Year" + ], + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemKind" + } + ], + "description": "The base item kind." + }, + "IsFolder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is folder.", + "nullable": true + }, + "RunTimeTicks": { + "type": "integer", + "description": "Gets or sets the run time ticks.", + "format": "int64", + "nullable": true + }, + "MediaType": { + "enum": [ + "Unknown", + "Video", + "Audio", + "Photo", + "Book" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaType" + } + ], + "description": "Media types.", + "default": "Unknown" + }, + "StartDate": { + "type": "string", + "description": "Gets or sets the start date.", + "format": "date-time", + "nullable": true + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date.", + "format": "date-time", + "nullable": true + }, + "Series": { + "type": "string", + "description": "Gets or sets the series.", + "nullable": true + }, + "Status": { + "type": "string", + "description": "Gets or sets the status.", + "nullable": true + }, + "Album": { + "type": "string", + "description": "Gets or sets the album.", + "nullable": true + }, + "AlbumId": { + "type": "string", + "description": "Gets or sets the album id.", + "format": "uuid", + "nullable": true + }, + "AlbumArtist": { + "type": "string", + "description": "Gets or sets the album artist.", + "nullable": true + }, + "Artists": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the artists." + }, + "SongCount": { + "type": "integer", + "description": "Gets or sets the song count.", + "format": "int32", + "nullable": true + }, + "EpisodeCount": { + "type": "integer", + "description": "Gets or sets the episode count.", + "format": "int32", + "nullable": true + }, + "ChannelId": { + "type": "string", + "description": "Gets or sets the channel identifier.", + "format": "uuid", + "nullable": true + }, + "ChannelName": { + "type": "string", + "description": "Gets or sets the name of the channel.", + "nullable": true + }, + "PrimaryImageAspectRatio": { + "type": "number", + "description": "Gets or sets the primary image aspect ratio.", + "format": "double", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class SearchHintResult." + }, + "SearchHintResult": { + "type": "object", + "properties": { + "SearchHints": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SearchHint" + }, + "description": "Gets the search hints." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets the total record count.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Class SearchHintResult." + }, + "SeekRequestDto": { + "type": "object", + "properties": { + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Class SeekRequestDto." + }, + "SendCommand": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid" + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets the playlist identifier of the playing item.", + "format": "uuid" + }, + "When": { + "type": "string", + "description": "Gets or sets the UTC time when to execute the command.", + "format": "date-time" + }, + "PositionTicks": { + "type": "integer", + "description": "Gets the position ticks.", + "format": "int64", + "nullable": true + }, + "Command": { + "enum": [ + "Unpause", + "Pause", + "Stop", + "Seek" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SendCommandType" + } + ], + "description": "Gets the command." + }, + "EmittedAt": { + "type": "string", + "description": "Gets the UTC time when this command has been emitted.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Class SendCommand." + }, + "SendCommandType": { + "enum": [ + "Unpause", + "Pause", + "Stop", + "Seek" + ], + "type": "string", + "description": "Enum SendCommandType." + }, + "SeriesInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "SeriesInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "SeriesStatus": { + "enum": [ + "Continuing", + "Ended", + "Unreleased" + ], + "type": "string", + "description": "The status of a series." + }, + "SeriesTimerCancelledMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerEventInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SeriesTimerCancelled", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Series timer cancelled message." + }, + "SeriesTimerCreatedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerEventInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SeriesTimerCreated", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Series timer created message." + }, + "SeriesTimerInfoDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the Id of the recording.", + "nullable": true + }, + "Type": { + "type": "string", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server identifier.", + "nullable": true + }, + "ExternalId": { + "type": "string", + "description": "Gets or sets the external identifier.", + "nullable": true + }, + "ChannelId": { + "type": "string", + "description": "Gets or sets the channel id of the recording.", + "format": "uuid" + }, + "ExternalChannelId": { + "type": "string", + "description": "Gets or sets the external channel identifier.", + "nullable": true + }, + "ChannelName": { + "type": "string", + "description": "Gets or sets the channel name of the recording.", + "nullable": true + }, + "ChannelPrimaryImageTag": { + "type": "string", + "nullable": true + }, + "ProgramId": { + "type": "string", + "description": "Gets or sets the program identifier.", + "nullable": true + }, + "ExternalProgramId": { + "type": "string", + "description": "Gets or sets the external program identifier.", + "nullable": true + }, + "Name": { + "type": "string", + "description": "Gets or sets the name of the recording.", + "nullable": true + }, + "Overview": { + "type": "string", + "description": "Gets or sets the description of the recording.", + "nullable": true + }, + "StartDate": { + "type": "string", + "description": "Gets or sets the start date of the recording, in UTC.", + "format": "date-time" + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date of the recording, in UTC.", + "format": "date-time" + }, + "ServiceName": { + "type": "string", + "description": "Gets or sets the name of the service.", + "nullable": true + }, + "Priority": { + "type": "integer", + "description": "Gets or sets the priority.", + "format": "int32" + }, + "PrePaddingSeconds": { + "type": "integer", + "description": "Gets or sets the pre padding seconds.", + "format": "int32" + }, + "PostPaddingSeconds": { + "type": "integer", + "description": "Gets or sets the post padding seconds.", + "format": "int32" + }, + "IsPrePaddingRequired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is pre padding required." + }, + "ParentBackdropItemId": { + "type": "string", + "description": "Gets or sets the Id of the Parent that has a backdrop if the item does not have one.", + "nullable": true + }, + "ParentBackdropImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the parent backdrop image tags.", + "nullable": true + }, + "IsPostPaddingRequired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is post padding required." + }, + "KeepUntil": { + "enum": [ + "UntilDeleted", + "UntilSpaceNeeded", + "UntilWatched", + "UntilDate" + ], + "allOf": [ + { + "$ref": "#/components/schemas/KeepUntil" + } + ] + }, + "RecordAnyTime": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [record any time]." + }, + "SkipEpisodesInLibrary": { + "type": "boolean" + }, + "RecordAnyChannel": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [record any channel]." + }, + "KeepUpTo": { + "type": "integer", + "format": "int32" + }, + "RecordNewOnly": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [record new only]." + }, + "Days": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DayOfWeek" + }, + "description": "Gets or sets the days.", + "nullable": true + }, + "DayPattern": { + "enum": [ + "Daily", + "Weekdays", + "Weekends" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DayPattern" + } + ], + "description": "Gets or sets the day pattern.", + "nullable": true + }, + "ImageTags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Gets or sets the image tags.", + "nullable": true + }, + "ParentThumbItemId": { + "type": "string", + "description": "Gets or sets the parent thumb item id.", + "nullable": true + }, + "ParentThumbImageTag": { + "type": "string", + "description": "Gets or sets the parent thumb image tag.", + "nullable": true + }, + "ParentPrimaryImageItemId": { + "type": "string", + "description": "Gets or sets the parent primary image item identifier.", + "format": "uuid", + "nullable": true + }, + "ParentPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the parent primary image tag.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class SeriesTimerInfoDto." + }, + "SeriesTimerInfoDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "ServerConfiguration": { + "type": "object", + "properties": { + "LogFileRetentionDays": { + "type": "integer", + "description": "Gets or sets the number of days we should retain log files.", + "format": "int32" + }, + "IsStartupWizardCompleted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is first run." + }, + "CachePath": { + "type": "string", + "description": "Gets or sets the cache path.", + "nullable": true + }, + "PreviousVersion": { + "type": "string", + "description": "Gets or sets the last known version that was ran using the configuration.", + "nullable": true + }, + "PreviousVersionStr": { + "type": "string", + "description": "Gets or sets the stringified PreviousVersion to be stored/loaded,\r\nbecause System.Version itself isn't xml-serializable.", + "nullable": true + }, + "EnableMetrics": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable prometheus metrics exporting." + }, + "EnableNormalizedItemByNameIds": { + "type": "boolean" + }, + "IsPortAuthorized": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is port authorized." + }, + "QuickConnectAvailable": { + "type": "boolean", + "description": "Gets or sets a value indicating whether quick connect is available for use on this server." + }, + "EnableCaseSensitiveItemIds": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [enable case-sensitive item ids]." + }, + "DisableLiveTvChannelUserDataName": { + "type": "boolean" + }, + "MetadataPath": { + "type": "string", + "description": "Gets or sets the metadata path." + }, + "PreferredMetadataLanguage": { + "type": "string", + "description": "Gets or sets the preferred metadata language." + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code." + }, + "SortReplaceCharacters": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets characters to be replaced with a ' ' in strings to create a sort name." + }, + "SortRemoveCharacters": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets characters to be removed from strings to create a sort name." + }, + "SortRemoveWords": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets words to be removed from strings to create a sort name." + }, + "MinResumePct": { + "type": "integer", + "description": "Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated.", + "format": "int32" + }, + "MaxResumePct": { + "type": "integer", + "description": "Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched.", + "format": "int32" + }, + "MinResumeDurationSeconds": { + "type": "integer", + "description": "Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates..", + "format": "int32" + }, + "MinAudiobookResume": { + "type": "integer", + "description": "Gets or sets the minimum minutes of a book that must be played in order for playstate to be updated.", + "format": "int32" + }, + "MaxAudiobookResume": { + "type": "integer", + "description": "Gets or sets the remaining minutes of a book that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched.", + "format": "int32" + }, + "InactiveSessionThreshold": { + "type": "integer", + "description": "Gets or sets the threshold in minutes after a inactive session gets closed automatically.\r\nIf set to 0 the check for inactive sessions gets disabled.", + "format": "int32" + }, + "LibraryMonitorDelay": { + "type": "integer", + "description": "Gets or sets the delay in seconds that we will wait after a file system change to try and discover what has been added/removed\r\nSome delay is necessary with some items because their creation is not atomic. It involves the creation of several\r\ndifferent directories and files.", + "format": "int32" + }, + "LibraryUpdateDuration": { + "type": "integer", + "description": "Gets or sets the duration in seconds that we will wait after a library updated event before executing the library changed notification.", + "format": "int32" + }, + "CacheSize": { + "type": "integer", + "description": "Gets or sets the maximum amount of items to cache.", + "format": "int32" + }, + "ImageSavingConvention": { + "enum": [ + "Legacy", + "Compatible" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageSavingConvention" + } + ], + "description": "Gets or sets the image saving convention." + }, + "MetadataOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetadataOptions" + } + }, + "SkipDeserializationForBasicTypes": { + "type": "boolean" + }, + "ServerName": { + "type": "string" + }, + "UICulture": { + "type": "string" + }, + "SaveMetadataHidden": { + "type": "boolean" + }, + "ContentTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameValuePair" + } + }, + "RemoteClientBitrateLimit": { + "type": "integer", + "format": "int32" + }, + "EnableFolderView": { + "type": "boolean" + }, + "EnableGroupingMoviesIntoCollections": { + "type": "boolean" + }, + "EnableGroupingShowsIntoCollections": { + "type": "boolean" + }, + "DisplaySpecialsWithinSeasons": { + "type": "boolean" + }, + "CodecsUsed": { + "type": "array", + "items": { + "type": "string" + } + }, + "PluginRepositories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + }, + "EnableExternalContentInSuggestions": { + "type": "boolean" + }, + "ImageExtractionTimeoutMs": { + "type": "integer", + "format": "int32" + }, + "PathSubstitutions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PathSubstitution" + } + }, + "EnableSlowResponseWarning": { + "type": "boolean", + "description": "Gets or sets a value indicating whether slow server responses should be logged as a warning." + }, + "SlowResponseThresholdMs": { + "type": "integer", + "description": "Gets or sets the threshold for the slow response time warning in ms.", + "format": "int64" + }, + "CorsHosts": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the cors hosts." + }, + "ActivityLogRetentionDays": { + "type": "integer", + "description": "Gets or sets the number of days we should retain activity logs.", + "format": "int32", + "nullable": true + }, + "LibraryScanFanoutConcurrency": { + "type": "integer", + "description": "Gets or sets the how the library scan fans out.", + "format": "int32" + }, + "LibraryMetadataRefreshConcurrency": { + "type": "integer", + "description": "Gets or sets the how many metadata refreshes can run concurrently.", + "format": "int32" + }, + "AllowClientLogUpload": { + "type": "boolean", + "description": "Gets or sets a value indicating whether clients should be allowed to upload logs." + }, + "DummyChapterDuration": { + "type": "integer", + "description": "Gets or sets the dummy chapter duration in seconds, use 0 (zero) or less to disable generation altogether.", + "format": "int32" + }, + "ChapterImageResolution": { + "enum": [ + "MatchSource", + "P144", + "P240", + "P360", + "P480", + "P720", + "P1080", + "P1440", + "P2160" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageResolution" + } + ], + "description": "Gets or sets the chapter image resolution." + }, + "ParallelImageEncodingLimit": { + "type": "integer", + "description": "Gets or sets the limit for parallel image encoding.", + "format": "int32" + }, + "CastReceiverApplications": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CastReceiverApplication" + }, + "description": "Gets or sets the list of cast receiver applications." + }, + "TrickplayOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/TrickplayOptions" + } + ], + "description": "Gets or sets the trickplay options." + }, + "EnableLegacyAuthorization": { + "type": "boolean", + "description": "Gets or sets a value indicating whether old authorization methods are allowed." + } + }, + "additionalProperties": false, + "description": "Represents the server configuration." + }, + "ServerDiscoveryInfo": { + "type": "object", + "properties": { + "Address": { + "type": "string", + "description": "Gets the address." + }, + "Id": { + "type": "string", + "description": "Gets the server identifier." + }, + "Name": { + "type": "string", + "description": "Gets the name." + }, + "EndpointAddress": { + "type": "string", + "description": "Gets the endpoint address.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The server discovery info model." + }, + "ServerRestartingMessage": { + "type": "object", + "properties": { + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ServerRestarting", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Server restarting down message." + }, + "ServerShuttingDownMessage": { + "type": "object", + "properties": { + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ServerShuttingDown", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Server shutting down message." + }, + "SessionInfoDto": { + "type": "object", + "properties": { + "PlayState": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayerStateInfo" + } + ], + "description": "Gets or sets the play state.", + "nullable": true + }, + "AdditionalUsers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionUserInfo" + }, + "description": "Gets or sets the additional users.", + "nullable": true + }, + "Capabilities": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Gets or sets the client capabilities.", + "nullable": true + }, + "RemoteEndPoint": { + "type": "string", + "description": "Gets or sets the remote end point.", + "nullable": true + }, + "PlayableMediaTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + }, + "description": "Gets or sets the playable media types." + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid" + }, + "UserName": { + "type": "string", + "description": "Gets or sets the username.", + "nullable": true + }, + "Client": { + "type": "string", + "description": "Gets or sets the type of the client.", + "nullable": true + }, + "LastActivityDate": { + "type": "string", + "description": "Gets or sets the last activity date.", + "format": "date-time" + }, + "LastPlaybackCheckIn": { + "type": "string", + "description": "Gets or sets the last playback check in.", + "format": "date-time" + }, + "LastPausedDate": { + "type": "string", + "description": "Gets or sets the last paused date.", + "format": "date-time", + "nullable": true + }, + "DeviceName": { + "type": "string", + "description": "Gets or sets the name of the device.", + "nullable": true + }, + "DeviceType": { + "type": "string", + "description": "Gets or sets the type of the device.", + "nullable": true + }, + "NowPlayingItem": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the now playing item.", + "nullable": true + }, + "NowViewingItem": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the now viewing item.", + "nullable": true + }, + "DeviceId": { + "type": "string", + "description": "Gets or sets the device id.", + "nullable": true + }, + "ApplicationVersion": { + "type": "string", + "description": "Gets or sets the application version.", + "nullable": true + }, + "TranscodingInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/TranscodingInfo" + } + ], + "description": "Gets or sets the transcoding info.", + "nullable": true + }, + "IsActive": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this session is active." + }, + "SupportsMediaControl": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the session supports media control." + }, + "SupportsRemoteControl": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the session supports remote control." + }, + "NowPlayingQueue": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueItem" + }, + "description": "Gets or sets the now playing queue.", + "nullable": true + }, + "NowPlayingQueueFullItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + }, + "description": "Gets or sets the now playing queue full items.", + "nullable": true + }, + "HasCustomDeviceName": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the session has a custom device name." + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist item id.", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server id.", + "nullable": true + }, + "UserPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the user primary image tag.", + "nullable": true + }, + "SupportedCommands": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneralCommandType" + }, + "description": "Gets or sets the supported commands." + } + }, + "additionalProperties": false, + "description": "Session info DTO." + }, + "SessionMessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "type": "string", + "description": "The different kinds of messages that are used in the WebSocket api." + }, + "SessionsMessage": { + "type": "object", + "properties": { + "Data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionInfoDto" + }, + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "Sessions", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Sessions message." + }, + "SessionsStartMessage": { + "type": "object", + "properties": { + "Data": { + "type": "string", + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SessionsStart", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Sessions start message.\r\nData is the timing data encoded as \"$initialDelay,$interval\" in ms." + }, + "SessionsStopMessage": { + "type": "object", + "properties": { + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SessionsStop", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Sessions stop message." + }, + "SessionUserInfo": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "description": "Gets or sets the user identifier.", + "format": "uuid" + }, + "UserName": { + "type": "string", + "description": "Gets or sets the name of the user.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class SessionUserInfo." + }, + "SetChannelMappingDto": { + "required": [ + "ProviderChannelId", + "ProviderId", + "TunerChannelId" + ], + "type": "object", + "properties": { + "ProviderId": { + "type": "string", + "description": "Gets or sets the provider id." + }, + "TunerChannelId": { + "type": "string", + "description": "Gets or sets the tuner channel id." + }, + "ProviderChannelId": { + "type": "string", + "description": "Gets or sets the provider channel id." + } + }, + "additionalProperties": false, + "description": "Set channel mapping dto." + }, + "SetPlaylistItemRequestDto": { + "type": "object", + "properties": { + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist identifier of the playing item.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class SetPlaylistItemRequestDto." + }, + "SetRepeatModeRequestDto": { + "type": "object", + "properties": { + "Mode": { + "enum": [ + "RepeatOne", + "RepeatAll", + "RepeatNone" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupRepeatMode" + } + ], + "description": "Enum GroupRepeatMode." + } + }, + "additionalProperties": false, + "description": "Class SetRepeatModeRequestDto." + }, + "SetShuffleModeRequestDto": { + "type": "object", + "properties": { + "Mode": { + "enum": [ + "Sorted", + "Shuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupShuffleMode" + } + ], + "description": "Enum GroupShuffleMode." + } + }, + "additionalProperties": false, + "description": "Class SetShuffleModeRequestDto." + }, + "SongInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "AlbumArtists": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Album": { + "type": "string", + "nullable": true + }, + "Artists": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "SortOrder": { + "enum": [ + "Ascending", + "Descending" + ], + "type": "string", + "description": "An enum representing the sorting order." + }, + "SpecialViewOptionDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets view option name.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets view option id.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Special view option dto." + }, + "StartupConfigurationDto": { + "type": "object", + "properties": { + "ServerName": { + "type": "string", + "description": "Gets or sets the server name.", + "nullable": true + }, + "UICulture": { + "type": "string", + "description": "Gets or sets UI language culture.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "PreferredMetadataLanguage": { + "type": "string", + "description": "Gets or sets the preferred language for the metadata.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The startup configuration DTO." + }, + "StartupRemoteAccessDto": { + "required": [ + "EnableAutomaticPortMapping", + "EnableRemoteAccess" + ], + "type": "object", + "properties": { + "EnableRemoteAccess": { + "type": "boolean", + "description": "Gets or sets a value indicating whether enable remote access." + }, + "EnableAutomaticPortMapping": { + "type": "boolean", + "description": "Gets or sets a value indicating whether enable automatic port mapping.", + "deprecated": true + } + }, + "additionalProperties": false, + "description": "Startup remote access dto." + }, + "StartupUserDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the username.", + "nullable": true + }, + "Password": { + "type": "string", + "description": "Gets or sets the user's password.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The startup user DTO." + }, + "SubtitleDeliveryMethod": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "type": "string", + "description": "Delivery method to use during playback of a specific subtitle format." + }, + "SubtitleOptions": { + "type": "object", + "properties": { + "SkipIfEmbeddedSubtitlesPresent": { + "type": "boolean" + }, + "SkipIfAudioTrackMatches": { + "type": "boolean" + }, + "DownloadLanguages": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DownloadMovieSubtitles": { + "type": "boolean" + }, + "DownloadEpisodeSubtitles": { + "type": "boolean" + }, + "OpenSubtitlesUsername": { + "type": "string", + "nullable": true + }, + "OpenSubtitlesPasswordHash": { + "type": "string", + "nullable": true + }, + "IsOpenSubtitleVipAccount": { + "type": "boolean" + }, + "RequirePerfectMatch": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "SubtitlePlaybackMode": { + "enum": [ + "Default", + "Always", + "OnlyForced", + "None", + "Smart" + ], + "type": "string", + "description": "An enum representing a subtitle playback mode." + }, + "SubtitleProfile": { + "type": "object", + "properties": { + "Format": { + "type": "string", + "description": "Gets or sets the format.", + "nullable": true + }, + "Method": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ], + "description": "Gets or sets the delivery method." + }, + "DidlMode": { + "type": "string", + "description": "Gets or sets the DIDL mode.", + "nullable": true + }, + "Language": { + "type": "string", + "description": "Gets or sets the language.", + "nullable": true + }, + "Container": { + "type": "string", + "description": "Gets or sets the container.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "A class for subtitle profile information." + }, + "SyncPlayCommandMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/SendCommand" + } + ], + "description": "Class SendCommand.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SyncPlayCommand", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Sync play command." + }, + "SyncPlayGroupDoesNotExistUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "type": "string", + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "GroupDoesNotExist", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SyncPlayGroupJoinedUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/GroupInfoDto" + } + ], + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "GroupJoined", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SyncPlayGroupLeftUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "type": "string", + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "GroupLeft", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SyncPlayGroupUpdateMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdate" + } + ], + "description": "Group update data" + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SyncPlayGroupUpdate", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Untyped sync play command." + }, + "SyncPlayLibraryAccessDeniedUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "type": "string", + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "LibraryAccessDenied", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SyncPlayNotInGroupUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "type": "string", + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "NotInGroup", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SyncPlayPlayQueueUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayQueueUpdate" + } + ], + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "PlayQueue", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SyncPlayQueueItem": { + "type": "object", + "properties": { + "ItemId": { + "type": "string", + "description": "Gets the item identifier.", + "format": "uuid" + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets the playlist identifier of the item.", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Class QueueItem." + }, + "SyncPlayStateUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/GroupStateUpdate" + } + ], + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "StateUpdate", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SyncPlayUserAccessType": { + "enum": [ + "CreateAndJoinGroups", + "JoinGroups", + "None" + ], + "type": "string", + "description": "Enum SyncPlayUserAccessType." + }, + "SyncPlayUserJoinedUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "type": "string", + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "UserJoined", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SyncPlayUserLeftUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "type": "string", + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "UserLeft", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SystemInfo": { + "type": "object", + "properties": { + "LocalAddress": { + "type": "string", + "description": "Gets or sets the local address.", + "nullable": true + }, + "ServerName": { + "type": "string", + "description": "Gets or sets the name of the server.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the server version.", + "nullable": true + }, + "ProductName": { + "type": "string", + "description": "Gets or sets the product name. This is the AssemblyProduct name.", + "nullable": true + }, + "OperatingSystem": { + "type": "string", + "description": "Gets or sets the operating system.", + "nullable": true, + "deprecated": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "StartupWizardCompleted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the startup wizard is completed.", + "nullable": true + }, + "OperatingSystemDisplayName": { + "type": "string", + "description": "Gets or sets the display name of the operating system.", + "nullable": true, + "deprecated": true + }, + "PackageName": { + "type": "string", + "description": "Gets or sets the package name.", + "nullable": true + }, + "HasPendingRestart": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has pending restart." + }, + "IsShuttingDown": { + "type": "boolean" + }, + "SupportsLibraryMonitor": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports library monitor]." + }, + "WebSocketPortNumber": { + "type": "integer", + "description": "Gets or sets the web socket port number.", + "format": "int32" + }, + "CompletedInstallations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InstallationInfo" + }, + "description": "Gets or sets the completed installations.", + "nullable": true + }, + "CanSelfRestart": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can self restart.", + "default": true, + "deprecated": true + }, + "CanLaunchWebBrowser": { + "type": "boolean", + "default": false, + "deprecated": true + }, + "ProgramDataPath": { + "type": "string", + "description": "Gets or sets the program data path.", + "nullable": true, + "deprecated": true + }, + "WebPath": { + "type": "string", + "description": "Gets or sets the web UI resources path.", + "nullable": true, + "deprecated": true + }, + "ItemsByNamePath": { + "type": "string", + "description": "Gets or sets the items by name path.", + "nullable": true, + "deprecated": true + }, + "CachePath": { + "type": "string", + "description": "Gets or sets the cache path.", + "nullable": true, + "deprecated": true + }, + "LogPath": { + "type": "string", + "description": "Gets or sets the log path.", + "nullable": true, + "deprecated": true + }, + "InternalMetadataPath": { + "type": "string", + "description": "Gets or sets the internal metadata path.", + "nullable": true, + "deprecated": true + }, + "TranscodingTempPath": { + "type": "string", + "description": "Gets or sets the transcode path.", + "nullable": true, + "deprecated": true + }, + "CastReceiverApplications": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CastReceiverApplication" + }, + "description": "Gets or sets the list of cast receiver applications.", + "nullable": true + }, + "HasUpdateAvailable": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has update available.", + "default": false, + "deprecated": true + }, + "EncoderLocation": { + "type": "string", + "default": "System", + "nullable": true, + "deprecated": true + }, + "SystemArchitecture": { + "type": "string", + "default": "X64", + "nullable": true, + "deprecated": true + } + }, + "additionalProperties": false, + "description": "Class SystemInfo." + }, + "SystemStorageDto": { + "type": "object", + "properties": { + "ProgramDataFolder": { + "allOf": [ + { + "$ref": "#/components/schemas/FolderStorageDto" + } + ], + "description": "Gets or sets the Storage information of the program data folder." + }, + "WebFolder": { + "allOf": [ + { + "$ref": "#/components/schemas/FolderStorageDto" + } + ], + "description": "Gets or sets the Storage information of the web UI resources folder." + }, + "ImageCacheFolder": { + "allOf": [ + { + "$ref": "#/components/schemas/FolderStorageDto" + } + ], + "description": "Gets or sets the Storage information of the folder where images are cached." + }, + "CacheFolder": { + "allOf": [ + { + "$ref": "#/components/schemas/FolderStorageDto" + } + ], + "description": "Gets or sets the Storage information of the cache folder." + }, + "LogFolder": { + "allOf": [ + { + "$ref": "#/components/schemas/FolderStorageDto" + } + ], + "description": "Gets or sets the Storage information of the folder where logfiles are saved to." + }, + "InternalMetadataFolder": { + "allOf": [ + { + "$ref": "#/components/schemas/FolderStorageDto" + } + ], + "description": "Gets or sets the Storage information of the folder where metadata is stored." + }, + "TranscodingTempFolder": { + "allOf": [ + { + "$ref": "#/components/schemas/FolderStorageDto" + } + ], + "description": "Gets or sets the Storage information of the transcoding cache." + }, + "Libraries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryStorageDto" + }, + "description": "Gets or sets the storage informations of all libraries." + } + }, + "additionalProperties": false, + "description": "Contains informations about the systems storage." + }, + "TaskCompletionStatus": { + "enum": [ + "Completed", + "Failed", + "Cancelled", + "Aborted" + ], + "type": "string", + "description": "Enum TaskCompletionStatus." + }, + "TaskInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "State": { + "enum": [ + "Idle", + "Cancelling", + "Running" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TaskState" + } + ], + "description": "Gets or sets the state of the task." + }, + "CurrentProgressPercentage": { + "type": "number", + "description": "Gets or sets the progress.", + "format": "double", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "LastExecutionResult": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskResult" + } + ], + "description": "Gets or sets the last execution result.", + "nullable": true + }, + "Triggers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskTriggerInfo" + }, + "description": "Gets or sets the triggers.", + "nullable": true + }, + "Description": { + "type": "string", + "description": "Gets or sets the description.", + "nullable": true + }, + "Category": { + "type": "string", + "description": "Gets or sets the category.", + "nullable": true + }, + "IsHidden": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is hidden." + }, + "Key": { + "type": "string", + "description": "Gets or sets the key.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class TaskInfo." + }, + "TaskResult": { + "type": "object", + "properties": { + "StartTimeUtc": { + "type": "string", + "description": "Gets or sets the start time UTC.", + "format": "date-time" + }, + "EndTimeUtc": { + "type": "string", + "description": "Gets or sets the end time UTC.", + "format": "date-time" + }, + "Status": { + "enum": [ + "Completed", + "Failed", + "Cancelled", + "Aborted" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TaskCompletionStatus" + } + ], + "description": "Gets or sets the status." + }, + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Key": { + "type": "string", + "description": "Gets or sets the key.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "ErrorMessage": { + "type": "string", + "description": "Gets or sets the error message.", + "nullable": true + }, + "LongErrorMessage": { + "type": "string", + "description": "Gets or sets the long error message.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class TaskExecutionInfo." + }, + "TaskState": { + "enum": [ + "Idle", + "Cancelling", + "Running" + ], + "type": "string", + "description": "Enum TaskState." + }, + "TaskTriggerInfo": { + "type": "object", + "properties": { + "Type": { + "enum": [ + "DailyTrigger", + "WeeklyTrigger", + "IntervalTrigger", + "StartupTrigger" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TaskTriggerInfoType" + } + ], + "description": "Gets or sets the type." + }, + "TimeOfDayTicks": { + "type": "integer", + "description": "Gets or sets the time of day.", + "format": "int64", + "nullable": true + }, + "IntervalTicks": { + "type": "integer", + "description": "Gets or sets the interval.", + "format": "int64", + "nullable": true + }, + "DayOfWeek": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DayOfWeek" + } + ], + "description": "Gets or sets the day of week.", + "nullable": true + }, + "MaxRuntimeTicks": { + "type": "integer", + "description": "Gets or sets the maximum runtime ticks.", + "format": "int64", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class TaskTriggerInfo." + }, + "TaskTriggerInfoType": { + "enum": [ + "DailyTrigger", + "WeeklyTrigger", + "IntervalTrigger", + "StartupTrigger" + ], + "type": "string", + "description": "Enum TaskTriggerInfoType." + }, + "ThemeMediaResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + }, + "OwnerId": { + "type": "string", + "description": "Gets or sets the owner id.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class ThemeMediaResult." + }, + "TimerCancelledMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerEventInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "TimerCancelled", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Timer cancelled message." + }, + "TimerCreatedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerEventInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "TimerCreated", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Timer created message." + }, + "TimerEventInfo": { + "type": "object", + "properties": { + "Id": { + "type": "string" + }, + "ProgramId": { + "type": "string", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "TimerInfoDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the Id of the recording.", + "nullable": true + }, + "Type": { + "type": "string", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server identifier.", + "nullable": true + }, + "ExternalId": { + "type": "string", + "description": "Gets or sets the external identifier.", + "nullable": true + }, + "ChannelId": { + "type": "string", + "description": "Gets or sets the channel id of the recording.", + "format": "uuid" + }, + "ExternalChannelId": { + "type": "string", + "description": "Gets or sets the external channel identifier.", + "nullable": true + }, + "ChannelName": { + "type": "string", + "description": "Gets or sets the channel name of the recording.", + "nullable": true + }, + "ChannelPrimaryImageTag": { + "type": "string", + "nullable": true + }, + "ProgramId": { + "type": "string", + "description": "Gets or sets the program identifier.", + "nullable": true + }, + "ExternalProgramId": { + "type": "string", + "description": "Gets or sets the external program identifier.", + "nullable": true + }, + "Name": { + "type": "string", + "description": "Gets or sets the name of the recording.", + "nullable": true + }, + "Overview": { + "type": "string", + "description": "Gets or sets the description of the recording.", + "nullable": true + }, + "StartDate": { + "type": "string", + "description": "Gets or sets the start date of the recording, in UTC.", + "format": "date-time" + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date of the recording, in UTC.", + "format": "date-time" + }, + "ServiceName": { + "type": "string", + "description": "Gets or sets the name of the service.", + "nullable": true + }, + "Priority": { + "type": "integer", + "description": "Gets or sets the priority.", + "format": "int32" + }, + "PrePaddingSeconds": { + "type": "integer", + "description": "Gets or sets the pre padding seconds.", + "format": "int32" + }, + "PostPaddingSeconds": { + "type": "integer", + "description": "Gets or sets the post padding seconds.", + "format": "int32" + }, + "IsPrePaddingRequired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is pre padding required." + }, + "ParentBackdropItemId": { + "type": "string", + "description": "Gets or sets the Id of the Parent that has a backdrop if the item does not have one.", + "nullable": true + }, + "ParentBackdropImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the parent backdrop image tags.", + "nullable": true + }, + "IsPostPaddingRequired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is post padding required." + }, + "KeepUntil": { + "enum": [ + "UntilDeleted", + "UntilSpaceNeeded", + "UntilWatched", + "UntilDate" + ], + "allOf": [ + { + "$ref": "#/components/schemas/KeepUntil" + } + ] + }, + "Status": { + "enum": [ + "New", + "InProgress", + "Completed", + "Cancelled", + "ConflictedOk", + "ConflictedNotOk", + "Error" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RecordingStatus" + } + ], + "description": "Gets or sets the status." + }, + "SeriesTimerId": { + "type": "string", + "description": "Gets or sets the series timer identifier.", + "nullable": true + }, + "ExternalSeriesTimerId": { + "type": "string", + "description": "Gets or sets the external series timer identifier.", + "nullable": true + }, + "RunTimeTicks": { + "type": "integer", + "description": "Gets or sets the run time ticks.", + "format": "int64", + "nullable": true + }, + "ProgramInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the program information.", + "nullable": true + } + }, + "additionalProperties": false + }, + "TimerInfoDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TimerInfoDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "TonemappingAlgorithm": { + "enum": [ + "none", + "clip", + "linear", + "gamma", + "reinhard", + "hable", + "mobius", + "bt2390" + ], + "type": "string", + "description": "Enum containing tonemapping algorithms." + }, + "TonemappingMode": { + "enum": [ + "auto", + "max", + "rgb", + "lum", + "itp" + ], + "type": "string", + "description": "Enum containing tonemapping modes." + }, + "TonemappingRange": { + "enum": [ + "auto", + "tv", + "pc" + ], + "type": "string", + "description": "Enum containing tonemapping ranges." + }, + "TrailerInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "TrailerInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/TrailerInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "TranscodeReason": { + "enum": [ + "ContainerNotSupported", + "VideoCodecNotSupported", + "AudioCodecNotSupported", + "SubtitleCodecNotSupported", + "AudioIsExternal", + "SecondaryAudioNotSupported", + "VideoProfileNotSupported", + "VideoLevelNotSupported", + "VideoResolutionNotSupported", + "VideoBitDepthNotSupported", + "VideoFramerateNotSupported", + "RefFramesNotSupported", + "AnamorphicVideoNotSupported", + "InterlacedVideoNotSupported", + "AudioChannelsNotSupported", + "AudioProfileNotSupported", + "AudioSampleRateNotSupported", + "AudioBitDepthNotSupported", + "ContainerBitrateExceedsLimit", + "VideoBitrateNotSupported", + "AudioBitrateNotSupported", + "UnknownVideoStreamInfo", + "UnknownAudioStreamInfo", + "DirectPlayError", + "VideoRangeTypeNotSupported", + "VideoCodecTagNotSupported", + "StreamCountExceedsLimit" + ], + "type": "string" + }, + "TranscodeSeekInfo": { + "enum": [ + "Auto", + "Bytes" + ], + "type": "string" + }, + "TranscodingInfo": { + "type": "object", + "properties": { + "AudioCodec": { + "type": "string", + "description": "Gets or sets the thread count used for encoding.", + "nullable": true + }, + "VideoCodec": { + "type": "string", + "description": "Gets or sets the thread count used for encoding.", + "nullable": true + }, + "Container": { + "type": "string", + "description": "Gets or sets the thread count used for encoding.", + "nullable": true + }, + "IsVideoDirect": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the video is passed through." + }, + "IsAudioDirect": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the audio is passed through." + }, + "Bitrate": { + "type": "integer", + "description": "Gets or sets the bitrate.", + "format": "int32", + "nullable": true + }, + "Framerate": { + "type": "number", + "description": "Gets or sets the framerate.", + "format": "float", + "nullable": true + }, + "CompletionPercentage": { + "type": "number", + "description": "Gets or sets the completion percentage.", + "format": "double", + "nullable": true + }, + "Width": { + "type": "integer", + "description": "Gets or sets the video width.", + "format": "int32", + "nullable": true + }, + "Height": { + "type": "integer", + "description": "Gets or sets the video height.", + "format": "int32", + "nullable": true + }, + "AudioChannels": { + "type": "integer", + "description": "Gets or sets the audio channels.", + "format": "int32", + "nullable": true + }, + "HardwareAccelerationType": { + "enum": [ + "none", + "amf", + "qsv", + "nvenc", + "v4l2m2m", + "vaapi", + "videotoolbox", + "rkmpp" + ], + "allOf": [ + { + "$ref": "#/components/schemas/HardwareAccelerationType" + } + ], + "description": "Gets or sets the hardware acceleration type.", + "nullable": true + }, + "TranscodeReasons": { + "enum": [ + "ContainerNotSupported", + "VideoCodecNotSupported", + "AudioCodecNotSupported", + "SubtitleCodecNotSupported", + "AudioIsExternal", + "SecondaryAudioNotSupported", + "VideoProfileNotSupported", + "VideoLevelNotSupported", + "VideoResolutionNotSupported", + "VideoBitDepthNotSupported", + "VideoFramerateNotSupported", + "RefFramesNotSupported", + "AnamorphicVideoNotSupported", + "InterlacedVideoNotSupported", + "AudioChannelsNotSupported", + "AudioProfileNotSupported", + "AudioSampleRateNotSupported", + "AudioBitDepthNotSupported", + "ContainerBitrateExceedsLimit", + "VideoBitrateNotSupported", + "AudioBitrateNotSupported", + "UnknownVideoStreamInfo", + "UnknownAudioStreamInfo", + "DirectPlayError", + "VideoRangeTypeNotSupported", + "VideoCodecTagNotSupported", + "StreamCountExceedsLimit" + ], + "type": "array", + "items": { + "$ref": "#/components/schemas/TranscodeReason" + }, + "description": "Gets or sets the transcode reasons." + } + }, + "additionalProperties": false, + "description": "Class holding information on a running transcode." + }, + "TranscodingProfile": { + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "Gets or sets the container." + }, + "Type": { + "enum": [ + "Audio", + "Video", + "Photo", + "Subtitle", + "Lyric" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DlnaProfileType" + } + ], + "description": "Gets or sets the DLNA profile type." + }, + "VideoCodec": { + "type": "string", + "description": "Gets or sets the video codec." + }, + "AudioCodec": { + "type": "string", + "description": "Gets or sets the audio codec." + }, + "Protocol": { + "enum": [ + "http", + "hls" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaStreamProtocol" + } + ], + "description": "Media streaming protocol.\r\nLowercase for backwards compatibility." + }, + "EstimateContentLength": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the content length should be estimated.", + "default": false + }, + "EnableMpegtsM2TsMode": { + "type": "boolean", + "description": "Gets or sets a value indicating whether M2TS mode is enabled.", + "default": false + }, + "TranscodeSeekInfo": { + "enum": [ + "Auto", + "Bytes" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TranscodeSeekInfo" + } + ], + "description": "Gets or sets the transcoding seek info mode.", + "default": "Auto" + }, + "CopyTimestamps": { + "type": "boolean", + "description": "Gets or sets a value indicating whether timestamps should be copied.", + "default": false + }, + "Context": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ], + "description": "Gets or sets the encoding context.", + "default": "Streaming" + }, + "EnableSubtitlesInManifest": { + "type": "boolean", + "description": "Gets or sets a value indicating whether subtitles are allowed in the manifest.", + "default": false + }, + "MaxAudioChannels": { + "type": "string", + "description": "Gets or sets the maximum audio channels.", + "nullable": true + }, + "MinSegments": { + "type": "integer", + "description": "Gets or sets the minimum amount of segments.", + "format": "int32", + "default": 0 + }, + "SegmentLength": { + "type": "integer", + "description": "Gets or sets the segment length.", + "format": "int32", + "default": 0 + }, + "BreakOnNonKeyFrames": { + "type": "boolean", + "description": "Gets or sets a value indicating whether breaking the video stream on non-keyframes is supported.", + "default": false + }, + "Conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + }, + "description": "Gets or sets the profile conditions." + }, + "EnableAudioVbrEncoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether variable bitrate encoding is supported.", + "default": true + } + }, + "additionalProperties": false, + "description": "A class for transcoding profile information.\r\nNote for client developers: Conditions defined in MediaBrowser.Model.Dlna.CodecProfile has higher priority and can override values defined here." + }, + "TransportStreamTimestamp": { + "enum": [ + "None", + "Zero", + "Valid" + ], + "type": "string" + }, + "TrickplayInfoDto": { + "type": "object", + "properties": { + "Width": { + "type": "integer", + "description": "Gets the width of an individual thumbnail.", + "format": "int32" + }, + "Height": { + "type": "integer", + "description": "Gets the height of an individual thumbnail.", + "format": "int32" + }, + "TileWidth": { + "type": "integer", + "description": "Gets the amount of thumbnails per row.", + "format": "int32" + }, + "TileHeight": { + "type": "integer", + "description": "Gets the amount of thumbnails per column.", + "format": "int32" + }, + "ThumbnailCount": { + "type": "integer", + "description": "Gets the total amount of non-black thumbnails.", + "format": "int32" + }, + "Interval": { + "type": "integer", + "description": "Gets the interval in milliseconds between each trickplay thumbnail.", + "format": "int32" + }, + "Bandwidth": { + "type": "integer", + "description": "Gets the peak bandwidth usage in bits per second.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "The trickplay api model." + }, + "TrickplayOptions": { + "type": "object", + "properties": { + "EnableHwAcceleration": { + "type": "boolean", + "description": "Gets or sets a value indicating whether or not to use HW acceleration." + }, + "EnableHwEncoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether or not to use HW accelerated MJPEG encoding." + }, + "EnableKeyFrameOnlyExtraction": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to only extract key frames.\r\nSignificantly faster, but is not compatible with all decoders and/or video files." + }, + "ScanBehavior": { + "enum": [ + "Blocking", + "NonBlocking" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TrickplayScanBehavior" + } + ], + "description": "Gets or sets the behavior used by trickplay provider on library scan/update." + }, + "ProcessPriority": { + "enum": [ + "Normal", + "Idle", + "High", + "RealTime", + "BelowNormal", + "AboveNormal" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ProcessPriorityClass" + } + ], + "description": "Gets or sets the process priority for the ffmpeg process." + }, + "Interval": { + "type": "integer", + "description": "Gets or sets the interval, in ms, between each new trickplay image.", + "format": "int32" + }, + "WidthResolutions": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "Gets or sets the target width resolutions, in px, to generates preview images for." + }, + "TileWidth": { + "type": "integer", + "description": "Gets or sets number of tile images to allow in X dimension.", + "format": "int32" + }, + "TileHeight": { + "type": "integer", + "description": "Gets or sets number of tile images to allow in Y dimension.", + "format": "int32" + }, + "Qscale": { + "type": "integer", + "description": "Gets or sets the ffmpeg output quality level.", + "format": "int32" + }, + "JpegQuality": { + "type": "integer", + "description": "Gets or sets the jpeg quality to use for image tiles.", + "format": "int32" + }, + "ProcessThreads": { + "type": "integer", + "description": "Gets or sets the number of threads to be used by ffmpeg.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Class TrickplayOptions." + }, + "TrickplayScanBehavior": { + "enum": [ + "Blocking", + "NonBlocking" + ], + "type": "string", + "description": "Enum TrickplayScanBehavior." + }, + "TunerChannelMapping": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "ProviderChannelName": { + "type": "string", + "nullable": true + }, + "ProviderChannelId": { + "type": "string", + "nullable": true + }, + "Id": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "TunerHostInfo": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": true + }, + "Url": { + "type": "string", + "nullable": true + }, + "Type": { + "type": "string", + "nullable": true + }, + "DeviceId": { + "type": "string", + "nullable": true + }, + "FriendlyName": { + "type": "string", + "nullable": true + }, + "ImportFavoritesOnly": { + "type": "boolean" + }, + "AllowHWTranscoding": { + "type": "boolean" + }, + "AllowFmp4TranscodingContainer": { + "type": "boolean" + }, + "AllowStreamSharing": { + "type": "boolean" + }, + "FallbackMaxStreamingBitrate": { + "type": "integer", + "format": "int32" + }, + "EnableStreamLooping": { + "type": "boolean" + }, + "Source": { + "type": "string", + "nullable": true + }, + "TunerCount": { + "type": "integer", + "format": "int32" + }, + "UserAgent": { + "type": "string", + "nullable": true + }, + "IgnoreDts": { + "type": "boolean" + }, + "ReadAtNativeFramerate": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "TypeOptions": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": true + }, + "MetadataFetchers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "MetadataFetcherOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ImageFetchers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ImageFetcherOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ImageOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageOption" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "UnratedItem": { + "enum": [ + "Movie", + "Trailer", + "Series", + "Music", + "Book", + "LiveTvChannel", + "LiveTvProgram", + "ChannelContent", + "Other" + ], + "type": "string", + "description": "An enum representing an unrated item." + }, + "UpdateLibraryOptionsDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the library item id.", + "format": "uuid" + }, + "LibraryOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/LibraryOptions" + } + ], + "description": "Gets or sets library options.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Update library options dto." + }, + "UpdateMediaPathRequestDto": { + "required": [ + "Name", + "PathInfo" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the library name." + }, + "PathInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathInfo" + } + ], + "description": "Gets or sets library folder path information." + } + }, + "additionalProperties": false, + "description": "Update library options dto." + }, + "UpdatePlaylistDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name of the new playlist.", + "nullable": true + }, + "Ids": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets item ids of the playlist.", + "nullable": true + }, + "Users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + }, + "description": "Gets or sets the playlist users.", + "nullable": true + }, + "IsPublic": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the playlist is public.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Update existing playlist dto. Fields set to `null` will not be updated and keep their current values." + }, + "UpdatePlaylistUserDto": { + "type": "object", + "properties": { + "CanEdit": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the user can edit the playlist.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values." + }, + "UpdateUserItemDataDto": { + "type": "object", + "properties": { + "Rating": { + "type": "number", + "description": "Gets or sets the rating.", + "format": "double", + "nullable": true + }, + "PlayedPercentage": { + "type": "number", + "description": "Gets or sets the played percentage.", + "format": "double", + "nullable": true + }, + "UnplayedItemCount": { + "type": "integer", + "description": "Gets or sets the unplayed item count.", + "format": "int32", + "nullable": true + }, + "PlaybackPositionTicks": { + "type": "integer", + "description": "Gets or sets the playback position ticks.", + "format": "int64", + "nullable": true + }, + "PlayCount": { + "type": "integer", + "description": "Gets or sets the play count.", + "format": "int32", + "nullable": true + }, + "IsFavorite": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is favorite.", + "nullable": true + }, + "Likes": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UpdateUserItemDataDto is likes.", + "nullable": true + }, + "LastPlayedDate": { + "type": "string", + "description": "Gets or sets the last played date.", + "format": "date-time", + "nullable": true + }, + "Played": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played.", + "nullable": true + }, + "Key": { + "type": "string", + "description": "Gets or sets the key.", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This is used by the api to get information about a item user data." + }, + "UpdateUserPassword": { + "type": "object", + "properties": { + "CurrentPassword": { + "type": "string", + "description": "Gets or sets the current sha1-hashed password.", + "nullable": true + }, + "CurrentPw": { + "type": "string", + "description": "Gets or sets the current plain text password.", + "nullable": true + }, + "NewPw": { + "type": "string", + "description": "Gets or sets the new plain text password.", + "nullable": true + }, + "ResetPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to reset the password." + } + }, + "additionalProperties": false, + "description": "The update user password request body." + }, + "UploadSubtitleDto": { + "required": [ + "Data", + "Format", + "IsForced", + "IsHearingImpaired", + "Language" + ], + "type": "object", + "properties": { + "Language": { + "type": "string", + "description": "Gets or sets the subtitle language." + }, + "Format": { + "type": "string", + "description": "Gets or sets the subtitle format." + }, + "IsForced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the subtitle is forced." + }, + "IsHearingImpaired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the subtitle is for hearing impaired." + }, + "Data": { + "type": "string", + "description": "Gets or sets the subtitle data." + } + }, + "additionalProperties": false, + "description": "Upload subtitles dto." + }, + "UserConfiguration": { + "type": "object", + "properties": { + "AudioLanguagePreference": { + "type": "string", + "description": "Gets or sets the audio language preference.", + "nullable": true + }, + "PlayDefaultAudioTrack": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [play default audio track]." + }, + "SubtitleLanguagePreference": { + "type": "string", + "description": "Gets or sets the subtitle language preference.", + "nullable": true + }, + "DisplayMissingEpisodes": { + "type": "boolean" + }, + "GroupedFolders": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "SubtitleMode": { + "enum": [ + "Default", + "Always", + "OnlyForced", + "None", + "Smart" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitlePlaybackMode" + } + ], + "description": "An enum representing a subtitle playback mode." + }, + "DisplayCollectionsView": { + "type": "boolean" + }, + "EnableLocalPassword": { + "type": "boolean" + }, + "OrderedViews": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "LatestItemsExcludes": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "MyMediaExcludes": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "HidePlayedInLatest": { + "type": "boolean" + }, + "RememberAudioSelections": { + "type": "boolean" + }, + "RememberSubtitleSelections": { + "type": "boolean" + }, + "EnableNextEpisodeAutoPlay": { + "type": "boolean" + }, + "CastReceiverId": { + "type": "string", + "description": "Gets or sets the id of the selected cast receiver.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class UserConfiguration." + }, + "UserDataChangedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDataChangeInfo" + } + ], + "description": "Class UserDataChangeInfo.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "UserDataChanged", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "User data changed message." + }, + "UserDataChangeInfo": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid" + }, + "UserDataList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserItemDataDto" + }, + "description": "Gets or sets the user data list." + } + }, + "additionalProperties": false, + "description": "Class UserDataChangeInfo." + }, + "UserDeletedMessage": { + "type": "object", + "properties": { + "Data": { + "type": "string", + "description": "Gets or sets the data.", + "format": "uuid" + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "UserDeleted", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "User deleted message." + }, + "UserDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server identifier.", + "nullable": true + }, + "ServerName": { + "type": "string", + "description": "Gets or sets the name of the server.\r\nThis is not used by the server and is for client-side usage only.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "format": "uuid" + }, + "PrimaryImageTag": { + "type": "string", + "description": "Gets or sets the primary image tag.", + "nullable": true + }, + "HasPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has password." + }, + "HasConfiguredPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has configured password." + }, + "HasConfiguredEasyPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has configured easy password.", + "deprecated": true + }, + "EnableAutoLogin": { + "type": "boolean", + "description": "Gets or sets whether async login is enabled or not.", + "nullable": true + }, + "LastLoginDate": { + "type": "string", + "description": "Gets or sets the last login date.", + "format": "date-time", + "nullable": true + }, + "LastActivityDate": { + "type": "string", + "description": "Gets or sets the last activity date.", + "format": "date-time", + "nullable": true + }, + "Configuration": { + "allOf": [ + { + "$ref": "#/components/schemas/UserConfiguration" + } + ], + "description": "Gets or sets the configuration.", + "nullable": true + }, + "Policy": { + "allOf": [ + { + "$ref": "#/components/schemas/UserPolicy" + } + ], + "description": "Gets or sets the policy.", + "nullable": true + }, + "PrimaryImageAspectRatio": { + "type": "number", + "description": "Gets or sets the primary image aspect ratio.", + "format": "double", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class UserDto." + }, + "UserItemDataDto": { + "type": "object", + "properties": { + "Rating": { + "type": "number", + "description": "Gets or sets the rating.", + "format": "double", + "nullable": true + }, + "PlayedPercentage": { + "type": "number", + "description": "Gets or sets the played percentage.", + "format": "double", + "nullable": true + }, + "UnplayedItemCount": { + "type": "integer", + "description": "Gets or sets the unplayed item count.", + "format": "int32", + "nullable": true + }, + "PlaybackPositionTicks": { + "type": "integer", + "description": "Gets or sets the playback position ticks.", + "format": "int64" + }, + "PlayCount": { + "type": "integer", + "description": "Gets or sets the play count.", + "format": "int32" + }, + "IsFavorite": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is favorite." + }, + "Likes": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is likes.", + "nullable": true + }, + "LastPlayedDate": { + "type": "string", + "description": "Gets or sets the last played date.", + "format": "date-time", + "nullable": true + }, + "Played": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played." + }, + "Key": { + "type": "string", + "description": "Gets or sets the key." + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class UserItemDataDto." + }, + "UserPolicy": { + "required": [ + "AuthenticationProviderId", + "PasswordResetProviderId" + ], + "type": "object", + "properties": { + "IsAdministrator": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is administrator." + }, + "IsHidden": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is hidden." + }, + "EnableCollectionManagement": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can manage collections.", + "default": false + }, + "EnableSubtitleManagement": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can manage subtitles.", + "default": false + }, + "EnableLyricManagement": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this user can manage lyrics.", + "default": false + }, + "IsDisabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is disabled." + }, + "MaxParentalRating": { + "type": "integer", + "description": "Gets or sets the max parental rating.", + "format": "int32", + "nullable": true + }, + "MaxParentalSubRating": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "BlockedTags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "AllowedTags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "EnableUserPreferenceAccess": { + "type": "boolean" + }, + "AccessSchedules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccessSchedule" + }, + "nullable": true + }, + "BlockUnratedItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UnratedItem" + }, + "nullable": true + }, + "EnableRemoteControlOfOtherUsers": { + "type": "boolean" + }, + "EnableSharedDeviceControl": { + "type": "boolean" + }, + "EnableRemoteAccess": { + "type": "boolean" + }, + "EnableLiveTvManagement": { + "type": "boolean" + }, + "EnableLiveTvAccess": { + "type": "boolean" + }, + "EnableMediaPlayback": { + "type": "boolean" + }, + "EnableAudioPlaybackTranscoding": { + "type": "boolean" + }, + "EnableVideoPlaybackTranscoding": { + "type": "boolean" + }, + "EnablePlaybackRemuxing": { + "type": "boolean" + }, + "ForceRemoteSourceTranscoding": { + "type": "boolean" + }, + "EnableContentDeletion": { + "type": "boolean" + }, + "EnableContentDeletionFromFolders": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "EnableContentDownloading": { + "type": "boolean" + }, + "EnableSyncTranscoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [enable synchronize]." + }, + "EnableMediaConversion": { + "type": "boolean" + }, + "EnabledDevices": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "EnableAllDevices": { + "type": "boolean" + }, + "EnabledChannels": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "EnableAllChannels": { + "type": "boolean" + }, + "EnabledFolders": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "EnableAllFolders": { + "type": "boolean" + }, + "InvalidLoginAttemptCount": { + "type": "integer", + "format": "int32" + }, + "LoginAttemptsBeforeLockout": { + "type": "integer", + "format": "int32" + }, + "MaxActiveSessions": { + "type": "integer", + "format": "int32" + }, + "EnablePublicSharing": { + "type": "boolean" + }, + "BlockedMediaFolders": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "BlockedChannels": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "RemoteClientBitrateLimit": { + "type": "integer", + "format": "int32" + }, + "AuthenticationProviderId": { + "type": "string" + }, + "PasswordResetProviderId": { + "type": "string" + }, + "SyncPlayAccess": { + "enum": [ + "CreateAndJoinGroups", + "JoinGroups", + "None" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SyncPlayUserAccessType" + } + ], + "description": "Gets or sets a value indicating what SyncPlay features the user can access." + } + }, + "additionalProperties": false + }, + "UserUpdatedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "UserUpdated", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "User updated message." + }, + "UtcTimeResponse": { + "type": "object", + "properties": { + "RequestReceptionTime": { + "type": "string", + "description": "Gets the UTC time when request has been received.", + "format": "date-time" + }, + "ResponseTransmissionTime": { + "type": "string", + "description": "Gets the UTC time when response has been sent.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Class UtcTimeResponse." + }, + "ValidatePathDto": { + "type": "object", + "properties": { + "ValidateWritable": { + "type": "boolean", + "description": "Gets or sets a value indicating whether validate if path is writable." + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "IsFile": { + "type": "boolean", + "description": "Gets or sets is path file.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Validate path object." + }, + "VersionInfo": { + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Gets or sets the version." + }, + "VersionNumber": { + "type": "string", + "description": "Gets the version as a System.Version.", + "readOnly": true + }, + "changelog": { + "type": "string", + "description": "Gets or sets the changelog for this version.", + "nullable": true + }, + "targetAbi": { + "type": "string", + "description": "Gets or sets the ABI that this version was built against.", + "nullable": true + }, + "sourceUrl": { + "type": "string", + "description": "Gets or sets the source URL.", + "nullable": true + }, + "checksum": { + "type": "string", + "description": "Gets or sets a checksum for the binary.", + "nullable": true + }, + "timestamp": { + "type": "string", + "description": "Gets or sets a timestamp of when the binary was built.", + "nullable": true + }, + "repositoryName": { + "type": "string", + "description": "Gets or sets the repository name." + }, + "repositoryUrl": { + "type": "string", + "description": "Gets or sets the repository url." + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Updates.VersionInfo class." + }, + "Video3DFormat": { + "enum": [ + "HalfSideBySide", + "FullSideBySide", + "FullTopAndBottom", + "HalfTopAndBottom", + "MVC" + ], + "type": "string" + }, + "VideoRange": { + "enum": [ + "Unknown", + "SDR", + "HDR" + ], + "type": "string", + "description": "An enum representing video ranges." + }, + "VideoRangeType": { + "enum": [ + "Unknown", + "SDR", + "HDR10", + "HLG", + "DOVI", + "DOVIWithHDR10", + "DOVIWithHLG", + "DOVIWithSDR", + "DOVIWithEL", + "DOVIWithHDR10Plus", + "DOVIWithELHDR10Plus", + "DOVIInvalid", + "HDR10Plus" + ], + "type": "string", + "description": "An enum representing types of video ranges." + }, + "VideoType": { + "enum": [ + "VideoFile", + "Iso", + "Dvd", + "BluRay" + ], + "type": "string", + "description": "Enum VideoType." + }, + "VirtualFolderInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Locations": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the locations.", + "nullable": true + }, + "CollectionType": { + "enum": [ + "movies", + "tvshows", + "music", + "musicvideos", + "homevideos", + "boxsets", + "books", + "mixed" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CollectionTypeOptions" + } + ], + "description": "Gets or sets the type of the collection.", + "nullable": true + }, + "LibraryOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/LibraryOptions" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "nullable": true + }, + "PrimaryImageItemId": { + "type": "string", + "description": "Gets or sets the primary image item identifier.", + "nullable": true + }, + "RefreshProgress": { + "type": "number", + "format": "double", + "nullable": true + }, + "RefreshStatus": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to hold information about a user's list of configured virtual folders." + }, + "WebSocketMessage": { + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/InboundWebSocketMessage" + }, + { + "$ref": "#/components/schemas/OutboundWebSocketMessage" + } + ], + "description": "Represents the possible websocket types" + }, + "XbmcMetadataOptions": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "nullable": true + }, + "ReleaseDateFormat": { + "type": "string" + }, + "SaveImagePathsInNfo": { + "type": "boolean" + }, + "EnablePathSubstitution": { + "type": "boolean" + }, + "EnableExtraThumbsDuplication": { + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + "securitySchemes": { + "CustomAuthentication": { + "type": "apiKey", + "description": "API key header parameter", + "name": "Authorization", + "in": "header" + } + } + } +} \ No newline at end of file diff --git a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/json/jellyfin-openapi-10.8.13.json b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/json/jellyfin-openapi-10.8.13.json new file mode 100644 index 0000000000000..9b60e838b1de9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/json/jellyfin-openapi-10.8.13.json @@ -0,0 +1,55485 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Jellyfin API", + "version": "10.8.13", + "x-jellyfin-version": "10.8.13" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/System/ActivityLog/Entries": { + "get": { + "tags": [ + "ActivityLog" + ], + "summary": "Gets activity log entries.", + "operationId": "GetLogEntries", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minDate", + "in": "query", + "description": "Optional. The minimum date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasUserId", + "in": "query", + "description": "Optional. Filter log entries if it has user id, or not.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Activity log returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActivityLogEntryQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ActivityLogEntryQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ActivityLogEntryQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Auth/Keys": { + "get": { + "tags": [ + "ApiKey" + ], + "summary": "Get all keys.", + "operationId": "GetKeys", + "responses": { + "200": { + "description": "Api keys retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationInfoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationInfoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationInfoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "ApiKey" + ], + "summary": "Create a new api key.", + "operationId": "CreateKey", + "parameters": [ + { + "name": "app", + "in": "query", + "description": "Name of the app using the authentication key.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Api key created." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Auth/Keys/{key}": { + "delete": { + "tags": [ + "ApiKey" + ], + "summary": "Remove an api key.", + "operationId": "RevokeKey", + "parameters": [ + { + "name": "key", + "in": "path", + "description": "The access token to delete.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Api key deleted." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Artists": { + "get": { + "tags": [ + "Artists" + ], + "summary": "Gets all artists from a given item, folder, or the entire library.", + "operationId": "GetArtists", + "parameters": [ + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Artists returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/{name}": { + "get": { + "tags": [ + "Artists" + ], + "summary": "Gets an artist by name.", + "operationId": "GetArtistByName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Artist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/AlbumArtists": { + "get": { + "tags": [ + "Artists" + ], + "summary": "Gets all album artists from a given item, folder, or the entire library.", + "operationId": "GetAlbumArtists", + "parameters": [ + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Album artists returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/stream": { + "get": { + "tags": [ + "Audio" + ], + "summary": "Gets an audio stream.", + "operationId": "GetAudioStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The audio container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "head": { + "tags": [ + "Audio" + ], + "summary": "Gets an audio stream.", + "operationId": "HeadAudioStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The audio container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/Audio/{itemId}/stream.{container}": { + "get": { + "tags": [ + "Audio" + ], + "summary": "Gets an audio stream.", + "operationId": "GetAudioStreamByContainer", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "path", + "description": "The audio container.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment lenght.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamporphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "head": { + "tags": [ + "Audio" + ], + "summary": "Gets an audio stream.", + "operationId": "HeadAudioStreamByContainer", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "path", + "description": "The audio container.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment lenght.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamporphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/Branding/Configuration": { + "get": { + "tags": [ + "Branding" + ], + "summary": "Gets branding configuration.", + "operationId": "GetBrandingOptions", + "responses": { + "200": { + "description": "Branding configuration returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BrandingOptions" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BrandingOptions" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BrandingOptions" + } + } + } + } + } + } + }, + "/Branding/Css": { + "get": { + "tags": [ + "Branding" + ], + "summary": "Gets branding css.", + "operationId": "GetBrandingCss", + "responses": { + "200": { + "description": "Branding css returned.", + "content": { + "text/css": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + }, + "204": { + "description": "No branding css configured." + } + } + } + }, + "/Branding/Css.css": { + "get": { + "tags": [ + "Branding" + ], + "summary": "Gets branding css.", + "operationId": "GetBrandingCss_2", + "responses": { + "200": { + "description": "Branding css returned.", + "content": { + "text/css": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + }, + "204": { + "description": "No branding css configured." + } + } + } + }, + "/Channels": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Gets available channels.", + "operationId": "GetChannels", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User Id to filter by. Use System.Guid.Empty to not filter by user.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "supportsLatestItems", + "in": "query", + "description": "Optional. Filter by channels that support getting latest items.", + "schema": { + "type": "boolean" + } + }, + { + "name": "supportsMediaDeletion", + "in": "query", + "description": "Optional. Filter by channels that support media deletion.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional. Filter by channels that are favorite.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Channels returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Channels/{channelId}/Features": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Get channel features.", + "operationId": "GetChannelFeatures", + "parameters": [ + { + "name": "channelId", + "in": "path", + "description": "Channel id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Channel features returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChannelFeatures" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ChannelFeatures" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ChannelFeatures" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Channels/{channelId}/Items": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Get channel items.", + "operationId": "GetChannelItems", + "parameters": [ + { + "name": "channelId", + "in": "path", + "description": "Channel Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "folderId", + "in": "query", + "description": "Optional. Folder Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Channel items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Channels/Features": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Get all channel features.", + "operationId": "GetAllChannelFeatures", + "responses": { + "200": { + "description": "All channel features returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelFeatures" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelFeatures" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelFeatures" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Channels/Items/Latest": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Gets latest channel items.", + "operationId": "GetLatestChannelItems", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "channelIds", + "in": "query", + "description": "Optional. Specify one or more channel id's, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "200": { + "description": "Latest channel items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/ClientLog/Document": { + "post": { + "tags": [ + "ClientLog" + ], + "summary": "Upload a document.", + "operationId": "LogFile", + "requestBody": { + "content": { + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "200": { + "description": "Document saved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientLogDocumentResponseDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ClientLogDocumentResponseDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ClientLogDocumentResponseDto" + } + } + } + }, + "403": { + "description": "Event logging disabled.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "413": { + "description": "Upload size too large.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Collections": { + "post": { + "tags": [ + "Collection" + ], + "summary": "Creates a new collection.", + "operationId": "CreateCollection", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the collection.", + "schema": { + "type": "string" + } + }, + { + "name": "ids", + "in": "query", + "description": "Item Ids to add to the collection.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Create the collection within a specific folder.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isLocked", + "in": "query", + "description": "Whether or not to lock the new collection.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Collection created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionCreationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/CollectionCreationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/CollectionCreationResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Collections/{collectionId}/Items": { + "post": { + "tags": [ + "Collection" + ], + "summary": "Adds items to a collection.", + "operationId": "AddToCollection", + "parameters": [ + { + "name": "collectionId", + "in": "path", + "description": "The collection id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ids", + "in": "query", + "description": "Item ids, comma delimited.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "204": { + "description": "Items added to collection." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Collection" + ], + "summary": "Removes items from a collection.", + "operationId": "RemoveFromCollection", + "parameters": [ + { + "name": "collectionId", + "in": "path", + "description": "The collection id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ids", + "in": "query", + "description": "Item ids, comma delimited.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "204": { + "description": "Items removed from collection." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Configuration": { + "get": { + "tags": [ + "Configuration" + ], + "summary": "Gets application configuration.", + "operationId": "GetConfiguration", + "responses": { + "200": { + "description": "Application configuration returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServerConfiguration" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ServerConfiguration" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ServerConfiguration" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Configuration" + ], + "summary": "Updates application configuration.", + "operationId": "UpdateConfiguration", + "requestBody": { + "description": "Configuration.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServerConfiguration" + } + ], + "description": "Represents the server configuration." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServerConfiguration" + } + ], + "description": "Represents the server configuration." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServerConfiguration" + } + ], + "description": "Represents the server configuration." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Configuration updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Configuration/{key}": { + "get": { + "tags": [ + "Configuration" + ], + "summary": "Gets a named configuration.", + "operationId": "GetNamedConfiguration", + "parameters": [ + { + "name": "key", + "in": "path", + "description": "Configuration key.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Configuration returned.", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Configuration" + ], + "summary": "Updates named configuration.", + "operationId": "UpdateNamedConfiguration", + "parameters": [ + { + "name": "key", + "in": "path", + "description": "Configuration key.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Configuration.", + "content": { + "application/json": { + "schema": { } + }, + "text/json": { + "schema": { } + }, + "application/*+json": { + "schema": { } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Named configuration updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Configuration/MetadataOptions/Default": { + "get": { + "tags": [ + "Configuration" + ], + "summary": "Gets a default MetadataOptions object.", + "operationId": "GetDefaultMetadataOptions", + "responses": { + "200": { + "description": "Metadata options returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataOptions" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/MetadataOptions" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/MetadataOptions" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/MediaEncoder/Path": { + "post": { + "tags": [ + "Configuration" + ], + "summary": "Updates the path to the media encoder.", + "operationId": "UpdateMediaEncoderPath", + "requestBody": { + "description": "Media encoder path form body.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaEncoderPathDto" + } + ], + "description": "Media Encoder Path Dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaEncoderPathDto" + } + ], + "description": "Media Encoder Path Dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaEncoderPathDto" + } + ], + "description": "Media Encoder Path Dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Media encoder path updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/web/ConfigurationPage": { + "get": { + "tags": [ + "Dashboard" + ], + "summary": "Gets a dashboard configuration page.", + "operationId": "GetDashboardConfigurationPage", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the page.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "ConfigurationPage returned.", + "content": { + "text/html": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/x-javascript": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Plugin configuration page not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/web/ConfigurationPages": { + "get": { + "tags": [ + "Dashboard" + ], + "summary": "Gets the configuration pages.", + "operationId": "GetConfigurationPages", + "parameters": [ + { + "name": "enableInMainMenu", + "in": "query", + "description": "Whether to enable in the main menu.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "ConfigurationPages returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigurationPageInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigurationPageInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigurationPageInfo" + } + } + } + } + }, + "404": { + "description": "Server still loading.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Devices": { + "get": { + "tags": [ + "Devices" + ], + "summary": "Get Devices.", + "operationId": "GetDevices", + "parameters": [ + { + "name": "supportsSync", + "in": "query", + "description": "Gets or sets a value indicating whether [supports synchronize].", + "schema": { + "type": "boolean" + } + }, + { + "name": "userId", + "in": "query", + "description": "Gets or sets the user identifier.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Devices retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "Devices" + ], + "summary": "Deletes a device.", + "operationId": "DeleteDevice", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Device Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Device deleted." + }, + "404": { + "description": "Device not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Devices/Info": { + "get": { + "tags": [ + "Devices" + ], + "summary": "Get info for a device.", + "operationId": "GetDeviceInfo", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Device Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Device info retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceInfo" + } + } + } + }, + "404": { + "description": "Device not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Devices/Options": { + "get": { + "tags": [ + "Devices" + ], + "summary": "Get options for a device.", + "operationId": "GetDeviceOptions", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Device Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Device options retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceOptions" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceOptions" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceOptions" + } + } + } + }, + "404": { + "description": "Device not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Devices" + ], + "summary": "Update device options.", + "operationId": "UpdateDeviceOptions", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Device Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Device Options.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + ], + "description": "A dto representing custom options for a device." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + ], + "description": "A dto representing custom options for a device." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + ], + "description": "A dto representing custom options for a device." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Device options updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/DisplayPreferences/{displayPreferencesId}": { + "get": { + "tags": [ + "DisplayPreferences" + ], + "summary": "Get Display Preferences.", + "operationId": "GetDisplayPreferences", + "parameters": [ + { + "name": "displayPreferencesId", + "in": "path", + "description": "Display preferences id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "client", + "in": "query", + "description": "Client.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Display preferences retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "DisplayPreferences" + ], + "summary": "Update Display Preferences.", + "operationId": "UpdateDisplayPreferences", + "parameters": [ + { + "name": "displayPreferencesId", + "in": "path", + "description": "Display preferences id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "User Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "client", + "in": "query", + "description": "Client.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "New Display Preferences object.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + ], + "description": "Defines the display preferences for any item that supports them (usually Folders)." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + ], + "description": "Defines the display preferences for any item that supports them (usually Folders)." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + ], + "description": "Defines the display preferences for any item that supports them (usually Folders)." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Display preferences updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Dlna/ProfileInfos": { + "get": { + "tags": [ + "Dlna" + ], + "summary": "Get profile infos.", + "operationId": "GetProfileInfos", + "responses": { + "200": { + "description": "Device profile infos returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeviceProfileInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeviceProfileInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeviceProfileInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Dlna/Profiles": { + "post": { + "tags": [ + "Dlna" + ], + "summary": "Creates a profile.", + "operationId": "CreateProfile", + "requestBody": { + "description": "Device profile.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + } + } + } + }, + "responses": { + "204": { + "description": "Device profile created." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Dlna/Profiles/{profileId}": { + "get": { + "tags": [ + "Dlna" + ], + "summary": "Gets a single profile.", + "operationId": "GetProfile", + "parameters": [ + { + "name": "profileId", + "in": "path", + "description": "Profile Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Device profile returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceProfile" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceProfile" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceProfile" + } + } + } + }, + "404": { + "description": "Device profile not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "Dlna" + ], + "summary": "Deletes a profile.", + "operationId": "DeleteProfile", + "parameters": [ + { + "name": "profileId", + "in": "path", + "description": "Profile id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Device profile deleted." + }, + "404": { + "description": "Device profile not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Dlna" + ], + "summary": "Updates a profile.", + "operationId": "UpdateProfile", + "parameters": [ + { + "name": "profileId", + "in": "path", + "description": "Profile id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Device profile.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + } + } + } + }, + "responses": { + "204": { + "description": "Device profile updated." + }, + "404": { + "description": "Device profile not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Dlna/Profiles/Default": { + "get": { + "tags": [ + "Dlna" + ], + "summary": "Gets the default profile.", + "operationId": "GetDefaultProfile", + "responses": { + "200": { + "description": "Default device profile returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceProfile" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceProfile" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceProfile" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Dlna/{serverId}/ConnectionManager": { + "get": { + "tags": [ + "DlnaServer" + ], + "summary": "Gets Dlna media receiver registrar xml.", + "operationId": "GetConnectionManager", + "parameters": [ + { + "name": "serverId", + "in": "path", + "description": "Server UUID.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Dlna media receiver registrar xml returned.", + "content": { + "text/xml": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "DLNA is disabled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "AnonymousLanAccessPolicy" + ] + } + ] + } + }, + "/Dlna/{serverId}/ConnectionManager/ConnectionManager": { + "get": { + "tags": [ + "DlnaServer" + ], + "summary": "Gets Dlna media receiver registrar xml.", + "operationId": "GetConnectionManager_2", + "parameters": [ + { + "name": "serverId", + "in": "path", + "description": "Server UUID.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Dlna media receiver registrar xml returned.", + "content": { + "text/xml": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "DLNA is disabled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "AnonymousLanAccessPolicy" + ] + } + ] + } + }, + "/Dlna/{serverId}/ConnectionManager/ConnectionManager.xml": { + "get": { + "tags": [ + "DlnaServer" + ], + "summary": "Gets Dlna media receiver registrar xml.", + "operationId": "GetConnectionManager_3", + "parameters": [ + { + "name": "serverId", + "in": "path", + "description": "Server UUID.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Dlna media receiver registrar xml returned.", + "content": { + "text/xml": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "DLNA is disabled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "AnonymousLanAccessPolicy" + ] + } + ] + } + }, + "/Dlna/{serverId}/ConnectionManager/Control": { + "post": { + "tags": [ + "DlnaServer" + ], + "summary": "Process a connection manager control request.", + "operationId": "ProcessConnectionManagerControlRequest", + "parameters": [ + { + "name": "serverId", + "in": "path", + "description": "Server UUID.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Request processed.", + "content": { + "text/xml": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "DLNA is disabled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "AnonymousLanAccessPolicy" + ] + } + ] + } + }, + "/Dlna/{serverId}/ContentDirectory": { + "get": { + "tags": [ + "DlnaServer" + ], + "summary": "Gets Dlna content directory xml.", + "operationId": "GetContentDirectory", + "parameters": [ + { + "name": "serverId", + "in": "path", + "description": "Server UUID.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Dlna content directory returned.", + "content": { + "text/xml": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "DLNA is disabled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "AnonymousLanAccessPolicy" + ] + } + ] + } + }, + "/Dlna/{serverId}/ContentDirectory/ContentDirectory": { + "get": { + "tags": [ + "DlnaServer" + ], + "summary": "Gets Dlna content directory xml.", + "operationId": "GetContentDirectory_2", + "parameters": [ + { + "name": "serverId", + "in": "path", + "description": "Server UUID.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Dlna content directory returned.", + "content": { + "text/xml": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "DLNA is disabled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "AnonymousLanAccessPolicy" + ] + } + ] + } + }, + "/Dlna/{serverId}/ContentDirectory/ContentDirectory.xml": { + "get": { + "tags": [ + "DlnaServer" + ], + "summary": "Gets Dlna content directory xml.", + "operationId": "GetContentDirectory_3", + "parameters": [ + { + "name": "serverId", + "in": "path", + "description": "Server UUID.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Dlna content directory returned.", + "content": { + "text/xml": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "DLNA is disabled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "AnonymousLanAccessPolicy" + ] + } + ] + } + }, + "/Dlna/{serverId}/ContentDirectory/Control": { + "post": { + "tags": [ + "DlnaServer" + ], + "summary": "Process a content directory control request.", + "operationId": "ProcessContentDirectoryControlRequest", + "parameters": [ + { + "name": "serverId", + "in": "path", + "description": "Server UUID.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Request processed.", + "content": { + "text/xml": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "DLNA is disabled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "AnonymousLanAccessPolicy" + ] + } + ] + } + }, + "/Dlna/{serverId}/description": { + "get": { + "tags": [ + "DlnaServer" + ], + "summary": "Get Description Xml.", + "operationId": "GetDescriptionXml", + "parameters": [ + { + "name": "serverId", + "in": "path", + "description": "Server UUID.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Description xml returned.", + "content": { + "text/xml": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "DLNA is disabled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "AnonymousLanAccessPolicy" + ] + } + ] + } + }, + "/Dlna/{serverId}/description.xml": { + "get": { + "tags": [ + "DlnaServer" + ], + "summary": "Get Description Xml.", + "operationId": "GetDescriptionXml_2", + "parameters": [ + { + "name": "serverId", + "in": "path", + "description": "Server UUID.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Description xml returned.", + "content": { + "text/xml": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "DLNA is disabled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "AnonymousLanAccessPolicy" + ] + } + ] + } + }, + "/Dlna/{serverId}/icons/{fileName}": { + "get": { + "tags": [ + "DlnaServer" + ], + "summary": "Gets a server icon.", + "operationId": "GetIconId", + "parameters": [ + { + "name": "serverId", + "in": "path", + "description": "Server UUID.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "fileName", + "in": "path", + "description": "The icon filename.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Request processed.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "DLNA is disabled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "AnonymousLanAccessPolicy" + ] + } + ] + } + }, + "/Dlna/{serverId}/MediaReceiverRegistrar": { + "get": { + "tags": [ + "DlnaServer" + ], + "summary": "Gets Dlna media receiver registrar xml.", + "operationId": "GetMediaReceiverRegistrar", + "parameters": [ + { + "name": "serverId", + "in": "path", + "description": "Server UUID.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Dlna media receiver registrar xml returned.", + "content": { + "text/xml": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "DLNA is disabled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "AnonymousLanAccessPolicy" + ] + } + ] + } + }, + "/Dlna/{serverId}/MediaReceiverRegistrar/Control": { + "post": { + "tags": [ + "DlnaServer" + ], + "summary": "Process a media receiver registrar control request.", + "operationId": "ProcessMediaReceiverRegistrarControlRequest", + "parameters": [ + { + "name": "serverId", + "in": "path", + "description": "Server UUID.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Request processed.", + "content": { + "text/xml": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "DLNA is disabled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "AnonymousLanAccessPolicy" + ] + } + ] + } + }, + "/Dlna/{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar": { + "get": { + "tags": [ + "DlnaServer" + ], + "summary": "Gets Dlna media receiver registrar xml.", + "operationId": "GetMediaReceiverRegistrar_2", + "parameters": [ + { + "name": "serverId", + "in": "path", + "description": "Server UUID.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Dlna media receiver registrar xml returned.", + "content": { + "text/xml": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "DLNA is disabled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "AnonymousLanAccessPolicy" + ] + } + ] + } + }, + "/Dlna/{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar.xml": { + "get": { + "tags": [ + "DlnaServer" + ], + "summary": "Gets Dlna media receiver registrar xml.", + "operationId": "GetMediaReceiverRegistrar_3", + "parameters": [ + { + "name": "serverId", + "in": "path", + "description": "Server UUID.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Dlna media receiver registrar xml returned.", + "content": { + "text/xml": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "DLNA is disabled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "AnonymousLanAccessPolicy" + ] + } + ] + } + }, + "/Dlna/icons/{fileName}": { + "get": { + "tags": [ + "DlnaServer" + ], + "summary": "Gets a server icon.", + "operationId": "GetIcon", + "parameters": [ + { + "name": "fileName", + "in": "path", + "description": "The icon filename.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Request processed.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "DLNA is disabled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "AnonymousLanAccessPolicy" + ] + } + ] + } + }, + "/Audio/{itemId}/hls1/{playlistId}/{segmentId}.{container}": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video stream using HTTP live streaming.", + "operationId": "GetHlsAudioSegment", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "container", + "in": "path", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "runtimeTicks", + "in": "query", + "description": "The position of the requested segment in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "actualSegmentLengthTicks", + "in": "query", + "description": "The length of the requested segment in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/main.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets an audio stream using HTTP live streaming.", + "operationId": "GetVariantHlsAudioPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/master.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets an audio hls playlist stream.", + "operationId": "GetMasterHlsAudioPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAdaptiveBitrateStreaming", + "in": "query", + "description": "Enable adaptive bitrate streaming.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "head": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets an audio hls playlist stream.", + "operationId": "HeadMasterHlsAudioPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAdaptiveBitrateStreaming", + "in": "query", + "description": "Enable adaptive bitrate streaming.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/hls1/{playlistId}/{segmentId}.{container}": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video stream using HTTP live streaming.", + "operationId": "GetHlsVideoSegment", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "container", + "in": "path", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "runtimeTicks", + "in": "query", + "description": "The position of the requested segment in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "actualSegmentLengthTicks", + "in": "query", + "description": "The length of the requested segment in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The desired segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/live.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a hls live stream.", + "operationId": "GetLiveHlsStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The audio container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment lenght.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The max width.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The max height.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableSubtitlesInManifest", + "in": "query", + "description": "Optional. Whether to enable subtitles in the manifest.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Hls live stream retrieved.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/main.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video stream using HTTP live streaming.", + "operationId": "GetVariantHlsVideoPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/master.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video hls playlist stream.", + "operationId": "GetMasterHlsVideoPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAdaptiveBitrateStreaming", + "in": "query", + "description": "Enable adaptive bitrate streaming.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "head": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video hls playlist stream.", + "operationId": "HeadMasterHlsVideoPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAdaptiveBitrateStreaming", + "in": "query", + "description": "Enable adaptive bitrate streaming.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/DefaultDirectoryBrowser": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Get Default directory browser.", + "operationId": "GetDefaultDirectoryBrowser", + "responses": { + "200": { + "description": "Default directory browser returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultDirectoryBrowserInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DefaultDirectoryBrowserInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DefaultDirectoryBrowserInfoDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + } + }, + "/Environment/DirectoryContents": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Gets the contents of a given directory in the file system.", + "operationId": "GetDirectoryContents", + "parameters": [ + { + "name": "path", + "in": "query", + "description": "The path.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "includeFiles", + "in": "query", + "description": "An optional filter to include or exclude files from the results. true/false.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "includeDirectories", + "in": "query", + "description": "An optional filter to include or exclude folders from the results. true/false.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Directory contents returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + } + }, + "/Environment/Drives": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Gets available drives from the server's file system.", + "operationId": "GetDrives", + "responses": { + "200": { + "description": "List of entries returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + } + }, + "/Environment/NetworkShares": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Gets network paths.", + "operationId": "GetNetworkShares", + "responses": { + "200": { + "description": "Empty array returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + } + }, + "/Environment/ParentPath": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Gets the parent path of a given path.", + "operationId": "GetParentPath", + "parameters": [ + { + "name": "path", + "in": "query", + "description": "The path.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + } + }, + "/Environment/ValidatePath": { + "post": { + "tags": [ + "Environment" + ], + "summary": "Validates path.", + "operationId": "ValidatePath", + "requestBody": { + "description": "Validate request object.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatePathDto" + } + ], + "description": "Validate path object." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatePathDto" + } + ], + "description": "Validate path object." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatePathDto" + } + ], + "description": "Validate path object." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Path validated." + }, + "404": { + "description": "Path not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + } + }, + "/Items/Filters": { + "get": { + "tags": [ + "Filter" + ], + "summary": "Gets legacy query filters.", + "operationId": "GetQueryFiltersLegacy", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Parent id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional. Filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "Legacy filters retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueryFiltersLegacy" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/QueryFiltersLegacy" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/QueryFiltersLegacy" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Filters2": { + "get": { + "tags": [ + "Filter" + ], + "summary": "Gets query filters.", + "operationId": "GetQueryFilters", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isAiring", + "in": "query", + "description": "Optional. Is item airing.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Is item movie.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Is item sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Is item kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Is item news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Is item series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "recursive", + "in": "query", + "description": "Optional. Search recursive.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Filters retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueryFilters" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/QueryFilters" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/QueryFilters" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Genres": { + "get": { + "tags": [ + "Genres" + ], + "summary": "Gets all genres from a given item, folder, or the entire library.", + "operationId": "GetGenres", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Include total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Genres returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Genres/{genreName}": { + "get": { + "tags": [ + "Genres" + ], + "summary": "Gets a genre, by name.", + "operationId": "GetGenre", + "parameters": [ + { + "name": "genreName", + "in": "path", + "description": "The genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Genres returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/hls/{segmentId}/stream.aac": { + "get": { + "tags": [ + "HlsSegment" + ], + "summary": "Gets the specified audio segment for an audio item.", + "operationId": "GetHlsAudioSegmentLegacyAac", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Hls audio segment returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/Audio/{itemId}/hls/{segmentId}/stream.mp3": { + "get": { + "tags": [ + "HlsSegment" + ], + "summary": "Gets the specified audio segment for an audio item.", + "operationId": "GetHlsAudioSegmentLegacyMp3", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Hls audio segment returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/Videos/{itemId}/hls/{playlistId}/{segmentId}.{segmentContainer}": { + "get": { + "tags": [ + "HlsSegment" + ], + "summary": "Gets a hls video segment.", + "operationId": "GetHlsVideoSegmentLegacy", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "path", + "description": "The segment container.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Hls video segment returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Hls segment not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Videos/{itemId}/hls/{playlistId}/stream.m3u8": { + "get": { + "tags": [ + "HlsSegment" + ], + "summary": "Gets a hls video playlist.", + "operationId": "GetHlsPlaylistLegacy", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The video id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Hls video playlist returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/ActiveEncodings": { + "delete": { + "tags": [ + "HlsSegment" + ], + "summary": "Stops an active encoding.", + "operationId": "StopEncodingProcess", + "parameters": [ + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Encoding stopped successfully." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get artist image by name.", + "operationId": "GetArtistImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Artist name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get artist image by name.", + "operationId": "HeadArtistImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Artist name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Branding/Splashscreen": { + "get": { + "tags": [ + "Image" + ], + "summary": "Generates or gets the splashscreen.", + "operationId": "GetSplashscreen", + "parameters": [ + { + "name": "tag", + "in": "query", + "description": "Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "quality", + "in": "query", + "description": "Quality setting, from 0-100.", + "schema": { + "maximum": 100, + "minimum": 0, + "type": "integer", + "format": "int32", + "default": 90 + } + } + ], + "responses": { + "200": { + "description": "Splashscreen returned successfully.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "post": { + "tags": [ + "Image" + ], + "summary": "Uploads a custom splashscreen.\r\nThe body is expected to the image contents base64 encoded.", + "operationId": "UploadCustomSplashscreen", + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Successfully uploaded new splashscreen." + }, + "400": { + "description": "Error reading MimeType from uploaded image.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User does not have permission to upload splashscreen..", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete a custom splashscreen.", + "operationId": "DeleteCustomSplashscreen", + "responses": { + "204": { + "description": "Successfully deleted the custom splashscreen." + }, + "403": { + "description": "User does not have permission to delete splashscreen.." + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Genres/{name}/Images/{imageType}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get genre image by name.", + "operationId": "GetGenreImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get genre image by name.", + "operationId": "HeadGenreImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Genres/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get genre image by name.", + "operationId": "GetGenreImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get genre image by name.", + "operationId": "HeadGenreImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Items/{itemId}/Images": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get item image infos.", + "operationId": "GetItemImageInfos", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item images returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageInfo" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Images/{imageType}": { + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete an item's image.", + "operationId": "DeleteItemImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "The image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Image deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Image" + ], + "summary": "Set item image.", + "operationId": "SetItemImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + } + ], + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Image saved." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "get": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "GetItemImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "format", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "HeadItemImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "format", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Items/{itemId}/Images/{imageType}/{imageIndex}": { + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete an item's image.", + "operationId": "DeleteItemImageByIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "The image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Image deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Image" + ], + "summary": "Set item image.", + "operationId": "SetItemImageByIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "(Unused) Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Image saved." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "get": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "GetItemImageByIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "format", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "HeadItemImageByIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "format", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "GetItemImage2", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "maxWidth", + "in": "path", + "description": "The maximum image width to return.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "path", + "description": "The maximum image height to return.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "path", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "format", + "in": "path", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ], + "description": "Enum ImageOutputFormat." + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "percentPlayed", + "in": "path", + "description": "Optional. Percent to render for the percent played overlay.", + "required": true, + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "path", + "description": "Optional. Unplayed count overlay to render.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "HeadItemImage2", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "maxWidth", + "in": "path", + "description": "The maximum image width to return.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "path", + "description": "The maximum image height to return.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "path", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "format", + "in": "path", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ], + "description": "Enum ImageOutputFormat." + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "percentPlayed", + "in": "path", + "description": "Optional. Percent to render for the percent played overlay.", + "required": true, + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "path", + "description": "Optional. Unplayed count overlay to render.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Items/{itemId}/Images/{imageType}/{imageIndex}/Index": { + "post": { + "tags": [ + "Image" + ], + "summary": "Updates the index for an item image.", + "operationId": "UpdateItemImageIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Old image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "newIndex", + "in": "query", + "description": "New image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Image index updated." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/MusicGenres/{name}/Images/{imageType}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get music genre image by name.", + "operationId": "GetMusicGenreImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Music genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get music genre image by name.", + "operationId": "HeadMusicGenreImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Music genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/MusicGenres/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get music genre image by name.", + "operationId": "GetMusicGenreImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Music genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get music genre image by name.", + "operationId": "HeadMusicGenreImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Music genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Persons/{name}/Images/{imageType}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get person image by name.", + "operationId": "GetPersonImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get person image by name.", + "operationId": "HeadPersonImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Persons/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get person image by name.", + "operationId": "GetPersonImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get person image by name.", + "operationId": "HeadPersonImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Studios/{name}/Images/{imageType}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get studio image by name.", + "operationId": "GetStudioImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get studio image by name.", + "operationId": "HeadStudioImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Studios/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get studio image by name.", + "operationId": "GetStudioImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get studio image by name.", + "operationId": "HeadStudioImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Users/{userId}/Images/{imageType}": { + "post": { + "tags": [ + "Image" + ], + "summary": "Sets the user image.", + "operationId": "PostUserImage", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "(Unused) Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "index", + "in": "query", + "description": "(Unused) Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Image updated." + }, + "403": { + "description": "User does not have permission to delete the image.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete the user's image.", + "operationId": "DeleteUserImage", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "(Unused) Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "index", + "in": "query", + "description": "(Unused) Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Image deleted." + }, + "403": { + "description": "User does not have permission to delete the image.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "get": { + "tags": [ + "Image" + ], + "summary": "Get user profile image.", + "operationId": "GetUserImage", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get user profile image.", + "operationId": "HeadUserImage", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Users/{userId}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get user profile image.", + "operationId": "GetUserImageByIndex", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get user profile image.", + "operationId": "HeadUserImageByIndex", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cropWhitespace", + "in": "query", + "description": "Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "addPlayedIndicator", + "in": "query", + "description": "Optional. Add a played indicator.", + "schema": { + "type": "boolean" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Users/{userId}/Images/{imageType}/{index}": { + "post": { + "tags": [ + "Image" + ], + "summary": "Sets the user image.", + "operationId": "PostUserImageByIndex", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "(Unused) Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "index", + "in": "path", + "description": "(Unused) Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Image updated." + }, + "403": { + "description": "User does not have permission to delete the image.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete the user's image.", + "operationId": "DeleteUserImageByIndex", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "(Unused) Image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "index", + "in": "path", + "description": "(Unused) Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Image deleted." + }, + "403": { + "description": "User does not have permission to delete the image.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Images/General": { + "get": { + "tags": [ + "ImageByName" + ], + "summary": "Get all general images.", + "operationId": "GetGeneralImages", + "responses": { + "200": { + "description": "Retrieved list of images.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageByNameInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageByNameInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageByNameInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Images/General/{name}/{type}": { + "get": { + "tags": [ + "ImageByName" + ], + "summary": "Get General Image.", + "operationId": "GetGeneralImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the image.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "type", + "in": "path", + "description": "Image Type (primary, backdrop, logo, etc).", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream retrieved.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Image not found.", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Images/MediaInfo": { + "get": { + "tags": [ + "ImageByName" + ], + "summary": "Get all media info images.", + "operationId": "GetMediaInfoImages", + "responses": { + "200": { + "description": "Image list retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageByNameInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageByNameInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageByNameInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Images/MediaInfo/{theme}/{name}": { + "get": { + "tags": [ + "ImageByName" + ], + "summary": "Get media info image.", + "operationId": "GetMediaInfoImage", + "parameters": [ + { + "name": "theme", + "in": "path", + "description": "The theme to get the image from.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "path", + "description": "The name of the image.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream retrieved.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Image not found.", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Images/Ratings": { + "get": { + "tags": [ + "ImageByName" + ], + "summary": "Get all general images.", + "operationId": "GetRatingImages", + "responses": { + "200": { + "description": "Retrieved list of images.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageByNameInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageByNameInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageByNameInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Images/Ratings/{theme}/{name}": { + "get": { + "tags": [ + "ImageByName" + ], + "summary": "Get rating image.", + "operationId": "GetRatingImage", + "parameters": [ + { + "name": "theme", + "in": "path", + "description": "The theme to get the image from.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "path", + "description": "The name of the image.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream retrieved.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Image not found.", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Albums/{id}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given album.", + "operationId": "GetInstantMixFromAlbum", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/{id}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given artist.", + "operationId": "GetInstantMixFromArtists", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given artist.", + "operationId": "GetInstantMixFromArtists2", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{id}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given item.", + "operationId": "GetInstantMixFromItem", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MusicGenres/{name}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given genre.", + "operationId": "GetInstantMixFromMusicGenreByName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MusicGenres/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given genre.", + "operationId": "GetInstantMixFromMusicGenreById", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{id}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given playlist.", + "operationId": "GetInstantMixFromPlaylist", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Songs/{id}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given song.", + "operationId": "GetInstantMixFromSong", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ExternalIdInfos": { + "get": { + "tags": [ + "ItemLookup" + ], + "summary": "Get the item's external id info.", + "operationId": "GetExternalIdInfos", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "External id info retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalIdInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalIdInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalIdInfo" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Apply/{itemId}": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Applies search criteria to an item and refreshes metadata.", + "operationId": "ApplySearchCriteria", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "replaceAllImages", + "in": "query", + "description": "Optional. Whether or not to replace all images. Default: True.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "requestBody": { + "description": "The remote search result.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoteSearchResult" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoteSearchResult" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoteSearchResult" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Item metadata refreshed." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Book": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get book remote search.", + "operationId": "GetBookRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BookInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BookInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BookInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Book remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/BoxSet": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get box set remote search.", + "operationId": "GetBoxSetRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BoxSetInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BoxSetInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BoxSetInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Box set remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Movie": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get movie remote search.", + "operationId": "GetMovieRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovieInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovieInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovieInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Movie remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/MusicAlbum": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get music album remote search.", + "operationId": "GetMusicAlbumRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AlbumInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AlbumInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AlbumInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Music album remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/MusicArtist": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get music artist remote search.", + "operationId": "GetMusicArtistRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ArtistInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ArtistInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ArtistInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Music artist remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/MusicVideo": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get music video remote search.", + "operationId": "GetMusicVideoRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MusicVideoInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MusicVideoInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MusicVideoInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Music video remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Person": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get person remote search.", + "operationId": "GetPersonRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PersonLookupInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PersonLookupInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PersonLookupInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Person remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Series": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get series remote search.", + "operationId": "GetSeriesRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Series remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Trailer": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get trailer remote search.", + "operationId": "GetTrailerRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TrailerInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TrailerInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TrailerInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Trailer remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Refresh": { + "post": { + "tags": [ + "ItemRefresh" + ], + "summary": "Refreshes metadata for an item.", + "operationId": "RefreshItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "metadataRefreshMode", + "in": "query", + "description": "(Optional) Specifies the metadata refresh mode.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MetadataRefreshMode" + } + ], + "default": "None" + } + }, + { + "name": "imageRefreshMode", + "in": "query", + "description": "(Optional) Specifies the image refresh mode.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MetadataRefreshMode" + } + ], + "default": "None" + } + }, + { + "name": "replaceAllMetadata", + "in": "query", + "description": "(Optional) Determines if metadata should be replaced. Only applicable if mode is FullRefresh.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "replaceAllImages", + "in": "query", + "description": "(Optional) Determines if images should be replaced. Only applicable if mode is FullRefresh.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Item metadata refresh queued." + }, + "404": { + "description": "Item to refresh not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Items": { + "get": { + "tags": [ + "Items" + ], + "summary": "Gets items based on a query.", + "operationId": "GetItems", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id supplied as query parameter.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "maxOfficialRating", + "in": "query", + "description": "Optional filter by maximum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "hasThemeSong", + "in": "query", + "description": "Optional filter by items with theme songs.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasThemeVideo", + "in": "query", + "description": "Optional filter by items with theme videos.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSubtitles", + "in": "query", + "description": "Optional filter by items with subtitles.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSpecialFeature", + "in": "query", + "description": "Optional filter by items with special features.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTrailer", + "in": "query", + "description": "Optional filter by items with trailers.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string" + } + }, + { + "name": "parentIndexNumber", + "in": "query", + "description": "Optional filter by parent index number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "hasParentalRating", + "in": "query", + "description": "Optional filter by items that have or do not have a parental rating.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isHd", + "in": "query", + "description": "Optional filter by items that are HD or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "is4K", + "in": "query", + "description": "Optional filter by items that are 4K or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "locationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "excludeLocationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isUnaired", + "in": "query", + "description": "Optional filter by items that are unaired episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minCriticRating", + "in": "query", + "description": "Optional filter by minimum critic rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minPremiereDate", + "in": "query", + "description": "Optional. The minimum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSaved", + "in": "query", + "description": "Optional. The minimum last saved date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSavedForUser", + "in": "query", + "description": "Optional. The minimum last saved date for the current user. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "maxPremiereDate", + "in": "query", + "description": "Optional. The maximum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasOverview", + "in": "query", + "description": "Optional filter by items that have an overview or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasImdbId", + "in": "query", + "description": "Optional filter by items that have an imdb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTmdbId", + "in": "query", + "description": "Optional filter by items that have a tmdb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTvdbId", + "in": "query", + "description": "Optional filter by items that have a tvdb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional filter for live tv movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional filter for live tv series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional filter for live tv news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional filter for live tv kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional filter for live tv sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "excludeItemIds", + "in": "query", + "description": "Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "recursive", + "in": "query", + "description": "When searching within folders, this determines whether or not the search will be recursive. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Filter based on a search term.", + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "imageTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "isPlayed", + "in": "query", + "description": "Optional filter by items that are played, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "artists", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "artistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albumArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified album artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "contributingArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified contributing artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albums", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "albumIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "ids", + "in": "query", + "description": "Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "videoTypes", + "in": "query", + "description": "Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VideoType" + } + } + }, + { + "name": "minOfficialRating", + "in": "query", + "description": "Optional filter by minimum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "isLocked", + "in": "query", + "description": "Optional filter by items that are locked.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isPlaceHolder", + "in": "query", + "description": "Optional filter by items that are placeholders.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasOfficialRating", + "in": "query", + "description": "Optional filter by items that have official ratings.", + "schema": { + "type": "boolean" + } + }, + { + "name": "collapseBoxSetItems", + "in": "query", + "description": "Whether or not to hide items behind their boxsets.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minWidth", + "in": "query", + "description": "Optional. Filter by the minimum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minHeight", + "in": "query", + "description": "Optional. Filter by the minimum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. Filter by the maximum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. Filter by the maximum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "is3D", + "in": "query", + "description": "Optional filter by items that are 3D, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesStatus", + "in": "query", + "description": "Optional filter by Series Status. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SeriesStatus" + } + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Enable the total record count.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Library" + ], + "summary": "Deletes items from the library and filesystem.", + "operationId": "DeleteItems", + "parameters": [ + { + "name": "ids", + "in": "query", + "description": "The item ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "204": { + "description": "Items deleted." + }, + "401": { + "description": "Unauthorized access.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/Items": { + "get": { + "tags": [ + "Items" + ], + "summary": "Gets items based on a query.", + "operationId": "GetItemsByUserId", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id supplied as query parameter.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "maxOfficialRating", + "in": "query", + "description": "Optional filter by maximum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "hasThemeSong", + "in": "query", + "description": "Optional filter by items with theme songs.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasThemeVideo", + "in": "query", + "description": "Optional filter by items with theme videos.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSubtitles", + "in": "query", + "description": "Optional filter by items with subtitles.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSpecialFeature", + "in": "query", + "description": "Optional filter by items with special features.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTrailer", + "in": "query", + "description": "Optional filter by items with trailers.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string" + } + }, + { + "name": "parentIndexNumber", + "in": "query", + "description": "Optional filter by parent index number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "hasParentalRating", + "in": "query", + "description": "Optional filter by items that have or do not have a parental rating.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isHd", + "in": "query", + "description": "Optional filter by items that are HD or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "is4K", + "in": "query", + "description": "Optional filter by items that are 4K or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "locationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "excludeLocationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isUnaired", + "in": "query", + "description": "Optional filter by items that are unaired episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minCriticRating", + "in": "query", + "description": "Optional filter by minimum critic rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minPremiereDate", + "in": "query", + "description": "Optional. The minimum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSaved", + "in": "query", + "description": "Optional. The minimum last saved date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSavedForUser", + "in": "query", + "description": "Optional. The minimum last saved date for the current user. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "maxPremiereDate", + "in": "query", + "description": "Optional. The maximum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasOverview", + "in": "query", + "description": "Optional filter by items that have an overview or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasImdbId", + "in": "query", + "description": "Optional filter by items that have an imdb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTmdbId", + "in": "query", + "description": "Optional filter by items that have a tmdb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTvdbId", + "in": "query", + "description": "Optional filter by items that have a tvdb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional filter for live tv movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional filter for live tv series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional filter for live tv news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional filter for live tv kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional filter for live tv sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "excludeItemIds", + "in": "query", + "description": "Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "recursive", + "in": "query", + "description": "When searching within folders, this determines whether or not the search will be recursive. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Filter based on a search term.", + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "imageTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "isPlayed", + "in": "query", + "description": "Optional filter by items that are played, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "artists", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "artistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albumArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified album artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "contributingArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified contributing artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albums", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "albumIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "ids", + "in": "query", + "description": "Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "videoTypes", + "in": "query", + "description": "Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VideoType" + } + } + }, + { + "name": "minOfficialRating", + "in": "query", + "description": "Optional filter by minimum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "isLocked", + "in": "query", + "description": "Optional filter by items that are locked.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isPlaceHolder", + "in": "query", + "description": "Optional filter by items that are placeholders.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasOfficialRating", + "in": "query", + "description": "Optional filter by items that have official ratings.", + "schema": { + "type": "boolean" + } + }, + { + "name": "collapseBoxSetItems", + "in": "query", + "description": "Whether or not to hide items behind their boxsets.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minWidth", + "in": "query", + "description": "Optional. Filter by the minimum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minHeight", + "in": "query", + "description": "Optional. Filter by the minimum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. Filter by the maximum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. Filter by the maximum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "is3D", + "in": "query", + "description": "Optional filter by items that are 3D, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesStatus", + "in": "query", + "description": "Optional filter by Series Status. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SeriesStatus" + } + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Enable the total record count.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/Items/Resume": { + "get": { + "tags": [ + "Items" + ], + "summary": "Gets items based on a query.", + "operationId": "GetResumeItems", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "The start index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "The item limit.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional. Filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Enable the total record count.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "excludeActiveSessions", + "in": "query", + "description": "Optional. Whether to exclude the currently active sessions.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}": { + "post": { + "tags": [ + "ItemUpdate" + ], + "summary": "Updates an item.", + "operationId": "UpdateItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The new item properties.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Item updated." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "Library" + ], + "summary": "Deletes an item from the library and filesystem.", + "operationId": "DeleteItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Item deleted." + }, + "401": { + "description": "Unauthorized access.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ContentType": { + "post": { + "tags": [ + "ItemUpdate" + ], + "summary": "Updates an item's content type.", + "operationId": "UpdateItemContentType", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "contentType", + "in": "query", + "description": "The content type of the item.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Item content type updated." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Items/{itemId}/MetadataEditor": { + "get": { + "tags": [ + "ItemUpdate" + ], + "summary": "Gets metadata editor info for an item.", + "operationId": "GetMetadataEditorInfo", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item metadata editor returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataEditorInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/MetadataEditorInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/MetadataEditorInfo" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Albums/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarAlbums", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarArtists", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Ancestors": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets all parents of an item.", + "operationId": "GetAncestors", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item parents returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/CriticReviews": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets critic review for an item.", + "operationId": "GetCriticReviews", + "parameters": [ + { + "name": "itemId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Critic reviews returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Download": { + "get": { + "tags": [ + "Library" + ], + "summary": "Downloads item media.", + "operationId": "GetDownload", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Media downloaded.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "Download" + ] + } + ] + } + }, + "/Items/{itemId}/File": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get the original file of an item.", + "operationId": "GetFile", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "File stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarItems", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ThemeMedia": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get theme songs and videos for an item.", + "operationId": "GetThemeMedia", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "inheritFromParent", + "in": "query", + "description": "Optional. Determines whether or not parent items should be searched for theme media.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Theme songs and videos returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AllThemeMediaResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AllThemeMediaResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AllThemeMediaResult" + } + } + } + }, + "404": { + "description": "Item not found." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ThemeSongs": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get theme songs for an item.", + "operationId": "GetThemeSongs", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "inheritFromParent", + "in": "query", + "description": "Optional. Determines whether or not parent items should be searched for theme media.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Theme songs returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ThemeVideos": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get theme videos for an item.", + "operationId": "GetThemeVideos", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "inheritFromParent", + "in": "query", + "description": "Optional. Determines whether or not parent items should be searched for theme media.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Theme videos returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Counts": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get item counts.", + "operationId": "GetItemCounts", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. Get counts from a specific user's library.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional. Get counts of favorite items.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Item counts returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ItemCounts" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ItemCounts" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ItemCounts" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Libraries/AvailableOptions": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets the library options info.", + "operationId": "GetLibraryOptionsInfo", + "parameters": [ + { + "name": "libraryContentType", + "in": "query", + "description": "Library content type.", + "schema": { + "type": "string" + } + }, + { + "name": "isNewLibrary", + "in": "query", + "description": "Whether this is a new library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Library options info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LibraryOptionsResultDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LibraryOptionsResultDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LibraryOptionsResultDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault" + ] + } + ] + } + }, + "/Library/Media/Updated": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new movies have been added by an external source.", + "operationId": "PostUpdatedMedia", + "requestBody": { + "description": "The update paths.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaUpdateInfoDto" + } + ], + "description": "Media Update Info Dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaUpdateInfoDto" + } + ], + "description": "Media Update Info Dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaUpdateInfoDto" + } + ], + "description": "Media Update Info Dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Report success." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/MediaFolders": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets all user media folders.", + "operationId": "GetMediaFolders", + "parameters": [ + { + "name": "isHidden", + "in": "query", + "description": "Optional. Filter by folders that are marked hidden, or not.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Media folders returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Library/Movies/Added": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new movies have been added by an external source.", + "operationId": "PostAddedMovies", + "parameters": [ + { + "name": "tmdbId", + "in": "query", + "description": "The tmdbId.", + "schema": { + "type": "string" + } + }, + { + "name": "imdbId", + "in": "query", + "description": "The imdbId.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Report success." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/Movies/Updated": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new movies have been added by an external source.", + "operationId": "PostUpdatedMovies", + "parameters": [ + { + "name": "tmdbId", + "in": "query", + "description": "The tmdbId.", + "schema": { + "type": "string" + } + }, + { + "name": "imdbId", + "in": "query", + "description": "The imdbId.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Report success." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/PhysicalPaths": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets a list of physical paths from virtual folders.", + "operationId": "GetPhysicalPaths", + "responses": { + "200": { + "description": "Physical paths returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Library/Refresh": { + "post": { + "tags": [ + "Library" + ], + "summary": "Starts a library scan.", + "operationId": "RefreshLibrary", + "responses": { + "204": { + "description": "Library scan started." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Library/Series/Added": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new episodes of a series have been added by an external source.", + "operationId": "PostAddedSeries", + "parameters": [ + { + "name": "tvdbId", + "in": "query", + "description": "The tvdbId.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Report success." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/Series/Updated": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new episodes of a series have been added by an external source.", + "operationId": "PostUpdatedSeries", + "parameters": [ + { + "name": "tvdbId", + "in": "query", + "description": "The tvdbId.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Report success." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Movies/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarMovies", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarShows", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Trailers/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarTrailers", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/VirtualFolders": { + "get": { + "tags": [ + "LibraryStructure" + ], + "summary": "Gets all virtual folders.", + "operationId": "GetVirtualFolders", + "responses": { + "200": { + "description": "Virtual folders retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VirtualFolderInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VirtualFolderInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VirtualFolderInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + }, + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Adds a virtual folder.", + "operationId": "AddVirtualFolder", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the virtual folder.", + "schema": { + "type": "string" + } + }, + { + "name": "collectionType", + "in": "query", + "description": "The type of the collection.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CollectionTypeOptions" + } + ] + } + }, + { + "name": "paths", + "in": "query", + "description": "The paths of the virtual folder.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "The library options.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AddVirtualFolderDto" + } + ], + "description": "Add virtual folder dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AddVirtualFolderDto" + } + ], + "description": "Add virtual folder dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AddVirtualFolderDto" + } + ], + "description": "Add virtual folder dto." + } + } + } + }, + "responses": { + "204": { + "description": "Folder added." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + }, + "delete": { + "tags": [ + "LibraryStructure" + ], + "summary": "Removes a virtual folder.", + "operationId": "RemoveVirtualFolder", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the folder.", + "schema": { + "type": "string" + } + }, + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Folder removed." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + } + }, + "/Library/VirtualFolders/LibraryOptions": { + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Update library options.", + "operationId": "UpdateLibraryOptions", + "requestBody": { + "description": "The library name and options.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateLibraryOptionsDto" + } + ], + "description": "Update library options dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateLibraryOptionsDto" + } + ], + "description": "Update library options dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateLibraryOptionsDto" + } + ], + "description": "Update library options dto." + } + } + } + }, + "responses": { + "204": { + "description": "Library updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + } + }, + "/Library/VirtualFolders/Name": { + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Renames a virtual folder.", + "operationId": "RenameVirtualFolder", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the virtual folder.", + "schema": { + "type": "string" + } + }, + { + "name": "newName", + "in": "query", + "description": "The new name.", + "schema": { + "type": "string" + } + }, + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Folder renamed." + }, + "404": { + "description": "Library doesn't exist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "409": { + "description": "Library already exists.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + } + }, + "/Library/VirtualFolders/Paths": { + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Add a media path to a library.", + "operationId": "AddMediaPath", + "parameters": [ + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "The media path dto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathDto" + } + ], + "description": "Media Path dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathDto" + } + ], + "description": "Media Path dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathDto" + } + ], + "description": "Media Path dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Media path added." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + }, + "delete": { + "tags": [ + "LibraryStructure" + ], + "summary": "Remove a media path.", + "operationId": "RemoveMediaPath", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the library.", + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "The path to remove.", + "schema": { + "type": "string" + } + }, + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Media path removed." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + } + }, + "/Library/VirtualFolders/Paths/Update": { + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Updates a media path.", + "operationId": "UpdateMediaPath", + "requestBody": { + "description": "The name of the library and path infos.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateMediaPathRequestDto" + } + ], + "description": "Update library options dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateMediaPathRequestDto" + } + ], + "description": "Update library options dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateMediaPathRequestDto" + } + ], + "description": "Update library options dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Media path updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + } + }, + "/LiveTv/ChannelMappingOptions": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Get channel mapping options.", + "operationId": "GetChannelMappingOptions", + "parameters": [ + { + "name": "providerId", + "in": "query", + "description": "Provider id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Channel mapping options returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChannelMappingOptionsDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ChannelMappingOptionsDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ChannelMappingOptionsDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/ChannelMappings": { + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Set channel mappings.", + "operationId": "SetChannelMapping", + "requestBody": { + "description": "The set channel mapping dto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetChannelMappingDto" + } + ], + "description": "Set channel mapping dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetChannelMappingDto" + } + ], + "description": "Set channel mapping dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetChannelMappingDto" + } + ], + "description": "Set channel mapping dto." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Created channel mapping returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TunerChannelMapping" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TunerChannelMapping" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TunerChannelMapping" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement" + ] + } + ] + } + }, + "/LiveTv/Channels": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available live tv channels.", + "operationId": "GetLiveTvChannels", + "parameters": [ + { + "name": "type", + "in": "query", + "description": "Optional. Filter by channel type.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ChannelType" + } + ] + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional. Filter by channels that are favorites, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isLiked", + "in": "query", + "description": "Optional. Filter by channels that are liked, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isDisliked", + "in": "query", + "description": "Optional. Filter by channels that are disliked, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "\"Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Key to sort by.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort order.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SortOrder" + } + ] + } + }, + { + "name": "enableFavoriteSorting", + "in": "query", + "description": "Optional. Incorporate favorite and like status into channel sorting.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "addCurrentProgram", + "in": "query", + "description": "Optional. Adds current program info to each channel.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Available live tv channels returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/Channels/{channelId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv channel.", + "operationId": "GetChannel", + "parameters": [ + { + "name": "channelId", + "in": "path", + "description": "Channel id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Live tv channel returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/GuideInfo": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Get guid info.", + "operationId": "GetGuideInfo", + "responses": { + "200": { + "description": "Guid info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GuideInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/GuideInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/GuideInfo" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/Info": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available live tv services.", + "operationId": "GetLiveTvInfo", + "responses": { + "200": { + "description": "Available live tv services returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiveTvInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LiveTvInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LiveTvInfo" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/ListingProviders": { + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Adds a listings provider.", + "operationId": "AddListingProvider", + "parameters": [ + { + "name": "pw", + "in": "query", + "description": "Password.", + "schema": { + "type": "string" + } + }, + { + "name": "validateListings", + "in": "query", + "description": "Validate listings.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "validateLogin", + "in": "query", + "description": "Validate login.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "New listings info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Created listings provider returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Delete listing provider.", + "operationId": "DeleteListingProvider", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Listing provider id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Listing provider deleted." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement" + ] + } + ] + } + }, + "/LiveTv/ListingProviders/Default": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets default listings provider info.", + "operationId": "GetDefaultListingProvider", + "responses": { + "200": { + "description": "Default listings provider info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/ListingProviders/Lineups": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available lineups.", + "operationId": "GetLineups", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Provider id.", + "schema": { + "type": "string" + } + }, + { + "name": "type", + "in": "query", + "description": "Provider type.", + "schema": { + "type": "string" + } + }, + { + "name": "location", + "in": "query", + "description": "Location.", + "schema": { + "type": "string" + } + }, + { + "name": "country", + "in": "query", + "description": "Country.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Available lineups returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/ListingProviders/SchedulesDirect/Countries": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available countries.", + "operationId": "GetSchedulesDirectCountries", + "responses": { + "200": { + "description": "Available countries returned.", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/LiveRecordings/{recordingId}/stream": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv recording stream.", + "operationId": "GetLiveRecordingFile", + "parameters": [ + { + "name": "recordingId", + "in": "path", + "description": "Recording id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Recording stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Recording not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/LiveTv/LiveStreamFiles/{streamId}/stream.{container}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv channel stream.", + "operationId": "GetLiveStreamFile", + "parameters": [ + { + "name": "streamId", + "in": "path", + "description": "Stream id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "container", + "in": "path", + "description": "Container type.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Stream not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/LiveTv/Programs": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available live tv epgs.", + "operationId": "GetLiveTvPrograms", + "parameters": [ + { + "name": "channelIds", + "in": "query", + "description": "The channels to return guide information for.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "minStartDate", + "in": "query", + "description": "Optional. The minimum premiere start date.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasAired", + "in": "query", + "description": "Optional. Filter by programs that have completed airing, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isAiring", + "in": "query", + "description": "Optional. Filter by programs that are currently airing, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "maxStartDate", + "in": "query", + "description": "Optional. The maximum premiere start date.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minEndDate", + "in": "query", + "description": "Optional. The minimum premiere end date.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "maxEndDate", + "in": "query", + "description": "Optional. The maximum premiere end date.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "genres", + "in": "query", + "description": "The genres to return guide information for.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "The genre ids to return guide information for.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesTimerId", + "in": "query", + "description": "Optional. Filter by series timer id.", + "schema": { + "type": "string" + } + }, + { + "name": "librarySeriesId", + "in": "query", + "description": "Optional. Filter by library series id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Retrieve total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Live tv epgs returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available live tv epgs.", + "operationId": "GetPrograms", + "requestBody": { + "description": "Request body.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GetProgramsDto" + } + ], + "description": "Get programs dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GetProgramsDto" + } + ], + "description": "Get programs dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GetProgramsDto" + } + ], + "description": "Get programs dto." + } + } + } + }, + "responses": { + "200": { + "description": "Live tv epgs returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/Programs/{programId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv program.", + "operationId": "GetProgram", + "parameters": [ + { + "name": "programId", + "in": "path", + "description": "Program id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Program returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/Programs/Recommended": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets recommended live tv epgs.", + "operationId": "GetRecommendedPrograms", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. filter by user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "isAiring", + "in": "query", + "description": "Optional. Filter by programs that are currently airing, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasAired", + "in": "query", + "description": "Optional. Filter by programs that have completed airing, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "The genres to return guide information for.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Retrieve total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Recommended epgs returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/Recordings": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets live tv recordings.", + "operationId": "GetRecordings", + "parameters": [ + { + "name": "channelId", + "in": "query", + "description": "Optional. Filter by channel id.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "status", + "in": "query", + "description": "Optional. Filter by recording status.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RecordingStatus" + } + ] + } + }, + { + "name": "isInProgress", + "in": "query", + "description": "Optional. Filter by recordings that are in progress, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesTimerId", + "in": "query", + "description": "Optional. Filter by recordings belonging to a series timer.", + "schema": { + "type": "string" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isLibraryItem", + "in": "query", + "description": "Optional. Filter for is library item.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Return total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Live tv recordings returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/Recordings/{recordingId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv recording.", + "operationId": "GetRecording", + "parameters": [ + { + "name": "recordingId", + "in": "path", + "description": "Recording id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Recording returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Deletes a live tv recording.", + "operationId": "DeleteRecording", + "parameters": [ + { + "name": "recordingId", + "in": "path", + "description": "Recording id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Recording deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement" + ] + } + ] + } + }, + "/LiveTv/Recordings/Folders": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets recording folders.", + "operationId": "GetRecordingFolders", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Recording folders returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/Recordings/Groups": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets live tv recording groups.", + "operationId": "GetRecordingGroups", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Recording groups returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/Recordings/Groups/{groupId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Get recording group.", + "operationId": "GetRecordingGroup", + "parameters": [ + { + "name": "groupId", + "in": "path", + "description": "Group id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/Recordings/Series": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets live tv recording series.", + "operationId": "GetRecordingsSeries", + "parameters": [ + { + "name": "channelId", + "in": "query", + "description": "Optional. Filter by channel id.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "groupId", + "in": "query", + "description": "Optional. Filter by recording group.", + "schema": { + "type": "string" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "status", + "in": "query", + "description": "Optional. Filter by recording status.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RecordingStatus" + } + ] + } + }, + { + "name": "isInProgress", + "in": "query", + "description": "Optional. Filter by recordings that are in progress, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesTimerId", + "in": "query", + "description": "Optional. Filter by recordings belonging to a series timer.", + "schema": { + "type": "string" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Return total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Live tv recordings returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/SeriesTimers": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets live tv series timers.", + "operationId": "GetSeriesTimers", + "parameters": [ + { + "name": "sortBy", + "in": "query", + "description": "Optional. Sort by SortName or Priority.", + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort in Ascending or Descending order.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SortOrder" + } + ] + } + } + ], + "responses": { + "200": { + "description": "Timers returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Creates a live tv series timer.", + "operationId": "CreateSeriesTimer", + "requestBody": { + "description": "New series timer info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + } + } + }, + "responses": { + "204": { + "description": "Series timer info created." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement" + ] + } + ] + } + }, + "/LiveTv/SeriesTimers/{timerId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv series timer.", + "operationId": "GetSeriesTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Series timer returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + } + } + }, + "404": { + "description": "Series timer not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Cancels a live tv series timer.", + "operationId": "CancelSeriesTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Timer cancelled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Updates a live tv series timer.", + "operationId": "UpdateSeriesTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "New series timer info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + } + } + }, + "responses": { + "204": { + "description": "Series timer updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement" + ] + } + ] + } + }, + "/LiveTv/Timers": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets the live tv timers.", + "operationId": "GetTimers", + "parameters": [ + { + "name": "channelId", + "in": "query", + "description": "Optional. Filter by channel id.", + "schema": { + "type": "string" + } + }, + { + "name": "seriesTimerId", + "in": "query", + "description": "Optional. Filter by timers belonging to a series timer.", + "schema": { + "type": "string" + } + }, + { + "name": "isActive", + "in": "query", + "description": "Optional. Filter by timers that are active.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isScheduled", + "in": "query", + "description": "Optional. Filter by timers that are scheduled.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Creates a live tv timer.", + "operationId": "CreateTimer", + "requestBody": { + "description": "New timer info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + } + } + }, + "responses": { + "204": { + "description": "Timer created." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement" + ] + } + ] + } + }, + "/LiveTv/Timers/{timerId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a timer.", + "operationId": "GetTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Timer returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Cancels a live tv timer.", + "operationId": "CancelTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Timer deleted." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Updates a live tv timer.", + "operationId": "UpdateTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "New timer info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + } + } + }, + "responses": { + "204": { + "description": "Timer updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement" + ] + } + ] + } + }, + "/LiveTv/Timers/Defaults": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets the default values for a new timer.", + "operationId": "GetDefaultTimer", + "parameters": [ + { + "name": "programId", + "in": "query", + "description": "Optional. To attach default values based on a program.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Default values returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/TunerHosts": { + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Adds a tuner host.", + "operationId": "AddTunerHost", + "requestBody": { + "description": "New tuner host.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TunerHostInfo" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TunerHostInfo" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TunerHostInfo" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Created tuner host returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TunerHostInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TunerHostInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Deletes a tuner host.", + "operationId": "DeleteTunerHost", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Tuner host id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Tuner host deleted." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement" + ] + } + ] + } + }, + "/LiveTv/TunerHosts/Types": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Get tuner host types.", + "operationId": "GetTunerHostTypes", + "responses": { + "200": { + "description": "Tuner host types returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess" + ] + } + ] + } + }, + "/LiveTv/Tuners/{tunerId}/Reset": { + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Resets a tv tuner.", + "operationId": "ResetTuner", + "parameters": [ + { + "name": "tunerId", + "in": "path", + "description": "Tuner id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Tuner reset." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement" + ] + } + ] + } + }, + "/LiveTv/Tuners/Discover": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Discover tuners.", + "operationId": "DiscoverTuners", + "parameters": [ + { + "name": "newDevicesOnly", + "in": "query", + "description": "Only discover new tuners.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Tuners returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement" + ] + } + ] + } + }, + "/LiveTv/Tuners/Discvover": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Discover tuners.", + "operationId": "DiscvoverTuners", + "parameters": [ + { + "name": "newDevicesOnly", + "in": "query", + "description": "Only discover new tuners.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Tuners returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement" + ] + } + ] + } + }, + "/Localization/Countries": { + "get": { + "tags": [ + "Localization" + ], + "summary": "Gets known countries.", + "operationId": "GetCountries", + "responses": { + "200": { + "description": "Known countries returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CountryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CountryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CountryInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault" + ] + } + ] + } + }, + "/Localization/Cultures": { + "get": { + "tags": [ + "Localization" + ], + "summary": "Gets known cultures.", + "operationId": "GetCultures", + "responses": { + "200": { + "description": "Known cultures returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CultureDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CultureDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CultureDto" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault" + ] + } + ] + } + }, + "/Localization/Options": { + "get": { + "tags": [ + "Localization" + ], + "summary": "Gets localization options.", + "operationId": "GetLocalizationOptions", + "responses": { + "200": { + "description": "Localization options returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocalizationOption" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocalizationOption" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocalizationOption" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault" + ] + } + ] + } + }, + "/Localization/ParentalRatings": { + "get": { + "tags": [ + "Localization" + ], + "summary": "Gets known parental ratings.", + "operationId": "GetParentalRatings", + "responses": { + "200": { + "description": "Known parental ratings returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParentalRating" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParentalRating" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParentalRating" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault" + ] + } + ] + } + }, + "/Items/{itemId}/PlaybackInfo": { + "get": { + "tags": [ + "MediaInfo" + ], + "summary": "Gets live playback media info for an item.", + "operationId": "GetPlaybackInfo", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Playback info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "MediaInfo" + ], + "summary": "Gets live playback media info for an item.", + "description": "For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.\r\nQuery parameters are obsolete.", + "operationId": "GetPostedPlaybackInfo", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "deprecated": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "The maximum streaming bitrate.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "The start time in ticks.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "The audio stream index.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "The subtitle stream index.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "The maximum number of audio channels.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media source id.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The livestream id.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "autoOpenLiveStream", + "in": "query", + "description": "Whether to auto open the livestream.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "enableDirectPlay", + "in": "query", + "description": "Whether to enable direct play. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "enableDirectStream", + "in": "query", + "description": "Whether to enable direct stream. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "enableTranscoding", + "in": "query", + "description": "Whether to enable transcoding. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether to allow to copy the video stream. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether to allow to copy the audio stream. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "description": "The playback info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackInfoDto" + } + ], + "description": "Plabyback info dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackInfoDto" + } + ], + "description": "Plabyback info dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackInfoDto" + } + ], + "description": "Plabyback info dto." + } + } + } + }, + "responses": { + "200": { + "description": "Playback info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveStreams/Close": { + "post": { + "tags": [ + "MediaInfo" + ], + "summary": "Closes a media source.", + "operationId": "CloseLiveStream", + "parameters": [ + { + "name": "liveStreamId", + "in": "query", + "description": "The livestream id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Livestream closed." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveStreams/Open": { + "post": { + "tags": [ + "MediaInfo" + ], + "summary": "Opens a media source.", + "operationId": "OpenLiveStream", + "parameters": [ + { + "name": "openToken", + "in": "query", + "description": "The open token.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "The start time in ticks.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "The audio stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "The subtitle stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "The maximum number of audio channels.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "itemId", + "in": "query", + "description": "The item id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableDirectPlay", + "in": "query", + "description": "Whether to enable direct play. Default: true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableDirectStream", + "in": "query", + "description": "Whether to enable direct stream. Default: true.", + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "description": "The open live stream dto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenLiveStreamDto" + } + ], + "description": "Open live stream dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenLiveStreamDto" + } + ], + "description": "Open live stream dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenLiveStreamDto" + } + ], + "description": "Open live stream dto." + } + } + } + }, + "responses": { + "200": { + "description": "Media source opened.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiveStreamResponse" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LiveStreamResponse" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LiveStreamResponse" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playback/BitrateTest": { + "get": { + "tags": [ + "MediaInfo" + ], + "summary": "Tests the network with a request with the size of the bitrate.", + "operationId": "GetBitrateTestBytes", + "parameters": [ + { + "name": "size", + "in": "query", + "description": "The bitrate. Defaults to 102400.", + "schema": { + "maximum": 100000000, + "minimum": 1, + "type": "integer", + "format": "int32", + "default": 102400 + } + } + ], + "responses": { + "200": { + "description": "Test buffer returned.", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Movies/Recommendations": { + "get": { + "tags": [ + "Movies" + ], + "summary": "Gets movie recommendations.", + "operationId": "GetMovieRecommendations", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. The fields to return.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "categoryLimit", + "in": "query", + "description": "The max number of categories to return.", + "schema": { + "type": "integer", + "format": "int32", + "default": 5 + } + }, + { + "name": "itemLimit", + "in": "query", + "description": "The max number of items to return per category.", + "schema": { + "type": "integer", + "format": "int32", + "default": 8 + } + } + ], + "responses": { + "200": { + "description": "Movie recommendations returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecommendationDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecommendationDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecommendationDto" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MusicGenres": { + "get": { + "tags": [ + "MusicGenres" + ], + "summary": "Gets all music genres from a given item, folder, or the entire library.", + "operationId": "GetMusicGenres", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Include total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Music genres returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MusicGenres/{genreName}": { + "get": { + "tags": [ + "MusicGenres" + ], + "summary": "Gets a music genre, by name.", + "operationId": "GetMusicGenre", + "parameters": [ + { + "name": "genreName", + "in": "path", + "description": "The genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Notifications/{userId}": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "Gets a user's notifications.", + "operationId": "GetNotifications", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Notifications returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationResultDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/NotificationResultDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/NotificationResultDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Notifications/{userId}/Read": { + "post": { + "tags": [ + "Notifications" + ], + "summary": "Sets notifications as read.", + "operationId": "SetRead", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Notifications set as read." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Notifications/{userId}/Summary": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "Gets a user's notification summary.", + "operationId": "GetNotificationsSummary", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Summary of user's notifications returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationsSummaryDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/NotificationsSummaryDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/NotificationsSummaryDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Notifications/{userId}/Unread": { + "post": { + "tags": [ + "Notifications" + ], + "summary": "Sets notifications as unread.", + "operationId": "SetUnread", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Notifications set as unread." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Notifications/Admin": { + "post": { + "tags": [ + "Notifications" + ], + "summary": "Sends a notification to all admins.", + "operationId": "CreateAdminNotification", + "requestBody": { + "description": "The notification request.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AdminNotificationDto" + } + ], + "description": "The admin notification dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AdminNotificationDto" + } + ], + "description": "The admin notification dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AdminNotificationDto" + } + ], + "description": "The admin notification dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Notification sent." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Notifications/Services": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "Gets notification services.", + "operationId": "GetNotificationServices", + "responses": { + "200": { + "description": "All notification services returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Notifications/Types": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "Gets notification types.", + "operationId": "GetNotificationTypes", + "responses": { + "200": { + "description": "All notification types returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationTypeInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationTypeInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationTypeInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Packages": { + "get": { + "tags": [ + "Package" + ], + "summary": "Gets available packages.", + "operationId": "GetPackages", + "responses": { + "200": { + "description": "Available packages returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PackageInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PackageInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PackageInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Packages/{name}": { + "get": { + "tags": [ + "Package" + ], + "summary": "Gets a package by name or assembly GUID.", + "operationId": "GetPackageInfo", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the package.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "assemblyGuid", + "in": "query", + "description": "The GUID of the associated assembly.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Package retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PackageInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PackageInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PackageInfo" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Packages/Installed/{name}": { + "post": { + "tags": [ + "Package" + ], + "summary": "Installs a package.", + "operationId": "InstallPackage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Package name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "assemblyGuid", + "in": "query", + "description": "GUID of the associated assembly.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "query", + "description": "Optional version. Defaults to latest version.", + "schema": { + "type": "string" + } + }, + { + "name": "repositoryUrl", + "in": "query", + "description": "Optional. Specify the repository to install from.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Package found." + }, + "404": { + "description": "Package not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Packages/Installing/{packageId}": { + "delete": { + "tags": [ + "Package" + ], + "summary": "Cancels a package installation.", + "operationId": "CancelPackageInstallation", + "parameters": [ + { + "name": "packageId", + "in": "path", + "description": "Installation Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Installation cancelled." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Repositories": { + "get": { + "tags": [ + "Package" + ], + "summary": "Gets all package repositories.", + "operationId": "GetRepositories", + "responses": { + "200": { + "description": "Package repositories returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Package" + ], + "summary": "Sets the enabled and existing package repositories.", + "operationId": "SetRepositories", + "requestBody": { + "description": "The list of package repositories.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Package repositories saved." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Persons": { + "get": { + "tags": [ + "Persons" + ], + "summary": "Gets all persons.", + "operationId": "GetPersons", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term.", + "schema": { + "type": "string" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not. userId is required.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "excludePersonTypes", + "in": "query", + "description": "Optional. If specified results will be filtered to exclude those containing the specified PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified results will be filtered to include only those containing the specified PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "appearsInItemId", + "in": "query", + "description": "Optional. If specified, person results will be filtered on items related to said persons.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Persons returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Persons/{name}": { + "get": { + "tags": [ + "Persons" + ], + "summary": "Get person by name.", + "operationId": "GetPerson", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Person returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "404": { + "description": "Person not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists": { + "post": { + "tags": [ + "Playlists" + ], + "summary": "Creates a new playlist.", + "description": "For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.\r\nQuery parameters are obsolete.", + "operationId": "CreatePlaylist", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The playlist name.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "ids", + "in": "query", + "description": "The item ids.", + "deprecated": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "deprecated": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaType", + "in": "query", + "description": "The media type.", + "deprecated": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The create playlist payload.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreatePlaylistDto" + } + ], + "description": "Create new playlist dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreatePlaylistDto" + } + ], + "description": "Create new playlist dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreatePlaylistDto" + } + ], + "description": "Create new playlist dto." + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaylistCreationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistCreationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistCreationResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}/Items": { + "post": { + "tags": [ + "Playlists" + ], + "summary": "Adds items to a playlist.", + "operationId": "AddToPlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ids", + "in": "query", + "description": "Item id, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "The userId.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Items added to playlist." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Playlists" + ], + "summary": "Removes items from a playlist.", + "operationId": "RemoveFromPlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "entryIds", + "in": "query", + "description": "The item ids, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "204": { + "description": "Items removed." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "get": { + "tags": [ + "Playlists" + ], + "summary": "Gets the original items of a playlist.", + "operationId": "GetPlaylistItems", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Original playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Playlist not found." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}/Items/{itemId}/Move/{newIndex}": { + "post": { + "tags": [ + "Playlists" + ], + "summary": "Moves a playlist item.", + "operationId": "MoveItem", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "newIndex", + "in": "path", + "description": "The new index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Item moved to new index." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Playing": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports playback has started within a session.", + "operationId": "ReportPlaybackStart", + "requestBody": { + "description": "The playback start info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStartInfo" + } + ], + "description": "Class PlaybackStartInfo." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStartInfo" + } + ], + "description": "Class PlaybackStartInfo." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStartInfo" + } + ], + "description": "Class PlaybackStartInfo." + } + } + } + }, + "responses": { + "204": { + "description": "Playback start recorded." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Playing/Ping": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Pings a playback session.", + "operationId": "PingPlaybackSession", + "parameters": [ + { + "name": "playSessionId", + "in": "query", + "description": "Playback session id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Playback session pinged." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Playing/Progress": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports playback progress within a session.", + "operationId": "ReportPlaybackProgress", + "requestBody": { + "description": "The playback progress info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackProgressInfo" + } + ], + "description": "Class PlaybackProgressInfo." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackProgressInfo" + } + ], + "description": "Class PlaybackProgressInfo." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackProgressInfo" + } + ], + "description": "Class PlaybackProgressInfo." + } + } + } + }, + "responses": { + "204": { + "description": "Playback progress recorded." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Playing/Stopped": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports playback has stopped within a session.", + "operationId": "ReportPlaybackStopped", + "requestBody": { + "description": "The playback stop info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStopInfo" + } + ], + "description": "Class PlaybackStopInfo." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStopInfo" + } + ], + "description": "Class PlaybackStopInfo." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStopInfo" + } + ], + "description": "Class PlaybackStopInfo." + } + } + } + }, + "responses": { + "204": { + "description": "Playback stop recorded." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/PlayedItems/{itemId}": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Marks an item as played for user.", + "operationId": "MarkPlayedItem", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "datePlayed", + "in": "query", + "description": "Optional. The date the item was played.", + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "Item marked as played.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Playstate" + ], + "summary": "Marks an item as unplayed for user.", + "operationId": "MarkUnplayedItem", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item marked as unplayed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/PlayingItems/{itemId}": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports that a user has begun playing an item.", + "operationId": "OnPlaybackStart", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The id of the MediaSource.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "The audio stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "The subtitle stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "playMethod", + "in": "query", + "description": "The play method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ] + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "canSeek", + "in": "query", + "description": "Indicates if the client can seek.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Play start recorded." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Playstate" + ], + "summary": "Reports that a user has stopped playing an item.", + "operationId": "OnPlaybackStopped", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The id of the MediaSource.", + "schema": { + "type": "string" + } + }, + { + "name": "nextMediaType", + "in": "query", + "description": "The next media type that will play.", + "schema": { + "type": "string" + } + }, + { + "name": "positionTicks", + "in": "query", + "description": "Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Playback stop recorded." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/PlayingItems/{itemId}/Progress": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports a user's playback progress.", + "operationId": "OnPlaybackProgress", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The id of the MediaSource.", + "schema": { + "type": "string" + } + }, + { + "name": "positionTicks", + "in": "query", + "description": "Optional. The current position, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "The audio stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "The subtitle stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "volumeLevel", + "in": "query", + "description": "Scale of 0-100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "playMethod", + "in": "query", + "description": "The play method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ] + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "repeatMode", + "in": "query", + "description": "The repeat mode.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RepeatMode" + } + ] + } + }, + { + "name": "isPaused", + "in": "query", + "description": "Indicates if the player is paused.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "isMuted", + "in": "query", + "description": "Indicates if the player is muted.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Play progress recorded." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Plugins": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "Gets a list of currently installed plugins.", + "operationId": "GetPlugins", + "responses": { + "200": { + "description": "Installed plugins returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Plugins/{pluginId}": { + "delete": { + "tags": [ + "Plugins" + ], + "summary": "Uninstalls a plugin.", + "operationId": "UninstallPlugin", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Plugin uninstalled." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Plugins/{pluginId}/{version}": { + "delete": { + "tags": [ + "Plugins" + ], + "summary": "Uninstalls a plugin by version.", + "operationId": "UninstallPluginByVersion", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "path", + "description": "Plugin version.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Plugin uninstalled." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Plugins/{pluginId}/{version}/Disable": { + "post": { + "tags": [ + "Plugins" + ], + "summary": "Disable a plugin.", + "operationId": "DisablePlugin", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "path", + "description": "Plugin version.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Plugin disabled." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Plugins/{pluginId}/{version}/Enable": { + "post": { + "tags": [ + "Plugins" + ], + "summary": "Enables a disabled plugin.", + "operationId": "EnablePlugin", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "path", + "description": "Plugin version.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Plugin enabled." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Plugins/{pluginId}/{version}/Image": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "Gets a plugin's image.", + "operationId": "GetPluginImage", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "path", + "description": "Plugin version.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Plugin image returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Plugins/{pluginId}/Configuration": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "Gets plugin configuration.", + "operationId": "GetPluginConfiguration", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Plugin configuration returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BasePluginConfiguration" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BasePluginConfiguration" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BasePluginConfiguration" + } + } + } + }, + "404": { + "description": "Plugin not found or plugin configuration not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Plugins" + ], + "summary": "Updates plugin configuration.", + "description": "Accepts plugin configuration as JSON body.", + "operationId": "UpdatePluginConfiguration", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Plugin configuration updated." + }, + "404": { + "description": "Plugin not found or plugin does not have configuration.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Plugins/{pluginId}/Manifest": { + "post": { + "tags": [ + "Plugins" + ], + "summary": "Gets a plugin's manifest.", + "operationId": "GetPluginManifest", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Plugin manifest returned." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/QuickConnect/Authorize": { + "post": { + "tags": [ + "QuickConnect" + ], + "summary": "Authorizes a pending quick connect request.", + "operationId": "Authorize", + "parameters": [ + { + "name": "code", + "in": "query", + "description": "Quick connect code to authorize.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Quick connect result authorized successfully.", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "boolean" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "boolean" + } + } + } + }, + "403": { + "description": "Unknown user id.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/QuickConnect/Connect": { + "get": { + "tags": [ + "QuickConnect" + ], + "summary": "Attempts to retrieve authentication information.", + "operationId": "Connect", + "parameters": [ + { + "name": "secret", + "in": "query", + "description": "Secret previously returned from the Initiate endpoint.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Quick connect result returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + } + } + }, + "404": { + "description": "Unknown quick connect secret.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/QuickConnect/Enabled": { + "get": { + "tags": [ + "QuickConnect" + ], + "summary": "Gets the current quick connect state.", + "operationId": "GetEnabled", + "responses": { + "200": { + "description": "Quick connect state returned.", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "boolean" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "boolean" + } + } + } + } + } + } + }, + "/QuickConnect/Initiate": { + "get": { + "tags": [ + "QuickConnect" + ], + "summary": "Initiate a new quick connect request.", + "operationId": "Initiate", + "responses": { + "200": { + "description": "Quick connect request successfully created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + } + } + }, + "401": { + "description": "Quick connect is not active on this server." + } + } + } + }, + "/Items/{itemId}/RemoteImages": { + "get": { + "tags": [ + "RemoteImage" + ], + "summary": "Gets available remote images for an item.", + "operationId": "GetRemoteImages", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "type", + "in": "query", + "description": "The image type.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ] + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "providerName", + "in": "query", + "description": "Optional. The image provider to use.", + "schema": { + "type": "string" + } + }, + { + "name": "includeAllLanguages", + "in": "query", + "description": "Optional. Include all languages.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Remote Images returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RemoteImageResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/RemoteImageResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/RemoteImageResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/RemoteImages/Download": { + "post": { + "tags": [ + "RemoteImage" + ], + "summary": "Downloads a remote image for an item.", + "operationId": "DownloadRemoteImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "type", + "in": "query", + "description": "The image type.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageUrl", + "in": "query", + "description": "The image url.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Remote image downloaded." + }, + "404": { + "description": "Remote image not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Items/{itemId}/RemoteImages/Providers": { + "get": { + "tags": [ + "RemoteImage" + ], + "summary": "Gets available remote image providers for an item.", + "operationId": "GetRemoteImageProviders", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Returned remote image providers.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageProviderInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageProviderInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageProviderInfo" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/ScheduledTasks": { + "get": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Get tasks.", + "operationId": "GetTasks", + "parameters": [ + { + "name": "isHidden", + "in": "query", + "description": "Optional filter tasks that are hidden, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isEnabled", + "in": "query", + "description": "Optional filter tasks that are enabled, or not.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Scheduled tasks retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/ScheduledTasks/{taskId}": { + "get": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Get task by id.", + "operationId": "GetTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "description": "Task Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Task retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaskInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TaskInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TaskInfo" + } + } + } + }, + "404": { + "description": "Task not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/ScheduledTasks/{taskId}/Triggers": { + "post": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Update specified task triggers.", + "operationId": "UpdateTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "description": "Task Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Triggers.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskTriggerInfo" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskTriggerInfo" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskTriggerInfo" + } + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Task triggers updated." + }, + "404": { + "description": "Task not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/ScheduledTasks/Running/{taskId}": { + "post": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Start specified task.", + "operationId": "StartTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "description": "Task Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Task started." + }, + "404": { + "description": "Task not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Stop specified task.", + "operationId": "StopTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "description": "Task Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Task stopped." + }, + "404": { + "description": "Task not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Search/Hints": { + "get": { + "tags": [ + "Search" + ], + "summary": "Gets the search hint result.", + "operationId": "Get", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Supply a user id to search within a user's library or omit to search all.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term to filter on.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "If specified, only results with the specified item types are returned. This allows multiple, comma delimeted.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "If specified, results with these item types are filtered out. This allows multiple, comma delimeted.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "If specified, only results with the specified media types are returned. This allows multiple, comma delimeted.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "If specified, only children of the parent are returned.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "includePeople", + "in": "query", + "description": "Optional filter whether to include people.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "includeMedia", + "in": "query", + "description": "Optional filter whether to include media.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "includeGenres", + "in": "query", + "description": "Optional filter whether to include genres.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "includeStudios", + "in": "query", + "description": "Optional filter whether to include studios.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "includeArtists", + "in": "query", + "description": "Optional filter whether to include artists.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Search hint returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchHintResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SearchHintResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SearchHintResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Auth/PasswordResetProviders": { + "get": { + "tags": [ + "Session" + ], + "summary": "Get all password reset providers.", + "operationId": "GetPasswordResetProviders", + "responses": { + "200": { + "description": "Password reset providers retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Auth/Providers": { + "get": { + "tags": [ + "Session" + ], + "summary": "Get all auth providers.", + "operationId": "GetAuthProviders", + "responses": { + "200": { + "description": "Auth providers retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Sessions": { + "get": { + "tags": [ + "Session" + ], + "summary": "Gets a list of sessions.", + "operationId": "GetSessions", + "parameters": [ + { + "name": "controllableByUserId", + "in": "query", + "description": "Filter by sessions that a given user is allowed to remote control.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "Filter by device Id.", + "schema": { + "type": "string" + } + }, + { + "name": "activeWithinSeconds", + "in": "query", + "description": "Optional. Filter by sessions that were active in the last n seconds.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "List of sessions returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Command": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a full general command to a client.", + "operationId": "SendFullGeneralCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The MediaBrowser.Model.Session.GeneralCommand.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommand" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommand" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommand" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Full general command sent to session." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Command/{command}": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a general command to a client.", + "operationId": "SendGeneralCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "command", + "in": "path", + "description": "The command to send.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommandType" + } + ], + "description": "This exists simply to identify a set of known commands." + } + } + ], + "responses": { + "204": { + "description": "General command sent to session." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Message": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a command to a client to display a message to the user.", + "operationId": "SendMessageCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and TimeoutMs.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MessageCommand" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MessageCommand" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MessageCommand" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Message sent." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Playing": { + "post": { + "tags": [ + "Session" + ], + "summary": "Instructs a session to play an item.", + "operationId": "Play", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "playCommand", + "in": "query", + "description": "The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet implemented play next and play last may play now.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayCommand" + } + ], + "description": "Enum PlayCommand." + } + }, + { + "name": "itemIds", + "in": "query", + "description": "The ids of the items to play, comma delimited.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "startPositionTicks", + "in": "query", + "description": "The starting position of the first item.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "Optional. The media source id.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to play.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to play.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The start index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Instruction sent to session." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Playing/{command}": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a playstate command to a client.", + "operationId": "SendPlaystateCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "command", + "in": "path", + "description": "The MediaBrowser.Model.Session.PlaystateCommand.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaystateCommand" + } + ], + "description": "Enum PlaystateCommand." + } + }, + { + "name": "seekPositionTicks", + "in": "query", + "description": "The optional position ticks.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "controllingUserId", + "in": "query", + "description": "The optional controlling user id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Playstate command sent to session." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/System/{command}": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a system command to a client.", + "operationId": "SendSystemCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "command", + "in": "path", + "description": "The command to send.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommandType" + } + ], + "description": "This exists simply to identify a set of known commands." + } + } + ], + "responses": { + "204": { + "description": "System command sent to session." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/User/{userId}": { + "post": { + "tags": [ + "Session" + ], + "summary": "Adds an additional user to a session.", + "operationId": "AddUserToSession", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "User added to session." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Session" + ], + "summary": "Removes an additional user from a session.", + "operationId": "RemoveUserFromSession", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "User removed from session." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Viewing": { + "post": { + "tags": [ + "Session" + ], + "summary": "Instructs a session to browse to an item or view.", + "operationId": "DisplayContent", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session Id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemType", + "in": "query", + "description": "The type of item to browse to.", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemKind" + } + ], + "description": "The base item kind." + } + }, + { + "name": "itemId", + "in": "query", + "description": "The Id of the item.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemName", + "in": "query", + "description": "The name of the item.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Instruction sent to session." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Capabilities": { + "post": { + "tags": [ + "Session" + ], + "summary": "Updates capabilities for a device.", + "operationId": "PostCapabilities", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The session id.", + "schema": { + "type": "string" + } + }, + { + "name": "playableMediaTypes", + "in": "query", + "description": "A list of playable media types, comma delimited. Audio, Video, Book, Photo.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "supportedCommands", + "in": "query", + "description": "A list of supported remote control commands, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneralCommandType" + } + } + }, + { + "name": "supportsMediaControl", + "in": "query", + "description": "Determines whether media can be played remotely..", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "supportsSync", + "in": "query", + "description": "Determines whether sync is supported.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "supportsPersistentIdentifier", + "in": "query", + "description": "Determines whether the device supports a unique identifier.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "204": { + "description": "Capabilities posted." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Capabilities/Full": { + "post": { + "tags": [ + "Session" + ], + "summary": "Updates capabilities for a device.", + "operationId": "PostFullCapabilities", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The session id.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The MediaBrowser.Model.Session.ClientCapabilities.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Client capabilities dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Client capabilities dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Client capabilities dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Capabilities updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Logout": { + "post": { + "tags": [ + "Session" + ], + "summary": "Reports that a session has ended.", + "operationId": "ReportSessionEnded", + "responses": { + "204": { + "description": "Session end reported to server." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Viewing": { + "post": { + "tags": [ + "Session" + ], + "summary": "Reports that a session is viewing an item.", + "operationId": "ReportViewing", + "parameters": [ + { + "name": "sessionId", + "in": "query", + "description": "The session id.", + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "query", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Session reported to server." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Startup/Complete": { + "post": { + "tags": [ + "Startup" + ], + "summary": "Completes the startup wizard.", + "operationId": "CompleteWizard", + "responses": { + "204": { + "description": "Startup wizard completed." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + } + }, + "/Startup/Configuration": { + "get": { + "tags": [ + "Startup" + ], + "summary": "Gets the initial startup wizard configuration.", + "operationId": "GetStartupConfiguration", + "responses": { + "200": { + "description": "Initial startup wizard configuration retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + }, + "post": { + "tags": [ + "Startup" + ], + "summary": "Sets the initial startup wizard configuration.", + "operationId": "UpdateInitialConfiguration", + "requestBody": { + "description": "The updated startup configuration.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + ], + "description": "The startup configuration DTO." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + ], + "description": "The startup configuration DTO." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + ], + "description": "The startup configuration DTO." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Configuration saved." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + } + }, + "/Startup/FirstUser": { + "get": { + "tags": [ + "Startup" + ], + "summary": "Gets the first user.", + "operationId": "GetFirstUser_2", + "responses": { + "200": { + "description": "Initial user retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + } + }, + "/Startup/RemoteAccess": { + "post": { + "tags": [ + "Startup" + ], + "summary": "Sets remote access and UPnP.", + "operationId": "SetRemoteAccess", + "requestBody": { + "description": "The startup remote access dto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupRemoteAccessDto" + } + ], + "description": "Startup remote access dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupRemoteAccessDto" + } + ], + "description": "Startup remote access dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupRemoteAccessDto" + } + ], + "description": "Startup remote access dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Configuration saved." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + } + }, + "/Startup/User": { + "get": { + "tags": [ + "Startup" + ], + "summary": "Gets the first user.", + "operationId": "GetFirstUser", + "responses": { + "200": { + "description": "Initial user retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + }, + "post": { + "tags": [ + "Startup" + ], + "summary": "Sets the user name and password.", + "operationId": "UpdateStartupUser", + "requestBody": { + "description": "The DTO containing username and password.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupUserDto" + } + ], + "description": "The startup user DTO." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupUserDto" + } + ], + "description": "The startup user DTO." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupUserDto" + } + ], + "description": "The startup user DTO." + } + } + } + }, + "responses": { + "204": { + "description": "Updated user name and password." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated" + ] + } + ] + } + }, + "/Studios": { + "get": { + "tags": [ + "Studios" + ], + "summary": "Gets all studios from a given item, folder, or the entire library.", + "operationId": "GetStudios", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Studios returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Studios/{name}": { + "get": { + "tags": [ + "Studios" + ], + "summary": "Gets a studio by name.", + "operationId": "GetStudio", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Studio returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/FallbackFont/Fonts": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets a list of available fallback font files.", + "operationId": "GetFallbackFontList", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FontFile" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FontFile" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FontFile" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/FallbackFont/Fonts/{name}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets a fallback font file.", + "operationId": "GetFallbackFont", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the fallback font file to get.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Fallback font file retrieved.", + "content": { + "font/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/RemoteSearch/Subtitles/{language}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Search remote subtitles.", + "operationId": "SearchRemoteSubtitles", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "language", + "in": "path", + "description": "The language of the subtitles.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "isPerfectMatch", + "in": "query", + "description": "Optional. Only show subtitles which are a perfect match.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Subtitles retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSubtitleInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSubtitleInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSubtitleInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/RemoteSearch/Subtitles/{subtitleId}": { + "post": { + "tags": [ + "Subtitle" + ], + "summary": "Downloads a remote subtitle.", + "operationId": "DownloadRemoteSubtitles", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "subtitleId", + "in": "path", + "description": "The subtitle id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Subtitle downloaded." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Providers/Subtitles/Subtitles/{id}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets the remote subtitles.", + "operationId": "GetRemoteSubtitles", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "File returned.", + "content": { + "text/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/{mediaSourceId}/Subtitles/{index}/subtitles.m3u8": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets an HLS subtitle playlist.", + "operationId": "GetSubtitlePlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "index", + "in": "path", + "description": "The subtitle stream index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "path", + "description": "The media source id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The subtitle segment length.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Subtitle playlist retrieved.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/Subtitles": { + "post": { + "tags": [ + "Subtitle" + ], + "summary": "Upload an external subtitle file.", + "operationId": "UploadSubtitle", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item the subtitle belongs to.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The request body.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UploadSubtitleDto" + } + ], + "description": "Upload subtitles dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UploadSubtitleDto" + } + ], + "description": "Upload subtitles dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UploadSubtitleDto" + } + ], + "description": "Upload subtitles dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Subtitle uploaded." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Videos/{itemId}/Subtitles/{index}": { + "delete": { + "tags": [ + "Subtitle" + ], + "summary": "Deletes an external subtitle file.", + "operationId": "DeleteSubtitle", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "index", + "in": "path", + "description": "The index of the subtitle file.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Subtitle deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/{routeStartPositionTicks}/Stream.{routeFormat}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets subtitles in a specified format.", + "operationId": "GetSubtitleWithTicks", + "parameters": [ + { + "name": "routeItemId", + "in": "path", + "description": "The (route) item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "routeMediaSourceId", + "in": "path", + "description": "The (route) media source id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "routeIndex", + "in": "path", + "description": "The (route) subtitle stream index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "routeStartPositionTicks", + "in": "path", + "description": "The (route) start position of the subtitle in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "routeFormat", + "in": "path", + "description": "The (route) format of the returned subtitle.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "query", + "description": "The item id.", + "deprecated": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media source id.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "index", + "in": "query", + "description": "The subtitle stream index.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startPositionTicks", + "in": "query", + "description": "The start position of the subtitle in ticks.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "format", + "in": "query", + "description": "The format of the returned subtitle.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "endPositionTicks", + "in": "query", + "description": "Optional. The end position of the subtitle in ticks.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Optional. Whether to copy the timestamps.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "addVttTimeMap", + "in": "query", + "description": "Optional. Whether to add a VTT time map.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "File returned.", + "content": { + "text/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/Stream.{routeFormat}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets subtitles in a specified format.", + "operationId": "GetSubtitle", + "parameters": [ + { + "name": "routeItemId", + "in": "path", + "description": "The (route) item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "routeMediaSourceId", + "in": "path", + "description": "The (route) media source id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "routeIndex", + "in": "path", + "description": "The (route) subtitle stream index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "routeFormat", + "in": "path", + "description": "The (route) format of the returned subtitle.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "query", + "description": "The item id.", + "deprecated": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media source id.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "index", + "in": "query", + "description": "The subtitle stream index.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "format", + "in": "query", + "description": "The format of the returned subtitle.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "endPositionTicks", + "in": "query", + "description": "Optional. The end position of the subtitle in ticks.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Optional. Whether to copy the timestamps.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "addVttTimeMap", + "in": "query", + "description": "Optional. Whether to add a VTT time map.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "startPositionTicks", + "in": "query", + "description": "The start position of the subtitle in ticks.", + "schema": { + "type": "integer", + "format": "int64", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "File returned.", + "content": { + "text/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/Users/{userId}/Suggestions": { + "get": { + "tags": [ + "Suggestions" + ], + "summary": "Gets suggestions.", + "operationId": "GetSuggestions", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaType", + "in": "query", + "description": "The media types.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "type", + "in": "query", + "description": "The type.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The start index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The limit.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Whether to enable the total record count.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Suggestions returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Buffering": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Notify SyncPlay group that member is buffering.", + "operationId": "SyncPlayBuffering", + "requestBody": { + "description": "The player status.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BufferRequestDto" + } + ], + "description": "Class BufferRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BufferRequestDto" + } + ], + "description": "Class BufferRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BufferRequestDto" + } + ], + "description": "Class BufferRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Group state update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/Join": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Join an existing SyncPlay group.", + "operationId": "SyncPlayJoinGroup", + "requestBody": { + "description": "The group to join.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/JoinGroupRequestDto" + } + ], + "description": "Class JoinGroupRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/JoinGroupRequestDto" + } + ], + "description": "Class JoinGroupRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/JoinGroupRequestDto" + } + ], + "description": "Class JoinGroupRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Group join successful." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayJoinGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/Leave": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Leave the joined SyncPlay group.", + "operationId": "SyncPlayLeaveGroup", + "responses": { + "204": { + "description": "Group leave successful." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/List": { + "get": { + "tags": [ + "SyncPlay" + ], + "summary": "Gets all SyncPlay groups.", + "operationId": "SyncPlayGetGroups", + "responses": { + "200": { + "description": "Groups returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupInfoDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupInfoDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupInfoDto" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayJoinGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/MovePlaylistItem": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to move an item in the playlist in SyncPlay group.", + "operationId": "SyncPlayMovePlaylistItem", + "requestBody": { + "description": "The new position for the item.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovePlaylistItemRequestDto" + } + ], + "description": "Class MovePlaylistItemRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovePlaylistItemRequestDto" + } + ], + "description": "Class MovePlaylistItemRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovePlaylistItemRequestDto" + } + ], + "description": "Class MovePlaylistItemRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/New": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Create a new SyncPlay group.", + "operationId": "SyncPlayCreateGroup", + "requestBody": { + "description": "The settings of the new group.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NewGroupRequestDto" + } + ], + "description": "Class NewGroupRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NewGroupRequestDto" + } + ], + "description": "Class NewGroupRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NewGroupRequestDto" + } + ], + "description": "Class NewGroupRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "New group created." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayCreateGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/NextItem": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request next item in SyncPlay group.", + "operationId": "SyncPlayNextItem", + "requestBody": { + "description": "The current item information.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NextItemRequestDto" + } + ], + "description": "Class NextItemRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NextItemRequestDto" + } + ], + "description": "Class NextItemRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NextItemRequestDto" + } + ], + "description": "Class NextItemRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Next item update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/Pause": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request pause in SyncPlay group.", + "operationId": "SyncPlayPause", + "responses": { + "204": { + "description": "Pause update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/Ping": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Update session ping.", + "operationId": "SyncPlayPing", + "requestBody": { + "description": "The new ping.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PingRequestDto" + } + ], + "description": "Class PingRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PingRequestDto" + } + ], + "description": "Class PingRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PingRequestDto" + } + ], + "description": "Class PingRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Ping updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/PreviousItem": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request previous item in SyncPlay group.", + "operationId": "SyncPlayPreviousItem", + "requestBody": { + "description": "The current item information.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PreviousItemRequestDto" + } + ], + "description": "Class PreviousItemRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PreviousItemRequestDto" + } + ], + "description": "Class PreviousItemRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PreviousItemRequestDto" + } + ], + "description": "Class PreviousItemRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Previous item update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/Queue": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to queue items to the playlist of a SyncPlay group.", + "operationId": "SyncPlayQueue", + "requestBody": { + "description": "The items to add.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QueueRequestDto" + } + ], + "description": "Class QueueRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QueueRequestDto" + } + ], + "description": "Class QueueRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QueueRequestDto" + } + ], + "description": "Class QueueRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/Ready": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Notify SyncPlay group that member is ready for playback.", + "operationId": "SyncPlayReady", + "requestBody": { + "description": "The player status.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ReadyRequestDto" + } + ], + "description": "Class ReadyRequest." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ReadyRequestDto" + } + ], + "description": "Class ReadyRequest." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ReadyRequestDto" + } + ], + "description": "Class ReadyRequest." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Group state update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/RemoveFromPlaylist": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to remove items from the playlist in SyncPlay group.", + "operationId": "SyncPlayRemoveFromPlaylist", + "requestBody": { + "description": "The items to remove.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoveFromPlaylistRequestDto" + } + ], + "description": "Class RemoveFromPlaylistRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoveFromPlaylistRequestDto" + } + ], + "description": "Class RemoveFromPlaylistRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoveFromPlaylistRequestDto" + } + ], + "description": "Class RemoveFromPlaylistRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/Seek": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request seek in SyncPlay group.", + "operationId": "SyncPlaySeek", + "requestBody": { + "description": "The new playback position.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeekRequestDto" + } + ], + "description": "Class SeekRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeekRequestDto" + } + ], + "description": "Class SeekRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeekRequestDto" + } + ], + "description": "Class SeekRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Seek update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/SetIgnoreWait": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request SyncPlay group to ignore member during group-wait.", + "operationId": "SyncPlaySetIgnoreWait", + "requestBody": { + "description": "The settings to set.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/IgnoreWaitRequestDto" + } + ], + "description": "Class IgnoreWaitRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/IgnoreWaitRequestDto" + } + ], + "description": "Class IgnoreWaitRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/IgnoreWaitRequestDto" + } + ], + "description": "Class IgnoreWaitRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Member state updated." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/SetNewQueue": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to set new playlist in SyncPlay group.", + "operationId": "SyncPlaySetNewQueue", + "requestBody": { + "description": "The new playlist to play in the group.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayRequestDto" + } + ], + "description": "Class PlayRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayRequestDto" + } + ], + "description": "Class PlayRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayRequestDto" + } + ], + "description": "Class PlayRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/SetPlaylistItem": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to change playlist item in SyncPlay group.", + "operationId": "SyncPlaySetPlaylistItem", + "requestBody": { + "description": "The new item to play.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetPlaylistItemRequestDto" + } + ], + "description": "Class SetPlaylistItemRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetPlaylistItemRequestDto" + } + ], + "description": "Class SetPlaylistItemRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetPlaylistItemRequestDto" + } + ], + "description": "Class SetPlaylistItemRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/SetRepeatMode": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to set repeat mode in SyncPlay group.", + "operationId": "SyncPlaySetRepeatMode", + "requestBody": { + "description": "The new repeat mode.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetRepeatModeRequestDto" + } + ], + "description": "Class SetRepeatModeRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetRepeatModeRequestDto" + } + ], + "description": "Class SetRepeatModeRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetRepeatModeRequestDto" + } + ], + "description": "Class SetRepeatModeRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Play queue update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/SetShuffleMode": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to set shuffle mode in SyncPlay group.", + "operationId": "SyncPlaySetShuffleMode", + "requestBody": { + "description": "The new shuffle mode.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetShuffleModeRequestDto" + } + ], + "description": "Class SetShuffleModeRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetShuffleModeRequestDto" + } + ], + "description": "Class SetShuffleModeRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetShuffleModeRequestDto" + } + ], + "description": "Class SetShuffleModeRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Play queue update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/Stop": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request stop in SyncPlay group.", + "operationId": "SyncPlayStop", + "responses": { + "204": { + "description": "Stop update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/SyncPlay/Unpause": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request unpause in SyncPlay group.", + "operationId": "SyncPlayUnpause", + "responses": { + "204": { + "description": "Unpause update sent to all group members." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess" + ] + } + ] + } + }, + "/System/Endpoint": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets information about the request endpoint.", + "operationId": "GetEndpointInfo", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndPointInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/EndPointInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/EndPointInfo" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Info": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets information about the server.", + "operationId": "GetSystemInfo", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrIgnoreParentalControl" + ] + } + ] + } + }, + "/System/Info/Public": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets public information about the server.", + "operationId": "GetPublicSystemInfo", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublicSystemInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PublicSystemInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PublicSystemInfo" + } + } + } + } + } + } + }, + "/System/Logs": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets a list of available server log files.", + "operationId": "GetServerLogs", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogFile" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogFile" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogFile" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/System/Logs/Log": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets a log file.", + "operationId": "GetLogFile", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the log file to get.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Log file retrieved.", + "content": { + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/System/Ping": { + "get": { + "tags": [ + "System" + ], + "summary": "Pings the system.", + "operationId": "GetPingSystem", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "System" + ], + "summary": "Pings the system.", + "operationId": "PostPingSystem", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/System/Restart": { + "post": { + "tags": [ + "System" + ], + "summary": "Restarts the application.", + "operationId": "RestartApplication", + "responses": { + "204": { + "description": "Server restarted." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LocalAccessOrRequiresElevation" + ] + } + ] + } + }, + "/System/Shutdown": { + "post": { + "tags": [ + "System" + ], + "summary": "Shuts down the application.", + "operationId": "ShutdownApplication", + "responses": { + "204": { + "description": "Server shut down." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/System/WakeOnLanInfo": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets wake on lan information.", + "operationId": "GetWakeOnLanInfo", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WakeOnLanInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WakeOnLanInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WakeOnLanInfo" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/GetUtcTime": { + "get": { + "tags": [ + "TimeSync" + ], + "summary": "Gets the current UTC time.", + "operationId": "GetUtcTime", + "responses": { + "200": { + "description": "Time returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UtcTimeResponse" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UtcTimeResponse" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UtcTimeResponse" + } + } + } + } + } + } + }, + "/Tmdb/ClientConfiguration": { + "get": { + "tags": [ + "Tmdb" + ], + "summary": "Gets the TMDb image configuration options.", + "operationId": "TmdbClientConfiguration", + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigImageTypes" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Trailers": { + "get": { + "tags": [ + "Trailers" + ], + "summary": "Finds movies and trailers similar to a given trailer.", + "operationId": "GetTrailers", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "maxOfficialRating", + "in": "query", + "description": "Optional filter by maximum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "hasThemeSong", + "in": "query", + "description": "Optional filter by items with theme songs.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasThemeVideo", + "in": "query", + "description": "Optional filter by items with theme videos.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSubtitles", + "in": "query", + "description": "Optional filter by items with subtitles.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSpecialFeature", + "in": "query", + "description": "Optional filter by items with special features.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTrailer", + "in": "query", + "description": "Optional filter by items with trailers.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string" + } + }, + { + "name": "parentIndexNumber", + "in": "query", + "description": "Optional filter by parent index number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "hasParentalRating", + "in": "query", + "description": "Optional filter by items that have or do not have a parental rating.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isHd", + "in": "query", + "description": "Optional filter by items that are HD or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "is4K", + "in": "query", + "description": "Optional filter by items that are 4K or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "locationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "excludeLocationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isUnaired", + "in": "query", + "description": "Optional filter by items that are unaired episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minCriticRating", + "in": "query", + "description": "Optional filter by minimum critic rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minPremiereDate", + "in": "query", + "description": "Optional. The minimum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSaved", + "in": "query", + "description": "Optional. The minimum last saved date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSavedForUser", + "in": "query", + "description": "Optional. The minimum last saved date for the current user. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "maxPremiereDate", + "in": "query", + "description": "Optional. The maximum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasOverview", + "in": "query", + "description": "Optional filter by items that have an overview or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasImdbId", + "in": "query", + "description": "Optional filter by items that have an imdb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTmdbId", + "in": "query", + "description": "Optional filter by items that have a tmdb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTvdbId", + "in": "query", + "description": "Optional filter by items that have a tvdb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional filter for live tv movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional filter for live tv series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional filter for live tv news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional filter for live tv kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional filter for live tv sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "excludeItemIds", + "in": "query", + "description": "Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "recursive", + "in": "query", + "description": "When searching within folders, this determines whether or not the search will be recursive. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Filter based on a search term.", + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "imageTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "isPlayed", + "in": "query", + "description": "Optional filter by items that are played, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "artists", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "artistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albumArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified album artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "contributingArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified contributing artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albums", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "albumIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "ids", + "in": "query", + "description": "Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "videoTypes", + "in": "query", + "description": "Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VideoType" + } + } + }, + { + "name": "minOfficialRating", + "in": "query", + "description": "Optional filter by minimum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "isLocked", + "in": "query", + "description": "Optional filter by items that are locked.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isPlaceHolder", + "in": "query", + "description": "Optional filter by items that are placeholders.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasOfficialRating", + "in": "query", + "description": "Optional filter by items that have official ratings.", + "schema": { + "type": "boolean" + } + }, + { + "name": "collapseBoxSetItems", + "in": "query", + "description": "Whether or not to hide items behind their boxsets.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minWidth", + "in": "query", + "description": "Optional. Filter by the minimum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minHeight", + "in": "query", + "description": "Optional. Filter by the minimum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. Filter by the maximum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. Filter by the maximum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "is3D", + "in": "query", + "description": "Optional filter by items that are 3D, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesStatus", + "in": "query", + "description": "Optional filter by Series Status. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SeriesStatus" + } + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Enable the total record count.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/{seriesId}/Episodes": { + "get": { + "tags": [ + "TvShows" + ], + "summary": "Gets episodes for a tv season.", + "operationId": "GetEpisodes", + "parameters": [ + { + "name": "seriesId", + "in": "path", + "description": "The series id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "season", + "in": "query", + "description": "Optional filter by season number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "seasonId", + "in": "query", + "description": "Optional. Filter by season id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional. Filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string" + } + }, + { + "name": "startItemId", + "in": "query", + "description": "Optional. Skip through the list until a given item is found.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/{seriesId}/Seasons": { + "get": { + "tags": [ + "TvShows" + ], + "summary": "Gets seasons for a tv series.", + "operationId": "GetSeasons", + "parameters": [ + { + "name": "seriesId", + "in": "path", + "description": "The series id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "isSpecialSeason", + "in": "query", + "description": "Optional. Filter by special season.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional. Filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/NextUp": { + "get": { + "tags": [ + "TvShows" + ], + "summary": "Gets a list of next up episodes.", + "operationId": "GetNextUp", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id of the user to get the next up episodes for.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "seriesId", + "in": "query", + "description": "Optional. Filter by series id.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "nextUpDateCutoff", + "in": "query", + "description": "Optional. Starting date of shows to show in Next Up section.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Whether to enable the total records count. Defaults to true.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "disableFirstEpisode", + "in": "query", + "description": "Whether to disable sending the first episode in a series as next up.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableRewatching", + "in": "query", + "description": "Whether to include watched episode in next up results.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/Upcoming": { + "get": { + "tags": [ + "TvShows" + ], + "summary": "Gets a list of upcoming episodes.", + "operationId": "GetUpcomingEpisodes", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id of the user to get the upcoming episodes for.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/universal": { + "get": { + "tags": [ + "UniversalAudio" + ], + "summary": "Gets an audio stream.", + "operationId": "GetUniversalAudioStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "Optional. The audio container.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. The audio codec to transcode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "transcodingAudioChannels", + "in": "query", + "description": "Optional. The number of how many audio channels to transcode to.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "transcodingContainer", + "in": "query", + "description": "Optional. The container to transcode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodingProtocol", + "in": "query", + "description": "Optional. The transcoding protocol.", + "schema": { + "type": "string" + } + }, + { + "name": "maxAudioSampleRate", + "in": "query", + "description": "Optional. The maximum audio sample rate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableRemoteMedia", + "in": "query", + "description": "Optional. Whether to enable remote media.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableRedirection", + "in": "query", + "description": "Whether to enable redirection. Defaults to true.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "302": { + "description": "Redirected to remote audio stream." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "head": { + "tags": [ + "UniversalAudio" + ], + "summary": "Gets an audio stream.", + "operationId": "HeadUniversalAudioStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "Optional. The audio container.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. The audio codec to transcode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "transcodingAudioChannels", + "in": "query", + "description": "Optional. The number of how many audio channels to transcode to.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "transcodingContainer", + "in": "query", + "description": "Optional. The container to transcode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodingProtocol", + "in": "query", + "description": "Optional. The transcoding protocol.", + "schema": { + "type": "string" + } + }, + { + "name": "maxAudioSampleRate", + "in": "query", + "description": "Optional. The maximum audio sample rate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableRemoteMedia", + "in": "query", + "description": "Optional. Whether to enable remote media.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableRedirection", + "in": "query", + "description": "Whether to enable redirection. Defaults to true.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "302": { + "description": "Redirected to remote audio stream." + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users": { + "get": { + "tags": [ + "User" + ], + "summary": "Gets a list of users.", + "operationId": "GetUsers", + "parameters": [ + { + "name": "isHidden", + "in": "query", + "description": "Optional filter by IsHidden=true or false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isDisabled", + "in": "query", + "description": "Optional filter by IsDisabled=true or false.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Users returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}": { + "get": { + "tags": [ + "User" + ], + "summary": "Gets a user by Id.", + "operationId": "GetUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "User returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + } + } + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "IgnoreParentalControl" + ] + } + ] + }, + "delete": { + "tags": [ + "User" + ], + "summary": "Deletes a user.", + "operationId": "DeleteUser", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "User deleted." + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user.", + "operationId": "UpdateUser", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The updated user model.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "User updated." + }, + "400": { + "description": "User information was not supplied.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User update forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/Authenticate": { + "post": { + "tags": [ + "User" + ], + "summary": "Authenticates a user.", + "operationId": "AuthenticateUser", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pw", + "in": "query", + "description": "The password as plain text.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "password", + "in": "query", + "description": "The password sha1-hash.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "User authenticated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + } + } + }, + "403": { + "description": "Sha1-hashed password only is not allowed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Users/{userId}/Configuration": { + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user configuration.", + "operationId": "UpdateUserConfiguration", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The new user configuration.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserConfiguration" + } + ], + "description": "Class UserConfiguration." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserConfiguration" + } + ], + "description": "Class UserConfiguration." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserConfiguration" + } + ], + "description": "Class UserConfiguration." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "User configuration updated." + }, + "403": { + "description": "User configuration update forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/EasyPassword": { + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user's easy password.", + "operationId": "UpdateUserEasyPassword", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The M:Jellyfin.Api.Controllers.UserController.UpdateUserEasyPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserEasyPassword) request.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserEasyPassword" + } + ], + "description": "The update user easy password request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserEasyPassword" + } + ], + "description": "The update user easy password request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserEasyPassword" + } + ], + "description": "The update user easy password request body." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Password successfully reset." + }, + "403": { + "description": "User is not allowed to update the password.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/Password": { + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user's password.", + "operationId": "UpdateUserPassword", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserPassword) request.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserPassword" + } + ], + "description": "The update user password request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserPassword" + } + ], + "description": "The update user password request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserPassword" + } + ], + "description": "The update user password request body." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Password successfully reset." + }, + "403": { + "description": "User is not allowed to update the password.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/Policy": { + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user policy.", + "operationId": "UpdateUserPolicy", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The new user policy.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserPolicy" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserPolicy" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserPolicy" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "User policy updated." + }, + "400": { + "description": "User policy was not supplied.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User policy update forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Users/AuthenticateByName": { + "post": { + "tags": [ + "User" + ], + "summary": "Authenticates a user by name.", + "operationId": "AuthenticateUserByName", + "requestBody": { + "description": "The M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) request.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AuthenticateUserByName" + } + ], + "description": "The authenticate user by name request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AuthenticateUserByName" + } + ], + "description": "The authenticate user by name request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AuthenticateUserByName" + } + ], + "description": "The authenticate user by name request body." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "User authenticated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + } + } + } + } + } + }, + "/Users/AuthenticateWithQuickConnect": { + "post": { + "tags": [ + "User" + ], + "summary": "Authenticates a user with quick connect.", + "operationId": "AuthenticateWithQuickConnect", + "requestBody": { + "description": "The Jellyfin.Api.Models.UserDtos.QuickConnectDto request.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QuickConnectDto" + } + ], + "description": "The quick connect request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QuickConnectDto" + } + ], + "description": "The quick connect request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QuickConnectDto" + } + ], + "description": "The quick connect request body." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "User authenticated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + } + } + }, + "400": { + "description": "Missing token." + } + } + } + }, + "/Users/ForgotPassword": { + "post": { + "tags": [ + "User" + ], + "summary": "Initiates the forgot password process for a local user.", + "operationId": "ForgotPassword", + "requestBody": { + "description": "The forgot password request containing the entered username.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordDto" + } + ], + "description": "Forgot Password request body DTO." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordDto" + } + ], + "description": "Forgot Password request body DTO." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordDto" + } + ], + "description": "Forgot Password request body DTO." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Password reset process started.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForgotPasswordResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ForgotPasswordResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ForgotPasswordResult" + } + } + } + } + } + } + }, + "/Users/ForgotPassword/Pin": { + "post": { + "tags": [ + "User" + ], + "summary": "Redeems a forgot password pin.", + "operationId": "ForgotPasswordPin", + "requestBody": { + "description": "The forgot password pin request containing the entered pin.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordPinDto" + } + ], + "description": "Forgot Password Pin enter request body DTO." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordPinDto" + } + ], + "description": "Forgot Password Pin enter request body DTO." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordPinDto" + } + ], + "description": "Forgot Password Pin enter request body DTO." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Pin reset process started.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PinRedeemResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PinRedeemResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PinRedeemResult" + } + } + } + } + } + } + }, + "/Users/Me": { + "get": { + "tags": [ + "User" + ], + "summary": "Gets the user based on auth token.", + "operationId": "GetCurrentUser", + "responses": { + "200": { + "description": "User returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + } + } + }, + "400": { + "description": "Token is not owned by a user.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/New": { + "post": { + "tags": [ + "User" + ], + "summary": "Creates a user.", + "operationId": "CreateUserByName", + "requestBody": { + "description": "The create user by name request body.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreateUserByName" + } + ], + "description": "The create user by name request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreateUserByName" + } + ], + "description": "The create user by name request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreateUserByName" + } + ], + "description": "The create user by name request body." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "User created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Users/Public": { + "get": { + "tags": [ + "User" + ], + "summary": "Gets a list of publicly visible users for display on a login screen.", + "operationId": "GetPublicUsers", + "responses": { + "200": { + "description": "Public users returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + } + } + } + } + } + }, + "/Users/{userId}/FavoriteItems/{itemId}": { + "post": { + "tags": [ + "UserLibrary" + ], + "summary": "Marks an item as a favorite.", + "operationId": "MarkFavoriteItem", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item marked as favorite.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "UserLibrary" + ], + "summary": "Unmarks item as a favorite.", + "operationId": "UnmarkFavoriteItem", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item unmarked as favorite.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/Items/{itemId}": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets an item from a user's library.", + "operationId": "GetItem", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/Items/{itemId}/Intros": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets intros to play before the main media item plays.", + "operationId": "GetIntros", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Intros returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/Items/{itemId}/LocalTrailers": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets local trailers for an item.", + "operationId": "GetLocalTrailers", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "An Microsoft.AspNetCore.Mvc.OkResult containing the item's local trailers.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/Items/{itemId}/Rating": { + "delete": { + "tags": [ + "UserLibrary" + ], + "summary": "Deletes a user's saved personal rating for an item.", + "operationId": "DeleteUserItemRating", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Personal rating removed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "UserLibrary" + ], + "summary": "Updates a user's rating for an item.", + "operationId": "UpdateUserItemRating", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "likes", + "in": "query", + "description": "Whether this M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Guid,System.Guid,System.Nullable{System.Boolean}) is likes.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Item rating updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/Items/{itemId}/SpecialFeatures": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets special features for an item.", + "operationId": "GetSpecialFeatures", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Special features returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/Items/Latest": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets latest media.", + "operationId": "GetLatestMedia", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isPlayed", + "in": "query", + "description": "Filter by items that are played, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "limit", + "in": "query", + "description": "Return item limit.", + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + } + }, + { + "name": "groupItems", + "in": "query", + "description": "Whether or not to group items into a parent container.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Latest media returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/Items/Root": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets the root folder from a user's library.", + "operationId": "GetRootFolder", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Root folder returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/GroupingOptions": { + "get": { + "tags": [ + "UserViews" + ], + "summary": "Get user view grouping options.", + "operationId": "GetGroupingOptions", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "User view grouping options returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SpecialViewOptionDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SpecialViewOptionDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SpecialViewOptionDto" + } + } + } + } + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}/Views": { + "get": { + "tags": [ + "UserViews" + ], + "summary": "Get user views.", + "operationId": "GetUserViews", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "User id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeExternalContent", + "in": "query", + "description": "Whether or not to include external views such as channels or live tv.", + "schema": { + "type": "boolean" + } + }, + { + "name": "presetViews", + "in": "query", + "description": "Preset views.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "includeHidden", + "in": "query", + "description": "Whether or not to include hidden content.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "User views returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{videoId}/{mediaSourceId}/Attachments/{index}": { + "get": { + "tags": [ + "VideoAttachments" + ], + "summary": "Get video attachment.", + "operationId": "GetAttachment", + "parameters": [ + { + "name": "videoId", + "in": "path", + "description": "Video ID.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "path", + "description": "Media Source ID.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "index", + "in": "path", + "description": "Attachment Index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Attachment retrieved.", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Video or attachment not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + } + } + }, + "/Videos/{itemId}/AdditionalParts": { + "get": { + "tags": [ + "Videos" + ], + "summary": "Gets additional parts for a video.", + "operationId": "GetAdditionalPart", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Additional parts returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/AlternateSources": { + "delete": { + "tags": [ + "Videos" + ], + "summary": "Removes alternate video sources.", + "operationId": "DeleteAlternateSources", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Alternate sources deleted." + }, + "404": { + "description": "Video not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Videos/{itemId}/stream": { + "get": { + "tags": [ + "Videos" + ], + "summary": "Gets a video stream.", + "operationId": "GetVideoStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "head": { + "tags": [ + "Videos" + ], + "summary": "Gets a video stream.", + "operationId": "HeadVideoStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/Videos/{itemId}/stream.{container}": { + "get": { + "tags": [ + "Videos" + ], + "summary": "Gets a video stream.", + "operationId": "GetVideoStreamByContainer", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "path", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "head": { + "tags": [ + "Videos" + ], + "summary": "Gets a video stream.", + "operationId": "HeadVideoStreamByContainer", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "path", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/Videos/MergeVersions": { + "post": { + "tags": [ + "Videos" + ], + "summary": "Merges videos into a single record.", + "operationId": "MergeVersions", + "parameters": [ + { + "name": "ids", + "in": "query", + "description": "Item id list. This allows multiple, comma delimited.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "204": { + "description": "Videos merged." + }, + "400": { + "description": "Supply at least 2 video ids.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Years": { + "get": { + "tags": [ + "Years" + ], + "summary": "Get years.", + "operationId": "GetYears", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Skips over a given number of items within the results. Use for paging.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be excluded based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be included based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional. Filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "recursive", + "in": "query", + "description": "Search recursively.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Year query returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Years/{year}": { + "get": { + "tags": [ + "Years" + ], + "summary": "Gets a year.", + "operationId": "GetYear", + "parameters": [ + { + "name": "year", + "in": "path", + "description": "The year.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Year returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "404": { + "description": "Year not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "AccessSchedule": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets the id of this instance.", + "format": "int32", + "readOnly": true + }, + "UserId": { + "type": "string", + "description": "Gets the id of the associated user.", + "format": "uuid" + }, + "DayOfWeek": { + "allOf": [ + { + "$ref": "#/components/schemas/DynamicDayOfWeek" + } + ], + "description": "Gets or sets the day of week." + }, + "StartHour": { + "type": "number", + "description": "Gets or sets the start hour.", + "format": "double" + }, + "EndHour": { + "type": "number", + "description": "Gets or sets the end hour.", + "format": "double" + } + }, + "additionalProperties": false, + "description": "An entity representing a user's access schedule." + }, + "ActivityLogEntry": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets or sets the identifier.", + "format": "int64" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "Overview": { + "type": "string", + "description": "Gets or sets the overview.", + "nullable": true + }, + "ShortOverview": { + "type": "string", + "description": "Gets or sets the short overview.", + "nullable": true + }, + "Type": { + "type": "string", + "description": "Gets or sets the type." + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "nullable": true + }, + "Date": { + "type": "string", + "description": "Gets or sets the date.", + "format": "date-time" + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user identifier.", + "format": "uuid" + }, + "UserPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the user primary image tag.", + "nullable": true, + "deprecated": true + }, + "Severity": { + "allOf": [ + { + "$ref": "#/components/schemas/LogLevel" + } + ], + "description": "Gets or sets the log severity." + } + }, + "additionalProperties": false, + "description": "An activity log entry." + }, + "ActivityLogEntryQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ActivityLogEntry" + }, + "description": "Gets or sets the items.", + "nullable": true + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false + }, + "AddVirtualFolderDto": { + "type": "object", + "properties": { + "LibraryOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/LibraryOptions" + } + ], + "description": "Gets or sets library options.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Add virtual folder dto." + }, + "AdminNotificationDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the notification name.", + "nullable": true + }, + "Description": { + "type": "string", + "description": "Gets or sets the notification description.", + "nullable": true + }, + "NotificationLevel": { + "allOf": [ + { + "$ref": "#/components/schemas/NotificationLevel" + } + ], + "description": "Gets or sets the notification level.", + "nullable": true + }, + "Url": { + "type": "string", + "description": "Gets or sets the notification url.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The admin notification dto." + }, + "AlbumInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "AlbumArtists": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the album artist." + }, + "ArtistProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the artist provider ids." + }, + "SongInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SongInfo" + } + } + }, + "additionalProperties": false + }, + "AlbumInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/AlbumInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "AllThemeMediaResult": { + "type": "object", + "properties": { + "ThemeVideosResult": { + "allOf": [ + { + "$ref": "#/components/schemas/ThemeMediaResult" + } + ], + "description": "Class ThemeMediaResult.", + "nullable": true + }, + "ThemeSongsResult": { + "allOf": [ + { + "$ref": "#/components/schemas/ThemeMediaResult" + } + ], + "description": "Class ThemeMediaResult.", + "nullable": true + }, + "SoundtrackSongsResult": { + "allOf": [ + { + "$ref": "#/components/schemas/ThemeMediaResult" + } + ], + "description": "Class ThemeMediaResult.", + "nullable": true + } + }, + "additionalProperties": false + }, + "Architecture": { + "enum": [ + "X86", + "X64", + "Arm", + "Arm64", + "Wasm", + "S390x" + ], + "type": "string" + }, + "ArtistInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "SongInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SongInfo" + } + } + }, + "additionalProperties": false + }, + "ArtistInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/ArtistInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "AuthenticateUserByName": { + "type": "object", + "properties": { + "Username": { + "type": "string", + "description": "Gets or sets the username.", + "nullable": true + }, + "Pw": { + "type": "string", + "description": "Gets or sets the plain text password.", + "nullable": true + }, + "Password": { + "type": "string", + "description": "Gets or sets the sha1-hashed password.", + "nullable": true, + "deprecated": true + } + }, + "additionalProperties": false, + "description": "The authenticate user by name request body." + }, + "AuthenticationInfo": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets or sets the identifier.", + "format": "int64" + }, + "AccessToken": { + "type": "string", + "description": "Gets or sets the access token.", + "nullable": true + }, + "DeviceId": { + "type": "string", + "description": "Gets or sets the device identifier.", + "nullable": true + }, + "AppName": { + "type": "string", + "description": "Gets or sets the name of the application.", + "nullable": true + }, + "AppVersion": { + "type": "string", + "description": "Gets or sets the application version.", + "nullable": true + }, + "DeviceName": { + "type": "string", + "description": "Gets or sets the name of the device.", + "nullable": true + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user identifier.", + "format": "uuid" + }, + "IsActive": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is active." + }, + "DateCreated": { + "type": "string", + "description": "Gets or sets the date created.", + "format": "date-time" + }, + "DateRevoked": { + "type": "string", + "description": "Gets or sets the date revoked.", + "format": "date-time", + "nullable": true + }, + "DateLastActivity": { + "type": "string", + "format": "date-time" + }, + "UserName": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "AuthenticationInfoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AuthenticationInfo" + }, + "description": "Gets or sets the items.", + "nullable": true + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false + }, + "AuthenticationResult": { + "type": "object", + "properties": { + "User": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto.", + "nullable": true + }, + "SessionInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/SessionInfo" + } + ], + "description": "Class SessionInfo.", + "nullable": true + }, + "AccessToken": { + "type": "string", + "nullable": true + }, + "ServerId": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "BaseItem": { + "type": "object", + "properties": { + "Size": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "Container": { + "type": "string", + "nullable": true + }, + "IsHD": { + "type": "boolean", + "readOnly": true + }, + "IsShortcut": { + "type": "boolean" + }, + "ShortcutPath": { + "type": "string", + "nullable": true + }, + "Width": { + "type": "integer", + "format": "int32" + }, + "Height": { + "type": "integer", + "format": "int32" + }, + "ExtraIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "DateLastSaved": { + "type": "string", + "format": "date-time" + }, + "RemoteTrailers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaUrl" + }, + "description": "Gets or sets the remote trailers.", + "nullable": true + }, + "SupportsExternalTransfer": { + "type": "boolean", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Class BaseItem." + }, + "BaseItemDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server identifier.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "format": "uuid" + }, + "Etag": { + "type": "string", + "description": "Gets or sets the etag.", + "nullable": true + }, + "SourceType": { + "type": "string", + "description": "Gets or sets the type of the source.", + "nullable": true + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist item identifier.", + "nullable": true + }, + "DateCreated": { + "type": "string", + "description": "Gets or sets the date created.", + "format": "date-time", + "nullable": true + }, + "DateLastMediaAdded": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "ExtraType": { + "type": "string", + "nullable": true + }, + "AirsBeforeSeasonNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AirsAfterSeasonNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AirsBeforeEpisodeNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "CanDelete": { + "type": "boolean", + "nullable": true + }, + "CanDownload": { + "type": "boolean", + "nullable": true + }, + "HasSubtitles": { + "type": "boolean", + "nullable": true + }, + "PreferredMetadataLanguage": { + "type": "string", + "nullable": true + }, + "PreferredMetadataCountryCode": { + "type": "string", + "nullable": true + }, + "SupportsSync": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports synchronize].", + "nullable": true + }, + "Container": { + "type": "string", + "nullable": true + }, + "SortName": { + "type": "string", + "description": "Gets or sets the name of the sort.", + "nullable": true + }, + "ForcedSortName": { + "type": "string", + "nullable": true + }, + "Video3DFormat": { + "allOf": [ + { + "$ref": "#/components/schemas/Video3DFormat" + } + ], + "description": "Gets or sets the video3 D format.", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "description": "Gets or sets the premiere date.", + "format": "date-time", + "nullable": true + }, + "ExternalUrls": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalUrl" + }, + "description": "Gets or sets the external urls.", + "nullable": true + }, + "MediaSources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaSourceInfo" + }, + "description": "Gets or sets the media versions.", + "nullable": true + }, + "CriticRating": { + "type": "number", + "description": "Gets or sets the critic rating.", + "format": "float", + "nullable": true + }, + "ProductionLocations": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "EnableMediaSourceDisplay": { + "type": "boolean", + "nullable": true + }, + "OfficialRating": { + "type": "string", + "description": "Gets or sets the official rating.", + "nullable": true + }, + "CustomRating": { + "type": "string", + "description": "Gets or sets the custom rating.", + "nullable": true + }, + "ChannelId": { + "type": "string", + "description": "Gets or sets the channel identifier.", + "format": "uuid", + "nullable": true + }, + "ChannelName": { + "type": "string", + "nullable": true + }, + "Overview": { + "type": "string", + "description": "Gets or sets the overview.", + "nullable": true + }, + "Taglines": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the taglines.", + "nullable": true + }, + "Genres": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the genres.", + "nullable": true + }, + "CommunityRating": { + "type": "number", + "description": "Gets or sets the community rating.", + "format": "float", + "nullable": true + }, + "CumulativeRunTimeTicks": { + "type": "integer", + "description": "Gets or sets the cumulative run time ticks.", + "format": "int64", + "nullable": true + }, + "RunTimeTicks": { + "type": "integer", + "description": "Gets or sets the run time ticks.", + "format": "int64", + "nullable": true + }, + "PlayAccess": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayAccess" + } + ], + "description": "Gets or sets the play access.", + "nullable": true + }, + "AspectRatio": { + "type": "string", + "description": "Gets or sets the aspect ratio.", + "nullable": true + }, + "ProductionYear": { + "type": "integer", + "description": "Gets or sets the production year.", + "format": "int32", + "nullable": true + }, + "IsPlaceHolder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is place holder.", + "nullable": true + }, + "Number": { + "type": "string", + "description": "Gets or sets the number.", + "nullable": true + }, + "ChannelNumber": { + "type": "string", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "description": "Gets or sets the index number.", + "format": "int32", + "nullable": true + }, + "IndexNumberEnd": { + "type": "integer", + "description": "Gets or sets the index number end.", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "description": "Gets or sets the parent index number.", + "format": "int32", + "nullable": true + }, + "RemoteTrailers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaUrl" + }, + "description": "Gets or sets the trailer urls.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "IsHD": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is HD.", + "nullable": true + }, + "IsFolder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is folder.", + "nullable": true + }, + "ParentId": { + "type": "string", + "description": "Gets or sets the parent id.", + "format": "uuid", + "nullable": true + }, + "Type": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemKind" + } + ], + "description": "Gets or sets the type." + }, + "People": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemPerson" + }, + "description": "Gets or sets the people.", + "nullable": true + }, + "Studios": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "description": "Gets or sets the studios.", + "nullable": true + }, + "GenreItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "nullable": true + }, + "ParentLogoItemId": { + "type": "string", + "description": "Gets or sets wether the item has a logo, this will hold the Id of the Parent that has one.", + "format": "uuid", + "nullable": true + }, + "ParentBackdropItemId": { + "type": "string", + "description": "Gets or sets wether the item has any backdrops, this will hold the Id of the Parent that has one.", + "format": "uuid", + "nullable": true + }, + "ParentBackdropImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the parent backdrop image tags.", + "nullable": true + }, + "LocalTrailerCount": { + "type": "integer", + "description": "Gets or sets the local trailer count.", + "format": "int32", + "nullable": true + }, + "UserData": { + "allOf": [ + { + "$ref": "#/components/schemas/UserItemDataDto" + } + ], + "description": "Gets or sets the user data for this item based on the user it's being requested for.", + "nullable": true + }, + "RecursiveItemCount": { + "type": "integer", + "description": "Gets or sets the recursive item count.", + "format": "int32", + "nullable": true + }, + "ChildCount": { + "type": "integer", + "description": "Gets or sets the child count.", + "format": "int32", + "nullable": true + }, + "SeriesName": { + "type": "string", + "description": "Gets or sets the name of the series.", + "nullable": true + }, + "SeriesId": { + "type": "string", + "description": "Gets or sets the series id.", + "format": "uuid", + "nullable": true + }, + "SeasonId": { + "type": "string", + "description": "Gets or sets the season identifier.", + "format": "uuid", + "nullable": true + }, + "SpecialFeatureCount": { + "type": "integer", + "description": "Gets or sets the special feature count.", + "format": "int32", + "nullable": true + }, + "DisplayPreferencesId": { + "type": "string", + "description": "Gets or sets the display preferences id.", + "nullable": true + }, + "Status": { + "type": "string", + "description": "Gets or sets the status.", + "nullable": true + }, + "AirTime": { + "type": "string", + "description": "Gets or sets the air time.", + "nullable": true + }, + "AirDays": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DayOfWeek" + }, + "description": "Gets or sets the air days.", + "nullable": true + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the tags.", + "nullable": true + }, + "PrimaryImageAspectRatio": { + "type": "number", + "description": "Gets or sets the primary image aspect ratio, after image enhancements.", + "format": "double", + "nullable": true + }, + "Artists": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the artists.", + "nullable": true + }, + "ArtistItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "description": "Gets or sets the artist items.", + "nullable": true + }, + "Album": { + "type": "string", + "description": "Gets or sets the album.", + "nullable": true + }, + "CollectionType": { + "type": "string", + "description": "Gets or sets the type of the collection.", + "nullable": true + }, + "DisplayOrder": { + "type": "string", + "description": "Gets or sets the display order.", + "nullable": true + }, + "AlbumId": { + "type": "string", + "description": "Gets or sets the album id.", + "format": "uuid", + "nullable": true + }, + "AlbumPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the album image tag.", + "nullable": true + }, + "SeriesPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the series primary image tag.", + "nullable": true + }, + "AlbumArtist": { + "type": "string", + "description": "Gets or sets the album artist.", + "nullable": true + }, + "AlbumArtists": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "description": "Gets or sets the album artists.", + "nullable": true + }, + "SeasonName": { + "type": "string", + "description": "Gets or sets the name of the season.", + "nullable": true + }, + "MediaStreams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaStream" + }, + "description": "Gets or sets the media streams.", + "nullable": true + }, + "VideoType": { + "allOf": [ + { + "$ref": "#/components/schemas/VideoType" + } + ], + "description": "Gets or sets the type of the video.", + "nullable": true + }, + "PartCount": { + "type": "integer", + "description": "Gets or sets the part count.", + "format": "int32", + "nullable": true + }, + "MediaSourceCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ImageTags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Gets or sets the image tags.", + "nullable": true + }, + "BackdropImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the backdrop image tags.", + "nullable": true + }, + "ScreenshotImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the screenshot image tags.", + "nullable": true + }, + "ParentLogoImageTag": { + "type": "string", + "description": "Gets or sets the parent logo image tag.", + "nullable": true + }, + "ParentArtItemId": { + "type": "string", + "description": "Gets or sets wether the item has fan art, this will hold the Id of the Parent that has one.", + "format": "uuid", + "nullable": true + }, + "ParentArtImageTag": { + "type": "string", + "description": "Gets or sets the parent art image tag.", + "nullable": true + }, + "SeriesThumbImageTag": { + "type": "string", + "description": "Gets or sets the series thumb image tag.", + "nullable": true + }, + "ImageBlurHashes": { + "type": "object", + "properties": { + "Primary": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Art": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Backdrop": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Banner": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Logo": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Thumb": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Disc": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Box": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Screenshot": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Menu": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Chapter": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "BoxRear": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Profile": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "Gets or sets the blurhashes for the image tags.\r\nMaps image type to dictionary mapping image tag to blurhash value.", + "nullable": true + }, + "SeriesStudio": { + "type": "string", + "description": "Gets or sets the series studio.", + "nullable": true + }, + "ParentThumbItemId": { + "type": "string", + "description": "Gets or sets the parent thumb item id.", + "format": "uuid", + "nullable": true + }, + "ParentThumbImageTag": { + "type": "string", + "description": "Gets or sets the parent thumb image tag.", + "nullable": true + }, + "ParentPrimaryImageItemId": { + "type": "string", + "description": "Gets or sets the parent primary image item identifier.", + "nullable": true + }, + "ParentPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the parent primary image tag.", + "nullable": true + }, + "Chapters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChapterInfo" + }, + "description": "Gets or sets the chapters.", + "nullable": true + }, + "LocationType": { + "allOf": [ + { + "$ref": "#/components/schemas/LocationType" + } + ], + "description": "Gets or sets the type of the location.", + "nullable": true + }, + "IsoType": { + "allOf": [ + { + "$ref": "#/components/schemas/IsoType" + } + ], + "description": "Gets or sets the type of the iso.", + "nullable": true + }, + "MediaType": { + "type": "string", + "description": "Gets or sets the type of the media.", + "nullable": true + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date.", + "format": "date-time", + "nullable": true + }, + "LockedFields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetadataField" + }, + "description": "Gets or sets the locked fields.", + "nullable": true + }, + "TrailerCount": { + "type": "integer", + "description": "Gets or sets the trailer count.", + "format": "int32", + "nullable": true + }, + "MovieCount": { + "type": "integer", + "description": "Gets or sets the movie count.", + "format": "int32", + "nullable": true + }, + "SeriesCount": { + "type": "integer", + "description": "Gets or sets the series count.", + "format": "int32", + "nullable": true + }, + "ProgramCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "EpisodeCount": { + "type": "integer", + "description": "Gets or sets the episode count.", + "format": "int32", + "nullable": true + }, + "SongCount": { + "type": "integer", + "description": "Gets or sets the song count.", + "format": "int32", + "nullable": true + }, + "AlbumCount": { + "type": "integer", + "description": "Gets or sets the album count.", + "format": "int32", + "nullable": true + }, + "ArtistCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "MusicVideoCount": { + "type": "integer", + "description": "Gets or sets the music video count.", + "format": "int32", + "nullable": true + }, + "LockData": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [enable internet providers].", + "nullable": true + }, + "Width": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "Height": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "CameraMake": { + "type": "string", + "nullable": true + }, + "CameraModel": { + "type": "string", + "nullable": true + }, + "Software": { + "type": "string", + "nullable": true + }, + "ExposureTime": { + "type": "number", + "format": "double", + "nullable": true + }, + "FocalLength": { + "type": "number", + "format": "double", + "nullable": true + }, + "ImageOrientation": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageOrientation" + } + ], + "nullable": true + }, + "Aperture": { + "type": "number", + "format": "double", + "nullable": true + }, + "ShutterSpeed": { + "type": "number", + "format": "double", + "nullable": true + }, + "Latitude": { + "type": "number", + "format": "double", + "nullable": true + }, + "Longitude": { + "type": "number", + "format": "double", + "nullable": true + }, + "Altitude": { + "type": "number", + "format": "double", + "nullable": true + }, + "IsoSpeedRating": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "SeriesTimerId": { + "type": "string", + "description": "Gets or sets the series timer identifier.", + "nullable": true + }, + "ProgramId": { + "type": "string", + "description": "Gets or sets the program identifier.", + "nullable": true + }, + "ChannelPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the channel primary image tag.", + "nullable": true + }, + "StartDate": { + "type": "string", + "description": "Gets or sets the start date of the recording, in UTC.", + "format": "date-time", + "nullable": true + }, + "CompletionPercentage": { + "type": "number", + "description": "Gets or sets the completion percentage.", + "format": "double", + "nullable": true + }, + "IsRepeat": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is repeat.", + "nullable": true + }, + "EpisodeTitle": { + "type": "string", + "description": "Gets or sets the episode title.", + "nullable": true + }, + "ChannelType": { + "allOf": [ + { + "$ref": "#/components/schemas/ChannelType" + } + ], + "description": "Gets or sets the type of the channel.", + "nullable": true + }, + "Audio": { + "allOf": [ + { + "$ref": "#/components/schemas/ProgramAudio" + } + ], + "description": "Gets or sets the audio.", + "nullable": true + }, + "IsMovie": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is movie.", + "nullable": true + }, + "IsSports": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is sports.", + "nullable": true + }, + "IsSeries": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is series.", + "nullable": true + }, + "IsLive": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is live.", + "nullable": true + }, + "IsNews": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is news.", + "nullable": true + }, + "IsKids": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is kids.", + "nullable": true + }, + "IsPremiere": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is premiere.", + "nullable": true + }, + "TimerId": { + "type": "string", + "description": "Gets or sets the timer identifier.", + "nullable": true + }, + "CurrentProgram": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the current program.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + }, + "BaseItemDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + }, + "description": "Gets or sets the items.", + "nullable": true + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false + }, + "BaseItemKind": { + "enum": [ + "AggregateFolder", + "Audio", + "AudioBook", + "BasePluginFolder", + "Book", + "BoxSet", + "Channel", + "ChannelFolderItem", + "CollectionFolder", + "Episode", + "Folder", + "Genre", + "ManualPlaylistsFolder", + "Movie", + "LiveTvChannel", + "LiveTvProgram", + "MusicAlbum", + "MusicArtist", + "MusicGenre", + "MusicVideo", + "Person", + "Photo", + "PhotoAlbum", + "Playlist", + "PlaylistsFolder", + "Program", + "Recording", + "Season", + "Series", + "Studio", + "Trailer", + "TvChannel", + "TvProgram", + "UserRootFolder", + "UserView", + "Video", + "Year" + ], + "type": "string", + "description": "The base item kind." + }, + "BaseItemPerson": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "format": "uuid" + }, + "Role": { + "type": "string", + "description": "Gets or sets the role.", + "nullable": true + }, + "Type": { + "type": "string", + "description": "Gets or sets the type.", + "nullable": true + }, + "PrimaryImageTag": { + "type": "string", + "description": "Gets or sets the primary image tag.", + "nullable": true + }, + "ImageBlurHashes": { + "type": "object", + "properties": { + "Primary": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Art": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Backdrop": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Banner": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Logo": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Thumb": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Disc": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Box": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Screenshot": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Menu": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Chapter": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "BoxRear": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Profile": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "Gets or sets the primary image blurhash.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This is used by the api to get information about a Person within a BaseItem." + }, + "BasePluginConfiguration": { + "type": "object", + "additionalProperties": false, + "description": "Class BasePluginConfiguration." + }, + "BookInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "SeriesName": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "BookInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/BookInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "BoxSetInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "BoxSetInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/BoxSetInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "BrandingOptions": { + "type": "object", + "properties": { + "LoginDisclaimer": { + "type": "string", + "description": "Gets or sets the login disclaimer.", + "nullable": true + }, + "CustomCss": { + "type": "string", + "description": "Gets or sets the custom CSS.", + "nullable": true + }, + "SplashscreenEnabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable the splashscreen." + } + }, + "additionalProperties": false, + "description": "The branding options." + }, + "BufferRequestDto": { + "type": "object", + "properties": { + "When": { + "type": "string", + "description": "Gets or sets when the request has been made by the client.", + "format": "date-time" + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64" + }, + "IsPlaying": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the client playback is unpaused." + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist item identifier of the playing item.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class BufferRequestDto." + }, + "ChannelFeatures": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "format": "uuid" + }, + "CanSearch": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can search." + }, + "MediaTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelMediaType" + }, + "description": "Gets or sets the media types." + }, + "ContentTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelMediaContentType" + }, + "description": "Gets or sets the content types." + }, + "MaxPageSize": { + "type": "integer", + "description": "Gets or sets the maximum number of records the channel allows retrieving at a time.", + "format": "int32", + "nullable": true + }, + "AutoRefreshLevels": { + "type": "integer", + "description": "Gets or sets the automatic refresh levels.", + "format": "int32", + "nullable": true + }, + "DefaultSortFields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelItemSortField" + }, + "description": "Gets or sets the default sort orders." + }, + "SupportsSortOrderToggle": { + "type": "boolean", + "description": "Gets or sets a value indicating whether a sort ascending/descending toggle is supported." + }, + "SupportsLatestMedia": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports latest media]." + }, + "CanFilter": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can filter." + }, + "SupportsContentDownloading": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports content downloading]." + } + }, + "additionalProperties": false + }, + "ChannelItemSortField": { + "enum": [ + "Name", + "CommunityRating", + "PremiereDate", + "DateCreated", + "Runtime", + "PlayCount", + "CommunityPlayCount" + ], + "type": "string" + }, + "ChannelMappingOptionsDto": { + "type": "object", + "properties": { + "TunerChannels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerChannelMapping" + }, + "description": "Gets or sets list of tuner channels." + }, + "ProviderChannels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + }, + "description": "Gets or sets list of provider channels." + }, + "Mappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameValuePair" + }, + "description": "Gets or sets list of mappings." + }, + "ProviderName": { + "type": "string", + "description": "Gets or sets provider name.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Channel mapping options dto." + }, + "ChannelMediaContentType": { + "enum": [ + "Clip", + "Podcast", + "Trailer", + "Movie", + "Episode", + "Song", + "MovieExtra", + "TvExtra" + ], + "type": "string" + }, + "ChannelMediaType": { + "enum": [ + "Audio", + "Video", + "Photo" + ], + "type": "string" + }, + "ChannelType": { + "enum": [ + "TV", + "Radio" + ], + "type": "string", + "description": "Enum ChannelType." + }, + "ChapterInfo": { + "type": "object", + "properties": { + "StartPositionTicks": { + "type": "integer", + "description": "Gets or sets the start position ticks.", + "format": "int64" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "ImagePath": { + "type": "string", + "description": "Gets or sets the image path.", + "nullable": true + }, + "ImageDateModified": { + "type": "string", + "format": "date-time" + }, + "ImageTag": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class ChapterInfo." + }, + "ClientCapabilities": { + "type": "object", + "properties": { + "PlayableMediaTypes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "SupportedCommands": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneralCommandType" + }, + "nullable": true + }, + "SupportsMediaControl": { + "type": "boolean" + }, + "SupportsContentUploading": { + "type": "boolean" + }, + "MessageCallbackUrl": { + "type": "string", + "nullable": true + }, + "SupportsPersistentIdentifier": { + "type": "boolean" + }, + "SupportsSync": { + "type": "boolean" + }, + "DeviceProfile": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't.", + "nullable": true + }, + "AppStoreUrl": { + "type": "string", + "nullable": true + }, + "IconUrl": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "ClientCapabilitiesDto": { + "type": "object", + "properties": { + "PlayableMediaTypes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the list of playable media types." + }, + "SupportedCommands": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneralCommandType" + }, + "description": "Gets or sets the list of supported commands." + }, + "SupportsMediaControl": { + "type": "boolean", + "description": "Gets or sets a value indicating whether session supports media control." + }, + "SupportsContentUploading": { + "type": "boolean", + "description": "Gets or sets a value indicating whether session supports content uploading." + }, + "MessageCallbackUrl": { + "type": "string", + "description": "Gets or sets the message callback url.", + "nullable": true + }, + "SupportsPersistentIdentifier": { + "type": "boolean", + "description": "Gets or sets a value indicating whether session supports a persistent identifier." + }, + "SupportsSync": { + "type": "boolean", + "description": "Gets or sets a value indicating whether session supports sync." + }, + "DeviceProfile": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't.", + "nullable": true + }, + "AppStoreUrl": { + "type": "string", + "description": "Gets or sets the app store url.", + "nullable": true + }, + "IconUrl": { + "type": "string", + "description": "Gets or sets the icon url.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Client capabilities dto." + }, + "ClientLogDocumentResponseDto": { + "type": "object", + "properties": { + "FileName": { + "type": "string", + "description": "Gets the resulting filename." + } + }, + "additionalProperties": false, + "description": "Client log document response dto." + }, + "CodecProfile": { + "type": "object", + "properties": { + "Type": { + "allOf": [ + { + "$ref": "#/components/schemas/CodecType" + } + ] + }, + "Conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + }, + "nullable": true + }, + "ApplyConditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + }, + "nullable": true + }, + "Codec": { + "type": "string", + "nullable": true + }, + "Container": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "CodecType": { + "enum": [ + "Video", + "VideoAudio", + "Audio" + ], + "type": "string" + }, + "CollectionCreationResult": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "CollectionTypeOptions": { + "enum": [ + "Movies", + "TvShows", + "Music", + "MusicVideos", + "HomeVideos", + "BoxSets", + "Books", + "Mixed" + ], + "type": "string" + }, + "ConfigImageTypes": { + "type": "object", + "properties": { + "BackdropSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "BaseUrl": { + "type": "string", + "nullable": true + }, + "LogoSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "PosterSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ProfileSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "SecureBaseUrl": { + "type": "string", + "nullable": true + }, + "StillSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "ConfigurationPageInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "EnableInMainMenu": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the configurations page is enabled in the main menu." + }, + "MenuSection": { + "type": "string", + "description": "Gets or sets the menu section.", + "nullable": true + }, + "MenuIcon": { + "type": "string", + "description": "Gets or sets the menu icon.", + "nullable": true + }, + "DisplayName": { + "type": "string", + "description": "Gets or sets the display name.", + "nullable": true + }, + "PluginId": { + "type": "string", + "description": "Gets or sets the plugin id.", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The configuration page info." + }, + "ContainerProfile": { + "type": "object", + "properties": { + "Type": { + "allOf": [ + { + "$ref": "#/components/schemas/DlnaProfileType" + } + ] + }, + "Conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + }, + "nullable": true + }, + "Container": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ControlResponse": { + "type": "object", + "properties": { + "Headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, + "Xml": { + "type": "string" + }, + "IsSuccessful": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "CountryInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "DisplayName": { + "type": "string", + "description": "Gets or sets the display name.", + "nullable": true + }, + "TwoLetterISORegionName": { + "type": "string", + "description": "Gets or sets the name of the two letter ISO region.", + "nullable": true + }, + "ThreeLetterISORegionName": { + "type": "string", + "description": "Gets or sets the name of the three letter ISO region.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class CountryInfo." + }, + "CreatePlaylistDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name of the new playlist.", + "nullable": true + }, + "Ids": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets item ids to add to the playlist." + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid", + "nullable": true + }, + "MediaType": { + "type": "string", + "description": "Gets or sets the media type.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Create new playlist dto." + }, + "CreateUserByName": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the username.", + "nullable": true + }, + "Password": { + "type": "string", + "description": "Gets or sets the password.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The create user by name request body." + }, + "CultureDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets the name." + }, + "DisplayName": { + "type": "string", + "description": "Gets the display name." + }, + "TwoLetterISOLanguageName": { + "type": "string", + "description": "Gets the name of the two letter ISO language." + }, + "ThreeLetterISOLanguageName": { + "type": "string", + "description": "Gets the name of the three letter ISO language.", + "nullable": true, + "readOnly": true + }, + "ThreeLetterISOLanguageNames": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "description": "Class CultureDto." + }, + "DayOfWeek": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + "type": "string" + }, + "DayPattern": { + "enum": [ + "Daily", + "Weekdays", + "Weekends" + ], + "type": "string" + }, + "DefaultDirectoryBrowserInfoDto": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Default directory browser info." + }, + "DeviceIdentification": { + "type": "object", + "properties": { + "FriendlyName": { + "type": "string", + "description": "Gets or sets the name of the friendly." + }, + "ModelNumber": { + "type": "string", + "description": "Gets or sets the model number." + }, + "SerialNumber": { + "type": "string", + "description": "Gets or sets the serial number." + }, + "ModelName": { + "type": "string", + "description": "Gets or sets the name of the model." + }, + "ModelDescription": { + "type": "string", + "description": "Gets or sets the model description." + }, + "ModelUrl": { + "type": "string", + "description": "Gets or sets the model URL." + }, + "Manufacturer": { + "type": "string", + "description": "Gets or sets the manufacturer." + }, + "ManufacturerUrl": { + "type": "string", + "description": "Gets or sets the manufacturer URL." + }, + "Headers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/HttpHeaderInfo" + }, + "description": "Gets or sets the headers." + } + }, + "additionalProperties": false + }, + "DeviceInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "AccessToken": { + "type": "string", + "description": "Gets or sets the access token.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "nullable": true + }, + "LastUserName": { + "type": "string", + "description": "Gets or sets the last name of the user.", + "nullable": true + }, + "AppName": { + "type": "string", + "description": "Gets or sets the name of the application.", + "nullable": true + }, + "AppVersion": { + "type": "string", + "description": "Gets or sets the application version.", + "nullable": true + }, + "LastUserId": { + "type": "string", + "description": "Gets or sets the last user identifier.", + "format": "uuid" + }, + "DateLastActivity": { + "type": "string", + "description": "Gets or sets the date last modified.", + "format": "date-time" + }, + "Capabilities": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilities" + } + ], + "description": "Gets or sets the capabilities.", + "nullable": true + }, + "IconUrl": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "DeviceInfoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeviceInfo" + }, + "description": "Gets or sets the items.", + "nullable": true + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false + }, + "DeviceOptions": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets the id.", + "format": "int32", + "readOnly": true + }, + "DeviceId": { + "type": "string", + "description": "Gets the device id." + }, + "CustomName": { + "type": "string", + "description": "Gets or sets the custom name.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "An entity representing custom options for a device." + }, + "DeviceOptionsDto": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets or sets the id.", + "format": "int32" + }, + "DeviceId": { + "type": "string", + "description": "Gets or sets the device id.", + "nullable": true + }, + "CustomName": { + "type": "string", + "description": "Gets or sets the custom name.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "A dto representing custom options for a device." + }, + "DeviceProfile": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name of this device profile.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the Id.", + "nullable": true + }, + "Identification": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceIdentification" + } + ], + "description": "Gets or sets the Identification.", + "nullable": true + }, + "FriendlyName": { + "type": "string", + "description": "Gets or sets the friendly name of the device profile, which can be shown to users.", + "nullable": true + }, + "Manufacturer": { + "type": "string", + "description": "Gets or sets the manufacturer of the device which this profile represents.", + "nullable": true + }, + "ManufacturerUrl": { + "type": "string", + "description": "Gets or sets an url for the manufacturer of the device which this profile represents.", + "nullable": true + }, + "ModelName": { + "type": "string", + "description": "Gets or sets the model name of the device which this profile represents.", + "nullable": true + }, + "ModelDescription": { + "type": "string", + "description": "Gets or sets the model description of the device which this profile represents.", + "nullable": true + }, + "ModelNumber": { + "type": "string", + "description": "Gets or sets the model number of the device which this profile represents.", + "nullable": true + }, + "ModelUrl": { + "type": "string", + "description": "Gets or sets the ModelUrl.", + "nullable": true + }, + "SerialNumber": { + "type": "string", + "description": "Gets or sets the serial number of the device which this profile represents.", + "nullable": true + }, + "EnableAlbumArtInDidl": { + "type": "boolean", + "description": "Gets or sets a value indicating whether EnableAlbumArtInDidl.", + "default": false + }, + "EnableSingleAlbumArtLimit": { + "type": "boolean", + "description": "Gets or sets a value indicating whether EnableSingleAlbumArtLimit.", + "default": false + }, + "EnableSingleSubtitleLimit": { + "type": "boolean", + "description": "Gets or sets a value indicating whether EnableSingleSubtitleLimit.", + "default": false + }, + "SupportedMediaTypes": { + "type": "string", + "description": "Gets or sets the SupportedMediaTypes." + }, + "UserId": { + "type": "string", + "description": "Gets or sets the UserId.", + "nullable": true + }, + "AlbumArtPn": { + "type": "string", + "description": "Gets or sets the AlbumArtPn.", + "nullable": true + }, + "MaxAlbumArtWidth": { + "type": "integer", + "description": "Gets or sets the MaxAlbumArtWidth.", + "format": "int32", + "nullable": true + }, + "MaxAlbumArtHeight": { + "type": "integer", + "description": "Gets or sets the MaxAlbumArtHeight.", + "format": "int32", + "nullable": true + }, + "MaxIconWidth": { + "type": "integer", + "description": "Gets or sets the maximum allowed width of embedded icons.", + "format": "int32", + "nullable": true + }, + "MaxIconHeight": { + "type": "integer", + "description": "Gets or sets the maximum allowed height of embedded icons.", + "format": "int32", + "nullable": true + }, + "MaxStreamingBitrate": { + "type": "integer", + "description": "Gets or sets the maximum allowed bitrate for all streamed content.", + "format": "int32", + "nullable": true + }, + "MaxStaticBitrate": { + "type": "integer", + "description": "Gets or sets the maximum allowed bitrate for statically streamed content (= direct played files).", + "format": "int32", + "nullable": true + }, + "MusicStreamingTranscodingBitrate": { + "type": "integer", + "description": "Gets or sets the maximum allowed bitrate for transcoded music streams.", + "format": "int32", + "nullable": true + }, + "MaxStaticMusicBitrate": { + "type": "integer", + "description": "Gets or sets the maximum allowed bitrate for statically streamed (= direct played) music files.", + "format": "int32", + "nullable": true + }, + "SonyAggregationFlags": { + "type": "string", + "description": "Gets or sets the content of the aggregationFlags element in the urn:schemas-sonycom:av namespace.", + "nullable": true + }, + "ProtocolInfo": { + "type": "string", + "description": "Gets or sets the ProtocolInfo.", + "nullable": true + }, + "TimelineOffsetSeconds": { + "type": "integer", + "description": "Gets or sets the TimelineOffsetSeconds.", + "format": "int32", + "default": 0 + }, + "RequiresPlainVideoItems": { + "type": "boolean", + "description": "Gets or sets a value indicating whether RequiresPlainVideoItems.", + "default": false + }, + "RequiresPlainFolders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether RequiresPlainFolders.", + "default": false + }, + "EnableMSMediaReceiverRegistrar": { + "type": "boolean", + "description": "Gets or sets a value indicating whether EnableMSMediaReceiverRegistrar.", + "default": false + }, + "IgnoreTranscodeByteRangeRequests": { + "type": "boolean", + "description": "Gets or sets a value indicating whether IgnoreTranscodeByteRangeRequests.", + "default": false + }, + "XmlRootAttributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/XmlAttribute" + }, + "description": "Gets or sets the XmlRootAttributes." + }, + "DirectPlayProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DirectPlayProfile" + }, + "description": "Gets or sets the direct play profiles." + }, + "TranscodingProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TranscodingProfile" + }, + "description": "Gets or sets the transcoding profiles." + }, + "ContainerProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerProfile" + }, + "description": "Gets or sets the container profiles." + }, + "CodecProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CodecProfile" + }, + "description": "Gets or sets the codec profiles." + }, + "ResponseProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ResponseProfile" + }, + "description": "Gets or sets the ResponseProfiles." + }, + "SubtitleProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubtitleProfile" + }, + "description": "Gets or sets the subtitle profiles." + } + }, + "additionalProperties": false, + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + }, + "DeviceProfileInfo": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "nullable": true + }, + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Type": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfileType" + } + ], + "description": "Gets or sets the type." + } + }, + "additionalProperties": false + }, + "DeviceProfileType": { + "enum": [ + "System", + "User" + ], + "type": "string" + }, + "DirectPlayProfile": { + "type": "object", + "properties": { + "Container": { + "type": "string", + "nullable": true + }, + "AudioCodec": { + "type": "string", + "nullable": true + }, + "VideoCodec": { + "type": "string", + "nullable": true + }, + "Type": { + "allOf": [ + { + "$ref": "#/components/schemas/DlnaProfileType" + } + ] + } + }, + "additionalProperties": false + }, + "DisplayPreferencesDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the user id.", + "nullable": true + }, + "ViewType": { + "type": "string", + "description": "Gets or sets the type of the view.", + "nullable": true + }, + "SortBy": { + "type": "string", + "description": "Gets or sets the sort by.", + "nullable": true + }, + "IndexBy": { + "type": "string", + "description": "Gets or sets the index by.", + "nullable": true + }, + "RememberIndexing": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [remember indexing]." + }, + "PrimaryImageHeight": { + "type": "integer", + "description": "Gets or sets the height of the primary image.", + "format": "int32" + }, + "PrimaryImageWidth": { + "type": "integer", + "description": "Gets or sets the width of the primary image.", + "format": "int32" + }, + "CustomPrefs": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the custom prefs." + }, + "ScrollDirection": { + "allOf": [ + { + "$ref": "#/components/schemas/ScrollDirection" + } + ], + "description": "Gets or sets the scroll direction." + }, + "ShowBackdrop": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to show backdrops on this item." + }, + "RememberSorting": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [remember sorting]." + }, + "SortOrder": { + "allOf": [ + { + "$ref": "#/components/schemas/SortOrder" + } + ], + "description": "Gets or sets the sort order." + }, + "ShowSidebar": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [show sidebar]." + }, + "Client": { + "type": "string", + "description": "Gets or sets the client.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Defines the display preferences for any item that supports them (usually Folders)." + }, + "DlnaOptions": { + "type": "object", + "properties": { + "EnablePlayTo": { + "type": "boolean", + "description": "Gets or sets a value indicating whether gets or sets a value to indicate the status of the dlna playTo subsystem." + }, + "EnableServer": { + "type": "boolean", + "description": "Gets or sets a value indicating whether gets or sets a value to indicate the status of the dlna server subsystem." + }, + "EnableDebugLog": { + "type": "boolean", + "description": "Gets or sets a value indicating whether detailed dlna server logs are sent to the console/log.\r\nIf the setting \"Emby.Dlna\": \"Debug\" msut be set in logging.default.json for this property to work." + }, + "EnablePlayToTracing": { + "type": "boolean", + "description": "Gets or sets a value indicating whether whether detailed playTo debug logs are sent to the console/log.\r\nIf the setting \"Emby.Dlna.PlayTo\": \"Debug\" msut be set in logging.default.json for this property to work." + }, + "ClientDiscoveryIntervalSeconds": { + "type": "integer", + "description": "Gets or sets the ssdp client discovery interval time (in seconds).\r\nThis is the time after which the server will send a ssdp search request.", + "format": "int32" + }, + "AliveMessageIntervalSeconds": { + "type": "integer", + "description": "Gets or sets the frequency at which ssdp alive notifications are transmitted.", + "format": "int32" + }, + "BlastAliveMessageIntervalSeconds": { + "type": "integer", + "description": "Gets or sets the frequency at which ssdp alive notifications are transmitted. MIGRATING - TO BE REMOVED ONCE WEB HAS BEEN ALTERED.", + "format": "int32" + }, + "DefaultUserId": { + "type": "string", + "description": "Gets or sets the default user account that the dlna server uses.", + "nullable": true + }, + "AutoCreatePlayToProfiles": { + "type": "boolean", + "description": "Gets or sets a value indicating whether playTo device profiles should be created." + }, + "BlastAliveMessages": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to blast alive messages." + }, + "SendOnlyMatchedHost": { + "type": "boolean", + "description": "gets or sets a value indicating whether to send only matched host." + } + }, + "additionalProperties": false, + "description": "The DlnaOptions class contains the user definable parameters for the dlna subsystems." + }, + "DlnaProfileType": { + "enum": [ + "Audio", + "Video", + "Photo", + "Subtitle" + ], + "type": "string" + }, + "DynamicDayOfWeek": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Everyday", + "Weekday", + "Weekend" + ], + "type": "string", + "description": "An enum that represents a day of the week, weekdays, weekends, or all days." + }, + "EmbeddedSubtitleOptions": { + "enum": [ + "AllowAll", + "AllowText", + "AllowImage", + "AllowNone" + ], + "type": "string", + "description": "An enum representing the options to disable embedded subs." + }, + "EncodingContext": { + "enum": [ + "Streaming", + "Static" + ], + "type": "string" + }, + "EncodingOptions": { + "type": "object", + "properties": { + "EncodingThreadCount": { + "type": "integer", + "format": "int32" + }, + "TranscodingTempPath": { + "type": "string", + "nullable": true + }, + "FallbackFontPath": { + "type": "string", + "nullable": true + }, + "EnableFallbackFont": { + "type": "boolean" + }, + "DownMixAudioBoost": { + "type": "number", + "format": "double" + }, + "MaxMuxingQueueSize": { + "type": "integer", + "format": "int32" + }, + "EnableThrottling": { + "type": "boolean" + }, + "ThrottleDelaySeconds": { + "type": "integer", + "format": "int32" + }, + "HardwareAccelerationType": { + "type": "string", + "nullable": true + }, + "EncoderAppPath": { + "type": "string", + "description": "Gets or sets the FFmpeg path as set by the user via the UI.", + "nullable": true + }, + "EncoderAppPathDisplay": { + "type": "string", + "description": "Gets or sets the current FFmpeg path being used by the system and displayed on the transcode page.", + "nullable": true + }, + "VaapiDevice": { + "type": "string", + "nullable": true + }, + "EnableTonemapping": { + "type": "boolean" + }, + "EnableVppTonemapping": { + "type": "boolean" + }, + "TonemappingAlgorithm": { + "type": "string", + "nullable": true + }, + "TonemappingMode": { + "type": "string", + "nullable": true + }, + "TonemappingRange": { + "type": "string", + "nullable": true + }, + "TonemappingDesat": { + "type": "number", + "format": "double" + }, + "TonemappingPeak": { + "type": "number", + "format": "double" + }, + "TonemappingParam": { + "type": "number", + "format": "double" + }, + "VppTonemappingBrightness": { + "type": "number", + "format": "double" + }, + "VppTonemappingContrast": { + "type": "number", + "format": "double" + }, + "H264Crf": { + "type": "integer", + "format": "int32" + }, + "H265Crf": { + "type": "integer", + "format": "int32" + }, + "EncoderPreset": { + "type": "string", + "nullable": true + }, + "DeinterlaceDoubleRate": { + "type": "boolean" + }, + "DeinterlaceMethod": { + "type": "string", + "nullable": true + }, + "EnableDecodingColorDepth10Hevc": { + "type": "boolean" + }, + "EnableDecodingColorDepth10Vp9": { + "type": "boolean" + }, + "EnableEnhancedNvdecDecoder": { + "type": "boolean" + }, + "PreferSystemNativeHwDecoder": { + "type": "boolean" + }, + "EnableIntelLowPowerH264HwEncoder": { + "type": "boolean" + }, + "EnableIntelLowPowerHevcHwEncoder": { + "type": "boolean" + }, + "EnableHardwareEncoding": { + "type": "boolean" + }, + "AllowHevcEncoding": { + "type": "boolean" + }, + "EnableSubtitleExtraction": { + "type": "boolean" + }, + "HardwareDecodingCodecs": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "AllowOnDemandMetadataBasedKeyframeExtractionForExtensions": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "EndPointInfo": { + "type": "object", + "properties": { + "IsLocal": { + "type": "boolean" + }, + "IsInNetwork": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "ExternalIdInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the display name of the external id provider (IE: IMDB, MusicBrainz, etc)." + }, + "Key": { + "type": "string", + "description": "Gets or sets the unique key for this id. This key should be unique across all providers." + }, + "Type": { + "allOf": [ + { + "$ref": "#/components/schemas/ExternalIdMediaType" + } + ], + "description": "Gets or sets the specific media type for this id. This is used to distinguish between the different\r\nexternal id types for providers with multiple ids.\r\nA null value indicates there is no specific media type associated with the external id, or this is the\r\ndefault id for the external provider so there is no need to specify a type.", + "nullable": true + }, + "UrlFormatString": { + "type": "string", + "description": "Gets or sets the URL format string.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Represents the external id information for serialization to the client." + }, + "ExternalIdMediaType": { + "enum": [ + "Album", + "AlbumArtist", + "Artist", + "BoxSet", + "Episode", + "Movie", + "OtherArtist", + "Person", + "ReleaseGroup", + "Season", + "Series", + "Track" + ], + "type": "string", + "description": "The specific media type of an MediaBrowser.Model.Providers.ExternalIdInfo." + }, + "ExternalUrl": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Url": { + "type": "string", + "description": "Gets or sets the type of the item.", + "nullable": true + } + }, + "additionalProperties": false + }, + "FFmpegLocation": { + "enum": [ + "NotFound", + "SetByArgument", + "Custom", + "System" + ], + "type": "string", + "description": "Enum describing the location of the FFmpeg tool." + }, + "FileSystemEntryInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets the name." + }, + "Path": { + "type": "string", + "description": "Gets the path." + }, + "Type": { + "allOf": [ + { + "$ref": "#/components/schemas/FileSystemEntryType" + } + ], + "description": "Gets the type." + } + }, + "additionalProperties": false, + "description": "Class FileSystemEntryInfo." + }, + "FileSystemEntryType": { + "enum": [ + "File", + "Directory", + "NetworkComputer", + "NetworkShare" + ], + "type": "string", + "description": "Enum FileSystemEntryType." + }, + "FontFile": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Size": { + "type": "integer", + "description": "Gets or sets the size.", + "format": "int64" + }, + "DateCreated": { + "type": "string", + "description": "Gets or sets the date created.", + "format": "date-time" + }, + "DateModified": { + "type": "string", + "description": "Gets or sets the date modified.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Class FontFile." + }, + "ForgotPasswordAction": { + "enum": [ + "ContactAdmin", + "PinCode", + "InNetworkRequired" + ], + "type": "string" + }, + "ForgotPasswordDto": { + "required": [ + "EnteredUsername" + ], + "type": "object", + "properties": { + "EnteredUsername": { + "type": "string", + "description": "Gets or sets the entered username to have its password reset." + } + }, + "additionalProperties": false, + "description": "Forgot Password request body DTO." + }, + "ForgotPasswordPinDto": { + "required": [ + "Pin" + ], + "type": "object", + "properties": { + "Pin": { + "type": "string", + "description": "Gets or sets the entered pin to have the password reset." + } + }, + "additionalProperties": false, + "description": "Forgot Password Pin enter request body DTO." + }, + "ForgotPasswordResult": { + "type": "object", + "properties": { + "Action": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordAction" + } + ], + "description": "Gets or sets the action." + }, + "PinFile": { + "type": "string", + "description": "Gets or sets the pin file.", + "nullable": true + }, + "PinExpirationDate": { + "type": "string", + "description": "Gets or sets the pin expiration date.", + "format": "date-time", + "nullable": true + } + }, + "additionalProperties": false + }, + "GeneralCommand": { + "type": "object", + "properties": { + "Name": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommandType" + } + ], + "description": "This exists simply to identify a set of known commands." + }, + "ControllingUserId": { + "type": "string", + "format": "uuid" + }, + "Arguments": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + "additionalProperties": false + }, + "GeneralCommandType": { + "enum": [ + "MoveUp", + "MoveDown", + "MoveLeft", + "MoveRight", + "PageUp", + "PageDown", + "PreviousLetter", + "NextLetter", + "ToggleOsd", + "ToggleContextMenu", + "Select", + "Back", + "TakeScreenshot", + "SendKey", + "SendString", + "GoHome", + "GoToSettings", + "VolumeUp", + "VolumeDown", + "Mute", + "Unmute", + "ToggleMute", + "SetVolume", + "SetAudioStreamIndex", + "SetSubtitleStreamIndex", + "ToggleFullscreen", + "DisplayContent", + "GoToSearch", + "DisplayMessage", + "SetRepeatMode", + "ChannelUp", + "ChannelDown", + "Guide", + "ToggleStats", + "PlayMediaSource", + "PlayTrailers", + "SetShuffleQueue", + "PlayState", + "PlayNext", + "ToggleOsdMenu", + "Play", + "SetMaxStreamingBitrate" + ], + "type": "string", + "description": "This exists simply to identify a set of known commands." + }, + "GetProgramsDto": { + "type": "object", + "properties": { + "ChannelIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the channels to return guide information for." + }, + "UserId": { + "type": "string", + "description": "Gets or sets optional. Filter by user id.", + "format": "uuid" + }, + "MinStartDate": { + "type": "string", + "description": "Gets or sets the minimum premiere start date.\r\nOptional.", + "format": "date-time", + "nullable": true + }, + "HasAired": { + "type": "boolean", + "description": "Gets or sets filter by programs that have completed airing, or not.\r\nOptional.", + "nullable": true + }, + "IsAiring": { + "type": "boolean", + "description": "Gets or sets filter by programs that are currently airing, or not.\r\nOptional.", + "nullable": true + }, + "MaxStartDate": { + "type": "string", + "description": "Gets or sets the maximum premiere start date.\r\nOptional.", + "format": "date-time", + "nullable": true + }, + "MinEndDate": { + "type": "string", + "description": "Gets or sets the minimum premiere end date.\r\nOptional.", + "format": "date-time", + "nullable": true + }, + "MaxEndDate": { + "type": "string", + "description": "Gets or sets the maximum premiere end date.\r\nOptional.", + "format": "date-time", + "nullable": true + }, + "IsMovie": { + "type": "boolean", + "description": "Gets or sets filter for movies.\r\nOptional.", + "nullable": true + }, + "IsSeries": { + "type": "boolean", + "description": "Gets or sets filter for series.\r\nOptional.", + "nullable": true + }, + "IsNews": { + "type": "boolean", + "description": "Gets or sets filter for news.\r\nOptional.", + "nullable": true + }, + "IsKids": { + "type": "boolean", + "description": "Gets or sets filter for kids.\r\nOptional.", + "nullable": true + }, + "IsSports": { + "type": "boolean", + "description": "Gets or sets filter for sports.\r\nOptional.", + "nullable": true + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the record index to start at. All items with a lower index will be dropped from the results.\r\nOptional.", + "format": "int32", + "nullable": true + }, + "Limit": { + "type": "integer", + "description": "Gets or sets the maximum number of records to return.\r\nOptional.", + "format": "int32", + "nullable": true + }, + "SortBy": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets specify one or more sort orders, comma delimited. Options: Name, StartDate.\r\nOptional." + }, + "SortOrder": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + }, + "description": "Gets or sets sort Order - Ascending,Descending." + }, + "Genres": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the genres to return guide information for." + }, + "GenreIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the genre ids to return guide information for." + }, + "EnableImages": { + "type": "boolean", + "description": "Gets or sets include image information in output.\r\nOptional.", + "nullable": true + }, + "EnableTotalRecordCount": { + "type": "boolean", + "description": "Gets or sets a value indicating whether retrieve total record count." + }, + "ImageTypeLimit": { + "type": "integer", + "description": "Gets or sets the max number of images to return, per image type.\r\nOptional.", + "format": "int32", + "nullable": true + }, + "EnableImageTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + }, + "description": "Gets or sets the image types to include in the output.\r\nOptional." + }, + "EnableUserData": { + "type": "boolean", + "description": "Gets or sets include user data.\r\nOptional.", + "nullable": true + }, + "SeriesTimerId": { + "type": "string", + "description": "Gets or sets filter by series timer id.\r\nOptional.", + "nullable": true + }, + "LibrarySeriesId": { + "type": "string", + "description": "Gets or sets filter by library series id.\r\nOptional.", + "format": "uuid" + }, + "Fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + }, + "description": "Gets or sets specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.\r\nOptional." + } + }, + "additionalProperties": false, + "description": "Get programs dto." + }, + "GroupInfoDto": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid" + }, + "GroupName": { + "type": "string", + "description": "Gets the group name." + }, + "State": { + "allOf": [ + { + "$ref": "#/components/schemas/GroupStateType" + } + ], + "description": "Gets the group state." + }, + "Participants": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets the participants." + }, + "LastUpdatedAt": { + "type": "string", + "description": "Gets the date when this DTO has been created.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Class GroupInfoDto." + }, + "GroupQueueMode": { + "enum": [ + "Queue", + "QueueNext" + ], + "type": "string", + "description": "Enum GroupQueueMode." + }, + "GroupRepeatMode": { + "enum": [ + "RepeatOne", + "RepeatAll", + "RepeatNone" + ], + "type": "string", + "description": "Enum GroupRepeatMode." + }, + "GroupShuffleMode": { + "enum": [ + "Sorted", + "Shuffle" + ], + "type": "string", + "description": "Enum GroupShuffleMode." + }, + "GroupStateType": { + "enum": [ + "Idle", + "Waiting", + "Paused", + "Playing" + ], + "type": "string", + "description": "Enum GroupState." + }, + "GroupUpdateType": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "CreateGroupDenied", + "JoinGroupDenied", + "LibraryAccessDenied" + ], + "type": "string", + "description": "Enum GroupUpdateType." + }, + "GuideInfo": { + "type": "object", + "properties": { + "StartDate": { + "type": "string", + "description": "Gets or sets the start date.", + "format": "date-time" + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date.", + "format": "date-time" + } + }, + "additionalProperties": false + }, + "HardwareEncodingType": { + "enum": [ + "AMF", + "QSV", + "NVENC", + "V4L2M2M", + "VAAPI", + "VideoToolBox" + ], + "type": "string", + "description": "Enum HardwareEncodingType." + }, + "HeaderMatchType": { + "enum": [ + "Equals", + "Regex", + "Substring" + ], + "type": "string" + }, + "HttpHeaderInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "Value": { + "type": "string", + "nullable": true + }, + "Match": { + "allOf": [ + { + "$ref": "#/components/schemas/HeaderMatchType" + } + ] + } + }, + "additionalProperties": false + }, + "IgnoreWaitRequestDto": { + "type": "object", + "properties": { + "IgnoreWait": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the client should be ignored." + } + }, + "additionalProperties": false, + "description": "Class IgnoreWaitRequestDto." + }, + "ImageByNameInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Theme": { + "type": "string", + "description": "Gets or sets the theme.", + "nullable": true + }, + "Context": { + "type": "string", + "description": "Gets or sets the context.", + "nullable": true + }, + "FileLength": { + "type": "integer", + "description": "Gets or sets the length of the file.", + "format": "int64" + }, + "Format": { + "type": "string", + "description": "Gets or sets the format.", + "nullable": true + } + }, + "additionalProperties": false + }, + "ImageFormat": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp" + ], + "type": "string", + "description": "Enum ImageOutputFormat." + }, + "ImageInfo": { + "type": "object", + "properties": { + "ImageType": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Gets or sets the type of the image." + }, + "ImageIndex": { + "type": "integer", + "description": "Gets or sets the index of the image.", + "format": "int32", + "nullable": true + }, + "ImageTag": { + "type": "string", + "description": "Gets or sets the image tag.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "BlurHash": { + "type": "string", + "description": "Gets or sets the blurhash.", + "nullable": true + }, + "Height": { + "type": "integer", + "description": "Gets or sets the height.", + "format": "int32", + "nullable": true + }, + "Width": { + "type": "integer", + "description": "Gets or sets the width.", + "format": "int32", + "nullable": true + }, + "Size": { + "type": "integer", + "description": "Gets or sets the size.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Class ImageInfo." + }, + "ImageOption": { + "type": "object", + "properties": { + "Type": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Gets or sets the type." + }, + "Limit": { + "type": "integer", + "description": "Gets or sets the limit.", + "format": "int32" + }, + "MinWidth": { + "type": "integer", + "description": "Gets or sets the minimum width.", + "format": "int32" + } + }, + "additionalProperties": false + }, + "ImageOrientation": { + "enum": [ + "TopLeft", + "TopRight", + "BottomRight", + "BottomLeft", + "LeftTop", + "RightTop", + "RightBottom", + "LeftBottom" + ], + "type": "string" + }, + "ImageProviderInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets the name." + }, + "SupportedImages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + }, + "description": "Gets the supported image types." + } + }, + "additionalProperties": false, + "description": "Class ImageProviderInfo." + }, + "ImageSavingConvention": { + "enum": [ + "Legacy", + "Compatible" + ], + "type": "string" + }, + "ImageType": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "type": "string", + "description": "Enum ImageType." + }, + "InstallationInfo": { + "type": "object", + "properties": { + "Guid": { + "type": "string", + "description": "Gets or sets the Id.", + "format": "uuid" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the version.", + "nullable": true + }, + "Changelog": { + "type": "string", + "description": "Gets or sets the changelog for this version.", + "nullable": true + }, + "SourceUrl": { + "type": "string", + "description": "Gets or sets the source URL.", + "nullable": true + }, + "Checksum": { + "type": "string", + "description": "Gets or sets a checksum for the binary.", + "nullable": true + }, + "PackageInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/PackageInfo" + } + ], + "description": "Gets or sets package information for the installation.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class InstallationInfo." + }, + "IPlugin": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets the name of the plugin.", + "nullable": true, + "readOnly": true + }, + "Description": { + "type": "string", + "description": "Gets the Description.", + "nullable": true, + "readOnly": true + }, + "Id": { + "type": "string", + "description": "Gets the unique id.", + "format": "uuid", + "readOnly": true + }, + "Version": { + "type": "string", + "description": "Gets the plugin version.", + "nullable": true, + "readOnly": true + }, + "AssemblyFilePath": { + "type": "string", + "description": "Gets the path to the assembly file.", + "nullable": true, + "readOnly": true + }, + "CanUninstall": { + "type": "boolean", + "description": "Gets a value indicating whether the plugin can be uninstalled.", + "readOnly": true + }, + "DataFolderPath": { + "type": "string", + "description": "Gets the full path to the data folder, where the plugin can store any miscellaneous files needed.", + "nullable": true, + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Common.Plugins.IPlugin." + }, + "IsoType": { + "enum": [ + "Dvd", + "BluRay" + ], + "type": "string", + "description": "Enum IsoType." + }, + "ItemCounts": { + "type": "object", + "properties": { + "MovieCount": { + "type": "integer", + "description": "Gets or sets the movie count.", + "format": "int32" + }, + "SeriesCount": { + "type": "integer", + "description": "Gets or sets the series count.", + "format": "int32" + }, + "EpisodeCount": { + "type": "integer", + "description": "Gets or sets the episode count.", + "format": "int32" + }, + "ArtistCount": { + "type": "integer", + "description": "Gets or sets the artist count.", + "format": "int32" + }, + "ProgramCount": { + "type": "integer", + "description": "Gets or sets the program count.", + "format": "int32" + }, + "TrailerCount": { + "type": "integer", + "description": "Gets or sets the trailer count.", + "format": "int32" + }, + "SongCount": { + "type": "integer", + "description": "Gets or sets the song count.", + "format": "int32" + }, + "AlbumCount": { + "type": "integer", + "description": "Gets or sets the album count.", + "format": "int32" + }, + "MusicVideoCount": { + "type": "integer", + "description": "Gets or sets the music video count.", + "format": "int32" + }, + "BoxSetCount": { + "type": "integer", + "description": "Gets or sets the box set count.", + "format": "int32" + }, + "BookCount": { + "type": "integer", + "description": "Gets or sets the book count.", + "format": "int32" + }, + "ItemCount": { + "type": "integer", + "description": "Gets or sets the item count.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Class LibrarySummary." + }, + "ItemFields": { + "enum": [ + "AirTime", + "CanDelete", + "CanDownload", + "ChannelInfo", + "Chapters", + "ChildCount", + "CumulativeRunTimeTicks", + "CustomRating", + "DateCreated", + "DateLastMediaAdded", + "DisplayPreferencesId", + "Etag", + "ExternalUrls", + "Genres", + "HomePageUrl", + "ItemCounts", + "MediaSourceCount", + "MediaSources", + "OriginalTitle", + "Overview", + "ParentId", + "Path", + "People", + "PlayAccess", + "ProductionLocations", + "ProviderIds", + "PrimaryImageAspectRatio", + "RecursiveItemCount", + "Settings", + "ScreenshotImageTags", + "SeriesPrimaryImage", + "SeriesStudio", + "SortName", + "SpecialEpisodeNumbers", + "Studios", + "BasicSyncInfo", + "SyncInfo", + "Taglines", + "Tags", + "RemoteTrailers", + "MediaStreams", + "SeasonUserData", + "ServiceName", + "ThemeSongIds", + "ThemeVideoIds", + "ExternalEtag", + "PresentationUniqueKey", + "InheritedParentalRatingValue", + "ExternalSeriesId", + "SeriesPresentationUniqueKey", + "DateLastRefreshed", + "DateLastSaved", + "RefreshState", + "ChannelImage", + "EnableMediaSourceDisplay", + "Width", + "Height", + "ExtraIds", + "LocalTrailerCount", + "IsHD", + "SpecialFeatureCount" + ], + "type": "string", + "description": "Used to control the data that gets attached to DtoBaseItems." + }, + "ItemFilter": { + "enum": [ + "IsFolder", + "IsNotFolder", + "IsUnplayed", + "IsPlayed", + "IsFavorite", + "IsResumable", + "Likes", + "Dislikes", + "IsFavoriteOrLikes" + ], + "type": "string", + "description": "Enum ItemFilter." + }, + "JoinGroupRequestDto": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets or sets the group identifier.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class JoinGroupRequestDto." + }, + "KeepUntil": { + "enum": [ + "UntilDeleted", + "UntilSpaceNeeded", + "UntilWatched", + "UntilDate" + ], + "type": "string" + }, + "LibraryOptionInfoDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets name.", + "nullable": true + }, + "DefaultEnabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether default enabled." + } + }, + "additionalProperties": false, + "description": "Library option info dto." + }, + "LibraryOptions": { + "type": "object", + "properties": { + "EnablePhotos": { + "type": "boolean" + }, + "EnableRealtimeMonitor": { + "type": "boolean" + }, + "EnableChapterImageExtraction": { + "type": "boolean" + }, + "ExtractChapterImagesDuringLibraryScan": { + "type": "boolean" + }, + "PathInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaPathInfo" + } + }, + "SaveLocalMetadata": { + "type": "boolean" + }, + "EnableInternetProviders": { + "type": "boolean", + "deprecated": true + }, + "EnableAutomaticSeriesGrouping": { + "type": "boolean" + }, + "EnableEmbeddedTitles": { + "type": "boolean" + }, + "EnableEmbeddedEpisodeInfos": { + "type": "boolean" + }, + "AutomaticRefreshIntervalDays": { + "type": "integer", + "format": "int32" + }, + "PreferredMetadataLanguage": { + "type": "string", + "description": "Gets or sets the preferred metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "SeasonZeroDisplayName": { + "type": "string" + }, + "MetadataSavers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DisabledLocalMetadataReaders": { + "type": "array", + "items": { + "type": "string" + } + }, + "LocalMetadataReaderOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DisabledSubtitleFetchers": { + "type": "array", + "items": { + "type": "string" + } + }, + "SubtitleFetcherOrder": { + "type": "array", + "items": { + "type": "string" + } + }, + "SkipSubtitlesIfEmbeddedSubtitlesPresent": { + "type": "boolean" + }, + "SkipSubtitlesIfAudioTrackMatches": { + "type": "boolean" + }, + "SubtitleDownloadLanguages": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "RequirePerfectSubtitleMatch": { + "type": "boolean" + }, + "SaveSubtitlesWithMedia": { + "type": "boolean" + }, + "AutomaticallyAddToCollection": { + "type": "boolean" + }, + "AllowEmbeddedSubtitles": { + "allOf": [ + { + "$ref": "#/components/schemas/EmbeddedSubtitleOptions" + } + ], + "description": "An enum representing the options to disable embedded subs." + }, + "TypeOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TypeOptions" + } + } + }, + "additionalProperties": false + }, + "LibraryOptionsResultDto": { + "type": "object", + "properties": { + "MetadataSavers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the metadata savers." + }, + "MetadataReaders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the metadata readers." + }, + "SubtitleFetchers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the subtitle fetchers." + }, + "TypeOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryTypeOptionsDto" + }, + "description": "Gets or sets the type options." + } + }, + "additionalProperties": false, + "description": "Library options result dto." + }, + "LibraryTypeOptionsDto": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "description": "Gets or sets the type.", + "nullable": true + }, + "MetadataFetchers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the metadata fetchers." + }, + "ImageFetchers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the image fetchers." + }, + "SupportedImageTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + }, + "description": "Gets or sets the supported image types." + }, + "DefaultImageOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageOption" + }, + "description": "Gets or sets the default image options." + } + }, + "additionalProperties": false, + "description": "Library type options dto." + }, + "LibraryUpdateInfo": { + "type": "object", + "properties": { + "FoldersAddedTo": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the folders added to." + }, + "FoldersRemovedFrom": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the folders removed from." + }, + "ItemsAdded": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the items added." + }, + "ItemsRemoved": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the items removed." + }, + "ItemsUpdated": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the items updated." + }, + "CollectionFolders": { + "type": "array", + "items": { + "type": "string" + } + }, + "IsEmpty": { + "type": "boolean", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Class LibraryUpdateInfo." + }, + "ListingsProviderInfo": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": true + }, + "Type": { + "type": "string", + "nullable": true + }, + "Username": { + "type": "string", + "nullable": true + }, + "Password": { + "type": "string", + "nullable": true + }, + "ListingsId": { + "type": "string", + "nullable": true + }, + "ZipCode": { + "type": "string", + "nullable": true + }, + "Country": { + "type": "string", + "nullable": true + }, + "Path": { + "type": "string", + "nullable": true + }, + "EnabledTuners": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "EnableAllTuners": { + "type": "boolean" + }, + "NewsCategories": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "SportsCategories": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "KidsCategories": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "MovieCategories": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ChannelMappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameValuePair" + }, + "nullable": true + }, + "MoviePrefix": { + "type": "string", + "nullable": true + }, + "PreferredLanguage": { + "type": "string", + "nullable": true + }, + "UserAgent": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "LiveStreamResponse": { + "type": "object", + "properties": { + "MediaSource": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaSourceInfo" + } + ] + } + }, + "additionalProperties": false + }, + "LiveTvInfo": { + "type": "object", + "properties": { + "Services": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LiveTvServiceInfo" + }, + "description": "Gets or sets the services." + }, + "IsEnabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is enabled." + }, + "EnabledUsers": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the enabled users." + } + }, + "additionalProperties": false + }, + "LiveTvOptions": { + "type": "object", + "properties": { + "GuideDays": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "RecordingPath": { + "type": "string", + "nullable": true + }, + "MovieRecordingPath": { + "type": "string", + "nullable": true + }, + "SeriesRecordingPath": { + "type": "string", + "nullable": true + }, + "EnableRecordingSubfolders": { + "type": "boolean" + }, + "EnableOriginalAudioWithEncodedRecordings": { + "type": "boolean" + }, + "TunerHosts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + }, + "nullable": true + }, + "ListingProviders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ListingsProviderInfo" + }, + "nullable": true + }, + "PrePaddingSeconds": { + "type": "integer", + "format": "int32" + }, + "PostPaddingSeconds": { + "type": "integer", + "format": "int32" + }, + "MediaLocationsCreated": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "RecordingPostProcessor": { + "type": "string", + "nullable": true + }, + "RecordingPostProcessorArguments": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "LiveTvServiceInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "HomePageUrl": { + "type": "string", + "description": "Gets or sets the home page URL.", + "nullable": true + }, + "Status": { + "allOf": [ + { + "$ref": "#/components/schemas/LiveTvServiceStatus" + } + ], + "description": "Gets or sets the status." + }, + "StatusMessage": { + "type": "string", + "description": "Gets or sets the status message.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the version.", + "nullable": true + }, + "HasUpdateAvailable": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has update available." + }, + "IsVisible": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is visible." + }, + "Tuners": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class ServiceInfo." + }, + "LiveTvServiceStatus": { + "enum": [ + "Ok", + "Unavailable" + ], + "type": "string" + }, + "LocalizationOption": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "Value": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "LocationType": { + "enum": [ + "FileSystem", + "Remote", + "Virtual", + "Offline" + ], + "type": "string", + "description": "Enum LocationType." + }, + "LogFile": { + "type": "object", + "properties": { + "DateCreated": { + "type": "string", + "description": "Gets or sets the date created.", + "format": "date-time" + }, + "DateModified": { + "type": "string", + "description": "Gets or sets the date modified.", + "format": "date-time" + }, + "Size": { + "type": "integer", + "description": "Gets or sets the size.", + "format": "int64" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + } + }, + "additionalProperties": false + }, + "LogLevel": { + "enum": [ + "Trace", + "Debug", + "Information", + "Warning", + "Error", + "Critical", + "None" + ], + "type": "string" + }, + "MediaAttachment": { + "type": "object", + "properties": { + "Codec": { + "type": "string", + "description": "Gets or sets the codec.", + "nullable": true + }, + "CodecTag": { + "type": "string", + "description": "Gets or sets the codec tag.", + "nullable": true + }, + "Comment": { + "type": "string", + "description": "Gets or sets the comment.", + "nullable": true + }, + "Index": { + "type": "integer", + "description": "Gets or sets the index.", + "format": "int32" + }, + "FileName": { + "type": "string", + "description": "Gets or sets the filename.", + "nullable": true + }, + "MimeType": { + "type": "string", + "description": "Gets or sets the MIME type.", + "nullable": true + }, + "DeliveryUrl": { + "type": "string", + "description": "Gets or sets the delivery URL.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class MediaAttachment." + }, + "MediaEncoderPathDto": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Gets or sets media encoder path." + }, + "PathType": { + "type": "string", + "description": "Gets or sets media encoder path type." + } + }, + "additionalProperties": false, + "description": "Media Encoder Path Dto." + }, + "MediaPathDto": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name of the library." + }, + "Path": { + "type": "string", + "description": "Gets or sets the path to add.", + "nullable": true + }, + "PathInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathInfo" + } + ], + "description": "Gets or sets the path info.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Media Path dto." + }, + "MediaPathInfo": { + "type": "object", + "properties": { + "Path": { + "type": "string" + }, + "NetworkPath": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "MediaProtocol": { + "enum": [ + "File", + "Http", + "Rtmp", + "Rtsp", + "Udp", + "Rtp", + "Ftp" + ], + "type": "string" + }, + "MediaSourceInfo": { + "type": "object", + "properties": { + "Protocol": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaProtocol" + } + ] + }, + "Id": { + "type": "string", + "nullable": true + }, + "Path": { + "type": "string", + "nullable": true + }, + "EncoderPath": { + "type": "string", + "nullable": true + }, + "EncoderProtocol": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaProtocol" + } + ], + "nullable": true + }, + "Type": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaSourceType" + } + ] + }, + "Container": { + "type": "string", + "nullable": true + }, + "Size": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "Name": { + "type": "string", + "nullable": true + }, + "IsRemote": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the media is remote.\r\nDifferentiate internet url vs local network." + }, + "ETag": { + "type": "string", + "nullable": true + }, + "RunTimeTicks": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "ReadAtNativeFramerate": { + "type": "boolean" + }, + "IgnoreDts": { + "type": "boolean" + }, + "IgnoreIndex": { + "type": "boolean" + }, + "GenPtsInput": { + "type": "boolean" + }, + "SupportsTranscoding": { + "type": "boolean" + }, + "SupportsDirectStream": { + "type": "boolean" + }, + "SupportsDirectPlay": { + "type": "boolean" + }, + "IsInfiniteStream": { + "type": "boolean" + }, + "RequiresOpening": { + "type": "boolean" + }, + "OpenToken": { + "type": "string", + "nullable": true + }, + "RequiresClosing": { + "type": "boolean" + }, + "LiveStreamId": { + "type": "string", + "nullable": true + }, + "BufferMs": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "RequiresLooping": { + "type": "boolean" + }, + "SupportsProbing": { + "type": "boolean" + }, + "VideoType": { + "allOf": [ + { + "$ref": "#/components/schemas/VideoType" + } + ], + "nullable": true + }, + "IsoType": { + "allOf": [ + { + "$ref": "#/components/schemas/IsoType" + } + ], + "nullable": true + }, + "Video3DFormat": { + "allOf": [ + { + "$ref": "#/components/schemas/Video3DFormat" + } + ], + "nullable": true + }, + "MediaStreams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaStream" + }, + "nullable": true + }, + "MediaAttachments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaAttachment" + }, + "nullable": true + }, + "Formats": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Bitrate": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "Timestamp": { + "allOf": [ + { + "$ref": "#/components/schemas/TransportStreamTimestamp" + } + ], + "nullable": true + }, + "RequiredHttpHeaders": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "nullable": true + }, + "TranscodingUrl": { + "type": "string", + "nullable": true + }, + "TranscodingSubProtocol": { + "type": "string", + "nullable": true + }, + "TranscodingContainer": { + "type": "string", + "nullable": true + }, + "AnalyzeDurationMs": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "DefaultAudioStreamIndex": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "DefaultSubtitleStreamIndex": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false + }, + "MediaSourceType": { + "enum": [ + "Default", + "Grouping", + "Placeholder" + ], + "type": "string" + }, + "MediaStream": { + "type": "object", + "properties": { + "Codec": { + "type": "string", + "description": "Gets or sets the codec.", + "nullable": true + }, + "CodecTag": { + "type": "string", + "description": "Gets or sets the codec tag.", + "nullable": true + }, + "Language": { + "type": "string", + "description": "Gets or sets the language.", + "nullable": true + }, + "ColorRange": { + "type": "string", + "description": "Gets or sets the color range.", + "nullable": true + }, + "ColorSpace": { + "type": "string", + "description": "Gets or sets the color space.", + "nullable": true + }, + "ColorTransfer": { + "type": "string", + "description": "Gets or sets the color transfer.", + "nullable": true + }, + "ColorPrimaries": { + "type": "string", + "description": "Gets or sets the color primaries.", + "nullable": true + }, + "DvVersionMajor": { + "type": "integer", + "description": "Gets or sets the Dolby Vision version major.", + "format": "int32", + "nullable": true + }, + "DvVersionMinor": { + "type": "integer", + "description": "Gets or sets the Dolby Vision version minor.", + "format": "int32", + "nullable": true + }, + "DvProfile": { + "type": "integer", + "description": "Gets or sets the Dolby Vision profile.", + "format": "int32", + "nullable": true + }, + "DvLevel": { + "type": "integer", + "description": "Gets or sets the Dolby Vision level.", + "format": "int32", + "nullable": true + }, + "RpuPresentFlag": { + "type": "integer", + "description": "Gets or sets the Dolby Vision rpu present flag.", + "format": "int32", + "nullable": true + }, + "ElPresentFlag": { + "type": "integer", + "description": "Gets or sets the Dolby Vision el present flag.", + "format": "int32", + "nullable": true + }, + "BlPresentFlag": { + "type": "integer", + "description": "Gets or sets the Dolby Vision bl present flag.", + "format": "int32", + "nullable": true + }, + "DvBlSignalCompatibilityId": { + "type": "integer", + "description": "Gets or sets the Dolby Vision bl signal compatibility id.", + "format": "int32", + "nullable": true + }, + "Comment": { + "type": "string", + "description": "Gets or sets the comment.", + "nullable": true + }, + "TimeBase": { + "type": "string", + "description": "Gets or sets the time base.", + "nullable": true + }, + "CodecTimeBase": { + "type": "string", + "description": "Gets or sets the codec time base.", + "nullable": true + }, + "Title": { + "type": "string", + "description": "Gets or sets the title.", + "nullable": true + }, + "VideoRange": { + "type": "string", + "description": "Gets the video range.", + "nullable": true, + "readOnly": true + }, + "VideoRangeType": { + "type": "string", + "description": "Gets the video range type.", + "nullable": true, + "readOnly": true + }, + "VideoDoViTitle": { + "type": "string", + "description": "Gets the video dovi title.", + "nullable": true, + "readOnly": true + }, + "LocalizedUndefined": { + "type": "string", + "nullable": true + }, + "LocalizedDefault": { + "type": "string", + "nullable": true + }, + "LocalizedForced": { + "type": "string", + "nullable": true + }, + "LocalizedExternal": { + "type": "string", + "nullable": true + }, + "DisplayTitle": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "NalLengthSize": { + "type": "string", + "nullable": true + }, + "IsInterlaced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is interlaced." + }, + "IsAVC": { + "type": "boolean", + "nullable": true + }, + "ChannelLayout": { + "type": "string", + "description": "Gets or sets the channel layout.", + "nullable": true + }, + "BitRate": { + "type": "integer", + "description": "Gets or sets the bit rate.", + "format": "int32", + "nullable": true + }, + "BitDepth": { + "type": "integer", + "description": "Gets or sets the bit depth.", + "format": "int32", + "nullable": true + }, + "RefFrames": { + "type": "integer", + "description": "Gets or sets the reference frames.", + "format": "int32", + "nullable": true + }, + "PacketLength": { + "type": "integer", + "description": "Gets or sets the length of the packet.", + "format": "int32", + "nullable": true + }, + "Channels": { + "type": "integer", + "description": "Gets or sets the channels.", + "format": "int32", + "nullable": true + }, + "SampleRate": { + "type": "integer", + "description": "Gets or sets the sample rate.", + "format": "int32", + "nullable": true + }, + "IsDefault": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is default." + }, + "IsForced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is forced." + }, + "Height": { + "type": "integer", + "description": "Gets or sets the height.", + "format": "int32", + "nullable": true + }, + "Width": { + "type": "integer", + "description": "Gets or sets the width.", + "format": "int32", + "nullable": true + }, + "AverageFrameRate": { + "type": "number", + "description": "Gets or sets the average frame rate.", + "format": "float", + "nullable": true + }, + "RealFrameRate": { + "type": "number", + "description": "Gets or sets the real frame rate.", + "format": "float", + "nullable": true + }, + "Profile": { + "type": "string", + "description": "Gets or sets the profile.", + "nullable": true + }, + "Type": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaStreamType" + } + ], + "description": "Gets or sets the type." + }, + "AspectRatio": { + "type": "string", + "description": "Gets or sets the aspect ratio.", + "nullable": true + }, + "Index": { + "type": "integer", + "description": "Gets or sets the index.", + "format": "int32" + }, + "Score": { + "type": "integer", + "description": "Gets or sets the score.", + "format": "int32", + "nullable": true + }, + "IsExternal": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is external." + }, + "DeliveryMethod": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ], + "description": "Gets or sets the method.", + "nullable": true + }, + "DeliveryUrl": { + "type": "string", + "description": "Gets or sets the delivery URL.", + "nullable": true + }, + "IsExternalUrl": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is external URL.", + "nullable": true + }, + "IsTextSubtitleStream": { + "type": "boolean", + "readOnly": true + }, + "SupportsExternalStream": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports external stream]." + }, + "Path": { + "type": "string", + "description": "Gets or sets the filename.", + "nullable": true + }, + "PixelFormat": { + "type": "string", + "description": "Gets or sets the pixel format.", + "nullable": true + }, + "Level": { + "type": "number", + "description": "Gets or sets the level.", + "format": "double", + "nullable": true + }, + "IsAnamorphic": { + "type": "boolean", + "description": "Gets or sets whether this instance is anamorphic.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class MediaStream." + }, + "MediaStreamType": { + "enum": [ + "Audio", + "Video", + "Subtitle", + "EmbeddedImage", + "Data" + ], + "type": "string", + "description": "Enum MediaStreamType." + }, + "MediaUpdateInfoDto": { + "type": "object", + "properties": { + "Updates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaUpdateInfoPathDto" + }, + "description": "Gets or sets the list of updates." + } + }, + "additionalProperties": false, + "description": "Media Update Info Dto." + }, + "MediaUpdateInfoPathDto": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Gets or sets media path.", + "nullable": true + }, + "UpdateType": { + "type": "string", + "description": "Gets or sets media update type.\r\nCreated, Modified, Deleted.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The media update info path." + }, + "MediaUrl": { + "type": "object", + "properties": { + "Url": { + "type": "string", + "nullable": true + }, + "Name": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "MessageCommand": { + "required": [ + "Text" + ], + "type": "object", + "properties": { + "Header": { + "type": "string", + "nullable": true + }, + "Text": { + "type": "string" + }, + "TimeoutMs": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + "additionalProperties": false + }, + "MetadataConfiguration": { + "type": "object", + "properties": { + "UseFileCreationTimeForDateAdded": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "MetadataEditorInfo": { + "type": "object", + "properties": { + "ParentalRatingOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParentalRating" + } + }, + "Countries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CountryInfo" + } + }, + "Cultures": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CultureDto" + } + }, + "ExternalIdInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalIdInfo" + } + }, + "ContentType": { + "type": "string", + "nullable": true + }, + "ContentTypeOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameValuePair" + } + } + }, + "additionalProperties": false + }, + "MetadataField": { + "enum": [ + "Cast", + "Genres", + "ProductionLocations", + "Studios", + "Tags", + "Name", + "Overview", + "Runtime", + "OfficialRating" + ], + "type": "string", + "description": "Enum MetadataFields." + }, + "MetadataOptions": { + "type": "object", + "properties": { + "ItemType": { + "type": "string", + "nullable": true + }, + "DisabledMetadataSavers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "LocalMetadataReaderOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DisabledMetadataFetchers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "MetadataFetcherOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DisabledImageFetchers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ImageFetcherOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class MetadataOptions." + }, + "MetadataRefreshMode": { + "enum": [ + "None", + "ValidationOnly", + "Default", + "FullRefresh" + ], + "type": "string" + }, + "MovePlaylistItemRequestDto": { + "type": "object", + "properties": { + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist identifier of the item.", + "format": "uuid" + }, + "NewIndex": { + "type": "integer", + "description": "Gets or sets the new position.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Class MovePlaylistItemRequestDto." + }, + "MovieInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "MovieInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/MovieInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "MusicVideoInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "Artists": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "MusicVideoInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/MusicVideoInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "NameGuidPair": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "Id": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "NameIdPair": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "nullable": true + } + }, + "additionalProperties": false + }, + "NameValuePair": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Value": { + "type": "string", + "description": "Gets or sets the value.", + "nullable": true + } + }, + "additionalProperties": false + }, + "NetworkConfiguration": { + "type": "object", + "properties": { + "RequireHttps": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the server should force connections over HTTPS." + }, + "CertificatePath": { + "type": "string", + "description": "Gets or sets the filesystem path of an X.509 certificate to use for SSL." + }, + "CertificatePassword": { + "type": "string", + "description": "Gets or sets the password required to access the X.509 certificate data in the file specified by Jellyfin.Networking.Configuration.NetworkConfiguration.CertificatePath." + }, + "BaseUrl": { + "type": "string", + "description": "Gets or sets a value used to specify the URL prefix that your Jellyfin instance can be accessed at." + }, + "PublicHttpsPort": { + "type": "integer", + "description": "Gets or sets the public HTTPS port.", + "format": "int32" + }, + "HttpServerPortNumber": { + "type": "integer", + "description": "Gets or sets the HTTP server port number.", + "format": "int32" + }, + "HttpsPortNumber": { + "type": "integer", + "description": "Gets or sets the HTTPS server port number.", + "format": "int32" + }, + "EnableHttps": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to use HTTPS." + }, + "PublicPort": { + "type": "integer", + "description": "Gets or sets the public mapped port.", + "format": "int32" + }, + "UPnPCreateHttpPortMap": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the http port should be mapped as part of UPnP automatic port forwarding." + }, + "UDPPortRange": { + "type": "string", + "description": "Gets or sets the UDPPortRange." + }, + "EnableIPV6": { + "type": "boolean", + "description": "Gets or sets a value indicating whether gets or sets IPV6 capability." + }, + "EnableIPV4": { + "type": "boolean", + "description": "Gets or sets a value indicating whether gets or sets IPV4 capability." + }, + "EnableSSDPTracing": { + "type": "boolean", + "description": "Gets or sets a value indicating whether detailed SSDP logs are sent to the console/log.\r\n\"Emby.Dlna\": \"Debug\" must be set in logging.default.json for this property to have any effect." + }, + "SSDPTracingFilter": { + "type": "string", + "description": "Gets or sets the SSDPTracingFilter\r\nGets or sets a value indicating whether an IP address is to be used to filter the detailed ssdp logs that are being sent to the console/log.\r\nIf the setting \"Emby.Dlna\": \"Debug\" msut be set in logging.default.json for this property to work." + }, + "UDPSendCount": { + "type": "integer", + "description": "Gets or sets the number of times SSDP UDP messages are sent.", + "format": "int32" + }, + "UDPSendDelay": { + "type": "integer", + "description": "Gets or sets the delay between each groups of SSDP messages (in ms).", + "format": "int32" + }, + "IgnoreVirtualInterfaces": { + "type": "boolean", + "description": "Gets or sets a value indicating whether address names that match Jellyfin.Networking.Configuration.NetworkConfiguration.VirtualInterfaceNames should be Ignore for the purposes of binding." + }, + "VirtualInterfaceNames": { + "type": "string", + "description": "Gets or sets a value indicating the interfaces that should be ignored. The list can be comma separated. ." + }, + "GatewayMonitorPeriod": { + "type": "integer", + "description": "Gets or sets the time (in seconds) between the pings of SSDP gateway monitor.", + "format": "int32" + }, + "EnableMultiSocketBinding": { + "type": "boolean", + "description": "Gets a value indicating whether multi-socket binding is available.", + "readOnly": true + }, + "TrustAllIP6Interfaces": { + "type": "boolean", + "description": "Gets or sets a value indicating whether all IPv6 interfaces should be treated as on the internal network.\r\nDepending on the address range implemented ULA ranges might not be used." + }, + "HDHomerunPortRange": { + "type": "string", + "description": "Gets or sets the ports that HDHomerun uses." + }, + "PublishedServerUriBySubnet": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the PublishedServerUriBySubnet\r\nGets or sets PublishedServerUri to advertise for specific subnets." + }, + "AutoDiscoveryTracing": { + "type": "boolean", + "description": "Gets or sets a value indicating whether Autodiscovery tracing is enabled." + }, + "AutoDiscovery": { + "type": "boolean", + "description": "Gets or sets a value indicating whether Autodiscovery is enabled." + }, + "RemoteIPFilter": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the filter for remote IP connectivity. Used in conjuntion with ." + }, + "IsRemoteIPFilterBlacklist": { + "type": "boolean", + "description": "Gets or sets a value indicating whether contains a blacklist or a whitelist. Default is a whitelist." + }, + "EnableUPnP": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable automatic port forwarding." + }, + "EnableRemoteAccess": { + "type": "boolean", + "description": "Gets or sets a value indicating whether access outside of the LAN is permitted." + }, + "LocalNetworkSubnets": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the subnets that are deemed to make up the LAN." + }, + "LocalNetworkAddresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the interface addresses which Jellyfin will bind to. If empty, all interfaces will be used." + }, + "KnownProxies": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the known proxies. If the proxy is a network, it's added to the KnownNetworks." + }, + "EnablePublishedServerUriByRequest": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the published server uri is based on information in HTTP requests." + } + }, + "additionalProperties": false, + "description": "Defines the Jellyfin.Networking.Configuration.NetworkConfiguration." + }, + "NewGroupRequestDto": { + "type": "object", + "properties": { + "GroupName": { + "type": "string", + "description": "Gets or sets the group name." + } + }, + "additionalProperties": false, + "description": "Class NewGroupRequestDto." + }, + "NextItemRequestDto": { + "type": "object", + "properties": { + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playing item identifier.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class NextItemRequestDto." + }, + "NotificationDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the notification ID. Defaults to an empty string." + }, + "UserId": { + "type": "string", + "description": "Gets or sets the notification's user ID. Defaults to an empty string." + }, + "Date": { + "type": "string", + "description": "Gets or sets the notification date.", + "format": "date-time" + }, + "IsRead": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the notification has been read. Defaults to false." + }, + "Name": { + "type": "string", + "description": "Gets or sets the notification's name. Defaults to an empty string." + }, + "Description": { + "type": "string", + "description": "Gets or sets the notification's description. Defaults to an empty string." + }, + "Url": { + "type": "string", + "description": "Gets or sets the notification's URL. Defaults to an empty string." + }, + "Level": { + "allOf": [ + { + "$ref": "#/components/schemas/NotificationLevel" + } + ], + "description": "Gets or sets the notification level." + } + }, + "additionalProperties": false, + "description": "The notification DTO." + }, + "NotificationLevel": { + "enum": [ + "Normal", + "Warning", + "Error" + ], + "type": "string" + }, + "NotificationOption": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": true + }, + "DisabledMonitorUsers": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets user Ids to not monitor (it's opt out)." + }, + "SendToUsers": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets user Ids to send to (if SendToUserMode == Custom)." + }, + "Enabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Notifications.NotificationOption is enabled." + }, + "DisabledServices": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the disabled services." + }, + "SendToUserMode": { + "allOf": [ + { + "$ref": "#/components/schemas/SendToUserType" + } + ], + "description": "Gets or sets the send to user mode." + } + }, + "additionalProperties": false + }, + "NotificationOptions": { + "type": "object", + "properties": { + "Options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationOption" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "NotificationResultDto": { + "type": "object", + "properties": { + "Notifications": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationDto" + }, + "description": "Gets or sets the current page of notifications." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of notifications.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "A list of notifications with the total record count for pagination." + }, + "NotificationsSummaryDto": { + "type": "object", + "properties": { + "UnreadCount": { + "type": "integer", + "description": "Gets or sets the number of unread notifications.", + "format": "int32" + }, + "MaxUnreadNotificationLevel": { + "allOf": [ + { + "$ref": "#/components/schemas/NotificationLevel" + } + ], + "description": "Gets or sets the maximum unread notification level.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The notification summary DTO." + }, + "NotificationTypeInfo": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": true + }, + "Name": { + "type": "string", + "nullable": true + }, + "Enabled": { + "type": "boolean" + }, + "Category": { + "type": "string", + "nullable": true + }, + "IsBasedOnUserEvent": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "ObjectGroupUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid" + }, + "Type": { + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Gets the update type." + }, + "Data": { + "description": "Gets the update data." + } + }, + "additionalProperties": false, + "description": "Class GroupUpdate." + }, + "OpenLiveStreamDto": { + "type": "object", + "properties": { + "OpenToken": { + "type": "string", + "description": "Gets or sets the open token.", + "nullable": true + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid", + "nullable": true + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session id.", + "nullable": true + }, + "MaxStreamingBitrate": { + "type": "integer", + "description": "Gets or sets the max streaming bitrate.", + "format": "int32", + "nullable": true + }, + "StartTimeTicks": { + "type": "integer", + "description": "Gets or sets the start time in ticks.", + "format": "int64", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the audio stream index.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the subtitle stream index.", + "format": "int32", + "nullable": true + }, + "MaxAudioChannels": { + "type": "integer", + "description": "Gets or sets the max audio channels.", + "format": "int32", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item id.", + "format": "uuid", + "nullable": true + }, + "EnableDirectPlay": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable direct play.", + "nullable": true + }, + "EnableDirectStream": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enale direct stream.", + "nullable": true + }, + "DeviceProfile": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't.", + "nullable": true + }, + "DirectPlayProtocols": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaProtocol" + }, + "description": "Gets or sets the device play protocols." + } + }, + "additionalProperties": false, + "description": "Open live stream dto." + }, + "PackageInfo": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Gets or sets the name." + }, + "description": { + "type": "string", + "description": "Gets or sets a long description of the plugin containing features or helpful explanations." + }, + "overview": { + "type": "string", + "description": "Gets or sets a short overview of what the plugin does." + }, + "owner": { + "type": "string", + "description": "Gets or sets the owner." + }, + "category": { + "type": "string", + "description": "Gets or sets the category." + }, + "guid": { + "type": "string", + "description": "Gets or sets the guid of the assembly associated with this plugin.\r\nThis is used to identify the proper item for automatic updates.", + "format": "uuid" + }, + "versions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VersionInfo" + }, + "description": "Gets or sets the versions." + }, + "imageUrl": { + "type": "string", + "description": "Gets or sets the image url for the package.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PackageInfo." + }, + "ParentalRating": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Value": { + "type": "integer", + "description": "Gets or sets the value.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Class ParentalRating." + }, + "PathSubstitution": { + "type": "object", + "properties": { + "From": { + "type": "string", + "description": "Gets or sets the value to substitute." + }, + "To": { + "type": "string", + "description": "Gets or sets the value to substitution with." + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Configuration.PathSubstitution." + }, + "PersonLookupInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "PersonLookupInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/PersonLookupInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "PingRequestDto": { + "type": "object", + "properties": { + "Ping": { + "type": "integer", + "description": "Gets or sets the ping time.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Class PingRequestDto." + }, + "PinRedeemResult": { + "type": "object", + "properties": { + "Success": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Users.PinRedeemResult is success." + }, + "UsersReset": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the users reset." + } + }, + "additionalProperties": false + }, + "PlayAccess": { + "enum": [ + "Full", + "None" + ], + "type": "string" + }, + "PlaybackErrorCode": { + "enum": [ + "NotAllowed", + "NoCompatibleStream", + "RateLimitExceeded" + ], + "type": "string" + }, + "PlaybackInfoDto": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "description": "Gets or sets the playback userId.", + "format": "uuid", + "nullable": true + }, + "MaxStreamingBitrate": { + "type": "integer", + "description": "Gets or sets the max streaming bitrate.", + "format": "int32", + "nullable": true + }, + "StartTimeTicks": { + "type": "integer", + "description": "Gets or sets the start time in ticks.", + "format": "int64", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the audio stream index.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the subtitle stream index.", + "format": "int32", + "nullable": true + }, + "MaxAudioChannels": { + "type": "integer", + "description": "Gets or sets the max audio channels.", + "format": "int32", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the media source id.", + "nullable": true + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the live stream id.", + "nullable": true + }, + "DeviceProfile": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't.", + "nullable": true + }, + "EnableDirectPlay": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable direct play.", + "nullable": true + }, + "EnableDirectStream": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable direct stream.", + "nullable": true + }, + "EnableTranscoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable transcoding.", + "nullable": true + }, + "AllowVideoStreamCopy": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable video stream copy.", + "nullable": true + }, + "AllowAudioStreamCopy": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to allow audio stream copy.", + "nullable": true + }, + "AutoOpenLiveStream": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to auto open the live stream.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Plabyback info dto." + }, + "PlaybackInfoResponse": { + "type": "object", + "properties": { + "MediaSources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaSourceInfo" + }, + "description": "Gets or sets the media sources." + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session identifier.", + "nullable": true + }, + "ErrorCode": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackErrorCode" + } + ], + "description": "Gets or sets the error code.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlaybackInfoResponse." + }, + "PlaybackProgressInfo": { + "type": "object", + "properties": { + "CanSeek": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can seek." + }, + "Item": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the item.", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "format": "uuid" + }, + "SessionId": { + "type": "string", + "description": "Gets or sets the session id.", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the media version identifier.", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the audio stream.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the subtitle stream.", + "format": "int32", + "nullable": true + }, + "IsPaused": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is paused." + }, + "IsMuted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is muted." + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64", + "nullable": true + }, + "PlaybackStartTimeTicks": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "VolumeLevel": { + "type": "integer", + "description": "Gets or sets the volume level.", + "format": "int32", + "nullable": true + }, + "Brightness": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AspectRatio": { + "type": "string", + "nullable": true + }, + "PlayMethod": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ], + "description": "Gets or sets the play method." + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the live stream identifier.", + "nullable": true + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session identifier.", + "nullable": true + }, + "RepeatMode": { + "allOf": [ + { + "$ref": "#/components/schemas/RepeatMode" + } + ], + "description": "Gets or sets the repeat mode." + }, + "NowPlayingQueue": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueItem" + }, + "nullable": true + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlaybackProgressInfo." + }, + "PlaybackStartInfo": { + "type": "object", + "properties": { + "CanSeek": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can seek." + }, + "Item": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the item.", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "format": "uuid" + }, + "SessionId": { + "type": "string", + "description": "Gets or sets the session id.", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the media version identifier.", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the audio stream.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the subtitle stream.", + "format": "int32", + "nullable": true + }, + "IsPaused": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is paused." + }, + "IsMuted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is muted." + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64", + "nullable": true + }, + "PlaybackStartTimeTicks": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "VolumeLevel": { + "type": "integer", + "description": "Gets or sets the volume level.", + "format": "int32", + "nullable": true + }, + "Brightness": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AspectRatio": { + "type": "string", + "nullable": true + }, + "PlayMethod": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ], + "description": "Gets or sets the play method." + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the live stream identifier.", + "nullable": true + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session identifier.", + "nullable": true + }, + "RepeatMode": { + "allOf": [ + { + "$ref": "#/components/schemas/RepeatMode" + } + ], + "description": "Gets or sets the repeat mode." + }, + "NowPlayingQueue": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueItem" + }, + "nullable": true + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlaybackStartInfo." + }, + "PlaybackStopInfo": { + "type": "object", + "properties": { + "Item": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the item.", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "format": "uuid" + }, + "SessionId": { + "type": "string", + "description": "Gets or sets the session id.", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the media version identifier.", + "nullable": true + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64", + "nullable": true + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the live stream identifier.", + "nullable": true + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session identifier.", + "nullable": true + }, + "Failed": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Session.PlaybackStopInfo is failed." + }, + "NextMediaType": { + "type": "string", + "nullable": true + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + }, + "NowPlayingQueue": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueItem" + }, + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlaybackStopInfo." + }, + "PlayCommand": { + "enum": [ + "PlayNow", + "PlayNext", + "PlayLast", + "PlayInstantMix", + "PlayShuffle" + ], + "type": "string", + "description": "Enum PlayCommand." + }, + "PlayerStateInfo": { + "type": "object", + "properties": { + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the now playing position ticks.", + "format": "int64", + "nullable": true + }, + "CanSeek": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can seek." + }, + "IsPaused": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is paused." + }, + "IsMuted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is muted." + }, + "VolumeLevel": { + "type": "integer", + "description": "Gets or sets the volume level.", + "format": "int32", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the now playing audio stream.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the now playing subtitle stream.", + "format": "int32", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the now playing media version identifier.", + "nullable": true + }, + "PlayMethod": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ], + "description": "Gets or sets the play method.", + "nullable": true + }, + "RepeatMode": { + "allOf": [ + { + "$ref": "#/components/schemas/RepeatMode" + } + ], + "description": "Gets or sets the repeat mode." + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the now playing live stream identifier.", + "nullable": true + } + }, + "additionalProperties": false + }, + "PlaylistCreationResult": { + "type": "object", + "properties": { + "Id": { + "type": "string" + } + }, + "additionalProperties": false + }, + "PlayMethod": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "type": "string" + }, + "PlayRequest": { + "type": "object", + "properties": { + "ItemIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the item ids.", + "nullable": true + }, + "StartPositionTicks": { + "type": "integer", + "description": "Gets or sets the start position ticks that the first item should be played at.", + "format": "int64", + "nullable": true + }, + "PlayCommand": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayCommand" + } + ], + "description": "Gets or sets the play command." + }, + "ControllingUserId": { + "type": "string", + "description": "Gets or sets the controlling user identifier.", + "format": "uuid" + }, + "SubtitleStreamIndex": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "nullable": true + }, + "StartIndex": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlayRequest." + }, + "PlayRequestDto": { + "type": "object", + "properties": { + "PlayingQueue": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the playing queue." + }, + "PlayingItemPosition": { + "type": "integer", + "description": "Gets or sets the position of the playing item in the queue.", + "format": "int32" + }, + "StartPositionTicks": { + "type": "integer", + "description": "Gets or sets the start position ticks.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Class PlayRequestDto." + }, + "PlaystateCommand": { + "enum": [ + "Stop", + "Pause", + "Unpause", + "NextTrack", + "PreviousTrack", + "Seek", + "Rewind", + "FastForward", + "PlayPause" + ], + "type": "string", + "description": "Enum PlaystateCommand." + }, + "PlaystateRequest": { + "type": "object", + "properties": { + "Command": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaystateCommand" + } + ], + "description": "Enum PlaystateCommand." + }, + "SeekPositionTicks": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "ControllingUserId": { + "type": "string", + "description": "Gets or sets the controlling user identifier.", + "nullable": true + } + }, + "additionalProperties": false + }, + "PluginInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "Version": { + "type": "string", + "description": "Gets or sets the version." + }, + "ConfigurationFileName": { + "type": "string", + "description": "Gets or sets the name of the configuration file.", + "nullable": true + }, + "Description": { + "type": "string", + "description": "Gets or sets the description." + }, + "Id": { + "type": "string", + "description": "Gets or sets the unique id.", + "format": "uuid" + }, + "CanUninstall": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the plugin can be uninstalled." + }, + "HasImage": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this plugin has a valid image." + }, + "Status": { + "allOf": [ + { + "$ref": "#/components/schemas/PluginStatus" + } + ], + "description": "Gets or sets a value indicating the status of the plugin." + } + }, + "additionalProperties": false, + "description": "This is a serializable stub class that is used by the api to provide information about installed plugins." + }, + "PluginStatus": { + "enum": [ + "Active", + "Restart", + "Deleted", + "Superceded", + "Malfunctioned", + "NotSupported", + "Disabled" + ], + "type": "string", + "description": "Plugin load status." + }, + "PreviousItemRequestDto": { + "type": "object", + "properties": { + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playing item identifier.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class PreviousItemRequestDto." + }, + "ProblemDetails": { + "type": "object", + "properties": { + "type": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "status": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "detail": { + "type": "string", + "nullable": true + }, + "instance": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": { } + }, + "ProfileCondition": { + "type": "object", + "properties": { + "Condition": { + "allOf": [ + { + "$ref": "#/components/schemas/ProfileConditionType" + } + ] + }, + "Property": { + "allOf": [ + { + "$ref": "#/components/schemas/ProfileConditionValue" + } + ] + }, + "Value": { + "type": "string", + "nullable": true + }, + "IsRequired": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "ProfileConditionType": { + "enum": [ + "Equals", + "NotEquals", + "LessThanEqual", + "GreaterThanEqual", + "EqualsAny" + ], + "type": "string" + }, + "ProfileConditionValue": { + "enum": [ + "AudioChannels", + "AudioBitrate", + "AudioProfile", + "Width", + "Height", + "Has64BitOffsets", + "PacketLength", + "VideoBitDepth", + "VideoBitrate", + "VideoFramerate", + "VideoLevel", + "VideoProfile", + "VideoTimestamp", + "IsAnamorphic", + "RefFrames", + "NumAudioStreams", + "NumVideoStreams", + "IsSecondaryAudio", + "VideoCodecTag", + "IsAvc", + "IsInterlaced", + "AudioSampleRate", + "AudioBitDepth", + "VideoRangeType" + ], + "type": "string" + }, + "ProgramAudio": { + "enum": [ + "Mono", + "Stereo", + "Dolby", + "DolbyDigital", + "Thx", + "Atmos" + ], + "type": "string" + }, + "PublicSystemInfo": { + "type": "object", + "properties": { + "LocalAddress": { + "type": "string", + "description": "Gets or sets the local address.", + "nullable": true + }, + "ServerName": { + "type": "string", + "description": "Gets or sets the name of the server.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the server version.", + "nullable": true + }, + "ProductName": { + "type": "string", + "description": "Gets or sets the product name. This is the AssemblyProduct name.", + "nullable": true + }, + "OperatingSystem": { + "type": "string", + "description": "Gets or sets the operating system.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "StartupWizardCompleted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the startup wizard is completed.", + "nullable": true + } + }, + "additionalProperties": false + }, + "QueryFilters": { + "type": "object", + "properties": { + "Genres": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "nullable": true + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "QueryFiltersLegacy": { + "type": "object", + "properties": { + "Genres": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "OfficialRatings": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Years": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "QueueItem": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "format": "uuid" + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "QueueRequestDto": { + "type": "object", + "properties": { + "ItemIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the items to enqueue." + }, + "Mode": { + "allOf": [ + { + "$ref": "#/components/schemas/GroupQueueMode" + } + ], + "description": "Enum GroupQueueMode." + } + }, + "additionalProperties": false, + "description": "Class QueueRequestDto." + }, + "QuickConnectDto": { + "required": [ + "Secret" + ], + "type": "object", + "properties": { + "Secret": { + "type": "string", + "description": "Gets or sets the quick connect secret." + } + }, + "additionalProperties": false, + "description": "The quick connect request body." + }, + "QuickConnectResult": { + "type": "object", + "properties": { + "Authenticated": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this request is authorized." + }, + "Secret": { + "type": "string", + "description": "Gets the secret value used to uniquely identify this request. Can be used to retrieve authentication information." + }, + "Code": { + "type": "string", + "description": "Gets the user facing code used so the user can quickly differentiate this request from others." + }, + "DeviceId": { + "type": "string", + "description": "Gets the requesting device id." + }, + "DeviceName": { + "type": "string", + "description": "Gets the requesting device name." + }, + "AppName": { + "type": "string", + "description": "Gets the requesting app name." + }, + "AppVersion": { + "type": "string", + "description": "Gets the requesting app version." + }, + "DateAdded": { + "type": "string", + "description": "Gets or sets the DateTime that this request was created.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Stores the state of an quick connect request." + }, + "RatingType": { + "enum": [ + "Score", + "Likes" + ], + "type": "string" + }, + "ReadyRequestDto": { + "type": "object", + "properties": { + "When": { + "type": "string", + "description": "Gets or sets when the request has been made by the client.", + "format": "date-time" + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64" + }, + "IsPlaying": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the client playback is unpaused." + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist item identifier of the playing item.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class ReadyRequest." + }, + "RecommendationDto": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + }, + "nullable": true + }, + "RecommendationType": { + "allOf": [ + { + "$ref": "#/components/schemas/RecommendationType" + } + ] + }, + "BaselineItemName": { + "type": "string", + "nullable": true + }, + "CategoryId": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "RecommendationType": { + "enum": [ + "SimilarToRecentlyPlayed", + "SimilarToLikedItem", + "HasDirectorFromRecentlyPlayed", + "HasActorFromRecentlyPlayed", + "HasLikedDirector", + "HasLikedActor" + ], + "type": "string" + }, + "RecordingStatus": { + "enum": [ + "New", + "InProgress", + "Completed", + "Cancelled", + "ConflictedOk", + "ConflictedNotOk", + "Error" + ], + "type": "string" + }, + "RemoteImageInfo": { + "type": "object", + "properties": { + "ProviderName": { + "type": "string", + "description": "Gets or sets the name of the provider.", + "nullable": true + }, + "Url": { + "type": "string", + "description": "Gets or sets the URL.", + "nullable": true + }, + "ThumbnailUrl": { + "type": "string", + "description": "Gets or sets a url used for previewing a smaller version.", + "nullable": true + }, + "Height": { + "type": "integer", + "description": "Gets or sets the height.", + "format": "int32", + "nullable": true + }, + "Width": { + "type": "integer", + "description": "Gets or sets the width.", + "format": "int32", + "nullable": true + }, + "CommunityRating": { + "type": "number", + "description": "Gets or sets the community rating.", + "format": "double", + "nullable": true + }, + "VoteCount": { + "type": "integer", + "description": "Gets or sets the vote count.", + "format": "int32", + "nullable": true + }, + "Language": { + "type": "string", + "description": "Gets or sets the language.", + "nullable": true + }, + "Type": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Gets or sets the type." + }, + "RatingType": { + "allOf": [ + { + "$ref": "#/components/schemas/RatingType" + } + ], + "description": "Gets or sets the type of the rating." + } + }, + "additionalProperties": false, + "description": "Class RemoteImageInfo." + }, + "RemoteImageResult": { + "type": "object", + "properties": { + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteImageInfo" + }, + "description": "Gets or sets the images.", + "nullable": true + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total record count.", + "format": "int32" + }, + "Providers": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the providers.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class RemoteImageResult." + }, + "RemoteSearchResult": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "ProductionYear": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "IndexNumberEnd": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "ImageUrl": { + "type": "string", + "nullable": true + }, + "SearchProviderName": { + "type": "string", + "nullable": true + }, + "Overview": { + "type": "string", + "nullable": true + }, + "AlbumArtist": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoteSearchResult" + } + ], + "nullable": true + }, + "Artists": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "RemoteSubtitleInfo": { + "type": "object", + "properties": { + "ThreeLetterISOLanguageName": { + "type": "string", + "nullable": true + }, + "Id": { + "type": "string", + "nullable": true + }, + "ProviderName": { + "type": "string", + "nullable": true + }, + "Name": { + "type": "string", + "nullable": true + }, + "Format": { + "type": "string", + "nullable": true + }, + "Author": { + "type": "string", + "nullable": true + }, + "Comment": { + "type": "string", + "nullable": true + }, + "DateCreated": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "CommunityRating": { + "type": "number", + "format": "float", + "nullable": true + }, + "DownloadCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "IsHashMatch": { + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": false + }, + "RemoveFromPlaylistRequestDto": { + "type": "object", + "properties": { + "PlaylistItemIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the playlist identifiers ot the items. Ignored when clearing the playlist." + }, + "ClearPlaylist": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the entire playlist should be cleared." + }, + "ClearPlayingItem": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the playing item should be removed as well. Used only when clearing the playlist." + } + }, + "additionalProperties": false, + "description": "Class RemoveFromPlaylistRequestDto." + }, + "RepeatMode": { + "enum": [ + "RepeatNone", + "RepeatAll", + "RepeatOne" + ], + "type": "string" + }, + "RepositoryInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Url": { + "type": "string", + "description": "Gets or sets the URL.", + "nullable": true + }, + "Enabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the repository is enabled." + } + }, + "additionalProperties": false, + "description": "Class RepositoryInfo." + }, + "ResponseProfile": { + "type": "object", + "properties": { + "Container": { + "type": "string", + "nullable": true + }, + "AudioCodec": { + "type": "string", + "nullable": true + }, + "VideoCodec": { + "type": "string", + "nullable": true + }, + "Type": { + "allOf": [ + { + "$ref": "#/components/schemas/DlnaProfileType" + } + ] + }, + "OrgPn": { + "type": "string", + "nullable": true + }, + "MimeType": { + "type": "string", + "nullable": true + }, + "Conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "ScrollDirection": { + "enum": [ + "Horizontal", + "Vertical" + ], + "type": "string", + "description": "An enum representing the axis that should be scrolled." + }, + "SearchHint": { + "type": "object", + "properties": { + "ItemId": { + "type": "string", + "description": "Gets or sets the item id.", + "format": "uuid" + }, + "Id": { + "type": "string", + "format": "uuid" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "MatchedTerm": { + "type": "string", + "description": "Gets or sets the matched term.", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "description": "Gets or sets the index number.", + "format": "int32", + "nullable": true + }, + "ProductionYear": { + "type": "integer", + "description": "Gets or sets the production year.", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "description": "Gets or sets the parent index number.", + "format": "int32", + "nullable": true + }, + "PrimaryImageTag": { + "type": "string", + "description": "Gets or sets the image tag.", + "nullable": true + }, + "ThumbImageTag": { + "type": "string", + "description": "Gets or sets the thumb image tag.", + "nullable": true + }, + "ThumbImageItemId": { + "type": "string", + "description": "Gets or sets the thumb image item identifier.", + "nullable": true + }, + "BackdropImageTag": { + "type": "string", + "description": "Gets or sets the backdrop image tag.", + "nullable": true + }, + "BackdropImageItemId": { + "type": "string", + "description": "Gets or sets the backdrop image item identifier.", + "nullable": true + }, + "Type": { + "type": "string", + "description": "Gets or sets the type.", + "nullable": true + }, + "IsFolder": { + "type": "boolean", + "nullable": true + }, + "RunTimeTicks": { + "type": "integer", + "description": "Gets or sets the run time ticks.", + "format": "int64", + "nullable": true + }, + "MediaType": { + "type": "string", + "description": "Gets or sets the type of the media.", + "nullable": true + }, + "StartDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "EndDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "Series": { + "type": "string", + "description": "Gets or sets the series.", + "nullable": true + }, + "Status": { + "type": "string", + "nullable": true + }, + "Album": { + "type": "string", + "description": "Gets or sets the album.", + "nullable": true + }, + "AlbumId": { + "type": "string", + "format": "uuid" + }, + "AlbumArtist": { + "type": "string", + "description": "Gets or sets the album artist.", + "nullable": true + }, + "Artists": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the artists.", + "nullable": true + }, + "SongCount": { + "type": "integer", + "description": "Gets or sets the song count.", + "format": "int32", + "nullable": true + }, + "EpisodeCount": { + "type": "integer", + "description": "Gets or sets the episode count.", + "format": "int32", + "nullable": true + }, + "ChannelId": { + "type": "string", + "description": "Gets or sets the channel identifier.", + "format": "uuid" + }, + "ChannelName": { + "type": "string", + "description": "Gets or sets the name of the channel.", + "nullable": true + }, + "PrimaryImageAspectRatio": { + "type": "number", + "description": "Gets or sets the primary image aspect ratio.", + "format": "double", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class SearchHintResult." + }, + "SearchHintResult": { + "type": "object", + "properties": { + "SearchHints": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SearchHint" + }, + "description": "Gets the search hints." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets the total record count.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Class SearchHintResult." + }, + "SeekRequestDto": { + "type": "object", + "properties": { + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Class SeekRequestDto." + }, + "SendCommand": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid" + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets the playlist identifier of the playing item.", + "format": "uuid" + }, + "When": { + "type": "string", + "description": "Gets or sets the UTC time when to execute the command.", + "format": "date-time" + }, + "PositionTicks": { + "type": "integer", + "description": "Gets the position ticks.", + "format": "int64", + "nullable": true + }, + "Command": { + "allOf": [ + { + "$ref": "#/components/schemas/SendCommandType" + } + ], + "description": "Gets the command." + }, + "EmittedAt": { + "type": "string", + "description": "Gets the UTC time when this command has been emitted.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Class SendCommand." + }, + "SendCommandType": { + "enum": [ + "Unpause", + "Pause", + "Stop", + "Seek" + ], + "type": "string", + "description": "Enum SendCommandType." + }, + "SendToUserType": { + "enum": [ + "All", + "Admins", + "Custom" + ], + "type": "string" + }, + "SeriesInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "SeriesInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "SeriesStatus": { + "enum": [ + "Continuing", + "Ended" + ], + "type": "string", + "description": "Enum SeriesStatus." + }, + "SeriesTimerInfoDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the Id of the recording.", + "nullable": true + }, + "Type": { + "type": "string", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server identifier.", + "nullable": true + }, + "ExternalId": { + "type": "string", + "description": "Gets or sets the external identifier.", + "nullable": true + }, + "ChannelId": { + "type": "string", + "description": "Gets or sets the channel id of the recording.", + "format": "uuid" + }, + "ExternalChannelId": { + "type": "string", + "description": "Gets or sets the external channel identifier.", + "nullable": true + }, + "ChannelName": { + "type": "string", + "description": "Gets or sets the channel name of the recording.", + "nullable": true + }, + "ChannelPrimaryImageTag": { + "type": "string", + "nullable": true + }, + "ProgramId": { + "type": "string", + "description": "Gets or sets the program identifier.", + "nullable": true + }, + "ExternalProgramId": { + "type": "string", + "description": "Gets or sets the external program identifier.", + "nullable": true + }, + "Name": { + "type": "string", + "description": "Gets or sets the name of the recording.", + "nullable": true + }, + "Overview": { + "type": "string", + "description": "Gets or sets the description of the recording.", + "nullable": true + }, + "StartDate": { + "type": "string", + "description": "Gets or sets the start date of the recording, in UTC.", + "format": "date-time" + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date of the recording, in UTC.", + "format": "date-time" + }, + "ServiceName": { + "type": "string", + "description": "Gets or sets the name of the service.", + "nullable": true + }, + "Priority": { + "type": "integer", + "description": "Gets or sets the priority.", + "format": "int32" + }, + "PrePaddingSeconds": { + "type": "integer", + "description": "Gets or sets the pre padding seconds.", + "format": "int32" + }, + "PostPaddingSeconds": { + "type": "integer", + "description": "Gets or sets the post padding seconds.", + "format": "int32" + }, + "IsPrePaddingRequired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is pre padding required." + }, + "ParentBackdropItemId": { + "type": "string", + "description": "Gets or sets the Id of the Parent that has a backdrop if the item does not have one.", + "nullable": true + }, + "ParentBackdropImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the parent backdrop image tags.", + "nullable": true + }, + "IsPostPaddingRequired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is post padding required." + }, + "KeepUntil": { + "allOf": [ + { + "$ref": "#/components/schemas/KeepUntil" + } + ] + }, + "RecordAnyTime": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [record any time]." + }, + "SkipEpisodesInLibrary": { + "type": "boolean" + }, + "RecordAnyChannel": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [record any channel]." + }, + "KeepUpTo": { + "type": "integer", + "format": "int32" + }, + "RecordNewOnly": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [record new only]." + }, + "Days": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DayOfWeek" + }, + "description": "Gets or sets the days.", + "nullable": true + }, + "DayPattern": { + "allOf": [ + { + "$ref": "#/components/schemas/DayPattern" + } + ], + "description": "Gets or sets the day pattern.", + "nullable": true + }, + "ImageTags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Gets or sets the image tags.", + "nullable": true + }, + "ParentThumbItemId": { + "type": "string", + "description": "Gets or sets the parent thumb item id.", + "nullable": true + }, + "ParentThumbImageTag": { + "type": "string", + "description": "Gets or sets the parent thumb image tag.", + "nullable": true + }, + "ParentPrimaryImageItemId": { + "type": "string", + "description": "Gets or sets the parent primary image item identifier.", + "nullable": true + }, + "ParentPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the parent primary image tag.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class SeriesTimerInfoDto." + }, + "SeriesTimerInfoDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + }, + "description": "Gets or sets the items.", + "nullable": true + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false + }, + "ServerConfiguration": { + "type": "object", + "properties": { + "LogFileRetentionDays": { + "type": "integer", + "description": "Gets or sets the number of days we should retain log files.", + "format": "int32" + }, + "IsStartupWizardCompleted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is first run." + }, + "CachePath": { + "type": "string", + "description": "Gets or sets the cache path.", + "nullable": true + }, + "PreviousVersion": { + "type": "string", + "description": "Gets or sets the last known version that was ran using the configuration.", + "nullable": true + }, + "PreviousVersionStr": { + "type": "string", + "description": "Gets or sets the stringified PreviousVersion to be stored/loaded,\r\nbecause System.Version itself isn't xml-serializable.", + "nullable": true + }, + "EnableMetrics": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable prometheus metrics exporting." + }, + "EnableNormalizedItemByNameIds": { + "type": "boolean" + }, + "IsPortAuthorized": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is port authorized." + }, + "QuickConnectAvailable": { + "type": "boolean", + "description": "Gets or sets a value indicating whether quick connect is available for use on this server." + }, + "EnableCaseSensitiveItemIds": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [enable case sensitive item ids]." + }, + "DisableLiveTvChannelUserDataName": { + "type": "boolean" + }, + "MetadataPath": { + "type": "string", + "description": "Gets or sets the metadata path." + }, + "MetadataNetworkPath": { + "type": "string" + }, + "PreferredMetadataLanguage": { + "type": "string", + "description": "Gets or sets the preferred metadata language." + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code." + }, + "SortReplaceCharacters": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets characters to be replaced with a ' ' in strings to create a sort name." + }, + "SortRemoveCharacters": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets characters to be removed from strings to create a sort name." + }, + "SortRemoveWords": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets words to be removed from strings to create a sort name." + }, + "MinResumePct": { + "type": "integer", + "description": "Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated.", + "format": "int32" + }, + "MaxResumePct": { + "type": "integer", + "description": "Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched.", + "format": "int32" + }, + "MinResumeDurationSeconds": { + "type": "integer", + "description": "Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates..", + "format": "int32" + }, + "MinAudiobookResume": { + "type": "integer", + "description": "Gets or sets the minimum minutes of a book that must be played in order for playstate to be updated.", + "format": "int32" + }, + "MaxAudiobookResume": { + "type": "integer", + "description": "Gets or sets the remaining minutes of a book that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched.", + "format": "int32" + }, + "LibraryMonitorDelay": { + "type": "integer", + "description": "Gets or sets the delay in seconds that we will wait after a file system change to try and discover what has been added/removed\r\nSome delay is necessary with some items because their creation is not atomic. It involves the creation of several\r\ndifferent directories and files.", + "format": "int32" + }, + "ImageSavingConvention": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageSavingConvention" + } + ], + "description": "Gets or sets the image saving convention." + }, + "MetadataOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetadataOptions" + } + }, + "SkipDeserializationForBasicTypes": { + "type": "boolean" + }, + "ServerName": { + "type": "string" + }, + "UICulture": { + "type": "string" + }, + "SaveMetadataHidden": { + "type": "boolean" + }, + "ContentTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameValuePair" + } + }, + "RemoteClientBitrateLimit": { + "type": "integer", + "format": "int32" + }, + "EnableFolderView": { + "type": "boolean" + }, + "EnableGroupingIntoCollections": { + "type": "boolean" + }, + "DisplaySpecialsWithinSeasons": { + "type": "boolean" + }, + "CodecsUsed": { + "type": "array", + "items": { + "type": "string" + } + }, + "PluginRepositories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + }, + "EnableExternalContentInSuggestions": { + "type": "boolean" + }, + "ImageExtractionTimeoutMs": { + "type": "integer", + "format": "int32" + }, + "PathSubstitutions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PathSubstitution" + } + }, + "EnableSlowResponseWarning": { + "type": "boolean", + "description": "Gets or sets a value indicating whether slow server responses should be logged as a warning." + }, + "SlowResponseThresholdMs": { + "type": "integer", + "description": "Gets or sets the threshold for the slow response time warning in ms.", + "format": "int64" + }, + "CorsHosts": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the cors hosts." + }, + "ActivityLogRetentionDays": { + "type": "integer", + "description": "Gets or sets the number of days we should retain activity logs.", + "format": "int32", + "nullable": true + }, + "LibraryScanFanoutConcurrency": { + "type": "integer", + "description": "Gets or sets the how the library scan fans out.", + "format": "int32" + }, + "LibraryMetadataRefreshConcurrency": { + "type": "integer", + "description": "Gets or sets the how many metadata refreshes can run concurrently.", + "format": "int32" + }, + "RemoveOldPlugins": { + "type": "boolean", + "description": "Gets or sets a value indicating whether older plugins should automatically be deleted from the plugin folder." + }, + "AllowClientLogUpload": { + "type": "boolean", + "description": "Gets or sets a value indicating whether clients should be allowed to upload logs." + } + }, + "additionalProperties": false, + "description": "Represents the server configuration." + }, + "ServerDiscoveryInfo": { + "type": "object", + "properties": { + "Address": { + "type": "string", + "description": "Gets the address." + }, + "Id": { + "type": "string", + "description": "Gets the server identifier." + }, + "Name": { + "type": "string", + "description": "Gets the name." + }, + "EndpointAddress": { + "type": "string", + "description": "Gets the endpoint address.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The server discovery info model." + }, + "SessionInfo": { + "type": "object", + "properties": { + "PlayState": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayerStateInfo" + } + ], + "nullable": true + }, + "AdditionalUsers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionUserInfo" + }, + "nullable": true + }, + "Capabilities": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilities" + } + ], + "nullable": true + }, + "RemoteEndPoint": { + "type": "string", + "description": "Gets or sets the remote end point.", + "nullable": true + }, + "PlayableMediaTypes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets the playable media types.", + "nullable": true, + "readOnly": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid" + }, + "UserName": { + "type": "string", + "description": "Gets or sets the username.", + "nullable": true + }, + "Client": { + "type": "string", + "description": "Gets or sets the type of the client.", + "nullable": true + }, + "LastActivityDate": { + "type": "string", + "description": "Gets or sets the last activity date.", + "format": "date-time" + }, + "LastPlaybackCheckIn": { + "type": "string", + "description": "Gets or sets the last playback check in.", + "format": "date-time" + }, + "DeviceName": { + "type": "string", + "description": "Gets or sets the name of the device.", + "nullable": true + }, + "DeviceType": { + "type": "string", + "description": "Gets or sets the type of the device.", + "nullable": true + }, + "NowPlayingItem": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the now playing item.", + "nullable": true + }, + "FullNowPlayingItem": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItem" + } + ], + "description": "Class BaseItem.", + "nullable": true + }, + "NowViewingItem": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client.", + "nullable": true + }, + "DeviceId": { + "type": "string", + "description": "Gets or sets the device id.", + "nullable": true + }, + "ApplicationVersion": { + "type": "string", + "description": "Gets or sets the application version.", + "nullable": true + }, + "TranscodingInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/TranscodingInfo" + } + ], + "nullable": true + }, + "IsActive": { + "type": "boolean", + "description": "Gets a value indicating whether this instance is active.", + "readOnly": true + }, + "SupportsMediaControl": { + "type": "boolean", + "readOnly": true + }, + "SupportsRemoteControl": { + "type": "boolean", + "readOnly": true + }, + "NowPlayingQueue": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueItem" + }, + "nullable": true + }, + "NowPlayingQueueFullItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + }, + "nullable": true + }, + "HasCustomDeviceName": { + "type": "boolean" + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + }, + "ServerId": { + "type": "string", + "nullable": true + }, + "UserPrimaryImageTag": { + "type": "string", + "nullable": true + }, + "SupportedCommands": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneralCommandType" + }, + "description": "Gets the supported commands.", + "nullable": true, + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Class SessionInfo." + }, + "SessionMessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "type": "string", + "description": "The different kinds of messages that are used in the WebSocket api." + }, + "SessionUserInfo": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "description": "Gets or sets the user identifier.", + "format": "uuid" + }, + "UserName": { + "type": "string", + "description": "Gets or sets the name of the user.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class SessionUserInfo." + }, + "SetChannelMappingDto": { + "required": [ + "ProviderChannelId", + "ProviderId", + "TunerChannelId" + ], + "type": "object", + "properties": { + "ProviderId": { + "type": "string", + "description": "Gets or sets the provider id." + }, + "TunerChannelId": { + "type": "string", + "description": "Gets or sets the tuner channel id." + }, + "ProviderChannelId": { + "type": "string", + "description": "Gets or sets the provider channel id." + } + }, + "additionalProperties": false, + "description": "Set channel mapping dto." + }, + "SetPlaylistItemRequestDto": { + "type": "object", + "properties": { + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist identifier of the playing item.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class SetPlaylistItemRequestDto." + }, + "SetRepeatModeRequestDto": { + "type": "object", + "properties": { + "Mode": { + "allOf": [ + { + "$ref": "#/components/schemas/GroupRepeatMode" + } + ], + "description": "Enum GroupRepeatMode." + } + }, + "additionalProperties": false, + "description": "Class SetRepeatModeRequestDto." + }, + "SetShuffleModeRequestDto": { + "type": "object", + "properties": { + "Mode": { + "allOf": [ + { + "$ref": "#/components/schemas/GroupShuffleMode" + } + ], + "description": "Enum GroupShuffleMode." + } + }, + "additionalProperties": false, + "description": "Class SetShuffleModeRequestDto." + }, + "SongInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "AlbumArtists": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Album": { + "type": "string", + "nullable": true + }, + "Artists": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "SortOrder": { + "enum": [ + "Ascending", + "Descending" + ], + "type": "string", + "description": "An enum representing the sorting order." + }, + "SpecialViewOptionDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets view option name.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets view option id.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Special view option dto." + }, + "StartupConfigurationDto": { + "type": "object", + "properties": { + "UICulture": { + "type": "string", + "description": "Gets or sets UI language culture.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "PreferredMetadataLanguage": { + "type": "string", + "description": "Gets or sets the preferred language for the metadata.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The startup configuration DTO." + }, + "StartupRemoteAccessDto": { + "required": [ + "EnableAutomaticPortMapping", + "EnableRemoteAccess" + ], + "type": "object", + "properties": { + "EnableRemoteAccess": { + "type": "boolean", + "description": "Gets or sets a value indicating whether enable remote access." + }, + "EnableAutomaticPortMapping": { + "type": "boolean", + "description": "Gets or sets a value indicating whether enable automatic port mapping." + } + }, + "additionalProperties": false, + "description": "Startup remote access dto." + }, + "StartupUserDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the username.", + "nullable": true + }, + "Password": { + "type": "string", + "description": "Gets or sets the user's password.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The startup user DTO." + }, + "SubtitleDeliveryMethod": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "type": "string", + "description": "Delivery method to use during playback of a specific subtitle format." + }, + "SubtitleOptions": { + "type": "object", + "properties": { + "SkipIfEmbeddedSubtitlesPresent": { + "type": "boolean" + }, + "SkipIfAudioTrackMatches": { + "type": "boolean" + }, + "DownloadLanguages": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DownloadMovieSubtitles": { + "type": "boolean" + }, + "DownloadEpisodeSubtitles": { + "type": "boolean" + }, + "OpenSubtitlesUsername": { + "type": "string", + "nullable": true + }, + "OpenSubtitlesPasswordHash": { + "type": "string", + "nullable": true + }, + "IsOpenSubtitleVipAccount": { + "type": "boolean" + }, + "RequirePerfectMatch": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "SubtitlePlaybackMode": { + "enum": [ + "Default", + "Always", + "OnlyForced", + "None", + "Smart" + ], + "type": "string", + "description": "An enum representing a subtitle playback mode." + }, + "SubtitleProfile": { + "type": "object", + "properties": { + "Format": { + "type": "string", + "nullable": true + }, + "Method": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ], + "description": "Delivery method to use during playback of a specific subtitle format." + }, + "DidlMode": { + "type": "string", + "nullable": true + }, + "Language": { + "type": "string", + "nullable": true + }, + "Container": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "SyncPlayUserAccessType": { + "enum": [ + "CreateAndJoinGroups", + "JoinGroups", + "None" + ], + "type": "string", + "description": "Enum SyncPlayUserAccessType." + }, + "SystemInfo": { + "type": "object", + "properties": { + "LocalAddress": { + "type": "string", + "description": "Gets or sets the local address.", + "nullable": true + }, + "ServerName": { + "type": "string", + "description": "Gets or sets the name of the server.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the server version.", + "nullable": true + }, + "ProductName": { + "type": "string", + "description": "Gets or sets the product name. This is the AssemblyProduct name.", + "nullable": true + }, + "OperatingSystem": { + "type": "string", + "description": "Gets or sets the operating system.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "StartupWizardCompleted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the startup wizard is completed.", + "nullable": true + }, + "OperatingSystemDisplayName": { + "type": "string", + "description": "Gets or sets the display name of the operating system.", + "nullable": true + }, + "PackageName": { + "type": "string", + "description": "Gets or sets the package name.", + "nullable": true + }, + "HasPendingRestart": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has pending restart." + }, + "IsShuttingDown": { + "type": "boolean" + }, + "SupportsLibraryMonitor": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports library monitor]." + }, + "WebSocketPortNumber": { + "type": "integer", + "description": "Gets or sets the web socket port number.", + "format": "int32" + }, + "CompletedInstallations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InstallationInfo" + }, + "description": "Gets or sets the completed installations.", + "nullable": true + }, + "CanSelfRestart": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can self restart." + }, + "CanLaunchWebBrowser": { + "type": "boolean" + }, + "ProgramDataPath": { + "type": "string", + "description": "Gets or sets the program data path.", + "nullable": true + }, + "WebPath": { + "type": "string", + "description": "Gets or sets the web UI resources path.", + "nullable": true + }, + "ItemsByNamePath": { + "type": "string", + "description": "Gets or sets the items by name path.", + "nullable": true + }, + "CachePath": { + "type": "string", + "description": "Gets or sets the cache path.", + "nullable": true + }, + "LogPath": { + "type": "string", + "description": "Gets or sets the log path.", + "nullable": true + }, + "InternalMetadataPath": { + "type": "string", + "description": "Gets or sets the internal metadata path.", + "nullable": true + }, + "TranscodingTempPath": { + "type": "string", + "description": "Gets or sets the transcode path.", + "nullable": true + }, + "HasUpdateAvailable": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has update available.", + "deprecated": true + }, + "EncoderLocation": { + "allOf": [ + { + "$ref": "#/components/schemas/FFmpegLocation" + } + ], + "description": "Enum describing the location of the FFmpeg tool.", + "deprecated": true + }, + "SystemArchitecture": { + "allOf": [ + { + "$ref": "#/components/schemas/Architecture" + } + ] + } + }, + "additionalProperties": false, + "description": "Class SystemInfo." + }, + "TaskCompletionStatus": { + "enum": [ + "Completed", + "Failed", + "Cancelled", + "Aborted" + ], + "type": "string", + "description": "Enum TaskCompletionStatus." + }, + "TaskInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "State": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskState" + } + ], + "description": "Gets or sets the state of the task." + }, + "CurrentProgressPercentage": { + "type": "number", + "description": "Gets or sets the progress.", + "format": "double", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "LastExecutionResult": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskResult" + } + ], + "description": "Gets or sets the last execution result.", + "nullable": true + }, + "Triggers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskTriggerInfo" + }, + "description": "Gets or sets the triggers.", + "nullable": true + }, + "Description": { + "type": "string", + "description": "Gets or sets the description.", + "nullable": true + }, + "Category": { + "type": "string", + "description": "Gets or sets the category.", + "nullable": true + }, + "IsHidden": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is hidden." + }, + "Key": { + "type": "string", + "description": "Gets or sets the key.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class TaskInfo." + }, + "TaskResult": { + "type": "object", + "properties": { + "StartTimeUtc": { + "type": "string", + "description": "Gets or sets the start time UTC.", + "format": "date-time" + }, + "EndTimeUtc": { + "type": "string", + "description": "Gets or sets the end time UTC.", + "format": "date-time" + }, + "Status": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskCompletionStatus" + } + ], + "description": "Gets or sets the status." + }, + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Key": { + "type": "string", + "description": "Gets or sets the key.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "ErrorMessage": { + "type": "string", + "description": "Gets or sets the error message.", + "nullable": true + }, + "LongErrorMessage": { + "type": "string", + "description": "Gets or sets the long error message.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class TaskExecutionInfo." + }, + "TaskState": { + "enum": [ + "Idle", + "Cancelling", + "Running" + ], + "type": "string", + "description": "Enum TaskState." + }, + "TaskTriggerInfo": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "description": "Gets or sets the type.", + "nullable": true + }, + "TimeOfDayTicks": { + "type": "integer", + "description": "Gets or sets the time of day.", + "format": "int64", + "nullable": true + }, + "IntervalTicks": { + "type": "integer", + "description": "Gets or sets the interval.", + "format": "int64", + "nullable": true + }, + "DayOfWeek": { + "allOf": [ + { + "$ref": "#/components/schemas/DayOfWeek" + } + ], + "description": "Gets or sets the day of week.", + "nullable": true + }, + "MaxRuntimeTicks": { + "type": "integer", + "description": "Gets or sets the maximum runtime ticks.", + "format": "int64", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class TaskTriggerInfo." + }, + "ThemeMediaResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + }, + "description": "Gets or sets the items.", + "nullable": true + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + }, + "OwnerId": { + "type": "string", + "description": "Gets or sets the owner id.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class ThemeMediaResult." + }, + "TimerEventInfo": { + "type": "object", + "properties": { + "Id": { + "type": "string" + }, + "ProgramId": { + "type": "string", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "TimerInfoDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the Id of the recording.", + "nullable": true + }, + "Type": { + "type": "string", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server identifier.", + "nullable": true + }, + "ExternalId": { + "type": "string", + "description": "Gets or sets the external identifier.", + "nullable": true + }, + "ChannelId": { + "type": "string", + "description": "Gets or sets the channel id of the recording.", + "format": "uuid" + }, + "ExternalChannelId": { + "type": "string", + "description": "Gets or sets the external channel identifier.", + "nullable": true + }, + "ChannelName": { + "type": "string", + "description": "Gets or sets the channel name of the recording.", + "nullable": true + }, + "ChannelPrimaryImageTag": { + "type": "string", + "nullable": true + }, + "ProgramId": { + "type": "string", + "description": "Gets or sets the program identifier.", + "nullable": true + }, + "ExternalProgramId": { + "type": "string", + "description": "Gets or sets the external program identifier.", + "nullable": true + }, + "Name": { + "type": "string", + "description": "Gets or sets the name of the recording.", + "nullable": true + }, + "Overview": { + "type": "string", + "description": "Gets or sets the description of the recording.", + "nullable": true + }, + "StartDate": { + "type": "string", + "description": "Gets or sets the start date of the recording, in UTC.", + "format": "date-time" + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date of the recording, in UTC.", + "format": "date-time" + }, + "ServiceName": { + "type": "string", + "description": "Gets or sets the name of the service.", + "nullable": true + }, + "Priority": { + "type": "integer", + "description": "Gets or sets the priority.", + "format": "int32" + }, + "PrePaddingSeconds": { + "type": "integer", + "description": "Gets or sets the pre padding seconds.", + "format": "int32" + }, + "PostPaddingSeconds": { + "type": "integer", + "description": "Gets or sets the post padding seconds.", + "format": "int32" + }, + "IsPrePaddingRequired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is pre padding required." + }, + "ParentBackdropItemId": { + "type": "string", + "description": "Gets or sets the Id of the Parent that has a backdrop if the item does not have one.", + "nullable": true + }, + "ParentBackdropImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the parent backdrop image tags.", + "nullable": true + }, + "IsPostPaddingRequired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is post padding required." + }, + "KeepUntil": { + "allOf": [ + { + "$ref": "#/components/schemas/KeepUntil" + } + ] + }, + "Status": { + "allOf": [ + { + "$ref": "#/components/schemas/RecordingStatus" + } + ], + "description": "Gets or sets the status." + }, + "SeriesTimerId": { + "type": "string", + "description": "Gets or sets the series timer identifier.", + "nullable": true + }, + "ExternalSeriesTimerId": { + "type": "string", + "description": "Gets or sets the external series timer identifier.", + "nullable": true + }, + "RunTimeTicks": { + "type": "integer", + "description": "Gets or sets the run time ticks.", + "format": "int64", + "nullable": true + }, + "ProgramInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the program information.", + "nullable": true + } + }, + "additionalProperties": false + }, + "TimerInfoDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TimerInfoDto" + }, + "description": "Gets or sets the items.", + "nullable": true + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false + }, + "TrailerInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "TrailerInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/TrailerInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "TranscodeReason": { + "enum": [ + "ContainerNotSupported", + "VideoCodecNotSupported", + "AudioCodecNotSupported", + "SubtitleCodecNotSupported", + "AudioIsExternal", + "SecondaryAudioNotSupported", + "VideoProfileNotSupported", + "VideoLevelNotSupported", + "VideoResolutionNotSupported", + "VideoBitDepthNotSupported", + "VideoFramerateNotSupported", + "RefFramesNotSupported", + "AnamorphicVideoNotSupported", + "InterlacedVideoNotSupported", + "AudioChannelsNotSupported", + "AudioProfileNotSupported", + "AudioSampleRateNotSupported", + "AudioBitDepthNotSupported", + "ContainerBitrateExceedsLimit", + "VideoBitrateNotSupported", + "AudioBitrateNotSupported", + "UnknownVideoStreamInfo", + "UnknownAudioStreamInfo", + "DirectPlayError", + "VideoRangeTypeNotSupported" + ], + "type": "string" + }, + "TranscodeSeekInfo": { + "enum": [ + "Auto", + "Bytes" + ], + "type": "string" + }, + "TranscodingInfo": { + "type": "object", + "properties": { + "AudioCodec": { + "type": "string", + "nullable": true + }, + "VideoCodec": { + "type": "string", + "nullable": true + }, + "Container": { + "type": "string", + "nullable": true + }, + "IsVideoDirect": { + "type": "boolean" + }, + "IsAudioDirect": { + "type": "boolean" + }, + "Bitrate": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "Framerate": { + "type": "number", + "format": "float", + "nullable": true + }, + "CompletionPercentage": { + "type": "number", + "format": "double", + "nullable": true + }, + "Width": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "Height": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AudioChannels": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "HardwareAccelerationType": { + "allOf": [ + { + "$ref": "#/components/schemas/HardwareEncodingType" + } + ], + "nullable": true + }, + "TranscodeReasons": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TranscodeReason" + } + } + }, + "additionalProperties": false + }, + "TranscodingProfile": { + "type": "object", + "properties": { + "Container": { + "type": "string" + }, + "Type": { + "allOf": [ + { + "$ref": "#/components/schemas/DlnaProfileType" + } + ] + }, + "VideoCodec": { + "type": "string" + }, + "AudioCodec": { + "type": "string" + }, + "Protocol": { + "type": "string" + }, + "EstimateContentLength": { + "type": "boolean", + "default": false + }, + "EnableMpegtsM2TsMode": { + "type": "boolean", + "default": false + }, + "TranscodeSeekInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/TranscodeSeekInfo" + } + ], + "default": "Auto" + }, + "CopyTimestamps": { + "type": "boolean", + "default": false + }, + "Context": { + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ], + "default": "Streaming" + }, + "EnableSubtitlesInManifest": { + "type": "boolean", + "default": false + }, + "MaxAudioChannels": { + "type": "string", + "nullable": true + }, + "MinSegments": { + "type": "integer", + "format": "int32", + "default": 0 + }, + "SegmentLength": { + "type": "integer", + "format": "int32", + "default": 0 + }, + "BreakOnNonKeyFrames": { + "type": "boolean", + "default": false + }, + "Conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + } + } + }, + "additionalProperties": false + }, + "TransportStreamTimestamp": { + "enum": [ + "None", + "Zero", + "Valid" + ], + "type": "string" + }, + "TunerChannelMapping": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "ProviderChannelName": { + "type": "string", + "nullable": true + }, + "ProviderChannelId": { + "type": "string", + "nullable": true + }, + "Id": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "TunerHostInfo": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": true + }, + "Url": { + "type": "string", + "nullable": true + }, + "Type": { + "type": "string", + "nullable": true + }, + "DeviceId": { + "type": "string", + "nullable": true + }, + "FriendlyName": { + "type": "string", + "nullable": true + }, + "ImportFavoritesOnly": { + "type": "boolean" + }, + "AllowHWTranscoding": { + "type": "boolean" + }, + "EnableStreamLooping": { + "type": "boolean" + }, + "Source": { + "type": "string", + "nullable": true + }, + "TunerCount": { + "type": "integer", + "format": "int32" + }, + "UserAgent": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "TypeOptions": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": true + }, + "MetadataFetchers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "MetadataFetcherOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ImageFetchers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ImageFetcherOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ImageOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageOption" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "UnratedItem": { + "enum": [ + "Movie", + "Trailer", + "Series", + "Music", + "Book", + "LiveTvChannel", + "LiveTvProgram", + "ChannelContent", + "Other" + ], + "type": "string", + "description": "An enum representing an unrated item." + }, + "UpdateLibraryOptionsDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the library item id.", + "format": "uuid" + }, + "LibraryOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/LibraryOptions" + } + ], + "description": "Gets or sets library options.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Update library options dto." + }, + "UpdateMediaPathRequestDto": { + "required": [ + "Name", + "PathInfo" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the library name." + }, + "PathInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathInfo" + } + ], + "description": "Gets or sets library folder path information." + } + }, + "additionalProperties": false, + "description": "Update library options dto." + }, + "UpdateUserEasyPassword": { + "type": "object", + "properties": { + "NewPassword": { + "type": "string", + "description": "Gets or sets the new sha1-hashed password.", + "nullable": true + }, + "NewPw": { + "type": "string", + "description": "Gets or sets the new password.", + "nullable": true + }, + "ResetPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to reset the password." + } + }, + "additionalProperties": false, + "description": "The update user easy password request body." + }, + "UpdateUserPassword": { + "type": "object", + "properties": { + "CurrentPassword": { + "type": "string", + "description": "Gets or sets the current sha1-hashed password.", + "nullable": true + }, + "CurrentPw": { + "type": "string", + "description": "Gets or sets the current plain text password.", + "nullable": true + }, + "NewPw": { + "type": "string", + "description": "Gets or sets the new plain text password.", + "nullable": true + }, + "ResetPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to reset the password." + } + }, + "additionalProperties": false, + "description": "The update user password request body." + }, + "UploadSubtitleDto": { + "required": [ + "Data", + "Format", + "IsForced", + "Language" + ], + "type": "object", + "properties": { + "Language": { + "type": "string", + "description": "Gets or sets the subtitle language." + }, + "Format": { + "type": "string", + "description": "Gets or sets the subtitle format." + }, + "IsForced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the subtitle is forced." + }, + "Data": { + "type": "string", + "description": "Gets or sets the subtitle data." + } + }, + "additionalProperties": false, + "description": "Upload subtitles dto." + }, + "UserConfiguration": { + "type": "object", + "properties": { + "AudioLanguagePreference": { + "type": "string", + "description": "Gets or sets the audio language preference.", + "nullable": true + }, + "PlayDefaultAudioTrack": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [play default audio track]." + }, + "SubtitleLanguagePreference": { + "type": "string", + "description": "Gets or sets the subtitle language preference.", + "nullable": true + }, + "DisplayMissingEpisodes": { + "type": "boolean" + }, + "GroupedFolders": { + "type": "array", + "items": { + "type": "string" + } + }, + "SubtitleMode": { + "allOf": [ + { + "$ref": "#/components/schemas/SubtitlePlaybackMode" + } + ], + "description": "An enum representing a subtitle playback mode." + }, + "DisplayCollectionsView": { + "type": "boolean" + }, + "EnableLocalPassword": { + "type": "boolean" + }, + "OrderedViews": { + "type": "array", + "items": { + "type": "string" + } + }, + "LatestItemsExcludes": { + "type": "array", + "items": { + "type": "string" + } + }, + "MyMediaExcludes": { + "type": "array", + "items": { + "type": "string" + } + }, + "HidePlayedInLatest": { + "type": "boolean" + }, + "RememberAudioSelections": { + "type": "boolean" + }, + "RememberSubtitleSelections": { + "type": "boolean" + }, + "EnableNextEpisodeAutoPlay": { + "type": "boolean" + } + }, + "additionalProperties": false, + "description": "Class UserConfiguration." + }, + "UserDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server identifier.", + "nullable": true + }, + "ServerName": { + "type": "string", + "description": "Gets or sets the name of the server.\r\nThis is not used by the server and is for client-side usage only.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "format": "uuid" + }, + "PrimaryImageTag": { + "type": "string", + "description": "Gets or sets the primary image tag.", + "nullable": true + }, + "HasPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has password." + }, + "HasConfiguredPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has configured password." + }, + "HasConfiguredEasyPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has configured easy password." + }, + "EnableAutoLogin": { + "type": "boolean", + "description": "Gets or sets whether async login is enabled or not.", + "nullable": true + }, + "LastLoginDate": { + "type": "string", + "description": "Gets or sets the last login date.", + "format": "date-time", + "nullable": true + }, + "LastActivityDate": { + "type": "string", + "description": "Gets or sets the last activity date.", + "format": "date-time", + "nullable": true + }, + "Configuration": { + "allOf": [ + { + "$ref": "#/components/schemas/UserConfiguration" + } + ], + "description": "Gets or sets the configuration.", + "nullable": true + }, + "Policy": { + "allOf": [ + { + "$ref": "#/components/schemas/UserPolicy" + } + ], + "description": "Gets or sets the policy.", + "nullable": true + }, + "PrimaryImageAspectRatio": { + "type": "number", + "description": "Gets or sets the primary image aspect ratio.", + "format": "double", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class UserDto." + }, + "UserItemDataDto": { + "type": "object", + "properties": { + "Rating": { + "type": "number", + "description": "Gets or sets the rating.", + "format": "double", + "nullable": true + }, + "PlayedPercentage": { + "type": "number", + "description": "Gets or sets the played percentage.", + "format": "double", + "nullable": true + }, + "UnplayedItemCount": { + "type": "integer", + "description": "Gets or sets the unplayed item count.", + "format": "int32", + "nullable": true + }, + "PlaybackPositionTicks": { + "type": "integer", + "description": "Gets or sets the playback position ticks.", + "format": "int64" + }, + "PlayCount": { + "type": "integer", + "description": "Gets or sets the play count.", + "format": "int32" + }, + "IsFavorite": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is favorite." + }, + "Likes": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is likes.", + "nullable": true + }, + "LastPlayedDate": { + "type": "string", + "description": "Gets or sets the last played date.", + "format": "date-time", + "nullable": true + }, + "Played": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played." + }, + "Key": { + "type": "string", + "description": "Gets or sets the key.", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class UserItemDataDto." + }, + "UserPolicy": { + "type": "object", + "properties": { + "IsAdministrator": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is administrator." + }, + "IsHidden": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is hidden." + }, + "IsDisabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is disabled." + }, + "MaxParentalRating": { + "type": "integer", + "description": "Gets or sets the max parental rating.", + "format": "int32", + "nullable": true + }, + "BlockedTags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "EnableUserPreferenceAccess": { + "type": "boolean" + }, + "AccessSchedules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccessSchedule" + }, + "nullable": true + }, + "BlockUnratedItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UnratedItem" + }, + "nullable": true + }, + "EnableRemoteControlOfOtherUsers": { + "type": "boolean" + }, + "EnableSharedDeviceControl": { + "type": "boolean" + }, + "EnableRemoteAccess": { + "type": "boolean" + }, + "EnableLiveTvManagement": { + "type": "boolean" + }, + "EnableLiveTvAccess": { + "type": "boolean" + }, + "EnableMediaPlayback": { + "type": "boolean" + }, + "EnableAudioPlaybackTranscoding": { + "type": "boolean" + }, + "EnableVideoPlaybackTranscoding": { + "type": "boolean" + }, + "EnablePlaybackRemuxing": { + "type": "boolean" + }, + "ForceRemoteSourceTranscoding": { + "type": "boolean" + }, + "EnableContentDeletion": { + "type": "boolean" + }, + "EnableContentDeletionFromFolders": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "EnableContentDownloading": { + "type": "boolean" + }, + "EnableSyncTranscoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [enable synchronize]." + }, + "EnableMediaConversion": { + "type": "boolean" + }, + "EnabledDevices": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "EnableAllDevices": { + "type": "boolean" + }, + "EnabledChannels": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "EnableAllChannels": { + "type": "boolean" + }, + "EnabledFolders": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "EnableAllFolders": { + "type": "boolean" + }, + "InvalidLoginAttemptCount": { + "type": "integer", + "format": "int32" + }, + "LoginAttemptsBeforeLockout": { + "type": "integer", + "format": "int32" + }, + "MaxActiveSessions": { + "type": "integer", + "format": "int32" + }, + "EnablePublicSharing": { + "type": "boolean" + }, + "BlockedMediaFolders": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "BlockedChannels": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "RemoteClientBitrateLimit": { + "type": "integer", + "format": "int32" + }, + "AuthenticationProviderId": { + "type": "string", + "nullable": true + }, + "PasswordResetProviderId": { + "type": "string", + "nullable": true + }, + "SyncPlayAccess": { + "allOf": [ + { + "$ref": "#/components/schemas/SyncPlayUserAccessType" + } + ], + "description": "Gets or sets a value indicating what SyncPlay features the user can access." + } + }, + "additionalProperties": false + }, + "UtcTimeResponse": { + "type": "object", + "properties": { + "RequestReceptionTime": { + "type": "string", + "description": "Gets the UTC time when request has been received.", + "format": "date-time" + }, + "ResponseTransmissionTime": { + "type": "string", + "description": "Gets the UTC time when response has been sent.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Class UtcTimeResponse." + }, + "ValidatePathDto": { + "type": "object", + "properties": { + "ValidateWritable": { + "type": "boolean", + "description": "Gets or sets a value indicating whether validate if path is writable." + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "IsFile": { + "type": "boolean", + "description": "Gets or sets is path file.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Validate path object." + }, + "VersionInfo": { + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Gets or sets the version." + }, + "VersionNumber": { + "type": "string", + "description": "Gets the version as a System.Version.", + "readOnly": true + }, + "changelog": { + "type": "string", + "description": "Gets or sets the changelog for this version.", + "nullable": true + }, + "targetAbi": { + "type": "string", + "description": "Gets or sets the ABI that this version was built against.", + "nullable": true + }, + "sourceUrl": { + "type": "string", + "description": "Gets or sets the source URL.", + "nullable": true + }, + "checksum": { + "type": "string", + "description": "Gets or sets a checksum for the binary.", + "nullable": true + }, + "timestamp": { + "type": "string", + "description": "Gets or sets a timestamp of when the binary was built.", + "nullable": true + }, + "repositoryName": { + "type": "string", + "description": "Gets or sets the repository name." + }, + "repositoryUrl": { + "type": "string", + "description": "Gets or sets the repository url." + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Updates.VersionInfo class." + }, + "Video3DFormat": { + "enum": [ + "HalfSideBySide", + "FullSideBySide", + "FullTopAndBottom", + "HalfTopAndBottom", + "MVC" + ], + "type": "string" + }, + "VideoType": { + "enum": [ + "VideoFile", + "Iso", + "Dvd", + "BluRay" + ], + "type": "string", + "description": "Enum VideoType." + }, + "VirtualFolderInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Locations": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the locations.", + "nullable": true + }, + "CollectionType": { + "allOf": [ + { + "$ref": "#/components/schemas/CollectionTypeOptions" + } + ], + "description": "Gets or sets the type of the collection.", + "nullable": true + }, + "LibraryOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/LibraryOptions" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "nullable": true + }, + "PrimaryImageItemId": { + "type": "string", + "description": "Gets or sets the primary image item identifier.", + "nullable": true + }, + "RefreshProgress": { + "type": "number", + "format": "double", + "nullable": true + }, + "RefreshStatus": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to hold information about a user's list of configured virtual folders." + }, + "WakeOnLanInfo": { + "type": "object", + "properties": { + "MacAddress": { + "type": "string", + "description": "Gets the MAC address of the device.", + "nullable": true + }, + "Port": { + "type": "integer", + "description": "Gets or sets the wake-on-LAN port.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Provides the MAC address and port for wake-on-LAN functionality." + }, + "XbmcMetadataOptions": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "nullable": true + }, + "ReleaseDateFormat": { + "type": "string" + }, + "SaveImagePathsInNfo": { + "type": "boolean" + }, + "EnablePathSubstitution": { + "type": "boolean" + }, + "EnableExtraThumbsDuplication": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "XmlAttribute": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name of the attribute.", + "nullable": true + }, + "Value": { + "type": "string", + "description": "Gets or sets the value of the attribute.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Dlna.XmlAttribute." + } + }, + "securitySchemes": { + "CustomAuthentication": { + "type": "apiKey", + "description": "API key header parameter", + "name": "Authorization", + "in": "header" + } + } + } +} \ No newline at end of file diff --git a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/yaml/jellyfin-openapi-10.10.7.yaml b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/yaml/jellyfin-openapi-10.10.7.yaml new file mode 100644 index 0000000000000..caf698948609e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/yaml/jellyfin-openapi-10.10.7.yaml @@ -0,0 +1,39350 @@ +openapi: 3.0.1 +info: + title: Jellyfin API + version: 10.10.7 + x-jellyfin-version: 10.10.7 +servers: + - url: http://localhost +paths: + /System/ActivityLog/Entries: + get: + tags: + - ActivityLog + summary: Gets activity log entries. + operationId: GetLogEntries + parameters: + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: minDate + in: query + description: Optional. The minimum date. Format = ISO. + schema: + type: string + format: date-time + - name: hasUserId + in: query + description: Optional. Filter log entries if it has user id, or not. + schema: + type: boolean + responses: + "200": + description: Activity log returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ActivityLogEntryQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ActivityLogEntryQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ActivityLogEntryQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Auth/Keys: + get: + tags: + - ApiKey + summary: Get all keys. + operationId: GetKeys + responses: + "200": + description: Api keys retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/AuthenticationInfoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/AuthenticationInfoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + post: + tags: + - ApiKey + summary: Create a new api key. + operationId: CreateKey + parameters: + - name: app + in: query + description: Name of the app using the authentication key. + required: true + schema: + type: string + responses: + "204": + description: Api key created. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Auth/Keys/{key}: + delete: + tags: + - ApiKey + summary: Remove an api key. + operationId: RevokeKey + parameters: + - name: key + in: path + description: The access token to delete. + required: true + schema: + type: string + responses: + "204": + description: Api key deleted. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Artists: + get: + tags: + - Artists + summary: Gets all artists from a given item, folder, or the entire library. + operationId: GetArtists + parameters: + - name: minCommunityRating + in: query + description: Optional filter by minimum community rating. + schema: + type: number + format: double + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: searchTerm + in: query + description: Optional. Search term. + schema: + type: string + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: filters + in: query + description: Optional. Specify additional filters to apply. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFilter' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. + schema: + type: boolean + - name: mediaTypes + in: query + description: Optional filter by MediaType. Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/MediaType' + - name: genres + in: query + description: Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: genreIds + in: query + description: Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: officialRatings + in: query + description: Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: tags + in: query + description: Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: years + in: query + description: Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. + schema: + type: array + items: + type: integer + format: int32 + - name: enableUserData + in: query + description: Optional, include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: person + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person. + schema: + type: string + - name: personIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person ids. + schema: + type: array + items: + type: string + format: uuid + - name: personTypes + in: query + description: Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. + schema: + type: array + items: + type: string + - name: studios + in: query + description: Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: studioIds + in: query + description: Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: nameStartsWithOrGreater + in: query + description: Optional filter by items whose name is sorted equally or greater than a given input string. + schema: + type: string + - name: nameStartsWith + in: query + description: Optional filter by items whose name is sorted equally than a given input string. + schema: + type: string + - name: nameLessThan + in: query + description: Optional filter by items whose name is equally or lesser than a given input string. + schema: + type: string + - name: sortBy + in: query + description: Optional. Specify one or more sort orders, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/ItemSortBy' + - name: sortOrder + in: query + description: Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + - name: enableTotalRecordCount + in: query + description: Total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Artists returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Artists/{name}: + get: + tags: + - Artists + summary: Gets an artist by name. + operationId: GetArtistByName + parameters: + - name: name + in: path + description: Studio name. + required: true + schema: + type: string + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Artist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Artists/AlbumArtists: + get: + tags: + - Artists + summary: Gets all album artists from a given item, folder, or the entire library. + operationId: GetAlbumArtists + parameters: + - name: minCommunityRating + in: query + description: Optional filter by minimum community rating. + schema: + type: number + format: double + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: searchTerm + in: query + description: Optional. Search term. + schema: + type: string + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: filters + in: query + description: Optional. Specify additional filters to apply. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFilter' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. + schema: + type: boolean + - name: mediaTypes + in: query + description: Optional filter by MediaType. Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/MediaType' + - name: genres + in: query + description: Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: genreIds + in: query + description: Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: officialRatings + in: query + description: Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: tags + in: query + description: Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: years + in: query + description: Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. + schema: + type: array + items: + type: integer + format: int32 + - name: enableUserData + in: query + description: Optional, include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: person + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person. + schema: + type: string + - name: personIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person ids. + schema: + type: array + items: + type: string + format: uuid + - name: personTypes + in: query + description: Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. + schema: + type: array + items: + type: string + - name: studios + in: query + description: Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: studioIds + in: query + description: Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: nameStartsWithOrGreater + in: query + description: Optional filter by items whose name is sorted equally or greater than a given input string. + schema: + type: string + - name: nameStartsWith + in: query + description: Optional filter by items whose name is sorted equally than a given input string. + schema: + type: string + - name: nameLessThan + in: query + description: Optional filter by items whose name is equally or lesser than a given input string. + schema: + type: string + - name: sortBy + in: query + description: Optional. Specify one or more sort orders, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/ItemSortBy' + - name: sortOrder + in: query + description: Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + - name: enableTotalRecordCount + in: query + description: Total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Album artists returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Audio/{itemId}/stream: + get: + tags: + - Audio + summary: Gets an audio stream. + operationId: GetAudioStream + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: query + description: The audio container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + deprecated: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + responses: + "200": + description: Audio stream returned. + content: + audio/*: + schema: + type: string + format: binary + head: + tags: + - Audio + summary: Gets an audio stream. + operationId: HeadAudioStream + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: query + description: The audio container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + deprecated: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + responses: + "200": + description: Audio stream returned. + content: + audio/*: + schema: + type: string + format: binary + /Audio/{itemId}/stream.{container}: + get: + tags: + - Audio + summary: Gets an audio stream. + operationId: GetAudioStreamByContainer + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: path + description: The audio container. + required: true + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + deprecated: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamporphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + responses: + "200": + description: Audio stream returned. + content: + audio/*: + schema: + type: string + format: binary + head: + tags: + - Audio + summary: Gets an audio stream. + operationId: HeadAudioStreamByContainer + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: path + description: The audio container. + required: true + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + deprecated: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamporphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + responses: + "200": + description: Audio stream returned. + content: + audio/*: + schema: + type: string + format: binary + /Branding/Configuration: + get: + tags: + - Branding + summary: Gets branding configuration. + operationId: GetBrandingOptions + responses: + "200": + description: Branding configuration returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BrandingOptions' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BrandingOptions' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BrandingOptions' + /Branding/Css: + get: + tags: + - Branding + summary: Gets branding css. + operationId: GetBrandingCss + responses: + "200": + description: Branding css returned. + content: + text/css: + schema: + type: string + application/json: + schema: + type: string + application/json; profile="CamelCase": + schema: + type: string + application/json; profile="PascalCase": + schema: + type: string + "204": + description: No branding css configured. + /Branding/Css.css: + get: + tags: + - Branding + summary: Gets branding css. + operationId: GetBrandingCss_2 + responses: + "200": + description: Branding css returned. + content: + text/css: + schema: + type: string + application/json: + schema: + type: string + application/json; profile="CamelCase": + schema: + type: string + application/json; profile="PascalCase": + schema: + type: string + "204": + description: No branding css configured. + /Channels: + get: + tags: + - Channels + summary: Gets available channels. + operationId: GetChannels + parameters: + - name: userId + in: query + description: User Id to filter by. Use System.Guid.Empty to not filter by user. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: supportsLatestItems + in: query + description: Optional. Filter by channels that support getting latest items. + schema: + type: boolean + - name: supportsMediaDeletion + in: query + description: Optional. Filter by channels that support media deletion. + schema: + type: boolean + - name: isFavorite + in: query + description: Optional. Filter by channels that are favorite. + schema: + type: boolean + responses: + "200": + description: Channels returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Channels/{channelId}/Features: + get: + tags: + - Channels + summary: Get channel features. + operationId: GetChannelFeatures + parameters: + - name: channelId + in: path + description: Channel id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Channel features returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ChannelFeatures' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ChannelFeatures' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ChannelFeatures' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Channels/{channelId}/Items: + get: + tags: + - Channels + summary: Get channel items. + operationId: GetChannelItems + parameters: + - name: channelId + in: path + description: Channel Id. + required: true + schema: + type: string + format: uuid + - name: folderId + in: query + description: Optional. Folder Id. + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. User Id. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: sortOrder + in: query + description: Optional. Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: filters + in: query + description: Optional. Specify additional filters to apply. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFilter' + - name: sortBy + in: query + description: 'Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemSortBy' + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + responses: + "200": + description: Channel items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Channels/Features: + get: + tags: + - Channels + summary: Get all channel features. + operationId: GetAllChannelFeatures + responses: + "200": + description: All channel features returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChannelFeatures' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/ChannelFeatures' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/ChannelFeatures' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Channels/Items/Latest: + get: + tags: + - Channels + summary: Gets latest channel items. + operationId: GetLatestChannelItems + parameters: + - name: userId + in: query + description: Optional. User Id. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: filters + in: query + description: Optional. Specify additional filters to apply. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFilter' + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: channelIds + in: query + description: Optional. Specify one or more channel id's, comma delimited. + schema: + type: array + items: + type: string + format: uuid + responses: + "200": + description: Latest channel items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /ClientLog/Document: + post: + tags: + - ClientLog + summary: Upload a document. + operationId: LogFile + requestBody: + content: + text/plain: + schema: + type: string + format: binary + responses: + "200": + description: Document saved. + content: + application/json: + schema: + $ref: '#/components/schemas/ClientLogDocumentResponseDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ClientLogDocumentResponseDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ClientLogDocumentResponseDto' + "403": + description: Event logging disabled. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "413": + description: Upload size too large. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + /Collections: + post: + tags: + - Collection + summary: Creates a new collection. + operationId: CreateCollection + parameters: + - name: name + in: query + description: The name of the collection. + schema: + type: string + - name: ids + in: query + description: Item Ids to add to the collection. + schema: + type: array + items: + type: string + - name: parentId + in: query + description: Optional. Create the collection within a specific folder. + schema: + type: string + format: uuid + - name: isLocked + in: query + description: Whether or not to lock the new collection. + schema: + type: boolean + default: false + responses: + "200": + description: Collection created. + content: + application/json: + schema: + $ref: '#/components/schemas/CollectionCreationResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/CollectionCreationResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/CollectionCreationResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - CollectionManagement + - DefaultAuthorization + /Collections/{collectionId}/Items: + post: + tags: + - Collection + summary: Adds items to a collection. + operationId: AddToCollection + parameters: + - name: collectionId + in: path + description: The collection id. + required: true + schema: + type: string + format: uuid + - name: ids + in: query + description: Item ids, comma delimited. + required: true + schema: + type: array + items: + type: string + format: uuid + responses: + "204": + description: Items added to collection. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - CollectionManagement + - DefaultAuthorization + delete: + tags: + - Collection + summary: Removes items from a collection. + operationId: RemoveFromCollection + parameters: + - name: collectionId + in: path + description: The collection id. + required: true + schema: + type: string + format: uuid + - name: ids + in: query + description: Item ids, comma delimited. + required: true + schema: + type: array + items: + type: string + format: uuid + responses: + "204": + description: Items removed from collection. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - CollectionManagement + - DefaultAuthorization + /System/Configuration: + get: + tags: + - Configuration + summary: Gets application configuration. + operationId: GetConfiguration + responses: + "200": + description: Application configuration returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ServerConfiguration' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ServerConfiguration' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ServerConfiguration' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + post: + tags: + - Configuration + summary: Updates application configuration. + operationId: UpdateConfiguration + requestBody: + description: Configuration. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ServerConfiguration' + description: Represents the server configuration. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/ServerConfiguration' + description: Represents the server configuration. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/ServerConfiguration' + description: Represents the server configuration. + required: true + responses: + "204": + description: Configuration updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /System/Configuration/{key}: + get: + tags: + - Configuration + summary: Gets a named configuration. + operationId: GetNamedConfiguration + parameters: + - name: key + in: path + description: Configuration key. + required: true + schema: + type: string + responses: + "200": + description: Configuration returned. + content: + application/json: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + post: + tags: + - Configuration + summary: Updates named configuration. + operationId: UpdateNamedConfiguration + parameters: + - name: key + in: path + description: Configuration key. + required: true + schema: + type: string + requestBody: + description: Configuration. + content: + application/json: + schema: {} + text/json: + schema: {} + application/*+json: + schema: {} + required: true + responses: + "204": + description: Named configuration updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /System/Configuration/MetadataOptions/Default: + get: + tags: + - Configuration + summary: Gets a default MetadataOptions object. + operationId: GetDefaultMetadataOptions + responses: + "200": + description: Metadata options returned. + content: + application/json: + schema: + $ref: '#/components/schemas/MetadataOptions' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/MetadataOptions' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/MetadataOptions' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /web/ConfigurationPage: + get: + tags: + - Dashboard + summary: Gets a dashboard configuration page. + operationId: GetDashboardConfigurationPage + parameters: + - name: name + in: query + description: The name of the page. + schema: + type: string + responses: + "200": + description: ConfigurationPage returned. + content: + text/html: + schema: + type: string + format: binary + application/x-javascript: + schema: + type: string + format: binary + "404": + description: Plugin configuration page not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /web/ConfigurationPages: + get: + tags: + - Dashboard + summary: Gets the configuration pages. + operationId: GetConfigurationPages + parameters: + - name: enableInMainMenu + in: query + description: Whether to enable in the main menu. + schema: + type: boolean + responses: + "200": + description: ConfigurationPages returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ConfigurationPageInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/ConfigurationPageInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/ConfigurationPageInfo' + "404": + description: Server still loading. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Devices: + get: + tags: + - Devices + summary: Get Devices. + operationId: GetDevices + parameters: + - name: userId + in: query + description: Gets or sets the user identifier. + schema: + type: string + format: uuid + responses: + "200": + description: Devices retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceInfoDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/DeviceInfoDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/DeviceInfoDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + delete: + tags: + - Devices + summary: Deletes a device. + operationId: DeleteDevice + parameters: + - name: id + in: query + description: Device Id. + required: true + schema: + type: string + responses: + "204": + description: Device deleted. + "404": + description: Device not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Devices/Info: + get: + tags: + - Devices + summary: Get info for a device. + operationId: GetDeviceInfo + parameters: + - name: id + in: query + description: Device Id. + required: true + schema: + type: string + responses: + "200": + description: Device info retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceInfoDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/DeviceInfoDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/DeviceInfoDto' + "404": + description: Device not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Devices/Options: + get: + tags: + - Devices + summary: Get options for a device. + operationId: GetDeviceOptions + parameters: + - name: id + in: query + description: Device Id. + required: true + schema: + type: string + responses: + "200": + description: Device options retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceOptionsDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/DeviceOptionsDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/DeviceOptionsDto' + "404": + description: Device not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + post: + tags: + - Devices + summary: Update device options. + operationId: UpdateDeviceOptions + parameters: + - name: id + in: query + description: Device Id. + required: true + schema: + type: string + requestBody: + description: Device Options. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/DeviceOptionsDto' + description: A dto representing custom options for a device. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/DeviceOptionsDto' + description: A dto representing custom options for a device. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/DeviceOptionsDto' + description: A dto representing custom options for a device. + required: true + responses: + "204": + description: Device options updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /DisplayPreferences/{displayPreferencesId}: + get: + tags: + - DisplayPreferences + summary: Get Display Preferences. + operationId: GetDisplayPreferences + parameters: + - name: displayPreferencesId + in: path + description: Display preferences id. + required: true + schema: + type: string + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: client + in: query + description: Client. + required: true + schema: + type: string + responses: + "200": + description: Display preferences retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/DisplayPreferencesDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/DisplayPreferencesDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/DisplayPreferencesDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + post: + tags: + - DisplayPreferences + summary: Update Display Preferences. + operationId: UpdateDisplayPreferences + parameters: + - name: displayPreferencesId + in: path + description: Display preferences id. + required: true + schema: + type: string + - name: userId + in: query + description: User Id. + schema: + type: string + format: uuid + - name: client + in: query + description: Client. + required: true + schema: + type: string + requestBody: + description: New Display Preferences object. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/DisplayPreferencesDto' + description: Defines the display preferences for any item that supports them (usually Folders). + text/json: + schema: + allOf: + - $ref: '#/components/schemas/DisplayPreferencesDto' + description: Defines the display preferences for any item that supports them (usually Folders). + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/DisplayPreferencesDto' + description: Defines the display preferences for any item that supports them (usually Folders). + required: true + responses: + "204": + description: Display preferences updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Audio/{itemId}/hls1/{playlistId}/{segmentId}.{container}: + get: + tags: + - DynamicHls + summary: Gets a video stream using HTTP live streaming. + operationId: GetHlsAudioSegment + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + - name: segmentId + in: path + description: The segment id. + required: true + schema: + type: integer + format: int32 + - name: container + in: path + description: 'The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.' + required: true + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: runtimeTicks + in: query + description: The position of the requested segment in ticks. + required: true + schema: + type: integer + format: int64 + - name: actualSegmentLengthTicks + in: query + description: The length of the requested segment in ticks. + required: true + schema: + type: integer + format: int64 + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + deprecated: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: maxStreamingBitrate + in: query + description: Optional. The maximum streaming bitrate. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + responses: + "200": + description: Video stream returned. + content: + audio/*: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Audio/{itemId}/main.m3u8: + get: + tags: + - DynamicHls + summary: Gets an audio stream using HTTP live streaming. + operationId: GetVariantHlsAudioPlaylist + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + deprecated: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: maxStreamingBitrate + in: query + description: Optional. The maximum streaming bitrate. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + responses: + "200": + description: Audio stream returned. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Audio/{itemId}/master.m3u8: + get: + tags: + - DynamicHls + summary: Gets an audio hls playlist stream. + operationId: GetMasterHlsAudioPlaylist + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + deprecated: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + required: true + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: maxStreamingBitrate + in: query + description: Optional. The maximum streaming bitrate. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAdaptiveBitrateStreaming + in: query + description: Enable adaptive bitrate streaming. + schema: + type: boolean + default: true + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + responses: + "200": + description: Audio stream returned. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + head: + tags: + - DynamicHls + summary: Gets an audio hls playlist stream. + operationId: HeadMasterHlsAudioPlaylist + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + deprecated: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + required: true + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: maxStreamingBitrate + in: query + description: Optional. The maximum streaming bitrate. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAdaptiveBitrateStreaming + in: query + description: Enable adaptive bitrate streaming. + schema: + type: boolean + default: true + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + responses: + "200": + description: Audio stream returned. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{itemId}/hls1/{playlistId}/{segmentId}.{container}: + get: + tags: + - DynamicHls + summary: Gets a video stream using HTTP live streaming. + operationId: GetHlsVideoSegment + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + - name: segmentId + in: path + description: The segment id. + required: true + schema: + type: integer + format: int32 + - name: container + in: path + description: 'The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.' + required: true + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: runtimeTicks + in: query + description: The position of the requested segment in ticks. + required: true + schema: + type: integer + format: int64 + - name: actualSegmentLengthTicks + in: query + description: The length of the requested segment in ticks. + required: true + schema: + type: integer + format: int64 + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + deprecated: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The desired segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. The maximum horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The maximum vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + - name: alwaysBurnInSubtitleWhenTranscoding + in: query + description: Whether to always burn in subtitles when transcoding. + schema: + type: boolean + default: false + responses: + "200": + description: Video stream returned. + content: + video/*: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{itemId}/live.m3u8: + get: + tags: + - DynamicHls + summary: Gets a hls live stream. + operationId: GetLiveHlsStream + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: query + description: The audio container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + deprecated: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: maxWidth + in: query + description: Optional. The max width. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The max height. + schema: + type: integer + format: int32 + - name: enableSubtitlesInManifest + in: query + description: Optional. Whether to enable subtitles in the manifest. + schema: + type: boolean + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + - name: alwaysBurnInSubtitleWhenTranscoding + in: query + description: Whether to always burn in subtitles when transcoding. + schema: + type: boolean + default: false + responses: + "200": + description: Hls live stream retrieved. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{itemId}/main.m3u8: + get: + tags: + - DynamicHls + summary: Gets a video stream using HTTP live streaming. + operationId: GetVariantHlsVideoPlaylist + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + deprecated: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. The maximum horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The maximum vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + - name: alwaysBurnInSubtitleWhenTranscoding + in: query + description: Whether to always burn in subtitles when transcoding. + schema: + type: boolean + default: false + responses: + "200": + description: Video stream returned. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{itemId}/master.m3u8: + get: + tags: + - DynamicHls + summary: Gets a video hls playlist stream. + operationId: GetMasterHlsVideoPlaylist + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + deprecated: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + required: true + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. The maximum horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The maximum vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAdaptiveBitrateStreaming + in: query + description: Enable adaptive bitrate streaming. + schema: + type: boolean + default: true + - name: enableTrickplay + in: query + description: Enable trickplay image playlists being added to master playlist. + schema: + type: boolean + default: true + - name: enableAudioVbrEncoding + in: query + description: Whether to enable Audio Encoding. + schema: + type: boolean + default: true + - name: alwaysBurnInSubtitleWhenTranscoding + in: query + description: Whether to always burn in subtitles when transcoding. + schema: + type: boolean + default: false + responses: + "200": + description: Video stream returned. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + head: + tags: + - DynamicHls + summary: Gets a video hls playlist stream. + operationId: HeadMasterHlsVideoPlaylist + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + deprecated: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + required: true + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. The maximum horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The maximum vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAdaptiveBitrateStreaming + in: query + description: Enable adaptive bitrate streaming. + schema: + type: boolean + default: true + - name: enableTrickplay + in: query + description: Enable trickplay image playlists being added to master playlist. + schema: + type: boolean + default: true + - name: enableAudioVbrEncoding + in: query + description: Whether to enable Audio Encoding. + schema: + type: boolean + default: true + - name: alwaysBurnInSubtitleWhenTranscoding + in: query + description: Whether to always burn in subtitles when transcoding. + schema: + type: boolean + default: false + responses: + "200": + description: Video stream returned. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Environment/DefaultDirectoryBrowser: + get: + tags: + - Environment + summary: Get Default directory browser. + operationId: GetDefaultDirectoryBrowser + responses: + "200": + description: Default directory browser returned. + content: + application/json: + schema: + $ref: '#/components/schemas/DefaultDirectoryBrowserInfoDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/DefaultDirectoryBrowserInfoDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/DefaultDirectoryBrowserInfoDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /Environment/DirectoryContents: + get: + tags: + - Environment + summary: Gets the contents of a given directory in the file system. + operationId: GetDirectoryContents + parameters: + - name: path + in: query + description: The path. + required: true + schema: + type: string + - name: includeFiles + in: query + description: An optional filter to include or exclude files from the results. true/false. + schema: + type: boolean + default: false + - name: includeDirectories + in: query + description: An optional filter to include or exclude folders from the results. true/false. + schema: + type: boolean + default: false + responses: + "200": + description: Directory contents returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /Environment/Drives: + get: + tags: + - Environment + summary: Gets available drives from the server's file system. + operationId: GetDrives + responses: + "200": + description: List of entries returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /Environment/NetworkShares: + get: + tags: + - Environment + summary: Gets network paths. + operationId: GetNetworkShares + responses: + "200": + description: Empty array returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /Environment/ParentPath: + get: + tags: + - Environment + summary: Gets the parent path of a given path. + operationId: GetParentPath + parameters: + - name: path + in: query + description: The path. + required: true + schema: + type: string + responses: + "200": + description: Success + content: + application/json: + schema: + type: string + application/json; profile="CamelCase": + schema: + type: string + application/json; profile="PascalCase": + schema: + type: string + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /Environment/ValidatePath: + post: + tags: + - Environment + summary: Validates path. + operationId: ValidatePath + requestBody: + description: Validate request object. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ValidatePathDto' + description: Validate path object. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/ValidatePathDto' + description: Validate path object. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/ValidatePathDto' + description: Validate path object. + required: true + responses: + "204": + description: Path validated. + "404": + description: Path not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /Items/Filters: + get: + tags: + - Filter + summary: Gets legacy query filters. + operationId: GetQueryFiltersLegacy + parameters: + - name: userId + in: query + description: Optional. User id. + schema: + type: string + format: uuid + - name: parentId + in: query + description: Optional. Parent id. + schema: + type: string + format: uuid + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: mediaTypes + in: query + description: Optional. Filter by MediaType. Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/MediaType' + responses: + "200": + description: Legacy filters retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryFiltersLegacy' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/QueryFiltersLegacy' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/QueryFiltersLegacy' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/Filters2: + get: + tags: + - Filter + summary: Gets query filters. + operationId: GetQueryFilters + parameters: + - name: userId + in: query + description: Optional. User id. + schema: + type: string + format: uuid + - name: parentId + in: query + description: Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: isAiring + in: query + description: Optional. Is item airing. + schema: + type: boolean + - name: isMovie + in: query + description: Optional. Is item movie. + schema: + type: boolean + - name: isSports + in: query + description: Optional. Is item sports. + schema: + type: boolean + - name: isKids + in: query + description: Optional. Is item kids. + schema: + type: boolean + - name: isNews + in: query + description: Optional. Is item news. + schema: + type: boolean + - name: isSeries + in: query + description: Optional. Is item series. + schema: + type: boolean + - name: recursive + in: query + description: Optional. Search recursive. + schema: + type: boolean + responses: + "200": + description: Filters retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryFilters' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/QueryFilters' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/QueryFilters' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Genres: + get: + tags: + - Genres + summary: Gets all genres from a given item, folder, or the entire library. + operationId: GetGenres + parameters: + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: searchTerm + in: query + description: The search term. + schema: + type: string + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: nameStartsWithOrGreater + in: query + description: Optional filter by items whose name is sorted equally or greater than a given input string. + schema: + type: string + - name: nameStartsWith + in: query + description: Optional filter by items whose name is sorted equally than a given input string. + schema: + type: string + - name: nameLessThan + in: query + description: Optional filter by items whose name is equally or lesser than a given input string. + schema: + type: string + - name: sortBy + in: query + description: Optional. Specify one or more sort orders, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/ItemSortBy' + - name: sortOrder + in: query + description: Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + - name: enableTotalRecordCount + in: query + description: Optional. Include total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Genres returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Genres/{genreName}: + get: + tags: + - Genres + summary: Gets a genre, by name. + operationId: GetGenre + parameters: + - name: genreName + in: path + description: The genre name. + required: true + schema: + type: string + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + responses: + "200": + description: Genres returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Audio/{itemId}/hls/{segmentId}/stream.aac: + get: + tags: + - HlsSegment + summary: Gets the specified audio segment for an audio item. + operationId: GetHlsAudioSegmentLegacyAac + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + - name: segmentId + in: path + description: The segment id. + required: true + schema: + type: string + responses: + "200": + description: Hls audio segment returned. + content: + audio/*: + schema: + type: string + format: binary + /Audio/{itemId}/hls/{segmentId}/stream.mp3: + get: + tags: + - HlsSegment + summary: Gets the specified audio segment for an audio item. + operationId: GetHlsAudioSegmentLegacyMp3 + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + - name: segmentId + in: path + description: The segment id. + required: true + schema: + type: string + responses: + "200": + description: Hls audio segment returned. + content: + audio/*: + schema: + type: string + format: binary + /Videos/{itemId}/hls/{playlistId}/{segmentId}.{segmentContainer}: + get: + tags: + - HlsSegment + summary: Gets a hls video segment. + operationId: GetHlsVideoSegmentLegacy + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + - name: segmentId + in: path + description: The segment id. + required: true + schema: + type: string + - name: segmentContainer + in: path + description: The segment container. + required: true + schema: + type: string + responses: + "200": + description: Hls video segment returned. + content: + video/*: + schema: + type: string + format: binary + "404": + description: Hls segment not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Videos/{itemId}/hls/{playlistId}/stream.m3u8: + get: + tags: + - HlsSegment + summary: Gets a hls video playlist. + operationId: GetHlsPlaylistLegacy + parameters: + - name: itemId + in: path + description: The video id. + required: true + schema: + type: string + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + responses: + "200": + description: Hls video playlist returned. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/ActiveEncodings: + delete: + tags: + - HlsSegment + summary: Stops an active encoding. + operationId: StopEncodingProcess + parameters: + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + required: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + required: true + schema: + type: string + responses: + "204": + description: Encoding stopped successfully. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Artists/{name}/Images/{imageType}/{imageIndex}: + get: + tags: + - Image + summary: Get artist image by name. + operationId: GetArtistImage + parameters: + - name: name + in: path + description: Artist name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get artist image by name. + operationId: HeadArtistImage + parameters: + - name: name + in: path + description: Artist name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Branding/Splashscreen: + get: + tags: + - Image + summary: Generates or gets the splashscreen. + operationId: GetSplashscreen + parameters: + - name: tag + in: query + description: Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Apply a foreground layer on top of the image. + schema: + type: string + - name: quality + in: query + description: Quality setting, from 0-100. + schema: + maximum: 100 + minimum: 0 + type: integer + format: int32 + default: 90 + responses: + "200": + description: Splashscreen returned successfully. + content: + image/*: + schema: + type: string + format: binary + post: + tags: + - Image + summary: "Uploads a custom splashscreen.\r\nThe body is expected to the image contents base64 encoded." + operationId: UploadCustomSplashscreen + requestBody: + content: + image/*: + schema: + type: string + format: binary + responses: + "204": + description: Successfully uploaded new splashscreen. + "400": + description: Error reading MimeType from uploaded image. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: User does not have permission to upload splashscreen.. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - RequiresElevation + delete: + tags: + - Image + summary: Delete a custom splashscreen. + operationId: DeleteCustomSplashscreen + responses: + "204": + description: Successfully deleted the custom splashscreen. + "403": + description: User does not have permission to delete splashscreen.. + "401": + description: Unauthorized + security: + - CustomAuthentication: + - RequiresElevation + /Genres/{name}/Images/{imageType}: + get: + tags: + - Image + summary: Get genre image by name. + operationId: GetGenreImage + parameters: + - name: name + in: path + description: Genre name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get genre image by name. + operationId: HeadGenreImage + parameters: + - name: name + in: path + description: Genre name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Genres/{name}/Images/{imageType}/{imageIndex}: + get: + tags: + - Image + summary: Get genre image by name. + operationId: GetGenreImageByIndex + parameters: + - name: name + in: path + description: Genre name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get genre image by name. + operationId: HeadGenreImageByIndex + parameters: + - name: name + in: path + description: Genre name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Items/{itemId}/Images: + get: + tags: + - Image + summary: Get item image infos. + operationId: GetItemImageInfos + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Item images returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ImageInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/ImageInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/ImageInfo' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/Images/{imageType}: + delete: + tags: + - Image + summary: Delete an item's image. + operationId: DeleteItemImage + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: query + description: The image index. + schema: + type: integer + format: int32 + responses: + "204": + description: Image deleted. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + post: + tags: + - Image + summary: Set item image. + operationId: SetItemImage + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + requestBody: + content: + image/*: + schema: + type: string + format: binary + responses: + "204": + description: Image saved. + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + get: + tags: + - Image + summary: Gets the item's image. + operationId: GetItemImage + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Gets the item's image. + operationId: HeadItemImage + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Items/{itemId}/Images/{imageType}/{imageIndex}: + delete: + tags: + - Image + summary: Delete an item's image. + operationId: DeleteItemImageByIndex + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: The image index. + required: true + schema: + type: integer + format: int32 + responses: + "204": + description: Image deleted. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + post: + tags: + - Image + summary: Set item image. + operationId: SetItemImageByIndex + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: (Unused) Image index. + required: true + schema: + type: integer + format: int32 + requestBody: + content: + image/*: + schema: + type: string + format: binary + responses: + "204": + description: Image saved. + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + get: + tags: + - Image + summary: Gets the item's image. + operationId: GetItemImageByIndex + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Gets the item's image. + operationId: HeadItemImageByIndex + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}: + get: + tags: + - Image + summary: Gets the item's image. + operationId: GetItemImage2 + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: maxWidth + in: path + description: The maximum image width to return. + required: true + schema: + type: integer + format: int32 + - name: maxHeight + in: path + description: The maximum image height to return. + required: true + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: tag + in: path + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + required: true + schema: + type: string + - name: format + in: path + description: Determines the output format of the image - original,gif,jpg,png. + required: true + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + description: Enum ImageOutputFormat. + - name: percentPlayed + in: path + description: Optional. Percent to render for the percent played overlay. + required: true + schema: + type: number + format: double + - name: unplayedCount + in: path + description: Optional. Unplayed count overlay to render. + required: true + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Gets the item's image. + operationId: HeadItemImage2 + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: maxWidth + in: path + description: The maximum image width to return. + required: true + schema: + type: integer + format: int32 + - name: maxHeight + in: path + description: The maximum image height to return. + required: true + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: tag + in: path + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + required: true + schema: + type: string + - name: format + in: path + description: Determines the output format of the image - original,gif,jpg,png. + required: true + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + description: Enum ImageOutputFormat. + - name: percentPlayed + in: path + description: Optional. Percent to render for the percent played overlay. + required: true + schema: + type: number + format: double + - name: unplayedCount + in: path + description: Optional. Unplayed count overlay to render. + required: true + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Items/{itemId}/Images/{imageType}/{imageIndex}/Index: + post: + tags: + - Image + summary: Updates the index for an item image. + operationId: UpdateItemImageIndex + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Old image index. + required: true + schema: + type: integer + format: int32 + - name: newIndex + in: query + description: New image index. + required: true + schema: + type: integer + format: int32 + responses: + "204": + description: Image index updated. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /MusicGenres/{name}/Images/{imageType}: + get: + tags: + - Image + summary: Get music genre image by name. + operationId: GetMusicGenreImage + parameters: + - name: name + in: path + description: Music genre name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get music genre image by name. + operationId: HeadMusicGenreImage + parameters: + - name: name + in: path + description: Music genre name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /MusicGenres/{name}/Images/{imageType}/{imageIndex}: + get: + tags: + - Image + summary: Get music genre image by name. + operationId: GetMusicGenreImageByIndex + parameters: + - name: name + in: path + description: Music genre name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get music genre image by name. + operationId: HeadMusicGenreImageByIndex + parameters: + - name: name + in: path + description: Music genre name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Persons/{name}/Images/{imageType}: + get: + tags: + - Image + summary: Get person image by name. + operationId: GetPersonImage + parameters: + - name: name + in: path + description: Person name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get person image by name. + operationId: HeadPersonImage + parameters: + - name: name + in: path + description: Person name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Persons/{name}/Images/{imageType}/{imageIndex}: + get: + tags: + - Image + summary: Get person image by name. + operationId: GetPersonImageByIndex + parameters: + - name: name + in: path + description: Person name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get person image by name. + operationId: HeadPersonImageByIndex + parameters: + - name: name + in: path + description: Person name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Studios/{name}/Images/{imageType}: + get: + tags: + - Image + summary: Get studio image by name. + operationId: GetStudioImage + parameters: + - name: name + in: path + description: Studio name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get studio image by name. + operationId: HeadStudioImage + parameters: + - name: name + in: path + description: Studio name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Studios/{name}/Images/{imageType}/{imageIndex}: + get: + tags: + - Image + summary: Get studio image by name. + operationId: GetStudioImageByIndex + parameters: + - name: name + in: path + description: Studio name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get studio image by name. + operationId: HeadStudioImageByIndex + parameters: + - name: name + in: path + description: Studio name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /UserImage: + post: + tags: + - Image + summary: Sets the user image. + operationId: PostUserImage + parameters: + - name: userId + in: query + description: User Id. + schema: + type: string + format: uuid + requestBody: + content: + image/*: + schema: + type: string + format: binary + responses: + "204": + description: Image updated. + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: User does not have permission to delete the image. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - Image + summary: Delete the user's image. + operationId: DeleteUserImage + parameters: + - name: userId + in: query + description: User Id. + schema: + type: string + format: uuid + responses: + "204": + description: Image deleted. + "403": + description: User does not have permission to delete the image. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + get: + tags: + - Image + summary: Get user profile image. + operationId: GetUserImage + parameters: + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "400": + description: User id not provided. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get user profile image. + operationId: HeadUserImage + parameters: + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "400": + description: User id not provided. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Albums/{itemId}/InstantMix: + get: + tags: + - InstantMix + summary: Creates an instant playlist based on a given album. + operationId: GetInstantMixFromAlbum + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Instant playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Artists/{itemId}/InstantMix: + get: + tags: + - InstantMix + summary: Creates an instant playlist based on a given artist. + operationId: GetInstantMixFromArtists + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Instant playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Artists/InstantMix: + get: + tags: + - InstantMix + summary: Creates an instant playlist based on a given artist. + operationId: GetInstantMixFromArtists2 + parameters: + - name: id + in: query + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Instant playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/InstantMix: + get: + tags: + - InstantMix + summary: Creates an instant playlist based on a given item. + operationId: GetInstantMixFromItem + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Instant playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /MusicGenres/{name}/InstantMix: + get: + tags: + - InstantMix + summary: Creates an instant playlist based on a given genre. + operationId: GetInstantMixFromMusicGenreByName + parameters: + - name: name + in: path + description: The genre name. + required: true + schema: + type: string + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Instant playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /MusicGenres/InstantMix: + get: + tags: + - InstantMix + summary: Creates an instant playlist based on a given genre. + operationId: GetInstantMixFromMusicGenreById + parameters: + - name: id + in: query + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Instant playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Playlists/{itemId}/InstantMix: + get: + tags: + - InstantMix + summary: Creates an instant playlist based on a given playlist. + operationId: GetInstantMixFromPlaylist + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Instant playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Songs/{itemId}/InstantMix: + get: + tags: + - InstantMix + summary: Creates an instant playlist based on a given song. + operationId: GetInstantMixFromSong + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Instant playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/ExternalIdInfos: + get: + tags: + - ItemLookup + summary: Get the item's external id info. + operationId: GetExternalIdInfos + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: External id info retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ExternalIdInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/ExternalIdInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/ExternalIdInfo' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /Items/RemoteSearch/Apply/{itemId}: + post: + tags: + - ItemLookup + summary: Applies search criteria to an item and refreshes metadata. + operationId: ApplySearchCriteria + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: replaceAllImages + in: query + description: 'Optional. Whether or not to replace all images. Default: True.' + schema: + type: boolean + default: true + requestBody: + description: The remote search result. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/RemoteSearchResult' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/RemoteSearchResult' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/RemoteSearchResult' + required: true + responses: + "204": + description: Item metadata refreshed. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /Items/RemoteSearch/Book: + post: + tags: + - ItemLookup + summary: Get book remote search. + operationId: GetBookRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/BookInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/BookInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/BookInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Book remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/RemoteSearch/BoxSet: + post: + tags: + - ItemLookup + summary: Get box set remote search. + operationId: GetBoxSetRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/BoxSetInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/BoxSetInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/BoxSetInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Box set remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/RemoteSearch/Movie: + post: + tags: + - ItemLookup + summary: Get movie remote search. + operationId: GetMovieRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/MovieInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/MovieInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/MovieInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Movie remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/RemoteSearch/MusicAlbum: + post: + tags: + - ItemLookup + summary: Get music album remote search. + operationId: GetMusicAlbumRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/AlbumInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/AlbumInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/AlbumInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Music album remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/RemoteSearch/MusicArtist: + post: + tags: + - ItemLookup + summary: Get music artist remote search. + operationId: GetMusicArtistRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ArtistInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/ArtistInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/ArtistInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Music artist remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/RemoteSearch/MusicVideo: + post: + tags: + - ItemLookup + summary: Get music video remote search. + operationId: GetMusicVideoRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/MusicVideoInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/MusicVideoInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/MusicVideoInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Music video remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/RemoteSearch/Person: + post: + tags: + - ItemLookup + summary: Get person remote search. + operationId: GetPersonRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PersonLookupInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/PersonLookupInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/PersonLookupInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Person remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /Items/RemoteSearch/Series: + post: + tags: + - ItemLookup + summary: Get series remote search. + operationId: GetSeriesRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Series remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/RemoteSearch/Trailer: + post: + tags: + - ItemLookup + summary: Get trailer remote search. + operationId: GetTrailerRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/TrailerInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/TrailerInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/TrailerInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Trailer remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/Refresh: + post: + tags: + - ItemRefresh + summary: Refreshes metadata for an item. + operationId: RefreshItem + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: metadataRefreshMode + in: query + description: (Optional) Specifies the metadata refresh mode. + schema: + enum: + - None + - ValidationOnly + - Default + - FullRefresh + allOf: + - $ref: '#/components/schemas/MetadataRefreshMode' + default: None + - name: imageRefreshMode + in: query + description: (Optional) Specifies the image refresh mode. + schema: + enum: + - None + - ValidationOnly + - Default + - FullRefresh + allOf: + - $ref: '#/components/schemas/MetadataRefreshMode' + default: None + - name: replaceAllMetadata + in: query + description: (Optional) Determines if metadata should be replaced. Only applicable if mode is FullRefresh. + schema: + type: boolean + default: false + - name: replaceAllImages + in: query + description: (Optional) Determines if images should be replaced. Only applicable if mode is FullRefresh. + schema: + type: boolean + default: false + - name: regenerateTrickplay + in: query + description: (Optional) Determines if trickplay images should be replaced. Only applicable if mode is FullRefresh. + schema: + type: boolean + default: false + responses: + "204": + description: Item metadata refresh queued. + "404": + description: Item to refresh not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Items: + get: + tags: + - Items + summary: Gets items based on a query. + operationId: GetItems + parameters: + - name: userId + in: query + description: The user id supplied as query parameter; this is required when not using an API key. + schema: + type: string + format: uuid + - name: maxOfficialRating + in: query + description: Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). + schema: + type: string + - name: hasThemeSong + in: query + description: Optional filter by items with theme songs. + schema: + type: boolean + - name: hasThemeVideo + in: query + description: Optional filter by items with theme videos. + schema: + type: boolean + - name: hasSubtitles + in: query + description: Optional filter by items with subtitles. + schema: + type: boolean + - name: hasSpecialFeature + in: query + description: Optional filter by items with special features. + schema: + type: boolean + - name: hasTrailer + in: query + description: Optional filter by items with trailers. + schema: + type: boolean + - name: adjacentTo + in: query + description: Optional. Return items that are siblings of a supplied item. + schema: + type: string + format: uuid + - name: indexNumber + in: query + description: Optional filter by index number. + schema: + type: integer + format: int32 + - name: parentIndexNumber + in: query + description: Optional filter by parent index number. + schema: + type: integer + format: int32 + - name: hasParentalRating + in: query + description: Optional filter by items that have or do not have a parental rating. + schema: + type: boolean + - name: isHd + in: query + description: Optional filter by items that are HD or not. + schema: + type: boolean + - name: is4K + in: query + description: Optional filter by items that are 4K or not. + schema: + type: boolean + - name: locationTypes + in: query + description: Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/LocationType' + - name: excludeLocationTypes + in: query + description: Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/LocationType' + - name: isMissing + in: query + description: Optional filter by items that are missing episodes or not. + schema: + type: boolean + - name: isUnaired + in: query + description: Optional filter by items that are unaired episodes or not. + schema: + type: boolean + - name: minCommunityRating + in: query + description: Optional filter by minimum community rating. + schema: + type: number + format: double + - name: minCriticRating + in: query + description: Optional filter by minimum critic rating. + schema: + type: number + format: double + - name: minPremiereDate + in: query + description: Optional. The minimum premiere date. Format = ISO. + schema: + type: string + format: date-time + - name: minDateLastSaved + in: query + description: Optional. The minimum last saved date. Format = ISO. + schema: + type: string + format: date-time + - name: minDateLastSavedForUser + in: query + description: Optional. The minimum last saved date for the current user. Format = ISO. + schema: + type: string + format: date-time + - name: maxPremiereDate + in: query + description: Optional. The maximum premiere date. Format = ISO. + schema: + type: string + format: date-time + - name: hasOverview + in: query + description: Optional filter by items that have an overview or not. + schema: + type: boolean + - name: hasImdbId + in: query + description: Optional filter by items that have an IMDb id or not. + schema: + type: boolean + - name: hasTmdbId + in: query + description: Optional filter by items that have a TMDb id or not. + schema: + type: boolean + - name: hasTvdbId + in: query + description: Optional filter by items that have a TVDb id or not. + schema: + type: boolean + - name: isMovie + in: query + description: Optional filter for live tv movies. + schema: + type: boolean + - name: isSeries + in: query + description: Optional filter for live tv series. + schema: + type: boolean + - name: isNews + in: query + description: Optional filter for live tv news. + schema: + type: boolean + - name: isKids + in: query + description: Optional filter for live tv kids. + schema: + type: boolean + - name: isSports + in: query + description: Optional filter for live tv sports. + schema: + type: boolean + - name: excludeItemIds + in: query + description: Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited. + schema: + type: array + items: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: recursive + in: query + description: When searching within folders, this determines whether or not the search will be recursive. true/false. + schema: + type: boolean + - name: searchTerm + in: query + description: Optional. Filter based on a search term. + schema: + type: string + - name: sortOrder + in: query + description: Sort Order - Ascending, Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: filters + in: query + description: 'Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFilter' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. + schema: + type: boolean + - name: mediaTypes + in: query + description: Optional filter by MediaType. Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/MediaType' + - name: imageTypes + in: query + description: Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: sortBy + in: query + description: 'Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemSortBy' + - name: isPlayed + in: query + description: Optional filter by items that are played, or not. + schema: + type: boolean + - name: genres + in: query + description: Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: officialRatings + in: query + description: Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: tags + in: query + description: Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: years + in: query + description: Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. + schema: + type: array + items: + type: integer + format: int32 + - name: enableUserData + in: query + description: Optional, include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: person + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person. + schema: + type: string + - name: personIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person id. + schema: + type: array + items: + type: string + format: uuid + - name: personTypes + in: query + description: Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. + schema: + type: array + items: + type: string + - name: studios + in: query + description: Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: artists + in: query + description: Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: excludeArtistIds + in: query + description: Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: artistIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified artist id. + schema: + type: array + items: + type: string + format: uuid + - name: albumArtistIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified album artist id. + schema: + type: array + items: + type: string + format: uuid + - name: contributingArtistIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified contributing artist id. + schema: + type: array + items: + type: string + format: uuid + - name: albums + in: query + description: Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: albumIds + in: query + description: Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: ids + in: query + description: Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited. + schema: + type: array + items: + type: string + format: uuid + - name: videoTypes + in: query + description: Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/VideoType' + - name: minOfficialRating + in: query + description: Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). + schema: + type: string + - name: isLocked + in: query + description: Optional filter by items that are locked. + schema: + type: boolean + - name: isPlaceHolder + in: query + description: Optional filter by items that are placeholders. + schema: + type: boolean + - name: hasOfficialRating + in: query + description: Optional filter by items that have official ratings. + schema: + type: boolean + - name: collapseBoxSetItems + in: query + description: Whether or not to hide items behind their boxsets. + schema: + type: boolean + - name: minWidth + in: query + description: Optional. Filter by the minimum width of the item. + schema: + type: integer + format: int32 + - name: minHeight + in: query + description: Optional. Filter by the minimum height of the item. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. Filter by the maximum width of the item. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. Filter by the maximum height of the item. + schema: + type: integer + format: int32 + - name: is3D + in: query + description: Optional filter by items that are 3D, or not. + schema: + type: boolean + - name: seriesStatus + in: query + description: Optional filter by Series Status. Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/SeriesStatus' + - name: nameStartsWithOrGreater + in: query + description: Optional filter by items whose name is sorted equally or greater than a given input string. + schema: + type: string + - name: nameStartsWith + in: query + description: Optional filter by items whose name is sorted equally than a given input string. + schema: + type: string + - name: nameLessThan + in: query + description: Optional filter by items whose name is equally or lesser than a given input string. + schema: + type: string + - name: studioIds + in: query + description: Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: genreIds + in: query + description: Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: enableTotalRecordCount + in: query + description: Optional. Enable the total record count. + schema: + type: boolean + default: true + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - Library + summary: Deletes items from the library and filesystem. + operationId: DeleteItems + parameters: + - name: ids + in: query + description: The item ids. + schema: + type: array + items: + type: string + format: uuid + responses: + "204": + description: Items deleted. + "401": + description: Unauthorized access. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /UserItems/{itemId}/UserData: + get: + tags: + - Items + summary: Get Item User Data. + operationId: GetItemUserData + parameters: + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: return item user data. + content: + application/json: + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + "404": + description: Item is not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + post: + tags: + - Items + summary: Update Item User Data. + operationId: UpdateItemUserData + parameters: + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + requestBody: + description: New user data object. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateUserItemDataDto' + description: This is used by the api to get information about a item user data. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateUserItemDataDto' + description: This is used by the api to get information about a item user data. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateUserItemDataDto' + description: This is used by the api to get information about a item user data. + required: true + responses: + "200": + description: return updated user item data. + content: + application/json: + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + "404": + description: Item is not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /UserItems/Resume: + get: + tags: + - Items + summary: Gets items based on a query. + operationId: GetResumeItems + parameters: + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: The start index. + schema: + type: integer + format: int32 + - name: limit + in: query + description: The item limit. + schema: + type: integer + format: int32 + - name: searchTerm + in: query + description: The search term. + schema: + type: string + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: mediaTypes + in: query + description: Optional. Filter by MediaType. Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/MediaType' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: enableTotalRecordCount + in: query + description: Optional. Enable the total record count. + schema: + type: boolean + default: true + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + default: true + - name: excludeActiveSessions + in: query + description: Optional. Whether to exclude the currently active sessions. + schema: + type: boolean + default: false + responses: + "200": + description: Items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}: + post: + tags: + - ItemUpdate + summary: Updates an item. + operationId: UpdateItem + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + requestBody: + description: The new item properties. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + text/json: + schema: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + required: true + responses: + "204": + description: Item updated. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + delete: + tags: + - Library + summary: Deletes an item from the library and filesystem. + operationId: DeleteItem + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: Item deleted. + "401": + description: Unauthorized access. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + get: + tags: + - UserLibrary + summary: Gets an item from a user's library. + operationId: GetItem + parameters: + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Item returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/ContentType: + post: + tags: + - ItemUpdate + summary: Updates an item's content type. + operationId: UpdateItemContentType + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: contentType + in: query + description: The content type of the item. + schema: + type: string + responses: + "204": + description: Item content type updated. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Items/{itemId}/MetadataEditor: + get: + tags: + - ItemUpdate + summary: Gets metadata editor info for an item. + operationId: GetMetadataEditorInfo + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Item metadata editor returned. + content: + application/json: + schema: + $ref: '#/components/schemas/MetadataEditorInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/MetadataEditorInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/MetadataEditorInfo' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Albums/{itemId}/Similar: + get: + tags: + - Library + summary: Gets similar items. + operationId: GetSimilarAlbums + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: excludeArtistIds + in: query + description: Exclude artist ids. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + responses: + "200": + description: Similar items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Artists/{itemId}/Similar: + get: + tags: + - Library + summary: Gets similar items. + operationId: GetSimilarArtists + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: excludeArtistIds + in: query + description: Exclude artist ids. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + responses: + "200": + description: Similar items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/Ancestors: + get: + tags: + - Library + summary: Gets all parents of an item. + operationId: GetAncestors + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Item parents returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/CriticReviews: + get: + tags: + - Library + summary: Gets critic review for an item. + operationId: GetCriticReviews + parameters: + - name: itemId + in: path + required: true + schema: + type: string + responses: + "200": + description: Critic reviews returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/Download: + get: + tags: + - Library + summary: Downloads item media. + operationId: GetDownload + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Media downloaded. + content: + video/*: + schema: + type: string + format: binary + audio/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - Download + - DefaultAuthorization + /Items/{itemId}/File: + get: + tags: + - Library + summary: Get the original file of an item. + operationId: GetFile + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: File stream returned. + content: + video/*: + schema: + type: string + format: binary + audio/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/Similar: + get: + tags: + - Library + summary: Gets similar items. + operationId: GetSimilarItems + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: excludeArtistIds + in: query + description: Exclude artist ids. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + responses: + "200": + description: Similar items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/ThemeMedia: + get: + tags: + - Library + summary: Get theme songs and videos for an item. + operationId: GetThemeMedia + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: inheritFromParent + in: query + description: Optional. Determines whether or not parent items should be searched for theme media. + schema: + type: boolean + default: false + - name: sortBy + in: query + description: 'Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemSortBy' + - name: sortOrder + in: query + description: Optional. Sort Order - Ascending, Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + responses: + "200": + description: Theme songs and videos returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AllThemeMediaResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/AllThemeMediaResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/AllThemeMediaResult' + "404": + description: Item not found. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/ThemeSongs: + get: + tags: + - Library + summary: Get theme songs for an item. + operationId: GetThemeSongs + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: inheritFromParent + in: query + description: Optional. Determines whether or not parent items should be searched for theme media. + schema: + type: boolean + default: false + - name: sortBy + in: query + description: 'Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemSortBy' + - name: sortOrder + in: query + description: Optional. Sort Order - Ascending, Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + responses: + "200": + description: Theme songs returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ThemeMediaResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ThemeMediaResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ThemeMediaResult' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/ThemeVideos: + get: + tags: + - Library + summary: Get theme videos for an item. + operationId: GetThemeVideos + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: inheritFromParent + in: query + description: Optional. Determines whether or not parent items should be searched for theme media. + schema: + type: boolean + default: false + - name: sortBy + in: query + description: 'Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemSortBy' + - name: sortOrder + in: query + description: Optional. Sort Order - Ascending, Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + responses: + "200": + description: Theme videos returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ThemeMediaResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ThemeMediaResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ThemeMediaResult' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/Counts: + get: + tags: + - Library + summary: Get item counts. + operationId: GetItemCounts + parameters: + - name: userId + in: query + description: Optional. Get counts from a specific user's library. + schema: + type: string + format: uuid + - name: isFavorite + in: query + description: Optional. Get counts of favorite items. + schema: + type: boolean + responses: + "200": + description: Item counts returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ItemCounts' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ItemCounts' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ItemCounts' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Libraries/AvailableOptions: + get: + tags: + - Library + summary: Gets the library options info. + operationId: GetLibraryOptionsInfo + parameters: + - name: libraryContentType + in: query + description: Library content type. + schema: + enum: + - unknown + - movies + - tvshows + - music + - musicvideos + - trailers + - homevideos + - boxsets + - books + - photos + - livetv + - playlists + - folders + allOf: + - $ref: '#/components/schemas/CollectionType' + - name: isNewLibrary + in: query + description: Whether this is a new library. + schema: + type: boolean + default: false + responses: + "200": + description: Library options info returned. + content: + application/json: + schema: + $ref: '#/components/schemas/LibraryOptionsResultDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/LibraryOptionsResultDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/LibraryOptionsResultDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrDefault + - DefaultAuthorization + /Library/Media/Updated: + post: + tags: + - Library + summary: Reports that new movies have been added by an external source. + operationId: PostUpdatedMedia + requestBody: + description: The update paths. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/MediaUpdateInfoDto' + description: Media Update Info Dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/MediaUpdateInfoDto' + description: Media Update Info Dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/MediaUpdateInfoDto' + description: Media Update Info Dto. + required: true + responses: + "204": + description: Report success. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Library/MediaFolders: + get: + tags: + - Library + summary: Gets all user media folders. + operationId: GetMediaFolders + parameters: + - name: isHidden + in: query + description: Optional. Filter by folders that are marked hidden, or not. + schema: + type: boolean + responses: + "200": + description: Media folders returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Library/Movies/Added: + post: + tags: + - Library + summary: Reports that new movies have been added by an external source. + operationId: PostAddedMovies + parameters: + - name: tmdbId + in: query + description: The tmdbId. + schema: + type: string + - name: imdbId + in: query + description: The imdbId. + schema: + type: string + responses: + "204": + description: Report success. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Library/Movies/Updated: + post: + tags: + - Library + summary: Reports that new movies have been added by an external source. + operationId: PostUpdatedMovies + parameters: + - name: tmdbId + in: query + description: The tmdbId. + schema: + type: string + - name: imdbId + in: query + description: The imdbId. + schema: + type: string + responses: + "204": + description: Report success. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Library/PhysicalPaths: + get: + tags: + - Library + summary: Gets a list of physical paths from virtual folders. + operationId: GetPhysicalPaths + responses: + "200": + description: Physical paths returned. + content: + application/json: + schema: + type: array + items: + type: string + application/json; profile="CamelCase": + schema: + type: array + items: + type: string + application/json; profile="PascalCase": + schema: + type: array + items: + type: string + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Library/Refresh: + post: + tags: + - Library + summary: Starts a library scan. + operationId: RefreshLibrary + responses: + "204": + description: Library scan started. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Library/Series/Added: + post: + tags: + - Library + summary: Reports that new episodes of a series have been added by an external source. + operationId: PostAddedSeries + parameters: + - name: tvdbId + in: query + description: The tvdbId. + schema: + type: string + responses: + "204": + description: Report success. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Library/Series/Updated: + post: + tags: + - Library + summary: Reports that new episodes of a series have been added by an external source. + operationId: PostUpdatedSeries + parameters: + - name: tvdbId + in: query + description: The tvdbId. + schema: + type: string + responses: + "204": + description: Report success. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Movies/{itemId}/Similar: + get: + tags: + - Library + summary: Gets similar items. + operationId: GetSimilarMovies + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: excludeArtistIds + in: query + description: Exclude artist ids. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + responses: + "200": + description: Similar items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Shows/{itemId}/Similar: + get: + tags: + - Library + summary: Gets similar items. + operationId: GetSimilarShows + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: excludeArtistIds + in: query + description: Exclude artist ids. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + responses: + "200": + description: Similar items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Trailers/{itemId}/Similar: + get: + tags: + - Library + summary: Gets similar items. + operationId: GetSimilarTrailers + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: excludeArtistIds + in: query + description: Exclude artist ids. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + responses: + "200": + description: Similar items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Library/VirtualFolders: + get: + tags: + - LibraryStructure + summary: Gets all virtual folders. + operationId: GetVirtualFolders + responses: + "200": + description: Virtual folders retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/VirtualFolderInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/VirtualFolderInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/VirtualFolderInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + post: + tags: + - LibraryStructure + summary: Adds a virtual folder. + operationId: AddVirtualFolder + parameters: + - name: name + in: query + description: The name of the virtual folder. + schema: + type: string + - name: collectionType + in: query + description: The type of the collection. + schema: + enum: + - movies + - tvshows + - music + - musicvideos + - homevideos + - boxsets + - books + - mixed + allOf: + - $ref: '#/components/schemas/CollectionTypeOptions' + - name: paths + in: query + description: The paths of the virtual folder. + schema: + type: array + items: + type: string + - name: refreshLibrary + in: query + description: Whether to refresh the library. + schema: + type: boolean + default: false + requestBody: + description: The library options. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/AddVirtualFolderDto' + description: Add virtual folder dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/AddVirtualFolderDto' + description: Add virtual folder dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/AddVirtualFolderDto' + description: Add virtual folder dto. + responses: + "204": + description: Folder added. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + delete: + tags: + - LibraryStructure + summary: Removes a virtual folder. + operationId: RemoveVirtualFolder + parameters: + - name: name + in: query + description: The name of the folder. + schema: + type: string + - name: refreshLibrary + in: query + description: Whether to refresh the library. + schema: + type: boolean + default: false + responses: + "204": + description: Folder removed. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /Library/VirtualFolders/LibraryOptions: + post: + tags: + - LibraryStructure + summary: Update library options. + operationId: UpdateLibraryOptions + requestBody: + description: The library name and options. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateLibraryOptionsDto' + description: Update library options dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateLibraryOptionsDto' + description: Update library options dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateLibraryOptionsDto' + description: Update library options dto. + responses: + "204": + description: Library updated. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /Library/VirtualFolders/Name: + post: + tags: + - LibraryStructure + summary: Renames a virtual folder. + operationId: RenameVirtualFolder + parameters: + - name: name + in: query + description: The name of the virtual folder. + schema: + type: string + - name: newName + in: query + description: The new name. + schema: + type: string + - name: refreshLibrary + in: query + description: Whether to refresh the library. + schema: + type: boolean + default: false + responses: + "204": + description: Folder renamed. + "404": + description: Library doesn't exist. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "409": + description: Library already exists. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /Library/VirtualFolders/Paths: + post: + tags: + - LibraryStructure + summary: Add a media path to a library. + operationId: AddMediaPath + parameters: + - name: refreshLibrary + in: query + description: Whether to refresh the library. + schema: + type: boolean + default: false + requestBody: + description: The media path dto. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/MediaPathDto' + description: Media Path dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/MediaPathDto' + description: Media Path dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/MediaPathDto' + description: Media Path dto. + required: true + responses: + "204": + description: Media path added. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + delete: + tags: + - LibraryStructure + summary: Remove a media path. + operationId: RemoveMediaPath + parameters: + - name: name + in: query + description: The name of the library. + schema: + type: string + - name: path + in: query + description: The path to remove. + schema: + type: string + - name: refreshLibrary + in: query + description: Whether to refresh the library. + schema: + type: boolean + default: false + responses: + "204": + description: Media path removed. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /Library/VirtualFolders/Paths/Update: + post: + tags: + - LibraryStructure + summary: Updates a media path. + operationId: UpdateMediaPath + requestBody: + description: The name of the library and path infos. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateMediaPathRequestDto' + description: Update library options dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateMediaPathRequestDto' + description: Update library options dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateMediaPathRequestDto' + description: Update library options dto. + required: true + responses: + "204": + description: Media path updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /LiveTv/ChannelMappingOptions: + get: + tags: + - LiveTv + summary: Get channel mapping options. + operationId: GetChannelMappingOptions + parameters: + - name: providerId + in: query + description: Provider id. + schema: + type: string + responses: + "200": + description: Channel mapping options returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ChannelMappingOptionsDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ChannelMappingOptionsDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ChannelMappingOptionsDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/ChannelMappings: + post: + tags: + - LiveTv + summary: Set channel mappings. + operationId: SetChannelMapping + requestBody: + description: The set channel mapping dto. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SetChannelMappingDto' + description: Set channel mapping dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/SetChannelMappingDto' + description: Set channel mapping dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/SetChannelMappingDto' + description: Set channel mapping dto. + required: true + responses: + "200": + description: Created channel mapping returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TunerChannelMapping' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/TunerChannelMapping' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/TunerChannelMapping' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + - DefaultAuthorization + /LiveTv/Channels: + get: + tags: + - LiveTv + summary: Gets available live tv channels. + operationId: GetLiveTvChannels + parameters: + - name: type + in: query + description: Optional. Filter by channel type. + schema: + enum: + - TV + - Radio + allOf: + - $ref: '#/components/schemas/ChannelType' + - name: userId + in: query + description: Optional. Filter by user and attach user data. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: isMovie + in: query + description: Optional. Filter for movies. + schema: + type: boolean + - name: isSeries + in: query + description: Optional. Filter for series. + schema: + type: boolean + - name: isNews + in: query + description: Optional. Filter for news. + schema: + type: boolean + - name: isKids + in: query + description: Optional. Filter for kids. + schema: + type: boolean + - name: isSports + in: query + description: Optional. Filter for sports. + schema: + type: boolean + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: isFavorite + in: query + description: Optional. Filter by channels that are favorites, or not. + schema: + type: boolean + - name: isLiked + in: query + description: Optional. Filter by channels that are liked, or not. + schema: + type: boolean + - name: isDisliked + in: query + description: Optional. Filter by channels that are disliked, or not. + schema: + type: boolean + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: '"Optional. The image types to include in the output.' + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: sortBy + in: query + description: Optional. Key to sort by. + schema: + type: array + items: + $ref: '#/components/schemas/ItemSortBy' + - name: sortOrder + in: query + description: Optional. Sort order. + schema: + enum: + - Ascending + - Descending + allOf: + - $ref: '#/components/schemas/SortOrder' + - name: enableFavoriteSorting + in: query + description: Optional. Incorporate favorite and like status into channel sorting. + schema: + type: boolean + default: false + - name: addCurrentProgram + in: query + description: Optional. Adds current program info to each channel. + schema: + type: boolean + default: true + responses: + "200": + description: Available live tv channels returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/Channels/{channelId}: + get: + tags: + - LiveTv + summary: Gets a live tv channel. + operationId: GetChannel + parameters: + - name: channelId + in: path + description: Channel id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Live tv channel returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/GuideInfo: + get: + tags: + - LiveTv + summary: Get guid info. + operationId: GetGuideInfo + responses: + "200": + description: Guid info returned. + content: + application/json: + schema: + $ref: '#/components/schemas/GuideInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/GuideInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/GuideInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/Info: + get: + tags: + - LiveTv + summary: Gets available live tv services. + operationId: GetLiveTvInfo + responses: + "200": + description: Available live tv services returned. + content: + application/json: + schema: + $ref: '#/components/schemas/LiveTvInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/LiveTvInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/LiveTvInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/ListingProviders: + post: + tags: + - LiveTv + summary: Adds a listings provider. + operationId: AddListingProvider + parameters: + - name: pw + in: query + description: Password. + schema: + type: string + - name: validateListings + in: query + description: Validate listings. + schema: + type: boolean + default: false + - name: validateLogin + in: query + description: Validate login. + schema: + type: boolean + default: false + requestBody: + description: New listings info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ListingsProviderInfo' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/ListingsProviderInfo' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/ListingsProviderInfo' + responses: + "200": + description: Created listings provider returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ListingsProviderInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ListingsProviderInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ListingsProviderInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + - DefaultAuthorization + delete: + tags: + - LiveTv + summary: Delete listing provider. + operationId: DeleteListingProvider + parameters: + - name: id + in: query + description: Listing provider id. + schema: + type: string + responses: + "204": + description: Listing provider deleted. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + - DefaultAuthorization + /LiveTv/ListingProviders/Default: + get: + tags: + - LiveTv + summary: Gets default listings provider info. + operationId: GetDefaultListingProvider + responses: + "200": + description: Default listings provider info returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ListingsProviderInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ListingsProviderInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ListingsProviderInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/ListingProviders/Lineups: + get: + tags: + - LiveTv + summary: Gets available lineups. + operationId: GetLineups + parameters: + - name: id + in: query + description: Provider id. + schema: + type: string + - name: type + in: query + description: Provider type. + schema: + type: string + - name: location + in: query + description: Location. + schema: + type: string + - name: country + in: query + description: Country. + schema: + type: string + responses: + "200": + description: Available lineups returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/ListingProviders/SchedulesDirect/Countries: + get: + tags: + - LiveTv + summary: Gets available countries. + operationId: GetSchedulesDirectCountries + responses: + "200": + description: Available countries returned. + content: + application/json: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/LiveRecordings/{recordingId}/stream: + get: + tags: + - LiveTv + summary: Gets a live tv recording stream. + operationId: GetLiveRecordingFile + parameters: + - name: recordingId + in: path + description: Recording id. + required: true + schema: + type: string + responses: + "200": + description: Recording stream returned. + content: + video/*: + schema: + type: string + format: binary + "404": + description: Recording not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /LiveTv/LiveStreamFiles/{streamId}/stream.{container}: + get: + tags: + - LiveTv + summary: Gets a live tv channel stream. + operationId: GetLiveStreamFile + parameters: + - name: streamId + in: path + description: Stream id. + required: true + schema: + type: string + - name: container + in: path + description: Container type. + required: true + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + responses: + "200": + description: Stream returned. + content: + video/*: + schema: + type: string + format: binary + "404": + description: Stream not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /LiveTv/Programs: + get: + tags: + - LiveTv + summary: Gets available live tv epgs. + operationId: GetLiveTvPrograms + parameters: + - name: channelIds + in: query + description: The channels to return guide information for. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id. + schema: + type: string + format: uuid + - name: minStartDate + in: query + description: Optional. The minimum premiere start date. + schema: + type: string + format: date-time + - name: hasAired + in: query + description: Optional. Filter by programs that have completed airing, or not. + schema: + type: boolean + - name: isAiring + in: query + description: Optional. Filter by programs that are currently airing, or not. + schema: + type: boolean + - name: maxStartDate + in: query + description: Optional. The maximum premiere start date. + schema: + type: string + format: date-time + - name: minEndDate + in: query + description: Optional. The minimum premiere end date. + schema: + type: string + format: date-time + - name: maxEndDate + in: query + description: Optional. The maximum premiere end date. + schema: + type: string + format: date-time + - name: isMovie + in: query + description: Optional. Filter for movies. + schema: + type: boolean + - name: isSeries + in: query + description: Optional. Filter for series. + schema: + type: boolean + - name: isNews + in: query + description: Optional. Filter for news. + schema: + type: boolean + - name: isKids + in: query + description: Optional. Filter for kids. + schema: + type: boolean + - name: isSports + in: query + description: Optional. Filter for sports. + schema: + type: boolean + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: sortBy + in: query + description: 'Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemSortBy' + - name: sortOrder + in: query + description: Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: genres + in: query + description: The genres to return guide information for. + schema: + type: array + items: + type: string + - name: genreIds + in: query + description: The genre ids to return guide information for. + schema: + type: array + items: + type: string + format: uuid + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: seriesTimerId + in: query + description: Optional. Filter by series timer id. + schema: + type: string + - name: librarySeriesId + in: query + description: Optional. Filter by library series id. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableTotalRecordCount + in: query + description: Retrieve total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Live tv epgs returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + post: + tags: + - LiveTv + summary: Gets available live tv epgs. + operationId: GetPrograms + requestBody: + description: Request body. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/GetProgramsDto' + description: Get programs dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/GetProgramsDto' + description: Get programs dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/GetProgramsDto' + description: Get programs dto. + responses: + "200": + description: Live tv epgs returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/Programs/{programId}: + get: + tags: + - LiveTv + summary: Gets a live tv program. + operationId: GetProgram + parameters: + - name: programId + in: path + description: Program id. + required: true + schema: + type: string + - name: userId + in: query + description: Optional. Attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Program returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/Programs/Recommended: + get: + tags: + - LiveTv + summary: Gets recommended live tv epgs. + operationId: GetRecommendedPrograms + parameters: + - name: userId + in: query + description: Optional. filter by user id. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: isAiring + in: query + description: Optional. Filter by programs that are currently airing, or not. + schema: + type: boolean + - name: hasAired + in: query + description: Optional. Filter by programs that have completed airing, or not. + schema: + type: boolean + - name: isSeries + in: query + description: Optional. Filter for series. + schema: + type: boolean + - name: isMovie + in: query + description: Optional. Filter for movies. + schema: + type: boolean + - name: isNews + in: query + description: Optional. Filter for news. + schema: + type: boolean + - name: isKids + in: query + description: Optional. Filter for kids. + schema: + type: boolean + - name: isSports + in: query + description: Optional. Filter for sports. + schema: + type: boolean + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: genreIds + in: query + description: The genres to return guide information for. + schema: + type: array + items: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableUserData + in: query + description: Optional. include user data. + schema: + type: boolean + - name: enableTotalRecordCount + in: query + description: Retrieve total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Recommended epgs returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/Recordings: + get: + tags: + - LiveTv + summary: Gets live tv recordings. + operationId: GetRecordings + parameters: + - name: channelId + in: query + description: Optional. Filter by channel id. + schema: + type: string + - name: userId + in: query + description: Optional. Filter by user and attach user data. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: status + in: query + description: Optional. Filter by recording status. + schema: + enum: + - New + - InProgress + - Completed + - Cancelled + - ConflictedOk + - ConflictedNotOk + - Error + allOf: + - $ref: '#/components/schemas/RecordingStatus' + - name: isInProgress + in: query + description: Optional. Filter by recordings that are in progress, or not. + schema: + type: boolean + - name: seriesTimerId + in: query + description: Optional. Filter by recordings belonging to a series timer. + schema: + type: string + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: isMovie + in: query + description: Optional. Filter for movies. + schema: + type: boolean + - name: isSeries + in: query + description: Optional. Filter for series. + schema: + type: boolean + - name: isKids + in: query + description: Optional. Filter for kids. + schema: + type: boolean + - name: isSports + in: query + description: Optional. Filter for sports. + schema: + type: boolean + - name: isNews + in: query + description: Optional. Filter for news. + schema: + type: boolean + - name: isLibraryItem + in: query + description: Optional. Filter for is library item. + schema: + type: boolean + - name: enableTotalRecordCount + in: query + description: Optional. Return total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Live tv recordings returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/Recordings/{recordingId}: + get: + tags: + - LiveTv + summary: Gets a live tv recording. + operationId: GetRecording + parameters: + - name: recordingId + in: path + description: Recording id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Recording returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + delete: + tags: + - LiveTv + summary: Deletes a live tv recording. + operationId: DeleteRecording + parameters: + - name: recordingId + in: path + description: Recording id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: Recording deleted. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + - DefaultAuthorization + /LiveTv/Recordings/Folders: + get: + tags: + - LiveTv + summary: Gets recording folders. + operationId: GetRecordingFolders + parameters: + - name: userId + in: query + description: Optional. Filter by user and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Recording folders returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/Recordings/Groups: + get: + tags: + - LiveTv + summary: Gets live tv recording groups. + operationId: GetRecordingGroups + parameters: + - name: userId + in: query + description: Optional. Filter by user and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Recording groups returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/Recordings/Groups/{groupId}: + get: + tags: + - LiveTv + summary: Get recording group. + operationId: GetRecordingGroup + parameters: + - name: groupId + in: path + description: Group id. + required: true + schema: + type: string + format: uuid + responses: + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/Recordings/Series: + get: + tags: + - LiveTv + summary: Gets live tv recording series. + operationId: GetRecordingsSeries + parameters: + - name: channelId + in: query + description: Optional. Filter by channel id. + schema: + type: string + - name: userId + in: query + description: Optional. Filter by user and attach user data. + schema: + type: string + format: uuid + - name: groupId + in: query + description: Optional. Filter by recording group. + schema: + type: string + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: status + in: query + description: Optional. Filter by recording status. + schema: + enum: + - New + - InProgress + - Completed + - Cancelled + - ConflictedOk + - ConflictedNotOk + - Error + allOf: + - $ref: '#/components/schemas/RecordingStatus' + - name: isInProgress + in: query + description: Optional. Filter by recordings that are in progress, or not. + schema: + type: boolean + - name: seriesTimerId + in: query + description: Optional. Filter by recordings belonging to a series timer. + schema: + type: string + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: enableTotalRecordCount + in: query + description: Optional. Return total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Live tv recordings returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/SeriesTimers: + get: + tags: + - LiveTv + summary: Gets live tv series timers. + operationId: GetSeriesTimers + parameters: + - name: sortBy + in: query + description: Optional. Sort by SortName or Priority. + schema: + type: string + - name: sortOrder + in: query + description: Optional. Sort in Ascending or Descending order. + schema: + enum: + - Ascending + - Descending + allOf: + - $ref: '#/components/schemas/SortOrder' + responses: + "200": + description: Timers returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SeriesTimerInfoDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/SeriesTimerInfoDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/SeriesTimerInfoDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + post: + tags: + - LiveTv + summary: Creates a live tv series timer. + operationId: CreateSeriesTimer + requestBody: + description: New series timer info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesTimerInfoDto' + description: Class SeriesTimerInfoDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesTimerInfoDto' + description: Class SeriesTimerInfoDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesTimerInfoDto' + description: Class SeriesTimerInfoDto. + responses: + "204": + description: Series timer info created. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + - DefaultAuthorization + /LiveTv/SeriesTimers/{timerId}: + get: + tags: + - LiveTv + summary: Gets a live tv series timer. + operationId: GetSeriesTimer + parameters: + - name: timerId + in: path + description: Timer id. + required: true + schema: + type: string + responses: + "200": + description: Series timer returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SeriesTimerInfoDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/SeriesTimerInfoDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/SeriesTimerInfoDto' + "404": + description: Series timer not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + delete: + tags: + - LiveTv + summary: Cancels a live tv series timer. + operationId: CancelSeriesTimer + parameters: + - name: timerId + in: path + description: Timer id. + required: true + schema: + type: string + responses: + "204": + description: Timer cancelled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + - DefaultAuthorization + post: + tags: + - LiveTv + summary: Updates a live tv series timer. + operationId: UpdateSeriesTimer + parameters: + - name: timerId + in: path + description: Timer id. + required: true + schema: + type: string + requestBody: + description: New series timer info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesTimerInfoDto' + description: Class SeriesTimerInfoDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesTimerInfoDto' + description: Class SeriesTimerInfoDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesTimerInfoDto' + description: Class SeriesTimerInfoDto. + responses: + "204": + description: Series timer updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + - DefaultAuthorization + /LiveTv/Timers: + get: + tags: + - LiveTv + summary: Gets the live tv timers. + operationId: GetTimers + parameters: + - name: channelId + in: query + description: Optional. Filter by channel id. + schema: + type: string + - name: seriesTimerId + in: query + description: Optional. Filter by timers belonging to a series timer. + schema: + type: string + - name: isActive + in: query + description: Optional. Filter by timers that are active. + schema: + type: boolean + - name: isScheduled + in: query + description: Optional. Filter by timers that are scheduled. + schema: + type: boolean + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/TimerInfoDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/TimerInfoDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/TimerInfoDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + post: + tags: + - LiveTv + summary: Creates a live tv timer. + operationId: CreateTimer + requestBody: + description: New timer info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/TimerInfoDto' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/TimerInfoDto' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/TimerInfoDto' + responses: + "204": + description: Timer created. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + - DefaultAuthorization + /LiveTv/Timers/{timerId}: + get: + tags: + - LiveTv + summary: Gets a timer. + operationId: GetTimer + parameters: + - name: timerId + in: path + description: Timer id. + required: true + schema: + type: string + responses: + "200": + description: Timer returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TimerInfoDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/TimerInfoDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/TimerInfoDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + delete: + tags: + - LiveTv + summary: Cancels a live tv timer. + operationId: CancelTimer + parameters: + - name: timerId + in: path + description: Timer id. + required: true + schema: + type: string + responses: + "204": + description: Timer deleted. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + - DefaultAuthorization + post: + tags: + - LiveTv + summary: Updates a live tv timer. + operationId: UpdateTimer + parameters: + - name: timerId + in: path + description: Timer id. + required: true + schema: + type: string + requestBody: + description: New timer info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/TimerInfoDto' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/TimerInfoDto' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/TimerInfoDto' + responses: + "204": + description: Timer updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + - DefaultAuthorization + /LiveTv/Timers/Defaults: + get: + tags: + - LiveTv + summary: Gets the default values for a new timer. + operationId: GetDefaultTimer + parameters: + - name: programId + in: query + description: Optional. To attach default values based on a program. + schema: + type: string + responses: + "200": + description: Default values returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SeriesTimerInfoDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/SeriesTimerInfoDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/SeriesTimerInfoDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/TunerHosts: + post: + tags: + - LiveTv + summary: Adds a tuner host. + operationId: AddTunerHost + requestBody: + description: New tuner host. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/TunerHostInfo' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/TunerHostInfo' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/TunerHostInfo' + responses: + "200": + description: Created tuner host returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TunerHostInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/TunerHostInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/TunerHostInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + - DefaultAuthorization + delete: + tags: + - LiveTv + summary: Deletes a tuner host. + operationId: DeleteTunerHost + parameters: + - name: id + in: query + description: Tuner host id. + schema: + type: string + responses: + "204": + description: Tuner host deleted. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + - DefaultAuthorization + /LiveTv/TunerHosts/Types: + get: + tags: + - LiveTv + summary: Get tuner host types. + operationId: GetTunerHostTypes + responses: + "200": + description: Tuner host types returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + - DefaultAuthorization + /LiveTv/Tuners/{tunerId}/Reset: + post: + tags: + - LiveTv + summary: Resets a tv tuner. + operationId: ResetTuner + parameters: + - name: tunerId + in: path + description: Tuner id. + required: true + schema: + type: string + responses: + "204": + description: Tuner reset. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + - DefaultAuthorization + /LiveTv/Tuners/Discover: + get: + tags: + - LiveTv + summary: Discover tuners. + operationId: DiscoverTuners + parameters: + - name: newDevicesOnly + in: query + description: Only discover new tuners. + schema: + type: boolean + default: false + responses: + "200": + description: Tuners returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TunerHostInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/TunerHostInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/TunerHostInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + - DefaultAuthorization + /LiveTv/Tuners/Discvover: + get: + tags: + - LiveTv + summary: Discover tuners. + operationId: DiscvoverTuners + parameters: + - name: newDevicesOnly + in: query + description: Only discover new tuners. + schema: + type: boolean + default: false + responses: + "200": + description: Tuners returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TunerHostInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/TunerHostInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/TunerHostInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + - DefaultAuthorization + /Localization/Countries: + get: + tags: + - Localization + summary: Gets known countries. + operationId: GetCountries + responses: + "200": + description: Known countries returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CountryInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/CountryInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/CountryInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrDefault + - DefaultAuthorization + /Localization/Cultures: + get: + tags: + - Localization + summary: Gets known cultures. + operationId: GetCultures + responses: + "200": + description: Known cultures returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CultureDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/CultureDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/CultureDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrDefault + - DefaultAuthorization + /Localization/Options: + get: + tags: + - Localization + summary: Gets localization options. + operationId: GetLocalizationOptions + responses: + "200": + description: Localization options returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/LocalizationOption' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/LocalizationOption' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/LocalizationOption' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrDefault + - DefaultAuthorization + /Localization/ParentalRatings: + get: + tags: + - Localization + summary: Gets known parental ratings. + operationId: GetParentalRatings + responses: + "200": + description: Known parental ratings returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ParentalRating' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/ParentalRating' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/ParentalRating' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrDefault + - DefaultAuthorization + /Audio/{itemId}/Lyrics: + get: + tags: + - Lyrics + summary: Gets an item's lyrics. + operationId: GetLyrics + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Lyrics returned. + content: + application/json: + schema: + $ref: '#/components/schemas/LyricDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/LyricDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/LyricDto' + "404": + description: Something went wrong. No Lyrics will be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + post: + tags: + - Lyrics + summary: Upload an external lyric file. + operationId: UploadLyrics + parameters: + - name: itemId + in: path + description: The item the lyric belongs to. + required: true + schema: + type: string + format: uuid + - name: fileName + in: query + description: Name of the file being uploaded. + required: true + schema: + type: string + requestBody: + content: + text/plain: + schema: + type: string + format: binary + responses: + "200": + description: Lyrics uploaded. + content: + application/json: + schema: + $ref: '#/components/schemas/LyricDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/LyricDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/LyricDto' + "400": + description: Error processing upload. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LyricManagement + - DefaultAuthorization + delete: + tags: + - Lyrics + summary: Deletes an external lyric file. + operationId: DeleteLyrics + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: Lyric deleted. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LyricManagement + - DefaultAuthorization + /Audio/{itemId}/RemoteSearch/Lyrics: + get: + tags: + - Lyrics + summary: Search remote lyrics. + operationId: SearchRemoteLyrics + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Lyrics retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteLyricInfoDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteLyricInfoDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteLyricInfoDto' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LyricManagement + - DefaultAuthorization + /Audio/{itemId}/RemoteSearch/Lyrics/{lyricId}: + post: + tags: + - Lyrics + summary: Downloads a remote lyric. + operationId: DownloadRemoteLyrics + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: lyricId + in: path + description: The lyric id. + required: true + schema: + type: string + responses: + "200": + description: Lyric downloaded. + content: + application/json: + schema: + $ref: '#/components/schemas/LyricDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/LyricDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/LyricDto' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LyricManagement + - DefaultAuthorization + /Providers/Lyrics/{lyricId}: + get: + tags: + - Lyrics + summary: Gets the remote lyrics. + operationId: GetRemoteLyrics + parameters: + - name: lyricId + in: path + description: The remote provider item id. + required: true + schema: + type: string + responses: + "200": + description: File returned. + content: + application/json: + schema: + $ref: '#/components/schemas/LyricDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/LyricDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/LyricDto' + "404": + description: Lyric not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LyricManagement + - DefaultAuthorization + /Items/{itemId}/PlaybackInfo: + get: + tags: + - MediaInfo + summary: Gets live playback media info for an item. + operationId: GetPlaybackInfo + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + responses: + "200": + description: Playback info returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PlaybackInfoResponse' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/PlaybackInfoResponse' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/PlaybackInfoResponse' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + post: + tags: + - MediaInfo + summary: Gets live playback media info for an item. + description: "For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.\r\nQuery parameters are obsolete." + operationId: GetPostedPlaybackInfo + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: The user id. + deprecated: true + schema: + type: string + format: uuid + - name: maxStreamingBitrate + in: query + description: The maximum streaming bitrate. + deprecated: true + schema: + type: integer + format: int32 + - name: startTimeTicks + in: query + description: The start time in ticks. + deprecated: true + schema: + type: integer + format: int64 + - name: audioStreamIndex + in: query + description: The audio stream index. + deprecated: true + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: The subtitle stream index. + deprecated: true + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: The maximum number of audio channels. + deprecated: true + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media source id. + deprecated: true + schema: + type: string + - name: liveStreamId + in: query + description: The livestream id. + deprecated: true + schema: + type: string + - name: autoOpenLiveStream + in: query + description: Whether to auto open the livestream. + deprecated: true + schema: + type: boolean + - name: enableDirectPlay + in: query + description: 'Whether to enable direct play. Default: true.' + deprecated: true + schema: + type: boolean + - name: enableDirectStream + in: query + description: 'Whether to enable direct stream. Default: true.' + deprecated: true + schema: + type: boolean + - name: enableTranscoding + in: query + description: 'Whether to enable transcoding. Default: true.' + deprecated: true + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: 'Whether to allow to copy the video stream. Default: true.' + deprecated: true + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: 'Whether to allow to copy the audio stream. Default: true.' + deprecated: true + schema: + type: boolean + requestBody: + description: The playback info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackInfoDto' + description: Plabyback info dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackInfoDto' + description: Plabyback info dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackInfoDto' + description: Plabyback info dto. + responses: + "200": + description: Playback info returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PlaybackInfoResponse' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/PlaybackInfoResponse' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/PlaybackInfoResponse' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /LiveStreams/Close: + post: + tags: + - MediaInfo + summary: Closes a media source. + operationId: CloseLiveStream + parameters: + - name: liveStreamId + in: query + description: The livestream id. + required: true + schema: + type: string + responses: + "204": + description: Livestream closed. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /LiveStreams/Open: + post: + tags: + - MediaInfo + summary: Opens a media source. + operationId: OpenLiveStream + parameters: + - name: openToken + in: query + description: The open token. + schema: + type: string + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: maxStreamingBitrate + in: query + description: The maximum streaming bitrate. + schema: + type: integer + format: int32 + - name: startTimeTicks + in: query + description: The start time in ticks. + schema: + type: integer + format: int64 + - name: audioStreamIndex + in: query + description: The audio stream index. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: The subtitle stream index. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: The maximum number of audio channels. + schema: + type: integer + format: int32 + - name: itemId + in: query + description: The item id. + schema: + type: string + format: uuid + - name: enableDirectPlay + in: query + description: 'Whether to enable direct play. Default: true.' + schema: + type: boolean + - name: enableDirectStream + in: query + description: 'Whether to enable direct stream. Default: true.' + schema: + type: boolean + - name: alwaysBurnInSubtitleWhenTranscoding + in: query + description: Always burn-in subtitle when transcoding. + schema: + type: boolean + requestBody: + description: The open live stream dto. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OpenLiveStreamDto' + description: Open live stream dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/OpenLiveStreamDto' + description: Open live stream dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/OpenLiveStreamDto' + description: Open live stream dto. + responses: + "200": + description: Media source opened. + content: + application/json: + schema: + $ref: '#/components/schemas/LiveStreamResponse' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/LiveStreamResponse' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/LiveStreamResponse' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Playback/BitrateTest: + get: + tags: + - MediaInfo + summary: Tests the network with a request with the size of the bitrate. + operationId: GetBitrateTestBytes + parameters: + - name: size + in: query + description: The bitrate. Defaults to 102400. + schema: + maximum: 100000000 + minimum: 1 + type: integer + format: int32 + default: 102400 + responses: + "200": + description: Test buffer returned. + content: + application/octet-stream: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /MediaSegments/{itemId}: + get: + tags: + - MediaSegments + summary: Gets all media segments based on an itemId. + operationId: GetItemSegments + parameters: + - name: itemId + in: path + description: The ItemId. + required: true + schema: + type: string + format: uuid + - name: includeSegmentTypes + in: query + description: Optional filter of requested segment types. + schema: + type: array + items: + $ref: '#/components/schemas/MediaSegmentType' + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/MediaSegmentDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/MediaSegmentDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/MediaSegmentDtoQueryResult' + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Movies/Recommendations: + get: + tags: + - Movies + summary: Gets movie recommendations. + operationId: GetMovieRecommendations + parameters: + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. The fields to return. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: categoryLimit + in: query + description: The max number of categories to return. + schema: + type: integer + format: int32 + default: 5 + - name: itemLimit + in: query + description: The max number of items to return per category. + schema: + type: integer + format: int32 + default: 8 + responses: + "200": + description: Movie recommendations returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RecommendationDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RecommendationDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RecommendationDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /MusicGenres: + get: + tags: + - MusicGenres + summary: Gets all music genres from a given item, folder, or the entire library. + operationId: GetMusicGenres + parameters: + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: searchTerm + in: query + description: The search term. + schema: + type: string + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: nameStartsWithOrGreater + in: query + description: Optional filter by items whose name is sorted equally or greater than a given input string. + schema: + type: string + - name: nameStartsWith + in: query + description: Optional filter by items whose name is sorted equally than a given input string. + schema: + type: string + - name: nameLessThan + in: query + description: Optional filter by items whose name is equally or lesser than a given input string. + schema: + type: string + - name: sortBy + in: query + description: Optional. Specify one or more sort orders, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/ItemSortBy' + - name: sortOrder + in: query + description: Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + - name: enableTotalRecordCount + in: query + description: Optional. Include total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Music genres returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - DefaultAuthorization + /MusicGenres/{genreName}: + get: + tags: + - MusicGenres + summary: Gets a music genre, by name. + operationId: GetMusicGenre + parameters: + - name: genreName + in: path + description: The genre name. + required: true + schema: + type: string + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Packages: + get: + tags: + - Package + summary: Gets available packages. + operationId: GetPackages + responses: + "200": + description: Available packages returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PackageInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/PackageInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/PackageInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Packages/{name}: + get: + tags: + - Package + summary: Gets a package by name or assembly GUID. + operationId: GetPackageInfo + parameters: + - name: name + in: path + description: The name of the package. + required: true + schema: + type: string + - name: assemblyGuid + in: query + description: The GUID of the associated assembly. + schema: + type: string + format: uuid + responses: + "200": + description: Package retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/PackageInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/PackageInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/PackageInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Packages/Installed/{name}: + post: + tags: + - Package + summary: Installs a package. + operationId: InstallPackage + parameters: + - name: name + in: path + description: Package name. + required: true + schema: + type: string + - name: assemblyGuid + in: query + description: GUID of the associated assembly. + schema: + type: string + format: uuid + - name: version + in: query + description: Optional version. Defaults to latest version. + schema: + type: string + - name: repositoryUrl + in: query + description: Optional. Specify the repository to install from. + schema: + type: string + responses: + "204": + description: Package found. + "404": + description: Package not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Packages/Installing/{packageId}: + delete: + tags: + - Package + summary: Cancels a package installation. + operationId: CancelPackageInstallation + parameters: + - name: packageId + in: path + description: Installation Id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: Installation cancelled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Repositories: + get: + tags: + - Package + summary: Gets all package repositories. + operationId: GetRepositories + responses: + "200": + description: Package repositories returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RepositoryInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RepositoryInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RepositoryInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + post: + tags: + - Package + summary: Sets the enabled and existing package repositories. + operationId: SetRepositories + requestBody: + description: The list of package repositories. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RepositoryInfo' + text/json: + schema: + type: array + items: + $ref: '#/components/schemas/RepositoryInfo' + application/*+json: + schema: + type: array + items: + $ref: '#/components/schemas/RepositoryInfo' + required: true + responses: + "204": + description: Package repositories saved. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Persons: + get: + tags: + - Persons + summary: Gets all persons. + operationId: GetPersons + parameters: + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: searchTerm + in: query + description: The search term. + schema: + type: string + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: filters + in: query + description: Optional. Specify additional filters to apply. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFilter' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. userId is required. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional, include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: excludePersonTypes + in: query + description: Optional. If specified results will be filtered to exclude those containing the specified PersonType. Allows multiple, comma-delimited. + schema: + type: array + items: + type: string + - name: personTypes + in: query + description: Optional. If specified results will be filtered to include only those containing the specified PersonType. Allows multiple, comma-delimited. + schema: + type: array + items: + type: string + - name: appearsInItemId + in: query + description: Optional. If specified, person results will be filtered on items related to said persons. + schema: + type: string + format: uuid + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + responses: + "200": + description: Persons returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Persons/{name}: + get: + tags: + - Persons + summary: Get person by name. + operationId: GetPerson + parameters: + - name: name + in: path + description: Person name. + required: true + schema: + type: string + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Person returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "404": + description: Person not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Playlists: + post: + tags: + - Playlists + summary: Creates a new playlist. + description: "For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.\r\nQuery parameters are obsolete." + operationId: CreatePlaylist + parameters: + - name: name + in: query + description: The playlist name. + deprecated: true + schema: + type: string + - name: ids + in: query + description: The item ids. + deprecated: true + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: The user id. + deprecated: true + schema: + type: string + format: uuid + - name: mediaType + in: query + description: The media type. + deprecated: true + schema: + enum: + - Unknown + - Video + - Audio + - Photo + - Book + allOf: + - $ref: '#/components/schemas/MediaType' + requestBody: + description: The create playlist payload. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CreatePlaylistDto' + description: Create new playlist dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/CreatePlaylistDto' + description: Create new playlist dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/CreatePlaylistDto' + description: Create new playlist dto. + responses: + "200": + description: Playlist created. + content: + application/json: + schema: + $ref: '#/components/schemas/PlaylistCreationResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/PlaylistCreationResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/PlaylistCreationResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Playlists/{playlistId}: + post: + tags: + - Playlists + summary: Updates a playlist. + operationId: UpdatePlaylist + parameters: + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + format: uuid + requestBody: + description: The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistDto id. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdatePlaylistDto' + description: Update existing playlist dto. Fields set to `null` will not be updated and keep their current values. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdatePlaylistDto' + description: Update existing playlist dto. Fields set to `null` will not be updated and keep their current values. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UpdatePlaylistDto' + description: Update existing playlist dto. Fields set to `null` will not be updated and keep their current values. + required: true + responses: + "204": + description: Playlist updated. + "403": + description: Access forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Playlist not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + get: + tags: + - Playlists + summary: Get a playlist. + operationId: GetPlaylist + parameters: + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: The playlist. + content: + application/json: + schema: + $ref: '#/components/schemas/PlaylistDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/PlaylistDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/PlaylistDto' + "404": + description: Playlist not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Playlists/{playlistId}/Items: + post: + tags: + - Playlists + summary: Adds items to a playlist. + operationId: AddItemToPlaylist + parameters: + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + format: uuid + - name: ids + in: query + description: Item id, comma delimited. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: The userId. + schema: + type: string + format: uuid + responses: + "204": + description: Items added to playlist. + "403": + description: Access forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Playlist not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - Playlists + summary: Removes items from a playlist. + operationId: RemoveItemFromPlaylist + parameters: + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + - name: entryIds + in: query + description: The item ids, comma delimited. + schema: + type: array + items: + type: string + responses: + "204": + description: Items removed. + "403": + description: Access forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Playlist not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + get: + tags: + - Playlists + summary: Gets the original items of a playlist. + operationId: GetPlaylistItems + parameters: + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Original playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Playlist not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + /Playlists/{playlistId}/Items/{itemId}/Move/{newIndex}: + post: + tags: + - Playlists + summary: Moves a playlist item. + operationId: MoveItem + parameters: + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + - name: newIndex + in: path + description: The new index. + required: true + schema: + type: integer + format: int32 + responses: + "204": + description: Item moved to new index. + "403": + description: Access forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Playlist not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + /Playlists/{playlistId}/Users: + get: + tags: + - Playlists + summary: Get a playlist's users. + operationId: GetPlaylistUsers + parameters: + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Found shares. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PlaylistUserPermissions' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/PlaylistUserPermissions' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/PlaylistUserPermissions' + "403": + description: Access forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Playlist not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + /Playlists/{playlistId}/Users/{userId}: + get: + tags: + - Playlists + summary: Get a playlist user. + operationId: GetPlaylistUser + parameters: + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + format: uuid + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: User permission found. + content: + application/json: + schema: + $ref: '#/components/schemas/PlaylistUserPermissions' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/PlaylistUserPermissions' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/PlaylistUserPermissions' + "403": + description: Access forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Playlist not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + post: + tags: + - Playlists + summary: Modify a user of a playlist's users. + operationId: UpdatePlaylistUser + parameters: + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + format: uuid + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + requestBody: + description: The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistUserDto. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdatePlaylistUserDto' + description: Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdatePlaylistUserDto' + description: Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UpdatePlaylistUserDto' + description: Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values. + required: true + responses: + "204": + description: User's permissions modified. + "403": + description: Access forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Playlist not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - Playlists + summary: Remove a user from a playlist's users. + operationId: RemoveUserFromPlaylist + parameters: + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + format: uuid + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: User permissions removed from playlist. + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: No playlist or user permissions found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized access. + security: + - CustomAuthentication: + - DefaultAuthorization + /PlayingItems/{itemId}: + post: + tags: + - Playstate + summary: Reports that a session has begun playing an item. + operationId: OnPlaybackStart + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: mediaSourceId + in: query + description: The id of the MediaSource. + schema: + type: string + - name: audioStreamIndex + in: query + description: The audio stream index. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: The subtitle stream index. + schema: + type: integer + format: int32 + - name: playMethod + in: query + description: The play method. + schema: + enum: + - Transcode + - DirectStream + - DirectPlay + allOf: + - $ref: '#/components/schemas/PlayMethod' + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: canSeek + in: query + description: Indicates if the client can seek. + schema: + type: boolean + default: false + responses: + "204": + description: Play start recorded. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - Playstate + summary: Reports that a session has stopped playing an item. + operationId: OnPlaybackStopped + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: mediaSourceId + in: query + description: The id of the MediaSource. + schema: + type: string + - name: nextMediaType + in: query + description: The next media type that will play. + schema: + type: string + - name: positionTicks + in: query + description: Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + responses: + "204": + description: Playback stop recorded. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /PlayingItems/{itemId}/Progress: + post: + tags: + - Playstate + summary: Reports a session's playback progress. + operationId: OnPlaybackProgress + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: mediaSourceId + in: query + description: The id of the MediaSource. + schema: + type: string + - name: positionTicks + in: query + description: Optional. The current position, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: audioStreamIndex + in: query + description: The audio stream index. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: The subtitle stream index. + schema: + type: integer + format: int32 + - name: volumeLevel + in: query + description: Scale of 0-100. + schema: + type: integer + format: int32 + - name: playMethod + in: query + description: The play method. + schema: + enum: + - Transcode + - DirectStream + - DirectPlay + allOf: + - $ref: '#/components/schemas/PlayMethod' + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: repeatMode + in: query + description: The repeat mode. + schema: + enum: + - RepeatNone + - RepeatAll + - RepeatOne + allOf: + - $ref: '#/components/schemas/RepeatMode' + - name: isPaused + in: query + description: Indicates if the player is paused. + schema: + type: boolean + default: false + - name: isMuted + in: query + description: Indicates if the player is muted. + schema: + type: boolean + default: false + responses: + "204": + description: Play progress recorded. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/Playing: + post: + tags: + - Playstate + summary: Reports playback has started within a session. + operationId: ReportPlaybackStart + requestBody: + description: The playback start info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackStartInfo' + description: Class PlaybackStartInfo. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackStartInfo' + description: Class PlaybackStartInfo. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackStartInfo' + description: Class PlaybackStartInfo. + responses: + "204": + description: Playback start recorded. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/Playing/Ping: + post: + tags: + - Playstate + summary: Pings a playback session. + operationId: PingPlaybackSession + parameters: + - name: playSessionId + in: query + description: Playback session id. + required: true + schema: + type: string + responses: + "204": + description: Playback session pinged. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/Playing/Progress: + post: + tags: + - Playstate + summary: Reports playback progress within a session. + operationId: ReportPlaybackProgress + requestBody: + description: The playback progress info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackProgressInfo' + description: Class PlaybackProgressInfo. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackProgressInfo' + description: Class PlaybackProgressInfo. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackProgressInfo' + description: Class PlaybackProgressInfo. + responses: + "204": + description: Playback progress recorded. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/Playing/Stopped: + post: + tags: + - Playstate + summary: Reports playback has stopped within a session. + operationId: ReportPlaybackStopped + requestBody: + description: The playback stop info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackStopInfo' + description: Class PlaybackStopInfo. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackStopInfo' + description: Class PlaybackStopInfo. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackStopInfo' + description: Class PlaybackStopInfo. + responses: + "204": + description: Playback stop recorded. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /UserPlayedItems/{itemId}: + post: + tags: + - Playstate + summary: Marks an item as played for user. + operationId: MarkPlayedItem + parameters: + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: datePlayed + in: query + description: Optional. The date the item was played. + schema: + type: string + format: date-time + responses: + "200": + description: Item marked as played. + content: + application/json: + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - Playstate + summary: Marks an item as unplayed for user. + operationId: MarkUnplayedItem + parameters: + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Item marked as unplayed. + content: + application/json: + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Plugins: + get: + tags: + - Plugins + summary: Gets a list of currently installed plugins. + operationId: GetPlugins + responses: + "200": + description: Installed plugins returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PluginInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/PluginInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/PluginInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Plugins/{pluginId}: + delete: + tags: + - Plugins + summary: Uninstalls a plugin. + operationId: UninstallPlugin + parameters: + - name: pluginId + in: path + description: Plugin id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: Plugin uninstalled. + "404": + description: Plugin not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - RequiresElevation + /Plugins/{pluginId}/{version}: + delete: + tags: + - Plugins + summary: Uninstalls a plugin by version. + operationId: UninstallPluginByVersion + parameters: + - name: pluginId + in: path + description: Plugin id. + required: true + schema: + type: string + format: uuid + - name: version + in: path + description: Plugin version. + required: true + schema: + type: string + responses: + "204": + description: Plugin uninstalled. + "404": + description: Plugin not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Plugins/{pluginId}/{version}/Disable: + post: + tags: + - Plugins + summary: Disable a plugin. + operationId: DisablePlugin + parameters: + - name: pluginId + in: path + description: Plugin id. + required: true + schema: + type: string + format: uuid + - name: version + in: path + description: Plugin version. + required: true + schema: + type: string + responses: + "204": + description: Plugin disabled. + "404": + description: Plugin not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Plugins/{pluginId}/{version}/Enable: + post: + tags: + - Plugins + summary: Enables a disabled plugin. + operationId: EnablePlugin + parameters: + - name: pluginId + in: path + description: Plugin id. + required: true + schema: + type: string + format: uuid + - name: version + in: path + description: Plugin version. + required: true + schema: + type: string + responses: + "204": + description: Plugin enabled. + "404": + description: Plugin not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Plugins/{pluginId}/{version}/Image: + get: + tags: + - Plugins + summary: Gets a plugin's image. + operationId: GetPluginImage + parameters: + - name: pluginId + in: path + description: Plugin id. + required: true + schema: + type: string + format: uuid + - name: version + in: path + description: Plugin version. + required: true + schema: + type: string + responses: + "200": + description: Plugin image returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Plugins/{pluginId}/Configuration: + get: + tags: + - Plugins + summary: Gets plugin configuration. + operationId: GetPluginConfiguration + parameters: + - name: pluginId + in: path + description: Plugin id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Plugin configuration returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BasePluginConfiguration' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BasePluginConfiguration' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BasePluginConfiguration' + "404": + description: Plugin not found or plugin configuration not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + post: + tags: + - Plugins + summary: Updates plugin configuration. + description: Accepts plugin configuration as JSON body. + operationId: UpdatePluginConfiguration + parameters: + - name: pluginId + in: path + description: Plugin id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: Plugin configuration updated. + "404": + description: Plugin not found or plugin does not have configuration. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Plugins/{pluginId}/Manifest: + post: + tags: + - Plugins + summary: Gets a plugin's manifest. + operationId: GetPluginManifest + parameters: + - name: pluginId + in: path + description: Plugin id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: Plugin manifest returned. + "404": + description: Plugin not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /QuickConnect/Authorize: + post: + tags: + - QuickConnect + summary: Authorizes a pending quick connect request. + operationId: AuthorizeQuickConnect + parameters: + - name: code + in: query + description: Quick connect code to authorize. + required: true + schema: + type: string + - name: userId + in: query + description: The user the authorize. Access to the requested user is required. + schema: + type: string + format: uuid + responses: + "200": + description: Quick connect result authorized successfully. + content: + application/json: + schema: + type: boolean + application/json; profile="CamelCase": + schema: + type: boolean + application/json; profile="PascalCase": + schema: + type: boolean + "403": + description: Unknown user id. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + /QuickConnect/Connect: + get: + tags: + - QuickConnect + summary: Attempts to retrieve authentication information. + operationId: GetQuickConnectState + parameters: + - name: secret + in: query + description: Secret previously returned from the Initiate endpoint. + required: true + schema: + type: string + responses: + "200": + description: Quick connect result returned. + content: + application/json: + schema: + $ref: '#/components/schemas/QuickConnectResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/QuickConnectResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/QuickConnectResult' + "404": + description: Unknown quick connect secret. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /QuickConnect/Enabled: + get: + tags: + - QuickConnect + summary: Gets the current quick connect state. + operationId: GetQuickConnectEnabled + responses: + "200": + description: Quick connect state returned. + content: + application/json: + schema: + type: boolean + application/json; profile="CamelCase": + schema: + type: boolean + application/json; profile="PascalCase": + schema: + type: boolean + /QuickConnect/Initiate: + post: + tags: + - QuickConnect + summary: Initiate a new quick connect request. + operationId: InitiateQuickConnect + responses: + "200": + description: Quick connect request successfully created. + content: + application/json: + schema: + $ref: '#/components/schemas/QuickConnectResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/QuickConnectResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/QuickConnectResult' + "401": + description: Quick connect is not active on this server. + /Items/{itemId}/RemoteImages: + get: + tags: + - RemoteImage + summary: Gets available remote images for an item. + operationId: GetRemoteImages + parameters: + - name: itemId + in: path + description: Item Id. + required: true + schema: + type: string + format: uuid + - name: type + in: query + description: The image type. + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: providerName + in: query + description: Optional. The image provider to use. + schema: + type: string + - name: includeAllLanguages + in: query + description: Optional. Include all languages. + schema: + type: boolean + default: false + responses: + "200": + description: Remote Images returned. + content: + application/json: + schema: + $ref: '#/components/schemas/RemoteImageResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/RemoteImageResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/RemoteImageResult' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/RemoteImages/Download: + post: + tags: + - RemoteImage + summary: Downloads a remote image for an item. + operationId: DownloadRemoteImage + parameters: + - name: itemId + in: path + description: Item Id. + required: true + schema: + type: string + format: uuid + - name: type + in: query + description: The image type. + required: true + schema: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageUrl + in: query + description: The image url. + schema: + type: string + responses: + "204": + description: Remote image downloaded. + "404": + description: Remote image not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Items/{itemId}/RemoteImages/Providers: + get: + tags: + - RemoteImage + summary: Gets available remote image providers for an item. + operationId: GetRemoteImageProviders + parameters: + - name: itemId + in: path + description: Item Id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Returned remote image providers. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ImageProviderInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/ImageProviderInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/ImageProviderInfo' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /ScheduledTasks: + get: + tags: + - ScheduledTasks + summary: Get tasks. + operationId: GetTasks + parameters: + - name: isHidden + in: query + description: Optional filter tasks that are hidden, or not. + schema: + type: boolean + - name: isEnabled + in: query + description: Optional filter tasks that are enabled, or not. + schema: + type: boolean + responses: + "200": + description: Scheduled tasks retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TaskInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/TaskInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/TaskInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /ScheduledTasks/{taskId}: + get: + tags: + - ScheduledTasks + summary: Get task by id. + operationId: GetTask + parameters: + - name: taskId + in: path + description: Task Id. + required: true + schema: + type: string + responses: + "200": + description: Task retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/TaskInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/TaskInfo' + "404": + description: Task not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /ScheduledTasks/{taskId}/Triggers: + post: + tags: + - ScheduledTasks + summary: Update specified task triggers. + operationId: UpdateTask + parameters: + - name: taskId + in: path + description: Task Id. + required: true + schema: + type: string + requestBody: + description: Triggers. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TaskTriggerInfo' + text/json: + schema: + type: array + items: + $ref: '#/components/schemas/TaskTriggerInfo' + application/*+json: + schema: + type: array + items: + $ref: '#/components/schemas/TaskTriggerInfo' + required: true + responses: + "204": + description: Task triggers updated. + "404": + description: Task not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /ScheduledTasks/Running/{taskId}: + post: + tags: + - ScheduledTasks + summary: Start specified task. + operationId: StartTask + parameters: + - name: taskId + in: path + description: Task Id. + required: true + schema: + type: string + responses: + "204": + description: Task started. + "404": + description: Task not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + delete: + tags: + - ScheduledTasks + summary: Stop specified task. + operationId: StopTask + parameters: + - name: taskId + in: path + description: Task Id. + required: true + schema: + type: string + responses: + "204": + description: Task stopped. + "404": + description: Task not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Search/Hints: + get: + tags: + - Search + summary: Gets the search hint result. + operationId: GetSearchHints + parameters: + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: userId + in: query + description: Optional. Supply a user id to search within a user's library or omit to search all. + schema: + type: string + format: uuid + - name: searchTerm + in: query + description: The search term to filter on. + required: true + schema: + type: string + - name: includeItemTypes + in: query + description: If specified, only results with the specified item types are returned. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: excludeItemTypes + in: query + description: If specified, results with these item types are filtered out. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: mediaTypes + in: query + description: If specified, only results with the specified media types are returned. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/MediaType' + - name: parentId + in: query + description: If specified, only children of the parent are returned. + schema: + type: string + format: uuid + - name: isMovie + in: query + description: Optional filter for movies. + schema: + type: boolean + - name: isSeries + in: query + description: Optional filter for series. + schema: + type: boolean + - name: isNews + in: query + description: Optional filter for news. + schema: + type: boolean + - name: isKids + in: query + description: Optional filter for kids. + schema: + type: boolean + - name: isSports + in: query + description: Optional filter for sports. + schema: + type: boolean + - name: includePeople + in: query + description: Optional filter whether to include people. + schema: + type: boolean + default: true + - name: includeMedia + in: query + description: Optional filter whether to include media. + schema: + type: boolean + default: true + - name: includeGenres + in: query + description: Optional filter whether to include genres. + schema: + type: boolean + default: true + - name: includeStudios + in: query + description: Optional filter whether to include studios. + schema: + type: boolean + default: true + - name: includeArtists + in: query + description: Optional filter whether to include artists. + schema: + type: boolean + default: true + responses: + "200": + description: Search hint returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SearchHintResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/SearchHintResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/SearchHintResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Auth/PasswordResetProviders: + get: + tags: + - Session + summary: Get all password reset providers. + operationId: GetPasswordResetProviders + responses: + "200": + description: Password reset providers retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Auth/Providers: + get: + tags: + - Session + summary: Get all auth providers. + operationId: GetAuthProviders + responses: + "200": + description: Auth providers retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Sessions: + get: + tags: + - Session + summary: Gets a list of sessions. + operationId: GetSessions + parameters: + - name: controllableByUserId + in: query + description: Filter by sessions that a given user is allowed to remote control. + schema: + type: string + format: uuid + - name: deviceId + in: query + description: Filter by device Id. + schema: + type: string + - name: activeWithinSeconds + in: query + description: Optional. Filter by sessions that were active in the last n seconds. + schema: + type: integer + format: int32 + responses: + "200": + description: List of sessions returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SessionInfoDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/SessionInfoDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/SessionInfoDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/{sessionId}/Command: + post: + tags: + - Session + summary: Issues a full general command to a client. + operationId: SendFullGeneralCommand + parameters: + - name: sessionId + in: path + description: The session id. + required: true + schema: + type: string + requestBody: + description: The MediaBrowser.Model.Session.GeneralCommand. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/GeneralCommand' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/GeneralCommand' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/GeneralCommand' + required: true + responses: + "204": + description: Full general command sent to session. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/{sessionId}/Command/{command}: + post: + tags: + - Session + summary: Issues a general command to a client. + operationId: SendGeneralCommand + parameters: + - name: sessionId + in: path + description: The session id. + required: true + schema: + type: string + - name: command + in: path + description: The command to send. + required: true + schema: + enum: + - MoveUp + - MoveDown + - MoveLeft + - MoveRight + - PageUp + - PageDown + - PreviousLetter + - NextLetter + - ToggleOsd + - ToggleContextMenu + - Select + - Back + - TakeScreenshot + - SendKey + - SendString + - GoHome + - GoToSettings + - VolumeUp + - VolumeDown + - Mute + - Unmute + - ToggleMute + - SetVolume + - SetAudioStreamIndex + - SetSubtitleStreamIndex + - ToggleFullscreen + - DisplayContent + - GoToSearch + - DisplayMessage + - SetRepeatMode + - ChannelUp + - ChannelDown + - Guide + - ToggleStats + - PlayMediaSource + - PlayTrailers + - SetShuffleQueue + - PlayState + - PlayNext + - ToggleOsdMenu + - Play + - SetMaxStreamingBitrate + - SetPlaybackOrder + allOf: + - $ref: '#/components/schemas/GeneralCommandType' + description: This exists simply to identify a set of known commands. + responses: + "204": + description: General command sent to session. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/{sessionId}/Message: + post: + tags: + - Session + summary: Issues a command to a client to display a message to the user. + operationId: SendMessageCommand + parameters: + - name: sessionId + in: path + description: The session id. + required: true + schema: + type: string + requestBody: + description: The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and TimeoutMs. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/MessageCommand' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/MessageCommand' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/MessageCommand' + required: true + responses: + "204": + description: Message sent. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/{sessionId}/Playing: + post: + tags: + - Session + summary: Instructs a session to play an item. + operationId: Play + parameters: + - name: sessionId + in: path + description: The session id. + required: true + schema: + type: string + - name: playCommand + in: query + description: The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet implemented play next and play last may play now. + required: true + schema: + enum: + - PlayNow + - PlayNext + - PlayLast + - PlayInstantMix + - PlayShuffle + allOf: + - $ref: '#/components/schemas/PlayCommand' + description: Enum PlayCommand. + - name: itemIds + in: query + description: The ids of the items to play, comma delimited. + required: true + schema: + type: array + items: + type: string + format: uuid + - name: startPositionTicks + in: query + description: The starting position of the first item. + schema: + type: integer + format: int64 + - name: mediaSourceId + in: query + description: Optional. The media source id. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to play. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to play. + schema: + type: integer + format: int32 + - name: startIndex + in: query + description: Optional. The start index. + schema: + type: integer + format: int32 + responses: + "204": + description: Instruction sent to session. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/{sessionId}/Playing/{command}: + post: + tags: + - Session + summary: Issues a playstate command to a client. + operationId: SendPlaystateCommand + parameters: + - name: sessionId + in: path + description: The session id. + required: true + schema: + type: string + - name: command + in: path + description: The MediaBrowser.Model.Session.PlaystateCommand. + required: true + schema: + enum: + - Stop + - Pause + - Unpause + - NextTrack + - PreviousTrack + - Seek + - Rewind + - FastForward + - PlayPause + allOf: + - $ref: '#/components/schemas/PlaystateCommand' + description: Enum PlaystateCommand. + - name: seekPositionTicks + in: query + description: The optional position ticks. + schema: + type: integer + format: int64 + - name: controllingUserId + in: query + description: The optional controlling user id. + schema: + type: string + responses: + "204": + description: Playstate command sent to session. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/{sessionId}/System/{command}: + post: + tags: + - Session + summary: Issues a system command to a client. + operationId: SendSystemCommand + parameters: + - name: sessionId + in: path + description: The session id. + required: true + schema: + type: string + - name: command + in: path + description: The command to send. + required: true + schema: + enum: + - MoveUp + - MoveDown + - MoveLeft + - MoveRight + - PageUp + - PageDown + - PreviousLetter + - NextLetter + - ToggleOsd + - ToggleContextMenu + - Select + - Back + - TakeScreenshot + - SendKey + - SendString + - GoHome + - GoToSettings + - VolumeUp + - VolumeDown + - Mute + - Unmute + - ToggleMute + - SetVolume + - SetAudioStreamIndex + - SetSubtitleStreamIndex + - ToggleFullscreen + - DisplayContent + - GoToSearch + - DisplayMessage + - SetRepeatMode + - ChannelUp + - ChannelDown + - Guide + - ToggleStats + - PlayMediaSource + - PlayTrailers + - SetShuffleQueue + - PlayState + - PlayNext + - ToggleOsdMenu + - Play + - SetMaxStreamingBitrate + - SetPlaybackOrder + allOf: + - $ref: '#/components/schemas/GeneralCommandType' + description: This exists simply to identify a set of known commands. + responses: + "204": + description: System command sent to session. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/{sessionId}/User/{userId}: + post: + tags: + - Session + summary: Adds an additional user to a session. + operationId: AddUserToSession + parameters: + - name: sessionId + in: path + description: The session id. + required: true + schema: + type: string + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: User added to session. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - Session + summary: Removes an additional user from a session. + operationId: RemoveUserFromSession + parameters: + - name: sessionId + in: path + description: The session id. + required: true + schema: + type: string + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: User removed from session. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/{sessionId}/Viewing: + post: + tags: + - Session + summary: Instructs a session to browse to an item or view. + operationId: DisplayContent + parameters: + - name: sessionId + in: path + description: The session Id. + required: true + schema: + type: string + - name: itemType + in: query + description: The type of item to browse to. + required: true + schema: + enum: + - AggregateFolder + - Audio + - AudioBook + - BasePluginFolder + - Book + - BoxSet + - Channel + - ChannelFolderItem + - CollectionFolder + - Episode + - Folder + - Genre + - ManualPlaylistsFolder + - Movie + - LiveTvChannel + - LiveTvProgram + - MusicAlbum + - MusicArtist + - MusicGenre + - MusicVideo + - Person + - Photo + - PhotoAlbum + - Playlist + - PlaylistsFolder + - Program + - Recording + - Season + - Series + - Studio + - Trailer + - TvChannel + - TvProgram + - UserRootFolder + - UserView + - Video + - Year + allOf: + - $ref: '#/components/schemas/BaseItemKind' + description: The base item kind. + - name: itemId + in: query + description: The Id of the item. + required: true + schema: + type: string + - name: itemName + in: query + description: The name of the item. + required: true + schema: + type: string + responses: + "204": + description: Instruction sent to session. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/Capabilities: + post: + tags: + - Session + summary: Updates capabilities for a device. + operationId: PostCapabilities + parameters: + - name: id + in: query + description: The session id. + schema: + type: string + - name: playableMediaTypes + in: query + description: A list of playable media types, comma delimited. Audio, Video, Book, Photo. + schema: + type: array + items: + $ref: '#/components/schemas/MediaType' + - name: supportedCommands + in: query + description: A list of supported remote control commands, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/GeneralCommandType' + - name: supportsMediaControl + in: query + description: Determines whether media can be played remotely.. + schema: + type: boolean + default: false + - name: supportsPersistentIdentifier + in: query + description: Determines whether the device supports a unique identifier. + schema: + type: boolean + default: true + responses: + "204": + description: Capabilities posted. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/Capabilities/Full: + post: + tags: + - Session + summary: Updates capabilities for a device. + operationId: PostFullCapabilities + parameters: + - name: id + in: query + description: The session id. + schema: + type: string + requestBody: + description: The MediaBrowser.Model.Session.ClientCapabilities. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ClientCapabilitiesDto' + description: Client capabilities dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/ClientCapabilitiesDto' + description: Client capabilities dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/ClientCapabilitiesDto' + description: Client capabilities dto. + required: true + responses: + "204": + description: Capabilities updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/Logout: + post: + tags: + - Session + summary: Reports that a session has ended. + operationId: ReportSessionEnded + responses: + "204": + description: Session end reported to server. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/Viewing: + post: + tags: + - Session + summary: Reports that a session is viewing an item. + operationId: ReportViewing + parameters: + - name: sessionId + in: query + description: The session id. + schema: + type: string + - name: itemId + in: query + description: The item id. + required: true + schema: + type: string + responses: + "204": + description: Session reported to server. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Startup/Complete: + post: + tags: + - Startup + summary: Completes the startup wizard. + operationId: CompleteWizard + responses: + "204": + description: Startup wizard completed. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /Startup/Configuration: + get: + tags: + - Startup + summary: Gets the initial startup wizard configuration. + operationId: GetStartupConfiguration + responses: + "200": + description: Initial startup wizard configuration retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/StartupConfigurationDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/StartupConfigurationDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/StartupConfigurationDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + post: + tags: + - Startup + summary: Sets the initial startup wizard configuration. + operationId: UpdateInitialConfiguration + requestBody: + description: The updated startup configuration. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/StartupConfigurationDto' + description: The startup configuration DTO. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/StartupConfigurationDto' + description: The startup configuration DTO. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/StartupConfigurationDto' + description: The startup configuration DTO. + required: true + responses: + "204": + description: Configuration saved. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /Startup/FirstUser: + get: + tags: + - Startup + summary: Gets the first user. + operationId: GetFirstUser_2 + responses: + "200": + description: Initial user retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/StartupUserDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/StartupUserDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/StartupUserDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /Startup/RemoteAccess: + post: + tags: + - Startup + summary: Sets remote access and UPnP. + operationId: SetRemoteAccess + requestBody: + description: The startup remote access dto. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/StartupRemoteAccessDto' + description: Startup remote access dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/StartupRemoteAccessDto' + description: Startup remote access dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/StartupRemoteAccessDto' + description: Startup remote access dto. + required: true + responses: + "204": + description: Configuration saved. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /Startup/User: + get: + tags: + - Startup + summary: Gets the first user. + operationId: GetFirstUser + responses: + "200": + description: Initial user retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/StartupUserDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/StartupUserDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/StartupUserDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + post: + tags: + - Startup + summary: Sets the user name and password. + operationId: UpdateStartupUser + requestBody: + description: The DTO containing username and password. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/StartupUserDto' + description: The startup user DTO. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/StartupUserDto' + description: The startup user DTO. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/StartupUserDto' + description: The startup user DTO. + responses: + "204": + description: Updated user name and password. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /Studios: + get: + tags: + - Studios + summary: Gets all studios from a given item, folder, or the entire library. + operationId: GetStudios + parameters: + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: searchTerm + in: query + description: Optional. Search term. + schema: + type: string + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional, include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: nameStartsWithOrGreater + in: query + description: Optional filter by items whose name is sorted equally or greater than a given input string. + schema: + type: string + - name: nameStartsWith + in: query + description: Optional filter by items whose name is sorted equally than a given input string. + schema: + type: string + - name: nameLessThan + in: query + description: Optional filter by items whose name is equally or lesser than a given input string. + schema: + type: string + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + - name: enableTotalRecordCount + in: query + description: Total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Studios returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Studios/{name}: + get: + tags: + - Studios + summary: Gets a studio by name. + operationId: GetStudio + parameters: + - name: name + in: path + description: Studio name. + required: true + schema: + type: string + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Studio returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /FallbackFont/Fonts: + get: + tags: + - Subtitle + summary: Gets a list of available fallback font files. + operationId: GetFallbackFontList + responses: + "200": + description: Information retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FontFile' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/FontFile' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/FontFile' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /FallbackFont/Fonts/{name}: + get: + tags: + - Subtitle + summary: Gets a fallback font file. + operationId: GetFallbackFont + parameters: + - name: name + in: path + description: The name of the fallback font file to get. + required: true + schema: + type: string + responses: + "200": + description: Fallback font file retrieved. + content: + font/*: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/RemoteSearch/Subtitles/{language}: + get: + tags: + - Subtitle + summary: Search remote subtitles. + operationId: SearchRemoteSubtitles + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: language + in: path + description: The language of the subtitles. + required: true + schema: + type: string + - name: isPerfectMatch + in: query + description: Optional. Only show subtitles which are a perfect match. + schema: + type: boolean + responses: + "200": + description: Subtitles retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSubtitleInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSubtitleInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSubtitleInfo' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SubtitleManagement + - DefaultAuthorization + /Items/{itemId}/RemoteSearch/Subtitles/{subtitleId}: + post: + tags: + - Subtitle + summary: Downloads a remote subtitle. + operationId: DownloadRemoteSubtitles + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: subtitleId + in: path + description: The subtitle id. + required: true + schema: + type: string + responses: + "204": + description: Subtitle downloaded. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SubtitleManagement + - DefaultAuthorization + /Providers/Subtitles/Subtitles/{subtitleId}: + get: + tags: + - Subtitle + summary: Gets the remote subtitles. + operationId: GetRemoteSubtitles + parameters: + - name: subtitleId + in: path + description: The item id. + required: true + schema: + type: string + responses: + "200": + description: File returned. + content: + text/*: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SubtitleManagement + - DefaultAuthorization + /Videos/{itemId}/{mediaSourceId}/Subtitles/{index}/subtitles.m3u8: + get: + tags: + - Subtitle + summary: Gets an HLS subtitle playlist. + operationId: GetSubtitlePlaylist + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: index + in: path + description: The subtitle stream index. + required: true + schema: + type: integer + format: int32 + - name: mediaSourceId + in: path + description: The media source id. + required: true + schema: + type: string + - name: segmentLength + in: query + description: The subtitle segment length. + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: Subtitle playlist retrieved. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{itemId}/Subtitles: + post: + tags: + - Subtitle + summary: Upload an external subtitle file. + operationId: UploadSubtitle + parameters: + - name: itemId + in: path + description: The item the subtitle belongs to. + required: true + schema: + type: string + format: uuid + requestBody: + description: The request body. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UploadSubtitleDto' + description: Upload subtitles dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UploadSubtitleDto' + description: Upload subtitles dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UploadSubtitleDto' + description: Upload subtitles dto. + required: true + responses: + "204": + description: Subtitle uploaded. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SubtitleManagement + - DefaultAuthorization + /Videos/{itemId}/Subtitles/{index}: + delete: + tags: + - Subtitle + summary: Deletes an external subtitle file. + operationId: DeleteSubtitle + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: index + in: path + description: The index of the subtitle file. + required: true + schema: + type: integer + format: int32 + responses: + "204": + description: Subtitle deleted. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/{routeStartPositionTicks}/Stream.{routeFormat}: + get: + tags: + - Subtitle + summary: Gets subtitles in a specified format. + operationId: GetSubtitleWithTicks + parameters: + - name: routeItemId + in: path + description: The (route) item id. + required: true + schema: + type: string + format: uuid + - name: routeMediaSourceId + in: path + description: The (route) media source id. + required: true + schema: + type: string + - name: routeIndex + in: path + description: The (route) subtitle stream index. + required: true + schema: + type: integer + format: int32 + - name: routeStartPositionTicks + in: path + description: The (route) start position of the subtitle in ticks. + required: true + schema: + type: integer + format: int64 + - name: routeFormat + in: path + description: The (route) format of the returned subtitle. + required: true + schema: + type: string + - name: itemId + in: query + description: The item id. + deprecated: true + schema: + type: string + format: uuid + - name: mediaSourceId + in: query + description: The media source id. + deprecated: true + schema: + type: string + - name: index + in: query + description: The subtitle stream index. + deprecated: true + schema: + type: integer + format: int32 + - name: startPositionTicks + in: query + description: The start position of the subtitle in ticks. + deprecated: true + schema: + type: integer + format: int64 + - name: format + in: query + description: The format of the returned subtitle. + deprecated: true + schema: + type: string + - name: endPositionTicks + in: query + description: Optional. The end position of the subtitle in ticks. + schema: + type: integer + format: int64 + - name: copyTimestamps + in: query + description: Optional. Whether to copy the timestamps. + schema: + type: boolean + default: false + - name: addVttTimeMap + in: query + description: Optional. Whether to add a VTT time map. + schema: + type: boolean + default: false + responses: + "200": + description: File returned. + content: + text/*: + schema: + type: string + format: binary + /Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/Stream.{routeFormat}: + get: + tags: + - Subtitle + summary: Gets subtitles in a specified format. + operationId: GetSubtitle + parameters: + - name: routeItemId + in: path + description: The (route) item id. + required: true + schema: + type: string + format: uuid + - name: routeMediaSourceId + in: path + description: The (route) media source id. + required: true + schema: + type: string + - name: routeIndex + in: path + description: The (route) subtitle stream index. + required: true + schema: + type: integer + format: int32 + - name: routeFormat + in: path + description: The (route) format of the returned subtitle. + required: true + schema: + type: string + - name: itemId + in: query + description: The item id. + deprecated: true + schema: + type: string + format: uuid + - name: mediaSourceId + in: query + description: The media source id. + deprecated: true + schema: + type: string + - name: index + in: query + description: The subtitle stream index. + deprecated: true + schema: + type: integer + format: int32 + - name: format + in: query + description: The format of the returned subtitle. + deprecated: true + schema: + type: string + - name: endPositionTicks + in: query + description: Optional. The end position of the subtitle in ticks. + schema: + type: integer + format: int64 + - name: copyTimestamps + in: query + description: Optional. Whether to copy the timestamps. + schema: + type: boolean + default: false + - name: addVttTimeMap + in: query + description: Optional. Whether to add a VTT time map. + schema: + type: boolean + default: false + - name: startPositionTicks + in: query + description: The start position of the subtitle in ticks. + schema: + type: integer + format: int64 + default: 0 + responses: + "200": + description: File returned. + content: + text/*: + schema: + type: string + format: binary + /Items/Suggestions: + get: + tags: + - Suggestions + summary: Gets suggestions. + operationId: GetSuggestions + parameters: + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + - name: mediaType + in: query + description: The media types. + schema: + type: array + items: + $ref: '#/components/schemas/MediaType' + - name: type + in: query + description: The type. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: startIndex + in: query + description: Optional. The start index. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The limit. + schema: + type: integer + format: int32 + - name: enableTotalRecordCount + in: query + description: Whether to enable the total record count. + schema: + type: boolean + default: false + responses: + "200": + description: Suggestions returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /SyncPlay/Buffering: + post: + tags: + - SyncPlay + summary: Notify SyncPlay group that member is buffering. + operationId: SyncPlayBuffering + requestBody: + description: The player status. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/BufferRequestDto' + description: Class BufferRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/BufferRequestDto' + description: Class BufferRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/BufferRequestDto' + description: Class BufferRequestDto. + required: true + responses: + "204": + description: Group state update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/Join: + post: + tags: + - SyncPlay + summary: Join an existing SyncPlay group. + operationId: SyncPlayJoinGroup + requestBody: + description: The group to join. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/JoinGroupRequestDto' + description: Class JoinGroupRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/JoinGroupRequestDto' + description: Class JoinGroupRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/JoinGroupRequestDto' + description: Class JoinGroupRequestDto. + required: true + responses: + "204": + description: Group join successful. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayJoinGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/Leave: + post: + tags: + - SyncPlay + summary: Leave the joined SyncPlay group. + operationId: SyncPlayLeaveGroup + responses: + "204": + description: Group leave successful. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/List: + get: + tags: + - SyncPlay + summary: Gets all SyncPlay groups. + operationId: SyncPlayGetGroups + responses: + "200": + description: Groups returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GroupInfoDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/GroupInfoDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/GroupInfoDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayJoinGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/MovePlaylistItem: + post: + tags: + - SyncPlay + summary: Request to move an item in the playlist in SyncPlay group. + operationId: SyncPlayMovePlaylistItem + requestBody: + description: The new position for the item. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/MovePlaylistItemRequestDto' + description: Class MovePlaylistItemRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/MovePlaylistItemRequestDto' + description: Class MovePlaylistItemRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/MovePlaylistItemRequestDto' + description: Class MovePlaylistItemRequestDto. + required: true + responses: + "204": + description: Queue update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/New: + post: + tags: + - SyncPlay + summary: Create a new SyncPlay group. + operationId: SyncPlayCreateGroup + requestBody: + description: The settings of the new group. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/NewGroupRequestDto' + description: Class NewGroupRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/NewGroupRequestDto' + description: Class NewGroupRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/NewGroupRequestDto' + description: Class NewGroupRequestDto. + required: true + responses: + "204": + description: New group created. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayCreateGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/NextItem: + post: + tags: + - SyncPlay + summary: Request next item in SyncPlay group. + operationId: SyncPlayNextItem + requestBody: + description: The current item information. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/NextItemRequestDto' + description: Class NextItemRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/NextItemRequestDto' + description: Class NextItemRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/NextItemRequestDto' + description: Class NextItemRequestDto. + required: true + responses: + "204": + description: Next item update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/Pause: + post: + tags: + - SyncPlay + summary: Request pause in SyncPlay group. + operationId: SyncPlayPause + responses: + "204": + description: Pause update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/Ping: + post: + tags: + - SyncPlay + summary: Update session ping. + operationId: SyncPlayPing + requestBody: + description: The new ping. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PingRequestDto' + description: Class PingRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/PingRequestDto' + description: Class PingRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/PingRequestDto' + description: Class PingRequestDto. + required: true + responses: + "204": + description: Ping updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/PreviousItem: + post: + tags: + - SyncPlay + summary: Request previous item in SyncPlay group. + operationId: SyncPlayPreviousItem + requestBody: + description: The current item information. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PreviousItemRequestDto' + description: Class PreviousItemRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/PreviousItemRequestDto' + description: Class PreviousItemRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/PreviousItemRequestDto' + description: Class PreviousItemRequestDto. + required: true + responses: + "204": + description: Previous item update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/Queue: + post: + tags: + - SyncPlay + summary: Request to queue items to the playlist of a SyncPlay group. + operationId: SyncPlayQueue + requestBody: + description: The items to add. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/QueueRequestDto' + description: Class QueueRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/QueueRequestDto' + description: Class QueueRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/QueueRequestDto' + description: Class QueueRequestDto. + required: true + responses: + "204": + description: Queue update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/Ready: + post: + tags: + - SyncPlay + summary: Notify SyncPlay group that member is ready for playback. + operationId: SyncPlayReady + requestBody: + description: The player status. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ReadyRequestDto' + description: Class ReadyRequest. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/ReadyRequestDto' + description: Class ReadyRequest. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/ReadyRequestDto' + description: Class ReadyRequest. + required: true + responses: + "204": + description: Group state update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/RemoveFromPlaylist: + post: + tags: + - SyncPlay + summary: Request to remove items from the playlist in SyncPlay group. + operationId: SyncPlayRemoveFromPlaylist + requestBody: + description: The items to remove. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/RemoveFromPlaylistRequestDto' + description: Class RemoveFromPlaylistRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/RemoveFromPlaylistRequestDto' + description: Class RemoveFromPlaylistRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/RemoveFromPlaylistRequestDto' + description: Class RemoveFromPlaylistRequestDto. + required: true + responses: + "204": + description: Queue update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/Seek: + post: + tags: + - SyncPlay + summary: Request seek in SyncPlay group. + operationId: SyncPlaySeek + requestBody: + description: The new playback position. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SeekRequestDto' + description: Class SeekRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/SeekRequestDto' + description: Class SeekRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/SeekRequestDto' + description: Class SeekRequestDto. + required: true + responses: + "204": + description: Seek update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/SetIgnoreWait: + post: + tags: + - SyncPlay + summary: Request SyncPlay group to ignore member during group-wait. + operationId: SyncPlaySetIgnoreWait + requestBody: + description: The settings to set. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/IgnoreWaitRequestDto' + description: Class IgnoreWaitRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/IgnoreWaitRequestDto' + description: Class IgnoreWaitRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/IgnoreWaitRequestDto' + description: Class IgnoreWaitRequestDto. + required: true + responses: + "204": + description: Member state updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/SetNewQueue: + post: + tags: + - SyncPlay + summary: Request to set new playlist in SyncPlay group. + operationId: SyncPlaySetNewQueue + requestBody: + description: The new playlist to play in the group. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PlayRequestDto' + description: Class PlayRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/PlayRequestDto' + description: Class PlayRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/PlayRequestDto' + description: Class PlayRequestDto. + required: true + responses: + "204": + description: Queue update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/SetPlaylistItem: + post: + tags: + - SyncPlay + summary: Request to change playlist item in SyncPlay group. + operationId: SyncPlaySetPlaylistItem + requestBody: + description: The new item to play. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SetPlaylistItemRequestDto' + description: Class SetPlaylistItemRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/SetPlaylistItemRequestDto' + description: Class SetPlaylistItemRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/SetPlaylistItemRequestDto' + description: Class SetPlaylistItemRequestDto. + required: true + responses: + "204": + description: Queue update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/SetRepeatMode: + post: + tags: + - SyncPlay + summary: Request to set repeat mode in SyncPlay group. + operationId: SyncPlaySetRepeatMode + requestBody: + description: The new repeat mode. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SetRepeatModeRequestDto' + description: Class SetRepeatModeRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/SetRepeatModeRequestDto' + description: Class SetRepeatModeRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/SetRepeatModeRequestDto' + description: Class SetRepeatModeRequestDto. + required: true + responses: + "204": + description: Play queue update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/SetShuffleMode: + post: + tags: + - SyncPlay + summary: Request to set shuffle mode in SyncPlay group. + operationId: SyncPlaySetShuffleMode + requestBody: + description: The new shuffle mode. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SetShuffleModeRequestDto' + description: Class SetShuffleModeRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/SetShuffleModeRequestDto' + description: Class SetShuffleModeRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/SetShuffleModeRequestDto' + description: Class SetShuffleModeRequestDto. + required: true + responses: + "204": + description: Play queue update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/Stop: + post: + tags: + - SyncPlay + summary: Request stop in SyncPlay group. + operationId: SyncPlayStop + responses: + "204": + description: Stop update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /SyncPlay/Unpause: + post: + tags: + - SyncPlay + summary: Request unpause in SyncPlay group. + operationId: SyncPlayUnpause + responses: + "204": + description: Unpause update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + - DefaultAuthorization + /System/Endpoint: + get: + tags: + - System + summary: Gets information about the request endpoint. + operationId: GetEndpointInfo + responses: + "200": + description: Information retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/EndPointInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/EndPointInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/EndPointInfo' + "403": + description: User does not have permission to get endpoint information. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + /System/Info: + get: + tags: + - System + summary: Gets information about the server. + operationId: GetSystemInfo + responses: + "200": + description: Information retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/SystemInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/SystemInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/SystemInfo' + "403": + description: User does not have permission to retrieve information. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - FirstTimeSetupOrIgnoreParentalControl + - DefaultAuthorization + /System/Info/Public: + get: + tags: + - System + summary: Gets public information about the server. + operationId: GetPublicSystemInfo + responses: + "200": + description: Information retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/PublicSystemInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/PublicSystemInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/PublicSystemInfo' + /System/Logs: + get: + tags: + - System + summary: Gets a list of available server log files. + operationId: GetServerLogs + responses: + "200": + description: Information retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/LogFile' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/LogFile' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/LogFile' + "403": + description: User does not have permission to get server logs. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - RequiresElevation + /System/Logs/Log: + get: + tags: + - System + summary: Gets a log file. + operationId: GetLogFile + parameters: + - name: name + in: query + description: The name of the log file to get. + required: true + schema: + type: string + responses: + "200": + description: Log file retrieved. + content: + text/plain: + schema: + type: string + format: binary + "403": + description: User does not have permission to get log files. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: Could not find a log file with the name. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - RequiresElevation + /System/Ping: + get: + tags: + - System + summary: Pings the system. + operationId: GetPingSystem + responses: + "200": + description: Information retrieved. + content: + application/json: + schema: + type: string + application/json; profile="CamelCase": + schema: + type: string + application/json; profile="PascalCase": + schema: + type: string + post: + tags: + - System + summary: Pings the system. + operationId: PostPingSystem + responses: + "200": + description: Information retrieved. + content: + application/json: + schema: + type: string + application/json; profile="CamelCase": + schema: + type: string + application/json; profile="PascalCase": + schema: + type: string + /System/Restart: + post: + tags: + - System + summary: Restarts the application. + operationId: RestartApplication + responses: + "204": + description: Server restarted. + "403": + description: User does not have permission to restart server. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - LocalAccessOrRequiresElevation + /System/Shutdown: + post: + tags: + - System + summary: Shuts down the application. + operationId: ShutdownApplication + responses: + "204": + description: Server shut down. + "403": + description: User does not have permission to shutdown server. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - RequiresElevation + /System/WakeOnLanInfo: + get: + tags: + - System + summary: Gets wake on lan information. + operationId: GetWakeOnLanInfo + responses: + "200": + description: Information retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/WakeOnLanInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/WakeOnLanInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/WakeOnLanInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - DefaultAuthorization + /GetUtcTime: + get: + tags: + - TimeSync + summary: Gets the current UTC time. + operationId: GetUtcTime + responses: + "200": + description: Time returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UtcTimeResponse' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UtcTimeResponse' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UtcTimeResponse' + /Tmdb/ClientConfiguration: + get: + tags: + - Tmdb + summary: Gets the TMDb image configuration options. + operationId: TmdbClientConfiguration + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigImageTypes' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Trailers: + get: + tags: + - Trailers + summary: Finds movies and trailers similar to a given trailer. + operationId: GetTrailers + parameters: + - name: userId + in: query + description: The user id supplied as query parameter; this is required when not using an API key. + schema: + type: string + format: uuid + - name: maxOfficialRating + in: query + description: Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). + schema: + type: string + - name: hasThemeSong + in: query + description: Optional filter by items with theme songs. + schema: + type: boolean + - name: hasThemeVideo + in: query + description: Optional filter by items with theme videos. + schema: + type: boolean + - name: hasSubtitles + in: query + description: Optional filter by items with subtitles. + schema: + type: boolean + - name: hasSpecialFeature + in: query + description: Optional filter by items with special features. + schema: + type: boolean + - name: hasTrailer + in: query + description: Optional filter by items with trailers. + schema: + type: boolean + - name: adjacentTo + in: query + description: Optional. Return items that are siblings of a supplied item. + schema: + type: string + format: uuid + - name: parentIndexNumber + in: query + description: Optional filter by parent index number. + schema: + type: integer + format: int32 + - name: hasParentalRating + in: query + description: Optional filter by items that have or do not have a parental rating. + schema: + type: boolean + - name: isHd + in: query + description: Optional filter by items that are HD or not. + schema: + type: boolean + - name: is4K + in: query + description: Optional filter by items that are 4K or not. + schema: + type: boolean + - name: locationTypes + in: query + description: Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/LocationType' + - name: excludeLocationTypes + in: query + description: Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/LocationType' + - name: isMissing + in: query + description: Optional filter by items that are missing episodes or not. + schema: + type: boolean + - name: isUnaired + in: query + description: Optional filter by items that are unaired episodes or not. + schema: + type: boolean + - name: minCommunityRating + in: query + description: Optional filter by minimum community rating. + schema: + type: number + format: double + - name: minCriticRating + in: query + description: Optional filter by minimum critic rating. + schema: + type: number + format: double + - name: minPremiereDate + in: query + description: Optional. The minimum premiere date. Format = ISO. + schema: + type: string + format: date-time + - name: minDateLastSaved + in: query + description: Optional. The minimum last saved date. Format = ISO. + schema: + type: string + format: date-time + - name: minDateLastSavedForUser + in: query + description: Optional. The minimum last saved date for the current user. Format = ISO. + schema: + type: string + format: date-time + - name: maxPremiereDate + in: query + description: Optional. The maximum premiere date. Format = ISO. + schema: + type: string + format: date-time + - name: hasOverview + in: query + description: Optional filter by items that have an overview or not. + schema: + type: boolean + - name: hasImdbId + in: query + description: Optional filter by items that have an IMDb id or not. + schema: + type: boolean + - name: hasTmdbId + in: query + description: Optional filter by items that have a TMDb id or not. + schema: + type: boolean + - name: hasTvdbId + in: query + description: Optional filter by items that have a TVDb id or not. + schema: + type: boolean + - name: isMovie + in: query + description: Optional filter for live tv movies. + schema: + type: boolean + - name: isSeries + in: query + description: Optional filter for live tv series. + schema: + type: boolean + - name: isNews + in: query + description: Optional filter for live tv news. + schema: + type: boolean + - name: isKids + in: query + description: Optional filter for live tv kids. + schema: + type: boolean + - name: isSports + in: query + description: Optional filter for live tv sports. + schema: + type: boolean + - name: excludeItemIds + in: query + description: Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited. + schema: + type: array + items: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: recursive + in: query + description: When searching within folders, this determines whether or not the search will be recursive. true/false. + schema: + type: boolean + - name: searchTerm + in: query + description: Optional. Filter based on a search term. + schema: + type: string + - name: sortOrder + in: query + description: Sort Order - Ascending, Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: filters + in: query + description: 'Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFilter' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. + schema: + type: boolean + - name: mediaTypes + in: query + description: Optional filter by MediaType. Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/MediaType' + - name: imageTypes + in: query + description: Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: sortBy + in: query + description: 'Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemSortBy' + - name: isPlayed + in: query + description: Optional filter by items that are played, or not. + schema: + type: boolean + - name: genres + in: query + description: Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: officialRatings + in: query + description: Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: tags + in: query + description: Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: years + in: query + description: Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. + schema: + type: array + items: + type: integer + format: int32 + - name: enableUserData + in: query + description: Optional, include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: person + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person. + schema: + type: string + - name: personIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person id. + schema: + type: array + items: + type: string + format: uuid + - name: personTypes + in: query + description: Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. + schema: + type: array + items: + type: string + - name: studios + in: query + description: Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: artists + in: query + description: Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: excludeArtistIds + in: query + description: Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: artistIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified artist id. + schema: + type: array + items: + type: string + format: uuid + - name: albumArtistIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified album artist id. + schema: + type: array + items: + type: string + format: uuid + - name: contributingArtistIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified contributing artist id. + schema: + type: array + items: + type: string + format: uuid + - name: albums + in: query + description: Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: albumIds + in: query + description: Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: ids + in: query + description: Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited. + schema: + type: array + items: + type: string + format: uuid + - name: videoTypes + in: query + description: Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/VideoType' + - name: minOfficialRating + in: query + description: Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). + schema: + type: string + - name: isLocked + in: query + description: Optional filter by items that are locked. + schema: + type: boolean + - name: isPlaceHolder + in: query + description: Optional filter by items that are placeholders. + schema: + type: boolean + - name: hasOfficialRating + in: query + description: Optional filter by items that have official ratings. + schema: + type: boolean + - name: collapseBoxSetItems + in: query + description: Whether or not to hide items behind their boxsets. + schema: + type: boolean + - name: minWidth + in: query + description: Optional. Filter by the minimum width of the item. + schema: + type: integer + format: int32 + - name: minHeight + in: query + description: Optional. Filter by the minimum height of the item. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. Filter by the maximum width of the item. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. Filter by the maximum height of the item. + schema: + type: integer + format: int32 + - name: is3D + in: query + description: Optional filter by items that are 3D, or not. + schema: + type: boolean + - name: seriesStatus + in: query + description: Optional filter by Series Status. Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/SeriesStatus' + - name: nameStartsWithOrGreater + in: query + description: Optional filter by items whose name is sorted equally or greater than a given input string. + schema: + type: string + - name: nameStartsWith + in: query + description: Optional filter by items whose name is sorted equally than a given input string. + schema: + type: string + - name: nameLessThan + in: query + description: Optional filter by items whose name is equally or lesser than a given input string. + schema: + type: string + - name: studioIds + in: query + description: Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: genreIds + in: query + description: Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: enableTotalRecordCount + in: query + description: Optional. Enable the total record count. + schema: + type: boolean + default: true + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{itemId}/Trickplay/{width}/{index}.jpg: + get: + tags: + - Trickplay + summary: Gets a trickplay tile image. + operationId: GetTrickplayTileImage + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: width + in: path + description: The width of a single tile. + required: true + schema: + type: integer + format: int32 + - name: index + in: path + description: The index of the desired tile. + required: true + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if using an alternate version. + schema: + type: string + format: uuid + responses: + "200": + description: Tile image not found at specified index. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{itemId}/Trickplay/{width}/tiles.m3u8: + get: + tags: + - Trickplay + summary: Gets an image tiles playlist for trickplay. + operationId: GetTrickplayHlsPlaylist + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: width + in: path + description: The width of a single tile. + required: true + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if using an alternate version. + schema: + type: string + format: uuid + responses: + "200": + description: Tiles playlist returned. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Shows/{seriesId}/Episodes: + get: + tags: + - TvShows + summary: Gets episodes for a tv season. + operationId: GetEpisodes + parameters: + - name: seriesId + in: path + description: The series id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: season + in: query + description: Optional filter by season number. + schema: + type: integer + format: int32 + - name: seasonId + in: query + description: Optional. Filter by season id. + schema: + type: string + format: uuid + - name: isMissing + in: query + description: Optional. Filter by items that are missing episodes or not. + schema: + type: boolean + - name: adjacentTo + in: query + description: Optional. Return items that are siblings of a supplied item. + schema: + type: string + format: uuid + - name: startItemId + in: query + description: Optional. Skip through the list until a given item is found. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: sortBy + in: query + description: 'Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.' + schema: + enum: + - Default + - AiredEpisodeOrder + - Album + - AlbumArtist + - Artist + - DateCreated + - OfficialRating + - DatePlayed + - PremiereDate + - StartDate + - SortName + - Name + - Random + - Runtime + - CommunityRating + - ProductionYear + - PlayCount + - CriticRating + - IsFolder + - IsUnplayed + - IsPlayed + - SeriesSortName + - VideoBitRate + - AirTime + - Studio + - IsFavoriteOrLiked + - DateLastContentAdded + - SeriesDatePlayed + - ParentIndexNumber + - IndexNumber + - SimilarityScore + - SearchScore + allOf: + - $ref: '#/components/schemas/ItemSortBy' + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Shows/{seriesId}/Seasons: + get: + tags: + - TvShows + summary: Gets seasons for a tv series. + operationId: GetSeasons + parameters: + - name: seriesId + in: path + description: The series id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: isSpecialSeason + in: query + description: Optional. Filter by special season. + schema: + type: boolean + - name: isMissing + in: query + description: Optional. Filter by items that are missing episodes or not. + schema: + type: boolean + - name: adjacentTo + in: query + description: Optional. Return items that are siblings of a supplied item. + schema: + type: string + format: uuid + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Shows/NextUp: + get: + tags: + - TvShows + summary: Gets a list of next up episodes. + operationId: GetNextUp + parameters: + - name: userId + in: query + description: The user id of the user to get the next up episodes for. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: seriesId + in: query + description: Optional. Filter by series id. + schema: + type: string + format: uuid + - name: parentId + in: query + description: Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: nextUpDateCutoff + in: query + description: Optional. Starting date of shows to show in Next Up section. + schema: + type: string + format: date-time + - name: enableTotalRecordCount + in: query + description: Whether to enable the total records count. Defaults to true. + schema: + type: boolean + default: true + - name: disableFirstEpisode + in: query + description: Whether to disable sending the first episode in a series as next up. + schema: + type: boolean + default: false + - name: enableResumable + in: query + description: Whether to include resumable episodes in next up results. + schema: + type: boolean + default: true + - name: enableRewatching + in: query + description: Whether to include watched episodes in next up results. + schema: + type: boolean + default: false + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Shows/Upcoming: + get: + tags: + - TvShows + summary: Gets a list of upcoming episodes. + operationId: GetUpcomingEpisodes + parameters: + - name: userId + in: query + description: The user id of the user to get the upcoming episodes for. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: parentId + in: query + description: Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Audio/{itemId}/universal: + get: + tags: + - UniversalAudio + summary: Gets an audio stream. + operationId: GetUniversalAudioStream + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: query + description: Optional. The audio container. + schema: + type: array + items: + type: string + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: userId + in: query + description: Optional. The user id. + schema: + type: string + format: uuid + - name: audioCodec + in: query + description: Optional. The audio codec to transcode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: maxAudioChannels + in: query + description: Optional. The maximum number of audio channels. + schema: + type: integer + format: int32 + - name: transcodingAudioChannels + in: query + description: Optional. The number of how many audio channels to transcode to. + schema: + type: integer + format: int32 + - name: maxStreamingBitrate + in: query + description: Optional. The maximum streaming bitrate. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: transcodingContainer + in: query + description: Optional. The container to transcode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodingProtocol + in: query + description: Optional. The transcoding protocol. + schema: + enum: + - http + - hls + allOf: + - $ref: '#/components/schemas/MediaStreamProtocol' + - name: maxAudioSampleRate + in: query + description: Optional. The maximum audio sample rate. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: enableRemoteMedia + in: query + description: Optional. Whether to enable remote media. + schema: + type: boolean + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + default: false + - name: enableRedirection + in: query + description: Whether to enable redirection. Defaults to true. + schema: + type: boolean + default: true + responses: + "200": + description: Audio stream returned. + content: + audio/*: + schema: + type: string + format: binary + "302": + description: Redirected to remote audio stream. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + head: + tags: + - UniversalAudio + summary: Gets an audio stream. + operationId: HeadUniversalAudioStream + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: query + description: Optional. The audio container. + schema: + type: array + items: + type: string + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: userId + in: query + description: Optional. The user id. + schema: + type: string + format: uuid + - name: audioCodec + in: query + description: Optional. The audio codec to transcode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: maxAudioChannels + in: query + description: Optional. The maximum number of audio channels. + schema: + type: integer + format: int32 + - name: transcodingAudioChannels + in: query + description: Optional. The number of how many audio channels to transcode to. + schema: + type: integer + format: int32 + - name: maxStreamingBitrate + in: query + description: Optional. The maximum streaming bitrate. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: transcodingContainer + in: query + description: Optional. The container to transcode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodingProtocol + in: query + description: Optional. The transcoding protocol. + schema: + enum: + - http + - hls + allOf: + - $ref: '#/components/schemas/MediaStreamProtocol' + - name: maxAudioSampleRate + in: query + description: Optional. The maximum audio sample rate. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: enableRemoteMedia + in: query + description: Optional. Whether to enable remote media. + schema: + type: boolean + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + default: false + - name: enableRedirection + in: query + description: Whether to enable redirection. Defaults to true. + schema: + type: boolean + default: true + responses: + "200": + description: Audio stream returned. + content: + audio/*: + schema: + type: string + format: binary + "302": + description: Redirected to remote audio stream. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users: + get: + tags: + - User + summary: Gets a list of users. + operationId: GetUsers + parameters: + - name: isHidden + in: query + description: Optional filter by IsHidden=true or false. + schema: + type: boolean + - name: isDisabled + in: query + description: Optional filter by IsDisabled=true or false. + schema: + type: boolean + responses: + "200": + description: Users returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UserDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/UserDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/UserDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + post: + tags: + - User + summary: Updates a user. + operationId: UpdateUser + parameters: + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + requestBody: + description: The updated user model. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UserDto' + description: Class UserDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UserDto' + description: Class UserDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UserDto' + description: Class UserDto. + required: true + responses: + "204": + description: User updated. + "400": + description: User information was not supplied. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: User update forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}: + get: + tags: + - User + summary: Gets a user by Id. + operationId: GetUserById + parameters: + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: User returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UserDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserDto' + "404": + description: User not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - IgnoreParentalControl + - DefaultAuthorization + delete: + tags: + - User + summary: Deletes a user. + operationId: DeleteUser + parameters: + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: User deleted. + "404": + description: User not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Users/{userId}/Policy: + post: + tags: + - User + summary: Updates a user policy. + operationId: UpdateUserPolicy + parameters: + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + requestBody: + description: The new user policy. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UserPolicy' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UserPolicy' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UserPolicy' + required: true + responses: + "204": + description: User policy updated. + "400": + description: User policy was not supplied. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: User policy update forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - RequiresElevation + /Users/AuthenticateByName: + post: + tags: + - User + summary: Authenticates a user by name. + operationId: AuthenticateUserByName + requestBody: + description: The M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) request. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/AuthenticateUserByName' + description: The authenticate user by name request body. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/AuthenticateUserByName' + description: The authenticate user by name request body. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/AuthenticateUserByName' + description: The authenticate user by name request body. + required: true + responses: + "200": + description: User authenticated. + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/AuthenticationResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/AuthenticationResult' + /Users/AuthenticateWithQuickConnect: + post: + tags: + - User + summary: Authenticates a user with quick connect. + operationId: AuthenticateWithQuickConnect + requestBody: + description: The Jellyfin.Api.Models.UserDtos.QuickConnectDto request. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/QuickConnectDto' + description: The quick connect request body. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/QuickConnectDto' + description: The quick connect request body. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/QuickConnectDto' + description: The quick connect request body. + required: true + responses: + "200": + description: User authenticated. + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/AuthenticationResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/AuthenticationResult' + "400": + description: Missing token. + /Users/Configuration: + post: + tags: + - User + summary: Updates a user configuration. + operationId: UpdateUserConfiguration + parameters: + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + requestBody: + description: The new user configuration. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UserConfiguration' + description: Class UserConfiguration. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UserConfiguration' + description: Class UserConfiguration. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UserConfiguration' + description: Class UserConfiguration. + required: true + responses: + "204": + description: User configuration updated. + "403": + description: User configuration update forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/ForgotPassword: + post: + tags: + - User + summary: Initiates the forgot password process for a local user. + operationId: ForgotPassword + requestBody: + description: The forgot password request containing the entered username. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ForgotPasswordDto' + description: Forgot Password request body DTO. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/ForgotPasswordDto' + description: Forgot Password request body DTO. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/ForgotPasswordDto' + description: Forgot Password request body DTO. + required: true + responses: + "200": + description: Password reset process started. + content: + application/json: + schema: + $ref: '#/components/schemas/ForgotPasswordResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ForgotPasswordResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ForgotPasswordResult' + /Users/ForgotPassword/Pin: + post: + tags: + - User + summary: Redeems a forgot password pin. + operationId: ForgotPasswordPin + requestBody: + description: The forgot password pin request containing the entered pin. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ForgotPasswordPinDto' + description: Forgot Password Pin enter request body DTO. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/ForgotPasswordPinDto' + description: Forgot Password Pin enter request body DTO. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/ForgotPasswordPinDto' + description: Forgot Password Pin enter request body DTO. + required: true + responses: + "200": + description: Pin reset process started. + content: + application/json: + schema: + $ref: '#/components/schemas/PinRedeemResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/PinRedeemResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/PinRedeemResult' + /Users/Me: + get: + tags: + - User + summary: Gets the user based on auth token. + operationId: GetCurrentUser + responses: + "200": + description: User returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UserDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserDto' + "400": + description: Token is not owned by a user. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/New: + post: + tags: + - User + summary: Creates a user. + operationId: CreateUserByName + requestBody: + description: The create user by name request body. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CreateUserByName' + description: The create user by name request body. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/CreateUserByName' + description: The create user by name request body. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/CreateUserByName' + description: The create user by name request body. + required: true + responses: + "200": + description: User created. + content: + application/json: + schema: + $ref: '#/components/schemas/UserDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Users/Password: + post: + tags: + - User + summary: Updates a user's password. + operationId: UpdateUserPassword + parameters: + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + requestBody: + description: The M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Nullable{System.Guid},Jellyfin.Api.Models.UserDtos.UpdateUserPassword) request. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateUserPassword' + description: The update user password request body. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateUserPassword' + description: The update user password request body. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateUserPassword' + description: The update user password request body. + required: true + responses: + "204": + description: Password successfully reset. + "403": + description: User is not allowed to update the password. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: User not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/Public: + get: + tags: + - User + summary: Gets a list of publicly visible users for display on a login screen. + operationId: GetPublicUsers + responses: + "200": + description: Public users returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UserDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/UserDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/UserDto' + /Items/{itemId}/Intros: + get: + tags: + - UserLibrary + summary: Gets intros to play before the main media item plays. + operationId: GetIntros + parameters: + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Intros returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/LocalTrailers: + get: + tags: + - UserLibrary + summary: Gets local trailers for an item. + operationId: GetLocalTrailers + parameters: + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: An Microsoft.AspNetCore.Mvc.OkResult containing the item's local trailers. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/SpecialFeatures: + get: + tags: + - UserLibrary + summary: Gets special features for an item. + operationId: GetSpecialFeatures + parameters: + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Special features returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/Latest: + get: + tags: + - UserLibrary + summary: Gets latest media. + operationId: GetLatestMedia + parameters: + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: isPlayed + in: query + description: Filter by items that are played, or not. + schema: + type: boolean + - name: enableImages + in: query + description: Optional. include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: enableUserData + in: query + description: Optional. include user data. + schema: + type: boolean + - name: limit + in: query + description: Return item limit. + schema: + type: integer + format: int32 + default: 20 + - name: groupItems + in: query + description: Whether or not to group items into a parent container. + schema: + type: boolean + default: true + responses: + "200": + description: Latest media returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/Root: + get: + tags: + - UserLibrary + summary: Gets the root folder from a user's library. + operationId: GetRootFolder + parameters: + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + responses: + "200": + description: Root folder returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /UserFavoriteItems/{itemId}: + post: + tags: + - UserLibrary + summary: Marks an item as a favorite. + operationId: MarkFavoriteItem + parameters: + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Item marked as favorite. + content: + application/json: + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - UserLibrary + summary: Unmarks item as a favorite. + operationId: UnmarkFavoriteItem + parameters: + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Item unmarked as favorite. + content: + application/json: + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /UserItems/{itemId}/Rating: + delete: + tags: + - UserLibrary + summary: Deletes a user's saved personal rating for an item. + operationId: DeleteUserItemRating + parameters: + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Personal rating removed. + content: + application/json: + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + post: + tags: + - UserLibrary + summary: Updates a user's rating for an item. + operationId: UpdateUserItemRating + parameters: + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: likes + in: query + description: Whether this M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Nullable{System.Guid},System.Guid,System.Nullable{System.Boolean}) is likes. + schema: + type: boolean + responses: + "200": + description: Item rating updated. + content: + application/json: + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /UserViews: + get: + tags: + - UserViews + summary: Get user views. + operationId: GetUserViews + parameters: + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: includeExternalContent + in: query + description: Whether or not to include external views such as channels or live tv. + schema: + type: boolean + - name: presetViews + in: query + description: Preset views. + schema: + type: array + items: + $ref: '#/components/schemas/CollectionType' + - name: includeHidden + in: query + description: Whether or not to include hidden content. + schema: + type: boolean + default: false + responses: + "200": + description: User views returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /UserViews/GroupingOptions: + get: + tags: + - UserViews + summary: Get user view grouping options. + operationId: GetGroupingOptions + parameters: + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + responses: + "200": + description: User view grouping options returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SpecialViewOptionDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/SpecialViewOptionDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/SpecialViewOptionDto' + "404": + description: User not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{videoId}/{mediaSourceId}/Attachments/{index}: + get: + tags: + - VideoAttachments + summary: Get video attachment. + operationId: GetAttachment + parameters: + - name: videoId + in: path + description: Video ID. + required: true + schema: + type: string + format: uuid + - name: mediaSourceId + in: path + description: Media Source ID. + required: true + schema: + type: string + - name: index + in: path + description: Attachment Index. + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: Attachment retrieved. + content: + application/octet-stream: + schema: + type: string + format: binary + "404": + description: Video or attachment not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Videos/{itemId}/AdditionalParts: + get: + tags: + - Videos + summary: Gets additional parts for a video. + operationId: GetAdditionalPart + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Additional parts returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{itemId}/AlternateSources: + delete: + tags: + - Videos + summary: Removes alternate video sources. + operationId: DeleteAlternateSources + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: Alternate sources deleted. + "404": + description: Video not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Videos/{itemId}/stream: + get: + tags: + - Videos + summary: Gets a video stream. + operationId: GetVideoStream + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: query + description: 'The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + deprecated: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. The maximum horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The maximum vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + responses: + "200": + description: Video stream returned. + content: + video/*: + schema: + type: string + format: binary + head: + tags: + - Videos + summary: Gets a video stream. + operationId: HeadVideoStream + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: query + description: 'The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + deprecated: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. The maximum horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The maximum vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + responses: + "200": + description: Video stream returned. + content: + video/*: + schema: + type: string + format: binary + /Videos/{itemId}/stream.{container}: + get: + tags: + - Videos + summary: Gets a video stream. + operationId: GetVideoStreamByContainer + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: path + description: 'The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.' + required: true + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. The maximum horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The maximum vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + responses: + "200": + description: Video stream returned. + content: + video/*: + schema: + type: string + format: binary + head: + tags: + - Videos + summary: Gets a video stream. + operationId: HeadVideoStreamByContainer + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: path + description: 'The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.' + required: true + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + pattern: -?[0-9]+(?:\.[0-9]+)? + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. The maximum horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The maximum vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAudioVbrEncoding + in: query + description: Optional. Whether to enable Audio Encoding. + schema: + type: boolean + default: true + responses: + "200": + description: Video stream returned. + content: + video/*: + schema: + type: string + format: binary + /Videos/MergeVersions: + post: + tags: + - Videos + summary: Merges videos into a single record. + operationId: MergeVersions + parameters: + - name: ids + in: query + description: Item id list. This allows multiple, comma delimited. + required: true + schema: + type: array + items: + type: string + format: uuid + responses: + "204": + description: Videos merged. + "400": + description: Supply at least 2 video ids. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Years: + get: + tags: + - Years + summary: Get years. + operationId: GetYears + parameters: + - name: startIndex + in: query + description: Skips over a given number of items within the results. Use for paging. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: sortOrder + in: query + description: Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be excluded based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be included based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: mediaTypes + in: query + description: Optional. Filter by MediaType. Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/MediaType' + - name: sortBy + in: query + description: 'Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemSortBy' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: userId + in: query + description: User Id. + schema: + type: string + format: uuid + - name: recursive + in: query + description: Search recursively. + schema: + type: boolean + default: true + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + default: true + responses: + "200": + description: Year query returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Years/{year}: + get: + tags: + - Years + summary: Gets a year. + operationId: GetYear + parameters: + - name: year + in: path + description: The year. + required: true + schema: + type: integer + format: int32 + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Year returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "404": + description: Year not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization +components: + schemas: + AccessSchedule: + type: object + properties: + Id: + type: integer + description: Gets the id of this instance. + format: int32 + readOnly: true + UserId: + type: string + description: Gets the id of the associated user. + format: uuid + DayOfWeek: + enum: + - Sunday + - Monday + - Tuesday + - Wednesday + - Thursday + - Friday + - Saturday + - Everyday + - Weekday + - Weekend + allOf: + - $ref: '#/components/schemas/DynamicDayOfWeek' + description: Gets or sets the day of week. + StartHour: + type: number + description: Gets or sets the start hour. + format: double + EndHour: + type: number + description: Gets or sets the end hour. + format: double + additionalProperties: false + description: An entity representing a user's access schedule. + ActivityLogEntry: + type: object + properties: + Id: + type: integer + description: Gets or sets the identifier. + format: int64 + Name: + type: string + description: Gets or sets the name. + Overview: + type: string + description: Gets or sets the overview. + nullable: true + ShortOverview: + type: string + description: Gets or sets the short overview. + nullable: true + Type: + type: string + description: Gets or sets the type. + ItemId: + type: string + description: Gets or sets the item identifier. + nullable: true + Date: + type: string + description: Gets or sets the date. + format: date-time + UserId: + type: string + description: Gets or sets the user identifier. + format: uuid + UserPrimaryImageTag: + type: string + description: Gets or sets the user primary image tag. + nullable: true + deprecated: true + Severity: + enum: + - Trace + - Debug + - Information + - Warning + - Error + - Critical + - None + allOf: + - $ref: '#/components/schemas/LogLevel' + description: Gets or sets the log severity. + additionalProperties: false + description: An activity log entry. + ActivityLogEntryMessage: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/ActivityLogEntry' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: ActivityLogEntry + readOnly: true + additionalProperties: false + description: Activity log created message. + ActivityLogEntryQueryResult: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/ActivityLogEntry' + description: Gets or sets the items. + TotalRecordCount: + type: integer + description: Gets or sets the total number of records available. + format: int32 + StartIndex: + type: integer + description: Gets or sets the index of the first record in Items. + format: int32 + additionalProperties: false + description: Query result container. + ActivityLogEntryStartMessage: + type: object + properties: + Data: + type: string + description: Gets or sets the data. + nullable: true + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: ActivityLogEntryStart + readOnly: true + additionalProperties: false + description: "Activity log entry start message.\r\nData is the timing data encoded as \"$initialDelay,$interval\" in ms." + ActivityLogEntryStopMessage: + type: object + properties: + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: ActivityLogEntryStop + readOnly: true + additionalProperties: false + description: Activity log entry stop message. + AddVirtualFolderDto: + type: object + properties: + LibraryOptions: + allOf: + - $ref: '#/components/schemas/LibraryOptions' + description: Gets or sets library options. + nullable: true + additionalProperties: false + description: Add virtual folder dto. + AlbumInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + AlbumArtists: + type: array + items: + type: string + description: Gets or sets the album artist. + ArtistProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the artist provider ids. + SongInfos: + type: array + items: + $ref: '#/components/schemas/SongInfo' + additionalProperties: false + AlbumInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/AlbumInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + AllThemeMediaResult: + type: object + properties: + ThemeVideosResult: + allOf: + - $ref: '#/components/schemas/ThemeMediaResult' + description: Class ThemeMediaResult. + nullable: true + ThemeSongsResult: + allOf: + - $ref: '#/components/schemas/ThemeMediaResult' + description: Class ThemeMediaResult. + nullable: true + SoundtrackSongsResult: + allOf: + - $ref: '#/components/schemas/ThemeMediaResult' + description: Class ThemeMediaResult. + nullable: true + additionalProperties: false + ArtistInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + SongInfos: + type: array + items: + $ref: '#/components/schemas/SongInfo' + additionalProperties: false + ArtistInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/ArtistInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + AudioSpatialFormat: + enum: + - None + - DolbyAtmos + - DTSX + type: string + description: An enum representing formats of spatial audio. + AuthenticateUserByName: + type: object + properties: + Username: + type: string + description: Gets or sets the username. + nullable: true + Pw: + type: string + description: Gets or sets the plain text password. + nullable: true + additionalProperties: false + description: The authenticate user by name request body. + AuthenticationInfo: + type: object + properties: + Id: + type: integer + description: Gets or sets the identifier. + format: int64 + AccessToken: + type: string + description: Gets or sets the access token. + nullable: true + DeviceId: + type: string + description: Gets or sets the device identifier. + nullable: true + AppName: + type: string + description: Gets or sets the name of the application. + nullable: true + AppVersion: + type: string + description: Gets or sets the application version. + nullable: true + DeviceName: + type: string + description: Gets or sets the name of the device. + nullable: true + UserId: + type: string + description: Gets or sets the user identifier. + format: uuid + IsActive: + type: boolean + description: Gets or sets a value indicating whether this instance is active. + DateCreated: + type: string + description: Gets or sets the date created. + format: date-time + DateRevoked: + type: string + description: Gets or sets the date revoked. + format: date-time + nullable: true + DateLastActivity: + type: string + format: date-time + UserName: + type: string + nullable: true + additionalProperties: false + AuthenticationInfoQueryResult: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/AuthenticationInfo' + description: Gets or sets the items. + TotalRecordCount: + type: integer + description: Gets or sets the total number of records available. + format: int32 + StartIndex: + type: integer + description: Gets or sets the index of the first record in Items. + format: int32 + additionalProperties: false + description: Query result container. + AuthenticationResult: + type: object + properties: + User: + allOf: + - $ref: '#/components/schemas/UserDto' + description: Gets or sets the user. + nullable: true + SessionInfo: + allOf: + - $ref: '#/components/schemas/SessionInfoDto' + description: Gets or sets the session info. + nullable: true + AccessToken: + type: string + description: Gets or sets the access token. + nullable: true + ServerId: + type: string + description: Gets or sets the server id. + nullable: true + additionalProperties: false + description: A class representing an authentication result. + BaseItemDto: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + nullable: true + ServerId: + type: string + description: Gets or sets the server identifier. + nullable: true + Id: + type: string + description: Gets or sets the id. + format: uuid + Etag: + type: string + description: Gets or sets the etag. + nullable: true + SourceType: + type: string + description: Gets or sets the type of the source. + nullable: true + PlaylistItemId: + type: string + description: Gets or sets the playlist item identifier. + nullable: true + DateCreated: + type: string + description: Gets or sets the date created. + format: date-time + nullable: true + DateLastMediaAdded: + type: string + format: date-time + nullable: true + ExtraType: + enum: + - Unknown + - Clip + - Trailer + - BehindTheScenes + - DeletedScene + - Interview + - Scene + - Sample + - ThemeSong + - ThemeVideo + - Featurette + - Short + allOf: + - $ref: '#/components/schemas/ExtraType' + nullable: true + AirsBeforeSeasonNumber: + type: integer + format: int32 + nullable: true + AirsAfterSeasonNumber: + type: integer + format: int32 + nullable: true + AirsBeforeEpisodeNumber: + type: integer + format: int32 + nullable: true + CanDelete: + type: boolean + nullable: true + CanDownload: + type: boolean + nullable: true + HasLyrics: + type: boolean + nullable: true + HasSubtitles: + type: boolean + nullable: true + PreferredMetadataLanguage: + type: string + nullable: true + PreferredMetadataCountryCode: + type: string + nullable: true + Container: + type: string + nullable: true + SortName: + type: string + description: Gets or sets the name of the sort. + nullable: true + ForcedSortName: + type: string + nullable: true + Video3DFormat: + enum: + - HalfSideBySide + - FullSideBySide + - FullTopAndBottom + - HalfTopAndBottom + - MVC + allOf: + - $ref: '#/components/schemas/Video3DFormat' + description: Gets or sets the video3 D format. + nullable: true + PremiereDate: + type: string + description: Gets or sets the premiere date. + format: date-time + nullable: true + ExternalUrls: + type: array + items: + $ref: '#/components/schemas/ExternalUrl' + description: Gets or sets the external urls. + nullable: true + MediaSources: + type: array + items: + $ref: '#/components/schemas/MediaSourceInfo' + description: Gets or sets the media versions. + nullable: true + CriticRating: + type: number + description: Gets or sets the critic rating. + format: float + nullable: true + ProductionLocations: + type: array + items: + type: string + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + EnableMediaSourceDisplay: + type: boolean + nullable: true + OfficialRating: + type: string + description: Gets or sets the official rating. + nullable: true + CustomRating: + type: string + description: Gets or sets the custom rating. + nullable: true + ChannelId: + type: string + description: Gets or sets the channel identifier. + format: uuid + nullable: true + ChannelName: + type: string + nullable: true + Overview: + type: string + description: Gets or sets the overview. + nullable: true + Taglines: + type: array + items: + type: string + description: Gets or sets the taglines. + nullable: true + Genres: + type: array + items: + type: string + description: Gets or sets the genres. + nullable: true + CommunityRating: + type: number + description: Gets or sets the community rating. + format: float + nullable: true + CumulativeRunTimeTicks: + type: integer + description: Gets or sets the cumulative run time ticks. + format: int64 + nullable: true + RunTimeTicks: + type: integer + description: Gets or sets the run time ticks. + format: int64 + nullable: true + PlayAccess: + enum: + - Full + - None + allOf: + - $ref: '#/components/schemas/PlayAccess' + description: Gets or sets the play access. + nullable: true + AspectRatio: + type: string + description: Gets or sets the aspect ratio. + nullable: true + ProductionYear: + type: integer + description: Gets or sets the production year. + format: int32 + nullable: true + IsPlaceHolder: + type: boolean + description: Gets or sets a value indicating whether this instance is place holder. + nullable: true + Number: + type: string + description: Gets or sets the number. + nullable: true + ChannelNumber: + type: string + nullable: true + IndexNumber: + type: integer + description: Gets or sets the index number. + format: int32 + nullable: true + IndexNumberEnd: + type: integer + description: Gets or sets the index number end. + format: int32 + nullable: true + ParentIndexNumber: + type: integer + description: Gets or sets the parent index number. + format: int32 + nullable: true + RemoteTrailers: + type: array + items: + $ref: '#/components/schemas/MediaUrl' + description: Gets or sets the trailer urls. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + IsHD: + type: boolean + description: Gets or sets a value indicating whether this instance is HD. + nullable: true + IsFolder: + type: boolean + description: Gets or sets a value indicating whether this instance is folder. + nullable: true + ParentId: + type: string + description: Gets or sets the parent id. + format: uuid + nullable: true + Type: + enum: + - AggregateFolder + - Audio + - AudioBook + - BasePluginFolder + - Book + - BoxSet + - Channel + - ChannelFolderItem + - CollectionFolder + - Episode + - Folder + - Genre + - ManualPlaylistsFolder + - Movie + - LiveTvChannel + - LiveTvProgram + - MusicAlbum + - MusicArtist + - MusicGenre + - MusicVideo + - Person + - Photo + - PhotoAlbum + - Playlist + - PlaylistsFolder + - Program + - Recording + - Season + - Series + - Studio + - Trailer + - TvChannel + - TvProgram + - UserRootFolder + - UserView + - Video + - Year + allOf: + - $ref: '#/components/schemas/BaseItemKind' + description: Gets or sets the type. + People: + type: array + items: + $ref: '#/components/schemas/BaseItemPerson' + description: Gets or sets the people. + nullable: true + Studios: + type: array + items: + $ref: '#/components/schemas/NameGuidPair' + description: Gets or sets the studios. + nullable: true + GenreItems: + type: array + items: + $ref: '#/components/schemas/NameGuidPair' + nullable: true + ParentLogoItemId: + type: string + description: Gets or sets whether the item has a logo, this will hold the Id of the Parent that has one. + format: uuid + nullable: true + ParentBackdropItemId: + type: string + description: Gets or sets whether the item has any backdrops, this will hold the Id of the Parent that has one. + format: uuid + nullable: true + ParentBackdropImageTags: + type: array + items: + type: string + description: Gets or sets the parent backdrop image tags. + nullable: true + LocalTrailerCount: + type: integer + description: Gets or sets the local trailer count. + format: int32 + nullable: true + UserData: + allOf: + - $ref: '#/components/schemas/UserItemDataDto' + description: Gets or sets the user data for this item based on the user it's being requested for. + nullable: true + RecursiveItemCount: + type: integer + description: Gets or sets the recursive item count. + format: int32 + nullable: true + ChildCount: + type: integer + description: Gets or sets the child count. + format: int32 + nullable: true + SeriesName: + type: string + description: Gets or sets the name of the series. + nullable: true + SeriesId: + type: string + description: Gets or sets the series id. + format: uuid + nullable: true + SeasonId: + type: string + description: Gets or sets the season identifier. + format: uuid + nullable: true + SpecialFeatureCount: + type: integer + description: Gets or sets the special feature count. + format: int32 + nullable: true + DisplayPreferencesId: + type: string + description: Gets or sets the display preferences id. + nullable: true + Status: + type: string + description: Gets or sets the status. + nullable: true + AirTime: + type: string + description: Gets or sets the air time. + nullable: true + AirDays: + type: array + items: + $ref: '#/components/schemas/DayOfWeek' + description: Gets or sets the air days. + nullable: true + Tags: + type: array + items: + type: string + description: Gets or sets the tags. + nullable: true + PrimaryImageAspectRatio: + type: number + description: Gets or sets the primary image aspect ratio, after image enhancements. + format: double + nullable: true + Artists: + type: array + items: + type: string + description: Gets or sets the artists. + nullable: true + ArtistItems: + type: array + items: + $ref: '#/components/schemas/NameGuidPair' + description: Gets or sets the artist items. + nullable: true + Album: + type: string + description: Gets or sets the album. + nullable: true + CollectionType: + enum: + - unknown + - movies + - tvshows + - music + - musicvideos + - trailers + - homevideos + - boxsets + - books + - photos + - livetv + - playlists + - folders + allOf: + - $ref: '#/components/schemas/CollectionType' + description: Gets or sets the type of the collection. + nullable: true + DisplayOrder: + type: string + description: Gets or sets the display order. + nullable: true + AlbumId: + type: string + description: Gets or sets the album id. + format: uuid + nullable: true + AlbumPrimaryImageTag: + type: string + description: Gets or sets the album image tag. + nullable: true + SeriesPrimaryImageTag: + type: string + description: Gets or sets the series primary image tag. + nullable: true + AlbumArtist: + type: string + description: Gets or sets the album artist. + nullable: true + AlbumArtists: + type: array + items: + $ref: '#/components/schemas/NameGuidPair' + description: Gets or sets the album artists. + nullable: true + SeasonName: + type: string + description: Gets or sets the name of the season. + nullable: true + MediaStreams: + type: array + items: + $ref: '#/components/schemas/MediaStream' + description: Gets or sets the media streams. + nullable: true + VideoType: + enum: + - VideoFile + - Iso + - Dvd + - BluRay + allOf: + - $ref: '#/components/schemas/VideoType' + description: Gets or sets the type of the video. + nullable: true + PartCount: + type: integer + description: Gets or sets the part count. + format: int32 + nullable: true + MediaSourceCount: + type: integer + format: int32 + nullable: true + ImageTags: + type: object + additionalProperties: + type: string + description: Gets or sets the image tags. + nullable: true + BackdropImageTags: + type: array + items: + type: string + description: Gets or sets the backdrop image tags. + nullable: true + ScreenshotImageTags: + type: array + items: + type: string + description: Gets or sets the screenshot image tags. + nullable: true + ParentLogoImageTag: + type: string + description: Gets or sets the parent logo image tag. + nullable: true + ParentArtItemId: + type: string + description: Gets or sets whether the item has fan art, this will hold the Id of the Parent that has one. + format: uuid + nullable: true + ParentArtImageTag: + type: string + description: Gets or sets the parent art image tag. + nullable: true + SeriesThumbImageTag: + type: string + description: Gets or sets the series thumb image tag. + nullable: true + ImageBlurHashes: + type: object + properties: + Primary: + type: object + additionalProperties: + type: string + Art: + type: object + additionalProperties: + type: string + Backdrop: + type: object + additionalProperties: + type: string + Banner: + type: object + additionalProperties: + type: string + Logo: + type: object + additionalProperties: + type: string + Thumb: + type: object + additionalProperties: + type: string + Disc: + type: object + additionalProperties: + type: string + Box: + type: object + additionalProperties: + type: string + Screenshot: + type: object + additionalProperties: + type: string + Menu: + type: object + additionalProperties: + type: string + Chapter: + type: object + additionalProperties: + type: string + BoxRear: + type: object + additionalProperties: + type: string + Profile: + type: object + additionalProperties: + type: string + description: "Gets or sets the blurhashes for the image tags.\r\nMaps image type to dictionary mapping image tag to blurhash value." + nullable: true + SeriesStudio: + type: string + description: Gets or sets the series studio. + nullable: true + ParentThumbItemId: + type: string + description: Gets or sets the parent thumb item id. + format: uuid + nullable: true + ParentThumbImageTag: + type: string + description: Gets or sets the parent thumb image tag. + nullable: true + ParentPrimaryImageItemId: + type: string + description: Gets or sets the parent primary image item identifier. + nullable: true + ParentPrimaryImageTag: + type: string + description: Gets or sets the parent primary image tag. + nullable: true + Chapters: + type: array + items: + $ref: '#/components/schemas/ChapterInfo' + description: Gets or sets the chapters. + nullable: true + Trickplay: + type: object + additionalProperties: + type: object + additionalProperties: + $ref: '#/components/schemas/TrickplayInfo' + description: Gets or sets the trickplay manifest. + nullable: true + LocationType: + enum: + - FileSystem + - Remote + - Virtual + - Offline + allOf: + - $ref: '#/components/schemas/LocationType' + description: Gets or sets the type of the location. + nullable: true + IsoType: + enum: + - Dvd + - BluRay + allOf: + - $ref: '#/components/schemas/IsoType' + description: Gets or sets the type of the iso. + nullable: true + MediaType: + enum: + - Unknown + - Video + - Audio + - Photo + - Book + allOf: + - $ref: '#/components/schemas/MediaType' + description: Gets or sets the type of the media. + default: Unknown + EndDate: + type: string + description: Gets or sets the end date. + format: date-time + nullable: true + LockedFields: + type: array + items: + $ref: '#/components/schemas/MetadataField' + description: Gets or sets the locked fields. + nullable: true + TrailerCount: + type: integer + description: Gets or sets the trailer count. + format: int32 + nullable: true + MovieCount: + type: integer + description: Gets or sets the movie count. + format: int32 + nullable: true + SeriesCount: + type: integer + description: Gets or sets the series count. + format: int32 + nullable: true + ProgramCount: + type: integer + format: int32 + nullable: true + EpisodeCount: + type: integer + description: Gets or sets the episode count. + format: int32 + nullable: true + SongCount: + type: integer + description: Gets or sets the song count. + format: int32 + nullable: true + AlbumCount: + type: integer + description: Gets or sets the album count. + format: int32 + nullable: true + ArtistCount: + type: integer + format: int32 + nullable: true + MusicVideoCount: + type: integer + description: Gets or sets the music video count. + format: int32 + nullable: true + LockData: + type: boolean + description: Gets or sets a value indicating whether [enable internet providers]. + nullable: true + Width: + type: integer + format: int32 + nullable: true + Height: + type: integer + format: int32 + nullable: true + CameraMake: + type: string + nullable: true + CameraModel: + type: string + nullable: true + Software: + type: string + nullable: true + ExposureTime: + type: number + format: double + nullable: true + FocalLength: + type: number + format: double + nullable: true + ImageOrientation: + enum: + - TopLeft + - TopRight + - BottomRight + - BottomLeft + - LeftTop + - RightTop + - RightBottom + - LeftBottom + allOf: + - $ref: '#/components/schemas/ImageOrientation' + nullable: true + Aperture: + type: number + format: double + nullable: true + ShutterSpeed: + type: number + format: double + nullable: true + Latitude: + type: number + format: double + nullable: true + Longitude: + type: number + format: double + nullable: true + Altitude: + type: number + format: double + nullable: true + IsoSpeedRating: + type: integer + format: int32 + nullable: true + SeriesTimerId: + type: string + description: Gets or sets the series timer identifier. + nullable: true + ProgramId: + type: string + description: Gets or sets the program identifier. + nullable: true + ChannelPrimaryImageTag: + type: string + description: Gets or sets the channel primary image tag. + nullable: true + StartDate: + type: string + description: Gets or sets the start date of the recording, in UTC. + format: date-time + nullable: true + CompletionPercentage: + type: number + description: Gets or sets the completion percentage. + format: double + nullable: true + IsRepeat: + type: boolean + description: Gets or sets a value indicating whether this instance is repeat. + nullable: true + EpisodeTitle: + type: string + description: Gets or sets the episode title. + nullable: true + ChannelType: + enum: + - TV + - Radio + allOf: + - $ref: '#/components/schemas/ChannelType' + description: Gets or sets the type of the channel. + nullable: true + Audio: + enum: + - Mono + - Stereo + - Dolby + - DolbyDigital + - Thx + - Atmos + allOf: + - $ref: '#/components/schemas/ProgramAudio' + description: Gets or sets the audio. + nullable: true + IsMovie: + type: boolean + description: Gets or sets a value indicating whether this instance is movie. + nullable: true + IsSports: + type: boolean + description: Gets or sets a value indicating whether this instance is sports. + nullable: true + IsSeries: + type: boolean + description: Gets or sets a value indicating whether this instance is series. + nullable: true + IsLive: + type: boolean + description: Gets or sets a value indicating whether this instance is live. + nullable: true + IsNews: + type: boolean + description: Gets or sets a value indicating whether this instance is news. + nullable: true + IsKids: + type: boolean + description: Gets or sets a value indicating whether this instance is kids. + nullable: true + IsPremiere: + type: boolean + description: Gets or sets a value indicating whether this instance is premiere. + nullable: true + TimerId: + type: string + description: Gets or sets the timer identifier. + nullable: true + NormalizationGain: + type: number + description: Gets or sets the gain required for audio normalization. + format: float + nullable: true + CurrentProgram: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the current program. + nullable: true + additionalProperties: false + description: "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + BaseItemDtoQueryResult: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the items. + TotalRecordCount: + type: integer + description: Gets or sets the total number of records available. + format: int32 + StartIndex: + type: integer + description: Gets or sets the index of the first record in Items. + format: int32 + additionalProperties: false + description: Query result container. + BaseItemKind: + enum: + - AggregateFolder + - Audio + - AudioBook + - BasePluginFolder + - Book + - BoxSet + - Channel + - ChannelFolderItem + - CollectionFolder + - Episode + - Folder + - Genre + - ManualPlaylistsFolder + - Movie + - LiveTvChannel + - LiveTvProgram + - MusicAlbum + - MusicArtist + - MusicGenre + - MusicVideo + - Person + - Photo + - PhotoAlbum + - Playlist + - PlaylistsFolder + - Program + - Recording + - Season + - Series + - Studio + - Trailer + - TvChannel + - TvProgram + - UserRootFolder + - UserView + - Video + - Year + type: string + description: The base item kind. + BaseItemPerson: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Id: + type: string + description: Gets or sets the identifier. + format: uuid + Role: + type: string + description: Gets or sets the role. + nullable: true + Type: + enum: + - Unknown + - Actor + - Director + - Composer + - Writer + - GuestStar + - Producer + - Conductor + - Lyricist + - Arranger + - Engineer + - Mixer + - Remixer + - Creator + - Artist + - AlbumArtist + - Author + - Illustrator + - Penciller + - Inker + - Colorist + - Letterer + - CoverArtist + - Editor + - Translator + allOf: + - $ref: '#/components/schemas/PersonKind' + description: Gets or sets the type. + default: Unknown + PrimaryImageTag: + type: string + description: Gets or sets the primary image tag. + nullable: true + ImageBlurHashes: + type: object + properties: + Primary: + type: object + additionalProperties: + type: string + Art: + type: object + additionalProperties: + type: string + Backdrop: + type: object + additionalProperties: + type: string + Banner: + type: object + additionalProperties: + type: string + Logo: + type: object + additionalProperties: + type: string + Thumb: + type: object + additionalProperties: + type: string + Disc: + type: object + additionalProperties: + type: string + Box: + type: object + additionalProperties: + type: string + Screenshot: + type: object + additionalProperties: + type: string + Menu: + type: object + additionalProperties: + type: string + Chapter: + type: object + additionalProperties: + type: string + BoxRear: + type: object + additionalProperties: + type: string + Profile: + type: object + additionalProperties: + type: string + description: Gets or sets the primary image blurhash. + nullable: true + additionalProperties: false + description: This is used by the api to get information about a Person within a BaseItem. + BasePluginConfiguration: + type: object + additionalProperties: false + description: Class BasePluginConfiguration. + BookInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + SeriesName: + type: string + nullable: true + additionalProperties: false + BookInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/BookInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + BoxSetInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + additionalProperties: false + BoxSetInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/BoxSetInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + BrandingOptions: + type: object + properties: + LoginDisclaimer: + type: string + description: Gets or sets the login disclaimer. + nullable: true + CustomCss: + type: string + description: Gets or sets the custom CSS. + nullable: true + SplashscreenEnabled: + type: boolean + description: Gets or sets a value indicating whether to enable the splashscreen. + additionalProperties: false + description: The branding options. + BufferRequestDto: + type: object + properties: + When: + type: string + description: Gets or sets when the request has been made by the client. + format: date-time + PositionTicks: + type: integer + description: Gets or sets the position ticks. + format: int64 + IsPlaying: + type: boolean + description: Gets or sets a value indicating whether the client playback is unpaused. + PlaylistItemId: + type: string + description: Gets or sets the playlist item identifier of the playing item. + format: uuid + additionalProperties: false + description: Class BufferRequestDto. + CastReceiverApplication: + type: object + properties: + Id: + type: string + description: Gets or sets the cast receiver application id. + Name: + type: string + description: Gets or sets the cast receiver application name. + additionalProperties: false + description: The cast receiver application model. + ChannelFeatures: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + Id: + type: string + description: Gets or sets the identifier. + format: uuid + CanSearch: + type: boolean + description: Gets or sets a value indicating whether this instance can search. + MediaTypes: + type: array + items: + $ref: '#/components/schemas/ChannelMediaType' + description: Gets or sets the media types. + ContentTypes: + type: array + items: + $ref: '#/components/schemas/ChannelMediaContentType' + description: Gets or sets the content types. + MaxPageSize: + type: integer + description: Gets or sets the maximum number of records the channel allows retrieving at a time. + format: int32 + nullable: true + AutoRefreshLevels: + type: integer + description: Gets or sets the automatic refresh levels. + format: int32 + nullable: true + DefaultSortFields: + type: array + items: + $ref: '#/components/schemas/ChannelItemSortField' + description: Gets or sets the default sort orders. + SupportsSortOrderToggle: + type: boolean + description: Gets or sets a value indicating whether a sort ascending/descending toggle is supported. + SupportsLatestMedia: + type: boolean + description: Gets or sets a value indicating whether [supports latest media]. + CanFilter: + type: boolean + description: Gets or sets a value indicating whether this instance can filter. + SupportsContentDownloading: + type: boolean + description: Gets or sets a value indicating whether [supports content downloading]. + additionalProperties: false + ChannelItemSortField: + enum: + - Name + - CommunityRating + - PremiereDate + - DateCreated + - Runtime + - PlayCount + - CommunityPlayCount + type: string + ChannelMappingOptionsDto: + type: object + properties: + TunerChannels: + type: array + items: + $ref: '#/components/schemas/TunerChannelMapping' + description: Gets or sets list of tuner channels. + ProviderChannels: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + description: Gets or sets list of provider channels. + Mappings: + type: array + items: + $ref: '#/components/schemas/NameValuePair' + description: Gets or sets list of mappings. + ProviderName: + type: string + description: Gets or sets provider name. + nullable: true + additionalProperties: false + description: Channel mapping options dto. + ChannelMediaContentType: + enum: + - Clip + - Podcast + - Trailer + - Movie + - Episode + - Song + - MovieExtra + - TvExtra + type: string + ChannelMediaType: + enum: + - Audio + - Video + - Photo + type: string + ChannelType: + enum: + - TV + - Radio + type: string + description: Enum ChannelType. + ChapterInfo: + type: object + properties: + StartPositionTicks: + type: integer + description: Gets or sets the start position ticks. + format: int64 + Name: + type: string + description: Gets or sets the name. + nullable: true + ImagePath: + type: string + description: Gets or sets the image path. + nullable: true + ImageDateModified: + type: string + format: date-time + ImageTag: + type: string + nullable: true + additionalProperties: false + description: Class ChapterInfo. + ClientCapabilitiesDto: + type: object + properties: + PlayableMediaTypes: + type: array + items: + $ref: '#/components/schemas/MediaType' + description: Gets or sets the list of playable media types. + SupportedCommands: + type: array + items: + $ref: '#/components/schemas/GeneralCommandType' + description: Gets or sets the list of supported commands. + SupportsMediaControl: + type: boolean + description: Gets or sets a value indicating whether session supports media control. + SupportsPersistentIdentifier: + type: boolean + description: Gets or sets a value indicating whether session supports a persistent identifier. + DeviceProfile: + allOf: + - $ref: '#/components/schemas/DeviceProfile' + description: Gets or sets the device profile. + nullable: true + AppStoreUrl: + type: string + description: Gets or sets the app store url. + nullable: true + IconUrl: + type: string + description: Gets or sets the icon url. + nullable: true + additionalProperties: false + description: Client capabilities dto. + ClientLogDocumentResponseDto: + type: object + properties: + FileName: + type: string + description: Gets the resulting filename. + additionalProperties: false + description: Client log document response dto. + CodecProfile: + type: object + properties: + Type: + enum: + - Video + - VideoAudio + - Audio + allOf: + - $ref: '#/components/schemas/CodecType' + description: Gets or sets the MediaBrowser.Model.Dlna.CodecType which this container must meet. + Conditions: + type: array + items: + $ref: '#/components/schemas/ProfileCondition' + description: Gets or sets the list of MediaBrowser.Model.Dlna.ProfileCondition which this profile must meet. + ApplyConditions: + type: array + items: + $ref: '#/components/schemas/ProfileCondition' + description: Gets or sets the list of MediaBrowser.Model.Dlna.ProfileCondition to apply if this profile is met. + Codec: + type: string + description: Gets or sets the codec(s) that this profile applies to. + nullable: true + Container: + type: string + description: Gets or sets the container(s) which this profile will be applied to. + nullable: true + SubContainer: + type: string + description: Gets or sets the sub-container(s) which this profile will be applied to. + nullable: true + additionalProperties: false + description: Defines the MediaBrowser.Model.Dlna.CodecProfile. + CodecType: + enum: + - Video + - VideoAudio + - Audio + type: string + CollectionCreationResult: + type: object + properties: + Id: + type: string + format: uuid + additionalProperties: false + CollectionType: + enum: + - unknown + - movies + - tvshows + - music + - musicvideos + - trailers + - homevideos + - boxsets + - books + - photos + - livetv + - playlists + - folders + type: string + description: Collection type. + CollectionTypeOptions: + enum: + - movies + - tvshows + - music + - musicvideos + - homevideos + - boxsets + - books + - mixed + type: string + description: The collection type options. + ConfigImageTypes: + type: object + properties: + BackdropSizes: + type: array + items: + type: string + nullable: true + BaseUrl: + type: string + nullable: true + LogoSizes: + type: array + items: + type: string + nullable: true + PosterSizes: + type: array + items: + type: string + nullable: true + ProfileSizes: + type: array + items: + type: string + nullable: true + SecureBaseUrl: + type: string + nullable: true + StillSizes: + type: array + items: + type: string + nullable: true + additionalProperties: false + ConfigurationPageInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + EnableInMainMenu: + type: boolean + description: Gets or sets a value indicating whether the configurations page is enabled in the main menu. + MenuSection: + type: string + description: Gets or sets the menu section. + nullable: true + MenuIcon: + type: string + description: Gets or sets the menu icon. + nullable: true + DisplayName: + type: string + description: Gets or sets the display name. + nullable: true + PluginId: + type: string + description: Gets or sets the plugin id. + format: uuid + nullable: true + additionalProperties: false + description: The configuration page info. + ContainerProfile: + type: object + properties: + Type: + enum: + - Audio + - Video + - Photo + - Subtitle + - Lyric + allOf: + - $ref: '#/components/schemas/DlnaProfileType' + description: Gets or sets the MediaBrowser.Model.Dlna.DlnaProfileType which this container must meet. + Conditions: + type: array + items: + $ref: '#/components/schemas/ProfileCondition' + description: Gets or sets the list of MediaBrowser.Model.Dlna.ProfileCondition which this container will be applied to. + Container: + type: string + description: Gets or sets the container(s) which this container must meet. + nullable: true + SubContainer: + type: string + description: Gets or sets the sub container(s) which this container must meet. + nullable: true + additionalProperties: false + description: Defines the MediaBrowser.Model.Dlna.ContainerProfile. + CountryInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + DisplayName: + type: string + description: Gets or sets the display name. + nullable: true + TwoLetterISORegionName: + type: string + description: Gets or sets the name of the two letter ISO region. + nullable: true + ThreeLetterISORegionName: + type: string + description: Gets or sets the name of the three letter ISO region. + nullable: true + additionalProperties: false + description: Class CountryInfo. + CreatePlaylistDto: + type: object + properties: + Name: + type: string + description: Gets or sets the name of the new playlist. + Ids: + type: array + items: + type: string + format: uuid + description: Gets or sets item ids to add to the playlist. + UserId: + type: string + description: Gets or sets the user id. + format: uuid + nullable: true + MediaType: + enum: + - Unknown + - Video + - Audio + - Photo + - Book + allOf: + - $ref: '#/components/schemas/MediaType' + description: Gets or sets the media type. + nullable: true + Users: + type: array + items: + $ref: '#/components/schemas/PlaylistUserPermissions' + description: Gets or sets the playlist users. + IsPublic: + type: boolean + description: Gets or sets a value indicating whether the playlist is public. + additionalProperties: false + description: Create new playlist dto. + CreateUserByName: + required: + - Name + type: object + properties: + Name: + type: string + description: Gets or sets the username. + Password: + type: string + description: Gets or sets the password. + nullable: true + additionalProperties: false + description: The create user by name request body. + CultureDto: + type: object + properties: + Name: + type: string + description: Gets the name. + DisplayName: + type: string + description: Gets the display name. + TwoLetterISOLanguageName: + type: string + description: Gets the name of the two letter ISO language. + ThreeLetterISOLanguageName: + type: string + description: Gets the name of the three letter ISO language. + nullable: true + readOnly: true + ThreeLetterISOLanguageNames: + type: array + items: + type: string + additionalProperties: false + description: Class CultureDto. + DayOfWeek: + enum: + - Sunday + - Monday + - Tuesday + - Wednesday + - Thursday + - Friday + - Saturday + type: string + DayPattern: + enum: + - Daily + - Weekdays + - Weekends + type: string + DefaultDirectoryBrowserInfoDto: + type: object + properties: + Path: + type: string + description: Gets or sets the path. + nullable: true + additionalProperties: false + description: Default directory browser info. + DeinterlaceMethod: + enum: + - yadif + - bwdif + type: string + description: Enum containing deinterlace methods. + DeviceInfoDto: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + CustomName: + type: string + description: Gets or sets the custom name. + nullable: true + AccessToken: + type: string + description: Gets or sets the access token. + nullable: true + Id: + type: string + description: Gets or sets the identifier. + nullable: true + LastUserName: + type: string + description: Gets or sets the last name of the user. + nullable: true + AppName: + type: string + description: Gets or sets the name of the application. + nullable: true + AppVersion: + type: string + description: Gets or sets the application version. + nullable: true + LastUserId: + type: string + description: Gets or sets the last user identifier. + format: uuid + nullable: true + DateLastActivity: + type: string + description: Gets or sets the date last modified. + format: date-time + nullable: true + Capabilities: + allOf: + - $ref: '#/components/schemas/ClientCapabilitiesDto' + description: Gets or sets the capabilities. + IconUrl: + type: string + description: Gets or sets the icon URL. + nullable: true + additionalProperties: false + description: A DTO representing device information. + DeviceInfoDtoQueryResult: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/DeviceInfoDto' + description: Gets or sets the items. + TotalRecordCount: + type: integer + description: Gets or sets the total number of records available. + format: int32 + StartIndex: + type: integer + description: Gets or sets the index of the first record in Items. + format: int32 + additionalProperties: false + description: Query result container. + DeviceOptionsDto: + type: object + properties: + Id: + type: integer + description: Gets or sets the id. + format: int32 + DeviceId: + type: string + description: Gets or sets the device id. + nullable: true + CustomName: + type: string + description: Gets or sets the custom name. + nullable: true + additionalProperties: false + description: A dto representing custom options for a device. + DeviceProfile: + type: object + properties: + Name: + type: string + description: Gets or sets the name of this device profile. User profiles must have a unique name. + nullable: true + Id: + type: string + description: Gets or sets the unique internal identifier. + format: uuid + nullable: true + MaxStreamingBitrate: + type: integer + description: Gets or sets the maximum allowed bitrate for all streamed content. + format: int32 + nullable: true + MaxStaticBitrate: + type: integer + description: Gets or sets the maximum allowed bitrate for statically streamed content (= direct played files). + format: int32 + nullable: true + MusicStreamingTranscodingBitrate: + type: integer + description: Gets or sets the maximum allowed bitrate for transcoded music streams. + format: int32 + nullable: true + MaxStaticMusicBitrate: + type: integer + description: Gets or sets the maximum allowed bitrate for statically streamed (= direct played) music files. + format: int32 + nullable: true + DirectPlayProfiles: + type: array + items: + $ref: '#/components/schemas/DirectPlayProfile' + description: Gets or sets the direct play profiles. + TranscodingProfiles: + type: array + items: + $ref: '#/components/schemas/TranscodingProfile' + description: Gets or sets the transcoding profiles. + ContainerProfiles: + type: array + items: + $ref: '#/components/schemas/ContainerProfile' + description: Gets or sets the container profiles. Failing to meet these optional conditions causes transcoding to occur. + CodecProfiles: + type: array + items: + $ref: '#/components/schemas/CodecProfile' + description: Gets or sets the codec profiles. + SubtitleProfiles: + type: array + items: + $ref: '#/components/schemas/SubtitleProfile' + description: Gets or sets the subtitle profiles. + additionalProperties: false + description: "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + DirectPlayProfile: + type: object + properties: + Container: + type: string + description: Gets or sets the container. + AudioCodec: + type: string + description: Gets or sets the audio codec. + nullable: true + VideoCodec: + type: string + description: Gets or sets the video codec. + nullable: true + Type: + enum: + - Audio + - Video + - Photo + - Subtitle + - Lyric + allOf: + - $ref: '#/components/schemas/DlnaProfileType' + description: Gets or sets the Dlna profile type. + additionalProperties: false + description: Defines the MediaBrowser.Model.Dlna.DirectPlayProfile. + DisplayPreferencesDto: + type: object + properties: + Id: + type: string + description: Gets or sets the user id. + nullable: true + ViewType: + type: string + description: Gets or sets the type of the view. + nullable: true + SortBy: + type: string + description: Gets or sets the sort by. + nullable: true + IndexBy: + type: string + description: Gets or sets the index by. + nullable: true + RememberIndexing: + type: boolean + description: Gets or sets a value indicating whether [remember indexing]. + PrimaryImageHeight: + type: integer + description: Gets or sets the height of the primary image. + format: int32 + PrimaryImageWidth: + type: integer + description: Gets or sets the width of the primary image. + format: int32 + CustomPrefs: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the custom prefs. + ScrollDirection: + enum: + - Horizontal + - Vertical + allOf: + - $ref: '#/components/schemas/ScrollDirection' + description: Gets or sets the scroll direction. + ShowBackdrop: + type: boolean + description: Gets or sets a value indicating whether to show backdrops on this item. + RememberSorting: + type: boolean + description: Gets or sets a value indicating whether [remember sorting]. + SortOrder: + enum: + - Ascending + - Descending + allOf: + - $ref: '#/components/schemas/SortOrder' + description: Gets or sets the sort order. + ShowSidebar: + type: boolean + description: Gets or sets a value indicating whether [show sidebar]. + Client: + type: string + description: Gets or sets the client. + nullable: true + additionalProperties: false + description: Defines the display preferences for any item that supports them (usually Folders). + DlnaProfileType: + enum: + - Audio + - Video + - Photo + - Subtitle + - Lyric + type: string + DownMixStereoAlgorithms: + enum: + - None + - Dave750 + - NightmodeDialogue + - Rfc7845 + - Ac4 + type: string + description: An enum representing an algorithm to downmix surround sound to stereo. + DynamicDayOfWeek: + enum: + - Sunday + - Monday + - Tuesday + - Wednesday + - Thursday + - Friday + - Saturday + - Everyday + - Weekday + - Weekend + type: string + description: An enum that represents a day of the week, weekdays, weekends, or all days. + EmbeddedSubtitleOptions: + enum: + - AllowAll + - AllowText + - AllowImage + - AllowNone + type: string + description: An enum representing the options to disable embedded subs. + EncoderPreset: + enum: + - auto + - placebo + - veryslow + - slower + - slow + - medium + - fast + - faster + - veryfast + - superfast + - ultrafast + type: string + description: Enum containing encoder presets. + EncodingContext: + enum: + - Streaming + - Static + type: string + EncodingOptions: + type: object + properties: + EncodingThreadCount: + type: integer + description: Gets or sets the thread count used for encoding. + format: int32 + TranscodingTempPath: + type: string + description: Gets or sets the temporary transcoding path. + nullable: true + FallbackFontPath: + type: string + description: Gets or sets the path to the fallback font. + nullable: true + EnableFallbackFont: + type: boolean + description: Gets or sets a value indicating whether to use the fallback font. + EnableAudioVbr: + type: boolean + description: Gets or sets a value indicating whether audio VBR is enabled. + DownMixAudioBoost: + type: number + description: Gets or sets the audio boost applied when downmixing audio. + format: double + DownMixStereoAlgorithm: + enum: + - None + - Dave750 + - NightmodeDialogue + - Rfc7845 + - Ac4 + allOf: + - $ref: '#/components/schemas/DownMixStereoAlgorithms' + description: Gets or sets the algorithm used for downmixing audio to stereo. + MaxMuxingQueueSize: + type: integer + description: Gets or sets the maximum size of the muxing queue. + format: int32 + EnableThrottling: + type: boolean + description: Gets or sets a value indicating whether throttling is enabled. + ThrottleDelaySeconds: + type: integer + description: Gets or sets the delay after which throttling happens. + format: int32 + EnableSegmentDeletion: + type: boolean + description: Gets or sets a value indicating whether segment deletion is enabled. + SegmentKeepSeconds: + type: integer + description: Gets or sets seconds for which segments should be kept before being deleted. + format: int32 + HardwareAccelerationType: + enum: + - none + - amf + - qsv + - nvenc + - v4l2m2m + - vaapi + - videotoolbox + - rkmpp + allOf: + - $ref: '#/components/schemas/HardwareAccelerationType' + description: Gets or sets the hardware acceleration type. + EncoderAppPath: + type: string + description: Gets or sets the FFmpeg path as set by the user via the UI. + nullable: true + EncoderAppPathDisplay: + type: string + description: Gets or sets the current FFmpeg path being used by the system and displayed on the transcode page. + nullable: true + VaapiDevice: + type: string + description: Gets or sets the VA-API device. + nullable: true + QsvDevice: + type: string + description: Gets or sets the QSV device. + nullable: true + EnableTonemapping: + type: boolean + description: Gets or sets a value indicating whether tonemapping is enabled. + EnableVppTonemapping: + type: boolean + description: Gets or sets a value indicating whether VPP tonemapping is enabled. + EnableVideoToolboxTonemapping: + type: boolean + description: Gets or sets a value indicating whether videotoolbox tonemapping is enabled. + TonemappingAlgorithm: + enum: + - none + - clip + - linear + - gamma + - reinhard + - hable + - mobius + - bt2390 + allOf: + - $ref: '#/components/schemas/TonemappingAlgorithm' + description: Gets or sets the tone-mapping algorithm. + TonemappingMode: + enum: + - auto + - max + - rgb + - lum + - itp + allOf: + - $ref: '#/components/schemas/TonemappingMode' + description: Gets or sets the tone-mapping mode. + TonemappingRange: + enum: + - auto + - tv + - pc + allOf: + - $ref: '#/components/schemas/TonemappingRange' + description: Gets or sets the tone-mapping range. + TonemappingDesat: + type: number + description: Gets or sets the tone-mapping desaturation. + format: double + TonemappingPeak: + type: number + description: Gets or sets the tone-mapping peak. + format: double + TonemappingParam: + type: number + description: Gets or sets the tone-mapping parameters. + format: double + VppTonemappingBrightness: + type: number + description: Gets or sets the VPP tone-mapping brightness. + format: double + VppTonemappingContrast: + type: number + description: Gets or sets the VPP tone-mapping contrast. + format: double + H264Crf: + type: integer + description: Gets or sets the H264 CRF. + format: int32 + H265Crf: + type: integer + description: Gets or sets the H265 CRF. + format: int32 + EncoderPreset: + enum: + - auto + - placebo + - veryslow + - slower + - slow + - medium + - fast + - faster + - veryfast + - superfast + - ultrafast + allOf: + - $ref: '#/components/schemas/EncoderPreset' + description: Gets or sets the encoder preset. + nullable: true + DeinterlaceDoubleRate: + type: boolean + description: Gets or sets a value indicating whether the framerate is doubled when deinterlacing. + DeinterlaceMethod: + enum: + - yadif + - bwdif + allOf: + - $ref: '#/components/schemas/DeinterlaceMethod' + description: Gets or sets the deinterlace method. + EnableDecodingColorDepth10Hevc: + type: boolean + description: Gets or sets a value indicating whether 10bit HEVC decoding is enabled. + EnableDecodingColorDepth10Vp9: + type: boolean + description: Gets or sets a value indicating whether 10bit VP9 decoding is enabled. + EnableDecodingColorDepth10HevcRext: + type: boolean + description: Gets or sets a value indicating whether 8/10bit HEVC RExt decoding is enabled. + EnableDecodingColorDepth12HevcRext: + type: boolean + description: Gets or sets a value indicating whether 12bit HEVC RExt decoding is enabled. + EnableEnhancedNvdecDecoder: + type: boolean + description: Gets or sets a value indicating whether the enhanced NVDEC is enabled. + PreferSystemNativeHwDecoder: + type: boolean + description: Gets or sets a value indicating whether the system native hardware decoder should be used. + EnableIntelLowPowerH264HwEncoder: + type: boolean + description: Gets or sets a value indicating whether the Intel H264 low-power hardware encoder should be used. + EnableIntelLowPowerHevcHwEncoder: + type: boolean + description: Gets or sets a value indicating whether the Intel HEVC low-power hardware encoder should be used. + EnableHardwareEncoding: + type: boolean + description: Gets or sets a value indicating whether hardware encoding is enabled. + AllowHevcEncoding: + type: boolean + description: Gets or sets a value indicating whether HEVC encoding is enabled. + AllowAv1Encoding: + type: boolean + description: Gets or sets a value indicating whether AV1 encoding is enabled. + EnableSubtitleExtraction: + type: boolean + description: Gets or sets a value indicating whether subtitle extraction is enabled. + HardwareDecodingCodecs: + type: array + items: + type: string + description: Gets or sets the codecs hardware encoding is used for. + nullable: true + AllowOnDemandMetadataBasedKeyframeExtractionForExtensions: + type: array + items: + type: string + description: Gets or sets the file extensions on-demand metadata based keyframe extraction is enabled for. + nullable: true + additionalProperties: false + description: Class EncodingOptions. + EndPointInfo: + type: object + properties: + IsLocal: + type: boolean + IsInNetwork: + type: boolean + additionalProperties: false + ExternalIdInfo: + type: object + properties: + Name: + type: string + description: 'Gets or sets the display name of the external id provider (IE: IMDB, MusicBrainz, etc).' + Key: + type: string + description: Gets or sets the unique key for this id. This key should be unique across all providers. + Type: + enum: + - Album + - AlbumArtist + - Artist + - BoxSet + - Episode + - Movie + - OtherArtist + - Person + - ReleaseGroup + - Season + - Series + - Track + - Book + allOf: + - $ref: '#/components/schemas/ExternalIdMediaType' + description: "Gets or sets the specific media type for this id. This is used to distinguish between the different\r\nexternal id types for providers with multiple ids.\r\nA null value indicates there is no specific media type associated with the external id, or this is the\r\ndefault id for the external provider so there is no need to specify a type." + nullable: true + UrlFormatString: + type: string + description: Gets or sets the URL format string. + nullable: true + deprecated: true + additionalProperties: false + description: Represents the external id information for serialization to the client. + ExternalIdMediaType: + enum: + - Album + - AlbumArtist + - Artist + - BoxSet + - Episode + - Movie + - OtherArtist + - Person + - ReleaseGroup + - Season + - Series + - Track + - Book + type: string + description: The specific media type of an MediaBrowser.Model.Providers.ExternalIdInfo. + ExternalUrl: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Url: + type: string + description: Gets or sets the type of the item. + nullable: true + additionalProperties: false + ExtraType: + enum: + - Unknown + - Clip + - Trailer + - BehindTheScenes + - DeletedScene + - Interview + - Scene + - Sample + - ThemeSong + - ThemeVideo + - Featurette + - Short + type: string + FileSystemEntryInfo: + type: object + properties: + Name: + type: string + description: Gets the name. + Path: + type: string + description: Gets the path. + Type: + enum: + - File + - Directory + - NetworkComputer + - NetworkShare + allOf: + - $ref: '#/components/schemas/FileSystemEntryType' + description: Gets the type. + additionalProperties: false + description: Class FileSystemEntryInfo. + FileSystemEntryType: + enum: + - File + - Directory + - NetworkComputer + - NetworkShare + type: string + description: Enum FileSystemEntryType. + FontFile: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Size: + type: integer + description: Gets or sets the size. + format: int64 + DateCreated: + type: string + description: Gets or sets the date created. + format: date-time + DateModified: + type: string + description: Gets or sets the date modified. + format: date-time + additionalProperties: false + description: Class FontFile. + ForceKeepAliveMessage: + type: object + properties: + Data: + type: integer + description: Gets or sets the data. + format: int32 + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: ForceKeepAlive + readOnly: true + additionalProperties: false + description: Force keep alive websocket messages. + ForgotPasswordAction: + enum: + - ContactAdmin + - PinCode + - InNetworkRequired + type: string + ForgotPasswordDto: + required: + - EnteredUsername + type: object + properties: + EnteredUsername: + type: string + description: Gets or sets the entered username to have its password reset. + additionalProperties: false + description: Forgot Password request body DTO. + ForgotPasswordPinDto: + required: + - Pin + type: object + properties: + Pin: + type: string + description: Gets or sets the entered pin to have the password reset. + additionalProperties: false + description: Forgot Password Pin enter request body DTO. + ForgotPasswordResult: + type: object + properties: + Action: + enum: + - ContactAdmin + - PinCode + - InNetworkRequired + allOf: + - $ref: '#/components/schemas/ForgotPasswordAction' + description: Gets or sets the action. + PinFile: + type: string + description: Gets or sets the pin file. + nullable: true + PinExpirationDate: + type: string + description: Gets or sets the pin expiration date. + format: date-time + nullable: true + additionalProperties: false + GeneralCommand: + type: object + properties: + Name: + enum: + - MoveUp + - MoveDown + - MoveLeft + - MoveRight + - PageUp + - PageDown + - PreviousLetter + - NextLetter + - ToggleOsd + - ToggleContextMenu + - Select + - Back + - TakeScreenshot + - SendKey + - SendString + - GoHome + - GoToSettings + - VolumeUp + - VolumeDown + - Mute + - Unmute + - ToggleMute + - SetVolume + - SetAudioStreamIndex + - SetSubtitleStreamIndex + - ToggleFullscreen + - DisplayContent + - GoToSearch + - DisplayMessage + - SetRepeatMode + - ChannelUp + - ChannelDown + - Guide + - ToggleStats + - PlayMediaSource + - PlayTrailers + - SetShuffleQueue + - PlayState + - PlayNext + - ToggleOsdMenu + - Play + - SetMaxStreamingBitrate + - SetPlaybackOrder + allOf: + - $ref: '#/components/schemas/GeneralCommandType' + description: This exists simply to identify a set of known commands. + ControllingUserId: + type: string + format: uuid + Arguments: + type: object + additionalProperties: + type: string + nullable: true + additionalProperties: false + GeneralCommandMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/GeneralCommand' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: GeneralCommand + readOnly: true + additionalProperties: false + description: General command websocket message. + GeneralCommandType: + enum: + - MoveUp + - MoveDown + - MoveLeft + - MoveRight + - PageUp + - PageDown + - PreviousLetter + - NextLetter + - ToggleOsd + - ToggleContextMenu + - Select + - Back + - TakeScreenshot + - SendKey + - SendString + - GoHome + - GoToSettings + - VolumeUp + - VolumeDown + - Mute + - Unmute + - ToggleMute + - SetVolume + - SetAudioStreamIndex + - SetSubtitleStreamIndex + - ToggleFullscreen + - DisplayContent + - GoToSearch + - DisplayMessage + - SetRepeatMode + - ChannelUp + - ChannelDown + - Guide + - ToggleStats + - PlayMediaSource + - PlayTrailers + - SetShuffleQueue + - PlayState + - PlayNext + - ToggleOsdMenu + - Play + - SetMaxStreamingBitrate + - SetPlaybackOrder + type: string + description: This exists simply to identify a set of known commands. + GetProgramsDto: + type: object + properties: + ChannelIds: + type: array + items: + type: string + format: uuid + description: Gets or sets the channels to return guide information for. + nullable: true + UserId: + type: string + description: Gets or sets optional. Filter by user id. + format: uuid + nullable: true + MinStartDate: + type: string + description: Gets or sets the minimum premiere start date. + format: date-time + nullable: true + HasAired: + type: boolean + description: Gets or sets filter by programs that have completed airing, or not. + nullable: true + IsAiring: + type: boolean + description: Gets or sets filter by programs that are currently airing, or not. + nullable: true + MaxStartDate: + type: string + description: Gets or sets the maximum premiere start date. + format: date-time + nullable: true + MinEndDate: + type: string + description: Gets or sets the minimum premiere end date. + format: date-time + nullable: true + MaxEndDate: + type: string + description: Gets or sets the maximum premiere end date. + format: date-time + nullable: true + IsMovie: + type: boolean + description: Gets or sets filter for movies. + nullable: true + IsSeries: + type: boolean + description: Gets or sets filter for series. + nullable: true + IsNews: + type: boolean + description: Gets or sets filter for news. + nullable: true + IsKids: + type: boolean + description: Gets or sets filter for kids. + nullable: true + IsSports: + type: boolean + description: Gets or sets filter for sports. + nullable: true + StartIndex: + type: integer + description: Gets or sets the record index to start at. All items with a lower index will be dropped from the results. + format: int32 + nullable: true + Limit: + type: integer + description: Gets or sets the maximum number of records to return. + format: int32 + nullable: true + SortBy: + type: array + items: + $ref: '#/components/schemas/ItemSortBy' + description: 'Gets or sets specify one or more sort orders, comma delimited. Options: Name, StartDate.' + nullable: true + SortOrder: + type: array + items: + $ref: '#/components/schemas/SortOrder' + description: Gets or sets sort order. + nullable: true + Genres: + type: array + items: + type: string + description: Gets or sets the genres to return guide information for. + nullable: true + GenreIds: + type: array + items: + type: string + format: uuid + description: Gets or sets the genre ids to return guide information for. + nullable: true + EnableImages: + type: boolean + description: Gets or sets include image information in output. + nullable: true + EnableTotalRecordCount: + type: boolean + description: Gets or sets a value indicating whether retrieve total record count. + default: true + ImageTypeLimit: + type: integer + description: Gets or sets the max number of images to return, per image type. + format: int32 + nullable: true + EnableImageTypes: + type: array + items: + $ref: '#/components/schemas/ImageType' + description: Gets or sets the image types to include in the output. + nullable: true + EnableUserData: + type: boolean + description: Gets or sets include user data. + nullable: true + SeriesTimerId: + type: string + description: Gets or sets filter by series timer id. + nullable: true + LibrarySeriesId: + type: string + description: Gets or sets filter by library series id. + format: uuid + nullable: true + Fields: + type: array + items: + $ref: '#/components/schemas/ItemFields' + description: Gets or sets specify additional fields of information to return in the output. + nullable: true + additionalProperties: false + description: Get programs dto. + GroupInfoDto: + type: object + properties: + GroupId: + type: string + description: Gets the group identifier. + format: uuid + GroupName: + type: string + description: Gets the group name. + State: + enum: + - Idle + - Waiting + - Paused + - Playing + allOf: + - $ref: '#/components/schemas/GroupStateType' + description: Gets the group state. + Participants: + type: array + items: + type: string + description: Gets the participants. + LastUpdatedAt: + type: string + description: Gets the date when this DTO has been created. + format: date-time + additionalProperties: false + description: Class GroupInfoDto. + GroupInfoDtoGroupUpdate: + type: object + properties: + GroupId: + type: string + description: Gets the group identifier. + format: uuid + readOnly: true + Type: + enum: + - UserJoined + - UserLeft + - GroupJoined + - GroupLeft + - StateUpdate + - PlayQueue + - NotInGroup + - GroupDoesNotExist + - CreateGroupDenied + - JoinGroupDenied + - LibraryAccessDenied + allOf: + - $ref: '#/components/schemas/GroupUpdateType' + description: Gets the update type. + Data: + allOf: + - $ref: '#/components/schemas/GroupInfoDto' + description: Gets the update data. + additionalProperties: false + description: Class GroupUpdate. + GroupQueueMode: + enum: + - Queue + - QueueNext + type: string + description: Enum GroupQueueMode. + GroupRepeatMode: + enum: + - RepeatOne + - RepeatAll + - RepeatNone + type: string + description: Enum GroupRepeatMode. + GroupShuffleMode: + enum: + - Sorted + - Shuffle + type: string + description: Enum GroupShuffleMode. + GroupStateType: + enum: + - Idle + - Waiting + - Paused + - Playing + type: string + description: Enum GroupState. + GroupStateUpdate: + type: object + properties: + State: + enum: + - Idle + - Waiting + - Paused + - Playing + allOf: + - $ref: '#/components/schemas/GroupStateType' + description: Gets the state of the group. + Reason: + enum: + - Play + - SetPlaylistItem + - RemoveFromPlaylist + - MovePlaylistItem + - Queue + - Unpause + - Pause + - Stop + - Seek + - Buffer + - Ready + - NextItem + - PreviousItem + - SetRepeatMode + - SetShuffleMode + - Ping + - IgnoreWait + allOf: + - $ref: '#/components/schemas/PlaybackRequestType' + description: Gets the reason of the state change. + additionalProperties: false + description: Class GroupStateUpdate. + GroupStateUpdateGroupUpdate: + type: object + properties: + GroupId: + type: string + description: Gets the group identifier. + format: uuid + readOnly: true + Type: + enum: + - UserJoined + - UserLeft + - GroupJoined + - GroupLeft + - StateUpdate + - PlayQueue + - NotInGroup + - GroupDoesNotExist + - CreateGroupDenied + - JoinGroupDenied + - LibraryAccessDenied + allOf: + - $ref: '#/components/schemas/GroupUpdateType' + description: Gets the update type. + Data: + allOf: + - $ref: '#/components/schemas/GroupStateUpdate' + description: Gets the update data. + additionalProperties: false + description: Class GroupUpdate. + GroupUpdate: + type: object + oneOf: + - $ref: '#/components/schemas/GroupInfoDtoGroupUpdate' + - $ref: '#/components/schemas/GroupStateUpdateGroupUpdate' + - $ref: '#/components/schemas/StringGroupUpdate' + - $ref: '#/components/schemas/PlayQueueUpdateGroupUpdate' + properties: + GroupId: + type: string + description: Gets the group identifier. + format: uuid + readOnly: true + Type: + enum: + - UserJoined + - UserLeft + - GroupJoined + - GroupLeft + - StateUpdate + - PlayQueue + - NotInGroup + - GroupDoesNotExist + - CreateGroupDenied + - JoinGroupDenied + - LibraryAccessDenied + allOf: + - $ref: '#/components/schemas/GroupUpdateType' + description: Gets the update type. + additionalProperties: false + description: Group update without data. + discriminator: + propertyName: Type + mapping: + UserJoined: '#/components/schemas/StringGroupUpdate' + UserLeft: '#/components/schemas/StringGroupUpdate' + GroupJoined: '#/components/schemas/GroupInfoDtoGroupUpdate' + GroupLeft: '#/components/schemas/StringGroupUpdate' + StateUpdate: '#/components/schemas/GroupStateUpdateGroupUpdate' + PlayQueue: '#/components/schemas/PlayQueueUpdateGroupUpdate' + NotInGroup: '#/components/schemas/StringGroupUpdate' + GroupDoesNotExist: '#/components/schemas/StringGroupUpdate' + LibraryAccessDenied: '#/components/schemas/StringGroupUpdate' + GroupUpdateType: + enum: + - UserJoined + - UserLeft + - GroupJoined + - GroupLeft + - StateUpdate + - PlayQueue + - NotInGroup + - GroupDoesNotExist + - CreateGroupDenied + - JoinGroupDenied + - LibraryAccessDenied + type: string + description: Enum GroupUpdateType. + GuideInfo: + type: object + properties: + StartDate: + type: string + description: Gets or sets the start date. + format: date-time + EndDate: + type: string + description: Gets or sets the end date. + format: date-time + additionalProperties: false + HardwareAccelerationType: + enum: + - none + - amf + - qsv + - nvenc + - v4l2m2m + - vaapi + - videotoolbox + - rkmpp + type: string + description: Enum containing hardware acceleration types. + IgnoreWaitRequestDto: + type: object + properties: + IgnoreWait: + type: boolean + description: Gets or sets a value indicating whether the client should be ignored. + additionalProperties: false + description: Class IgnoreWaitRequestDto. + ImageFormat: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + - Svg + type: string + description: Enum ImageOutputFormat. + ImageInfo: + type: object + properties: + ImageType: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Gets or sets the type of the image. + ImageIndex: + type: integer + description: Gets or sets the index of the image. + format: int32 + nullable: true + ImageTag: + type: string + description: Gets or sets the image tag. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + BlurHash: + type: string + description: Gets or sets the blurhash. + nullable: true + Height: + type: integer + description: Gets or sets the height. + format: int32 + nullable: true + Width: + type: integer + description: Gets or sets the width. + format: int32 + nullable: true + Size: + type: integer + description: Gets or sets the size. + format: int64 + additionalProperties: false + description: Class ImageInfo. + ImageOption: + type: object + properties: + Type: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Gets or sets the type. + Limit: + type: integer + description: Gets or sets the limit. + format: int32 + MinWidth: + type: integer + description: Gets or sets the minimum width. + format: int32 + additionalProperties: false + ImageOrientation: + enum: + - TopLeft + - TopRight + - BottomRight + - BottomLeft + - LeftTop + - RightTop + - RightBottom + - LeftBottom + type: string + ImageProviderInfo: + type: object + properties: + Name: + type: string + description: Gets the name. + SupportedImages: + type: array + items: + $ref: '#/components/schemas/ImageType' + description: Gets the supported image types. + additionalProperties: false + description: Class ImageProviderInfo. + ImageResolution: + enum: + - MatchSource + - P144 + - P240 + - P360 + - P480 + - P720 + - P1080 + - P1440 + - P2160 + type: string + description: Enum ImageResolution. + ImageSavingConvention: + enum: + - Legacy + - Compatible + type: string + ImageType: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + type: string + description: Enum ImageType. + InboundKeepAliveMessage: + type: object + properties: + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: KeepAlive + readOnly: true + additionalProperties: false + description: Keep alive websocket messages. + InboundWebSocketMessage: + type: object + oneOf: + - $ref: '#/components/schemas/ActivityLogEntryStartMessage' + - $ref: '#/components/schemas/ActivityLogEntryStopMessage' + - $ref: '#/components/schemas/InboundKeepAliveMessage' + - $ref: '#/components/schemas/ScheduledTasksInfoStartMessage' + - $ref: '#/components/schemas/ScheduledTasksInfoStopMessage' + - $ref: '#/components/schemas/SessionsStartMessage' + - $ref: '#/components/schemas/SessionsStopMessage' + description: Represents the list of possible inbound websocket types + discriminator: + propertyName: MessageType + mapping: + ActivityLogEntryStart: '#/components/schemas/ActivityLogEntryStartMessage' + ActivityLogEntryStop: '#/components/schemas/ActivityLogEntryStopMessage' + KeepAlive: '#/components/schemas/InboundKeepAliveMessage' + ScheduledTasksInfoStart: '#/components/schemas/ScheduledTasksInfoStartMessage' + ScheduledTasksInfoStop: '#/components/schemas/ScheduledTasksInfoStopMessage' + SessionsStart: '#/components/schemas/SessionsStartMessage' + SessionsStop: '#/components/schemas/SessionsStopMessage' + InstallationInfo: + type: object + properties: + Guid: + type: string + description: Gets or sets the Id. + format: uuid + Name: + type: string + description: Gets or sets the name. + nullable: true + Version: + type: string + description: Gets or sets the version. + nullable: true + Changelog: + type: string + description: Gets or sets the changelog for this version. + nullable: true + SourceUrl: + type: string + description: Gets or sets the source URL. + nullable: true + Checksum: + type: string + description: Gets or sets a checksum for the binary. + nullable: true + PackageInfo: + allOf: + - $ref: '#/components/schemas/PackageInfo' + description: Gets or sets package information for the installation. + nullable: true + additionalProperties: false + description: Class InstallationInfo. + IPlugin: + type: object + properties: + Name: + type: string + description: Gets the name of the plugin. + nullable: true + readOnly: true + Description: + type: string + description: Gets the Description. + nullable: true + readOnly: true + Id: + type: string + description: Gets the unique id. + format: uuid + readOnly: true + Version: + type: string + description: Gets the plugin version. + nullable: true + readOnly: true + AssemblyFilePath: + type: string + description: Gets the path to the assembly file. + nullable: true + readOnly: true + CanUninstall: + type: boolean + description: Gets a value indicating whether the plugin can be uninstalled. + readOnly: true + DataFolderPath: + type: string + description: Gets the full path to the data folder, where the plugin can store any miscellaneous files needed. + nullable: true + readOnly: true + additionalProperties: false + description: Defines the MediaBrowser.Common.Plugins.IPlugin. + IsoType: + enum: + - Dvd + - BluRay + type: string + description: Enum IsoType. + ItemCounts: + type: object + properties: + MovieCount: + type: integer + description: Gets or sets the movie count. + format: int32 + SeriesCount: + type: integer + description: Gets or sets the series count. + format: int32 + EpisodeCount: + type: integer + description: Gets or sets the episode count. + format: int32 + ArtistCount: + type: integer + description: Gets or sets the artist count. + format: int32 + ProgramCount: + type: integer + description: Gets or sets the program count. + format: int32 + TrailerCount: + type: integer + description: Gets or sets the trailer count. + format: int32 + SongCount: + type: integer + description: Gets or sets the song count. + format: int32 + AlbumCount: + type: integer + description: Gets or sets the album count. + format: int32 + MusicVideoCount: + type: integer + description: Gets or sets the music video count. + format: int32 + BoxSetCount: + type: integer + description: Gets or sets the box set count. + format: int32 + BookCount: + type: integer + description: Gets or sets the book count. + format: int32 + ItemCount: + type: integer + description: Gets or sets the item count. + format: int32 + additionalProperties: false + description: Class LibrarySummary. + ItemFields: + enum: + - AirTime + - CanDelete + - CanDownload + - ChannelInfo + - Chapters + - Trickplay + - ChildCount + - CumulativeRunTimeTicks + - CustomRating + - DateCreated + - DateLastMediaAdded + - DisplayPreferencesId + - Etag + - ExternalUrls + - Genres + - HomePageUrl + - ItemCounts + - MediaSourceCount + - MediaSources + - OriginalTitle + - Overview + - ParentId + - Path + - People + - PlayAccess + - ProductionLocations + - ProviderIds + - PrimaryImageAspectRatio + - RecursiveItemCount + - Settings + - ScreenshotImageTags + - SeriesPrimaryImage + - SeriesStudio + - SortName + - SpecialEpisodeNumbers + - Studios + - Taglines + - Tags + - RemoteTrailers + - MediaStreams + - SeasonUserData + - ServiceName + - ThemeSongIds + - ThemeVideoIds + - ExternalEtag + - PresentationUniqueKey + - InheritedParentalRatingValue + - ExternalSeriesId + - SeriesPresentationUniqueKey + - DateLastRefreshed + - DateLastSaved + - RefreshState + - ChannelImage + - EnableMediaSourceDisplay + - Width + - Height + - ExtraIds + - LocalTrailerCount + - IsHD + - SpecialFeatureCount + type: string + description: Used to control the data that gets attached to DtoBaseItems. + ItemFilter: + enum: + - IsFolder + - IsNotFolder + - IsUnplayed + - IsPlayed + - IsFavorite + - IsResumable + - Likes + - Dislikes + - IsFavoriteOrLikes + type: string + description: Enum ItemFilter. + ItemSortBy: + enum: + - Default + - AiredEpisodeOrder + - Album + - AlbumArtist + - Artist + - DateCreated + - OfficialRating + - DatePlayed + - PremiereDate + - StartDate + - SortName + - Name + - Random + - Runtime + - CommunityRating + - ProductionYear + - PlayCount + - CriticRating + - IsFolder + - IsUnplayed + - IsPlayed + - SeriesSortName + - VideoBitRate + - AirTime + - Studio + - IsFavoriteOrLiked + - DateLastContentAdded + - SeriesDatePlayed + - ParentIndexNumber + - IndexNumber + - SimilarityScore + - SearchScore + type: string + description: These represent sort orders. + JoinGroupRequestDto: + type: object + properties: + GroupId: + type: string + description: Gets or sets the group identifier. + format: uuid + additionalProperties: false + description: Class JoinGroupRequestDto. + KeepUntil: + enum: + - UntilDeleted + - UntilSpaceNeeded + - UntilWatched + - UntilDate + type: string + LibraryChangedMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/LibraryUpdateInfo' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: LibraryChanged + readOnly: true + additionalProperties: false + description: Library changed message. + LibraryOptionInfoDto: + type: object + properties: + Name: + type: string + description: Gets or sets name. + nullable: true + DefaultEnabled: + type: boolean + description: Gets or sets a value indicating whether default enabled. + additionalProperties: false + description: Library option info dto. + LibraryOptions: + type: object + properties: + Enabled: + type: boolean + EnablePhotos: + type: boolean + EnableRealtimeMonitor: + type: boolean + EnableLUFSScan: + type: boolean + EnableChapterImageExtraction: + type: boolean + ExtractChapterImagesDuringLibraryScan: + type: boolean + EnableTrickplayImageExtraction: + type: boolean + ExtractTrickplayImagesDuringLibraryScan: + type: boolean + PathInfos: + type: array + items: + $ref: '#/components/schemas/MediaPathInfo' + SaveLocalMetadata: + type: boolean + EnableInternetProviders: + type: boolean + deprecated: true + EnableAutomaticSeriesGrouping: + type: boolean + EnableEmbeddedTitles: + type: boolean + EnableEmbeddedExtrasTitles: + type: boolean + EnableEmbeddedEpisodeInfos: + type: boolean + AutomaticRefreshIntervalDays: + type: integer + format: int32 + PreferredMetadataLanguage: + type: string + description: Gets or sets the preferred metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + SeasonZeroDisplayName: + type: string + MetadataSavers: + type: array + items: + type: string + nullable: true + DisabledLocalMetadataReaders: + type: array + items: + type: string + LocalMetadataReaderOrder: + type: array + items: + type: string + nullable: true + DisabledSubtitleFetchers: + type: array + items: + type: string + SubtitleFetcherOrder: + type: array + items: + type: string + DisabledMediaSegmentProviders: + type: array + items: + type: string + MediaSegmentProvideOrder: + type: array + items: + type: string + SkipSubtitlesIfEmbeddedSubtitlesPresent: + type: boolean + SkipSubtitlesIfAudioTrackMatches: + type: boolean + SubtitleDownloadLanguages: + type: array + items: + type: string + nullable: true + RequirePerfectSubtitleMatch: + type: boolean + SaveSubtitlesWithMedia: + type: boolean + SaveLyricsWithMedia: + type: boolean + default: false + SaveTrickplayWithMedia: + type: boolean + default: false + DisabledLyricFetchers: + type: array + items: + type: string + LyricFetcherOrder: + type: array + items: + type: string + PreferNonstandardArtistsTag: + type: boolean + default: false + UseCustomTagDelimiters: + type: boolean + default: false + CustomTagDelimiters: + type: array + items: + type: string + DelimiterWhitelist: + type: array + items: + type: string + AutomaticallyAddToCollection: + type: boolean + AllowEmbeddedSubtitles: + enum: + - AllowAll + - AllowText + - AllowImage + - AllowNone + allOf: + - $ref: '#/components/schemas/EmbeddedSubtitleOptions' + description: An enum representing the options to disable embedded subs. + TypeOptions: + type: array + items: + $ref: '#/components/schemas/TypeOptions' + additionalProperties: false + LibraryOptionsResultDto: + type: object + properties: + MetadataSavers: + type: array + items: + $ref: '#/components/schemas/LibraryOptionInfoDto' + description: Gets or sets the metadata savers. + MetadataReaders: + type: array + items: + $ref: '#/components/schemas/LibraryOptionInfoDto' + description: Gets or sets the metadata readers. + SubtitleFetchers: + type: array + items: + $ref: '#/components/schemas/LibraryOptionInfoDto' + description: Gets or sets the subtitle fetchers. + LyricFetchers: + type: array + items: + $ref: '#/components/schemas/LibraryOptionInfoDto' + description: Gets or sets the list of lyric fetchers. + TypeOptions: + type: array + items: + $ref: '#/components/schemas/LibraryTypeOptionsDto' + description: Gets or sets the type options. + additionalProperties: false + description: Library options result dto. + LibraryTypeOptionsDto: + type: object + properties: + Type: + type: string + description: Gets or sets the type. + nullable: true + MetadataFetchers: + type: array + items: + $ref: '#/components/schemas/LibraryOptionInfoDto' + description: Gets or sets the metadata fetchers. + ImageFetchers: + type: array + items: + $ref: '#/components/schemas/LibraryOptionInfoDto' + description: Gets or sets the image fetchers. + SupportedImageTypes: + type: array + items: + $ref: '#/components/schemas/ImageType' + description: Gets or sets the supported image types. + DefaultImageOptions: + type: array + items: + $ref: '#/components/schemas/ImageOption' + description: Gets or sets the default image options. + additionalProperties: false + description: Library type options dto. + LibraryUpdateInfo: + type: object + properties: + FoldersAddedTo: + type: array + items: + type: string + description: Gets or sets the folders added to. + FoldersRemovedFrom: + type: array + items: + type: string + description: Gets or sets the folders removed from. + ItemsAdded: + type: array + items: + type: string + description: Gets or sets the items added. + ItemsRemoved: + type: array + items: + type: string + description: Gets or sets the items removed. + ItemsUpdated: + type: array + items: + type: string + description: Gets or sets the items updated. + CollectionFolders: + type: array + items: + type: string + IsEmpty: + type: boolean + readOnly: true + additionalProperties: false + description: Class LibraryUpdateInfo. + ListingsProviderInfo: + type: object + properties: + Id: + type: string + nullable: true + Type: + type: string + nullable: true + Username: + type: string + nullable: true + Password: + type: string + nullable: true + ListingsId: + type: string + nullable: true + ZipCode: + type: string + nullable: true + Country: + type: string + nullable: true + Path: + type: string + nullable: true + EnabledTuners: + type: array + items: + type: string + nullable: true + EnableAllTuners: + type: boolean + NewsCategories: + type: array + items: + type: string + nullable: true + SportsCategories: + type: array + items: + type: string + nullable: true + KidsCategories: + type: array + items: + type: string + nullable: true + MovieCategories: + type: array + items: + type: string + nullable: true + ChannelMappings: + type: array + items: + $ref: '#/components/schemas/NameValuePair' + nullable: true + MoviePrefix: + type: string + nullable: true + PreferredLanguage: + type: string + nullable: true + UserAgent: + type: string + nullable: true + additionalProperties: false + LiveStreamResponse: + type: object + properties: + MediaSource: + allOf: + - $ref: '#/components/schemas/MediaSourceInfo' + additionalProperties: false + LiveTvInfo: + type: object + properties: + Services: + type: array + items: + $ref: '#/components/schemas/LiveTvServiceInfo' + description: Gets or sets the services. + IsEnabled: + type: boolean + description: Gets or sets a value indicating whether this instance is enabled. + EnabledUsers: + type: array + items: + type: string + description: Gets or sets the enabled users. + additionalProperties: false + LiveTvOptions: + type: object + properties: + GuideDays: + type: integer + format: int32 + nullable: true + RecordingPath: + type: string + nullable: true + MovieRecordingPath: + type: string + nullable: true + SeriesRecordingPath: + type: string + nullable: true + EnableRecordingSubfolders: + type: boolean + EnableOriginalAudioWithEncodedRecordings: + type: boolean + TunerHosts: + type: array + items: + $ref: '#/components/schemas/TunerHostInfo' + nullable: true + ListingProviders: + type: array + items: + $ref: '#/components/schemas/ListingsProviderInfo' + nullable: true + PrePaddingSeconds: + type: integer + format: int32 + PostPaddingSeconds: + type: integer + format: int32 + MediaLocationsCreated: + type: array + items: + type: string + nullable: true + RecordingPostProcessor: + type: string + nullable: true + RecordingPostProcessorArguments: + type: string + nullable: true + SaveRecordingNFO: + type: boolean + SaveRecordingImages: + type: boolean + additionalProperties: false + LiveTvServiceInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + HomePageUrl: + type: string + description: Gets or sets the home page URL. + nullable: true + Status: + enum: + - Ok + - Unavailable + allOf: + - $ref: '#/components/schemas/LiveTvServiceStatus' + description: Gets or sets the status. + StatusMessage: + type: string + description: Gets or sets the status message. + nullable: true + Version: + type: string + description: Gets or sets the version. + nullable: true + HasUpdateAvailable: + type: boolean + description: Gets or sets a value indicating whether this instance has update available. + IsVisible: + type: boolean + description: Gets or sets a value indicating whether this instance is visible. + Tuners: + type: array + items: + type: string + nullable: true + additionalProperties: false + description: Class ServiceInfo. + LiveTvServiceStatus: + enum: + - Ok + - Unavailable + type: string + LocalizationOption: + type: object + properties: + Name: + type: string + nullable: true + Value: + type: string + nullable: true + additionalProperties: false + LocationType: + enum: + - FileSystem + - Remote + - Virtual + - Offline + type: string + description: Enum LocationType. + LogFile: + type: object + properties: + DateCreated: + type: string + description: Gets or sets the date created. + format: date-time + DateModified: + type: string + description: Gets or sets the date modified. + format: date-time + Size: + type: integer + description: Gets or sets the size. + format: int64 + Name: + type: string + description: Gets or sets the name. + additionalProperties: false + LogLevel: + enum: + - Trace + - Debug + - Information + - Warning + - Error + - Critical + - None + type: string + LyricDto: + type: object + properties: + Metadata: + allOf: + - $ref: '#/components/schemas/LyricMetadata' + description: Gets or sets Metadata for the lyrics. + Lyrics: + type: array + items: + $ref: '#/components/schemas/LyricLine' + description: Gets or sets a collection of individual lyric lines. + additionalProperties: false + description: LyricResponse model. + LyricLine: + type: object + properties: + Text: + type: string + description: Gets the text of this lyric line. + Start: + type: integer + description: Gets the start time in ticks. + format: int64 + nullable: true + additionalProperties: false + description: Lyric model. + LyricMetadata: + type: object + properties: + Artist: + type: string + description: Gets or sets the song artist. + nullable: true + Album: + type: string + description: Gets or sets the album this song is on. + nullable: true + Title: + type: string + description: Gets or sets the title of the song. + nullable: true + Author: + type: string + description: Gets or sets the author of the lyric data. + nullable: true + Length: + type: integer + description: Gets or sets the length of the song in ticks. + format: int64 + nullable: true + By: + type: string + description: Gets or sets who the LRC file was created by. + nullable: true + Offset: + type: integer + description: Gets or sets the lyric offset compared to audio in ticks. + format: int64 + nullable: true + Creator: + type: string + description: Gets or sets the software used to create the LRC file. + nullable: true + Version: + type: string + description: Gets or sets the version of the creator used. + nullable: true + IsSynced: + type: boolean + description: Gets or sets a value indicating whether this lyric is synced. + nullable: true + additionalProperties: false + description: LyricMetadata model. + MediaAttachment: + type: object + properties: + Codec: + type: string + description: Gets or sets the codec. + nullable: true + CodecTag: + type: string + description: Gets or sets the codec tag. + nullable: true + Comment: + type: string + description: Gets or sets the comment. + nullable: true + Index: + type: integer + description: Gets or sets the index. + format: int32 + FileName: + type: string + description: Gets or sets the filename. + nullable: true + MimeType: + type: string + description: Gets or sets the MIME type. + nullable: true + DeliveryUrl: + type: string + description: Gets or sets the delivery URL. + nullable: true + additionalProperties: false + description: Class MediaAttachment. + MediaPathDto: + required: + - Name + type: object + properties: + Name: + type: string + description: Gets or sets the name of the library. + Path: + type: string + description: Gets or sets the path to add. + nullable: true + PathInfo: + allOf: + - $ref: '#/components/schemas/MediaPathInfo' + description: Gets or sets the path info. + nullable: true + additionalProperties: false + description: Media Path dto. + MediaPathInfo: + type: object + properties: + Path: + type: string + additionalProperties: false + MediaProtocol: + enum: + - File + - Http + - Rtmp + - Rtsp + - Udp + - Rtp + - Ftp + type: string + MediaSegmentDto: + type: object + properties: + Id: + type: string + description: Gets or sets the id of the media segment. + format: uuid + ItemId: + type: string + description: Gets or sets the id of the associated item. + format: uuid + Type: + enum: + - Unknown + - Commercial + - Preview + - Recap + - Outro + - Intro + allOf: + - $ref: '#/components/schemas/MediaSegmentType' + description: Gets or sets the type of content this segment defines. + default: Unknown + StartTicks: + type: integer + description: Gets or sets the start of the segment. + format: int64 + EndTicks: + type: integer + description: Gets or sets the end of the segment. + format: int64 + additionalProperties: false + description: Api model for MediaSegment's. + MediaSegmentDtoQueryResult: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/MediaSegmentDto' + description: Gets or sets the items. + TotalRecordCount: + type: integer + description: Gets or sets the total number of records available. + format: int32 + StartIndex: + type: integer + description: Gets or sets the index of the first record in Items. + format: int32 + additionalProperties: false + description: Query result container. + MediaSegmentType: + enum: + - Unknown + - Commercial + - Preview + - Recap + - Outro + - Intro + type: string + description: Defines the types of content an individual Jellyfin.Data.Entities.MediaSegment represents. + MediaSourceInfo: + type: object + properties: + Protocol: + enum: + - File + - Http + - Rtmp + - Rtsp + - Udp + - Rtp + - Ftp + allOf: + - $ref: '#/components/schemas/MediaProtocol' + Id: + type: string + nullable: true + Path: + type: string + nullable: true + EncoderPath: + type: string + nullable: true + EncoderProtocol: + enum: + - File + - Http + - Rtmp + - Rtsp + - Udp + - Rtp + - Ftp + allOf: + - $ref: '#/components/schemas/MediaProtocol' + nullable: true + Type: + enum: + - Default + - Grouping + - Placeholder + allOf: + - $ref: '#/components/schemas/MediaSourceType' + Container: + type: string + nullable: true + Size: + type: integer + format: int64 + nullable: true + Name: + type: string + nullable: true + IsRemote: + type: boolean + description: "Gets or sets a value indicating whether the media is remote.\r\nDifferentiate internet url vs local network." + ETag: + type: string + nullable: true + RunTimeTicks: + type: integer + format: int64 + nullable: true + ReadAtNativeFramerate: + type: boolean + IgnoreDts: + type: boolean + IgnoreIndex: + type: boolean + GenPtsInput: + type: boolean + SupportsTranscoding: + type: boolean + SupportsDirectStream: + type: boolean + SupportsDirectPlay: + type: boolean + IsInfiniteStream: + type: boolean + UseMostCompatibleTranscodingProfile: + type: boolean + default: false + RequiresOpening: + type: boolean + OpenToken: + type: string + nullable: true + RequiresClosing: + type: boolean + LiveStreamId: + type: string + nullable: true + BufferMs: + type: integer + format: int32 + nullable: true + RequiresLooping: + type: boolean + SupportsProbing: + type: boolean + VideoType: + enum: + - VideoFile + - Iso + - Dvd + - BluRay + allOf: + - $ref: '#/components/schemas/VideoType' + nullable: true + IsoType: + enum: + - Dvd + - BluRay + allOf: + - $ref: '#/components/schemas/IsoType' + nullable: true + Video3DFormat: + enum: + - HalfSideBySide + - FullSideBySide + - FullTopAndBottom + - HalfTopAndBottom + - MVC + allOf: + - $ref: '#/components/schemas/Video3DFormat' + nullable: true + MediaStreams: + type: array + items: + $ref: '#/components/schemas/MediaStream' + nullable: true + MediaAttachments: + type: array + items: + $ref: '#/components/schemas/MediaAttachment' + nullable: true + Formats: + type: array + items: + type: string + nullable: true + Bitrate: + type: integer + format: int32 + nullable: true + FallbackMaxStreamingBitrate: + type: integer + format: int32 + nullable: true + Timestamp: + enum: + - None + - Zero + - Valid + allOf: + - $ref: '#/components/schemas/TransportStreamTimestamp' + nullable: true + RequiredHttpHeaders: + type: object + additionalProperties: + type: string + nullable: true + nullable: true + TranscodingUrl: + type: string + nullable: true + TranscodingSubProtocol: + enum: + - http + - hls + allOf: + - $ref: '#/components/schemas/MediaStreamProtocol' + description: "Media streaming protocol.\r\nLowercase for backwards compatibility." + TranscodingContainer: + type: string + nullable: true + AnalyzeDurationMs: + type: integer + format: int32 + nullable: true + DefaultAudioStreamIndex: + type: integer + format: int32 + nullable: true + DefaultSubtitleStreamIndex: + type: integer + format: int32 + nullable: true + HasSegments: + type: boolean + additionalProperties: false + MediaSourceType: + enum: + - Default + - Grouping + - Placeholder + type: string + MediaStream: + type: object + properties: + Codec: + type: string + description: Gets or sets the codec. + nullable: true + CodecTag: + type: string + description: Gets or sets the codec tag. + nullable: true + Language: + type: string + description: Gets or sets the language. + nullable: true + ColorRange: + type: string + description: Gets or sets the color range. + nullable: true + ColorSpace: + type: string + description: Gets or sets the color space. + nullable: true + ColorTransfer: + type: string + description: Gets or sets the color transfer. + nullable: true + ColorPrimaries: + type: string + description: Gets or sets the color primaries. + nullable: true + DvVersionMajor: + type: integer + description: Gets or sets the Dolby Vision version major. + format: int32 + nullable: true + DvVersionMinor: + type: integer + description: Gets or sets the Dolby Vision version minor. + format: int32 + nullable: true + DvProfile: + type: integer + description: Gets or sets the Dolby Vision profile. + format: int32 + nullable: true + DvLevel: + type: integer + description: Gets or sets the Dolby Vision level. + format: int32 + nullable: true + RpuPresentFlag: + type: integer + description: Gets or sets the Dolby Vision rpu present flag. + format: int32 + nullable: true + ElPresentFlag: + type: integer + description: Gets or sets the Dolby Vision el present flag. + format: int32 + nullable: true + BlPresentFlag: + type: integer + description: Gets or sets the Dolby Vision bl present flag. + format: int32 + nullable: true + DvBlSignalCompatibilityId: + type: integer + description: Gets or sets the Dolby Vision bl signal compatibility id. + format: int32 + nullable: true + Rotation: + type: integer + description: Gets or sets the Rotation in degrees. + format: int32 + nullable: true + Comment: + type: string + description: Gets or sets the comment. + nullable: true + TimeBase: + type: string + description: Gets or sets the time base. + nullable: true + CodecTimeBase: + type: string + description: Gets or sets the codec time base. + nullable: true + Title: + type: string + description: Gets or sets the title. + nullable: true + VideoRange: + enum: + - Unknown + - SDR + - HDR + allOf: + - $ref: '#/components/schemas/VideoRange' + description: Gets the video range. + default: Unknown + readOnly: true + VideoRangeType: + enum: + - Unknown + - SDR + - HDR10 + - HLG + - DOVI + - DOVIWithHDR10 + - DOVIWithHLG + - DOVIWithSDR + - HDR10Plus + allOf: + - $ref: '#/components/schemas/VideoRangeType' + description: Gets the video range type. + default: Unknown + readOnly: true + VideoDoViTitle: + type: string + description: Gets the video dovi title. + nullable: true + readOnly: true + AudioSpatialFormat: + enum: + - None + - DolbyAtmos + - DTSX + allOf: + - $ref: '#/components/schemas/AudioSpatialFormat' + description: Gets the audio spatial format. + default: None + readOnly: true + LocalizedUndefined: + type: string + nullable: true + LocalizedDefault: + type: string + nullable: true + LocalizedForced: + type: string + nullable: true + LocalizedExternal: + type: string + nullable: true + LocalizedHearingImpaired: + type: string + nullable: true + DisplayTitle: + type: string + nullable: true + readOnly: true + NalLengthSize: + type: string + nullable: true + IsInterlaced: + type: boolean + description: Gets or sets a value indicating whether this instance is interlaced. + IsAVC: + type: boolean + nullable: true + ChannelLayout: + type: string + description: Gets or sets the channel layout. + nullable: true + BitRate: + type: integer + description: Gets or sets the bit rate. + format: int32 + nullable: true + BitDepth: + type: integer + description: Gets or sets the bit depth. + format: int32 + nullable: true + RefFrames: + type: integer + description: Gets or sets the reference frames. + format: int32 + nullable: true + PacketLength: + type: integer + description: Gets or sets the length of the packet. + format: int32 + nullable: true + Channels: + type: integer + description: Gets or sets the channels. + format: int32 + nullable: true + SampleRate: + type: integer + description: Gets or sets the sample rate. + format: int32 + nullable: true + IsDefault: + type: boolean + description: Gets or sets a value indicating whether this instance is default. + IsForced: + type: boolean + description: Gets or sets a value indicating whether this instance is forced. + IsHearingImpaired: + type: boolean + description: Gets or sets a value indicating whether this instance is for the hearing impaired. + Height: + type: integer + description: Gets or sets the height. + format: int32 + nullable: true + Width: + type: integer + description: Gets or sets the width. + format: int32 + nullable: true + AverageFrameRate: + type: number + description: Gets or sets the average frame rate. + format: float + nullable: true + RealFrameRate: + type: number + description: Gets or sets the real frame rate. + format: float + nullable: true + ReferenceFrameRate: + type: number + description: "Gets the framerate used as reference.\r\nPrefer AverageFrameRate, if that is null or an unrealistic value\r\nthen fallback to RealFrameRate." + format: float + nullable: true + readOnly: true + Profile: + type: string + description: Gets or sets the profile. + nullable: true + Type: + enum: + - Audio + - Video + - Subtitle + - EmbeddedImage + - Data + - Lyric + allOf: + - $ref: '#/components/schemas/MediaStreamType' + description: Gets or sets the type. + AspectRatio: + type: string + description: Gets or sets the aspect ratio. + nullable: true + Index: + type: integer + description: Gets or sets the index. + format: int32 + Score: + type: integer + description: Gets or sets the score. + format: int32 + nullable: true + IsExternal: + type: boolean + description: Gets or sets a value indicating whether this instance is external. + DeliveryMethod: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + description: Gets or sets the method. + nullable: true + DeliveryUrl: + type: string + description: Gets or sets the delivery URL. + nullable: true + IsExternalUrl: + type: boolean + description: Gets or sets a value indicating whether this instance is external URL. + nullable: true + IsTextSubtitleStream: + type: boolean + readOnly: true + SupportsExternalStream: + type: boolean + description: Gets or sets a value indicating whether [supports external stream]. + Path: + type: string + description: Gets or sets the filename. + nullable: true + PixelFormat: + type: string + description: Gets or sets the pixel format. + nullable: true + Level: + type: number + description: Gets or sets the level. + format: double + nullable: true + IsAnamorphic: + type: boolean + description: Gets or sets whether this instance is anamorphic. + nullable: true + additionalProperties: false + description: Class MediaStream. + MediaStreamProtocol: + enum: + - http + - hls + type: string + description: "Media streaming protocol.\r\nLowercase for backwards compatibility." + MediaStreamType: + enum: + - Audio + - Video + - Subtitle + - EmbeddedImage + - Data + - Lyric + type: string + description: Enum MediaStreamType. + MediaType: + enum: + - Unknown + - Video + - Audio + - Photo + - Book + type: string + description: Media types. + MediaUpdateInfoDto: + type: object + properties: + Updates: + type: array + items: + $ref: '#/components/schemas/MediaUpdateInfoPathDto' + description: Gets or sets the list of updates. + additionalProperties: false + description: Media Update Info Dto. + MediaUpdateInfoPathDto: + type: object + properties: + Path: + type: string + description: Gets or sets media path. + nullable: true + UpdateType: + type: string + description: "Gets or sets media update type.\r\nCreated, Modified, Deleted." + nullable: true + additionalProperties: false + description: The media update info path. + MediaUrl: + type: object + properties: + Url: + type: string + nullable: true + Name: + type: string + nullable: true + additionalProperties: false + MessageCommand: + required: + - Text + type: object + properties: + Header: + type: string + nullable: true + Text: + type: string + TimeoutMs: + type: integer + format: int64 + nullable: true + additionalProperties: false + MetadataConfiguration: + type: object + properties: + UseFileCreationTimeForDateAdded: + type: boolean + additionalProperties: false + MetadataEditorInfo: + type: object + properties: + ParentalRatingOptions: + type: array + items: + $ref: '#/components/schemas/ParentalRating' + Countries: + type: array + items: + $ref: '#/components/schemas/CountryInfo' + Cultures: + type: array + items: + $ref: '#/components/schemas/CultureDto' + ExternalIdInfos: + type: array + items: + $ref: '#/components/schemas/ExternalIdInfo' + ContentType: + enum: + - unknown + - movies + - tvshows + - music + - musicvideos + - trailers + - homevideos + - boxsets + - books + - photos + - livetv + - playlists + - folders + allOf: + - $ref: '#/components/schemas/CollectionType' + nullable: true + ContentTypeOptions: + type: array + items: + $ref: '#/components/schemas/NameValuePair' + additionalProperties: false + MetadataField: + enum: + - Cast + - Genres + - ProductionLocations + - Studios + - Tags + - Name + - Overview + - Runtime + - OfficialRating + type: string + description: Enum MetadataFields. + MetadataOptions: + type: object + properties: + ItemType: + type: string + nullable: true + DisabledMetadataSavers: + type: array + items: + type: string + nullable: true + LocalMetadataReaderOrder: + type: array + items: + type: string + nullable: true + DisabledMetadataFetchers: + type: array + items: + type: string + nullable: true + MetadataFetcherOrder: + type: array + items: + type: string + nullable: true + DisabledImageFetchers: + type: array + items: + type: string + nullable: true + ImageFetcherOrder: + type: array + items: + type: string + nullable: true + additionalProperties: false + description: Class MetadataOptions. + MetadataRefreshMode: + enum: + - None + - ValidationOnly + - Default + - FullRefresh + type: string + MovePlaylistItemRequestDto: + type: object + properties: + PlaylistItemId: + type: string + description: Gets or sets the playlist identifier of the item. + format: uuid + NewIndex: + type: integer + description: Gets or sets the new position. + format: int32 + additionalProperties: false + description: Class MovePlaylistItemRequestDto. + MovieInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + additionalProperties: false + MovieInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/MovieInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + MusicVideoInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + Artists: + type: array + items: + type: string + nullable: true + additionalProperties: false + MusicVideoInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/MusicVideoInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + NameGuidPair: + type: object + properties: + Name: + type: string + nullable: true + Id: + type: string + format: uuid + additionalProperties: false + NameIdPair: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Id: + type: string + description: Gets or sets the identifier. + nullable: true + additionalProperties: false + NameValuePair: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Value: + type: string + description: Gets or sets the value. + nullable: true + additionalProperties: false + NetworkConfiguration: + type: object + properties: + BaseUrl: + type: string + description: Gets or sets a value used to specify the URL prefix that your Jellyfin instance can be accessed at. + EnableHttps: + type: boolean + description: Gets or sets a value indicating whether to use HTTPS. + RequireHttps: + type: boolean + description: Gets or sets a value indicating whether the server should force connections over HTTPS. + CertificatePath: + type: string + description: Gets or sets the filesystem path of an X.509 certificate to use for SSL. + CertificatePassword: + type: string + description: Gets or sets the password required to access the X.509 certificate data in the file specified by MediaBrowser.Common.Net.NetworkConfiguration.CertificatePath. + InternalHttpPort: + type: integer + description: Gets or sets the internal HTTP server port. + format: int32 + InternalHttpsPort: + type: integer + description: Gets or sets the internal HTTPS server port. + format: int32 + PublicHttpPort: + type: integer + description: Gets or sets the public HTTP port. + format: int32 + PublicHttpsPort: + type: integer + description: Gets or sets the public HTTPS port. + format: int32 + AutoDiscovery: + type: boolean + description: Gets or sets a value indicating whether Autodiscovery is enabled. + EnableUPnP: + type: boolean + description: Gets or sets a value indicating whether to enable automatic port forwarding. + EnableIPv4: + type: boolean + description: Gets or sets a value indicating whether IPv6 is enabled. + EnableIPv6: + type: boolean + description: Gets or sets a value indicating whether IPv6 is enabled. + EnableRemoteAccess: + type: boolean + description: Gets or sets a value indicating whether access from outside of the LAN is permitted. + LocalNetworkSubnets: + type: array + items: + type: string + description: Gets or sets the subnets that are deemed to make up the LAN. + LocalNetworkAddresses: + type: array + items: + type: string + description: Gets or sets the interface addresses which Jellyfin will bind to. If empty, all interfaces will be used. + KnownProxies: + type: array + items: + type: string + description: Gets or sets the known proxies. + IgnoreVirtualInterfaces: + type: boolean + description: Gets or sets a value indicating whether address names that match MediaBrowser.Common.Net.NetworkConfiguration.VirtualInterfaceNames should be ignored for the purposes of binding. + VirtualInterfaceNames: + type: array + items: + type: string + description: Gets or sets a value indicating the interface name prefixes that should be ignored. The list can be comma separated and values are case-insensitive. . + EnablePublishedServerUriByRequest: + type: boolean + description: Gets or sets a value indicating whether the published server uri is based on information in HTTP requests. + PublishedServerUriBySubnet: + type: array + items: + type: string + description: "Gets or sets the PublishedServerUriBySubnet\r\nGets or sets PublishedServerUri to advertise for specific subnets." + RemoteIPFilter: + type: array + items: + type: string + description: Gets or sets the filter for remote IP connectivity. Used in conjunction with . + IsRemoteIPFilterBlacklist: + type: boolean + description: Gets or sets a value indicating whether contains a blacklist or a whitelist. Default is a whitelist. + additionalProperties: false + description: Defines the MediaBrowser.Common.Net.NetworkConfiguration. + NewGroupRequestDto: + type: object + properties: + GroupName: + type: string + description: Gets or sets the group name. + additionalProperties: false + description: Class NewGroupRequestDto. + NextItemRequestDto: + type: object + properties: + PlaylistItemId: + type: string + description: Gets or sets the playing item identifier. + format: uuid + additionalProperties: false + description: Class NextItemRequestDto. + OpenLiveStreamDto: + type: object + properties: + OpenToken: + type: string + description: Gets or sets the open token. + nullable: true + UserId: + type: string + description: Gets or sets the user id. + format: uuid + nullable: true + PlaySessionId: + type: string + description: Gets or sets the play session id. + nullable: true + MaxStreamingBitrate: + type: integer + description: Gets or sets the max streaming bitrate. + format: int32 + nullable: true + StartTimeTicks: + type: integer + description: Gets or sets the start time in ticks. + format: int64 + nullable: true + AudioStreamIndex: + type: integer + description: Gets or sets the audio stream index. + format: int32 + nullable: true + SubtitleStreamIndex: + type: integer + description: Gets or sets the subtitle stream index. + format: int32 + nullable: true + MaxAudioChannels: + type: integer + description: Gets or sets the max audio channels. + format: int32 + nullable: true + ItemId: + type: string + description: Gets or sets the item id. + format: uuid + nullable: true + EnableDirectPlay: + type: boolean + description: Gets or sets a value indicating whether to enable direct play. + nullable: true + EnableDirectStream: + type: boolean + description: Gets or sets a value indicating whether to enale direct stream. + nullable: true + AlwaysBurnInSubtitleWhenTranscoding: + type: boolean + description: Gets or sets a value indicating whether always burn in subtitles when transcoding. + nullable: true + DeviceProfile: + allOf: + - $ref: '#/components/schemas/DeviceProfile' + description: "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + nullable: true + DirectPlayProtocols: + type: array + items: + $ref: '#/components/schemas/MediaProtocol' + description: Gets or sets the device play protocols. + additionalProperties: false + description: Open live stream dto. + OutboundKeepAliveMessage: + type: object + properties: + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: KeepAlive + readOnly: true + additionalProperties: false + description: Keep alive websocket messages. + OutboundWebSocketMessage: + type: object + oneOf: + - $ref: '#/components/schemas/ActivityLogEntryMessage' + - $ref: '#/components/schemas/ForceKeepAliveMessage' + - $ref: '#/components/schemas/GeneralCommandMessage' + - $ref: '#/components/schemas/LibraryChangedMessage' + - $ref: '#/components/schemas/OutboundKeepAliveMessage' + - $ref: '#/components/schemas/PlayMessage' + - $ref: '#/components/schemas/PlaystateMessage' + - $ref: '#/components/schemas/PluginInstallationCancelledMessage' + - $ref: '#/components/schemas/PluginInstallationCompletedMessage' + - $ref: '#/components/schemas/PluginInstallationFailedMessage' + - $ref: '#/components/schemas/PluginInstallingMessage' + - $ref: '#/components/schemas/PluginUninstalledMessage' + - $ref: '#/components/schemas/RefreshProgressMessage' + - $ref: '#/components/schemas/RestartRequiredMessage' + - $ref: '#/components/schemas/ScheduledTaskEndedMessage' + - $ref: '#/components/schemas/ScheduledTasksInfoMessage' + - $ref: '#/components/schemas/SeriesTimerCancelledMessage' + - $ref: '#/components/schemas/SeriesTimerCreatedMessage' + - $ref: '#/components/schemas/ServerRestartingMessage' + - $ref: '#/components/schemas/ServerShuttingDownMessage' + - $ref: '#/components/schemas/SessionsMessage' + - $ref: '#/components/schemas/SyncPlayCommandMessage' + - $ref: '#/components/schemas/SyncPlayGroupUpdateCommandMessage' + - $ref: '#/components/schemas/TimerCancelledMessage' + - $ref: '#/components/schemas/TimerCreatedMessage' + - $ref: '#/components/schemas/UserDataChangedMessage' + - $ref: '#/components/schemas/UserDeletedMessage' + - $ref: '#/components/schemas/UserUpdatedMessage' + description: Represents the list of possible outbound websocket types + discriminator: + propertyName: MessageType + mapping: + ActivityLogEntry: '#/components/schemas/ActivityLogEntryMessage' + ForceKeepAlive: '#/components/schemas/ForceKeepAliveMessage' + GeneralCommand: '#/components/schemas/GeneralCommandMessage' + LibraryChanged: '#/components/schemas/LibraryChangedMessage' + KeepAlive: '#/components/schemas/OutboundKeepAliveMessage' + Play: '#/components/schemas/PlayMessage' + Playstate: '#/components/schemas/PlaystateMessage' + PackageInstallationCancelled: '#/components/schemas/PluginInstallationCancelledMessage' + PackageInstallationCompleted: '#/components/schemas/PluginInstallationCompletedMessage' + PackageInstallationFailed: '#/components/schemas/PluginInstallationFailedMessage' + PackageInstalling: '#/components/schemas/PluginInstallingMessage' + PackageUninstalled: '#/components/schemas/PluginUninstalledMessage' + RefreshProgress: '#/components/schemas/RefreshProgressMessage' + RestartRequired: '#/components/schemas/RestartRequiredMessage' + ScheduledTaskEnded: '#/components/schemas/ScheduledTaskEndedMessage' + ScheduledTasksInfo: '#/components/schemas/ScheduledTasksInfoMessage' + SeriesTimerCancelled: '#/components/schemas/SeriesTimerCancelledMessage' + SeriesTimerCreated: '#/components/schemas/SeriesTimerCreatedMessage' + ServerRestarting: '#/components/schemas/ServerRestartingMessage' + ServerShuttingDown: '#/components/schemas/ServerShuttingDownMessage' + Sessions: '#/components/schemas/SessionsMessage' + SyncPlayCommand: '#/components/schemas/SyncPlayCommandMessage' + SyncPlayGroupUpdate: '#/components/schemas/SyncPlayGroupUpdateCommandMessage' + TimerCancelled: '#/components/schemas/TimerCancelledMessage' + TimerCreated: '#/components/schemas/TimerCreatedMessage' + UserDataChanged: '#/components/schemas/UserDataChangedMessage' + UserDeleted: '#/components/schemas/UserDeletedMessage' + UserUpdated: '#/components/schemas/UserUpdatedMessage' + PackageInfo: + type: object + properties: + name: + type: string + description: Gets or sets the name. + description: + type: string + description: Gets or sets a long description of the plugin containing features or helpful explanations. + overview: + type: string + description: Gets or sets a short overview of what the plugin does. + owner: + type: string + description: Gets or sets the owner. + category: + type: string + description: Gets or sets the category. + guid: + type: string + description: "Gets or sets the guid of the assembly associated with this plugin.\r\nThis is used to identify the proper item for automatic updates." + format: uuid + versions: + type: array + items: + $ref: '#/components/schemas/VersionInfo' + description: Gets or sets the versions. + imageUrl: + type: string + description: Gets or sets the image url for the package. + nullable: true + additionalProperties: false + description: Class PackageInfo. + ParentalRating: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Value: + type: integer + description: Gets or sets the value. + format: int32 + nullable: true + additionalProperties: false + description: Class ParentalRating. + PathSubstitution: + type: object + properties: + From: + type: string + description: Gets or sets the value to substitute. + To: + type: string + description: Gets or sets the value to substitution with. + additionalProperties: false + description: Defines the MediaBrowser.Model.Configuration.PathSubstitution. + PersonKind: + enum: + - Unknown + - Actor + - Director + - Composer + - Writer + - GuestStar + - Producer + - Conductor + - Lyricist + - Arranger + - Engineer + - Mixer + - Remixer + - Creator + - Artist + - AlbumArtist + - Author + - Illustrator + - Penciller + - Inker + - Colorist + - Letterer + - CoverArtist + - Editor + - Translator + type: string + description: The person kind. + PersonLookupInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + additionalProperties: false + PersonLookupInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/PersonLookupInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + PingRequestDto: + type: object + properties: + Ping: + type: integer + description: Gets or sets the ping time. + format: int64 + additionalProperties: false + description: Class PingRequestDto. + PinRedeemResult: + type: object + properties: + Success: + type: boolean + description: Gets or sets a value indicating whether this MediaBrowser.Model.Users.PinRedeemResult is success. + UsersReset: + type: array + items: + type: string + description: Gets or sets the users reset. + additionalProperties: false + PlayAccess: + enum: + - Full + - None + type: string + PlaybackErrorCode: + enum: + - NotAllowed + - NoCompatibleStream + - RateLimitExceeded + type: string + PlaybackInfoDto: + type: object + properties: + UserId: + type: string + description: Gets or sets the playback userId. + format: uuid + nullable: true + MaxStreamingBitrate: + type: integer + description: Gets or sets the max streaming bitrate. + format: int32 + nullable: true + StartTimeTicks: + type: integer + description: Gets or sets the start time in ticks. + format: int64 + nullable: true + AudioStreamIndex: + type: integer + description: Gets or sets the audio stream index. + format: int32 + nullable: true + SubtitleStreamIndex: + type: integer + description: Gets or sets the subtitle stream index. + format: int32 + nullable: true + MaxAudioChannels: + type: integer + description: Gets or sets the max audio channels. + format: int32 + nullable: true + MediaSourceId: + type: string + description: Gets or sets the media source id. + nullable: true + LiveStreamId: + type: string + description: Gets or sets the live stream id. + nullable: true + DeviceProfile: + allOf: + - $ref: '#/components/schemas/DeviceProfile' + description: "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + nullable: true + EnableDirectPlay: + type: boolean + description: Gets or sets a value indicating whether to enable direct play. + nullable: true + EnableDirectStream: + type: boolean + description: Gets or sets a value indicating whether to enable direct stream. + nullable: true + EnableTranscoding: + type: boolean + description: Gets or sets a value indicating whether to enable transcoding. + nullable: true + AllowVideoStreamCopy: + type: boolean + description: Gets or sets a value indicating whether to enable video stream copy. + nullable: true + AllowAudioStreamCopy: + type: boolean + description: Gets or sets a value indicating whether to allow audio stream copy. + nullable: true + AutoOpenLiveStream: + type: boolean + description: Gets or sets a value indicating whether to auto open the live stream. + nullable: true + AlwaysBurnInSubtitleWhenTranscoding: + type: boolean + description: Gets or sets a value indicating whether always burn in subtitles when transcoding. + nullable: true + additionalProperties: false + description: Plabyback info dto. + PlaybackInfoResponse: + type: object + properties: + MediaSources: + type: array + items: + $ref: '#/components/schemas/MediaSourceInfo' + description: Gets or sets the media sources. + PlaySessionId: + type: string + description: Gets or sets the play session identifier. + nullable: true + ErrorCode: + enum: + - NotAllowed + - NoCompatibleStream + - RateLimitExceeded + allOf: + - $ref: '#/components/schemas/PlaybackErrorCode' + description: Gets or sets the error code. + nullable: true + additionalProperties: false + description: Class PlaybackInfoResponse. + PlaybackOrder: + enum: + - Default + - Shuffle + type: string + description: Enum PlaybackOrder. + PlaybackProgressInfo: + type: object + properties: + CanSeek: + type: boolean + description: Gets or sets a value indicating whether this instance can seek. + Item: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the item. + nullable: true + ItemId: + type: string + description: Gets or sets the item identifier. + format: uuid + SessionId: + type: string + description: Gets or sets the session id. + nullable: true + MediaSourceId: + type: string + description: Gets or sets the media version identifier. + nullable: true + AudioStreamIndex: + type: integer + description: Gets or sets the index of the audio stream. + format: int32 + nullable: true + SubtitleStreamIndex: + type: integer + description: Gets or sets the index of the subtitle stream. + format: int32 + nullable: true + IsPaused: + type: boolean + description: Gets or sets a value indicating whether this instance is paused. + IsMuted: + type: boolean + description: Gets or sets a value indicating whether this instance is muted. + PositionTicks: + type: integer + description: Gets or sets the position ticks. + format: int64 + nullable: true + PlaybackStartTimeTicks: + type: integer + format: int64 + nullable: true + VolumeLevel: + type: integer + description: Gets or sets the volume level. + format: int32 + nullable: true + Brightness: + type: integer + format: int32 + nullable: true + AspectRatio: + type: string + nullable: true + PlayMethod: + enum: + - Transcode + - DirectStream + - DirectPlay + allOf: + - $ref: '#/components/schemas/PlayMethod' + description: Gets or sets the play method. + LiveStreamId: + type: string + description: Gets or sets the live stream identifier. + nullable: true + PlaySessionId: + type: string + description: Gets or sets the play session identifier. + nullable: true + RepeatMode: + enum: + - RepeatNone + - RepeatAll + - RepeatOne + allOf: + - $ref: '#/components/schemas/RepeatMode' + description: Gets or sets the repeat mode. + PlaybackOrder: + enum: + - Default + - Shuffle + allOf: + - $ref: '#/components/schemas/PlaybackOrder' + description: Gets or sets the playback order. + NowPlayingQueue: + type: array + items: + $ref: '#/components/schemas/QueueItem' + nullable: true + PlaylistItemId: + type: string + nullable: true + additionalProperties: false + description: Class PlaybackProgressInfo. + PlaybackRequestType: + enum: + - Play + - SetPlaylistItem + - RemoveFromPlaylist + - MovePlaylistItem + - Queue + - Unpause + - Pause + - Stop + - Seek + - Buffer + - Ready + - NextItem + - PreviousItem + - SetRepeatMode + - SetShuffleMode + - Ping + - IgnoreWait + type: string + description: Enum PlaybackRequestType. + PlaybackStartInfo: + type: object + properties: + CanSeek: + type: boolean + description: Gets or sets a value indicating whether this instance can seek. + Item: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the item. + nullable: true + ItemId: + type: string + description: Gets or sets the item identifier. + format: uuid + SessionId: + type: string + description: Gets or sets the session id. + nullable: true + MediaSourceId: + type: string + description: Gets or sets the media version identifier. + nullable: true + AudioStreamIndex: + type: integer + description: Gets or sets the index of the audio stream. + format: int32 + nullable: true + SubtitleStreamIndex: + type: integer + description: Gets or sets the index of the subtitle stream. + format: int32 + nullable: true + IsPaused: + type: boolean + description: Gets or sets a value indicating whether this instance is paused. + IsMuted: + type: boolean + description: Gets or sets a value indicating whether this instance is muted. + PositionTicks: + type: integer + description: Gets or sets the position ticks. + format: int64 + nullable: true + PlaybackStartTimeTicks: + type: integer + format: int64 + nullable: true + VolumeLevel: + type: integer + description: Gets or sets the volume level. + format: int32 + nullable: true + Brightness: + type: integer + format: int32 + nullable: true + AspectRatio: + type: string + nullable: true + PlayMethod: + enum: + - Transcode + - DirectStream + - DirectPlay + allOf: + - $ref: '#/components/schemas/PlayMethod' + description: Gets or sets the play method. + LiveStreamId: + type: string + description: Gets or sets the live stream identifier. + nullable: true + PlaySessionId: + type: string + description: Gets or sets the play session identifier. + nullable: true + RepeatMode: + enum: + - RepeatNone + - RepeatAll + - RepeatOne + allOf: + - $ref: '#/components/schemas/RepeatMode' + description: Gets or sets the repeat mode. + PlaybackOrder: + enum: + - Default + - Shuffle + allOf: + - $ref: '#/components/schemas/PlaybackOrder' + description: Gets or sets the playback order. + NowPlayingQueue: + type: array + items: + $ref: '#/components/schemas/QueueItem' + nullable: true + PlaylistItemId: + type: string + nullable: true + additionalProperties: false + description: Class PlaybackStartInfo. + PlaybackStopInfo: + type: object + properties: + Item: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the item. + nullable: true + ItemId: + type: string + description: Gets or sets the item identifier. + format: uuid + SessionId: + type: string + description: Gets or sets the session id. + nullable: true + MediaSourceId: + type: string + description: Gets or sets the media version identifier. + nullable: true + PositionTicks: + type: integer + description: Gets or sets the position ticks. + format: int64 + nullable: true + LiveStreamId: + type: string + description: Gets or sets the live stream identifier. + nullable: true + PlaySessionId: + type: string + description: Gets or sets the play session identifier. + nullable: true + Failed: + type: boolean + description: Gets or sets a value indicating whether this MediaBrowser.Model.Session.PlaybackStopInfo is failed. + NextMediaType: + type: string + nullable: true + PlaylistItemId: + type: string + nullable: true + NowPlayingQueue: + type: array + items: + $ref: '#/components/schemas/QueueItem' + nullable: true + additionalProperties: false + description: Class PlaybackStopInfo. + PlayCommand: + enum: + - PlayNow + - PlayNext + - PlayLast + - PlayInstantMix + - PlayShuffle + type: string + description: Enum PlayCommand. + PlayerStateInfo: + type: object + properties: + PositionTicks: + type: integer + description: Gets or sets the now playing position ticks. + format: int64 + nullable: true + CanSeek: + type: boolean + description: Gets or sets a value indicating whether this instance can seek. + IsPaused: + type: boolean + description: Gets or sets a value indicating whether this instance is paused. + IsMuted: + type: boolean + description: Gets or sets a value indicating whether this instance is muted. + VolumeLevel: + type: integer + description: Gets or sets the volume level. + format: int32 + nullable: true + AudioStreamIndex: + type: integer + description: Gets or sets the index of the now playing audio stream. + format: int32 + nullable: true + SubtitleStreamIndex: + type: integer + description: Gets or sets the index of the now playing subtitle stream. + format: int32 + nullable: true + MediaSourceId: + type: string + description: Gets or sets the now playing media version identifier. + nullable: true + PlayMethod: + enum: + - Transcode + - DirectStream + - DirectPlay + allOf: + - $ref: '#/components/schemas/PlayMethod' + description: Gets or sets the play method. + nullable: true + RepeatMode: + enum: + - RepeatNone + - RepeatAll + - RepeatOne + allOf: + - $ref: '#/components/schemas/RepeatMode' + description: Gets or sets the repeat mode. + PlaybackOrder: + enum: + - Default + - Shuffle + allOf: + - $ref: '#/components/schemas/PlaybackOrder' + description: Gets or sets the playback order. + LiveStreamId: + type: string + description: Gets or sets the now playing live stream identifier. + nullable: true + additionalProperties: false + PlaylistCreationResult: + type: object + properties: + Id: + type: string + additionalProperties: false + PlaylistDto: + type: object + properties: + OpenAccess: + type: boolean + description: Gets or sets a value indicating whether the playlist is publicly readable. + Shares: + type: array + items: + $ref: '#/components/schemas/PlaylistUserPermissions' + description: Gets or sets the share permissions. + ItemIds: + type: array + items: + type: string + format: uuid + description: Gets or sets the item ids. + additionalProperties: false + description: DTO for playlists. + PlaylistUserPermissions: + type: object + properties: + UserId: + type: string + description: Gets or sets the user id. + format: uuid + CanEdit: + type: boolean + description: Gets or sets a value indicating whether the user has edit permissions. + additionalProperties: false + description: Class to hold data on user permissions for playlists. + PlayMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/PlayRequest' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: Play + readOnly: true + additionalProperties: false + description: Play command websocket message. + PlayMethod: + enum: + - Transcode + - DirectStream + - DirectPlay + type: string + PlayQueueUpdate: + type: object + properties: + Reason: + enum: + - NewPlaylist + - SetCurrentItem + - RemoveItems + - MoveItem + - Queue + - QueueNext + - NextItem + - PreviousItem + - RepeatMode + - ShuffleMode + allOf: + - $ref: '#/components/schemas/PlayQueueUpdateReason' + description: Gets the request type that originated this update. + LastUpdate: + type: string + description: Gets the UTC time of the last change to the playing queue. + format: date-time + Playlist: + type: array + items: + $ref: '#/components/schemas/SyncPlayQueueItem' + description: Gets the playlist. + PlayingItemIndex: + type: integer + description: Gets the playing item index in the playlist. + format: int32 + StartPositionTicks: + type: integer + description: Gets the start position ticks. + format: int64 + IsPlaying: + type: boolean + description: Gets a value indicating whether the current item is playing. + ShuffleMode: + enum: + - Sorted + - Shuffle + allOf: + - $ref: '#/components/schemas/GroupShuffleMode' + description: Gets the shuffle mode. + RepeatMode: + enum: + - RepeatOne + - RepeatAll + - RepeatNone + allOf: + - $ref: '#/components/schemas/GroupRepeatMode' + description: Gets the repeat mode. + additionalProperties: false + description: Class PlayQueueUpdate. + PlayQueueUpdateGroupUpdate: + type: object + properties: + GroupId: + type: string + description: Gets the group identifier. + format: uuid + readOnly: true + Type: + enum: + - UserJoined + - UserLeft + - GroupJoined + - GroupLeft + - StateUpdate + - PlayQueue + - NotInGroup + - GroupDoesNotExist + - CreateGroupDenied + - JoinGroupDenied + - LibraryAccessDenied + allOf: + - $ref: '#/components/schemas/GroupUpdateType' + description: Gets the update type. + Data: + allOf: + - $ref: '#/components/schemas/PlayQueueUpdate' + description: Gets the update data. + additionalProperties: false + description: Class GroupUpdate. + PlayQueueUpdateReason: + enum: + - NewPlaylist + - SetCurrentItem + - RemoveItems + - MoveItem + - Queue + - QueueNext + - NextItem + - PreviousItem + - RepeatMode + - ShuffleMode + type: string + description: Enum PlayQueueUpdateReason. + PlayRequest: + type: object + properties: + ItemIds: + type: array + items: + type: string + format: uuid + description: Gets or sets the item ids. + nullable: true + StartPositionTicks: + type: integer + description: Gets or sets the start position ticks that the first item should be played at. + format: int64 + nullable: true + PlayCommand: + enum: + - PlayNow + - PlayNext + - PlayLast + - PlayInstantMix + - PlayShuffle + allOf: + - $ref: '#/components/schemas/PlayCommand' + description: Gets or sets the play command. + ControllingUserId: + type: string + description: Gets or sets the controlling user identifier. + format: uuid + SubtitleStreamIndex: + type: integer + format: int32 + nullable: true + AudioStreamIndex: + type: integer + format: int32 + nullable: true + MediaSourceId: + type: string + nullable: true + StartIndex: + type: integer + format: int32 + nullable: true + additionalProperties: false + description: Class PlayRequest. + PlayRequestDto: + type: object + properties: + PlayingQueue: + type: array + items: + type: string + format: uuid + description: Gets or sets the playing queue. + PlayingItemPosition: + type: integer + description: Gets or sets the position of the playing item in the queue. + format: int32 + StartPositionTicks: + type: integer + description: Gets or sets the start position ticks. + format: int64 + additionalProperties: false + description: Class PlayRequestDto. + PlaystateCommand: + enum: + - Stop + - Pause + - Unpause + - NextTrack + - PreviousTrack + - Seek + - Rewind + - FastForward + - PlayPause + type: string + description: Enum PlaystateCommand. + PlaystateMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/PlaystateRequest' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: Playstate + readOnly: true + additionalProperties: false + description: Playstate message. + PlaystateRequest: + type: object + properties: + Command: + enum: + - Stop + - Pause + - Unpause + - NextTrack + - PreviousTrack + - Seek + - Rewind + - FastForward + - PlayPause + allOf: + - $ref: '#/components/schemas/PlaystateCommand' + description: Enum PlaystateCommand. + SeekPositionTicks: + type: integer + format: int64 + nullable: true + ControllingUserId: + type: string + description: Gets or sets the controlling user identifier. + nullable: true + additionalProperties: false + PluginInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + Version: + type: string + description: Gets or sets the version. + ConfigurationFileName: + type: string + description: Gets or sets the name of the configuration file. + nullable: true + Description: + type: string + description: Gets or sets the description. + Id: + type: string + description: Gets or sets the unique id. + format: uuid + CanUninstall: + type: boolean + description: Gets or sets a value indicating whether the plugin can be uninstalled. + HasImage: + type: boolean + description: Gets or sets a value indicating whether this plugin has a valid image. + Status: + enum: + - Active + - Restart + - Deleted + - Superceded + - Malfunctioned + - NotSupported + - Disabled + allOf: + - $ref: '#/components/schemas/PluginStatus' + description: Gets or sets a value indicating the status of the plugin. + additionalProperties: false + description: This is a serializable stub class that is used by the api to provide information about installed plugins. + PluginInstallationCancelledMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/InstallationInfo' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: PackageInstallationCancelled + readOnly: true + additionalProperties: false + description: Plugin installation cancelled message. + PluginInstallationCompletedMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/InstallationInfo' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: PackageInstallationCompleted + readOnly: true + additionalProperties: false + description: Plugin installation completed message. + PluginInstallationFailedMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/InstallationInfo' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: PackageInstallationFailed + readOnly: true + additionalProperties: false + description: Plugin installation failed message. + PluginInstallingMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/InstallationInfo' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: PackageInstalling + readOnly: true + additionalProperties: false + description: Package installing message. + PluginStatus: + enum: + - Active + - Restart + - Deleted + - Superceded + - Malfunctioned + - NotSupported + - Disabled + type: string + description: Plugin load status. + PluginUninstalledMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/PluginInfo' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: PackageUninstalled + readOnly: true + additionalProperties: false + description: Plugin uninstalled message. + PreviousItemRequestDto: + type: object + properties: + PlaylistItemId: + type: string + description: Gets or sets the playing item identifier. + format: uuid + additionalProperties: false + description: Class PreviousItemRequestDto. + ProblemDetails: + type: object + properties: + type: + type: string + nullable: true + title: + type: string + nullable: true + status: + type: integer + format: int32 + nullable: true + detail: + type: string + nullable: true + instance: + type: string + nullable: true + additionalProperties: {} + ProcessPriorityClass: + enum: + - Normal + - Idle + - High + - RealTime + - BelowNormal + - AboveNormal + type: string + ProfileCondition: + type: object + properties: + Condition: + enum: + - Equals + - NotEquals + - LessThanEqual + - GreaterThanEqual + - EqualsAny + allOf: + - $ref: '#/components/schemas/ProfileConditionType' + Property: + enum: + - AudioChannels + - AudioBitrate + - AudioProfile + - Width + - Height + - Has64BitOffsets + - PacketLength + - VideoBitDepth + - VideoBitrate + - VideoFramerate + - VideoLevel + - VideoProfile + - VideoTimestamp + - IsAnamorphic + - RefFrames + - NumAudioStreams + - NumVideoStreams + - IsSecondaryAudio + - VideoCodecTag + - IsAvc + - IsInterlaced + - AudioSampleRate + - AudioBitDepth + - VideoRangeType + allOf: + - $ref: '#/components/schemas/ProfileConditionValue' + Value: + type: string + nullable: true + IsRequired: + type: boolean + additionalProperties: false + ProfileConditionType: + enum: + - Equals + - NotEquals + - LessThanEqual + - GreaterThanEqual + - EqualsAny + type: string + ProfileConditionValue: + enum: + - AudioChannels + - AudioBitrate + - AudioProfile + - Width + - Height + - Has64BitOffsets + - PacketLength + - VideoBitDepth + - VideoBitrate + - VideoFramerate + - VideoLevel + - VideoProfile + - VideoTimestamp + - IsAnamorphic + - RefFrames + - NumAudioStreams + - NumVideoStreams + - IsSecondaryAudio + - VideoCodecTag + - IsAvc + - IsInterlaced + - AudioSampleRate + - AudioBitDepth + - VideoRangeType + type: string + ProgramAudio: + enum: + - Mono + - Stereo + - Dolby + - DolbyDigital + - Thx + - Atmos + type: string + PublicSystemInfo: + type: object + properties: + LocalAddress: + type: string + description: Gets or sets the local address. + nullable: true + ServerName: + type: string + description: Gets or sets the name of the server. + nullable: true + Version: + type: string + description: Gets or sets the server version. + nullable: true + ProductName: + type: string + description: Gets or sets the product name. This is the AssemblyProduct name. + nullable: true + OperatingSystem: + type: string + description: Gets or sets the operating system. + nullable: true + deprecated: true + Id: + type: string + description: Gets or sets the id. + nullable: true + StartupWizardCompleted: + type: boolean + description: Gets or sets a value indicating whether the startup wizard is completed. + nullable: true + additionalProperties: false + QueryFilters: + type: object + properties: + Genres: + type: array + items: + $ref: '#/components/schemas/NameGuidPair' + nullable: true + Tags: + type: array + items: + type: string + nullable: true + additionalProperties: false + QueryFiltersLegacy: + type: object + properties: + Genres: + type: array + items: + type: string + nullable: true + Tags: + type: array + items: + type: string + nullable: true + OfficialRatings: + type: array + items: + type: string + nullable: true + Years: + type: array + items: + type: integer + format: int32 + nullable: true + additionalProperties: false + QueueItem: + type: object + properties: + Id: + type: string + format: uuid + PlaylistItemId: + type: string + nullable: true + additionalProperties: false + QueueRequestDto: + type: object + properties: + ItemIds: + type: array + items: + type: string + format: uuid + description: Gets or sets the items to enqueue. + Mode: + enum: + - Queue + - QueueNext + allOf: + - $ref: '#/components/schemas/GroupQueueMode' + description: Enum GroupQueueMode. + additionalProperties: false + description: Class QueueRequestDto. + QuickConnectDto: + required: + - Secret + type: object + properties: + Secret: + type: string + description: Gets or sets the quick connect secret. + additionalProperties: false + description: The quick connect request body. + QuickConnectResult: + type: object + properties: + Authenticated: + type: boolean + description: Gets or sets a value indicating whether this request is authorized. + Secret: + type: string + description: Gets the secret value used to uniquely identify this request. Can be used to retrieve authentication information. + Code: + type: string + description: Gets the user facing code used so the user can quickly differentiate this request from others. + DeviceId: + type: string + description: Gets the requesting device id. + DeviceName: + type: string + description: Gets the requesting device name. + AppName: + type: string + description: Gets the requesting app name. + AppVersion: + type: string + description: Gets the requesting app version. + DateAdded: + type: string + description: Gets or sets the DateTime that this request was created. + format: date-time + additionalProperties: false + description: Stores the state of an quick connect request. + RatingType: + enum: + - Score + - Likes + type: string + ReadyRequestDto: + type: object + properties: + When: + type: string + description: Gets or sets when the request has been made by the client. + format: date-time + PositionTicks: + type: integer + description: Gets or sets the position ticks. + format: int64 + IsPlaying: + type: boolean + description: Gets or sets a value indicating whether the client playback is unpaused. + PlaylistItemId: + type: string + description: Gets or sets the playlist item identifier of the playing item. + format: uuid + additionalProperties: false + description: Class ReadyRequest. + RecommendationDto: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + nullable: true + RecommendationType: + enum: + - SimilarToRecentlyPlayed + - SimilarToLikedItem + - HasDirectorFromRecentlyPlayed + - HasActorFromRecentlyPlayed + - HasLikedDirector + - HasLikedActor + allOf: + - $ref: '#/components/schemas/RecommendationType' + BaselineItemName: + type: string + nullable: true + CategoryId: + type: string + format: uuid + additionalProperties: false + RecommendationType: + enum: + - SimilarToRecentlyPlayed + - SimilarToLikedItem + - HasDirectorFromRecentlyPlayed + - HasActorFromRecentlyPlayed + - HasLikedDirector + - HasLikedActor + type: string + RecordingStatus: + enum: + - New + - InProgress + - Completed + - Cancelled + - ConflictedOk + - ConflictedNotOk + - Error + type: string + RefreshProgressMessage: + type: object + properties: + Data: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: RefreshProgress + readOnly: true + additionalProperties: false + description: Refresh progress message. + RemoteImageInfo: + type: object + properties: + ProviderName: + type: string + description: Gets or sets the name of the provider. + nullable: true + Url: + type: string + description: Gets or sets the URL. + nullable: true + ThumbnailUrl: + type: string + description: Gets or sets a url used for previewing a smaller version. + nullable: true + Height: + type: integer + description: Gets or sets the height. + format: int32 + nullable: true + Width: + type: integer + description: Gets or sets the width. + format: int32 + nullable: true + CommunityRating: + type: number + description: Gets or sets the community rating. + format: double + nullable: true + VoteCount: + type: integer + description: Gets or sets the vote count. + format: int32 + nullable: true + Language: + type: string + description: Gets or sets the language. + nullable: true + Type: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + allOf: + - $ref: '#/components/schemas/ImageType' + description: Gets or sets the type. + RatingType: + enum: + - Score + - Likes + allOf: + - $ref: '#/components/schemas/RatingType' + description: Gets or sets the type of the rating. + additionalProperties: false + description: Class RemoteImageInfo. + RemoteImageResult: + type: object + properties: + Images: + type: array + items: + $ref: '#/components/schemas/RemoteImageInfo' + description: Gets or sets the images. + nullable: true + TotalRecordCount: + type: integer + description: Gets or sets the total record count. + format: int32 + Providers: + type: array + items: + type: string + description: Gets or sets the providers. + nullable: true + additionalProperties: false + description: Class RemoteImageResult. + RemoteLyricInfoDto: + type: object + properties: + Id: + type: string + description: Gets or sets the id for the lyric. + ProviderName: + type: string + description: Gets the provider name. + Lyrics: + allOf: + - $ref: '#/components/schemas/LyricDto' + description: Gets the lyrics. + additionalProperties: false + description: The remote lyric info dto. + RemoteSearchResult: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + ProductionYear: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + IndexNumberEnd: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + ImageUrl: + type: string + nullable: true + SearchProviderName: + type: string + nullable: true + Overview: + type: string + nullable: true + AlbumArtist: + allOf: + - $ref: '#/components/schemas/RemoteSearchResult' + nullable: true + Artists: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + nullable: true + additionalProperties: false + RemoteSubtitleInfo: + type: object + properties: + ThreeLetterISOLanguageName: + type: string + nullable: true + Id: + type: string + nullable: true + ProviderName: + type: string + nullable: true + Name: + type: string + nullable: true + Format: + type: string + nullable: true + Author: + type: string + nullable: true + Comment: + type: string + nullable: true + DateCreated: + type: string + format: date-time + nullable: true + CommunityRating: + type: number + format: float + nullable: true + FrameRate: + type: number + format: float + nullable: true + DownloadCount: + type: integer + format: int32 + nullable: true + IsHashMatch: + type: boolean + nullable: true + AiTranslated: + type: boolean + nullable: true + MachineTranslated: + type: boolean + nullable: true + Forced: + type: boolean + nullable: true + HearingImpaired: + type: boolean + nullable: true + additionalProperties: false + RemoveFromPlaylistRequestDto: + type: object + properties: + PlaylistItemIds: + type: array + items: + type: string + format: uuid + description: Gets or sets the playlist identifiers of the items. Ignored when clearing the playlist. + ClearPlaylist: + type: boolean + description: Gets or sets a value indicating whether the entire playlist should be cleared. + ClearPlayingItem: + type: boolean + description: Gets or sets a value indicating whether the playing item should be removed as well. Used only when clearing the playlist. + additionalProperties: false + description: Class RemoveFromPlaylistRequestDto. + RepeatMode: + enum: + - RepeatNone + - RepeatAll + - RepeatOne + type: string + RepositoryInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Url: + type: string + description: Gets or sets the URL. + nullable: true + Enabled: + type: boolean + description: Gets or sets a value indicating whether the repository is enabled. + additionalProperties: false + description: Class RepositoryInfo. + RestartRequiredMessage: + type: object + properties: + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: RestartRequired + readOnly: true + additionalProperties: false + description: Restart required. + ScheduledTaskEndedMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/TaskResult' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: ScheduledTaskEnded + readOnly: true + additionalProperties: false + description: Scheduled task ended message. + ScheduledTasksInfoMessage: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/TaskInfo' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: ScheduledTasksInfo + readOnly: true + additionalProperties: false + description: Scheduled tasks info message. + ScheduledTasksInfoStartMessage: + type: object + properties: + Data: + type: string + description: Gets or sets the data. + nullable: true + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: ScheduledTasksInfoStart + readOnly: true + additionalProperties: false + description: "Scheduled tasks info start message.\r\nData is the timing data encoded as \"$initialDelay,$interval\" in ms." + ScheduledTasksInfoStopMessage: + type: object + properties: + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: ScheduledTasksInfoStop + readOnly: true + additionalProperties: false + description: Scheduled tasks info stop message. + ScrollDirection: + enum: + - Horizontal + - Vertical + type: string + description: An enum representing the axis that should be scrolled. + SearchHint: + type: object + properties: + ItemId: + type: string + description: Gets or sets the item id. + format: uuid + deprecated: true + Id: + type: string + description: Gets or sets the item id. + format: uuid + Name: + type: string + description: Gets or sets the name. + MatchedTerm: + type: string + description: Gets or sets the matched term. + nullable: true + IndexNumber: + type: integer + description: Gets or sets the index number. + format: int32 + nullable: true + ProductionYear: + type: integer + description: Gets or sets the production year. + format: int32 + nullable: true + ParentIndexNumber: + type: integer + description: Gets or sets the parent index number. + format: int32 + nullable: true + PrimaryImageTag: + type: string + description: Gets or sets the image tag. + nullable: true + ThumbImageTag: + type: string + description: Gets or sets the thumb image tag. + nullable: true + ThumbImageItemId: + type: string + description: Gets or sets the thumb image item identifier. + nullable: true + BackdropImageTag: + type: string + description: Gets or sets the backdrop image tag. + nullable: true + BackdropImageItemId: + type: string + description: Gets or sets the backdrop image item identifier. + nullable: true + Type: + enum: + - AggregateFolder + - Audio + - AudioBook + - BasePluginFolder + - Book + - BoxSet + - Channel + - ChannelFolderItem + - CollectionFolder + - Episode + - Folder + - Genre + - ManualPlaylistsFolder + - Movie + - LiveTvChannel + - LiveTvProgram + - MusicAlbum + - MusicArtist + - MusicGenre + - MusicVideo + - Person + - Photo + - PhotoAlbum + - Playlist + - PlaylistsFolder + - Program + - Recording + - Season + - Series + - Studio + - Trailer + - TvChannel + - TvProgram + - UserRootFolder + - UserView + - Video + - Year + allOf: + - $ref: '#/components/schemas/BaseItemKind' + description: Gets or sets the type. + IsFolder: + type: boolean + description: Gets or sets a value indicating whether this instance is folder. + nullable: true + RunTimeTicks: + type: integer + description: Gets or sets the run time ticks. + format: int64 + nullable: true + MediaType: + enum: + - Unknown + - Video + - Audio + - Photo + - Book + allOf: + - $ref: '#/components/schemas/MediaType' + description: Gets or sets the type of the media. + default: Unknown + StartDate: + type: string + description: Gets or sets the start date. + format: date-time + nullable: true + EndDate: + type: string + description: Gets or sets the end date. + format: date-time + nullable: true + Series: + type: string + description: Gets or sets the series. + nullable: true + Status: + type: string + description: Gets or sets the status. + nullable: true + Album: + type: string + description: Gets or sets the album. + nullable: true + AlbumId: + type: string + description: Gets or sets the album id. + format: uuid + nullable: true + AlbumArtist: + type: string + description: Gets or sets the album artist. + nullable: true + Artists: + type: array + items: + type: string + description: Gets or sets the artists. + SongCount: + type: integer + description: Gets or sets the song count. + format: int32 + nullable: true + EpisodeCount: + type: integer + description: Gets or sets the episode count. + format: int32 + nullable: true + ChannelId: + type: string + description: Gets or sets the channel identifier. + format: uuid + nullable: true + ChannelName: + type: string + description: Gets or sets the name of the channel. + nullable: true + PrimaryImageAspectRatio: + type: number + description: Gets or sets the primary image aspect ratio. + format: double + nullable: true + additionalProperties: false + description: Class SearchHintResult. + SearchHintResult: + type: object + properties: + SearchHints: + type: array + items: + $ref: '#/components/schemas/SearchHint' + description: Gets the search hints. + TotalRecordCount: + type: integer + description: Gets the total record count. + format: int32 + additionalProperties: false + description: Class SearchHintResult. + SeekRequestDto: + type: object + properties: + PositionTicks: + type: integer + description: Gets or sets the position ticks. + format: int64 + additionalProperties: false + description: Class SeekRequestDto. + SendCommand: + type: object + properties: + GroupId: + type: string + description: Gets the group identifier. + format: uuid + PlaylistItemId: + type: string + description: Gets the playlist identifier of the playing item. + format: uuid + When: + type: string + description: Gets or sets the UTC time when to execute the command. + format: date-time + PositionTicks: + type: integer + description: Gets the position ticks. + format: int64 + nullable: true + Command: + enum: + - Unpause + - Pause + - Stop + - Seek + allOf: + - $ref: '#/components/schemas/SendCommandType' + description: Gets the command. + EmittedAt: + type: string + description: Gets the UTC time when this command has been emitted. + format: date-time + additionalProperties: false + description: Class SendCommand. + SendCommandType: + enum: + - Unpause + - Pause + - Stop + - Seek + type: string + description: Enum SendCommandType. + SeriesInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + additionalProperties: false + SeriesInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/SeriesInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + SeriesStatus: + enum: + - Continuing + - Ended + - Unreleased + type: string + description: The status of a series. + SeriesTimerCancelledMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/TimerEventInfo' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: SeriesTimerCancelled + readOnly: true + additionalProperties: false + description: Series timer cancelled message. + SeriesTimerCreatedMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/TimerEventInfo' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: SeriesTimerCreated + readOnly: true + additionalProperties: false + description: Series timer created message. + SeriesTimerInfoDto: + type: object + properties: + Id: + type: string + description: Gets or sets the Id of the recording. + nullable: true + Type: + type: string + nullable: true + ServerId: + type: string + description: Gets or sets the server identifier. + nullable: true + ExternalId: + type: string + description: Gets or sets the external identifier. + nullable: true + ChannelId: + type: string + description: Gets or sets the channel id of the recording. + format: uuid + ExternalChannelId: + type: string + description: Gets or sets the external channel identifier. + nullable: true + ChannelName: + type: string + description: Gets or sets the channel name of the recording. + nullable: true + ChannelPrimaryImageTag: + type: string + nullable: true + ProgramId: + type: string + description: Gets or sets the program identifier. + nullable: true + ExternalProgramId: + type: string + description: Gets or sets the external program identifier. + nullable: true + Name: + type: string + description: Gets or sets the name of the recording. + nullable: true + Overview: + type: string + description: Gets or sets the description of the recording. + nullable: true + StartDate: + type: string + description: Gets or sets the start date of the recording, in UTC. + format: date-time + EndDate: + type: string + description: Gets or sets the end date of the recording, in UTC. + format: date-time + ServiceName: + type: string + description: Gets or sets the name of the service. + nullable: true + Priority: + type: integer + description: Gets or sets the priority. + format: int32 + PrePaddingSeconds: + type: integer + description: Gets or sets the pre padding seconds. + format: int32 + PostPaddingSeconds: + type: integer + description: Gets or sets the post padding seconds. + format: int32 + IsPrePaddingRequired: + type: boolean + description: Gets or sets a value indicating whether this instance is pre padding required. + ParentBackdropItemId: + type: string + description: Gets or sets the Id of the Parent that has a backdrop if the item does not have one. + nullable: true + ParentBackdropImageTags: + type: array + items: + type: string + description: Gets or sets the parent backdrop image tags. + nullable: true + IsPostPaddingRequired: + type: boolean + description: Gets or sets a value indicating whether this instance is post padding required. + KeepUntil: + enum: + - UntilDeleted + - UntilSpaceNeeded + - UntilWatched + - UntilDate + allOf: + - $ref: '#/components/schemas/KeepUntil' + RecordAnyTime: + type: boolean + description: Gets or sets a value indicating whether [record any time]. + SkipEpisodesInLibrary: + type: boolean + RecordAnyChannel: + type: boolean + description: Gets or sets a value indicating whether [record any channel]. + KeepUpTo: + type: integer + format: int32 + RecordNewOnly: + type: boolean + description: Gets or sets a value indicating whether [record new only]. + Days: + type: array + items: + $ref: '#/components/schemas/DayOfWeek' + description: Gets or sets the days. + nullable: true + DayPattern: + enum: + - Daily + - Weekdays + - Weekends + allOf: + - $ref: '#/components/schemas/DayPattern' + description: Gets or sets the day pattern. + nullable: true + ImageTags: + type: object + additionalProperties: + type: string + description: Gets or sets the image tags. + nullable: true + ParentThumbItemId: + type: string + description: Gets or sets the parent thumb item id. + nullable: true + ParentThumbImageTag: + type: string + description: Gets or sets the parent thumb image tag. + nullable: true + ParentPrimaryImageItemId: + type: string + description: Gets or sets the parent primary image item identifier. + nullable: true + ParentPrimaryImageTag: + type: string + description: Gets or sets the parent primary image tag. + nullable: true + additionalProperties: false + description: Class SeriesTimerInfoDto. + SeriesTimerInfoDtoQueryResult: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/SeriesTimerInfoDto' + description: Gets or sets the items. + TotalRecordCount: + type: integer + description: Gets or sets the total number of records available. + format: int32 + StartIndex: + type: integer + description: Gets or sets the index of the first record in Items. + format: int32 + additionalProperties: false + description: Query result container. + ServerConfiguration: + type: object + properties: + LogFileRetentionDays: + type: integer + description: Gets or sets the number of days we should retain log files. + format: int32 + IsStartupWizardCompleted: + type: boolean + description: Gets or sets a value indicating whether this instance is first run. + CachePath: + type: string + description: Gets or sets the cache path. + nullable: true + PreviousVersion: + type: string + description: Gets or sets the last known version that was ran using the configuration. + nullable: true + PreviousVersionStr: + type: string + description: "Gets or sets the stringified PreviousVersion to be stored/loaded,\r\nbecause System.Version itself isn't xml-serializable." + nullable: true + EnableMetrics: + type: boolean + description: Gets or sets a value indicating whether to enable prometheus metrics exporting. + EnableNormalizedItemByNameIds: + type: boolean + IsPortAuthorized: + type: boolean + description: Gets or sets a value indicating whether this instance is port authorized. + QuickConnectAvailable: + type: boolean + description: Gets or sets a value indicating whether quick connect is available for use on this server. + EnableCaseSensitiveItemIds: + type: boolean + description: Gets or sets a value indicating whether [enable case sensitive item ids]. + DisableLiveTvChannelUserDataName: + type: boolean + MetadataPath: + type: string + description: Gets or sets the metadata path. + PreferredMetadataLanguage: + type: string + description: Gets or sets the preferred metadata language. + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + SortReplaceCharacters: + type: array + items: + type: string + description: Gets or sets characters to be replaced with a ' ' in strings to create a sort name. + SortRemoveCharacters: + type: array + items: + type: string + description: Gets or sets characters to be removed from strings to create a sort name. + SortRemoveWords: + type: array + items: + type: string + description: Gets or sets words to be removed from strings to create a sort name. + MinResumePct: + type: integer + description: Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated. + format: int32 + MaxResumePct: + type: integer + description: Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched. + format: int32 + MinResumeDurationSeconds: + type: integer + description: Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates.. + format: int32 + MinAudiobookResume: + type: integer + description: Gets or sets the minimum minutes of a book that must be played in order for playstate to be updated. + format: int32 + MaxAudiobookResume: + type: integer + description: Gets or sets the remaining minutes of a book that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched. + format: int32 + InactiveSessionThreshold: + type: integer + description: "Gets or sets the threshold in minutes after a inactive session gets closed automatically.\r\nIf set to 0 the check for inactive sessions gets disabled." + format: int32 + LibraryMonitorDelay: + type: integer + description: "Gets or sets the delay in seconds that we will wait after a file system change to try and discover what has been added/removed\r\nSome delay is necessary with some items because their creation is not atomic. It involves the creation of several\r\ndifferent directories and files." + format: int32 + LibraryUpdateDuration: + type: integer + description: Gets or sets the duration in seconds that we will wait after a library updated event before executing the library changed notification. + format: int32 + ImageSavingConvention: + enum: + - Legacy + - Compatible + allOf: + - $ref: '#/components/schemas/ImageSavingConvention' + description: Gets or sets the image saving convention. + MetadataOptions: + type: array + items: + $ref: '#/components/schemas/MetadataOptions' + SkipDeserializationForBasicTypes: + type: boolean + ServerName: + type: string + UICulture: + type: string + SaveMetadataHidden: + type: boolean + ContentTypes: + type: array + items: + $ref: '#/components/schemas/NameValuePair' + RemoteClientBitrateLimit: + type: integer + format: int32 + EnableFolderView: + type: boolean + EnableGroupingIntoCollections: + type: boolean + DisplaySpecialsWithinSeasons: + type: boolean + CodecsUsed: + type: array + items: + type: string + PluginRepositories: + type: array + items: + $ref: '#/components/schemas/RepositoryInfo' + EnableExternalContentInSuggestions: + type: boolean + ImageExtractionTimeoutMs: + type: integer + format: int32 + PathSubstitutions: + type: array + items: + $ref: '#/components/schemas/PathSubstitution' + EnableSlowResponseWarning: + type: boolean + description: Gets or sets a value indicating whether slow server responses should be logged as a warning. + SlowResponseThresholdMs: + type: integer + description: Gets or sets the threshold for the slow response time warning in ms. + format: int64 + CorsHosts: + type: array + items: + type: string + description: Gets or sets the cors hosts. + ActivityLogRetentionDays: + type: integer + description: Gets or sets the number of days we should retain activity logs. + format: int32 + nullable: true + LibraryScanFanoutConcurrency: + type: integer + description: Gets or sets the how the library scan fans out. + format: int32 + LibraryMetadataRefreshConcurrency: + type: integer + description: Gets or sets the how many metadata refreshes can run concurrently. + format: int32 + RemoveOldPlugins: + type: boolean + description: Gets or sets a value indicating whether older plugins should automatically be deleted from the plugin folder. + AllowClientLogUpload: + type: boolean + description: Gets or sets a value indicating whether clients should be allowed to upload logs. + DummyChapterDuration: + type: integer + description: Gets or sets the dummy chapter duration in seconds, use 0 (zero) or less to disable generation alltogether. + format: int32 + ChapterImageResolution: + enum: + - MatchSource + - P144 + - P240 + - P360 + - P480 + - P720 + - P1080 + - P1440 + - P2160 + allOf: + - $ref: '#/components/schemas/ImageResolution' + description: Gets or sets the chapter image resolution. + ParallelImageEncodingLimit: + type: integer + description: Gets or sets the limit for parallel image encoding. + format: int32 + CastReceiverApplications: + type: array + items: + $ref: '#/components/schemas/CastReceiverApplication' + description: Gets or sets the list of cast receiver applications. + TrickplayOptions: + allOf: + - $ref: '#/components/schemas/TrickplayOptions' + description: Gets or sets the trickplay options. + additionalProperties: false + description: Represents the server configuration. + ServerDiscoveryInfo: + type: object + properties: + Address: + type: string + description: Gets the address. + Id: + type: string + description: Gets the server identifier. + Name: + type: string + description: Gets the name. + EndpointAddress: + type: string + description: Gets the endpoint address. + nullable: true + additionalProperties: false + description: The server discovery info model. + ServerRestartingMessage: + type: object + properties: + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: ServerRestarting + readOnly: true + additionalProperties: false + description: Server restarting down message. + ServerShuttingDownMessage: + type: object + properties: + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: ServerShuttingDown + readOnly: true + additionalProperties: false + description: Server shutting down message. + SessionInfoDto: + type: object + properties: + PlayState: + allOf: + - $ref: '#/components/schemas/PlayerStateInfo' + description: Gets or sets the play state. + nullable: true + AdditionalUsers: + type: array + items: + $ref: '#/components/schemas/SessionUserInfo' + description: Gets or sets the additional users. + nullable: true + Capabilities: + allOf: + - $ref: '#/components/schemas/ClientCapabilitiesDto' + description: Gets or sets the client capabilities. + nullable: true + RemoteEndPoint: + type: string + description: Gets or sets the remote end point. + nullable: true + PlayableMediaTypes: + type: array + items: + $ref: '#/components/schemas/MediaType' + description: Gets or sets the playable media types. + Id: + type: string + description: Gets or sets the id. + nullable: true + UserId: + type: string + description: Gets or sets the user id. + format: uuid + UserName: + type: string + description: Gets or sets the username. + nullable: true + Client: + type: string + description: Gets or sets the type of the client. + nullable: true + LastActivityDate: + type: string + description: Gets or sets the last activity date. + format: date-time + LastPlaybackCheckIn: + type: string + description: Gets or sets the last playback check in. + format: date-time + LastPausedDate: + type: string + description: Gets or sets the last paused date. + format: date-time + nullable: true + DeviceName: + type: string + description: Gets or sets the name of the device. + nullable: true + DeviceType: + type: string + description: Gets or sets the type of the device. + nullable: true + NowPlayingItem: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the now playing item. + nullable: true + NowViewingItem: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the now viewing item. + nullable: true + DeviceId: + type: string + description: Gets or sets the device id. + nullable: true + ApplicationVersion: + type: string + description: Gets or sets the application version. + nullable: true + TranscodingInfo: + allOf: + - $ref: '#/components/schemas/TranscodingInfo' + description: Gets or sets the transcoding info. + nullable: true + IsActive: + type: boolean + description: Gets or sets a value indicating whether this session is active. + SupportsMediaControl: + type: boolean + description: Gets or sets a value indicating whether the session supports media control. + SupportsRemoteControl: + type: boolean + description: Gets or sets a value indicating whether the session supports remote control. + NowPlayingQueue: + type: array + items: + $ref: '#/components/schemas/QueueItem' + description: Gets or sets the now playing queue. + nullable: true + NowPlayingQueueFullItems: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the now playing queue full items. + nullable: true + HasCustomDeviceName: + type: boolean + description: Gets or sets a value indicating whether the session has a custom device name. + PlaylistItemId: + type: string + description: Gets or sets the playlist item id. + nullable: true + ServerId: + type: string + description: Gets or sets the server id. + nullable: true + UserPrimaryImageTag: + type: string + description: Gets or sets the user primary image tag. + nullable: true + SupportedCommands: + type: array + items: + $ref: '#/components/schemas/GeneralCommandType' + description: Gets or sets the supported commands. + additionalProperties: false + description: Session info DTO. + SessionMessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + type: string + description: The different kinds of messages that are used in the WebSocket api. + SessionsMessage: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/SessionInfoDto' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: Sessions + readOnly: true + additionalProperties: false + description: Sessions message. + SessionsStartMessage: + type: object + properties: + Data: + type: string + description: Gets or sets the data. + nullable: true + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: SessionsStart + readOnly: true + additionalProperties: false + description: "Sessions start message.\r\nData is the timing data encoded as \"$initialDelay,$interval\" in ms." + SessionsStopMessage: + type: object + properties: + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: SessionsStop + readOnly: true + additionalProperties: false + description: Sessions stop message. + SessionUserInfo: + type: object + properties: + UserId: + type: string + description: Gets or sets the user identifier. + format: uuid + UserName: + type: string + description: Gets or sets the name of the user. + nullable: true + additionalProperties: false + description: Class SessionUserInfo. + SetChannelMappingDto: + required: + - ProviderChannelId + - ProviderId + - TunerChannelId + type: object + properties: + ProviderId: + type: string + description: Gets or sets the provider id. + TunerChannelId: + type: string + description: Gets or sets the tuner channel id. + ProviderChannelId: + type: string + description: Gets or sets the provider channel id. + additionalProperties: false + description: Set channel mapping dto. + SetPlaylistItemRequestDto: + type: object + properties: + PlaylistItemId: + type: string + description: Gets or sets the playlist identifier of the playing item. + format: uuid + additionalProperties: false + description: Class SetPlaylistItemRequestDto. + SetRepeatModeRequestDto: + type: object + properties: + Mode: + enum: + - RepeatOne + - RepeatAll + - RepeatNone + allOf: + - $ref: '#/components/schemas/GroupRepeatMode' + description: Enum GroupRepeatMode. + additionalProperties: false + description: Class SetRepeatModeRequestDto. + SetShuffleModeRequestDto: + type: object + properties: + Mode: + enum: + - Sorted + - Shuffle + allOf: + - $ref: '#/components/schemas/GroupShuffleMode' + description: Enum GroupShuffleMode. + additionalProperties: false + description: Class SetShuffleModeRequestDto. + SongInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + AlbumArtists: + type: array + items: + type: string + nullable: true + Album: + type: string + nullable: true + Artists: + type: array + items: + type: string + nullable: true + additionalProperties: false + SortOrder: + enum: + - Ascending + - Descending + type: string + description: An enum representing the sorting order. + SpecialViewOptionDto: + type: object + properties: + Name: + type: string + description: Gets or sets view option name. + nullable: true + Id: + type: string + description: Gets or sets view option id. + nullable: true + additionalProperties: false + description: Special view option dto. + StartupConfigurationDto: + type: object + properties: + UICulture: + type: string + description: Gets or sets UI language culture. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + PreferredMetadataLanguage: + type: string + description: Gets or sets the preferred language for the metadata. + nullable: true + additionalProperties: false + description: The startup configuration DTO. + StartupRemoteAccessDto: + required: + - EnableAutomaticPortMapping + - EnableRemoteAccess + type: object + properties: + EnableRemoteAccess: + type: boolean + description: Gets or sets a value indicating whether enable remote access. + EnableAutomaticPortMapping: + type: boolean + description: Gets or sets a value indicating whether enable automatic port mapping. + additionalProperties: false + description: Startup remote access dto. + StartupUserDto: + type: object + properties: + Name: + type: string + description: Gets or sets the username. + nullable: true + Password: + type: string + description: Gets or sets the user's password. + nullable: true + additionalProperties: false + description: The startup user DTO. + StringGroupUpdate: + type: object + properties: + GroupId: + type: string + description: Gets the group identifier. + format: uuid + readOnly: true + Type: + enum: + - UserJoined + - UserLeft + - GroupJoined + - GroupLeft + - StateUpdate + - PlayQueue + - NotInGroup + - GroupDoesNotExist + - CreateGroupDenied + - JoinGroupDenied + - LibraryAccessDenied + allOf: + - $ref: '#/components/schemas/GroupUpdateType' + description: Gets the update type. + Data: + type: string + description: Gets the update data. + additionalProperties: false + description: Class GroupUpdate. + SubtitleDeliveryMethod: + enum: + - Encode + - Embed + - External + - Hls + - Drop + type: string + description: Delivery method to use during playback of a specific subtitle format. + SubtitleOptions: + type: object + properties: + SkipIfEmbeddedSubtitlesPresent: + type: boolean + SkipIfAudioTrackMatches: + type: boolean + DownloadLanguages: + type: array + items: + type: string + nullable: true + DownloadMovieSubtitles: + type: boolean + DownloadEpisodeSubtitles: + type: boolean + OpenSubtitlesUsername: + type: string + nullable: true + OpenSubtitlesPasswordHash: + type: string + nullable: true + IsOpenSubtitleVipAccount: + type: boolean + RequirePerfectMatch: + type: boolean + additionalProperties: false + SubtitlePlaybackMode: + enum: + - Default + - Always + - OnlyForced + - None + - Smart + type: string + description: An enum representing a subtitle playback mode. + SubtitleProfile: + type: object + properties: + Format: + type: string + description: Gets or sets the format. + nullable: true + Method: + enum: + - Encode + - Embed + - External + - Hls + - Drop + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + description: Gets or sets the delivery method. + DidlMode: + type: string + description: Gets or sets the DIDL mode. + nullable: true + Language: + type: string + description: Gets or sets the language. + nullable: true + Container: + type: string + description: Gets or sets the container. + nullable: true + additionalProperties: false + description: A class for subtitle profile information. + SyncPlayCommandMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/SendCommand' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: SyncPlayCommand + readOnly: true + additionalProperties: false + description: Sync play command. + SyncPlayGroupUpdateCommandMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/GroupUpdate' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: SyncPlayGroupUpdate + readOnly: true + additionalProperties: false + description: Untyped sync play command. + SyncPlayQueueItem: + type: object + properties: + ItemId: + type: string + description: Gets the item identifier. + format: uuid + PlaylistItemId: + type: string + description: Gets the playlist identifier of the item. + format: uuid + readOnly: true + additionalProperties: false + description: Class QueueItem. + SyncPlayUserAccessType: + enum: + - CreateAndJoinGroups + - JoinGroups + - None + type: string + description: Enum SyncPlayUserAccessType. + SystemInfo: + type: object + properties: + LocalAddress: + type: string + description: Gets or sets the local address. + nullable: true + ServerName: + type: string + description: Gets or sets the name of the server. + nullable: true + Version: + type: string + description: Gets or sets the server version. + nullable: true + ProductName: + type: string + description: Gets or sets the product name. This is the AssemblyProduct name. + nullable: true + OperatingSystem: + type: string + description: Gets or sets the operating system. + nullable: true + deprecated: true + Id: + type: string + description: Gets or sets the id. + nullable: true + StartupWizardCompleted: + type: boolean + description: Gets or sets a value indicating whether the startup wizard is completed. + nullable: true + OperatingSystemDisplayName: + type: string + description: Gets or sets the display name of the operating system. + nullable: true + deprecated: true + PackageName: + type: string + description: Gets or sets the package name. + nullable: true + HasPendingRestart: + type: boolean + description: Gets or sets a value indicating whether this instance has pending restart. + IsShuttingDown: + type: boolean + SupportsLibraryMonitor: + type: boolean + description: Gets or sets a value indicating whether [supports library monitor]. + WebSocketPortNumber: + type: integer + description: Gets or sets the web socket port number. + format: int32 + CompletedInstallations: + type: array + items: + $ref: '#/components/schemas/InstallationInfo' + description: Gets or sets the completed installations. + nullable: true + CanSelfRestart: + type: boolean + description: Gets or sets a value indicating whether this instance can self restart. + default: true + deprecated: true + CanLaunchWebBrowser: + type: boolean + default: false + deprecated: true + ProgramDataPath: + type: string + description: Gets or sets the program data path. + nullable: true + WebPath: + type: string + description: Gets or sets the web UI resources path. + nullable: true + ItemsByNamePath: + type: string + description: Gets or sets the items by name path. + nullable: true + CachePath: + type: string + description: Gets or sets the cache path. + nullable: true + LogPath: + type: string + description: Gets or sets the log path. + nullable: true + InternalMetadataPath: + type: string + description: Gets or sets the internal metadata path. + nullable: true + TranscodingTempPath: + type: string + description: Gets or sets the transcode path. + nullable: true + CastReceiverApplications: + type: array + items: + $ref: '#/components/schemas/CastReceiverApplication' + description: Gets or sets the list of cast receiver applications. + nullable: true + HasUpdateAvailable: + type: boolean + description: Gets or sets a value indicating whether this instance has update available. + default: false + deprecated: true + EncoderLocation: + type: string + default: System + nullable: true + deprecated: true + SystemArchitecture: + type: string + default: X64 + nullable: true + deprecated: true + additionalProperties: false + description: Class SystemInfo. + TaskCompletionStatus: + enum: + - Completed + - Failed + - Cancelled + - Aborted + type: string + description: Enum TaskCompletionStatus. + TaskInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + State: + enum: + - Idle + - Cancelling + - Running + allOf: + - $ref: '#/components/schemas/TaskState' + description: Gets or sets the state of the task. + CurrentProgressPercentage: + type: number + description: Gets or sets the progress. + format: double + nullable: true + Id: + type: string + description: Gets or sets the id. + nullable: true + LastExecutionResult: + allOf: + - $ref: '#/components/schemas/TaskResult' + description: Gets or sets the last execution result. + nullable: true + Triggers: + type: array + items: + $ref: '#/components/schemas/TaskTriggerInfo' + description: Gets or sets the triggers. + nullable: true + Description: + type: string + description: Gets or sets the description. + nullable: true + Category: + type: string + description: Gets or sets the category. + nullable: true + IsHidden: + type: boolean + description: Gets or sets a value indicating whether this instance is hidden. + Key: + type: string + description: Gets or sets the key. + nullable: true + additionalProperties: false + description: Class TaskInfo. + TaskResult: + type: object + properties: + StartTimeUtc: + type: string + description: Gets or sets the start time UTC. + format: date-time + EndTimeUtc: + type: string + description: Gets or sets the end time UTC. + format: date-time + Status: + enum: + - Completed + - Failed + - Cancelled + - Aborted + allOf: + - $ref: '#/components/schemas/TaskCompletionStatus' + description: Gets or sets the status. + Name: + type: string + description: Gets or sets the name. + nullable: true + Key: + type: string + description: Gets or sets the key. + nullable: true + Id: + type: string + description: Gets or sets the id. + nullable: true + ErrorMessage: + type: string + description: Gets or sets the error message. + nullable: true + LongErrorMessage: + type: string + description: Gets or sets the long error message. + nullable: true + additionalProperties: false + description: Class TaskExecutionInfo. + TaskState: + enum: + - Idle + - Cancelling + - Running + type: string + description: Enum TaskState. + TaskTriggerInfo: + type: object + properties: + Type: + type: string + description: Gets or sets the type. + nullable: true + TimeOfDayTicks: + type: integer + description: Gets or sets the time of day. + format: int64 + nullable: true + IntervalTicks: + type: integer + description: Gets or sets the interval. + format: int64 + nullable: true + DayOfWeek: + enum: + - Sunday + - Monday + - Tuesday + - Wednesday + - Thursday + - Friday + - Saturday + allOf: + - $ref: '#/components/schemas/DayOfWeek' + description: Gets or sets the day of week. + nullable: true + MaxRuntimeTicks: + type: integer + description: Gets or sets the maximum runtime ticks. + format: int64 + nullable: true + additionalProperties: false + description: Class TaskTriggerInfo. + ThemeMediaResult: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the items. + TotalRecordCount: + type: integer + description: Gets or sets the total number of records available. + format: int32 + StartIndex: + type: integer + description: Gets or sets the index of the first record in Items. + format: int32 + OwnerId: + type: string + description: Gets or sets the owner id. + format: uuid + additionalProperties: false + description: Class ThemeMediaResult. + TimerCancelledMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/TimerEventInfo' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: TimerCancelled + readOnly: true + additionalProperties: false + description: Timer cancelled message. + TimerCreatedMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/TimerEventInfo' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: TimerCreated + readOnly: true + additionalProperties: false + description: Timer created message. + TimerEventInfo: + type: object + properties: + Id: + type: string + ProgramId: + type: string + format: uuid + nullable: true + additionalProperties: false + TimerInfoDto: + type: object + properties: + Id: + type: string + description: Gets or sets the Id of the recording. + nullable: true + Type: + type: string + nullable: true + ServerId: + type: string + description: Gets or sets the server identifier. + nullable: true + ExternalId: + type: string + description: Gets or sets the external identifier. + nullable: true + ChannelId: + type: string + description: Gets or sets the channel id of the recording. + format: uuid + ExternalChannelId: + type: string + description: Gets or sets the external channel identifier. + nullable: true + ChannelName: + type: string + description: Gets or sets the channel name of the recording. + nullable: true + ChannelPrimaryImageTag: + type: string + nullable: true + ProgramId: + type: string + description: Gets or sets the program identifier. + nullable: true + ExternalProgramId: + type: string + description: Gets or sets the external program identifier. + nullable: true + Name: + type: string + description: Gets or sets the name of the recording. + nullable: true + Overview: + type: string + description: Gets or sets the description of the recording. + nullable: true + StartDate: + type: string + description: Gets or sets the start date of the recording, in UTC. + format: date-time + EndDate: + type: string + description: Gets or sets the end date of the recording, in UTC. + format: date-time + ServiceName: + type: string + description: Gets or sets the name of the service. + nullable: true + Priority: + type: integer + description: Gets or sets the priority. + format: int32 + PrePaddingSeconds: + type: integer + description: Gets or sets the pre padding seconds. + format: int32 + PostPaddingSeconds: + type: integer + description: Gets or sets the post padding seconds. + format: int32 + IsPrePaddingRequired: + type: boolean + description: Gets or sets a value indicating whether this instance is pre padding required. + ParentBackdropItemId: + type: string + description: Gets or sets the Id of the Parent that has a backdrop if the item does not have one. + nullable: true + ParentBackdropImageTags: + type: array + items: + type: string + description: Gets or sets the parent backdrop image tags. + nullable: true + IsPostPaddingRequired: + type: boolean + description: Gets or sets a value indicating whether this instance is post padding required. + KeepUntil: + enum: + - UntilDeleted + - UntilSpaceNeeded + - UntilWatched + - UntilDate + allOf: + - $ref: '#/components/schemas/KeepUntil' + Status: + enum: + - New + - InProgress + - Completed + - Cancelled + - ConflictedOk + - ConflictedNotOk + - Error + allOf: + - $ref: '#/components/schemas/RecordingStatus' + description: Gets or sets the status. + SeriesTimerId: + type: string + description: Gets or sets the series timer identifier. + nullable: true + ExternalSeriesTimerId: + type: string + description: Gets or sets the external series timer identifier. + nullable: true + RunTimeTicks: + type: integer + description: Gets or sets the run time ticks. + format: int64 + nullable: true + ProgramInfo: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the program information. + nullable: true + additionalProperties: false + TimerInfoDtoQueryResult: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/TimerInfoDto' + description: Gets or sets the items. + TotalRecordCount: + type: integer + description: Gets or sets the total number of records available. + format: int32 + StartIndex: + type: integer + description: Gets or sets the index of the first record in Items. + format: int32 + additionalProperties: false + description: Query result container. + TonemappingAlgorithm: + enum: + - none + - clip + - linear + - gamma + - reinhard + - hable + - mobius + - bt2390 + type: string + description: Enum containing tonemapping algorithms. + TonemappingMode: + enum: + - auto + - max + - rgb + - lum + - itp + type: string + description: Enum containing tonemapping modes. + TonemappingRange: + enum: + - auto + - tv + - pc + type: string + description: Enum containing tonemapping ranges. + TrailerInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + additionalProperties: false + TrailerInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/TrailerInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + TranscodeReason: + enum: + - ContainerNotSupported + - VideoCodecNotSupported + - AudioCodecNotSupported + - SubtitleCodecNotSupported + - AudioIsExternal + - SecondaryAudioNotSupported + - VideoProfileNotSupported + - VideoLevelNotSupported + - VideoResolutionNotSupported + - VideoBitDepthNotSupported + - VideoFramerateNotSupported + - RefFramesNotSupported + - AnamorphicVideoNotSupported + - InterlacedVideoNotSupported + - AudioChannelsNotSupported + - AudioProfileNotSupported + - AudioSampleRateNotSupported + - AudioBitDepthNotSupported + - ContainerBitrateExceedsLimit + - VideoBitrateNotSupported + - AudioBitrateNotSupported + - UnknownVideoStreamInfo + - UnknownAudioStreamInfo + - DirectPlayError + - VideoRangeTypeNotSupported + - VideoCodecTagNotSupported + type: string + TranscodeSeekInfo: + enum: + - Auto + - Bytes + type: string + TranscodingInfo: + type: object + properties: + AudioCodec: + type: string + description: Gets or sets the thread count used for encoding. + nullable: true + VideoCodec: + type: string + description: Gets or sets the thread count used for encoding. + nullable: true + Container: + type: string + description: Gets or sets the thread count used for encoding. + nullable: true + IsVideoDirect: + type: boolean + description: Gets or sets a value indicating whether the video is passed through. + IsAudioDirect: + type: boolean + description: Gets or sets a value indicating whether the audio is passed through. + Bitrate: + type: integer + description: Gets or sets the bitrate. + format: int32 + nullable: true + Framerate: + type: number + description: Gets or sets the framerate. + format: float + nullable: true + CompletionPercentage: + type: number + description: Gets or sets the completion percentage. + format: double + nullable: true + Width: + type: integer + description: Gets or sets the video width. + format: int32 + nullable: true + Height: + type: integer + description: Gets or sets the video height. + format: int32 + nullable: true + AudioChannels: + type: integer + description: Gets or sets the audio channels. + format: int32 + nullable: true + HardwareAccelerationType: + enum: + - none + - amf + - qsv + - nvenc + - v4l2m2m + - vaapi + - videotoolbox + - rkmpp + allOf: + - $ref: '#/components/schemas/HardwareAccelerationType' + description: Gets or sets the hardware acceleration type. + nullable: true + TranscodeReasons: + type: array + items: + $ref: '#/components/schemas/TranscodeReason' + description: Gets or sets the transcode reasons. + additionalProperties: false + description: Class holding information on a runnning transcode. + TranscodingProfile: + type: object + properties: + Container: + type: string + description: Gets or sets the container. + Type: + enum: + - Audio + - Video + - Photo + - Subtitle + - Lyric + allOf: + - $ref: '#/components/schemas/DlnaProfileType' + description: Gets or sets the DLNA profile type. + VideoCodec: + type: string + description: Gets or sets the video codec. + AudioCodec: + type: string + description: Gets or sets the audio codec. + Protocol: + enum: + - http + - hls + allOf: + - $ref: '#/components/schemas/MediaStreamProtocol' + description: Gets or sets the protocol. + EstimateContentLength: + type: boolean + description: Gets or sets a value indicating whether the content length should be estimated. + default: false + EnableMpegtsM2TsMode: + type: boolean + description: Gets or sets a value indicating whether M2TS mode is enabled. + default: false + TranscodeSeekInfo: + enum: + - Auto + - Bytes + allOf: + - $ref: '#/components/schemas/TranscodeSeekInfo' + description: Gets or sets the transcoding seek info mode. + default: Auto + CopyTimestamps: + type: boolean + description: Gets or sets a value indicating whether timestamps should be copied. + default: false + Context: + enum: + - Streaming + - Static + allOf: + - $ref: '#/components/schemas/EncodingContext' + description: Gets or sets the encoding context. + default: Streaming + EnableSubtitlesInManifest: + type: boolean + description: Gets or sets a value indicating whether subtitles are allowed in the manifest. + default: false + MaxAudioChannels: + type: string + description: Gets or sets the maximum audio channels. + nullable: true + MinSegments: + type: integer + description: Gets or sets the minimum amount of segments. + format: int32 + default: 0 + SegmentLength: + type: integer + description: Gets or sets the segment length. + format: int32 + default: 0 + BreakOnNonKeyFrames: + type: boolean + description: Gets or sets a value indicating whether breaking the video stream on non-keyframes is supported. + default: false + Conditions: + type: array + items: + $ref: '#/components/schemas/ProfileCondition' + description: Gets or sets the profile conditions. + EnableAudioVbrEncoding: + type: boolean + description: Gets or sets a value indicating whether variable bitrate encoding is supported. + default: true + additionalProperties: false + description: "A class for transcoding profile information.\r\nNote for client developers: Conditions defined in MediaBrowser.Model.Dlna.CodecProfile has higher priority and can override values defined here." + TransportStreamTimestamp: + enum: + - None + - Zero + - Valid + type: string + TrickplayInfo: + type: object + properties: + Width: + type: integer + description: Gets or sets width of an individual thumbnail. + format: int32 + Height: + type: integer + description: Gets or sets height of an individual thumbnail. + format: int32 + TileWidth: + type: integer + description: Gets or sets amount of thumbnails per row. + format: int32 + TileHeight: + type: integer + description: Gets or sets amount of thumbnails per column. + format: int32 + ThumbnailCount: + type: integer + description: Gets or sets total amount of non-black thumbnails. + format: int32 + Interval: + type: integer + description: Gets or sets interval in milliseconds between each trickplay thumbnail. + format: int32 + Bandwidth: + type: integer + description: Gets or sets peak bandwith usage in bits per second. + format: int32 + additionalProperties: false + description: An entity representing the metadata for a group of trickplay tiles. + TrickplayOptions: + type: object + properties: + EnableHwAcceleration: + type: boolean + description: Gets or sets a value indicating whether or not to use HW acceleration. + EnableHwEncoding: + type: boolean + description: Gets or sets a value indicating whether or not to use HW accelerated MJPEG encoding. + EnableKeyFrameOnlyExtraction: + type: boolean + description: "Gets or sets a value indicating whether to only extract key frames.\r\nSignificantly faster, but is not compatible with all decoders and/or video files." + ScanBehavior: + enum: + - Blocking + - NonBlocking + allOf: + - $ref: '#/components/schemas/TrickplayScanBehavior' + description: Gets or sets the behavior used by trickplay provider on library scan/update. + ProcessPriority: + enum: + - Normal + - Idle + - High + - RealTime + - BelowNormal + - AboveNormal + allOf: + - $ref: '#/components/schemas/ProcessPriorityClass' + description: Gets or sets the process priority for the ffmpeg process. + Interval: + type: integer + description: Gets or sets the interval, in ms, between each new trickplay image. + format: int32 + WidthResolutions: + type: array + items: + type: integer + format: int32 + description: Gets or sets the target width resolutions, in px, to generates preview images for. + TileWidth: + type: integer + description: Gets or sets number of tile images to allow in X dimension. + format: int32 + TileHeight: + type: integer + description: Gets or sets number of tile images to allow in Y dimension. + format: int32 + Qscale: + type: integer + description: Gets or sets the ffmpeg output quality level. + format: int32 + JpegQuality: + type: integer + description: Gets or sets the jpeg quality to use for image tiles. + format: int32 + ProcessThreads: + type: integer + description: Gets or sets the number of threads to be used by ffmpeg. + format: int32 + additionalProperties: false + description: Class TrickplayOptions. + TrickplayScanBehavior: + enum: + - Blocking + - NonBlocking + type: string + description: Enum TrickplayScanBehavior. + TunerChannelMapping: + type: object + properties: + Name: + type: string + nullable: true + ProviderChannelName: + type: string + nullable: true + ProviderChannelId: + type: string + nullable: true + Id: + type: string + nullable: true + additionalProperties: false + TunerHostInfo: + type: object + properties: + Id: + type: string + nullable: true + Url: + type: string + nullable: true + Type: + type: string + nullable: true + DeviceId: + type: string + nullable: true + FriendlyName: + type: string + nullable: true + ImportFavoritesOnly: + type: boolean + AllowHWTranscoding: + type: boolean + AllowFmp4TranscodingContainer: + type: boolean + AllowStreamSharing: + type: boolean + FallbackMaxStreamingBitrate: + type: integer + format: int32 + EnableStreamLooping: + type: boolean + Source: + type: string + nullable: true + TunerCount: + type: integer + format: int32 + UserAgent: + type: string + nullable: true + IgnoreDts: + type: boolean + additionalProperties: false + TypeOptions: + type: object + properties: + Type: + type: string + nullable: true + MetadataFetchers: + type: array + items: + type: string + nullable: true + MetadataFetcherOrder: + type: array + items: + type: string + nullable: true + ImageFetchers: + type: array + items: + type: string + nullable: true + ImageFetcherOrder: + type: array + items: + type: string + nullable: true + ImageOptions: + type: array + items: + $ref: '#/components/schemas/ImageOption' + nullable: true + additionalProperties: false + UnratedItem: + enum: + - Movie + - Trailer + - Series + - Music + - Book + - LiveTvChannel + - LiveTvProgram + - ChannelContent + - Other + type: string + description: An enum representing an unrated item. + UpdateLibraryOptionsDto: + type: object + properties: + Id: + type: string + description: Gets or sets the library item id. + format: uuid + LibraryOptions: + allOf: + - $ref: '#/components/schemas/LibraryOptions' + description: Gets or sets library options. + nullable: true + additionalProperties: false + description: Update library options dto. + UpdateMediaPathRequestDto: + required: + - Name + - PathInfo + type: object + properties: + Name: + type: string + description: Gets or sets the library name. + PathInfo: + allOf: + - $ref: '#/components/schemas/MediaPathInfo' + description: Gets or sets library folder path information. + additionalProperties: false + description: Update library options dto. + UpdatePlaylistDto: + type: object + properties: + Name: + type: string + description: Gets or sets the name of the new playlist. + nullable: true + Ids: + type: array + items: + type: string + format: uuid + description: Gets or sets item ids of the playlist. + nullable: true + Users: + type: array + items: + $ref: '#/components/schemas/PlaylistUserPermissions' + description: Gets or sets the playlist users. + nullable: true + IsPublic: + type: boolean + description: Gets or sets a value indicating whether the playlist is public. + nullable: true + additionalProperties: false + description: Update existing playlist dto. Fields set to `null` will not be updated and keep their current values. + UpdatePlaylistUserDto: + type: object + properties: + CanEdit: + type: boolean + description: Gets or sets a value indicating whether the user can edit the playlist. + nullable: true + additionalProperties: false + description: Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values. + UpdateUserItemDataDto: + type: object + properties: + Rating: + type: number + description: Gets or sets the rating. + format: double + nullable: true + PlayedPercentage: + type: number + description: Gets or sets the played percentage. + format: double + nullable: true + UnplayedItemCount: + type: integer + description: Gets or sets the unplayed item count. + format: int32 + nullable: true + PlaybackPositionTicks: + type: integer + description: Gets or sets the playback position ticks. + format: int64 + nullable: true + PlayCount: + type: integer + description: Gets or sets the play count. + format: int32 + nullable: true + IsFavorite: + type: boolean + description: Gets or sets a value indicating whether this instance is favorite. + nullable: true + Likes: + type: boolean + description: Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UpdateUserItemDataDto is likes. + nullable: true + LastPlayedDate: + type: string + description: Gets or sets the last played date. + format: date-time + nullable: true + Played: + type: boolean + description: Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played. + nullable: true + Key: + type: string + description: Gets or sets the key. + nullable: true + ItemId: + type: string + description: Gets or sets the item identifier. + nullable: true + additionalProperties: false + description: This is used by the api to get information about a item user data. + UpdateUserPassword: + type: object + properties: + CurrentPassword: + type: string + description: Gets or sets the current sha1-hashed password. + nullable: true + CurrentPw: + type: string + description: Gets or sets the current plain text password. + nullable: true + NewPw: + type: string + description: Gets or sets the new plain text password. + nullable: true + ResetPassword: + type: boolean + description: Gets or sets a value indicating whether to reset the password. + additionalProperties: false + description: The update user password request body. + UploadSubtitleDto: + required: + - Data + - Format + - IsForced + - IsHearingImpaired + - Language + type: object + properties: + Language: + type: string + description: Gets or sets the subtitle language. + Format: + type: string + description: Gets or sets the subtitle format. + IsForced: + type: boolean + description: Gets or sets a value indicating whether the subtitle is forced. + IsHearingImpaired: + type: boolean + description: Gets or sets a value indicating whether the subtitle is for hearing impaired. + Data: + type: string + description: Gets or sets the subtitle data. + additionalProperties: false + description: Upload subtitles dto. + UserConfiguration: + type: object + properties: + AudioLanguagePreference: + type: string + description: Gets or sets the audio language preference. + nullable: true + PlayDefaultAudioTrack: + type: boolean + description: Gets or sets a value indicating whether [play default audio track]. + SubtitleLanguagePreference: + type: string + description: Gets or sets the subtitle language preference. + nullable: true + DisplayMissingEpisodes: + type: boolean + GroupedFolders: + type: array + items: + type: string + format: uuid + SubtitleMode: + enum: + - Default + - Always + - OnlyForced + - None + - Smart + allOf: + - $ref: '#/components/schemas/SubtitlePlaybackMode' + description: An enum representing a subtitle playback mode. + DisplayCollectionsView: + type: boolean + EnableLocalPassword: + type: boolean + OrderedViews: + type: array + items: + type: string + format: uuid + LatestItemsExcludes: + type: array + items: + type: string + format: uuid + MyMediaExcludes: + type: array + items: + type: string + format: uuid + HidePlayedInLatest: + type: boolean + RememberAudioSelections: + type: boolean + RememberSubtitleSelections: + type: boolean + EnableNextEpisodeAutoPlay: + type: boolean + CastReceiverId: + type: string + description: Gets or sets the id of the selected cast receiver. + nullable: true + additionalProperties: false + description: Class UserConfiguration. + UserDataChangedMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/UserDataChangeInfo' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: UserDataChanged + readOnly: true + additionalProperties: false + description: User data changed message. + UserDataChangeInfo: + type: object + properties: + UserId: + type: string + description: Gets or sets the user id. + format: uuid + UserDataList: + type: array + items: + $ref: '#/components/schemas/UserItemDataDto' + description: Gets or sets the user data list. + additionalProperties: false + description: Class UserDataChangeInfo. + UserDeletedMessage: + type: object + properties: + Data: + type: string + description: Gets or sets the data. + format: uuid + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: UserDeleted + readOnly: true + additionalProperties: false + description: User deleted message. + UserDto: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + ServerId: + type: string + description: Gets or sets the server identifier. + nullable: true + ServerName: + type: string + description: "Gets or sets the name of the server.\r\nThis is not used by the server and is for client-side usage only." + nullable: true + Id: + type: string + description: Gets or sets the id. + format: uuid + PrimaryImageTag: + type: string + description: Gets or sets the primary image tag. + nullable: true + HasPassword: + type: boolean + description: Gets or sets a value indicating whether this instance has password. + HasConfiguredPassword: + type: boolean + description: Gets or sets a value indicating whether this instance has configured password. + HasConfiguredEasyPassword: + type: boolean + description: Gets or sets a value indicating whether this instance has configured easy password. + deprecated: true + EnableAutoLogin: + type: boolean + description: Gets or sets whether async login is enabled or not. + nullable: true + LastLoginDate: + type: string + description: Gets or sets the last login date. + format: date-time + nullable: true + LastActivityDate: + type: string + description: Gets or sets the last activity date. + format: date-time + nullable: true + Configuration: + allOf: + - $ref: '#/components/schemas/UserConfiguration' + description: Gets or sets the configuration. + nullable: true + Policy: + allOf: + - $ref: '#/components/schemas/UserPolicy' + description: Gets or sets the policy. + nullable: true + PrimaryImageAspectRatio: + type: number + description: Gets or sets the primary image aspect ratio. + format: double + nullable: true + additionalProperties: false + description: Class UserDto. + UserItemDataDto: + type: object + properties: + Rating: + type: number + description: Gets or sets the rating. + format: double + nullable: true + PlayedPercentage: + type: number + description: Gets or sets the played percentage. + format: double + nullable: true + UnplayedItemCount: + type: integer + description: Gets or sets the unplayed item count. + format: int32 + nullable: true + PlaybackPositionTicks: + type: integer + description: Gets or sets the playback position ticks. + format: int64 + PlayCount: + type: integer + description: Gets or sets the play count. + format: int32 + IsFavorite: + type: boolean + description: Gets or sets a value indicating whether this instance is favorite. + Likes: + type: boolean + description: Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is likes. + nullable: true + LastPlayedDate: + type: string + description: Gets or sets the last played date. + format: date-time + nullable: true + Played: + type: boolean + description: Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played. + Key: + type: string + description: Gets or sets the key. + ItemId: + type: string + description: Gets or sets the item identifier. + format: uuid + additionalProperties: false + description: Class UserItemDataDto. + UserPolicy: + required: + - AuthenticationProviderId + - PasswordResetProviderId + type: object + properties: + IsAdministrator: + type: boolean + description: Gets or sets a value indicating whether this instance is administrator. + IsHidden: + type: boolean + description: Gets or sets a value indicating whether this instance is hidden. + EnableCollectionManagement: + type: boolean + description: Gets or sets a value indicating whether this instance can manage collections. + default: false + EnableSubtitleManagement: + type: boolean + description: Gets or sets a value indicating whether this instance can manage subtitles. + default: false + EnableLyricManagement: + type: boolean + description: Gets or sets a value indicating whether this user can manage lyrics. + default: false + IsDisabled: + type: boolean + description: Gets or sets a value indicating whether this instance is disabled. + MaxParentalRating: + type: integer + description: Gets or sets the max parental rating. + format: int32 + nullable: true + BlockedTags: + type: array + items: + type: string + nullable: true + AllowedTags: + type: array + items: + type: string + nullable: true + EnableUserPreferenceAccess: + type: boolean + AccessSchedules: + type: array + items: + $ref: '#/components/schemas/AccessSchedule' + nullable: true + BlockUnratedItems: + type: array + items: + $ref: '#/components/schemas/UnratedItem' + nullable: true + EnableRemoteControlOfOtherUsers: + type: boolean + EnableSharedDeviceControl: + type: boolean + EnableRemoteAccess: + type: boolean + EnableLiveTvManagement: + type: boolean + EnableLiveTvAccess: + type: boolean + EnableMediaPlayback: + type: boolean + EnableAudioPlaybackTranscoding: + type: boolean + EnableVideoPlaybackTranscoding: + type: boolean + EnablePlaybackRemuxing: + type: boolean + ForceRemoteSourceTranscoding: + type: boolean + EnableContentDeletion: + type: boolean + EnableContentDeletionFromFolders: + type: array + items: + type: string + nullable: true + EnableContentDownloading: + type: boolean + EnableSyncTranscoding: + type: boolean + description: Gets or sets a value indicating whether [enable synchronize]. + EnableMediaConversion: + type: boolean + EnabledDevices: + type: array + items: + type: string + nullable: true + EnableAllDevices: + type: boolean + EnabledChannels: + type: array + items: + type: string + format: uuid + nullable: true + EnableAllChannels: + type: boolean + EnabledFolders: + type: array + items: + type: string + format: uuid + nullable: true + EnableAllFolders: + type: boolean + InvalidLoginAttemptCount: + type: integer + format: int32 + LoginAttemptsBeforeLockout: + type: integer + format: int32 + MaxActiveSessions: + type: integer + format: int32 + EnablePublicSharing: + type: boolean + BlockedMediaFolders: + type: array + items: + type: string + format: uuid + nullable: true + BlockedChannels: + type: array + items: + type: string + format: uuid + nullable: true + RemoteClientBitrateLimit: + type: integer + format: int32 + AuthenticationProviderId: + type: string + PasswordResetProviderId: + type: string + SyncPlayAccess: + enum: + - CreateAndJoinGroups + - JoinGroups + - None + allOf: + - $ref: '#/components/schemas/SyncPlayUserAccessType' + description: Gets or sets a value indicating what SyncPlay features the user can access. + additionalProperties: false + UserUpdatedMessage: + type: object + properties: + Data: + allOf: + - $ref: '#/components/schemas/UserDto' + description: Gets or sets the data. + nullable: true + MessageId: + type: string + description: Gets or sets the message id. + format: uuid + MessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + allOf: + - $ref: '#/components/schemas/SessionMessageType' + description: The different kinds of messages that are used in the WebSocket api. + default: UserUpdated + readOnly: true + additionalProperties: false + description: User updated message. + UtcTimeResponse: + type: object + properties: + RequestReceptionTime: + type: string + description: Gets the UTC time when request has been received. + format: date-time + ResponseTransmissionTime: + type: string + description: Gets the UTC time when response has been sent. + format: date-time + additionalProperties: false + description: Class UtcTimeResponse. + ValidatePathDto: + type: object + properties: + ValidateWritable: + type: boolean + description: Gets or sets a value indicating whether validate if path is writable. + Path: + type: string + description: Gets or sets the path. + nullable: true + IsFile: + type: boolean + description: Gets or sets is path file. + nullable: true + additionalProperties: false + description: Validate path object. + VersionInfo: + type: object + properties: + version: + type: string + description: Gets or sets the version. + VersionNumber: + type: string + description: Gets the version as a System.Version. + readOnly: true + changelog: + type: string + description: Gets or sets the changelog for this version. + nullable: true + targetAbi: + type: string + description: Gets or sets the ABI that this version was built against. + nullable: true + sourceUrl: + type: string + description: Gets or sets the source URL. + nullable: true + checksum: + type: string + description: Gets or sets a checksum for the binary. + nullable: true + timestamp: + type: string + description: Gets or sets a timestamp of when the binary was built. + nullable: true + repositoryName: + type: string + description: Gets or sets the repository name. + repositoryUrl: + type: string + description: Gets or sets the repository url. + additionalProperties: false + description: Defines the MediaBrowser.Model.Updates.VersionInfo class. + Video3DFormat: + enum: + - HalfSideBySide + - FullSideBySide + - FullTopAndBottom + - HalfTopAndBottom + - MVC + type: string + VideoRange: + enum: + - Unknown + - SDR + - HDR + type: string + description: An enum representing video ranges. + VideoRangeType: + enum: + - Unknown + - SDR + - HDR10 + - HLG + - DOVI + - DOVIWithHDR10 + - DOVIWithHLG + - DOVIWithSDR + - HDR10Plus + type: string + description: An enum representing types of video ranges. + VideoType: + enum: + - VideoFile + - Iso + - Dvd + - BluRay + type: string + description: Enum VideoType. + VirtualFolderInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Locations: + type: array + items: + type: string + description: Gets or sets the locations. + nullable: true + CollectionType: + enum: + - movies + - tvshows + - music + - musicvideos + - homevideos + - boxsets + - books + - mixed + allOf: + - $ref: '#/components/schemas/CollectionTypeOptions' + description: Gets or sets the type of the collection. + nullable: true + LibraryOptions: + allOf: + - $ref: '#/components/schemas/LibraryOptions' + nullable: true + ItemId: + type: string + description: Gets or sets the item identifier. + nullable: true + PrimaryImageItemId: + type: string + description: Gets or sets the primary image item identifier. + nullable: true + RefreshProgress: + type: number + format: double + nullable: true + RefreshStatus: + type: string + nullable: true + additionalProperties: false + description: Used to hold information about a user's list of configured virtual folders. + WakeOnLanInfo: + type: object + properties: + MacAddress: + type: string + description: Gets the MAC address of the device. + nullable: true + Port: + type: integer + description: Gets or sets the wake-on-LAN port. + format: int32 + additionalProperties: false + description: Provides the MAC address and port for wake-on-LAN functionality. + WebSocketMessage: + type: object + oneOf: + - $ref: '#/components/schemas/InboundWebSocketMessage' + - $ref: '#/components/schemas/OutboundWebSocketMessage' + description: Represents the possible websocket types + XbmcMetadataOptions: + type: object + properties: + UserId: + type: string + nullable: true + ReleaseDateFormat: + type: string + SaveImagePathsInNfo: + type: boolean + EnablePathSubstitution: + type: boolean + EnableExtraThumbsDuplication: + type: boolean + additionalProperties: false + securitySchemes: + CustomAuthentication: + type: apiKey + description: API key header parameter + name: Authorization + in: header diff --git a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/yaml/jellyfin-openapi-10.11.0.yaml b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/yaml/jellyfin-openapi-10.11.0.yaml new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/yaml/jellyfin-openapi-10.8.13.yaml b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/yaml/jellyfin-openapi-10.8.13.yaml new file mode 100644 index 0000000000000..cb21672520637 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/specifications/yaml/jellyfin-openapi-10.8.13.yaml @@ -0,0 +1,35824 @@ +openapi: 3.0.1 +info: + title: Jellyfin API + version: 10.8.13 + x-jellyfin-version: 10.8.13 +servers: + - url: http://localhost +paths: + /System/ActivityLog/Entries: + get: + tags: + - ActivityLog + summary: Gets activity log entries. + operationId: GetLogEntries + parameters: + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: minDate + in: query + description: Optional. The minimum date. Format = ISO. + schema: + type: string + format: date-time + - name: hasUserId + in: query + description: Optional. Filter log entries if it has user id, or not. + schema: + type: boolean + responses: + "200": + description: Activity log returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ActivityLogEntryQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ActivityLogEntryQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ActivityLogEntryQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Auth/Keys: + get: + tags: + - ApiKey + summary: Get all keys. + operationId: GetKeys + responses: + "200": + description: Api keys retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/AuthenticationInfoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/AuthenticationInfoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + post: + tags: + - ApiKey + summary: Create a new api key. + operationId: CreateKey + parameters: + - name: app + in: query + description: Name of the app using the authentication key. + required: true + schema: + type: string + responses: + "204": + description: Api key created. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Auth/Keys/{key}: + delete: + tags: + - ApiKey + summary: Remove an api key. + operationId: RevokeKey + parameters: + - name: key + in: path + description: The access token to delete. + required: true + schema: + type: string + responses: + "204": + description: Api key deleted. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Artists: + get: + tags: + - Artists + summary: Gets all artists from a given item, folder, or the entire library. + operationId: GetArtists + parameters: + - name: minCommunityRating + in: query + description: Optional filter by minimum community rating. + schema: + type: number + format: double + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: searchTerm + in: query + description: Optional. Search term. + schema: + type: string + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: filters + in: query + description: Optional. Specify additional filters to apply. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFilter' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. + schema: + type: boolean + - name: mediaTypes + in: query + description: Optional filter by MediaType. Allows multiple, comma delimited. + schema: + type: array + items: + type: string + - name: genres + in: query + description: Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: genreIds + in: query + description: Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: officialRatings + in: query + description: Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: tags + in: query + description: Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: years + in: query + description: Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. + schema: + type: array + items: + type: integer + format: int32 + - name: enableUserData + in: query + description: Optional, include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: person + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person. + schema: + type: string + - name: personIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person ids. + schema: + type: array + items: + type: string + format: uuid + - name: personTypes + in: query + description: Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. + schema: + type: array + items: + type: string + - name: studios + in: query + description: Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: studioIds + in: query + description: Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: nameStartsWithOrGreater + in: query + description: Optional filter by items whose name is sorted equally or greater than a given input string. + schema: + type: string + - name: nameStartsWith + in: query + description: Optional filter by items whose name is sorted equally than a given input string. + schema: + type: string + - name: nameLessThan + in: query + description: Optional filter by items whose name is equally or lesser than a given input string. + schema: + type: string + - name: sortBy + in: query + description: Optional. Specify one or more sort orders, comma delimited. + schema: + type: array + items: + type: string + - name: sortOrder + in: query + description: Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + - name: enableTotalRecordCount + in: query + description: Total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Artists returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Artists/{name}: + get: + tags: + - Artists + summary: Gets an artist by name. + operationId: GetArtistByName + parameters: + - name: name + in: path + description: Studio name. + required: true + schema: + type: string + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Artist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Artists/AlbumArtists: + get: + tags: + - Artists + summary: Gets all album artists from a given item, folder, or the entire library. + operationId: GetAlbumArtists + parameters: + - name: minCommunityRating + in: query + description: Optional filter by minimum community rating. + schema: + type: number + format: double + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: searchTerm + in: query + description: Optional. Search term. + schema: + type: string + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: filters + in: query + description: Optional. Specify additional filters to apply. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFilter' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. + schema: + type: boolean + - name: mediaTypes + in: query + description: Optional filter by MediaType. Allows multiple, comma delimited. + schema: + type: array + items: + type: string + - name: genres + in: query + description: Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: genreIds + in: query + description: Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: officialRatings + in: query + description: Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: tags + in: query + description: Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: years + in: query + description: Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. + schema: + type: array + items: + type: integer + format: int32 + - name: enableUserData + in: query + description: Optional, include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: person + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person. + schema: + type: string + - name: personIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person ids. + schema: + type: array + items: + type: string + format: uuid + - name: personTypes + in: query + description: Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. + schema: + type: array + items: + type: string + - name: studios + in: query + description: Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: studioIds + in: query + description: Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: nameStartsWithOrGreater + in: query + description: Optional filter by items whose name is sorted equally or greater than a given input string. + schema: + type: string + - name: nameStartsWith + in: query + description: Optional filter by items whose name is sorted equally than a given input string. + schema: + type: string + - name: nameLessThan + in: query + description: Optional filter by items whose name is equally or lesser than a given input string. + schema: + type: string + - name: sortBy + in: query + description: Optional. Specify one or more sort orders, comma delimited. + schema: + type: array + items: + type: string + - name: sortOrder + in: query + description: Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + - name: enableTotalRecordCount + in: query + description: Total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Album artists returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Audio/{itemId}/stream: + get: + tags: + - Audio + summary: Gets an audio stream. + operationId: GetAudioStream + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: query + description: The audio container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + responses: + "200": + description: Audio stream returned. + content: + audio/*: + schema: + type: string + format: binary + head: + tags: + - Audio + summary: Gets an audio stream. + operationId: HeadAudioStream + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: query + description: The audio container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + responses: + "200": + description: Audio stream returned. + content: + audio/*: + schema: + type: string + format: binary + /Audio/{itemId}/stream.{container}: + get: + tags: + - Audio + summary: Gets an audio stream. + operationId: GetAudioStreamByContainer + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: path + description: The audio container. + required: true + schema: + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment lenght. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamporphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + responses: + "200": + description: Audio stream returned. + content: + audio/*: + schema: + type: string + format: binary + head: + tags: + - Audio + summary: Gets an audio stream. + operationId: HeadAudioStreamByContainer + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: path + description: The audio container. + required: true + schema: + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment lenght. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamporphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + responses: + "200": + description: Audio stream returned. + content: + audio/*: + schema: + type: string + format: binary + /Branding/Configuration: + get: + tags: + - Branding + summary: Gets branding configuration. + operationId: GetBrandingOptions + responses: + "200": + description: Branding configuration returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BrandingOptions' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BrandingOptions' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BrandingOptions' + /Branding/Css: + get: + tags: + - Branding + summary: Gets branding css. + operationId: GetBrandingCss + responses: + "200": + description: Branding css returned. + content: + text/css: + schema: + type: string + application/json: + schema: + type: string + application/json; profile="CamelCase": + schema: + type: string + application/json; profile="PascalCase": + schema: + type: string + "204": + description: No branding css configured. + /Branding/Css.css: + get: + tags: + - Branding + summary: Gets branding css. + operationId: GetBrandingCss_2 + responses: + "200": + description: Branding css returned. + content: + text/css: + schema: + type: string + application/json: + schema: + type: string + application/json; profile="CamelCase": + schema: + type: string + application/json; profile="PascalCase": + schema: + type: string + "204": + description: No branding css configured. + /Channels: + get: + tags: + - Channels + summary: Gets available channels. + operationId: GetChannels + parameters: + - name: userId + in: query + description: User Id to filter by. Use System.Guid.Empty to not filter by user. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: supportsLatestItems + in: query + description: Optional. Filter by channels that support getting latest items. + schema: + type: boolean + - name: supportsMediaDeletion + in: query + description: Optional. Filter by channels that support media deletion. + schema: + type: boolean + - name: isFavorite + in: query + description: Optional. Filter by channels that are favorite. + schema: + type: boolean + responses: + "200": + description: Channels returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Channels/{channelId}/Features: + get: + tags: + - Channels + summary: Get channel features. + operationId: GetChannelFeatures + parameters: + - name: channelId + in: path + description: Channel id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Channel features returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ChannelFeatures' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ChannelFeatures' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ChannelFeatures' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Channels/{channelId}/Items: + get: + tags: + - Channels + summary: Get channel items. + operationId: GetChannelItems + parameters: + - name: channelId + in: path + description: Channel Id. + required: true + schema: + type: string + format: uuid + - name: folderId + in: query + description: Optional. Folder Id. + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. User Id. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: sortOrder + in: query + description: Optional. Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: filters + in: query + description: Optional. Specify additional filters to apply. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFilter' + - name: sortBy + in: query + description: 'Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.' + schema: + type: array + items: + type: string + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + responses: + "200": + description: Channel items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Channels/Features: + get: + tags: + - Channels + summary: Get all channel features. + operationId: GetAllChannelFeatures + responses: + "200": + description: All channel features returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChannelFeatures' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/ChannelFeatures' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/ChannelFeatures' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Channels/Items/Latest: + get: + tags: + - Channels + summary: Gets latest channel items. + operationId: GetLatestChannelItems + parameters: + - name: userId + in: query + description: Optional. User Id. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: filters + in: query + description: Optional. Specify additional filters to apply. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFilter' + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: channelIds + in: query + description: Optional. Specify one or more channel id's, comma delimited. + schema: + type: array + items: + type: string + format: uuid + responses: + "200": + description: Latest channel items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /ClientLog/Document: + post: + tags: + - ClientLog + summary: Upload a document. + operationId: LogFile + requestBody: + content: + text/plain: + schema: + type: string + format: binary + responses: + "200": + description: Document saved. + content: + application/json: + schema: + $ref: '#/components/schemas/ClientLogDocumentResponseDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ClientLogDocumentResponseDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ClientLogDocumentResponseDto' + "403": + description: Event logging disabled. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "413": + description: Upload size too large. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + /Collections: + post: + tags: + - Collection + summary: Creates a new collection. + operationId: CreateCollection + parameters: + - name: name + in: query + description: The name of the collection. + schema: + type: string + - name: ids + in: query + description: Item Ids to add to the collection. + schema: + type: array + items: + type: string + - name: parentId + in: query + description: Optional. Create the collection within a specific folder. + schema: + type: string + format: uuid + - name: isLocked + in: query + description: Whether or not to lock the new collection. + schema: + type: boolean + default: false + responses: + "200": + description: Collection created. + content: + application/json: + schema: + $ref: '#/components/schemas/CollectionCreationResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/CollectionCreationResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/CollectionCreationResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Collections/{collectionId}/Items: + post: + tags: + - Collection + summary: Adds items to a collection. + operationId: AddToCollection + parameters: + - name: collectionId + in: path + description: The collection id. + required: true + schema: + type: string + format: uuid + - name: ids + in: query + description: Item ids, comma delimited. + required: true + schema: + type: array + items: + type: string + format: uuid + responses: + "204": + description: Items added to collection. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - Collection + summary: Removes items from a collection. + operationId: RemoveFromCollection + parameters: + - name: collectionId + in: path + description: The collection id. + required: true + schema: + type: string + format: uuid + - name: ids + in: query + description: Item ids, comma delimited. + required: true + schema: + type: array + items: + type: string + format: uuid + responses: + "204": + description: Items removed from collection. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /System/Configuration: + get: + tags: + - Configuration + summary: Gets application configuration. + operationId: GetConfiguration + responses: + "200": + description: Application configuration returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ServerConfiguration' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ServerConfiguration' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ServerConfiguration' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + post: + tags: + - Configuration + summary: Updates application configuration. + operationId: UpdateConfiguration + requestBody: + description: Configuration. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ServerConfiguration' + description: Represents the server configuration. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/ServerConfiguration' + description: Represents the server configuration. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/ServerConfiguration' + description: Represents the server configuration. + required: true + responses: + "204": + description: Configuration updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /System/Configuration/{key}: + get: + tags: + - Configuration + summary: Gets a named configuration. + operationId: GetNamedConfiguration + parameters: + - name: key + in: path + description: Configuration key. + required: true + schema: + type: string + responses: + "200": + description: Configuration returned. + content: + application/json: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + post: + tags: + - Configuration + summary: Updates named configuration. + operationId: UpdateNamedConfiguration + parameters: + - name: key + in: path + description: Configuration key. + required: true + schema: + type: string + requestBody: + description: Configuration. + content: + application/json: + schema: {} + text/json: + schema: {} + application/*+json: + schema: {} + required: true + responses: + "204": + description: Named configuration updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /System/Configuration/MetadataOptions/Default: + get: + tags: + - Configuration + summary: Gets a default MetadataOptions object. + operationId: GetDefaultMetadataOptions + responses: + "200": + description: Metadata options returned. + content: + application/json: + schema: + $ref: '#/components/schemas/MetadataOptions' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/MetadataOptions' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/MetadataOptions' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /System/MediaEncoder/Path: + post: + tags: + - Configuration + summary: Updates the path to the media encoder. + operationId: UpdateMediaEncoderPath + requestBody: + description: Media encoder path form body. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/MediaEncoderPathDto' + description: Media Encoder Path Dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/MediaEncoderPathDto' + description: Media Encoder Path Dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/MediaEncoderPathDto' + description: Media Encoder Path Dto. + required: true + responses: + "204": + description: Media encoder path updated. + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + - DefaultAuthorization + /web/ConfigurationPage: + get: + tags: + - Dashboard + summary: Gets a dashboard configuration page. + operationId: GetDashboardConfigurationPage + parameters: + - name: name + in: query + description: The name of the page. + schema: + type: string + responses: + "200": + description: ConfigurationPage returned. + content: + text/html: + schema: + type: string + format: binary + application/x-javascript: + schema: + type: string + format: binary + "404": + description: Plugin configuration page not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /web/ConfigurationPages: + get: + tags: + - Dashboard + summary: Gets the configuration pages. + operationId: GetConfigurationPages + parameters: + - name: enableInMainMenu + in: query + description: Whether to enable in the main menu. + schema: + type: boolean + responses: + "200": + description: ConfigurationPages returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ConfigurationPageInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/ConfigurationPageInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/ConfigurationPageInfo' + "404": + description: Server still loading. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Devices: + get: + tags: + - Devices + summary: Get Devices. + operationId: GetDevices + parameters: + - name: supportsSync + in: query + description: Gets or sets a value indicating whether [supports synchronize]. + schema: + type: boolean + - name: userId + in: query + description: Gets or sets the user identifier. + schema: + type: string + format: uuid + responses: + "200": + description: Devices retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceInfoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/DeviceInfoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/DeviceInfoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + delete: + tags: + - Devices + summary: Deletes a device. + operationId: DeleteDevice + parameters: + - name: id + in: query + description: Device Id. + required: true + schema: + type: string + responses: + "204": + description: Device deleted. + "404": + description: Device not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Devices/Info: + get: + tags: + - Devices + summary: Get info for a device. + operationId: GetDeviceInfo + parameters: + - name: id + in: query + description: Device Id. + required: true + schema: + type: string + responses: + "200": + description: Device info retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/DeviceInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/DeviceInfo' + "404": + description: Device not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Devices/Options: + get: + tags: + - Devices + summary: Get options for a device. + operationId: GetDeviceOptions + parameters: + - name: id + in: query + description: Device Id. + required: true + schema: + type: string + responses: + "200": + description: Device options retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceOptions' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/DeviceOptions' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/DeviceOptions' + "404": + description: Device not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + post: + tags: + - Devices + summary: Update device options. + operationId: UpdateDeviceOptions + parameters: + - name: id + in: query + description: Device Id. + required: true + schema: + type: string + requestBody: + description: Device Options. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/DeviceOptionsDto' + description: A dto representing custom options for a device. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/DeviceOptionsDto' + description: A dto representing custom options for a device. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/DeviceOptionsDto' + description: A dto representing custom options for a device. + required: true + responses: + "204": + description: Device options updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /DisplayPreferences/{displayPreferencesId}: + get: + tags: + - DisplayPreferences + summary: Get Display Preferences. + operationId: GetDisplayPreferences + parameters: + - name: displayPreferencesId + in: path + description: Display preferences id. + required: true + schema: + type: string + - name: userId + in: query + description: User id. + required: true + schema: + type: string + format: uuid + - name: client + in: query + description: Client. + required: true + schema: + type: string + responses: + "200": + description: Display preferences retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/DisplayPreferencesDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/DisplayPreferencesDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/DisplayPreferencesDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + post: + tags: + - DisplayPreferences + summary: Update Display Preferences. + operationId: UpdateDisplayPreferences + parameters: + - name: displayPreferencesId + in: path + description: Display preferences id. + required: true + schema: + type: string + - name: userId + in: query + description: User Id. + required: true + schema: + type: string + format: uuid + - name: client + in: query + description: Client. + required: true + schema: + type: string + requestBody: + description: New Display Preferences object. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/DisplayPreferencesDto' + description: Defines the display preferences for any item that supports them (usually Folders). + text/json: + schema: + allOf: + - $ref: '#/components/schemas/DisplayPreferencesDto' + description: Defines the display preferences for any item that supports them (usually Folders). + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/DisplayPreferencesDto' + description: Defines the display preferences for any item that supports them (usually Folders). + required: true + responses: + "204": + description: Display preferences updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Dlna/ProfileInfos: + get: + tags: + - Dlna + summary: Get profile infos. + operationId: GetProfileInfos + responses: + "200": + description: Device profile infos returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceProfileInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/DeviceProfileInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/DeviceProfileInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Dlna/Profiles: + post: + tags: + - Dlna + summary: Creates a profile. + operationId: CreateProfile + requestBody: + description: Device profile. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/DeviceProfile' + description: "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + text/json: + schema: + allOf: + - $ref: '#/components/schemas/DeviceProfile' + description: "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/DeviceProfile' + description: "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + responses: + "204": + description: Device profile created. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Dlna/Profiles/{profileId}: + get: + tags: + - Dlna + summary: Gets a single profile. + operationId: GetProfile + parameters: + - name: profileId + in: path + description: Profile Id. + required: true + schema: + type: string + responses: + "200": + description: Device profile returned. + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceProfile' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/DeviceProfile' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/DeviceProfile' + "404": + description: Device profile not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + delete: + tags: + - Dlna + summary: Deletes a profile. + operationId: DeleteProfile + parameters: + - name: profileId + in: path + description: Profile id. + required: true + schema: + type: string + responses: + "204": + description: Device profile deleted. + "404": + description: Device profile not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + post: + tags: + - Dlna + summary: Updates a profile. + operationId: UpdateProfile + parameters: + - name: profileId + in: path + description: Profile id. + required: true + schema: + type: string + requestBody: + description: Device profile. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/DeviceProfile' + description: "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + text/json: + schema: + allOf: + - $ref: '#/components/schemas/DeviceProfile' + description: "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/DeviceProfile' + description: "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + responses: + "204": + description: Device profile updated. + "404": + description: Device profile not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Dlna/Profiles/Default: + get: + tags: + - Dlna + summary: Gets the default profile. + operationId: GetDefaultProfile + responses: + "200": + description: Default device profile returned. + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceProfile' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/DeviceProfile' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/DeviceProfile' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Dlna/{serverId}/ConnectionManager: + get: + tags: + - DlnaServer + summary: Gets Dlna media receiver registrar xml. + operationId: GetConnectionManager + parameters: + - name: serverId + in: path + description: Server UUID. + required: true + schema: + type: string + responses: + "200": + description: Dlna media receiver registrar xml returned. + content: + text/xml: + schema: + type: string + format: binary + "503": + description: DLNA is disabled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - AnonymousLanAccessPolicy + /Dlna/{serverId}/ConnectionManager/ConnectionManager: + get: + tags: + - DlnaServer + summary: Gets Dlna media receiver registrar xml. + operationId: GetConnectionManager_2 + parameters: + - name: serverId + in: path + description: Server UUID. + required: true + schema: + type: string + responses: + "200": + description: Dlna media receiver registrar xml returned. + content: + text/xml: + schema: + type: string + format: binary + "503": + description: DLNA is disabled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - AnonymousLanAccessPolicy + /Dlna/{serverId}/ConnectionManager/ConnectionManager.xml: + get: + tags: + - DlnaServer + summary: Gets Dlna media receiver registrar xml. + operationId: GetConnectionManager_3 + parameters: + - name: serverId + in: path + description: Server UUID. + required: true + schema: + type: string + responses: + "200": + description: Dlna media receiver registrar xml returned. + content: + text/xml: + schema: + type: string + format: binary + "503": + description: DLNA is disabled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - AnonymousLanAccessPolicy + /Dlna/{serverId}/ConnectionManager/Control: + post: + tags: + - DlnaServer + summary: Process a connection manager control request. + operationId: ProcessConnectionManagerControlRequest + parameters: + - name: serverId + in: path + description: Server UUID. + required: true + schema: + type: string + responses: + "200": + description: Request processed. + content: + text/xml: + schema: + type: string + format: binary + "503": + description: DLNA is disabled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - AnonymousLanAccessPolicy + /Dlna/{serverId}/ContentDirectory: + get: + tags: + - DlnaServer + summary: Gets Dlna content directory xml. + operationId: GetContentDirectory + parameters: + - name: serverId + in: path + description: Server UUID. + required: true + schema: + type: string + responses: + "200": + description: Dlna content directory returned. + content: + text/xml: + schema: + type: string + format: binary + "503": + description: DLNA is disabled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - AnonymousLanAccessPolicy + /Dlna/{serverId}/ContentDirectory/ContentDirectory: + get: + tags: + - DlnaServer + summary: Gets Dlna content directory xml. + operationId: GetContentDirectory_2 + parameters: + - name: serverId + in: path + description: Server UUID. + required: true + schema: + type: string + responses: + "200": + description: Dlna content directory returned. + content: + text/xml: + schema: + type: string + format: binary + "503": + description: DLNA is disabled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - AnonymousLanAccessPolicy + /Dlna/{serverId}/ContentDirectory/ContentDirectory.xml: + get: + tags: + - DlnaServer + summary: Gets Dlna content directory xml. + operationId: GetContentDirectory_3 + parameters: + - name: serverId + in: path + description: Server UUID. + required: true + schema: + type: string + responses: + "200": + description: Dlna content directory returned. + content: + text/xml: + schema: + type: string + format: binary + "503": + description: DLNA is disabled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - AnonymousLanAccessPolicy + /Dlna/{serverId}/ContentDirectory/Control: + post: + tags: + - DlnaServer + summary: Process a content directory control request. + operationId: ProcessContentDirectoryControlRequest + parameters: + - name: serverId + in: path + description: Server UUID. + required: true + schema: + type: string + responses: + "200": + description: Request processed. + content: + text/xml: + schema: + type: string + format: binary + "503": + description: DLNA is disabled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - AnonymousLanAccessPolicy + /Dlna/{serverId}/description: + get: + tags: + - DlnaServer + summary: Get Description Xml. + operationId: GetDescriptionXml + parameters: + - name: serverId + in: path + description: Server UUID. + required: true + schema: + type: string + responses: + "200": + description: Description xml returned. + content: + text/xml: + schema: + type: string + format: binary + "503": + description: DLNA is disabled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - AnonymousLanAccessPolicy + /Dlna/{serverId}/description.xml: + get: + tags: + - DlnaServer + summary: Get Description Xml. + operationId: GetDescriptionXml_2 + parameters: + - name: serverId + in: path + description: Server UUID. + required: true + schema: + type: string + responses: + "200": + description: Description xml returned. + content: + text/xml: + schema: + type: string + format: binary + "503": + description: DLNA is disabled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - AnonymousLanAccessPolicy + /Dlna/{serverId}/icons/{fileName}: + get: + tags: + - DlnaServer + summary: Gets a server icon. + operationId: GetIconId + parameters: + - name: serverId + in: path + description: Server UUID. + required: true + schema: + type: string + - name: fileName + in: path + description: The icon filename. + required: true + schema: + type: string + responses: + "200": + description: Request processed. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Not Found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "503": + description: DLNA is disabled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - AnonymousLanAccessPolicy + /Dlna/{serverId}/MediaReceiverRegistrar: + get: + tags: + - DlnaServer + summary: Gets Dlna media receiver registrar xml. + operationId: GetMediaReceiverRegistrar + parameters: + - name: serverId + in: path + description: Server UUID. + required: true + schema: + type: string + responses: + "200": + description: Dlna media receiver registrar xml returned. + content: + text/xml: + schema: + type: string + format: binary + "503": + description: DLNA is disabled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - AnonymousLanAccessPolicy + /Dlna/{serverId}/MediaReceiverRegistrar/Control: + post: + tags: + - DlnaServer + summary: Process a media receiver registrar control request. + operationId: ProcessMediaReceiverRegistrarControlRequest + parameters: + - name: serverId + in: path + description: Server UUID. + required: true + schema: + type: string + responses: + "200": + description: Request processed. + content: + text/xml: + schema: + type: string + format: binary + "503": + description: DLNA is disabled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - AnonymousLanAccessPolicy + /Dlna/{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar: + get: + tags: + - DlnaServer + summary: Gets Dlna media receiver registrar xml. + operationId: GetMediaReceiverRegistrar_2 + parameters: + - name: serverId + in: path + description: Server UUID. + required: true + schema: + type: string + responses: + "200": + description: Dlna media receiver registrar xml returned. + content: + text/xml: + schema: + type: string + format: binary + "503": + description: DLNA is disabled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - AnonymousLanAccessPolicy + /Dlna/{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar.xml: + get: + tags: + - DlnaServer + summary: Gets Dlna media receiver registrar xml. + operationId: GetMediaReceiverRegistrar_3 + parameters: + - name: serverId + in: path + description: Server UUID. + required: true + schema: + type: string + responses: + "200": + description: Dlna media receiver registrar xml returned. + content: + text/xml: + schema: + type: string + format: binary + "503": + description: DLNA is disabled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - AnonymousLanAccessPolicy + /Dlna/icons/{fileName}: + get: + tags: + - DlnaServer + summary: Gets a server icon. + operationId: GetIcon + parameters: + - name: fileName + in: path + description: The icon filename. + required: true + schema: + type: string + responses: + "200": + description: Request processed. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Not Found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "503": + description: DLNA is disabled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - AnonymousLanAccessPolicy + /Audio/{itemId}/hls1/{playlistId}/{segmentId}.{container}: + get: + tags: + - DynamicHls + summary: Gets a video stream using HTTP live streaming. + operationId: GetHlsAudioSegment + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + - name: segmentId + in: path + description: The segment id. + required: true + schema: + type: integer + format: int32 + - name: container + in: path + description: 'The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.' + required: true + schema: + type: string + - name: runtimeTicks + in: query + description: The position of the requested segment in ticks. + required: true + schema: + type: integer + format: int64 + - name: actualSegmentLengthTicks + in: query + description: The length of the requested segment in ticks. + required: true + schema: + type: integer + format: int64 + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: maxStreamingBitrate + in: query + description: Optional. The maximum streaming bitrate. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vpx, wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + responses: + "200": + description: Video stream returned. + content: + audio/*: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Audio/{itemId}/main.m3u8: + get: + tags: + - DynamicHls + summary: Gets an audio stream using HTTP live streaming. + operationId: GetVariantHlsAudioPlaylist + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: maxStreamingBitrate + in: query + description: Optional. The maximum streaming bitrate. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vpx, wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + responses: + "200": + description: Audio stream returned. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Audio/{itemId}/master.m3u8: + get: + tags: + - DynamicHls + summary: Gets an audio hls playlist stream. + operationId: GetMasterHlsAudioPlaylist + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + required: true + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: maxStreamingBitrate + in: query + description: Optional. The maximum streaming bitrate. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAdaptiveBitrateStreaming + in: query + description: Enable adaptive bitrate streaming. + schema: + type: boolean + default: true + responses: + "200": + description: Audio stream returned. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + head: + tags: + - DynamicHls + summary: Gets an audio hls playlist stream. + operationId: HeadMasterHlsAudioPlaylist + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + required: true + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: maxStreamingBitrate + in: query + description: Optional. The maximum streaming bitrate. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAdaptiveBitrateStreaming + in: query + description: Enable adaptive bitrate streaming. + schema: + type: boolean + default: true + responses: + "200": + description: Audio stream returned. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{itemId}/hls1/{playlistId}/{segmentId}.{container}: + get: + tags: + - DynamicHls + summary: Gets a video stream using HTTP live streaming. + operationId: GetHlsVideoSegment + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + - name: segmentId + in: path + description: The segment id. + required: true + schema: + type: integer + format: int32 + - name: container + in: path + description: 'The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.' + required: true + schema: + type: string + - name: runtimeTicks + in: query + description: The position of the requested segment in ticks. + required: true + schema: + type: integer + format: int64 + - name: actualSegmentLengthTicks + in: query + description: The length of the requested segment in ticks. + required: true + schema: + type: integer + format: int64 + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The desired segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. The maximum horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The maximum vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + responses: + "200": + description: Video stream returned. + content: + video/*: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{itemId}/live.m3u8: + get: + tags: + - DynamicHls + summary: Gets a hls live stream. + operationId: GetLiveHlsStream + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: query + description: The audio container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment lenght. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: maxWidth + in: query + description: Optional. The max width. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The max height. + schema: + type: integer + format: int32 + - name: enableSubtitlesInManifest + in: query + description: Optional. Whether to enable subtitles in the manifest. + schema: + type: boolean + responses: + "200": + description: Hls live stream retrieved. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{itemId}/main.m3u8: + get: + tags: + - DynamicHls + summary: Gets a video stream using HTTP live streaming. + operationId: GetVariantHlsVideoPlaylist + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. The maximum horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The maximum vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + responses: + "200": + description: Video stream returned. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{itemId}/master.m3u8: + get: + tags: + - DynamicHls + summary: Gets a video hls playlist stream. + operationId: GetMasterHlsVideoPlaylist + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + required: true + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. The maximum horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The maximum vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAdaptiveBitrateStreaming + in: query + description: Enable adaptive bitrate streaming. + schema: + type: boolean + default: true + responses: + "200": + description: Video stream returned. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + head: + tags: + - DynamicHls + summary: Gets a video hls playlist stream. + operationId: HeadMasterHlsVideoPlaylist + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + required: true + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. The maximum horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The maximum vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + - name: enableAdaptiveBitrateStreaming + in: query + description: Enable adaptive bitrate streaming. + schema: + type: boolean + default: true + responses: + "200": + description: Video stream returned. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Environment/DefaultDirectoryBrowser: + get: + tags: + - Environment + summary: Get Default directory browser. + operationId: GetDefaultDirectoryBrowser + responses: + "200": + description: Default directory browser returned. + content: + application/json: + schema: + $ref: '#/components/schemas/DefaultDirectoryBrowserInfoDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/DefaultDirectoryBrowserInfoDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/DefaultDirectoryBrowserInfoDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + /Environment/DirectoryContents: + get: + tags: + - Environment + summary: Gets the contents of a given directory in the file system. + operationId: GetDirectoryContents + parameters: + - name: path + in: query + description: The path. + required: true + schema: + type: string + - name: includeFiles + in: query + description: An optional filter to include or exclude files from the results. true/false. + schema: + type: boolean + default: false + - name: includeDirectories + in: query + description: An optional filter to include or exclude folders from the results. true/false. + schema: + type: boolean + default: false + responses: + "200": + description: Directory contents returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + /Environment/Drives: + get: + tags: + - Environment + summary: Gets available drives from the server's file system. + operationId: GetDrives + responses: + "200": + description: List of entries returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + /Environment/NetworkShares: + get: + tags: + - Environment + summary: Gets network paths. + operationId: GetNetworkShares + responses: + "200": + description: Empty array returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/FileSystemEntryInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + /Environment/ParentPath: + get: + tags: + - Environment + summary: Gets the parent path of a given path. + operationId: GetParentPath + parameters: + - name: path + in: query + description: The path. + required: true + schema: + type: string + responses: + "200": + description: Success + content: + application/json: + schema: + type: string + application/json; profile="CamelCase": + schema: + type: string + application/json; profile="PascalCase": + schema: + type: string + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + /Environment/ValidatePath: + post: + tags: + - Environment + summary: Validates path. + operationId: ValidatePath + requestBody: + description: Validate request object. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ValidatePathDto' + description: Validate path object. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/ValidatePathDto' + description: Validate path object. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/ValidatePathDto' + description: Validate path object. + required: true + responses: + "204": + description: Path validated. + "404": + description: Path not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + /Items/Filters: + get: + tags: + - Filter + summary: Gets legacy query filters. + operationId: GetQueryFiltersLegacy + parameters: + - name: userId + in: query + description: Optional. User id. + schema: + type: string + format: uuid + - name: parentId + in: query + description: Optional. Parent id. + schema: + type: string + format: uuid + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: mediaTypes + in: query + description: Optional. Filter by MediaType. Allows multiple, comma delimited. + schema: + type: array + items: + type: string + responses: + "200": + description: Legacy filters retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryFiltersLegacy' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/QueryFiltersLegacy' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/QueryFiltersLegacy' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/Filters2: + get: + tags: + - Filter + summary: Gets query filters. + operationId: GetQueryFilters + parameters: + - name: userId + in: query + description: Optional. User id. + schema: + type: string + format: uuid + - name: parentId + in: query + description: Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: isAiring + in: query + description: Optional. Is item airing. + schema: + type: boolean + - name: isMovie + in: query + description: Optional. Is item movie. + schema: + type: boolean + - name: isSports + in: query + description: Optional. Is item sports. + schema: + type: boolean + - name: isKids + in: query + description: Optional. Is item kids. + schema: + type: boolean + - name: isNews + in: query + description: Optional. Is item news. + schema: + type: boolean + - name: isSeries + in: query + description: Optional. Is item series. + schema: + type: boolean + - name: recursive + in: query + description: Optional. Search recursive. + schema: + type: boolean + responses: + "200": + description: Filters retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryFilters' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/QueryFilters' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/QueryFilters' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Genres: + get: + tags: + - Genres + summary: Gets all genres from a given item, folder, or the entire library. + operationId: GetGenres + parameters: + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: searchTerm + in: query + description: The search term. + schema: + type: string + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: nameStartsWithOrGreater + in: query + description: Optional filter by items whose name is sorted equally or greater than a given input string. + schema: + type: string + - name: nameStartsWith + in: query + description: Optional filter by items whose name is sorted equally than a given input string. + schema: + type: string + - name: nameLessThan + in: query + description: Optional filter by items whose name is equally or lesser than a given input string. + schema: + type: string + - name: sortBy + in: query + description: Optional. Specify one or more sort orders, comma delimited. + schema: + type: array + items: + type: string + - name: sortOrder + in: query + description: Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + - name: enableTotalRecordCount + in: query + description: Optional. Include total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Genres returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Genres/{genreName}: + get: + tags: + - Genres + summary: Gets a genre, by name. + operationId: GetGenre + parameters: + - name: genreName + in: path + description: The genre name. + required: true + schema: + type: string + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + responses: + "200": + description: Genres returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Audio/{itemId}/hls/{segmentId}/stream.aac: + get: + tags: + - HlsSegment + summary: Gets the specified audio segment for an audio item. + operationId: GetHlsAudioSegmentLegacyAac + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + - name: segmentId + in: path + description: The segment id. + required: true + schema: + type: string + responses: + "200": + description: Hls audio segment returned. + content: + audio/*: + schema: + type: string + format: binary + /Audio/{itemId}/hls/{segmentId}/stream.mp3: + get: + tags: + - HlsSegment + summary: Gets the specified audio segment for an audio item. + operationId: GetHlsAudioSegmentLegacyMp3 + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + - name: segmentId + in: path + description: The segment id. + required: true + schema: + type: string + responses: + "200": + description: Hls audio segment returned. + content: + audio/*: + schema: + type: string + format: binary + /Videos/{itemId}/hls/{playlistId}/{segmentId}.{segmentContainer}: + get: + tags: + - HlsSegment + summary: Gets a hls video segment. + operationId: GetHlsVideoSegmentLegacy + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + - name: segmentId + in: path + description: The segment id. + required: true + schema: + type: string + - name: segmentContainer + in: path + description: The segment container. + required: true + schema: + type: string + responses: + "200": + description: Hls video segment returned. + content: + video/*: + schema: + type: string + format: binary + "404": + description: Hls segment not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Videos/{itemId}/hls/{playlistId}/stream.m3u8: + get: + tags: + - HlsSegment + summary: Gets a hls video playlist. + operationId: GetHlsPlaylistLegacy + parameters: + - name: itemId + in: path + description: The video id. + required: true + schema: + type: string + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + responses: + "200": + description: Hls video playlist returned. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/ActiveEncodings: + delete: + tags: + - HlsSegment + summary: Stops an active encoding. + operationId: StopEncodingProcess + parameters: + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + required: true + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + required: true + schema: + type: string + responses: + "204": + description: Encoding stopped successfully. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Artists/{name}/Images/{imageType}/{imageIndex}: + get: + tags: + - Image + summary: Get artist image by name. + operationId: GetArtistImage + parameters: + - name: name + in: path + description: Artist name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get artist image by name. + operationId: HeadArtistImage + parameters: + - name: name + in: path + description: Artist name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Branding/Splashscreen: + get: + tags: + - Image + summary: Generates or gets the splashscreen. + operationId: GetSplashscreen + parameters: + - name: tag + in: query + description: Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Apply a foreground layer on top of the image. + schema: + type: string + - name: quality + in: query + description: Quality setting, from 0-100. + schema: + maximum: 100 + minimum: 0 + type: integer + format: int32 + default: 90 + responses: + "200": + description: Splashscreen returned successfully. + content: + image/*: + schema: + type: string + format: binary + post: + tags: + - Image + summary: "Uploads a custom splashscreen.\r\nThe body is expected to the image contents base64 encoded." + operationId: UploadCustomSplashscreen + requestBody: + content: + image/*: + schema: + type: string + format: binary + responses: + "204": + description: Successfully uploaded new splashscreen. + "400": + description: Error reading MimeType from uploaded image. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: User does not have permission to upload splashscreen.. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - RequiresElevation + delete: + tags: + - Image + summary: Delete a custom splashscreen. + operationId: DeleteCustomSplashscreen + responses: + "204": + description: Successfully deleted the custom splashscreen. + "403": + description: User does not have permission to delete splashscreen.. + "401": + description: Unauthorized + security: + - CustomAuthentication: + - RequiresElevation + /Genres/{name}/Images/{imageType}: + get: + tags: + - Image + summary: Get genre image by name. + operationId: GetGenreImage + parameters: + - name: name + in: path + description: Genre name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get genre image by name. + operationId: HeadGenreImage + parameters: + - name: name + in: path + description: Genre name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Genres/{name}/Images/{imageType}/{imageIndex}: + get: + tags: + - Image + summary: Get genre image by name. + operationId: GetGenreImageByIndex + parameters: + - name: name + in: path + description: Genre name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get genre image by name. + operationId: HeadGenreImageByIndex + parameters: + - name: name + in: path + description: Genre name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Items/{itemId}/Images: + get: + tags: + - Image + summary: Get item image infos. + operationId: GetItemImageInfos + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Item images returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ImageInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/ImageInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/ImageInfo' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/Images/{imageType}: + delete: + tags: + - Image + summary: Delete an item's image. + operationId: DeleteItemImage + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: query + description: The image index. + schema: + type: integer + format: int32 + responses: + "204": + description: Image deleted. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + post: + tags: + - Image + summary: Set item image. + operationId: SetItemImage + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + requestBody: + content: + image/*: + schema: + type: string + format: binary + responses: + "204": + description: Image saved. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + get: + tags: + - Image + summary: Gets the item's image. + operationId: GetItemImage + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: format + in: query + description: Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Gets the item's image. + operationId: HeadItemImage + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: format + in: query + description: Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Items/{itemId}/Images/{imageType}/{imageIndex}: + delete: + tags: + - Image + summary: Delete an item's image. + operationId: DeleteItemImageByIndex + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: The image index. + required: true + schema: + type: integer + format: int32 + responses: + "204": + description: Image deleted. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + post: + tags: + - Image + summary: Set item image. + operationId: SetItemImageByIndex + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: (Unused) Image index. + required: true + schema: + type: integer + format: int32 + requestBody: + content: + image/*: + schema: + type: string + format: binary + responses: + "204": + description: Image saved. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + get: + tags: + - Image + summary: Gets the item's image. + operationId: GetItemImageByIndex + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: format + in: query + description: Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Gets the item's image. + operationId: HeadItemImageByIndex + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: format + in: query + description: Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}: + get: + tags: + - Image + summary: Gets the item's image. + operationId: GetItemImage2 + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: maxWidth + in: path + description: The maximum image width to return. + required: true + schema: + type: integer + format: int32 + - name: maxHeight + in: path + description: The maximum image height to return. + required: true + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: tag + in: path + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + required: true + schema: + type: string + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: format + in: path + description: Determines the output format of the image - original,gif,jpg,png. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + description: Enum ImageOutputFormat. + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: percentPlayed + in: path + description: Optional. Percent to render for the percent played overlay. + required: true + schema: + type: number + format: double + - name: unplayedCount + in: path + description: Optional. Unplayed count overlay to render. + required: true + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Gets the item's image. + operationId: HeadItemImage2 + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: maxWidth + in: path + description: The maximum image width to return. + required: true + schema: + type: integer + format: int32 + - name: maxHeight + in: path + description: The maximum image height to return. + required: true + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: tag + in: path + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + required: true + schema: + type: string + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: format + in: path + description: Determines the output format of the image - original,gif,jpg,png. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + description: Enum ImageOutputFormat. + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: percentPlayed + in: path + description: Optional. Percent to render for the percent played overlay. + required: true + schema: + type: number + format: double + - name: unplayedCount + in: path + description: Optional. Unplayed count overlay to render. + required: true + schema: + type: integer + format: int32 + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Items/{itemId}/Images/{imageType}/{imageIndex}/Index: + post: + tags: + - Image + summary: Updates the index for an item image. + operationId: UpdateItemImageIndex + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Old image index. + required: true + schema: + type: integer + format: int32 + - name: newIndex + in: query + description: New image index. + required: true + schema: + type: integer + format: int32 + responses: + "204": + description: Image index updated. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /MusicGenres/{name}/Images/{imageType}: + get: + tags: + - Image + summary: Get music genre image by name. + operationId: GetMusicGenreImage + parameters: + - name: name + in: path + description: Music genre name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get music genre image by name. + operationId: HeadMusicGenreImage + parameters: + - name: name + in: path + description: Music genre name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /MusicGenres/{name}/Images/{imageType}/{imageIndex}: + get: + tags: + - Image + summary: Get music genre image by name. + operationId: GetMusicGenreImageByIndex + parameters: + - name: name + in: path + description: Music genre name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get music genre image by name. + operationId: HeadMusicGenreImageByIndex + parameters: + - name: name + in: path + description: Music genre name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Persons/{name}/Images/{imageType}: + get: + tags: + - Image + summary: Get person image by name. + operationId: GetPersonImage + parameters: + - name: name + in: path + description: Person name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get person image by name. + operationId: HeadPersonImage + parameters: + - name: name + in: path + description: Person name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Persons/{name}/Images/{imageType}/{imageIndex}: + get: + tags: + - Image + summary: Get person image by name. + operationId: GetPersonImageByIndex + parameters: + - name: name + in: path + description: Person name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get person image by name. + operationId: HeadPersonImageByIndex + parameters: + - name: name + in: path + description: Person name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Studios/{name}/Images/{imageType}: + get: + tags: + - Image + summary: Get studio image by name. + operationId: GetStudioImage + parameters: + - name: name + in: path + description: Studio name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get studio image by name. + operationId: HeadStudioImage + parameters: + - name: name + in: path + description: Studio name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Studios/{name}/Images/{imageType}/{imageIndex}: + get: + tags: + - Image + summary: Get studio image by name. + operationId: GetStudioImageByIndex + parameters: + - name: name + in: path + description: Studio name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get studio image by name. + operationId: HeadStudioImageByIndex + parameters: + - name: name + in: path + description: Studio name. + required: true + schema: + type: string + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Users/{userId}/Images/{imageType}: + post: + tags: + - Image + summary: Sets the user image. + operationId: PostUserImage + parameters: + - name: userId + in: path + description: User Id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: (Unused) Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: index + in: query + description: (Unused) Image index. + schema: + type: integer + format: int32 + requestBody: + content: + image/*: + schema: + type: string + format: binary + responses: + "204": + description: Image updated. + "403": + description: User does not have permission to delete the image. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - Image + summary: Delete the user's image. + operationId: DeleteUserImage + parameters: + - name: userId + in: path + description: User Id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: (Unused) Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: index + in: query + description: (Unused) Image index. + schema: + type: integer + format: int32 + responses: + "204": + description: Image deleted. + "403": + description: User does not have permission to delete the image. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + get: + tags: + - Image + summary: Get user profile image. + operationId: GetUserImage + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get user profile image. + operationId: HeadUserImage + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + - name: imageIndex + in: query + description: Image index. + schema: + type: integer + format: int32 + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Users/{userId}/Images/{imageType}/{imageIndex}: + get: + tags: + - Image + summary: Get user profile image. + operationId: GetUserImageByIndex + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + head: + tags: + - Image + summary: Get user profile image. + operationId: HeadUserImageByIndex + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageIndex + in: path + description: Image index. + required: true + schema: + type: integer + format: int32 + - name: tag + in: query + description: Optional. Supply the cache tag from the item object to receive strong caching headers. + schema: + type: string + - name: format + in: query + description: Determines the output format of the image - original,gif,jpg,png. + schema: + allOf: + - $ref: '#/components/schemas/ImageFormat' + - name: maxWidth + in: query + description: The maximum image width to return. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: The maximum image height to return. + schema: + type: integer + format: int32 + - name: percentPlayed + in: query + description: Optional. Percent to render for the percent played overlay. + schema: + type: number + format: double + - name: unplayedCount + in: query + description: Optional. Unplayed count overlay to render. + schema: + type: integer + format: int32 + - name: width + in: query + description: The fixed image width to return. + schema: + type: integer + format: int32 + - name: height + in: query + description: The fixed image height to return. + schema: + type: integer + format: int32 + - name: quality + in: query + description: Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + schema: + type: integer + format: int32 + - name: fillWidth + in: query + description: Width of box to fill. + schema: + type: integer + format: int32 + - name: fillHeight + in: query + description: Height of box to fill. + schema: + type: integer + format: int32 + - name: cropWhitespace + in: query + description: Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + deprecated: true + schema: + type: boolean + - name: addPlayedIndicator + in: query + description: Optional. Add a played indicator. + schema: + type: boolean + - name: blur + in: query + description: Optional. Blur image. + schema: + type: integer + format: int32 + - name: backgroundColor + in: query + description: Optional. Apply a background color for transparent images. + schema: + type: string + - name: foregroundLayer + in: query + description: Optional. Apply a foreground layer on top of the image. + schema: + type: string + responses: + "200": + description: Image stream returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Users/{userId}/Images/{imageType}/{index}: + post: + tags: + - Image + summary: Sets the user image. + operationId: PostUserImageByIndex + parameters: + - name: userId + in: path + description: User Id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: (Unused) Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: index + in: path + description: (Unused) Image index. + required: true + schema: + type: integer + format: int32 + requestBody: + content: + image/*: + schema: + type: string + format: binary + responses: + "204": + description: Image updated. + "403": + description: User does not have permission to delete the image. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - Image + summary: Delete the user's image. + operationId: DeleteUserImageByIndex + parameters: + - name: userId + in: path + description: User Id. + required: true + schema: + type: string + format: uuid + - name: imageType + in: path + description: (Unused) Image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: index + in: path + description: (Unused) Image index. + required: true + schema: + type: integer + format: int32 + responses: + "204": + description: Image deleted. + "403": + description: User does not have permission to delete the image. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + /Images/General: + get: + tags: + - ImageByName + summary: Get all general images. + operationId: GetGeneralImages + responses: + "200": + description: Retrieved list of images. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ImageByNameInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/ImageByNameInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/ImageByNameInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Images/General/{name}/{type}: + get: + tags: + - ImageByName + summary: Get General Image. + operationId: GetGeneralImage + parameters: + - name: name + in: path + description: The name of the image. + required: true + schema: + type: string + - name: type + in: path + description: Image Type (primary, backdrop, logo, etc). + required: true + schema: + type: string + responses: + "200": + description: Image stream retrieved. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Image not found. + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Images/MediaInfo: + get: + tags: + - ImageByName + summary: Get all media info images. + operationId: GetMediaInfoImages + responses: + "200": + description: Image list retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ImageByNameInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/ImageByNameInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/ImageByNameInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Images/MediaInfo/{theme}/{name}: + get: + tags: + - ImageByName + summary: Get media info image. + operationId: GetMediaInfoImage + parameters: + - name: theme + in: path + description: The theme to get the image from. + required: true + schema: + type: string + - name: name + in: path + description: The name of the image. + required: true + schema: + type: string + responses: + "200": + description: Image stream retrieved. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Image not found. + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Images/Ratings: + get: + tags: + - ImageByName + summary: Get all general images. + operationId: GetRatingImages + responses: + "200": + description: Retrieved list of images. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ImageByNameInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/ImageByNameInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/ImageByNameInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Images/Ratings/{theme}/{name}: + get: + tags: + - ImageByName + summary: Get rating image. + operationId: GetRatingImage + parameters: + - name: theme + in: path + description: The theme to get the image from. + required: true + schema: + type: string + - name: name + in: path + description: The name of the image. + required: true + schema: + type: string + responses: + "200": + description: Image stream retrieved. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Image not found. + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Albums/{id}/InstantMix: + get: + tags: + - InstantMix + summary: Creates an instant playlist based on a given album. + operationId: GetInstantMixFromAlbum + parameters: + - name: id + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Instant playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Artists/{id}/InstantMix: + get: + tags: + - InstantMix + summary: Creates an instant playlist based on a given artist. + operationId: GetInstantMixFromArtists + parameters: + - name: id + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Instant playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Artists/InstantMix: + get: + tags: + - InstantMix + summary: Creates an instant playlist based on a given artist. + operationId: GetInstantMixFromArtists2 + parameters: + - name: id + in: query + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Instant playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{id}/InstantMix: + get: + tags: + - InstantMix + summary: Creates an instant playlist based on a given item. + operationId: GetInstantMixFromItem + parameters: + - name: id + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Instant playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /MusicGenres/{name}/InstantMix: + get: + tags: + - InstantMix + summary: Creates an instant playlist based on a given genre. + operationId: GetInstantMixFromMusicGenreByName + parameters: + - name: name + in: path + description: The genre name. + required: true + schema: + type: string + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Instant playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /MusicGenres/InstantMix: + get: + tags: + - InstantMix + summary: Creates an instant playlist based on a given genre. + operationId: GetInstantMixFromMusicGenreById + parameters: + - name: id + in: query + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Instant playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Playlists/{id}/InstantMix: + get: + tags: + - InstantMix + summary: Creates an instant playlist based on a given playlist. + operationId: GetInstantMixFromPlaylist + parameters: + - name: id + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Instant playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Songs/{id}/InstantMix: + get: + tags: + - InstantMix + summary: Creates an instant playlist based on a given song. + operationId: GetInstantMixFromSong + parameters: + - name: id + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Instant playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/ExternalIdInfos: + get: + tags: + - ItemLookup + summary: Get the item's external id info. + operationId: GetExternalIdInfos + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: External id info retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ExternalIdInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/ExternalIdInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/ExternalIdInfo' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /Items/RemoteSearch/Apply/{itemId}: + post: + tags: + - ItemLookup + summary: Applies search criteria to an item and refreshes metadata. + operationId: ApplySearchCriteria + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: replaceAllImages + in: query + description: 'Optional. Whether or not to replace all images. Default: True.' + schema: + type: boolean + default: true + requestBody: + description: The remote search result. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/RemoteSearchResult' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/RemoteSearchResult' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/RemoteSearchResult' + required: true + responses: + "204": + description: Item metadata refreshed. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /Items/RemoteSearch/Book: + post: + tags: + - ItemLookup + summary: Get book remote search. + operationId: GetBookRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/BookInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/BookInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/BookInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Book remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/RemoteSearch/BoxSet: + post: + tags: + - ItemLookup + summary: Get box set remote search. + operationId: GetBoxSetRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/BoxSetInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/BoxSetInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/BoxSetInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Box set remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/RemoteSearch/Movie: + post: + tags: + - ItemLookup + summary: Get movie remote search. + operationId: GetMovieRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/MovieInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/MovieInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/MovieInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Movie remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/RemoteSearch/MusicAlbum: + post: + tags: + - ItemLookup + summary: Get music album remote search. + operationId: GetMusicAlbumRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/AlbumInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/AlbumInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/AlbumInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Music album remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/RemoteSearch/MusicArtist: + post: + tags: + - ItemLookup + summary: Get music artist remote search. + operationId: GetMusicArtistRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ArtistInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/ArtistInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/ArtistInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Music artist remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/RemoteSearch/MusicVideo: + post: + tags: + - ItemLookup + summary: Get music video remote search. + operationId: GetMusicVideoRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/MusicVideoInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/MusicVideoInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/MusicVideoInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Music video remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/RemoteSearch/Person: + post: + tags: + - ItemLookup + summary: Get person remote search. + operationId: GetPersonRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PersonLookupInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/PersonLookupInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/PersonLookupInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Person remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /Items/RemoteSearch/Series: + post: + tags: + - ItemLookup + summary: Get series remote search. + operationId: GetSeriesRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Series remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/RemoteSearch/Trailer: + post: + tags: + - ItemLookup + summary: Get trailer remote search. + operationId: GetTrailerRemoteSearchResults + requestBody: + description: Remote search query. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/TrailerInfoRemoteSearchQuery' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/TrailerInfoRemoteSearchQuery' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/TrailerInfoRemoteSearchQuery' + required: true + responses: + "200": + description: Trailer remote search executed. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/Refresh: + post: + tags: + - ItemRefresh + summary: Refreshes metadata for an item. + operationId: RefreshItem + parameters: + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: metadataRefreshMode + in: query + description: (Optional) Specifies the metadata refresh mode. + schema: + allOf: + - $ref: '#/components/schemas/MetadataRefreshMode' + default: None + - name: imageRefreshMode + in: query + description: (Optional) Specifies the image refresh mode. + schema: + allOf: + - $ref: '#/components/schemas/MetadataRefreshMode' + default: None + - name: replaceAllMetadata + in: query + description: (Optional) Determines if metadata should be replaced. Only applicable if mode is FullRefresh. + schema: + type: boolean + default: false + - name: replaceAllImages + in: query + description: (Optional) Determines if images should be replaced. Only applicable if mode is FullRefresh. + schema: + type: boolean + default: false + responses: + "204": + description: Item metadata refresh queued. + "404": + description: Item to refresh not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Items: + get: + tags: + - Items + summary: Gets items based on a query. + operationId: GetItems + parameters: + - name: userId + in: query + description: The user id supplied as query parameter. + schema: + type: string + format: uuid + - name: maxOfficialRating + in: query + description: Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). + schema: + type: string + - name: hasThemeSong + in: query + description: Optional filter by items with theme songs. + schema: + type: boolean + - name: hasThemeVideo + in: query + description: Optional filter by items with theme videos. + schema: + type: boolean + - name: hasSubtitles + in: query + description: Optional filter by items with subtitles. + schema: + type: boolean + - name: hasSpecialFeature + in: query + description: Optional filter by items with special features. + schema: + type: boolean + - name: hasTrailer + in: query + description: Optional filter by items with trailers. + schema: + type: boolean + - name: adjacentTo + in: query + description: Optional. Return items that are siblings of a supplied item. + schema: + type: string + - name: parentIndexNumber + in: query + description: Optional filter by parent index number. + schema: + type: integer + format: int32 + - name: hasParentalRating + in: query + description: Optional filter by items that have or do not have a parental rating. + schema: + type: boolean + - name: isHd + in: query + description: Optional filter by items that are HD or not. + schema: + type: boolean + - name: is4K + in: query + description: Optional filter by items that are 4K or not. + schema: + type: boolean + - name: locationTypes + in: query + description: Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/LocationType' + - name: excludeLocationTypes + in: query + description: Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/LocationType' + - name: isMissing + in: query + description: Optional filter by items that are missing episodes or not. + schema: + type: boolean + - name: isUnaired + in: query + description: Optional filter by items that are unaired episodes or not. + schema: + type: boolean + - name: minCommunityRating + in: query + description: Optional filter by minimum community rating. + schema: + type: number + format: double + - name: minCriticRating + in: query + description: Optional filter by minimum critic rating. + schema: + type: number + format: double + - name: minPremiereDate + in: query + description: Optional. The minimum premiere date. Format = ISO. + schema: + type: string + format: date-time + - name: minDateLastSaved + in: query + description: Optional. The minimum last saved date. Format = ISO. + schema: + type: string + format: date-time + - name: minDateLastSavedForUser + in: query + description: Optional. The minimum last saved date for the current user. Format = ISO. + schema: + type: string + format: date-time + - name: maxPremiereDate + in: query + description: Optional. The maximum premiere date. Format = ISO. + schema: + type: string + format: date-time + - name: hasOverview + in: query + description: Optional filter by items that have an overview or not. + schema: + type: boolean + - name: hasImdbId + in: query + description: Optional filter by items that have an imdb id or not. + schema: + type: boolean + - name: hasTmdbId + in: query + description: Optional filter by items that have a tmdb id or not. + schema: + type: boolean + - name: hasTvdbId + in: query + description: Optional filter by items that have a tvdb id or not. + schema: + type: boolean + - name: isMovie + in: query + description: Optional filter for live tv movies. + schema: + type: boolean + - name: isSeries + in: query + description: Optional filter for live tv series. + schema: + type: boolean + - name: isNews + in: query + description: Optional filter for live tv news. + schema: + type: boolean + - name: isKids + in: query + description: Optional filter for live tv kids. + schema: + type: boolean + - name: isSports + in: query + description: Optional filter for live tv sports. + schema: + type: boolean + - name: excludeItemIds + in: query + description: Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited. + schema: + type: array + items: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: recursive + in: query + description: When searching within folders, this determines whether or not the search will be recursive. true/false. + schema: + type: boolean + - name: searchTerm + in: query + description: Optional. Filter based on a search term. + schema: + type: string + - name: sortOrder + in: query + description: Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: filters + in: query + description: 'Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFilter' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. + schema: + type: boolean + - name: mediaTypes + in: query + description: Optional filter by MediaType. Allows multiple, comma delimited. + schema: + type: array + items: + type: string + - name: imageTypes + in: query + description: Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: sortBy + in: query + description: 'Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.' + schema: + type: array + items: + type: string + - name: isPlayed + in: query + description: Optional filter by items that are played, or not. + schema: + type: boolean + - name: genres + in: query + description: Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: officialRatings + in: query + description: Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: tags + in: query + description: Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: years + in: query + description: Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. + schema: + type: array + items: + type: integer + format: int32 + - name: enableUserData + in: query + description: Optional, include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: person + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person. + schema: + type: string + - name: personIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person id. + schema: + type: array + items: + type: string + format: uuid + - name: personTypes + in: query + description: Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. + schema: + type: array + items: + type: string + - name: studios + in: query + description: Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: artists + in: query + description: Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: excludeArtistIds + in: query + description: Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: artistIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified artist id. + schema: + type: array + items: + type: string + format: uuid + - name: albumArtistIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified album artist id. + schema: + type: array + items: + type: string + format: uuid + - name: contributingArtistIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified contributing artist id. + schema: + type: array + items: + type: string + format: uuid + - name: albums + in: query + description: Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: albumIds + in: query + description: Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: ids + in: query + description: Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited. + schema: + type: array + items: + type: string + format: uuid + - name: videoTypes + in: query + description: Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/VideoType' + - name: minOfficialRating + in: query + description: Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). + schema: + type: string + - name: isLocked + in: query + description: Optional filter by items that are locked. + schema: + type: boolean + - name: isPlaceHolder + in: query + description: Optional filter by items that are placeholders. + schema: + type: boolean + - name: hasOfficialRating + in: query + description: Optional filter by items that have official ratings. + schema: + type: boolean + - name: collapseBoxSetItems + in: query + description: Whether or not to hide items behind their boxsets. + schema: + type: boolean + - name: minWidth + in: query + description: Optional. Filter by the minimum width of the item. + schema: + type: integer + format: int32 + - name: minHeight + in: query + description: Optional. Filter by the minimum height of the item. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. Filter by the maximum width of the item. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. Filter by the maximum height of the item. + schema: + type: integer + format: int32 + - name: is3D + in: query + description: Optional filter by items that are 3D, or not. + schema: + type: boolean + - name: seriesStatus + in: query + description: Optional filter by Series Status. Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/SeriesStatus' + - name: nameStartsWithOrGreater + in: query + description: Optional filter by items whose name is sorted equally or greater than a given input string. + schema: + type: string + - name: nameStartsWith + in: query + description: Optional filter by items whose name is sorted equally than a given input string. + schema: + type: string + - name: nameLessThan + in: query + description: Optional filter by items whose name is equally or lesser than a given input string. + schema: + type: string + - name: studioIds + in: query + description: Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: genreIds + in: query + description: Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: enableTotalRecordCount + in: query + description: Optional. Enable the total record count. + schema: + type: boolean + default: true + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - Library + summary: Deletes items from the library and filesystem. + operationId: DeleteItems + parameters: + - name: ids + in: query + description: The item ids. + schema: + type: array + items: + type: string + format: uuid + responses: + "204": + description: Items deleted. + "401": + description: Unauthorized access. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/Items: + get: + tags: + - Items + summary: Gets items based on a query. + operationId: GetItemsByUserId + parameters: + - name: userId + in: path + description: The user id supplied as query parameter. + required: true + schema: + type: string + format: uuid + - name: maxOfficialRating + in: query + description: Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). + schema: + type: string + - name: hasThemeSong + in: query + description: Optional filter by items with theme songs. + schema: + type: boolean + - name: hasThemeVideo + in: query + description: Optional filter by items with theme videos. + schema: + type: boolean + - name: hasSubtitles + in: query + description: Optional filter by items with subtitles. + schema: + type: boolean + - name: hasSpecialFeature + in: query + description: Optional filter by items with special features. + schema: + type: boolean + - name: hasTrailer + in: query + description: Optional filter by items with trailers. + schema: + type: boolean + - name: adjacentTo + in: query + description: Optional. Return items that are siblings of a supplied item. + schema: + type: string + - name: parentIndexNumber + in: query + description: Optional filter by parent index number. + schema: + type: integer + format: int32 + - name: hasParentalRating + in: query + description: Optional filter by items that have or do not have a parental rating. + schema: + type: boolean + - name: isHd + in: query + description: Optional filter by items that are HD or not. + schema: + type: boolean + - name: is4K + in: query + description: Optional filter by items that are 4K or not. + schema: + type: boolean + - name: locationTypes + in: query + description: Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/LocationType' + - name: excludeLocationTypes + in: query + description: Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/LocationType' + - name: isMissing + in: query + description: Optional filter by items that are missing episodes or not. + schema: + type: boolean + - name: isUnaired + in: query + description: Optional filter by items that are unaired episodes or not. + schema: + type: boolean + - name: minCommunityRating + in: query + description: Optional filter by minimum community rating. + schema: + type: number + format: double + - name: minCriticRating + in: query + description: Optional filter by minimum critic rating. + schema: + type: number + format: double + - name: minPremiereDate + in: query + description: Optional. The minimum premiere date. Format = ISO. + schema: + type: string + format: date-time + - name: minDateLastSaved + in: query + description: Optional. The minimum last saved date. Format = ISO. + schema: + type: string + format: date-time + - name: minDateLastSavedForUser + in: query + description: Optional. The minimum last saved date for the current user. Format = ISO. + schema: + type: string + format: date-time + - name: maxPremiereDate + in: query + description: Optional. The maximum premiere date. Format = ISO. + schema: + type: string + format: date-time + - name: hasOverview + in: query + description: Optional filter by items that have an overview or not. + schema: + type: boolean + - name: hasImdbId + in: query + description: Optional filter by items that have an imdb id or not. + schema: + type: boolean + - name: hasTmdbId + in: query + description: Optional filter by items that have a tmdb id or not. + schema: + type: boolean + - name: hasTvdbId + in: query + description: Optional filter by items that have a tvdb id or not. + schema: + type: boolean + - name: isMovie + in: query + description: Optional filter for live tv movies. + schema: + type: boolean + - name: isSeries + in: query + description: Optional filter for live tv series. + schema: + type: boolean + - name: isNews + in: query + description: Optional filter for live tv news. + schema: + type: boolean + - name: isKids + in: query + description: Optional filter for live tv kids. + schema: + type: boolean + - name: isSports + in: query + description: Optional filter for live tv sports. + schema: + type: boolean + - name: excludeItemIds + in: query + description: Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited. + schema: + type: array + items: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: recursive + in: query + description: When searching within folders, this determines whether or not the search will be recursive. true/false. + schema: + type: boolean + - name: searchTerm + in: query + description: Optional. Filter based on a search term. + schema: + type: string + - name: sortOrder + in: query + description: Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: filters + in: query + description: 'Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFilter' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. + schema: + type: boolean + - name: mediaTypes + in: query + description: Optional filter by MediaType. Allows multiple, comma delimited. + schema: + type: array + items: + type: string + - name: imageTypes + in: query + description: Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: sortBy + in: query + description: 'Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.' + schema: + type: array + items: + type: string + - name: isPlayed + in: query + description: Optional filter by items that are played, or not. + schema: + type: boolean + - name: genres + in: query + description: Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: officialRatings + in: query + description: Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: tags + in: query + description: Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: years + in: query + description: Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. + schema: + type: array + items: + type: integer + format: int32 + - name: enableUserData + in: query + description: Optional, include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: person + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person. + schema: + type: string + - name: personIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person id. + schema: + type: array + items: + type: string + format: uuid + - name: personTypes + in: query + description: Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. + schema: + type: array + items: + type: string + - name: studios + in: query + description: Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: artists + in: query + description: Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: excludeArtistIds + in: query + description: Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: artistIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified artist id. + schema: + type: array + items: + type: string + format: uuid + - name: albumArtistIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified album artist id. + schema: + type: array + items: + type: string + format: uuid + - name: contributingArtistIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified contributing artist id. + schema: + type: array + items: + type: string + format: uuid + - name: albums + in: query + description: Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: albumIds + in: query + description: Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: ids + in: query + description: Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited. + schema: + type: array + items: + type: string + format: uuid + - name: videoTypes + in: query + description: Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/VideoType' + - name: minOfficialRating + in: query + description: Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). + schema: + type: string + - name: isLocked + in: query + description: Optional filter by items that are locked. + schema: + type: boolean + - name: isPlaceHolder + in: query + description: Optional filter by items that are placeholders. + schema: + type: boolean + - name: hasOfficialRating + in: query + description: Optional filter by items that have official ratings. + schema: + type: boolean + - name: collapseBoxSetItems + in: query + description: Whether or not to hide items behind their boxsets. + schema: + type: boolean + - name: minWidth + in: query + description: Optional. Filter by the minimum width of the item. + schema: + type: integer + format: int32 + - name: minHeight + in: query + description: Optional. Filter by the minimum height of the item. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. Filter by the maximum width of the item. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. Filter by the maximum height of the item. + schema: + type: integer + format: int32 + - name: is3D + in: query + description: Optional filter by items that are 3D, or not. + schema: + type: boolean + - name: seriesStatus + in: query + description: Optional filter by Series Status. Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/SeriesStatus' + - name: nameStartsWithOrGreater + in: query + description: Optional filter by items whose name is sorted equally or greater than a given input string. + schema: + type: string + - name: nameStartsWith + in: query + description: Optional filter by items whose name is sorted equally than a given input string. + schema: + type: string + - name: nameLessThan + in: query + description: Optional filter by items whose name is equally or lesser than a given input string. + schema: + type: string + - name: studioIds + in: query + description: Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: genreIds + in: query + description: Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: enableTotalRecordCount + in: query + description: Optional. Enable the total record count. + schema: + type: boolean + default: true + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/Items/Resume: + get: + tags: + - Items + summary: Gets items based on a query. + operationId: GetResumeItems + parameters: + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + - name: startIndex + in: query + description: The start index. + schema: + type: integer + format: int32 + - name: limit + in: query + description: The item limit. + schema: + type: integer + format: int32 + - name: searchTerm + in: query + description: The search term. + schema: + type: string + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: mediaTypes + in: query + description: Optional. Filter by MediaType. Allows multiple, comma delimited. + schema: + type: array + items: + type: string + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: enableTotalRecordCount + in: query + description: Optional. Enable the total record count. + schema: + type: boolean + default: true + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + default: true + - name: excludeActiveSessions + in: query + description: Optional. Whether to exclude the currently active sessions. + schema: + type: boolean + default: false + responses: + "200": + description: Items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}: + post: + tags: + - ItemUpdate + summary: Updates an item. + operationId: UpdateItem + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + requestBody: + description: The new item properties. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + text/json: + schema: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + required: true + responses: + "204": + description: Item updated. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + delete: + tags: + - Library + summary: Deletes an item from the library and filesystem. + operationId: DeleteItem + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: Item deleted. + "401": + description: Unauthorized access. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/ContentType: + post: + tags: + - ItemUpdate + summary: Updates an item's content type. + operationId: UpdateItemContentType + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: contentType + in: query + description: The content type of the item. + schema: + type: string + responses: + "204": + description: Item content type updated. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Items/{itemId}/MetadataEditor: + get: + tags: + - ItemUpdate + summary: Gets metadata editor info for an item. + operationId: GetMetadataEditorInfo + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Item metadata editor returned. + content: + application/json: + schema: + $ref: '#/components/schemas/MetadataEditorInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/MetadataEditorInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/MetadataEditorInfo' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Albums/{itemId}/Similar: + get: + tags: + - Library + summary: Gets similar items. + operationId: GetSimilarAlbums + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: excludeArtistIds + in: query + description: Exclude artist ids. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + responses: + "200": + description: Similar items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Artists/{itemId}/Similar: + get: + tags: + - Library + summary: Gets similar items. + operationId: GetSimilarArtists + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: excludeArtistIds + in: query + description: Exclude artist ids. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + responses: + "200": + description: Similar items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/Ancestors: + get: + tags: + - Library + summary: Gets all parents of an item. + operationId: GetAncestors + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Item parents returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/CriticReviews: + get: + tags: + - Library + summary: Gets critic review for an item. + operationId: GetCriticReviews + parameters: + - name: itemId + in: path + required: true + schema: + type: string + responses: + "200": + description: Critic reviews returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/Download: + get: + tags: + - Library + summary: Downloads item media. + operationId: GetDownload + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Media downloaded. + content: + video/*: + schema: + type: string + format: binary + audio/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - Download + /Items/{itemId}/File: + get: + tags: + - Library + summary: Get the original file of an item. + operationId: GetFile + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: File stream returned. + content: + video/*: + schema: + type: string + format: binary + audio/*: + schema: + type: string + format: binary + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/Similar: + get: + tags: + - Library + summary: Gets similar items. + operationId: GetSimilarItems + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: excludeArtistIds + in: query + description: Exclude artist ids. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + responses: + "200": + description: Similar items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/ThemeMedia: + get: + tags: + - Library + summary: Get theme songs and videos for an item. + operationId: GetThemeMedia + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: inheritFromParent + in: query + description: Optional. Determines whether or not parent items should be searched for theme media. + schema: + type: boolean + default: false + responses: + "200": + description: Theme songs and videos returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AllThemeMediaResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/AllThemeMediaResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/AllThemeMediaResult' + "404": + description: Item not found. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/ThemeSongs: + get: + tags: + - Library + summary: Get theme songs for an item. + operationId: GetThemeSongs + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: inheritFromParent + in: query + description: Optional. Determines whether or not parent items should be searched for theme media. + schema: + type: boolean + default: false + responses: + "200": + description: Theme songs returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ThemeMediaResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ThemeMediaResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ThemeMediaResult' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/ThemeVideos: + get: + tags: + - Library + summary: Get theme videos for an item. + operationId: GetThemeVideos + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: inheritFromParent + in: query + description: Optional. Determines whether or not parent items should be searched for theme media. + schema: + type: boolean + default: false + responses: + "200": + description: Theme videos returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ThemeMediaResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ThemeMediaResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ThemeMediaResult' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/Counts: + get: + tags: + - Library + summary: Get item counts. + operationId: GetItemCounts + parameters: + - name: userId + in: query + description: Optional. Get counts from a specific user's library. + schema: + type: string + format: uuid + - name: isFavorite + in: query + description: Optional. Get counts of favorite items. + schema: + type: boolean + responses: + "200": + description: Item counts returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ItemCounts' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ItemCounts' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ItemCounts' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Libraries/AvailableOptions: + get: + tags: + - Library + summary: Gets the library options info. + operationId: GetLibraryOptionsInfo + parameters: + - name: libraryContentType + in: query + description: Library content type. + schema: + type: string + - name: isNewLibrary + in: query + description: Whether this is a new library. + schema: + type: boolean + default: false + responses: + "200": + description: Library options info returned. + content: + application/json: + schema: + $ref: '#/components/schemas/LibraryOptionsResultDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/LibraryOptionsResultDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/LibraryOptionsResultDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrDefault + /Library/Media/Updated: + post: + tags: + - Library + summary: Reports that new movies have been added by an external source. + operationId: PostUpdatedMedia + requestBody: + description: The update paths. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/MediaUpdateInfoDto' + description: Media Update Info Dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/MediaUpdateInfoDto' + description: Media Update Info Dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/MediaUpdateInfoDto' + description: Media Update Info Dto. + required: true + responses: + "204": + description: Report success. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Library/MediaFolders: + get: + tags: + - Library + summary: Gets all user media folders. + operationId: GetMediaFolders + parameters: + - name: isHidden + in: query + description: Optional. Filter by folders that are marked hidden, or not. + schema: + type: boolean + responses: + "200": + description: Media folders returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Library/Movies/Added: + post: + tags: + - Library + summary: Reports that new movies have been added by an external source. + operationId: PostAddedMovies + parameters: + - name: tmdbId + in: query + description: The tmdbId. + schema: + type: string + - name: imdbId + in: query + description: The imdbId. + schema: + type: string + responses: + "204": + description: Report success. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Library/Movies/Updated: + post: + tags: + - Library + summary: Reports that new movies have been added by an external source. + operationId: PostUpdatedMovies + parameters: + - name: tmdbId + in: query + description: The tmdbId. + schema: + type: string + - name: imdbId + in: query + description: The imdbId. + schema: + type: string + responses: + "204": + description: Report success. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Library/PhysicalPaths: + get: + tags: + - Library + summary: Gets a list of physical paths from virtual folders. + operationId: GetPhysicalPaths + responses: + "200": + description: Physical paths returned. + content: + application/json: + schema: + type: array + items: + type: string + application/json; profile="CamelCase": + schema: + type: array + items: + type: string + application/json; profile="PascalCase": + schema: + type: array + items: + type: string + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Library/Refresh: + post: + tags: + - Library + summary: Starts a library scan. + operationId: RefreshLibrary + responses: + "204": + description: Library scan started. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Library/Series/Added: + post: + tags: + - Library + summary: Reports that new episodes of a series have been added by an external source. + operationId: PostAddedSeries + parameters: + - name: tvdbId + in: query + description: The tvdbId. + schema: + type: string + responses: + "204": + description: Report success. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Library/Series/Updated: + post: + tags: + - Library + summary: Reports that new episodes of a series have been added by an external source. + operationId: PostUpdatedSeries + parameters: + - name: tvdbId + in: query + description: The tvdbId. + schema: + type: string + responses: + "204": + description: Report success. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Movies/{itemId}/Similar: + get: + tags: + - Library + summary: Gets similar items. + operationId: GetSimilarMovies + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: excludeArtistIds + in: query + description: Exclude artist ids. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + responses: + "200": + description: Similar items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Shows/{itemId}/Similar: + get: + tags: + - Library + summary: Gets similar items. + operationId: GetSimilarShows + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: excludeArtistIds + in: query + description: Exclude artist ids. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + responses: + "200": + description: Similar items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Trailers/{itemId}/Similar: + get: + tags: + - Library + summary: Gets similar items. + operationId: GetSimilarTrailers + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: excludeArtistIds + in: query + description: Exclude artist ids. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + responses: + "200": + description: Similar items returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Library/VirtualFolders: + get: + tags: + - LibraryStructure + summary: Gets all virtual folders. + operationId: GetVirtualFolders + responses: + "200": + description: Virtual folders retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/VirtualFolderInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/VirtualFolderInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/VirtualFolderInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + post: + tags: + - LibraryStructure + summary: Adds a virtual folder. + operationId: AddVirtualFolder + parameters: + - name: name + in: query + description: The name of the virtual folder. + schema: + type: string + - name: collectionType + in: query + description: The type of the collection. + schema: + allOf: + - $ref: '#/components/schemas/CollectionTypeOptions' + - name: paths + in: query + description: The paths of the virtual folder. + schema: + type: array + items: + type: string + - name: refreshLibrary + in: query + description: Whether to refresh the library. + schema: + type: boolean + default: false + requestBody: + description: The library options. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/AddVirtualFolderDto' + description: Add virtual folder dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/AddVirtualFolderDto' + description: Add virtual folder dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/AddVirtualFolderDto' + description: Add virtual folder dto. + responses: + "204": + description: Folder added. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + delete: + tags: + - LibraryStructure + summary: Removes a virtual folder. + operationId: RemoveVirtualFolder + parameters: + - name: name + in: query + description: The name of the folder. + schema: + type: string + - name: refreshLibrary + in: query + description: Whether to refresh the library. + schema: + type: boolean + default: false + responses: + "204": + description: Folder removed. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + /Library/VirtualFolders/LibraryOptions: + post: + tags: + - LibraryStructure + summary: Update library options. + operationId: UpdateLibraryOptions + requestBody: + description: The library name and options. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateLibraryOptionsDto' + description: Update library options dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateLibraryOptionsDto' + description: Update library options dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateLibraryOptionsDto' + description: Update library options dto. + responses: + "204": + description: Library updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + /Library/VirtualFolders/Name: + post: + tags: + - LibraryStructure + summary: Renames a virtual folder. + operationId: RenameVirtualFolder + parameters: + - name: name + in: query + description: The name of the virtual folder. + schema: + type: string + - name: newName + in: query + description: The new name. + schema: + type: string + - name: refreshLibrary + in: query + description: Whether to refresh the library. + schema: + type: boolean + default: false + responses: + "204": + description: Folder renamed. + "404": + description: Library doesn't exist. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "409": + description: Library already exists. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + /Library/VirtualFolders/Paths: + post: + tags: + - LibraryStructure + summary: Add a media path to a library. + operationId: AddMediaPath + parameters: + - name: refreshLibrary + in: query + description: Whether to refresh the library. + schema: + type: boolean + default: false + requestBody: + description: The media path dto. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/MediaPathDto' + description: Media Path dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/MediaPathDto' + description: Media Path dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/MediaPathDto' + description: Media Path dto. + required: true + responses: + "204": + description: Media path added. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + delete: + tags: + - LibraryStructure + summary: Remove a media path. + operationId: RemoveMediaPath + parameters: + - name: name + in: query + description: The name of the library. + schema: + type: string + - name: path + in: query + description: The path to remove. + schema: + type: string + - name: refreshLibrary + in: query + description: Whether to refresh the library. + schema: + type: boolean + default: false + responses: + "204": + description: Media path removed. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + /Library/VirtualFolders/Paths/Update: + post: + tags: + - LibraryStructure + summary: Updates a media path. + operationId: UpdateMediaPath + requestBody: + description: The name of the library and path infos. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateMediaPathRequestDto' + description: Update library options dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateMediaPathRequestDto' + description: Update library options dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateMediaPathRequestDto' + description: Update library options dto. + required: true + responses: + "204": + description: Media path updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + /LiveTv/ChannelMappingOptions: + get: + tags: + - LiveTv + summary: Get channel mapping options. + operationId: GetChannelMappingOptions + parameters: + - name: providerId + in: query + description: Provider id. + schema: + type: string + responses: + "200": + description: Channel mapping options returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ChannelMappingOptionsDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ChannelMappingOptionsDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ChannelMappingOptionsDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/ChannelMappings: + post: + tags: + - LiveTv + summary: Set channel mappings. + operationId: SetChannelMapping + requestBody: + description: The set channel mapping dto. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SetChannelMappingDto' + description: Set channel mapping dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/SetChannelMappingDto' + description: Set channel mapping dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/SetChannelMappingDto' + description: Set channel mapping dto. + required: true + responses: + "200": + description: Created channel mapping returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TunerChannelMapping' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/TunerChannelMapping' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/TunerChannelMapping' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + /LiveTv/Channels: + get: + tags: + - LiveTv + summary: Gets available live tv channels. + operationId: GetLiveTvChannels + parameters: + - name: type + in: query + description: Optional. Filter by channel type. + schema: + allOf: + - $ref: '#/components/schemas/ChannelType' + - name: userId + in: query + description: Optional. Filter by user and attach user data. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: isMovie + in: query + description: Optional. Filter for movies. + schema: + type: boolean + - name: isSeries + in: query + description: Optional. Filter for series. + schema: + type: boolean + - name: isNews + in: query + description: Optional. Filter for news. + schema: + type: boolean + - name: isKids + in: query + description: Optional. Filter for kids. + schema: + type: boolean + - name: isSports + in: query + description: Optional. Filter for sports. + schema: + type: boolean + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: isFavorite + in: query + description: Optional. Filter by channels that are favorites, or not. + schema: + type: boolean + - name: isLiked + in: query + description: Optional. Filter by channels that are liked, or not. + schema: + type: boolean + - name: isDisliked + in: query + description: Optional. Filter by channels that are disliked, or not. + schema: + type: boolean + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: '"Optional. The image types to include in the output.' + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: sortBy + in: query + description: Optional. Key to sort by. + schema: + type: array + items: + type: string + - name: sortOrder + in: query + description: Optional. Sort order. + schema: + allOf: + - $ref: '#/components/schemas/SortOrder' + - name: enableFavoriteSorting + in: query + description: Optional. Incorporate favorite and like status into channel sorting. + schema: + type: boolean + default: false + - name: addCurrentProgram + in: query + description: Optional. Adds current program info to each channel. + schema: + type: boolean + default: true + responses: + "200": + description: Available live tv channels returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/Channels/{channelId}: + get: + tags: + - LiveTv + summary: Gets a live tv channel. + operationId: GetChannel + parameters: + - name: channelId + in: path + description: Channel id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Live tv channel returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/GuideInfo: + get: + tags: + - LiveTv + summary: Get guid info. + operationId: GetGuideInfo + responses: + "200": + description: Guid info returned. + content: + application/json: + schema: + $ref: '#/components/schemas/GuideInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/GuideInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/GuideInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/Info: + get: + tags: + - LiveTv + summary: Gets available live tv services. + operationId: GetLiveTvInfo + responses: + "200": + description: Available live tv services returned. + content: + application/json: + schema: + $ref: '#/components/schemas/LiveTvInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/LiveTvInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/LiveTvInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/ListingProviders: + post: + tags: + - LiveTv + summary: Adds a listings provider. + operationId: AddListingProvider + parameters: + - name: pw + in: query + description: Password. + schema: + type: string + - name: validateListings + in: query + description: Validate listings. + schema: + type: boolean + default: false + - name: validateLogin + in: query + description: Validate login. + schema: + type: boolean + default: false + requestBody: + description: New listings info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ListingsProviderInfo' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/ListingsProviderInfo' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/ListingsProviderInfo' + responses: + "200": + description: Created listings provider returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ListingsProviderInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ListingsProviderInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ListingsProviderInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + delete: + tags: + - LiveTv + summary: Delete listing provider. + operationId: DeleteListingProvider + parameters: + - name: id + in: query + description: Listing provider id. + schema: + type: string + responses: + "204": + description: Listing provider deleted. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + /LiveTv/ListingProviders/Default: + get: + tags: + - LiveTv + summary: Gets default listings provider info. + operationId: GetDefaultListingProvider + responses: + "200": + description: Default listings provider info returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ListingsProviderInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ListingsProviderInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ListingsProviderInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/ListingProviders/Lineups: + get: + tags: + - LiveTv + summary: Gets available lineups. + operationId: GetLineups + parameters: + - name: id + in: query + description: Provider id. + schema: + type: string + - name: type + in: query + description: Provider type. + schema: + type: string + - name: location + in: query + description: Location. + schema: + type: string + - name: country + in: query + description: Country. + schema: + type: string + responses: + "200": + description: Available lineups returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/ListingProviders/SchedulesDirect/Countries: + get: + tags: + - LiveTv + summary: Gets available countries. + operationId: GetSchedulesDirectCountries + responses: + "200": + description: Available countries returned. + content: + application/json: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/LiveRecordings/{recordingId}/stream: + get: + tags: + - LiveTv + summary: Gets a live tv recording stream. + operationId: GetLiveRecordingFile + parameters: + - name: recordingId + in: path + description: Recording id. + required: true + schema: + type: string + responses: + "200": + description: Recording stream returned. + content: + video/*: + schema: + type: string + format: binary + "404": + description: Recording not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /LiveTv/LiveStreamFiles/{streamId}/stream.{container}: + get: + tags: + - LiveTv + summary: Gets a live tv channel stream. + operationId: GetLiveStreamFile + parameters: + - name: streamId + in: path + description: Stream id. + required: true + schema: + type: string + - name: container + in: path + description: Container type. + required: true + schema: + type: string + responses: + "200": + description: Stream returned. + content: + video/*: + schema: + type: string + format: binary + "404": + description: Stream not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /LiveTv/Programs: + get: + tags: + - LiveTv + summary: Gets available live tv epgs. + operationId: GetLiveTvPrograms + parameters: + - name: channelIds + in: query + description: The channels to return guide information for. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id. + schema: + type: string + format: uuid + - name: minStartDate + in: query + description: Optional. The minimum premiere start date. + schema: + type: string + format: date-time + - name: hasAired + in: query + description: Optional. Filter by programs that have completed airing, or not. + schema: + type: boolean + - name: isAiring + in: query + description: Optional. Filter by programs that are currently airing, or not. + schema: + type: boolean + - name: maxStartDate + in: query + description: Optional. The maximum premiere start date. + schema: + type: string + format: date-time + - name: minEndDate + in: query + description: Optional. The minimum premiere end date. + schema: + type: string + format: date-time + - name: maxEndDate + in: query + description: Optional. The maximum premiere end date. + schema: + type: string + format: date-time + - name: isMovie + in: query + description: Optional. Filter for movies. + schema: + type: boolean + - name: isSeries + in: query + description: Optional. Filter for series. + schema: + type: boolean + - name: isNews + in: query + description: Optional. Filter for news. + schema: + type: boolean + - name: isKids + in: query + description: Optional. Filter for kids. + schema: + type: boolean + - name: isSports + in: query + description: Optional. Filter for sports. + schema: + type: boolean + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: sortBy + in: query + description: 'Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate.' + schema: + type: array + items: + type: string + - name: sortOrder + in: query + description: Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: genres + in: query + description: The genres to return guide information for. + schema: + type: array + items: + type: string + - name: genreIds + in: query + description: The genre ids to return guide information for. + schema: + type: array + items: + type: string + format: uuid + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: seriesTimerId + in: query + description: Optional. Filter by series timer id. + schema: + type: string + - name: librarySeriesId + in: query + description: Optional. Filter by library series id. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableTotalRecordCount + in: query + description: Retrieve total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Live tv epgs returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + post: + tags: + - LiveTv + summary: Gets available live tv epgs. + operationId: GetPrograms + requestBody: + description: Request body. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/GetProgramsDto' + description: Get programs dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/GetProgramsDto' + description: Get programs dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/GetProgramsDto' + description: Get programs dto. + responses: + "200": + description: Live tv epgs returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/Programs/{programId}: + get: + tags: + - LiveTv + summary: Gets a live tv program. + operationId: GetProgram + parameters: + - name: programId + in: path + description: Program id. + required: true + schema: + type: string + - name: userId + in: query + description: Optional. Attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Program returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/Programs/Recommended: + get: + tags: + - LiveTv + summary: Gets recommended live tv epgs. + operationId: GetRecommendedPrograms + parameters: + - name: userId + in: query + description: Optional. filter by user id. + schema: + type: string + format: uuid + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: isAiring + in: query + description: Optional. Filter by programs that are currently airing, or not. + schema: + type: boolean + - name: hasAired + in: query + description: Optional. Filter by programs that have completed airing, or not. + schema: + type: boolean + - name: isSeries + in: query + description: Optional. Filter for series. + schema: + type: boolean + - name: isMovie + in: query + description: Optional. Filter for movies. + schema: + type: boolean + - name: isNews + in: query + description: Optional. Filter for news. + schema: + type: boolean + - name: isKids + in: query + description: Optional. Filter for kids. + schema: + type: boolean + - name: isSports + in: query + description: Optional. Filter for sports. + schema: + type: boolean + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: genreIds + in: query + description: The genres to return guide information for. + schema: + type: array + items: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableUserData + in: query + description: Optional. include user data. + schema: + type: boolean + - name: enableTotalRecordCount + in: query + description: Retrieve total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Recommended epgs returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/Recordings: + get: + tags: + - LiveTv + summary: Gets live tv recordings. + operationId: GetRecordings + parameters: + - name: channelId + in: query + description: Optional. Filter by channel id. + schema: + type: string + - name: userId + in: query + description: Optional. Filter by user and attach user data. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: status + in: query + description: Optional. Filter by recording status. + schema: + allOf: + - $ref: '#/components/schemas/RecordingStatus' + - name: isInProgress + in: query + description: Optional. Filter by recordings that are in progress, or not. + schema: + type: boolean + - name: seriesTimerId + in: query + description: Optional. Filter by recordings belonging to a series timer. + schema: + type: string + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: isMovie + in: query + description: Optional. Filter for movies. + schema: + type: boolean + - name: isSeries + in: query + description: Optional. Filter for series. + schema: + type: boolean + - name: isKids + in: query + description: Optional. Filter for kids. + schema: + type: boolean + - name: isSports + in: query + description: Optional. Filter for sports. + schema: + type: boolean + - name: isNews + in: query + description: Optional. Filter for news. + schema: + type: boolean + - name: isLibraryItem + in: query + description: Optional. Filter for is library item. + schema: + type: boolean + - name: enableTotalRecordCount + in: query + description: Optional. Return total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Live tv recordings returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/Recordings/{recordingId}: + get: + tags: + - LiveTv + summary: Gets a live tv recording. + operationId: GetRecording + parameters: + - name: recordingId + in: path + description: Recording id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Recording returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + delete: + tags: + - LiveTv + summary: Deletes a live tv recording. + operationId: DeleteRecording + parameters: + - name: recordingId + in: path + description: Recording id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: Recording deleted. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + /LiveTv/Recordings/Folders: + get: + tags: + - LiveTv + summary: Gets recording folders. + operationId: GetRecordingFolders + parameters: + - name: userId + in: query + description: Optional. Filter by user and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Recording folders returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/Recordings/Groups: + get: + tags: + - LiveTv + summary: Gets live tv recording groups. + operationId: GetRecordingGroups + parameters: + - name: userId + in: query + description: Optional. Filter by user and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Recording groups returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/Recordings/Groups/{groupId}: + get: + tags: + - LiveTv + summary: Get recording group. + operationId: GetRecordingGroup + parameters: + - name: groupId + in: path + description: Group id. + required: true + schema: + type: string + format: uuid + responses: + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/Recordings/Series: + get: + tags: + - LiveTv + summary: Gets live tv recording series. + operationId: GetRecordingsSeries + parameters: + - name: channelId + in: query + description: Optional. Filter by channel id. + schema: + type: string + - name: userId + in: query + description: Optional. Filter by user and attach user data. + schema: + type: string + format: uuid + - name: groupId + in: query + description: Optional. Filter by recording group. + schema: + type: string + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: status + in: query + description: Optional. Filter by recording status. + schema: + allOf: + - $ref: '#/components/schemas/RecordingStatus' + - name: isInProgress + in: query + description: Optional. Filter by recordings that are in progress, or not. + schema: + type: boolean + - name: seriesTimerId + in: query + description: Optional. Filter by recordings belonging to a series timer. + schema: + type: string + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: enableTotalRecordCount + in: query + description: Optional. Return total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Live tv recordings returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/SeriesTimers: + get: + tags: + - LiveTv + summary: Gets live tv series timers. + operationId: GetSeriesTimers + parameters: + - name: sortBy + in: query + description: Optional. Sort by SortName or Priority. + schema: + type: string + - name: sortOrder + in: query + description: Optional. Sort in Ascending or Descending order. + schema: + allOf: + - $ref: '#/components/schemas/SortOrder' + responses: + "200": + description: Timers returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SeriesTimerInfoDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/SeriesTimerInfoDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/SeriesTimerInfoDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + post: + tags: + - LiveTv + summary: Creates a live tv series timer. + operationId: CreateSeriesTimer + requestBody: + description: New series timer info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesTimerInfoDto' + description: Class SeriesTimerInfoDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesTimerInfoDto' + description: Class SeriesTimerInfoDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesTimerInfoDto' + description: Class SeriesTimerInfoDto. + responses: + "204": + description: Series timer info created. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + /LiveTv/SeriesTimers/{timerId}: + get: + tags: + - LiveTv + summary: Gets a live tv series timer. + operationId: GetSeriesTimer + parameters: + - name: timerId + in: path + description: Timer id. + required: true + schema: + type: string + responses: + "200": + description: Series timer returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SeriesTimerInfoDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/SeriesTimerInfoDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/SeriesTimerInfoDto' + "404": + description: Series timer not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + delete: + tags: + - LiveTv + summary: Cancels a live tv series timer. + operationId: CancelSeriesTimer + parameters: + - name: timerId + in: path + description: Timer id. + required: true + schema: + type: string + responses: + "204": + description: Timer cancelled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + post: + tags: + - LiveTv + summary: Updates a live tv series timer. + operationId: UpdateSeriesTimer + parameters: + - name: timerId + in: path + description: Timer id. + required: true + schema: + type: string + requestBody: + description: New series timer info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesTimerInfoDto' + description: Class SeriesTimerInfoDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesTimerInfoDto' + description: Class SeriesTimerInfoDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/SeriesTimerInfoDto' + description: Class SeriesTimerInfoDto. + responses: + "204": + description: Series timer updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + /LiveTv/Timers: + get: + tags: + - LiveTv + summary: Gets the live tv timers. + operationId: GetTimers + parameters: + - name: channelId + in: query + description: Optional. Filter by channel id. + schema: + type: string + - name: seriesTimerId + in: query + description: Optional. Filter by timers belonging to a series timer. + schema: + type: string + - name: isActive + in: query + description: Optional. Filter by timers that are active. + schema: + type: boolean + - name: isScheduled + in: query + description: Optional. Filter by timers that are scheduled. + schema: + type: boolean + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/TimerInfoDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/TimerInfoDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/TimerInfoDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + post: + tags: + - LiveTv + summary: Creates a live tv timer. + operationId: CreateTimer + requestBody: + description: New timer info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/TimerInfoDto' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/TimerInfoDto' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/TimerInfoDto' + responses: + "204": + description: Timer created. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + /LiveTv/Timers/{timerId}: + get: + tags: + - LiveTv + summary: Gets a timer. + operationId: GetTimer + parameters: + - name: timerId + in: path + description: Timer id. + required: true + schema: + type: string + responses: + "200": + description: Timer returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TimerInfoDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/TimerInfoDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/TimerInfoDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + delete: + tags: + - LiveTv + summary: Cancels a live tv timer. + operationId: CancelTimer + parameters: + - name: timerId + in: path + description: Timer id. + required: true + schema: + type: string + responses: + "204": + description: Timer deleted. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + post: + tags: + - LiveTv + summary: Updates a live tv timer. + operationId: UpdateTimer + parameters: + - name: timerId + in: path + description: Timer id. + required: true + schema: + type: string + requestBody: + description: New timer info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/TimerInfoDto' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/TimerInfoDto' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/TimerInfoDto' + responses: + "204": + description: Timer updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + /LiveTv/Timers/Defaults: + get: + tags: + - LiveTv + summary: Gets the default values for a new timer. + operationId: GetDefaultTimer + parameters: + - name: programId + in: query + description: Optional. To attach default values based on a program. + schema: + type: string + responses: + "200": + description: Default values returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SeriesTimerInfoDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/SeriesTimerInfoDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/SeriesTimerInfoDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/TunerHosts: + post: + tags: + - LiveTv + summary: Adds a tuner host. + operationId: AddTunerHost + requestBody: + description: New tuner host. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/TunerHostInfo' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/TunerHostInfo' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/TunerHostInfo' + responses: + "200": + description: Created tuner host returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TunerHostInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/TunerHostInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/TunerHostInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + delete: + tags: + - LiveTv + summary: Deletes a tuner host. + operationId: DeleteTunerHost + parameters: + - name: id + in: query + description: Tuner host id. + schema: + type: string + responses: + "204": + description: Tuner host deleted. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + /LiveTv/TunerHosts/Types: + get: + tags: + - LiveTv + summary: Get tuner host types. + operationId: GetTunerHostTypes + responses: + "200": + description: Tuner host types returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvAccess + /LiveTv/Tuners/{tunerId}/Reset: + post: + tags: + - LiveTv + summary: Resets a tv tuner. + operationId: ResetTuner + parameters: + - name: tunerId + in: path + description: Tuner id. + required: true + schema: + type: string + responses: + "204": + description: Tuner reset. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + /LiveTv/Tuners/Discover: + get: + tags: + - LiveTv + summary: Discover tuners. + operationId: DiscoverTuners + parameters: + - name: newDevicesOnly + in: query + description: Only discover new tuners. + schema: + type: boolean + default: false + responses: + "200": + description: Tuners returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TunerHostInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/TunerHostInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/TunerHostInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + /LiveTv/Tuners/Discvover: + get: + tags: + - LiveTv + summary: Discover tuners. + operationId: DiscvoverTuners + parameters: + - name: newDevicesOnly + in: query + description: Only discover new tuners. + schema: + type: boolean + default: false + responses: + "200": + description: Tuners returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TunerHostInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/TunerHostInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/TunerHostInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LiveTvManagement + /Localization/Countries: + get: + tags: + - Localization + summary: Gets known countries. + operationId: GetCountries + responses: + "200": + description: Known countries returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CountryInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/CountryInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/CountryInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrDefault + /Localization/Cultures: + get: + tags: + - Localization + summary: Gets known cultures. + operationId: GetCultures + responses: + "200": + description: Known cultures returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CultureDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/CultureDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/CultureDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrDefault + /Localization/Options: + get: + tags: + - Localization + summary: Gets localization options. + operationId: GetLocalizationOptions + responses: + "200": + description: Localization options returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/LocalizationOption' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/LocalizationOption' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/LocalizationOption' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrDefault + /Localization/ParentalRatings: + get: + tags: + - Localization + summary: Gets known parental ratings. + operationId: GetParentalRatings + responses: + "200": + description: Known parental ratings returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ParentalRating' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/ParentalRating' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/ParentalRating' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrDefault + /Items/{itemId}/PlaybackInfo: + get: + tags: + - MediaInfo + summary: Gets live playback media info for an item. + operationId: GetPlaybackInfo + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: The user id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Playback info returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PlaybackInfoResponse' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/PlaybackInfoResponse' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/PlaybackInfoResponse' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + post: + tags: + - MediaInfo + summary: Gets live playback media info for an item. + description: "For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.\r\nQuery parameters are obsolete." + operationId: GetPostedPlaybackInfo + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: The user id. + deprecated: true + schema: + type: string + format: uuid + - name: maxStreamingBitrate + in: query + description: The maximum streaming bitrate. + deprecated: true + schema: + type: integer + format: int32 + - name: startTimeTicks + in: query + description: The start time in ticks. + deprecated: true + schema: + type: integer + format: int64 + - name: audioStreamIndex + in: query + description: The audio stream index. + deprecated: true + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: The subtitle stream index. + deprecated: true + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: The maximum number of audio channels. + deprecated: true + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media source id. + deprecated: true + schema: + type: string + - name: liveStreamId + in: query + description: The livestream id. + deprecated: true + schema: + type: string + - name: autoOpenLiveStream + in: query + description: Whether to auto open the livestream. + deprecated: true + schema: + type: boolean + - name: enableDirectPlay + in: query + description: 'Whether to enable direct play. Default: true.' + deprecated: true + schema: + type: boolean + - name: enableDirectStream + in: query + description: 'Whether to enable direct stream. Default: true.' + deprecated: true + schema: + type: boolean + - name: enableTranscoding + in: query + description: 'Whether to enable transcoding. Default: true.' + deprecated: true + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: 'Whether to allow to copy the video stream. Default: true.' + deprecated: true + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: 'Whether to allow to copy the audio stream. Default: true.' + deprecated: true + schema: + type: boolean + requestBody: + description: The playback info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackInfoDto' + description: Plabyback info dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackInfoDto' + description: Plabyback info dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackInfoDto' + description: Plabyback info dto. + responses: + "200": + description: Playback info returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PlaybackInfoResponse' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/PlaybackInfoResponse' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/PlaybackInfoResponse' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /LiveStreams/Close: + post: + tags: + - MediaInfo + summary: Closes a media source. + operationId: CloseLiveStream + parameters: + - name: liveStreamId + in: query + description: The livestream id. + required: true + schema: + type: string + responses: + "204": + description: Livestream closed. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /LiveStreams/Open: + post: + tags: + - MediaInfo + summary: Opens a media source. + operationId: OpenLiveStream + parameters: + - name: openToken + in: query + description: The open token. + schema: + type: string + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: maxStreamingBitrate + in: query + description: The maximum streaming bitrate. + schema: + type: integer + format: int32 + - name: startTimeTicks + in: query + description: The start time in ticks. + schema: + type: integer + format: int64 + - name: audioStreamIndex + in: query + description: The audio stream index. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: The subtitle stream index. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: The maximum number of audio channels. + schema: + type: integer + format: int32 + - name: itemId + in: query + description: The item id. + schema: + type: string + format: uuid + - name: enableDirectPlay + in: query + description: 'Whether to enable direct play. Default: true.' + schema: + type: boolean + - name: enableDirectStream + in: query + description: 'Whether to enable direct stream. Default: true.' + schema: + type: boolean + requestBody: + description: The open live stream dto. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OpenLiveStreamDto' + description: Open live stream dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/OpenLiveStreamDto' + description: Open live stream dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/OpenLiveStreamDto' + description: Open live stream dto. + responses: + "200": + description: Media source opened. + content: + application/json: + schema: + $ref: '#/components/schemas/LiveStreamResponse' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/LiveStreamResponse' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/LiveStreamResponse' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Playback/BitrateTest: + get: + tags: + - MediaInfo + summary: Tests the network with a request with the size of the bitrate. + operationId: GetBitrateTestBytes + parameters: + - name: size + in: query + description: The bitrate. Defaults to 102400. + schema: + maximum: 100000000 + minimum: 1 + type: integer + format: int32 + default: 102400 + responses: + "200": + description: Test buffer returned. + content: + application/octet-stream: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Movies/Recommendations: + get: + tags: + - Movies + summary: Gets movie recommendations. + operationId: GetMovieRecommendations + parameters: + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. The fields to return. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: categoryLimit + in: query + description: The max number of categories to return. + schema: + type: integer + format: int32 + default: 5 + - name: itemLimit + in: query + description: The max number of items to return per category. + schema: + type: integer + format: int32 + default: 8 + responses: + "200": + description: Movie recommendations returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RecommendationDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RecommendationDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RecommendationDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /MusicGenres: + get: + tags: + - MusicGenres + summary: Gets all music genres from a given item, folder, or the entire library. + operationId: GetMusicGenres + parameters: + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: searchTerm + in: query + description: The search term. + schema: + type: string + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: nameStartsWithOrGreater + in: query + description: Optional filter by items whose name is sorted equally or greater than a given input string. + schema: + type: string + - name: nameStartsWith + in: query + description: Optional filter by items whose name is sorted equally than a given input string. + schema: + type: string + - name: nameLessThan + in: query + description: Optional filter by items whose name is equally or lesser than a given input string. + schema: + type: string + - name: sortBy + in: query + description: Optional. Specify one or more sort orders, comma delimited. + schema: + type: array + items: + type: string + - name: sortOrder + in: query + description: Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + - name: enableTotalRecordCount + in: query + description: Optional. Include total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Music genres returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - DefaultAuthorization + /MusicGenres/{genreName}: + get: + tags: + - MusicGenres + summary: Gets a music genre, by name. + operationId: GetMusicGenre + parameters: + - name: genreName + in: path + description: The genre name. + required: true + schema: + type: string + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Notifications/{userId}: + get: + tags: + - Notifications + summary: Gets a user's notifications. + operationId: GetNotifications + parameters: + - name: userId + in: path + required: true + schema: + type: string + responses: + "200": + description: Notifications returned. + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationResultDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/NotificationResultDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/NotificationResultDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Notifications/{userId}/Read: + post: + tags: + - Notifications + summary: Sets notifications as read. + operationId: SetRead + parameters: + - name: userId + in: path + required: true + schema: + type: string + responses: + "204": + description: Notifications set as read. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Notifications/{userId}/Summary: + get: + tags: + - Notifications + summary: Gets a user's notification summary. + operationId: GetNotificationsSummary + parameters: + - name: userId + in: path + required: true + schema: + type: string + responses: + "200": + description: Summary of user's notifications returned. + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationsSummaryDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/NotificationsSummaryDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/NotificationsSummaryDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Notifications/{userId}/Unread: + post: + tags: + - Notifications + summary: Sets notifications as unread. + operationId: SetUnread + parameters: + - name: userId + in: path + required: true + schema: + type: string + responses: + "204": + description: Notifications set as unread. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Notifications/Admin: + post: + tags: + - Notifications + summary: Sends a notification to all admins. + operationId: CreateAdminNotification + requestBody: + description: The notification request. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/AdminNotificationDto' + description: The admin notification dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/AdminNotificationDto' + description: The admin notification dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/AdminNotificationDto' + description: The admin notification dto. + required: true + responses: + "204": + description: Notification sent. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Notifications/Services: + get: + tags: + - Notifications + summary: Gets notification services. + operationId: GetNotificationServices + responses: + "200": + description: All notification services returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Notifications/Types: + get: + tags: + - Notifications + summary: Gets notification types. + operationId: GetNotificationTypes + responses: + "200": + description: All notification types returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NotificationTypeInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/NotificationTypeInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/NotificationTypeInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Packages: + get: + tags: + - Package + summary: Gets available packages. + operationId: GetPackages + responses: + "200": + description: Available packages returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PackageInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/PackageInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/PackageInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Packages/{name}: + get: + tags: + - Package + summary: Gets a package by name or assembly GUID. + operationId: GetPackageInfo + parameters: + - name: name + in: path + description: The name of the package. + required: true + schema: + type: string + - name: assemblyGuid + in: query + description: The GUID of the associated assembly. + schema: + type: string + format: uuid + responses: + "200": + description: Package retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/PackageInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/PackageInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/PackageInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Packages/Installed/{name}: + post: + tags: + - Package + summary: Installs a package. + operationId: InstallPackage + parameters: + - name: name + in: path + description: Package name. + required: true + schema: + type: string + - name: assemblyGuid + in: query + description: GUID of the associated assembly. + schema: + type: string + format: uuid + - name: version + in: query + description: Optional version. Defaults to latest version. + schema: + type: string + - name: repositoryUrl + in: query + description: Optional. Specify the repository to install from. + schema: + type: string + responses: + "204": + description: Package found. + "404": + description: Package not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /Packages/Installing/{packageId}: + delete: + tags: + - Package + summary: Cancels a package installation. + operationId: CancelPackageInstallation + parameters: + - name: packageId + in: path + description: Installation Id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: Installation cancelled. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /Repositories: + get: + tags: + - Package + summary: Gets all package repositories. + operationId: GetRepositories + responses: + "200": + description: Package repositories returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RepositoryInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RepositoryInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RepositoryInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + post: + tags: + - Package + summary: Sets the enabled and existing package repositories. + operationId: SetRepositories + requestBody: + description: The list of package repositories. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RepositoryInfo' + text/json: + schema: + type: array + items: + $ref: '#/components/schemas/RepositoryInfo' + application/*+json: + schema: + type: array + items: + $ref: '#/components/schemas/RepositoryInfo' + required: true + responses: + "204": + description: Package repositories saved. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /Persons: + get: + tags: + - Persons + summary: Gets all persons. + operationId: GetPersons + parameters: + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: searchTerm + in: query + description: The search term. + schema: + type: string + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: filters + in: query + description: Optional. Specify additional filters to apply. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFilter' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. userId is required. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional, include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: excludePersonTypes + in: query + description: Optional. If specified results will be filtered to exclude those containing the specified PersonType. Allows multiple, comma-delimited. + schema: + type: array + items: + type: string + - name: personTypes + in: query + description: Optional. If specified results will be filtered to include only those containing the specified PersonType. Allows multiple, comma-delimited. + schema: + type: array + items: + type: string + - name: appearsInItemId + in: query + description: Optional. If specified, person results will be filtered on items related to said persons. + schema: + type: string + format: uuid + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + responses: + "200": + description: Persons returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Persons/{name}: + get: + tags: + - Persons + summary: Get person by name. + operationId: GetPerson + parameters: + - name: name + in: path + description: Person name. + required: true + schema: + type: string + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Person returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "404": + description: Person not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Playlists: + post: + tags: + - Playlists + summary: Creates a new playlist. + description: "For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.\r\nQuery parameters are obsolete." + operationId: CreatePlaylist + parameters: + - name: name + in: query + description: The playlist name. + deprecated: true + schema: + type: string + - name: ids + in: query + description: The item ids. + deprecated: true + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: The user id. + deprecated: true + schema: + type: string + format: uuid + - name: mediaType + in: query + description: The media type. + deprecated: true + schema: + type: string + requestBody: + description: The create playlist payload. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CreatePlaylistDto' + description: Create new playlist dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/CreatePlaylistDto' + description: Create new playlist dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/CreatePlaylistDto' + description: Create new playlist dto. + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/PlaylistCreationResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/PlaylistCreationResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/PlaylistCreationResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Playlists/{playlistId}/Items: + post: + tags: + - Playlists + summary: Adds items to a playlist. + operationId: AddToPlaylist + parameters: + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + format: uuid + - name: ids + in: query + description: Item id, comma delimited. + schema: + type: array + items: + type: string + format: uuid + - name: userId + in: query + description: The userId. + schema: + type: string + format: uuid + responses: + "204": + description: Items added to playlist. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - Playlists + summary: Removes items from a playlist. + operationId: RemoveFromPlaylist + parameters: + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + - name: entryIds + in: query + description: The item ids, comma delimited. + schema: + type: array + items: + type: string + responses: + "204": + description: Items removed. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + get: + tags: + - Playlists + summary: Gets the original items of a playlist. + operationId: GetPlaylistItems + parameters: + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: User id. + required: true + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + responses: + "200": + description: Original playlist returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "404": + description: Playlist not found. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Playlists/{playlistId}/Items/{itemId}/Move/{newIndex}: + post: + tags: + - Playlists + summary: Moves a playlist item. + operationId: MoveItem + parameters: + - name: playlistId + in: path + description: The playlist id. + required: true + schema: + type: string + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + - name: newIndex + in: path + description: The new index. + required: true + schema: + type: integer + format: int32 + responses: + "204": + description: Item moved to new index. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/Playing: + post: + tags: + - Playstate + summary: Reports playback has started within a session. + operationId: ReportPlaybackStart + requestBody: + description: The playback start info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackStartInfo' + description: Class PlaybackStartInfo. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackStartInfo' + description: Class PlaybackStartInfo. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackStartInfo' + description: Class PlaybackStartInfo. + responses: + "204": + description: Playback start recorded. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/Playing/Ping: + post: + tags: + - Playstate + summary: Pings a playback session. + operationId: PingPlaybackSession + parameters: + - name: playSessionId + in: query + description: Playback session id. + required: true + schema: + type: string + responses: + "204": + description: Playback session pinged. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/Playing/Progress: + post: + tags: + - Playstate + summary: Reports playback progress within a session. + operationId: ReportPlaybackProgress + requestBody: + description: The playback progress info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackProgressInfo' + description: Class PlaybackProgressInfo. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackProgressInfo' + description: Class PlaybackProgressInfo. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackProgressInfo' + description: Class PlaybackProgressInfo. + responses: + "204": + description: Playback progress recorded. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/Playing/Stopped: + post: + tags: + - Playstate + summary: Reports playback has stopped within a session. + operationId: ReportPlaybackStopped + requestBody: + description: The playback stop info. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackStopInfo' + description: Class PlaybackStopInfo. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackStopInfo' + description: Class PlaybackStopInfo. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/PlaybackStopInfo' + description: Class PlaybackStopInfo. + responses: + "204": + description: Playback stop recorded. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/PlayedItems/{itemId}: + post: + tags: + - Playstate + summary: Marks an item as played for user. + operationId: MarkPlayedItem + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: datePlayed + in: query + description: Optional. The date the item was played. + schema: + type: string + format: date-time + responses: + "200": + description: Item marked as played. + content: + application/json: + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - Playstate + summary: Marks an item as unplayed for user. + operationId: MarkUnplayedItem + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Item marked as unplayed. + content: + application/json: + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/PlayingItems/{itemId}: + post: + tags: + - Playstate + summary: Reports that a user has begun playing an item. + operationId: OnPlaybackStart + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: mediaSourceId + in: query + description: The id of the MediaSource. + schema: + type: string + - name: audioStreamIndex + in: query + description: The audio stream index. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: The subtitle stream index. + schema: + type: integer + format: int32 + - name: playMethod + in: query + description: The play method. + schema: + allOf: + - $ref: '#/components/schemas/PlayMethod' + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: canSeek + in: query + description: Indicates if the client can seek. + schema: + type: boolean + default: false + responses: + "204": + description: Play start recorded. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - Playstate + summary: Reports that a user has stopped playing an item. + operationId: OnPlaybackStopped + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: mediaSourceId + in: query + description: The id of the MediaSource. + schema: + type: string + - name: nextMediaType + in: query + description: The next media type that will play. + schema: + type: string + - name: positionTicks + in: query + description: Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + responses: + "204": + description: Playback stop recorded. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/PlayingItems/{itemId}/Progress: + post: + tags: + - Playstate + summary: Reports a user's playback progress. + operationId: OnPlaybackProgress + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: mediaSourceId + in: query + description: The id of the MediaSource. + schema: + type: string + - name: positionTicks + in: query + description: Optional. The current position, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: audioStreamIndex + in: query + description: The audio stream index. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: The subtitle stream index. + schema: + type: integer + format: int32 + - name: volumeLevel + in: query + description: Scale of 0-100. + schema: + type: integer + format: int32 + - name: playMethod + in: query + description: The play method. + schema: + allOf: + - $ref: '#/components/schemas/PlayMethod' + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: repeatMode + in: query + description: The repeat mode. + schema: + allOf: + - $ref: '#/components/schemas/RepeatMode' + - name: isPaused + in: query + description: Indicates if the player is paused. + schema: + type: boolean + default: false + - name: isMuted + in: query + description: Indicates if the player is muted. + schema: + type: boolean + default: false + responses: + "204": + description: Play progress recorded. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Plugins: + get: + tags: + - Plugins + summary: Gets a list of currently installed plugins. + operationId: GetPlugins + responses: + "200": + description: Installed plugins returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PluginInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/PluginInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/PluginInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Plugins/{pluginId}: + delete: + tags: + - Plugins + summary: Uninstalls a plugin. + operationId: UninstallPlugin + parameters: + - name: pluginId + in: path + description: Plugin id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: Plugin uninstalled. + "404": + description: Plugin not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /Plugins/{pluginId}/{version}: + delete: + tags: + - Plugins + summary: Uninstalls a plugin by version. + operationId: UninstallPluginByVersion + parameters: + - name: pluginId + in: path + description: Plugin id. + required: true + schema: + type: string + format: uuid + - name: version + in: path + description: Plugin version. + required: true + schema: + type: string + responses: + "204": + description: Plugin uninstalled. + "404": + description: Plugin not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /Plugins/{pluginId}/{version}/Disable: + post: + tags: + - Plugins + summary: Disable a plugin. + operationId: DisablePlugin + parameters: + - name: pluginId + in: path + description: Plugin id. + required: true + schema: + type: string + format: uuid + - name: version + in: path + description: Plugin version. + required: true + schema: + type: string + responses: + "204": + description: Plugin disabled. + "404": + description: Plugin not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /Plugins/{pluginId}/{version}/Enable: + post: + tags: + - Plugins + summary: Enables a disabled plugin. + operationId: EnablePlugin + parameters: + - name: pluginId + in: path + description: Plugin id. + required: true + schema: + type: string + format: uuid + - name: version + in: path + description: Plugin version. + required: true + schema: + type: string + responses: + "204": + description: Plugin enabled. + "404": + description: Plugin not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + - DefaultAuthorization + /Plugins/{pluginId}/{version}/Image: + get: + tags: + - Plugins + summary: Gets a plugin's image. + operationId: GetPluginImage + parameters: + - name: pluginId + in: path + description: Plugin id. + required: true + schema: + type: string + format: uuid + - name: version + in: path + description: Plugin version. + required: true + schema: + type: string + responses: + "200": + description: Plugin image returned. + content: + image/*: + schema: + type: string + format: binary + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Plugins/{pluginId}/Configuration: + get: + tags: + - Plugins + summary: Gets plugin configuration. + operationId: GetPluginConfiguration + parameters: + - name: pluginId + in: path + description: Plugin id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Plugin configuration returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BasePluginConfiguration' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BasePluginConfiguration' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BasePluginConfiguration' + "404": + description: Plugin not found or plugin configuration not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + post: + tags: + - Plugins + summary: Updates plugin configuration. + description: Accepts plugin configuration as JSON body. + operationId: UpdatePluginConfiguration + parameters: + - name: pluginId + in: path + description: Plugin id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: Plugin configuration updated. + "404": + description: Plugin not found or plugin does not have configuration. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Plugins/{pluginId}/Manifest: + post: + tags: + - Plugins + summary: Gets a plugin's manifest. + operationId: GetPluginManifest + parameters: + - name: pluginId + in: path + description: Plugin id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: Plugin manifest returned. + "404": + description: Plugin not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /QuickConnect/Authorize: + post: + tags: + - QuickConnect + summary: Authorizes a pending quick connect request. + operationId: Authorize + parameters: + - name: code + in: query + description: Quick connect code to authorize. + required: true + schema: + type: string + responses: + "200": + description: Quick connect result authorized successfully. + content: + application/json: + schema: + type: boolean + application/json; profile="CamelCase": + schema: + type: boolean + application/json; profile="PascalCase": + schema: + type: boolean + "403": + description: Unknown user id. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + /QuickConnect/Connect: + get: + tags: + - QuickConnect + summary: Attempts to retrieve authentication information. + operationId: Connect + parameters: + - name: secret + in: query + description: Secret previously returned from the Initiate endpoint. + required: true + schema: + type: string + responses: + "200": + description: Quick connect result returned. + content: + application/json: + schema: + $ref: '#/components/schemas/QuickConnectResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/QuickConnectResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/QuickConnectResult' + "404": + description: Unknown quick connect secret. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /QuickConnect/Enabled: + get: + tags: + - QuickConnect + summary: Gets the current quick connect state. + operationId: GetEnabled + responses: + "200": + description: Quick connect state returned. + content: + application/json: + schema: + type: boolean + application/json; profile="CamelCase": + schema: + type: boolean + application/json; profile="PascalCase": + schema: + type: boolean + /QuickConnect/Initiate: + get: + tags: + - QuickConnect + summary: Initiate a new quick connect request. + operationId: Initiate + responses: + "200": + description: Quick connect request successfully created. + content: + application/json: + schema: + $ref: '#/components/schemas/QuickConnectResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/QuickConnectResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/QuickConnectResult' + "401": + description: Quick connect is not active on this server. + /Items/{itemId}/RemoteImages: + get: + tags: + - RemoteImage + summary: Gets available remote images for an item. + operationId: GetRemoteImages + parameters: + - name: itemId + in: path + description: Item Id. + required: true + schema: + type: string + format: uuid + - name: type + in: query + description: The image type. + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: providerName + in: query + description: Optional. The image provider to use. + schema: + type: string + - name: includeAllLanguages + in: query + description: Optional. Include all languages. + schema: + type: boolean + default: false + responses: + "200": + description: Remote Images returned. + content: + application/json: + schema: + $ref: '#/components/schemas/RemoteImageResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/RemoteImageResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/RemoteImageResult' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/RemoteImages/Download: + post: + tags: + - RemoteImage + summary: Downloads a remote image for an item. + operationId: DownloadRemoteImage + parameters: + - name: itemId + in: path + description: Item Id. + required: true + schema: + type: string + format: uuid + - name: type + in: query + description: The image type. + required: true + schema: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Enum ImageType. + - name: imageUrl + in: query + description: The image url. + schema: + type: string + responses: + "204": + description: Remote image downloaded. + "404": + description: Remote image not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Items/{itemId}/RemoteImages/Providers: + get: + tags: + - RemoteImage + summary: Gets available remote image providers for an item. + operationId: GetRemoteImageProviders + parameters: + - name: itemId + in: path + description: Item Id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Returned remote image providers. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ImageProviderInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/ImageProviderInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/ImageProviderInfo' + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /ScheduledTasks: + get: + tags: + - ScheduledTasks + summary: Get tasks. + operationId: GetTasks + parameters: + - name: isHidden + in: query + description: Optional filter tasks that are hidden, or not. + schema: + type: boolean + - name: isEnabled + in: query + description: Optional filter tasks that are enabled, or not. + schema: + type: boolean + responses: + "200": + description: Scheduled tasks retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TaskInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/TaskInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/TaskInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /ScheduledTasks/{taskId}: + get: + tags: + - ScheduledTasks + summary: Get task by id. + operationId: GetTask + parameters: + - name: taskId + in: path + description: Task Id. + required: true + schema: + type: string + responses: + "200": + description: Task retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/TaskInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/TaskInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/TaskInfo' + "404": + description: Task not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /ScheduledTasks/{taskId}/Triggers: + post: + tags: + - ScheduledTasks + summary: Update specified task triggers. + operationId: UpdateTask + parameters: + - name: taskId + in: path + description: Task Id. + required: true + schema: + type: string + requestBody: + description: Triggers. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TaskTriggerInfo' + text/json: + schema: + type: array + items: + $ref: '#/components/schemas/TaskTriggerInfo' + application/*+json: + schema: + type: array + items: + $ref: '#/components/schemas/TaskTriggerInfo' + required: true + responses: + "204": + description: Task triggers updated. + "404": + description: Task not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /ScheduledTasks/Running/{taskId}: + post: + tags: + - ScheduledTasks + summary: Start specified task. + operationId: StartTask + parameters: + - name: taskId + in: path + description: Task Id. + required: true + schema: + type: string + responses: + "204": + description: Task started. + "404": + description: Task not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + delete: + tags: + - ScheduledTasks + summary: Stop specified task. + operationId: StopTask + parameters: + - name: taskId + in: path + description: Task Id. + required: true + schema: + type: string + responses: + "204": + description: Task stopped. + "404": + description: Task not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Search/Hints: + get: + tags: + - Search + summary: Gets the search hint result. + operationId: Get + parameters: + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: userId + in: query + description: Optional. Supply a user id to search within a user's library or omit to search all. + schema: + type: string + format: uuid + - name: searchTerm + in: query + description: The search term to filter on. + required: true + schema: + type: string + - name: includeItemTypes + in: query + description: If specified, only results with the specified item types are returned. This allows multiple, comma delimeted. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: excludeItemTypes + in: query + description: If specified, results with these item types are filtered out. This allows multiple, comma delimeted. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: mediaTypes + in: query + description: If specified, only results with the specified media types are returned. This allows multiple, comma delimeted. + schema: + type: array + items: + type: string + - name: parentId + in: query + description: If specified, only children of the parent are returned. + schema: + type: string + format: uuid + - name: isMovie + in: query + description: Optional filter for movies. + schema: + type: boolean + - name: isSeries + in: query + description: Optional filter for series. + schema: + type: boolean + - name: isNews + in: query + description: Optional filter for news. + schema: + type: boolean + - name: isKids + in: query + description: Optional filter for kids. + schema: + type: boolean + - name: isSports + in: query + description: Optional filter for sports. + schema: + type: boolean + - name: includePeople + in: query + description: Optional filter whether to include people. + schema: + type: boolean + default: true + - name: includeMedia + in: query + description: Optional filter whether to include media. + schema: + type: boolean + default: true + - name: includeGenres + in: query + description: Optional filter whether to include genres. + schema: + type: boolean + default: true + - name: includeStudios + in: query + description: Optional filter whether to include studios. + schema: + type: boolean + default: true + - name: includeArtists + in: query + description: Optional filter whether to include artists. + schema: + type: boolean + default: true + responses: + "200": + description: Search hint returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SearchHintResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/SearchHintResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/SearchHintResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Auth/PasswordResetProviders: + get: + tags: + - Session + summary: Get all password reset providers. + operationId: GetPasswordResetProviders + responses: + "200": + description: Password reset providers retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Auth/Providers: + get: + tags: + - Session + summary: Get all auth providers. + operationId: GetAuthProviders + responses: + "200": + description: Auth providers retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Sessions: + get: + tags: + - Session + summary: Gets a list of sessions. + operationId: GetSessions + parameters: + - name: controllableByUserId + in: query + description: Filter by sessions that a given user is allowed to remote control. + schema: + type: string + format: uuid + - name: deviceId + in: query + description: Filter by device Id. + schema: + type: string + - name: activeWithinSeconds + in: query + description: Optional. Filter by sessions that were active in the last n seconds. + schema: + type: integer + format: int32 + responses: + "200": + description: List of sessions returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SessionInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/SessionInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/SessionInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/{sessionId}/Command: + post: + tags: + - Session + summary: Issues a full general command to a client. + operationId: SendFullGeneralCommand + parameters: + - name: sessionId + in: path + description: The session id. + required: true + schema: + type: string + requestBody: + description: The MediaBrowser.Model.Session.GeneralCommand. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/GeneralCommand' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/GeneralCommand' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/GeneralCommand' + required: true + responses: + "204": + description: Full general command sent to session. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/{sessionId}/Command/{command}: + post: + tags: + - Session + summary: Issues a general command to a client. + operationId: SendGeneralCommand + parameters: + - name: sessionId + in: path + description: The session id. + required: true + schema: + type: string + - name: command + in: path + description: The command to send. + required: true + schema: + allOf: + - $ref: '#/components/schemas/GeneralCommandType' + description: This exists simply to identify a set of known commands. + responses: + "204": + description: General command sent to session. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/{sessionId}/Message: + post: + tags: + - Session + summary: Issues a command to a client to display a message to the user. + operationId: SendMessageCommand + parameters: + - name: sessionId + in: path + description: The session id. + required: true + schema: + type: string + requestBody: + description: The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and TimeoutMs. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/MessageCommand' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/MessageCommand' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/MessageCommand' + required: true + responses: + "204": + description: Message sent. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/{sessionId}/Playing: + post: + tags: + - Session + summary: Instructs a session to play an item. + operationId: Play + parameters: + - name: sessionId + in: path + description: The session id. + required: true + schema: + type: string + - name: playCommand + in: query + description: The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet implemented play next and play last may play now. + required: true + schema: + allOf: + - $ref: '#/components/schemas/PlayCommand' + description: Enum PlayCommand. + - name: itemIds + in: query + description: The ids of the items to play, comma delimited. + required: true + schema: + type: array + items: + type: string + format: uuid + - name: startPositionTicks + in: query + description: The starting position of the first item. + schema: + type: integer + format: int64 + - name: mediaSourceId + in: query + description: Optional. The media source id. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to play. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to play. + schema: + type: integer + format: int32 + - name: startIndex + in: query + description: Optional. The start index. + schema: + type: integer + format: int32 + responses: + "204": + description: Instruction sent to session. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/{sessionId}/Playing/{command}: + post: + tags: + - Session + summary: Issues a playstate command to a client. + operationId: SendPlaystateCommand + parameters: + - name: sessionId + in: path + description: The session id. + required: true + schema: + type: string + - name: command + in: path + description: The MediaBrowser.Model.Session.PlaystateCommand. + required: true + schema: + allOf: + - $ref: '#/components/schemas/PlaystateCommand' + description: Enum PlaystateCommand. + - name: seekPositionTicks + in: query + description: The optional position ticks. + schema: + type: integer + format: int64 + - name: controllingUserId + in: query + description: The optional controlling user id. + schema: + type: string + responses: + "204": + description: Playstate command sent to session. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/{sessionId}/System/{command}: + post: + tags: + - Session + summary: Issues a system command to a client. + operationId: SendSystemCommand + parameters: + - name: sessionId + in: path + description: The session id. + required: true + schema: + type: string + - name: command + in: path + description: The command to send. + required: true + schema: + allOf: + - $ref: '#/components/schemas/GeneralCommandType' + description: This exists simply to identify a set of known commands. + responses: + "204": + description: System command sent to session. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/{sessionId}/User/{userId}: + post: + tags: + - Session + summary: Adds an additional user to a session. + operationId: AddUserToSession + parameters: + - name: sessionId + in: path + description: The session id. + required: true + schema: + type: string + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: User added to session. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - Session + summary: Removes an additional user from a session. + operationId: RemoveUserFromSession + parameters: + - name: sessionId + in: path + description: The session id. + required: true + schema: + type: string + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: User removed from session. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/{sessionId}/Viewing: + post: + tags: + - Session + summary: Instructs a session to browse to an item or view. + operationId: DisplayContent + parameters: + - name: sessionId + in: path + description: The session Id. + required: true + schema: + type: string + - name: itemType + in: query + description: The type of item to browse to. + required: true + schema: + allOf: + - $ref: '#/components/schemas/BaseItemKind' + description: The base item kind. + - name: itemId + in: query + description: The Id of the item. + required: true + schema: + type: string + - name: itemName + in: query + description: The name of the item. + required: true + schema: + type: string + responses: + "204": + description: Instruction sent to session. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/Capabilities: + post: + tags: + - Session + summary: Updates capabilities for a device. + operationId: PostCapabilities + parameters: + - name: id + in: query + description: The session id. + schema: + type: string + - name: playableMediaTypes + in: query + description: A list of playable media types, comma delimited. Audio, Video, Book, Photo. + schema: + type: array + items: + type: string + - name: supportedCommands + in: query + description: A list of supported remote control commands, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/GeneralCommandType' + - name: supportsMediaControl + in: query + description: Determines whether media can be played remotely.. + schema: + type: boolean + default: false + - name: supportsSync + in: query + description: Determines whether sync is supported. + schema: + type: boolean + default: false + - name: supportsPersistentIdentifier + in: query + description: Determines whether the device supports a unique identifier. + schema: + type: boolean + default: true + responses: + "204": + description: Capabilities posted. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/Capabilities/Full: + post: + tags: + - Session + summary: Updates capabilities for a device. + operationId: PostFullCapabilities + parameters: + - name: id + in: query + description: The session id. + schema: + type: string + requestBody: + description: The MediaBrowser.Model.Session.ClientCapabilities. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ClientCapabilitiesDto' + description: Client capabilities dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/ClientCapabilitiesDto' + description: Client capabilities dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/ClientCapabilitiesDto' + description: Client capabilities dto. + required: true + responses: + "204": + description: Capabilities updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/Logout: + post: + tags: + - Session + summary: Reports that a session has ended. + operationId: ReportSessionEnded + responses: + "204": + description: Session end reported to server. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Sessions/Viewing: + post: + tags: + - Session + summary: Reports that a session is viewing an item. + operationId: ReportViewing + parameters: + - name: sessionId + in: query + description: The session id. + schema: + type: string + - name: itemId + in: query + description: The item id. + required: true + schema: + type: string + responses: + "204": + description: Session reported to server. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Startup/Complete: + post: + tags: + - Startup + summary: Completes the startup wizard. + operationId: CompleteWizard + responses: + "204": + description: Startup wizard completed. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + /Startup/Configuration: + get: + tags: + - Startup + summary: Gets the initial startup wizard configuration. + operationId: GetStartupConfiguration + responses: + "200": + description: Initial startup wizard configuration retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/StartupConfigurationDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/StartupConfigurationDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/StartupConfigurationDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + post: + tags: + - Startup + summary: Sets the initial startup wizard configuration. + operationId: UpdateInitialConfiguration + requestBody: + description: The updated startup configuration. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/StartupConfigurationDto' + description: The startup configuration DTO. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/StartupConfigurationDto' + description: The startup configuration DTO. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/StartupConfigurationDto' + description: The startup configuration DTO. + required: true + responses: + "204": + description: Configuration saved. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + /Startup/FirstUser: + get: + tags: + - Startup + summary: Gets the first user. + operationId: GetFirstUser_2 + responses: + "200": + description: Initial user retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/StartupUserDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/StartupUserDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/StartupUserDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + /Startup/RemoteAccess: + post: + tags: + - Startup + summary: Sets remote access and UPnP. + operationId: SetRemoteAccess + requestBody: + description: The startup remote access dto. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/StartupRemoteAccessDto' + description: Startup remote access dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/StartupRemoteAccessDto' + description: Startup remote access dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/StartupRemoteAccessDto' + description: Startup remote access dto. + required: true + responses: + "204": + description: Configuration saved. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + /Startup/User: + get: + tags: + - Startup + summary: Gets the first user. + operationId: GetFirstUser + responses: + "200": + description: Initial user retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/StartupUserDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/StartupUserDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/StartupUserDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + post: + tags: + - Startup + summary: Sets the user name and password. + operationId: UpdateStartupUser + requestBody: + description: The DTO containing username and password. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/StartupUserDto' + description: The startup user DTO. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/StartupUserDto' + description: The startup user DTO. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/StartupUserDto' + description: The startup user DTO. + responses: + "204": + description: Updated user name and password. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrElevated + /Studios: + get: + tags: + - Studios + summary: Gets all studios from a given item, folder, or the entire library. + operationId: GetStudios + parameters: + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: searchTerm + in: query + description: Optional. Search term. + schema: + type: string + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. + schema: + type: boolean + - name: enableUserData + in: query + description: Optional, include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: userId + in: query + description: User id. + schema: + type: string + format: uuid + - name: nameStartsWithOrGreater + in: query + description: Optional filter by items whose name is sorted equally or greater than a given input string. + schema: + type: string + - name: nameStartsWith + in: query + description: Optional filter by items whose name is sorted equally than a given input string. + schema: + type: string + - name: nameLessThan + in: query + description: Optional filter by items whose name is equally or lesser than a given input string. + schema: + type: string + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + - name: enableTotalRecordCount + in: query + description: Total record count. + schema: + type: boolean + default: true + responses: + "200": + description: Studios returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Studios/{name}: + get: + tags: + - Studios + summary: Gets a studio by name. + operationId: GetStudio + parameters: + - name: name + in: path + description: Studio name. + required: true + schema: + type: string + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Studio returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /FallbackFont/Fonts: + get: + tags: + - Subtitle + summary: Gets a list of available fallback font files. + operationId: GetFallbackFontList + responses: + "200": + description: Information retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FontFile' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/FontFile' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/FontFile' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /FallbackFont/Fonts/{name}: + get: + tags: + - Subtitle + summary: Gets a fallback font file. + operationId: GetFallbackFont + parameters: + - name: name + in: path + description: The name of the fallback font file to get. + required: true + schema: + type: string + responses: + "200": + description: Fallback font file retrieved. + content: + font/*: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/RemoteSearch/Subtitles/{language}: + get: + tags: + - Subtitle + summary: Search remote subtitles. + operationId: SearchRemoteSubtitles + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: language + in: path + description: The language of the subtitles. + required: true + schema: + type: string + - name: isPerfectMatch + in: query + description: Optional. Only show subtitles which are a perfect match. + schema: + type: boolean + responses: + "200": + description: Subtitles retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSubtitleInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSubtitleInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/RemoteSubtitleInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Items/{itemId}/RemoteSearch/Subtitles/{subtitleId}: + post: + tags: + - Subtitle + summary: Downloads a remote subtitle. + operationId: DownloadRemoteSubtitles + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: subtitleId + in: path + description: The subtitle id. + required: true + schema: + type: string + responses: + "204": + description: Subtitle downloaded. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Providers/Subtitles/Subtitles/{id}: + get: + tags: + - Subtitle + summary: Gets the remote subtitles. + operationId: GetRemoteSubtitles + parameters: + - name: id + in: path + description: The item id. + required: true + schema: + type: string + responses: + "200": + description: File returned. + content: + text/*: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{itemId}/{mediaSourceId}/Subtitles/{index}/subtitles.m3u8: + get: + tags: + - Subtitle + summary: Gets an HLS subtitle playlist. + operationId: GetSubtitlePlaylist + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: index + in: path + description: The subtitle stream index. + required: true + schema: + type: integer + format: int32 + - name: mediaSourceId + in: path + description: The media source id. + required: true + schema: + type: string + - name: segmentLength + in: query + description: The subtitle segment length. + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: Subtitle playlist retrieved. + content: + application/x-mpegURL: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{itemId}/Subtitles: + post: + tags: + - Subtitle + summary: Upload an external subtitle file. + operationId: UploadSubtitle + parameters: + - name: itemId + in: path + description: The item the subtitle belongs to. + required: true + schema: + type: string + format: uuid + requestBody: + description: The request body. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UploadSubtitleDto' + description: Upload subtitles dto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UploadSubtitleDto' + description: Upload subtitles dto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UploadSubtitleDto' + description: Upload subtitles dto. + required: true + responses: + "204": + description: Subtitle uploaded. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Videos/{itemId}/Subtitles/{index}: + delete: + tags: + - Subtitle + summary: Deletes an external subtitle file. + operationId: DeleteSubtitle + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: index + in: path + description: The index of the subtitle file. + required: true + schema: + type: integer + format: int32 + responses: + "204": + description: Subtitle deleted. + "404": + description: Item not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/{routeStartPositionTicks}/Stream.{routeFormat}: + get: + tags: + - Subtitle + summary: Gets subtitles in a specified format. + operationId: GetSubtitleWithTicks + parameters: + - name: routeItemId + in: path + description: The (route) item id. + required: true + schema: + type: string + format: uuid + - name: routeMediaSourceId + in: path + description: The (route) media source id. + required: true + schema: + type: string + - name: routeIndex + in: path + description: The (route) subtitle stream index. + required: true + schema: + type: integer + format: int32 + - name: routeStartPositionTicks + in: path + description: The (route) start position of the subtitle in ticks. + required: true + schema: + type: integer + format: int64 + - name: routeFormat + in: path + description: The (route) format of the returned subtitle. + required: true + schema: + type: string + - name: itemId + in: query + description: The item id. + deprecated: true + schema: + type: string + format: uuid + - name: mediaSourceId + in: query + description: The media source id. + deprecated: true + schema: + type: string + - name: index + in: query + description: The subtitle stream index. + deprecated: true + schema: + type: integer + format: int32 + - name: startPositionTicks + in: query + description: The start position of the subtitle in ticks. + deprecated: true + schema: + type: integer + format: int64 + - name: format + in: query + description: The format of the returned subtitle. + deprecated: true + schema: + type: string + - name: endPositionTicks + in: query + description: Optional. The end position of the subtitle in ticks. + schema: + type: integer + format: int64 + - name: copyTimestamps + in: query + description: Optional. Whether to copy the timestamps. + schema: + type: boolean + default: false + - name: addVttTimeMap + in: query + description: Optional. Whether to add a VTT time map. + schema: + type: boolean + default: false + responses: + "200": + description: File returned. + content: + text/*: + schema: + type: string + format: binary + /Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/Stream.{routeFormat}: + get: + tags: + - Subtitle + summary: Gets subtitles in a specified format. + operationId: GetSubtitle + parameters: + - name: routeItemId + in: path + description: The (route) item id. + required: true + schema: + type: string + format: uuid + - name: routeMediaSourceId + in: path + description: The (route) media source id. + required: true + schema: + type: string + - name: routeIndex + in: path + description: The (route) subtitle stream index. + required: true + schema: + type: integer + format: int32 + - name: routeFormat + in: path + description: The (route) format of the returned subtitle. + required: true + schema: + type: string + - name: itemId + in: query + description: The item id. + deprecated: true + schema: + type: string + format: uuid + - name: mediaSourceId + in: query + description: The media source id. + deprecated: true + schema: + type: string + - name: index + in: query + description: The subtitle stream index. + deprecated: true + schema: + type: integer + format: int32 + - name: format + in: query + description: The format of the returned subtitle. + deprecated: true + schema: + type: string + - name: endPositionTicks + in: query + description: Optional. The end position of the subtitle in ticks. + schema: + type: integer + format: int64 + - name: copyTimestamps + in: query + description: Optional. Whether to copy the timestamps. + schema: + type: boolean + default: false + - name: addVttTimeMap + in: query + description: Optional. Whether to add a VTT time map. + schema: + type: boolean + default: false + - name: startPositionTicks + in: query + description: The start position of the subtitle in ticks. + schema: + type: integer + format: int64 + default: 0 + responses: + "200": + description: File returned. + content: + text/*: + schema: + type: string + format: binary + /Users/{userId}/Suggestions: + get: + tags: + - Suggestions + summary: Gets suggestions. + operationId: GetSuggestions + parameters: + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + - name: mediaType + in: query + description: The media types. + schema: + type: array + items: + type: string + - name: type + in: query + description: The type. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: startIndex + in: query + description: Optional. The start index. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The limit. + schema: + type: integer + format: int32 + - name: enableTotalRecordCount + in: query + description: Whether to enable the total record count. + schema: + type: boolean + default: false + responses: + "200": + description: Suggestions returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /SyncPlay/Buffering: + post: + tags: + - SyncPlay + summary: Notify SyncPlay group that member is buffering. + operationId: SyncPlayBuffering + requestBody: + description: The player status. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/BufferRequestDto' + description: Class BufferRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/BufferRequestDto' + description: Class BufferRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/BufferRequestDto' + description: Class BufferRequestDto. + required: true + responses: + "204": + description: Group state update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /SyncPlay/Join: + post: + tags: + - SyncPlay + summary: Join an existing SyncPlay group. + operationId: SyncPlayJoinGroup + requestBody: + description: The group to join. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/JoinGroupRequestDto' + description: Class JoinGroupRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/JoinGroupRequestDto' + description: Class JoinGroupRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/JoinGroupRequestDto' + description: Class JoinGroupRequestDto. + required: true + responses: + "204": + description: Group join successful. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayJoinGroup + - SyncPlayHasAccess + /SyncPlay/Leave: + post: + tags: + - SyncPlay + summary: Leave the joined SyncPlay group. + operationId: SyncPlayLeaveGroup + responses: + "204": + description: Group leave successful. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /SyncPlay/List: + get: + tags: + - SyncPlay + summary: Gets all SyncPlay groups. + operationId: SyncPlayGetGroups + responses: + "200": + description: Groups returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GroupInfoDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/GroupInfoDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/GroupInfoDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayJoinGroup + - SyncPlayHasAccess + /SyncPlay/MovePlaylistItem: + post: + tags: + - SyncPlay + summary: Request to move an item in the playlist in SyncPlay group. + operationId: SyncPlayMovePlaylistItem + requestBody: + description: The new position for the item. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/MovePlaylistItemRequestDto' + description: Class MovePlaylistItemRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/MovePlaylistItemRequestDto' + description: Class MovePlaylistItemRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/MovePlaylistItemRequestDto' + description: Class MovePlaylistItemRequestDto. + required: true + responses: + "204": + description: Queue update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /SyncPlay/New: + post: + tags: + - SyncPlay + summary: Create a new SyncPlay group. + operationId: SyncPlayCreateGroup + requestBody: + description: The settings of the new group. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/NewGroupRequestDto' + description: Class NewGroupRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/NewGroupRequestDto' + description: Class NewGroupRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/NewGroupRequestDto' + description: Class NewGroupRequestDto. + required: true + responses: + "204": + description: New group created. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayCreateGroup + - SyncPlayHasAccess + /SyncPlay/NextItem: + post: + tags: + - SyncPlay + summary: Request next item in SyncPlay group. + operationId: SyncPlayNextItem + requestBody: + description: The current item information. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/NextItemRequestDto' + description: Class NextItemRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/NextItemRequestDto' + description: Class NextItemRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/NextItemRequestDto' + description: Class NextItemRequestDto. + required: true + responses: + "204": + description: Next item update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /SyncPlay/Pause: + post: + tags: + - SyncPlay + summary: Request pause in SyncPlay group. + operationId: SyncPlayPause + responses: + "204": + description: Pause update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /SyncPlay/Ping: + post: + tags: + - SyncPlay + summary: Update session ping. + operationId: SyncPlayPing + requestBody: + description: The new ping. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PingRequestDto' + description: Class PingRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/PingRequestDto' + description: Class PingRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/PingRequestDto' + description: Class PingRequestDto. + required: true + responses: + "204": + description: Ping updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayHasAccess + /SyncPlay/PreviousItem: + post: + tags: + - SyncPlay + summary: Request previous item in SyncPlay group. + operationId: SyncPlayPreviousItem + requestBody: + description: The current item information. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PreviousItemRequestDto' + description: Class PreviousItemRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/PreviousItemRequestDto' + description: Class PreviousItemRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/PreviousItemRequestDto' + description: Class PreviousItemRequestDto. + required: true + responses: + "204": + description: Previous item update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /SyncPlay/Queue: + post: + tags: + - SyncPlay + summary: Request to queue items to the playlist of a SyncPlay group. + operationId: SyncPlayQueue + requestBody: + description: The items to add. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/QueueRequestDto' + description: Class QueueRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/QueueRequestDto' + description: Class QueueRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/QueueRequestDto' + description: Class QueueRequestDto. + required: true + responses: + "204": + description: Queue update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /SyncPlay/Ready: + post: + tags: + - SyncPlay + summary: Notify SyncPlay group that member is ready for playback. + operationId: SyncPlayReady + requestBody: + description: The player status. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ReadyRequestDto' + description: Class ReadyRequest. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/ReadyRequestDto' + description: Class ReadyRequest. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/ReadyRequestDto' + description: Class ReadyRequest. + required: true + responses: + "204": + description: Group state update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /SyncPlay/RemoveFromPlaylist: + post: + tags: + - SyncPlay + summary: Request to remove items from the playlist in SyncPlay group. + operationId: SyncPlayRemoveFromPlaylist + requestBody: + description: The items to remove. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/RemoveFromPlaylistRequestDto' + description: Class RemoveFromPlaylistRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/RemoveFromPlaylistRequestDto' + description: Class RemoveFromPlaylistRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/RemoveFromPlaylistRequestDto' + description: Class RemoveFromPlaylistRequestDto. + required: true + responses: + "204": + description: Queue update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /SyncPlay/Seek: + post: + tags: + - SyncPlay + summary: Request seek in SyncPlay group. + operationId: SyncPlaySeek + requestBody: + description: The new playback position. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SeekRequestDto' + description: Class SeekRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/SeekRequestDto' + description: Class SeekRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/SeekRequestDto' + description: Class SeekRequestDto. + required: true + responses: + "204": + description: Seek update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /SyncPlay/SetIgnoreWait: + post: + tags: + - SyncPlay + summary: Request SyncPlay group to ignore member during group-wait. + operationId: SyncPlaySetIgnoreWait + requestBody: + description: The settings to set. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/IgnoreWaitRequestDto' + description: Class IgnoreWaitRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/IgnoreWaitRequestDto' + description: Class IgnoreWaitRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/IgnoreWaitRequestDto' + description: Class IgnoreWaitRequestDto. + required: true + responses: + "204": + description: Member state updated. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /SyncPlay/SetNewQueue: + post: + tags: + - SyncPlay + summary: Request to set new playlist in SyncPlay group. + operationId: SyncPlaySetNewQueue + requestBody: + description: The new playlist to play in the group. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PlayRequestDto' + description: Class PlayRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/PlayRequestDto' + description: Class PlayRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/PlayRequestDto' + description: Class PlayRequestDto. + required: true + responses: + "204": + description: Queue update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /SyncPlay/SetPlaylistItem: + post: + tags: + - SyncPlay + summary: Request to change playlist item in SyncPlay group. + operationId: SyncPlaySetPlaylistItem + requestBody: + description: The new item to play. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SetPlaylistItemRequestDto' + description: Class SetPlaylistItemRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/SetPlaylistItemRequestDto' + description: Class SetPlaylistItemRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/SetPlaylistItemRequestDto' + description: Class SetPlaylistItemRequestDto. + required: true + responses: + "204": + description: Queue update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /SyncPlay/SetRepeatMode: + post: + tags: + - SyncPlay + summary: Request to set repeat mode in SyncPlay group. + operationId: SyncPlaySetRepeatMode + requestBody: + description: The new repeat mode. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SetRepeatModeRequestDto' + description: Class SetRepeatModeRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/SetRepeatModeRequestDto' + description: Class SetRepeatModeRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/SetRepeatModeRequestDto' + description: Class SetRepeatModeRequestDto. + required: true + responses: + "204": + description: Play queue update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /SyncPlay/SetShuffleMode: + post: + tags: + - SyncPlay + summary: Request to set shuffle mode in SyncPlay group. + operationId: SyncPlaySetShuffleMode + requestBody: + description: The new shuffle mode. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SetShuffleModeRequestDto' + description: Class SetShuffleModeRequestDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/SetShuffleModeRequestDto' + description: Class SetShuffleModeRequestDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/SetShuffleModeRequestDto' + description: Class SetShuffleModeRequestDto. + required: true + responses: + "204": + description: Play queue update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /SyncPlay/Stop: + post: + tags: + - SyncPlay + summary: Request stop in SyncPlay group. + operationId: SyncPlayStop + responses: + "204": + description: Stop update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /SyncPlay/Unpause: + post: + tags: + - SyncPlay + summary: Request unpause in SyncPlay group. + operationId: SyncPlayUnpause + responses: + "204": + description: Unpause update sent to all group members. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - SyncPlayIsInGroup + - SyncPlayHasAccess + /System/Endpoint: + get: + tags: + - System + summary: Gets information about the request endpoint. + operationId: GetEndpointInfo + responses: + "200": + description: Information retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/EndPointInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/EndPointInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/EndPointInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /System/Info: + get: + tags: + - System + summary: Gets information about the server. + operationId: GetSystemInfo + responses: + "200": + description: Information retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/SystemInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/SystemInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/SystemInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - FirstTimeSetupOrIgnoreParentalControl + /System/Info/Public: + get: + tags: + - System + summary: Gets public information about the server. + operationId: GetPublicSystemInfo + responses: + "200": + description: Information retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/PublicSystemInfo' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/PublicSystemInfo' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/PublicSystemInfo' + /System/Logs: + get: + tags: + - System + summary: Gets a list of available server log files. + operationId: GetServerLogs + responses: + "200": + description: Information retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/LogFile' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/LogFile' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/LogFile' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /System/Logs/Log: + get: + tags: + - System + summary: Gets a log file. + operationId: GetLogFile + parameters: + - name: name + in: query + description: The name of the log file to get. + required: true + schema: + type: string + responses: + "200": + description: Log file retrieved. + content: + text/plain: + schema: + type: string + format: binary + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /System/Ping: + get: + tags: + - System + summary: Pings the system. + operationId: GetPingSystem + responses: + "200": + description: Information retrieved. + content: + application/json: + schema: + type: string + application/json; profile="CamelCase": + schema: + type: string + application/json; profile="PascalCase": + schema: + type: string + post: + tags: + - System + summary: Pings the system. + operationId: PostPingSystem + responses: + "200": + description: Information retrieved. + content: + application/json: + schema: + type: string + application/json; profile="CamelCase": + schema: + type: string + application/json; profile="PascalCase": + schema: + type: string + /System/Restart: + post: + tags: + - System + summary: Restarts the application. + operationId: RestartApplication + responses: + "204": + description: Server restarted. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - LocalAccessOrRequiresElevation + /System/Shutdown: + post: + tags: + - System + summary: Shuts down the application. + operationId: ShutdownApplication + responses: + "204": + description: Server shut down. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /System/WakeOnLanInfo: + get: + tags: + - System + summary: Gets wake on lan information. + operationId: GetWakeOnLanInfo + responses: + "200": + description: Information retrieved. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/WakeOnLanInfo' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/WakeOnLanInfo' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/WakeOnLanInfo' + "401": + description: Unauthorized + "403": + description: Forbidden + deprecated: true + security: + - CustomAuthentication: + - DefaultAuthorization + /GetUtcTime: + get: + tags: + - TimeSync + summary: Gets the current UTC time. + operationId: GetUtcTime + responses: + "200": + description: Time returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UtcTimeResponse' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UtcTimeResponse' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UtcTimeResponse' + /Tmdb/ClientConfiguration: + get: + tags: + - Tmdb + summary: Gets the TMDb image configuration options. + operationId: TmdbClientConfiguration + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigImageTypes' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Trailers: + get: + tags: + - Trailers + summary: Finds movies and trailers similar to a given trailer. + operationId: GetTrailers + parameters: + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + - name: maxOfficialRating + in: query + description: Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). + schema: + type: string + - name: hasThemeSong + in: query + description: Optional filter by items with theme songs. + schema: + type: boolean + - name: hasThemeVideo + in: query + description: Optional filter by items with theme videos. + schema: + type: boolean + - name: hasSubtitles + in: query + description: Optional filter by items with subtitles. + schema: + type: boolean + - name: hasSpecialFeature + in: query + description: Optional filter by items with special features. + schema: + type: boolean + - name: hasTrailer + in: query + description: Optional filter by items with trailers. + schema: + type: boolean + - name: adjacentTo + in: query + description: Optional. Return items that are siblings of a supplied item. + schema: + type: string + - name: parentIndexNumber + in: query + description: Optional filter by parent index number. + schema: + type: integer + format: int32 + - name: hasParentalRating + in: query + description: Optional filter by items that have or do not have a parental rating. + schema: + type: boolean + - name: isHd + in: query + description: Optional filter by items that are HD or not. + schema: + type: boolean + - name: is4K + in: query + description: Optional filter by items that are 4K or not. + schema: + type: boolean + - name: locationTypes + in: query + description: Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/LocationType' + - name: excludeLocationTypes + in: query + description: Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/LocationType' + - name: isMissing + in: query + description: Optional filter by items that are missing episodes or not. + schema: + type: boolean + - name: isUnaired + in: query + description: Optional filter by items that are unaired episodes or not. + schema: + type: boolean + - name: minCommunityRating + in: query + description: Optional filter by minimum community rating. + schema: + type: number + format: double + - name: minCriticRating + in: query + description: Optional filter by minimum critic rating. + schema: + type: number + format: double + - name: minPremiereDate + in: query + description: Optional. The minimum premiere date. Format = ISO. + schema: + type: string + format: date-time + - name: minDateLastSaved + in: query + description: Optional. The minimum last saved date. Format = ISO. + schema: + type: string + format: date-time + - name: minDateLastSavedForUser + in: query + description: Optional. The minimum last saved date for the current user. Format = ISO. + schema: + type: string + format: date-time + - name: maxPremiereDate + in: query + description: Optional. The maximum premiere date. Format = ISO. + schema: + type: string + format: date-time + - name: hasOverview + in: query + description: Optional filter by items that have an overview or not. + schema: + type: boolean + - name: hasImdbId + in: query + description: Optional filter by items that have an imdb id or not. + schema: + type: boolean + - name: hasTmdbId + in: query + description: Optional filter by items that have a tmdb id or not. + schema: + type: boolean + - name: hasTvdbId + in: query + description: Optional filter by items that have a tvdb id or not. + schema: + type: boolean + - name: isMovie + in: query + description: Optional filter for live tv movies. + schema: + type: boolean + - name: isSeries + in: query + description: Optional filter for live tv series. + schema: + type: boolean + - name: isNews + in: query + description: Optional filter for live tv news. + schema: + type: boolean + - name: isKids + in: query + description: Optional filter for live tv kids. + schema: + type: boolean + - name: isSports + in: query + description: Optional filter for live tv sports. + schema: + type: boolean + - name: excludeItemIds + in: query + description: Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited. + schema: + type: array + items: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: recursive + in: query + description: When searching within folders, this determines whether or not the search will be recursive. true/false. + schema: + type: boolean + - name: searchTerm + in: query + description: Optional. Filter based on a search term. + schema: + type: string + - name: sortOrder + in: query + description: Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: filters + in: query + description: 'Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFilter' + - name: isFavorite + in: query + description: Optional filter by items that are marked as favorite, or not. + schema: + type: boolean + - name: mediaTypes + in: query + description: Optional filter by MediaType. Allows multiple, comma delimited. + schema: + type: array + items: + type: string + - name: imageTypes + in: query + description: Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: sortBy + in: query + description: 'Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.' + schema: + type: array + items: + type: string + - name: isPlayed + in: query + description: Optional filter by items that are played, or not. + schema: + type: boolean + - name: genres + in: query + description: Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: officialRatings + in: query + description: Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: tags + in: query + description: Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: years + in: query + description: Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. + schema: + type: array + items: + type: integer + format: int32 + - name: enableUserData + in: query + description: Optional, include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: person + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person. + schema: + type: string + - name: personIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified person id. + schema: + type: array + items: + type: string + format: uuid + - name: personTypes + in: query + description: Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. + schema: + type: array + items: + type: string + - name: studios + in: query + description: Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: artists + in: query + description: Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: excludeArtistIds + in: query + description: Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: artistIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified artist id. + schema: + type: array + items: + type: string + format: uuid + - name: albumArtistIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified album artist id. + schema: + type: array + items: + type: string + format: uuid + - name: contributingArtistIds + in: query + description: Optional. If specified, results will be filtered to include only those containing the specified contributing artist id. + schema: + type: array + items: + type: string + format: uuid + - name: albums + in: query + description: Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + - name: albumIds + in: query + description: Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: ids + in: query + description: Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited. + schema: + type: array + items: + type: string + format: uuid + - name: videoTypes + in: query + description: Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/VideoType' + - name: minOfficialRating + in: query + description: Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). + schema: + type: string + - name: isLocked + in: query + description: Optional filter by items that are locked. + schema: + type: boolean + - name: isPlaceHolder + in: query + description: Optional filter by items that are placeholders. + schema: + type: boolean + - name: hasOfficialRating + in: query + description: Optional filter by items that have official ratings. + schema: + type: boolean + - name: collapseBoxSetItems + in: query + description: Whether or not to hide items behind their boxsets. + schema: + type: boolean + - name: minWidth + in: query + description: Optional. Filter by the minimum width of the item. + schema: + type: integer + format: int32 + - name: minHeight + in: query + description: Optional. Filter by the minimum height of the item. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. Filter by the maximum width of the item. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. Filter by the maximum height of the item. + schema: + type: integer + format: int32 + - name: is3D + in: query + description: Optional filter by items that are 3D, or not. + schema: + type: boolean + - name: seriesStatus + in: query + description: Optional filter by Series Status. Allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/SeriesStatus' + - name: nameStartsWithOrGreater + in: query + description: Optional filter by items whose name is sorted equally or greater than a given input string. + schema: + type: string + - name: nameStartsWith + in: query + description: Optional filter by items whose name is sorted equally than a given input string. + schema: + type: string + - name: nameLessThan + in: query + description: Optional filter by items whose name is equally or lesser than a given input string. + schema: + type: string + - name: studioIds + in: query + description: Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: genreIds + in: query + description: Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. + schema: + type: array + items: + type: string + format: uuid + - name: enableTotalRecordCount + in: query + description: Optional. Enable the total record count. + schema: + type: boolean + default: true + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + default: true + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Shows/{seriesId}/Episodes: + get: + tags: + - TvShows + summary: Gets episodes for a tv season. + operationId: GetEpisodes + parameters: + - name: seriesId + in: path + description: The series id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: season + in: query + description: Optional filter by season number. + schema: + type: integer + format: int32 + - name: seasonId + in: query + description: Optional. Filter by season id. + schema: + type: string + format: uuid + - name: isMissing + in: query + description: Optional. Filter by items that are missing episodes or not. + schema: + type: boolean + - name: adjacentTo + in: query + description: Optional. Return items that are siblings of a supplied item. + schema: + type: string + - name: startItemId + in: query + description: Optional. Skip through the list until a given item is found. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: enableImages + in: query + description: Optional, include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional, the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: sortBy + in: query + description: 'Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.' + schema: + type: string + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Shows/{seriesId}/Seasons: + get: + tags: + - TvShows + summary: Gets seasons for a tv series. + operationId: GetSeasons + parameters: + - name: seriesId + in: path + description: The series id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: The user id. + schema: + type: string + format: uuid + - name: fields + in: query + description: 'Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.' + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: isSpecialSeason + in: query + description: Optional. Filter by special season. + schema: + type: boolean + - name: isMissing + in: query + description: Optional. Filter by items that are missing episodes or not. + schema: + type: boolean + - name: adjacentTo + in: query + description: Optional. Return items that are siblings of a supplied item. + schema: + type: string + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Shows/NextUp: + get: + tags: + - TvShows + summary: Gets a list of next up episodes. + operationId: GetNextUp + parameters: + - name: userId + in: query + description: The user id of the user to get the next up episodes for. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: seriesId + in: query + description: Optional. Filter by series id. + schema: + type: string + - name: parentId + in: query + description: Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: nextUpDateCutoff + in: query + description: Optional. Starting date of shows to show in Next Up section. + schema: + type: string + format: date-time + - name: enableTotalRecordCount + in: query + description: Whether to enable the total records count. Defaults to true. + schema: + type: boolean + default: true + - name: disableFirstEpisode + in: query + description: Whether to disable sending the first episode in a series as next up. + schema: + type: boolean + default: false + - name: enableRewatching + in: query + description: Whether to include watched episode in next up results. + schema: + type: boolean + default: false + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Shows/Upcoming: + get: + tags: + - TvShows + summary: Gets a list of upcoming episodes. + operationId: GetUpcomingEpisodes + parameters: + - name: userId + in: query + description: The user id of the user to get the upcoming episodes for. + schema: + type: string + format: uuid + - name: startIndex + in: query + description: Optional. The record index to start at. All items with a lower index will be dropped from the results. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: parentId + in: query + description: Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Audio/{itemId}/universal: + get: + tags: + - UniversalAudio + summary: Gets an audio stream. + operationId: GetUniversalAudioStream + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: query + description: Optional. The audio container. + schema: + type: array + items: + type: string + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: userId + in: query + description: Optional. The user id. + schema: + type: string + format: uuid + - name: audioCodec + in: query + description: Optional. The audio codec to transcode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: maxAudioChannels + in: query + description: Optional. The maximum number of audio channels. + schema: + type: integer + format: int32 + - name: transcodingAudioChannels + in: query + description: Optional. The number of how many audio channels to transcode to. + schema: + type: integer + format: int32 + - name: maxStreamingBitrate + in: query + description: Optional. The maximum streaming bitrate. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: transcodingContainer + in: query + description: Optional. The container to transcode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodingProtocol + in: query + description: Optional. The transcoding protocol. + schema: + type: string + - name: maxAudioSampleRate + in: query + description: Optional. The maximum audio sample rate. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: enableRemoteMedia + in: query + description: Optional. Whether to enable remote media. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + default: false + - name: enableRedirection + in: query + description: Whether to enable redirection. Defaults to true. + schema: + type: boolean + default: true + responses: + "200": + description: Audio stream returned. + content: + audio/*: + schema: + type: string + format: binary + "302": + description: Redirected to remote audio stream. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + head: + tags: + - UniversalAudio + summary: Gets an audio stream. + operationId: HeadUniversalAudioStream + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: query + description: Optional. The audio container. + schema: + type: array + items: + type: string + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: userId + in: query + description: Optional. The user id. + schema: + type: string + format: uuid + - name: audioCodec + in: query + description: Optional. The audio codec to transcode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: maxAudioChannels + in: query + description: Optional. The maximum number of audio channels. + schema: + type: integer + format: int32 + - name: transcodingAudioChannels + in: query + description: Optional. The number of how many audio channels to transcode to. + schema: + type: integer + format: int32 + - name: maxStreamingBitrate + in: query + description: Optional. The maximum streaming bitrate. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: transcodingContainer + in: query + description: Optional. The container to transcode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodingProtocol + in: query + description: Optional. The transcoding protocol. + schema: + type: string + - name: maxAudioSampleRate + in: query + description: Optional. The maximum audio sample rate. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: enableRemoteMedia + in: query + description: Optional. Whether to enable remote media. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + default: false + - name: enableRedirection + in: query + description: Whether to enable redirection. Defaults to true. + schema: + type: boolean + default: true + responses: + "200": + description: Audio stream returned. + content: + audio/*: + schema: + type: string + format: binary + "302": + description: Redirected to remote audio stream. + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users: + get: + tags: + - User + summary: Gets a list of users. + operationId: GetUsers + parameters: + - name: isHidden + in: query + description: Optional filter by IsHidden=true or false. + schema: + type: boolean + - name: isDisabled + in: query + description: Optional filter by IsDisabled=true or false. + schema: + type: boolean + responses: + "200": + description: Users returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UserDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/UserDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/UserDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}: + get: + tags: + - User + summary: Gets a user by Id. + operationId: GetUserById + parameters: + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: User returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UserDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserDto' + "404": + description: User not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - IgnoreParentalControl + delete: + tags: + - User + summary: Deletes a user. + operationId: DeleteUser + parameters: + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: User deleted. + "404": + description: User not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + post: + tags: + - User + summary: Updates a user. + operationId: UpdateUser + parameters: + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + requestBody: + description: The updated user model. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UserDto' + description: Class UserDto. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UserDto' + description: Class UserDto. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UserDto' + description: Class UserDto. + required: true + responses: + "204": + description: User updated. + "400": + description: User information was not supplied. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: User update forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/Authenticate: + post: + tags: + - User + summary: Authenticates a user. + operationId: AuthenticateUser + parameters: + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + - name: pw + in: query + description: The password as plain text. + required: true + schema: + type: string + - name: password + in: query + description: The password sha1-hash. + schema: + type: string + responses: + "200": + description: User authenticated. + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/AuthenticationResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/AuthenticationResult' + "403": + description: Sha1-hashed password only is not allowed. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: User not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Users/{userId}/Configuration: + post: + tags: + - User + summary: Updates a user configuration. + operationId: UpdateUserConfiguration + parameters: + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + requestBody: + description: The new user configuration. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UserConfiguration' + description: Class UserConfiguration. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UserConfiguration' + description: Class UserConfiguration. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UserConfiguration' + description: Class UserConfiguration. + required: true + responses: + "204": + description: User configuration updated. + "403": + description: User configuration update forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/EasyPassword: + post: + tags: + - User + summary: Updates a user's easy password. + operationId: UpdateUserEasyPassword + parameters: + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + requestBody: + description: The M:Jellyfin.Api.Controllers.UserController.UpdateUserEasyPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserEasyPassword) request. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateUserEasyPassword' + description: The update user easy password request body. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateUserEasyPassword' + description: The update user easy password request body. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateUserEasyPassword' + description: The update user easy password request body. + required: true + responses: + "204": + description: Password successfully reset. + "403": + description: User is not allowed to update the password. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: User not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/Password: + post: + tags: + - User + summary: Updates a user's password. + operationId: UpdateUserPassword + parameters: + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + requestBody: + description: The M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserPassword) request. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateUserPassword' + description: The update user password request body. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateUserPassword' + description: The update user password request body. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateUserPassword' + description: The update user password request body. + required: true + responses: + "204": + description: Password successfully reset. + "403": + description: User is not allowed to update the password. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: User not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/Policy: + post: + tags: + - User + summary: Updates a user policy. + operationId: UpdateUserPolicy + parameters: + - name: userId + in: path + description: The user id. + required: true + schema: + type: string + format: uuid + requestBody: + description: The new user policy. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UserPolicy' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/UserPolicy' + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/UserPolicy' + required: true + responses: + "204": + description: User policy updated. + "400": + description: User policy was not supplied. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: User policy update forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + security: + - CustomAuthentication: + - RequiresElevation + /Users/AuthenticateByName: + post: + tags: + - User + summary: Authenticates a user by name. + operationId: AuthenticateUserByName + requestBody: + description: The M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) request. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/AuthenticateUserByName' + description: The authenticate user by name request body. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/AuthenticateUserByName' + description: The authenticate user by name request body. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/AuthenticateUserByName' + description: The authenticate user by name request body. + required: true + responses: + "200": + description: User authenticated. + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/AuthenticationResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/AuthenticationResult' + /Users/AuthenticateWithQuickConnect: + post: + tags: + - User + summary: Authenticates a user with quick connect. + operationId: AuthenticateWithQuickConnect + requestBody: + description: The Jellyfin.Api.Models.UserDtos.QuickConnectDto request. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/QuickConnectDto' + description: The quick connect request body. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/QuickConnectDto' + description: The quick connect request body. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/QuickConnectDto' + description: The quick connect request body. + required: true + responses: + "200": + description: User authenticated. + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/AuthenticationResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/AuthenticationResult' + "400": + description: Missing token. + /Users/ForgotPassword: + post: + tags: + - User + summary: Initiates the forgot password process for a local user. + operationId: ForgotPassword + requestBody: + description: The forgot password request containing the entered username. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ForgotPasswordDto' + description: Forgot Password request body DTO. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/ForgotPasswordDto' + description: Forgot Password request body DTO. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/ForgotPasswordDto' + description: Forgot Password request body DTO. + required: true + responses: + "200": + description: Password reset process started. + content: + application/json: + schema: + $ref: '#/components/schemas/ForgotPasswordResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ForgotPasswordResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ForgotPasswordResult' + /Users/ForgotPassword/Pin: + post: + tags: + - User + summary: Redeems a forgot password pin. + operationId: ForgotPasswordPin + requestBody: + description: The forgot password pin request containing the entered pin. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ForgotPasswordPinDto' + description: Forgot Password Pin enter request body DTO. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/ForgotPasswordPinDto' + description: Forgot Password Pin enter request body DTO. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/ForgotPasswordPinDto' + description: Forgot Password Pin enter request body DTO. + required: true + responses: + "200": + description: Pin reset process started. + content: + application/json: + schema: + $ref: '#/components/schemas/PinRedeemResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/PinRedeemResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/PinRedeemResult' + /Users/Me: + get: + tags: + - User + summary: Gets the user based on auth token. + operationId: GetCurrentUser + responses: + "200": + description: User returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UserDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserDto' + "400": + description: Token is not owned by a user. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/New: + post: + tags: + - User + summary: Creates a user. + operationId: CreateUserByName + requestBody: + description: The create user by name request body. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CreateUserByName' + description: The create user by name request body. + text/json: + schema: + allOf: + - $ref: '#/components/schemas/CreateUserByName' + description: The create user by name request body. + application/*+json: + schema: + allOf: + - $ref: '#/components/schemas/CreateUserByName' + description: The create user by name request body. + required: true + responses: + "200": + description: User created. + content: + application/json: + schema: + $ref: '#/components/schemas/UserDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Users/Public: + get: + tags: + - User + summary: Gets a list of publicly visible users for display on a login screen. + operationId: GetPublicUsers + responses: + "200": + description: Public users returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UserDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/UserDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/UserDto' + /Users/{userId}/FavoriteItems/{itemId}: + post: + tags: + - UserLibrary + summary: Marks an item as a favorite. + operationId: MarkFavoriteItem + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Item marked as favorite. + content: + application/json: + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + delete: + tags: + - UserLibrary + summary: Unmarks item as a favorite. + operationId: UnmarkFavoriteItem + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Item unmarked as favorite. + content: + application/json: + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/Items/{itemId}: + get: + tags: + - UserLibrary + summary: Gets an item from a user's library. + operationId: GetItem + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Item returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/Items/{itemId}/Intros: + get: + tags: + - UserLibrary + summary: Gets intros to play before the main media item plays. + operationId: GetIntros + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Intros returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/Items/{itemId}/LocalTrailers: + get: + tags: + - UserLibrary + summary: Gets local trailers for an item. + operationId: GetLocalTrailers + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: An Microsoft.AspNetCore.Mvc.OkResult containing the item's local trailers. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/Items/{itemId}/Rating: + delete: + tags: + - UserLibrary + summary: Deletes a user's saved personal rating for an item. + operationId: DeleteUserItemRating + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Personal rating removed. + content: + application/json: + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + post: + tags: + - UserLibrary + summary: Updates a user's rating for an item. + operationId: UpdateUserItemRating + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + - name: likes + in: query + description: Whether this M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Guid,System.Guid,System.Nullable{System.Boolean}) is likes. + schema: + type: boolean + responses: + "200": + description: Item rating updated. + content: + application/json: + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/UserItemDataDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/Items/{itemId}/SpecialFeatures: + get: + tags: + - UserLibrary + summary: Gets special features for an item. + operationId: GetSpecialFeatures + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: itemId + in: path + description: Item id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Special features returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/Items/Latest: + get: + tags: + - UserLibrary + summary: Gets latest media. + operationId: GetLatestMedia + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: isPlayed + in: query + description: Filter by items that are played, or not. + schema: + type: boolean + - name: enableImages + in: query + description: Optional. include image information in output. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. the max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: enableUserData + in: query + description: Optional. include user data. + schema: + type: boolean + - name: limit + in: query + description: Return item limit. + schema: + type: integer + format: int32 + default: 20 + - name: groupItems + in: query + description: Whether or not to group items into a parent container. + schema: + type: boolean + default: true + responses: + "200": + description: Latest media returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/Items/Root: + get: + tags: + - UserLibrary + summary: Gets the root folder from a user's library. + operationId: GetRootFolder + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: Root folder returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/GroupingOptions: + get: + tags: + - UserViews + summary: Get user view grouping options. + operationId: GetGroupingOptions + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + responses: + "200": + description: User view grouping options returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SpecialViewOptionDto' + application/json; profile="CamelCase": + schema: + type: array + items: + $ref: '#/components/schemas/SpecialViewOptionDto' + application/json; profile="PascalCase": + schema: + type: array + items: + $ref: '#/components/schemas/SpecialViewOptionDto' + "404": + description: User not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Users/{userId}/Views: + get: + tags: + - UserViews + summary: Get user views. + operationId: GetUserViews + parameters: + - name: userId + in: path + description: User id. + required: true + schema: + type: string + format: uuid + - name: includeExternalContent + in: query + description: Whether or not to include external views such as channels or live tv. + schema: + type: boolean + - name: presetViews + in: query + description: Preset views. + schema: + type: array + items: + type: string + - name: includeHidden + in: query + description: Whether or not to include hidden content. + schema: + type: boolean + default: false + responses: + "200": + description: User views returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{videoId}/{mediaSourceId}/Attachments/{index}: + get: + tags: + - VideoAttachments + summary: Get video attachment. + operationId: GetAttachment + parameters: + - name: videoId + in: path + description: Video ID. + required: true + schema: + type: string + format: uuid + - name: mediaSourceId + in: path + description: Media Source ID. + required: true + schema: + type: string + - name: index + in: path + description: Attachment Index. + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: Attachment retrieved. + content: + application/octet-stream: + schema: + type: string + format: binary + "404": + description: Video or attachment not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + /Videos/{itemId}/AdditionalParts: + get: + tags: + - Videos + summary: Gets additional parts for a video. + operationId: GetAdditionalPart + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Additional parts returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Videos/{itemId}/AlternateSources: + delete: + tags: + - Videos + summary: Removes alternate video sources. + operationId: DeleteAlternateSources + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + responses: + "204": + description: Alternate sources deleted. + "404": + description: Video not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Videos/{itemId}/stream: + get: + tags: + - Videos + summary: Gets a video stream. + operationId: GetVideoStream + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: query + description: 'The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. The maximum horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The maximum vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + responses: + "200": + description: Video stream returned. + content: + video/*: + schema: + type: string + format: binary + head: + tags: + - Videos + summary: Gets a video stream. + operationId: HeadVideoStream + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: query + description: 'The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. The maximum horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The maximum vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + responses: + "200": + description: Video stream returned. + content: + video/*: + schema: + type: string + format: binary + /Videos/{itemId}/stream.{container}: + get: + tags: + - Videos + summary: Gets a video stream. + operationId: GetVideoStreamByContainer + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: path + description: 'The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.' + required: true + schema: + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. The maximum horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The maximum vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + responses: + "200": + description: Video stream returned. + content: + video/*: + schema: + type: string + format: binary + head: + tags: + - Videos + summary: Gets a video stream. + operationId: HeadVideoStreamByContainer + parameters: + - name: itemId + in: path + description: The item id. + required: true + schema: + type: string + format: uuid + - name: container + in: path + description: 'The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.' + required: true + schema: + type: string + - name: static + in: query + description: Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + schema: + type: boolean + - name: params + in: query + description: The streaming parameters. + schema: + type: string + - name: tag + in: query + description: The tag. + schema: + type: string + - name: deviceProfileId + in: query + description: Optional. The dlna device profile id to utilize. + schema: + type: string + - name: playSessionId + in: query + description: The play session id. + schema: + type: string + - name: segmentContainer + in: query + description: The segment container. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: segmentLength + in: query + description: The segment length. + schema: + type: integer + format: int32 + - name: minSegments + in: query + description: The minimum number of segments. + schema: + type: integer + format: int32 + - name: mediaSourceId + in: query + description: The media version id, if playing an alternate version. + schema: + type: string + - name: deviceId + in: query + description: The device id of the client requesting. Used to stop encoding processes when needed. + schema: + type: string + - name: audioCodec + in: query + description: 'Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url''s extension. Options: aac, mp3, vorbis, wma.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: enableAutoStreamCopy + in: query + description: Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + schema: + type: boolean + - name: allowVideoStreamCopy + in: query + description: Whether or not to allow copying of the video stream url. + schema: + type: boolean + - name: allowAudioStreamCopy + in: query + description: Whether or not to allow copying of the audio stream url. + schema: + type: boolean + - name: breakOnNonKeyFrames + in: query + description: Optional. Whether to break on non key frames. + schema: + type: boolean + - name: audioSampleRate + in: query + description: Optional. Specify a specific audio sample rate, e.g. 44100. + schema: + type: integer + format: int32 + - name: maxAudioBitDepth + in: query + description: Optional. The maximum audio bit depth. + schema: + type: integer + format: int32 + - name: audioBitRate + in: query + description: Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: audioChannels + in: query + description: Optional. Specify a specific number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: maxAudioChannels + in: query + description: Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + schema: + type: integer + format: int32 + - name: profile + in: query + description: Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + schema: + type: string + - name: level + in: query + description: Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. + schema: + type: string + - name: framerate + in: query + description: Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: maxFramerate + in: query + description: Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + schema: + type: number + format: float + - name: copyTimestamps + in: query + description: Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + schema: + type: boolean + - name: startTimeTicks + in: query + description: Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + schema: + type: integer + format: int64 + - name: width + in: query + description: Optional. The fixed horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: height + in: query + description: Optional. The fixed vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxWidth + in: query + description: Optional. The maximum horizontal resolution of the encoded video. + schema: + type: integer + format: int32 + - name: maxHeight + in: query + description: Optional. The maximum vertical resolution of the encoded video. + schema: + type: integer + format: int32 + - name: videoBitRate + in: query + description: Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + schema: + type: integer + format: int32 + - name: subtitleStreamIndex + in: query + description: Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + schema: + type: integer + format: int32 + - name: subtitleMethod + in: query + description: Optional. Specify the subtitle delivery method. + schema: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + - name: maxRefFrames + in: query + description: Optional. + schema: + type: integer + format: int32 + - name: maxVideoBitDepth + in: query + description: Optional. The maximum video bit depth. + schema: + type: integer + format: int32 + - name: requireAvc + in: query + description: Optional. Whether to require avc. + schema: + type: boolean + - name: deInterlace + in: query + description: Optional. Whether to deinterlace the video. + schema: + type: boolean + - name: requireNonAnamorphic + in: query + description: Optional. Whether to require a non anamorphic stream. + schema: + type: boolean + - name: transcodingMaxAudioChannels + in: query + description: Optional. The maximum number of audio channels to transcode. + schema: + type: integer + format: int32 + - name: cpuCoreLimit + in: query + description: Optional. The limit of how many cpu cores to use. + schema: + type: integer + format: int32 + - name: liveStreamId + in: query + description: The live stream id. + schema: + type: string + - name: enableMpegtsM2TsMode + in: query + description: Optional. Whether to enable the MpegtsM2Ts mode. + schema: + type: boolean + - name: videoCodec + in: query + description: 'Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url''s extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv.' + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: subtitleCodec + in: query + description: Optional. Specify a subtitle codec to encode to. + schema: + pattern: ^[a-zA-Z0-9\-\._,|]{0,40}$ + type: string + - name: transcodeReasons + in: query + description: Optional. The transcoding reason. + schema: + type: string + - name: audioStreamIndex + in: query + description: Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + schema: + type: integer + format: int32 + - name: videoStreamIndex + in: query + description: Optional. The index of the video stream to use. If omitted the first video stream will be used. + schema: + type: integer + format: int32 + - name: context + in: query + description: Optional. The MediaBrowser.Model.Dlna.EncodingContext. + schema: + allOf: + - $ref: '#/components/schemas/EncodingContext' + - name: streamOptions + in: query + description: Optional. The streaming options. + schema: + type: object + additionalProperties: + type: string + nullable: true + responses: + "200": + description: Video stream returned. + content: + video/*: + schema: + type: string + format: binary + /Videos/MergeVersions: + post: + tags: + - Videos + summary: Merges videos into a single record. + operationId: MergeVersions + parameters: + - name: ids + in: query + description: Item id list. This allows multiple, comma delimited. + required: true + schema: + type: array + items: + type: string + format: uuid + responses: + "204": + description: Videos merged. + "400": + description: Supply at least 2 video ids. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - RequiresElevation + /Years: + get: + tags: + - Years + summary: Get years. + operationId: GetYears + parameters: + - name: startIndex + in: query + description: Skips over a given number of items within the results. Use for paging. + schema: + type: integer + format: int32 + - name: limit + in: query + description: Optional. The maximum number of records to return. + schema: + type: integer + format: int32 + - name: sortOrder + in: query + description: Sort Order - Ascending,Descending. + schema: + type: array + items: + $ref: '#/components/schemas/SortOrder' + - name: parentId + in: query + description: Specify this to localize the search to a specific item or folder. Omit to use the root. + schema: + type: string + format: uuid + - name: fields + in: query + description: Optional. Specify additional fields of information to return in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ItemFields' + - name: excludeItemTypes + in: query + description: Optional. If specified, results will be excluded based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: includeItemTypes + in: query + description: Optional. If specified, results will be included based on item type. This allows multiple, comma delimited. + schema: + type: array + items: + $ref: '#/components/schemas/BaseItemKind' + - name: mediaTypes + in: query + description: Optional. Filter by MediaType. Allows multiple, comma delimited. + schema: + type: array + items: + type: string + - name: sortBy + in: query + description: 'Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.' + schema: + type: array + items: + type: string + - name: enableUserData + in: query + description: Optional. Include user data. + schema: + type: boolean + - name: imageTypeLimit + in: query + description: Optional. The max number of images to return, per image type. + schema: + type: integer + format: int32 + - name: enableImageTypes + in: query + description: Optional. The image types to include in the output. + schema: + type: array + items: + $ref: '#/components/schemas/ImageType' + - name: userId + in: query + description: User Id. + schema: + type: string + format: uuid + - name: recursive + in: query + description: Search recursively. + schema: + type: boolean + default: true + - name: enableImages + in: query + description: Optional. Include image information in output. + schema: + type: boolean + default: true + responses: + "200": + description: Year query returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDtoQueryResult' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization + /Years/{year}: + get: + tags: + - Years + summary: Gets a year. + operationId: GetYear + parameters: + - name: year + in: path + description: The year. + required: true + schema: + type: integer + format: int32 + - name: userId + in: query + description: Optional. Filter by user id, and attach user data. + schema: + type: string + format: uuid + responses: + "200": + description: Year returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/BaseItemDto' + "404": + description: Year not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="CamelCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + application/json; profile="PascalCase": + schema: + $ref: '#/components/schemas/ProblemDetails' + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - CustomAuthentication: + - DefaultAuthorization +components: + schemas: + AccessSchedule: + type: object + properties: + Id: + type: integer + description: Gets the id of this instance. + format: int32 + readOnly: true + UserId: + type: string + description: Gets the id of the associated user. + format: uuid + DayOfWeek: + allOf: + - $ref: '#/components/schemas/DynamicDayOfWeek' + description: Gets or sets the day of week. + StartHour: + type: number + description: Gets or sets the start hour. + format: double + EndHour: + type: number + description: Gets or sets the end hour. + format: double + additionalProperties: false + description: An entity representing a user's access schedule. + ActivityLogEntry: + type: object + properties: + Id: + type: integer + description: Gets or sets the identifier. + format: int64 + Name: + type: string + description: Gets or sets the name. + Overview: + type: string + description: Gets or sets the overview. + nullable: true + ShortOverview: + type: string + description: Gets or sets the short overview. + nullable: true + Type: + type: string + description: Gets or sets the type. + ItemId: + type: string + description: Gets or sets the item identifier. + nullable: true + Date: + type: string + description: Gets or sets the date. + format: date-time + UserId: + type: string + description: Gets or sets the user identifier. + format: uuid + UserPrimaryImageTag: + type: string + description: Gets or sets the user primary image tag. + nullable: true + deprecated: true + Severity: + allOf: + - $ref: '#/components/schemas/LogLevel' + description: Gets or sets the log severity. + additionalProperties: false + description: An activity log entry. + ActivityLogEntryQueryResult: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/ActivityLogEntry' + description: Gets or sets the items. + nullable: true + TotalRecordCount: + type: integer + description: Gets or sets the total number of records available. + format: int32 + StartIndex: + type: integer + description: Gets or sets the index of the first record in Items. + format: int32 + additionalProperties: false + AddVirtualFolderDto: + type: object + properties: + LibraryOptions: + allOf: + - $ref: '#/components/schemas/LibraryOptions' + description: Gets or sets library options. + nullable: true + additionalProperties: false + description: Add virtual folder dto. + AdminNotificationDto: + type: object + properties: + Name: + type: string + description: Gets or sets the notification name. + nullable: true + Description: + type: string + description: Gets or sets the notification description. + nullable: true + NotificationLevel: + allOf: + - $ref: '#/components/schemas/NotificationLevel' + description: Gets or sets the notification level. + nullable: true + Url: + type: string + description: Gets or sets the notification url. + nullable: true + additionalProperties: false + description: The admin notification dto. + AlbumInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + AlbumArtists: + type: array + items: + type: string + description: Gets or sets the album artist. + ArtistProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the artist provider ids. + SongInfos: + type: array + items: + $ref: '#/components/schemas/SongInfo' + additionalProperties: false + AlbumInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/AlbumInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + AllThemeMediaResult: + type: object + properties: + ThemeVideosResult: + allOf: + - $ref: '#/components/schemas/ThemeMediaResult' + description: Class ThemeMediaResult. + nullable: true + ThemeSongsResult: + allOf: + - $ref: '#/components/schemas/ThemeMediaResult' + description: Class ThemeMediaResult. + nullable: true + SoundtrackSongsResult: + allOf: + - $ref: '#/components/schemas/ThemeMediaResult' + description: Class ThemeMediaResult. + nullable: true + additionalProperties: false + Architecture: + enum: + - X86 + - X64 + - Arm + - Arm64 + - Wasm + - S390x + type: string + ArtistInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + SongInfos: + type: array + items: + $ref: '#/components/schemas/SongInfo' + additionalProperties: false + ArtistInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/ArtistInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + AuthenticateUserByName: + type: object + properties: + Username: + type: string + description: Gets or sets the username. + nullable: true + Pw: + type: string + description: Gets or sets the plain text password. + nullable: true + Password: + type: string + description: Gets or sets the sha1-hashed password. + nullable: true + deprecated: true + additionalProperties: false + description: The authenticate user by name request body. + AuthenticationInfo: + type: object + properties: + Id: + type: integer + description: Gets or sets the identifier. + format: int64 + AccessToken: + type: string + description: Gets or sets the access token. + nullable: true + DeviceId: + type: string + description: Gets or sets the device identifier. + nullable: true + AppName: + type: string + description: Gets or sets the name of the application. + nullable: true + AppVersion: + type: string + description: Gets or sets the application version. + nullable: true + DeviceName: + type: string + description: Gets or sets the name of the device. + nullable: true + UserId: + type: string + description: Gets or sets the user identifier. + format: uuid + IsActive: + type: boolean + description: Gets or sets a value indicating whether this instance is active. + DateCreated: + type: string + description: Gets or sets the date created. + format: date-time + DateRevoked: + type: string + description: Gets or sets the date revoked. + format: date-time + nullable: true + DateLastActivity: + type: string + format: date-time + UserName: + type: string + nullable: true + additionalProperties: false + AuthenticationInfoQueryResult: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/AuthenticationInfo' + description: Gets or sets the items. + nullable: true + TotalRecordCount: + type: integer + description: Gets or sets the total number of records available. + format: int32 + StartIndex: + type: integer + description: Gets or sets the index of the first record in Items. + format: int32 + additionalProperties: false + AuthenticationResult: + type: object + properties: + User: + allOf: + - $ref: '#/components/schemas/UserDto' + description: Class UserDto. + nullable: true + SessionInfo: + allOf: + - $ref: '#/components/schemas/SessionInfo' + description: Class SessionInfo. + nullable: true + AccessToken: + type: string + nullable: true + ServerId: + type: string + nullable: true + additionalProperties: false + BaseItem: + type: object + properties: + Size: + type: integer + format: int64 + nullable: true + Container: + type: string + nullable: true + IsHD: + type: boolean + readOnly: true + IsShortcut: + type: boolean + ShortcutPath: + type: string + nullable: true + Width: + type: integer + format: int32 + Height: + type: integer + format: int32 + ExtraIds: + type: array + items: + type: string + format: uuid + nullable: true + DateLastSaved: + type: string + format: date-time + RemoteTrailers: + type: array + items: + $ref: '#/components/schemas/MediaUrl' + description: Gets or sets the remote trailers. + nullable: true + SupportsExternalTransfer: + type: boolean + readOnly: true + additionalProperties: false + description: Class BaseItem. + BaseItemDto: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + nullable: true + ServerId: + type: string + description: Gets or sets the server identifier. + nullable: true + Id: + type: string + description: Gets or sets the id. + format: uuid + Etag: + type: string + description: Gets or sets the etag. + nullable: true + SourceType: + type: string + description: Gets or sets the type of the source. + nullable: true + PlaylistItemId: + type: string + description: Gets or sets the playlist item identifier. + nullable: true + DateCreated: + type: string + description: Gets or sets the date created. + format: date-time + nullable: true + DateLastMediaAdded: + type: string + format: date-time + nullable: true + ExtraType: + type: string + nullable: true + AirsBeforeSeasonNumber: + type: integer + format: int32 + nullable: true + AirsAfterSeasonNumber: + type: integer + format: int32 + nullable: true + AirsBeforeEpisodeNumber: + type: integer + format: int32 + nullable: true + CanDelete: + type: boolean + nullable: true + CanDownload: + type: boolean + nullable: true + HasSubtitles: + type: boolean + nullable: true + PreferredMetadataLanguage: + type: string + nullable: true + PreferredMetadataCountryCode: + type: string + nullable: true + SupportsSync: + type: boolean + description: Gets or sets a value indicating whether [supports synchronize]. + nullable: true + Container: + type: string + nullable: true + SortName: + type: string + description: Gets or sets the name of the sort. + nullable: true + ForcedSortName: + type: string + nullable: true + Video3DFormat: + allOf: + - $ref: '#/components/schemas/Video3DFormat' + description: Gets or sets the video3 D format. + nullable: true + PremiereDate: + type: string + description: Gets or sets the premiere date. + format: date-time + nullable: true + ExternalUrls: + type: array + items: + $ref: '#/components/schemas/ExternalUrl' + description: Gets or sets the external urls. + nullable: true + MediaSources: + type: array + items: + $ref: '#/components/schemas/MediaSourceInfo' + description: Gets or sets the media versions. + nullable: true + CriticRating: + type: number + description: Gets or sets the critic rating. + format: float + nullable: true + ProductionLocations: + type: array + items: + type: string + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + EnableMediaSourceDisplay: + type: boolean + nullable: true + OfficialRating: + type: string + description: Gets or sets the official rating. + nullable: true + CustomRating: + type: string + description: Gets or sets the custom rating. + nullable: true + ChannelId: + type: string + description: Gets or sets the channel identifier. + format: uuid + nullable: true + ChannelName: + type: string + nullable: true + Overview: + type: string + description: Gets or sets the overview. + nullable: true + Taglines: + type: array + items: + type: string + description: Gets or sets the taglines. + nullable: true + Genres: + type: array + items: + type: string + description: Gets or sets the genres. + nullable: true + CommunityRating: + type: number + description: Gets or sets the community rating. + format: float + nullable: true + CumulativeRunTimeTicks: + type: integer + description: Gets or sets the cumulative run time ticks. + format: int64 + nullable: true + RunTimeTicks: + type: integer + description: Gets or sets the run time ticks. + format: int64 + nullable: true + PlayAccess: + allOf: + - $ref: '#/components/schemas/PlayAccess' + description: Gets or sets the play access. + nullable: true + AspectRatio: + type: string + description: Gets or sets the aspect ratio. + nullable: true + ProductionYear: + type: integer + description: Gets or sets the production year. + format: int32 + nullable: true + IsPlaceHolder: + type: boolean + description: Gets or sets a value indicating whether this instance is place holder. + nullable: true + Number: + type: string + description: Gets or sets the number. + nullable: true + ChannelNumber: + type: string + nullable: true + IndexNumber: + type: integer + description: Gets or sets the index number. + format: int32 + nullable: true + IndexNumberEnd: + type: integer + description: Gets or sets the index number end. + format: int32 + nullable: true + ParentIndexNumber: + type: integer + description: Gets or sets the parent index number. + format: int32 + nullable: true + RemoteTrailers: + type: array + items: + $ref: '#/components/schemas/MediaUrl' + description: Gets or sets the trailer urls. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + IsHD: + type: boolean + description: Gets or sets a value indicating whether this instance is HD. + nullable: true + IsFolder: + type: boolean + description: Gets or sets a value indicating whether this instance is folder. + nullable: true + ParentId: + type: string + description: Gets or sets the parent id. + format: uuid + nullable: true + Type: + allOf: + - $ref: '#/components/schemas/BaseItemKind' + description: Gets or sets the type. + People: + type: array + items: + $ref: '#/components/schemas/BaseItemPerson' + description: Gets or sets the people. + nullable: true + Studios: + type: array + items: + $ref: '#/components/schemas/NameGuidPair' + description: Gets or sets the studios. + nullable: true + GenreItems: + type: array + items: + $ref: '#/components/schemas/NameGuidPair' + nullable: true + ParentLogoItemId: + type: string + description: Gets or sets wether the item has a logo, this will hold the Id of the Parent that has one. + format: uuid + nullable: true + ParentBackdropItemId: + type: string + description: Gets or sets wether the item has any backdrops, this will hold the Id of the Parent that has one. + format: uuid + nullable: true + ParentBackdropImageTags: + type: array + items: + type: string + description: Gets or sets the parent backdrop image tags. + nullable: true + LocalTrailerCount: + type: integer + description: Gets or sets the local trailer count. + format: int32 + nullable: true + UserData: + allOf: + - $ref: '#/components/schemas/UserItemDataDto' + description: Gets or sets the user data for this item based on the user it's being requested for. + nullable: true + RecursiveItemCount: + type: integer + description: Gets or sets the recursive item count. + format: int32 + nullable: true + ChildCount: + type: integer + description: Gets or sets the child count. + format: int32 + nullable: true + SeriesName: + type: string + description: Gets or sets the name of the series. + nullable: true + SeriesId: + type: string + description: Gets or sets the series id. + format: uuid + nullable: true + SeasonId: + type: string + description: Gets or sets the season identifier. + format: uuid + nullable: true + SpecialFeatureCount: + type: integer + description: Gets or sets the special feature count. + format: int32 + nullable: true + DisplayPreferencesId: + type: string + description: Gets or sets the display preferences id. + nullable: true + Status: + type: string + description: Gets or sets the status. + nullable: true + AirTime: + type: string + description: Gets or sets the air time. + nullable: true + AirDays: + type: array + items: + $ref: '#/components/schemas/DayOfWeek' + description: Gets or sets the air days. + nullable: true + Tags: + type: array + items: + type: string + description: Gets or sets the tags. + nullable: true + PrimaryImageAspectRatio: + type: number + description: Gets or sets the primary image aspect ratio, after image enhancements. + format: double + nullable: true + Artists: + type: array + items: + type: string + description: Gets or sets the artists. + nullable: true + ArtistItems: + type: array + items: + $ref: '#/components/schemas/NameGuidPair' + description: Gets or sets the artist items. + nullable: true + Album: + type: string + description: Gets or sets the album. + nullable: true + CollectionType: + type: string + description: Gets or sets the type of the collection. + nullable: true + DisplayOrder: + type: string + description: Gets or sets the display order. + nullable: true + AlbumId: + type: string + description: Gets or sets the album id. + format: uuid + nullable: true + AlbumPrimaryImageTag: + type: string + description: Gets or sets the album image tag. + nullable: true + SeriesPrimaryImageTag: + type: string + description: Gets or sets the series primary image tag. + nullable: true + AlbumArtist: + type: string + description: Gets or sets the album artist. + nullable: true + AlbumArtists: + type: array + items: + $ref: '#/components/schemas/NameGuidPair' + description: Gets or sets the album artists. + nullable: true + SeasonName: + type: string + description: Gets or sets the name of the season. + nullable: true + MediaStreams: + type: array + items: + $ref: '#/components/schemas/MediaStream' + description: Gets or sets the media streams. + nullable: true + VideoType: + allOf: + - $ref: '#/components/schemas/VideoType' + description: Gets or sets the type of the video. + nullable: true + PartCount: + type: integer + description: Gets or sets the part count. + format: int32 + nullable: true + MediaSourceCount: + type: integer + format: int32 + nullable: true + ImageTags: + type: object + additionalProperties: + type: string + description: Gets or sets the image tags. + nullable: true + BackdropImageTags: + type: array + items: + type: string + description: Gets or sets the backdrop image tags. + nullable: true + ScreenshotImageTags: + type: array + items: + type: string + description: Gets or sets the screenshot image tags. + nullable: true + ParentLogoImageTag: + type: string + description: Gets or sets the parent logo image tag. + nullable: true + ParentArtItemId: + type: string + description: Gets or sets wether the item has fan art, this will hold the Id of the Parent that has one. + format: uuid + nullable: true + ParentArtImageTag: + type: string + description: Gets or sets the parent art image tag. + nullable: true + SeriesThumbImageTag: + type: string + description: Gets or sets the series thumb image tag. + nullable: true + ImageBlurHashes: + type: object + properties: + Primary: + type: object + additionalProperties: + type: string + Art: + type: object + additionalProperties: + type: string + Backdrop: + type: object + additionalProperties: + type: string + Banner: + type: object + additionalProperties: + type: string + Logo: + type: object + additionalProperties: + type: string + Thumb: + type: object + additionalProperties: + type: string + Disc: + type: object + additionalProperties: + type: string + Box: + type: object + additionalProperties: + type: string + Screenshot: + type: object + additionalProperties: + type: string + Menu: + type: object + additionalProperties: + type: string + Chapter: + type: object + additionalProperties: + type: string + BoxRear: + type: object + additionalProperties: + type: string + Profile: + type: object + additionalProperties: + type: string + description: "Gets or sets the blurhashes for the image tags.\r\nMaps image type to dictionary mapping image tag to blurhash value." + nullable: true + SeriesStudio: + type: string + description: Gets or sets the series studio. + nullable: true + ParentThumbItemId: + type: string + description: Gets or sets the parent thumb item id. + format: uuid + nullable: true + ParentThumbImageTag: + type: string + description: Gets or sets the parent thumb image tag. + nullable: true + ParentPrimaryImageItemId: + type: string + description: Gets or sets the parent primary image item identifier. + nullable: true + ParentPrimaryImageTag: + type: string + description: Gets or sets the parent primary image tag. + nullable: true + Chapters: + type: array + items: + $ref: '#/components/schemas/ChapterInfo' + description: Gets or sets the chapters. + nullable: true + LocationType: + allOf: + - $ref: '#/components/schemas/LocationType' + description: Gets or sets the type of the location. + nullable: true + IsoType: + allOf: + - $ref: '#/components/schemas/IsoType' + description: Gets or sets the type of the iso. + nullable: true + MediaType: + type: string + description: Gets or sets the type of the media. + nullable: true + EndDate: + type: string + description: Gets or sets the end date. + format: date-time + nullable: true + LockedFields: + type: array + items: + $ref: '#/components/schemas/MetadataField' + description: Gets or sets the locked fields. + nullable: true + TrailerCount: + type: integer + description: Gets or sets the trailer count. + format: int32 + nullable: true + MovieCount: + type: integer + description: Gets or sets the movie count. + format: int32 + nullable: true + SeriesCount: + type: integer + description: Gets or sets the series count. + format: int32 + nullable: true + ProgramCount: + type: integer + format: int32 + nullable: true + EpisodeCount: + type: integer + description: Gets or sets the episode count. + format: int32 + nullable: true + SongCount: + type: integer + description: Gets or sets the song count. + format: int32 + nullable: true + AlbumCount: + type: integer + description: Gets or sets the album count. + format: int32 + nullable: true + ArtistCount: + type: integer + format: int32 + nullable: true + MusicVideoCount: + type: integer + description: Gets or sets the music video count. + format: int32 + nullable: true + LockData: + type: boolean + description: Gets or sets a value indicating whether [enable internet providers]. + nullable: true + Width: + type: integer + format: int32 + nullable: true + Height: + type: integer + format: int32 + nullable: true + CameraMake: + type: string + nullable: true + CameraModel: + type: string + nullable: true + Software: + type: string + nullable: true + ExposureTime: + type: number + format: double + nullable: true + FocalLength: + type: number + format: double + nullable: true + ImageOrientation: + allOf: + - $ref: '#/components/schemas/ImageOrientation' + nullable: true + Aperture: + type: number + format: double + nullable: true + ShutterSpeed: + type: number + format: double + nullable: true + Latitude: + type: number + format: double + nullable: true + Longitude: + type: number + format: double + nullable: true + Altitude: + type: number + format: double + nullable: true + IsoSpeedRating: + type: integer + format: int32 + nullable: true + SeriesTimerId: + type: string + description: Gets or sets the series timer identifier. + nullable: true + ProgramId: + type: string + description: Gets or sets the program identifier. + nullable: true + ChannelPrimaryImageTag: + type: string + description: Gets or sets the channel primary image tag. + nullable: true + StartDate: + type: string + description: Gets or sets the start date of the recording, in UTC. + format: date-time + nullable: true + CompletionPercentage: + type: number + description: Gets or sets the completion percentage. + format: double + nullable: true + IsRepeat: + type: boolean + description: Gets or sets a value indicating whether this instance is repeat. + nullable: true + EpisodeTitle: + type: string + description: Gets or sets the episode title. + nullable: true + ChannelType: + allOf: + - $ref: '#/components/schemas/ChannelType' + description: Gets or sets the type of the channel. + nullable: true + Audio: + allOf: + - $ref: '#/components/schemas/ProgramAudio' + description: Gets or sets the audio. + nullable: true + IsMovie: + type: boolean + description: Gets or sets a value indicating whether this instance is movie. + nullable: true + IsSports: + type: boolean + description: Gets or sets a value indicating whether this instance is sports. + nullable: true + IsSeries: + type: boolean + description: Gets or sets a value indicating whether this instance is series. + nullable: true + IsLive: + type: boolean + description: Gets or sets a value indicating whether this instance is live. + nullable: true + IsNews: + type: boolean + description: Gets or sets a value indicating whether this instance is news. + nullable: true + IsKids: + type: boolean + description: Gets or sets a value indicating whether this instance is kids. + nullable: true + IsPremiere: + type: boolean + description: Gets or sets a value indicating whether this instance is premiere. + nullable: true + TimerId: + type: string + description: Gets or sets the timer identifier. + nullable: true + CurrentProgram: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the current program. + nullable: true + additionalProperties: false + description: "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + BaseItemDtoQueryResult: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the items. + nullable: true + TotalRecordCount: + type: integer + description: Gets or sets the total number of records available. + format: int32 + StartIndex: + type: integer + description: Gets or sets the index of the first record in Items. + format: int32 + additionalProperties: false + BaseItemKind: + enum: + - AggregateFolder + - Audio + - AudioBook + - BasePluginFolder + - Book + - BoxSet + - Channel + - ChannelFolderItem + - CollectionFolder + - Episode + - Folder + - Genre + - ManualPlaylistsFolder + - Movie + - LiveTvChannel + - LiveTvProgram + - MusicAlbum + - MusicArtist + - MusicGenre + - MusicVideo + - Person + - Photo + - PhotoAlbum + - Playlist + - PlaylistsFolder + - Program + - Recording + - Season + - Series + - Studio + - Trailer + - TvChannel + - TvProgram + - UserRootFolder + - UserView + - Video + - Year + type: string + description: The base item kind. + BaseItemPerson: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Id: + type: string + description: Gets or sets the identifier. + format: uuid + Role: + type: string + description: Gets or sets the role. + nullable: true + Type: + type: string + description: Gets or sets the type. + nullable: true + PrimaryImageTag: + type: string + description: Gets or sets the primary image tag. + nullable: true + ImageBlurHashes: + type: object + properties: + Primary: + type: object + additionalProperties: + type: string + Art: + type: object + additionalProperties: + type: string + Backdrop: + type: object + additionalProperties: + type: string + Banner: + type: object + additionalProperties: + type: string + Logo: + type: object + additionalProperties: + type: string + Thumb: + type: object + additionalProperties: + type: string + Disc: + type: object + additionalProperties: + type: string + Box: + type: object + additionalProperties: + type: string + Screenshot: + type: object + additionalProperties: + type: string + Menu: + type: object + additionalProperties: + type: string + Chapter: + type: object + additionalProperties: + type: string + BoxRear: + type: object + additionalProperties: + type: string + Profile: + type: object + additionalProperties: + type: string + description: Gets or sets the primary image blurhash. + nullable: true + additionalProperties: false + description: This is used by the api to get information about a Person within a BaseItem. + BasePluginConfiguration: + type: object + additionalProperties: false + description: Class BasePluginConfiguration. + BookInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + SeriesName: + type: string + nullable: true + additionalProperties: false + BookInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/BookInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + BoxSetInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + additionalProperties: false + BoxSetInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/BoxSetInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + BrandingOptions: + type: object + properties: + LoginDisclaimer: + type: string + description: Gets or sets the login disclaimer. + nullable: true + CustomCss: + type: string + description: Gets or sets the custom CSS. + nullable: true + SplashscreenEnabled: + type: boolean + description: Gets or sets a value indicating whether to enable the splashscreen. + additionalProperties: false + description: The branding options. + BufferRequestDto: + type: object + properties: + When: + type: string + description: Gets or sets when the request has been made by the client. + format: date-time + PositionTicks: + type: integer + description: Gets or sets the position ticks. + format: int64 + IsPlaying: + type: boolean + description: Gets or sets a value indicating whether the client playback is unpaused. + PlaylistItemId: + type: string + description: Gets or sets the playlist item identifier of the playing item. + format: uuid + additionalProperties: false + description: Class BufferRequestDto. + ChannelFeatures: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + Id: + type: string + description: Gets or sets the identifier. + format: uuid + CanSearch: + type: boolean + description: Gets or sets a value indicating whether this instance can search. + MediaTypes: + type: array + items: + $ref: '#/components/schemas/ChannelMediaType' + description: Gets or sets the media types. + ContentTypes: + type: array + items: + $ref: '#/components/schemas/ChannelMediaContentType' + description: Gets or sets the content types. + MaxPageSize: + type: integer + description: Gets or sets the maximum number of records the channel allows retrieving at a time. + format: int32 + nullable: true + AutoRefreshLevels: + type: integer + description: Gets or sets the automatic refresh levels. + format: int32 + nullable: true + DefaultSortFields: + type: array + items: + $ref: '#/components/schemas/ChannelItemSortField' + description: Gets or sets the default sort orders. + SupportsSortOrderToggle: + type: boolean + description: Gets or sets a value indicating whether a sort ascending/descending toggle is supported. + SupportsLatestMedia: + type: boolean + description: Gets or sets a value indicating whether [supports latest media]. + CanFilter: + type: boolean + description: Gets or sets a value indicating whether this instance can filter. + SupportsContentDownloading: + type: boolean + description: Gets or sets a value indicating whether [supports content downloading]. + additionalProperties: false + ChannelItemSortField: + enum: + - Name + - CommunityRating + - PremiereDate + - DateCreated + - Runtime + - PlayCount + - CommunityPlayCount + type: string + ChannelMappingOptionsDto: + type: object + properties: + TunerChannels: + type: array + items: + $ref: '#/components/schemas/TunerChannelMapping' + description: Gets or sets list of tuner channels. + ProviderChannels: + type: array + items: + $ref: '#/components/schemas/NameIdPair' + description: Gets or sets list of provider channels. + Mappings: + type: array + items: + $ref: '#/components/schemas/NameValuePair' + description: Gets or sets list of mappings. + ProviderName: + type: string + description: Gets or sets provider name. + nullable: true + additionalProperties: false + description: Channel mapping options dto. + ChannelMediaContentType: + enum: + - Clip + - Podcast + - Trailer + - Movie + - Episode + - Song + - MovieExtra + - TvExtra + type: string + ChannelMediaType: + enum: + - Audio + - Video + - Photo + type: string + ChannelType: + enum: + - TV + - Radio + type: string + description: Enum ChannelType. + ChapterInfo: + type: object + properties: + StartPositionTicks: + type: integer + description: Gets or sets the start position ticks. + format: int64 + Name: + type: string + description: Gets or sets the name. + nullable: true + ImagePath: + type: string + description: Gets or sets the image path. + nullable: true + ImageDateModified: + type: string + format: date-time + ImageTag: + type: string + nullable: true + additionalProperties: false + description: Class ChapterInfo. + ClientCapabilities: + type: object + properties: + PlayableMediaTypes: + type: array + items: + type: string + nullable: true + SupportedCommands: + type: array + items: + $ref: '#/components/schemas/GeneralCommandType' + nullable: true + SupportsMediaControl: + type: boolean + SupportsContentUploading: + type: boolean + MessageCallbackUrl: + type: string + nullable: true + SupportsPersistentIdentifier: + type: boolean + SupportsSync: + type: boolean + DeviceProfile: + allOf: + - $ref: '#/components/schemas/DeviceProfile' + description: "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + nullable: true + AppStoreUrl: + type: string + nullable: true + IconUrl: + type: string + nullable: true + additionalProperties: false + ClientCapabilitiesDto: + type: object + properties: + PlayableMediaTypes: + type: array + items: + type: string + description: Gets or sets the list of playable media types. + SupportedCommands: + type: array + items: + $ref: '#/components/schemas/GeneralCommandType' + description: Gets or sets the list of supported commands. + SupportsMediaControl: + type: boolean + description: Gets or sets a value indicating whether session supports media control. + SupportsContentUploading: + type: boolean + description: Gets or sets a value indicating whether session supports content uploading. + MessageCallbackUrl: + type: string + description: Gets or sets the message callback url. + nullable: true + SupportsPersistentIdentifier: + type: boolean + description: Gets or sets a value indicating whether session supports a persistent identifier. + SupportsSync: + type: boolean + description: Gets or sets a value indicating whether session supports sync. + DeviceProfile: + allOf: + - $ref: '#/components/schemas/DeviceProfile' + description: "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + nullable: true + AppStoreUrl: + type: string + description: Gets or sets the app store url. + nullable: true + IconUrl: + type: string + description: Gets or sets the icon url. + nullable: true + additionalProperties: false + description: Client capabilities dto. + ClientLogDocumentResponseDto: + type: object + properties: + FileName: + type: string + description: Gets the resulting filename. + additionalProperties: false + description: Client log document response dto. + CodecProfile: + type: object + properties: + Type: + allOf: + - $ref: '#/components/schemas/CodecType' + Conditions: + type: array + items: + $ref: '#/components/schemas/ProfileCondition' + nullable: true + ApplyConditions: + type: array + items: + $ref: '#/components/schemas/ProfileCondition' + nullable: true + Codec: + type: string + nullable: true + Container: + type: string + nullable: true + additionalProperties: false + CodecType: + enum: + - Video + - VideoAudio + - Audio + type: string + CollectionCreationResult: + type: object + properties: + Id: + type: string + format: uuid + additionalProperties: false + CollectionTypeOptions: + enum: + - Movies + - TvShows + - Music + - MusicVideos + - HomeVideos + - BoxSets + - Books + - Mixed + type: string + ConfigImageTypes: + type: object + properties: + BackdropSizes: + type: array + items: + type: string + nullable: true + BaseUrl: + type: string + nullable: true + LogoSizes: + type: array + items: + type: string + nullable: true + PosterSizes: + type: array + items: + type: string + nullable: true + ProfileSizes: + type: array + items: + type: string + nullable: true + SecureBaseUrl: + type: string + nullable: true + StillSizes: + type: array + items: + type: string + nullable: true + additionalProperties: false + ConfigurationPageInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + EnableInMainMenu: + type: boolean + description: Gets or sets a value indicating whether the configurations page is enabled in the main menu. + MenuSection: + type: string + description: Gets or sets the menu section. + nullable: true + MenuIcon: + type: string + description: Gets or sets the menu icon. + nullable: true + DisplayName: + type: string + description: Gets or sets the display name. + nullable: true + PluginId: + type: string + description: Gets or sets the plugin id. + format: uuid + nullable: true + additionalProperties: false + description: The configuration page info. + ContainerProfile: + type: object + properties: + Type: + allOf: + - $ref: '#/components/schemas/DlnaProfileType' + Conditions: + type: array + items: + $ref: '#/components/schemas/ProfileCondition' + nullable: true + Container: + type: string + additionalProperties: false + ControlResponse: + type: object + properties: + Headers: + type: object + additionalProperties: + type: string + readOnly: true + Xml: + type: string + IsSuccessful: + type: boolean + additionalProperties: false + CountryInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + DisplayName: + type: string + description: Gets or sets the display name. + nullable: true + TwoLetterISORegionName: + type: string + description: Gets or sets the name of the two letter ISO region. + nullable: true + ThreeLetterISORegionName: + type: string + description: Gets or sets the name of the three letter ISO region. + nullable: true + additionalProperties: false + description: Class CountryInfo. + CreatePlaylistDto: + type: object + properties: + Name: + type: string + description: Gets or sets the name of the new playlist. + nullable: true + Ids: + type: array + items: + type: string + format: uuid + description: Gets or sets item ids to add to the playlist. + UserId: + type: string + description: Gets or sets the user id. + format: uuid + nullable: true + MediaType: + type: string + description: Gets or sets the media type. + nullable: true + additionalProperties: false + description: Create new playlist dto. + CreateUserByName: + type: object + properties: + Name: + type: string + description: Gets or sets the username. + nullable: true + Password: + type: string + description: Gets or sets the password. + nullable: true + additionalProperties: false + description: The create user by name request body. + CultureDto: + type: object + properties: + Name: + type: string + description: Gets the name. + DisplayName: + type: string + description: Gets the display name. + TwoLetterISOLanguageName: + type: string + description: Gets the name of the two letter ISO language. + ThreeLetterISOLanguageName: + type: string + description: Gets the name of the three letter ISO language. + nullable: true + readOnly: true + ThreeLetterISOLanguageNames: + type: array + items: + type: string + additionalProperties: false + description: Class CultureDto. + DayOfWeek: + enum: + - Sunday + - Monday + - Tuesday + - Wednesday + - Thursday + - Friday + - Saturday + type: string + DayPattern: + enum: + - Daily + - Weekdays + - Weekends + type: string + DefaultDirectoryBrowserInfoDto: + type: object + properties: + Path: + type: string + description: Gets or sets the path. + nullable: true + additionalProperties: false + description: Default directory browser info. + DeviceIdentification: + type: object + properties: + FriendlyName: + type: string + description: Gets or sets the name of the friendly. + ModelNumber: + type: string + description: Gets or sets the model number. + SerialNumber: + type: string + description: Gets or sets the serial number. + ModelName: + type: string + description: Gets or sets the name of the model. + ModelDescription: + type: string + description: Gets or sets the model description. + ModelUrl: + type: string + description: Gets or sets the model URL. + Manufacturer: + type: string + description: Gets or sets the manufacturer. + ManufacturerUrl: + type: string + description: Gets or sets the manufacturer URL. + Headers: + type: array + items: + $ref: '#/components/schemas/HttpHeaderInfo' + description: Gets or sets the headers. + additionalProperties: false + DeviceInfo: + type: object + properties: + Name: + type: string + nullable: true + AccessToken: + type: string + description: Gets or sets the access token. + nullable: true + Id: + type: string + description: Gets or sets the identifier. + nullable: true + LastUserName: + type: string + description: Gets or sets the last name of the user. + nullable: true + AppName: + type: string + description: Gets or sets the name of the application. + nullable: true + AppVersion: + type: string + description: Gets or sets the application version. + nullable: true + LastUserId: + type: string + description: Gets or sets the last user identifier. + format: uuid + DateLastActivity: + type: string + description: Gets or sets the date last modified. + format: date-time + Capabilities: + allOf: + - $ref: '#/components/schemas/ClientCapabilities' + description: Gets or sets the capabilities. + nullable: true + IconUrl: + type: string + nullable: true + additionalProperties: false + DeviceInfoQueryResult: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/DeviceInfo' + description: Gets or sets the items. + nullable: true + TotalRecordCount: + type: integer + description: Gets or sets the total number of records available. + format: int32 + StartIndex: + type: integer + description: Gets or sets the index of the first record in Items. + format: int32 + additionalProperties: false + DeviceOptions: + type: object + properties: + Id: + type: integer + description: Gets the id. + format: int32 + readOnly: true + DeviceId: + type: string + description: Gets the device id. + CustomName: + type: string + description: Gets or sets the custom name. + nullable: true + additionalProperties: false + description: An entity representing custom options for a device. + DeviceOptionsDto: + type: object + properties: + Id: + type: integer + description: Gets or sets the id. + format: int32 + DeviceId: + type: string + description: Gets or sets the device id. + nullable: true + CustomName: + type: string + description: Gets or sets the custom name. + nullable: true + additionalProperties: false + description: A dto representing custom options for a device. + DeviceProfile: + type: object + properties: + Name: + type: string + description: Gets or sets the name of this device profile. + nullable: true + Id: + type: string + description: Gets or sets the Id. + nullable: true + Identification: + allOf: + - $ref: '#/components/schemas/DeviceIdentification' + description: Gets or sets the Identification. + nullable: true + FriendlyName: + type: string + description: Gets or sets the friendly name of the device profile, which can be shown to users. + nullable: true + Manufacturer: + type: string + description: Gets or sets the manufacturer of the device which this profile represents. + nullable: true + ManufacturerUrl: + type: string + description: Gets or sets an url for the manufacturer of the device which this profile represents. + nullable: true + ModelName: + type: string + description: Gets or sets the model name of the device which this profile represents. + nullable: true + ModelDescription: + type: string + description: Gets or sets the model description of the device which this profile represents. + nullable: true + ModelNumber: + type: string + description: Gets or sets the model number of the device which this profile represents. + nullable: true + ModelUrl: + type: string + description: Gets or sets the ModelUrl. + nullable: true + SerialNumber: + type: string + description: Gets or sets the serial number of the device which this profile represents. + nullable: true + EnableAlbumArtInDidl: + type: boolean + description: Gets or sets a value indicating whether EnableAlbumArtInDidl. + default: false + EnableSingleAlbumArtLimit: + type: boolean + description: Gets or sets a value indicating whether EnableSingleAlbumArtLimit. + default: false + EnableSingleSubtitleLimit: + type: boolean + description: Gets or sets a value indicating whether EnableSingleSubtitleLimit. + default: false + SupportedMediaTypes: + type: string + description: Gets or sets the SupportedMediaTypes. + UserId: + type: string + description: Gets or sets the UserId. + nullable: true + AlbumArtPn: + type: string + description: Gets or sets the AlbumArtPn. + nullable: true + MaxAlbumArtWidth: + type: integer + description: Gets or sets the MaxAlbumArtWidth. + format: int32 + nullable: true + MaxAlbumArtHeight: + type: integer + description: Gets or sets the MaxAlbumArtHeight. + format: int32 + nullable: true + MaxIconWidth: + type: integer + description: Gets or sets the maximum allowed width of embedded icons. + format: int32 + nullable: true + MaxIconHeight: + type: integer + description: Gets or sets the maximum allowed height of embedded icons. + format: int32 + nullable: true + MaxStreamingBitrate: + type: integer + description: Gets or sets the maximum allowed bitrate for all streamed content. + format: int32 + nullable: true + MaxStaticBitrate: + type: integer + description: Gets or sets the maximum allowed bitrate for statically streamed content (= direct played files). + format: int32 + nullable: true + MusicStreamingTranscodingBitrate: + type: integer + description: Gets or sets the maximum allowed bitrate for transcoded music streams. + format: int32 + nullable: true + MaxStaticMusicBitrate: + type: integer + description: Gets or sets the maximum allowed bitrate for statically streamed (= direct played) music files. + format: int32 + nullable: true + SonyAggregationFlags: + type: string + description: Gets or sets the content of the aggregationFlags element in the urn:schemas-sonycom:av namespace. + nullable: true + ProtocolInfo: + type: string + description: Gets or sets the ProtocolInfo. + nullable: true + TimelineOffsetSeconds: + type: integer + description: Gets or sets the TimelineOffsetSeconds. + format: int32 + default: 0 + RequiresPlainVideoItems: + type: boolean + description: Gets or sets a value indicating whether RequiresPlainVideoItems. + default: false + RequiresPlainFolders: + type: boolean + description: Gets or sets a value indicating whether RequiresPlainFolders. + default: false + EnableMSMediaReceiverRegistrar: + type: boolean + description: Gets or sets a value indicating whether EnableMSMediaReceiverRegistrar. + default: false + IgnoreTranscodeByteRangeRequests: + type: boolean + description: Gets or sets a value indicating whether IgnoreTranscodeByteRangeRequests. + default: false + XmlRootAttributes: + type: array + items: + $ref: '#/components/schemas/XmlAttribute' + description: Gets or sets the XmlRootAttributes. + DirectPlayProfiles: + type: array + items: + $ref: '#/components/schemas/DirectPlayProfile' + description: Gets or sets the direct play profiles. + TranscodingProfiles: + type: array + items: + $ref: '#/components/schemas/TranscodingProfile' + description: Gets or sets the transcoding profiles. + ContainerProfiles: + type: array + items: + $ref: '#/components/schemas/ContainerProfile' + description: Gets or sets the container profiles. + CodecProfiles: + type: array + items: + $ref: '#/components/schemas/CodecProfile' + description: Gets or sets the codec profiles. + ResponseProfiles: + type: array + items: + $ref: '#/components/schemas/ResponseProfile' + description: Gets or sets the ResponseProfiles. + SubtitleProfiles: + type: array + items: + $ref: '#/components/schemas/SubtitleProfile' + description: Gets or sets the subtitle profiles. + additionalProperties: false + description: "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + DeviceProfileInfo: + type: object + properties: + Id: + type: string + description: Gets or sets the identifier. + nullable: true + Name: + type: string + description: Gets or sets the name. + nullable: true + Type: + allOf: + - $ref: '#/components/schemas/DeviceProfileType' + description: Gets or sets the type. + additionalProperties: false + DeviceProfileType: + enum: + - System + - User + type: string + DirectPlayProfile: + type: object + properties: + Container: + type: string + nullable: true + AudioCodec: + type: string + nullable: true + VideoCodec: + type: string + nullable: true + Type: + allOf: + - $ref: '#/components/schemas/DlnaProfileType' + additionalProperties: false + DisplayPreferencesDto: + type: object + properties: + Id: + type: string + description: Gets or sets the user id. + nullable: true + ViewType: + type: string + description: Gets or sets the type of the view. + nullable: true + SortBy: + type: string + description: Gets or sets the sort by. + nullable: true + IndexBy: + type: string + description: Gets or sets the index by. + nullable: true + RememberIndexing: + type: boolean + description: Gets or sets a value indicating whether [remember indexing]. + PrimaryImageHeight: + type: integer + description: Gets or sets the height of the primary image. + format: int32 + PrimaryImageWidth: + type: integer + description: Gets or sets the width of the primary image. + format: int32 + CustomPrefs: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the custom prefs. + ScrollDirection: + allOf: + - $ref: '#/components/schemas/ScrollDirection' + description: Gets or sets the scroll direction. + ShowBackdrop: + type: boolean + description: Gets or sets a value indicating whether to show backdrops on this item. + RememberSorting: + type: boolean + description: Gets or sets a value indicating whether [remember sorting]. + SortOrder: + allOf: + - $ref: '#/components/schemas/SortOrder' + description: Gets or sets the sort order. + ShowSidebar: + type: boolean + description: Gets or sets a value indicating whether [show sidebar]. + Client: + type: string + description: Gets or sets the client. + nullable: true + additionalProperties: false + description: Defines the display preferences for any item that supports them (usually Folders). + DlnaOptions: + type: object + properties: + EnablePlayTo: + type: boolean + description: Gets or sets a value indicating whether gets or sets a value to indicate the status of the dlna playTo subsystem. + EnableServer: + type: boolean + description: Gets or sets a value indicating whether gets or sets a value to indicate the status of the dlna server subsystem. + EnableDebugLog: + type: boolean + description: "Gets or sets a value indicating whether detailed dlna server logs are sent to the console/log.\r\nIf the setting \"Emby.Dlna\": \"Debug\" msut be set in logging.default.json for this property to work." + EnablePlayToTracing: + type: boolean + description: "Gets or sets a value indicating whether whether detailed playTo debug logs are sent to the console/log.\r\nIf the setting \"Emby.Dlna.PlayTo\": \"Debug\" msut be set in logging.default.json for this property to work." + ClientDiscoveryIntervalSeconds: + type: integer + description: "Gets or sets the ssdp client discovery interval time (in seconds).\r\nThis is the time after which the server will send a ssdp search request." + format: int32 + AliveMessageIntervalSeconds: + type: integer + description: Gets or sets the frequency at which ssdp alive notifications are transmitted. + format: int32 + BlastAliveMessageIntervalSeconds: + type: integer + description: Gets or sets the frequency at which ssdp alive notifications are transmitted. MIGRATING - TO BE REMOVED ONCE WEB HAS BEEN ALTERED. + format: int32 + DefaultUserId: + type: string + description: Gets or sets the default user account that the dlna server uses. + nullable: true + AutoCreatePlayToProfiles: + type: boolean + description: Gets or sets a value indicating whether playTo device profiles should be created. + BlastAliveMessages: + type: boolean + description: Gets or sets a value indicating whether to blast alive messages. + SendOnlyMatchedHost: + type: boolean + description: gets or sets a value indicating whether to send only matched host. + additionalProperties: false + description: The DlnaOptions class contains the user definable parameters for the dlna subsystems. + DlnaProfileType: + enum: + - Audio + - Video + - Photo + - Subtitle + type: string + DynamicDayOfWeek: + enum: + - Sunday + - Monday + - Tuesday + - Wednesday + - Thursday + - Friday + - Saturday + - Everyday + - Weekday + - Weekend + type: string + description: An enum that represents a day of the week, weekdays, weekends, or all days. + EmbeddedSubtitleOptions: + enum: + - AllowAll + - AllowText + - AllowImage + - AllowNone + type: string + description: An enum representing the options to disable embedded subs. + EncodingContext: + enum: + - Streaming + - Static + type: string + EncodingOptions: + type: object + properties: + EncodingThreadCount: + type: integer + format: int32 + TranscodingTempPath: + type: string + nullable: true + FallbackFontPath: + type: string + nullable: true + EnableFallbackFont: + type: boolean + DownMixAudioBoost: + type: number + format: double + MaxMuxingQueueSize: + type: integer + format: int32 + EnableThrottling: + type: boolean + ThrottleDelaySeconds: + type: integer + format: int32 + HardwareAccelerationType: + type: string + nullable: true + EncoderAppPath: + type: string + description: Gets or sets the FFmpeg path as set by the user via the UI. + nullable: true + EncoderAppPathDisplay: + type: string + description: Gets or sets the current FFmpeg path being used by the system and displayed on the transcode page. + nullable: true + VaapiDevice: + type: string + nullable: true + EnableTonemapping: + type: boolean + EnableVppTonemapping: + type: boolean + TonemappingAlgorithm: + type: string + nullable: true + TonemappingMode: + type: string + nullable: true + TonemappingRange: + type: string + nullable: true + TonemappingDesat: + type: number + format: double + TonemappingPeak: + type: number + format: double + TonemappingParam: + type: number + format: double + VppTonemappingBrightness: + type: number + format: double + VppTonemappingContrast: + type: number + format: double + H264Crf: + type: integer + format: int32 + H265Crf: + type: integer + format: int32 + EncoderPreset: + type: string + nullable: true + DeinterlaceDoubleRate: + type: boolean + DeinterlaceMethod: + type: string + nullable: true + EnableDecodingColorDepth10Hevc: + type: boolean + EnableDecodingColorDepth10Vp9: + type: boolean + EnableEnhancedNvdecDecoder: + type: boolean + PreferSystemNativeHwDecoder: + type: boolean + EnableIntelLowPowerH264HwEncoder: + type: boolean + EnableIntelLowPowerHevcHwEncoder: + type: boolean + EnableHardwareEncoding: + type: boolean + AllowHevcEncoding: + type: boolean + EnableSubtitleExtraction: + type: boolean + HardwareDecodingCodecs: + type: array + items: + type: string + nullable: true + AllowOnDemandMetadataBasedKeyframeExtractionForExtensions: + type: array + items: + type: string + nullable: true + additionalProperties: false + EndPointInfo: + type: object + properties: + IsLocal: + type: boolean + IsInNetwork: + type: boolean + additionalProperties: false + ExternalIdInfo: + type: object + properties: + Name: + type: string + description: 'Gets or sets the display name of the external id provider (IE: IMDB, MusicBrainz, etc).' + Key: + type: string + description: Gets or sets the unique key for this id. This key should be unique across all providers. + Type: + allOf: + - $ref: '#/components/schemas/ExternalIdMediaType' + description: "Gets or sets the specific media type for this id. This is used to distinguish between the different\r\nexternal id types for providers with multiple ids.\r\nA null value indicates there is no specific media type associated with the external id, or this is the\r\ndefault id for the external provider so there is no need to specify a type." + nullable: true + UrlFormatString: + type: string + description: Gets or sets the URL format string. + nullable: true + additionalProperties: false + description: Represents the external id information for serialization to the client. + ExternalIdMediaType: + enum: + - Album + - AlbumArtist + - Artist + - BoxSet + - Episode + - Movie + - OtherArtist + - Person + - ReleaseGroup + - Season + - Series + - Track + type: string + description: The specific media type of an MediaBrowser.Model.Providers.ExternalIdInfo. + ExternalUrl: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Url: + type: string + description: Gets or sets the type of the item. + nullable: true + additionalProperties: false + FFmpegLocation: + enum: + - NotFound + - SetByArgument + - Custom + - System + type: string + description: Enum describing the location of the FFmpeg tool. + FileSystemEntryInfo: + type: object + properties: + Name: + type: string + description: Gets the name. + Path: + type: string + description: Gets the path. + Type: + allOf: + - $ref: '#/components/schemas/FileSystemEntryType' + description: Gets the type. + additionalProperties: false + description: Class FileSystemEntryInfo. + FileSystemEntryType: + enum: + - File + - Directory + - NetworkComputer + - NetworkShare + type: string + description: Enum FileSystemEntryType. + FontFile: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Size: + type: integer + description: Gets or sets the size. + format: int64 + DateCreated: + type: string + description: Gets or sets the date created. + format: date-time + DateModified: + type: string + description: Gets or sets the date modified. + format: date-time + additionalProperties: false + description: Class FontFile. + ForgotPasswordAction: + enum: + - ContactAdmin + - PinCode + - InNetworkRequired + type: string + ForgotPasswordDto: + required: + - EnteredUsername + type: object + properties: + EnteredUsername: + type: string + description: Gets or sets the entered username to have its password reset. + additionalProperties: false + description: Forgot Password request body DTO. + ForgotPasswordPinDto: + required: + - Pin + type: object + properties: + Pin: + type: string + description: Gets or sets the entered pin to have the password reset. + additionalProperties: false + description: Forgot Password Pin enter request body DTO. + ForgotPasswordResult: + type: object + properties: + Action: + allOf: + - $ref: '#/components/schemas/ForgotPasswordAction' + description: Gets or sets the action. + PinFile: + type: string + description: Gets or sets the pin file. + nullable: true + PinExpirationDate: + type: string + description: Gets or sets the pin expiration date. + format: date-time + nullable: true + additionalProperties: false + GeneralCommand: + type: object + properties: + Name: + allOf: + - $ref: '#/components/schemas/GeneralCommandType' + description: This exists simply to identify a set of known commands. + ControllingUserId: + type: string + format: uuid + Arguments: + type: object + additionalProperties: + type: string + nullable: true + additionalProperties: false + GeneralCommandType: + enum: + - MoveUp + - MoveDown + - MoveLeft + - MoveRight + - PageUp + - PageDown + - PreviousLetter + - NextLetter + - ToggleOsd + - ToggleContextMenu + - Select + - Back + - TakeScreenshot + - SendKey + - SendString + - GoHome + - GoToSettings + - VolumeUp + - VolumeDown + - Mute + - Unmute + - ToggleMute + - SetVolume + - SetAudioStreamIndex + - SetSubtitleStreamIndex + - ToggleFullscreen + - DisplayContent + - GoToSearch + - DisplayMessage + - SetRepeatMode + - ChannelUp + - ChannelDown + - Guide + - ToggleStats + - PlayMediaSource + - PlayTrailers + - SetShuffleQueue + - PlayState + - PlayNext + - ToggleOsdMenu + - Play + - SetMaxStreamingBitrate + type: string + description: This exists simply to identify a set of known commands. + GetProgramsDto: + type: object + properties: + ChannelIds: + type: array + items: + type: string + format: uuid + description: Gets or sets the channels to return guide information for. + UserId: + type: string + description: Gets or sets optional. Filter by user id. + format: uuid + MinStartDate: + type: string + description: "Gets or sets the minimum premiere start date.\r\nOptional." + format: date-time + nullable: true + HasAired: + type: boolean + description: "Gets or sets filter by programs that have completed airing, or not.\r\nOptional." + nullable: true + IsAiring: + type: boolean + description: "Gets or sets filter by programs that are currently airing, or not.\r\nOptional." + nullable: true + MaxStartDate: + type: string + description: "Gets or sets the maximum premiere start date.\r\nOptional." + format: date-time + nullable: true + MinEndDate: + type: string + description: "Gets or sets the minimum premiere end date.\r\nOptional." + format: date-time + nullable: true + MaxEndDate: + type: string + description: "Gets or sets the maximum premiere end date.\r\nOptional." + format: date-time + nullable: true + IsMovie: + type: boolean + description: "Gets or sets filter for movies.\r\nOptional." + nullable: true + IsSeries: + type: boolean + description: "Gets or sets filter for series.\r\nOptional." + nullable: true + IsNews: + type: boolean + description: "Gets or sets filter for news.\r\nOptional." + nullable: true + IsKids: + type: boolean + description: "Gets or sets filter for kids.\r\nOptional." + nullable: true + IsSports: + type: boolean + description: "Gets or sets filter for sports.\r\nOptional." + nullable: true + StartIndex: + type: integer + description: "Gets or sets the record index to start at. All items with a lower index will be dropped from the results.\r\nOptional." + format: int32 + nullable: true + Limit: + type: integer + description: "Gets or sets the maximum number of records to return.\r\nOptional." + format: int32 + nullable: true + SortBy: + type: array + items: + type: string + description: "Gets or sets specify one or more sort orders, comma delimited. Options: Name, StartDate.\r\nOptional." + SortOrder: + type: array + items: + $ref: '#/components/schemas/SortOrder' + description: Gets or sets sort Order - Ascending,Descending. + Genres: + type: array + items: + type: string + description: Gets or sets the genres to return guide information for. + GenreIds: + type: array + items: + type: string + format: uuid + description: Gets or sets the genre ids to return guide information for. + EnableImages: + type: boolean + description: "Gets or sets include image information in output.\r\nOptional." + nullable: true + EnableTotalRecordCount: + type: boolean + description: Gets or sets a value indicating whether retrieve total record count. + ImageTypeLimit: + type: integer + description: "Gets or sets the max number of images to return, per image type.\r\nOptional." + format: int32 + nullable: true + EnableImageTypes: + type: array + items: + $ref: '#/components/schemas/ImageType' + description: "Gets or sets the image types to include in the output.\r\nOptional." + EnableUserData: + type: boolean + description: "Gets or sets include user data.\r\nOptional." + nullable: true + SeriesTimerId: + type: string + description: "Gets or sets filter by series timer id.\r\nOptional." + nullable: true + LibrarySeriesId: + type: string + description: "Gets or sets filter by library series id.\r\nOptional." + format: uuid + Fields: + type: array + items: + $ref: '#/components/schemas/ItemFields' + description: "Gets or sets specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.\r\nOptional." + additionalProperties: false + description: Get programs dto. + GroupInfoDto: + type: object + properties: + GroupId: + type: string + description: Gets the group identifier. + format: uuid + GroupName: + type: string + description: Gets the group name. + State: + allOf: + - $ref: '#/components/schemas/GroupStateType' + description: Gets the group state. + Participants: + type: array + items: + type: string + description: Gets the participants. + LastUpdatedAt: + type: string + description: Gets the date when this DTO has been created. + format: date-time + additionalProperties: false + description: Class GroupInfoDto. + GroupQueueMode: + enum: + - Queue + - QueueNext + type: string + description: Enum GroupQueueMode. + GroupRepeatMode: + enum: + - RepeatOne + - RepeatAll + - RepeatNone + type: string + description: Enum GroupRepeatMode. + GroupShuffleMode: + enum: + - Sorted + - Shuffle + type: string + description: Enum GroupShuffleMode. + GroupStateType: + enum: + - Idle + - Waiting + - Paused + - Playing + type: string + description: Enum GroupState. + GroupUpdateType: + enum: + - UserJoined + - UserLeft + - GroupJoined + - GroupLeft + - StateUpdate + - PlayQueue + - NotInGroup + - GroupDoesNotExist + - CreateGroupDenied + - JoinGroupDenied + - LibraryAccessDenied + type: string + description: Enum GroupUpdateType. + GuideInfo: + type: object + properties: + StartDate: + type: string + description: Gets or sets the start date. + format: date-time + EndDate: + type: string + description: Gets or sets the end date. + format: date-time + additionalProperties: false + HardwareEncodingType: + enum: + - AMF + - QSV + - NVENC + - V4L2M2M + - VAAPI + - VideoToolBox + type: string + description: Enum HardwareEncodingType. + HeaderMatchType: + enum: + - Equals + - Regex + - Substring + type: string + HttpHeaderInfo: + type: object + properties: + Name: + type: string + nullable: true + Value: + type: string + nullable: true + Match: + allOf: + - $ref: '#/components/schemas/HeaderMatchType' + additionalProperties: false + IgnoreWaitRequestDto: + type: object + properties: + IgnoreWait: + type: boolean + description: Gets or sets a value indicating whether the client should be ignored. + additionalProperties: false + description: Class IgnoreWaitRequestDto. + ImageByNameInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Theme: + type: string + description: Gets or sets the theme. + nullable: true + Context: + type: string + description: Gets or sets the context. + nullable: true + FileLength: + type: integer + description: Gets or sets the length of the file. + format: int64 + Format: + type: string + description: Gets or sets the format. + nullable: true + additionalProperties: false + ImageFormat: + enum: + - Bmp + - Gif + - Jpg + - Png + - Webp + type: string + description: Enum ImageOutputFormat. + ImageInfo: + type: object + properties: + ImageType: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Gets or sets the type of the image. + ImageIndex: + type: integer + description: Gets or sets the index of the image. + format: int32 + nullable: true + ImageTag: + type: string + description: Gets or sets the image tag. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + BlurHash: + type: string + description: Gets or sets the blurhash. + nullable: true + Height: + type: integer + description: Gets or sets the height. + format: int32 + nullable: true + Width: + type: integer + description: Gets or sets the width. + format: int32 + nullable: true + Size: + type: integer + description: Gets or sets the size. + format: int64 + additionalProperties: false + description: Class ImageInfo. + ImageOption: + type: object + properties: + Type: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Gets or sets the type. + Limit: + type: integer + description: Gets or sets the limit. + format: int32 + MinWidth: + type: integer + description: Gets or sets the minimum width. + format: int32 + additionalProperties: false + ImageOrientation: + enum: + - TopLeft + - TopRight + - BottomRight + - BottomLeft + - LeftTop + - RightTop + - RightBottom + - LeftBottom + type: string + ImageProviderInfo: + type: object + properties: + Name: + type: string + description: Gets the name. + SupportedImages: + type: array + items: + $ref: '#/components/schemas/ImageType' + description: Gets the supported image types. + additionalProperties: false + description: Class ImageProviderInfo. + ImageSavingConvention: + enum: + - Legacy + - Compatible + type: string + ImageType: + enum: + - Primary + - Art + - Backdrop + - Banner + - Logo + - Thumb + - Disc + - Box + - Screenshot + - Menu + - Chapter + - BoxRear + - Profile + type: string + description: Enum ImageType. + InstallationInfo: + type: object + properties: + Guid: + type: string + description: Gets or sets the Id. + format: uuid + Name: + type: string + description: Gets or sets the name. + nullable: true + Version: + type: string + description: Gets or sets the version. + nullable: true + Changelog: + type: string + description: Gets or sets the changelog for this version. + nullable: true + SourceUrl: + type: string + description: Gets or sets the source URL. + nullable: true + Checksum: + type: string + description: Gets or sets a checksum for the binary. + nullable: true + PackageInfo: + allOf: + - $ref: '#/components/schemas/PackageInfo' + description: Gets or sets package information for the installation. + nullable: true + additionalProperties: false + description: Class InstallationInfo. + IPlugin: + type: object + properties: + Name: + type: string + description: Gets the name of the plugin. + nullable: true + readOnly: true + Description: + type: string + description: Gets the Description. + nullable: true + readOnly: true + Id: + type: string + description: Gets the unique id. + format: uuid + readOnly: true + Version: + type: string + description: Gets the plugin version. + nullable: true + readOnly: true + AssemblyFilePath: + type: string + description: Gets the path to the assembly file. + nullable: true + readOnly: true + CanUninstall: + type: boolean + description: Gets a value indicating whether the plugin can be uninstalled. + readOnly: true + DataFolderPath: + type: string + description: Gets the full path to the data folder, where the plugin can store any miscellaneous files needed. + nullable: true + readOnly: true + additionalProperties: false + description: Defines the MediaBrowser.Common.Plugins.IPlugin. + IsoType: + enum: + - Dvd + - BluRay + type: string + description: Enum IsoType. + ItemCounts: + type: object + properties: + MovieCount: + type: integer + description: Gets or sets the movie count. + format: int32 + SeriesCount: + type: integer + description: Gets or sets the series count. + format: int32 + EpisodeCount: + type: integer + description: Gets or sets the episode count. + format: int32 + ArtistCount: + type: integer + description: Gets or sets the artist count. + format: int32 + ProgramCount: + type: integer + description: Gets or sets the program count. + format: int32 + TrailerCount: + type: integer + description: Gets or sets the trailer count. + format: int32 + SongCount: + type: integer + description: Gets or sets the song count. + format: int32 + AlbumCount: + type: integer + description: Gets or sets the album count. + format: int32 + MusicVideoCount: + type: integer + description: Gets or sets the music video count. + format: int32 + BoxSetCount: + type: integer + description: Gets or sets the box set count. + format: int32 + BookCount: + type: integer + description: Gets or sets the book count. + format: int32 + ItemCount: + type: integer + description: Gets or sets the item count. + format: int32 + additionalProperties: false + description: Class LibrarySummary. + ItemFields: + enum: + - AirTime + - CanDelete + - CanDownload + - ChannelInfo + - Chapters + - ChildCount + - CumulativeRunTimeTicks + - CustomRating + - DateCreated + - DateLastMediaAdded + - DisplayPreferencesId + - Etag + - ExternalUrls + - Genres + - HomePageUrl + - ItemCounts + - MediaSourceCount + - MediaSources + - OriginalTitle + - Overview + - ParentId + - Path + - People + - PlayAccess + - ProductionLocations + - ProviderIds + - PrimaryImageAspectRatio + - RecursiveItemCount + - Settings + - ScreenshotImageTags + - SeriesPrimaryImage + - SeriesStudio + - SortName + - SpecialEpisodeNumbers + - Studios + - BasicSyncInfo + - SyncInfo + - Taglines + - Tags + - RemoteTrailers + - MediaStreams + - SeasonUserData + - ServiceName + - ThemeSongIds + - ThemeVideoIds + - ExternalEtag + - PresentationUniqueKey + - InheritedParentalRatingValue + - ExternalSeriesId + - SeriesPresentationUniqueKey + - DateLastRefreshed + - DateLastSaved + - RefreshState + - ChannelImage + - EnableMediaSourceDisplay + - Width + - Height + - ExtraIds + - LocalTrailerCount + - IsHD + - SpecialFeatureCount + type: string + description: Used to control the data that gets attached to DtoBaseItems. + ItemFilter: + enum: + - IsFolder + - IsNotFolder + - IsUnplayed + - IsPlayed + - IsFavorite + - IsResumable + - Likes + - Dislikes + - IsFavoriteOrLikes + type: string + description: Enum ItemFilter. + JoinGroupRequestDto: + type: object + properties: + GroupId: + type: string + description: Gets or sets the group identifier. + format: uuid + additionalProperties: false + description: Class JoinGroupRequestDto. + KeepUntil: + enum: + - UntilDeleted + - UntilSpaceNeeded + - UntilWatched + - UntilDate + type: string + LibraryOptionInfoDto: + type: object + properties: + Name: + type: string + description: Gets or sets name. + nullable: true + DefaultEnabled: + type: boolean + description: Gets or sets a value indicating whether default enabled. + additionalProperties: false + description: Library option info dto. + LibraryOptions: + type: object + properties: + EnablePhotos: + type: boolean + EnableRealtimeMonitor: + type: boolean + EnableChapterImageExtraction: + type: boolean + ExtractChapterImagesDuringLibraryScan: + type: boolean + PathInfos: + type: array + items: + $ref: '#/components/schemas/MediaPathInfo' + SaveLocalMetadata: + type: boolean + EnableInternetProviders: + type: boolean + deprecated: true + EnableAutomaticSeriesGrouping: + type: boolean + EnableEmbeddedTitles: + type: boolean + EnableEmbeddedEpisodeInfos: + type: boolean + AutomaticRefreshIntervalDays: + type: integer + format: int32 + PreferredMetadataLanguage: + type: string + description: Gets or sets the preferred metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + SeasonZeroDisplayName: + type: string + MetadataSavers: + type: array + items: + type: string + nullable: true + DisabledLocalMetadataReaders: + type: array + items: + type: string + LocalMetadataReaderOrder: + type: array + items: + type: string + nullable: true + DisabledSubtitleFetchers: + type: array + items: + type: string + SubtitleFetcherOrder: + type: array + items: + type: string + SkipSubtitlesIfEmbeddedSubtitlesPresent: + type: boolean + SkipSubtitlesIfAudioTrackMatches: + type: boolean + SubtitleDownloadLanguages: + type: array + items: + type: string + nullable: true + RequirePerfectSubtitleMatch: + type: boolean + SaveSubtitlesWithMedia: + type: boolean + AutomaticallyAddToCollection: + type: boolean + AllowEmbeddedSubtitles: + allOf: + - $ref: '#/components/schemas/EmbeddedSubtitleOptions' + description: An enum representing the options to disable embedded subs. + TypeOptions: + type: array + items: + $ref: '#/components/schemas/TypeOptions' + additionalProperties: false + LibraryOptionsResultDto: + type: object + properties: + MetadataSavers: + type: array + items: + $ref: '#/components/schemas/LibraryOptionInfoDto' + description: Gets or sets the metadata savers. + MetadataReaders: + type: array + items: + $ref: '#/components/schemas/LibraryOptionInfoDto' + description: Gets or sets the metadata readers. + SubtitleFetchers: + type: array + items: + $ref: '#/components/schemas/LibraryOptionInfoDto' + description: Gets or sets the subtitle fetchers. + TypeOptions: + type: array + items: + $ref: '#/components/schemas/LibraryTypeOptionsDto' + description: Gets or sets the type options. + additionalProperties: false + description: Library options result dto. + LibraryTypeOptionsDto: + type: object + properties: + Type: + type: string + description: Gets or sets the type. + nullable: true + MetadataFetchers: + type: array + items: + $ref: '#/components/schemas/LibraryOptionInfoDto' + description: Gets or sets the metadata fetchers. + ImageFetchers: + type: array + items: + $ref: '#/components/schemas/LibraryOptionInfoDto' + description: Gets or sets the image fetchers. + SupportedImageTypes: + type: array + items: + $ref: '#/components/schemas/ImageType' + description: Gets or sets the supported image types. + DefaultImageOptions: + type: array + items: + $ref: '#/components/schemas/ImageOption' + description: Gets or sets the default image options. + additionalProperties: false + description: Library type options dto. + LibraryUpdateInfo: + type: object + properties: + FoldersAddedTo: + type: array + items: + type: string + description: Gets or sets the folders added to. + FoldersRemovedFrom: + type: array + items: + type: string + description: Gets or sets the folders removed from. + ItemsAdded: + type: array + items: + type: string + description: Gets or sets the items added. + ItemsRemoved: + type: array + items: + type: string + description: Gets or sets the items removed. + ItemsUpdated: + type: array + items: + type: string + description: Gets or sets the items updated. + CollectionFolders: + type: array + items: + type: string + IsEmpty: + type: boolean + readOnly: true + additionalProperties: false + description: Class LibraryUpdateInfo. + ListingsProviderInfo: + type: object + properties: + Id: + type: string + nullable: true + Type: + type: string + nullable: true + Username: + type: string + nullable: true + Password: + type: string + nullable: true + ListingsId: + type: string + nullable: true + ZipCode: + type: string + nullable: true + Country: + type: string + nullable: true + Path: + type: string + nullable: true + EnabledTuners: + type: array + items: + type: string + nullable: true + EnableAllTuners: + type: boolean + NewsCategories: + type: array + items: + type: string + nullable: true + SportsCategories: + type: array + items: + type: string + nullable: true + KidsCategories: + type: array + items: + type: string + nullable: true + MovieCategories: + type: array + items: + type: string + nullable: true + ChannelMappings: + type: array + items: + $ref: '#/components/schemas/NameValuePair' + nullable: true + MoviePrefix: + type: string + nullable: true + PreferredLanguage: + type: string + nullable: true + UserAgent: + type: string + nullable: true + additionalProperties: false + LiveStreamResponse: + type: object + properties: + MediaSource: + allOf: + - $ref: '#/components/schemas/MediaSourceInfo' + additionalProperties: false + LiveTvInfo: + type: object + properties: + Services: + type: array + items: + $ref: '#/components/schemas/LiveTvServiceInfo' + description: Gets or sets the services. + IsEnabled: + type: boolean + description: Gets or sets a value indicating whether this instance is enabled. + EnabledUsers: + type: array + items: + type: string + description: Gets or sets the enabled users. + additionalProperties: false + LiveTvOptions: + type: object + properties: + GuideDays: + type: integer + format: int32 + nullable: true + RecordingPath: + type: string + nullable: true + MovieRecordingPath: + type: string + nullable: true + SeriesRecordingPath: + type: string + nullable: true + EnableRecordingSubfolders: + type: boolean + EnableOriginalAudioWithEncodedRecordings: + type: boolean + TunerHosts: + type: array + items: + $ref: '#/components/schemas/TunerHostInfo' + nullable: true + ListingProviders: + type: array + items: + $ref: '#/components/schemas/ListingsProviderInfo' + nullable: true + PrePaddingSeconds: + type: integer + format: int32 + PostPaddingSeconds: + type: integer + format: int32 + MediaLocationsCreated: + type: array + items: + type: string + nullable: true + RecordingPostProcessor: + type: string + nullable: true + RecordingPostProcessorArguments: + type: string + nullable: true + additionalProperties: false + LiveTvServiceInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + HomePageUrl: + type: string + description: Gets or sets the home page URL. + nullable: true + Status: + allOf: + - $ref: '#/components/schemas/LiveTvServiceStatus' + description: Gets or sets the status. + StatusMessage: + type: string + description: Gets or sets the status message. + nullable: true + Version: + type: string + description: Gets or sets the version. + nullable: true + HasUpdateAvailable: + type: boolean + description: Gets or sets a value indicating whether this instance has update available. + IsVisible: + type: boolean + description: Gets or sets a value indicating whether this instance is visible. + Tuners: + type: array + items: + type: string + nullable: true + additionalProperties: false + description: Class ServiceInfo. + LiveTvServiceStatus: + enum: + - Ok + - Unavailable + type: string + LocalizationOption: + type: object + properties: + Name: + type: string + nullable: true + Value: + type: string + nullable: true + additionalProperties: false + LocationType: + enum: + - FileSystem + - Remote + - Virtual + - Offline + type: string + description: Enum LocationType. + LogFile: + type: object + properties: + DateCreated: + type: string + description: Gets or sets the date created. + format: date-time + DateModified: + type: string + description: Gets or sets the date modified. + format: date-time + Size: + type: integer + description: Gets or sets the size. + format: int64 + Name: + type: string + description: Gets or sets the name. + nullable: true + additionalProperties: false + LogLevel: + enum: + - Trace + - Debug + - Information + - Warning + - Error + - Critical + - None + type: string + MediaAttachment: + type: object + properties: + Codec: + type: string + description: Gets or sets the codec. + nullable: true + CodecTag: + type: string + description: Gets or sets the codec tag. + nullable: true + Comment: + type: string + description: Gets or sets the comment. + nullable: true + Index: + type: integer + description: Gets or sets the index. + format: int32 + FileName: + type: string + description: Gets or sets the filename. + nullable: true + MimeType: + type: string + description: Gets or sets the MIME type. + nullable: true + DeliveryUrl: + type: string + description: Gets or sets the delivery URL. + nullable: true + additionalProperties: false + description: Class MediaAttachment. + MediaEncoderPathDto: + type: object + properties: + Path: + type: string + description: Gets or sets media encoder path. + PathType: + type: string + description: Gets or sets media encoder path type. + additionalProperties: false + description: Media Encoder Path Dto. + MediaPathDto: + required: + - Name + type: object + properties: + Name: + type: string + description: Gets or sets the name of the library. + Path: + type: string + description: Gets or sets the path to add. + nullable: true + PathInfo: + allOf: + - $ref: '#/components/schemas/MediaPathInfo' + description: Gets or sets the path info. + nullable: true + additionalProperties: false + description: Media Path dto. + MediaPathInfo: + type: object + properties: + Path: + type: string + NetworkPath: + type: string + nullable: true + additionalProperties: false + MediaProtocol: + enum: + - File + - Http + - Rtmp + - Rtsp + - Udp + - Rtp + - Ftp + type: string + MediaSourceInfo: + type: object + properties: + Protocol: + allOf: + - $ref: '#/components/schemas/MediaProtocol' + Id: + type: string + nullable: true + Path: + type: string + nullable: true + EncoderPath: + type: string + nullable: true + EncoderProtocol: + allOf: + - $ref: '#/components/schemas/MediaProtocol' + nullable: true + Type: + allOf: + - $ref: '#/components/schemas/MediaSourceType' + Container: + type: string + nullable: true + Size: + type: integer + format: int64 + nullable: true + Name: + type: string + nullable: true + IsRemote: + type: boolean + description: "Gets or sets a value indicating whether the media is remote.\r\nDifferentiate internet url vs local network." + ETag: + type: string + nullable: true + RunTimeTicks: + type: integer + format: int64 + nullable: true + ReadAtNativeFramerate: + type: boolean + IgnoreDts: + type: boolean + IgnoreIndex: + type: boolean + GenPtsInput: + type: boolean + SupportsTranscoding: + type: boolean + SupportsDirectStream: + type: boolean + SupportsDirectPlay: + type: boolean + IsInfiniteStream: + type: boolean + RequiresOpening: + type: boolean + OpenToken: + type: string + nullable: true + RequiresClosing: + type: boolean + LiveStreamId: + type: string + nullable: true + BufferMs: + type: integer + format: int32 + nullable: true + RequiresLooping: + type: boolean + SupportsProbing: + type: boolean + VideoType: + allOf: + - $ref: '#/components/schemas/VideoType' + nullable: true + IsoType: + allOf: + - $ref: '#/components/schemas/IsoType' + nullable: true + Video3DFormat: + allOf: + - $ref: '#/components/schemas/Video3DFormat' + nullable: true + MediaStreams: + type: array + items: + $ref: '#/components/schemas/MediaStream' + nullable: true + MediaAttachments: + type: array + items: + $ref: '#/components/schemas/MediaAttachment' + nullable: true + Formats: + type: array + items: + type: string + nullable: true + Bitrate: + type: integer + format: int32 + nullable: true + Timestamp: + allOf: + - $ref: '#/components/schemas/TransportStreamTimestamp' + nullable: true + RequiredHttpHeaders: + type: object + additionalProperties: + type: string + nullable: true + nullable: true + TranscodingUrl: + type: string + nullable: true + TranscodingSubProtocol: + type: string + nullable: true + TranscodingContainer: + type: string + nullable: true + AnalyzeDurationMs: + type: integer + format: int32 + nullable: true + DefaultAudioStreamIndex: + type: integer + format: int32 + nullable: true + DefaultSubtitleStreamIndex: + type: integer + format: int32 + nullable: true + additionalProperties: false + MediaSourceType: + enum: + - Default + - Grouping + - Placeholder + type: string + MediaStream: + type: object + properties: + Codec: + type: string + description: Gets or sets the codec. + nullable: true + CodecTag: + type: string + description: Gets or sets the codec tag. + nullable: true + Language: + type: string + description: Gets or sets the language. + nullable: true + ColorRange: + type: string + description: Gets or sets the color range. + nullable: true + ColorSpace: + type: string + description: Gets or sets the color space. + nullable: true + ColorTransfer: + type: string + description: Gets or sets the color transfer. + nullable: true + ColorPrimaries: + type: string + description: Gets or sets the color primaries. + nullable: true + DvVersionMajor: + type: integer + description: Gets or sets the Dolby Vision version major. + format: int32 + nullable: true + DvVersionMinor: + type: integer + description: Gets or sets the Dolby Vision version minor. + format: int32 + nullable: true + DvProfile: + type: integer + description: Gets or sets the Dolby Vision profile. + format: int32 + nullable: true + DvLevel: + type: integer + description: Gets or sets the Dolby Vision level. + format: int32 + nullable: true + RpuPresentFlag: + type: integer + description: Gets or sets the Dolby Vision rpu present flag. + format: int32 + nullable: true + ElPresentFlag: + type: integer + description: Gets or sets the Dolby Vision el present flag. + format: int32 + nullable: true + BlPresentFlag: + type: integer + description: Gets or sets the Dolby Vision bl present flag. + format: int32 + nullable: true + DvBlSignalCompatibilityId: + type: integer + description: Gets or sets the Dolby Vision bl signal compatibility id. + format: int32 + nullable: true + Comment: + type: string + description: Gets or sets the comment. + nullable: true + TimeBase: + type: string + description: Gets or sets the time base. + nullable: true + CodecTimeBase: + type: string + description: Gets or sets the codec time base. + nullable: true + Title: + type: string + description: Gets or sets the title. + nullable: true + VideoRange: + type: string + description: Gets the video range. + nullable: true + readOnly: true + VideoRangeType: + type: string + description: Gets the video range type. + nullable: true + readOnly: true + VideoDoViTitle: + type: string + description: Gets the video dovi title. + nullable: true + readOnly: true + LocalizedUndefined: + type: string + nullable: true + LocalizedDefault: + type: string + nullable: true + LocalizedForced: + type: string + nullable: true + LocalizedExternal: + type: string + nullable: true + DisplayTitle: + type: string + nullable: true + readOnly: true + NalLengthSize: + type: string + nullable: true + IsInterlaced: + type: boolean + description: Gets or sets a value indicating whether this instance is interlaced. + IsAVC: + type: boolean + nullable: true + ChannelLayout: + type: string + description: Gets or sets the channel layout. + nullable: true + BitRate: + type: integer + description: Gets or sets the bit rate. + format: int32 + nullable: true + BitDepth: + type: integer + description: Gets or sets the bit depth. + format: int32 + nullable: true + RefFrames: + type: integer + description: Gets or sets the reference frames. + format: int32 + nullable: true + PacketLength: + type: integer + description: Gets or sets the length of the packet. + format: int32 + nullable: true + Channels: + type: integer + description: Gets or sets the channels. + format: int32 + nullable: true + SampleRate: + type: integer + description: Gets or sets the sample rate. + format: int32 + nullable: true + IsDefault: + type: boolean + description: Gets or sets a value indicating whether this instance is default. + IsForced: + type: boolean + description: Gets or sets a value indicating whether this instance is forced. + Height: + type: integer + description: Gets or sets the height. + format: int32 + nullable: true + Width: + type: integer + description: Gets or sets the width. + format: int32 + nullable: true + AverageFrameRate: + type: number + description: Gets or sets the average frame rate. + format: float + nullable: true + RealFrameRate: + type: number + description: Gets or sets the real frame rate. + format: float + nullable: true + Profile: + type: string + description: Gets or sets the profile. + nullable: true + Type: + allOf: + - $ref: '#/components/schemas/MediaStreamType' + description: Gets or sets the type. + AspectRatio: + type: string + description: Gets or sets the aspect ratio. + nullable: true + Index: + type: integer + description: Gets or sets the index. + format: int32 + Score: + type: integer + description: Gets or sets the score. + format: int32 + nullable: true + IsExternal: + type: boolean + description: Gets or sets a value indicating whether this instance is external. + DeliveryMethod: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + description: Gets or sets the method. + nullable: true + DeliveryUrl: + type: string + description: Gets or sets the delivery URL. + nullable: true + IsExternalUrl: + type: boolean + description: Gets or sets a value indicating whether this instance is external URL. + nullable: true + IsTextSubtitleStream: + type: boolean + readOnly: true + SupportsExternalStream: + type: boolean + description: Gets or sets a value indicating whether [supports external stream]. + Path: + type: string + description: Gets or sets the filename. + nullable: true + PixelFormat: + type: string + description: Gets or sets the pixel format. + nullable: true + Level: + type: number + description: Gets or sets the level. + format: double + nullable: true + IsAnamorphic: + type: boolean + description: Gets or sets whether this instance is anamorphic. + nullable: true + additionalProperties: false + description: Class MediaStream. + MediaStreamType: + enum: + - Audio + - Video + - Subtitle + - EmbeddedImage + - Data + type: string + description: Enum MediaStreamType. + MediaUpdateInfoDto: + type: object + properties: + Updates: + type: array + items: + $ref: '#/components/schemas/MediaUpdateInfoPathDto' + description: Gets or sets the list of updates. + additionalProperties: false + description: Media Update Info Dto. + MediaUpdateInfoPathDto: + type: object + properties: + Path: + type: string + description: Gets or sets media path. + nullable: true + UpdateType: + type: string + description: "Gets or sets media update type.\r\nCreated, Modified, Deleted." + nullable: true + additionalProperties: false + description: The media update info path. + MediaUrl: + type: object + properties: + Url: + type: string + nullable: true + Name: + type: string + nullable: true + additionalProperties: false + MessageCommand: + required: + - Text + type: object + properties: + Header: + type: string + nullable: true + Text: + type: string + TimeoutMs: + type: integer + format: int64 + nullable: true + additionalProperties: false + MetadataConfiguration: + type: object + properties: + UseFileCreationTimeForDateAdded: + type: boolean + additionalProperties: false + MetadataEditorInfo: + type: object + properties: + ParentalRatingOptions: + type: array + items: + $ref: '#/components/schemas/ParentalRating' + Countries: + type: array + items: + $ref: '#/components/schemas/CountryInfo' + Cultures: + type: array + items: + $ref: '#/components/schemas/CultureDto' + ExternalIdInfos: + type: array + items: + $ref: '#/components/schemas/ExternalIdInfo' + ContentType: + type: string + nullable: true + ContentTypeOptions: + type: array + items: + $ref: '#/components/schemas/NameValuePair' + additionalProperties: false + MetadataField: + enum: + - Cast + - Genres + - ProductionLocations + - Studios + - Tags + - Name + - Overview + - Runtime + - OfficialRating + type: string + description: Enum MetadataFields. + MetadataOptions: + type: object + properties: + ItemType: + type: string + nullable: true + DisabledMetadataSavers: + type: array + items: + type: string + nullable: true + LocalMetadataReaderOrder: + type: array + items: + type: string + nullable: true + DisabledMetadataFetchers: + type: array + items: + type: string + nullable: true + MetadataFetcherOrder: + type: array + items: + type: string + nullable: true + DisabledImageFetchers: + type: array + items: + type: string + nullable: true + ImageFetcherOrder: + type: array + items: + type: string + nullable: true + additionalProperties: false + description: Class MetadataOptions. + MetadataRefreshMode: + enum: + - None + - ValidationOnly + - Default + - FullRefresh + type: string + MovePlaylistItemRequestDto: + type: object + properties: + PlaylistItemId: + type: string + description: Gets or sets the playlist identifier of the item. + format: uuid + NewIndex: + type: integer + description: Gets or sets the new position. + format: int32 + additionalProperties: false + description: Class MovePlaylistItemRequestDto. + MovieInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + additionalProperties: false + MovieInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/MovieInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + MusicVideoInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + Artists: + type: array + items: + type: string + nullable: true + additionalProperties: false + MusicVideoInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/MusicVideoInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + NameGuidPair: + type: object + properties: + Name: + type: string + nullable: true + Id: + type: string + format: uuid + additionalProperties: false + NameIdPair: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Id: + type: string + description: Gets or sets the identifier. + nullable: true + additionalProperties: false + NameValuePair: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Value: + type: string + description: Gets or sets the value. + nullable: true + additionalProperties: false + NetworkConfiguration: + type: object + properties: + RequireHttps: + type: boolean + description: Gets or sets a value indicating whether the server should force connections over HTTPS. + CertificatePath: + type: string + description: Gets or sets the filesystem path of an X.509 certificate to use for SSL. + CertificatePassword: + type: string + description: Gets or sets the password required to access the X.509 certificate data in the file specified by Jellyfin.Networking.Configuration.NetworkConfiguration.CertificatePath. + BaseUrl: + type: string + description: Gets or sets a value used to specify the URL prefix that your Jellyfin instance can be accessed at. + PublicHttpsPort: + type: integer + description: Gets or sets the public HTTPS port. + format: int32 + HttpServerPortNumber: + type: integer + description: Gets or sets the HTTP server port number. + format: int32 + HttpsPortNumber: + type: integer + description: Gets or sets the HTTPS server port number. + format: int32 + EnableHttps: + type: boolean + description: Gets or sets a value indicating whether to use HTTPS. + PublicPort: + type: integer + description: Gets or sets the public mapped port. + format: int32 + UPnPCreateHttpPortMap: + type: boolean + description: Gets or sets a value indicating whether the http port should be mapped as part of UPnP automatic port forwarding. + UDPPortRange: + type: string + description: Gets or sets the UDPPortRange. + EnableIPV6: + type: boolean + description: Gets or sets a value indicating whether gets or sets IPV6 capability. + EnableIPV4: + type: boolean + description: Gets or sets a value indicating whether gets or sets IPV4 capability. + EnableSSDPTracing: + type: boolean + description: "Gets or sets a value indicating whether detailed SSDP logs are sent to the console/log.\r\n\"Emby.Dlna\": \"Debug\" must be set in logging.default.json for this property to have any effect." + SSDPTracingFilter: + type: string + description: "Gets or sets the SSDPTracingFilter\r\nGets or sets a value indicating whether an IP address is to be used to filter the detailed ssdp logs that are being sent to the console/log.\r\nIf the setting \"Emby.Dlna\": \"Debug\" msut be set in logging.default.json for this property to work." + UDPSendCount: + type: integer + description: Gets or sets the number of times SSDP UDP messages are sent. + format: int32 + UDPSendDelay: + type: integer + description: Gets or sets the delay between each groups of SSDP messages (in ms). + format: int32 + IgnoreVirtualInterfaces: + type: boolean + description: Gets or sets a value indicating whether address names that match Jellyfin.Networking.Configuration.NetworkConfiguration.VirtualInterfaceNames should be Ignore for the purposes of binding. + VirtualInterfaceNames: + type: string + description: Gets or sets a value indicating the interfaces that should be ignored. The list can be comma separated. . + GatewayMonitorPeriod: + type: integer + description: Gets or sets the time (in seconds) between the pings of SSDP gateway monitor. + format: int32 + EnableMultiSocketBinding: + type: boolean + description: Gets a value indicating whether multi-socket binding is available. + readOnly: true + TrustAllIP6Interfaces: + type: boolean + description: "Gets or sets a value indicating whether all IPv6 interfaces should be treated as on the internal network.\r\nDepending on the address range implemented ULA ranges might not be used." + HDHomerunPortRange: + type: string + description: Gets or sets the ports that HDHomerun uses. + PublishedServerUriBySubnet: + type: array + items: + type: string + description: "Gets or sets the PublishedServerUriBySubnet\r\nGets or sets PublishedServerUri to advertise for specific subnets." + AutoDiscoveryTracing: + type: boolean + description: Gets or sets a value indicating whether Autodiscovery tracing is enabled. + AutoDiscovery: + type: boolean + description: Gets or sets a value indicating whether Autodiscovery is enabled. + RemoteIPFilter: + type: array + items: + type: string + description: Gets or sets the filter for remote IP connectivity. Used in conjuntion with . + IsRemoteIPFilterBlacklist: + type: boolean + description: Gets or sets a value indicating whether contains a blacklist or a whitelist. Default is a whitelist. + EnableUPnP: + type: boolean + description: Gets or sets a value indicating whether to enable automatic port forwarding. + EnableRemoteAccess: + type: boolean + description: Gets or sets a value indicating whether access outside of the LAN is permitted. + LocalNetworkSubnets: + type: array + items: + type: string + description: Gets or sets the subnets that are deemed to make up the LAN. + LocalNetworkAddresses: + type: array + items: + type: string + description: Gets or sets the interface addresses which Jellyfin will bind to. If empty, all interfaces will be used. + KnownProxies: + type: array + items: + type: string + description: Gets or sets the known proxies. If the proxy is a network, it's added to the KnownNetworks. + EnablePublishedServerUriByRequest: + type: boolean + description: Gets or sets a value indicating whether the published server uri is based on information in HTTP requests. + additionalProperties: false + description: Defines the Jellyfin.Networking.Configuration.NetworkConfiguration. + NewGroupRequestDto: + type: object + properties: + GroupName: + type: string + description: Gets or sets the group name. + additionalProperties: false + description: Class NewGroupRequestDto. + NextItemRequestDto: + type: object + properties: + PlaylistItemId: + type: string + description: Gets or sets the playing item identifier. + format: uuid + additionalProperties: false + description: Class NextItemRequestDto. + NotificationDto: + type: object + properties: + Id: + type: string + description: Gets or sets the notification ID. Defaults to an empty string. + UserId: + type: string + description: Gets or sets the notification's user ID. Defaults to an empty string. + Date: + type: string + description: Gets or sets the notification date. + format: date-time + IsRead: + type: boolean + description: Gets or sets a value indicating whether the notification has been read. Defaults to false. + Name: + type: string + description: Gets or sets the notification's name. Defaults to an empty string. + Description: + type: string + description: Gets or sets the notification's description. Defaults to an empty string. + Url: + type: string + description: Gets or sets the notification's URL. Defaults to an empty string. + Level: + allOf: + - $ref: '#/components/schemas/NotificationLevel' + description: Gets or sets the notification level. + additionalProperties: false + description: The notification DTO. + NotificationLevel: + enum: + - Normal + - Warning + - Error + type: string + NotificationOption: + type: object + properties: + Type: + type: string + nullable: true + DisabledMonitorUsers: + type: array + items: + type: string + description: Gets or sets user Ids to not monitor (it's opt out). + SendToUsers: + type: array + items: + type: string + description: Gets or sets user Ids to send to (if SendToUserMode == Custom). + Enabled: + type: boolean + description: Gets or sets a value indicating whether this MediaBrowser.Model.Notifications.NotificationOption is enabled. + DisabledServices: + type: array + items: + type: string + description: Gets or sets the disabled services. + SendToUserMode: + allOf: + - $ref: '#/components/schemas/SendToUserType' + description: Gets or sets the send to user mode. + additionalProperties: false + NotificationOptions: + type: object + properties: + Options: + type: array + items: + $ref: '#/components/schemas/NotificationOption' + nullable: true + additionalProperties: false + NotificationResultDto: + type: object + properties: + Notifications: + type: array + items: + $ref: '#/components/schemas/NotificationDto' + description: Gets or sets the current page of notifications. + TotalRecordCount: + type: integer + description: Gets or sets the total number of notifications. + format: int32 + additionalProperties: false + description: A list of notifications with the total record count for pagination. + NotificationsSummaryDto: + type: object + properties: + UnreadCount: + type: integer + description: Gets or sets the number of unread notifications. + format: int32 + MaxUnreadNotificationLevel: + allOf: + - $ref: '#/components/schemas/NotificationLevel' + description: Gets or sets the maximum unread notification level. + nullable: true + additionalProperties: false + description: The notification summary DTO. + NotificationTypeInfo: + type: object + properties: + Type: + type: string + nullable: true + Name: + type: string + nullable: true + Enabled: + type: boolean + Category: + type: string + nullable: true + IsBasedOnUserEvent: + type: boolean + additionalProperties: false + ObjectGroupUpdate: + type: object + properties: + GroupId: + type: string + description: Gets the group identifier. + format: uuid + Type: + allOf: + - $ref: '#/components/schemas/GroupUpdateType' + description: Gets the update type. + Data: + description: Gets the update data. + additionalProperties: false + description: Class GroupUpdate. + OpenLiveStreamDto: + type: object + properties: + OpenToken: + type: string + description: Gets or sets the open token. + nullable: true + UserId: + type: string + description: Gets or sets the user id. + format: uuid + nullable: true + PlaySessionId: + type: string + description: Gets or sets the play session id. + nullable: true + MaxStreamingBitrate: + type: integer + description: Gets or sets the max streaming bitrate. + format: int32 + nullable: true + StartTimeTicks: + type: integer + description: Gets or sets the start time in ticks. + format: int64 + nullable: true + AudioStreamIndex: + type: integer + description: Gets or sets the audio stream index. + format: int32 + nullable: true + SubtitleStreamIndex: + type: integer + description: Gets or sets the subtitle stream index. + format: int32 + nullable: true + MaxAudioChannels: + type: integer + description: Gets or sets the max audio channels. + format: int32 + nullable: true + ItemId: + type: string + description: Gets or sets the item id. + format: uuid + nullable: true + EnableDirectPlay: + type: boolean + description: Gets or sets a value indicating whether to enable direct play. + nullable: true + EnableDirectStream: + type: boolean + description: Gets or sets a value indicating whether to enale direct stream. + nullable: true + DeviceProfile: + allOf: + - $ref: '#/components/schemas/DeviceProfile' + description: "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + nullable: true + DirectPlayProtocols: + type: array + items: + $ref: '#/components/schemas/MediaProtocol' + description: Gets or sets the device play protocols. + additionalProperties: false + description: Open live stream dto. + PackageInfo: + type: object + properties: + name: + type: string + description: Gets or sets the name. + description: + type: string + description: Gets or sets a long description of the plugin containing features or helpful explanations. + overview: + type: string + description: Gets or sets a short overview of what the plugin does. + owner: + type: string + description: Gets or sets the owner. + category: + type: string + description: Gets or sets the category. + guid: + type: string + description: "Gets or sets the guid of the assembly associated with this plugin.\r\nThis is used to identify the proper item for automatic updates." + format: uuid + versions: + type: array + items: + $ref: '#/components/schemas/VersionInfo' + description: Gets or sets the versions. + imageUrl: + type: string + description: Gets or sets the image url for the package. + nullable: true + additionalProperties: false + description: Class PackageInfo. + ParentalRating: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Value: + type: integer + description: Gets or sets the value. + format: int32 + additionalProperties: false + description: Class ParentalRating. + PathSubstitution: + type: object + properties: + From: + type: string + description: Gets or sets the value to substitute. + To: + type: string + description: Gets or sets the value to substitution with. + additionalProperties: false + description: Defines the MediaBrowser.Model.Configuration.PathSubstitution. + PersonLookupInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + additionalProperties: false + PersonLookupInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/PersonLookupInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + PingRequestDto: + type: object + properties: + Ping: + type: integer + description: Gets or sets the ping time. + format: int64 + additionalProperties: false + description: Class PingRequestDto. + PinRedeemResult: + type: object + properties: + Success: + type: boolean + description: Gets or sets a value indicating whether this MediaBrowser.Model.Users.PinRedeemResult is success. + UsersReset: + type: array + items: + type: string + description: Gets or sets the users reset. + additionalProperties: false + PlayAccess: + enum: + - Full + - None + type: string + PlaybackErrorCode: + enum: + - NotAllowed + - NoCompatibleStream + - RateLimitExceeded + type: string + PlaybackInfoDto: + type: object + properties: + UserId: + type: string + description: Gets or sets the playback userId. + format: uuid + nullable: true + MaxStreamingBitrate: + type: integer + description: Gets or sets the max streaming bitrate. + format: int32 + nullable: true + StartTimeTicks: + type: integer + description: Gets or sets the start time in ticks. + format: int64 + nullable: true + AudioStreamIndex: + type: integer + description: Gets or sets the audio stream index. + format: int32 + nullable: true + SubtitleStreamIndex: + type: integer + description: Gets or sets the subtitle stream index. + format: int32 + nullable: true + MaxAudioChannels: + type: integer + description: Gets or sets the max audio channels. + format: int32 + nullable: true + MediaSourceId: + type: string + description: Gets or sets the media source id. + nullable: true + LiveStreamId: + type: string + description: Gets or sets the live stream id. + nullable: true + DeviceProfile: + allOf: + - $ref: '#/components/schemas/DeviceProfile' + description: "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + nullable: true + EnableDirectPlay: + type: boolean + description: Gets or sets a value indicating whether to enable direct play. + nullable: true + EnableDirectStream: + type: boolean + description: Gets or sets a value indicating whether to enable direct stream. + nullable: true + EnableTranscoding: + type: boolean + description: Gets or sets a value indicating whether to enable transcoding. + nullable: true + AllowVideoStreamCopy: + type: boolean + description: Gets or sets a value indicating whether to enable video stream copy. + nullable: true + AllowAudioStreamCopy: + type: boolean + description: Gets or sets a value indicating whether to allow audio stream copy. + nullable: true + AutoOpenLiveStream: + type: boolean + description: Gets or sets a value indicating whether to auto open the live stream. + nullable: true + additionalProperties: false + description: Plabyback info dto. + PlaybackInfoResponse: + type: object + properties: + MediaSources: + type: array + items: + $ref: '#/components/schemas/MediaSourceInfo' + description: Gets or sets the media sources. + PlaySessionId: + type: string + description: Gets or sets the play session identifier. + nullable: true + ErrorCode: + allOf: + - $ref: '#/components/schemas/PlaybackErrorCode' + description: Gets or sets the error code. + nullable: true + additionalProperties: false + description: Class PlaybackInfoResponse. + PlaybackProgressInfo: + type: object + properties: + CanSeek: + type: boolean + description: Gets or sets a value indicating whether this instance can seek. + Item: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the item. + nullable: true + ItemId: + type: string + description: Gets or sets the item identifier. + format: uuid + SessionId: + type: string + description: Gets or sets the session id. + nullable: true + MediaSourceId: + type: string + description: Gets or sets the media version identifier. + nullable: true + AudioStreamIndex: + type: integer + description: Gets or sets the index of the audio stream. + format: int32 + nullable: true + SubtitleStreamIndex: + type: integer + description: Gets or sets the index of the subtitle stream. + format: int32 + nullable: true + IsPaused: + type: boolean + description: Gets or sets a value indicating whether this instance is paused. + IsMuted: + type: boolean + description: Gets or sets a value indicating whether this instance is muted. + PositionTicks: + type: integer + description: Gets or sets the position ticks. + format: int64 + nullable: true + PlaybackStartTimeTicks: + type: integer + format: int64 + nullable: true + VolumeLevel: + type: integer + description: Gets or sets the volume level. + format: int32 + nullable: true + Brightness: + type: integer + format: int32 + nullable: true + AspectRatio: + type: string + nullable: true + PlayMethod: + allOf: + - $ref: '#/components/schemas/PlayMethod' + description: Gets or sets the play method. + LiveStreamId: + type: string + description: Gets or sets the live stream identifier. + nullable: true + PlaySessionId: + type: string + description: Gets or sets the play session identifier. + nullable: true + RepeatMode: + allOf: + - $ref: '#/components/schemas/RepeatMode' + description: Gets or sets the repeat mode. + NowPlayingQueue: + type: array + items: + $ref: '#/components/schemas/QueueItem' + nullable: true + PlaylistItemId: + type: string + nullable: true + additionalProperties: false + description: Class PlaybackProgressInfo. + PlaybackStartInfo: + type: object + properties: + CanSeek: + type: boolean + description: Gets or sets a value indicating whether this instance can seek. + Item: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the item. + nullable: true + ItemId: + type: string + description: Gets or sets the item identifier. + format: uuid + SessionId: + type: string + description: Gets or sets the session id. + nullable: true + MediaSourceId: + type: string + description: Gets or sets the media version identifier. + nullable: true + AudioStreamIndex: + type: integer + description: Gets or sets the index of the audio stream. + format: int32 + nullable: true + SubtitleStreamIndex: + type: integer + description: Gets or sets the index of the subtitle stream. + format: int32 + nullable: true + IsPaused: + type: boolean + description: Gets or sets a value indicating whether this instance is paused. + IsMuted: + type: boolean + description: Gets or sets a value indicating whether this instance is muted. + PositionTicks: + type: integer + description: Gets or sets the position ticks. + format: int64 + nullable: true + PlaybackStartTimeTicks: + type: integer + format: int64 + nullable: true + VolumeLevel: + type: integer + description: Gets or sets the volume level. + format: int32 + nullable: true + Brightness: + type: integer + format: int32 + nullable: true + AspectRatio: + type: string + nullable: true + PlayMethod: + allOf: + - $ref: '#/components/schemas/PlayMethod' + description: Gets or sets the play method. + LiveStreamId: + type: string + description: Gets or sets the live stream identifier. + nullable: true + PlaySessionId: + type: string + description: Gets or sets the play session identifier. + nullable: true + RepeatMode: + allOf: + - $ref: '#/components/schemas/RepeatMode' + description: Gets or sets the repeat mode. + NowPlayingQueue: + type: array + items: + $ref: '#/components/schemas/QueueItem' + nullable: true + PlaylistItemId: + type: string + nullable: true + additionalProperties: false + description: Class PlaybackStartInfo. + PlaybackStopInfo: + type: object + properties: + Item: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the item. + nullable: true + ItemId: + type: string + description: Gets or sets the item identifier. + format: uuid + SessionId: + type: string + description: Gets or sets the session id. + nullable: true + MediaSourceId: + type: string + description: Gets or sets the media version identifier. + nullable: true + PositionTicks: + type: integer + description: Gets or sets the position ticks. + format: int64 + nullable: true + LiveStreamId: + type: string + description: Gets or sets the live stream identifier. + nullable: true + PlaySessionId: + type: string + description: Gets or sets the play session identifier. + nullable: true + Failed: + type: boolean + description: Gets or sets a value indicating whether this MediaBrowser.Model.Session.PlaybackStopInfo is failed. + NextMediaType: + type: string + nullable: true + PlaylistItemId: + type: string + nullable: true + NowPlayingQueue: + type: array + items: + $ref: '#/components/schemas/QueueItem' + nullable: true + additionalProperties: false + description: Class PlaybackStopInfo. + PlayCommand: + enum: + - PlayNow + - PlayNext + - PlayLast + - PlayInstantMix + - PlayShuffle + type: string + description: Enum PlayCommand. + PlayerStateInfo: + type: object + properties: + PositionTicks: + type: integer + description: Gets or sets the now playing position ticks. + format: int64 + nullable: true + CanSeek: + type: boolean + description: Gets or sets a value indicating whether this instance can seek. + IsPaused: + type: boolean + description: Gets or sets a value indicating whether this instance is paused. + IsMuted: + type: boolean + description: Gets or sets a value indicating whether this instance is muted. + VolumeLevel: + type: integer + description: Gets or sets the volume level. + format: int32 + nullable: true + AudioStreamIndex: + type: integer + description: Gets or sets the index of the now playing audio stream. + format: int32 + nullable: true + SubtitleStreamIndex: + type: integer + description: Gets or sets the index of the now playing subtitle stream. + format: int32 + nullable: true + MediaSourceId: + type: string + description: Gets or sets the now playing media version identifier. + nullable: true + PlayMethod: + allOf: + - $ref: '#/components/schemas/PlayMethod' + description: Gets or sets the play method. + nullable: true + RepeatMode: + allOf: + - $ref: '#/components/schemas/RepeatMode' + description: Gets or sets the repeat mode. + LiveStreamId: + type: string + description: Gets or sets the now playing live stream identifier. + nullable: true + additionalProperties: false + PlaylistCreationResult: + type: object + properties: + Id: + type: string + additionalProperties: false + PlayMethod: + enum: + - Transcode + - DirectStream + - DirectPlay + type: string + PlayRequest: + type: object + properties: + ItemIds: + type: array + items: + type: string + format: uuid + description: Gets or sets the item ids. + nullable: true + StartPositionTicks: + type: integer + description: Gets or sets the start position ticks that the first item should be played at. + format: int64 + nullable: true + PlayCommand: + allOf: + - $ref: '#/components/schemas/PlayCommand' + description: Gets or sets the play command. + ControllingUserId: + type: string + description: Gets or sets the controlling user identifier. + format: uuid + SubtitleStreamIndex: + type: integer + format: int32 + nullable: true + AudioStreamIndex: + type: integer + format: int32 + nullable: true + MediaSourceId: + type: string + nullable: true + StartIndex: + type: integer + format: int32 + nullable: true + additionalProperties: false + description: Class PlayRequest. + PlayRequestDto: + type: object + properties: + PlayingQueue: + type: array + items: + type: string + format: uuid + description: Gets or sets the playing queue. + PlayingItemPosition: + type: integer + description: Gets or sets the position of the playing item in the queue. + format: int32 + StartPositionTicks: + type: integer + description: Gets or sets the start position ticks. + format: int64 + additionalProperties: false + description: Class PlayRequestDto. + PlaystateCommand: + enum: + - Stop + - Pause + - Unpause + - NextTrack + - PreviousTrack + - Seek + - Rewind + - FastForward + - PlayPause + type: string + description: Enum PlaystateCommand. + PlaystateRequest: + type: object + properties: + Command: + allOf: + - $ref: '#/components/schemas/PlaystateCommand' + description: Enum PlaystateCommand. + SeekPositionTicks: + type: integer + format: int64 + nullable: true + ControllingUserId: + type: string + description: Gets or sets the controlling user identifier. + nullable: true + additionalProperties: false + PluginInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + Version: + type: string + description: Gets or sets the version. + ConfigurationFileName: + type: string + description: Gets or sets the name of the configuration file. + nullable: true + Description: + type: string + description: Gets or sets the description. + Id: + type: string + description: Gets or sets the unique id. + format: uuid + CanUninstall: + type: boolean + description: Gets or sets a value indicating whether the plugin can be uninstalled. + HasImage: + type: boolean + description: Gets or sets a value indicating whether this plugin has a valid image. + Status: + allOf: + - $ref: '#/components/schemas/PluginStatus' + description: Gets or sets a value indicating the status of the plugin. + additionalProperties: false + description: This is a serializable stub class that is used by the api to provide information about installed plugins. + PluginStatus: + enum: + - Active + - Restart + - Deleted + - Superceded + - Malfunctioned + - NotSupported + - Disabled + type: string + description: Plugin load status. + PreviousItemRequestDto: + type: object + properties: + PlaylistItemId: + type: string + description: Gets or sets the playing item identifier. + format: uuid + additionalProperties: false + description: Class PreviousItemRequestDto. + ProblemDetails: + type: object + properties: + type: + type: string + nullable: true + title: + type: string + nullable: true + status: + type: integer + format: int32 + nullable: true + detail: + type: string + nullable: true + instance: + type: string + nullable: true + additionalProperties: {} + ProfileCondition: + type: object + properties: + Condition: + allOf: + - $ref: '#/components/schemas/ProfileConditionType' + Property: + allOf: + - $ref: '#/components/schemas/ProfileConditionValue' + Value: + type: string + nullable: true + IsRequired: + type: boolean + additionalProperties: false + ProfileConditionType: + enum: + - Equals + - NotEquals + - LessThanEqual + - GreaterThanEqual + - EqualsAny + type: string + ProfileConditionValue: + enum: + - AudioChannels + - AudioBitrate + - AudioProfile + - Width + - Height + - Has64BitOffsets + - PacketLength + - VideoBitDepth + - VideoBitrate + - VideoFramerate + - VideoLevel + - VideoProfile + - VideoTimestamp + - IsAnamorphic + - RefFrames + - NumAudioStreams + - NumVideoStreams + - IsSecondaryAudio + - VideoCodecTag + - IsAvc + - IsInterlaced + - AudioSampleRate + - AudioBitDepth + - VideoRangeType + type: string + ProgramAudio: + enum: + - Mono + - Stereo + - Dolby + - DolbyDigital + - Thx + - Atmos + type: string + PublicSystemInfo: + type: object + properties: + LocalAddress: + type: string + description: Gets or sets the local address. + nullable: true + ServerName: + type: string + description: Gets or sets the name of the server. + nullable: true + Version: + type: string + description: Gets or sets the server version. + nullable: true + ProductName: + type: string + description: Gets or sets the product name. This is the AssemblyProduct name. + nullable: true + OperatingSystem: + type: string + description: Gets or sets the operating system. + nullable: true + Id: + type: string + description: Gets or sets the id. + nullable: true + StartupWizardCompleted: + type: boolean + description: Gets or sets a value indicating whether the startup wizard is completed. + nullable: true + additionalProperties: false + QueryFilters: + type: object + properties: + Genres: + type: array + items: + $ref: '#/components/schemas/NameGuidPair' + nullable: true + Tags: + type: array + items: + type: string + nullable: true + additionalProperties: false + QueryFiltersLegacy: + type: object + properties: + Genres: + type: array + items: + type: string + nullable: true + Tags: + type: array + items: + type: string + nullable: true + OfficialRatings: + type: array + items: + type: string + nullable: true + Years: + type: array + items: + type: integer + format: int32 + nullable: true + additionalProperties: false + QueueItem: + type: object + properties: + Id: + type: string + format: uuid + PlaylistItemId: + type: string + nullable: true + additionalProperties: false + QueueRequestDto: + type: object + properties: + ItemIds: + type: array + items: + type: string + format: uuid + description: Gets or sets the items to enqueue. + Mode: + allOf: + - $ref: '#/components/schemas/GroupQueueMode' + description: Enum GroupQueueMode. + additionalProperties: false + description: Class QueueRequestDto. + QuickConnectDto: + required: + - Secret + type: object + properties: + Secret: + type: string + description: Gets or sets the quick connect secret. + additionalProperties: false + description: The quick connect request body. + QuickConnectResult: + type: object + properties: + Authenticated: + type: boolean + description: Gets or sets a value indicating whether this request is authorized. + Secret: + type: string + description: Gets the secret value used to uniquely identify this request. Can be used to retrieve authentication information. + Code: + type: string + description: Gets the user facing code used so the user can quickly differentiate this request from others. + DeviceId: + type: string + description: Gets the requesting device id. + DeviceName: + type: string + description: Gets the requesting device name. + AppName: + type: string + description: Gets the requesting app name. + AppVersion: + type: string + description: Gets the requesting app version. + DateAdded: + type: string + description: Gets or sets the DateTime that this request was created. + format: date-time + additionalProperties: false + description: Stores the state of an quick connect request. + RatingType: + enum: + - Score + - Likes + type: string + ReadyRequestDto: + type: object + properties: + When: + type: string + description: Gets or sets when the request has been made by the client. + format: date-time + PositionTicks: + type: integer + description: Gets or sets the position ticks. + format: int64 + IsPlaying: + type: boolean + description: Gets or sets a value indicating whether the client playback is unpaused. + PlaylistItemId: + type: string + description: Gets or sets the playlist item identifier of the playing item. + format: uuid + additionalProperties: false + description: Class ReadyRequest. + RecommendationDto: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + nullable: true + RecommendationType: + allOf: + - $ref: '#/components/schemas/RecommendationType' + BaselineItemName: + type: string + nullable: true + CategoryId: + type: string + format: uuid + additionalProperties: false + RecommendationType: + enum: + - SimilarToRecentlyPlayed + - SimilarToLikedItem + - HasDirectorFromRecentlyPlayed + - HasActorFromRecentlyPlayed + - HasLikedDirector + - HasLikedActor + type: string + RecordingStatus: + enum: + - New + - InProgress + - Completed + - Cancelled + - ConflictedOk + - ConflictedNotOk + - Error + type: string + RemoteImageInfo: + type: object + properties: + ProviderName: + type: string + description: Gets or sets the name of the provider. + nullable: true + Url: + type: string + description: Gets or sets the URL. + nullable: true + ThumbnailUrl: + type: string + description: Gets or sets a url used for previewing a smaller version. + nullable: true + Height: + type: integer + description: Gets or sets the height. + format: int32 + nullable: true + Width: + type: integer + description: Gets or sets the width. + format: int32 + nullable: true + CommunityRating: + type: number + description: Gets or sets the community rating. + format: double + nullable: true + VoteCount: + type: integer + description: Gets or sets the vote count. + format: int32 + nullable: true + Language: + type: string + description: Gets or sets the language. + nullable: true + Type: + allOf: + - $ref: '#/components/schemas/ImageType' + description: Gets or sets the type. + RatingType: + allOf: + - $ref: '#/components/schemas/RatingType' + description: Gets or sets the type of the rating. + additionalProperties: false + description: Class RemoteImageInfo. + RemoteImageResult: + type: object + properties: + Images: + type: array + items: + $ref: '#/components/schemas/RemoteImageInfo' + description: Gets or sets the images. + nullable: true + TotalRecordCount: + type: integer + description: Gets or sets the total record count. + format: int32 + Providers: + type: array + items: + type: string + description: Gets or sets the providers. + nullable: true + additionalProperties: false + description: Class RemoteImageResult. + RemoteSearchResult: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + ProductionYear: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + IndexNumberEnd: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + ImageUrl: + type: string + nullable: true + SearchProviderName: + type: string + nullable: true + Overview: + type: string + nullable: true + AlbumArtist: + allOf: + - $ref: '#/components/schemas/RemoteSearchResult' + nullable: true + Artists: + type: array + items: + $ref: '#/components/schemas/RemoteSearchResult' + nullable: true + additionalProperties: false + RemoteSubtitleInfo: + type: object + properties: + ThreeLetterISOLanguageName: + type: string + nullable: true + Id: + type: string + nullable: true + ProviderName: + type: string + nullable: true + Name: + type: string + nullable: true + Format: + type: string + nullable: true + Author: + type: string + nullable: true + Comment: + type: string + nullable: true + DateCreated: + type: string + format: date-time + nullable: true + CommunityRating: + type: number + format: float + nullable: true + DownloadCount: + type: integer + format: int32 + nullable: true + IsHashMatch: + type: boolean + nullable: true + additionalProperties: false + RemoveFromPlaylistRequestDto: + type: object + properties: + PlaylistItemIds: + type: array + items: + type: string + format: uuid + description: Gets or sets the playlist identifiers ot the items. Ignored when clearing the playlist. + ClearPlaylist: + type: boolean + description: Gets or sets a value indicating whether the entire playlist should be cleared. + ClearPlayingItem: + type: boolean + description: Gets or sets a value indicating whether the playing item should be removed as well. Used only when clearing the playlist. + additionalProperties: false + description: Class RemoveFromPlaylistRequestDto. + RepeatMode: + enum: + - RepeatNone + - RepeatAll + - RepeatOne + type: string + RepositoryInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Url: + type: string + description: Gets or sets the URL. + nullable: true + Enabled: + type: boolean + description: Gets or sets a value indicating whether the repository is enabled. + additionalProperties: false + description: Class RepositoryInfo. + ResponseProfile: + type: object + properties: + Container: + type: string + nullable: true + AudioCodec: + type: string + nullable: true + VideoCodec: + type: string + nullable: true + Type: + allOf: + - $ref: '#/components/schemas/DlnaProfileType' + OrgPn: + type: string + nullable: true + MimeType: + type: string + nullable: true + Conditions: + type: array + items: + $ref: '#/components/schemas/ProfileCondition' + nullable: true + additionalProperties: false + ScrollDirection: + enum: + - Horizontal + - Vertical + type: string + description: An enum representing the axis that should be scrolled. + SearchHint: + type: object + properties: + ItemId: + type: string + description: Gets or sets the item id. + format: uuid + Id: + type: string + format: uuid + Name: + type: string + description: Gets or sets the name. + nullable: true + MatchedTerm: + type: string + description: Gets or sets the matched term. + nullable: true + IndexNumber: + type: integer + description: Gets or sets the index number. + format: int32 + nullable: true + ProductionYear: + type: integer + description: Gets or sets the production year. + format: int32 + nullable: true + ParentIndexNumber: + type: integer + description: Gets or sets the parent index number. + format: int32 + nullable: true + PrimaryImageTag: + type: string + description: Gets or sets the image tag. + nullable: true + ThumbImageTag: + type: string + description: Gets or sets the thumb image tag. + nullable: true + ThumbImageItemId: + type: string + description: Gets or sets the thumb image item identifier. + nullable: true + BackdropImageTag: + type: string + description: Gets or sets the backdrop image tag. + nullable: true + BackdropImageItemId: + type: string + description: Gets or sets the backdrop image item identifier. + nullable: true + Type: + type: string + description: Gets or sets the type. + nullable: true + IsFolder: + type: boolean + nullable: true + RunTimeTicks: + type: integer + description: Gets or sets the run time ticks. + format: int64 + nullable: true + MediaType: + type: string + description: Gets or sets the type of the media. + nullable: true + StartDate: + type: string + format: date-time + nullable: true + EndDate: + type: string + format: date-time + nullable: true + Series: + type: string + description: Gets or sets the series. + nullable: true + Status: + type: string + nullable: true + Album: + type: string + description: Gets or sets the album. + nullable: true + AlbumId: + type: string + format: uuid + AlbumArtist: + type: string + description: Gets or sets the album artist. + nullable: true + Artists: + type: array + items: + type: string + description: Gets or sets the artists. + nullable: true + SongCount: + type: integer + description: Gets or sets the song count. + format: int32 + nullable: true + EpisodeCount: + type: integer + description: Gets or sets the episode count. + format: int32 + nullable: true + ChannelId: + type: string + description: Gets or sets the channel identifier. + format: uuid + ChannelName: + type: string + description: Gets or sets the name of the channel. + nullable: true + PrimaryImageAspectRatio: + type: number + description: Gets or sets the primary image aspect ratio. + format: double + nullable: true + additionalProperties: false + description: Class SearchHintResult. + SearchHintResult: + type: object + properties: + SearchHints: + type: array + items: + $ref: '#/components/schemas/SearchHint' + description: Gets the search hints. + TotalRecordCount: + type: integer + description: Gets the total record count. + format: int32 + additionalProperties: false + description: Class SearchHintResult. + SeekRequestDto: + type: object + properties: + PositionTicks: + type: integer + description: Gets or sets the position ticks. + format: int64 + additionalProperties: false + description: Class SeekRequestDto. + SendCommand: + type: object + properties: + GroupId: + type: string + description: Gets the group identifier. + format: uuid + PlaylistItemId: + type: string + description: Gets the playlist identifier of the playing item. + format: uuid + When: + type: string + description: Gets or sets the UTC time when to execute the command. + format: date-time + PositionTicks: + type: integer + description: Gets the position ticks. + format: int64 + nullable: true + Command: + allOf: + - $ref: '#/components/schemas/SendCommandType' + description: Gets the command. + EmittedAt: + type: string + description: Gets the UTC time when this command has been emitted. + format: date-time + additionalProperties: false + description: Class SendCommand. + SendCommandType: + enum: + - Unpause + - Pause + - Stop + - Seek + type: string + description: Enum SendCommandType. + SendToUserType: + enum: + - All + - Admins + - Custom + type: string + SeriesInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + additionalProperties: false + SeriesInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/SeriesInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + SeriesStatus: + enum: + - Continuing + - Ended + type: string + description: Enum SeriesStatus. + SeriesTimerInfoDto: + type: object + properties: + Id: + type: string + description: Gets or sets the Id of the recording. + nullable: true + Type: + type: string + nullable: true + ServerId: + type: string + description: Gets or sets the server identifier. + nullable: true + ExternalId: + type: string + description: Gets or sets the external identifier. + nullable: true + ChannelId: + type: string + description: Gets or sets the channel id of the recording. + format: uuid + ExternalChannelId: + type: string + description: Gets or sets the external channel identifier. + nullable: true + ChannelName: + type: string + description: Gets or sets the channel name of the recording. + nullable: true + ChannelPrimaryImageTag: + type: string + nullable: true + ProgramId: + type: string + description: Gets or sets the program identifier. + nullable: true + ExternalProgramId: + type: string + description: Gets or sets the external program identifier. + nullable: true + Name: + type: string + description: Gets or sets the name of the recording. + nullable: true + Overview: + type: string + description: Gets or sets the description of the recording. + nullable: true + StartDate: + type: string + description: Gets or sets the start date of the recording, in UTC. + format: date-time + EndDate: + type: string + description: Gets or sets the end date of the recording, in UTC. + format: date-time + ServiceName: + type: string + description: Gets or sets the name of the service. + nullable: true + Priority: + type: integer + description: Gets or sets the priority. + format: int32 + PrePaddingSeconds: + type: integer + description: Gets or sets the pre padding seconds. + format: int32 + PostPaddingSeconds: + type: integer + description: Gets or sets the post padding seconds. + format: int32 + IsPrePaddingRequired: + type: boolean + description: Gets or sets a value indicating whether this instance is pre padding required. + ParentBackdropItemId: + type: string + description: Gets or sets the Id of the Parent that has a backdrop if the item does not have one. + nullable: true + ParentBackdropImageTags: + type: array + items: + type: string + description: Gets or sets the parent backdrop image tags. + nullable: true + IsPostPaddingRequired: + type: boolean + description: Gets or sets a value indicating whether this instance is post padding required. + KeepUntil: + allOf: + - $ref: '#/components/schemas/KeepUntil' + RecordAnyTime: + type: boolean + description: Gets or sets a value indicating whether [record any time]. + SkipEpisodesInLibrary: + type: boolean + RecordAnyChannel: + type: boolean + description: Gets or sets a value indicating whether [record any channel]. + KeepUpTo: + type: integer + format: int32 + RecordNewOnly: + type: boolean + description: Gets or sets a value indicating whether [record new only]. + Days: + type: array + items: + $ref: '#/components/schemas/DayOfWeek' + description: Gets or sets the days. + nullable: true + DayPattern: + allOf: + - $ref: '#/components/schemas/DayPattern' + description: Gets or sets the day pattern. + nullable: true + ImageTags: + type: object + additionalProperties: + type: string + description: Gets or sets the image tags. + nullable: true + ParentThumbItemId: + type: string + description: Gets or sets the parent thumb item id. + nullable: true + ParentThumbImageTag: + type: string + description: Gets or sets the parent thumb image tag. + nullable: true + ParentPrimaryImageItemId: + type: string + description: Gets or sets the parent primary image item identifier. + nullable: true + ParentPrimaryImageTag: + type: string + description: Gets or sets the parent primary image tag. + nullable: true + additionalProperties: false + description: Class SeriesTimerInfoDto. + SeriesTimerInfoDtoQueryResult: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/SeriesTimerInfoDto' + description: Gets or sets the items. + nullable: true + TotalRecordCount: + type: integer + description: Gets or sets the total number of records available. + format: int32 + StartIndex: + type: integer + description: Gets or sets the index of the first record in Items. + format: int32 + additionalProperties: false + ServerConfiguration: + type: object + properties: + LogFileRetentionDays: + type: integer + description: Gets or sets the number of days we should retain log files. + format: int32 + IsStartupWizardCompleted: + type: boolean + description: Gets or sets a value indicating whether this instance is first run. + CachePath: + type: string + description: Gets or sets the cache path. + nullable: true + PreviousVersion: + type: string + description: Gets or sets the last known version that was ran using the configuration. + nullable: true + PreviousVersionStr: + type: string + description: "Gets or sets the stringified PreviousVersion to be stored/loaded,\r\nbecause System.Version itself isn't xml-serializable." + nullable: true + EnableMetrics: + type: boolean + description: Gets or sets a value indicating whether to enable prometheus metrics exporting. + EnableNormalizedItemByNameIds: + type: boolean + IsPortAuthorized: + type: boolean + description: Gets or sets a value indicating whether this instance is port authorized. + QuickConnectAvailable: + type: boolean + description: Gets or sets a value indicating whether quick connect is available for use on this server. + EnableCaseSensitiveItemIds: + type: boolean + description: Gets or sets a value indicating whether [enable case sensitive item ids]. + DisableLiveTvChannelUserDataName: + type: boolean + MetadataPath: + type: string + description: Gets or sets the metadata path. + MetadataNetworkPath: + type: string + PreferredMetadataLanguage: + type: string + description: Gets or sets the preferred metadata language. + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + SortReplaceCharacters: + type: array + items: + type: string + description: Gets or sets characters to be replaced with a ' ' in strings to create a sort name. + SortRemoveCharacters: + type: array + items: + type: string + description: Gets or sets characters to be removed from strings to create a sort name. + SortRemoveWords: + type: array + items: + type: string + description: Gets or sets words to be removed from strings to create a sort name. + MinResumePct: + type: integer + description: Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated. + format: int32 + MaxResumePct: + type: integer + description: Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched. + format: int32 + MinResumeDurationSeconds: + type: integer + description: Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates.. + format: int32 + MinAudiobookResume: + type: integer + description: Gets or sets the minimum minutes of a book that must be played in order for playstate to be updated. + format: int32 + MaxAudiobookResume: + type: integer + description: Gets or sets the remaining minutes of a book that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched. + format: int32 + LibraryMonitorDelay: + type: integer + description: "Gets or sets the delay in seconds that we will wait after a file system change to try and discover what has been added/removed\r\nSome delay is necessary with some items because their creation is not atomic. It involves the creation of several\r\ndifferent directories and files." + format: int32 + ImageSavingConvention: + allOf: + - $ref: '#/components/schemas/ImageSavingConvention' + description: Gets or sets the image saving convention. + MetadataOptions: + type: array + items: + $ref: '#/components/schemas/MetadataOptions' + SkipDeserializationForBasicTypes: + type: boolean + ServerName: + type: string + UICulture: + type: string + SaveMetadataHidden: + type: boolean + ContentTypes: + type: array + items: + $ref: '#/components/schemas/NameValuePair' + RemoteClientBitrateLimit: + type: integer + format: int32 + EnableFolderView: + type: boolean + EnableGroupingIntoCollections: + type: boolean + DisplaySpecialsWithinSeasons: + type: boolean + CodecsUsed: + type: array + items: + type: string + PluginRepositories: + type: array + items: + $ref: '#/components/schemas/RepositoryInfo' + EnableExternalContentInSuggestions: + type: boolean + ImageExtractionTimeoutMs: + type: integer + format: int32 + PathSubstitutions: + type: array + items: + $ref: '#/components/schemas/PathSubstitution' + EnableSlowResponseWarning: + type: boolean + description: Gets or sets a value indicating whether slow server responses should be logged as a warning. + SlowResponseThresholdMs: + type: integer + description: Gets or sets the threshold for the slow response time warning in ms. + format: int64 + CorsHosts: + type: array + items: + type: string + description: Gets or sets the cors hosts. + ActivityLogRetentionDays: + type: integer + description: Gets or sets the number of days we should retain activity logs. + format: int32 + nullable: true + LibraryScanFanoutConcurrency: + type: integer + description: Gets or sets the how the library scan fans out. + format: int32 + LibraryMetadataRefreshConcurrency: + type: integer + description: Gets or sets the how many metadata refreshes can run concurrently. + format: int32 + RemoveOldPlugins: + type: boolean + description: Gets or sets a value indicating whether older plugins should automatically be deleted from the plugin folder. + AllowClientLogUpload: + type: boolean + description: Gets or sets a value indicating whether clients should be allowed to upload logs. + additionalProperties: false + description: Represents the server configuration. + ServerDiscoveryInfo: + type: object + properties: + Address: + type: string + description: Gets the address. + Id: + type: string + description: Gets the server identifier. + Name: + type: string + description: Gets the name. + EndpointAddress: + type: string + description: Gets the endpoint address. + nullable: true + additionalProperties: false + description: The server discovery info model. + SessionInfo: + type: object + properties: + PlayState: + allOf: + - $ref: '#/components/schemas/PlayerStateInfo' + nullable: true + AdditionalUsers: + type: array + items: + $ref: '#/components/schemas/SessionUserInfo' + nullable: true + Capabilities: + allOf: + - $ref: '#/components/schemas/ClientCapabilities' + nullable: true + RemoteEndPoint: + type: string + description: Gets or sets the remote end point. + nullable: true + PlayableMediaTypes: + type: array + items: + type: string + description: Gets the playable media types. + nullable: true + readOnly: true + Id: + type: string + description: Gets or sets the id. + nullable: true + UserId: + type: string + description: Gets or sets the user id. + format: uuid + UserName: + type: string + description: Gets or sets the username. + nullable: true + Client: + type: string + description: Gets or sets the type of the client. + nullable: true + LastActivityDate: + type: string + description: Gets or sets the last activity date. + format: date-time + LastPlaybackCheckIn: + type: string + description: Gets or sets the last playback check in. + format: date-time + DeviceName: + type: string + description: Gets or sets the name of the device. + nullable: true + DeviceType: + type: string + description: Gets or sets the type of the device. + nullable: true + NowPlayingItem: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the now playing item. + nullable: true + FullNowPlayingItem: + allOf: + - $ref: '#/components/schemas/BaseItem' + description: Class BaseItem. + nullable: true + NowViewingItem: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + nullable: true + DeviceId: + type: string + description: Gets or sets the device id. + nullable: true + ApplicationVersion: + type: string + description: Gets or sets the application version. + nullable: true + TranscodingInfo: + allOf: + - $ref: '#/components/schemas/TranscodingInfo' + nullable: true + IsActive: + type: boolean + description: Gets a value indicating whether this instance is active. + readOnly: true + SupportsMediaControl: + type: boolean + readOnly: true + SupportsRemoteControl: + type: boolean + readOnly: true + NowPlayingQueue: + type: array + items: + $ref: '#/components/schemas/QueueItem' + nullable: true + NowPlayingQueueFullItems: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + nullable: true + HasCustomDeviceName: + type: boolean + PlaylistItemId: + type: string + nullable: true + ServerId: + type: string + nullable: true + UserPrimaryImageTag: + type: string + nullable: true + SupportedCommands: + type: array + items: + $ref: '#/components/schemas/GeneralCommandType' + description: Gets the supported commands. + nullable: true + readOnly: true + additionalProperties: false + description: Class SessionInfo. + SessionMessageType: + enum: + - ForceKeepAlive + - GeneralCommand + - UserDataChanged + - Sessions + - Play + - SyncPlayCommand + - SyncPlayGroupUpdate + - Playstate + - RestartRequired + - ServerShuttingDown + - ServerRestarting + - LibraryChanged + - UserDeleted + - UserUpdated + - SeriesTimerCreated + - TimerCreated + - SeriesTimerCancelled + - TimerCancelled + - RefreshProgress + - ScheduledTaskEnded + - PackageInstallationCancelled + - PackageInstallationFailed + - PackageInstallationCompleted + - PackageInstalling + - PackageUninstalled + - ActivityLogEntry + - ScheduledTasksInfo + - ActivityLogEntryStart + - ActivityLogEntryStop + - SessionsStart + - SessionsStop + - ScheduledTasksInfoStart + - ScheduledTasksInfoStop + - KeepAlive + type: string + description: The different kinds of messages that are used in the WebSocket api. + SessionUserInfo: + type: object + properties: + UserId: + type: string + description: Gets or sets the user identifier. + format: uuid + UserName: + type: string + description: Gets or sets the name of the user. + nullable: true + additionalProperties: false + description: Class SessionUserInfo. + SetChannelMappingDto: + required: + - ProviderChannelId + - ProviderId + - TunerChannelId + type: object + properties: + ProviderId: + type: string + description: Gets or sets the provider id. + TunerChannelId: + type: string + description: Gets or sets the tuner channel id. + ProviderChannelId: + type: string + description: Gets or sets the provider channel id. + additionalProperties: false + description: Set channel mapping dto. + SetPlaylistItemRequestDto: + type: object + properties: + PlaylistItemId: + type: string + description: Gets or sets the playlist identifier of the playing item. + format: uuid + additionalProperties: false + description: Class SetPlaylistItemRequestDto. + SetRepeatModeRequestDto: + type: object + properties: + Mode: + allOf: + - $ref: '#/components/schemas/GroupRepeatMode' + description: Enum GroupRepeatMode. + additionalProperties: false + description: Class SetRepeatModeRequestDto. + SetShuffleModeRequestDto: + type: object + properties: + Mode: + allOf: + - $ref: '#/components/schemas/GroupShuffleMode' + description: Enum GroupShuffleMode. + additionalProperties: false + description: Class SetShuffleModeRequestDto. + SongInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + AlbumArtists: + type: array + items: + type: string + nullable: true + Album: + type: string + nullable: true + Artists: + type: array + items: + type: string + nullable: true + additionalProperties: false + SortOrder: + enum: + - Ascending + - Descending + type: string + description: An enum representing the sorting order. + SpecialViewOptionDto: + type: object + properties: + Name: + type: string + description: Gets or sets view option name. + nullable: true + Id: + type: string + description: Gets or sets view option id. + nullable: true + additionalProperties: false + description: Special view option dto. + StartupConfigurationDto: + type: object + properties: + UICulture: + type: string + description: Gets or sets UI language culture. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + PreferredMetadataLanguage: + type: string + description: Gets or sets the preferred language for the metadata. + nullable: true + additionalProperties: false + description: The startup configuration DTO. + StartupRemoteAccessDto: + required: + - EnableAutomaticPortMapping + - EnableRemoteAccess + type: object + properties: + EnableRemoteAccess: + type: boolean + description: Gets or sets a value indicating whether enable remote access. + EnableAutomaticPortMapping: + type: boolean + description: Gets or sets a value indicating whether enable automatic port mapping. + additionalProperties: false + description: Startup remote access dto. + StartupUserDto: + type: object + properties: + Name: + type: string + description: Gets or sets the username. + nullable: true + Password: + type: string + description: Gets or sets the user's password. + nullable: true + additionalProperties: false + description: The startup user DTO. + SubtitleDeliveryMethod: + enum: + - Encode + - Embed + - External + - Hls + - Drop + type: string + description: Delivery method to use during playback of a specific subtitle format. + SubtitleOptions: + type: object + properties: + SkipIfEmbeddedSubtitlesPresent: + type: boolean + SkipIfAudioTrackMatches: + type: boolean + DownloadLanguages: + type: array + items: + type: string + nullable: true + DownloadMovieSubtitles: + type: boolean + DownloadEpisodeSubtitles: + type: boolean + OpenSubtitlesUsername: + type: string + nullable: true + OpenSubtitlesPasswordHash: + type: string + nullable: true + IsOpenSubtitleVipAccount: + type: boolean + RequirePerfectMatch: + type: boolean + additionalProperties: false + SubtitlePlaybackMode: + enum: + - Default + - Always + - OnlyForced + - None + - Smart + type: string + description: An enum representing a subtitle playback mode. + SubtitleProfile: + type: object + properties: + Format: + type: string + nullable: true + Method: + allOf: + - $ref: '#/components/schemas/SubtitleDeliveryMethod' + description: Delivery method to use during playback of a specific subtitle format. + DidlMode: + type: string + nullable: true + Language: + type: string + nullable: true + Container: + type: string + nullable: true + additionalProperties: false + SyncPlayUserAccessType: + enum: + - CreateAndJoinGroups + - JoinGroups + - None + type: string + description: Enum SyncPlayUserAccessType. + SystemInfo: + type: object + properties: + LocalAddress: + type: string + description: Gets or sets the local address. + nullable: true + ServerName: + type: string + description: Gets or sets the name of the server. + nullable: true + Version: + type: string + description: Gets or sets the server version. + nullable: true + ProductName: + type: string + description: Gets or sets the product name. This is the AssemblyProduct name. + nullable: true + OperatingSystem: + type: string + description: Gets or sets the operating system. + nullable: true + Id: + type: string + description: Gets or sets the id. + nullable: true + StartupWizardCompleted: + type: boolean + description: Gets or sets a value indicating whether the startup wizard is completed. + nullable: true + OperatingSystemDisplayName: + type: string + description: Gets or sets the display name of the operating system. + nullable: true + PackageName: + type: string + description: Gets or sets the package name. + nullable: true + HasPendingRestart: + type: boolean + description: Gets or sets a value indicating whether this instance has pending restart. + IsShuttingDown: + type: boolean + SupportsLibraryMonitor: + type: boolean + description: Gets or sets a value indicating whether [supports library monitor]. + WebSocketPortNumber: + type: integer + description: Gets or sets the web socket port number. + format: int32 + CompletedInstallations: + type: array + items: + $ref: '#/components/schemas/InstallationInfo' + description: Gets or sets the completed installations. + nullable: true + CanSelfRestart: + type: boolean + description: Gets or sets a value indicating whether this instance can self restart. + CanLaunchWebBrowser: + type: boolean + ProgramDataPath: + type: string + description: Gets or sets the program data path. + nullable: true + WebPath: + type: string + description: Gets or sets the web UI resources path. + nullable: true + ItemsByNamePath: + type: string + description: Gets or sets the items by name path. + nullable: true + CachePath: + type: string + description: Gets or sets the cache path. + nullable: true + LogPath: + type: string + description: Gets or sets the log path. + nullable: true + InternalMetadataPath: + type: string + description: Gets or sets the internal metadata path. + nullable: true + TranscodingTempPath: + type: string + description: Gets or sets the transcode path. + nullable: true + HasUpdateAvailable: + type: boolean + description: Gets or sets a value indicating whether this instance has update available. + deprecated: true + EncoderLocation: + allOf: + - $ref: '#/components/schemas/FFmpegLocation' + description: Enum describing the location of the FFmpeg tool. + deprecated: true + SystemArchitecture: + allOf: + - $ref: '#/components/schemas/Architecture' + additionalProperties: false + description: Class SystemInfo. + TaskCompletionStatus: + enum: + - Completed + - Failed + - Cancelled + - Aborted + type: string + description: Enum TaskCompletionStatus. + TaskInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + State: + allOf: + - $ref: '#/components/schemas/TaskState' + description: Gets or sets the state of the task. + CurrentProgressPercentage: + type: number + description: Gets or sets the progress. + format: double + nullable: true + Id: + type: string + description: Gets or sets the id. + nullable: true + LastExecutionResult: + allOf: + - $ref: '#/components/schemas/TaskResult' + description: Gets or sets the last execution result. + nullable: true + Triggers: + type: array + items: + $ref: '#/components/schemas/TaskTriggerInfo' + description: Gets or sets the triggers. + nullable: true + Description: + type: string + description: Gets or sets the description. + nullable: true + Category: + type: string + description: Gets or sets the category. + nullable: true + IsHidden: + type: boolean + description: Gets or sets a value indicating whether this instance is hidden. + Key: + type: string + description: Gets or sets the key. + nullable: true + additionalProperties: false + description: Class TaskInfo. + TaskResult: + type: object + properties: + StartTimeUtc: + type: string + description: Gets or sets the start time UTC. + format: date-time + EndTimeUtc: + type: string + description: Gets or sets the end time UTC. + format: date-time + Status: + allOf: + - $ref: '#/components/schemas/TaskCompletionStatus' + description: Gets or sets the status. + Name: + type: string + description: Gets or sets the name. + nullable: true + Key: + type: string + description: Gets or sets the key. + nullable: true + Id: + type: string + description: Gets or sets the id. + nullable: true + ErrorMessage: + type: string + description: Gets or sets the error message. + nullable: true + LongErrorMessage: + type: string + description: Gets or sets the long error message. + nullable: true + additionalProperties: false + description: Class TaskExecutionInfo. + TaskState: + enum: + - Idle + - Cancelling + - Running + type: string + description: Enum TaskState. + TaskTriggerInfo: + type: object + properties: + Type: + type: string + description: Gets or sets the type. + nullable: true + TimeOfDayTicks: + type: integer + description: Gets or sets the time of day. + format: int64 + nullable: true + IntervalTicks: + type: integer + description: Gets or sets the interval. + format: int64 + nullable: true + DayOfWeek: + allOf: + - $ref: '#/components/schemas/DayOfWeek' + description: Gets or sets the day of week. + nullable: true + MaxRuntimeTicks: + type: integer + description: Gets or sets the maximum runtime ticks. + format: int64 + nullable: true + additionalProperties: false + description: Class TaskTriggerInfo. + ThemeMediaResult: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the items. + nullable: true + TotalRecordCount: + type: integer + description: Gets or sets the total number of records available. + format: int32 + StartIndex: + type: integer + description: Gets or sets the index of the first record in Items. + format: int32 + OwnerId: + type: string + description: Gets or sets the owner id. + format: uuid + additionalProperties: false + description: Class ThemeMediaResult. + TimerEventInfo: + type: object + properties: + Id: + type: string + ProgramId: + type: string + format: uuid + nullable: true + additionalProperties: false + TimerInfoDto: + type: object + properties: + Id: + type: string + description: Gets or sets the Id of the recording. + nullable: true + Type: + type: string + nullable: true + ServerId: + type: string + description: Gets or sets the server identifier. + nullable: true + ExternalId: + type: string + description: Gets or sets the external identifier. + nullable: true + ChannelId: + type: string + description: Gets or sets the channel id of the recording. + format: uuid + ExternalChannelId: + type: string + description: Gets or sets the external channel identifier. + nullable: true + ChannelName: + type: string + description: Gets or sets the channel name of the recording. + nullable: true + ChannelPrimaryImageTag: + type: string + nullable: true + ProgramId: + type: string + description: Gets or sets the program identifier. + nullable: true + ExternalProgramId: + type: string + description: Gets or sets the external program identifier. + nullable: true + Name: + type: string + description: Gets or sets the name of the recording. + nullable: true + Overview: + type: string + description: Gets or sets the description of the recording. + nullable: true + StartDate: + type: string + description: Gets or sets the start date of the recording, in UTC. + format: date-time + EndDate: + type: string + description: Gets or sets the end date of the recording, in UTC. + format: date-time + ServiceName: + type: string + description: Gets or sets the name of the service. + nullable: true + Priority: + type: integer + description: Gets or sets the priority. + format: int32 + PrePaddingSeconds: + type: integer + description: Gets or sets the pre padding seconds. + format: int32 + PostPaddingSeconds: + type: integer + description: Gets or sets the post padding seconds. + format: int32 + IsPrePaddingRequired: + type: boolean + description: Gets or sets a value indicating whether this instance is pre padding required. + ParentBackdropItemId: + type: string + description: Gets or sets the Id of the Parent that has a backdrop if the item does not have one. + nullable: true + ParentBackdropImageTags: + type: array + items: + type: string + description: Gets or sets the parent backdrop image tags. + nullable: true + IsPostPaddingRequired: + type: boolean + description: Gets or sets a value indicating whether this instance is post padding required. + KeepUntil: + allOf: + - $ref: '#/components/schemas/KeepUntil' + Status: + allOf: + - $ref: '#/components/schemas/RecordingStatus' + description: Gets or sets the status. + SeriesTimerId: + type: string + description: Gets or sets the series timer identifier. + nullable: true + ExternalSeriesTimerId: + type: string + description: Gets or sets the external series timer identifier. + nullable: true + RunTimeTicks: + type: integer + description: Gets or sets the run time ticks. + format: int64 + nullable: true + ProgramInfo: + allOf: + - $ref: '#/components/schemas/BaseItemDto' + description: Gets or sets the program information. + nullable: true + additionalProperties: false + TimerInfoDtoQueryResult: + type: object + properties: + Items: + type: array + items: + $ref: '#/components/schemas/TimerInfoDto' + description: Gets or sets the items. + nullable: true + TotalRecordCount: + type: integer + description: Gets or sets the total number of records available. + format: int32 + StartIndex: + type: integer + description: Gets or sets the index of the first record in Items. + format: int32 + additionalProperties: false + TrailerInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + OriginalTitle: + type: string + description: Gets or sets the original title. + nullable: true + Path: + type: string + description: Gets or sets the path. + nullable: true + MetadataLanguage: + type: string + description: Gets or sets the metadata language. + nullable: true + MetadataCountryCode: + type: string + description: Gets or sets the metadata country code. + nullable: true + ProviderIds: + type: object + additionalProperties: + type: string + nullable: true + description: Gets or sets the provider ids. + nullable: true + Year: + type: integer + description: Gets or sets the year. + format: int32 + nullable: true + IndexNumber: + type: integer + format: int32 + nullable: true + ParentIndexNumber: + type: integer + format: int32 + nullable: true + PremiereDate: + type: string + format: date-time + nullable: true + IsAutomated: + type: boolean + additionalProperties: false + TrailerInfoRemoteSearchQuery: + type: object + properties: + SearchInfo: + allOf: + - $ref: '#/components/schemas/TrailerInfo' + nullable: true + ItemId: + type: string + format: uuid + SearchProviderName: + type: string + description: Gets or sets the provider name to search within if set. + nullable: true + IncludeDisabledProviders: + type: boolean + description: Gets or sets a value indicating whether disabled providers should be included. + additionalProperties: false + TranscodeReason: + enum: + - ContainerNotSupported + - VideoCodecNotSupported + - AudioCodecNotSupported + - SubtitleCodecNotSupported + - AudioIsExternal + - SecondaryAudioNotSupported + - VideoProfileNotSupported + - VideoLevelNotSupported + - VideoResolutionNotSupported + - VideoBitDepthNotSupported + - VideoFramerateNotSupported + - RefFramesNotSupported + - AnamorphicVideoNotSupported + - InterlacedVideoNotSupported + - AudioChannelsNotSupported + - AudioProfileNotSupported + - AudioSampleRateNotSupported + - AudioBitDepthNotSupported + - ContainerBitrateExceedsLimit + - VideoBitrateNotSupported + - AudioBitrateNotSupported + - UnknownVideoStreamInfo + - UnknownAudioStreamInfo + - DirectPlayError + - VideoRangeTypeNotSupported + type: string + TranscodeSeekInfo: + enum: + - Auto + - Bytes + type: string + TranscodingInfo: + type: object + properties: + AudioCodec: + type: string + nullable: true + VideoCodec: + type: string + nullable: true + Container: + type: string + nullable: true + IsVideoDirect: + type: boolean + IsAudioDirect: + type: boolean + Bitrate: + type: integer + format: int32 + nullable: true + Framerate: + type: number + format: float + nullable: true + CompletionPercentage: + type: number + format: double + nullable: true + Width: + type: integer + format: int32 + nullable: true + Height: + type: integer + format: int32 + nullable: true + AudioChannels: + type: integer + format: int32 + nullable: true + HardwareAccelerationType: + allOf: + - $ref: '#/components/schemas/HardwareEncodingType' + nullable: true + TranscodeReasons: + type: array + items: + $ref: '#/components/schemas/TranscodeReason' + additionalProperties: false + TranscodingProfile: + type: object + properties: + Container: + type: string + Type: + allOf: + - $ref: '#/components/schemas/DlnaProfileType' + VideoCodec: + type: string + AudioCodec: + type: string + Protocol: + type: string + EstimateContentLength: + type: boolean + default: false + EnableMpegtsM2TsMode: + type: boolean + default: false + TranscodeSeekInfo: + allOf: + - $ref: '#/components/schemas/TranscodeSeekInfo' + default: Auto + CopyTimestamps: + type: boolean + default: false + Context: + allOf: + - $ref: '#/components/schemas/EncodingContext' + default: Streaming + EnableSubtitlesInManifest: + type: boolean + default: false + MaxAudioChannels: + type: string + nullable: true + MinSegments: + type: integer + format: int32 + default: 0 + SegmentLength: + type: integer + format: int32 + default: 0 + BreakOnNonKeyFrames: + type: boolean + default: false + Conditions: + type: array + items: + $ref: '#/components/schemas/ProfileCondition' + additionalProperties: false + TransportStreamTimestamp: + enum: + - None + - Zero + - Valid + type: string + TunerChannelMapping: + type: object + properties: + Name: + type: string + nullable: true + ProviderChannelName: + type: string + nullable: true + ProviderChannelId: + type: string + nullable: true + Id: + type: string + nullable: true + additionalProperties: false + TunerHostInfo: + type: object + properties: + Id: + type: string + nullable: true + Url: + type: string + nullable: true + Type: + type: string + nullable: true + DeviceId: + type: string + nullable: true + FriendlyName: + type: string + nullable: true + ImportFavoritesOnly: + type: boolean + AllowHWTranscoding: + type: boolean + EnableStreamLooping: + type: boolean + Source: + type: string + nullable: true + TunerCount: + type: integer + format: int32 + UserAgent: + type: string + nullable: true + additionalProperties: false + TypeOptions: + type: object + properties: + Type: + type: string + nullable: true + MetadataFetchers: + type: array + items: + type: string + nullable: true + MetadataFetcherOrder: + type: array + items: + type: string + nullable: true + ImageFetchers: + type: array + items: + type: string + nullable: true + ImageFetcherOrder: + type: array + items: + type: string + nullable: true + ImageOptions: + type: array + items: + $ref: '#/components/schemas/ImageOption' + nullable: true + additionalProperties: false + UnratedItem: + enum: + - Movie + - Trailer + - Series + - Music + - Book + - LiveTvChannel + - LiveTvProgram + - ChannelContent + - Other + type: string + description: An enum representing an unrated item. + UpdateLibraryOptionsDto: + type: object + properties: + Id: + type: string + description: Gets or sets the library item id. + format: uuid + LibraryOptions: + allOf: + - $ref: '#/components/schemas/LibraryOptions' + description: Gets or sets library options. + nullable: true + additionalProperties: false + description: Update library options dto. + UpdateMediaPathRequestDto: + required: + - Name + - PathInfo + type: object + properties: + Name: + type: string + description: Gets or sets the library name. + PathInfo: + allOf: + - $ref: '#/components/schemas/MediaPathInfo' + description: Gets or sets library folder path information. + additionalProperties: false + description: Update library options dto. + UpdateUserEasyPassword: + type: object + properties: + NewPassword: + type: string + description: Gets or sets the new sha1-hashed password. + nullable: true + NewPw: + type: string + description: Gets or sets the new password. + nullable: true + ResetPassword: + type: boolean + description: Gets or sets a value indicating whether to reset the password. + additionalProperties: false + description: The update user easy password request body. + UpdateUserPassword: + type: object + properties: + CurrentPassword: + type: string + description: Gets or sets the current sha1-hashed password. + nullable: true + CurrentPw: + type: string + description: Gets or sets the current plain text password. + nullable: true + NewPw: + type: string + description: Gets or sets the new plain text password. + nullable: true + ResetPassword: + type: boolean + description: Gets or sets a value indicating whether to reset the password. + additionalProperties: false + description: The update user password request body. + UploadSubtitleDto: + required: + - Data + - Format + - IsForced + - Language + type: object + properties: + Language: + type: string + description: Gets or sets the subtitle language. + Format: + type: string + description: Gets or sets the subtitle format. + IsForced: + type: boolean + description: Gets or sets a value indicating whether the subtitle is forced. + Data: + type: string + description: Gets or sets the subtitle data. + additionalProperties: false + description: Upload subtitles dto. + UserConfiguration: + type: object + properties: + AudioLanguagePreference: + type: string + description: Gets or sets the audio language preference. + nullable: true + PlayDefaultAudioTrack: + type: boolean + description: Gets or sets a value indicating whether [play default audio track]. + SubtitleLanguagePreference: + type: string + description: Gets or sets the subtitle language preference. + nullable: true + DisplayMissingEpisodes: + type: boolean + GroupedFolders: + type: array + items: + type: string + SubtitleMode: + allOf: + - $ref: '#/components/schemas/SubtitlePlaybackMode' + description: An enum representing a subtitle playback mode. + DisplayCollectionsView: + type: boolean + EnableLocalPassword: + type: boolean + OrderedViews: + type: array + items: + type: string + LatestItemsExcludes: + type: array + items: + type: string + MyMediaExcludes: + type: array + items: + type: string + HidePlayedInLatest: + type: boolean + RememberAudioSelections: + type: boolean + RememberSubtitleSelections: + type: boolean + EnableNextEpisodeAutoPlay: + type: boolean + additionalProperties: false + description: Class UserConfiguration. + UserDto: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + ServerId: + type: string + description: Gets or sets the server identifier. + nullable: true + ServerName: + type: string + description: "Gets or sets the name of the server.\r\nThis is not used by the server and is for client-side usage only." + nullable: true + Id: + type: string + description: Gets or sets the id. + format: uuid + PrimaryImageTag: + type: string + description: Gets or sets the primary image tag. + nullable: true + HasPassword: + type: boolean + description: Gets or sets a value indicating whether this instance has password. + HasConfiguredPassword: + type: boolean + description: Gets or sets a value indicating whether this instance has configured password. + HasConfiguredEasyPassword: + type: boolean + description: Gets or sets a value indicating whether this instance has configured easy password. + EnableAutoLogin: + type: boolean + description: Gets or sets whether async login is enabled or not. + nullable: true + LastLoginDate: + type: string + description: Gets or sets the last login date. + format: date-time + nullable: true + LastActivityDate: + type: string + description: Gets or sets the last activity date. + format: date-time + nullable: true + Configuration: + allOf: + - $ref: '#/components/schemas/UserConfiguration' + description: Gets or sets the configuration. + nullable: true + Policy: + allOf: + - $ref: '#/components/schemas/UserPolicy' + description: Gets or sets the policy. + nullable: true + PrimaryImageAspectRatio: + type: number + description: Gets or sets the primary image aspect ratio. + format: double + nullable: true + additionalProperties: false + description: Class UserDto. + UserItemDataDto: + type: object + properties: + Rating: + type: number + description: Gets or sets the rating. + format: double + nullable: true + PlayedPercentage: + type: number + description: Gets or sets the played percentage. + format: double + nullable: true + UnplayedItemCount: + type: integer + description: Gets or sets the unplayed item count. + format: int32 + nullable: true + PlaybackPositionTicks: + type: integer + description: Gets or sets the playback position ticks. + format: int64 + PlayCount: + type: integer + description: Gets or sets the play count. + format: int32 + IsFavorite: + type: boolean + description: Gets or sets a value indicating whether this instance is favorite. + Likes: + type: boolean + description: Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is likes. + nullable: true + LastPlayedDate: + type: string + description: Gets or sets the last played date. + format: date-time + nullable: true + Played: + type: boolean + description: Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played. + Key: + type: string + description: Gets or sets the key. + nullable: true + ItemId: + type: string + description: Gets or sets the item identifier. + nullable: true + additionalProperties: false + description: Class UserItemDataDto. + UserPolicy: + type: object + properties: + IsAdministrator: + type: boolean + description: Gets or sets a value indicating whether this instance is administrator. + IsHidden: + type: boolean + description: Gets or sets a value indicating whether this instance is hidden. + IsDisabled: + type: boolean + description: Gets or sets a value indicating whether this instance is disabled. + MaxParentalRating: + type: integer + description: Gets or sets the max parental rating. + format: int32 + nullable: true + BlockedTags: + type: array + items: + type: string + nullable: true + EnableUserPreferenceAccess: + type: boolean + AccessSchedules: + type: array + items: + $ref: '#/components/schemas/AccessSchedule' + nullable: true + BlockUnratedItems: + type: array + items: + $ref: '#/components/schemas/UnratedItem' + nullable: true + EnableRemoteControlOfOtherUsers: + type: boolean + EnableSharedDeviceControl: + type: boolean + EnableRemoteAccess: + type: boolean + EnableLiveTvManagement: + type: boolean + EnableLiveTvAccess: + type: boolean + EnableMediaPlayback: + type: boolean + EnableAudioPlaybackTranscoding: + type: boolean + EnableVideoPlaybackTranscoding: + type: boolean + EnablePlaybackRemuxing: + type: boolean + ForceRemoteSourceTranscoding: + type: boolean + EnableContentDeletion: + type: boolean + EnableContentDeletionFromFolders: + type: array + items: + type: string + nullable: true + EnableContentDownloading: + type: boolean + EnableSyncTranscoding: + type: boolean + description: Gets or sets a value indicating whether [enable synchronize]. + EnableMediaConversion: + type: boolean + EnabledDevices: + type: array + items: + type: string + nullable: true + EnableAllDevices: + type: boolean + EnabledChannels: + type: array + items: + type: string + format: uuid + nullable: true + EnableAllChannels: + type: boolean + EnabledFolders: + type: array + items: + type: string + format: uuid + nullable: true + EnableAllFolders: + type: boolean + InvalidLoginAttemptCount: + type: integer + format: int32 + LoginAttemptsBeforeLockout: + type: integer + format: int32 + MaxActiveSessions: + type: integer + format: int32 + EnablePublicSharing: + type: boolean + BlockedMediaFolders: + type: array + items: + type: string + format: uuid + nullable: true + BlockedChannels: + type: array + items: + type: string + format: uuid + nullable: true + RemoteClientBitrateLimit: + type: integer + format: int32 + AuthenticationProviderId: + type: string + nullable: true + PasswordResetProviderId: + type: string + nullable: true + SyncPlayAccess: + allOf: + - $ref: '#/components/schemas/SyncPlayUserAccessType' + description: Gets or sets a value indicating what SyncPlay features the user can access. + additionalProperties: false + UtcTimeResponse: + type: object + properties: + RequestReceptionTime: + type: string + description: Gets the UTC time when request has been received. + format: date-time + ResponseTransmissionTime: + type: string + description: Gets the UTC time when response has been sent. + format: date-time + additionalProperties: false + description: Class UtcTimeResponse. + ValidatePathDto: + type: object + properties: + ValidateWritable: + type: boolean + description: Gets or sets a value indicating whether validate if path is writable. + Path: + type: string + description: Gets or sets the path. + nullable: true + IsFile: + type: boolean + description: Gets or sets is path file. + nullable: true + additionalProperties: false + description: Validate path object. + VersionInfo: + type: object + properties: + version: + type: string + description: Gets or sets the version. + VersionNumber: + type: string + description: Gets the version as a System.Version. + readOnly: true + changelog: + type: string + description: Gets or sets the changelog for this version. + nullable: true + targetAbi: + type: string + description: Gets or sets the ABI that this version was built against. + nullable: true + sourceUrl: + type: string + description: Gets or sets the source URL. + nullable: true + checksum: + type: string + description: Gets or sets a checksum for the binary. + nullable: true + timestamp: + type: string + description: Gets or sets a timestamp of when the binary was built. + nullable: true + repositoryName: + type: string + description: Gets or sets the repository name. + repositoryUrl: + type: string + description: Gets or sets the repository url. + additionalProperties: false + description: Defines the MediaBrowser.Model.Updates.VersionInfo class. + Video3DFormat: + enum: + - HalfSideBySide + - FullSideBySide + - FullTopAndBottom + - HalfTopAndBottom + - MVC + type: string + VideoType: + enum: + - VideoFile + - Iso + - Dvd + - BluRay + type: string + description: Enum VideoType. + VirtualFolderInfo: + type: object + properties: + Name: + type: string + description: Gets or sets the name. + nullable: true + Locations: + type: array + items: + type: string + description: Gets or sets the locations. + nullable: true + CollectionType: + allOf: + - $ref: '#/components/schemas/CollectionTypeOptions' + description: Gets or sets the type of the collection. + nullable: true + LibraryOptions: + allOf: + - $ref: '#/components/schemas/LibraryOptions' + nullable: true + ItemId: + type: string + description: Gets or sets the item identifier. + nullable: true + PrimaryImageItemId: + type: string + description: Gets or sets the primary image item identifier. + nullable: true + RefreshProgress: + type: number + format: double + nullable: true + RefreshStatus: + type: string + nullable: true + additionalProperties: false + description: Used to hold information about a user's list of configured virtual folders. + WakeOnLanInfo: + type: object + properties: + MacAddress: + type: string + description: Gets the MAC address of the device. + nullable: true + Port: + type: integer + description: Gets or sets the wake-on-LAN port. + format: int32 + additionalProperties: false + description: Provides the MAC address and port for wake-on-LAN functionality. + XbmcMetadataOptions: + type: object + properties: + UserId: + type: string + nullable: true + ReleaseDateFormat: + type: string + SaveImagePathsInNfo: + type: boolean + EnablePathSubstitution: + type: boolean + EnableExtraThumbsDuplication: + type: boolean + additionalProperties: false + XmlAttribute: + type: object + properties: + Name: + type: string + description: Gets or sets the name of the attribute. + nullable: true + Value: + type: string + description: Gets or sets the value of the attribute. + nullable: true + additionalProperties: false + description: Defines the MediaBrowser.Model.Dlna.XmlAttribute. + securitySchemes: + CustomAuthentication: + type: apiKey + description: API key header parameter + name: Authorization + in: header diff --git a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/templates/generatedAnnotation.mustache b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/templates/generatedAnnotation.mustache new file mode 100644 index 0000000000000..ace373fdd5c94 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/templates/generatedAnnotation.mustache @@ -0,0 +1 @@ +@jakarta.annotation.Generated(value = "{{generatorClass}}", comments = "OpenAPI Generator") \ No newline at end of file diff --git a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/templates/licenseInfo.mustache b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/templates/licenseInfo.mustache new file mode 100644 index 0000000000000..043c2a1a097a1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/templates/licenseInfo.mustache @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ \ No newline at end of file diff --git a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/templates/nullable_var_annotations.mustache b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/templates/nullable_var_annotations.mustache new file mode 100644 index 0000000000000..36ee770dd5c51 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/templates/nullable_var_annotations.mustache @@ -0,0 +1 @@ +{{#required}}{{#isNullable}}@org.eclipse.jdt.annotation.Nullable{{/isNullable}}{{^isNullable}}@org.eclipse.jdt.annotation.Nullable{{/isNullable}}{{/required}}{{^required}}@org.eclipse.jdt.annotation.NonNull{{/required}} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 8482a7b8a6c6a..2edb5b392f485 100644 --- a/pom.xml +++ b/pom.xml @@ -306,9 +306,6 @@ Import-Package: \\ CLASSPATH -classpath ${project.build.directory}/dependency - -err:+nullAnnot(org.eclipse.jdt.annotation.Nullable|org.eclipse.jdt.annotation.NonNull|org.eclipse.jdt.annotation.NonNullByDefault),+inheritNullAnnot,+nullAnnotConflict,-nullUncheckedConversion - -warn:+null,+inheritNullAnnot,-nullUncheckedConversion,+nullAnnotRedundant,+nullDereference - -nowarn:[${project.build.directory}/generated-sources] true true @@ -479,7 +476,7 @@ Import-Package: \\ i18n-maven-plugin ${ohc.version} - + com.diffplug.spotless spotless-maven-plugin diff --git a/tools/static-code-analysis/checkstyle/suppressions.xml b/tools/static-code-analysis/checkstyle/suppressions.xml index f5c6be25cb3c8..883727a1e05a7 100644 --- a/tools/static-code-analysis/checkstyle/suppressions.xml +++ b/tools/static-code-analysis/checkstyle/suppressions.xml @@ -1,6 +1,7 @@ + @@ -27,4 +28,4 @@ - \ No newline at end of file + diff --git a/tools/static-code-analysis/spotbugs/suppressions.xml b/tools/static-code-analysis/spotbugs/suppressions.xml index 8502f7b364ac5..0c76d06a0d1f3 100644 --- a/tools/static-code-analysis/spotbugs/suppressions.xml +++ b/tools/static-code-analysis/spotbugs/suppressions.xml @@ -1,5 +1,8 @@ + + + From 6de4bde3688c465bc05380468e37c7faf9ec1071 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sat, 19 Jul 2025 23:34:08 +0200 Subject: [PATCH 02/38] feat(configuration): binding configuration added Binding configuration for discovery port and timeout added; poc to learn how to do binding configs ... --- .../org.openhab.binding.jellyfin/README.md | 44 ++++++---- .../internal/BindingConfiguration.java | 72 +++++++++++++++++ .../binding/jellyfin/internal/Constants.java | 5 ++ .../jellyfin/internal/api/ApiClient.java | 20 +++++ .../internal/api/ApiClientFactory.java | 49 +++++++++++ ...coveryHelper.java => ServerDiscovery.java} | 25 +++--- .../discovery/ServerDiscoveryService.java | 22 +++-- ...inException.java => BindingException.java} | 4 +- .../internal/exceptions/ExceptionHandler.java | 31 +++++++ .../internal/handler/HandlerFactory.java | 22 ++++- .../internal/handler/ServerHandler.java | 81 +++++++++++++------ .../handler/tasks/ConnectionTask.java | 48 +++++++++++ ...Handler.java => ExceptionHandlerType.java} | 2 +- .../src/main/resources/OH-INF/addon/addon.xml | 22 +++++ .../resources/OH-INF/i18n/jellyfin.properties | 9 +++ .../generate-sources/scripts/generate.sh | 15 ++-- 16 files changed, 403 insertions(+), 68 deletions(-) create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/BindingConfiguration.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClient.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClientFactory.java rename bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/{ServerDiscoveryHelper.java => ServerDiscovery.java} (88%) rename bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/{JellyfinException.java => BindingException.java} (88%) create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/ExceptionHandler.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ConnectionTask.java rename bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/types/{JellyfinExceptionHandler.java => ExceptionHandlerType.java} (93%) diff --git a/bundles/org.openhab.binding.jellyfin/README.md b/bundles/org.openhab.binding.jellyfin/README.md index 8077080a3d969..5bf5e531b735d 100644 --- a/bundles/org.openhab.binding.jellyfin/README.md +++ b/bundles/org.openhab.binding.jellyfin/README.md @@ -4,16 +4,30 @@ This is the binding for [Jellyfin](https://jellyfin.org), the volunteer built me This binding allows you to connect to Jellyfin clients that supports remote control, it's built on top of the official Jellyfin Kotlin SDK. It is compatible with Jellyfin servers from version `10.8.1`, recommended is `10.8.13`. +## Binding - Configuration + +Parameters to fine-tune server discovery. +For most users the default configuration will work. + +| Parameter | Description | Value | +| --------- | -------------------------------------------------- | ---------- | +| Port | Port used to query servers on local network(s) | 0 - 65535 | +| Timeout | Maximum amount of time to wait for a response [ms] | 500 - 5000 | + ## Discovery -To discover clients, you must first configure a server (bridge). -Servers will be discovered automatically, or can be added manually. -After that, device discovery will detect controllable clients. +Servers can be discovered using a local network broadcast. +This discovery needs to be triggered manually and is designed for local networks. +Broadcasts typically do not traverse subnets or VLANs without specific network configurations. +If your Jellyfin servers are on different subnets, auto-discovery will likely not work. +In this case you need to configure the server manually using its IP address or hostname. + +Once a Jellyfin server bridge has been added, clients will be detected automatically. ## Thing Types | ThingTypeID | Description | -|-----------------|---------------------------------------| +| --------------- | ------------------------------------- | | server (bridge) | Jellyfin server instance | | client | Jellyfin controllable client instance | @@ -26,21 +40,21 @@ In order to assist you with this process the binding expose a simple login form ## Server Thing Configuration -| Config | Type | Description | -|---------------------------|---------|----------------------------------------------------------------------------------------------| -| hostname | Text | Hostname or IP address of the server (required) | -| port | Integer | Port of the server (required) | -| ssl | Boolean | Connect through https (required) | -| path | Text | Base path of the server | -| refreshSeconds | Integer | Interval to pull devices state from the server | -| clientActiveWithInSeconds | Integer | Amount of seconds allowed since the last client activity to assert it's online (0 disabled) | -| userId | Text | The user id | -| token | Text | The user access token | +| Config | Type | Description | +| ------------------------- | ------- | ------------------------------------------------------------------------------------------- | +| hostname | Text | Hostname or IP address of the server (required) | +| port | Integer | Port of the server (required) | +| ssl | Boolean | Connect through https (required) | +| path | Text | Base path of the server | +| refreshSeconds | Integer | Interval to pull devices state from the server | +| clientActiveWithInSeconds | Integer | Amount of seconds allowed since the last client activity to assert it's online (0 disabled) | +| userId | Text | The user id | +| token | Text | The user access token | ## Channels | channel | Type | Description | -|----------------------------|--------|-----------------------------------------------------------------------------------------------------------------| +| -------------------------- | ------ | --------------------------------------------------------------------------------------------------------------- | | send-notification | String | Display message in client | | media-control | Player | Control media playback | | playing-item-id | String | Id of the item currently playing (readonly) | diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/BindingConfiguration.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/BindingConfiguration.java new file mode 100644 index 0000000000000..e59afa3081241 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/BindingConfiguration.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal; + +import java.io.IOException; +import java.util.Dictionary; +import java.util.Enumeration; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.osgi.service.cm.ConfigurationAdmin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link BindingConfiguration} class contains fields mapping binding + * configuration parameters. + * + * @author Patrik Gfeller - Initial contribution + */ +@NonNullByDefault +public class BindingConfiguration { + private static final Logger logger = LoggerFactory.getLogger(BindingConfiguration.class); + + /** + * Port used to locate available servers on local network(s). + */ + public int discoveryPort = 7359; + /** + * Maximum amount of time to wait for a response during the server discovery + * process. + */ + public int discoveryTimeout = 2000; + /** + * Jellyfin specific discovery message. + */ + public String discoveryMessage = "who is JellyfinServer?"; + + public static BindingConfiguration getConfiguration(ConfigurationAdmin configurationAdmin) { + BindingConfiguration bindingConfig = new BindingConfiguration(); + + try { + var configuration = configurationAdmin.getConfiguration(Constants.BINDING_PID); + Dictionary properties = configuration.getProperties(); + + if (properties != null) { + org.openhab.core.config.core.Configuration config = new org.openhab.core.config.core.Configuration(); + for (Enumeration keys = properties.keys(); keys.hasMoreElements();) { + String key = keys.nextElement(); + config.put(key, properties.get(key)); + } + logger.debug("Applied binding configuration from OSGi configuration"); + return config.as(BindingConfiguration.class); + } else { + logger.debug("No configuration found for binding, using defaults"); + } + } catch (IOException e) { + logger.warn("Unable to read binding configuration: {}", e.getMessage()); + } + + return bindingConfig; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Constants.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Constants.java index b9c9eea6e52ad..b317ca673aec5 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Constants.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Constants.java @@ -28,6 +28,11 @@ public class Constants { static final String BINDING_ID = "jellyfin"; + static final String BINDING_PID = "binding.jellyfin"; + + // Property names + public static final String PROPERTY_API_VERSION = "apiVersion"; + public static final String PROPERTY_SERVER_URI = "uri"; // List of all Thing Type UIDs public static final ThingTypeUID THING_TYPE_SERVER = new ThingTypeUID(BINDING_ID, "server"); diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClient.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClient.java new file mode 100644 index 0000000000000..48d1f39483067 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClient.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +@NonNullByDefault +public class ApiClient extends org.openhab.binding.jellyfin.internal.api.generated.ApiClient { + +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClientFactory.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClientFactory.java new file mode 100644 index 0000000000000..bac8934af4531 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClientFactory.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.io.net.http.HttpClientFactory; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ServiceScope; + +/** + * JellyfinApiClient is a API client for interacting with the Jellyfin server. + * + * @author Patrik Gfeller - Initial Contribution + */ +@NonNullByDefault +@Component(scope = ServiceScope.SINGLETON, configurationPid = "api.jellyfin", service = ApiClientFactory.class) +public class ApiClientFactory { + private final HttpClientFactory httpClientFactory; + + @Activate + public ApiClientFactory(@Reference final HttpClientFactory httpClientFactory) { + this.httpClientFactory = httpClientFactory; + } + + /** + * Creates a new ApiClient instance configured with the HTTP client factory. + * + * @param baseUrl The base URL for the Jellyfin server + * @return A configured ApiClient instance + */ + public ApiClient createApiClient() { + ApiClient client = new ApiClient(); + // Configure the client with HTTP client factory and base URL + // Add any additional configuration here + return client; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryHelper.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscovery.java similarity index 88% rename from bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryHelper.java rename to bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscovery.java index 15c246a6cff72..2b4a784c433ee 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryHelper.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscovery.java @@ -35,17 +35,23 @@ * @author Patrik Gfeller - Initial Contribution */ @NonNullByDefault -class ServerDiscoveryHelper { - private static final int DISCOVERY_PORT = 7359; - private static final int TIMEOUT_MS = 2000; +class ServerDiscovery { private static final String DISCOVERY_MESSAGE = "who is JellyfinServer?"; - private final Logger logger = LoggerFactory.getLogger(ServerDiscoveryHelper.class); + private final Logger logger = LoggerFactory.getLogger(ServerDiscovery.class); private final List serverList = new CopyOnWriteArrayList<>(); private final ExecutorService executorService = Executors.newCachedThreadPool(); - public List discoverServers() { + private final int port; + private final int timeout; + + ServerDiscovery(int port, int timeout) { + this.port = port; + this.timeout = timeout; + } + + List discoverServers() { serverList.clear(); try { Enumeration interfaces = NetworkInterface.getNetworkInterfaces(); @@ -64,8 +70,7 @@ public List discoverServers() { } } } - // Give some time for responses to come back - Thread.sleep(TIMEOUT_MS + 500); // Wait a bit longer than the timeout + Thread.sleep(this.timeout); } catch (SocketException | InterruptedException e) { logger.error("Error during network interface enumeration or sleep: {}", e.getMessage()); } finally { @@ -77,13 +82,13 @@ public List discoverServers() { private void sendDiscoveryPacket(InetAddress broadcastAddress) { try (DatagramSocket socket = new DatagramSocket()) { socket.setBroadcast(true); - socket.setSoTimeout(TIMEOUT_MS); // Set a timeout for receiving responses + socket.setSoTimeout(this.timeout); // Set a timeout for receiving responses byte[] sendData = DISCOVERY_MESSAGE.getBytes(); - DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, broadcastAddress, DISCOVERY_PORT); + DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, broadcastAddress, this.port); socket.send(sendPacket); - logger.trace("Sent discovery packet to {}:{}", broadcastAddress.getHostAddress(), DISCOVERY_PORT); + logger.trace("Sent discovery packet to {}:{}", broadcastAddress.getHostAddress(), this.port); // Listen for responses byte[] receiveData = new byte[1024]; diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java index 6d12c4cb0bc7d..284dd40432968 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java @@ -18,6 +18,7 @@ import java.util.Set; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.jellyfin.internal.BindingConfiguration; import org.openhab.binding.jellyfin.internal.Constants; import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; import org.openhab.binding.jellyfin.internal.api.generated.ApiException; @@ -27,7 +28,10 @@ import org.openhab.core.config.discovery.DiscoveryService; import org.openhab.core.thing.Thing; import org.openhab.core.thing.ThingUID; +import org.osgi.service.cm.ConfigurationAdmin; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -42,14 +46,19 @@ @Component(service = DiscoveryService.class, immediate = true, configurationPid = "discovery.jellyfin") public class ServerDiscoveryService extends AbstractDiscoveryService { private final Logger logger = LoggerFactory.getLogger(ServerDiscoveryService.class); + private final ConfigurationAdmin configurationService; - public ServerDiscoveryService() throws IllegalArgumentException { + @Activate + public ServerDiscoveryService(final @Reference ConfigurationAdmin configurationService) + throws IllegalArgumentException { super(Set.of(Constants.THING_TYPE_SERVER), 60, false); + this.configurationService = configurationService; } @Override protected synchronized void startScan() { - ServerDiscoveryHelper discoverer = new ServerDiscoveryHelper(); + var configuration = BindingConfiguration.getConfiguration(configurationService); + ServerDiscovery discoverer = new ServerDiscovery(configuration.discoveryPort, configuration.discoveryTimeout); List servers = discoverer.discoverServers(); @@ -74,8 +83,9 @@ private Map getProperties(ServerDiscoveryResult server) { Map properties = new HashMap<>(); try { + var uri = server.getAddress(); var client = new ApiClient(); - client.updateBaseUri(server.getAddress()); + client.updateBaseUri(uri); var systemApi = new SystemApi(client); var systemInformation = systemApi.getPublicSystemInfo(); @@ -83,11 +93,11 @@ private Map getProperties(ServerDiscoveryResult server) { properties.put(Thing.PROPERTY_SERIAL_NUMBER, systemInformation.getId()); properties.put(Thing.PROPERTY_FIRMWARE_VERSION, systemInformation.getVersion()); properties.put(Thing.PROPERTY_VENDOR, "https://jellyfin.org"); + + properties.put(Constants.PROPERTY_SERVER_URI, uri); } catch (ApiException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + logger.warn("Unable to get device properties: {}", e); } - return properties; } } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/JellyfinException.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/BindingException.java similarity index 88% rename from bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/JellyfinException.java rename to bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/BindingException.java index 11b45ce8d36ab..86a96879c1eb1 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/JellyfinException.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/BindingException.java @@ -21,10 +21,10 @@ * @author Patrik Gfeller - Initial Contribution */ @NonNullByDefault -public abstract class JellyfinException extends Exception { +public abstract class BindingException extends Exception { private static final long serialVersionUID = 0L; - public JellyfinException(String message) { + public BindingException(String message) { super(message.startsWith("@text") ? ResourceHelper.getResourceString(message) : message); } } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/ExceptionHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/ExceptionHandler.java new file mode 100644 index 0000000000000..249207d975258 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/ExceptionHandler.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.exceptions; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * Exception handler implementation + * + * @author Patrik Gfeller - Initial contribution + */ +@NonNullByDefault +public class ExceptionHandler implements org.openhab.binding.jellyfin.internal.types.ExceptionHandlerType { + + public ExceptionHandler() { + } + + @Override + public void handle(Exception exception) { + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java index ac7b4e05e72d2..b2d20388b9fad 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java @@ -15,13 +15,17 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.jellyfin.internal.Constants; +import org.openhab.binding.jellyfin.internal.api.ApiClientFactory; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.Thing; import org.openhab.core.thing.ThingTypeUID; import org.openhab.core.thing.binding.BaseThingHandlerFactory; import org.openhab.core.thing.binding.ThingHandler; import org.openhab.core.thing.binding.ThingHandlerFactory; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ServiceScope; /** * The {@link HandlerFactory} is responsible for creating things and thing @@ -32,9 +36,18 @@ * and respective runtime */ @NonNullByDefault -@Component(configurationPid = "binding.jellyfin", service = ThingHandlerFactory.class) +@Component(scope = ServiceScope.SINGLETON, configurationPid = "binding.jellyfin", service = ThingHandlerFactory.class) public class HandlerFactory extends BaseThingHandlerFactory { + private ApiClientFactory apiClientFactory; + + @Activate + public HandlerFactory(@Reference final ApiClientFactory apiClientFactory) { + super(); + + this.apiClientFactory = apiClientFactory; + } + @Override public boolean supportsThingType(ThingTypeUID thingTypeUID) { return Constants.SUPPORTED_THING_TYPES.contains(thingTypeUID); @@ -45,7 +58,12 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { ThingTypeUID thingTypeUID = thing.getThingTypeUID(); if (Constants.THING_TYPE_SERVER.equals(thingTypeUID)) { - return new ServerHandler((Bridge) thing); + var client = this.apiClientFactory.createApiClient(); + var uri = thing.getProperties().get(Constants.PROPERTY_SERVER_URI); + + client.updateBaseUri(uri); + + return new ServerHandler((Bridge) thing, client); } return null; diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index de810f4206cee..71d737d940a31 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -12,12 +12,16 @@ */ package org.openhab.binding.jellyfin.internal.handler; +import java.util.HashMap; import java.util.Map; import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import org.openhab.binding.jellyfin.internal.types.JellyfinExceptionHandler; +import org.openhab.binding.jellyfin.internal.api.ApiClient; +import org.openhab.binding.jellyfin.internal.exceptions.ExceptionHandler; +import org.openhab.binding.jellyfin.internal.handler.tasks.ConnectionTask; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.binding.BaseBridgeHandler; @@ -26,8 +30,8 @@ import org.slf4j.LoggerFactory; /** - * The {@link ServerHandler} is responsible for handling commands, which - * are sent to one of the channels. + * The {@link ServerHandler} is responsible for handling commands, which are + * sent to one of the channels. * * @author Miguel Álvarez - Initial contribution * @author Patrik Gfeller - Adjustments to work independently of the Android SDK @@ -38,6 +42,9 @@ public class ServerHandler extends BaseBridgeHandler { private final Logger logger = LoggerFactory.getLogger(ServerHandler.class); private final ExceptionHandler exceptionHandler; + private final ApiClient apiClient; + + Map> tasks = new HashMap<>(); public static class TASKS { public static final String CONNECT = "Connect"; @@ -50,27 +57,11 @@ public static class TASKS { Map.entry(TASKS.REGISTER, 1), Map.entry(TASKS.POLL, 10)); } - /** - * Exception handler implementation - * - * @author Patrik Gfeller - Initial contribution - */ - private class ExceptionHandler implements JellyfinExceptionHandler { - private final ServerHandler handler; - - private ExceptionHandler(ServerHandler handler) { - this.handler = handler; - } - - @Override - public void handle(Exception exception) { - } - } - - public ServerHandler(Bridge bridge) { + public ServerHandler(Bridge bridge, ApiClient apiClient) { super(bridge); - this.exceptionHandler = new ExceptionHandler(this); + this.exceptionHandler = new ExceptionHandler(); + this.apiClient = apiClient; } @Override @@ -98,10 +89,44 @@ private synchronized Runnable initializeHandler() { }; } - private synchronized void stopTasks() { + private synchronized void startTasks() { + String taskId = getTask(); + + Runnable task = null; + + long delay = TASKS.delays.get(taskId); + long interval = TASKS.intervals.get(taskId); + + this.logger.trace("startTasks - [{}, delay: {}s, interval: {}s]", taskId, delay, interval); + + switch (taskId) { + case TASKS.CONNECT -> { + task = new ConnectionTask(this.apiClient, instance -> this.handleConnection(instance), + this.exceptionHandler); + break; + } + } + + if (task != null) { + logger.info("Starting task [{}]", taskId); + this.tasks.put(taskId, this.executeTask(task, delay, interval)); + } } - private synchronized void startTasks() { + private String getTask() { + return TASKS.CONNECT; + } + + private Object handleConnection(ApiClient instance) { + // TODO Auto-generated method stub + return null; + } + + private synchronized void stopTasks() { + logger.info("Stopping {} task(s): {}", this.tasks.values().size(), String.join(",", this.tasks.keySet())); + + this.tasks.values().forEach(task -> this.stopTask(task)); + this.tasks.clear(); } private synchronized void stopTask(@Nullable ScheduledFuture task) { @@ -111,4 +136,12 @@ private synchronized void stopTask(@Nullable ScheduledFuture task) { task.cancel(true); } + + private @Nullable ScheduledFuture executeTask(Runnable task, long initialDelay, long interval) { + return scheduler.scheduleWithFixedDelay(task, initialDelay, interval, TimeUnit.SECONDS); + } + + String getAccessToken() { + return "123"; + } } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ConnectionTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ConnectionTask.java new file mode 100644 index 0000000000000..42dfb7fef79de --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ConnectionTask.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.handler.tasks; + +import java.util.function.Consumer; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.jellyfin.internal.api.ApiClient; +import org.openhab.binding.jellyfin.internal.types.ExceptionHandlerType; + +/** + * @author Patrik Gfeller - Initial contribution + */ +@NonNullByDefault +public class ConnectionTask implements Runnable { + + private final Consumer acceptedHandler; + private final ExceptionHandlerType exceptionHandler; + private final ApiClient client; + + public ConnectionTask(ApiClient client, Consumer connectionHandler, + ExceptionHandlerType exceptionHandler) { + + this.acceptedHandler = connectionHandler; + this.exceptionHandler = exceptionHandler; + + this.client = client; + } + + @Override + public void run() { + try { + this.acceptedHandler.accept(client); + } catch (Exception e) { + this.exceptionHandler.handle(e); + } + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/types/JellyfinExceptionHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/types/ExceptionHandlerType.java similarity index 93% rename from bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/types/JellyfinExceptionHandler.java rename to bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/types/ExceptionHandlerType.java index 861e7eeb251fb..affc41a2c1765 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/types/JellyfinExceptionHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/types/ExceptionHandlerType.java @@ -20,6 +20,6 @@ * @author Patrik Gfeller - Initial contribution */ @NonNullByDefault -public interface JellyfinExceptionHandler { +public interface ExceptionHandlerType { void handle(Exception exception); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/addon/addon.xml b/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/addon/addon.xml index bfbe14d499283..e46f12faa4c40 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/addon/addon.xml +++ b/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/addon/addon.xml @@ -8,4 +8,26 @@ This is the binding for Jellyfin the free software media system. local + + + + Finetune Jellyfin-Server discovery parameters. + + + + + true + Port used to query servers on local network(s) + 7359 + + + + true + Maximum amount of time to wait for a response + 2000 + + + + diff --git a/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/i18n/jellyfin.properties b/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/i18n/jellyfin.properties index 2c7e447d6a8c2..e73210af728a0 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/i18n/jellyfin.properties +++ b/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/i18n/jellyfin.properties @@ -3,6 +3,15 @@ addon.jellyfin.name = Jellyfin Binding addon.jellyfin.description = This is the binding for Jellyfin the free software media system. +# add-on config + +addon.config.jellyfin.discoveryPort.label = Port +addon.config.jellyfin.discoveryPort.description = Port used to query servers on local network(s) +addon.config.jellyfin.discoveryTimeout.label = Timeout +addon.config.jellyfin.discoveryTimeout.description = Maximum amount of time to wait for a response +addon.config.jellyfin.group.discovery.label = Discovery +addon.config.jellyfin.group.discovery.description = Finetune Jellyfin-Server discovery parameters. + # thing types thing-type.jellyfin.client.label = Jellyfin Client diff --git a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/generate.sh b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/generate.sh index 15e508df368d2..5dbe7f5fa6ab3 100755 --- a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/generate.sh +++ b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/generate.sh @@ -56,7 +56,6 @@ echo -e "ℹ️ - Latest stable Jellyfin API - Version: \033[1m${LATEST}\033[0m VERSIONS=("10.10.7") VERSION_ALIAS=("current") - DOCKER_VOLUME_WORK="/work" ROOT=$(pwd) @@ -65,13 +64,13 @@ OPENAPI_JAVA_CONFIG="tools/generate-sources/scripts/java.config.json" OPENAPI_SPECIFICATION_DIR="tools/generate-sources/scripts/specifications" FILENAME_ENDPOINTS=logs/endpoints/${i}.txt -if ! npx list openapi-filter &>/dev/null; then - echo "ℹ️ - Installing openapi-filter@3.2.3" - npm install --save-dev --no-audit --no-fund openapi-filter@3.2.3 1>/dev/null || { - echo "❌ Error: Failed to install openapi-filter" - exit 1 - } -fi +# if ! npx list openapi-filter &>/dev/null; then +# echo "ℹ️ - Installing openapi-filter@3.2.3" +# npm install --save-dev --no-audit --no-fund openapi-filter@3.2.3 1>/dev/null || { +# echo "❌ Error: Failed to install openapi-filter" +# exit 1 +# } +# fi OUTPUT=. From ddd001466c96e4612abd0f4bac26ef87aef33d01 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Thu, 14 Aug 2025 16:32:21 +0200 Subject: [PATCH 03/38] Revert to java native libraries ... Signed-off-by: Patrik Gfeller --- .../org.openhab.binding.jellyfin/.gitignore | 4 +- .../internal/handler/ServerHandler.java | 58 +++++++++++++++---- .../generate-sources/scripts/generate.sh | 26 ++++----- 3 files changed, 60 insertions(+), 28 deletions(-) diff --git a/bundles/org.openhab.binding.jellyfin/.gitignore b/bundles/org.openhab.binding.jellyfin/.gitignore index 29ef8b4a102fc..069b15e576481 100644 --- a/bundles/org.openhab.binding.jellyfin/.gitignore +++ b/bundles/org.openhab.binding.jellyfin/.gitignore @@ -1,4 +1,6 @@ node_modules package-lock.json package.json -logs \ No newline at end of file +logs +/.apt_generated/ +/.apt_generated_tests/ diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index 71d737d940a31..efa216c606b91 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -19,11 +19,15 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.jellyfin.internal.Configuration; import org.openhab.binding.jellyfin.internal.api.ApiClient; import org.openhab.binding.jellyfin.internal.exceptions.ExceptionHandler; import org.openhab.binding.jellyfin.internal.handler.tasks.ConnectionTask; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.ChannelUID; +import org.openhab.core.thing.ThingStatus; +import org.openhab.core.thing.ThingStatusDetail; +import org.openhab.core.thing.ThingStatusInfo; import org.openhab.core.thing.binding.BaseBridgeHandler; import org.openhab.core.types.Command; import org.slf4j.Logger; @@ -84,14 +88,28 @@ public void dispose() { private synchronized Runnable initializeHandler() { return () -> { - this.stopTasks(); - this.startTasks(); + try { + if (this.configurationExists()) { + this.stopTasks(); + this.startTasks(); + } else { + logger.warn("Jellyfin configuration is missing or incomplete. Please check your settings."); + + var description = ""; + ThingStatusInfo statusInfo = new ThingStatusInfo(ThingStatus.OFFLINE, + ThingStatusDetail.CONFIGURATION_PENDING, description); + this.getThing().setStatusInfo(statusInfo); + } + } catch (Exception e) { + this.logger.warn("Error during initialization: {}", e.getMessage(), e); + + this.exceptionHandler.handle(e); + } }; } private synchronized void startTasks() { - String taskId = getTask(); - + String taskId = TASKS.CONNECT; Runnable task = null; long delay = TASKS.delays.get(taskId); @@ -113,12 +131,34 @@ private synchronized void startTasks() { } } - private String getTask() { - return TASKS.CONNECT; + private boolean configurationExists() { + var configuration = this.getConfigAs(Configuration.class); + + return (configuration.token.trim() != ""); } private Object handleConnection(ApiClient instance) { - // TODO Auto-generated method stub + try { + // Get public system information from the Jellyfin server + var systemApi = new org.openhab.binding.jellyfin.internal.api.generated.current.SystemApi(instance); + var publicSystemInfo = systemApi.getPublicSystemInfo(); + + // Log all available server information at INFO level + logger.info("Jellyfin Server Information:"); + logger.info(" Server Name: {}", publicSystemInfo.getServerName()); + logger.info(" Local Address: {}", publicSystemInfo.getLocalAddress()); + logger.info(" Version: {}", publicSystemInfo.getVersion()); + logger.info(" Product Name: {}", publicSystemInfo.getProductName()); + // Note: getOperatingSystem() is deprecated but still available for logging + @SuppressWarnings("deprecation") + String operatingSystem = publicSystemInfo.getOperatingSystem(); + logger.info(" Operating System: {}", operatingSystem); + logger.info(" Server ID: {}", publicSystemInfo.getId()); + logger.info(" Startup Wizard Completed: {}", publicSystemInfo.getStartupWizardCompleted()); + + } catch (Exception e) { + logger.warn("Failed to retrieve public system information: {}", e.getMessage(), e); + } return null; } @@ -140,8 +180,4 @@ private synchronized void stopTask(@Nullable ScheduledFuture task) { private @Nullable ScheduledFuture executeTask(Runnable task, long initialDelay, long interval) { return scheduler.scheduleWithFixedDelay(task, initialDelay, interval, TimeUnit.SECONDS); } - - String getAccessToken() { - return "123"; - } } diff --git a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/generate.sh b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/generate.sh index 5dbe7f5fa6ab3..f353e9d431404 100755 --- a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/generate.sh +++ b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/generate.sh @@ -32,6 +32,8 @@ function checkEnvironment() { checkEnvironment +OPENAPI_JAVA_CONFIG="tools/generate-sources/scripts/java.config.json" + # Get the latest stable release tag from GitHub for openapi-generator LATEST_OPENAPI_GENERATOR_CLI_TAG=$(curl -s "https://api.github.com/repos/OpenAPITools/openapi-generator/releases/latest" | jq -r '.tag_name' | @@ -51,6 +53,8 @@ fi LATEST=$(curl -sL https://repo.jellyfin.org/releases/openapi/jellyfin-openapi-stable.json | jq -r .info.version) echo -e "ℹ️ - Latest stable Jellyfin API - Version: \033[1m${LATEST}\033[0m" + + # VERSIONS=("10.8.13" "10.10.7") # VERSION_ALIAS=("legacy" "current") VERSIONS=("10.10.7") @@ -60,34 +64,24 @@ DOCKER_VOLUME_WORK="/work" ROOT=$(pwd) -OPENAPI_JAVA_CONFIG="tools/generate-sources/scripts/java.config.json" OPENAPI_SPECIFICATION_DIR="tools/generate-sources/scripts/specifications" -FILENAME_ENDPOINTS=logs/endpoints/${i}.txt - -# if ! npx list openapi-filter &>/dev/null; then -# echo "ℹ️ - Installing openapi-filter@3.2.3" -# npm install --save-dev --no-audit --no-fund openapi-filter@3.2.3 1>/dev/null || { -# echo "❌ Error: Failed to install openapi-filter" -# exit 1 -# } -# fi OUTPUT=. INDEX=0 for i in "${VERSIONS[@]}"; do ALIAS=${VERSION_ALIAS[INDEX++]} - PACKAGE=org.openhab.binding.jellyfin.internal.api.generated.${ALIAS} - PACKAGE_API=$PACKAGE - PACKAGE_MODEL=$PACKAGE.model + PACKAGE_BASE=org.openhab.binding.jellyfin.internal.api.generated.${ALIAS} + PACKAGE_API=${PACKAGE_BASE} + PACKAGE_MODEL=${PACKAGE_BASE}.model - echo -e " ➡️ generating API Version $i as \033[1m${ALIAS}\033[0m: ${PACKAGE_API}" + echo -e " ➡️ generating Jersey API Version $i as \033[1m${ALIAS}\033[0m: ${PACKAGE_API}" FILENAME_JSON=${ROOT}/${OPENAPI_SPECIFICATION_DIR}/json/jellyfin-openapi-${i}.json FILENAME_YAML=${ROOT}/${OPENAPI_SPECIFICATION_DIR}/yaml/jellyfin-openapi-${i}.yaml mkdir -p logs/endpoints - jq ".paths | to_entries[] | {path: .key, methods: (.value | keys)}" ${FILENAME_JSON} | grep \"path\" >logs/endpoints/${i}.txt + jq ".paths | to_entries[] | {path: .key, methods: (.value | keys)}" ${FILENAME_JSON} | grep \"path\" >logs/endpoints/${i}-jersey.txt if [ ! -e "${FILENAME_JSON}" ]; then echo " ⏬ - Downloading OPENAPI definition for Version ${i}" @@ -130,4 +124,4 @@ cd ${ROOT} MVN_OPT="--quiet" echo "" echo "🧹 apply formatting to generated code" -mvn spotless:apply $MVN_OPT +mvn spotless:apply $MVN_OPT \ No newline at end of file From fca6d1a5b0610be1e911a868e84fb0eda217040f Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Fri, 22 Aug 2025 22:48:23 +0200 Subject: [PATCH 04/38] =?UTF-8?q?=E2=9C=A8=20feat(jellyfin):=20implement?= =?UTF-8?q?=20token-based=20authentication?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit: 📦 Adds Jackson dependencies for JSON processing --- bundles/org.openhab.binding.jellyfin/pom.xml | 46 +++++++++++++++++++ .../jellyfin/internal/api/ApiClient.java | 11 +++++ .../internal/exceptions/ExceptionHandler.java | 1 + .../internal/handler/HandlerFactory.java | 2 + .../internal/handler/ServerHandler.java | 37 +++++++++------ .../handler/tasks/ConnectionTask.java | 10 ++-- 6 files changed, 90 insertions(+), 17 deletions(-) diff --git a/bundles/org.openhab.binding.jellyfin/pom.xml b/bundles/org.openhab.binding.jellyfin/pom.xml index d8d328f28ac4b..ec5b8eb6eb1f3 100644 --- a/bundles/org.openhab.binding.jellyfin/pom.xml +++ b/bundles/org.openhab.binding.jellyfin/pom.xml @@ -15,6 +15,52 @@ UTF-8 UTF-8 + 2.19.0 + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson.version} + + + + + + + org.apache.felix + maven-bundle-plugin + + + jackson-annotations, + jackson-core, + jackson-databind, + jackson-datatype-jsr310 + false + !com.fasterxml.jackson.*, + * + !com.fasterxml.jackson.*, + org.openhab.binding.jellyfin.* + + + + + + diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClient.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClient.java index 48d1f39483067..5203b9984cbe8 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClient.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClient.java @@ -17,4 +17,15 @@ @NonNullByDefault public class ApiClient extends org.openhab.binding.jellyfin.internal.api.generated.ApiClient { + /** + * Sets the API token for authenticating with the Jellyfin server. + * This will add an Authorization header to all outgoing requests. + * + * @param token The API token to use for authentication. + */ + public void authenticateWithToken(String token) { + setRequestInterceptor(builder -> { + builder.header("Authorization", "MediaBrowser Token=" + token); + }); + } } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/ExceptionHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/ExceptionHandler.java index 249207d975258..58f78dad86d6f 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/ExceptionHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/ExceptionHandler.java @@ -27,5 +27,6 @@ public ExceptionHandler() { @Override public void handle(Exception exception) { + exception.printStackTrace(); } } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java index b2d20388b9fad..6df6e49803850 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java @@ -14,6 +14,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.jellyfin.internal.Configuration; import org.openhab.binding.jellyfin.internal.Constants; import org.openhab.binding.jellyfin.internal.api.ApiClientFactory; import org.openhab.core.thing.Bridge; @@ -59,6 +60,7 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { if (Constants.THING_TYPE_SERVER.equals(thingTypeUID)) { var client = this.apiClientFactory.createApiClient(); + var config = thing.getConfiguration().as(Configuration.class); var uri = thing.getProperties().get(Constants.PROPERTY_SERVER_URI); client.updateBaseUri(uri); diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index efa216c606b91..8dc12b9db7e51 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -21,6 +21,7 @@ import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.jellyfin.internal.Configuration; import org.openhab.binding.jellyfin.internal.api.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SystemInfo; import org.openhab.binding.jellyfin.internal.exceptions.ExceptionHandler; import org.openhab.binding.jellyfin.internal.handler.tasks.ConnectionTask; import org.openhab.core.thing.Bridge; @@ -90,6 +91,7 @@ private synchronized Runnable initializeHandler() { return () -> { try { if (this.configurationExists()) { + this.stopTasks(); this.startTasks(); } else { @@ -109,6 +111,8 @@ private synchronized Runnable initializeHandler() { } private synchronized void startTasks() { + var currentStatus = this.getThing().getStatus(); + String taskId = TASKS.CONNECT; Runnable task = null; @@ -117,9 +121,12 @@ private synchronized void startTasks() { this.logger.trace("startTasks - [{}, delay: {}s, interval: {}s]", taskId, delay, interval); + Configuration config = this.getConfigAs(Configuration.class); + this.apiClient.authenticateWithToken(config.token); + switch (taskId) { case TASKS.CONNECT -> { - task = new ConnectionTask(this.apiClient, instance -> this.handleConnection(instance), + task = new ConnectionTask(this.apiClient, systemInfo -> this.handleConnection(systemInfo), this.exceptionHandler); break; } @@ -137,27 +144,29 @@ private boolean configurationExists() { return (configuration.token.trim() != ""); } - private Object handleConnection(ApiClient instance) { + private Object handleConnection(SystemInfo systemInfo) { try { - // Get public system information from the Jellyfin server - var systemApi = new org.openhab.binding.jellyfin.internal.api.generated.current.SystemApi(instance); - var publicSystemInfo = systemApi.getPublicSystemInfo(); - // Log all available server information at INFO level logger.info("Jellyfin Server Information:"); - logger.info(" Server Name: {}", publicSystemInfo.getServerName()); - logger.info(" Local Address: {}", publicSystemInfo.getLocalAddress()); - logger.info(" Version: {}", publicSystemInfo.getVersion()); - logger.info(" Product Name: {}", publicSystemInfo.getProductName()); + logger.info(" Server Name: {}", systemInfo.getServerName()); + logger.info(" Local Address: {}", systemInfo.getLocalAddress()); + logger.info(" Version: {}", systemInfo.getVersion()); + logger.info(" Product Name: {}", systemInfo.getProductName()); // Note: getOperatingSystem() is deprecated but still available for logging @SuppressWarnings("deprecation") - String operatingSystem = publicSystemInfo.getOperatingSystem(); + String operatingSystem = systemInfo.getOperatingSystem(); logger.info(" Operating System: {}", operatingSystem); - logger.info(" Server ID: {}", publicSystemInfo.getId()); - logger.info(" Startup Wizard Completed: {}", publicSystemInfo.getStartupWizardCompleted()); + logger.info(" Server ID: {}", systemInfo.getId()); + logger.info(" Startup Wizard Completed: {}", systemInfo.getStartupWizardCompleted()); + logger.info(" Web Socket Port: {}", systemInfo.getWebSocketPortNumber()); + + ThingStatusInfo statusInfo = new ThingStatusInfo(ThingStatus.ONLINE, ThingStatusDetail.NONE, ""); + this.getThing().setStatusInfo(statusInfo); + + this.stopTasks(); } catch (Exception e) { - logger.warn("Failed to retrieve public system information: {}", e.getMessage(), e); + logger.warn("Failed to process system information: {}", e.getMessage(), e); } return null; } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ConnectionTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ConnectionTask.java index 42dfb7fef79de..2ec13063b4930 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ConnectionTask.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ConnectionTask.java @@ -16,6 +16,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.jellyfin.internal.api.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SystemInfo; import org.openhab.binding.jellyfin.internal.types.ExceptionHandlerType; /** @@ -24,11 +25,11 @@ @NonNullByDefault public class ConnectionTask implements Runnable { - private final Consumer acceptedHandler; + private final Consumer acceptedHandler; private final ExceptionHandlerType exceptionHandler; private final ApiClient client; - public ConnectionTask(ApiClient client, Consumer connectionHandler, + public ConnectionTask(ApiClient client, Consumer connectionHandler, ExceptionHandlerType exceptionHandler) { this.acceptedHandler = connectionHandler; @@ -40,7 +41,10 @@ public ConnectionTask(ApiClient client, Consumer connectionHandler, @Override public void run() { try { - this.acceptedHandler.accept(client); + var systemApi = new org.openhab.binding.jellyfin.internal.api.generated.current.SystemApi(client); + var systemInfo = systemApi.getSystemInfo(); + + this.acceptedHandler.accept(systemInfo); } catch (Exception e) { this.exceptionHandler.handle(e); } From 99f7cc5bc7f74c64e8ca92eb2e107b9585ef7c31 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sun, 31 Aug 2025 21:46:03 +0200 Subject: [PATCH 05/38] =?UTF-8?q?=E2=9C=A8=20feat(jellyfin):=20improve=20s?= =?UTF-8?q?erver=20discovery=20and=20configuration=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 🔨 refactor(constants): create ServerProperties class for better organization - ✅ feat(configuration): add helper methods to check configuration and token existence - 🌐 feat(discovery): implement proper URI handling for discovered servers - 🧰 feat(handler): enhance ServerHandler to handle both manual and discovered servers - 🧹 chore(api): remove unused dependencies in ApiClientFactory --- .../jellyfin/internal/Configuration.java | 17 +++++++ .../binding/jellyfin/internal/Constants.java | 8 +-- .../internal/api/ApiClientFactory.java | 7 +-- .../discovery/ServerDiscoveryService.java | 2 +- .../internal/handler/HandlerFactory.java | 6 --- .../internal/handler/ServerHandler.java | 51 ++++++++++++------- 6 files changed, 56 insertions(+), 35 deletions(-) diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Configuration.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Configuration.java index b8a2b32cdaa29..ffc85605cb569 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Configuration.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Configuration.java @@ -13,6 +13,7 @@ package org.openhab.binding.jellyfin.internal; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.thing.Thing; /** * The {@link Configuration} class contains fields mapping thing configuration parameters. @@ -54,4 +55,20 @@ public class Configuration { * User ID */ public String userId = ""; + + /** + * Checks if a configuration exists for the given thing. + * + * @param thing the thing to check the configuration for + * @return true if the configuration is complete, false otherwise + */ + public static boolean configurationExists(Thing thing) { + Configuration config = thing.getConfiguration().as(Configuration.class); + return config != null && !config.hostname.isEmpty(); + } + + public static boolean tokenExists(Thing thing) { + Configuration config = thing.getConfiguration().as(Configuration.class); + return config != null && !config.token.isEmpty(); + } } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Constants.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Constants.java index b317ca673aec5..bcb7faecc95a5 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Constants.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Constants.java @@ -30,9 +30,11 @@ public class Constants { static final String BINDING_ID = "jellyfin"; static final String BINDING_PID = "binding.jellyfin"; - // Property names - public static final String PROPERTY_API_VERSION = "apiVersion"; - public static final String PROPERTY_SERVER_URI = "uri"; + public static class ServerProperties { + public static final String API_VERSION = "apiVersion"; + public static final String SERVER_URI = "uri"; + public static final String SERVER_VERSION = "Server Version"; + } // List of all Thing Type UIDs public static final ThingTypeUID THING_TYPE_SERVER = new ThingTypeUID(BINDING_ID, "server"); diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClientFactory.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClientFactory.java index bac8934af4531..da758df7c10e8 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClientFactory.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClientFactory.java @@ -13,10 +13,8 @@ package org.openhab.binding.jellyfin.internal.api; import org.eclipse.jdt.annotation.NonNullByDefault; -import org.openhab.core.io.net.http.HttpClientFactory; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; -import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.ServiceScope; /** @@ -27,11 +25,8 @@ @NonNullByDefault @Component(scope = ServiceScope.SINGLETON, configurationPid = "api.jellyfin", service = ApiClientFactory.class) public class ApiClientFactory { - private final HttpClientFactory httpClientFactory; - @Activate - public ApiClientFactory(@Reference final HttpClientFactory httpClientFactory) { - this.httpClientFactory = httpClientFactory; + public ApiClientFactory() { } /** diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java index 284dd40432968..a0de9045225c0 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java @@ -94,7 +94,7 @@ private Map getProperties(ServerDiscoveryResult server) { properties.put(Thing.PROPERTY_FIRMWARE_VERSION, systemInformation.getVersion()); properties.put(Thing.PROPERTY_VENDOR, "https://jellyfin.org"); - properties.put(Constants.PROPERTY_SERVER_URI, uri); + properties.put(Constants.ServerProperties.SERVER_URI, uri); } catch (ApiException e) { logger.warn("Unable to get device properties: {}", e); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java index 6df6e49803850..73014b5beccee 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java @@ -14,7 +14,6 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import org.openhab.binding.jellyfin.internal.Configuration; import org.openhab.binding.jellyfin.internal.Constants; import org.openhab.binding.jellyfin.internal.api.ApiClientFactory; import org.openhab.core.thing.Bridge; @@ -60,11 +59,6 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { if (Constants.THING_TYPE_SERVER.equals(thingTypeUID)) { var client = this.apiClientFactory.createApiClient(); - var config = thing.getConfiguration().as(Configuration.class); - var uri = thing.getProperties().get(Constants.PROPERTY_SERVER_URI); - - client.updateBaseUri(uri); - return new ServerHandler((Bridge) thing, client); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index 8dc12b9db7e51..a99479c4dda3b 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.handler; +import java.net.URI; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ScheduledFuture; @@ -20,6 +21,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.jellyfin.internal.Configuration; +import org.openhab.binding.jellyfin.internal.Constants; import org.openhab.binding.jellyfin.internal.api.ApiClient; import org.openhab.binding.jellyfin.internal.api.generated.current.model.SystemInfo; import org.openhab.binding.jellyfin.internal.exceptions.ExceptionHandler; @@ -48,10 +50,11 @@ public class ServerHandler extends BaseBridgeHandler { private final Logger logger = LoggerFactory.getLogger(ServerHandler.class); private final ExceptionHandler exceptionHandler; private final ApiClient apiClient; + private final Configuration configuration; Map> tasks = new HashMap<>(); - public static class TASKS { + private static class TASKS { public static final String CONNECT = "Connect"; public static final String REGISTER = "Registration"; public static final String POLL = "Update"; @@ -66,6 +69,7 @@ public ServerHandler(Bridge bridge, ApiClient apiClient) { super(bridge); this.exceptionHandler = new ExceptionHandler(); + this.configuration = this.getConfigAs(Configuration.class); this.apiClient = apiClient; } @@ -90,29 +94,41 @@ public void dispose() { private synchronized Runnable initializeHandler() { return () -> { try { - if (this.configurationExists()) { + if (Configuration.configurationExists(this.getThing())) { + var uriObject = new URI(this.configuration.ssl ? "https" : "http", null, // userInfo + this.configuration.hostname, this.configuration.port, this.configuration.path, null, // query + null // fragment + ); - this.stopTasks(); - this.startTasks(); + var uriString = uriObject.toString(); + + this.apiClient.updateBaseUri(uriString); } else { - logger.warn("Jellyfin configuration is missing or incomplete. Please check your settings."); + var uriString = thing.getProperties().get(Constants.ServerProperties.SERVER_URI); + var uriObject = new URI(uriString); + + this.configuration.hostname = uriObject.getHost(); + this.configuration.port = uriObject.getPort(); + this.configuration.ssl = "https".equalsIgnoreCase(uriObject.getScheme()); + this.configuration.path = uriObject.getPath(); + + this.apiClient.updateBaseUri(uriString); - var description = ""; - ThingStatusInfo statusInfo = new ThingStatusInfo(ThingStatus.OFFLINE, - ThingStatusDetail.CONFIGURATION_PENDING, description); - this.getThing().setStatusInfo(statusInfo); + thing.getProperties().remove(Constants.ServerProperties.SERVER_URI); + + logger.info("Creating initial configuration for discovered server at {}:{}", + this.configuration.hostname, this.configuration.port); } + this.stopTasks(); + this.startTasks(); } catch (Exception e) { - this.logger.warn("Error during initialization: {}", e.getMessage(), e); - + this.logger.error("Error during initialization: {}", e.getMessage(), e); this.exceptionHandler.handle(e); } }; } private synchronized void startTasks() { - var currentStatus = this.getThing().getStatus(); - String taskId = TASKS.CONNECT; Runnable task = null; @@ -138,12 +154,6 @@ private synchronized void startTasks() { } } - private boolean configurationExists() { - var configuration = this.getConfigAs(Configuration.class); - - return (configuration.token.trim() != ""); - } - private Object handleConnection(SystemInfo systemInfo) { try { // Log all available server information at INFO level @@ -151,6 +161,9 @@ private Object handleConnection(SystemInfo systemInfo) { logger.info(" Server Name: {}", systemInfo.getServerName()); logger.info(" Local Address: {}", systemInfo.getLocalAddress()); logger.info(" Version: {}", systemInfo.getVersion()); + + this.thing.getProperties().put(Constants.ServerProperties.SERVER_VERSION, systemInfo.getVersion()); + logger.info(" Product Name: {}", systemInfo.getProductName()); // Note: getOperatingSystem() is deprecated but still available for logging @SuppressWarnings("deprecation") From 176da1d3b2ab82c8f283d99de1c6067c29a582f8 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Mon, 15 Sep 2025 23:56:23 +0200 Subject: [PATCH 06/38] =?UTF-8?q?=F0=9F=94=A7=20chore:=20add=20temporary?= =?UTF-8?q?=20files=20to=20.gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add IDE configs to gitignore during WIP. These entries will be removed once the code work is completed. - IDE configuration (.vscode) Signed-off-by: Patrik Gfeller --- bundles/org.openhab.binding.jellyfin/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bundles/org.openhab.binding.jellyfin/.gitignore b/bundles/org.openhab.binding.jellyfin/.gitignore index 069b15e576481..b4e6dd92a5fbd 100644 --- a/bundles/org.openhab.binding.jellyfin/.gitignore +++ b/bundles/org.openhab.binding.jellyfin/.gitignore @@ -4,3 +4,5 @@ package.json logs /.apt_generated/ /.apt_generated_tests/ +# Temporary (wip) +.vscode From dc69954df89207c0f3dcd7c2293fb28ef80bd9f3 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Tue, 16 Sep 2025 00:02:17 +0200 Subject: [PATCH 07/38] =?UTF-8?q?=F0=9F=94=A7=20chore(jellyfin):=20reforma?= =?UTF-8?q?t=20pom.xml=20structure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Break long XML elements into multiple lines for better readability. Signed-off-by: Patrik Gfeller --- bundles/org.openhab.binding.jellyfin/pom.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.jellyfin/pom.xml b/bundles/org.openhab.binding.jellyfin/pom.xml index ec5b8eb6eb1f3..af02d457c0b5a 100644 --- a/bundles/org.openhab.binding.jellyfin/pom.xml +++ b/bundles/org.openhab.binding.jellyfin/pom.xml @@ -1,4 +1,6 @@ - + + 4.0.0 From b0a100c18a31b0222f67f6d50d44c35e7b456864 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Wed, 17 Sep 2025 04:24:09 +0200 Subject: [PATCH 08/38] =?UTF-8?q?=E2=9A=A1=20feat(jellyfin):=20add=20legac?= =?UTF-8?q?y=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Regenerate API models to support Jellyfin servers < 10.9. Add s legacy model package for backward compatibility. - Generated using OpenAPI Generator v7.15 - Support for older server versions alongside current API - Maintains compatibility while enabling newer features Signed-off-by: Patrik Gfeller --- .../internal/api/generated/ApiClient.java | 8 +- .../jellyfin/internal/api/generated/Pair.java | 32 +- .../api/generated/RFC3339JavaTimeModule.java | 6 + .../api/generated/current/ActivityLogApi.java | 132 +- .../api/generated/current/ApiKeyApi.java | 186 +- .../api/generated/current/ArtistsApi.java | 522 +- .../api/generated/current/AudioApi.java | 1173 +- .../api/generated/current/BrandingApi.java | 189 +- .../api/generated/current/ChannelsApi.java | 370 +- .../api/generated/current/ClientLogApi.java | 120 +- .../api/generated/current/CollectionApi.java | 200 +- .../generated/current/ConfigurationApi.java | 268 +- .../api/generated/current/DashboardApi.java | 164 +- .../api/generated/current/DevicesApi.java | 281 +- .../current/DisplayPreferencesApi.java | 171 +- .../api/generated/current/DynamicHlsApi.java | 2844 +++- .../api/generated/current/EnvironmentApi.java | 339 +- .../api/generated/current/FilterApi.java | 209 +- .../api/generated/current/GenresApi.java | 245 +- .../api/generated/current/HlsSegmentApi.java | 306 +- .../api/generated/current/ImageApi.java | 3248 ++++- .../api/generated/current/InstantMixApi.java | 670 +- .../api/generated/current/ItemLookupApi.java | 598 +- .../api/generated/current/ItemRefreshApi.java | 136 +- .../api/generated/current/ItemUpdateApi.java | 193 +- .../api/generated/current/ItemsApi.java | 933 +- .../api/generated/current/LibraryApi.java | 1324 +- .../current/LibraryStructureApi.java | 399 +- .../api/generated/current/LiveTvApi.java | 2275 +++- .../generated/current/LocalizationApi.java | 232 +- .../api/generated/current/LyricsApi.java | 336 +- .../api/generated/current/MediaInfoApi.java | 410 +- .../generated/current/MediaSegmentsApi.java | 126 +- .../api/generated/current/MoviesApi.java | 134 +- .../api/generated/current/MusicGenresApi.java | 249 +- .../api/generated/current/PackageApi.java | 306 +- .../api/generated/current/PersonsApi.java | 214 +- .../api/generated/current/PlaylistsApi.java | 594 +- .../api/generated/current/PlaystateApi.java | 503 +- .../api/generated/current/PluginsApi.java | 415 +- .../generated/current/QuickConnectApi.java | 243 +- .../api/generated/current/RemoteImageApi.java | 222 +- .../generated/current/ScheduledTasksApi.java | 270 +- .../api/generated/current/SearchApi.java | 190 +- .../api/generated/current/SessionApi.java | 745 +- .../api/generated/current/StartupApi.java | 327 +- .../api/generated/current/StudiosApi.java | 241 +- .../api/generated/current/SubtitleApi.java | 592 +- .../api/generated/current/SuggestionsApi.java | 138 +- .../api/generated/current/SyncPlayApi.java | 805 +- .../api/generated/current/SystemApi.java | 449 +- .../api/generated/current/TimeSyncApi.java | 112 +- .../api/generated/current/TmdbApi.java | 113 +- .../api/generated/current/TrailersApi.java | 522 +- .../api/generated/current/TrickplayApi.java | 177 +- .../api/generated/current/TvShowsApi.java | 457 +- .../generated/current/UniversalAudioApi.java | 318 +- .../api/generated/current/UserApi.java | 661 +- .../api/generated/current/UserLibraryApi.java | 573 +- .../api/generated/current/UserViewsApi.java | 178 +- .../current/VideoAttachmentsApi.java | 123 +- .../api/generated/current/VideosApi.java | 2189 +++- .../api/generated/current/YearsApi.java | 227 +- .../generated/current/model/GroupUpdate.java | 4 - .../model/InboundWebSocketMessage.java | 7 - .../model/OutboundWebSocketMessage.java | 28 - .../current/model/ProblemDetails.java | 7 +- .../api/generated/legacy/ActivityLogApi.java | 305 + .../api/generated/legacy/ApiKeyApi.java | 458 + .../api/generated/legacy/ArtistsApi.java | 1331 ++ .../api/generated/legacy/AudioApi.java | 2972 +++++ .../api/generated/legacy/BrandingApi.java | 438 + .../api/generated/legacy/ChannelsApi.java | 933 ++ .../api/generated/legacy/ClientLogApi.java | 256 + .../api/generated/legacy/CollectionApi.java | 545 + .../generated/legacy/ConfigurationApi.java | 787 ++ .../api/generated/legacy/DashboardApi.java | 392 + .../api/generated/legacy/DevicesApi.java | 777 ++ .../legacy/DisplayPreferencesApi.java | 467 + .../api/generated/legacy/DlnaApi.java | 768 ++ .../api/generated/legacy/DlnaServerApi.java | 1876 +++ .../api/generated/legacy/DynamicHlsApi.java | 6769 ++++++++++ .../api/generated/legacy/EnvironmentApi.java | 844 ++ .../api/generated/legacy/FilterApi.java | 522 + .../api/generated/legacy/GenresApi.java | 619 + .../api/generated/legacy/HlsSegmentApi.java | 789 ++ .../api/generated/legacy/ImageApi.java | 10719 ++++++++++++++++ .../api/generated/legacy/ImageByNameApi.java | 793 ++ .../api/generated/legacy/InstantMixApi.java | 1766 +++ .../api/generated/legacy/ItemLookupApi.java | 1542 +++ .../api/generated/legacy/ItemRefreshApi.java | 313 + .../api/generated/legacy/ItemUpdateApi.java | 497 + .../api/generated/legacy/ItemsApi.java | 2847 ++++ .../api/generated/legacy/LibraryApi.java | 3464 +++++ .../generated/legacy/LibraryStructureApi.java | 1130 ++ .../api/generated/legacy/LiveTvApi.java | 5938 +++++++++ .../api/generated/legacy/LocalizationApi.java | 541 + .../api/generated/legacy/MediaInfoApi.java | 1080 ++ .../api/generated/legacy/MoviesApi.java | 316 + .../api/generated/legacy/MusicGenresApi.java | 628 + .../generated/legacy/NotificationsApi.java | 877 ++ .../api/generated/legacy/PackageApi.java | 820 ++ .../api/generated/legacy/PersonsApi.java | 544 + .../api/generated/legacy/PlaylistsApi.java | 918 ++ .../api/generated/legacy/PlaystateApi.java | 1467 +++ .../api/generated/legacy/PluginsApi.java | 1118 ++ .../api/generated/legacy/QuickConnectApi.java | 593 + .../api/generated/legacy/RemoteImageApi.java | 571 + .../generated/legacy/ScheduledTasksApi.java | 704 + .../api/generated/legacy/SearchApi.java | 464 + .../api/generated/legacy/SessionApi.java | 2199 ++++ .../api/generated/legacy/StartupApi.java | 847 ++ .../api/generated/legacy/StudiosApi.java | 607 + .../api/generated/legacy/SubtitleApi.java | 1626 +++ .../api/generated/legacy/SuggestionsApi.java | 325 + .../api/generated/legacy/SyncPlayApi.java | 2344 ++++ .../api/generated/legacy/SystemApi.java | 1140 ++ .../api/generated/legacy/TimeSyncApi.java | 241 + .../api/generated/legacy/TmdbApi.java | 241 + .../api/generated/legacy/TrailersApi.java | 1332 ++ .../api/generated/legacy/TvShowsApi.java | 1168 ++ .../generated/legacy/UniversalAudioApi.java | 781 ++ .../api/generated/legacy/UserApi.java | 2061 +++ .../api/generated/legacy/UserLibraryApi.java | 1512 +++ .../api/generated/legacy/UserViewsApi.java | 421 + .../generated/legacy/VideoAttachmentsApi.java | 275 + .../api/generated/legacy/VideosApi.java | 3407 +++++ .../api/generated/legacy/YearsApi.java | 576 + .../legacy/model/AbstractOpenApiSchema.java | 146 + .../legacy/model/AccessSchedule.java | 351 + .../legacy/model/ActivityLogEntry.java | 562 + .../model/ActivityLogEntryQueryResult.java | 289 + .../legacy/model/AddVirtualFolderDto.java | 189 + .../legacy/model/AdminNotificationDto.java | 315 + .../api/generated/legacy/model/AlbumInfo.java | 772 ++ .../model/AlbumInfoRemoteSearchQuery.java | 317 + .../legacy/model/AllThemeMediaResult.java | 272 + .../generated/legacy/model/Architecture.java | 75 + .../generated/legacy/model/ArtistInfo.java | 671 + .../model/ArtistInfoRemoteSearchQuery.java | 318 + .../legacy/model/AuthenticateUserByName.java | 275 + .../legacy/model/AuthenticationInfo.java | 643 + .../model/AuthenticationInfoQueryResult.java | 290 + .../legacy/model/AuthenticationResult.java | 312 + .../api/generated/legacy/model/BaseItem.java | 613 + .../generated/legacy/model/BaseItemDto.java | 6600 ++++++++++ .../model/BaseItemDtoImageBlurHashes.java | 829 ++ .../legacy/model/BaseItemDtoQueryResult.java | 288 + .../generated/legacy/model/BaseItemKind.java | 137 + .../legacy/model/BaseItemPerson.java | 394 + .../model/BaseItemPersonImageBlurHashes.java | 830 ++ .../api/generated/legacy/model/BookInfo.java | 654 + .../model/BookInfoRemoteSearchQuery.java | 316 + .../generated/legacy/model/BoxSetInfo.java | 617 + .../model/BoxSetInfoRemoteSearchQuery.java | 318 + .../legacy/model/BrandingOptions.java | 274 + .../legacy/model/BufferRequestDto.java | 316 + .../legacy/model/ChannelFeatures.java | 687 + .../legacy/model/ChannelItemSortField.java | 77 + .../model/ChannelMappingOptionsDto.java | 357 + .../legacy/model/ChannelMediaContentType.java | 79 + .../legacy/model/ChannelMediaType.java | 69 + .../generated/legacy/model/ChannelType.java | 67 + .../generated/legacy/model/ChapterInfo.java | 355 + .../legacy/model/ClientCapabilities.java | 600 + .../legacy/model/ClientCapabilitiesDto.java | 603 + .../model/ClientLogDocumentResponseDto.java | 192 + .../generated/legacy/model/CodecProfile.java | 381 + .../api/generated/legacy/model/CodecType.java | 69 + .../model/CollectionCreationResult.java | 193 + .../legacy/model/CollectionTypeOptions.java | 79 + .../legacy/model/ConfigImageTypes.java | 494 + .../legacy/model/ConfigurationPageInfo.java | 397 + .../legacy/model/ContainerProfile.java | 287 + .../legacy/model/ControlResponse.java | 273 + .../generated/legacy/model/CountryInfo.java | 315 + .../legacy/model/CreatePlaylistDto.java | 329 + .../legacy/model/CreateUserByName.java | 232 + .../generated/legacy/model/CultureDto.java | 370 + .../api/generated/legacy/model/DayOfWeek.java | 77 + .../generated/legacy/model/DayPattern.java | 69 + .../model/DefaultDirectoryBrowserInfoDto.java | 192 + .../legacy/model/DeviceIdentification.java | 534 + .../generated/legacy/model/DeviceInfo.java | 559 + .../legacy/model/DeviceInfoQueryResult.java | 288 + .../generated/legacy/model/DeviceOptions.java | 268 + .../legacy/model/DeviceOptionsDto.java | 272 + .../generated/legacy/model/DeviceProfile.java | 1872 +++ .../legacy/model/DeviceProfileInfo.java | 272 + .../legacy/model/DeviceProfileType.java | 67 + .../legacy/model/DirectPlayProfile.java | 314 + .../legacy/model/DisplayPreferencesDto.java | 738 ++ .../generated/legacy/model/DlnaOptions.java | 620 + .../legacy/model/DlnaProfileType.java | 71 + .../legacy/model/DynamicDayOfWeek.java | 83 + .../legacy/model/EmbeddedSubtitleOptions.java | 71 + .../legacy/model/EncodingContext.java | 67 + .../legacy/model/EncodingOptions.java | 1781 +++ .../generated/legacy/model/EndPointInfo.java | 232 + .../legacy/model/ExternalIdInfo.java | 315 + .../legacy/model/ExternalIdMediaType.java | 87 + .../generated/legacy/model/ExternalUrl.java | 231 + .../legacy/model/FFmpegLocation.java | 71 + .../legacy/model/FileSystemEntryInfo.java | 273 + .../legacy/model/FileSystemEntryType.java | 71 + .../api/generated/legacy/model/FontFile.java | 314 + .../legacy/model/ForgotPasswordAction.java | 69 + .../legacy/model/ForgotPasswordDto.java | 192 + .../legacy/model/ForgotPasswordPinDto.java | 192 + .../legacy/model/ForgotPasswordResult.java | 276 + .../legacy/model/GeneralCommand.java | 289 + .../legacy/model/GeneralCommandType.java | 147 + .../legacy/model/GetProgramsDto.java | 1350 ++ .../generated/legacy/model/GroupInfoDto.java | 370 + .../legacy/model/GroupQueueMode.java | 67 + .../legacy/model/GroupRepeatMode.java | 69 + .../legacy/model/GroupShuffleMode.java | 67 + .../legacy/model/GroupStateType.java | 71 + .../legacy/model/GroupUpdateType.java | 85 + .../api/generated/legacy/model/GuideInfo.java | 232 + .../legacy/model/HardwareEncodingType.java | 75 + .../legacy/model/HeaderMatchType.java | 69 + .../legacy/model/HttpHeaderInfo.java | 272 + .../api/generated/legacy/model/IPlugin.java | 376 + .../legacy/model/IgnoreWaitRequestDto.java | 192 + .../legacy/model/ImageByNameInfo.java | 354 + .../generated/legacy/model/ImageFormat.java | 73 + .../api/generated/legacy/model/ImageInfo.java | 472 + .../generated/legacy/model/ImageOption.java | 272 + .../legacy/model/ImageOrientation.java | 79 + .../legacy/model/ImageProviderInfo.java | 247 + .../legacy/model/ImageSavingConvention.java | 67 + .../api/generated/legacy/model/ImageType.java | 89 + .../legacy/model/InstallationInfo.java | 436 + .../api/generated/legacy/model/IsoType.java | 67 + .../generated/legacy/model/ItemCounts.java | 642 + .../generated/legacy/model/ItemFields.java | 185 + .../generated/legacy/model/ItemFilter.java | 81 + .../legacy/model/JoinGroupRequestDto.java | 193 + .../api/generated/legacy/model/KeepUntil.java | 71 + .../legacy/model/LibraryOptionInfoDto.java | 232 + .../legacy/model/LibraryOptions.java | 1414 ++ .../legacy/model/LibraryOptionsResultDto.java | 372 + .../legacy/model/LibraryTypeOptionsDto.java | 414 + .../legacy/model/LibraryUpdateInfo.java | 502 + .../legacy/model/ListingsProviderInfo.java | 958 ++ .../legacy/model/LiveStreamResponse.java | 189 + .../generated/legacy/model/LiveTvInfo.java | 299 + .../generated/legacy/model/LiveTvOptions.java | 737 ++ .../legacy/model/LiveTvServiceInfo.java | 490 + .../legacy/model/LiveTvServiceStatus.java | 67 + .../legacy/model/LocalizationOption.java | 232 + .../generated/legacy/model/LocationType.java | 71 + .../api/generated/legacy/model/LogFile.java | 314 + .../api/generated/legacy/model/LogLevel.java | 77 + .../legacy/model/MediaAttachment.java | 436 + .../legacy/model/MediaEncoderPathDto.java | 232 + .../generated/legacy/model/MediaPathDto.java | 271 + .../generated/legacy/model/MediaPathInfo.java | 232 + .../generated/legacy/model/MediaProtocol.java | 77 + .../legacy/model/MediaSourceInfo.java | 1929 +++ .../legacy/model/MediaSourceType.java | 69 + .../generated/legacy/model/MediaStream.java | 2481 ++++ .../legacy/model/MediaStreamType.java | 73 + .../legacy/model/MediaUpdateInfoDto.java | 204 + .../legacy/model/MediaUpdateInfoPathDto.java | 232 + .../api/generated/legacy/model/MediaUrl.java | 231 + .../legacy/model/MessageCommand.java | 272 + .../legacy/model/MetadataConfiguration.java | 197 + .../legacy/model/MetadataEditorInfo.java | 467 + .../generated/legacy/model/MetadataField.java | 81 + .../legacy/model/MetadataOptions.java | 511 + .../legacy/model/MetadataRefreshMode.java | 71 + .../model/MovePlaylistItemRequestDto.java | 234 + .../api/generated/legacy/model/MovieInfo.java | 614 + .../model/MovieInfoRemoteSearchQuery.java | 317 + .../legacy/model/MusicVideoInfo.java | 670 + .../MusicVideoInfoRemoteSearchQuery.java | 319 + .../generated/legacy/model/NameGuidPair.java | 232 + .../generated/legacy/model/NameIdPair.java | 231 + .../generated/legacy/model/NameValuePair.java | 231 + .../legacy/model/NetworkConfiguration.java | 1637 +++ .../legacy/model/NewGroupRequestDto.java | 192 + .../legacy/model/NextItemRequestDto.java | 193 + .../legacy/model/NotificationDto.java | 475 + .../legacy/model/NotificationLevel.java | 69 + .../legacy/model/NotificationOption.java | 432 + .../legacy/model/NotificationOptions.java | 204 + .../legacy/model/NotificationResultDto.java | 250 + .../legacy/model/NotificationTypeInfo.java | 355 + .../legacy/model/NotificationsSummaryDto.java | 237 + .../legacy/model/ObjectGroupUpdate.java | 274 + .../legacy/model/OpenLiveStreamDto.java | 708 + .../generated/legacy/model/PackageInfo.java | 489 + .../legacy/model/ParentalRating.java | 231 + .../legacy/model/PathSubstitution.java | 231 + .../legacy/model/PersonLookupInfo.java | 617 + .../PersonLookupInfoRemoteSearchQuery.java | 320 + .../legacy/model/PinRedeemResult.java | 245 + .../legacy/model/PingRequestDto.java | 192 + .../generated/legacy/model/PlayAccess.java | 67 + .../generated/legacy/model/PlayCommand.java | 73 + .../generated/legacy/model/PlayMethod.java | 69 + .../generated/legacy/model/PlayRequest.java | 495 + .../legacy/model/PlayRequestDto.java | 290 + .../legacy/model/PlaybackErrorCode.java | 69 + .../legacy/model/PlaybackInfoDto.java | 774 ++ .../legacy/model/PlaybackInfoResponse.java | 289 + .../legacy/model/PlaybackProgressInfo.java | 985 ++ .../legacy/model/PlaybackStartInfo.java | 984 ++ .../legacy/model/PlaybackStopInfo.java | 615 + .../legacy/model/PlayerStateInfo.java | 602 + .../legacy/model/PlaylistCreationResult.java | 192 + .../legacy/model/PlaystateCommand.java | 81 + .../legacy/model/PlaystateRequest.java | 274 + .../generated/legacy/model/PluginInfo.java | 475 + .../generated/legacy/model/PluginStatus.java | 77 + .../legacy/model/PreviousItemRequestDto.java | 193 + .../legacy/model/ProblemDetails.java | 407 + .../legacy/model/ProfileCondition.java | 314 + .../legacy/model/ProfileConditionType.java | 73 + .../legacy/model/ProfileConditionValue.java | 111 + .../generated/legacy/model/ProgramAudio.java | 75 + .../legacy/model/PublicSystemInfo.java | 438 + .../generated/legacy/model/QueryFilters.java | 256 + .../legacy/model/QueryFiltersLegacy.java | 360 + .../api/generated/legacy/model/QueueItem.java | 232 + .../legacy/model/QueueRequestDto.java | 247 + .../legacy/model/QuickConnectDto.java | 192 + .../legacy/model/QuickConnectResult.java | 478 + .../generated/legacy/model/RatingType.java | 67 + .../legacy/model/ReadyRequestDto.java | 316 + .../legacy/model/RecommendationDto.java | 330 + .../legacy/model/RecommendationType.java | 75 + .../legacy/model/RecordingStatus.java | 77 + .../legacy/model/RemoteImageInfo.java | 560 + .../legacy/model/RemoteImageResult.java | 299 + .../legacy/model/RemoteSearchResult.java | 670 + .../legacy/model/RemoteSubtitleInfo.java | 603 + .../model/RemoveFromPlaylistRequestDto.java | 293 + .../generated/legacy/model/RepeatMode.java | 69 + .../legacy/model/RepositoryInfo.java | 272 + .../legacy/model/ResponseProfile.java | 450 + .../legacy/model/ScrollDirection.java | 67 + .../generated/legacy/model/SearchHint.java | 1347 ++ .../legacy/model/SearchHintResult.java | 247 + .../legacy/model/SeekRequestDto.java | 192 + .../generated/legacy/model/SendCommand.java | 397 + .../legacy/model/SendCommandType.java | 71 + .../legacy/model/SendToUserType.java | 69 + .../generated/legacy/model/SeriesInfo.java | 617 + .../model/SeriesInfoRemoteSearchQuery.java | 318 + .../generated/legacy/model/SeriesStatus.java | 67 + .../legacy/model/SeriesTimerInfoDto.java | 1634 +++ .../model/SeriesTimerInfoDtoQueryResult.java | 290 + .../legacy/model/ServerConfiguration.java | 2306 ++++ .../legacy/model/ServerDiscoveryInfo.java | 314 + .../generated/legacy/model/SessionInfo.java | 1348 ++ .../legacy/model/SessionMessageType.java | 131 + .../legacy/model/SessionUserInfo.java | 233 + .../legacy/model/SetChannelMappingDto.java | 274 + .../model/SetPlaylistItemRequestDto.java | 193 + .../legacy/model/SetRepeatModeRequestDto.java | 192 + .../model/SetShuffleModeRequestDto.java | 192 + .../api/generated/legacy/model/SongInfo.java | 758 ++ .../api/generated/legacy/model/SortOrder.java | 67 + .../legacy/model/SpecialViewOptionDto.java | 231 + .../legacy/model/StartupConfigurationDto.java | 277 + .../legacy/model/StartupRemoteAccessDto.java | 235 + .../legacy/model/StartupUserDto.java | 231 + .../legacy/model/SubtitleDeliveryMethod.java | 73 + .../legacy/model/SubtitleOptions.java | 546 + .../legacy/model/SubtitlePlaybackMode.java | 73 + .../legacy/model/SubtitleProfile.java | 355 + .../legacy/model/SyncPlayUserAccessType.java | 69 + .../generated/legacy/model/SystemInfo.java | 1241 ++ .../legacy/model/TaskCompletionStatus.java | 71 + .../api/generated/legacy/model/TaskInfo.java | 571 + .../generated/legacy/model/TaskResult.java | 476 + .../api/generated/legacy/model/TaskState.java | 69 + .../legacy/model/TaskTriggerInfo.java | 355 + .../legacy/model/ThemeMediaResult.java | 329 + .../legacy/model/TimerEventInfo.java | 232 + .../generated/legacy/model/TimerInfoDto.java | 1312 ++ .../legacy/model/TimerInfoDtoQueryResult.java | 288 + .../generated/legacy/model/TrailerInfo.java | 617 + .../model/TrailerInfoRemoteSearchQuery.java | 318 + .../legacy/model/TranscodeReason.java | 113 + .../legacy/model/TranscodeSeekInfo.java | 67 + .../legacy/model/TranscodingInfo.java | 701 + .../legacy/model/TranscodingProfile.java | 824 ++ .../model/TransportStreamTimestamp.java | 69 + .../legacy/model/TunerChannelMapping.java | 314 + .../generated/legacy/model/TunerHostInfo.java | 599 + .../generated/legacy/model/TypeOptions.java | 456 + .../generated/legacy/model/UnratedItem.java | 81 + .../legacy/model/UpdateLibraryOptionsDto.java | 232 + .../model/UpdateMediaPathRequestDto.java | 231 + .../legacy/model/UpdateUserEasyPassword.java | 274 + .../legacy/model/UpdateUserPassword.java | 314 + .../legacy/model/UploadSubtitleDto.java | 314 + .../legacy/model/UserConfiguration.java | 827 ++ .../api/generated/legacy/model/UserDto.java | 723 ++ .../legacy/model/UserItemDataDto.java | 601 + .../generated/legacy/model/UserPolicy.java | 1896 +++ .../legacy/model/UtcTimeResponse.java | 238 + .../legacy/model/ValidatePathDto.java | 274 + .../generated/legacy/model/VersionInfo.java | 514 + .../generated/legacy/model/Video3DFormat.java | 73 + .../api/generated/legacy/model/VideoType.java | 71 + .../legacy/model/VirtualFolderInfo.java | 491 + .../generated/legacy/model/WakeOnLanInfo.java | 232 + .../legacy/model/XbmcMetadataOptions.java | 362 + .../generated/legacy/model/XmlAttribute.java | 231 + .../generate-sources/scripts/generate.sh | 17 +- 415 files changed, 221412 insertions(+), 3185 deletions(-) create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ActivityLogApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ApiKeyApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ArtistsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/AudioApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/BrandingApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ChannelsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ClientLogApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/CollectionApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ConfigurationApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DashboardApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DevicesApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DisplayPreferencesApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DlnaApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DlnaServerApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DynamicHlsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/EnvironmentApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/FilterApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/GenresApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/HlsSegmentApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ImageApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ImageByNameApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/InstantMixApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ItemLookupApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ItemRefreshApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ItemUpdateApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ItemsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/LibraryApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/LibraryStructureApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/LiveTvApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/LocalizationApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/MediaInfoApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/MoviesApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/MusicGenresApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/NotificationsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PackageApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PersonsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PlaylistsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PlaystateApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PluginsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/QuickConnectApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/RemoteImageApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ScheduledTasksApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SearchApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SessionApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/StartupApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/StudiosApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SubtitleApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SuggestionsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SyncPlayApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SystemApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/TimeSyncApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/TmdbApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/TrailersApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/TvShowsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/UniversalAudioApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/UserApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/UserLibraryApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/UserViewsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/VideoAttachmentsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/VideosApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/YearsApi.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AbstractOpenApiSchema.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AccessSchedule.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ActivityLogEntry.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ActivityLogEntryQueryResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AddVirtualFolderDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AdminNotificationDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AlbumInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AlbumInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AllThemeMediaResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/Architecture.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ArtistInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ArtistInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AuthenticateUserByName.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AuthenticationInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AuthenticationInfoQueryResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AuthenticationResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItem.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemDtoImageBlurHashes.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemDtoQueryResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemKind.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemPerson.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemPersonImageBlurHashes.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BookInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BookInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BoxSetInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BoxSetInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BrandingOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BufferRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelFeatures.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelItemSortField.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelMappingOptionsDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelMediaContentType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelMediaType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChapterInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ClientCapabilities.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ClientCapabilitiesDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ClientLogDocumentResponseDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CodecProfile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CodecType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CollectionCreationResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CollectionTypeOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ConfigImageTypes.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ConfigurationPageInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ContainerProfile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ControlResponse.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CountryInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CreatePlaylistDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CreateUserByName.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CultureDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DayOfWeek.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DayPattern.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DefaultDirectoryBrowserInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceIdentification.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceInfoQueryResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceOptionsDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceProfile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceProfileInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceProfileType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DirectPlayProfile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DisplayPreferencesDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DlnaOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DlnaProfileType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DynamicDayOfWeek.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/EmbeddedSubtitleOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/EncodingContext.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/EncodingOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/EndPointInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ExternalIdInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ExternalIdMediaType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ExternalUrl.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/FFmpegLocation.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/FileSystemEntryInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/FileSystemEntryType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/FontFile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ForgotPasswordAction.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ForgotPasswordDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ForgotPasswordPinDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ForgotPasswordResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GeneralCommand.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GeneralCommandType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GetProgramsDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupQueueMode.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupRepeatMode.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupShuffleMode.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupStateType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupUpdateType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GuideInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/HardwareEncodingType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/HeaderMatchType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/HttpHeaderInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/IPlugin.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/IgnoreWaitRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageByNameInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageFormat.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageOption.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageOrientation.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageProviderInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageSavingConvention.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/InstallationInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/IsoType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ItemCounts.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ItemFields.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ItemFilter.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/JoinGroupRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/KeepUntil.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryOptionInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryOptionsResultDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryTypeOptionsDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryUpdateInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ListingsProviderInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveStreamResponse.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveTvInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveTvOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveTvServiceInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveTvServiceStatus.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LocalizationOption.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LocationType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LogFile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LogLevel.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaAttachment.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaEncoderPathDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaPathDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaPathInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaProtocol.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaSourceInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaSourceType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaStream.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaStreamType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaUpdateInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaUpdateInfoPathDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaUrl.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MessageCommand.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataConfiguration.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataEditorInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataField.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataRefreshMode.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MovePlaylistItemRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MovieInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MovieInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MusicVideoInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MusicVideoInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NameGuidPair.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NameIdPair.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NameValuePair.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NetworkConfiguration.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NewGroupRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NextItemRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationLevel.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationOption.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationResultDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationTypeInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationsSummaryDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ObjectGroupUpdate.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/OpenLiveStreamDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PackageInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ParentalRating.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PathSubstitution.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PersonLookupInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PersonLookupInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PinRedeemResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PingRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayAccess.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayCommand.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayMethod.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayRequest.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackErrorCode.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackInfoResponse.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackProgressInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackStartInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackStopInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayerStateInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaylistCreationResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaystateCommand.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaystateRequest.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PluginInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PluginStatus.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PreviousItemRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProblemDetails.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProfileCondition.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProfileConditionType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProfileConditionValue.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProgramAudio.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PublicSystemInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QueryFilters.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QueryFiltersLegacy.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QueueItem.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QueueRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QuickConnectDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QuickConnectResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RatingType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ReadyRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RecommendationDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RecommendationType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RecordingStatus.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoteImageInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoteImageResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoteSearchResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoteSubtitleInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoveFromPlaylistRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RepeatMode.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RepositoryInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ResponseProfile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ScrollDirection.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SearchHint.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SearchHintResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeekRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SendCommand.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SendCommandType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SendToUserType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesStatus.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesTimerInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesTimerInfoDtoQueryResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ServerConfiguration.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ServerDiscoveryInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SessionInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SessionMessageType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SessionUserInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SetChannelMappingDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SetPlaylistItemRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SetRepeatModeRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SetShuffleModeRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SongInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SortOrder.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SpecialViewOptionDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/StartupConfigurationDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/StartupRemoteAccessDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/StartupUserDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SubtitleDeliveryMethod.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SubtitleOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SubtitlePlaybackMode.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SubtitleProfile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SyncPlayUserAccessType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SystemInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskCompletionStatus.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskState.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskTriggerInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ThemeMediaResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TimerEventInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TimerInfoDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TimerInfoDtoQueryResult.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TrailerInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TrailerInfoRemoteSearchQuery.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TranscodeReason.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TranscodeSeekInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TranscodingInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TranscodingProfile.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TransportStreamTimestamp.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TunerChannelMapping.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TunerHostInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TypeOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UnratedItem.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UpdateLibraryOptionsDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UpdateMediaPathRequestDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UpdateUserEasyPassword.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UpdateUserPassword.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UploadSubtitleDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UserConfiguration.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UserDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UserItemDataDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UserPolicy.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UtcTimeResponse.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ValidatePathDto.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/VersionInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/Video3DFormat.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/VideoType.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/VirtualFolderInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/WakeOnLanInfo.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/XbmcMetadataOptions.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/XmlAttribute.java diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ApiClient.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ApiClient.java index b46a36250c058..c7cd1faf92e8f 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ApiClient.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/ApiClient.java @@ -171,7 +171,7 @@ public static List parameterToPairs(String collectionFormat, String name, public ApiClient() { this.builder = createDefaultHttpClientBuilder(); this.mapper = createDefaultObjectMapper(); - updateBaseUri(getDefaultBaseUri()); + updateBaseUri("http://localhost"); interceptor = null; readTimeout = null; connectTimeout = null; @@ -189,7 +189,7 @@ public ApiClient() { public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { this.builder = builder; this.mapper = mapper; - updateBaseUri(baseUri != null ? baseUri : getDefaultBaseUri()); + updateBaseUri(baseUri != null ? baseUri : "http://localhost"); interceptor = null; readTimeout = null; connectTimeout = null; @@ -211,8 +211,8 @@ public static ObjectMapper createDefaultObjectMapper() { return mapper; } - protected String getDefaultBaseUri() { - return "http://localhost"; + protected final String getDefaultBaseUri() { + return basePath; } public static HttpClient.Builder createDefaultHttpClientBuilder() { diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/Pair.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/Pair.java index e1fdc6ef3e5f1..034b37dbbd614 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/Pair.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/Pair.java @@ -15,28 +15,12 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class Pair { - private String name = ""; - private String value = ""; + private final String name; + private final String value; public Pair(String name, String value) { - setName(name); - setValue(value); - } - - private void setName(String name) { - if (!isValidString(name)) { - return; - } - - this.name = name; - } - - private void setValue(String value) { - if (!isValidString(value)) { - return; - } - - this.value = value; + this.name = isValidString(name) ? name : ""; + this.value = isValidString(value) ? value : ""; } public String getName() { @@ -47,11 +31,7 @@ public String getValue() { return this.value; } - private boolean isValidString(String arg) { - if (arg == null) { - return false; - } - - return true; + private static boolean isValidString(String arg) { + return arg != null; } } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/RFC3339JavaTimeModule.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/RFC3339JavaTimeModule.java index 055687a8975f0..ba029af4bb2ae 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/RFC3339JavaTimeModule.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/RFC3339JavaTimeModule.java @@ -16,6 +16,7 @@ import java.time.OffsetDateTime; import java.time.ZonedDateTime; +import com.fasterxml.jackson.databind.Module.SetupContext; import com.fasterxml.jackson.databind.module.SimpleModule; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") @@ -24,6 +25,11 @@ public class RFC3339JavaTimeModule extends SimpleModule { public RFC3339JavaTimeModule() { super("RFC3339JavaTimeModule"); + } + + @Override + public void setupModule(SetupContext context) { + super.setupModule(context); addDeserializer(Instant.class, RFC3339InstantDeserializer.INSTANT); addDeserializer(OffsetDateTime.class, RFC3339InstantDeserializer.OFFSET_DATE_TIME); diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ActivityLogApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ActivityLogApi.java index 636d46b286fa9..2e485d5d61f73 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ActivityLogApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ActivityLogApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -22,6 +23,7 @@ import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.function.Consumer; @@ -37,6 +39,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class ActivityLogApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -72,6 +96,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets activity log entries. * @@ -87,8 +161,27 @@ public ActivityLogEntryQueryResult getLogEntries(@org.eclipse.jdt.annotation.Non @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDate, @org.eclipse.jdt.annotation.NonNull Boolean hasUserId) throws ApiException { + return getLogEntries(startIndex, limit, minDate, hasUserId, null); + } + + /** + * Gets activity log entries. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param minDate Optional. The minimum date. Format = ISO. (optional) + * @param hasUserId Optional. Filter log entries if it has user id, or not. (optional) + * @param headers Optional headers to include in the request + * @return ActivityLogEntryQueryResult + * @throws ApiException if fails to make API call + */ + public ActivityLogEntryQueryResult getLogEntries(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasUserId, Map headers) throws ApiException { ApiResponse localVarResponse = getLogEntriesWithHttpInfo(startIndex, limit, - minDate, hasUserId); + minDate, hasUserId, headers); return localVarResponse.getData(); } @@ -107,7 +200,27 @@ public ApiResponse getLogEntriesWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDate, @org.eclipse.jdt.annotation.NonNull Boolean hasUserId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getLogEntriesRequestBuilder(startIndex, limit, minDate, hasUserId); + return getLogEntriesWithHttpInfo(startIndex, limit, minDate, hasUserId, null); + } + + /** + * Gets activity log entries. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param minDate Optional. The minimum date. Format = ISO. (optional) + * @param hasUserId Optional. Filter log entries if it has user id, or not. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<ActivityLogEntryQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLogEntriesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasUserId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLogEntriesRequestBuilder(startIndex, limit, minDate, hasUserId, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -124,14 +237,15 @@ public ApiResponse getLogEntriesWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + ActivityLogEntryQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -145,7 +259,7 @@ public ApiResponse getLogEntriesWithHttpInfo( private HttpRequest.Builder getLogEntriesRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDate, - @org.eclipse.jdt.annotation.NonNull Boolean hasUserId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean hasUserId, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -181,6 +295,8 @@ private HttpRequest.Builder getLogEntriesRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ApiKeyApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ApiKeyApi.java index ee396868ac17b..999dc8b73a1c3 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ApiKeyApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ApiKeyApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.function.Consumer; @@ -36,6 +38,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class ApiKeyApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -71,6 +95,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Create a new api key. * @@ -78,7 +152,19 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public void createKey(@org.eclipse.jdt.annotation.Nullable String app) throws ApiException { - createKeyWithHttpInfo(app); + createKey(app, null); + } + + /** + * Create a new api key. + * + * @param app Name of the app using the authentication key. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void createKey(@org.eclipse.jdt.annotation.Nullable String app, Map headers) + throws ApiException { + createKeyWithHttpInfo(app, headers); } /** @@ -90,7 +176,20 @@ public void createKey(@org.eclipse.jdt.annotation.Nullable String app) throws Ap */ public ApiResponse createKeyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String app) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = createKeyRequestBuilder(app); + return createKeyWithHttpInfo(app, null); + } + + /** + * Create a new api key. + * + * @param app Name of the app using the authentication key. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createKeyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String app, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createKeyRequestBuilder(app, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -117,8 +216,8 @@ public ApiResponse createKeyWithHttpInfo(@org.eclipse.jdt.annotation.Nulla } } - private HttpRequest.Builder createKeyRequestBuilder(@org.eclipse.jdt.annotation.Nullable String app) - throws ApiException { + private HttpRequest.Builder createKeyRequestBuilder(@org.eclipse.jdt.annotation.Nullable String app, + Map headers) throws ApiException { // verify the required parameter 'app' is set if (app == null) { throw new ApiException(400, "Missing the required parameter 'app' when calling createKey"); @@ -151,6 +250,8 @@ private HttpRequest.Builder createKeyRequestBuilder(@org.eclipse.jdt.annotation. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -164,7 +265,18 @@ private HttpRequest.Builder createKeyRequestBuilder(@org.eclipse.jdt.annotation. * @throws ApiException if fails to make API call */ public AuthenticationInfoQueryResult getKeys() throws ApiException { - ApiResponse localVarResponse = getKeysWithHttpInfo(); + return getKeys(null); + } + + /** + * Get all keys. + * + * @param headers Optional headers to include in the request + * @return AuthenticationInfoQueryResult + * @throws ApiException if fails to make API call + */ + public AuthenticationInfoQueryResult getKeys(Map headers) throws ApiException { + ApiResponse localVarResponse = getKeysWithHttpInfo(headers); return localVarResponse.getData(); } @@ -175,7 +287,19 @@ public AuthenticationInfoQueryResult getKeys() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getKeysWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getKeysRequestBuilder(); + return getKeysWithHttpInfo(null); + } + + /** + * Get all keys. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<AuthenticationInfoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getKeysWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getKeysRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -192,14 +316,15 @@ public ApiResponse getKeysWithHttpInfo() throws A } String responseBody = new String(localVarResponse.body().readAllBytes()); + AuthenticationInfoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -210,7 +335,7 @@ public ApiResponse getKeysWithHttpInfo() throws A } } - private HttpRequest.Builder getKeysRequestBuilder() throws ApiException { + private HttpRequest.Builder getKeysRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -225,6 +350,8 @@ private HttpRequest.Builder getKeysRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -238,7 +365,19 @@ private HttpRequest.Builder getKeysRequestBuilder() throws ApiException { * @throws ApiException if fails to make API call */ public void revokeKey(@org.eclipse.jdt.annotation.Nullable String key) throws ApiException { - revokeKeyWithHttpInfo(key); + revokeKey(key, null); + } + + /** + * Remove an api key. + * + * @param key The access token to delete. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void revokeKey(@org.eclipse.jdt.annotation.Nullable String key, Map headers) + throws ApiException { + revokeKeyWithHttpInfo(key, headers); } /** @@ -250,7 +389,20 @@ public void revokeKey(@org.eclipse.jdt.annotation.Nullable String key) throws Ap */ public ApiResponse revokeKeyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String key) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = revokeKeyRequestBuilder(key); + return revokeKeyWithHttpInfo(key, null); + } + + /** + * Remove an api key. + * + * @param key The access token to delete. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse revokeKeyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String key, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = revokeKeyRequestBuilder(key, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -277,8 +429,8 @@ public ApiResponse revokeKeyWithHttpInfo(@org.eclipse.jdt.annotation.Nulla } } - private HttpRequest.Builder revokeKeyRequestBuilder(@org.eclipse.jdt.annotation.Nullable String key) - throws ApiException { + private HttpRequest.Builder revokeKeyRequestBuilder(@org.eclipse.jdt.annotation.Nullable String key, + Map headers) throws ApiException { // verify the required parameter 'key' is set if (key == null) { throw new ApiException(400, "Missing the required parameter 'key' when calling revokeKey"); @@ -296,6 +448,8 @@ private HttpRequest.Builder revokeKeyRequestBuilder(@org.eclipse.jdt.annotation. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ArtistsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ArtistsApi.java index 487ad7daddfc8..0bcaca292f4ae 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ArtistsApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ArtistsApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -45,6 +47,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class ArtistsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -80,6 +104,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets all album artists from a given item, folder, or the entire library. * @@ -162,11 +236,102 @@ public BaseItemDtoQueryResult getAlbumArtists(@org.eclipse.jdt.annotation.NonNul @org.eclipse.jdt.annotation.NonNull List sortOrder, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getAlbumArtists(minCommunityRating, startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, + includeItemTypes, filters, isFavorite, mediaTypes, genres, genreIds, officialRatings, tags, years, + enableUserData, imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, studioIds, + userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, + enableTotalRecordCount, null); + } + + /** + * Gets all album artists from a given item, folder, or the entire library. + * + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person ids. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getAlbumArtists(@org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { ApiResponse localVarResponse = getAlbumArtistsWithHttpInfo(minCommunityRating, startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, genres, genreIds, officialRatings, tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, studioIds, userId, nameStartsWithOrGreater, - nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount); + nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount, headers); return localVarResponse.getData(); } @@ -253,11 +418,103 @@ public ApiResponse getAlbumArtistsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull List sortOrder, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getAlbumArtistsWithHttpInfo(minCommunityRating, startIndex, limit, searchTerm, parentId, fields, + excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, genres, genreIds, officialRatings, + tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, + studioIds, userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, + enableImages, enableTotalRecordCount, null); + } + + /** + * Gets all album artists from a given item, folder, or the entire library. + * + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person ids. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAlbumArtistsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getAlbumArtistsRequestBuilder(minCommunityRating, startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, genres, genreIds, officialRatings, tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, studioIds, userId, nameStartsWithOrGreater, - nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount); + nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -274,14 +531,14 @@ public ApiResponse getAlbumArtistsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -320,7 +577,8 @@ private HttpRequest.Builder getAlbumArtistsRequestBuilder( @org.eclipse.jdt.annotation.NonNull List sortBy, @org.eclipse.jdt.annotation.NonNull List sortOrder, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, - @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -412,6 +670,8 @@ private HttpRequest.Builder getAlbumArtistsRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -428,7 +688,21 @@ private HttpRequest.Builder getAlbumArtistsRequestBuilder( */ public BaseItemDto getArtistByName(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getArtistByNameWithHttpInfo(name, userId); + return getArtistByName(name, userId, null); + } + + /** + * Gets an artist by name. + * + * @param name Studio name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getArtistByName(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getArtistByNameWithHttpInfo(name, userId, headers); return localVarResponse.getData(); } @@ -442,7 +716,21 @@ public BaseItemDto getArtistByName(@org.eclipse.jdt.annotation.Nullable String n */ public ApiResponse getArtistByNameWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getArtistByNameRequestBuilder(name, userId); + return getArtistByNameWithHttpInfo(name, userId, null); + } + + /** + * Gets an artist by name. + * + * @param name Studio name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getArtistByNameWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getArtistByNameRequestBuilder(name, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -459,12 +747,14 @@ public ApiResponse getArtistByNameWithHttpInfo(@org.eclipse.jdt.ann } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -476,7 +766,7 @@ public ApiResponse getArtistByNameWithHttpInfo(@org.eclipse.jdt.ann } private HttpRequest.Builder getArtistByNameRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling getArtistByName"); @@ -510,6 +800,8 @@ private HttpRequest.Builder getArtistByNameRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -598,11 +890,102 @@ public BaseItemDtoQueryResult getArtists(@org.eclipse.jdt.annotation.NonNull Dou @org.eclipse.jdt.annotation.NonNull List sortOrder, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getArtists(minCommunityRating, startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, + includeItemTypes, filters, isFavorite, mediaTypes, genres, genreIds, officialRatings, tags, years, + enableUserData, imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, studioIds, + userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, + enableTotalRecordCount, null); + } + + /** + * Gets all artists from a given item, folder, or the entire library. + * + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person ids. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getArtists(@org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { ApiResponse localVarResponse = getArtistsWithHttpInfo(minCommunityRating, startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, genres, genreIds, officialRatings, tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, studioIds, userId, nameStartsWithOrGreater, - nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount); + nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount, headers); return localVarResponse.getData(); } @@ -689,11 +1072,103 @@ public ApiResponse getArtistsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull List sortOrder, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getArtistsWithHttpInfo(minCommunityRating, startIndex, limit, searchTerm, parentId, fields, + excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, genres, genreIds, officialRatings, + tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, + studioIds, userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, + enableImages, enableTotalRecordCount, null); + } + + /** + * Gets all artists from a given item, folder, or the entire library. + * + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person ids. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getArtistsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getArtistsRequestBuilder(minCommunityRating, startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, genres, genreIds, officialRatings, tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, studioIds, userId, nameStartsWithOrGreater, nameStartsWith, - nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount); + nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -710,14 +1185,14 @@ public ApiResponse getArtistsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -755,7 +1230,8 @@ private HttpRequest.Builder getArtistsRequestBuilder(@org.eclipse.jdt.annotation @org.eclipse.jdt.annotation.NonNull List sortBy, @org.eclipse.jdt.annotation.NonNull List sortOrder, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, - @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -847,6 +1323,8 @@ private HttpRequest.Builder getArtistsRequestBuilder(@org.eclipse.jdt.annotation if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/AudioApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/AudioApi.java index 8ab2592d4fc1b..33941cb6a65fa 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/AudioApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/AudioApi.java @@ -35,11 +35,32 @@ import org.openhab.binding.jellyfin.internal.api.generated.current.model.EncodingContext; import org.openhab.binding.jellyfin.internal.api.generated.current.model.SubtitleDeliveryMethod; -import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class AudioApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -75,6 +96,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets an audio stream. * @@ -188,6 +259,131 @@ public File getAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + return getAudioStream(itemId, container, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, + segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, enableAudioVbrEncoding, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { ApiResponse localVarResponse = getAudioStreamWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, @@ -196,7 +392,7 @@ public File getAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, - enableAudioVbrEncoding); + enableAudioVbrEncoding, headers); return localVarResponse.getData(); } @@ -313,6 +509,131 @@ public ApiResponse getAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation. @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + return getAudioStreamWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, enableAudioVbrEncoding, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getAudioStreamRequestBuilder(itemId, container, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, @@ -321,7 +642,7 @@ public ApiResponse getAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation. subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, - enableAudioVbrEncoding); + enableAudioVbrEncoding, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -336,13 +657,13 @@ public ApiResponse getAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation. return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -396,7 +717,8 @@ private HttpRequest.Builder getAudioStreamRequestBuilder(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getAudioStream"); @@ -526,6 +848,8 @@ private HttpRequest.Builder getAudioStreamRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -645,15 +969,140 @@ public File getAudioStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { - ApiResponse localVarResponse = getAudioStreamByContainerWithHttpInfo(itemId, container, _static, params, - tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, - deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + return getAudioStreamByContainer(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, enableAudioVbrEncoding, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamporphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getAudioStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { + ApiResponse localVarResponse = getAudioStreamByContainerWithHttpInfo(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, - enableAudioVbrEncoding); + enableAudioVbrEncoding, headers); return localVarResponse.getData(); } @@ -770,6 +1219,132 @@ public ApiResponse getAudioStreamByContainerWithHttpInfo(@org.eclipse.jdt. @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + return getAudioStreamByContainerWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, + playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, + enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, + maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamporphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAudioStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getAudioStreamByContainerRequestBuilder(itemId, container, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, @@ -778,7 +1353,7 @@ public ApiResponse getAudioStreamByContainerWithHttpInfo(@org.eclipse.jdt. subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, - enableAudioVbrEncoding); + enableAudioVbrEncoding, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -793,13 +1368,13 @@ public ApiResponse getAudioStreamByContainerWithHttpInfo(@org.eclipse.jdt. return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -853,7 +1428,8 @@ private HttpRequest.Builder getAudioStreamByContainerRequestBuilder( @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, @@ -989,6 +1565,8 @@ private HttpRequest.Builder getAudioStreamByContainerRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1061,10 +1639,260 @@ private HttpRequest.Builder getAudioStreamByContainerRequestBuilder( * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) * @param streamOptions Optional. The streaming options. (optional) * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) - * @return File + * @return File + * @throws ApiException if fails to make API call + */ + public File headAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + return headAudioStream(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, enableAudioVbrEncoding, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { + ApiResponse localVarResponse = headAudioStreamWithHttpInfo(itemId, container, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, headers); + return localVarResponse.getData(); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return ApiResponse<File> * @throws ApiException if fails to make API call */ - public File headAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + public ApiResponse headAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, @@ -1108,16 +1936,14 @@ public File headAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { - ApiResponse localVarResponse = headAudioStreamWithHttpInfo(itemId, container, _static, params, tag, - deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, - audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, - audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, - framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, - subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, - requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, - videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, - enableAudioVbrEncoding); - return localVarResponse.getData(); + return headAudioStreamWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, enableAudioVbrEncoding, null); } /** @@ -1186,6 +2012,7 @@ public File headAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) * @param streamOptions Optional. The streaming options. (optional) * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request * @return ApiResponse<File> * @throws ApiException if fails to make API call */ @@ -1232,7 +2059,8 @@ public ApiResponse headAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = headAudioStreamRequestBuilder(itemId, container, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, @@ -1241,7 +2069,7 @@ public ApiResponse headAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, - enableAudioVbrEncoding); + enableAudioVbrEncoding, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1256,13 +2084,13 @@ public ApiResponse headAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1316,7 +2144,8 @@ private HttpRequest.Builder headAudioStreamRequestBuilder(@org.eclipse.jdt.annot @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling headAudioStream"); @@ -1446,6 +2275,8 @@ private HttpRequest.Builder headAudioStreamRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1565,6 +2396,131 @@ public File headAudioStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + return headAudioStreamByContainer(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, enableAudioVbrEncoding, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamporphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headAudioStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { ApiResponse localVarResponse = headAudioStreamByContainerWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, @@ -1573,7 +2529,7 @@ public File headAudioStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, - enableAudioVbrEncoding); + enableAudioVbrEncoding, headers); return localVarResponse.getData(); } @@ -1690,6 +2646,132 @@ public ApiResponse headAudioStreamByContainerWithHttpInfo(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + return headAudioStreamByContainerWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, + playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, + enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, + maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamporphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headAudioStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = headAudioStreamByContainerRequestBuilder(itemId, container, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, @@ -1698,7 +2780,7 @@ public ApiResponse headAudioStreamByContainerWithHttpInfo(@org.eclipse.jdt subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, - enableAudioVbrEncoding); + enableAudioVbrEncoding, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1713,13 +2795,13 @@ public ApiResponse headAudioStreamByContainerWithHttpInfo(@org.eclipse.jdt return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1773,7 +2855,8 @@ private HttpRequest.Builder headAudioStreamByContainerRequestBuilder( @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, @@ -1909,6 +2992,8 @@ private HttpRequest.Builder headAudioStreamByContainerRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/BrandingApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/BrandingApi.java index 03cd7ff6355b2..46ca2391eccb7 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/BrandingApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/BrandingApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -19,6 +20,7 @@ import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; +import java.util.Map; import java.util.function.Consumer; import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; @@ -32,6 +34,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class BrandingApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -67,6 +91,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets branding css. * @@ -74,7 +148,18 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public String getBrandingCss() throws ApiException { - ApiResponse localVarResponse = getBrandingCssWithHttpInfo(); + return getBrandingCss(null); + } + + /** + * Gets branding css. + * + * @param headers Optional headers to include in the request + * @return String + * @throws ApiException if fails to make API call + */ + public String getBrandingCss(Map headers) throws ApiException { + ApiResponse localVarResponse = getBrandingCssWithHttpInfo(headers); return localVarResponse.getData(); } @@ -85,7 +170,18 @@ public String getBrandingCss() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getBrandingCssWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getBrandingCssRequestBuilder(); + return getBrandingCssWithHttpInfo(null); + } + + /** + * Gets branding css. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getBrandingCssWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBrandingCssRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -102,12 +198,14 @@ public ApiResponse getBrandingCssWithHttpInfo() throws ApiException { } String responseBody = new String(localVarResponse.body().readAllBytes()); + String responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -118,7 +216,7 @@ public ApiResponse getBrandingCssWithHttpInfo() throws ApiException { } } - private HttpRequest.Builder getBrandingCssRequestBuilder() throws ApiException { + private HttpRequest.Builder getBrandingCssRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -133,6 +231,8 @@ private HttpRequest.Builder getBrandingCssRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -146,7 +246,18 @@ private HttpRequest.Builder getBrandingCssRequestBuilder() throws ApiException { * @throws ApiException if fails to make API call */ public String getBrandingCss2() throws ApiException { - ApiResponse localVarResponse = getBrandingCss2WithHttpInfo(); + return getBrandingCss2(null); + } + + /** + * Gets branding css. + * + * @param headers Optional headers to include in the request + * @return String + * @throws ApiException if fails to make API call + */ + public String getBrandingCss2(Map headers) throws ApiException { + ApiResponse localVarResponse = getBrandingCss2WithHttpInfo(headers); return localVarResponse.getData(); } @@ -157,7 +268,18 @@ public String getBrandingCss2() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getBrandingCss2WithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getBrandingCss2RequestBuilder(); + return getBrandingCss2WithHttpInfo(null); + } + + /** + * Gets branding css. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getBrandingCss2WithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBrandingCss2RequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -174,12 +296,14 @@ public ApiResponse getBrandingCss2WithHttpInfo() throws ApiException { } String responseBody = new String(localVarResponse.body().readAllBytes()); + String responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -190,7 +314,7 @@ public ApiResponse getBrandingCss2WithHttpInfo() throws ApiException { } } - private HttpRequest.Builder getBrandingCss2RequestBuilder() throws ApiException { + private HttpRequest.Builder getBrandingCss2RequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -205,6 +329,8 @@ private HttpRequest.Builder getBrandingCss2RequestBuilder() throws ApiException if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -218,7 +344,18 @@ private HttpRequest.Builder getBrandingCss2RequestBuilder() throws ApiException * @throws ApiException if fails to make API call */ public BrandingOptions getBrandingOptions() throws ApiException { - ApiResponse localVarResponse = getBrandingOptionsWithHttpInfo(); + return getBrandingOptions(null); + } + + /** + * Gets branding configuration. + * + * @param headers Optional headers to include in the request + * @return BrandingOptions + * @throws ApiException if fails to make API call + */ + public BrandingOptions getBrandingOptions(Map headers) throws ApiException { + ApiResponse localVarResponse = getBrandingOptionsWithHttpInfo(headers); return localVarResponse.getData(); } @@ -229,7 +366,19 @@ public BrandingOptions getBrandingOptions() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getBrandingOptionsWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getBrandingOptionsRequestBuilder(); + return getBrandingOptionsWithHttpInfo(null); + } + + /** + * Gets branding configuration. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<BrandingOptions> + * @throws ApiException if fails to make API call + */ + public ApiResponse getBrandingOptionsWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBrandingOptionsRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -246,12 +395,14 @@ public ApiResponse getBrandingOptionsWithHttpInfo() throws ApiE } String responseBody = new String(localVarResponse.body().readAllBytes()); + BrandingOptions responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -262,7 +413,7 @@ public ApiResponse getBrandingOptionsWithHttpInfo() throws ApiE } } - private HttpRequest.Builder getBrandingOptionsRequestBuilder() throws ApiException { + private HttpRequest.Builder getBrandingOptionsRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -277,6 +428,8 @@ private HttpRequest.Builder getBrandingOptionsRequestBuilder() throws ApiExcepti if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ChannelsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ChannelsApi.java index 3f3689770bb6d..c96dec26a90ed 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ChannelsApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ChannelsApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -42,6 +44,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class ChannelsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -77,6 +101,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Get all channel features. * @@ -84,7 +158,18 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public List getAllChannelFeatures() throws ApiException { - ApiResponse> localVarResponse = getAllChannelFeaturesWithHttpInfo(); + return getAllChannelFeatures(null); + } + + /** + * Get all channel features. + * + * @param headers Optional headers to include in the request + * @return List<ChannelFeatures> + * @throws ApiException if fails to make API call + */ + public List getAllChannelFeatures(Map headers) throws ApiException { + ApiResponse> localVarResponse = getAllChannelFeaturesWithHttpInfo(headers); return localVarResponse.getData(); } @@ -95,7 +180,19 @@ public List getAllChannelFeatures() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getAllChannelFeaturesWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getAllChannelFeaturesRequestBuilder(); + return getAllChannelFeaturesWithHttpInfo(null); + } + + /** + * Get all channel features. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<ChannelFeatures>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getAllChannelFeaturesWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAllChannelFeaturesRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -112,14 +209,14 @@ public ApiResponse> getAllChannelFeaturesWithHttpInfo() th } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -130,7 +227,7 @@ public ApiResponse> getAllChannelFeaturesWithHttpInfo() th } } - private HttpRequest.Builder getAllChannelFeaturesRequestBuilder() throws ApiException { + private HttpRequest.Builder getAllChannelFeaturesRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -145,6 +242,8 @@ private HttpRequest.Builder getAllChannelFeaturesRequestBuilder() throws ApiExce if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -159,7 +258,20 @@ private HttpRequest.Builder getAllChannelFeaturesRequestBuilder() throws ApiExce * @throws ApiException if fails to make API call */ public ChannelFeatures getChannelFeatures(@org.eclipse.jdt.annotation.Nullable UUID channelId) throws ApiException { - ApiResponse localVarResponse = getChannelFeaturesWithHttpInfo(channelId); + return getChannelFeatures(channelId, null); + } + + /** + * Get channel features. + * + * @param channelId Channel id. (required) + * @param headers Optional headers to include in the request + * @return ChannelFeatures + * @throws ApiException if fails to make API call + */ + public ChannelFeatures getChannelFeatures(@org.eclipse.jdt.annotation.Nullable UUID channelId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getChannelFeaturesWithHttpInfo(channelId, headers); return localVarResponse.getData(); } @@ -172,7 +284,20 @@ public ChannelFeatures getChannelFeatures(@org.eclipse.jdt.annotation.Nullable U */ public ApiResponse getChannelFeaturesWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UUID channelId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getChannelFeaturesRequestBuilder(channelId); + return getChannelFeaturesWithHttpInfo(channelId, null); + } + + /** + * Get channel features. + * + * @param channelId Channel id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<ChannelFeatures> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelFeaturesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID channelId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getChannelFeaturesRequestBuilder(channelId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -189,12 +314,14 @@ public ApiResponse getChannelFeaturesWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + ChannelFeatures responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -205,8 +332,8 @@ public ApiResponse getChannelFeaturesWithHttpInfo( } } - private HttpRequest.Builder getChannelFeaturesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID channelId) - throws ApiException { + private HttpRequest.Builder getChannelFeaturesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID channelId, + Map headers) throws ApiException { // verify the required parameter 'channelId' is set if (channelId == null) { throw new ApiException(400, "Missing the required parameter 'channelId' when calling getChannelFeatures"); @@ -226,6 +353,8 @@ private HttpRequest.Builder getChannelFeaturesRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -257,8 +386,39 @@ public BaseItemDtoQueryResult getChannelItems(@org.eclipse.jdt.annotation.Nullab @org.eclipse.jdt.annotation.NonNull List filters, @org.eclipse.jdt.annotation.NonNull List sortBy, @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getChannelItems(channelId, folderId, userId, startIndex, limit, sortOrder, filters, sortBy, fields, + null); + } + + /** + * Get channel items. + * + * @param channelId Channel Id. (required) + * @param folderId Optional. Folder Id. (optional) + * @param userId Optional. User Id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortOrder Optional. Sort Order - Ascending,Descending. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getChannelItems(@org.eclipse.jdt.annotation.Nullable UUID channelId, + @org.eclipse.jdt.annotation.NonNull UUID folderId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { ApiResponse localVarResponse = getChannelItemsWithHttpInfo(channelId, folderId, userId, - startIndex, limit, sortOrder, filters, sortBy, fields); + startIndex, limit, sortOrder, filters, sortBy, fields, headers); return localVarResponse.getData(); } @@ -288,8 +448,40 @@ public ApiResponse getChannelItemsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull List filters, @org.eclipse.jdt.annotation.NonNull List sortBy, @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getChannelItemsWithHttpInfo(channelId, folderId, userId, startIndex, limit, sortOrder, filters, sortBy, + fields, null); + } + + /** + * Get channel items. + * + * @param channelId Channel Id. (required) + * @param folderId Optional. Folder Id. (optional) + * @param userId Optional. User Id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortOrder Optional. Sort Order - Ascending,Descending. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelItemsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID channelId, @org.eclipse.jdt.annotation.NonNull UUID folderId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getChannelItemsRequestBuilder(channelId, folderId, userId, - startIndex, limit, sortOrder, filters, sortBy, fields); + startIndex, limit, sortOrder, filters, sortBy, fields, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -306,14 +498,14 @@ public ApiResponse getChannelItemsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -330,7 +522,8 @@ private HttpRequest.Builder getChannelItemsRequestBuilder(@org.eclipse.jdt.annot @org.eclipse.jdt.annotation.NonNull List sortOrder, @org.eclipse.jdt.annotation.NonNull List filters, @org.eclipse.jdt.annotation.NonNull List sortBy, - @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { // verify the required parameter 'channelId' is set if (channelId == null) { throw new ApiException(400, "Missing the required parameter 'channelId' when calling getChannelItems"); @@ -379,6 +572,8 @@ private HttpRequest.Builder getChannelItemsRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -403,8 +598,30 @@ public BaseItemDtoQueryResult getChannels(@org.eclipse.jdt.annotation.NonNull UU @org.eclipse.jdt.annotation.NonNull Boolean supportsLatestItems, @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaDeletion, @org.eclipse.jdt.annotation.NonNull Boolean isFavorite) throws ApiException { + return getChannels(userId, startIndex, limit, supportsLatestItems, supportsMediaDeletion, isFavorite, null); + } + + /** + * Gets available channels. + * + * @param userId User Id to filter by. Use System.Guid.Empty to not filter by user. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param supportsLatestItems Optional. Filter by channels that support getting latest items. (optional) + * @param supportsMediaDeletion Optional. Filter by channels that support media deletion. (optional) + * @param isFavorite Optional. Filter by channels that are favorite. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getChannels(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean supportsLatestItems, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaDeletion, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, Map headers) throws ApiException { ApiResponse localVarResponse = getChannelsWithHttpInfo(userId, startIndex, limit, - supportsLatestItems, supportsMediaDeletion, isFavorite); + supportsLatestItems, supportsMediaDeletion, isFavorite, headers); return localVarResponse.getData(); } @@ -426,8 +643,31 @@ public ApiResponse getChannelsWithHttpInfo(@org.eclipse. @org.eclipse.jdt.annotation.NonNull Boolean supportsLatestItems, @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaDeletion, @org.eclipse.jdt.annotation.NonNull Boolean isFavorite) throws ApiException { + return getChannelsWithHttpInfo(userId, startIndex, limit, supportsLatestItems, supportsMediaDeletion, + isFavorite, null); + } + + /** + * Gets available channels. + * + * @param userId User Id to filter by. Use System.Guid.Empty to not filter by user. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param supportsLatestItems Optional. Filter by channels that support getting latest items. (optional) + * @param supportsMediaDeletion Optional. Filter by channels that support media deletion. (optional) + * @param isFavorite Optional. Filter by channels that are favorite. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean supportsLatestItems, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaDeletion, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getChannelsRequestBuilder(userId, startIndex, limit, - supportsLatestItems, supportsMediaDeletion, isFavorite); + supportsLatestItems, supportsMediaDeletion, isFavorite, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -444,14 +684,14 @@ public ApiResponse getChannelsWithHttpInfo(@org.eclipse. } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -466,7 +706,7 @@ private HttpRequest.Builder getChannelsRequestBuilder(@org.eclipse.jdt.annotatio @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean supportsLatestItems, @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaDeletion, - @org.eclipse.jdt.annotation.NonNull Boolean isFavorite) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -506,6 +746,8 @@ private HttpRequest.Builder getChannelsRequestBuilder(@org.eclipse.jdt.annotatio if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -530,8 +772,31 @@ public BaseItemDtoQueryResult getLatestChannelItems(@org.eclipse.jdt.annotation. @org.eclipse.jdt.annotation.NonNull List filters, @org.eclipse.jdt.annotation.NonNull List fields, @org.eclipse.jdt.annotation.NonNull List channelIds) throws ApiException { + return getLatestChannelItems(userId, startIndex, limit, filters, fields, channelIds, null); + } + + /** + * Gets latest channel items. + * + * @param userId Optional. User Id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param channelIds Optional. Specify one or more channel id's, comma delimited. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getLatestChannelItems(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List channelIds, Map headers) + throws ApiException { ApiResponse localVarResponse = getLatestChannelItemsWithHttpInfo(userId, startIndex, - limit, filters, fields, channelIds); + limit, filters, fields, channelIds, headers); return localVarResponse.getData(); } @@ -554,8 +819,32 @@ public ApiResponse getLatestChannelItemsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull List filters, @org.eclipse.jdt.annotation.NonNull List fields, @org.eclipse.jdt.annotation.NonNull List channelIds) throws ApiException { + return getLatestChannelItemsWithHttpInfo(userId, startIndex, limit, filters, fields, channelIds, null); + } + + /** + * Gets latest channel items. + * + * @param userId Optional. User Id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param channelIds Optional. Specify one or more channel id's, comma delimited. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLatestChannelItemsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List channelIds, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getLatestChannelItemsRequestBuilder(userId, startIndex, limit, - filters, fields, channelIds); + filters, fields, channelIds, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -572,14 +861,14 @@ public ApiResponse getLatestChannelItemsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -594,7 +883,8 @@ private HttpRequest.Builder getLatestChannelItemsRequestBuilder(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull List filters, @org.eclipse.jdt.annotation.NonNull List fields, - @org.eclipse.jdt.annotation.NonNull List channelIds) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List channelIds, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -634,6 +924,8 @@ private HttpRequest.Builder getLatestChannelItemsRequestBuilder(@org.eclipse.jdt if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ClientLogApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ClientLogApi.java index 7435629ee392d..a0c90bd23cd3d 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ClientLogApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ClientLogApi.java @@ -20,6 +20,7 @@ import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; +import java.util.Map; import java.util.function.Consumer; import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; @@ -33,6 +34,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class ClientLogApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -68,6 +91,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Upload a document. * @@ -76,7 +149,20 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public ClientLogDocumentResponseDto logFile(@org.eclipse.jdt.annotation.NonNull File body) throws ApiException { - ApiResponse localVarResponse = logFileWithHttpInfo(body); + return logFile(body, null); + } + + /** + * Upload a document. + * + * @param body (optional) + * @param headers Optional headers to include in the request + * @return ClientLogDocumentResponseDto + * @throws ApiException if fails to make API call + */ + public ClientLogDocumentResponseDto logFile(@org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + ApiResponse localVarResponse = logFileWithHttpInfo(body, headers); return localVarResponse.getData(); } @@ -89,7 +175,20 @@ public ClientLogDocumentResponseDto logFile(@org.eclipse.jdt.annotation.NonNull */ public ApiResponse logFileWithHttpInfo(@org.eclipse.jdt.annotation.NonNull File body) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = logFileRequestBuilder(body); + return logFileWithHttpInfo(body, null); + } + + /** + * Upload a document. + * + * @param body (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<ClientLogDocumentResponseDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse logFileWithHttpInfo(@org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = logFileRequestBuilder(body, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -106,14 +205,15 @@ public ApiResponse logFileWithHttpInfo(@org.eclips } String responseBody = new String(localVarResponse.body().readAllBytes()); + ClientLogDocumentResponseDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -124,8 +224,8 @@ public ApiResponse logFileWithHttpInfo(@org.eclips } } - private HttpRequest.Builder logFileRequestBuilder(@org.eclipse.jdt.annotation.NonNull File body) - throws ApiException { + private HttpRequest.Builder logFileRequestBuilder(@org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -146,6 +246,8 @@ private HttpRequest.Builder logFileRequestBuilder(@org.eclipse.jdt.annotation.No if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/CollectionApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/CollectionApi.java index 7e06e09cea5af..e3af2aa8c6abb 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/CollectionApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/CollectionApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -37,6 +39,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class CollectionApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -72,6 +96,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Adds items to a collection. * @@ -81,7 +155,20 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public void addToCollection(@org.eclipse.jdt.annotation.Nullable UUID collectionId, @org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { - addToCollectionWithHttpInfo(collectionId, ids); + addToCollection(collectionId, ids, null); + } + + /** + * Adds items to a collection. + * + * @param collectionId The collection id. (required) + * @param ids Item ids, comma delimited. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void addToCollection(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids, Map headers) throws ApiException { + addToCollectionWithHttpInfo(collectionId, ids, headers); } /** @@ -94,7 +181,21 @@ public void addToCollection(@org.eclipse.jdt.annotation.Nullable UUID collection */ public ApiResponse addToCollectionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID collectionId, @org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = addToCollectionRequestBuilder(collectionId, ids); + return addToCollectionWithHttpInfo(collectionId, ids, null); + } + + /** + * Adds items to a collection. + * + * @param collectionId The collection id. (required) + * @param ids Item ids, comma delimited. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addToCollectionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addToCollectionRequestBuilder(collectionId, ids, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -122,7 +223,7 @@ public ApiResponse addToCollectionWithHttpInfo(@org.eclipse.jdt.annotation } private HttpRequest.Builder addToCollectionRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID collectionId, - @org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { + @org.eclipse.jdt.annotation.Nullable List ids, Map headers) throws ApiException { // verify the required parameter 'collectionId' is set if (collectionId == null) { throw new ApiException(400, "Missing the required parameter 'collectionId' when calling addToCollection"); @@ -160,6 +261,8 @@ private HttpRequest.Builder addToCollectionRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -179,8 +282,25 @@ private HttpRequest.Builder addToCollectionRequestBuilder(@org.eclipse.jdt.annot public CollectionCreationResult createCollection(@org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean isLocked) throws ApiException { + return createCollection(name, ids, parentId, isLocked, null); + } + + /** + * Creates a new collection. + * + * @param name The name of the collection. (optional) + * @param ids Item Ids to add to the collection. (optional) + * @param parentId Optional. Create the collection within a specific folder. (optional) + * @param isLocked Whether or not to lock the new collection. (optional, default to false) + * @param headers Optional headers to include in the request + * @return CollectionCreationResult + * @throws ApiException if fails to make API call + */ + public CollectionCreationResult createCollection(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, Map headers) throws ApiException { ApiResponse localVarResponse = createCollectionWithHttpInfo(name, ids, parentId, - isLocked); + isLocked, headers); return localVarResponse.getData(); } @@ -198,7 +318,26 @@ public ApiResponse createCollectionWithHttpInfo( @org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean isLocked) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = createCollectionRequestBuilder(name, ids, parentId, isLocked); + return createCollectionWithHttpInfo(name, ids, parentId, isLocked, null); + } + + /** + * Creates a new collection. + * + * @param name The name of the collection. (optional) + * @param ids Item Ids to add to the collection. (optional) + * @param parentId Optional. Create the collection within a specific folder. (optional) + * @param isLocked Whether or not to lock the new collection. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<CollectionCreationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse createCollectionWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createCollectionRequestBuilder(name, ids, parentId, isLocked, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -215,14 +354,14 @@ public ApiResponse createCollectionWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + CollectionCreationResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -235,7 +374,7 @@ public ApiResponse createCollectionWithHttpInfo( private HttpRequest.Builder createCollectionRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID parentId, - @org.eclipse.jdt.annotation.NonNull Boolean isLocked) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -271,6 +410,8 @@ private HttpRequest.Builder createCollectionRequestBuilder(@org.eclipse.jdt.anno if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -286,7 +427,20 @@ private HttpRequest.Builder createCollectionRequestBuilder(@org.eclipse.jdt.anno */ public void removeFromCollection(@org.eclipse.jdt.annotation.Nullable UUID collectionId, @org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { - removeFromCollectionWithHttpInfo(collectionId, ids); + removeFromCollection(collectionId, ids, null); + } + + /** + * Removes items from a collection. + * + * @param collectionId The collection id. (required) + * @param ids Item ids, comma delimited. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void removeFromCollection(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids, Map headers) throws ApiException { + removeFromCollectionWithHttpInfo(collectionId, ids, headers); } /** @@ -299,7 +453,21 @@ public void removeFromCollection(@org.eclipse.jdt.annotation.Nullable UUID colle */ public ApiResponse removeFromCollectionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID collectionId, @org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = removeFromCollectionRequestBuilder(collectionId, ids); + return removeFromCollectionWithHttpInfo(collectionId, ids, null); + } + + /** + * Removes items from a collection. + * + * @param collectionId The collection id. (required) + * @param ids Item ids, comma delimited. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeFromCollectionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeFromCollectionRequestBuilder(collectionId, ids, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -327,8 +495,8 @@ public ApiResponse removeFromCollectionWithHttpInfo(@org.eclipse.jdt.annot } private HttpRequest.Builder removeFromCollectionRequestBuilder( - @org.eclipse.jdt.annotation.Nullable UUID collectionId, @org.eclipse.jdt.annotation.Nullable List ids) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable UUID collectionId, @org.eclipse.jdt.annotation.Nullable List ids, + Map headers) throws ApiException { // verify the required parameter 'collectionId' is set if (collectionId == null) { throw new ApiException(400, @@ -367,6 +535,8 @@ private HttpRequest.Builder removeFromCollectionRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ConfigurationApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ConfigurationApi.java index cd66c43921765..ac867773d2d81 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ConfigurationApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ConfigurationApi.java @@ -20,6 +20,7 @@ import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; +import java.util.Map; import java.util.function.Consumer; import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; @@ -34,6 +35,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class ConfigurationApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -69,6 +92,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets application configuration. * @@ -76,7 +149,18 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public ServerConfiguration getConfiguration() throws ApiException { - ApiResponse localVarResponse = getConfigurationWithHttpInfo(); + return getConfiguration(null); + } + + /** + * Gets application configuration. + * + * @param headers Optional headers to include in the request + * @return ServerConfiguration + * @throws ApiException if fails to make API call + */ + public ServerConfiguration getConfiguration(Map headers) throws ApiException { + ApiResponse localVarResponse = getConfigurationWithHttpInfo(headers); return localVarResponse.getData(); } @@ -87,7 +171,19 @@ public ServerConfiguration getConfiguration() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getConfigurationWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getConfigurationRequestBuilder(); + return getConfigurationWithHttpInfo(null); + } + + /** + * Gets application configuration. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<ServerConfiguration> + * @throws ApiException if fails to make API call + */ + public ApiResponse getConfigurationWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getConfigurationRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -104,14 +200,14 @@ public ApiResponse getConfigurationWithHttpInfo() throws Ap } String responseBody = new String(localVarResponse.body().readAllBytes()); + ServerConfiguration responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -122,7 +218,7 @@ public ApiResponse getConfigurationWithHttpInfo() throws Ap } } - private HttpRequest.Builder getConfigurationRequestBuilder() throws ApiException { + private HttpRequest.Builder getConfigurationRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -137,6 +233,8 @@ private HttpRequest.Builder getConfigurationRequestBuilder() throws ApiException if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -150,7 +248,18 @@ private HttpRequest.Builder getConfigurationRequestBuilder() throws ApiException * @throws ApiException if fails to make API call */ public MetadataOptions getDefaultMetadataOptions() throws ApiException { - ApiResponse localVarResponse = getDefaultMetadataOptionsWithHttpInfo(); + return getDefaultMetadataOptions(null); + } + + /** + * Gets a default MetadataOptions object. + * + * @param headers Optional headers to include in the request + * @return MetadataOptions + * @throws ApiException if fails to make API call + */ + public MetadataOptions getDefaultMetadataOptions(Map headers) throws ApiException { + ApiResponse localVarResponse = getDefaultMetadataOptionsWithHttpInfo(headers); return localVarResponse.getData(); } @@ -161,7 +270,19 @@ public MetadataOptions getDefaultMetadataOptions() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getDefaultMetadataOptionsWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getDefaultMetadataOptionsRequestBuilder(); + return getDefaultMetadataOptionsWithHttpInfo(null); + } + + /** + * Gets a default MetadataOptions object. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<MetadataOptions> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultMetadataOptionsWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDefaultMetadataOptionsRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -178,12 +299,14 @@ public ApiResponse getDefaultMetadataOptionsWithHttpInfo() thro } String responseBody = new String(localVarResponse.body().readAllBytes()); + MetadataOptions responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -194,7 +317,8 @@ public ApiResponse getDefaultMetadataOptionsWithHttpInfo() thro } } - private HttpRequest.Builder getDefaultMetadataOptionsRequestBuilder() throws ApiException { + private HttpRequest.Builder getDefaultMetadataOptionsRequestBuilder(Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -209,6 +333,8 @@ private HttpRequest.Builder getDefaultMetadataOptionsRequestBuilder() throws Api if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -223,7 +349,20 @@ private HttpRequest.Builder getDefaultMetadataOptionsRequestBuilder() throws Api * @throws ApiException if fails to make API call */ public File getNamedConfiguration(@org.eclipse.jdt.annotation.Nullable String key) throws ApiException { - ApiResponse localVarResponse = getNamedConfigurationWithHttpInfo(key); + return getNamedConfiguration(key, null); + } + + /** + * Gets a named configuration. + * + * @param key Configuration key. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getNamedConfiguration(@org.eclipse.jdt.annotation.Nullable String key, Map headers) + throws ApiException { + ApiResponse localVarResponse = getNamedConfigurationWithHttpInfo(key, headers); return localVarResponse.getData(); } @@ -236,7 +375,20 @@ public File getNamedConfiguration(@org.eclipse.jdt.annotation.Nullable String ke */ public ApiResponse getNamedConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String key) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getNamedConfigurationRequestBuilder(key); + return getNamedConfigurationWithHttpInfo(key, null); + } + + /** + * Gets a named configuration. + * + * @param key Configuration key. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getNamedConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String key, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getNamedConfigurationRequestBuilder(key, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -251,13 +403,13 @@ public ApiResponse getNamedConfigurationWithHttpInfo(@org.eclipse.jdt.anno return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -268,8 +420,8 @@ public ApiResponse getNamedConfigurationWithHttpInfo(@org.eclipse.jdt.anno } } - private HttpRequest.Builder getNamedConfigurationRequestBuilder(@org.eclipse.jdt.annotation.Nullable String key) - throws ApiException { + private HttpRequest.Builder getNamedConfigurationRequestBuilder(@org.eclipse.jdt.annotation.Nullable String key, + Map headers) throws ApiException { // verify the required parameter 'key' is set if (key == null) { throw new ApiException(400, "Missing the required parameter 'key' when calling getNamedConfiguration"); @@ -287,6 +439,8 @@ private HttpRequest.Builder getNamedConfigurationRequestBuilder(@org.eclipse.jdt if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -301,7 +455,19 @@ private HttpRequest.Builder getNamedConfigurationRequestBuilder(@org.eclipse.jdt */ public void updateConfiguration(@org.eclipse.jdt.annotation.Nullable ServerConfiguration serverConfiguration) throws ApiException { - updateConfigurationWithHttpInfo(serverConfiguration); + updateConfiguration(serverConfiguration, null); + } + + /** + * Updates application configuration. + * + * @param serverConfiguration Configuration. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateConfiguration(@org.eclipse.jdt.annotation.Nullable ServerConfiguration serverConfiguration, + Map headers) throws ApiException { + updateConfigurationWithHttpInfo(serverConfiguration, headers); } /** @@ -313,7 +479,21 @@ public void updateConfiguration(@org.eclipse.jdt.annotation.Nullable ServerConfi */ public ApiResponse updateConfigurationWithHttpInfo( @org.eclipse.jdt.annotation.Nullable ServerConfiguration serverConfiguration) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateConfigurationRequestBuilder(serverConfiguration); + return updateConfigurationWithHttpInfo(serverConfiguration, null); + } + + /** + * Updates application configuration. + * + * @param serverConfiguration Configuration. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateConfigurationWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ServerConfiguration serverConfiguration, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateConfigurationRequestBuilder(serverConfiguration, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -341,7 +521,8 @@ public ApiResponse updateConfigurationWithHttpInfo( } private HttpRequest.Builder updateConfigurationRequestBuilder( - @org.eclipse.jdt.annotation.Nullable ServerConfiguration serverConfiguration) throws ApiException { + @org.eclipse.jdt.annotation.Nullable ServerConfiguration serverConfiguration, Map headers) + throws ApiException { // verify the required parameter 'serverConfiguration' is set if (serverConfiguration == null) { throw new ApiException(400, @@ -366,6 +547,8 @@ private HttpRequest.Builder updateConfigurationRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -381,7 +564,20 @@ private HttpRequest.Builder updateConfigurationRequestBuilder( */ public void updateNamedConfiguration(@org.eclipse.jdt.annotation.Nullable String key, @org.eclipse.jdt.annotation.Nullable Object body) throws ApiException { - updateNamedConfigurationWithHttpInfo(key, body); + updateNamedConfiguration(key, body, null); + } + + /** + * Updates named configuration. + * + * @param key Configuration key. (required) + * @param body Configuration. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateNamedConfiguration(@org.eclipse.jdt.annotation.Nullable String key, + @org.eclipse.jdt.annotation.Nullable Object body, Map headers) throws ApiException { + updateNamedConfigurationWithHttpInfo(key, body, headers); } /** @@ -394,7 +590,21 @@ public void updateNamedConfiguration(@org.eclipse.jdt.annotation.Nullable String */ public ApiResponse updateNamedConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String key, @org.eclipse.jdt.annotation.Nullable Object body) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateNamedConfigurationRequestBuilder(key, body); + return updateNamedConfigurationWithHttpInfo(key, body, null); + } + + /** + * Updates named configuration. + * + * @param key Configuration key. (required) + * @param body Configuration. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateNamedConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String key, + @org.eclipse.jdt.annotation.Nullable Object body, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateNamedConfigurationRequestBuilder(key, body, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -422,7 +632,7 @@ public ApiResponse updateNamedConfigurationWithHttpInfo(@org.eclipse.jdt.a } private HttpRequest.Builder updateNamedConfigurationRequestBuilder(@org.eclipse.jdt.annotation.Nullable String key, - @org.eclipse.jdt.annotation.Nullable Object body) throws ApiException { + @org.eclipse.jdt.annotation.Nullable Object body, Map headers) throws ApiException { // verify the required parameter 'key' is set if (key == null) { throw new ApiException(400, "Missing the required parameter 'key' when calling updateNamedConfiguration"); @@ -450,6 +660,8 @@ private HttpRequest.Builder updateNamedConfigurationRequestBuilder(@org.eclipse. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DashboardApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DashboardApi.java index 2cc90f62913f7..59a38343551aa 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DashboardApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DashboardApi.java @@ -22,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.function.Consumer; @@ -37,6 +38,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class DashboardApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -72,6 +95,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets the configuration pages. * @@ -81,7 +154,22 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public List getConfigurationPages( @org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu) throws ApiException { - ApiResponse> localVarResponse = getConfigurationPagesWithHttpInfo(enableInMainMenu); + return getConfigurationPages(enableInMainMenu, null); + } + + /** + * Gets the configuration pages. + * + * @param enableInMainMenu Whether to enable in the main menu. (optional) + * @param headers Optional headers to include in the request + * @return List<ConfigurationPageInfo> + * @throws ApiException if fails to make API call + */ + public List getConfigurationPages( + @org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu, Map headers) + throws ApiException { + ApiResponse> localVarResponse = getConfigurationPagesWithHttpInfo(enableInMainMenu, + headers); return localVarResponse.getData(); } @@ -94,7 +182,21 @@ public List getConfigurationPages( */ public ApiResponse> getConfigurationPagesWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getConfigurationPagesRequestBuilder(enableInMainMenu); + return getConfigurationPagesWithHttpInfo(enableInMainMenu, null); + } + + /** + * Gets the configuration pages. + * + * @param enableInMainMenu Whether to enable in the main menu. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<ConfigurationPageInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getConfigurationPagesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getConfigurationPagesRequestBuilder(enableInMainMenu, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -111,14 +213,15 @@ public ApiResponse> getConfigurationPagesWithHttpInf } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -130,7 +233,8 @@ public ApiResponse> getConfigurationPagesWithHttpInf } private HttpRequest.Builder getConfigurationPagesRequestBuilder( - @org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -160,6 +264,8 @@ private HttpRequest.Builder getConfigurationPagesRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -174,7 +280,20 @@ private HttpRequest.Builder getConfigurationPagesRequestBuilder( * @throws ApiException if fails to make API call */ public File getDashboardConfigurationPage(@org.eclipse.jdt.annotation.NonNull String name) throws ApiException { - ApiResponse localVarResponse = getDashboardConfigurationPageWithHttpInfo(name); + return getDashboardConfigurationPage(name, null); + } + + /** + * Gets a dashboard configuration page. + * + * @param name The name of the page. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getDashboardConfigurationPage(@org.eclipse.jdt.annotation.NonNull String name, + Map headers) throws ApiException { + ApiResponse localVarResponse = getDashboardConfigurationPageWithHttpInfo(name, headers); return localVarResponse.getData(); } @@ -187,7 +306,20 @@ public File getDashboardConfigurationPage(@org.eclipse.jdt.annotation.NonNull St */ public ApiResponse getDashboardConfigurationPageWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getDashboardConfigurationPageRequestBuilder(name); + return getDashboardConfigurationPageWithHttpInfo(name, null); + } + + /** + * Gets a dashboard configuration page. + * + * @param name The name of the page. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDashboardConfigurationPageWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDashboardConfigurationPageRequestBuilder(name, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -202,13 +334,13 @@ public ApiResponse getDashboardConfigurationPageWithHttpInfo(@org.eclipse. return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -220,7 +352,7 @@ public ApiResponse getDashboardConfigurationPageWithHttpInfo(@org.eclipse. } private HttpRequest.Builder getDashboardConfigurationPageRequestBuilder( - @org.eclipse.jdt.annotation.NonNull String name) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String name, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -250,6 +382,8 @@ private HttpRequest.Builder getDashboardConfigurationPageRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DevicesApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DevicesApi.java index 4dde001c6dad2..9fc20e78bf6fe 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DevicesApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DevicesApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -39,6 +41,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class DevicesApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -74,6 +98,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Deletes a device. * @@ -81,7 +155,19 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public void deleteDevice(@org.eclipse.jdt.annotation.Nullable String id) throws ApiException { - deleteDeviceWithHttpInfo(id); + deleteDevice(id, null); + } + + /** + * Deletes a device. + * + * @param id Device Id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteDevice(@org.eclipse.jdt.annotation.Nullable String id, Map headers) + throws ApiException { + deleteDeviceWithHttpInfo(id, headers); } /** @@ -93,7 +179,20 @@ public void deleteDevice(@org.eclipse.jdt.annotation.Nullable String id) throws */ public ApiResponse deleteDeviceWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteDeviceRequestBuilder(id); + return deleteDeviceWithHttpInfo(id, null); + } + + /** + * Deletes a device. + * + * @param id Device Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteDeviceWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteDeviceRequestBuilder(id, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -120,8 +219,8 @@ public ApiResponse deleteDeviceWithHttpInfo(@org.eclipse.jdt.annotation.Nu } } - private HttpRequest.Builder deleteDeviceRequestBuilder(@org.eclipse.jdt.annotation.Nullable String id) - throws ApiException { + private HttpRequest.Builder deleteDeviceRequestBuilder(@org.eclipse.jdt.annotation.Nullable String id, + Map headers) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling deleteDevice"); @@ -155,6 +254,8 @@ private HttpRequest.Builder deleteDeviceRequestBuilder(@org.eclipse.jdt.annotati if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -169,7 +270,20 @@ private HttpRequest.Builder deleteDeviceRequestBuilder(@org.eclipse.jdt.annotati * @throws ApiException if fails to make API call */ public DeviceInfoDto getDeviceInfo(@org.eclipse.jdt.annotation.Nullable String id) throws ApiException { - ApiResponse localVarResponse = getDeviceInfoWithHttpInfo(id); + return getDeviceInfo(id, null); + } + + /** + * Get info for a device. + * + * @param id Device Id. (required) + * @param headers Optional headers to include in the request + * @return DeviceInfoDto + * @throws ApiException if fails to make API call + */ + public DeviceInfoDto getDeviceInfo(@org.eclipse.jdt.annotation.Nullable String id, Map headers) + throws ApiException { + ApiResponse localVarResponse = getDeviceInfoWithHttpInfo(id, headers); return localVarResponse.getData(); } @@ -182,7 +296,20 @@ public DeviceInfoDto getDeviceInfo(@org.eclipse.jdt.annotation.Nullable String i */ public ApiResponse getDeviceInfoWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getDeviceInfoRequestBuilder(id); + return getDeviceInfoWithHttpInfo(id, null); + } + + /** + * Get info for a device. + * + * @param id Device Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<DeviceInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDeviceInfoWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDeviceInfoRequestBuilder(id, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -199,12 +326,14 @@ public ApiResponse getDeviceInfoWithHttpInfo(@org.eclipse.jdt.ann } String responseBody = new String(localVarResponse.body().readAllBytes()); + DeviceInfoDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -215,8 +344,8 @@ public ApiResponse getDeviceInfoWithHttpInfo(@org.eclipse.jdt.ann } } - private HttpRequest.Builder getDeviceInfoRequestBuilder(@org.eclipse.jdt.annotation.Nullable String id) - throws ApiException { + private HttpRequest.Builder getDeviceInfoRequestBuilder(@org.eclipse.jdt.annotation.Nullable String id, + Map headers) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling getDeviceInfo"); @@ -250,6 +379,8 @@ private HttpRequest.Builder getDeviceInfoRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -264,7 +395,20 @@ private HttpRequest.Builder getDeviceInfoRequestBuilder(@org.eclipse.jdt.annotat * @throws ApiException if fails to make API call */ public DeviceOptionsDto getDeviceOptions(@org.eclipse.jdt.annotation.Nullable String id) throws ApiException { - ApiResponse localVarResponse = getDeviceOptionsWithHttpInfo(id); + return getDeviceOptions(id, null); + } + + /** + * Get options for a device. + * + * @param id Device Id. (required) + * @param headers Optional headers to include in the request + * @return DeviceOptionsDto + * @throws ApiException if fails to make API call + */ + public DeviceOptionsDto getDeviceOptions(@org.eclipse.jdt.annotation.Nullable String id, + Map headers) throws ApiException { + ApiResponse localVarResponse = getDeviceOptionsWithHttpInfo(id, headers); return localVarResponse.getData(); } @@ -277,7 +421,20 @@ public DeviceOptionsDto getDeviceOptions(@org.eclipse.jdt.annotation.Nullable St */ public ApiResponse getDeviceOptionsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getDeviceOptionsRequestBuilder(id); + return getDeviceOptionsWithHttpInfo(id, null); + } + + /** + * Get options for a device. + * + * @param id Device Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<DeviceOptionsDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDeviceOptionsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDeviceOptionsRequestBuilder(id, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -294,12 +451,14 @@ public ApiResponse getDeviceOptionsWithHttpInfo(@org.eclipse.j } String responseBody = new String(localVarResponse.body().readAllBytes()); + DeviceOptionsDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -310,8 +469,8 @@ public ApiResponse getDeviceOptionsWithHttpInfo(@org.eclipse.j } } - private HttpRequest.Builder getDeviceOptionsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String id) - throws ApiException { + private HttpRequest.Builder getDeviceOptionsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String id, + Map headers) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling getDeviceOptions"); @@ -345,6 +504,8 @@ private HttpRequest.Builder getDeviceOptionsRequestBuilder(@org.eclipse.jdt.anno if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -359,7 +520,20 @@ private HttpRequest.Builder getDeviceOptionsRequestBuilder(@org.eclipse.jdt.anno * @throws ApiException if fails to make API call */ public DeviceInfoDtoQueryResult getDevices(@org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getDevicesWithHttpInfo(userId); + return getDevices(userId, null); + } + + /** + * Get Devices. + * + * @param userId Gets or sets the user identifier. (optional) + * @param headers Optional headers to include in the request + * @return DeviceInfoDtoQueryResult + * @throws ApiException if fails to make API call + */ + public DeviceInfoDtoQueryResult getDevices(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getDevicesWithHttpInfo(userId, headers); return localVarResponse.getData(); } @@ -372,7 +546,20 @@ public DeviceInfoDtoQueryResult getDevices(@org.eclipse.jdt.annotation.NonNull U */ public ApiResponse getDevicesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getDevicesRequestBuilder(userId); + return getDevicesWithHttpInfo(userId, null); + } + + /** + * Get Devices. + * + * @param userId Gets or sets the user identifier. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<DeviceInfoDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDevicesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDevicesRequestBuilder(userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -389,14 +576,14 @@ public ApiResponse getDevicesWithHttpInfo(@org.eclipse } String responseBody = new String(localVarResponse.body().readAllBytes()); + DeviceInfoDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -407,8 +594,8 @@ public ApiResponse getDevicesWithHttpInfo(@org.eclipse } } - private HttpRequest.Builder getDevicesRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId) - throws ApiException { + private HttpRequest.Builder getDevicesRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -438,6 +625,8 @@ private HttpRequest.Builder getDevicesRequestBuilder(@org.eclipse.jdt.annotation if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -453,7 +642,21 @@ private HttpRequest.Builder getDevicesRequestBuilder(@org.eclipse.jdt.annotation */ public void updateDeviceOptions(@org.eclipse.jdt.annotation.Nullable String id, @org.eclipse.jdt.annotation.Nullable DeviceOptionsDto deviceOptionsDto) throws ApiException { - updateDeviceOptionsWithHttpInfo(id, deviceOptionsDto); + updateDeviceOptions(id, deviceOptionsDto, null); + } + + /** + * Update device options. + * + * @param id Device Id. (required) + * @param deviceOptionsDto Device Options. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateDeviceOptions(@org.eclipse.jdt.annotation.Nullable String id, + @org.eclipse.jdt.annotation.Nullable DeviceOptionsDto deviceOptionsDto, Map headers) + throws ApiException { + updateDeviceOptionsWithHttpInfo(id, deviceOptionsDto, headers); } /** @@ -466,7 +669,22 @@ public void updateDeviceOptions(@org.eclipse.jdt.annotation.Nullable String id, */ public ApiResponse updateDeviceOptionsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id, @org.eclipse.jdt.annotation.Nullable DeviceOptionsDto deviceOptionsDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateDeviceOptionsRequestBuilder(id, deviceOptionsDto); + return updateDeviceOptionsWithHttpInfo(id, deviceOptionsDto, null); + } + + /** + * Update device options. + * + * @param id Device Id. (required) + * @param deviceOptionsDto Device Options. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateDeviceOptionsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id, + @org.eclipse.jdt.annotation.Nullable DeviceOptionsDto deviceOptionsDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateDeviceOptionsRequestBuilder(id, deviceOptionsDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -494,7 +712,8 @@ public ApiResponse updateDeviceOptionsWithHttpInfo(@org.eclipse.jdt.annota } private HttpRequest.Builder updateDeviceOptionsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String id, - @org.eclipse.jdt.annotation.Nullable DeviceOptionsDto deviceOptionsDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable DeviceOptionsDto deviceOptionsDto, Map headers) + throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling updateDeviceOptions"); @@ -538,6 +757,8 @@ private HttpRequest.Builder updateDeviceOptionsRequestBuilder(@org.eclipse.jdt.a if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DisplayPreferencesApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DisplayPreferencesApi.java index 249c92ee0e6fe..06b286e2ca7f5 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DisplayPreferencesApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DisplayPreferencesApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -37,6 +39,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class DisplayPreferencesApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -72,6 +96,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Get Display Preferences. * @@ -84,8 +158,24 @@ private String formatExceptionMessage(String operationId, int statusCode, String public DisplayPreferencesDto getDisplayPreferences(@org.eclipse.jdt.annotation.Nullable String displayPreferencesId, @org.eclipse.jdt.annotation.Nullable String client, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getDisplayPreferences(displayPreferencesId, client, userId, null); + } + + /** + * Get Display Preferences. + * + * @param displayPreferencesId Display preferences id. (required) + * @param client Client. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return DisplayPreferencesDto + * @throws ApiException if fails to make API call + */ + public DisplayPreferencesDto getDisplayPreferences(@org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable String client, @org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { ApiResponse localVarResponse = getDisplayPreferencesWithHttpInfo(displayPreferencesId, - client, userId); + client, userId, headers); return localVarResponse.getData(); } @@ -102,8 +192,25 @@ public ApiResponse getDisplayPreferencesWithHttpInfo( @org.eclipse.jdt.annotation.Nullable String displayPreferencesId, @org.eclipse.jdt.annotation.Nullable String client, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getDisplayPreferencesWithHttpInfo(displayPreferencesId, client, userId, null); + } + + /** + * Get Display Preferences. + * + * @param displayPreferencesId Display preferences id. (required) + * @param client Client. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<DisplayPreferencesDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDisplayPreferencesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable String client, @org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getDisplayPreferencesRequestBuilder(displayPreferencesId, client, - userId); + userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -120,14 +227,14 @@ public ApiResponse getDisplayPreferencesWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + DisplayPreferencesDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -140,8 +247,8 @@ public ApiResponse getDisplayPreferencesWithHttpInfo( private HttpRequest.Builder getDisplayPreferencesRequestBuilder( @org.eclipse.jdt.annotation.Nullable String displayPreferencesId, - @org.eclipse.jdt.annotation.Nullable String client, @org.eclipse.jdt.annotation.NonNull UUID userId) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable String client, @org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { // verify the required parameter 'displayPreferencesId' is set if (displayPreferencesId == null) { throw new ApiException(400, @@ -183,6 +290,8 @@ private HttpRequest.Builder getDisplayPreferencesRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -202,7 +311,24 @@ public void updateDisplayPreferences(@org.eclipse.jdt.annotation.Nullable String @org.eclipse.jdt.annotation.Nullable String client, @org.eclipse.jdt.annotation.Nullable DisplayPreferencesDto displayPreferencesDto, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - updateDisplayPreferencesWithHttpInfo(displayPreferencesId, client, displayPreferencesDto, userId); + updateDisplayPreferences(displayPreferencesId, client, displayPreferencesDto, userId, null); + } + + /** + * Update Display Preferences. + * + * @param displayPreferencesId Display preferences id. (required) + * @param client Client. (required) + * @param displayPreferencesDto New Display Preferences object. (required) + * @param userId User Id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateDisplayPreferences(@org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable String client, + @org.eclipse.jdt.annotation.Nullable DisplayPreferencesDto displayPreferencesDto, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + updateDisplayPreferencesWithHttpInfo(displayPreferencesId, client, displayPreferencesDto, userId, headers); } /** @@ -220,8 +346,27 @@ public ApiResponse updateDisplayPreferencesWithHttpInfo( @org.eclipse.jdt.annotation.Nullable String client, @org.eclipse.jdt.annotation.Nullable DisplayPreferencesDto displayPreferencesDto, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return updateDisplayPreferencesWithHttpInfo(displayPreferencesId, client, displayPreferencesDto, userId, null); + } + + /** + * Update Display Preferences. + * + * @param displayPreferencesId Display preferences id. (required) + * @param client Client. (required) + * @param displayPreferencesDto New Display Preferences object. (required) + * @param userId User Id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateDisplayPreferencesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable String client, + @org.eclipse.jdt.annotation.Nullable DisplayPreferencesDto displayPreferencesDto, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = updateDisplayPreferencesRequestBuilder(displayPreferencesId, - client, displayPreferencesDto, userId); + client, displayPreferencesDto, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -252,7 +397,7 @@ private HttpRequest.Builder updateDisplayPreferencesRequestBuilder( @org.eclipse.jdt.annotation.Nullable String displayPreferencesId, @org.eclipse.jdt.annotation.Nullable String client, @org.eclipse.jdt.annotation.Nullable DisplayPreferencesDto displayPreferencesDto, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'displayPreferencesId' is set if (displayPreferencesId == null) { throw new ApiException(400, @@ -305,6 +450,8 @@ private HttpRequest.Builder updateDisplayPreferencesRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DynamicHlsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DynamicHlsApi.java index 3993fb2c6aec2..c00aef3d5860f 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DynamicHlsApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/DynamicHlsApi.java @@ -35,11 +35,32 @@ import org.openhab.binding.jellyfin.internal.api.generated.current.model.EncodingContext; import org.openhab.binding.jellyfin.internal.api.generated.current.model.SubtitleDeliveryMethod; -import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class DynamicHlsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -75,6 +96,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets a video stream using HTTP live streaming. * @@ -197,6 +268,141 @@ public File getHlsAudioSegment(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + return getHlsAudioSegment(itemId, playlistId, segmentId, container, runtimeTicks, actualSegmentLengthTicks, + _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, + audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, enableAudioVbrEncoding, null); + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param runtimeTicks The position of the requested segment in ticks. (required) + * @param actualSegmentLengthTicks The length of the requested segment in ticks. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsAudioSegment(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { ApiResponse localVarResponse = getHlsAudioSegmentWithHttpInfo(itemId, playlistId, segmentId, container, runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, @@ -206,7 +412,7 @@ public File getHlsAudioSegment(@org.eclipse.jdt.annotation.Nullable UUID itemId, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, - enableAudioVbrEncoding); + enableAudioVbrEncoding, headers); return localVarResponse.getData(); } @@ -332,48 +538,93 @@ public ApiResponse getHlsAudioSegmentWithHttpInfo(@org.eclipse.jdt.annotat @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getHlsAudioSegmentRequestBuilder(itemId, playlistId, segmentId, - container, runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, - segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + return getHlsAudioSegmentWithHttpInfo(itemId, playlistId, segmentId, container, runtimeTicks, + actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, + segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, - enableAudioVbrEncoding); - try { - HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode() / 100 != 2) { - throw getApiException("getHlsAudioSegment", localVarResponse); - } - if (localVarResponse.body() == null) { - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); - } - - String responseBody = new String(localVarResponse.body().readAllBytes()); - localVarResponse.body().close(); - - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } + enableAudioVbrEncoding, null); } - private HttpRequest.Builder getHlsAudioSegmentRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param runtimeTicks The position of the requested segment in ticks. (required) + * @param actualSegmentLengthTicks The length of the requested segment in ticks. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsAudioSegmentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String playlistId, @org.eclipse.jdt.annotation.Nullable Integer segmentId, @org.eclipse.jdt.annotation.Nullable String container, @@ -421,7 +672,99 @@ private HttpRequest.Builder getHlsAudioSegmentRequestBuilder(@org.eclipse.jdt.an @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsAudioSegmentRequestBuilder(itemId, playlistId, segmentId, + container, runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getHlsAudioSegment", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getHlsAudioSegmentRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getHlsAudioSegment"); @@ -581,6 +924,8 @@ private HttpRequest.Builder getHlsAudioSegmentRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -713,17 +1058,15 @@ public File getHlsVideoSegment(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { - ApiResponse localVarResponse = getHlsVideoSegmentWithHttpInfo(itemId, playlistId, segmentId, container, - runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, - segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, - allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, - audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, - startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, - maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, - transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, - subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, - enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding); - return localVarResponse.getData(); + return getHlsVideoSegment(itemId, playlistId, segmentId, container, runtimeTicks, actualSegmentLengthTicks, + _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding, null); } /** @@ -799,10 +1142,11 @@ public File getHlsVideoSegment(@org.eclipse.jdt.annotation.Nullable UUID itemId, * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, * default to false) - * @return ApiResponse<File> + * @param headers Optional headers to include in the request + * @return File * @throws ApiException if fails to make API call */ - public ApiResponse getHlsVideoSegmentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + public File getHlsVideoSegment(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String playlistId, @org.eclipse.jdt.annotation.Nullable Integer segmentId, @org.eclipse.jdt.annotation.Nullable String container, @@ -851,9 +1195,10 @@ public ApiResponse getHlsVideoSegmentWithHttpInfo(@org.eclipse.jdt.annotat @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, - @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getHlsVideoSegmentRequestBuilder(itemId, playlistId, segmentId, - container, runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + Map headers) throws ApiException { + ApiResponse localVarResponse = getHlsVideoSegmentWithHttpInfo(itemId, playlistId, segmentId, container, + runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, @@ -861,39 +1206,87 @@ public ApiResponse getHlsVideoSegmentWithHttpInfo(@org.eclipse.jdt.annotat maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, - enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding); - try { - HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode() / 100 != 2) { - throw getApiException("getHlsVideoSegment", localVarResponse); - } - if (localVarResponse.body() == null) { - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); - } - - String responseBody = new String(localVarResponse.body().readAllBytes()); - localVarResponse.body().close(); - - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } + enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding, headers); + return localVarResponse.getData(); } - private HttpRequest.Builder getHlsVideoSegmentRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param runtimeTicks The position of the requested segment in ticks. (required) + * @param actualSegmentLengthTicks The length of the requested segment in ticks. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The desired segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsVideoSegmentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String playlistId, @org.eclipse.jdt.annotation.Nullable Integer segmentId, @org.eclipse.jdt.annotation.Nullable String container, @@ -943,42 +1336,274 @@ private HttpRequest.Builder getHlsVideoSegmentRequestBuilder(@org.eclipse.jdt.an @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { - // verify the required parameter 'itemId' is set - if (itemId == null) { - throw new ApiException(400, "Missing the required parameter 'itemId' when calling getHlsVideoSegment"); - } - // verify the required parameter 'playlistId' is set - if (playlistId == null) { - throw new ApiException(400, "Missing the required parameter 'playlistId' when calling getHlsVideoSegment"); - } - // verify the required parameter 'segmentId' is set - if (segmentId == null) { - throw new ApiException(400, "Missing the required parameter 'segmentId' when calling getHlsVideoSegment"); - } - // verify the required parameter 'container' is set - if (container == null) { - throw new ApiException(400, "Missing the required parameter 'container' when calling getHlsVideoSegment"); - } - // verify the required parameter 'runtimeTicks' is set - if (runtimeTicks == null) { - throw new ApiException(400, - "Missing the required parameter 'runtimeTicks' when calling getHlsVideoSegment"); - } - // verify the required parameter 'actualSegmentLengthTicks' is set - if (actualSegmentLengthTicks == null) { - throw new ApiException(400, - "Missing the required parameter 'actualSegmentLengthTicks' when calling getHlsVideoSegment"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/Videos/{itemId}/hls1/{playlistId}/{segmentId}.{container}" - .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) - .replace("{playlistId}", ApiClient.urlEncode(playlistId.toString())) - .replace("{segmentId}", ApiClient.urlEncode(segmentId.toString())) - .replace("{container}", ApiClient.urlEncode(container.toString())); + return getHlsVideoSegmentWithHttpInfo(itemId, playlistId, segmentId, container, runtimeTicks, + actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, + segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding, null); + } - List localVarQueryParams = new ArrayList<>(); + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param runtimeTicks The position of the requested segment in ticks. (required) + * @param actualSegmentLengthTicks The length of the requested segment in ticks. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The desired segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsVideoSegmentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsVideoSegmentRequestBuilder(itemId, playlistId, segmentId, + container, runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getHlsVideoSegment", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getHlsVideoSegmentRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getHlsVideoSegment"); + } + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling getHlsVideoSegment"); + } + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException(400, "Missing the required parameter 'segmentId' when calling getHlsVideoSegment"); + } + // verify the required parameter 'container' is set + if (container == null) { + throw new ApiException(400, "Missing the required parameter 'container' when calling getHlsVideoSegment"); + } + // verify the required parameter 'runtimeTicks' is set + if (runtimeTicks == null) { + throw new ApiException(400, + "Missing the required parameter 'runtimeTicks' when calling getHlsVideoSegment"); + } + // verify the required parameter 'actualSegmentLengthTicks' is set + if (actualSegmentLengthTicks == null) { + throw new ApiException(400, + "Missing the required parameter 'actualSegmentLengthTicks' when calling getHlsVideoSegment"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/hls1/{playlistId}/{segmentId}.{container}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{playlistId}", ApiClient.urlEncode(playlistId.toString())) + .replace("{segmentId}", ApiClient.urlEncode(segmentId.toString())) + .replace("{container}", ApiClient.urlEncode(container.toString())); + + List localVarQueryParams = new ArrayList<>(); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; localVarQueryParameterBaseName = "runtimeTicks"; @@ -1107,6 +1732,8 @@ private HttpRequest.Builder getHlsVideoSegmentRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1182,10 +1809,274 @@ private HttpRequest.Builder getHlsVideoSegmentRequestBuilder(@org.eclipse.jdt.an * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, * default to false) - * @return File + * @return File + * @throws ApiException if fails to make API call + */ + public File getLiveHlsStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + return getLiveHlsStream(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, maxWidth, maxHeight, + enableSubtitlesInManifest, enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding, null); + } + + /** + * Gets a hls live stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param maxWidth Optional. The max width. (optional) + * @param maxHeight Optional. The max height. (optional) + * @param enableSubtitlesInManifest Optional. Whether to enable subtitles in the manifest. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getLiveHlsStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + Map headers) throws ApiException { + ApiResponse localVarResponse = getLiveHlsStreamWithHttpInfo(itemId, container, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + maxWidth, maxHeight, enableSubtitlesInManifest, enableAudioVbrEncoding, + alwaysBurnInSubtitleWhenTranscoding, headers); + return localVarResponse.getData(); + } + + /** + * Gets a hls live stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param maxWidth Optional. The max width. (optional) + * @param maxHeight Optional. The max height. (optional) + * @param enableSubtitlesInManifest Optional. Whether to enable subtitles in the manifest. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @return ApiResponse<File> * @throws ApiException if fails to make API call */ - public File getLiveHlsStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + public ApiResponse getLiveHlsStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, @@ -1232,17 +2123,15 @@ public File getLiveHlsStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { - ApiResponse localVarResponse = getLiveHlsStreamWithHttpInfo(itemId, container, _static, params, tag, - deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, - audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, - audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, - framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, - subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, - requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, - videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, - maxWidth, maxHeight, enableSubtitlesInManifest, enableAudioVbrEncoding, - alwaysBurnInSubtitleWhenTranscoding); - return localVarResponse.getData(); + return getLiveHlsStreamWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, maxWidth, maxHeight, + enableSubtitlesInManifest, enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding, null); } /** @@ -1314,6 +2203,7 @@ public File getLiveHlsStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, * default to false) + * @param headers Optional headers to include in the request * @return ApiResponse<File> * @throws ApiException if fails to make API call */ @@ -1363,7 +2253,8 @@ public ApiResponse getLiveHlsStreamWithHttpInfo(@org.eclipse.jdt.annotatio @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, - @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getLiveHlsStreamRequestBuilder(itemId, container, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, @@ -1373,7 +2264,7 @@ public ApiResponse getLiveHlsStreamWithHttpInfo(@org.eclipse.jdt.annotatio requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, maxWidth, maxHeight, enableSubtitlesInManifest, enableAudioVbrEncoding, - alwaysBurnInSubtitleWhenTranscoding); + alwaysBurnInSubtitleWhenTranscoding, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1388,13 +2279,13 @@ public ApiResponse getLiveHlsStreamWithHttpInfo(@org.eclipse.jdt.annotatio return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1451,7 +2342,8 @@ private HttpRequest.Builder getLiveHlsStreamRequestBuilder(@org.eclipse.jdt.anno @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, - @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getLiveHlsStream"); @@ -1590,6 +2482,8 @@ private HttpRequest.Builder getLiveHlsStreamRequestBuilder(@org.eclipse.jdt.anno if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1709,6 +2603,132 @@ public File getMasterHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + return getMasterHlsAudioPlaylist(itemId, mediaSourceId, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, enableAudioVbrEncoding, null); + } + + /** + * Gets an audio hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getMasterHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { ApiResponse localVarResponse = getMasterHlsAudioPlaylistWithHttpInfo(itemId, mediaSourceId, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, @@ -1717,7 +2737,7 @@ public File getMasterHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, - enableAdaptiveBitrateStreaming, enableAudioVbrEncoding); + enableAdaptiveBitrateStreaming, enableAudioVbrEncoding, headers); return localVarResponse.getData(); } @@ -1833,7 +2853,133 @@ public ApiResponse getMasterHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt. @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + return getMasterHlsAudioPlaylistWithHttpInfo(itemId, mediaSourceId, _static, params, tag, deviceProfileId, + playSessionId, segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, enableAudioVbrEncoding, null); + } + + /** + * Gets an audio hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMasterHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getMasterHlsAudioPlaylistRequestBuilder(itemId, mediaSourceId, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, @@ -1843,7 +2989,7 @@ public ApiResponse getMasterHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt. maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, enableAdaptiveBitrateStreaming, - enableAudioVbrEncoding); + enableAudioVbrEncoding, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1858,13 +3004,13 @@ public ApiResponse getMasterHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt. return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1919,7 +3065,8 @@ private HttpRequest.Builder getMasterHlsAudioPlaylistRequestBuilder( @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, @@ -2058,6 +3205,8 @@ private HttpRequest.Builder getMasterHlsAudioPlaylistRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2184,6 +3333,140 @@ public File getMasterHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplay, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + return getMasterHlsVideoPlaylist(itemId, mediaSourceId, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, enableTrickplay, enableAudioVbrEncoding, + alwaysBurnInSubtitleWhenTranscoding, null); + } + + /** + * Gets a video hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param enableTrickplay Enable trickplay image playlists being added to master playlist. (optional, default to + * true) + * @param enableAudioVbrEncoding Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getMasterHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplay, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + Map headers) throws ApiException { ApiResponse localVarResponse = getMasterHlsVideoPlaylistWithHttpInfo(itemId, mediaSourceId, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, @@ -2193,7 +3476,7 @@ public File getMasterHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, enableAdaptiveBitrateStreaming, enableTrickplay, enableAudioVbrEncoding, - alwaysBurnInSubtitleWhenTranscoding); + alwaysBurnInSubtitleWhenTranscoding, headers); return localVarResponse.getData(); } @@ -2316,7 +3599,141 @@ public ApiResponse getMasterHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt. @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplay, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, - @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + return getMasterHlsVideoPlaylistWithHttpInfo(itemId, mediaSourceId, _static, params, tag, deviceProfileId, + playSessionId, segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, enableTrickplay, enableAudioVbrEncoding, + alwaysBurnInSubtitleWhenTranscoding, null); + } + + /** + * Gets a video hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param enableTrickplay Enable trickplay image playlists being added to master playlist. (optional, default to + * true) + * @param enableAudioVbrEncoding Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMasterHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplay, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getMasterHlsVideoPlaylistRequestBuilder(itemId, mediaSourceId, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, @@ -2326,7 +3743,7 @@ public ApiResponse getMasterHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt. requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, enableAdaptiveBitrateStreaming, enableTrickplay, enableAudioVbrEncoding, - alwaysBurnInSubtitleWhenTranscoding); + alwaysBurnInSubtitleWhenTranscoding, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2341,13 +3758,13 @@ public ApiResponse getMasterHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt. return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -2404,7 +3821,8 @@ private HttpRequest.Builder getMasterHlsVideoPlaylistRequestBuilder( @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplay, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, - @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, @@ -2551,6 +3969,8 @@ private HttpRequest.Builder getMasterHlsVideoPlaylistRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2668,16 +4088,262 @@ public File getVariantHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { - ApiResponse localVarResponse = getVariantHlsAudioPlaylistWithHttpInfo(itemId, _static, params, tag, - deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, - audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, - audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, - profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, - subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, - requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, - videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, - enableAudioVbrEncoding); - return localVarResponse.getData(); + return getVariantHlsAudioPlaylist(itemId, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, null); + } + + /** + * Gets an audio stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getVariantHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { + ApiResponse localVarResponse = getVariantHlsAudioPlaylistWithHttpInfo(itemId, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, headers); + return localVarResponse.getData(); + } + + /** + * Gets an audio stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVariantHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + return getVariantHlsAudioPlaylistWithHttpInfo(itemId, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, null); } /** @@ -2744,6 +4410,7 @@ public File getVariantHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) * @param streamOptions Optional. The streaming options. (optional) * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request * @return ApiResponse<File> * @throws ApiException if fails to make API call */ @@ -2790,7 +4457,8 @@ public ApiResponse getVariantHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getVariantHlsAudioPlaylistRequestBuilder(itemId, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, @@ -2799,7 +4467,7 @@ public ApiResponse getVariantHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, - audioStreamIndex, videoStreamIndex, context, streamOptions, enableAudioVbrEncoding); + audioStreamIndex, videoStreamIndex, context, streamOptions, enableAudioVbrEncoding, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2814,13 +4482,13 @@ public ApiResponse getVariantHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -2875,7 +4543,8 @@ private HttpRequest.Builder getVariantHlsAudioPlaylistRequestBuilder( @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, @@ -3006,6 +4675,8 @@ private HttpRequest.Builder getVariantHlsAudioPlaylistRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -3127,6 +4798,134 @@ public File getVariantHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + return getVariantHlsVideoPlaylist(itemId, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding, null); + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getVariantHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + Map headers) throws ApiException { ApiResponse localVarResponse = getVariantHlsVideoPlaylistWithHttpInfo(itemId, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, @@ -3135,7 +4934,7 @@ public File getVariantHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, - context, streamOptions, enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding); + context, streamOptions, enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding, headers); return localVarResponse.getData(); } @@ -3253,7 +5052,135 @@ public ApiResponse getVariantHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, - @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + return getVariantHlsVideoPlaylistWithHttpInfo(itemId, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding, null); + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVariantHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getVariantHlsVideoPlaylistRequestBuilder(itemId, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, @@ -3262,7 +5189,7 @@ public ApiResponse getVariantHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, - context, streamOptions, enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding); + context, streamOptions, enableAudioVbrEncoding, alwaysBurnInSubtitleWhenTranscoding, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -3277,13 +5204,13 @@ public ApiResponse getVariantHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -3339,7 +5266,8 @@ private HttpRequest.Builder getVariantHlsVideoPlaylistRequestBuilder( @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, - @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, @@ -3475,6 +5403,8 @@ private HttpRequest.Builder getVariantHlsVideoPlaylistRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -3594,6 +5524,132 @@ public File headMasterHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + return headMasterHlsAudioPlaylist(itemId, mediaSourceId, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, enableAudioVbrEncoding, null); + } + + /** + * Gets an audio hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headMasterHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { ApiResponse localVarResponse = headMasterHlsAudioPlaylistWithHttpInfo(itemId, mediaSourceId, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, @@ -3602,7 +5658,7 @@ public File headMasterHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, - enableAdaptiveBitrateStreaming, enableAudioVbrEncoding); + enableAdaptiveBitrateStreaming, enableAudioVbrEncoding, headers); return localVarResponse.getData(); } @@ -3719,6 +5775,132 @@ public ApiResponse headMasterHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + return headMasterHlsAudioPlaylistWithHttpInfo(itemId, mediaSourceId, _static, params, tag, deviceProfileId, + playSessionId, segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, enableAudioVbrEncoding, null); + } + + /** + * Gets an audio hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headMasterHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = headMasterHlsAudioPlaylistRequestBuilder(itemId, mediaSourceId, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, @@ -3728,7 +5910,7 @@ public ApiResponse headMasterHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, enableAdaptiveBitrateStreaming, - enableAudioVbrEncoding); + enableAudioVbrEncoding, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -3743,13 +5925,13 @@ public ApiResponse headMasterHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -3804,7 +5986,8 @@ private HttpRequest.Builder headMasterHlsAudioPlaylistRequestBuilder( @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, @@ -3943,6 +6126,8 @@ private HttpRequest.Builder headMasterHlsAudioPlaylistRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -4069,6 +6254,140 @@ public File headMasterHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplay, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + return headMasterHlsVideoPlaylist(itemId, mediaSourceId, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, enableTrickplay, enableAudioVbrEncoding, + alwaysBurnInSubtitleWhenTranscoding, null); + } + + /** + * Gets a video hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param enableTrickplay Enable trickplay image playlists being added to master playlist. (optional, default to + * true) + * @param enableAudioVbrEncoding Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headMasterHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplay, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + Map headers) throws ApiException { ApiResponse localVarResponse = headMasterHlsVideoPlaylistWithHttpInfo(itemId, mediaSourceId, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, @@ -4078,7 +6397,7 @@ public File headMasterHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, enableAdaptiveBitrateStreaming, enableTrickplay, enableAudioVbrEncoding, - alwaysBurnInSubtitleWhenTranscoding); + alwaysBurnInSubtitleWhenTranscoding, headers); return localVarResponse.getData(); } @@ -4202,6 +6521,140 @@ public ApiResponse headMasterHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplay, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + return headMasterHlsVideoPlaylistWithHttpInfo(itemId, mediaSourceId, _static, params, tag, deviceProfileId, + playSessionId, segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, enableTrickplay, enableAudioVbrEncoding, + alwaysBurnInSubtitleWhenTranscoding, null); + } + + /** + * Gets a video hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param enableTrickplay Enable trickplay image playlists being added to master playlist. (optional, default to + * true) + * @param enableAudioVbrEncoding Whether to enable Audio Encoding. (optional, default to true) + * @param alwaysBurnInSubtitleWhenTranscoding Whether to always burn in subtitles when transcoding. (optional, + * default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headMasterHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, + @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplay, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = headMasterHlsVideoPlaylistRequestBuilder(itemId, mediaSourceId, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, @@ -4211,7 +6664,7 @@ public ApiResponse headMasterHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, enableAdaptiveBitrateStreaming, enableTrickplay, enableAudioVbrEncoding, - alwaysBurnInSubtitleWhenTranscoding); + alwaysBurnInSubtitleWhenTranscoding, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -4226,13 +6679,13 @@ public ApiResponse headMasterHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -4289,7 +6742,8 @@ private HttpRequest.Builder headMasterHlsVideoPlaylistRequestBuilder( @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, @org.eclipse.jdt.annotation.NonNull Boolean enableTrickplay, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, - @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, @@ -4436,6 +6890,8 @@ private HttpRequest.Builder headMasterHlsVideoPlaylistRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/EnvironmentApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/EnvironmentApi.java index c7a922a6e9546..81a0291de2fe9 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/EnvironmentApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/EnvironmentApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.function.Consumer; @@ -38,6 +40,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class EnvironmentApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -73,6 +97,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Get Default directory browser. * @@ -80,7 +154,18 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public DefaultDirectoryBrowserInfoDto getDefaultDirectoryBrowser() throws ApiException { - ApiResponse localVarResponse = getDefaultDirectoryBrowserWithHttpInfo(); + return getDefaultDirectoryBrowser(null); + } + + /** + * Get Default directory browser. + * + * @param headers Optional headers to include in the request + * @return DefaultDirectoryBrowserInfoDto + * @throws ApiException if fails to make API call + */ + public DefaultDirectoryBrowserInfoDto getDefaultDirectoryBrowser(Map headers) throws ApiException { + ApiResponse localVarResponse = getDefaultDirectoryBrowserWithHttpInfo(headers); return localVarResponse.getData(); } @@ -91,7 +176,19 @@ public DefaultDirectoryBrowserInfoDto getDefaultDirectoryBrowser() throws ApiExc * @throws ApiException if fails to make API call */ public ApiResponse getDefaultDirectoryBrowserWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getDefaultDirectoryBrowserRequestBuilder(); + return getDefaultDirectoryBrowserWithHttpInfo(null); + } + + /** + * Get Default directory browser. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<DefaultDirectoryBrowserInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultDirectoryBrowserWithHttpInfo( + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDefaultDirectoryBrowserRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -108,14 +205,15 @@ public ApiResponse getDefaultDirectoryBrowserWit } String responseBody = new String(localVarResponse.body().readAllBytes()); + DefaultDirectoryBrowserInfoDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -126,7 +224,8 @@ public ApiResponse getDefaultDirectoryBrowserWit } } - private HttpRequest.Builder getDefaultDirectoryBrowserRequestBuilder() throws ApiException { + private HttpRequest.Builder getDefaultDirectoryBrowserRequestBuilder(Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -141,6 +240,8 @@ private HttpRequest.Builder getDefaultDirectoryBrowserRequestBuilder() throws Ap if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -161,8 +262,27 @@ private HttpRequest.Builder getDefaultDirectoryBrowserRequestBuilder() throws Ap public List getDirectoryContents(@org.eclipse.jdt.annotation.Nullable String path, @org.eclipse.jdt.annotation.NonNull Boolean includeFiles, @org.eclipse.jdt.annotation.NonNull Boolean includeDirectories) throws ApiException { + return getDirectoryContents(path, includeFiles, includeDirectories, null); + } + + /** + * Gets the contents of a given directory in the file system. + * + * @param path The path. (required) + * @param includeFiles An optional filter to include or exclude files from the results. true/false. (optional, + * default to false) + * @param includeDirectories An optional filter to include or exclude folders from the results. true/false. + * (optional, default to false) + * @param headers Optional headers to include in the request + * @return List<FileSystemEntryInfo> + * @throws ApiException if fails to make API call + */ + public List getDirectoryContents(@org.eclipse.jdt.annotation.Nullable String path, + @org.eclipse.jdt.annotation.NonNull Boolean includeFiles, + @org.eclipse.jdt.annotation.NonNull Boolean includeDirectories, Map headers) + throws ApiException { ApiResponse> localVarResponse = getDirectoryContentsWithHttpInfo(path, includeFiles, - includeDirectories); + includeDirectories, headers); return localVarResponse.getData(); } @@ -180,8 +300,27 @@ public List getDirectoryContents(@org.eclipse.jdt.annotatio public ApiResponse> getDirectoryContentsWithHttpInfo( @org.eclipse.jdt.annotation.Nullable String path, @org.eclipse.jdt.annotation.NonNull Boolean includeFiles, @org.eclipse.jdt.annotation.NonNull Boolean includeDirectories) throws ApiException { + return getDirectoryContentsWithHttpInfo(path, includeFiles, includeDirectories, null); + } + + /** + * Gets the contents of a given directory in the file system. + * + * @param path The path. (required) + * @param includeFiles An optional filter to include or exclude files from the results. true/false. (optional, + * default to false) + * @param includeDirectories An optional filter to include or exclude folders from the results. true/false. + * (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<FileSystemEntryInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getDirectoryContentsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String path, @org.eclipse.jdt.annotation.NonNull Boolean includeFiles, + @org.eclipse.jdt.annotation.NonNull Boolean includeDirectories, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getDirectoryContentsRequestBuilder(path, includeFiles, - includeDirectories); + includeDirectories, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -198,14 +337,14 @@ public ApiResponse> getDirectoryContentsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -218,7 +357,8 @@ public ApiResponse> getDirectoryContentsWithHttpInfo( private HttpRequest.Builder getDirectoryContentsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String path, @org.eclipse.jdt.annotation.NonNull Boolean includeFiles, - @org.eclipse.jdt.annotation.NonNull Boolean includeDirectories) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean includeDirectories, Map headers) + throws ApiException { // verify the required parameter 'path' is set if (path == null) { throw new ApiException(400, "Missing the required parameter 'path' when calling getDirectoryContents"); @@ -256,6 +396,8 @@ private HttpRequest.Builder getDirectoryContentsRequestBuilder(@org.eclipse.jdt. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -269,7 +411,18 @@ private HttpRequest.Builder getDirectoryContentsRequestBuilder(@org.eclipse.jdt. * @throws ApiException if fails to make API call */ public List getDrives() throws ApiException { - ApiResponse> localVarResponse = getDrivesWithHttpInfo(); + return getDrives(null); + } + + /** + * Gets available drives from the server's file system. + * + * @param headers Optional headers to include in the request + * @return List<FileSystemEntryInfo> + * @throws ApiException if fails to make API call + */ + public List getDrives(Map headers) throws ApiException { + ApiResponse> localVarResponse = getDrivesWithHttpInfo(headers); return localVarResponse.getData(); } @@ -280,7 +433,19 @@ public List getDrives() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getDrivesWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getDrivesRequestBuilder(); + return getDrivesWithHttpInfo(null); + } + + /** + * Gets available drives from the server's file system. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<FileSystemEntryInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getDrivesWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDrivesRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -297,14 +462,14 @@ public ApiResponse> getDrivesWithHttpInfo() throws Api } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -315,7 +480,7 @@ public ApiResponse> getDrivesWithHttpInfo() throws Api } } - private HttpRequest.Builder getDrivesRequestBuilder() throws ApiException { + private HttpRequest.Builder getDrivesRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -330,6 +495,8 @@ private HttpRequest.Builder getDrivesRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -345,7 +512,20 @@ private HttpRequest.Builder getDrivesRequestBuilder() throws ApiException { */ @Deprecated public List getNetworkShares() throws ApiException { - ApiResponse> localVarResponse = getNetworkSharesWithHttpInfo(); + return getNetworkShares(null); + } + + /** + * Gets network paths. + * + * @param headers Optional headers to include in the request + * @return List<FileSystemEntryInfo> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public List getNetworkShares(Map headers) throws ApiException { + ApiResponse> localVarResponse = getNetworkSharesWithHttpInfo(headers); return localVarResponse.getData(); } @@ -358,7 +538,21 @@ public List getNetworkShares() throws ApiException { */ @Deprecated public ApiResponse> getNetworkSharesWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getNetworkSharesRequestBuilder(); + return getNetworkSharesWithHttpInfo(null); + } + + /** + * Gets network paths. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<FileSystemEntryInfo>> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse> getNetworkSharesWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getNetworkSharesRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -375,14 +569,14 @@ public ApiResponse> getNetworkSharesWithHttpInfo() thr } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -393,7 +587,7 @@ public ApiResponse> getNetworkSharesWithHttpInfo() thr } } - private HttpRequest.Builder getNetworkSharesRequestBuilder() throws ApiException { + private HttpRequest.Builder getNetworkSharesRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -408,6 +602,8 @@ private HttpRequest.Builder getNetworkSharesRequestBuilder() throws ApiException if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -422,7 +618,20 @@ private HttpRequest.Builder getNetworkSharesRequestBuilder() throws ApiException * @throws ApiException if fails to make API call */ public String getParentPath(@org.eclipse.jdt.annotation.Nullable String path) throws ApiException { - ApiResponse localVarResponse = getParentPathWithHttpInfo(path); + return getParentPath(path, null); + } + + /** + * Gets the parent path of a given path. + * + * @param path The path. (required) + * @param headers Optional headers to include in the request + * @return String + * @throws ApiException if fails to make API call + */ + public String getParentPath(@org.eclipse.jdt.annotation.Nullable String path, Map headers) + throws ApiException { + ApiResponse localVarResponse = getParentPathWithHttpInfo(path, headers); return localVarResponse.getData(); } @@ -435,7 +644,20 @@ public String getParentPath(@org.eclipse.jdt.annotation.Nullable String path) th */ public ApiResponse getParentPathWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String path) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getParentPathRequestBuilder(path); + return getParentPathWithHttpInfo(path, null); + } + + /** + * Gets the parent path of a given path. + * + * @param path The path. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getParentPathWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String path, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getParentPathRequestBuilder(path, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -452,12 +674,14 @@ public ApiResponse getParentPathWithHttpInfo(@org.eclipse.jdt.annotation } String responseBody = new String(localVarResponse.body().readAllBytes()); + String responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -468,8 +692,8 @@ public ApiResponse getParentPathWithHttpInfo(@org.eclipse.jdt.annotation } } - private HttpRequest.Builder getParentPathRequestBuilder(@org.eclipse.jdt.annotation.Nullable String path) - throws ApiException { + private HttpRequest.Builder getParentPathRequestBuilder(@org.eclipse.jdt.annotation.Nullable String path, + Map headers) throws ApiException { // verify the required parameter 'path' is set if (path == null) { throw new ApiException(400, "Missing the required parameter 'path' when calling getParentPath"); @@ -503,6 +727,8 @@ private HttpRequest.Builder getParentPathRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -516,7 +742,19 @@ private HttpRequest.Builder getParentPathRequestBuilder(@org.eclipse.jdt.annotat * @throws ApiException if fails to make API call */ public void validatePath(@org.eclipse.jdt.annotation.Nullable ValidatePathDto validatePathDto) throws ApiException { - validatePathWithHttpInfo(validatePathDto); + validatePath(validatePathDto, null); + } + + /** + * Validates path. + * + * @param validatePathDto Validate request object. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void validatePath(@org.eclipse.jdt.annotation.Nullable ValidatePathDto validatePathDto, + Map headers) throws ApiException { + validatePathWithHttpInfo(validatePathDto, headers); } /** @@ -528,7 +766,21 @@ public void validatePath(@org.eclipse.jdt.annotation.Nullable ValidatePathDto va */ public ApiResponse validatePathWithHttpInfo( @org.eclipse.jdt.annotation.Nullable ValidatePathDto validatePathDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = validatePathRequestBuilder(validatePathDto); + return validatePathWithHttpInfo(validatePathDto, null); + } + + /** + * Validates path. + * + * @param validatePathDto Validate request object. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse validatePathWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ValidatePathDto validatePathDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = validatePathRequestBuilder(validatePathDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -556,7 +808,8 @@ public ApiResponse validatePathWithHttpInfo( } private HttpRequest.Builder validatePathRequestBuilder( - @org.eclipse.jdt.annotation.Nullable ValidatePathDto validatePathDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable ValidatePathDto validatePathDto, Map headers) + throws ApiException { // verify the required parameter 'validatePathDto' is set if (validatePathDto == null) { throw new ApiException(400, "Missing the required parameter 'validatePathDto' when calling validatePath"); @@ -581,6 +834,8 @@ private HttpRequest.Builder validatePathRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/FilterApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/FilterApi.java index fbacaf7766dcf..53a4e256cfc4a 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/FilterApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/FilterApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -40,6 +42,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class FilterApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -75,6 +99,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets query filters. * @@ -100,8 +174,38 @@ public QueryFilters getQueryFilters(@org.eclipse.jdt.annotation.NonNull UUID use @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean recursive) throws ApiException { + return getQueryFilters(userId, parentId, includeItemTypes, isAiring, isMovie, isSports, isKids, isNews, + isSeries, recursive, null); + } + + /** + * Gets query filters. + * + * @param userId Optional. User id. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isAiring Optional. Is item airing. (optional) + * @param isMovie Optional. Is item movie. (optional) + * @param isSports Optional. Is item sports. (optional) + * @param isKids Optional. Is item kids. (optional) + * @param isNews Optional. Is item news. (optional) + * @param isSeries Optional. Is item series. (optional) + * @param recursive Optional. Search recursive. (optional) + * @param headers Optional headers to include in the request + * @return QueryFilters + * @throws ApiException if fails to make API call + */ + public QueryFilters getQueryFilters(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, Map headers) throws ApiException { ApiResponse localVarResponse = getQueryFiltersWithHttpInfo(userId, parentId, includeItemTypes, - isAiring, isMovie, isSports, isKids, isNews, isSeries, recursive); + isAiring, isMovie, isSports, isKids, isNews, isSeries, recursive, headers); return localVarResponse.getData(); } @@ -130,8 +234,38 @@ public ApiResponse getQueryFiltersWithHttpInfo(@org.eclipse.jdt.an @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean recursive) throws ApiException { + return getQueryFiltersWithHttpInfo(userId, parentId, includeItemTypes, isAiring, isMovie, isSports, isKids, + isNews, isSeries, recursive, null); + } + + /** + * Gets query filters. + * + * @param userId Optional. User id. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isAiring Optional. Is item airing. (optional) + * @param isMovie Optional. Is item movie. (optional) + * @param isSports Optional. Is item sports. (optional) + * @param isKids Optional. Is item kids. (optional) + * @param isNews Optional. Is item news. (optional) + * @param isSeries Optional. Is item series. (optional) + * @param recursive Optional. Search recursive. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<QueryFilters> + * @throws ApiException if fails to make API call + */ + public ApiResponse getQueryFiltersWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getQueryFiltersRequestBuilder(userId, parentId, includeItemTypes, - isAiring, isMovie, isSports, isKids, isNews, isSeries, recursive); + isAiring, isMovie, isSports, isKids, isNews, isSeries, recursive, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -148,12 +282,14 @@ public ApiResponse getQueryFiltersWithHttpInfo(@org.eclipse.jdt.an } String responseBody = new String(localVarResponse.body().readAllBytes()); + QueryFilters responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -170,7 +306,7 @@ private HttpRequest.Builder getQueryFiltersRequestBuilder(@org.eclipse.jdt.annot @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, - @org.eclipse.jdt.annotation.NonNull Boolean recursive) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean recursive, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -218,6 +354,8 @@ private HttpRequest.Builder getQueryFiltersRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -239,8 +377,28 @@ public QueryFiltersLegacy getQueryFiltersLegacy(@org.eclipse.jdt.annotation.NonN @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull List includeItemTypes, @org.eclipse.jdt.annotation.NonNull List mediaTypes) throws ApiException { + return getQueryFiltersLegacy(userId, parentId, includeItemTypes, mediaTypes, null); + } + + /** + * Gets legacy query filters. + * + * @param userId Optional. User id. (optional) + * @param parentId Optional. Parent id. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param headers Optional headers to include in the request + * @return QueryFiltersLegacy + * @throws ApiException if fails to make API call + */ + public QueryFiltersLegacy getQueryFiltersLegacy(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, Map headers) + throws ApiException { ApiResponse localVarResponse = getQueryFiltersLegacyWithHttpInfo(userId, parentId, - includeItemTypes, mediaTypes); + includeItemTypes, mediaTypes, headers); return localVarResponse.getData(); } @@ -259,8 +417,28 @@ public ApiResponse getQueryFiltersLegacyWithHttpInfo( @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull List includeItemTypes, @org.eclipse.jdt.annotation.NonNull List mediaTypes) throws ApiException { + return getQueryFiltersLegacyWithHttpInfo(userId, parentId, includeItemTypes, mediaTypes, null); + } + + /** + * Gets legacy query filters. + * + * @param userId Optional. User id. (optional) + * @param parentId Optional. Parent id. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<QueryFiltersLegacy> + * @throws ApiException if fails to make API call + */ + public ApiResponse getQueryFiltersLegacyWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getQueryFiltersLegacyRequestBuilder(userId, parentId, - includeItemTypes, mediaTypes); + includeItemTypes, mediaTypes, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -277,14 +455,14 @@ public ApiResponse getQueryFiltersLegacyWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + QueryFiltersLegacy responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -298,7 +476,8 @@ public ApiResponse getQueryFiltersLegacyWithHttpInfo( private HttpRequest.Builder getQueryFiltersLegacyRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull List includeItemTypes, - @org.eclipse.jdt.annotation.NonNull List mediaTypes) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List mediaTypes, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -334,6 +513,8 @@ private HttpRequest.Builder getQueryFiltersLegacyRequestBuilder(@org.eclipse.jdt if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/GenresApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/GenresApi.java index ee257685973d9..3930bd4c6c536 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/GenresApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/GenresApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -43,6 +45,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class GenresApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -78,6 +102,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets a genre, by name. * @@ -88,7 +162,21 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public BaseItemDto getGenre(@org.eclipse.jdt.annotation.Nullable String genreName, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getGenreWithHttpInfo(genreName, userId); + return getGenre(genreName, userId, null); + } + + /** + * Gets a genre, by name. + * + * @param genreName The genre name. (required) + * @param userId The user id. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getGenre(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getGenreWithHttpInfo(genreName, userId, headers); return localVarResponse.getData(); } @@ -102,7 +190,21 @@ public BaseItemDto getGenre(@org.eclipse.jdt.annotation.Nullable String genreNam */ public ApiResponse getGenreWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String genreName, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getGenreRequestBuilder(genreName, userId); + return getGenreWithHttpInfo(genreName, userId, null); + } + + /** + * Gets a genre, by name. + * + * @param genreName The genre name. (required) + * @param userId The user id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenreWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGenreRequestBuilder(genreName, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -119,12 +221,14 @@ public ApiResponse getGenreWithHttpInfo(@org.eclipse.jdt.annotation } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -136,7 +240,7 @@ public ApiResponse getGenreWithHttpInfo(@org.eclipse.jdt.annotation } private HttpRequest.Builder getGenreRequestBuilder(@org.eclipse.jdt.annotation.Nullable String genreName, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'genreName' is set if (genreName == null) { throw new ApiException(400, "Missing the required parameter 'genreName' when calling getGenre"); @@ -170,6 +274,8 @@ private HttpRequest.Builder getGenreRequestBuilder(@org.eclipse.jdt.annotation.N if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -223,10 +329,64 @@ public BaseItemDtoQueryResult getGenres(@org.eclipse.jdt.annotation.NonNull Inte @org.eclipse.jdt.annotation.NonNull List sortOrder, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getGenres(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, + isFavorite, imageTypeLimit, enableImageTypes, userId, nameStartsWithOrGreater, nameStartsWith, + nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount, null); + } + + /** + * Gets all genres from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered in based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Optional. Include total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getGenres(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { ApiResponse localVarResponse = getGenresWithHttpInfo(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, isFavorite, imageTypeLimit, enableImageTypes, userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, - enableTotalRecordCount); + enableTotalRecordCount, headers); return localVarResponse.getData(); } @@ -277,10 +437,64 @@ public ApiResponse getGenresWithHttpInfo( @org.eclipse.jdt.annotation.NonNull List sortOrder, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getGenresWithHttpInfo(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, + includeItemTypes, isFavorite, imageTypeLimit, enableImageTypes, userId, nameStartsWithOrGreater, + nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount, null); + } + + /** + * Gets all genres from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered in based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Optional. Include total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenresWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getGenresRequestBuilder(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, isFavorite, imageTypeLimit, enableImageTypes, userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, - enableTotalRecordCount); + enableTotalRecordCount, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -297,14 +511,14 @@ public ApiResponse getGenresWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -331,7 +545,8 @@ private HttpRequest.Builder getGenresRequestBuilder(@org.eclipse.jdt.annotation. @org.eclipse.jdt.annotation.NonNull List sortBy, @org.eclipse.jdt.annotation.NonNull List sortOrder, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, - @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -395,6 +610,8 @@ private HttpRequest.Builder getGenresRequestBuilder(@org.eclipse.jdt.annotation. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/HlsSegmentApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/HlsSegmentApi.java index f7bc54c222bc7..acde522eb3363 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/HlsSegmentApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/HlsSegmentApi.java @@ -22,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.function.Consumer; @@ -31,11 +32,32 @@ import org.openhab.binding.jellyfin.internal.api.generated.Configuration; import org.openhab.binding.jellyfin.internal.api.generated.Pair; -import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class HlsSegmentApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -71,6 +93,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets the specified audio segment for an audio item. * @@ -81,7 +153,21 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public File getHlsAudioSegmentLegacyAac(@org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String segmentId) throws ApiException { - ApiResponse localVarResponse = getHlsAudioSegmentLegacyAacWithHttpInfo(itemId, segmentId); + return getHlsAudioSegmentLegacyAac(itemId, segmentId, null); + } + + /** + * Gets the specified audio segment for an audio item. + * + * @param itemId The item id. (required) + * @param segmentId The segment id. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsAudioSegmentLegacyAac(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String segmentId, Map headers) throws ApiException { + ApiResponse localVarResponse = getHlsAudioSegmentLegacyAacWithHttpInfo(itemId, segmentId, headers); return localVarResponse.getData(); } @@ -95,7 +181,22 @@ public File getHlsAudioSegmentLegacyAac(@org.eclipse.jdt.annotation.Nullable Str */ public ApiResponse getHlsAudioSegmentLegacyAacWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String segmentId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getHlsAudioSegmentLegacyAacRequestBuilder(itemId, segmentId); + return getHlsAudioSegmentLegacyAacWithHttpInfo(itemId, segmentId, null); + } + + /** + * Gets the specified audio segment for an audio item. + * + * @param itemId The item id. (required) + * @param segmentId The segment id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsAudioSegmentLegacyAacWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String segmentId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsAudioSegmentLegacyAacRequestBuilder(itemId, segmentId, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -110,13 +211,13 @@ public ApiResponse getHlsAudioSegmentLegacyAacWithHttpInfo(@org.eclipse.jd return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -128,8 +229,8 @@ public ApiResponse getHlsAudioSegmentLegacyAacWithHttpInfo(@org.eclipse.jd } private HttpRequest.Builder getHlsAudioSegmentLegacyAacRequestBuilder( - @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String segmentId) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String segmentId, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, @@ -155,6 +256,8 @@ private HttpRequest.Builder getHlsAudioSegmentLegacyAacRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -171,7 +274,21 @@ private HttpRequest.Builder getHlsAudioSegmentLegacyAacRequestBuilder( */ public File getHlsAudioSegmentLegacyMp3(@org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String segmentId) throws ApiException { - ApiResponse localVarResponse = getHlsAudioSegmentLegacyMp3WithHttpInfo(itemId, segmentId); + return getHlsAudioSegmentLegacyMp3(itemId, segmentId, null); + } + + /** + * Gets the specified audio segment for an audio item. + * + * @param itemId The item id. (required) + * @param segmentId The segment id. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsAudioSegmentLegacyMp3(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String segmentId, Map headers) throws ApiException { + ApiResponse localVarResponse = getHlsAudioSegmentLegacyMp3WithHttpInfo(itemId, segmentId, headers); return localVarResponse.getData(); } @@ -185,7 +302,22 @@ public File getHlsAudioSegmentLegacyMp3(@org.eclipse.jdt.annotation.Nullable Str */ public ApiResponse getHlsAudioSegmentLegacyMp3WithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String segmentId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getHlsAudioSegmentLegacyMp3RequestBuilder(itemId, segmentId); + return getHlsAudioSegmentLegacyMp3WithHttpInfo(itemId, segmentId, null); + } + + /** + * Gets the specified audio segment for an audio item. + * + * @param itemId The item id. (required) + * @param segmentId The segment id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsAudioSegmentLegacyMp3WithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String segmentId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsAudioSegmentLegacyMp3RequestBuilder(itemId, segmentId, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -200,13 +332,13 @@ public ApiResponse getHlsAudioSegmentLegacyMp3WithHttpInfo(@org.eclipse.jd return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -218,8 +350,8 @@ public ApiResponse getHlsAudioSegmentLegacyMp3WithHttpInfo(@org.eclipse.jd } private HttpRequest.Builder getHlsAudioSegmentLegacyMp3RequestBuilder( - @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String segmentId) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String segmentId, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, @@ -245,6 +377,8 @@ private HttpRequest.Builder getHlsAudioSegmentLegacyMp3RequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -261,7 +395,21 @@ private HttpRequest.Builder getHlsAudioSegmentLegacyMp3RequestBuilder( */ public File getHlsPlaylistLegacy(@org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String playlistId) throws ApiException { - ApiResponse localVarResponse = getHlsPlaylistLegacyWithHttpInfo(itemId, playlistId); + return getHlsPlaylistLegacy(itemId, playlistId, null); + } + + /** + * Gets a hls video playlist. + * + * @param itemId The video id. (required) + * @param playlistId The playlist id. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsPlaylistLegacy(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, Map headers) throws ApiException { + ApiResponse localVarResponse = getHlsPlaylistLegacyWithHttpInfo(itemId, playlistId, headers); return localVarResponse.getData(); } @@ -275,7 +423,21 @@ public File getHlsPlaylistLegacy(@org.eclipse.jdt.annotation.Nullable String ite */ public ApiResponse getHlsPlaylistLegacyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String playlistId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getHlsPlaylistLegacyRequestBuilder(itemId, playlistId); + return getHlsPlaylistLegacyWithHttpInfo(itemId, playlistId, null); + } + + /** + * Gets a hls video playlist. + * + * @param itemId The video id. (required) + * @param playlistId The playlist id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsPlaylistLegacyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsPlaylistLegacyRequestBuilder(itemId, playlistId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -290,13 +452,13 @@ public ApiResponse getHlsPlaylistLegacyWithHttpInfo(@org.eclipse.jdt.annot return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -308,7 +470,7 @@ public ApiResponse getHlsPlaylistLegacyWithHttpInfo(@org.eclipse.jdt.annot } private HttpRequest.Builder getHlsPlaylistLegacyRequestBuilder(@org.eclipse.jdt.annotation.Nullable String itemId, - @org.eclipse.jdt.annotation.Nullable String playlistId) throws ApiException { + @org.eclipse.jdt.annotation.Nullable String playlistId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getHlsPlaylistLegacy"); @@ -333,6 +495,8 @@ private HttpRequest.Builder getHlsPlaylistLegacyRequestBuilder(@org.eclipse.jdt. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -353,8 +517,27 @@ public File getHlsVideoSegmentLegacy(@org.eclipse.jdt.annotation.Nullable String @org.eclipse.jdt.annotation.Nullable String playlistId, @org.eclipse.jdt.annotation.Nullable String segmentId, @org.eclipse.jdt.annotation.Nullable String segmentContainer) throws ApiException { + return getHlsVideoSegmentLegacy(itemId, playlistId, segmentId, segmentContainer, null); + } + + /** + * Gets a hls video segment. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param segmentContainer The segment container. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsVideoSegmentLegacy(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String segmentId, + @org.eclipse.jdt.annotation.Nullable String segmentContainer, Map headers) + throws ApiException { ApiResponse localVarResponse = getHlsVideoSegmentLegacyWithHttpInfo(itemId, playlistId, segmentId, - segmentContainer); + segmentContainer, headers); return localVarResponse.getData(); } @@ -372,8 +555,27 @@ public ApiResponse getHlsVideoSegmentLegacyWithHttpInfo(@org.eclipse.jdt.a @org.eclipse.jdt.annotation.Nullable String playlistId, @org.eclipse.jdt.annotation.Nullable String segmentId, @org.eclipse.jdt.annotation.Nullable String segmentContainer) throws ApiException { + return getHlsVideoSegmentLegacyWithHttpInfo(itemId, playlistId, segmentId, segmentContainer, null); + } + + /** + * Gets a hls video segment. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param segmentContainer The segment container. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsVideoSegmentLegacyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String segmentId, + @org.eclipse.jdt.annotation.Nullable String segmentContainer, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getHlsVideoSegmentLegacyRequestBuilder(itemId, playlistId, - segmentId, segmentContainer); + segmentId, segmentContainer, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -388,13 +590,13 @@ public ApiResponse getHlsVideoSegmentLegacyWithHttpInfo(@org.eclipse.jdt.a return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -408,7 +610,8 @@ public ApiResponse getHlsVideoSegmentLegacyWithHttpInfo(@org.eclipse.jdt.a private HttpRequest.Builder getHlsVideoSegmentLegacyRequestBuilder( @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String playlistId, @org.eclipse.jdt.annotation.Nullable String segmentId, - @org.eclipse.jdt.annotation.Nullable String segmentContainer) throws ApiException { + @org.eclipse.jdt.annotation.Nullable String segmentContainer, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, @@ -447,6 +650,8 @@ private HttpRequest.Builder getHlsVideoSegmentLegacyRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -462,7 +667,21 @@ private HttpRequest.Builder getHlsVideoSegmentLegacyRequestBuilder( */ public void stopEncodingProcess(@org.eclipse.jdt.annotation.Nullable String deviceId, @org.eclipse.jdt.annotation.Nullable String playSessionId) throws ApiException { - stopEncodingProcessWithHttpInfo(deviceId, playSessionId); + stopEncodingProcess(deviceId, playSessionId, null); + } + + /** + * Stops an active encoding. + * + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (required) + * @param playSessionId The play session id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void stopEncodingProcess(@org.eclipse.jdt.annotation.Nullable String deviceId, + @org.eclipse.jdt.annotation.Nullable String playSessionId, Map headers) + throws ApiException { + stopEncodingProcessWithHttpInfo(deviceId, playSessionId, headers); } /** @@ -475,7 +694,23 @@ public void stopEncodingProcess(@org.eclipse.jdt.annotation.Nullable String devi */ public ApiResponse stopEncodingProcessWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String deviceId, @org.eclipse.jdt.annotation.Nullable String playSessionId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = stopEncodingProcessRequestBuilder(deviceId, playSessionId); + return stopEncodingProcessWithHttpInfo(deviceId, playSessionId, null); + } + + /** + * Stops an active encoding. + * + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (required) + * @param playSessionId The play session id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse stopEncodingProcessWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String deviceId, + @org.eclipse.jdt.annotation.Nullable String playSessionId, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = stopEncodingProcessRequestBuilder(deviceId, playSessionId, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -503,7 +738,8 @@ public ApiResponse stopEncodingProcessWithHttpInfo(@org.eclipse.jdt.annota } private HttpRequest.Builder stopEncodingProcessRequestBuilder(@org.eclipse.jdt.annotation.Nullable String deviceId, - @org.eclipse.jdt.annotation.Nullable String playSessionId) throws ApiException { + @org.eclipse.jdt.annotation.Nullable String playSessionId, Map headers) + throws ApiException { // verify the required parameter 'deviceId' is set if (deviceId == null) { throw new ApiException(400, "Missing the required parameter 'deviceId' when calling stopEncodingProcess"); @@ -543,6 +779,8 @@ private HttpRequest.Builder stopEncodingProcessRequestBuilder(@org.eclipse.jdt.a if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ImageApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ImageApi.java index 57188e967b803..3a29d350cecbc 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ImageApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ImageApi.java @@ -22,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -40,6 +41,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class ImageApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -75,13 +98,73 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Delete a custom splashscreen. * * @throws ApiException if fails to make API call */ public void deleteCustomSplashscreen() throws ApiException { - deleteCustomSplashscreenWithHttpInfo(); + deleteCustomSplashscreen(null); + } + + /** + * Delete a custom splashscreen. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteCustomSplashscreen(Map headers) throws ApiException { + deleteCustomSplashscreenWithHttpInfo(headers); } /** @@ -91,7 +174,18 @@ public void deleteCustomSplashscreen() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse deleteCustomSplashscreenWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteCustomSplashscreenRequestBuilder(); + return deleteCustomSplashscreenWithHttpInfo(null); + } + + /** + * Delete a custom splashscreen. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteCustomSplashscreenWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteCustomSplashscreenRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -118,7 +212,8 @@ public ApiResponse deleteCustomSplashscreenWithHttpInfo() throws ApiExcept } } - private HttpRequest.Builder deleteCustomSplashscreenRequestBuilder() throws ApiException { + private HttpRequest.Builder deleteCustomSplashscreenRequestBuilder(Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -132,6 +227,8 @@ private HttpRequest.Builder deleteCustomSplashscreenRequestBuilder() throws ApiE if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -149,7 +246,22 @@ private HttpRequest.Builder deleteCustomSplashscreenRequestBuilder() throws ApiE public void deleteItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { - deleteItemImageWithHttpInfo(itemId, imageType, imageIndex); + deleteItemImage(itemId, imageType, imageIndex, null); + } + + /** + * Delete an item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex The image index. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + deleteItemImageWithHttpInfo(itemId, imageType, imageIndex, headers); } /** @@ -164,7 +276,24 @@ public void deleteItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, public ApiResponse deleteItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteItemImageRequestBuilder(itemId, imageType, imageIndex); + return deleteItemImageWithHttpInfo(itemId, imageType, imageIndex, null); + } + + /** + * Delete an item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex The image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteItemImageRequestBuilder(itemId, imageType, imageIndex, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -193,7 +322,7 @@ public ApiResponse deleteItemImageWithHttpInfo(@org.eclipse.jdt.annotation private HttpRequest.Builder deleteItemImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable ImageType imageType, - @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteItemImage"); @@ -233,6 +362,8 @@ private HttpRequest.Builder deleteItemImageRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -250,7 +381,22 @@ private HttpRequest.Builder deleteItemImageRequestBuilder(@org.eclipse.jdt.annot public void deleteItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.Nullable Integer imageIndex) throws ApiException { - deleteItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex); + deleteItemImageByIndex(itemId, imageType, imageIndex, null); + } + + /** + * Delete an item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex The image index. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, Map headers) throws ApiException { + deleteItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, headers); } /** @@ -265,8 +411,24 @@ public void deleteItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID ite public ApiResponse deleteItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.Nullable Integer imageIndex) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteItemImageByIndexRequestBuilder(itemId, imageType, - imageIndex); + return deleteItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, null); + } + + /** + * Delete an item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex The image index. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteItemImageByIndexRequestBuilder(itemId, imageType, imageIndex, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -295,7 +457,7 @@ public ApiResponse deleteItemImageByIndexWithHttpInfo(@org.eclipse.jdt.ann private HttpRequest.Builder deleteItemImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable ImageType imageType, - @org.eclipse.jdt.annotation.Nullable Integer imageIndex) throws ApiException { + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteItemImageByIndex"); @@ -327,6 +489,8 @@ private HttpRequest.Builder deleteItemImageByIndexRequestBuilder(@org.eclipse.jd if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -340,7 +504,19 @@ private HttpRequest.Builder deleteItemImageByIndexRequestBuilder(@org.eclipse.jd * @throws ApiException if fails to make API call */ public void deleteUserImage(@org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - deleteUserImageWithHttpInfo(userId); + deleteUserImage(userId, null); + } + + /** + * Delete the user's image. + * + * @param userId User Id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteUserImage(@org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) + throws ApiException { + deleteUserImageWithHttpInfo(userId, headers); } /** @@ -352,7 +528,20 @@ public void deleteUserImage(@org.eclipse.jdt.annotation.NonNull UUID userId) thr */ public ApiResponse deleteUserImageWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteUserImageRequestBuilder(userId); + return deleteUserImageWithHttpInfo(userId, null); + } + + /** + * Delete the user's image. + * + * @param userId User Id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserImageWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteUserImageRequestBuilder(userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -379,8 +568,8 @@ public ApiResponse deleteUserImageWithHttpInfo(@org.eclipse.jdt.annotation } } - private HttpRequest.Builder deleteUserImageRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId) - throws ApiException { + private HttpRequest.Builder deleteUserImageRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -410,6 +599,8 @@ private HttpRequest.Builder deleteUserImageRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -451,9 +642,51 @@ public File getArtistImage(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getArtistImage(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + null); + } + + /** + * Get artist image by name. + * + * @param name Artist name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getArtistImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { ApiResponse localVarResponse = getArtistImageWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer); + backgroundColor, foregroundLayer, headers); return localVarResponse.getData(); } @@ -492,9 +725,51 @@ public ApiResponse getArtistImageWithHttpInfo(@org.eclipse.jdt.annotation. @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getArtistImageWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + null); + } + + /** + * Get artist image by name. + * + * @param name Artist name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getArtistImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getArtistImageRequestBuilder(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, - fillHeight, blur, backgroundColor, foregroundLayer); + fillHeight, blur, backgroundColor, foregroundLayer, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -509,13 +784,13 @@ public ApiResponse getArtistImageWithHttpInfo(@org.eclipse.jdt.annotation. return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -537,7 +812,8 @@ private HttpRequest.Builder getArtistImageRequestBuilder(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling getArtistImage"); @@ -608,6 +884,8 @@ private HttpRequest.Builder getArtistImageRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -649,10 +927,8 @@ public File getGenreImage(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { - ApiResponse localVarResponse = getGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, - maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); - return localVarResponse.getData(); + return getGenreImage(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, + height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, imageIndex, null); } /** @@ -675,10 +951,11 @@ public File getGenreImage(@org.eclipse.jdt.annotation.Nullable String name, * @param backgroundColor Optional. Apply a background color for transparent images. (optional) * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) * @param imageIndex Image index. (optional) - * @return ApiResponse<File> + * @param headers Optional headers to include in the request + * @return File * @throws ApiException if fails to make API call */ - public ApiResponse getGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + public File getGenreImage(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull ImageFormat format, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, @@ -689,42 +966,37 @@ public ApiResponse getGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.N @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, - @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getGenreImageRequestBuilder(name, imageType, tag, format, maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + ApiResponse localVarResponse = getGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); - try { - HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode() / 100 != 2) { - throw getApiException("getGenreImage", localVarResponse); - } - if (localVarResponse.body() == null) { - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); - } - - String responseBody = new String(localVarResponse.body().readAllBytes()); - localVarResponse.body().close(); - - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } + backgroundColor, foregroundLayer, imageIndex, headers); + return localVarResponse.getData(); } - private HttpRequest.Builder getGenreImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull ImageFormat format, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, @@ -736,13 +1008,100 @@ private HttpRequest.Builder getGenreImageRequestBuilder(@org.eclipse.jdt.annotat @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { - // verify the required parameter 'name' is set - if (name == null) { - throw new ApiException(400, "Missing the required parameter 'name' when calling getGenreImage"); - } - // verify the required parameter 'imageType' is set - if (imageType == null) { - throw new ApiException(400, "Missing the required parameter 'imageType' when calling getGenreImage"); + return getGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + imageIndex, null); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGenreImageRequestBuilder(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getGenreImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getGenreImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getGenreImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getGenreImage"); } HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -803,6 +1162,8 @@ private HttpRequest.Builder getGenreImageRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -844,9 +1205,51 @@ public File getGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String nam @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getGenreImageByIndex(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + null); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { ApiResponse localVarResponse = getGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer); + backgroundColor, foregroundLayer, headers); return localVarResponse.getData(); } @@ -885,9 +1288,51 @@ public ApiResponse getGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annot @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, + foregroundLayer, null); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getGenreImageByIndexRequestBuilder(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, - fillHeight, blur, backgroundColor, foregroundLayer); + fillHeight, blur, backgroundColor, foregroundLayer, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -902,13 +1347,13 @@ public ApiResponse getGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annot return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -930,7 +1375,8 @@ private HttpRequest.Builder getGenreImageByIndexRequestBuilder(@org.eclipse.jdt. @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling getGenreImageByIndex"); @@ -1002,6 +1448,8 @@ private HttpRequest.Builder getGenreImageByIndexRequestBuilder(@org.eclipse.jdt. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1043,9 +1491,49 @@ public File getItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getItemImage(itemId, imageType, maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, + format, percentPlayed, unplayedCount, blur, backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { ApiResponse localVarResponse = getItemImageWithHttpInfo(itemId, imageType, maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); return localVarResponse.getData(); } @@ -1084,9 +1572,50 @@ public ApiResponse getItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nu @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getItemImageWithHttpInfo(itemId, imageType, maxWidth, maxHeight, width, height, quality, fillWidth, + fillHeight, tag, format, percentPlayed, unplayedCount, blur, backgroundColor, foregroundLayer, + imageIndex, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getItemImageRequestBuilder(itemId, imageType, maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1101,13 +1630,13 @@ public ApiResponse getItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nu return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1129,7 +1658,7 @@ private HttpRequest.Builder getItemImageRequestBuilder(@org.eclipse.jdt.annotati @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, - @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemImage"); @@ -1197,6 +1726,8 @@ private HttpRequest.Builder getItemImageRequestBuilder(@org.eclipse.jdt.annotati if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1239,9 +1770,52 @@ public File getItemImage2(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getItemImage2(itemId, imageType, maxWidth, maxHeight, tag, format, percentPlayed, unplayedCount, + imageIndex, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (required) + * @param maxHeight The maximum image height to return. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (required) + * @param format Determines the output format of the image - original,gif,jpg,png. (required) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (required) + * @param unplayedCount Optional. Unplayed count overlay to render. (required) + * @param imageIndex Image index. (required) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getItemImage2(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { ApiResponse localVarResponse = getItemImage2WithHttpInfo(itemId, imageType, maxWidth, maxHeight, tag, format, percentPlayed, unplayedCount, imageIndex, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer); + backgroundColor, foregroundLayer, headers); return localVarResponse.getData(); } @@ -1281,9 +1855,52 @@ public ApiResponse getItemImage2WithHttpInfo(@org.eclipse.jdt.annotation.N @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getItemImage2WithHttpInfo(itemId, imageType, maxWidth, maxHeight, tag, format, percentPlayed, + unplayedCount, imageIndex, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, + foregroundLayer, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (required) + * @param maxHeight The maximum image height to return. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (required) + * @param format Determines the output format of the image - original,gif,jpg,png. (required) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (required) + * @param unplayedCount Optional. Unplayed count overlay to render. (required) + * @param imageIndex Image index. (required) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemImage2WithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getItemImage2RequestBuilder(itemId, imageType, maxWidth, maxHeight, tag, format, percentPlayed, unplayedCount, imageIndex, width, height, quality, fillWidth, fillHeight, - blur, backgroundColor, foregroundLayer); + blur, backgroundColor, foregroundLayer, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1298,13 +1915,13 @@ public ApiResponse getItemImage2WithHttpInfo(@org.eclipse.jdt.annotation.N return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1327,7 +1944,8 @@ private HttpRequest.Builder getItemImage2RequestBuilder(@org.eclipse.jdt.annotat @org.eclipse.jdt.annotation.NonNull Integer fillWidth, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemImage2"); @@ -1416,6 +2034,8 @@ private HttpRequest.Builder getItemImage2RequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1442,10 +2062,93 @@ private HttpRequest.Builder getItemImage2RequestBuilder(@org.eclipse.jdt.annotat * @param blur Optional. Blur image. (optional) * @param backgroundColor Optional. Apply a background color for transparent images. (optional) * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) - * @return File + * @return File + * @throws ApiException if fails to make API call + */ + public File getItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getItemImageByIndex(itemId, imageType, imageIndex, maxWidth, maxHeight, width, height, quality, + fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, blur, backgroundColor, + foregroundLayer, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = getItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, maxWidth, + maxHeight, width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, + blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> * @throws ApiException if fails to make API call */ - public File getItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + public ApiResponse getItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, @@ -1457,10 +2160,9 @@ public File getItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { - ApiResponse localVarResponse = getItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, maxWidth, - maxHeight, width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, - blur, backgroundColor, foregroundLayer); - return localVarResponse.getData(); + return getItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, maxWidth, maxHeight, width, height, + quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, blur, backgroundColor, + foregroundLayer, null); } /** @@ -1483,6 +2185,7 @@ public File getItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId * @param blur Optional. Blur image. (optional) * @param backgroundColor Optional. Apply a background color for transparent images. (optional) * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request * @return ApiResponse<File> * @throws ApiException if fails to make API call */ @@ -1497,10 +2200,11 @@ public ApiResponse getItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.NonNull Double percentPlayed, @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getItemImageByIndexRequestBuilder(itemId, imageType, imageIndex, maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, - unplayedCount, blur, backgroundColor, foregroundLayer); + unplayedCount, blur, backgroundColor, foregroundLayer, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1515,13 +2219,13 @@ public ApiResponse getItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annota return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1543,7 +2247,8 @@ private HttpRequest.Builder getItemImageByIndexRequestBuilder(@org.eclipse.jdt.a @org.eclipse.jdt.annotation.NonNull Double percentPlayed, @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemImageByIndex"); @@ -1614,6 +2319,8 @@ private HttpRequest.Builder getItemImageByIndexRequestBuilder(@org.eclipse.jdt.a if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1628,7 +2335,20 @@ private HttpRequest.Builder getItemImageByIndexRequestBuilder(@org.eclipse.jdt.a * @throws ApiException if fails to make API call */ public List getItemImageInfos(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - ApiResponse> localVarResponse = getItemImageInfosWithHttpInfo(itemId); + return getItemImageInfos(itemId, null); + } + + /** + * Get item image infos. + * + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return List<ImageInfo> + * @throws ApiException if fails to make API call + */ + public List getItemImageInfos(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getItemImageInfosWithHttpInfo(itemId, headers); return localVarResponse.getData(); } @@ -1641,7 +2361,20 @@ public List getItemImageInfos(@org.eclipse.jdt.annotation.Nullable UU */ public ApiResponse> getItemImageInfosWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getItemImageInfosRequestBuilder(itemId); + return getItemImageInfosWithHttpInfo(itemId, null); + } + + /** + * Get item image infos. + * + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<ImageInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getItemImageInfosWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemImageInfosRequestBuilder(itemId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1658,12 +2391,14 @@ public ApiResponse> getItemImageInfosWithHttpInfo(@org.eclipse.j } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1674,8 +2409,8 @@ public ApiResponse> getItemImageInfosWithHttpInfo(@org.eclipse.j } } - private HttpRequest.Builder getItemImageInfosRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) - throws ApiException { + private HttpRequest.Builder getItemImageInfosRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemImageInfos"); @@ -1694,6 +2429,8 @@ private HttpRequest.Builder getItemImageInfosRequestBuilder(@org.eclipse.jdt.ann if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1735,9 +2472,50 @@ public File getMusicGenreImage(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getMusicGenreImage(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, + width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, imageIndex, + null); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getMusicGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { ApiResponse localVarResponse = getMusicGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); return localVarResponse.getData(); } @@ -1776,9 +2554,50 @@ public ApiResponse getMusicGenreImageWithHttpInfo(@org.eclipse.jdt.annotat @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getMusicGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + imageIndex, null); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMusicGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getMusicGenreImageRequestBuilder(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1793,13 +2612,13 @@ public ApiResponse getMusicGenreImageWithHttpInfo(@org.eclipse.jdt.annotat return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1821,7 +2640,7 @@ private HttpRequest.Builder getMusicGenreImageRequestBuilder(@org.eclipse.jdt.an @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, - @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling getMusicGenreImage"); @@ -1889,6 +2708,8 @@ private HttpRequest.Builder getMusicGenreImageRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1930,9 +2751,51 @@ public File getMusicGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable Strin @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getMusicGenreImageByIndex(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + null); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getMusicGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { ApiResponse localVarResponse = getMusicGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, - fillHeight, blur, backgroundColor, foregroundLayer); + fillHeight, blur, backgroundColor, foregroundLayer, headers); return localVarResponse.getData(); } @@ -1971,9 +2834,51 @@ public ApiResponse getMusicGenreImageByIndexWithHttpInfo(@org.eclipse.jdt. @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getMusicGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, + foregroundLayer, null); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMusicGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getMusicGenreImageByIndexRequestBuilder(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, - fillWidth, fillHeight, blur, backgroundColor, foregroundLayer); + fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1988,13 +2893,13 @@ public ApiResponse getMusicGenreImageByIndexWithHttpInfo(@org.eclipse.jdt. return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -2016,7 +2921,8 @@ private HttpRequest.Builder getMusicGenreImageByIndexRequestBuilder( @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling getMusicGenreImageByIndex"); @@ -2089,6 +2995,8 @@ private HttpRequest.Builder getMusicGenreImageByIndexRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2115,10 +3023,91 @@ private HttpRequest.Builder getMusicGenreImageByIndexRequestBuilder( * @param backgroundColor Optional. Apply a background color for transparent images. (optional) * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) * @param imageIndex Image index. (optional) - * @return File + * @return File + * @throws ApiException if fails to make API call + */ + public File getPersonImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getPersonImage(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, + height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getPersonImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + ApiResponse localVarResponse = getPersonImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex, headers); + return localVarResponse.getData(); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> * @throws ApiException if fails to make API call */ - public File getPersonImage(@org.eclipse.jdt.annotation.Nullable String name, + public ApiResponse getPersonImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull ImageFormat format, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, @@ -2130,10 +3119,9 @@ public File getPersonImage(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { - ApiResponse localVarResponse = getPersonImageWithHttpInfo(name, imageType, tag, format, maxWidth, - maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); - return localVarResponse.getData(); + return getPersonImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + imageIndex, null); } /** @@ -2156,6 +3144,7 @@ public File getPersonImage(@org.eclipse.jdt.annotation.Nullable String name, * @param backgroundColor Optional. Apply a background color for transparent images. (optional) * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request * @return ApiResponse<File> * @throws ApiException if fails to make API call */ @@ -2170,10 +3159,10 @@ public ApiResponse getPersonImageWithHttpInfo(@org.eclipse.jdt.annotation. @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, - @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getPersonImageRequestBuilder(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2188,13 +3177,13 @@ public ApiResponse getPersonImageWithHttpInfo(@org.eclipse.jdt.annotation. return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -2216,7 +3205,7 @@ private HttpRequest.Builder getPersonImageRequestBuilder(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, - @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling getPersonImage"); @@ -2284,6 +3273,8 @@ private HttpRequest.Builder getPersonImageRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2325,9 +3316,51 @@ public File getPersonImageByIndex(@org.eclipse.jdt.annotation.Nullable String na @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getPersonImageByIndex(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + null); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getPersonImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { ApiResponse localVarResponse = getPersonImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer); + backgroundColor, foregroundLayer, headers); return localVarResponse.getData(); } @@ -2366,9 +3399,51 @@ public ApiResponse getPersonImageByIndexWithHttpInfo(@org.eclipse.jdt.anno @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getPersonImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, + foregroundLayer, null); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPersonImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getPersonImageByIndexRequestBuilder(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, - fillHeight, blur, backgroundColor, foregroundLayer); + fillHeight, blur, backgroundColor, foregroundLayer, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2383,13 +3458,13 @@ public ApiResponse getPersonImageByIndexWithHttpInfo(@org.eclipse.jdt.anno return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -2411,7 +3486,8 @@ private HttpRequest.Builder getPersonImageByIndexRequestBuilder(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling getPersonImageByIndex"); @@ -2484,6 +3560,8 @@ private HttpRequest.Builder getPersonImageByIndexRequestBuilder(@org.eclipse.jdt if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2517,8 +3595,40 @@ public File getSplashscreen(@org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer quality) throws ApiException { + return getSplashscreen(tag, format, maxWidth, maxHeight, width, height, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, quality, null); + } + + /** + * Generates or gets the splashscreen. + * + * @param tag Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Blur image. (optional) + * @param backgroundColor Apply a background color for transparent images. (optional) + * @param foregroundLayer Apply a foreground layer on top of the image. (optional) + * @param quality Quality setting, from 0-100. (optional, default to 90) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getSplashscreen(@org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer quality, Map headers) throws ApiException { ApiResponse localVarResponse = getSplashscreenWithHttpInfo(tag, format, maxWidth, maxHeight, width, - height, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, quality); + height, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, quality, headers); return localVarResponse.getData(); } @@ -2549,8 +3659,40 @@ public ApiResponse getSplashscreenWithHttpInfo(@org.eclipse.jdt.annotation @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer quality) throws ApiException { + return getSplashscreenWithHttpInfo(tag, format, maxWidth, maxHeight, width, height, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, quality, null); + } + + /** + * Generates or gets the splashscreen. + * + * @param tag Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Blur image. (optional) + * @param backgroundColor Apply a background color for transparent images. (optional) + * @param foregroundLayer Apply a foreground layer on top of the image. (optional) + * @param quality Quality setting, from 0-100. (optional, default to 90) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSplashscreenWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer quality, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getSplashscreenRequestBuilder(tag, format, maxWidth, maxHeight, - width, height, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, quality); + width, height, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, quality, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2565,13 +3707,13 @@ public ApiResponse getSplashscreenWithHttpInfo(@org.eclipse.jdt.annotation return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -2590,7 +3732,7 @@ private HttpRequest.Builder getSplashscreenRequestBuilder(@org.eclipse.jdt.annot @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, - @org.eclipse.jdt.annotation.NonNull Integer quality) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer quality, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -2641,6 +3783,8 @@ private HttpRequest.Builder getSplashscreenRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2682,9 +3826,49 @@ public File getStudioImage(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getStudioImage(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, + height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getStudioImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { ApiResponse localVarResponse = getStudioImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); return localVarResponse.getData(); } @@ -2723,9 +3907,50 @@ public ApiResponse getStudioImageWithHttpInfo(@org.eclipse.jdt.annotation. @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getStudioImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + imageIndex, null); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStudioImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getStudioImageRequestBuilder(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2740,13 +3965,13 @@ public ApiResponse getStudioImageWithHttpInfo(@org.eclipse.jdt.annotation. return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -2768,7 +3993,7 @@ private HttpRequest.Builder getStudioImageRequestBuilder(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, - @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling getStudioImage"); @@ -2836,6 +4061,8 @@ private HttpRequest.Builder getStudioImageRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2876,10 +4103,52 @@ public File getStudioImageByIndex(@org.eclipse.jdt.annotation.Nullable String na @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getStudioImageByIndex(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + null); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getStudioImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { ApiResponse localVarResponse = getStudioImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer); + backgroundColor, foregroundLayer, headers); return localVarResponse.getData(); } @@ -2918,9 +4187,51 @@ public ApiResponse getStudioImageByIndexWithHttpInfo(@org.eclipse.jdt.anno @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getStudioImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, + foregroundLayer, null); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStudioImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getStudioImageByIndexRequestBuilder(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, - fillHeight, blur, backgroundColor, foregroundLayer); + fillHeight, blur, backgroundColor, foregroundLayer, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2935,13 +4246,13 @@ public ApiResponse getStudioImageByIndexWithHttpInfo(@org.eclipse.jdt.anno return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -2963,7 +4274,8 @@ private HttpRequest.Builder getStudioImageByIndexRequestBuilder(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling getStudioImageByIndex"); @@ -3036,6 +4348,8 @@ private HttpRequest.Builder getStudioImageByIndexRequestBuilder(@org.eclipse.jdt if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -3075,9 +4389,47 @@ public File getUserImage(@org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getUserImage(userId, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, + quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get user profile image. + * + * @param userId User id. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getUserImage(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { ApiResponse localVarResponse = getUserImageWithHttpInfo(userId, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, - foregroundLayer, imageIndex); + foregroundLayer, imageIndex, headers); return localVarResponse.getData(); } @@ -3114,9 +4466,47 @@ public ApiResponse getUserImageWithHttpInfo(@org.eclipse.jdt.annotation.No @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getUserImageWithHttpInfo(userId, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, + height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get user profile image. + * + * @param userId User id. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserImageWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getUserImageRequestBuilder(userId, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -3131,13 +4521,13 @@ public ApiResponse getUserImageWithHttpInfo(@org.eclipse.jdt.annotation.No return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -3158,7 +4548,7 @@ private HttpRequest.Builder getUserImageRequestBuilder(@org.eclipse.jdt.annotati @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, - @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -3218,6 +4608,8 @@ private HttpRequest.Builder getUserImageRequestBuilder(@org.eclipse.jdt.annotati if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -3259,9 +4651,51 @@ public File headArtistImage(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headArtistImage(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + null); + } + + /** + * Get artist image by name. + * + * @param name Artist name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headArtistImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { ApiResponse localVarResponse = headArtistImageWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer); + backgroundColor, foregroundLayer, headers); return localVarResponse.getData(); } @@ -3300,9 +4734,51 @@ public ApiResponse headArtistImageWithHttpInfo(@org.eclipse.jdt.annotation @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headArtistImageWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + null); + } + + /** + * Get artist image by name. + * + * @param name Artist name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headArtistImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = headArtistImageRequestBuilder(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, - fillHeight, blur, backgroundColor, foregroundLayer); + fillHeight, blur, backgroundColor, foregroundLayer, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -3317,13 +4793,13 @@ public ApiResponse headArtistImageWithHttpInfo(@org.eclipse.jdt.annotation return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -3345,7 +4821,8 @@ private HttpRequest.Builder headArtistImageRequestBuilder(@org.eclipse.jdt.annot @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling headArtistImage"); @@ -3416,6 +4893,8 @@ private HttpRequest.Builder headArtistImageRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -3442,10 +4921,91 @@ private HttpRequest.Builder headArtistImageRequestBuilder(@org.eclipse.jdt.annot * @param backgroundColor Optional. Apply a background color for transparent images. (optional) * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) * @param imageIndex Image index. (optional) - * @return File + * @return File + * @throws ApiException if fails to make API call + */ + public File headGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headGenreImage(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, + height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + ApiResponse localVarResponse = headGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, imageIndex, headers); + return localVarResponse.getData(); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> * @throws ApiException if fails to make API call */ - public File headGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + public ApiResponse headGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull ImageFormat format, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, @@ -3457,10 +5017,9 @@ public File headGenreImage(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { - ApiResponse localVarResponse = headGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, - maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); - return localVarResponse.getData(); + return headGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + imageIndex, null); } /** @@ -3483,6 +5042,7 @@ public File headGenreImage(@org.eclipse.jdt.annotation.Nullable String name, * @param backgroundColor Optional. Apply a background color for transparent images. (optional) * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request * @return ApiResponse<File> * @throws ApiException if fails to make API call */ @@ -3497,10 +5057,10 @@ public ApiResponse headGenreImageWithHttpInfo(@org.eclipse.jdt.annotation. @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, - @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = headGenreImageRequestBuilder(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -3515,13 +5075,13 @@ public ApiResponse headGenreImageWithHttpInfo(@org.eclipse.jdt.annotation. return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -3543,7 +5103,7 @@ private HttpRequest.Builder headGenreImageRequestBuilder(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, - @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling headGenreImage"); @@ -3611,6 +5171,8 @@ private HttpRequest.Builder headGenreImageRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -3652,9 +5214,51 @@ public File headGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String na @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headGenreImageByIndex(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + null); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { ApiResponse localVarResponse = headGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer); + backgroundColor, foregroundLayer, headers); return localVarResponse.getData(); } @@ -3693,9 +5297,51 @@ public ApiResponse headGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.anno @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, + foregroundLayer, null); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = headGenreImageByIndexRequestBuilder(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, - fillHeight, blur, backgroundColor, foregroundLayer); + fillHeight, blur, backgroundColor, foregroundLayer, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -3710,13 +5356,13 @@ public ApiResponse headGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.anno return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -3738,7 +5384,8 @@ private HttpRequest.Builder headGenreImageByIndexRequestBuilder(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling headGenreImageByIndex"); @@ -3811,6 +5458,8 @@ private HttpRequest.Builder headGenreImageByIndexRequestBuilder(@org.eclipse.jdt if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -3852,9 +5501,49 @@ public File headItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headItemImage(itemId, imageType, maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, + format, percentPlayed, unplayedCount, blur, backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { ApiResponse localVarResponse = headItemImageWithHttpInfo(itemId, imageType, maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); return localVarResponse.getData(); } @@ -3893,9 +5582,50 @@ public ApiResponse headItemImageWithHttpInfo(@org.eclipse.jdt.annotation.N @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headItemImageWithHttpInfo(itemId, imageType, maxWidth, maxHeight, width, height, quality, fillWidth, + fillHeight, tag, format, percentPlayed, unplayedCount, blur, backgroundColor, foregroundLayer, + imageIndex, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = headItemImageRequestBuilder(itemId, imageType, maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -3910,13 +5640,13 @@ public ApiResponse headItemImageWithHttpInfo(@org.eclipse.jdt.annotation.N return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -3938,7 +5668,7 @@ private HttpRequest.Builder headItemImageRequestBuilder(@org.eclipse.jdt.annotat @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, - @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling headItemImage"); @@ -4006,6 +5736,8 @@ private HttpRequest.Builder headItemImageRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -4032,10 +5764,95 @@ private HttpRequest.Builder headItemImageRequestBuilder(@org.eclipse.jdt.annotat * @param blur Optional. Blur image. (optional) * @param backgroundColor Optional. Apply a background color for transparent images. (optional) * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) - * @return File + * @return File + * @throws ApiException if fails to make API call + */ + public File headItemImage2(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headItemImage2(itemId, imageType, maxWidth, maxHeight, tag, format, percentPlayed, unplayedCount, + imageIndex, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (required) + * @param maxHeight The maximum image height to return. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (required) + * @param format Determines the output format of the image - original,gif,jpg,png. (required) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (required) + * @param unplayedCount Optional. Unplayed count overlay to render. (required) + * @param imageIndex Image index. (required) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headItemImage2(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = headItemImage2WithHttpInfo(itemId, imageType, maxWidth, maxHeight, tag, + format, percentPlayed, unplayedCount, imageIndex, width, height, quality, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (required) + * @param maxHeight The maximum image height to return. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (required) + * @param format Determines the output format of the image - original,gif,jpg,png. (required) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (required) + * @param unplayedCount Optional. Unplayed count overlay to render. (required) + * @param imageIndex Image index. (required) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> * @throws ApiException if fails to make API call */ - public File headItemImage2(@org.eclipse.jdt.annotation.Nullable UUID itemId, + public ApiResponse headItemImage2WithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.Nullable Integer maxWidth, @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, @@ -4048,10 +5865,9 @@ public File headItemImage2(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { - ApiResponse localVarResponse = headItemImage2WithHttpInfo(itemId, imageType, maxWidth, maxHeight, tag, - format, percentPlayed, unplayedCount, imageIndex, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer); - return localVarResponse.getData(); + return headItemImage2WithHttpInfo(itemId, imageType, maxWidth, maxHeight, tag, format, percentPlayed, + unplayedCount, imageIndex, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, + foregroundLayer, null); } /** @@ -4074,6 +5890,7 @@ public File headItemImage2(@org.eclipse.jdt.annotation.Nullable UUID itemId, * @param blur Optional. Blur image. (optional) * @param backgroundColor Optional. Apply a background color for transparent images. (optional) * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request * @return ApiResponse<File> * @throws ApiException if fails to make API call */ @@ -4089,10 +5906,11 @@ public ApiResponse headItemImage2WithHttpInfo(@org.eclipse.jdt.annotation. @org.eclipse.jdt.annotation.NonNull Integer fillWidth, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = headItemImage2RequestBuilder(itemId, imageType, maxWidth, maxHeight, tag, format, percentPlayed, unplayedCount, imageIndex, width, height, quality, fillWidth, - fillHeight, blur, backgroundColor, foregroundLayer); + fillHeight, blur, backgroundColor, foregroundLayer, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -4107,13 +5925,13 @@ public ApiResponse headItemImage2WithHttpInfo(@org.eclipse.jdt.annotation. return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -4136,7 +5954,8 @@ private HttpRequest.Builder headItemImage2RequestBuilder(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.NonNull Integer fillWidth, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling headItemImage2"); @@ -4225,6 +6044,8 @@ private HttpRequest.Builder headItemImage2RequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -4266,9 +6087,51 @@ public File headItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemI @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headItemImageByIndex(itemId, imageType, imageIndex, maxWidth, maxHeight, width, height, quality, + fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, blur, backgroundColor, + foregroundLayer, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { ApiResponse localVarResponse = headItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, - blur, backgroundColor, foregroundLayer); + blur, backgroundColor, foregroundLayer, headers); return localVarResponse.getData(); } @@ -4307,9 +6170,51 @@ public ApiResponse headItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annot @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, maxWidth, maxHeight, width, height, + quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, blur, backgroundColor, + foregroundLayer, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = headItemImageByIndexRequestBuilder(itemId, imageType, imageIndex, maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, - unplayedCount, blur, backgroundColor, foregroundLayer); + unplayedCount, blur, backgroundColor, foregroundLayer, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -4324,13 +6229,13 @@ public ApiResponse headItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annot return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -4352,7 +6257,8 @@ private HttpRequest.Builder headItemImageByIndexRequestBuilder(@org.eclipse.jdt. @org.eclipse.jdt.annotation.NonNull Double percentPlayed, @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling headItemImageByIndex"); @@ -4424,6 +6330,8 @@ private HttpRequest.Builder headItemImageByIndexRequestBuilder(@org.eclipse.jdt. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -4465,9 +6373,50 @@ public File headMusicGenreImage(@org.eclipse.jdt.annotation.Nullable String name @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headMusicGenreImage(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, + width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, imageIndex, + null); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headMusicGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { ApiResponse localVarResponse = headMusicGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); return localVarResponse.getData(); } @@ -4506,9 +6455,50 @@ public ApiResponse headMusicGenreImageWithHttpInfo(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headMusicGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + imageIndex, null); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headMusicGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = headMusicGenreImageRequestBuilder(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -4523,13 +6513,13 @@ public ApiResponse headMusicGenreImageWithHttpInfo(@org.eclipse.jdt.annota return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -4551,7 +6541,7 @@ private HttpRequest.Builder headMusicGenreImageRequestBuilder(@org.eclipse.jdt.a @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, - @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling headMusicGenreImage"); @@ -4619,6 +6609,8 @@ private HttpRequest.Builder headMusicGenreImageRequestBuilder(@org.eclipse.jdt.a if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -4660,9 +6652,51 @@ public File headMusicGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable Stri @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headMusicGenreImageByIndex(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + null); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headMusicGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { ApiResponse localVarResponse = headMusicGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, - fillHeight, blur, backgroundColor, foregroundLayer); + fillHeight, blur, backgroundColor, foregroundLayer, headers); return localVarResponse.getData(); } @@ -4700,10 +6734,52 @@ public ApiResponse headMusicGenreImageByIndexWithHttpInfo(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headMusicGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, + foregroundLayer, null); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headMusicGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = headMusicGenreImageByIndexRequestBuilder(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, - fillWidth, fillHeight, blur, backgroundColor, foregroundLayer); + fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -4718,13 +6794,13 @@ public ApiResponse headMusicGenreImageByIndexWithHttpInfo(@org.eclipse.jdt return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -4746,7 +6822,8 @@ private HttpRequest.Builder headMusicGenreImageByIndexRequestBuilder( @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, @@ -4820,6 +6897,8 @@ private HttpRequest.Builder headMusicGenreImageByIndexRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -4861,9 +6940,49 @@ public File headPersonImage(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headPersonImage(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, + height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headPersonImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { ApiResponse localVarResponse = headPersonImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); return localVarResponse.getData(); } @@ -4902,9 +7021,50 @@ public ApiResponse headPersonImageWithHttpInfo(@org.eclipse.jdt.annotation @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headPersonImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + imageIndex, null); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headPersonImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = headPersonImageRequestBuilder(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -4919,13 +7079,13 @@ public ApiResponse headPersonImageWithHttpInfo(@org.eclipse.jdt.annotation return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -4947,7 +7107,7 @@ private HttpRequest.Builder headPersonImageRequestBuilder(@org.eclipse.jdt.annot @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, - @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling headPersonImage"); @@ -5015,6 +7175,8 @@ private HttpRequest.Builder headPersonImageRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -5056,9 +7218,51 @@ public File headPersonImageByIndex(@org.eclipse.jdt.annotation.Nullable String n @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headPersonImageByIndex(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + null); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headPersonImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { ApiResponse localVarResponse = headPersonImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, - fillHeight, blur, backgroundColor, foregroundLayer); + fillHeight, blur, backgroundColor, foregroundLayer, headers); return localVarResponse.getData(); } @@ -5097,9 +7301,51 @@ public ApiResponse headPersonImageByIndexWithHttpInfo(@org.eclipse.jdt.ann @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headPersonImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, + foregroundLayer, null); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headPersonImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = headPersonImageByIndexRequestBuilder(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, - fillHeight, blur, backgroundColor, foregroundLayer); + fillHeight, blur, backgroundColor, foregroundLayer, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -5114,13 +7360,13 @@ public ApiResponse headPersonImageByIndexWithHttpInfo(@org.eclipse.jdt.ann return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -5142,7 +7388,8 @@ private HttpRequest.Builder headPersonImageByIndexRequestBuilder(@org.eclipse.jd @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling headPersonImageByIndex"); @@ -5215,6 +7462,8 @@ private HttpRequest.Builder headPersonImageByIndexRequestBuilder(@org.eclipse.jd if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -5256,9 +7505,49 @@ public File headStudioImage(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headStudioImage(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, + height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headStudioImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { ApiResponse localVarResponse = headStudioImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); return localVarResponse.getData(); } @@ -5297,9 +7586,50 @@ public ApiResponse headStudioImageWithHttpInfo(@org.eclipse.jdt.annotation @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headStudioImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + imageIndex, null); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headStudioImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = headStudioImageRequestBuilder(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -5314,13 +7644,13 @@ public ApiResponse headStudioImageWithHttpInfo(@org.eclipse.jdt.annotation return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -5342,7 +7672,7 @@ private HttpRequest.Builder headStudioImageRequestBuilder(@org.eclipse.jdt.annot @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, - @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling headStudioImage"); @@ -5410,6 +7740,8 @@ private HttpRequest.Builder headStudioImageRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -5450,10 +7782,52 @@ public File headStudioImageByIndex(@org.eclipse.jdt.annotation.Nullable String n @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headStudioImageByIndex(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, + null); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headStudioImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { ApiResponse localVarResponse = headStudioImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, - fillHeight, blur, backgroundColor, foregroundLayer); + fillHeight, blur, backgroundColor, foregroundLayer, headers); return localVarResponse.getData(); } @@ -5492,9 +7866,51 @@ public ApiResponse headStudioImageByIndexWithHttpInfo(@org.eclipse.jdt.ann @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headStudioImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, + foregroundLayer, null); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headStudioImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = headStudioImageByIndexRequestBuilder(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, - fillHeight, blur, backgroundColor, foregroundLayer); + fillHeight, blur, backgroundColor, foregroundLayer, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -5509,13 +7925,13 @@ public ApiResponse headStudioImageByIndexWithHttpInfo(@org.eclipse.jdt.ann return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -5537,7 +7953,8 @@ private HttpRequest.Builder headStudioImageByIndexRequestBuilder(@org.eclipse.jd @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, - @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling headStudioImageByIndex"); @@ -5610,6 +8027,8 @@ private HttpRequest.Builder headStudioImageByIndexRequestBuilder(@org.eclipse.jd if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -5649,9 +8068,47 @@ public File headUserImage(@org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headUserImage(userId, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, + quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get user profile image. + * + * @param userId User id. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headUserImage(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { ApiResponse localVarResponse = headUserImageWithHttpInfo(userId, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, - foregroundLayer, imageIndex); + foregroundLayer, imageIndex, headers); return localVarResponse.getData(); } @@ -5688,9 +8145,47 @@ public ApiResponse headUserImageWithHttpInfo(@org.eclipse.jdt.annotation.N @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headUserImageWithHttpInfo(userId, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, + height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get user profile image. + * + * @param userId User id. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headUserImageWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = headUserImageRequestBuilder(userId, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, - backgroundColor, foregroundLayer, imageIndex); + backgroundColor, foregroundLayer, imageIndex, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -5705,13 +8200,13 @@ public ApiResponse headUserImageWithHttpInfo(@org.eclipse.jdt.annotation.N return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -5732,7 +8227,7 @@ private HttpRequest.Builder headUserImageRequestBuilder(@org.eclipse.jdt.annotat @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, @org.eclipse.jdt.annotation.NonNull String backgroundColor, @org.eclipse.jdt.annotation.NonNull String foregroundLayer, - @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -5792,6 +8287,8 @@ private HttpRequest.Builder headUserImageRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -5807,7 +8304,20 @@ private HttpRequest.Builder headUserImageRequestBuilder(@org.eclipse.jdt.annotat */ public void postUserImage(@org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull File body) throws ApiException { - postUserImageWithHttpInfo(userId, body); + postUserImage(userId, body, null); + } + + /** + * Sets the user image. + * + * @param userId User Id. (optional) + * @param body (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postUserImage(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull File body, Map headers) throws ApiException { + postUserImageWithHttpInfo(userId, body, headers); } /** @@ -5820,7 +8330,21 @@ public void postUserImage(@org.eclipse.jdt.annotation.NonNull UUID userId, */ public ApiResponse postUserImageWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull File body) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = postUserImageRequestBuilder(userId, body); + return postUserImageWithHttpInfo(userId, body, null); + } + + /** + * Sets the user image. + * + * @param userId User Id. (optional) + * @param body (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUserImageWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull File body, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postUserImageRequestBuilder(userId, body, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -5848,7 +8372,7 @@ public ApiResponse postUserImageWithHttpInfo(@org.eclipse.jdt.annotation.N } private HttpRequest.Builder postUserImageRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, - @org.eclipse.jdt.annotation.NonNull File body) throws ApiException { + @org.eclipse.jdt.annotation.NonNull File body, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -5884,6 +8408,8 @@ private HttpRequest.Builder postUserImageRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -5901,7 +8427,22 @@ private HttpRequest.Builder postUserImageRequestBuilder(@org.eclipse.jdt.annotat public void setItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull File body) throws ApiException { - setItemImageWithHttpInfo(itemId, imageType, body); + setItemImage(itemId, imageType, body, null); + } + + /** + * Set item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param body (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void setItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + setItemImageWithHttpInfo(itemId, imageType, body, headers); } /** @@ -5916,7 +8457,23 @@ public void setItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, public ApiResponse setItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull File body) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = setItemImageRequestBuilder(itemId, imageType, body); + return setItemImageWithHttpInfo(itemId, imageType, body, null); + } + + /** + * Set item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param body (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = setItemImageRequestBuilder(itemId, imageType, body, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -5944,8 +8501,8 @@ public ApiResponse setItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nu } private HttpRequest.Builder setItemImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull File body) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling setItemImage"); @@ -5976,6 +8533,8 @@ private HttpRequest.Builder setItemImageRequestBuilder(@org.eclipse.jdt.annotati if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -5995,7 +8554,24 @@ public void setItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull File body) throws ApiException { - setItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, body); + setItemImageByIndex(itemId, imageType, imageIndex, body, null); + } + + /** + * Set item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex (Unused) Image index. (required) + * @param body (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void setItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + setItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, body, headers); } /** @@ -6012,8 +8588,26 @@ public ApiResponse setItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull File body) throws ApiException { + return setItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, body, null); + } + + /** + * Set item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex (Unused) Image index. (required) + * @param body (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = setItemImageByIndexRequestBuilder(itemId, imageType, imageIndex, - body); + body, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -6042,8 +8636,8 @@ public ApiResponse setItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annota private HttpRequest.Builder setItemImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable ImageType imageType, - @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull File body) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling setItemImageByIndex"); @@ -6079,6 +8673,8 @@ private HttpRequest.Builder setItemImageByIndexRequestBuilder(@org.eclipse.jdt.a if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -6098,7 +8694,24 @@ public void updateItemImageIndex(@org.eclipse.jdt.annotation.Nullable UUID itemI @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.Nullable Integer newIndex) throws ApiException { - updateItemImageIndexWithHttpInfo(itemId, imageType, imageIndex, newIndex); + updateItemImageIndex(itemId, imageType, imageIndex, newIndex, null); + } + + /** + * Updates the index for an item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Old image index. (required) + * @param newIndex New image index. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateItemImageIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.Nullable Integer newIndex, Map headers) throws ApiException { + updateItemImageIndexWithHttpInfo(itemId, imageType, imageIndex, newIndex, headers); } /** @@ -6115,8 +8728,26 @@ public ApiResponse updateItemImageIndexWithHttpInfo(@org.eclipse.jdt.annot @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.Nullable Integer newIndex) throws ApiException { + return updateItemImageIndexWithHttpInfo(itemId, imageType, imageIndex, newIndex, null); + } + + /** + * Updates the index for an item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Old image index. (required) + * @param newIndex New image index. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateItemImageIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.Nullable Integer newIndex, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = updateItemImageIndexRequestBuilder(itemId, imageType, imageIndex, - newIndex); + newIndex, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -6146,7 +8777,7 @@ public ApiResponse updateItemImageIndexWithHttpInfo(@org.eclipse.jdt.annot private HttpRequest.Builder updateItemImageIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.Nullable Integer imageIndex, - @org.eclipse.jdt.annotation.Nullable Integer newIndex) throws ApiException { + @org.eclipse.jdt.annotation.Nullable Integer newIndex, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling updateItemImageIndex"); @@ -6196,6 +8827,8 @@ private HttpRequest.Builder updateItemImageIndexRequestBuilder(@org.eclipse.jdt. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -6209,7 +8842,19 @@ private HttpRequest.Builder updateItemImageIndexRequestBuilder(@org.eclipse.jdt. * @throws ApiException if fails to make API call */ public void uploadCustomSplashscreen(@org.eclipse.jdt.annotation.NonNull File body) throws ApiException { - uploadCustomSplashscreenWithHttpInfo(body); + uploadCustomSplashscreen(body, null); + } + + /** + * Uploads a custom splashscreen. The body is expected to the image contents base64 encoded. + * + * @param body (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void uploadCustomSplashscreen(@org.eclipse.jdt.annotation.NonNull File body, Map headers) + throws ApiException { + uploadCustomSplashscreenWithHttpInfo(body, headers); } /** @@ -6221,7 +8866,20 @@ public void uploadCustomSplashscreen(@org.eclipse.jdt.annotation.NonNull File bo */ public ApiResponse uploadCustomSplashscreenWithHttpInfo(@org.eclipse.jdt.annotation.NonNull File body) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = uploadCustomSplashscreenRequestBuilder(body); + return uploadCustomSplashscreenWithHttpInfo(body, null); + } + + /** + * Uploads a custom splashscreen. The body is expected to the image contents base64 encoded. + * + * @param body (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse uploadCustomSplashscreenWithHttpInfo(@org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uploadCustomSplashscreenRequestBuilder(body, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -6248,8 +8906,8 @@ public ApiResponse uploadCustomSplashscreenWithHttpInfo(@org.eclipse.jdt.a } } - private HttpRequest.Builder uploadCustomSplashscreenRequestBuilder(@org.eclipse.jdt.annotation.NonNull File body) - throws ApiException { + private HttpRequest.Builder uploadCustomSplashscreenRequestBuilder(@org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -6270,6 +8928,8 @@ private HttpRequest.Builder uploadCustomSplashscreenRequestBuilder(@org.eclipse. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/InstantMixApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/InstantMixApi.java index 298641a76fb24..7a3e5b90fde77 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/InstantMixApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/InstantMixApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -39,6 +41,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class InstantMixApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -74,6 +98,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Creates an instant playlist based on a given album. * @@ -95,8 +169,35 @@ public BaseItemDtoQueryResult getInstantMixFromAlbum(@org.eclipse.jdt.annotation @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromAlbum(itemId, userId, limit, fields, enableImages, enableUserData, imageTypeLimit, + enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given album. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromAlbum(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { ApiResponse localVarResponse = getInstantMixFromAlbumWithHttpInfo(itemId, userId, limit, - fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); return localVarResponse.getData(); } @@ -122,8 +223,36 @@ public ApiResponse getInstantMixFromAlbumWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromAlbumWithHttpInfo(itemId, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given album. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromAlbumWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getInstantMixFromAlbumRequestBuilder(itemId, userId, limit, fields, - enableImages, enableUserData, imageTypeLimit, enableImageTypes); + enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -140,14 +269,14 @@ public ApiResponse getInstantMixFromAlbumWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -164,7 +293,8 @@ private HttpRequest.Builder getInstantMixFromAlbumRequestBuilder(@org.eclipse.jd @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, - @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getInstantMixFromAlbum"); @@ -210,6 +340,8 @@ private HttpRequest.Builder getInstantMixFromAlbumRequestBuilder(@org.eclipse.jd if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -237,8 +369,35 @@ public BaseItemDtoQueryResult getInstantMixFromArtists(@org.eclipse.jdt.annotati @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromArtists(itemId, userId, limit, fields, enableImages, enableUserData, imageTypeLimit, + enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given artist. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromArtists(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { ApiResponse localVarResponse = getInstantMixFromArtistsWithHttpInfo(itemId, userId, - limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); return localVarResponse.getData(); } @@ -264,8 +423,36 @@ public ApiResponse getInstantMixFromArtistsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromArtistsWithHttpInfo(itemId, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given artist. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromArtistsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getInstantMixFromArtistsRequestBuilder(itemId, userId, limit, - fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -282,14 +469,14 @@ public ApiResponse getInstantMixFromArtistsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -306,7 +493,8 @@ private HttpRequest.Builder getInstantMixFromArtistsRequestBuilder(@org.eclipse. @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, - @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, @@ -354,6 +542,8 @@ private HttpRequest.Builder getInstantMixFromArtistsRequestBuilder(@org.eclipse. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -383,8 +573,37 @@ public BaseItemDtoQueryResult getInstantMixFromArtists2(@org.eclipse.jdt.annotat @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromArtists2(id, userId, limit, fields, enableImages, enableUserData, imageTypeLimit, + enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given artist. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getInstantMixFromArtists2(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { ApiResponse localVarResponse = getInstantMixFromArtists2WithHttpInfo(id, userId, limit, - fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); return localVarResponse.getData(); } @@ -412,8 +631,38 @@ public ApiResponse getInstantMixFromArtists2WithHttpInfo @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromArtists2WithHttpInfo(id, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given artist. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getInstantMixFromArtists2WithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getInstantMixFromArtists2RequestBuilder(id, userId, limit, fields, - enableImages, enableUserData, imageTypeLimit, enableImageTypes); + enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -430,14 +679,14 @@ public ApiResponse getInstantMixFromArtists2WithHttpInfo } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -454,7 +703,8 @@ private HttpRequest.Builder getInstantMixFromArtists2RequestBuilder(@org.eclipse @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, - @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling getInstantMixFromArtists2"); @@ -502,6 +752,8 @@ private HttpRequest.Builder getInstantMixFromArtists2RequestBuilder(@org.eclipse if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -529,8 +781,35 @@ public BaseItemDtoQueryResult getInstantMixFromItem(@org.eclipse.jdt.annotation. @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromItem(itemId, userId, limit, fields, enableImages, enableUserData, imageTypeLimit, + enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { ApiResponse localVarResponse = getInstantMixFromItemWithHttpInfo(itemId, userId, limit, - fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); return localVarResponse.getData(); } @@ -556,8 +835,36 @@ public ApiResponse getInstantMixFromItemWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromItemWithHttpInfo(itemId, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getInstantMixFromItemRequestBuilder(itemId, userId, limit, fields, - enableImages, enableUserData, imageTypeLimit, enableImageTypes); + enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -574,14 +881,14 @@ public ApiResponse getInstantMixFromItemWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -598,7 +905,8 @@ private HttpRequest.Builder getInstantMixFromItemRequestBuilder(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, - @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getInstantMixFromItem"); @@ -644,6 +952,8 @@ private HttpRequest.Builder getInstantMixFromItemRequestBuilder(@org.eclipse.jdt if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -671,8 +981,35 @@ public BaseItemDtoQueryResult getInstantMixFromMusicGenreById(@org.eclipse.jdt.a @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromMusicGenreById(id, userId, limit, fields, enableImages, enableUserData, imageTypeLimit, + enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given genre. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromMusicGenreById(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { ApiResponse localVarResponse = getInstantMixFromMusicGenreByIdWithHttpInfo(id, userId, - limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); return localVarResponse.getData(); } @@ -698,8 +1035,36 @@ public ApiResponse getInstantMixFromMusicGenreByIdWithHt @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromMusicGenreByIdWithHttpInfo(id, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given genre. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromMusicGenreByIdWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getInstantMixFromMusicGenreByIdRequestBuilder(id, userId, limit, - fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -716,14 +1081,14 @@ public ApiResponse getInstantMixFromMusicGenreByIdWithHt } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -741,7 +1106,8 @@ private HttpRequest.Builder getInstantMixFromMusicGenreByIdRequestBuilder( @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, - @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, @@ -790,6 +1156,8 @@ private HttpRequest.Builder getInstantMixFromMusicGenreByIdRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -817,8 +1185,35 @@ public BaseItemDtoQueryResult getInstantMixFromMusicGenreByName(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromMusicGenreByName(name, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given genre. + * + * @param name The genre name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromMusicGenreByName(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { ApiResponse localVarResponse = getInstantMixFromMusicGenreByNameWithHttpInfo(name, - userId, limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + userId, limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); return localVarResponse.getData(); } @@ -844,8 +1239,36 @@ public ApiResponse getInstantMixFromMusicGenreByNameWith @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromMusicGenreByNameWithHttpInfo(name, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given genre. + * + * @param name The genre name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromMusicGenreByNameWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getInstantMixFromMusicGenreByNameRequestBuilder(name, userId, - limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -862,14 +1285,14 @@ public ApiResponse getInstantMixFromMusicGenreByNameWith } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -887,7 +1310,8 @@ private HttpRequest.Builder getInstantMixFromMusicGenreByNameRequestBuilder( @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, - @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, @@ -934,6 +1358,8 @@ private HttpRequest.Builder getInstantMixFromMusicGenreByNameRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -961,8 +1387,35 @@ public BaseItemDtoQueryResult getInstantMixFromPlaylist(@org.eclipse.jdt.annotat @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromPlaylist(itemId, userId, limit, fields, enableImages, enableUserData, imageTypeLimit, + enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given playlist. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { ApiResponse localVarResponse = getInstantMixFromPlaylistWithHttpInfo(itemId, userId, - limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); return localVarResponse.getData(); } @@ -988,8 +1441,36 @@ public ApiResponse getInstantMixFromPlaylistWithHttpInfo @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromPlaylistWithHttpInfo(itemId, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given playlist. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromPlaylistWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getInstantMixFromPlaylistRequestBuilder(itemId, userId, limit, - fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1006,14 +1487,14 @@ public ApiResponse getInstantMixFromPlaylistWithHttpInfo } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1031,7 +1512,8 @@ private HttpRequest.Builder getInstantMixFromPlaylistRequestBuilder( @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, - @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, @@ -1079,6 +1561,8 @@ private HttpRequest.Builder getInstantMixFromPlaylistRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1106,8 +1590,35 @@ public BaseItemDtoQueryResult getInstantMixFromSong(@org.eclipse.jdt.annotation. @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromSong(itemId, userId, limit, fields, enableImages, enableUserData, imageTypeLimit, + enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given song. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromSong(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { ApiResponse localVarResponse = getInstantMixFromSongWithHttpInfo(itemId, userId, limit, - fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); return localVarResponse.getData(); } @@ -1133,8 +1644,36 @@ public ApiResponse getInstantMixFromSongWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromSongWithHttpInfo(itemId, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given song. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromSongWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getInstantMixFromSongRequestBuilder(itemId, userId, limit, fields, - enableImages, enableUserData, imageTypeLimit, enableImageTypes); + enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1151,14 +1690,14 @@ public ApiResponse getInstantMixFromSongWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1175,7 +1714,8 @@ private HttpRequest.Builder getInstantMixFromSongRequestBuilder(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, - @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getInstantMixFromSong"); @@ -1221,6 +1761,8 @@ private HttpRequest.Builder getInstantMixFromSongRequestBuilder(@org.eclipse.jdt if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemLookupApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemLookupApi.java index 1090be48b6e47..3415e8fad71e9 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemLookupApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemLookupApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -47,6 +49,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class ItemLookupApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -82,6 +106,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Applies search criteria to an item and refreshes metadata. * @@ -94,7 +168,24 @@ private String formatExceptionMessage(String operationId, int statusCode, String public void applySearchCriteria(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable RemoteSearchResult remoteSearchResult, @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages) throws ApiException { - applySearchCriteriaWithHttpInfo(itemId, remoteSearchResult, replaceAllImages); + applySearchCriteria(itemId, remoteSearchResult, replaceAllImages, null); + } + + /** + * Applies search criteria to an item and refreshes metadata. + * + * @param itemId Item id. (required) + * @param remoteSearchResult The remote search result. (required) + * @param replaceAllImages Optional. Whether or not to replace all images. Default: True. (optional, default to + * true) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void applySearchCriteria(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable RemoteSearchResult remoteSearchResult, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, Map headers) + throws ApiException { + applySearchCriteriaWithHttpInfo(itemId, remoteSearchResult, replaceAllImages, headers); } /** @@ -110,8 +201,26 @@ public void applySearchCriteria(@org.eclipse.jdt.annotation.Nullable UUID itemId public ApiResponse applySearchCriteriaWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable RemoteSearchResult remoteSearchResult, @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages) throws ApiException { + return applySearchCriteriaWithHttpInfo(itemId, remoteSearchResult, replaceAllImages, null); + } + + /** + * Applies search criteria to an item and refreshes metadata. + * + * @param itemId Item id. (required) + * @param remoteSearchResult The remote search result. (required) + * @param replaceAllImages Optional. Whether or not to replace all images. Default: True. (optional, default to + * true) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse applySearchCriteriaWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable RemoteSearchResult remoteSearchResult, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = applySearchCriteriaRequestBuilder(itemId, remoteSearchResult, - replaceAllImages); + replaceAllImages, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -140,7 +249,8 @@ public ApiResponse applySearchCriteriaWithHttpInfo(@org.eclipse.jdt.annota private HttpRequest.Builder applySearchCriteriaRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable RemoteSearchResult remoteSearchResult, - @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling applySearchCriteria"); @@ -186,6 +296,8 @@ private HttpRequest.Builder applySearchCriteriaRequestBuilder(@org.eclipse.jdt.a if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -202,8 +314,22 @@ private HttpRequest.Builder applySearchCriteriaRequestBuilder(@org.eclipse.jdt.a public List getBookRemoteSearchResults( @org.eclipse.jdt.annotation.Nullable BookInfoRemoteSearchQuery bookInfoRemoteSearchQuery) throws ApiException { + return getBookRemoteSearchResults(bookInfoRemoteSearchQuery, null); + } + + /** + * Get book remote search. + * + * @param bookInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getBookRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable BookInfoRemoteSearchQuery bookInfoRemoteSearchQuery, + Map headers) throws ApiException { ApiResponse> localVarResponse = getBookRemoteSearchResultsWithHttpInfo( - bookInfoRemoteSearchQuery); + bookInfoRemoteSearchQuery, headers); return localVarResponse.getData(); } @@ -217,8 +343,22 @@ public List getBookRemoteSearchResults( public ApiResponse> getBookRemoteSearchResultsWithHttpInfo( @org.eclipse.jdt.annotation.Nullable BookInfoRemoteSearchQuery bookInfoRemoteSearchQuery) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getBookRemoteSearchResultsRequestBuilder( - bookInfoRemoteSearchQuery); + return getBookRemoteSearchResultsWithHttpInfo(bookInfoRemoteSearchQuery, null); + } + + /** + * Get book remote search. + * + * @param bookInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getBookRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable BookInfoRemoteSearchQuery bookInfoRemoteSearchQuery, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBookRemoteSearchResultsRequestBuilder(bookInfoRemoteSearchQuery, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -235,14 +375,14 @@ public ApiResponse> getBookRemoteSearchResultsWithHttpI } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -254,8 +394,8 @@ public ApiResponse> getBookRemoteSearchResultsWithHttpI } private HttpRequest.Builder getBookRemoteSearchResultsRequestBuilder( - @org.eclipse.jdt.annotation.Nullable BookInfoRemoteSearchQuery bookInfoRemoteSearchQuery) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable BookInfoRemoteSearchQuery bookInfoRemoteSearchQuery, + Map headers) throws ApiException { // verify the required parameter 'bookInfoRemoteSearchQuery' is set if (bookInfoRemoteSearchQuery == null) { throw new ApiException(400, @@ -281,6 +421,8 @@ private HttpRequest.Builder getBookRemoteSearchResultsRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -297,8 +439,22 @@ private HttpRequest.Builder getBookRemoteSearchResultsRequestBuilder( public List getBoxSetRemoteSearchResults( @org.eclipse.jdt.annotation.Nullable BoxSetInfoRemoteSearchQuery boxSetInfoRemoteSearchQuery) throws ApiException { + return getBoxSetRemoteSearchResults(boxSetInfoRemoteSearchQuery, null); + } + + /** + * Get box set remote search. + * + * @param boxSetInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getBoxSetRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable BoxSetInfoRemoteSearchQuery boxSetInfoRemoteSearchQuery, + Map headers) throws ApiException { ApiResponse> localVarResponse = getBoxSetRemoteSearchResultsWithHttpInfo( - boxSetInfoRemoteSearchQuery); + boxSetInfoRemoteSearchQuery, headers); return localVarResponse.getData(); } @@ -312,8 +468,22 @@ public List getBoxSetRemoteSearchResults( public ApiResponse> getBoxSetRemoteSearchResultsWithHttpInfo( @org.eclipse.jdt.annotation.Nullable BoxSetInfoRemoteSearchQuery boxSetInfoRemoteSearchQuery) throws ApiException { + return getBoxSetRemoteSearchResultsWithHttpInfo(boxSetInfoRemoteSearchQuery, null); + } + + /** + * Get box set remote search. + * + * @param boxSetInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getBoxSetRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable BoxSetInfoRemoteSearchQuery boxSetInfoRemoteSearchQuery, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getBoxSetRemoteSearchResultsRequestBuilder( - boxSetInfoRemoteSearchQuery); + boxSetInfoRemoteSearchQuery, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -330,14 +500,14 @@ public ApiResponse> getBoxSetRemoteSearchResultsWithHtt } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -349,8 +519,8 @@ public ApiResponse> getBoxSetRemoteSearchResultsWithHtt } private HttpRequest.Builder getBoxSetRemoteSearchResultsRequestBuilder( - @org.eclipse.jdt.annotation.Nullable BoxSetInfoRemoteSearchQuery boxSetInfoRemoteSearchQuery) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable BoxSetInfoRemoteSearchQuery boxSetInfoRemoteSearchQuery, + Map headers) throws ApiException { // verify the required parameter 'boxSetInfoRemoteSearchQuery' is set if (boxSetInfoRemoteSearchQuery == null) { throw new ApiException(400, @@ -376,6 +546,8 @@ private HttpRequest.Builder getBoxSetRemoteSearchResultsRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -391,7 +563,20 @@ private HttpRequest.Builder getBoxSetRemoteSearchResultsRequestBuilder( */ public List getExternalIdInfos(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - ApiResponse> localVarResponse = getExternalIdInfosWithHttpInfo(itemId); + return getExternalIdInfos(itemId, null); + } + + /** + * Get the item's external id info. + * + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return List<ExternalIdInfo> + * @throws ApiException if fails to make API call + */ + public List getExternalIdInfos(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getExternalIdInfosWithHttpInfo(itemId, headers); return localVarResponse.getData(); } @@ -404,7 +589,20 @@ public List getExternalIdInfos(@org.eclipse.jdt.annotation.Nulla */ public ApiResponse> getExternalIdInfosWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getExternalIdInfosRequestBuilder(itemId); + return getExternalIdInfosWithHttpInfo(itemId, null); + } + + /** + * Get the item's external id info. + * + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<ExternalIdInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getExternalIdInfosWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getExternalIdInfosRequestBuilder(itemId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -421,14 +619,14 @@ public ApiResponse> getExternalIdInfosWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -439,8 +637,8 @@ public ApiResponse> getExternalIdInfosWithHttpInfo( } } - private HttpRequest.Builder getExternalIdInfosRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) - throws ApiException { + private HttpRequest.Builder getExternalIdInfosRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getExternalIdInfos"); @@ -460,6 +658,8 @@ private HttpRequest.Builder getExternalIdInfosRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -476,8 +676,22 @@ private HttpRequest.Builder getExternalIdInfosRequestBuilder(@org.eclipse.jdt.an public List getMovieRemoteSearchResults( @org.eclipse.jdt.annotation.Nullable MovieInfoRemoteSearchQuery movieInfoRemoteSearchQuery) throws ApiException { + return getMovieRemoteSearchResults(movieInfoRemoteSearchQuery, null); + } + + /** + * Get movie remote search. + * + * @param movieInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getMovieRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable MovieInfoRemoteSearchQuery movieInfoRemoteSearchQuery, + Map headers) throws ApiException { ApiResponse> localVarResponse = getMovieRemoteSearchResultsWithHttpInfo( - movieInfoRemoteSearchQuery); + movieInfoRemoteSearchQuery, headers); return localVarResponse.getData(); } @@ -491,8 +705,22 @@ public List getMovieRemoteSearchResults( public ApiResponse> getMovieRemoteSearchResultsWithHttpInfo( @org.eclipse.jdt.annotation.Nullable MovieInfoRemoteSearchQuery movieInfoRemoteSearchQuery) throws ApiException { + return getMovieRemoteSearchResultsWithHttpInfo(movieInfoRemoteSearchQuery, null); + } + + /** + * Get movie remote search. + * + * @param movieInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMovieRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MovieInfoRemoteSearchQuery movieInfoRemoteSearchQuery, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getMovieRemoteSearchResultsRequestBuilder( - movieInfoRemoteSearchQuery); + movieInfoRemoteSearchQuery, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -509,14 +737,14 @@ public ApiResponse> getMovieRemoteSearchResultsWithHttp } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -528,8 +756,8 @@ public ApiResponse> getMovieRemoteSearchResultsWithHttp } private HttpRequest.Builder getMovieRemoteSearchResultsRequestBuilder( - @org.eclipse.jdt.annotation.Nullable MovieInfoRemoteSearchQuery movieInfoRemoteSearchQuery) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable MovieInfoRemoteSearchQuery movieInfoRemoteSearchQuery, + Map headers) throws ApiException { // verify the required parameter 'movieInfoRemoteSearchQuery' is set if (movieInfoRemoteSearchQuery == null) { throw new ApiException(400, @@ -555,6 +783,8 @@ private HttpRequest.Builder getMovieRemoteSearchResultsRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -571,8 +801,22 @@ private HttpRequest.Builder getMovieRemoteSearchResultsRequestBuilder( public List getMusicAlbumRemoteSearchResults( @org.eclipse.jdt.annotation.Nullable AlbumInfoRemoteSearchQuery albumInfoRemoteSearchQuery) throws ApiException { + return getMusicAlbumRemoteSearchResults(albumInfoRemoteSearchQuery, null); + } + + /** + * Get music album remote search. + * + * @param albumInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getMusicAlbumRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable AlbumInfoRemoteSearchQuery albumInfoRemoteSearchQuery, + Map headers) throws ApiException { ApiResponse> localVarResponse = getMusicAlbumRemoteSearchResultsWithHttpInfo( - albumInfoRemoteSearchQuery); + albumInfoRemoteSearchQuery, headers); return localVarResponse.getData(); } @@ -586,8 +830,22 @@ public List getMusicAlbumRemoteSearchResults( public ApiResponse> getMusicAlbumRemoteSearchResultsWithHttpInfo( @org.eclipse.jdt.annotation.Nullable AlbumInfoRemoteSearchQuery albumInfoRemoteSearchQuery) throws ApiException { + return getMusicAlbumRemoteSearchResultsWithHttpInfo(albumInfoRemoteSearchQuery, null); + } + + /** + * Get music album remote search. + * + * @param albumInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMusicAlbumRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable AlbumInfoRemoteSearchQuery albumInfoRemoteSearchQuery, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getMusicAlbumRemoteSearchResultsRequestBuilder( - albumInfoRemoteSearchQuery); + albumInfoRemoteSearchQuery, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -604,14 +862,14 @@ public ApiResponse> getMusicAlbumRemoteSearchResultsWit } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -623,8 +881,8 @@ public ApiResponse> getMusicAlbumRemoteSearchResultsWit } private HttpRequest.Builder getMusicAlbumRemoteSearchResultsRequestBuilder( - @org.eclipse.jdt.annotation.Nullable AlbumInfoRemoteSearchQuery albumInfoRemoteSearchQuery) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable AlbumInfoRemoteSearchQuery albumInfoRemoteSearchQuery, + Map headers) throws ApiException { // verify the required parameter 'albumInfoRemoteSearchQuery' is set if (albumInfoRemoteSearchQuery == null) { throw new ApiException(400, @@ -650,6 +908,8 @@ private HttpRequest.Builder getMusicAlbumRemoteSearchResultsRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -666,8 +926,22 @@ private HttpRequest.Builder getMusicAlbumRemoteSearchResultsRequestBuilder( public List getMusicArtistRemoteSearchResults( @org.eclipse.jdt.annotation.Nullable ArtistInfoRemoteSearchQuery artistInfoRemoteSearchQuery) throws ApiException { + return getMusicArtistRemoteSearchResults(artistInfoRemoteSearchQuery, null); + } + + /** + * Get music artist remote search. + * + * @param artistInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getMusicArtistRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable ArtistInfoRemoteSearchQuery artistInfoRemoteSearchQuery, + Map headers) throws ApiException { ApiResponse> localVarResponse = getMusicArtistRemoteSearchResultsWithHttpInfo( - artistInfoRemoteSearchQuery); + artistInfoRemoteSearchQuery, headers); return localVarResponse.getData(); } @@ -681,8 +955,22 @@ public List getMusicArtistRemoteSearchResults( public ApiResponse> getMusicArtistRemoteSearchResultsWithHttpInfo( @org.eclipse.jdt.annotation.Nullable ArtistInfoRemoteSearchQuery artistInfoRemoteSearchQuery) throws ApiException { + return getMusicArtistRemoteSearchResultsWithHttpInfo(artistInfoRemoteSearchQuery, null); + } + + /** + * Get music artist remote search. + * + * @param artistInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMusicArtistRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ArtistInfoRemoteSearchQuery artistInfoRemoteSearchQuery, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getMusicArtistRemoteSearchResultsRequestBuilder( - artistInfoRemoteSearchQuery); + artistInfoRemoteSearchQuery, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -699,14 +987,14 @@ public ApiResponse> getMusicArtistRemoteSearchResultsWi } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -718,8 +1006,8 @@ public ApiResponse> getMusicArtistRemoteSearchResultsWi } private HttpRequest.Builder getMusicArtistRemoteSearchResultsRequestBuilder( - @org.eclipse.jdt.annotation.Nullable ArtistInfoRemoteSearchQuery artistInfoRemoteSearchQuery) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable ArtistInfoRemoteSearchQuery artistInfoRemoteSearchQuery, + Map headers) throws ApiException { // verify the required parameter 'artistInfoRemoteSearchQuery' is set if (artistInfoRemoteSearchQuery == null) { throw new ApiException(400, @@ -745,6 +1033,8 @@ private HttpRequest.Builder getMusicArtistRemoteSearchResultsRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -761,8 +1051,22 @@ private HttpRequest.Builder getMusicArtistRemoteSearchResultsRequestBuilder( public List getMusicVideoRemoteSearchResults( @org.eclipse.jdt.annotation.Nullable MusicVideoInfoRemoteSearchQuery musicVideoInfoRemoteSearchQuery) throws ApiException { + return getMusicVideoRemoteSearchResults(musicVideoInfoRemoteSearchQuery, null); + } + + /** + * Get music video remote search. + * + * @param musicVideoInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getMusicVideoRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable MusicVideoInfoRemoteSearchQuery musicVideoInfoRemoteSearchQuery, + Map headers) throws ApiException { ApiResponse> localVarResponse = getMusicVideoRemoteSearchResultsWithHttpInfo( - musicVideoInfoRemoteSearchQuery); + musicVideoInfoRemoteSearchQuery, headers); return localVarResponse.getData(); } @@ -776,8 +1080,22 @@ public List getMusicVideoRemoteSearchResults( public ApiResponse> getMusicVideoRemoteSearchResultsWithHttpInfo( @org.eclipse.jdt.annotation.Nullable MusicVideoInfoRemoteSearchQuery musicVideoInfoRemoteSearchQuery) throws ApiException { + return getMusicVideoRemoteSearchResultsWithHttpInfo(musicVideoInfoRemoteSearchQuery, null); + } + + /** + * Get music video remote search. + * + * @param musicVideoInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMusicVideoRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MusicVideoInfoRemoteSearchQuery musicVideoInfoRemoteSearchQuery, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getMusicVideoRemoteSearchResultsRequestBuilder( - musicVideoInfoRemoteSearchQuery); + musicVideoInfoRemoteSearchQuery, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -794,14 +1112,14 @@ public ApiResponse> getMusicVideoRemoteSearchResultsWit } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -813,8 +1131,8 @@ public ApiResponse> getMusicVideoRemoteSearchResultsWit } private HttpRequest.Builder getMusicVideoRemoteSearchResultsRequestBuilder( - @org.eclipse.jdt.annotation.Nullable MusicVideoInfoRemoteSearchQuery musicVideoInfoRemoteSearchQuery) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable MusicVideoInfoRemoteSearchQuery musicVideoInfoRemoteSearchQuery, + Map headers) throws ApiException { // verify the required parameter 'musicVideoInfoRemoteSearchQuery' is set if (musicVideoInfoRemoteSearchQuery == null) { throw new ApiException(400, @@ -840,6 +1158,8 @@ private HttpRequest.Builder getMusicVideoRemoteSearchResultsRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -856,8 +1176,22 @@ private HttpRequest.Builder getMusicVideoRemoteSearchResultsRequestBuilder( public List getPersonRemoteSearchResults( @org.eclipse.jdt.annotation.Nullable PersonLookupInfoRemoteSearchQuery personLookupInfoRemoteSearchQuery) throws ApiException { + return getPersonRemoteSearchResults(personLookupInfoRemoteSearchQuery, null); + } + + /** + * Get person remote search. + * + * @param personLookupInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getPersonRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable PersonLookupInfoRemoteSearchQuery personLookupInfoRemoteSearchQuery, + Map headers) throws ApiException { ApiResponse> localVarResponse = getPersonRemoteSearchResultsWithHttpInfo( - personLookupInfoRemoteSearchQuery); + personLookupInfoRemoteSearchQuery, headers); return localVarResponse.getData(); } @@ -871,8 +1205,22 @@ public List getPersonRemoteSearchResults( public ApiResponse> getPersonRemoteSearchResultsWithHttpInfo( @org.eclipse.jdt.annotation.Nullable PersonLookupInfoRemoteSearchQuery personLookupInfoRemoteSearchQuery) throws ApiException { + return getPersonRemoteSearchResultsWithHttpInfo(personLookupInfoRemoteSearchQuery, null); + } + + /** + * Get person remote search. + * + * @param personLookupInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPersonRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable PersonLookupInfoRemoteSearchQuery personLookupInfoRemoteSearchQuery, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getPersonRemoteSearchResultsRequestBuilder( - personLookupInfoRemoteSearchQuery); + personLookupInfoRemoteSearchQuery, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -889,14 +1237,14 @@ public ApiResponse> getPersonRemoteSearchResultsWithHtt } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -908,8 +1256,8 @@ public ApiResponse> getPersonRemoteSearchResultsWithHtt } private HttpRequest.Builder getPersonRemoteSearchResultsRequestBuilder( - @org.eclipse.jdt.annotation.Nullable PersonLookupInfoRemoteSearchQuery personLookupInfoRemoteSearchQuery) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable PersonLookupInfoRemoteSearchQuery personLookupInfoRemoteSearchQuery, + Map headers) throws ApiException { // verify the required parameter 'personLookupInfoRemoteSearchQuery' is set if (personLookupInfoRemoteSearchQuery == null) { throw new ApiException(400, @@ -935,6 +1283,8 @@ private HttpRequest.Builder getPersonRemoteSearchResultsRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -951,8 +1301,22 @@ private HttpRequest.Builder getPersonRemoteSearchResultsRequestBuilder( public List getSeriesRemoteSearchResults( @org.eclipse.jdt.annotation.Nullable SeriesInfoRemoteSearchQuery seriesInfoRemoteSearchQuery) throws ApiException { + return getSeriesRemoteSearchResults(seriesInfoRemoteSearchQuery, null); + } + + /** + * Get series remote search. + * + * @param seriesInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getSeriesRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable SeriesInfoRemoteSearchQuery seriesInfoRemoteSearchQuery, + Map headers) throws ApiException { ApiResponse> localVarResponse = getSeriesRemoteSearchResultsWithHttpInfo( - seriesInfoRemoteSearchQuery); + seriesInfoRemoteSearchQuery, headers); return localVarResponse.getData(); } @@ -966,8 +1330,22 @@ public List getSeriesRemoteSearchResults( public ApiResponse> getSeriesRemoteSearchResultsWithHttpInfo( @org.eclipse.jdt.annotation.Nullable SeriesInfoRemoteSearchQuery seriesInfoRemoteSearchQuery) throws ApiException { + return getSeriesRemoteSearchResultsWithHttpInfo(seriesInfoRemoteSearchQuery, null); + } + + /** + * Get series remote search. + * + * @param seriesInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getSeriesRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SeriesInfoRemoteSearchQuery seriesInfoRemoteSearchQuery, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getSeriesRemoteSearchResultsRequestBuilder( - seriesInfoRemoteSearchQuery); + seriesInfoRemoteSearchQuery, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -984,14 +1362,14 @@ public ApiResponse> getSeriesRemoteSearchResultsWithHtt } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1003,8 +1381,8 @@ public ApiResponse> getSeriesRemoteSearchResultsWithHtt } private HttpRequest.Builder getSeriesRemoteSearchResultsRequestBuilder( - @org.eclipse.jdt.annotation.Nullable SeriesInfoRemoteSearchQuery seriesInfoRemoteSearchQuery) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable SeriesInfoRemoteSearchQuery seriesInfoRemoteSearchQuery, + Map headers) throws ApiException { // verify the required parameter 'seriesInfoRemoteSearchQuery' is set if (seriesInfoRemoteSearchQuery == null) { throw new ApiException(400, @@ -1030,6 +1408,8 @@ private HttpRequest.Builder getSeriesRemoteSearchResultsRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1046,8 +1426,22 @@ private HttpRequest.Builder getSeriesRemoteSearchResultsRequestBuilder( public List getTrailerRemoteSearchResults( @org.eclipse.jdt.annotation.Nullable TrailerInfoRemoteSearchQuery trailerInfoRemoteSearchQuery) throws ApiException { + return getTrailerRemoteSearchResults(trailerInfoRemoteSearchQuery, null); + } + + /** + * Get trailer remote search. + * + * @param trailerInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getTrailerRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable TrailerInfoRemoteSearchQuery trailerInfoRemoteSearchQuery, + Map headers) throws ApiException { ApiResponse> localVarResponse = getTrailerRemoteSearchResultsWithHttpInfo( - trailerInfoRemoteSearchQuery); + trailerInfoRemoteSearchQuery, headers); return localVarResponse.getData(); } @@ -1061,8 +1455,22 @@ public List getTrailerRemoteSearchResults( public ApiResponse> getTrailerRemoteSearchResultsWithHttpInfo( @org.eclipse.jdt.annotation.Nullable TrailerInfoRemoteSearchQuery trailerInfoRemoteSearchQuery) throws ApiException { + return getTrailerRemoteSearchResultsWithHttpInfo(trailerInfoRemoteSearchQuery, null); + } + + /** + * Get trailer remote search. + * + * @param trailerInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getTrailerRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable TrailerInfoRemoteSearchQuery trailerInfoRemoteSearchQuery, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getTrailerRemoteSearchResultsRequestBuilder( - trailerInfoRemoteSearchQuery); + trailerInfoRemoteSearchQuery, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1079,14 +1487,14 @@ public ApiResponse> getTrailerRemoteSearchResultsWithHt } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1098,8 +1506,8 @@ public ApiResponse> getTrailerRemoteSearchResultsWithHt } private HttpRequest.Builder getTrailerRemoteSearchResultsRequestBuilder( - @org.eclipse.jdt.annotation.Nullable TrailerInfoRemoteSearchQuery trailerInfoRemoteSearchQuery) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable TrailerInfoRemoteSearchQuery trailerInfoRemoteSearchQuery, + Map headers) throws ApiException { // verify the required parameter 'trailerInfoRemoteSearchQuery' is set if (trailerInfoRemoteSearchQuery == null) { throw new ApiException(400, @@ -1125,6 +1533,8 @@ private HttpRequest.Builder getTrailerRemoteSearchResultsRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemRefreshApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemRefreshApi.java index 347f6de5b7353..1c7c369161c28 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemRefreshApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemRefreshApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -36,6 +38,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class ItemRefreshApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -71,6 +95,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Refreshes metadata for an item. * @@ -91,8 +165,34 @@ public void refreshItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull Boolean replaceAllMetadata, @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, @org.eclipse.jdt.annotation.NonNull Boolean regenerateTrickplay) throws ApiException { + refreshItem(itemId, metadataRefreshMode, imageRefreshMode, replaceAllMetadata, replaceAllImages, + regenerateTrickplay, null); + } + + /** + * Refreshes metadata for an item. + * + * @param itemId Item id. (required) + * @param metadataRefreshMode (Optional) Specifies the metadata refresh mode. (optional, default to None) + * @param imageRefreshMode (Optional) Specifies the image refresh mode. (optional, default to None) + * @param replaceAllMetadata (Optional) Determines if metadata should be replaced. Only applicable if mode is + * FullRefresh. (optional, default to false) + * @param replaceAllImages (Optional) Determines if images should be replaced. Only applicable if mode is + * FullRefresh. (optional, default to false) + * @param regenerateTrickplay (Optional) Determines if trickplay images should be replaced. Only applicable if mode + * is FullRefresh. (optional, default to false) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void refreshItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode metadataRefreshMode, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode imageRefreshMode, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllMetadata, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, + @org.eclipse.jdt.annotation.NonNull Boolean regenerateTrickplay, Map headers) + throws ApiException { refreshItemWithHttpInfo(itemId, metadataRefreshMode, imageRefreshMode, replaceAllMetadata, replaceAllImages, - regenerateTrickplay); + regenerateTrickplay, headers); } /** @@ -116,8 +216,35 @@ public ApiResponse refreshItemWithHttpInfo(@org.eclipse.jdt.annotation.Nul @org.eclipse.jdt.annotation.NonNull Boolean replaceAllMetadata, @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, @org.eclipse.jdt.annotation.NonNull Boolean regenerateTrickplay) throws ApiException { + return refreshItemWithHttpInfo(itemId, metadataRefreshMode, imageRefreshMode, replaceAllMetadata, + replaceAllImages, regenerateTrickplay, null); + } + + /** + * Refreshes metadata for an item. + * + * @param itemId Item id. (required) + * @param metadataRefreshMode (Optional) Specifies the metadata refresh mode. (optional, default to None) + * @param imageRefreshMode (Optional) Specifies the image refresh mode. (optional, default to None) + * @param replaceAllMetadata (Optional) Determines if metadata should be replaced. Only applicable if mode is + * FullRefresh. (optional, default to false) + * @param replaceAllImages (Optional) Determines if images should be replaced. Only applicable if mode is + * FullRefresh. (optional, default to false) + * @param regenerateTrickplay (Optional) Determines if trickplay images should be replaced. Only applicable if mode + * is FullRefresh. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse refreshItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode metadataRefreshMode, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode imageRefreshMode, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllMetadata, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, + @org.eclipse.jdt.annotation.NonNull Boolean regenerateTrickplay, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = refreshItemRequestBuilder(itemId, metadataRefreshMode, - imageRefreshMode, replaceAllMetadata, replaceAllImages, regenerateTrickplay); + imageRefreshMode, replaceAllMetadata, replaceAllImages, regenerateTrickplay, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -149,7 +276,8 @@ private HttpRequest.Builder refreshItemRequestBuilder(@org.eclipse.jdt.annotatio @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode imageRefreshMode, @org.eclipse.jdt.annotation.NonNull Boolean replaceAllMetadata, @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, - @org.eclipse.jdt.annotation.NonNull Boolean regenerateTrickplay) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean regenerateTrickplay, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling refreshItem"); @@ -191,6 +319,8 @@ private HttpRequest.Builder refreshItemRequestBuilder(@org.eclipse.jdt.annotatio if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemUpdateApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemUpdateApi.java index 9df7d350a88b7..9381a493be792 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemUpdateApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemUpdateApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -38,6 +40,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class ItemUpdateApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -73,6 +97,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets metadata editor info for an item. * @@ -82,7 +156,20 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public MetadataEditorInfo getMetadataEditorInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - ApiResponse localVarResponse = getMetadataEditorInfoWithHttpInfo(itemId); + return getMetadataEditorInfo(itemId, null); + } + + /** + * Gets metadata editor info for an item. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return MetadataEditorInfo + * @throws ApiException if fails to make API call + */ + public MetadataEditorInfo getMetadataEditorInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getMetadataEditorInfoWithHttpInfo(itemId, headers); return localVarResponse.getData(); } @@ -95,7 +182,20 @@ public MetadataEditorInfo getMetadataEditorInfo(@org.eclipse.jdt.annotation.Null */ public ApiResponse getMetadataEditorInfoWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getMetadataEditorInfoRequestBuilder(itemId); + return getMetadataEditorInfoWithHttpInfo(itemId, null); + } + + /** + * Gets metadata editor info for an item. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<MetadataEditorInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMetadataEditorInfoWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMetadataEditorInfoRequestBuilder(itemId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -112,14 +212,14 @@ public ApiResponse getMetadataEditorInfoWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + MetadataEditorInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -130,8 +230,8 @@ public ApiResponse getMetadataEditorInfoWithHttpInfo( } } - private HttpRequest.Builder getMetadataEditorInfoRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) - throws ApiException { + private HttpRequest.Builder getMetadataEditorInfoRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getMetadataEditorInfo"); @@ -151,6 +251,8 @@ private HttpRequest.Builder getMetadataEditorInfoRequestBuilder(@org.eclipse.jdt if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -166,7 +268,21 @@ private HttpRequest.Builder getMetadataEditorInfoRequestBuilder(@org.eclipse.jdt */ public void updateItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable BaseItemDto baseItemDto) throws ApiException { - updateItemWithHttpInfo(itemId, baseItemDto); + updateItem(itemId, baseItemDto, null); + } + + /** + * Updates an item. + * + * @param itemId The item id. (required) + * @param baseItemDto The new item properties. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable BaseItemDto baseItemDto, Map headers) + throws ApiException { + updateItemWithHttpInfo(itemId, baseItemDto, headers); } /** @@ -179,7 +295,22 @@ public void updateItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, */ public ApiResponse updateItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable BaseItemDto baseItemDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateItemRequestBuilder(itemId, baseItemDto); + return updateItemWithHttpInfo(itemId, baseItemDto, null); + } + + /** + * Updates an item. + * + * @param itemId The item id. (required) + * @param baseItemDto The new item properties. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable BaseItemDto baseItemDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateItemRequestBuilder(itemId, baseItemDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -207,7 +338,8 @@ public ApiResponse updateItemWithHttpInfo(@org.eclipse.jdt.annotation.Null } private HttpRequest.Builder updateItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.Nullable BaseItemDto baseItemDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable BaseItemDto baseItemDto, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling updateItem"); @@ -236,6 +368,8 @@ private HttpRequest.Builder updateItemRequestBuilder(@org.eclipse.jdt.annotation if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -251,7 +385,20 @@ private HttpRequest.Builder updateItemRequestBuilder(@org.eclipse.jdt.annotation */ public void updateItemContentType(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String contentType) throws ApiException { - updateItemContentTypeWithHttpInfo(itemId, contentType); + updateItemContentType(itemId, contentType, null); + } + + /** + * Updates an item's content type. + * + * @param itemId The item id. (required) + * @param contentType The content type of the item. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateItemContentType(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String contentType, Map headers) throws ApiException { + updateItemContentTypeWithHttpInfo(itemId, contentType, headers); } /** @@ -264,7 +411,21 @@ public void updateItemContentType(@org.eclipse.jdt.annotation.Nullable UUID item */ public ApiResponse updateItemContentTypeWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String contentType) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateItemContentTypeRequestBuilder(itemId, contentType); + return updateItemContentTypeWithHttpInfo(itemId, contentType, null); + } + + /** + * Updates an item's content type. + * + * @param itemId The item id. (required) + * @param contentType The content type of the item. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateItemContentTypeWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String contentType, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateItemContentTypeRequestBuilder(itemId, contentType, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -292,7 +453,7 @@ public ApiResponse updateItemContentTypeWithHttpInfo(@org.eclipse.jdt.anno } private HttpRequest.Builder updateItemContentTypeRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull String contentType) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String contentType, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling updateItemContentType"); @@ -326,6 +487,8 @@ private HttpRequest.Builder updateItemContentTypeRequestBuilder(@org.eclipse.jdt if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemsApi.java index f93d08ecd6110..98c8753704954 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemsApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ItemsApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -22,6 +23,7 @@ import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -50,6 +52,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class ItemsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -85,105 +109,628 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Get Item User Data. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto getItemUserData(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getItemUserData(itemId, userId, null); + } + /** * Get Item User Data. * * @param itemId The item id. (required) * @param userId The user id. (optional) + * @param headers Optional headers to include in the request * @return UserItemDataDto * @throws ApiException if fails to make API call */ public UserItemDataDto getItemUserData(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getItemUserDataWithHttpInfo(itemId, userId, headers); + return localVarResponse.getData(); + } + + /** + * Get Item User Data. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemUserDataWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getItemUserDataWithHttpInfo(itemId, userId); + return getItemUserDataWithHttpInfo(itemId, userId, null); + } + + /** + * Get Item User Data. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemUserDataWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemUserDataRequestBuilder(itemId, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItemUserData", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + UserItemDataDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemUserDataRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemUserData"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/UserItems/{itemId}/UserData".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets items based on a query. + * + * @param userId The user id supplied as query parameter; this is required when not using an API key. (optional) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param indexNumber Optional filter by index number. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an IMDb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a TMDb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a TVDb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending, Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getItems(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer indexNumber, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getItems(userId, maxOfficialRating, hasThemeSong, hasThemeVideo, hasSubtitles, hasSpecialFeature, + hasTrailer, adjacentTo, indexNumber, parentIndexNumber, hasParentalRating, isHd, is4K, locationTypes, + excludeLocationTypes, isMissing, isUnaired, minCommunityRating, minCriticRating, minPremiereDate, + minDateLastSaved, minDateLastSavedForUser, maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, + hasTvdbId, isMovie, isSeries, isNews, isKids, isSports, excludeItemIds, startIndex, limit, recursive, + searchTerm, sortOrder, parentId, fields, excludeItemTypes, includeItemTypes, filters, isFavorite, + mediaTypes, imageTypes, sortBy, isPlayed, genres, officialRatings, tags, years, enableUserData, + imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, artists, excludeArtistIds, + artistIds, albumArtistIds, contributingArtistIds, albums, albumIds, ids, videoTypes, minOfficialRating, + isLocked, isPlaceHolder, hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, + maxHeight, is3D, seriesStatus, nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, + genreIds, enableTotalRecordCount, enableImages, null); + } + + /** + * Gets items based on a query. + * + * @param userId The user id supplied as query parameter; this is required when not using an API key. (optional) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param indexNumber Optional filter by index number. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an IMDb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a TMDb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a TVDb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending, Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getItems(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer indexNumber, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { + ApiResponse localVarResponse = getItemsWithHttpInfo(userId, maxOfficialRating, + hasThemeSong, hasThemeVideo, hasSubtitles, hasSpecialFeature, hasTrailer, adjacentTo, indexNumber, + parentIndexNumber, hasParentalRating, isHd, is4K, locationTypes, excludeLocationTypes, isMissing, + isUnaired, minCommunityRating, minCriticRating, minPremiereDate, minDateLastSaved, + minDateLastSavedForUser, maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, hasTvdbId, isMovie, + isSeries, isNews, isKids, isSports, excludeItemIds, startIndex, limit, recursive, searchTerm, sortOrder, + parentId, fields, excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, imageTypes, + sortBy, isPlayed, genres, officialRatings, tags, years, enableUserData, imageTypeLimit, + enableImageTypes, person, personIds, personTypes, studios, artists, excludeArtistIds, artistIds, + albumArtistIds, contributingArtistIds, albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, + isPlaceHolder, hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, + seriesStatus, nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, + enableTotalRecordCount, enableImages, headers); return localVarResponse.getData(); } - /** - * Get Item User Data. - * - * @param itemId The item id. (required) - * @param userId The user id. (optional) - * @return ApiResponse<UserItemDataDto> - * @throws ApiException if fails to make API call - */ - public ApiResponse getItemUserDataWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getItemUserDataRequestBuilder(itemId, userId); - try { - HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode() / 100 != 2) { - throw getApiException("getItemUserData", localVarResponse); - } - if (localVarResponse.body() == null) { - return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), null); - } - - String responseBody = new String(localVarResponse.body().readAllBytes()); - localVarResponse.body().close(); - - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder getItemUserDataRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - // verify the required parameter 'itemId' is set - if (itemId == null) { - throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemUserData"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/UserItems/{itemId}/UserData".replace("{itemId}", - ApiClient.urlEncode(itemId.toString())); - - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "userId"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); - - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - } - - localVarRequestBuilder.header("Accept", - "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** * Gets items based on a query. * @@ -310,10 +857,10 @@ private HttpRequest.Builder getItemUserDataRequestBuilder(@org.eclipse.jdt.annot * delimited. (optional) * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) * @param enableImages Optional, include image information in output. (optional, default to true) - * @return BaseItemDtoQueryResult + * @return ApiResponse<BaseItemDtoQueryResult> * @throws ApiException if fails to make API call */ - public BaseItemDtoQueryResult getItems(@org.eclipse.jdt.annotation.NonNull UUID userId, + public ApiResponse getItemsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, @@ -389,20 +936,18 @@ public BaseItemDtoQueryResult getItems(@org.eclipse.jdt.annotation.NonNull UUID @org.eclipse.jdt.annotation.NonNull List genreIds, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { - ApiResponse localVarResponse = getItemsWithHttpInfo(userId, maxOfficialRating, - hasThemeSong, hasThemeVideo, hasSubtitles, hasSpecialFeature, hasTrailer, adjacentTo, indexNumber, - parentIndexNumber, hasParentalRating, isHd, is4K, locationTypes, excludeLocationTypes, isMissing, - isUnaired, minCommunityRating, minCriticRating, minPremiereDate, minDateLastSaved, - minDateLastSavedForUser, maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, hasTvdbId, isMovie, - isSeries, isNews, isKids, isSports, excludeItemIds, startIndex, limit, recursive, searchTerm, sortOrder, - parentId, fields, excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, imageTypes, - sortBy, isPlayed, genres, officialRatings, tags, years, enableUserData, imageTypeLimit, - enableImageTypes, person, personIds, personTypes, studios, artists, excludeArtistIds, artistIds, - albumArtistIds, contributingArtistIds, albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, - isPlaceHolder, hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, - seriesStatus, nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, - enableTotalRecordCount, enableImages); - return localVarResponse.getData(); + return getItemsWithHttpInfo(userId, maxOfficialRating, hasThemeSong, hasThemeVideo, hasSubtitles, + hasSpecialFeature, hasTrailer, adjacentTo, indexNumber, parentIndexNumber, hasParentalRating, isHd, + is4K, locationTypes, excludeLocationTypes, isMissing, isUnaired, minCommunityRating, minCriticRating, + minPremiereDate, minDateLastSaved, minDateLastSavedForUser, maxPremiereDate, hasOverview, hasImdbId, + hasTmdbId, hasTvdbId, isMovie, isSeries, isNews, isKids, isSports, excludeItemIds, startIndex, limit, + recursive, searchTerm, sortOrder, parentId, fields, excludeItemTypes, includeItemTypes, filters, + isFavorite, mediaTypes, imageTypes, sortBy, isPlayed, genres, officialRatings, tags, years, + enableUserData, imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, artists, + excludeArtistIds, artistIds, albumArtistIds, contributingArtistIds, albums, albumIds, ids, videoTypes, + minOfficialRating, isLocked, isPlaceHolder, hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, + maxWidth, maxHeight, is3D, seriesStatus, nameStartsWithOrGreater, nameStartsWith, nameLessThan, + studioIds, genreIds, enableTotalRecordCount, enableImages, null); } /** @@ -531,6 +1076,7 @@ public BaseItemDtoQueryResult getItems(@org.eclipse.jdt.annotation.NonNull UUID * delimited. (optional) * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) * @param enableImages Optional, include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request * @return ApiResponse<BaseItemDtoQueryResult> * @throws ApiException if fails to make API call */ @@ -609,7 +1155,7 @@ public ApiResponse getItemsWithHttpInfo(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull List genreIds, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, - @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getItemsRequestBuilder(userId, maxOfficialRating, hasThemeSong, hasThemeVideo, hasSubtitles, hasSpecialFeature, hasTrailer, adjacentTo, indexNumber, parentIndexNumber, hasParentalRating, isHd, is4K, locationTypes, excludeLocationTypes, isMissing, isUnaired, @@ -622,7 +1168,7 @@ public ApiResponse getItemsWithHttpInfo(@org.eclipse.jdt contributingArtistIds, albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, isPlaceHolder, hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, seriesStatus, nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, enableTotalRecordCount, - enableImages); + enableImages, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -639,14 +1185,14 @@ public ApiResponse getItemsWithHttpInfo(@org.eclipse.jdt } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -732,7 +1278,7 @@ private HttpRequest.Builder getItemsRequestBuilder(@org.eclipse.jdt.annotation.N @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull List genreIds, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, - @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -932,6 +1478,8 @@ private HttpRequest.Builder getItemsRequestBuilder(@org.eclipse.jdt.annotation.N if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -979,9 +1527,58 @@ public BaseItemDtoQueryResult getResumeItems(@org.eclipse.jdt.annotation.NonNull @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean excludeActiveSessions) throws ApiException { + return getResumeItems(userId, startIndex, limit, searchTerm, parentId, fields, mediaTypes, enableUserData, + imageTypeLimit, enableImageTypes, excludeItemTypes, includeItemTypes, enableTotalRecordCount, + enableImages, excludeActiveSessions, null); + } + + /** + * Gets items based on a query. + * + * @param userId The user id. (optional) + * @param startIndex The start index. (optional) + * @param limit The item limit. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional. Include image information in output. (optional, default to true) + * @param excludeActiveSessions Optional. Whether to exclude the currently active sessions. (optional, default to + * false) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getResumeItems(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean excludeActiveSessions, Map headers) + throws ApiException { ApiResponse localVarResponse = getResumeItemsWithHttpInfo(userId, startIndex, limit, searchTerm, parentId, fields, mediaTypes, enableUserData, imageTypeLimit, enableImageTypes, - excludeItemTypes, includeItemTypes, enableTotalRecordCount, enableImages, excludeActiveSessions); + excludeItemTypes, includeItemTypes, enableTotalRecordCount, enableImages, excludeActiveSessions, + headers); return localVarResponse.getData(); } @@ -1027,9 +1624,58 @@ public ApiResponse getResumeItemsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean excludeActiveSessions) throws ApiException { + return getResumeItemsWithHttpInfo(userId, startIndex, limit, searchTerm, parentId, fields, mediaTypes, + enableUserData, imageTypeLimit, enableImageTypes, excludeItemTypes, includeItemTypes, + enableTotalRecordCount, enableImages, excludeActiveSessions, null); + } + + /** + * Gets items based on a query. + * + * @param userId The user id. (optional) + * @param startIndex The start index. (optional) + * @param limit The item limit. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional. Include image information in output. (optional, default to true) + * @param excludeActiveSessions Optional. Whether to exclude the currently active sessions. (optional, default to + * false) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getResumeItemsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean excludeActiveSessions, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getResumeItemsRequestBuilder(userId, startIndex, limit, searchTerm, parentId, fields, mediaTypes, enableUserData, imageTypeLimit, enableImageTypes, excludeItemTypes, - includeItemTypes, enableTotalRecordCount, enableImages, excludeActiveSessions); + includeItemTypes, enableTotalRecordCount, enableImages, excludeActiveSessions, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1046,14 +1692,14 @@ public ApiResponse getResumeItemsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1076,7 +1722,8 @@ private HttpRequest.Builder getResumeItemsRequestBuilder(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.NonNull List includeItemTypes, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, - @org.eclipse.jdt.annotation.NonNull Boolean excludeActiveSessions) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean excludeActiveSessions, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -1134,6 +1781,8 @@ private HttpRequest.Builder getResumeItemsRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1152,8 +1801,24 @@ private HttpRequest.Builder getResumeItemsRequestBuilder(@org.eclipse.jdt.annota public UserItemDataDto updateItemUserData(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable UpdateUserItemDataDto updateUserItemDataDto, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return updateItemUserData(itemId, updateUserItemDataDto, userId, null); + } + + /** + * Update Item User Data. + * + * @param itemId The item id. (required) + * @param updateUserItemDataDto New user data object. (required) + * @param userId The user id. (optional) + * @param headers Optional headers to include in the request + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto updateItemUserData(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UpdateUserItemDataDto updateUserItemDataDto, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { ApiResponse localVarResponse = updateItemUserDataWithHttpInfo(itemId, updateUserItemDataDto, - userId); + userId, headers); return localVarResponse.getData(); } @@ -1169,8 +1834,24 @@ public UserItemDataDto updateItemUserData(@org.eclipse.jdt.annotation.Nullable U public ApiResponse updateItemUserDataWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable UpdateUserItemDataDto updateUserItemDataDto, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return updateItemUserDataWithHttpInfo(itemId, updateUserItemDataDto, userId, null); + } + + /** + * Update Item User Data. + * + * @param itemId The item id. (required) + * @param updateUserItemDataDto New user data object. (required) + * @param userId The user id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateItemUserDataWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UpdateUserItemDataDto updateUserItemDataDto, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = updateItemUserDataRequestBuilder(itemId, updateUserItemDataDto, - userId); + userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1187,12 +1868,14 @@ public ApiResponse updateItemUserDataWithHttpInfo(@org.eclipse. } String responseBody = new String(localVarResponse.body().readAllBytes()); + UserItemDataDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1205,7 +1888,7 @@ public ApiResponse updateItemUserDataWithHttpInfo(@org.eclipse. private HttpRequest.Builder updateItemUserDataRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable UpdateUserItemDataDto updateUserItemDataDto, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling updateItemUserData"); @@ -1251,6 +1934,8 @@ private HttpRequest.Builder updateItemUserDataRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LibraryApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LibraryApi.java index f168164b90a21..ff022c200766a 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LibraryApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LibraryApi.java @@ -22,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -48,6 +49,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class LibraryApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -83,6 +106,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Deletes an item from the library and filesystem. * @@ -90,7 +163,19 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public void deleteItem(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - deleteItemWithHttpInfo(itemId); + deleteItem(itemId, null); + } + + /** + * Deletes an item from the library and filesystem. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) + throws ApiException { + deleteItemWithHttpInfo(itemId, headers); } /** @@ -102,7 +187,20 @@ public void deleteItem(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws */ public ApiResponse deleteItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteItemRequestBuilder(itemId); + return deleteItemWithHttpInfo(itemId, null); + } + + /** + * Deletes an item from the library and filesystem. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteItemRequestBuilder(itemId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -129,8 +227,8 @@ public ApiResponse deleteItemWithHttpInfo(@org.eclipse.jdt.annotation.Null } } - private HttpRequest.Builder deleteItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) - throws ApiException { + private HttpRequest.Builder deleteItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteItem"); @@ -149,6 +247,8 @@ private HttpRequest.Builder deleteItemRequestBuilder(@org.eclipse.jdt.annotation if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -162,7 +262,19 @@ private HttpRequest.Builder deleteItemRequestBuilder(@org.eclipse.jdt.annotation * @throws ApiException if fails to make API call */ public void deleteItems(@org.eclipse.jdt.annotation.NonNull List ids) throws ApiException { - deleteItemsWithHttpInfo(ids); + deleteItems(ids, null); + } + + /** + * Deletes items from the library and filesystem. + * + * @param ids The item ids. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteItems(@org.eclipse.jdt.annotation.NonNull List ids, Map headers) + throws ApiException { + deleteItemsWithHttpInfo(ids, headers); } /** @@ -174,7 +286,20 @@ public void deleteItems(@org.eclipse.jdt.annotation.NonNull List ids) thro */ public ApiResponse deleteItemsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull List ids) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteItemsRequestBuilder(ids); + return deleteItemsWithHttpInfo(ids, null); + } + + /** + * Deletes items from the library and filesystem. + * + * @param ids The item ids. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteItemsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull List ids, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteItemsRequestBuilder(ids, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -201,8 +326,8 @@ public ApiResponse deleteItemsWithHttpInfo(@org.eclipse.jdt.annotation.Non } } - private HttpRequest.Builder deleteItemsRequestBuilder(@org.eclipse.jdt.annotation.NonNull List ids) - throws ApiException { + private HttpRequest.Builder deleteItemsRequestBuilder(@org.eclipse.jdt.annotation.NonNull List ids, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -232,6 +357,8 @@ private HttpRequest.Builder deleteItemsRequestBuilder(@org.eclipse.jdt.annotatio if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -248,7 +375,21 @@ private HttpRequest.Builder deleteItemsRequestBuilder(@org.eclipse.jdt.annotatio */ public List getAncestors(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse> localVarResponse = getAncestorsWithHttpInfo(itemId, userId); + return getAncestors(itemId, userId, null); + } + + /** + * Gets all parents of an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return List<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public List getAncestors(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse> localVarResponse = getAncestorsWithHttpInfo(itemId, userId, headers); return localVarResponse.getData(); } @@ -262,7 +403,21 @@ public List getAncestors(@org.eclipse.jdt.annotation.Nullable UUID */ public ApiResponse> getAncestorsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getAncestorsRequestBuilder(itemId, userId); + return getAncestorsWithHttpInfo(itemId, userId, null); + } + + /** + * Gets all parents of an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<BaseItemDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getAncestorsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAncestorsRequestBuilder(itemId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -279,12 +434,14 @@ public ApiResponse> getAncestorsWithHttpInfo(@org.eclipse.jdt. } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -296,7 +453,7 @@ public ApiResponse> getAncestorsWithHttpInfo(@org.eclipse.jdt. } private HttpRequest.Builder getAncestorsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getAncestors"); @@ -330,6 +487,8 @@ private HttpRequest.Builder getAncestorsRequestBuilder(@org.eclipse.jdt.annotati if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -347,7 +506,22 @@ private HttpRequest.Builder getAncestorsRequestBuilder(@org.eclipse.jdt.annotati @Deprecated public BaseItemDtoQueryResult getCriticReviews(@org.eclipse.jdt.annotation.Nullable String itemId) throws ApiException { - ApiResponse localVarResponse = getCriticReviewsWithHttpInfo(itemId); + return getCriticReviews(itemId, null); + } + + /** + * Gets critic review for an item. + * + * @param itemId (required) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getCriticReviews(@org.eclipse.jdt.annotation.Nullable String itemId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getCriticReviewsWithHttpInfo(itemId, headers); return localVarResponse.getData(); } @@ -362,7 +536,22 @@ public BaseItemDtoQueryResult getCriticReviews(@org.eclipse.jdt.annotation.Nulla @Deprecated public ApiResponse getCriticReviewsWithHttpInfo( @org.eclipse.jdt.annotation.Nullable String itemId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getCriticReviewsRequestBuilder(itemId); + return getCriticReviewsWithHttpInfo(itemId, null); + } + + /** + * Gets critic review for an item. + * + * @param itemId (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getCriticReviewsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String itemId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getCriticReviewsRequestBuilder(itemId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -379,14 +568,14 @@ public ApiResponse getCriticReviewsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -397,8 +586,8 @@ public ApiResponse getCriticReviewsWithHttpInfo( } } - private HttpRequest.Builder getCriticReviewsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String itemId) - throws ApiException { + private HttpRequest.Builder getCriticReviewsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String itemId, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getCriticReviews"); @@ -418,6 +607,8 @@ private HttpRequest.Builder getCriticReviewsRequestBuilder(@org.eclipse.jdt.anno if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -432,7 +623,20 @@ private HttpRequest.Builder getCriticReviewsRequestBuilder(@org.eclipse.jdt.anno * @throws ApiException if fails to make API call */ public File getDownload(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - ApiResponse localVarResponse = getDownloadWithHttpInfo(itemId); + return getDownload(itemId, null); + } + + /** + * Downloads item media. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getDownload(@org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getDownloadWithHttpInfo(itemId, headers); return localVarResponse.getData(); } @@ -445,7 +649,20 @@ public File getDownload(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws */ public ApiResponse getDownloadWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getDownloadRequestBuilder(itemId); + return getDownloadWithHttpInfo(itemId, null); + } + + /** + * Downloads item media. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDownloadWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDownloadRequestBuilder(itemId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -460,13 +677,13 @@ public ApiResponse getDownloadWithHttpInfo(@org.eclipse.jdt.annotation.Nul return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -477,8 +694,8 @@ public ApiResponse getDownloadWithHttpInfo(@org.eclipse.jdt.annotation.Nul } } - private HttpRequest.Builder getDownloadRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) - throws ApiException { + private HttpRequest.Builder getDownloadRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getDownload"); @@ -497,6 +714,8 @@ private HttpRequest.Builder getDownloadRequestBuilder(@org.eclipse.jdt.annotatio if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -511,7 +730,20 @@ private HttpRequest.Builder getDownloadRequestBuilder(@org.eclipse.jdt.annotatio * @throws ApiException if fails to make API call */ public File getFile(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - ApiResponse localVarResponse = getFileWithHttpInfo(itemId); + return getFile(itemId, null); + } + + /** + * Get the original file of an item. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getFile(@org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getFileWithHttpInfo(itemId, headers); return localVarResponse.getData(); } @@ -523,7 +755,20 @@ public File getFile(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws Api * @throws ApiException if fails to make API call */ public ApiResponse getFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getFileRequestBuilder(itemId); + return getFileWithHttpInfo(itemId, null); + } + + /** + * Get the original file of an item. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFileRequestBuilder(itemId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -538,13 +783,13 @@ public ApiResponse getFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullabl return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -555,8 +800,8 @@ public ApiResponse getFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullabl } } - private HttpRequest.Builder getFileRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) - throws ApiException { + private HttpRequest.Builder getFileRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getFile"); @@ -575,6 +820,8 @@ private HttpRequest.Builder getFileRequestBuilder(@org.eclipse.jdt.annotation.Nu if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -591,7 +838,21 @@ private HttpRequest.Builder getFileRequestBuilder(@org.eclipse.jdt.annotation.Nu */ public ItemCounts getItemCounts(@org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean isFavorite) throws ApiException { - ApiResponse localVarResponse = getItemCountsWithHttpInfo(userId, isFavorite); + return getItemCounts(userId, isFavorite, null); + } + + /** + * Get item counts. + * + * @param userId Optional. Get counts from a specific user's library. (optional) + * @param isFavorite Optional. Get counts of favorite items. (optional) + * @param headers Optional headers to include in the request + * @return ItemCounts + * @throws ApiException if fails to make API call + */ + public ItemCounts getItemCounts(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, Map headers) throws ApiException { + ApiResponse localVarResponse = getItemCountsWithHttpInfo(userId, isFavorite, headers); return localVarResponse.getData(); } @@ -605,7 +866,21 @@ public ItemCounts getItemCounts(@org.eclipse.jdt.annotation.NonNull UUID userId, */ public ApiResponse getItemCountsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean isFavorite) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getItemCountsRequestBuilder(userId, isFavorite); + return getItemCountsWithHttpInfo(userId, isFavorite, null); + } + + /** + * Get item counts. + * + * @param userId Optional. Get counts from a specific user's library. (optional) + * @param isFavorite Optional. Get counts of favorite items. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<ItemCounts> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemCountsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemCountsRequestBuilder(userId, isFavorite, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -622,12 +897,14 @@ public ApiResponse getItemCountsWithHttpInfo(@org.eclipse.jdt.annota } String responseBody = new String(localVarResponse.body().readAllBytes()); + ItemCounts responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -639,7 +916,7 @@ public ApiResponse getItemCountsWithHttpInfo(@org.eclipse.jdt.annota } private HttpRequest.Builder getItemCountsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, - @org.eclipse.jdt.annotation.NonNull Boolean isFavorite) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -671,6 +948,8 @@ private HttpRequest.Builder getItemCountsRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -688,8 +967,23 @@ private HttpRequest.Builder getItemCountsRequestBuilder(@org.eclipse.jdt.annotat public LibraryOptionsResultDto getLibraryOptionsInfo( @org.eclipse.jdt.annotation.NonNull CollectionType libraryContentType, @org.eclipse.jdt.annotation.NonNull Boolean isNewLibrary) throws ApiException { + return getLibraryOptionsInfo(libraryContentType, isNewLibrary, null); + } + + /** + * Gets the library options info. + * + * @param libraryContentType Library content type. (optional) + * @param isNewLibrary Whether this is a new library. (optional, default to false) + * @param headers Optional headers to include in the request + * @return LibraryOptionsResultDto + * @throws ApiException if fails to make API call + */ + public LibraryOptionsResultDto getLibraryOptionsInfo( + @org.eclipse.jdt.annotation.NonNull CollectionType libraryContentType, + @org.eclipse.jdt.annotation.NonNull Boolean isNewLibrary, Map headers) throws ApiException { ApiResponse localVarResponse = getLibraryOptionsInfoWithHttpInfo(libraryContentType, - isNewLibrary); + isNewLibrary, headers); return localVarResponse.getData(); } @@ -704,8 +998,23 @@ public LibraryOptionsResultDto getLibraryOptionsInfo( public ApiResponse getLibraryOptionsInfoWithHttpInfo( @org.eclipse.jdt.annotation.NonNull CollectionType libraryContentType, @org.eclipse.jdt.annotation.NonNull Boolean isNewLibrary) throws ApiException { + return getLibraryOptionsInfoWithHttpInfo(libraryContentType, isNewLibrary, null); + } + + /** + * Gets the library options info. + * + * @param libraryContentType Library content type. (optional) + * @param isNewLibrary Whether this is a new library. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<LibraryOptionsResultDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLibraryOptionsInfoWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull CollectionType libraryContentType, + @org.eclipse.jdt.annotation.NonNull Boolean isNewLibrary, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getLibraryOptionsInfoRequestBuilder(libraryContentType, - isNewLibrary); + isNewLibrary, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -722,14 +1031,14 @@ public ApiResponse getLibraryOptionsInfoWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + LibraryOptionsResultDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -742,7 +1051,7 @@ public ApiResponse getLibraryOptionsInfoWithHttpInfo( private HttpRequest.Builder getLibraryOptionsInfoRequestBuilder( @org.eclipse.jdt.annotation.NonNull CollectionType libraryContentType, - @org.eclipse.jdt.annotation.NonNull Boolean isNewLibrary) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean isNewLibrary, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -774,6 +1083,8 @@ private HttpRequest.Builder getLibraryOptionsInfoRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -789,7 +1100,20 @@ private HttpRequest.Builder getLibraryOptionsInfoRequestBuilder( */ public BaseItemDtoQueryResult getMediaFolders(@org.eclipse.jdt.annotation.NonNull Boolean isHidden) throws ApiException { - ApiResponse localVarResponse = getMediaFoldersWithHttpInfo(isHidden); + return getMediaFolders(isHidden, null); + } + + /** + * Gets all user media folders. + * + * @param isHidden Optional. Filter by folders that are marked hidden, or not. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getMediaFolders(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + Map headers) throws ApiException { + ApiResponse localVarResponse = getMediaFoldersWithHttpInfo(isHidden, headers); return localVarResponse.getData(); } @@ -802,7 +1126,20 @@ public BaseItemDtoQueryResult getMediaFolders(@org.eclipse.jdt.annotation.NonNul */ public ApiResponse getMediaFoldersWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Boolean isHidden) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getMediaFoldersRequestBuilder(isHidden); + return getMediaFoldersWithHttpInfo(isHidden, null); + } + + /** + * Gets all user media folders. + * + * @param isHidden Optional. Filter by folders that are marked hidden, or not. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMediaFoldersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean isHidden, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMediaFoldersRequestBuilder(isHidden, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -819,14 +1156,14 @@ public ApiResponse getMediaFoldersWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -837,8 +1174,8 @@ public ApiResponse getMediaFoldersWithHttpInfo( } } - private HttpRequest.Builder getMediaFoldersRequestBuilder(@org.eclipse.jdt.annotation.NonNull Boolean isHidden) - throws ApiException { + private HttpRequest.Builder getMediaFoldersRequestBuilder(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -868,6 +1205,8 @@ private HttpRequest.Builder getMediaFoldersRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -881,7 +1220,18 @@ private HttpRequest.Builder getMediaFoldersRequestBuilder(@org.eclipse.jdt.annot * @throws ApiException if fails to make API call */ public List getPhysicalPaths() throws ApiException { - ApiResponse> localVarResponse = getPhysicalPathsWithHttpInfo(); + return getPhysicalPaths(null); + } + + /** + * Gets a list of physical paths from virtual folders. + * + * @param headers Optional headers to include in the request + * @return List<String> + * @throws ApiException if fails to make API call + */ + public List getPhysicalPaths(Map headers) throws ApiException { + ApiResponse> localVarResponse = getPhysicalPathsWithHttpInfo(headers); return localVarResponse.getData(); } @@ -892,7 +1242,18 @@ public List getPhysicalPaths() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getPhysicalPathsWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPhysicalPathsRequestBuilder(); + return getPhysicalPathsWithHttpInfo(null); + } + + /** + * Gets a list of physical paths from virtual folders. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<String>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPhysicalPathsWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPhysicalPathsRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -909,12 +1270,14 @@ public ApiResponse> getPhysicalPathsWithHttpInfo() throws ApiExcept } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -925,7 +1288,7 @@ public ApiResponse> getPhysicalPathsWithHttpInfo() throws ApiExcept } } - private HttpRequest.Builder getPhysicalPathsRequestBuilder() throws ApiException { + private HttpRequest.Builder getPhysicalPathsRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -940,6 +1303,8 @@ private HttpRequest.Builder getPhysicalPathsRequestBuilder() throws ApiException if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -964,9 +1329,7 @@ public BaseItemDtoQueryResult getSimilarAlbums(@org.eclipse.jdt.annotation.Nulla @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { - ApiResponse localVarResponse = getSimilarAlbumsWithHttpInfo(itemId, excludeArtistIds, - userId, limit, fields); - return localVarResponse.getData(); + return getSimilarAlbums(itemId, excludeArtistIds, userId, limit, fields, null); } /** @@ -980,22 +1343,71 @@ public BaseItemDtoQueryResult getSimilarAlbums(@org.eclipse.jdt.annotation.Nulla * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, * SortName, Studios, Taglines, TrailerUrls. (optional) - * @return ApiResponse<BaseItemDtoQueryResult> + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult * @throws ApiException if fails to make API call */ - public ApiResponse getSimilarAlbumsWithHttpInfo( - @org.eclipse.jdt.annotation.Nullable UUID itemId, + public BaseItemDtoQueryResult getSimilarAlbums(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, - @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getSimilarAlbumsRequestBuilder(itemId, excludeArtistIds, userId, - limit, fields); - try { - HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + ApiResponse localVarResponse = getSimilarAlbumsWithHttpInfo(itemId, excludeArtistIds, + userId, limit, fields, headers); + return localVarResponse.getData(); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarAlbumsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarAlbumsWithHttpInfo(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarAlbumsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSimilarAlbumsRequestBuilder(itemId, excludeArtistIds, userId, + limit, fields, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } try { if (localVarResponse.statusCode() / 100 != 2) { throw getApiException("getSimilarAlbums", localVarResponse); @@ -1006,14 +1418,14 @@ public ApiResponse getSimilarAlbumsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1027,7 +1439,8 @@ public ApiResponse getSimilarAlbumsWithHttpInfo( private HttpRequest.Builder getSimilarAlbumsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, - @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarAlbums"); @@ -1067,6 +1480,8 @@ private HttpRequest.Builder getSimilarAlbumsRequestBuilder(@org.eclipse.jdt.anno if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1091,8 +1506,31 @@ public BaseItemDtoQueryResult getSimilarArtists(@org.eclipse.jdt.annotation.Null @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarArtists(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarArtists(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { ApiResponse localVarResponse = getSimilarArtistsWithHttpInfo(itemId, excludeArtistIds, - userId, limit, fields); + userId, limit, fields, headers); return localVarResponse.getData(); } @@ -1115,8 +1553,32 @@ public ApiResponse getSimilarArtistsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarArtistsWithHttpInfo(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarArtistsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getSimilarArtistsRequestBuilder(itemId, excludeArtistIds, userId, - limit, fields); + limit, fields, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1133,14 +1595,14 @@ public ApiResponse getSimilarArtistsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1154,7 +1616,8 @@ public ApiResponse getSimilarArtistsWithHttpInfo( private HttpRequest.Builder getSimilarArtistsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, - @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarArtists"); @@ -1194,6 +1657,8 @@ private HttpRequest.Builder getSimilarArtistsRequestBuilder(@org.eclipse.jdt.ann if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1218,8 +1683,31 @@ public BaseItemDtoQueryResult getSimilarItems(@org.eclipse.jdt.annotation.Nullab @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarItems(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarItems(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { ApiResponse localVarResponse = getSimilarItemsWithHttpInfo(itemId, excludeArtistIds, - userId, limit, fields); + userId, limit, fields, headers); return localVarResponse.getData(); } @@ -1242,8 +1730,32 @@ public ApiResponse getSimilarItemsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarItemsWithHttpInfo(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarItemsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getSimilarItemsRequestBuilder(itemId, excludeArtistIds, userId, - limit, fields); + limit, fields, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1260,14 +1772,14 @@ public ApiResponse getSimilarItemsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1281,7 +1793,8 @@ public ApiResponse getSimilarItemsWithHttpInfo( private HttpRequest.Builder getSimilarItemsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, - @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarItems"); @@ -1321,6 +1834,8 @@ private HttpRequest.Builder getSimilarItemsRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1345,8 +1860,31 @@ public BaseItemDtoQueryResult getSimilarMovies(@org.eclipse.jdt.annotation.Nulla @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarMovies(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarMovies(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { ApiResponse localVarResponse = getSimilarMoviesWithHttpInfo(itemId, excludeArtistIds, - userId, limit, fields); + userId, limit, fields, headers); return localVarResponse.getData(); } @@ -1369,8 +1907,32 @@ public ApiResponse getSimilarMoviesWithHttpInfo( @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarMoviesWithHttpInfo(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarMoviesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getSimilarMoviesRequestBuilder(itemId, excludeArtistIds, userId, - limit, fields); + limit, fields, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1387,14 +1949,14 @@ public ApiResponse getSimilarMoviesWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1408,7 +1970,8 @@ public ApiResponse getSimilarMoviesWithHttpInfo( private HttpRequest.Builder getSimilarMoviesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, - @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarMovies"); @@ -1448,6 +2011,8 @@ private HttpRequest.Builder getSimilarMoviesRequestBuilder(@org.eclipse.jdt.anno if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1472,8 +2037,31 @@ public BaseItemDtoQueryResult getSimilarShows(@org.eclipse.jdt.annotation.Nullab @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarShows(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarShows(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { ApiResponse localVarResponse = getSimilarShowsWithHttpInfo(itemId, excludeArtistIds, - userId, limit, fields); + userId, limit, fields, headers); return localVarResponse.getData(); } @@ -1496,8 +2084,32 @@ public ApiResponse getSimilarShowsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarShowsWithHttpInfo(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarShowsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getSimilarShowsRequestBuilder(itemId, excludeArtistIds, userId, - limit, fields); + limit, fields, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1514,14 +2126,14 @@ public ApiResponse getSimilarShowsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1535,7 +2147,8 @@ public ApiResponse getSimilarShowsWithHttpInfo( private HttpRequest.Builder getSimilarShowsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, - @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarShows"); @@ -1575,6 +2188,8 @@ private HttpRequest.Builder getSimilarShowsRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1599,8 +2214,31 @@ public BaseItemDtoQueryResult getSimilarTrailers(@org.eclipse.jdt.annotation.Nul @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarTrailers(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarTrailers(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { ApiResponse localVarResponse = getSimilarTrailersWithHttpInfo(itemId, excludeArtistIds, - userId, limit, fields); + userId, limit, fields, headers); return localVarResponse.getData(); } @@ -1623,8 +2261,32 @@ public ApiResponse getSimilarTrailersWithHttpInfo( @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarTrailersWithHttpInfo(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarTrailersWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getSimilarTrailersRequestBuilder(itemId, excludeArtistIds, userId, - limit, fields); + limit, fields, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1641,14 +2303,14 @@ public ApiResponse getSimilarTrailersWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1662,7 +2324,8 @@ public ApiResponse getSimilarTrailersWithHttpInfo( private HttpRequest.Builder getSimilarTrailersRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, - @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarTrailers"); @@ -1702,6 +2365,8 @@ private HttpRequest.Builder getSimilarTrailersRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1727,8 +2392,32 @@ public AllThemeMediaResult getThemeMedia(@org.eclipse.jdt.annotation.Nullable UU @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, @org.eclipse.jdt.annotation.NonNull List sortBy, @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + return getThemeMedia(itemId, userId, inheritFromParent, sortBy, sortOrder, null); + } + + /** + * Get theme songs and videos for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param sortOrder Optional. Sort Order - Ascending, Descending. (optional) + * @param headers Optional headers to include in the request + * @return AllThemeMediaResult + * @throws ApiException if fails to make API call + */ + public AllThemeMediaResult getThemeMedia(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, Map headers) + throws ApiException { ApiResponse localVarResponse = getThemeMediaWithHttpInfo(itemId, userId, inheritFromParent, - sortBy, sortOrder); + sortBy, sortOrder, headers); return localVarResponse.getData(); } @@ -1751,8 +2440,32 @@ public ApiResponse getThemeMediaWithHttpInfo(@org.eclipse.j @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, @org.eclipse.jdt.annotation.NonNull List sortBy, @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + return getThemeMediaWithHttpInfo(itemId, userId, inheritFromParent, sortBy, sortOrder, null); + } + + /** + * Get theme songs and videos for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param sortOrder Optional. Sort Order - Ascending, Descending. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<AllThemeMediaResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getThemeMediaWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getThemeMediaRequestBuilder(itemId, userId, inheritFromParent, - sortBy, sortOrder); + sortBy, sortOrder, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1769,14 +2482,14 @@ public ApiResponse getThemeMediaWithHttpInfo(@org.eclipse.j } String responseBody = new String(localVarResponse.body().readAllBytes()); + AllThemeMediaResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1791,7 +2504,8 @@ private HttpRequest.Builder getThemeMediaRequestBuilder(@org.eclipse.jdt.annotat @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, @org.eclipse.jdt.annotation.NonNull List sortBy, - @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List sortOrder, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getThemeMedia"); @@ -1831,6 +2545,8 @@ private HttpRequest.Builder getThemeMediaRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1856,8 +2572,32 @@ public ThemeMediaResult getThemeSongs(@org.eclipse.jdt.annotation.Nullable UUID @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, @org.eclipse.jdt.annotation.NonNull List sortBy, @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + return getThemeSongs(itemId, userId, inheritFromParent, sortBy, sortOrder, null); + } + + /** + * Get theme songs for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param sortOrder Optional. Sort Order - Ascending, Descending. (optional) + * @param headers Optional headers to include in the request + * @return ThemeMediaResult + * @throws ApiException if fails to make API call + */ + public ThemeMediaResult getThemeSongs(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, Map headers) + throws ApiException { ApiResponse localVarResponse = getThemeSongsWithHttpInfo(itemId, userId, inheritFromParent, - sortBy, sortOrder); + sortBy, sortOrder, headers); return localVarResponse.getData(); } @@ -1880,8 +2620,32 @@ public ApiResponse getThemeSongsWithHttpInfo(@org.eclipse.jdt. @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, @org.eclipse.jdt.annotation.NonNull List sortBy, @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + return getThemeSongsWithHttpInfo(itemId, userId, inheritFromParent, sortBy, sortOrder, null); + } + + /** + * Get theme songs for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param sortOrder Optional. Sort Order - Ascending, Descending. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<ThemeMediaResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getThemeSongsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getThemeSongsRequestBuilder(itemId, userId, inheritFromParent, - sortBy, sortOrder); + sortBy, sortOrder, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1898,12 +2662,14 @@ public ApiResponse getThemeSongsWithHttpInfo(@org.eclipse.jdt. } String responseBody = new String(localVarResponse.body().readAllBytes()); + ThemeMediaResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1918,7 +2684,8 @@ private HttpRequest.Builder getThemeSongsRequestBuilder(@org.eclipse.jdt.annotat @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, @org.eclipse.jdt.annotation.NonNull List sortBy, - @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List sortOrder, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getThemeSongs"); @@ -1958,6 +2725,8 @@ private HttpRequest.Builder getThemeSongsRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1983,8 +2752,32 @@ public ThemeMediaResult getThemeVideos(@org.eclipse.jdt.annotation.Nullable UUID @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, @org.eclipse.jdt.annotation.NonNull List sortBy, @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + return getThemeVideos(itemId, userId, inheritFromParent, sortBy, sortOrder, null); + } + + /** + * Get theme videos for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param sortOrder Optional. Sort Order - Ascending, Descending. (optional) + * @param headers Optional headers to include in the request + * @return ThemeMediaResult + * @throws ApiException if fails to make API call + */ + public ThemeMediaResult getThemeVideos(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, Map headers) + throws ApiException { ApiResponse localVarResponse = getThemeVideosWithHttpInfo(itemId, userId, inheritFromParent, - sortBy, sortOrder); + sortBy, sortOrder, headers); return localVarResponse.getData(); } @@ -2007,8 +2800,32 @@ public ApiResponse getThemeVideosWithHttpInfo(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, @org.eclipse.jdt.annotation.NonNull List sortBy, @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + return getThemeVideosWithHttpInfo(itemId, userId, inheritFromParent, sortBy, sortOrder, null); + } + + /** + * Get theme videos for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param sortOrder Optional. Sort Order - Ascending, Descending. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<ThemeMediaResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getThemeVideosWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getThemeVideosRequestBuilder(itemId, userId, inheritFromParent, - sortBy, sortOrder); + sortBy, sortOrder, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2025,12 +2842,14 @@ public ApiResponse getThemeVideosWithHttpInfo(@org.eclipse.jdt } String responseBody = new String(localVarResponse.body().readAllBytes()); + ThemeMediaResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -2045,7 +2864,8 @@ private HttpRequest.Builder getThemeVideosRequestBuilder(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, @org.eclipse.jdt.annotation.NonNull List sortBy, - @org.eclipse.jdt.annotation.NonNull List sortOrder) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List sortOrder, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getThemeVideos"); @@ -2085,6 +2905,8 @@ private HttpRequest.Builder getThemeVideosRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2100,7 +2922,20 @@ private HttpRequest.Builder getThemeVideosRequestBuilder(@org.eclipse.jdt.annota */ public void postAddedMovies(@org.eclipse.jdt.annotation.NonNull String tmdbId, @org.eclipse.jdt.annotation.NonNull String imdbId) throws ApiException { - postAddedMoviesWithHttpInfo(tmdbId, imdbId); + postAddedMovies(tmdbId, imdbId, null); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param tmdbId The tmdbId. (optional) + * @param imdbId The imdbId. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postAddedMovies(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId, Map headers) throws ApiException { + postAddedMoviesWithHttpInfo(tmdbId, imdbId, headers); } /** @@ -2113,7 +2948,21 @@ public void postAddedMovies(@org.eclipse.jdt.annotation.NonNull String tmdbId, */ public ApiResponse postAddedMoviesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tmdbId, @org.eclipse.jdt.annotation.NonNull String imdbId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = postAddedMoviesRequestBuilder(tmdbId, imdbId); + return postAddedMoviesWithHttpInfo(tmdbId, imdbId, null); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param tmdbId The tmdbId. (optional) + * @param imdbId The imdbId. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postAddedMoviesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postAddedMoviesRequestBuilder(tmdbId, imdbId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2141,7 +2990,7 @@ public ApiResponse postAddedMoviesWithHttpInfo(@org.eclipse.jdt.annotation } private HttpRequest.Builder postAddedMoviesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String tmdbId, - @org.eclipse.jdt.annotation.NonNull String imdbId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String imdbId, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -2172,6 +3021,8 @@ private HttpRequest.Builder postAddedMoviesRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2185,7 +3036,19 @@ private HttpRequest.Builder postAddedMoviesRequestBuilder(@org.eclipse.jdt.annot * @throws ApiException if fails to make API call */ public void postAddedSeries(@org.eclipse.jdt.annotation.NonNull String tvdbId) throws ApiException { - postAddedSeriesWithHttpInfo(tvdbId); + postAddedSeries(tvdbId, null); + } + + /** + * Reports that new episodes of a series have been added by an external source. + * + * @param tvdbId The tvdbId. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postAddedSeries(@org.eclipse.jdt.annotation.NonNull String tvdbId, Map headers) + throws ApiException { + postAddedSeriesWithHttpInfo(tvdbId, headers); } /** @@ -2197,7 +3060,20 @@ public void postAddedSeries(@org.eclipse.jdt.annotation.NonNull String tvdbId) t */ public ApiResponse postAddedSeriesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tvdbId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = postAddedSeriesRequestBuilder(tvdbId); + return postAddedSeriesWithHttpInfo(tvdbId, null); + } + + /** + * Reports that new episodes of a series have been added by an external source. + * + * @param tvdbId The tvdbId. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postAddedSeriesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tvdbId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postAddedSeriesRequestBuilder(tvdbId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2224,8 +3100,8 @@ public ApiResponse postAddedSeriesWithHttpInfo(@org.eclipse.jdt.annotation } } - private HttpRequest.Builder postAddedSeriesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String tvdbId) - throws ApiException { + private HttpRequest.Builder postAddedSeriesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String tvdbId, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -2254,6 +3130,8 @@ private HttpRequest.Builder postAddedSeriesRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2268,7 +3146,19 @@ private HttpRequest.Builder postAddedSeriesRequestBuilder(@org.eclipse.jdt.annot */ public void postUpdatedMedia(@org.eclipse.jdt.annotation.Nullable MediaUpdateInfoDto mediaUpdateInfoDto) throws ApiException { - postUpdatedMediaWithHttpInfo(mediaUpdateInfoDto); + postUpdatedMedia(mediaUpdateInfoDto, null); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param mediaUpdateInfoDto The update paths. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postUpdatedMedia(@org.eclipse.jdt.annotation.Nullable MediaUpdateInfoDto mediaUpdateInfoDto, + Map headers) throws ApiException { + postUpdatedMediaWithHttpInfo(mediaUpdateInfoDto, headers); } /** @@ -2280,7 +3170,21 @@ public void postUpdatedMedia(@org.eclipse.jdt.annotation.Nullable MediaUpdateInf */ public ApiResponse postUpdatedMediaWithHttpInfo( @org.eclipse.jdt.annotation.Nullable MediaUpdateInfoDto mediaUpdateInfoDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = postUpdatedMediaRequestBuilder(mediaUpdateInfoDto); + return postUpdatedMediaWithHttpInfo(mediaUpdateInfoDto, null); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param mediaUpdateInfoDto The update paths. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUpdatedMediaWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MediaUpdateInfoDto mediaUpdateInfoDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postUpdatedMediaRequestBuilder(mediaUpdateInfoDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2308,7 +3212,8 @@ public ApiResponse postUpdatedMediaWithHttpInfo( } private HttpRequest.Builder postUpdatedMediaRequestBuilder( - @org.eclipse.jdt.annotation.Nullable MediaUpdateInfoDto mediaUpdateInfoDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable MediaUpdateInfoDto mediaUpdateInfoDto, Map headers) + throws ApiException { // verify the required parameter 'mediaUpdateInfoDto' is set if (mediaUpdateInfoDto == null) { throw new ApiException(400, @@ -2333,6 +3238,8 @@ private HttpRequest.Builder postUpdatedMediaRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2348,7 +3255,20 @@ private HttpRequest.Builder postUpdatedMediaRequestBuilder( */ public void postUpdatedMovies(@org.eclipse.jdt.annotation.NonNull String tmdbId, @org.eclipse.jdt.annotation.NonNull String imdbId) throws ApiException { - postUpdatedMoviesWithHttpInfo(tmdbId, imdbId); + postUpdatedMovies(tmdbId, imdbId, null); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param tmdbId The tmdbId. (optional) + * @param imdbId The imdbId. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postUpdatedMovies(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId, Map headers) throws ApiException { + postUpdatedMoviesWithHttpInfo(tmdbId, imdbId, headers); } /** @@ -2361,7 +3281,21 @@ public void postUpdatedMovies(@org.eclipse.jdt.annotation.NonNull String tmdbId, */ public ApiResponse postUpdatedMoviesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tmdbId, @org.eclipse.jdt.annotation.NonNull String imdbId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = postUpdatedMoviesRequestBuilder(tmdbId, imdbId); + return postUpdatedMoviesWithHttpInfo(tmdbId, imdbId, null); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param tmdbId The tmdbId. (optional) + * @param imdbId The imdbId. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUpdatedMoviesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postUpdatedMoviesRequestBuilder(tmdbId, imdbId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2389,7 +3323,7 @@ public ApiResponse postUpdatedMoviesWithHttpInfo(@org.eclipse.jdt.annotati } private HttpRequest.Builder postUpdatedMoviesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String tmdbId, - @org.eclipse.jdt.annotation.NonNull String imdbId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String imdbId, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -2420,6 +3354,8 @@ private HttpRequest.Builder postUpdatedMoviesRequestBuilder(@org.eclipse.jdt.ann if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2433,7 +3369,19 @@ private HttpRequest.Builder postUpdatedMoviesRequestBuilder(@org.eclipse.jdt.ann * @throws ApiException if fails to make API call */ public void postUpdatedSeries(@org.eclipse.jdt.annotation.NonNull String tvdbId) throws ApiException { - postUpdatedSeriesWithHttpInfo(tvdbId); + postUpdatedSeries(tvdbId, null); + } + + /** + * Reports that new episodes of a series have been added by an external source. + * + * @param tvdbId The tvdbId. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postUpdatedSeries(@org.eclipse.jdt.annotation.NonNull String tvdbId, Map headers) + throws ApiException { + postUpdatedSeriesWithHttpInfo(tvdbId, headers); } /** @@ -2445,7 +3393,20 @@ public void postUpdatedSeries(@org.eclipse.jdt.annotation.NonNull String tvdbId) */ public ApiResponse postUpdatedSeriesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tvdbId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = postUpdatedSeriesRequestBuilder(tvdbId); + return postUpdatedSeriesWithHttpInfo(tvdbId, null); + } + + /** + * Reports that new episodes of a series have been added by an external source. + * + * @param tvdbId The tvdbId. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUpdatedSeriesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tvdbId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postUpdatedSeriesRequestBuilder(tvdbId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2472,8 +3433,8 @@ public ApiResponse postUpdatedSeriesWithHttpInfo(@org.eclipse.jdt.annotati } } - private HttpRequest.Builder postUpdatedSeriesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String tvdbId) - throws ApiException { + private HttpRequest.Builder postUpdatedSeriesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String tvdbId, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -2502,6 +3463,8 @@ private HttpRequest.Builder postUpdatedSeriesRequestBuilder(@org.eclipse.jdt.ann if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2514,7 +3477,17 @@ private HttpRequest.Builder postUpdatedSeriesRequestBuilder(@org.eclipse.jdt.ann * @throws ApiException if fails to make API call */ public void refreshLibrary() throws ApiException { - refreshLibraryWithHttpInfo(); + refreshLibrary(null); + } + + /** + * Starts a library scan. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void refreshLibrary(Map headers) throws ApiException { + refreshLibraryWithHttpInfo(headers); } /** @@ -2524,7 +3497,18 @@ public void refreshLibrary() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse refreshLibraryWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = refreshLibraryRequestBuilder(); + return refreshLibraryWithHttpInfo(null); + } + + /** + * Starts a library scan. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse refreshLibraryWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = refreshLibraryRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2551,7 +3535,7 @@ public ApiResponse refreshLibraryWithHttpInfo() throws ApiException { } } - private HttpRequest.Builder refreshLibraryRequestBuilder() throws ApiException { + private HttpRequest.Builder refreshLibraryRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -2565,6 +3549,8 @@ private HttpRequest.Builder refreshLibraryRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LibraryStructureApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LibraryStructureApi.java index 34ff9732f3222..e1d5700fa46c7 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LibraryStructureApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LibraryStructureApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.function.Consumer; @@ -41,6 +43,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class LibraryStructureApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -76,6 +100,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Add a media path to a library. * @@ -85,7 +159,21 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public void addMediaPath(@org.eclipse.jdt.annotation.Nullable MediaPathDto mediaPathDto, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { - addMediaPathWithHttpInfo(mediaPathDto, refreshLibrary); + addMediaPath(mediaPathDto, refreshLibrary, null); + } + + /** + * Add a media path to a library. + * + * @param mediaPathDto The media path dto. (required) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void addMediaPath(@org.eclipse.jdt.annotation.Nullable MediaPathDto mediaPathDto, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { + addMediaPathWithHttpInfo(mediaPathDto, refreshLibrary, headers); } /** @@ -98,7 +186,22 @@ public void addMediaPath(@org.eclipse.jdt.annotation.Nullable MediaPathDto media */ public ApiResponse addMediaPathWithHttpInfo(@org.eclipse.jdt.annotation.Nullable MediaPathDto mediaPathDto, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = addMediaPathRequestBuilder(mediaPathDto, refreshLibrary); + return addMediaPathWithHttpInfo(mediaPathDto, refreshLibrary, null); + } + + /** + * Add a media path to a library. + * + * @param mediaPathDto The media path dto. (required) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addMediaPathWithHttpInfo(@org.eclipse.jdt.annotation.Nullable MediaPathDto mediaPathDto, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addMediaPathRequestBuilder(mediaPathDto, refreshLibrary, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -127,7 +230,8 @@ public ApiResponse addMediaPathWithHttpInfo(@org.eclipse.jdt.annotation.Nu private HttpRequest.Builder addMediaPathRequestBuilder( @org.eclipse.jdt.annotation.Nullable MediaPathDto mediaPathDto, - @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { // verify the required parameter 'mediaPathDto' is set if (mediaPathDto == null) { throw new ApiException(400, "Missing the required parameter 'mediaPathDto' when calling addMediaPath"); @@ -166,6 +270,8 @@ private HttpRequest.Builder addMediaPathRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -187,7 +293,27 @@ public void addVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull List paths, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, @org.eclipse.jdt.annotation.NonNull AddVirtualFolderDto addVirtualFolderDto) throws ApiException { - addVirtualFolderWithHttpInfo(name, collectionType, paths, refreshLibrary, addVirtualFolderDto); + addVirtualFolder(name, collectionType, paths, refreshLibrary, addVirtualFolderDto, null); + } + + /** + * Adds a virtual folder. + * + * @param name The name of the virtual folder. (optional) + * @param collectionType The type of the collection. (optional) + * @param paths The paths of the virtual folder. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param addVirtualFolderDto The library options. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void addVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull CollectionTypeOptions collectionType, + @org.eclipse.jdt.annotation.NonNull List paths, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, + @org.eclipse.jdt.annotation.NonNull AddVirtualFolderDto addVirtualFolderDto, Map headers) + throws ApiException { + addVirtualFolderWithHttpInfo(name, collectionType, paths, refreshLibrary, addVirtualFolderDto, headers); } /** @@ -206,8 +332,29 @@ public ApiResponse addVirtualFolderWithHttpInfo(@org.eclipse.jdt.annotatio @org.eclipse.jdt.annotation.NonNull List paths, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, @org.eclipse.jdt.annotation.NonNull AddVirtualFolderDto addVirtualFolderDto) throws ApiException { + return addVirtualFolderWithHttpInfo(name, collectionType, paths, refreshLibrary, addVirtualFolderDto, null); + } + + /** + * Adds a virtual folder. + * + * @param name The name of the virtual folder. (optional) + * @param collectionType The type of the collection. (optional) + * @param paths The paths of the virtual folder. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param addVirtualFolderDto The library options. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addVirtualFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull CollectionTypeOptions collectionType, + @org.eclipse.jdt.annotation.NonNull List paths, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, + @org.eclipse.jdt.annotation.NonNull AddVirtualFolderDto addVirtualFolderDto, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = addVirtualFolderRequestBuilder(name, collectionType, paths, - refreshLibrary, addVirtualFolderDto); + refreshLibrary, addVirtualFolderDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -238,7 +385,8 @@ private HttpRequest.Builder addVirtualFolderRequestBuilder(@org.eclipse.jdt.anno @org.eclipse.jdt.annotation.NonNull CollectionTypeOptions collectionType, @org.eclipse.jdt.annotation.NonNull List paths, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, - @org.eclipse.jdt.annotation.NonNull AddVirtualFolderDto addVirtualFolderDto) throws ApiException { + @org.eclipse.jdt.annotation.NonNull AddVirtualFolderDto addVirtualFolderDto, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -279,6 +427,8 @@ private HttpRequest.Builder addVirtualFolderRequestBuilder(@org.eclipse.jdt.anno if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -292,7 +442,18 @@ private HttpRequest.Builder addVirtualFolderRequestBuilder(@org.eclipse.jdt.anno * @throws ApiException if fails to make API call */ public List getVirtualFolders() throws ApiException { - ApiResponse> localVarResponse = getVirtualFoldersWithHttpInfo(); + return getVirtualFolders(null); + } + + /** + * Gets all virtual folders. + * + * @param headers Optional headers to include in the request + * @return List<VirtualFolderInfo> + * @throws ApiException if fails to make API call + */ + public List getVirtualFolders(Map headers) throws ApiException { + ApiResponse> localVarResponse = getVirtualFoldersWithHttpInfo(headers); return localVarResponse.getData(); } @@ -303,7 +464,19 @@ public List getVirtualFolders() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getVirtualFoldersWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getVirtualFoldersRequestBuilder(); + return getVirtualFoldersWithHttpInfo(null); + } + + /** + * Gets all virtual folders. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<VirtualFolderInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getVirtualFoldersWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getVirtualFoldersRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -320,14 +493,14 @@ public ApiResponse> getVirtualFoldersWithHttpInfo() thro } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -338,7 +511,7 @@ public ApiResponse> getVirtualFoldersWithHttpInfo() thro } } - private HttpRequest.Builder getVirtualFoldersRequestBuilder() throws ApiException { + private HttpRequest.Builder getVirtualFoldersRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -353,6 +526,8 @@ private HttpRequest.Builder getVirtualFoldersRequestBuilder() throws ApiExceptio if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -370,7 +545,22 @@ private HttpRequest.Builder getVirtualFoldersRequestBuilder() throws ApiExceptio public void removeMediaPath(@org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull String path, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { - removeMediaPathWithHttpInfo(name, path, refreshLibrary); + removeMediaPath(name, path, refreshLibrary, null); + } + + /** + * Remove a media path. + * + * @param name The name of the library. (optional) + * @param path The path to remove. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void removeMediaPath(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String path, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, + Map headers) throws ApiException { + removeMediaPathWithHttpInfo(name, path, refreshLibrary, headers); } /** @@ -385,7 +575,23 @@ public void removeMediaPath(@org.eclipse.jdt.annotation.NonNull String name, public ApiResponse removeMediaPathWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull String path, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = removeMediaPathRequestBuilder(name, path, refreshLibrary); + return removeMediaPathWithHttpInfo(name, path, refreshLibrary, null); + } + + /** + * Remove a media path. + * + * @param name The name of the library. (optional) + * @param path The path to remove. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeMediaPathWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String path, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeMediaPathRequestBuilder(name, path, refreshLibrary, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -413,8 +619,8 @@ public ApiResponse removeMediaPathWithHttpInfo(@org.eclipse.jdt.annotation } private HttpRequest.Builder removeMediaPathRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, - @org.eclipse.jdt.annotation.NonNull String path, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) - throws ApiException { + @org.eclipse.jdt.annotation.NonNull String path, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -447,6 +653,8 @@ private HttpRequest.Builder removeMediaPathRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -462,7 +670,21 @@ private HttpRequest.Builder removeMediaPathRequestBuilder(@org.eclipse.jdt.annot */ public void removeVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { - removeVirtualFolderWithHttpInfo(name, refreshLibrary); + removeVirtualFolder(name, refreshLibrary, null); + } + + /** + * Removes a virtual folder. + * + * @param name The name of the folder. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void removeVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { + removeVirtualFolderWithHttpInfo(name, refreshLibrary, headers); } /** @@ -475,7 +697,22 @@ public void removeVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, */ public ApiResponse removeVirtualFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = removeVirtualFolderRequestBuilder(name, refreshLibrary); + return removeVirtualFolderWithHttpInfo(name, refreshLibrary, null); + } + + /** + * Removes a virtual folder. + * + * @param name The name of the folder. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeVirtualFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeVirtualFolderRequestBuilder(name, refreshLibrary, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -503,7 +740,8 @@ public ApiResponse removeVirtualFolderWithHttpInfo(@org.eclipse.jdt.annota } private HttpRequest.Builder removeVirtualFolderRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, - @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -534,6 +772,8 @@ private HttpRequest.Builder removeVirtualFolderRequestBuilder(@org.eclipse.jdt.a if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -551,7 +791,23 @@ private HttpRequest.Builder removeVirtualFolderRequestBuilder(@org.eclipse.jdt.a public void renameVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull String newName, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { - renameVirtualFolderWithHttpInfo(name, newName, refreshLibrary); + renameVirtualFolder(name, newName, refreshLibrary, null); + } + + /** + * Renames a virtual folder. + * + * @param name The name of the virtual folder. (optional) + * @param newName The new name. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void renameVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String newName, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { + renameVirtualFolderWithHttpInfo(name, newName, refreshLibrary, headers); } /** @@ -566,7 +822,25 @@ public void renameVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, public ApiResponse renameVirtualFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull String newName, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = renameVirtualFolderRequestBuilder(name, newName, refreshLibrary); + return renameVirtualFolderWithHttpInfo(name, newName, refreshLibrary, null); + } + + /** + * Renames a virtual folder. + * + * @param name The name of the virtual folder. (optional) + * @param newName The new name. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse renameVirtualFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String newName, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = renameVirtualFolderRequestBuilder(name, newName, refreshLibrary, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -595,7 +869,8 @@ public ApiResponse renameVirtualFolderWithHttpInfo(@org.eclipse.jdt.annota private HttpRequest.Builder renameVirtualFolderRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull String newName, - @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -629,6 +904,8 @@ private HttpRequest.Builder renameVirtualFolderRequestBuilder(@org.eclipse.jdt.a if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -643,7 +920,20 @@ private HttpRequest.Builder renameVirtualFolderRequestBuilder(@org.eclipse.jdt.a */ public void updateLibraryOptions( @org.eclipse.jdt.annotation.NonNull UpdateLibraryOptionsDto updateLibraryOptionsDto) throws ApiException { - updateLibraryOptionsWithHttpInfo(updateLibraryOptionsDto); + updateLibraryOptions(updateLibraryOptionsDto, null); + } + + /** + * Update library options. + * + * @param updateLibraryOptionsDto The library name and options. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateLibraryOptions( + @org.eclipse.jdt.annotation.NonNull UpdateLibraryOptionsDto updateLibraryOptionsDto, + Map headers) throws ApiException { + updateLibraryOptionsWithHttpInfo(updateLibraryOptionsDto, headers); } /** @@ -655,7 +945,22 @@ public void updateLibraryOptions( */ public ApiResponse updateLibraryOptionsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull UpdateLibraryOptionsDto updateLibraryOptionsDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateLibraryOptionsRequestBuilder(updateLibraryOptionsDto); + return updateLibraryOptionsWithHttpInfo(updateLibraryOptionsDto, null); + } + + /** + * Update library options. + * + * @param updateLibraryOptionsDto The library name and options. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateLibraryOptionsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UpdateLibraryOptionsDto updateLibraryOptionsDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateLibraryOptionsRequestBuilder(updateLibraryOptionsDto, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -683,7 +988,8 @@ public ApiResponse updateLibraryOptionsWithHttpInfo( } private HttpRequest.Builder updateLibraryOptionsRequestBuilder( - @org.eclipse.jdt.annotation.NonNull UpdateLibraryOptionsDto updateLibraryOptionsDto) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UpdateLibraryOptionsDto updateLibraryOptionsDto, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -704,6 +1010,8 @@ private HttpRequest.Builder updateLibraryOptionsRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -719,7 +1027,20 @@ private HttpRequest.Builder updateLibraryOptionsRequestBuilder( public void updateMediaPath( @org.eclipse.jdt.annotation.Nullable UpdateMediaPathRequestDto updateMediaPathRequestDto) throws ApiException { - updateMediaPathWithHttpInfo(updateMediaPathRequestDto); + updateMediaPath(updateMediaPathRequestDto, null); + } + + /** + * Updates a media path. + * + * @param updateMediaPathRequestDto The name of the library and path infos. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateMediaPath( + @org.eclipse.jdt.annotation.Nullable UpdateMediaPathRequestDto updateMediaPathRequestDto, + Map headers) throws ApiException { + updateMediaPathWithHttpInfo(updateMediaPathRequestDto, headers); } /** @@ -732,7 +1053,21 @@ public void updateMediaPath( public ApiResponse updateMediaPathWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UpdateMediaPathRequestDto updateMediaPathRequestDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateMediaPathRequestBuilder(updateMediaPathRequestDto); + return updateMediaPathWithHttpInfo(updateMediaPathRequestDto, null); + } + + /** + * Updates a media path. + * + * @param updateMediaPathRequestDto The name of the library and path infos. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateMediaPathWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UpdateMediaPathRequestDto updateMediaPathRequestDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateMediaPathRequestBuilder(updateMediaPathRequestDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -760,8 +1095,8 @@ public ApiResponse updateMediaPathWithHttpInfo( } private HttpRequest.Builder updateMediaPathRequestBuilder( - @org.eclipse.jdt.annotation.Nullable UpdateMediaPathRequestDto updateMediaPathRequestDto) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable UpdateMediaPathRequestDto updateMediaPathRequestDto, + Map headers) throws ApiException { // verify the required parameter 'updateMediaPathRequestDto' is set if (updateMediaPathRequestDto == null) { throw new ApiException(400, @@ -786,6 +1121,8 @@ private HttpRequest.Builder updateMediaPathRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LiveTvApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LiveTvApi.java index e5c5e3a35f21a..44f65e5126508 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LiveTvApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LiveTvApi.java @@ -23,6 +23,7 @@ import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -59,6 +60,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class LiveTvApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -94,6 +117,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Adds a listings provider. * @@ -108,8 +181,27 @@ public ListingsProviderInfo addListingProvider(@org.eclipse.jdt.annotation.NonNu @org.eclipse.jdt.annotation.NonNull Boolean validateListings, @org.eclipse.jdt.annotation.NonNull Boolean validateLogin, @org.eclipse.jdt.annotation.NonNull ListingsProviderInfo listingsProviderInfo) throws ApiException { + return addListingProvider(pw, validateListings, validateLogin, listingsProviderInfo, null); + } + + /** + * Adds a listings provider. + * + * @param pw Password. (optional) + * @param validateListings Validate listings. (optional, default to false) + * @param validateLogin Validate login. (optional, default to false) + * @param listingsProviderInfo New listings info. (optional) + * @param headers Optional headers to include in the request + * @return ListingsProviderInfo + * @throws ApiException if fails to make API call + */ + public ListingsProviderInfo addListingProvider(@org.eclipse.jdt.annotation.NonNull String pw, + @org.eclipse.jdt.annotation.NonNull Boolean validateListings, + @org.eclipse.jdt.annotation.NonNull Boolean validateLogin, + @org.eclipse.jdt.annotation.NonNull ListingsProviderInfo listingsProviderInfo, Map headers) + throws ApiException { ApiResponse localVarResponse = addListingProviderWithHttpInfo(pw, validateListings, - validateLogin, listingsProviderInfo); + validateLogin, listingsProviderInfo, headers); return localVarResponse.getData(); } @@ -127,8 +219,27 @@ public ApiResponse addListingProviderWithHttpInfo( @org.eclipse.jdt.annotation.NonNull String pw, @org.eclipse.jdt.annotation.NonNull Boolean validateListings, @org.eclipse.jdt.annotation.NonNull Boolean validateLogin, @org.eclipse.jdt.annotation.NonNull ListingsProviderInfo listingsProviderInfo) throws ApiException { + return addListingProviderWithHttpInfo(pw, validateListings, validateLogin, listingsProviderInfo, null); + } + + /** + * Adds a listings provider. + * + * @param pw Password. (optional) + * @param validateListings Validate listings. (optional, default to false) + * @param validateLogin Validate login. (optional, default to false) + * @param listingsProviderInfo New listings info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<ListingsProviderInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse addListingProviderWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String pw, @org.eclipse.jdt.annotation.NonNull Boolean validateListings, + @org.eclipse.jdt.annotation.NonNull Boolean validateLogin, + @org.eclipse.jdt.annotation.NonNull ListingsProviderInfo listingsProviderInfo, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = addListingProviderRequestBuilder(pw, validateListings, - validateLogin, listingsProviderInfo); + validateLogin, listingsProviderInfo, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -145,14 +256,14 @@ public ApiResponse addListingProviderWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + ListingsProviderInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -166,7 +277,8 @@ public ApiResponse addListingProviderWithHttpInfo( private HttpRequest.Builder addListingProviderRequestBuilder(@org.eclipse.jdt.annotation.NonNull String pw, @org.eclipse.jdt.annotation.NonNull Boolean validateListings, @org.eclipse.jdt.annotation.NonNull Boolean validateLogin, - @org.eclipse.jdt.annotation.NonNull ListingsProviderInfo listingsProviderInfo) throws ApiException { + @org.eclipse.jdt.annotation.NonNull ListingsProviderInfo listingsProviderInfo, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -206,6 +318,8 @@ private HttpRequest.Builder addListingProviderRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -221,7 +335,20 @@ private HttpRequest.Builder addListingProviderRequestBuilder(@org.eclipse.jdt.an */ public TunerHostInfo addTunerHost(@org.eclipse.jdt.annotation.NonNull TunerHostInfo tunerHostInfo) throws ApiException { - ApiResponse localVarResponse = addTunerHostWithHttpInfo(tunerHostInfo); + return addTunerHost(tunerHostInfo, null); + } + + /** + * Adds a tuner host. + * + * @param tunerHostInfo New tuner host. (optional) + * @param headers Optional headers to include in the request + * @return TunerHostInfo + * @throws ApiException if fails to make API call + */ + public TunerHostInfo addTunerHost(@org.eclipse.jdt.annotation.NonNull TunerHostInfo tunerHostInfo, + Map headers) throws ApiException { + ApiResponse localVarResponse = addTunerHostWithHttpInfo(tunerHostInfo, headers); return localVarResponse.getData(); } @@ -234,7 +361,21 @@ public TunerHostInfo addTunerHost(@org.eclipse.jdt.annotation.NonNull TunerHostI */ public ApiResponse addTunerHostWithHttpInfo( @org.eclipse.jdt.annotation.NonNull TunerHostInfo tunerHostInfo) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = addTunerHostRequestBuilder(tunerHostInfo); + return addTunerHostWithHttpInfo(tunerHostInfo, null); + } + + /** + * Adds a tuner host. + * + * @param tunerHostInfo New tuner host. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<TunerHostInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse addTunerHostWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull TunerHostInfo tunerHostInfo, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addTunerHostRequestBuilder(tunerHostInfo, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -251,12 +392,14 @@ public ApiResponse addTunerHostWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + TunerHostInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -268,7 +411,8 @@ public ApiResponse addTunerHostWithHttpInfo( } private HttpRequest.Builder addTunerHostRequestBuilder( - @org.eclipse.jdt.annotation.NonNull TunerHostInfo tunerHostInfo) throws ApiException { + @org.eclipse.jdt.annotation.NonNull TunerHostInfo tunerHostInfo, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -289,6 +433,8 @@ private HttpRequest.Builder addTunerHostRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -302,7 +448,19 @@ private HttpRequest.Builder addTunerHostRequestBuilder( * @throws ApiException if fails to make API call */ public void cancelSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { - cancelSeriesTimerWithHttpInfo(timerId); + cancelSeriesTimer(timerId, null); + } + + /** + * Cancels a live tv series timer. + * + * @param timerId Timer id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void cancelSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerId, Map headers) + throws ApiException { + cancelSeriesTimerWithHttpInfo(timerId, headers); } /** @@ -314,7 +472,20 @@ public void cancelSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerI */ public ApiResponse cancelSeriesTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = cancelSeriesTimerRequestBuilder(timerId); + return cancelSeriesTimerWithHttpInfo(timerId, null); + } + + /** + * Cancels a live tv series timer. + * + * @param timerId Timer id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse cancelSeriesTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = cancelSeriesTimerRequestBuilder(timerId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -341,8 +512,8 @@ public ApiResponse cancelSeriesTimerWithHttpInfo(@org.eclipse.jdt.annotati } } - private HttpRequest.Builder cancelSeriesTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId) - throws ApiException { + private HttpRequest.Builder cancelSeriesTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId, + Map headers) throws ApiException { // verify the required parameter 'timerId' is set if (timerId == null) { throw new ApiException(400, "Missing the required parameter 'timerId' when calling cancelSeriesTimer"); @@ -361,6 +532,8 @@ private HttpRequest.Builder cancelSeriesTimerRequestBuilder(@org.eclipse.jdt.ann if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -374,7 +547,19 @@ private HttpRequest.Builder cancelSeriesTimerRequestBuilder(@org.eclipse.jdt.ann * @throws ApiException if fails to make API call */ public void cancelTimer(@org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { - cancelTimerWithHttpInfo(timerId); + cancelTimer(timerId, null); + } + + /** + * Cancels a live tv timer. + * + * @param timerId Timer id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void cancelTimer(@org.eclipse.jdt.annotation.Nullable String timerId, Map headers) + throws ApiException { + cancelTimerWithHttpInfo(timerId, headers); } /** @@ -386,7 +571,20 @@ public void cancelTimer(@org.eclipse.jdt.annotation.Nullable String timerId) thr */ public ApiResponse cancelTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = cancelTimerRequestBuilder(timerId); + return cancelTimerWithHttpInfo(timerId, null); + } + + /** + * Cancels a live tv timer. + * + * @param timerId Timer id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse cancelTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = cancelTimerRequestBuilder(timerId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -413,8 +611,8 @@ public ApiResponse cancelTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nul } } - private HttpRequest.Builder cancelTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId) - throws ApiException { + private HttpRequest.Builder cancelTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId, + Map headers) throws ApiException { // verify the required parameter 'timerId' is set if (timerId == null) { throw new ApiException(400, "Missing the required parameter 'timerId' when calling cancelTimer"); @@ -432,6 +630,8 @@ private HttpRequest.Builder cancelTimerRequestBuilder(@org.eclipse.jdt.annotatio if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -446,7 +646,19 @@ private HttpRequest.Builder cancelTimerRequestBuilder(@org.eclipse.jdt.annotatio */ public void createSeriesTimer(@org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto) throws ApiException { - createSeriesTimerWithHttpInfo(seriesTimerInfoDto); + createSeriesTimer(seriesTimerInfoDto, null); + } + + /** + * Creates a live tv series timer. + * + * @param seriesTimerInfoDto New series timer info. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void createSeriesTimer(@org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto, + Map headers) throws ApiException { + createSeriesTimerWithHttpInfo(seriesTimerInfoDto, headers); } /** @@ -458,7 +670,21 @@ public void createSeriesTimer(@org.eclipse.jdt.annotation.NonNull SeriesTimerInf */ public ApiResponse createSeriesTimerWithHttpInfo( @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = createSeriesTimerRequestBuilder(seriesTimerInfoDto); + return createSeriesTimerWithHttpInfo(seriesTimerInfoDto, null); + } + + /** + * Creates a live tv series timer. + * + * @param seriesTimerInfoDto New series timer info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createSeriesTimerWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createSeriesTimerRequestBuilder(seriesTimerInfoDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -486,7 +712,8 @@ public ApiResponse createSeriesTimerWithHttpInfo( } private HttpRequest.Builder createSeriesTimerRequestBuilder( - @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto) throws ApiException { + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -506,6 +733,8 @@ private HttpRequest.Builder createSeriesTimerRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -519,7 +748,19 @@ private HttpRequest.Builder createSeriesTimerRequestBuilder( * @throws ApiException if fails to make API call */ public void createTimer(@org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto) throws ApiException { - createTimerWithHttpInfo(timerInfoDto); + createTimer(timerInfoDto, null); + } + + /** + * Creates a live tv timer. + * + * @param timerInfoDto New timer info. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void createTimer(@org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto, Map headers) + throws ApiException { + createTimerWithHttpInfo(timerInfoDto, headers); } /** @@ -531,7 +772,20 @@ public void createTimer(@org.eclipse.jdt.annotation.NonNull TimerInfoDto timerIn */ public ApiResponse createTimerWithHttpInfo(@org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = createTimerRequestBuilder(timerInfoDto); + return createTimerWithHttpInfo(timerInfoDto, null); + } + + /** + * Creates a live tv timer. + * + * @param timerInfoDto New timer info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createTimerWithHttpInfo(@org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createTimerRequestBuilder(timerInfoDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -558,8 +812,8 @@ public ApiResponse createTimerWithHttpInfo(@org.eclipse.jdt.annotation.Non } } - private HttpRequest.Builder createTimerRequestBuilder(@org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto) - throws ApiException { + private HttpRequest.Builder createTimerRequestBuilder(@org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -579,6 +833,8 @@ private HttpRequest.Builder createTimerRequestBuilder(@org.eclipse.jdt.annotatio if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -592,7 +848,19 @@ private HttpRequest.Builder createTimerRequestBuilder(@org.eclipse.jdt.annotatio * @throws ApiException if fails to make API call */ public void deleteListingProvider(@org.eclipse.jdt.annotation.NonNull String id) throws ApiException { - deleteListingProviderWithHttpInfo(id); + deleteListingProvider(id, null); + } + + /** + * Delete listing provider. + * + * @param id Listing provider id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteListingProvider(@org.eclipse.jdt.annotation.NonNull String id, Map headers) + throws ApiException { + deleteListingProviderWithHttpInfo(id, headers); } /** @@ -604,7 +872,20 @@ public void deleteListingProvider(@org.eclipse.jdt.annotation.NonNull String id) */ public ApiResponse deleteListingProviderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteListingProviderRequestBuilder(id); + return deleteListingProviderWithHttpInfo(id, null); + } + + /** + * Delete listing provider. + * + * @param id Listing provider id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteListingProviderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteListingProviderRequestBuilder(id, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -631,8 +912,8 @@ public ApiResponse deleteListingProviderWithHttpInfo(@org.eclipse.jdt.anno } } - private HttpRequest.Builder deleteListingProviderRequestBuilder(@org.eclipse.jdt.annotation.NonNull String id) - throws ApiException { + private HttpRequest.Builder deleteListingProviderRequestBuilder(@org.eclipse.jdt.annotation.NonNull String id, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -661,6 +942,8 @@ private HttpRequest.Builder deleteListingProviderRequestBuilder(@org.eclipse.jdt if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -674,7 +957,19 @@ private HttpRequest.Builder deleteListingProviderRequestBuilder(@org.eclipse.jdt * @throws ApiException if fails to make API call */ public void deleteRecording(@org.eclipse.jdt.annotation.Nullable UUID recordingId) throws ApiException { - deleteRecordingWithHttpInfo(recordingId); + deleteRecording(recordingId, null); + } + + /** + * Deletes a live tv recording. + * + * @param recordingId Recording id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteRecording(@org.eclipse.jdt.annotation.Nullable UUID recordingId, Map headers) + throws ApiException { + deleteRecordingWithHttpInfo(recordingId, headers); } /** @@ -686,7 +981,20 @@ public void deleteRecording(@org.eclipse.jdt.annotation.Nullable UUID recordingI */ public ApiResponse deleteRecordingWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID recordingId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteRecordingRequestBuilder(recordingId); + return deleteRecordingWithHttpInfo(recordingId, null); + } + + /** + * Deletes a live tv recording. + * + * @param recordingId Recording id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteRecordingWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID recordingId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteRecordingRequestBuilder(recordingId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -713,8 +1021,8 @@ public ApiResponse deleteRecordingWithHttpInfo(@org.eclipse.jdt.annotation } } - private HttpRequest.Builder deleteRecordingRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID recordingId) - throws ApiException { + private HttpRequest.Builder deleteRecordingRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID recordingId, + Map headers) throws ApiException { // verify the required parameter 'recordingId' is set if (recordingId == null) { throw new ApiException(400, "Missing the required parameter 'recordingId' when calling deleteRecording"); @@ -734,6 +1042,8 @@ private HttpRequest.Builder deleteRecordingRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -747,7 +1057,19 @@ private HttpRequest.Builder deleteRecordingRequestBuilder(@org.eclipse.jdt.annot * @throws ApiException if fails to make API call */ public void deleteTunerHost(@org.eclipse.jdt.annotation.NonNull String id) throws ApiException { - deleteTunerHostWithHttpInfo(id); + deleteTunerHost(id, null); + } + + /** + * Deletes a tuner host. + * + * @param id Tuner host id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteTunerHost(@org.eclipse.jdt.annotation.NonNull String id, Map headers) + throws ApiException { + deleteTunerHostWithHttpInfo(id, headers); } /** @@ -759,7 +1081,20 @@ public void deleteTunerHost(@org.eclipse.jdt.annotation.NonNull String id) throw */ public ApiResponse deleteTunerHostWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteTunerHostRequestBuilder(id); + return deleteTunerHostWithHttpInfo(id, null); + } + + /** + * Deletes a tuner host. + * + * @param id Tuner host id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteTunerHostWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteTunerHostRequestBuilder(id, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -786,8 +1121,8 @@ public ApiResponse deleteTunerHostWithHttpInfo(@org.eclipse.jdt.annotation } } - private HttpRequest.Builder deleteTunerHostRequestBuilder(@org.eclipse.jdt.annotation.NonNull String id) - throws ApiException { + private HttpRequest.Builder deleteTunerHostRequestBuilder(@org.eclipse.jdt.annotation.NonNull String id, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -816,6 +1151,8 @@ private HttpRequest.Builder deleteTunerHostRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -831,7 +1168,20 @@ private HttpRequest.Builder deleteTunerHostRequestBuilder(@org.eclipse.jdt.annot */ public List discoverTuners(@org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly) throws ApiException { - ApiResponse> localVarResponse = discoverTunersWithHttpInfo(newDevicesOnly); + return discoverTuners(newDevicesOnly, null); + } + + /** + * Discover tuners. + * + * @param newDevicesOnly Only discover new tuners. (optional, default to false) + * @param headers Optional headers to include in the request + * @return List<TunerHostInfo> + * @throws ApiException if fails to make API call + */ + public List discoverTuners(@org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly, + Map headers) throws ApiException { + ApiResponse> localVarResponse = discoverTunersWithHttpInfo(newDevicesOnly, headers); return localVarResponse.getData(); } @@ -844,7 +1194,21 @@ public List discoverTuners(@org.eclipse.jdt.annotation.NonNull Bo */ public ApiResponse> discoverTunersWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = discoverTunersRequestBuilder(newDevicesOnly); + return discoverTunersWithHttpInfo(newDevicesOnly, null); + } + + /** + * Discover tuners. + * + * @param newDevicesOnly Only discover new tuners. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<TunerHostInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> discoverTunersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = discoverTunersRequestBuilder(newDevicesOnly, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -861,14 +1225,14 @@ public ApiResponse> discoverTunersWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -879,8 +1243,8 @@ public ApiResponse> discoverTunersWithHttpInfo( } } - private HttpRequest.Builder discoverTunersRequestBuilder(@org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly) - throws ApiException { + private HttpRequest.Builder discoverTunersRequestBuilder(@org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -910,6 +1274,8 @@ private HttpRequest.Builder discoverTunersRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -925,7 +1291,20 @@ private HttpRequest.Builder discoverTunersRequestBuilder(@org.eclipse.jdt.annota */ public List discvoverTuners(@org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly) throws ApiException { - ApiResponse> localVarResponse = discvoverTunersWithHttpInfo(newDevicesOnly); + return discvoverTuners(newDevicesOnly, null); + } + + /** + * Discover tuners. + * + * @param newDevicesOnly Only discover new tuners. (optional, default to false) + * @param headers Optional headers to include in the request + * @return List<TunerHostInfo> + * @throws ApiException if fails to make API call + */ + public List discvoverTuners(@org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly, + Map headers) throws ApiException { + ApiResponse> localVarResponse = discvoverTunersWithHttpInfo(newDevicesOnly, headers); return localVarResponse.getData(); } @@ -938,31 +1317,45 @@ public List discvoverTuners(@org.eclipse.jdt.annotation.NonNull B */ public ApiResponse> discvoverTunersWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = discvoverTunersRequestBuilder(newDevicesOnly); - try { - HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode() / 100 != 2) { - throw getApiException("discvoverTuners", localVarResponse); - } + return discvoverTunersWithHttpInfo(newDevicesOnly, null); + } + + /** + * Discover tuners. + * + * @param newDevicesOnly Only discover new tuners. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<TunerHostInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> discvoverTunersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = discvoverTunersRequestBuilder(newDevicesOnly, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("discvoverTuners", localVarResponse); + } if (localVarResponse.body() == null) { return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -974,7 +1367,8 @@ public ApiResponse> discvoverTunersWithHttpInfo( } private HttpRequest.Builder discvoverTunersRequestBuilder( - @org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -1004,6 +1398,8 @@ private HttpRequest.Builder discvoverTunersRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1020,7 +1416,21 @@ private HttpRequest.Builder discvoverTunersRequestBuilder( */ public BaseItemDto getChannel(@org.eclipse.jdt.annotation.Nullable UUID channelId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getChannelWithHttpInfo(channelId, userId); + return getChannel(channelId, userId, null); + } + + /** + * Gets a live tv channel. + * + * @param channelId Channel id. (required) + * @param userId Optional. Attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getChannel(@org.eclipse.jdt.annotation.Nullable UUID channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getChannelWithHttpInfo(channelId, userId, headers); return localVarResponse.getData(); } @@ -1034,7 +1444,21 @@ public BaseItemDto getChannel(@org.eclipse.jdt.annotation.Nullable UUID channelI */ public ApiResponse getChannelWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID channelId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getChannelRequestBuilder(channelId, userId); + return getChannelWithHttpInfo(channelId, userId, null); + } + + /** + * Gets a live tv channel. + * + * @param channelId Channel id. (required) + * @param userId Optional. Attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getChannelRequestBuilder(channelId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1051,12 +1475,14 @@ public ApiResponse getChannelWithHttpInfo(@org.eclipse.jdt.annotati } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1068,7 +1494,7 @@ public ApiResponse getChannelWithHttpInfo(@org.eclipse.jdt.annotati } private HttpRequest.Builder getChannelRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID channelId, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'channelId' is set if (channelId == null) { throw new ApiException(400, "Missing the required parameter 'channelId' when calling getChannel"); @@ -1103,6 +1529,8 @@ private HttpRequest.Builder getChannelRequestBuilder(@org.eclipse.jdt.annotation if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1118,7 +1546,21 @@ private HttpRequest.Builder getChannelRequestBuilder(@org.eclipse.jdt.annotation */ public ChannelMappingOptionsDto getChannelMappingOptions(@org.eclipse.jdt.annotation.NonNull String providerId) throws ApiException { - ApiResponse localVarResponse = getChannelMappingOptionsWithHttpInfo(providerId); + return getChannelMappingOptions(providerId, null); + } + + /** + * Get channel mapping options. + * + * @param providerId Provider id. (optional) + * @param headers Optional headers to include in the request + * @return ChannelMappingOptionsDto + * @throws ApiException if fails to make API call + */ + public ChannelMappingOptionsDto getChannelMappingOptions(@org.eclipse.jdt.annotation.NonNull String providerId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getChannelMappingOptionsWithHttpInfo(providerId, + headers); return localVarResponse.getData(); } @@ -1131,7 +1573,20 @@ public ChannelMappingOptionsDto getChannelMappingOptions(@org.eclipse.jdt.annota */ public ApiResponse getChannelMappingOptionsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull String providerId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getChannelMappingOptionsRequestBuilder(providerId); + return getChannelMappingOptionsWithHttpInfo(providerId, null); + } + + /** + * Get channel mapping options. + * + * @param providerId Provider id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<ChannelMappingOptionsDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelMappingOptionsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String providerId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getChannelMappingOptionsRequestBuilder(providerId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1148,14 +1603,14 @@ public ApiResponse getChannelMappingOptionsWithHttpInf } String responseBody = new String(localVarResponse.body().readAllBytes()); + ChannelMappingOptionsDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1167,7 +1622,7 @@ public ApiResponse getChannelMappingOptionsWithHttpInf } private HttpRequest.Builder getChannelMappingOptionsRequestBuilder( - @org.eclipse.jdt.annotation.NonNull String providerId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String providerId, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -1197,6 +1652,8 @@ private HttpRequest.Builder getChannelMappingOptionsRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1210,7 +1667,18 @@ private HttpRequest.Builder getChannelMappingOptionsRequestBuilder( * @throws ApiException if fails to make API call */ public ListingsProviderInfo getDefaultListingProvider() throws ApiException { - ApiResponse localVarResponse = getDefaultListingProviderWithHttpInfo(); + return getDefaultListingProvider(null); + } + + /** + * Gets default listings provider info. + * + * @param headers Optional headers to include in the request + * @return ListingsProviderInfo + * @throws ApiException if fails to make API call + */ + public ListingsProviderInfo getDefaultListingProvider(Map headers) throws ApiException { + ApiResponse localVarResponse = getDefaultListingProviderWithHttpInfo(headers); return localVarResponse.getData(); } @@ -1221,7 +1689,19 @@ public ListingsProviderInfo getDefaultListingProvider() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getDefaultListingProviderWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getDefaultListingProviderRequestBuilder(); + return getDefaultListingProviderWithHttpInfo(null); + } + + /** + * Gets default listings provider info. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<ListingsProviderInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultListingProviderWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDefaultListingProviderRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1238,14 +1718,14 @@ public ApiResponse getDefaultListingProviderWithHttpInfo() } String responseBody = new String(localVarResponse.body().readAllBytes()); + ListingsProviderInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1256,7 +1736,8 @@ public ApiResponse getDefaultListingProviderWithHttpInfo() } } - private HttpRequest.Builder getDefaultListingProviderRequestBuilder() throws ApiException { + private HttpRequest.Builder getDefaultListingProviderRequestBuilder(Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -1271,6 +1752,8 @@ private HttpRequest.Builder getDefaultListingProviderRequestBuilder() throws Api if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1286,7 +1769,20 @@ private HttpRequest.Builder getDefaultListingProviderRequestBuilder() throws Api */ public SeriesTimerInfoDto getDefaultTimer(@org.eclipse.jdt.annotation.NonNull String programId) throws ApiException { - ApiResponse localVarResponse = getDefaultTimerWithHttpInfo(programId); + return getDefaultTimer(programId, null); + } + + /** + * Gets the default values for a new timer. + * + * @param programId Optional. To attach default values based on a program. (optional) + * @param headers Optional headers to include in the request + * @return SeriesTimerInfoDto + * @throws ApiException if fails to make API call + */ + public SeriesTimerInfoDto getDefaultTimer(@org.eclipse.jdt.annotation.NonNull String programId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getDefaultTimerWithHttpInfo(programId, headers); return localVarResponse.getData(); } @@ -1299,7 +1795,20 @@ public SeriesTimerInfoDto getDefaultTimer(@org.eclipse.jdt.annotation.NonNull St */ public ApiResponse getDefaultTimerWithHttpInfo( @org.eclipse.jdt.annotation.NonNull String programId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getDefaultTimerRequestBuilder(programId); + return getDefaultTimerWithHttpInfo(programId, null); + } + + /** + * Gets the default values for a new timer. + * + * @param programId Optional. To attach default values based on a program. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<SeriesTimerInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultTimerWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String programId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDefaultTimerRequestBuilder(programId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1316,14 +1825,14 @@ public ApiResponse getDefaultTimerWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + SeriesTimerInfoDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1334,8 +1843,8 @@ public ApiResponse getDefaultTimerWithHttpInfo( } } - private HttpRequest.Builder getDefaultTimerRequestBuilder(@org.eclipse.jdt.annotation.NonNull String programId) - throws ApiException { + private HttpRequest.Builder getDefaultTimerRequestBuilder(@org.eclipse.jdt.annotation.NonNull String programId, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -1365,6 +1874,8 @@ private HttpRequest.Builder getDefaultTimerRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1378,7 +1889,18 @@ private HttpRequest.Builder getDefaultTimerRequestBuilder(@org.eclipse.jdt.annot * @throws ApiException if fails to make API call */ public GuideInfo getGuideInfo() throws ApiException { - ApiResponse localVarResponse = getGuideInfoWithHttpInfo(); + return getGuideInfo(null); + } + + /** + * Get guid info. + * + * @param headers Optional headers to include in the request + * @return GuideInfo + * @throws ApiException if fails to make API call + */ + public GuideInfo getGuideInfo(Map headers) throws ApiException { + ApiResponse localVarResponse = getGuideInfoWithHttpInfo(headers); return localVarResponse.getData(); } @@ -1389,7 +1911,18 @@ public GuideInfo getGuideInfo() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getGuideInfoWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getGuideInfoRequestBuilder(); + return getGuideInfoWithHttpInfo(null); + } + + /** + * Get guid info. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<GuideInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGuideInfoWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGuideInfoRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1406,12 +1939,14 @@ public ApiResponse getGuideInfoWithHttpInfo() throws ApiException { } String responseBody = new String(localVarResponse.body().readAllBytes()); + GuideInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1422,7 +1957,7 @@ public ApiResponse getGuideInfoWithHttpInfo() throws ApiException { } } - private HttpRequest.Builder getGuideInfoRequestBuilder() throws ApiException { + private HttpRequest.Builder getGuideInfoRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -1437,6 +1972,8 @@ private HttpRequest.Builder getGuideInfoRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1456,7 +1993,24 @@ private HttpRequest.Builder getGuideInfoRequestBuilder() throws ApiException { public List getLineups(@org.eclipse.jdt.annotation.NonNull String id, @org.eclipse.jdt.annotation.NonNull String type, @org.eclipse.jdt.annotation.NonNull String location, @org.eclipse.jdt.annotation.NonNull String country) throws ApiException { - ApiResponse> localVarResponse = getLineupsWithHttpInfo(id, type, location, country); + return getLineups(id, type, location, country, null); + } + + /** + * Gets available lineups. + * + * @param id Provider id. (optional) + * @param type Provider type. (optional) + * @param location Location. (optional) + * @param country Country. (optional) + * @param headers Optional headers to include in the request + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getLineups(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull String type, @org.eclipse.jdt.annotation.NonNull String location, + @org.eclipse.jdt.annotation.NonNull String country, Map headers) throws ApiException { + ApiResponse> localVarResponse = getLineupsWithHttpInfo(id, type, location, country, headers); return localVarResponse.getData(); } @@ -1473,7 +2027,24 @@ public List getLineups(@org.eclipse.jdt.annotation.NonNull String id public ApiResponse> getLineupsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id, @org.eclipse.jdt.annotation.NonNull String type, @org.eclipse.jdt.annotation.NonNull String location, @org.eclipse.jdt.annotation.NonNull String country) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getLineupsRequestBuilder(id, type, location, country); + return getLineupsWithHttpInfo(id, type, location, country, null); + } + + /** + * Gets available lineups. + * + * @param id Provider id. (optional) + * @param type Provider type. (optional) + * @param location Location. (optional) + * @param country Country. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getLineupsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull String type, @org.eclipse.jdt.annotation.NonNull String location, + @org.eclipse.jdt.annotation.NonNull String country, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLineupsRequestBuilder(id, type, location, country, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1490,12 +2061,14 @@ public ApiResponse> getLineupsWithHttpInfo(@org.eclipse.jdt.ann } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1508,7 +2081,7 @@ public ApiResponse> getLineupsWithHttpInfo(@org.eclipse.jdt.ann private HttpRequest.Builder getLineupsRequestBuilder(@org.eclipse.jdt.annotation.NonNull String id, @org.eclipse.jdt.annotation.NonNull String type, @org.eclipse.jdt.annotation.NonNull String location, - @org.eclipse.jdt.annotation.NonNull String country) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String country, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -1544,6 +2117,8 @@ private HttpRequest.Builder getLineupsRequestBuilder(@org.eclipse.jdt.annotation if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1558,7 +2133,20 @@ private HttpRequest.Builder getLineupsRequestBuilder(@org.eclipse.jdt.annotation * @throws ApiException if fails to make API call */ public File getLiveRecordingFile(@org.eclipse.jdt.annotation.Nullable String recordingId) throws ApiException { - ApiResponse localVarResponse = getLiveRecordingFileWithHttpInfo(recordingId); + return getLiveRecordingFile(recordingId, null); + } + + /** + * Gets a live tv recording stream. + * + * @param recordingId Recording id. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getLiveRecordingFile(@org.eclipse.jdt.annotation.Nullable String recordingId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getLiveRecordingFileWithHttpInfo(recordingId, headers); return localVarResponse.getData(); } @@ -1571,7 +2159,20 @@ public File getLiveRecordingFile(@org.eclipse.jdt.annotation.Nullable String rec */ public ApiResponse getLiveRecordingFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String recordingId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getLiveRecordingFileRequestBuilder(recordingId); + return getLiveRecordingFileWithHttpInfo(recordingId, null); + } + + /** + * Gets a live tv recording stream. + * + * @param recordingId Recording id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveRecordingFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String recordingId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLiveRecordingFileRequestBuilder(recordingId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1586,13 +2187,13 @@ public ApiResponse getLiveRecordingFileWithHttpInfo(@org.eclipse.jdt.annot return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1604,7 +2205,7 @@ public ApiResponse getLiveRecordingFileWithHttpInfo(@org.eclipse.jdt.annot } private HttpRequest.Builder getLiveRecordingFileRequestBuilder( - @org.eclipse.jdt.annotation.Nullable String recordingId) throws ApiException { + @org.eclipse.jdt.annotation.Nullable String recordingId, Map headers) throws ApiException { // verify the required parameter 'recordingId' is set if (recordingId == null) { throw new ApiException(400, @@ -1625,6 +2226,8 @@ private HttpRequest.Builder getLiveRecordingFileRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1641,7 +2244,21 @@ private HttpRequest.Builder getLiveRecordingFileRequestBuilder( */ public File getLiveStreamFile(@org.eclipse.jdt.annotation.Nullable String streamId, @org.eclipse.jdt.annotation.Nullable String container) throws ApiException { - ApiResponse localVarResponse = getLiveStreamFileWithHttpInfo(streamId, container); + return getLiveStreamFile(streamId, container, null); + } + + /** + * Gets a live tv channel stream. + * + * @param streamId Stream id. (required) + * @param container Container type. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getLiveStreamFile(@org.eclipse.jdt.annotation.Nullable String streamId, + @org.eclipse.jdt.annotation.Nullable String container, Map headers) throws ApiException { + ApiResponse localVarResponse = getLiveStreamFileWithHttpInfo(streamId, container, headers); return localVarResponse.getData(); } @@ -1655,7 +2272,21 @@ public File getLiveStreamFile(@org.eclipse.jdt.annotation.Nullable String stream */ public ApiResponse getLiveStreamFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String streamId, @org.eclipse.jdt.annotation.Nullable String container) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getLiveStreamFileRequestBuilder(streamId, container); + return getLiveStreamFileWithHttpInfo(streamId, container, null); + } + + /** + * Gets a live tv channel stream. + * + * @param streamId Stream id. (required) + * @param container Container type. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveStreamFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String streamId, + @org.eclipse.jdt.annotation.Nullable String container, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLiveStreamFileRequestBuilder(streamId, container, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1670,13 +2301,13 @@ public ApiResponse getLiveStreamFileWithHttpInfo(@org.eclipse.jdt.annotati return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1688,7 +2319,7 @@ public ApiResponse getLiveStreamFileWithHttpInfo(@org.eclipse.jdt.annotati } private HttpRequest.Builder getLiveStreamFileRequestBuilder(@org.eclipse.jdt.annotation.Nullable String streamId, - @org.eclipse.jdt.annotation.Nullable String container) throws ApiException { + @org.eclipse.jdt.annotation.Nullable String container, Map headers) throws ApiException { // verify the required parameter 'streamId' is set if (streamId == null) { throw new ApiException(400, "Missing the required parameter 'streamId' when calling getLiveStreamFile"); @@ -1713,6 +2344,8 @@ private HttpRequest.Builder getLiveStreamFileRequestBuilder(@org.eclipse.jdt.ann if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1764,10 +2397,62 @@ public BaseItemDtoQueryResult getLiveTvChannels(@org.eclipse.jdt.annotation.NonN @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, @org.eclipse.jdt.annotation.NonNull Boolean enableFavoriteSorting, @org.eclipse.jdt.annotation.NonNull Boolean addCurrentProgram) throws ApiException { + return getLiveTvChannels(type, userId, startIndex, isMovie, isSeries, isNews, isKids, isSports, limit, + isFavorite, isLiked, isDisliked, enableImages, imageTypeLimit, enableImageTypes, fields, enableUserData, + sortBy, sortOrder, enableFavoriteSorting, addCurrentProgram, null); + } + + /** + * Gets available live tv channels. + * + * @param type Optional. Filter by channel type. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param isFavorite Optional. Filter by channels that are favorites, or not. (optional) + * @param isLiked Optional. Filter by channels that are liked, or not. (optional) + * @param isDisliked Optional. Filter by channels that are disliked, or not. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes \"Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param sortBy Optional. Key to sort by. (optional) + * @param sortOrder Optional. Sort order. (optional) + * @param enableFavoriteSorting Optional. Incorporate favorite and like status into channel sorting. (optional, + * default to false) + * @param addCurrentProgram Optional. Adds current program info to each channel. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getLiveTvChannels(@org.eclipse.jdt.annotation.NonNull ChannelType type, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, @org.eclipse.jdt.annotation.NonNull Boolean isLiked, + @org.eclipse.jdt.annotation.NonNull Boolean isDisliked, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableFavoriteSorting, + @org.eclipse.jdt.annotation.NonNull Boolean addCurrentProgram, Map headers) + throws ApiException { ApiResponse localVarResponse = getLiveTvChannelsWithHttpInfo(type, userId, startIndex, isMovie, isSeries, isNews, isKids, isSports, limit, isFavorite, isLiked, isDisliked, enableImages, imageTypeLimit, enableImageTypes, fields, enableUserData, sortBy, sortOrder, enableFavoriteSorting, - addCurrentProgram); + addCurrentProgram, headers); return localVarResponse.getData(); } @@ -1816,15 +2501,67 @@ public ApiResponse getLiveTvChannelsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, @org.eclipse.jdt.annotation.NonNull Boolean enableFavoriteSorting, @org.eclipse.jdt.annotation.NonNull Boolean addCurrentProgram) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getLiveTvChannelsRequestBuilder(type, userId, startIndex, isMovie, - isSeries, isNews, isKids, isSports, limit, isFavorite, isLiked, isDisliked, enableImages, - imageTypeLimit, enableImageTypes, fields, enableUserData, sortBy, sortOrder, enableFavoriteSorting, - addCurrentProgram); - try { - HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); + return getLiveTvChannelsWithHttpInfo(type, userId, startIndex, isMovie, isSeries, isNews, isKids, isSports, + limit, isFavorite, isLiked, isDisliked, enableImages, imageTypeLimit, enableImageTypes, fields, + enableUserData, sortBy, sortOrder, enableFavoriteSorting, addCurrentProgram, null); + } + + /** + * Gets available live tv channels. + * + * @param type Optional. Filter by channel type. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param isFavorite Optional. Filter by channels that are favorites, or not. (optional) + * @param isLiked Optional. Filter by channels that are liked, or not. (optional) + * @param isDisliked Optional. Filter by channels that are disliked, or not. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes \"Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param sortBy Optional. Key to sort by. (optional) + * @param sortOrder Optional. Sort order. (optional) + * @param enableFavoriteSorting Optional. Incorporate favorite and like status into channel sorting. (optional, + * default to false) + * @param addCurrentProgram Optional. Adds current program info to each channel. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveTvChannelsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull ChannelType type, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean isLiked, @org.eclipse.jdt.annotation.NonNull Boolean isDisliked, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableFavoriteSorting, + @org.eclipse.jdt.annotation.NonNull Boolean addCurrentProgram, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLiveTvChannelsRequestBuilder(type, userId, startIndex, isMovie, + isSeries, isNews, isKids, isSports, limit, isFavorite, isLiked, isDisliked, enableImages, + imageTypeLimit, enableImageTypes, fields, enableUserData, sortBy, sortOrder, enableFavoriteSorting, + addCurrentProgram, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); } try { if (localVarResponse.statusCode() / 100 != 2) { @@ -1836,14 +2573,14 @@ public ApiResponse getLiveTvChannelsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1869,7 +2606,8 @@ private HttpRequest.Builder getLiveTvChannelsRequestBuilder(@org.eclipse.jdt.ann @org.eclipse.jdt.annotation.NonNull List sortBy, @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, @org.eclipse.jdt.annotation.NonNull Boolean enableFavoriteSorting, - @org.eclipse.jdt.annotation.NonNull Boolean addCurrentProgram) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean addCurrentProgram, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -1939,6 +2677,8 @@ private HttpRequest.Builder getLiveTvChannelsRequestBuilder(@org.eclipse.jdt.ann if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1952,7 +2692,18 @@ private HttpRequest.Builder getLiveTvChannelsRequestBuilder(@org.eclipse.jdt.ann * @throws ApiException if fails to make API call */ public LiveTvInfo getLiveTvInfo() throws ApiException { - ApiResponse localVarResponse = getLiveTvInfoWithHttpInfo(); + return getLiveTvInfo(null); + } + + /** + * Gets available live tv services. + * + * @param headers Optional headers to include in the request + * @return LiveTvInfo + * @throws ApiException if fails to make API call + */ + public LiveTvInfo getLiveTvInfo(Map headers) throws ApiException { + ApiResponse localVarResponse = getLiveTvInfoWithHttpInfo(headers); return localVarResponse.getData(); } @@ -1963,7 +2714,18 @@ public LiveTvInfo getLiveTvInfo() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getLiveTvInfoWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getLiveTvInfoRequestBuilder(); + return getLiveTvInfoWithHttpInfo(null); + } + + /** + * Gets available live tv services. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<LiveTvInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveTvInfoWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLiveTvInfoRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1980,12 +2742,14 @@ public ApiResponse getLiveTvInfoWithHttpInfo() throws ApiException { } String responseBody = new String(localVarResponse.body().readAllBytes()); + LiveTvInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1996,7 +2760,7 @@ public ApiResponse getLiveTvInfoWithHttpInfo() throws ApiException { } } - private HttpRequest.Builder getLiveTvInfoRequestBuilder() throws ApiException { + private HttpRequest.Builder getLiveTvInfoRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -2011,6 +2775,8 @@ private HttpRequest.Builder getLiveTvInfoRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2074,10 +2840,76 @@ public BaseItemDtoQueryResult getLiveTvPrograms(@org.eclipse.jdt.annotation.NonN @org.eclipse.jdt.annotation.NonNull UUID librarySeriesId, @org.eclipse.jdt.annotation.NonNull List fields, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getLiveTvPrograms(channelIds, userId, minStartDate, hasAired, isAiring, maxStartDate, minEndDate, + maxEndDate, isMovie, isSeries, isNews, isKids, isSports, startIndex, limit, sortBy, sortOrder, genres, + genreIds, enableImages, imageTypeLimit, enableImageTypes, enableUserData, seriesTimerId, + librarySeriesId, fields, enableTotalRecordCount, null); + } + + /** + * Gets available live tv epgs. + * + * @param channelIds The channels to return guide information for. (optional) + * @param userId Optional. Filter by user id. (optional) + * @param minStartDate Optional. The minimum premiere start date. (optional) + * @param hasAired Optional. Filter by programs that have completed airing, or not. (optional) + * @param isAiring Optional. Filter by programs that are currently airing, or not. (optional) + * @param maxStartDate Optional. The maximum premiere start date. (optional) + * @param minEndDate Optional. The minimum premiere end date. (optional) + * @param maxEndDate Optional. The maximum premiere end date. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param genres The genres to return guide information for. (optional) + * @param genreIds The genre ids to return guide information for. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param seriesTimerId Optional. Filter by series timer id. (optional) + * @param librarySeriesId Optional. Filter by library series id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getLiveTvPrograms(@org.eclipse.jdt.annotation.NonNull List channelIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minStartDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasAired, @org.eclipse.jdt.annotation.NonNull Boolean isAiring, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxStartDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minEndDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxEndDate, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull UUID librarySeriesId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { ApiResponse localVarResponse = getLiveTvProgramsWithHttpInfo(channelIds, userId, minStartDate, hasAired, isAiring, maxStartDate, minEndDate, maxEndDate, isMovie, isSeries, isNews, isKids, isSports, startIndex, limit, sortBy, sortOrder, genres, genreIds, enableImages, imageTypeLimit, - enableImageTypes, enableUserData, seriesTimerId, librarySeriesId, fields, enableTotalRecordCount); + enableImageTypes, enableUserData, seriesTimerId, librarySeriesId, fields, enableTotalRecordCount, + headers); return localVarResponse.getData(); } @@ -2138,10 +2970,75 @@ public ApiResponse getLiveTvProgramsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull UUID librarySeriesId, @org.eclipse.jdt.annotation.NonNull List fields, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getLiveTvProgramsWithHttpInfo(channelIds, userId, minStartDate, hasAired, isAiring, maxStartDate, + minEndDate, maxEndDate, isMovie, isSeries, isNews, isKids, isSports, startIndex, limit, sortBy, + sortOrder, genres, genreIds, enableImages, imageTypeLimit, enableImageTypes, enableUserData, + seriesTimerId, librarySeriesId, fields, enableTotalRecordCount, null); + } + + /** + * Gets available live tv epgs. + * + * @param channelIds The channels to return guide information for. (optional) + * @param userId Optional. Filter by user id. (optional) + * @param minStartDate Optional. The minimum premiere start date. (optional) + * @param hasAired Optional. Filter by programs that have completed airing, or not. (optional) + * @param isAiring Optional. Filter by programs that are currently airing, or not. (optional) + * @param maxStartDate Optional. The maximum premiere start date. (optional) + * @param minEndDate Optional. The minimum premiere end date. (optional) + * @param maxEndDate Optional. The maximum premiere end date. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param genres The genres to return guide information for. (optional) + * @param genreIds The genre ids to return guide information for. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param seriesTimerId Optional. Filter by series timer id. (optional) + * @param librarySeriesId Optional. Filter by library series id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveTvProgramsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull List channelIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minStartDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasAired, @org.eclipse.jdt.annotation.NonNull Boolean isAiring, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxStartDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minEndDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxEndDate, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull UUID librarySeriesId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getLiveTvProgramsRequestBuilder(channelIds, userId, minStartDate, hasAired, isAiring, maxStartDate, minEndDate, maxEndDate, isMovie, isSeries, isNews, isKids, isSports, startIndex, limit, sortBy, sortOrder, genres, genreIds, enableImages, imageTypeLimit, enableImageTypes, - enableUserData, seriesTimerId, librarySeriesId, fields, enableTotalRecordCount); + enableUserData, seriesTimerId, librarySeriesId, fields, enableTotalRecordCount, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2158,14 +3055,14 @@ public ApiResponse getLiveTvProgramsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -2198,7 +3095,8 @@ private HttpRequest.Builder getLiveTvProgramsRequestBuilder( @org.eclipse.jdt.annotation.NonNull String seriesTimerId, @org.eclipse.jdt.annotation.NonNull UUID librarySeriesId, @org.eclipse.jdt.annotation.NonNull List fields, - @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -2280,6 +3178,8 @@ private HttpRequest.Builder getLiveTvProgramsRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2296,7 +3196,21 @@ private HttpRequest.Builder getLiveTvProgramsRequestBuilder( */ public BaseItemDto getProgram(@org.eclipse.jdt.annotation.Nullable String programId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getProgramWithHttpInfo(programId, userId); + return getProgram(programId, userId, null); + } + + /** + * Gets a live tv program. + * + * @param programId Program id. (required) + * @param userId Optional. Attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getProgram(@org.eclipse.jdt.annotation.Nullable String programId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getProgramWithHttpInfo(programId, userId, headers); return localVarResponse.getData(); } @@ -2310,7 +3224,21 @@ public BaseItemDto getProgram(@org.eclipse.jdt.annotation.Nullable String progra */ public ApiResponse getProgramWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String programId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getProgramRequestBuilder(programId, userId); + return getProgramWithHttpInfo(programId, userId, null); + } + + /** + * Gets a live tv program. + * + * @param programId Program id. (required) + * @param userId Optional. Attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getProgramWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String programId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getProgramRequestBuilder(programId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2327,12 +3255,14 @@ public ApiResponse getProgramWithHttpInfo(@org.eclipse.jdt.annotati } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -2344,7 +3274,7 @@ public ApiResponse getProgramWithHttpInfo(@org.eclipse.jdt.annotati } private HttpRequest.Builder getProgramRequestBuilder(@org.eclipse.jdt.annotation.Nullable String programId, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'programId' is set if (programId == null) { throw new ApiException(400, "Missing the required parameter 'programId' when calling getProgram"); @@ -2379,6 +3309,8 @@ private HttpRequest.Builder getProgramRequestBuilder(@org.eclipse.jdt.annotation if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2394,7 +3326,20 @@ private HttpRequest.Builder getProgramRequestBuilder(@org.eclipse.jdt.annotation */ public BaseItemDtoQueryResult getPrograms(@org.eclipse.jdt.annotation.NonNull GetProgramsDto getProgramsDto) throws ApiException { - ApiResponse localVarResponse = getProgramsWithHttpInfo(getProgramsDto); + return getPrograms(getProgramsDto, null); + } + + /** + * Gets available live tv epgs. + * + * @param getProgramsDto Request body. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getPrograms(@org.eclipse.jdt.annotation.NonNull GetProgramsDto getProgramsDto, + Map headers) throws ApiException { + ApiResponse localVarResponse = getProgramsWithHttpInfo(getProgramsDto, headers); return localVarResponse.getData(); } @@ -2407,7 +3352,21 @@ public BaseItemDtoQueryResult getPrograms(@org.eclipse.jdt.annotation.NonNull Ge */ public ApiResponse getProgramsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull GetProgramsDto getProgramsDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getProgramsRequestBuilder(getProgramsDto); + return getProgramsWithHttpInfo(getProgramsDto, null); + } + + /** + * Gets available live tv epgs. + * + * @param getProgramsDto Request body. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getProgramsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull GetProgramsDto getProgramsDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getProgramsRequestBuilder(getProgramsDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2424,14 +3383,14 @@ public ApiResponse getProgramsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -2443,7 +3402,8 @@ public ApiResponse getProgramsWithHttpInfo( } private HttpRequest.Builder getProgramsRequestBuilder( - @org.eclipse.jdt.annotation.NonNull GetProgramsDto getProgramsDto) throws ApiException { + @org.eclipse.jdt.annotation.NonNull GetProgramsDto getProgramsDto, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -2464,6 +3424,8 @@ private HttpRequest.Builder getProgramsRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2504,10 +3466,9 @@ public BaseItemDtoQueryResult getRecommendedPrograms(@org.eclipse.jdt.annotation @org.eclipse.jdt.annotation.NonNull List fields, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { - ApiResponse localVarResponse = getRecommendedProgramsWithHttpInfo(userId, limit, - isAiring, hasAired, isSeries, isMovie, isNews, isKids, isSports, enableImages, imageTypeLimit, - enableImageTypes, genreIds, fields, enableUserData, enableTotalRecordCount); - return localVarResponse.getData(); + return getRecommendedPrograms(userId, limit, isAiring, hasAired, isSeries, isMovie, isNews, isKids, isSports, + enableImages, imageTypeLimit, enableImageTypes, genreIds, fields, enableUserData, + enableTotalRecordCount, null); } /** @@ -2529,25 +3490,109 @@ public BaseItemDtoQueryResult getRecommendedPrograms(@org.eclipse.jdt.annotation * @param fields Optional. Specify additional fields of information to return in the output. (optional) * @param enableUserData Optional. include user data. (optional) * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) - * @return ApiResponse<BaseItemDtoQueryResult> + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult * @throws ApiException if fails to make API call */ - public ApiResponse getRecommendedProgramsWithHttpInfo( - @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, - @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean hasAired, - @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, - @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, - @org.eclipse.jdt.annotation.NonNull Boolean isSports, - @org.eclipse.jdt.annotation.NonNull Boolean enableImages, - @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + public BaseItemDtoQueryResult getRecommendedPrograms(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean isAiring, + @org.eclipse.jdt.annotation.NonNull Boolean hasAired, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + ApiResponse localVarResponse = getRecommendedProgramsWithHttpInfo(userId, limit, + isAiring, hasAired, isSeries, isMovie, isNews, isKids, isSports, enableImages, imageTypeLimit, + enableImageTypes, genreIds, fields, enableUserData, enableTotalRecordCount, headers); + return localVarResponse.getData(); + } + + /** + * Gets recommended live tv epgs. + * + * @param userId Optional. filter by user id. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param isAiring Optional. Filter by programs that are currently airing, or not. (optional) + * @param hasAired Optional. Filter by programs that have completed airing, or not. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param genreIds The genres to return guide information for. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. include user data. (optional) + * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecommendedProgramsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean hasAired, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes, @org.eclipse.jdt.annotation.NonNull List genreIds, @org.eclipse.jdt.annotation.NonNull List fields, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getRecommendedProgramsWithHttpInfo(userId, limit, isAiring, hasAired, isSeries, isMovie, isNews, isKids, + isSports, enableImages, imageTypeLimit, enableImageTypes, genreIds, fields, enableUserData, + enableTotalRecordCount, null); + } + + /** + * Gets recommended live tv epgs. + * + * @param userId Optional. filter by user id. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param isAiring Optional. Filter by programs that are currently airing, or not. (optional) + * @param hasAired Optional. Filter by programs that have completed airing, or not. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param genreIds The genres to return guide information for. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. include user data. (optional) + * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecommendedProgramsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean hasAired, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getRecommendedProgramsRequestBuilder(userId, limit, isAiring, hasAired, isSeries, isMovie, isNews, isKids, isSports, enableImages, imageTypeLimit, enableImageTypes, - genreIds, fields, enableUserData, enableTotalRecordCount); + genreIds, fields, enableUserData, enableTotalRecordCount, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2564,14 +3609,14 @@ public ApiResponse getRecommendedProgramsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -2593,7 +3638,8 @@ private HttpRequest.Builder getRecommendedProgramsRequestBuilder(@org.eclipse.jd @org.eclipse.jdt.annotation.NonNull List genreIds, @org.eclipse.jdt.annotation.NonNull List fields, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, - @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -2653,6 +3699,8 @@ private HttpRequest.Builder getRecommendedProgramsRequestBuilder(@org.eclipse.jd if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2669,7 +3717,21 @@ private HttpRequest.Builder getRecommendedProgramsRequestBuilder(@org.eclipse.jd */ public BaseItemDto getRecording(@org.eclipse.jdt.annotation.Nullable UUID recordingId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getRecordingWithHttpInfo(recordingId, userId); + return getRecording(recordingId, userId, null); + } + + /** + * Gets a live tv recording. + * + * @param recordingId Recording id. (required) + * @param userId Optional. Attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getRecording(@org.eclipse.jdt.annotation.Nullable UUID recordingId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getRecordingWithHttpInfo(recordingId, userId, headers); return localVarResponse.getData(); } @@ -2683,7 +3745,21 @@ public BaseItemDto getRecording(@org.eclipse.jdt.annotation.Nullable UUID record */ public ApiResponse getRecordingWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID recordingId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getRecordingRequestBuilder(recordingId, userId); + return getRecordingWithHttpInfo(recordingId, userId, null); + } + + /** + * Gets a live tv recording. + * + * @param recordingId Recording id. (required) + * @param userId Optional. Attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecordingWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID recordingId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecordingRequestBuilder(recordingId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2700,12 +3776,14 @@ public ApiResponse getRecordingWithHttpInfo(@org.eclipse.jdt.annota } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -2717,7 +3795,7 @@ public ApiResponse getRecordingWithHttpInfo(@org.eclipse.jdt.annota } private HttpRequest.Builder getRecordingRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID recordingId, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'recordingId' is set if (recordingId == null) { throw new ApiException(400, "Missing the required parameter 'recordingId' when calling getRecording"); @@ -2752,6 +3830,8 @@ private HttpRequest.Builder getRecordingRequestBuilder(@org.eclipse.jdt.annotati if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2767,7 +3847,20 @@ private HttpRequest.Builder getRecordingRequestBuilder(@org.eclipse.jdt.annotati */ public BaseItemDtoQueryResult getRecordingFolders(@org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getRecordingFoldersWithHttpInfo(userId); + return getRecordingFolders(userId, null); + } + + /** + * Gets recording folders. + * + * @param userId Optional. Filter by user and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getRecordingFolders(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getRecordingFoldersWithHttpInfo(userId, headers); return localVarResponse.getData(); } @@ -2780,7 +3873,20 @@ public BaseItemDtoQueryResult getRecordingFolders(@org.eclipse.jdt.annotation.No */ public ApiResponse getRecordingFoldersWithHttpInfo( @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getRecordingFoldersRequestBuilder(userId); + return getRecordingFoldersWithHttpInfo(userId, null); + } + + /** + * Gets recording folders. + * + * @param userId Optional. Filter by user and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecordingFoldersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecordingFoldersRequestBuilder(userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2797,14 +3903,14 @@ public ApiResponse getRecordingFoldersWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -2815,8 +3921,8 @@ public ApiResponse getRecordingFoldersWithHttpInfo( } } - private HttpRequest.Builder getRecordingFoldersRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId) - throws ApiException { + private HttpRequest.Builder getRecordingFoldersRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -2846,6 +3952,8 @@ private HttpRequest.Builder getRecordingFoldersRequestBuilder(@org.eclipse.jdt.a if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2861,7 +3969,21 @@ private HttpRequest.Builder getRecordingFoldersRequestBuilder(@org.eclipse.jdt.a */ @Deprecated public void getRecordingGroup(@org.eclipse.jdt.annotation.Nullable UUID groupId) throws ApiException { - getRecordingGroupWithHttpInfo(groupId); + getRecordingGroup(groupId, null); + } + + /** + * Get recording group. + * + * @param groupId Group id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public void getRecordingGroup(@org.eclipse.jdt.annotation.Nullable UUID groupId, Map headers) + throws ApiException { + getRecordingGroupWithHttpInfo(groupId, headers); } /** @@ -2875,7 +3997,22 @@ public void getRecordingGroup(@org.eclipse.jdt.annotation.Nullable UUID groupId) @Deprecated public ApiResponse getRecordingGroupWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID groupId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getRecordingGroupRequestBuilder(groupId); + return getRecordingGroupWithHttpInfo(groupId, null); + } + + /** + * Get recording group. + * + * @param groupId Group id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getRecordingGroupWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID groupId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecordingGroupRequestBuilder(groupId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2902,8 +4039,8 @@ public ApiResponse getRecordingGroupWithHttpInfo(@org.eclipse.jdt.annotati } } - private HttpRequest.Builder getRecordingGroupRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID groupId) - throws ApiException { + private HttpRequest.Builder getRecordingGroupRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID groupId, + Map headers) throws ApiException { // verify the required parameter 'groupId' is set if (groupId == null) { throw new ApiException(400, "Missing the required parameter 'groupId' when calling getRecordingGroup"); @@ -2923,6 +4060,8 @@ private HttpRequest.Builder getRecordingGroupRequestBuilder(@org.eclipse.jdt.ann if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2940,7 +4079,22 @@ private HttpRequest.Builder getRecordingGroupRequestBuilder(@org.eclipse.jdt.ann @Deprecated public BaseItemDtoQueryResult getRecordingGroups(@org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getRecordingGroupsWithHttpInfo(userId); + return getRecordingGroups(userId, null); + } + + /** + * Gets live tv recording groups. + * + * @param userId Optional. Filter by user and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getRecordingGroups(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getRecordingGroupsWithHttpInfo(userId, headers); return localVarResponse.getData(); } @@ -2955,7 +4109,22 @@ public BaseItemDtoQueryResult getRecordingGroups(@org.eclipse.jdt.annotation.Non @Deprecated public ApiResponse getRecordingGroupsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getRecordingGroupsRequestBuilder(userId); + return getRecordingGroupsWithHttpInfo(userId, null); + } + + /** + * Gets live tv recording groups. + * + * @param userId Optional. Filter by user and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getRecordingGroupsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecordingGroupsRequestBuilder(userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2972,14 +4141,14 @@ public ApiResponse getRecordingGroupsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -2990,8 +4159,8 @@ public ApiResponse getRecordingGroupsWithHttpInfo( } } - private HttpRequest.Builder getRecordingGroupsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId) - throws ApiException { + private HttpRequest.Builder getRecordingGroupsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -3021,6 +4190,8 @@ private HttpRequest.Builder getRecordingGroupsRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -3069,9 +4240,59 @@ public BaseItemDtoQueryResult getRecordings(@org.eclipse.jdt.annotation.NonNull @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isLibraryItem, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getRecordings(channelId, userId, startIndex, limit, status, isInProgress, seriesTimerId, enableImages, + imageTypeLimit, enableImageTypes, fields, enableUserData, isMovie, isSeries, isKids, isSports, isNews, + isLibraryItem, enableTotalRecordCount, null); + } + + /** + * Gets live tv recordings. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param status Optional. Filter by recording status. (optional) + * @param isInProgress Optional. Filter by recordings that are in progress, or not. (optional) + * @param seriesTimerId Optional. Filter by recordings belonging to a series timer. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isLibraryItem Optional. Filter for is library item. (optional) + * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getRecordings(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isLibraryItem, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { ApiResponse localVarResponse = getRecordingsWithHttpInfo(channelId, userId, startIndex, limit, status, isInProgress, seriesTimerId, enableImages, imageTypeLimit, enableImageTypes, fields, - enableUserData, isMovie, isSeries, isKids, isSports, isNews, isLibraryItem, enableTotalRecordCount); + enableUserData, isMovie, isSeries, isKids, isSports, isNews, isLibraryItem, enableTotalRecordCount, + headers); return localVarResponse.getData(); } @@ -3117,9 +4338,59 @@ public ApiResponse getRecordingsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isLibraryItem, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getRecordingsWithHttpInfo(channelId, userId, startIndex, limit, status, isInProgress, seriesTimerId, + enableImages, imageTypeLimit, enableImageTypes, fields, enableUserData, isMovie, isSeries, isKids, + isSports, isNews, isLibraryItem, enableTotalRecordCount, null); + } + + /** + * Gets live tv recordings. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param status Optional. Filter by recording status. (optional) + * @param isInProgress Optional. Filter by recordings that are in progress, or not. (optional) + * @param seriesTimerId Optional. Filter by recordings belonging to a series timer. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isLibraryItem Optional. Filter for is library item. (optional) + * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecordingsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String channelId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isLibraryItem, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getRecordingsRequestBuilder(channelId, userId, startIndex, limit, status, isInProgress, seriesTimerId, enableImages, imageTypeLimit, enableImageTypes, fields, - enableUserData, isMovie, isSeries, isKids, isSports, isNews, isLibraryItem, enableTotalRecordCount); + enableUserData, isMovie, isSeries, isKids, isSports, isNews, isLibraryItem, enableTotalRecordCount, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -3136,14 +4407,14 @@ public ApiResponse getRecordingsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -3169,7 +4440,8 @@ private HttpRequest.Builder getRecordingsRequestBuilder(@org.eclipse.jdt.annotat @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isLibraryItem, - @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -3235,6 +4507,8 @@ private HttpRequest.Builder getRecordingsRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -3259,14 +4533,97 @@ private HttpRequest.Builder getRecordingsRequestBuilder(@org.eclipse.jdt.annotat * @param fields Optional. Specify additional fields of information to return in the output. (optional) * @param enableUserData Optional. Include user data. (optional) * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) - * @return BaseItemDtoQueryResult + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getRecordingsSeries(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String groupId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getRecordingsSeries(channelId, userId, groupId, startIndex, limit, status, isInProgress, seriesTimerId, + enableImages, imageTypeLimit, enableImageTypes, fields, enableUserData, enableTotalRecordCount, null); + } + + /** + * Gets live tv recording series. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param groupId Optional. Filter by recording group. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param status Optional. Filter by recording status. (optional) + * @param isInProgress Optional. Filter by recordings that are in progress, or not. (optional) + * @param seriesTimerId Optional. Filter by recordings belonging to a series timer. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getRecordingsSeries(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String groupId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + ApiResponse localVarResponse = getRecordingsSeriesWithHttpInfo(channelId, userId, + groupId, startIndex, limit, status, isInProgress, seriesTimerId, enableImages, imageTypeLimit, + enableImageTypes, fields, enableUserData, enableTotalRecordCount, headers); + return localVarResponse.getData(); + } + + /** + * Gets live tv recording series. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param groupId Optional. Filter by recording group. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param status Optional. Filter by recording status. (optional) + * @param isInProgress Optional. Filter by recordings that are in progress, or not. (optional) + * @param seriesTimerId Optional. Filter by recordings belonging to a series timer. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> * @throws ApiException if fails to make API call * @deprecated */ @Deprecated - public BaseItemDtoQueryResult getRecordingsSeries(@org.eclipse.jdt.annotation.NonNull String channelId, - @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String groupId, - @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + public ApiResponse getRecordingsSeriesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String channelId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String groupId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull RecordingStatus status, @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, @org.eclipse.jdt.annotation.NonNull String seriesTimerId, @@ -3276,10 +4633,9 @@ public BaseItemDtoQueryResult getRecordingsSeries(@org.eclipse.jdt.annotation.No @org.eclipse.jdt.annotation.NonNull List fields, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { - ApiResponse localVarResponse = getRecordingsSeriesWithHttpInfo(channelId, userId, - groupId, startIndex, limit, status, isInProgress, seriesTimerId, enableImages, imageTypeLimit, - enableImageTypes, fields, enableUserData, enableTotalRecordCount); - return localVarResponse.getData(); + return getRecordingsSeriesWithHttpInfo(channelId, userId, groupId, startIndex, limit, status, isInProgress, + seriesTimerId, enableImages, imageTypeLimit, enableImageTypes, fields, enableUserData, + enableTotalRecordCount, null); } /** @@ -3300,6 +4656,7 @@ public BaseItemDtoQueryResult getRecordingsSeries(@org.eclipse.jdt.annotation.No * @param fields Optional. Specify additional fields of information to return in the output. (optional) * @param enableUserData Optional. Include user data. (optional) * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @param headers Optional headers to include in the request * @return ApiResponse<BaseItemDtoQueryResult> * @throws ApiException if fails to make API call * @deprecated @@ -3317,10 +4674,11 @@ public ApiResponse getRecordingsSeriesWithHttpInfo( @org.eclipse.jdt.annotation.NonNull List enableImageTypes, @org.eclipse.jdt.annotation.NonNull List fields, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, - @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getRecordingsSeriesRequestBuilder(channelId, userId, groupId, startIndex, limit, status, isInProgress, seriesTimerId, enableImages, imageTypeLimit, enableImageTypes, - fields, enableUserData, enableTotalRecordCount); + fields, enableUserData, enableTotalRecordCount, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -3337,14 +4695,14 @@ public ApiResponse getRecordingsSeriesWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -3366,7 +4724,8 @@ private HttpRequest.Builder getRecordingsSeriesRequestBuilder(@org.eclipse.jdt.a @org.eclipse.jdt.annotation.NonNull List enableImageTypes, @org.eclipse.jdt.annotation.NonNull List fields, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, - @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -3422,6 +4781,8 @@ private HttpRequest.Builder getRecordingsSeriesRequestBuilder(@org.eclipse.jdt.a if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -3435,7 +4796,18 @@ private HttpRequest.Builder getRecordingsSeriesRequestBuilder(@org.eclipse.jdt.a * @throws ApiException if fails to make API call */ public File getSchedulesDirectCountries() throws ApiException { - ApiResponse localVarResponse = getSchedulesDirectCountriesWithHttpInfo(); + return getSchedulesDirectCountries(null); + } + + /** + * Gets available countries. + * + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getSchedulesDirectCountries(Map headers) throws ApiException { + ApiResponse localVarResponse = getSchedulesDirectCountriesWithHttpInfo(headers); return localVarResponse.getData(); } @@ -3446,7 +4818,18 @@ public File getSchedulesDirectCountries() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getSchedulesDirectCountriesWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getSchedulesDirectCountriesRequestBuilder(); + return getSchedulesDirectCountriesWithHttpInfo(null); + } + + /** + * Gets available countries. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSchedulesDirectCountriesWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSchedulesDirectCountriesRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -3461,13 +4844,13 @@ public ApiResponse getSchedulesDirectCountriesWithHttpInfo() throws ApiExc return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -3478,7 +4861,8 @@ public ApiResponse getSchedulesDirectCountriesWithHttpInfo() throws ApiExc } } - private HttpRequest.Builder getSchedulesDirectCountriesRequestBuilder() throws ApiException { + private HttpRequest.Builder getSchedulesDirectCountriesRequestBuilder(Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -3492,6 +4876,8 @@ private HttpRequest.Builder getSchedulesDirectCountriesRequestBuilder() throws A if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -3506,7 +4892,20 @@ private HttpRequest.Builder getSchedulesDirectCountriesRequestBuilder() throws A * @throws ApiException if fails to make API call */ public SeriesTimerInfoDto getSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { - ApiResponse localVarResponse = getSeriesTimerWithHttpInfo(timerId); + return getSeriesTimer(timerId, null); + } + + /** + * Gets a live tv series timer. + * + * @param timerId Timer id. (required) + * @param headers Optional headers to include in the request + * @return SeriesTimerInfoDto + * @throws ApiException if fails to make API call + */ + public SeriesTimerInfoDto getSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getSeriesTimerWithHttpInfo(timerId, headers); return localVarResponse.getData(); } @@ -3519,7 +4918,20 @@ public SeriesTimerInfoDto getSeriesTimer(@org.eclipse.jdt.annotation.Nullable St */ public ApiResponse getSeriesTimerWithHttpInfo( @org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getSeriesTimerRequestBuilder(timerId); + return getSeriesTimerWithHttpInfo(timerId, null); + } + + /** + * Gets a live tv series timer. + * + * @param timerId Timer id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<SeriesTimerInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSeriesTimerWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String timerId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSeriesTimerRequestBuilder(timerId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -3536,14 +4948,14 @@ public ApiResponse getSeriesTimerWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + SeriesTimerInfoDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -3554,8 +4966,8 @@ public ApiResponse getSeriesTimerWithHttpInfo( } } - private HttpRequest.Builder getSeriesTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId) - throws ApiException { + private HttpRequest.Builder getSeriesTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId, + Map headers) throws ApiException { // verify the required parameter 'timerId' is set if (timerId == null) { throw new ApiException(400, "Missing the required parameter 'timerId' when calling getSeriesTimer"); @@ -3575,6 +4987,8 @@ private HttpRequest.Builder getSeriesTimerRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -3591,7 +5005,22 @@ private HttpRequest.Builder getSeriesTimerRequestBuilder(@org.eclipse.jdt.annota */ public SeriesTimerInfoDtoQueryResult getSeriesTimers(@org.eclipse.jdt.annotation.NonNull String sortBy, @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder) throws ApiException { - ApiResponse localVarResponse = getSeriesTimersWithHttpInfo(sortBy, sortOrder); + return getSeriesTimers(sortBy, sortOrder, null); + } + + /** + * Gets live tv series timers. + * + * @param sortBy Optional. Sort by SortName or Priority. (optional) + * @param sortOrder Optional. Sort in Ascending or Descending order. (optional) + * @param headers Optional headers to include in the request + * @return SeriesTimerInfoDtoQueryResult + * @throws ApiException if fails to make API call + */ + public SeriesTimerInfoDtoQueryResult getSeriesTimers(@org.eclipse.jdt.annotation.NonNull String sortBy, + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, Map headers) throws ApiException { + ApiResponse localVarResponse = getSeriesTimersWithHttpInfo(sortBy, sortOrder, + headers); return localVarResponse.getData(); } @@ -3606,7 +5035,22 @@ public SeriesTimerInfoDtoQueryResult getSeriesTimers(@org.eclipse.jdt.annotation public ApiResponse getSeriesTimersWithHttpInfo( @org.eclipse.jdt.annotation.NonNull String sortBy, @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getSeriesTimersRequestBuilder(sortBy, sortOrder); + return getSeriesTimersWithHttpInfo(sortBy, sortOrder, null); + } + + /** + * Gets live tv series timers. + * + * @param sortBy Optional. Sort by SortName or Priority. (optional) + * @param sortOrder Optional. Sort in Ascending or Descending order. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<SeriesTimerInfoDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSeriesTimersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String sortBy, @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSeriesTimersRequestBuilder(sortBy, sortOrder, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -3623,14 +5067,15 @@ public ApiResponse getSeriesTimersWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + SeriesTimerInfoDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -3642,7 +5087,7 @@ public ApiResponse getSeriesTimersWithHttpInfo( } private HttpRequest.Builder getSeriesTimersRequestBuilder(@org.eclipse.jdt.annotation.NonNull String sortBy, - @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder) throws ApiException { + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -3674,6 +5119,8 @@ private HttpRequest.Builder getSeriesTimersRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -3688,7 +5135,20 @@ private HttpRequest.Builder getSeriesTimersRequestBuilder(@org.eclipse.jdt.annot * @throws ApiException if fails to make API call */ public TimerInfoDto getTimer(@org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { - ApiResponse localVarResponse = getTimerWithHttpInfo(timerId); + return getTimer(timerId, null); + } + + /** + * Gets a timer. + * + * @param timerId Timer id. (required) + * @param headers Optional headers to include in the request + * @return TimerInfoDto + * @throws ApiException if fails to make API call + */ + public TimerInfoDto getTimer(@org.eclipse.jdt.annotation.Nullable String timerId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getTimerWithHttpInfo(timerId, headers); return localVarResponse.getData(); } @@ -3701,7 +5161,20 @@ public TimerInfoDto getTimer(@org.eclipse.jdt.annotation.Nullable String timerId */ public ApiResponse getTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getTimerRequestBuilder(timerId); + return getTimerWithHttpInfo(timerId, null); + } + + /** + * Gets a timer. + * + * @param timerId Timer id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<TimerInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTimerRequestBuilder(timerId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -3718,12 +5191,14 @@ public ApiResponse getTimerWithHttpInfo(@org.eclipse.jdt.annotatio } String responseBody = new String(localVarResponse.body().readAllBytes()); + TimerInfoDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -3734,8 +5209,8 @@ public ApiResponse getTimerWithHttpInfo(@org.eclipse.jdt.annotatio } } - private HttpRequest.Builder getTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId) - throws ApiException { + private HttpRequest.Builder getTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId, + Map headers) throws ApiException { // verify the required parameter 'timerId' is set if (timerId == null) { throw new ApiException(400, "Missing the required parameter 'timerId' when calling getTimer"); @@ -3754,6 +5229,8 @@ private HttpRequest.Builder getTimerRequestBuilder(@org.eclipse.jdt.annotation.N if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -3774,8 +5251,26 @@ public TimerInfoDtoQueryResult getTimers(@org.eclipse.jdt.annotation.NonNull Str @org.eclipse.jdt.annotation.NonNull String seriesTimerId, @org.eclipse.jdt.annotation.NonNull Boolean isActive, @org.eclipse.jdt.annotation.NonNull Boolean isScheduled) throws ApiException { + return getTimers(channelId, seriesTimerId, isActive, isScheduled, null); + } + + /** + * Gets the live tv timers. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param seriesTimerId Optional. Filter by timers belonging to a series timer. (optional) + * @param isActive Optional. Filter by timers that are active. (optional) + * @param isScheduled Optional. Filter by timers that are scheduled. (optional) + * @param headers Optional headers to include in the request + * @return TimerInfoDtoQueryResult + * @throws ApiException if fails to make API call + */ + public TimerInfoDtoQueryResult getTimers(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean isActive, + @org.eclipse.jdt.annotation.NonNull Boolean isScheduled, Map headers) throws ApiException { ApiResponse localVarResponse = getTimersWithHttpInfo(channelId, seriesTimerId, - isActive, isScheduled); + isActive, isScheduled, headers); return localVarResponse.getData(); } @@ -3794,8 +5289,27 @@ public ApiResponse getTimersWithHttpInfo( @org.eclipse.jdt.annotation.NonNull String seriesTimerId, @org.eclipse.jdt.annotation.NonNull Boolean isActive, @org.eclipse.jdt.annotation.NonNull Boolean isScheduled) throws ApiException { + return getTimersWithHttpInfo(channelId, seriesTimerId, isActive, isScheduled, null); + } + + /** + * Gets the live tv timers. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param seriesTimerId Optional. Filter by timers belonging to a series timer. (optional) + * @param isActive Optional. Filter by timers that are active. (optional) + * @param isScheduled Optional. Filter by timers that are scheduled. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<TimerInfoDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTimersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean isActive, + @org.eclipse.jdt.annotation.NonNull Boolean isScheduled, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getTimersRequestBuilder(channelId, seriesTimerId, isActive, - isScheduled); + isScheduled, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -3812,14 +5326,14 @@ public ApiResponse getTimersWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + TimerInfoDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -3833,7 +5347,7 @@ public ApiResponse getTimersWithHttpInfo( private HttpRequest.Builder getTimersRequestBuilder(@org.eclipse.jdt.annotation.NonNull String channelId, @org.eclipse.jdt.annotation.NonNull String seriesTimerId, @org.eclipse.jdt.annotation.NonNull Boolean isActive, - @org.eclipse.jdt.annotation.NonNull Boolean isScheduled) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean isScheduled, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -3869,6 +5383,8 @@ private HttpRequest.Builder getTimersRequestBuilder(@org.eclipse.jdt.annotation. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -3882,7 +5398,18 @@ private HttpRequest.Builder getTimersRequestBuilder(@org.eclipse.jdt.annotation. * @throws ApiException if fails to make API call */ public List getTunerHostTypes() throws ApiException { - ApiResponse> localVarResponse = getTunerHostTypesWithHttpInfo(); + return getTunerHostTypes(null); + } + + /** + * Get tuner host types. + * + * @param headers Optional headers to include in the request + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getTunerHostTypes(Map headers) throws ApiException { + ApiResponse> localVarResponse = getTunerHostTypesWithHttpInfo(headers); return localVarResponse.getData(); } @@ -3893,7 +5420,19 @@ public List getTunerHostTypes() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getTunerHostTypesWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getTunerHostTypesRequestBuilder(); + return getTunerHostTypesWithHttpInfo(null); + } + + /** + * Get tuner host types. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getTunerHostTypesWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTunerHostTypesRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -3910,12 +5449,14 @@ public ApiResponse> getTunerHostTypesWithHttpInfo() throws ApiE } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -3926,7 +5467,7 @@ public ApiResponse> getTunerHostTypesWithHttpInfo() throws ApiE } } - private HttpRequest.Builder getTunerHostTypesRequestBuilder() throws ApiException { + private HttpRequest.Builder getTunerHostTypesRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -3941,6 +5482,8 @@ private HttpRequest.Builder getTunerHostTypesRequestBuilder() throws ApiExceptio if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -3954,7 +5497,19 @@ private HttpRequest.Builder getTunerHostTypesRequestBuilder() throws ApiExceptio * @throws ApiException if fails to make API call */ public void resetTuner(@org.eclipse.jdt.annotation.Nullable String tunerId) throws ApiException { - resetTunerWithHttpInfo(tunerId); + resetTuner(tunerId, null); + } + + /** + * Resets a tv tuner. + * + * @param tunerId Tuner id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void resetTuner(@org.eclipse.jdt.annotation.Nullable String tunerId, Map headers) + throws ApiException { + resetTunerWithHttpInfo(tunerId, headers); } /** @@ -3966,7 +5521,20 @@ public void resetTuner(@org.eclipse.jdt.annotation.Nullable String tunerId) thro */ public ApiResponse resetTunerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String tunerId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = resetTunerRequestBuilder(tunerId); + return resetTunerWithHttpInfo(tunerId, null); + } + + /** + * Resets a tv tuner. + * + * @param tunerId Tuner id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse resetTunerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String tunerId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = resetTunerRequestBuilder(tunerId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -3993,8 +5561,8 @@ public ApiResponse resetTunerWithHttpInfo(@org.eclipse.jdt.annotation.Null } } - private HttpRequest.Builder resetTunerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String tunerId) - throws ApiException { + private HttpRequest.Builder resetTunerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String tunerId, + Map headers) throws ApiException { // verify the required parameter 'tunerId' is set if (tunerId == null) { throw new ApiException(400, "Missing the required parameter 'tunerId' when calling resetTuner"); @@ -4013,6 +5581,8 @@ private HttpRequest.Builder resetTunerRequestBuilder(@org.eclipse.jdt.annotation if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -4028,7 +5598,22 @@ private HttpRequest.Builder resetTunerRequestBuilder(@org.eclipse.jdt.annotation */ public TunerChannelMapping setChannelMapping( @org.eclipse.jdt.annotation.Nullable SetChannelMappingDto setChannelMappingDto) throws ApiException { - ApiResponse localVarResponse = setChannelMappingWithHttpInfo(setChannelMappingDto); + return setChannelMapping(setChannelMappingDto, null); + } + + /** + * Set channel mappings. + * + * @param setChannelMappingDto The set channel mapping dto. (required) + * @param headers Optional headers to include in the request + * @return TunerChannelMapping + * @throws ApiException if fails to make API call + */ + public TunerChannelMapping setChannelMapping( + @org.eclipse.jdt.annotation.Nullable SetChannelMappingDto setChannelMappingDto, Map headers) + throws ApiException { + ApiResponse localVarResponse = setChannelMappingWithHttpInfo(setChannelMappingDto, + headers); return localVarResponse.getData(); } @@ -4041,7 +5626,21 @@ public TunerChannelMapping setChannelMapping( */ public ApiResponse setChannelMappingWithHttpInfo( @org.eclipse.jdt.annotation.Nullable SetChannelMappingDto setChannelMappingDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = setChannelMappingRequestBuilder(setChannelMappingDto); + return setChannelMappingWithHttpInfo(setChannelMappingDto, null); + } + + /** + * Set channel mappings. + * + * @param setChannelMappingDto The set channel mapping dto. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<TunerChannelMapping> + * @throws ApiException if fails to make API call + */ + public ApiResponse setChannelMappingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SetChannelMappingDto setChannelMappingDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = setChannelMappingRequestBuilder(setChannelMappingDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -4058,14 +5657,14 @@ public ApiResponse setChannelMappingWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + TunerChannelMapping responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -4077,7 +5676,8 @@ public ApiResponse setChannelMappingWithHttpInfo( } private HttpRequest.Builder setChannelMappingRequestBuilder( - @org.eclipse.jdt.annotation.Nullable SetChannelMappingDto setChannelMappingDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable SetChannelMappingDto setChannelMappingDto, Map headers) + throws ApiException { // verify the required parameter 'setChannelMappingDto' is set if (setChannelMappingDto == null) { throw new ApiException(400, @@ -4103,6 +5703,8 @@ private HttpRequest.Builder setChannelMappingRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -4118,7 +5720,21 @@ private HttpRequest.Builder setChannelMappingRequestBuilder( */ public void updateSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerId, @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto) throws ApiException { - updateSeriesTimerWithHttpInfo(timerId, seriesTimerInfoDto); + updateSeriesTimer(timerId, seriesTimerInfoDto, null); + } + + /** + * Updates a live tv series timer. + * + * @param timerId Timer id. (required) + * @param seriesTimerInfoDto New series timer info. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto, Map headers) + throws ApiException { + updateSeriesTimerWithHttpInfo(timerId, seriesTimerInfoDto, headers); } /** @@ -4131,7 +5747,23 @@ public void updateSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerI */ public ApiResponse updateSeriesTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId, @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateSeriesTimerRequestBuilder(timerId, seriesTimerInfoDto); + return updateSeriesTimerWithHttpInfo(timerId, seriesTimerInfoDto, null); + } + + /** + * Updates a live tv series timer. + * + * @param timerId Timer id. (required) + * @param seriesTimerInfoDto New series timer info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateSeriesTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateSeriesTimerRequestBuilder(timerId, seriesTimerInfoDto, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -4159,7 +5791,8 @@ public ApiResponse updateSeriesTimerWithHttpInfo(@org.eclipse.jdt.annotati } private HttpRequest.Builder updateSeriesTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId, - @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto) throws ApiException { + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto, Map headers) + throws ApiException { // verify the required parameter 'timerId' is set if (timerId == null) { throw new ApiException(400, "Missing the required parameter 'timerId' when calling updateSeriesTimer"); @@ -4184,6 +5817,8 @@ private HttpRequest.Builder updateSeriesTimerRequestBuilder(@org.eclipse.jdt.ann if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -4199,7 +5834,21 @@ private HttpRequest.Builder updateSeriesTimerRequestBuilder(@org.eclipse.jdt.ann */ public void updateTimer(@org.eclipse.jdt.annotation.Nullable String timerId, @org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto) throws ApiException { - updateTimerWithHttpInfo(timerId, timerInfoDto); + updateTimer(timerId, timerInfoDto, null); + } + + /** + * Updates a live tv timer. + * + * @param timerId Timer id. (required) + * @param timerInfoDto New timer info. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateTimer(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto, Map headers) + throws ApiException { + updateTimerWithHttpInfo(timerId, timerInfoDto, headers); } /** @@ -4212,7 +5861,22 @@ public void updateTimer(@org.eclipse.jdt.annotation.Nullable String timerId, */ public ApiResponse updateTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId, @org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateTimerRequestBuilder(timerId, timerInfoDto); + return updateTimerWithHttpInfo(timerId, timerInfoDto, null); + } + + /** + * Updates a live tv timer. + * + * @param timerId Timer id. (required) + * @param timerInfoDto New timer info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateTimerRequestBuilder(timerId, timerInfoDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -4240,7 +5904,8 @@ public ApiResponse updateTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nul } private HttpRequest.Builder updateTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId, - @org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto) throws ApiException { + @org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto, Map headers) + throws ApiException { // verify the required parameter 'timerId' is set if (timerId == null) { throw new ApiException(400, "Missing the required parameter 'timerId' when calling updateTimer"); @@ -4264,6 +5929,8 @@ private HttpRequest.Builder updateTimerRequestBuilder(@org.eclipse.jdt.annotatio if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LocalizationApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LocalizationApi.java index e3c56bb0ab51e..9ddde08243ca7 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LocalizationApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LocalizationApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -20,6 +21,7 @@ import java.net.http.HttpResponse; import java.time.Duration; import java.util.List; +import java.util.Map; import java.util.function.Consumer; import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; @@ -36,6 +38,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class LocalizationApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -71,6 +95,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets known countries. * @@ -78,7 +152,18 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public List getCountries() throws ApiException { - ApiResponse> localVarResponse = getCountriesWithHttpInfo(); + return getCountries(null); + } + + /** + * Gets known countries. + * + * @param headers Optional headers to include in the request + * @return List<CountryInfo> + * @throws ApiException if fails to make API call + */ + public List getCountries(Map headers) throws ApiException { + ApiResponse> localVarResponse = getCountriesWithHttpInfo(headers); return localVarResponse.getData(); } @@ -89,7 +174,18 @@ public List getCountries() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getCountriesWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getCountriesRequestBuilder(); + return getCountriesWithHttpInfo(null); + } + + /** + * Gets known countries. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<CountryInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getCountriesWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getCountriesRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -106,12 +202,14 @@ public ApiResponse> getCountriesWithHttpInfo() throws ApiExcep } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -122,7 +220,7 @@ public ApiResponse> getCountriesWithHttpInfo() throws ApiExcep } } - private HttpRequest.Builder getCountriesRequestBuilder() throws ApiException { + private HttpRequest.Builder getCountriesRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -137,6 +235,8 @@ private HttpRequest.Builder getCountriesRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -150,7 +250,18 @@ private HttpRequest.Builder getCountriesRequestBuilder() throws ApiException { * @throws ApiException if fails to make API call */ public List getCultures() throws ApiException { - ApiResponse> localVarResponse = getCulturesWithHttpInfo(); + return getCultures(null); + } + + /** + * Gets known cultures. + * + * @param headers Optional headers to include in the request + * @return List<CultureDto> + * @throws ApiException if fails to make API call + */ + public List getCultures(Map headers) throws ApiException { + ApiResponse> localVarResponse = getCulturesWithHttpInfo(headers); return localVarResponse.getData(); } @@ -161,7 +272,18 @@ public List getCultures() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getCulturesWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getCulturesRequestBuilder(); + return getCulturesWithHttpInfo(null); + } + + /** + * Gets known cultures. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<CultureDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getCulturesWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getCulturesRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -178,12 +300,14 @@ public ApiResponse> getCulturesWithHttpInfo() throws ApiExcepti } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -194,7 +318,7 @@ public ApiResponse> getCulturesWithHttpInfo() throws ApiExcepti } } - private HttpRequest.Builder getCulturesRequestBuilder() throws ApiException { + private HttpRequest.Builder getCulturesRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -209,6 +333,8 @@ private HttpRequest.Builder getCulturesRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -222,7 +348,18 @@ private HttpRequest.Builder getCulturesRequestBuilder() throws ApiException { * @throws ApiException if fails to make API call */ public List getLocalizationOptions() throws ApiException { - ApiResponse> localVarResponse = getLocalizationOptionsWithHttpInfo(); + return getLocalizationOptions(null); + } + + /** + * Gets localization options. + * + * @param headers Optional headers to include in the request + * @return List<LocalizationOption> + * @throws ApiException if fails to make API call + */ + public List getLocalizationOptions(Map headers) throws ApiException { + ApiResponse> localVarResponse = getLocalizationOptionsWithHttpInfo(headers); return localVarResponse.getData(); } @@ -233,7 +370,19 @@ public List getLocalizationOptions() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getLocalizationOptionsWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getLocalizationOptionsRequestBuilder(); + return getLocalizationOptionsWithHttpInfo(null); + } + + /** + * Gets localization options. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<LocalizationOption>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getLocalizationOptionsWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLocalizationOptionsRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -250,14 +399,14 @@ public ApiResponse> getLocalizationOptionsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -268,7 +417,7 @@ public ApiResponse> getLocalizationOptionsWithHttpInfo( } } - private HttpRequest.Builder getLocalizationOptionsRequestBuilder() throws ApiException { + private HttpRequest.Builder getLocalizationOptionsRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -283,6 +432,8 @@ private HttpRequest.Builder getLocalizationOptionsRequestBuilder() throws ApiExc if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -296,7 +447,18 @@ private HttpRequest.Builder getLocalizationOptionsRequestBuilder() throws ApiExc * @throws ApiException if fails to make API call */ public List getParentalRatings() throws ApiException { - ApiResponse> localVarResponse = getParentalRatingsWithHttpInfo(); + return getParentalRatings(null); + } + + /** + * Gets known parental ratings. + * + * @param headers Optional headers to include in the request + * @return List<ParentalRating> + * @throws ApiException if fails to make API call + */ + public List getParentalRatings(Map headers) throws ApiException { + ApiResponse> localVarResponse = getParentalRatingsWithHttpInfo(headers); return localVarResponse.getData(); } @@ -307,7 +469,19 @@ public List getParentalRatings() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getParentalRatingsWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getParentalRatingsRequestBuilder(); + return getParentalRatingsWithHttpInfo(null); + } + + /** + * Gets known parental ratings. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<ParentalRating>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getParentalRatingsWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getParentalRatingsRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -324,14 +498,14 @@ public ApiResponse> getParentalRatingsWithHttpInfo() throws } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -342,7 +516,7 @@ public ApiResponse> getParentalRatingsWithHttpInfo() throws } } - private HttpRequest.Builder getParentalRatingsRequestBuilder() throws ApiException { + private HttpRequest.Builder getParentalRatingsRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -357,6 +531,8 @@ private HttpRequest.Builder getParentalRatingsRequestBuilder() throws ApiExcepti if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LyricsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LyricsApi.java index a34c779857004..ff02fbff65fb4 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LyricsApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/LyricsApi.java @@ -22,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -39,6 +40,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class LyricsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -74,6 +97,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Deletes an external lyric file. * @@ -81,7 +154,19 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public void deleteLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - deleteLyricsWithHttpInfo(itemId); + deleteLyrics(itemId, null); + } + + /** + * Deletes an external lyric file. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) + throws ApiException { + deleteLyricsWithHttpInfo(itemId, headers); } /** @@ -93,7 +178,20 @@ public void deleteLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId) throw */ public ApiResponse deleteLyricsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteLyricsRequestBuilder(itemId); + return deleteLyricsWithHttpInfo(itemId, null); + } + + /** + * Deletes an external lyric file. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteLyricsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteLyricsRequestBuilder(itemId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -120,8 +218,8 @@ public ApiResponse deleteLyricsWithHttpInfo(@org.eclipse.jdt.annotation.Nu } } - private HttpRequest.Builder deleteLyricsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) - throws ApiException { + private HttpRequest.Builder deleteLyricsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteLyrics"); @@ -140,6 +238,8 @@ private HttpRequest.Builder deleteLyricsRequestBuilder(@org.eclipse.jdt.annotati if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -156,7 +256,21 @@ private HttpRequest.Builder deleteLyricsRequestBuilder(@org.eclipse.jdt.annotati */ public LyricDto downloadRemoteLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String lyricId) throws ApiException { - ApiResponse localVarResponse = downloadRemoteLyricsWithHttpInfo(itemId, lyricId); + return downloadRemoteLyrics(itemId, lyricId, null); + } + + /** + * Downloads a remote lyric. + * + * @param itemId The item id. (required) + * @param lyricId The lyric id. (required) + * @param headers Optional headers to include in the request + * @return LyricDto + * @throws ApiException if fails to make API call + */ + public LyricDto downloadRemoteLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String lyricId, Map headers) throws ApiException { + ApiResponse localVarResponse = downloadRemoteLyricsWithHttpInfo(itemId, lyricId, headers); return localVarResponse.getData(); } @@ -170,7 +284,21 @@ public LyricDto downloadRemoteLyrics(@org.eclipse.jdt.annotation.Nullable UUID i */ public ApiResponse downloadRemoteLyricsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String lyricId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = downloadRemoteLyricsRequestBuilder(itemId, lyricId); + return downloadRemoteLyricsWithHttpInfo(itemId, lyricId, null); + } + + /** + * Downloads a remote lyric. + * + * @param itemId The item id. (required) + * @param lyricId The lyric id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<LyricDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse downloadRemoteLyricsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String lyricId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = downloadRemoteLyricsRequestBuilder(itemId, lyricId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -187,12 +315,14 @@ public ApiResponse downloadRemoteLyricsWithHttpInfo(@org.eclipse.jdt.a } String responseBody = new String(localVarResponse.body().readAllBytes()); + LyricDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -204,7 +334,7 @@ public ApiResponse downloadRemoteLyricsWithHttpInfo(@org.eclipse.jdt.a } private HttpRequest.Builder downloadRemoteLyricsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.Nullable String lyricId) throws ApiException { + @org.eclipse.jdt.annotation.Nullable String lyricId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling downloadRemoteLyrics"); @@ -229,6 +359,8 @@ private HttpRequest.Builder downloadRemoteLyricsRequestBuilder(@org.eclipse.jdt. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -243,7 +375,20 @@ private HttpRequest.Builder downloadRemoteLyricsRequestBuilder(@org.eclipse.jdt. * @throws ApiException if fails to make API call */ public LyricDto getLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - ApiResponse localVarResponse = getLyricsWithHttpInfo(itemId); + return getLyrics(itemId, null); + } + + /** + * Gets an item's lyrics. + * + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return LyricDto + * @throws ApiException if fails to make API call + */ + public LyricDto getLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getLyricsWithHttpInfo(itemId, headers); return localVarResponse.getData(); } @@ -256,7 +401,20 @@ public LyricDto getLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId) thro */ public ApiResponse getLyricsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getLyricsRequestBuilder(itemId); + return getLyricsWithHttpInfo(itemId, null); + } + + /** + * Gets an item's lyrics. + * + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<LyricDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLyricsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLyricsRequestBuilder(itemId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -273,12 +431,14 @@ public ApiResponse getLyricsWithHttpInfo(@org.eclipse.jdt.annotation.N } String responseBody = new String(localVarResponse.body().readAllBytes()); + LyricDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -289,8 +449,8 @@ public ApiResponse getLyricsWithHttpInfo(@org.eclipse.jdt.annotation.N } } - private HttpRequest.Builder getLyricsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) - throws ApiException { + private HttpRequest.Builder getLyricsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getLyrics"); @@ -309,6 +469,8 @@ private HttpRequest.Builder getLyricsRequestBuilder(@org.eclipse.jdt.annotation. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -323,7 +485,20 @@ private HttpRequest.Builder getLyricsRequestBuilder(@org.eclipse.jdt.annotation. * @throws ApiException if fails to make API call */ public LyricDto getRemoteLyrics(@org.eclipse.jdt.annotation.Nullable String lyricId) throws ApiException { - ApiResponse localVarResponse = getRemoteLyricsWithHttpInfo(lyricId); + return getRemoteLyrics(lyricId, null); + } + + /** + * Gets the remote lyrics. + * + * @param lyricId The remote provider item id. (required) + * @param headers Optional headers to include in the request + * @return LyricDto + * @throws ApiException if fails to make API call + */ + public LyricDto getRemoteLyrics(@org.eclipse.jdt.annotation.Nullable String lyricId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getRemoteLyricsWithHttpInfo(lyricId, headers); return localVarResponse.getData(); } @@ -336,7 +511,20 @@ public LyricDto getRemoteLyrics(@org.eclipse.jdt.annotation.Nullable String lyri */ public ApiResponse getRemoteLyricsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String lyricId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getRemoteLyricsRequestBuilder(lyricId); + return getRemoteLyricsWithHttpInfo(lyricId, null); + } + + /** + * Gets the remote lyrics. + * + * @param lyricId The remote provider item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<LyricDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRemoteLyricsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String lyricId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRemoteLyricsRequestBuilder(lyricId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -353,12 +541,14 @@ public ApiResponse getRemoteLyricsWithHttpInfo(@org.eclipse.jdt.annota } String responseBody = new String(localVarResponse.body().readAllBytes()); + LyricDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -369,8 +559,8 @@ public ApiResponse getRemoteLyricsWithHttpInfo(@org.eclipse.jdt.annota } } - private HttpRequest.Builder getRemoteLyricsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String lyricId) - throws ApiException { + private HttpRequest.Builder getRemoteLyricsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String lyricId, + Map headers) throws ApiException { // verify the required parameter 'lyricId' is set if (lyricId == null) { throw new ApiException(400, "Missing the required parameter 'lyricId' when calling getRemoteLyrics"); @@ -390,6 +580,8 @@ private HttpRequest.Builder getRemoteLyricsRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -405,7 +597,20 @@ private HttpRequest.Builder getRemoteLyricsRequestBuilder(@org.eclipse.jdt.annot */ public List searchRemoteLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - ApiResponse> localVarResponse = searchRemoteLyricsWithHttpInfo(itemId); + return searchRemoteLyrics(itemId, null); + } + + /** + * Search remote lyrics. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteLyricInfoDto> + * @throws ApiException if fails to make API call + */ + public List searchRemoteLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + ApiResponse> localVarResponse = searchRemoteLyricsWithHttpInfo(itemId, headers); return localVarResponse.getData(); } @@ -418,7 +623,20 @@ public List searchRemoteLyrics(@org.eclipse.jdt.annotation.N */ public ApiResponse> searchRemoteLyricsWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = searchRemoteLyricsRequestBuilder(itemId); + return searchRemoteLyricsWithHttpInfo(itemId, null); + } + + /** + * Search remote lyrics. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteLyricInfoDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> searchRemoteLyricsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = searchRemoteLyricsRequestBuilder(itemId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -435,14 +653,14 @@ public ApiResponse> searchRemoteLyricsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -453,8 +671,8 @@ public ApiResponse> searchRemoteLyricsWithHttpInfo( } } - private HttpRequest.Builder searchRemoteLyricsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) - throws ApiException { + private HttpRequest.Builder searchRemoteLyricsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling searchRemoteLyrics"); @@ -474,6 +692,8 @@ private HttpRequest.Builder searchRemoteLyricsRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -492,7 +712,23 @@ private HttpRequest.Builder searchRemoteLyricsRequestBuilder(@org.eclipse.jdt.an public LyricDto uploadLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String fileName, @org.eclipse.jdt.annotation.NonNull File body) throws ApiException { - ApiResponse localVarResponse = uploadLyricsWithHttpInfo(itemId, fileName, body); + return uploadLyrics(itemId, fileName, body, null); + } + + /** + * Upload an external lyric file. + * + * @param itemId The item the lyric belongs to. (required) + * @param fileName Name of the file being uploaded. (required) + * @param body (optional) + * @param headers Optional headers to include in the request + * @return LyricDto + * @throws ApiException if fails to make API call + */ + public LyricDto uploadLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String fileName, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + ApiResponse localVarResponse = uploadLyricsWithHttpInfo(itemId, fileName, body, headers); return localVarResponse.getData(); } @@ -508,7 +744,23 @@ public LyricDto uploadLyrics(@org.eclipse.jdt.annotation.Nullable UUID itemId, public ApiResponse uploadLyricsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String fileName, @org.eclipse.jdt.annotation.NonNull File body) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = uploadLyricsRequestBuilder(itemId, fileName, body); + return uploadLyricsWithHttpInfo(itemId, fileName, body, null); + } + + /** + * Upload an external lyric file. + * + * @param itemId The item the lyric belongs to. (required) + * @param fileName Name of the file being uploaded. (required) + * @param body (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<LyricDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse uploadLyricsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String fileName, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uploadLyricsRequestBuilder(itemId, fileName, body, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -525,12 +777,14 @@ public ApiResponse uploadLyricsWithHttpInfo(@org.eclipse.jdt.annotatio } String responseBody = new String(localVarResponse.body().readAllBytes()); + LyricDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -542,8 +796,8 @@ public ApiResponse uploadLyricsWithHttpInfo(@org.eclipse.jdt.annotatio } private HttpRequest.Builder uploadLyricsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.Nullable String fileName, @org.eclipse.jdt.annotation.NonNull File body) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable String fileName, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling uploadLyrics"); @@ -587,6 +841,8 @@ private HttpRequest.Builder uploadLyricsRequestBuilder(@org.eclipse.jdt.annotati if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MediaInfoApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MediaInfoApi.java index ccaf84d58fed3..6534bcfcb1c1f 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MediaInfoApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MediaInfoApi.java @@ -22,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -41,6 +42,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class MediaInfoApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -76,6 +99,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Closes a media source. * @@ -83,7 +156,19 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public void closeLiveStream(@org.eclipse.jdt.annotation.Nullable String liveStreamId) throws ApiException { - closeLiveStreamWithHttpInfo(liveStreamId); + closeLiveStream(liveStreamId, null); + } + + /** + * Closes a media source. + * + * @param liveStreamId The livestream id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void closeLiveStream(@org.eclipse.jdt.annotation.Nullable String liveStreamId, Map headers) + throws ApiException { + closeLiveStreamWithHttpInfo(liveStreamId, headers); } /** @@ -95,7 +180,20 @@ public void closeLiveStream(@org.eclipse.jdt.annotation.Nullable String liveStre */ public ApiResponse closeLiveStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String liveStreamId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = closeLiveStreamRequestBuilder(liveStreamId); + return closeLiveStreamWithHttpInfo(liveStreamId, null); + } + + /** + * Closes a media source. + * + * @param liveStreamId The livestream id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse closeLiveStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String liveStreamId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = closeLiveStreamRequestBuilder(liveStreamId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -122,8 +220,8 @@ public ApiResponse closeLiveStreamWithHttpInfo(@org.eclipse.jdt.annotation } } - private HttpRequest.Builder closeLiveStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable String liveStreamId) - throws ApiException { + private HttpRequest.Builder closeLiveStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable String liveStreamId, + Map headers) throws ApiException { // verify the required parameter 'liveStreamId' is set if (liveStreamId == null) { throw new ApiException(400, "Missing the required parameter 'liveStreamId' when calling closeLiveStream"); @@ -156,6 +254,8 @@ private HttpRequest.Builder closeLiveStreamRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -170,7 +270,20 @@ private HttpRequest.Builder closeLiveStreamRequestBuilder(@org.eclipse.jdt.annot * @throws ApiException if fails to make API call */ public File getBitrateTestBytes(@org.eclipse.jdt.annotation.NonNull Integer size) throws ApiException { - ApiResponse localVarResponse = getBitrateTestBytesWithHttpInfo(size); + return getBitrateTestBytes(size, null); + } + + /** + * Tests the network with a request with the size of the bitrate. + * + * @param size The bitrate. Defaults to 102400. (optional, default to 102400) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getBitrateTestBytes(@org.eclipse.jdt.annotation.NonNull Integer size, Map headers) + throws ApiException { + ApiResponse localVarResponse = getBitrateTestBytesWithHttpInfo(size, headers); return localVarResponse.getData(); } @@ -183,7 +296,20 @@ public File getBitrateTestBytes(@org.eclipse.jdt.annotation.NonNull Integer size */ public ApiResponse getBitrateTestBytesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Integer size) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getBitrateTestBytesRequestBuilder(size); + return getBitrateTestBytesWithHttpInfo(size, null); + } + + /** + * Tests the network with a request with the size of the bitrate. + * + * @param size The bitrate. Defaults to 102400. (optional, default to 102400) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getBitrateTestBytesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Integer size, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBitrateTestBytesRequestBuilder(size, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -198,13 +324,13 @@ public ApiResponse getBitrateTestBytesWithHttpInfo(@org.eclipse.jdt.annota return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -215,8 +341,8 @@ public ApiResponse getBitrateTestBytesWithHttpInfo(@org.eclipse.jdt.annota } } - private HttpRequest.Builder getBitrateTestBytesRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer size) - throws ApiException { + private HttpRequest.Builder getBitrateTestBytesRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer size, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -245,6 +371,8 @@ private HttpRequest.Builder getBitrateTestBytesRequestBuilder(@org.eclipse.jdt.a if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -261,7 +389,21 @@ private HttpRequest.Builder getBitrateTestBytesRequestBuilder(@org.eclipse.jdt.a */ public PlaybackInfoResponse getPlaybackInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getPlaybackInfoWithHttpInfo(itemId, userId); + return getPlaybackInfo(itemId, userId, null); + } + + /** + * Gets live playback media info for an item. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @param headers Optional headers to include in the request + * @return PlaybackInfoResponse + * @throws ApiException if fails to make API call + */ + public PlaybackInfoResponse getPlaybackInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getPlaybackInfoWithHttpInfo(itemId, userId, headers); return localVarResponse.getData(); } @@ -276,7 +418,22 @@ public PlaybackInfoResponse getPlaybackInfo(@org.eclipse.jdt.annotation.Nullable public ApiResponse getPlaybackInfoWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPlaybackInfoRequestBuilder(itemId, userId); + return getPlaybackInfoWithHttpInfo(itemId, userId, null); + } + + /** + * Gets live playback media info for an item. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<PlaybackInfoResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPlaybackInfoWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPlaybackInfoRequestBuilder(itemId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -293,14 +450,14 @@ public ApiResponse getPlaybackInfoWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + PlaybackInfoResponse responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -312,7 +469,7 @@ public ApiResponse getPlaybackInfoWithHttpInfo( } private HttpRequest.Builder getPlaybackInfoRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getPlaybackInfo"); @@ -347,6 +504,8 @@ private HttpRequest.Builder getPlaybackInfoRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -393,10 +552,58 @@ public PlaybackInfoResponse getPostedPlaybackInfo(@org.eclipse.jdt.annotation.Nu @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, @org.eclipse.jdt.annotation.NonNull PlaybackInfoDto playbackInfoDto) throws ApiException { + return getPostedPlaybackInfo(itemId, userId, maxStreamingBitrate, startTimeTicks, audioStreamIndex, + subtitleStreamIndex, maxAudioChannels, mediaSourceId, liveStreamId, autoOpenLiveStream, + enableDirectPlay, enableDirectStream, enableTranscoding, allowVideoStreamCopy, allowAudioStreamCopy, + playbackInfoDto, null); + } + + /** + * Gets live playback media info for an item. + * For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query + * parameters are obsolete. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @param maxStreamingBitrate The maximum streaming bitrate. (optional) + * @param startTimeTicks The start time in ticks. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param maxAudioChannels The maximum number of audio channels. (optional) + * @param mediaSourceId The media source id. (optional) + * @param liveStreamId The livestream id. (optional) + * @param autoOpenLiveStream Whether to auto open the livestream. (optional) + * @param enableDirectPlay Whether to enable direct play. Default: true. (optional) + * @param enableDirectStream Whether to enable direct stream. Default: true. (optional) + * @param enableTranscoding Whether to enable transcoding. Default: true. (optional) + * @param allowVideoStreamCopy Whether to allow to copy the video stream. Default: true. (optional) + * @param allowAudioStreamCopy Whether to allow to copy the audio stream. Default: true. (optional) + * @param playbackInfoDto The playback info. (optional) + * @param headers Optional headers to include in the request + * @return PlaybackInfoResponse + * @throws ApiException if fails to make API call + */ + public PlaybackInfoResponse getPostedPlaybackInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean autoOpenLiveStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableTranscoding, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull PlaybackInfoDto playbackInfoDto, Map headers) + throws ApiException { ApiResponse localVarResponse = getPostedPlaybackInfoWithHttpInfo(itemId, userId, maxStreamingBitrate, startTimeTicks, audioStreamIndex, subtitleStreamIndex, maxAudioChannels, mediaSourceId, liveStreamId, autoOpenLiveStream, enableDirectPlay, enableDirectStream, - enableTranscoding, allowVideoStreamCopy, allowAudioStreamCopy, playbackInfoDto); + enableTranscoding, allowVideoStreamCopy, allowAudioStreamCopy, playbackInfoDto, headers); return localVarResponse.getData(); } @@ -440,10 +647,58 @@ public ApiResponse getPostedPlaybackInfoWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, @org.eclipse.jdt.annotation.NonNull PlaybackInfoDto playbackInfoDto) throws ApiException { + return getPostedPlaybackInfoWithHttpInfo(itemId, userId, maxStreamingBitrate, startTimeTicks, audioStreamIndex, + subtitleStreamIndex, maxAudioChannels, mediaSourceId, liveStreamId, autoOpenLiveStream, + enableDirectPlay, enableDirectStream, enableTranscoding, allowVideoStreamCopy, allowAudioStreamCopy, + playbackInfoDto, null); + } + + /** + * Gets live playback media info for an item. + * For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query + * parameters are obsolete. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @param maxStreamingBitrate The maximum streaming bitrate. (optional) + * @param startTimeTicks The start time in ticks. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param maxAudioChannels The maximum number of audio channels. (optional) + * @param mediaSourceId The media source id. (optional) + * @param liveStreamId The livestream id. (optional) + * @param autoOpenLiveStream Whether to auto open the livestream. (optional) + * @param enableDirectPlay Whether to enable direct play. Default: true. (optional) + * @param enableDirectStream Whether to enable direct stream. Default: true. (optional) + * @param enableTranscoding Whether to enable transcoding. Default: true. (optional) + * @param allowVideoStreamCopy Whether to allow to copy the video stream. Default: true. (optional) + * @param allowAudioStreamCopy Whether to allow to copy the audio stream. Default: true. (optional) + * @param playbackInfoDto The playback info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<PlaybackInfoResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPostedPlaybackInfoWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean autoOpenLiveStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableTranscoding, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull PlaybackInfoDto playbackInfoDto, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getPostedPlaybackInfoRequestBuilder(itemId, userId, maxStreamingBitrate, startTimeTicks, audioStreamIndex, subtitleStreamIndex, maxAudioChannels, mediaSourceId, liveStreamId, autoOpenLiveStream, enableDirectPlay, enableDirectStream, - enableTranscoding, allowVideoStreamCopy, allowAudioStreamCopy, playbackInfoDto); + enableTranscoding, allowVideoStreamCopy, allowAudioStreamCopy, playbackInfoDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -460,14 +715,14 @@ public ApiResponse getPostedPlaybackInfoWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + PlaybackInfoResponse responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -493,7 +748,8 @@ private HttpRequest.Builder getPostedPlaybackInfoRequestBuilder(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull Boolean enableTranscoding, @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, - @org.eclipse.jdt.annotation.NonNull PlaybackInfoDto playbackInfoDto) throws ApiException { + @org.eclipse.jdt.annotation.NonNull PlaybackInfoDto playbackInfoDto, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getPostedPlaybackInfo"); @@ -560,6 +816,8 @@ private HttpRequest.Builder getPostedPlaybackInfoRequestBuilder(@org.eclipse.jdt if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -597,9 +855,47 @@ public LiveStreamResponse openLiveStream(@org.eclipse.jdt.annotation.NonNull Str @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, @org.eclipse.jdt.annotation.NonNull OpenLiveStreamDto openLiveStreamDto) throws ApiException { + return openLiveStream(openToken, userId, playSessionId, maxStreamingBitrate, startTimeTicks, audioStreamIndex, + subtitleStreamIndex, maxAudioChannels, itemId, enableDirectPlay, enableDirectStream, + alwaysBurnInSubtitleWhenTranscoding, openLiveStreamDto, null); + } + + /** + * Opens a media source. + * + * @param openToken The open token. (optional) + * @param userId The user id. (optional) + * @param playSessionId The play session id. (optional) + * @param maxStreamingBitrate The maximum streaming bitrate. (optional) + * @param startTimeTicks The start time in ticks. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param maxAudioChannels The maximum number of audio channels. (optional) + * @param itemId The item id. (optional) + * @param enableDirectPlay Whether to enable direct play. Default: true. (optional) + * @param enableDirectStream Whether to enable direct stream. Default: true. (optional) + * @param alwaysBurnInSubtitleWhenTranscoding Always burn-in subtitle when transcoding. (optional) + * @param openLiveStreamDto The open live stream dto. (optional) + * @param headers Optional headers to include in the request + * @return LiveStreamResponse + * @throws ApiException if fails to make API call + */ + public LiveStreamResponse openLiveStream(@org.eclipse.jdt.annotation.NonNull String openToken, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + @org.eclipse.jdt.annotation.NonNull OpenLiveStreamDto openLiveStreamDto, Map headers) + throws ApiException { ApiResponse localVarResponse = openLiveStreamWithHttpInfo(openToken, userId, playSessionId, maxStreamingBitrate, startTimeTicks, audioStreamIndex, subtitleStreamIndex, maxAudioChannels, itemId, - enableDirectPlay, enableDirectStream, alwaysBurnInSubtitleWhenTranscoding, openLiveStreamDto); + enableDirectPlay, enableDirectStream, alwaysBurnInSubtitleWhenTranscoding, openLiveStreamDto, headers); return localVarResponse.getData(); } @@ -635,9 +931,48 @@ public ApiResponse openLiveStreamWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, @org.eclipse.jdt.annotation.NonNull OpenLiveStreamDto openLiveStreamDto) throws ApiException { + return openLiveStreamWithHttpInfo(openToken, userId, playSessionId, maxStreamingBitrate, startTimeTicks, + audioStreamIndex, subtitleStreamIndex, maxAudioChannels, itemId, enableDirectPlay, enableDirectStream, + alwaysBurnInSubtitleWhenTranscoding, openLiveStreamDto, null); + } + + /** + * Opens a media source. + * + * @param openToken The open token. (optional) + * @param userId The user id. (optional) + * @param playSessionId The play session id. (optional) + * @param maxStreamingBitrate The maximum streaming bitrate. (optional) + * @param startTimeTicks The start time in ticks. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param maxAudioChannels The maximum number of audio channels. (optional) + * @param itemId The item id. (optional) + * @param enableDirectPlay Whether to enable direct play. Default: true. (optional) + * @param enableDirectStream Whether to enable direct stream. Default: true. (optional) + * @param alwaysBurnInSubtitleWhenTranscoding Always burn-in subtitle when transcoding. (optional) + * @param openLiveStreamDto The open live stream dto. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<LiveStreamResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse openLiveStreamWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String openToken, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, + @org.eclipse.jdt.annotation.NonNull OpenLiveStreamDto openLiveStreamDto, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = openLiveStreamRequestBuilder(openToken, userId, playSessionId, maxStreamingBitrate, startTimeTicks, audioStreamIndex, subtitleStreamIndex, maxAudioChannels, itemId, - enableDirectPlay, enableDirectStream, alwaysBurnInSubtitleWhenTranscoding, openLiveStreamDto); + enableDirectPlay, enableDirectStream, alwaysBurnInSubtitleWhenTranscoding, openLiveStreamDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -654,14 +989,14 @@ public ApiResponse openLiveStreamWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + LiveStreamResponse responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -683,7 +1018,8 @@ private HttpRequest.Builder openLiveStreamRequestBuilder(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, @org.eclipse.jdt.annotation.NonNull Boolean alwaysBurnInSubtitleWhenTranscoding, - @org.eclipse.jdt.annotation.NonNull OpenLiveStreamDto openLiveStreamDto) throws ApiException { + @org.eclipse.jdt.annotation.NonNull OpenLiveStreamDto openLiveStreamDto, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -742,6 +1078,8 @@ private HttpRequest.Builder openLiveStreamRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MediaSegmentsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MediaSegmentsApi.java index ff7d3de5dde45..38c1bbe846371 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MediaSegmentsApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MediaSegmentsApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -38,6 +40,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class MediaSegmentsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -73,6 +97,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets all media segments based on an itemId. * @@ -83,8 +157,23 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public MediaSegmentDtoQueryResult getItemSegments(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull List includeSegmentTypes) throws ApiException { + return getItemSegments(itemId, includeSegmentTypes, null); + } + + /** + * Gets all media segments based on an itemId. + * + * @param itemId The ItemId. (required) + * @param includeSegmentTypes Optional filter of requested segment types. (optional) + * @param headers Optional headers to include in the request + * @return MediaSegmentDtoQueryResult + * @throws ApiException if fails to make API call + */ + public MediaSegmentDtoQueryResult getItemSegments(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List includeSegmentTypes, Map headers) + throws ApiException { ApiResponse localVarResponse = getItemSegmentsWithHttpInfo(itemId, - includeSegmentTypes); + includeSegmentTypes, headers); return localVarResponse.getData(); } @@ -99,7 +188,24 @@ public MediaSegmentDtoQueryResult getItemSegments(@org.eclipse.jdt.annotation.Nu public ApiResponse getItemSegmentsWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull List includeSegmentTypes) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getItemSegmentsRequestBuilder(itemId, includeSegmentTypes); + return getItemSegmentsWithHttpInfo(itemId, includeSegmentTypes, null); + } + + /** + * Gets all media segments based on an itemId. + * + * @param itemId The ItemId. (required) + * @param includeSegmentTypes Optional filter of requested segment types. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<MediaSegmentDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemSegmentsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List includeSegmentTypes, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemSegmentsRequestBuilder(itemId, includeSegmentTypes, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -116,14 +222,15 @@ public ApiResponse getItemSegmentsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + MediaSegmentDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -135,7 +242,8 @@ public ApiResponse getItemSegmentsWithHttpInfo( } private HttpRequest.Builder getItemSegmentsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull List includeSegmentTypes) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List includeSegmentTypes, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemSegments"); @@ -169,6 +277,8 @@ private HttpRequest.Builder getItemSegmentsRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MoviesApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MoviesApi.java index 5b0bef1d634ea..8ba46d276e8db 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MoviesApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MoviesApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -38,6 +40,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class MoviesApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -73,6 +97,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets movie recommendations. * @@ -90,8 +164,29 @@ public List getMovieRecommendations(@org.eclipse.jdt.annotati @org.eclipse.jdt.annotation.NonNull List fields, @org.eclipse.jdt.annotation.NonNull Integer categoryLimit, @org.eclipse.jdt.annotation.NonNull Integer itemLimit) throws ApiException { + return getMovieRecommendations(userId, parentId, fields, categoryLimit, itemLimit, null); + } + + /** + * Gets movie recommendations. + * + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. The fields to return. (optional) + * @param categoryLimit The max number of categories to return. (optional, default to 5) + * @param itemLimit The max number of items to return per category. (optional, default to 8) + * @param headers Optional headers to include in the request + * @return List<RecommendationDto> + * @throws ApiException if fails to make API call + */ + public List getMovieRecommendations(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer categoryLimit, + @org.eclipse.jdt.annotation.NonNull Integer itemLimit, Map headers) throws ApiException { ApiResponse> localVarResponse = getMovieRecommendationsWithHttpInfo(userId, parentId, - fields, categoryLimit, itemLimit); + fields, categoryLimit, itemLimit, headers); return localVarResponse.getData(); } @@ -112,8 +207,29 @@ public ApiResponse> getMovieRecommendationsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull List fields, @org.eclipse.jdt.annotation.NonNull Integer categoryLimit, @org.eclipse.jdt.annotation.NonNull Integer itemLimit) throws ApiException { + return getMovieRecommendationsWithHttpInfo(userId, parentId, fields, categoryLimit, itemLimit, null); + } + + /** + * Gets movie recommendations. + * + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. The fields to return. (optional) + * @param categoryLimit The max number of categories to return. (optional, default to 5) + * @param itemLimit The max number of items to return per category. (optional, default to 8) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RecommendationDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMovieRecommendationsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer categoryLimit, + @org.eclipse.jdt.annotation.NonNull Integer itemLimit, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getMovieRecommendationsRequestBuilder(userId, parentId, fields, - categoryLimit, itemLimit); + categoryLimit, itemLimit, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -130,14 +246,14 @@ public ApiResponse> getMovieRecommendationsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -152,7 +268,7 @@ private HttpRequest.Builder getMovieRecommendationsRequestBuilder(@org.eclipse.j @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull List fields, @org.eclipse.jdt.annotation.NonNull Integer categoryLimit, - @org.eclipse.jdt.annotation.NonNull Integer itemLimit) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer itemLimit, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -190,6 +306,8 @@ private HttpRequest.Builder getMovieRecommendationsRequestBuilder(@org.eclipse.j if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MusicGenresApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MusicGenresApi.java index d25b5082d3dd1..06207539471b6 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MusicGenresApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/MusicGenresApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -43,6 +45,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class MusicGenresApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -78,6 +102,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets a music genre, by name. * @@ -88,7 +162,21 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public BaseItemDto getMusicGenre(@org.eclipse.jdt.annotation.Nullable String genreName, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getMusicGenreWithHttpInfo(genreName, userId); + return getMusicGenre(genreName, userId, null); + } + + /** + * Gets a music genre, by name. + * + * @param genreName The genre name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getMusicGenre(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getMusicGenreWithHttpInfo(genreName, userId, headers); return localVarResponse.getData(); } @@ -102,7 +190,21 @@ public BaseItemDto getMusicGenre(@org.eclipse.jdt.annotation.Nullable String gen */ public ApiResponse getMusicGenreWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String genreName, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getMusicGenreRequestBuilder(genreName, userId); + return getMusicGenreWithHttpInfo(genreName, userId, null); + } + + /** + * Gets a music genre, by name. + * + * @param genreName The genre name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMusicGenreWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMusicGenreRequestBuilder(genreName, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -119,12 +221,14 @@ public ApiResponse getMusicGenreWithHttpInfo(@org.eclipse.jdt.annot } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -136,7 +240,7 @@ public ApiResponse getMusicGenreWithHttpInfo(@org.eclipse.jdt.annot } private HttpRequest.Builder getMusicGenreRequestBuilder(@org.eclipse.jdt.annotation.Nullable String genreName, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'genreName' is set if (genreName == null) { throw new ApiException(400, "Missing the required parameter 'genreName' when calling getMusicGenre"); @@ -171,6 +275,8 @@ private HttpRequest.Builder getMusicGenreRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -226,10 +332,66 @@ public BaseItemDtoQueryResult getMusicGenres(@org.eclipse.jdt.annotation.NonNull @org.eclipse.jdt.annotation.NonNull List sortOrder, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getMusicGenres(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, + isFavorite, imageTypeLimit, enableImageTypes, userId, nameStartsWithOrGreater, nameStartsWith, + nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount, null); + } + + /** + * Gets all music genres from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered in based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Optional. Include total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getMusicGenres(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { ApiResponse localVarResponse = getMusicGenresWithHttpInfo(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, isFavorite, imageTypeLimit, enableImageTypes, userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, - enableTotalRecordCount); + enableTotalRecordCount, headers); return localVarResponse.getData(); } @@ -282,10 +444,66 @@ public ApiResponse getMusicGenresWithHttpInfo( @org.eclipse.jdt.annotation.NonNull List sortOrder, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getMusicGenresWithHttpInfo(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, + includeItemTypes, isFavorite, imageTypeLimit, enableImageTypes, userId, nameStartsWithOrGreater, + nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount, null); + } + + /** + * Gets all music genres from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered in based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Optional. Include total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getMusicGenresWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getMusicGenresRequestBuilder(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, isFavorite, imageTypeLimit, enableImageTypes, userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, - enableTotalRecordCount); + enableTotalRecordCount, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -302,14 +520,14 @@ public ApiResponse getMusicGenresWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -336,7 +554,8 @@ private HttpRequest.Builder getMusicGenresRequestBuilder(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.NonNull List sortBy, @org.eclipse.jdt.annotation.NonNull List sortOrder, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, - @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -400,6 +619,8 @@ private HttpRequest.Builder getMusicGenresRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PackageApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PackageApi.java index 4ab4fcf0158ba..ce195e2a96f99 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PackageApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PackageApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -38,6 +40,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class PackageApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -73,6 +97,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Cancels a package installation. * @@ -80,7 +154,19 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public void cancelPackageInstallation(@org.eclipse.jdt.annotation.Nullable UUID packageId) throws ApiException { - cancelPackageInstallationWithHttpInfo(packageId); + cancelPackageInstallation(packageId, null); + } + + /** + * Cancels a package installation. + * + * @param packageId Installation Id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void cancelPackageInstallation(@org.eclipse.jdt.annotation.Nullable UUID packageId, + Map headers) throws ApiException { + cancelPackageInstallationWithHttpInfo(packageId, headers); } /** @@ -92,7 +178,20 @@ public void cancelPackageInstallation(@org.eclipse.jdt.annotation.Nullable UUID */ public ApiResponse cancelPackageInstallationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID packageId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = cancelPackageInstallationRequestBuilder(packageId); + return cancelPackageInstallationWithHttpInfo(packageId, null); + } + + /** + * Cancels a package installation. + * + * @param packageId Installation Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse cancelPackageInstallationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID packageId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = cancelPackageInstallationRequestBuilder(packageId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -120,7 +219,7 @@ public ApiResponse cancelPackageInstallationWithHttpInfo(@org.eclipse.jdt. } private HttpRequest.Builder cancelPackageInstallationRequestBuilder( - @org.eclipse.jdt.annotation.Nullable UUID packageId) throws ApiException { + @org.eclipse.jdt.annotation.Nullable UUID packageId, Map headers) throws ApiException { // verify the required parameter 'packageId' is set if (packageId == null) { throw new ApiException(400, @@ -140,6 +239,8 @@ private HttpRequest.Builder cancelPackageInstallationRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -156,7 +257,21 @@ private HttpRequest.Builder cancelPackageInstallationRequestBuilder( */ public PackageInfo getPackageInfo(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid) throws ApiException { - ApiResponse localVarResponse = getPackageInfoWithHttpInfo(name, assemblyGuid); + return getPackageInfo(name, assemblyGuid, null); + } + + /** + * Gets a package by name or assembly GUID. + * + * @param name The name of the package. (required) + * @param assemblyGuid The GUID of the associated assembly. (optional) + * @param headers Optional headers to include in the request + * @return PackageInfo + * @throws ApiException if fails to make API call + */ + public PackageInfo getPackageInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, Map headers) throws ApiException { + ApiResponse localVarResponse = getPackageInfoWithHttpInfo(name, assemblyGuid, headers); return localVarResponse.getData(); } @@ -170,7 +285,21 @@ public PackageInfo getPackageInfo(@org.eclipse.jdt.annotation.Nullable String na */ public ApiResponse getPackageInfoWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPackageInfoRequestBuilder(name, assemblyGuid); + return getPackageInfoWithHttpInfo(name, assemblyGuid, null); + } + + /** + * Gets a package by name or assembly GUID. + * + * @param name The name of the package. (required) + * @param assemblyGuid The GUID of the associated assembly. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<PackageInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPackageInfoWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPackageInfoRequestBuilder(name, assemblyGuid, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -187,12 +316,14 @@ public ApiResponse getPackageInfoWithHttpInfo(@org.eclipse.jdt.anno } String responseBody = new String(localVarResponse.body().readAllBytes()); + PackageInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -204,7 +335,7 @@ public ApiResponse getPackageInfoWithHttpInfo(@org.eclipse.jdt.anno } private HttpRequest.Builder getPackageInfoRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, - @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, Map headers) throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling getPackageInfo"); @@ -238,6 +369,8 @@ private HttpRequest.Builder getPackageInfoRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -251,7 +384,18 @@ private HttpRequest.Builder getPackageInfoRequestBuilder(@org.eclipse.jdt.annota * @throws ApiException if fails to make API call */ public List getPackages() throws ApiException { - ApiResponse> localVarResponse = getPackagesWithHttpInfo(); + return getPackages(null); + } + + /** + * Gets available packages. + * + * @param headers Optional headers to include in the request + * @return List<PackageInfo> + * @throws ApiException if fails to make API call + */ + public List getPackages(Map headers) throws ApiException { + ApiResponse> localVarResponse = getPackagesWithHttpInfo(headers); return localVarResponse.getData(); } @@ -262,7 +406,18 @@ public List getPackages() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getPackagesWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPackagesRequestBuilder(); + return getPackagesWithHttpInfo(null); + } + + /** + * Gets available packages. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<PackageInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPackagesWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPackagesRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -279,12 +434,14 @@ public ApiResponse> getPackagesWithHttpInfo() throws ApiExcept } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -295,7 +452,7 @@ public ApiResponse> getPackagesWithHttpInfo() throws ApiExcept } } - private HttpRequest.Builder getPackagesRequestBuilder() throws ApiException { + private HttpRequest.Builder getPackagesRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -310,6 +467,8 @@ private HttpRequest.Builder getPackagesRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -323,7 +482,18 @@ private HttpRequest.Builder getPackagesRequestBuilder() throws ApiException { * @throws ApiException if fails to make API call */ public List getRepositories() throws ApiException { - ApiResponse> localVarResponse = getRepositoriesWithHttpInfo(); + return getRepositories(null); + } + + /** + * Gets all package repositories. + * + * @param headers Optional headers to include in the request + * @return List<RepositoryInfo> + * @throws ApiException if fails to make API call + */ + public List getRepositories(Map headers) throws ApiException { + ApiResponse> localVarResponse = getRepositoriesWithHttpInfo(headers); return localVarResponse.getData(); } @@ -334,7 +504,19 @@ public List getRepositories() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getRepositoriesWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getRepositoriesRequestBuilder(); + return getRepositoriesWithHttpInfo(null); + } + + /** + * Gets all package repositories. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RepositoryInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getRepositoriesWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRepositoriesRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -351,14 +533,14 @@ public ApiResponse> getRepositoriesWithHttpInfo() throws Ap } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -369,7 +551,7 @@ public ApiResponse> getRepositoriesWithHttpInfo() throws Ap } } - private HttpRequest.Builder getRepositoriesRequestBuilder() throws ApiException { + private HttpRequest.Builder getRepositoriesRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -384,6 +566,8 @@ private HttpRequest.Builder getRepositoriesRequestBuilder() throws ApiException if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -402,7 +586,23 @@ private HttpRequest.Builder getRepositoriesRequestBuilder() throws ApiException public void installPackage(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, @org.eclipse.jdt.annotation.NonNull String version, @org.eclipse.jdt.annotation.NonNull String repositoryUrl) throws ApiException { - installPackageWithHttpInfo(name, assemblyGuid, version, repositoryUrl); + installPackage(name, assemblyGuid, version, repositoryUrl, null); + } + + /** + * Installs a package. + * + * @param name Package name. (required) + * @param assemblyGuid GUID of the associated assembly. (optional) + * @param version Optional version. Defaults to latest version. (optional) + * @param repositoryUrl Optional. Specify the repository to install from. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void installPackage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, @org.eclipse.jdt.annotation.NonNull String version, + @org.eclipse.jdt.annotation.NonNull String repositoryUrl, Map headers) throws ApiException { + installPackageWithHttpInfo(name, assemblyGuid, version, repositoryUrl, headers); } /** @@ -418,8 +618,25 @@ public void installPackage(@org.eclipse.jdt.annotation.Nullable String name, public ApiResponse installPackageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, @org.eclipse.jdt.annotation.NonNull String version, @org.eclipse.jdt.annotation.NonNull String repositoryUrl) throws ApiException { + return installPackageWithHttpInfo(name, assemblyGuid, version, repositoryUrl, null); + } + + /** + * Installs a package. + * + * @param name Package name. (required) + * @param assemblyGuid GUID of the associated assembly. (optional) + * @param version Optional version. Defaults to latest version. (optional) + * @param repositoryUrl Optional. Specify the repository to install from. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse installPackageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, @org.eclipse.jdt.annotation.NonNull String version, + @org.eclipse.jdt.annotation.NonNull String repositoryUrl, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = installPackageRequestBuilder(name, assemblyGuid, version, - repositoryUrl); + repositoryUrl, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -448,7 +665,7 @@ public ApiResponse installPackageWithHttpInfo(@org.eclipse.jdt.annotation. private HttpRequest.Builder installPackageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, @org.eclipse.jdt.annotation.NonNull String version, - @org.eclipse.jdt.annotation.NonNull String repositoryUrl) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String repositoryUrl, Map headers) throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling installPackage"); @@ -486,6 +703,8 @@ private HttpRequest.Builder installPackageRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -500,7 +719,19 @@ private HttpRequest.Builder installPackageRequestBuilder(@org.eclipse.jdt.annota */ public void setRepositories(@org.eclipse.jdt.annotation.Nullable List repositoryInfo) throws ApiException { - setRepositoriesWithHttpInfo(repositoryInfo); + setRepositories(repositoryInfo, null); + } + + /** + * Sets the enabled and existing package repositories. + * + * @param repositoryInfo The list of package repositories. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void setRepositories(@org.eclipse.jdt.annotation.Nullable List repositoryInfo, + Map headers) throws ApiException { + setRepositoriesWithHttpInfo(repositoryInfo, headers); } /** @@ -512,7 +743,21 @@ public void setRepositories(@org.eclipse.jdt.annotation.Nullable List setRepositoriesWithHttpInfo( @org.eclipse.jdt.annotation.Nullable List repositoryInfo) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = setRepositoriesRequestBuilder(repositoryInfo); + return setRepositoriesWithHttpInfo(repositoryInfo, null); + } + + /** + * Sets the enabled and existing package repositories. + * + * @param repositoryInfo The list of package repositories. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setRepositoriesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable List repositoryInfo, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = setRepositoriesRequestBuilder(repositoryInfo, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -540,7 +785,8 @@ public ApiResponse setRepositoriesWithHttpInfo( } private HttpRequest.Builder setRepositoriesRequestBuilder( - @org.eclipse.jdt.annotation.Nullable List repositoryInfo) throws ApiException { + @org.eclipse.jdt.annotation.Nullable List repositoryInfo, Map headers) + throws ApiException { // verify the required parameter 'repositoryInfo' is set if (repositoryInfo == null) { throw new ApiException(400, "Missing the required parameter 'repositoryInfo' when calling setRepositories"); @@ -564,6 +810,8 @@ private HttpRequest.Builder setRepositoriesRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PersonsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PersonsApi.java index f9d71feeb5729..7161fd2609b66 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PersonsApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PersonsApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -41,6 +43,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class PersonsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -76,6 +100,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Get person by name. * @@ -86,7 +160,21 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public BaseItemDto getPerson(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getPersonWithHttpInfo(name, userId); + return getPerson(name, userId, null); + } + + /** + * Get person by name. + * + * @param name Person name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getPerson(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getPersonWithHttpInfo(name, userId, headers); return localVarResponse.getData(); } @@ -100,7 +188,21 @@ public BaseItemDto getPerson(@org.eclipse.jdt.annotation.Nullable String name, */ public ApiResponse getPersonWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPersonRequestBuilder(name, userId); + return getPersonWithHttpInfo(name, userId, null); + } + + /** + * Get person by name. + * + * @param name Person name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPersonWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPersonRequestBuilder(name, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -117,12 +219,14 @@ public ApiResponse getPersonWithHttpInfo(@org.eclipse.jdt.annotatio } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -134,7 +238,7 @@ public ApiResponse getPersonWithHttpInfo(@org.eclipse.jdt.annotatio } private HttpRequest.Builder getPersonRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling getPerson"); @@ -168,6 +272,8 @@ private HttpRequest.Builder getPersonRequestBuilder(@org.eclipse.jdt.annotation. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -208,9 +314,48 @@ public BaseItemDtoQueryResult getPersons(@org.eclipse.jdt.annotation.NonNull Int @org.eclipse.jdt.annotation.NonNull List personTypes, @org.eclipse.jdt.annotation.NonNull UUID appearsInItemId, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getPersons(limit, searchTerm, fields, filters, isFavorite, enableUserData, imageTypeLimit, + enableImageTypes, excludePersonTypes, personTypes, appearsInItemId, userId, enableImages, null); + } + + /** + * Gets all persons. + * + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. userId is required. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param excludePersonTypes Optional. If specified results will be filtered to exclude those containing the + * specified PersonType. Allows multiple, comma-delimited. (optional) + * @param personTypes Optional. If specified results will be filtered to include only those containing the specified + * PersonType. Allows multiple, comma-delimited. (optional) + * @param appearsInItemId Optional. If specified, person results will be filtered on items related to said persons. + * (optional) + * @param userId User id. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getPersons(@org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludePersonTypes, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull UUID appearsInItemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { ApiResponse localVarResponse = getPersonsWithHttpInfo(limit, searchTerm, fields, filters, isFavorite, enableUserData, imageTypeLimit, enableImageTypes, excludePersonTypes, personTypes, - appearsInItemId, userId, enableImages); + appearsInItemId, userId, enableImages, headers); return localVarResponse.getData(); } @@ -248,9 +393,48 @@ public ApiResponse getPersonsWithHttpInfo(@org.eclipse.j @org.eclipse.jdt.annotation.NonNull List personTypes, @org.eclipse.jdt.annotation.NonNull UUID appearsInItemId, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getPersonsWithHttpInfo(limit, searchTerm, fields, filters, isFavorite, enableUserData, imageTypeLimit, + enableImageTypes, excludePersonTypes, personTypes, appearsInItemId, userId, enableImages, null); + } + + /** + * Gets all persons. + * + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. userId is required. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param excludePersonTypes Optional. If specified results will be filtered to exclude those containing the + * specified PersonType. Allows multiple, comma-delimited. (optional) + * @param personTypes Optional. If specified results will be filtered to include only those containing the specified + * PersonType. Allows multiple, comma-delimited. (optional) + * @param appearsInItemId Optional. If specified, person results will be filtered on items related to said persons. + * (optional) + * @param userId User id. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPersonsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludePersonTypes, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull UUID appearsInItemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getPersonsRequestBuilder(limit, searchTerm, fields, filters, isFavorite, enableUserData, imageTypeLimit, enableImageTypes, excludePersonTypes, personTypes, - appearsInItemId, userId, enableImages); + appearsInItemId, userId, enableImages, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -267,14 +451,14 @@ public ApiResponse getPersonsWithHttpInfo(@org.eclipse.j } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -296,7 +480,7 @@ private HttpRequest.Builder getPersonsRequestBuilder(@org.eclipse.jdt.annotation @org.eclipse.jdt.annotation.NonNull List excludePersonTypes, @org.eclipse.jdt.annotation.NonNull List personTypes, @org.eclipse.jdt.annotation.NonNull UUID appearsInItemId, @org.eclipse.jdt.annotation.NonNull UUID userId, - @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -350,6 +534,8 @@ private HttpRequest.Builder getPersonsRequestBuilder(@org.eclipse.jdt.annotation if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PlaylistsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PlaylistsApi.java index 5fa5b93afb308..9de200b483f00 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PlaylistsApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PlaylistsApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -46,6 +48,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class PlaylistsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -81,6 +105,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Adds items to a playlist. * @@ -92,7 +166,22 @@ private String formatExceptionMessage(String operationId, int statusCode, String public void addItemToPlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - addItemToPlaylistWithHttpInfo(playlistId, ids, userId); + addItemToPlaylist(playlistId, ids, userId, null); + } + + /** + * Adds items to a playlist. + * + * @param playlistId The playlist id. (required) + * @param ids Item id, comma delimited. (optional) + * @param userId The userId. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void addItemToPlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + addItemToPlaylistWithHttpInfo(playlistId, ids, userId, headers); } /** @@ -107,7 +196,23 @@ public void addItemToPlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlist public ApiResponse addItemToPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = addItemToPlaylistRequestBuilder(playlistId, ids, userId); + return addItemToPlaylistWithHttpInfo(playlistId, ids, userId, null); + } + + /** + * Adds items to a playlist. + * + * @param playlistId The playlist id. (required) + * @param ids Item id, comma delimited. (optional) + * @param userId The userId. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addItemToPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addItemToPlaylistRequestBuilder(playlistId, ids, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -135,8 +240,8 @@ public ApiResponse addItemToPlaylistWithHttpInfo(@org.eclipse.jdt.annotati } private HttpRequest.Builder addItemToPlaylistRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId, - @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId) - throws ApiException { + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { // verify the required parameter 'playlistId' is set if (playlistId == null) { throw new ApiException(400, "Missing the required parameter 'playlistId' when calling addItemToPlaylist"); @@ -173,6 +278,8 @@ private HttpRequest.Builder addItemToPlaylistRequestBuilder(@org.eclipse.jdt.ann if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -196,8 +303,30 @@ public PlaylistCreationResult createPlaylist(@org.eclipse.jdt.annotation.NonNull @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull MediaType mediaType, @org.eclipse.jdt.annotation.NonNull CreatePlaylistDto createPlaylistDto) throws ApiException { + return createPlaylist(name, ids, userId, mediaType, createPlaylistDto, null); + } + + /** + * Creates a new playlist. + * For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query + * parameters are obsolete. + * + * @param name The playlist name. (optional) + * @param ids The item ids. (optional) + * @param userId The user id. (optional) + * @param mediaType The media type. (optional) + * @param createPlaylistDto The create playlist payload. (optional) + * @param headers Optional headers to include in the request + * @return PlaylistCreationResult + * @throws ApiException if fails to make API call + */ + public PlaylistCreationResult createPlaylist(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull MediaType mediaType, + @org.eclipse.jdt.annotation.NonNull CreatePlaylistDto createPlaylistDto, Map headers) + throws ApiException { ApiResponse localVarResponse = createPlaylistWithHttpInfo(name, ids, userId, mediaType, - createPlaylistDto); + createPlaylistDto, headers); return localVarResponse.getData(); } @@ -218,8 +347,30 @@ public ApiResponse createPlaylistWithHttpInfo( @org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull MediaType mediaType, @org.eclipse.jdt.annotation.NonNull CreatePlaylistDto createPlaylistDto) throws ApiException { + return createPlaylistWithHttpInfo(name, ids, userId, mediaType, createPlaylistDto, null); + } + + /** + * Creates a new playlist. + * For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query + * parameters are obsolete. + * + * @param name The playlist name. (optional) + * @param ids The item ids. (optional) + * @param userId The user id. (optional) + * @param mediaType The media type. (optional) + * @param createPlaylistDto The create playlist payload. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<PlaylistCreationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse createPlaylistWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull MediaType mediaType, + @org.eclipse.jdt.annotation.NonNull CreatePlaylistDto createPlaylistDto, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = createPlaylistRequestBuilder(name, ids, userId, mediaType, - createPlaylistDto); + createPlaylistDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -236,14 +387,14 @@ public ApiResponse createPlaylistWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + PlaylistCreationResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -257,7 +408,8 @@ public ApiResponse createPlaylistWithHttpInfo( private HttpRequest.Builder createPlaylistRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull MediaType mediaType, - @org.eclipse.jdt.annotation.NonNull CreatePlaylistDto createPlaylistDto) throws ApiException { + @org.eclipse.jdt.annotation.NonNull CreatePlaylistDto createPlaylistDto, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -299,6 +451,8 @@ private HttpRequest.Builder createPlaylistRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -313,7 +467,20 @@ private HttpRequest.Builder createPlaylistRequestBuilder(@org.eclipse.jdt.annota * @throws ApiException if fails to make API call */ public PlaylistDto getPlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlistId) throws ApiException { - ApiResponse localVarResponse = getPlaylistWithHttpInfo(playlistId); + return getPlaylist(playlistId, null); + } + + /** + * Get a playlist. + * + * @param playlistId The playlist id. (required) + * @param headers Optional headers to include in the request + * @return PlaylistDto + * @throws ApiException if fails to make API call + */ + public PlaylistDto getPlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlistId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getPlaylistWithHttpInfo(playlistId, headers); return localVarResponse.getData(); } @@ -326,7 +493,20 @@ public PlaylistDto getPlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlis */ public ApiResponse getPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPlaylistRequestBuilder(playlistId); + return getPlaylistWithHttpInfo(playlistId, null); + } + + /** + * Get a playlist. + * + * @param playlistId The playlist id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<PlaylistDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPlaylistRequestBuilder(playlistId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -343,12 +523,14 @@ public ApiResponse getPlaylistWithHttpInfo(@org.eclipse.jdt.annotat } String responseBody = new String(localVarResponse.body().readAllBytes()); + PlaylistDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -359,8 +541,8 @@ public ApiResponse getPlaylistWithHttpInfo(@org.eclipse.jdt.annotat } } - private HttpRequest.Builder getPlaylistRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId) - throws ApiException { + private HttpRequest.Builder getPlaylistRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + Map headers) throws ApiException { // verify the required parameter 'playlistId' is set if (playlistId == null) { throw new ApiException(400, "Missing the required parameter 'playlistId' when calling getPlaylist"); @@ -380,6 +562,8 @@ private HttpRequest.Builder getPlaylistRequestBuilder(@org.eclipse.jdt.annotatio if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -410,8 +594,38 @@ public BaseItemDtoQueryResult getPlaylistItems(@org.eclipse.jdt.annotation.Nulla @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getPlaylistItems(playlistId, userId, startIndex, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Gets the original items of a playlist. + * + * @param playlistId The playlist id. (required) + * @param userId User id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getPlaylistItems(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { ApiResponse localVarResponse = getPlaylistItemsWithHttpInfo(playlistId, userId, - startIndex, limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + startIndex, limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); return localVarResponse.getData(); } @@ -439,8 +653,38 @@ public ApiResponse getPlaylistItemsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getPlaylistItemsWithHttpInfo(playlistId, userId, startIndex, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Gets the original items of a playlist. + * + * @param playlistId The playlist id. (required) + * @param userId User id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPlaylistItemsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getPlaylistItemsRequestBuilder(playlistId, userId, startIndex, - limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes); + limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -457,14 +701,14 @@ public ApiResponse getPlaylistItemsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -482,7 +726,8 @@ private HttpRequest.Builder getPlaylistItemsRequestBuilder(@org.eclipse.jdt.anno @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, - @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { // verify the required parameter 'playlistId' is set if (playlistId == null) { throw new ApiException(400, "Missing the required parameter 'playlistId' when calling getPlaylistItems"); @@ -531,6 +776,8 @@ private HttpRequest.Builder getPlaylistItemsRequestBuilder(@org.eclipse.jdt.anno if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -547,7 +794,22 @@ private HttpRequest.Builder getPlaylistItemsRequestBuilder(@org.eclipse.jdt.anno */ public PlaylistUserPermissions getPlaylistUser(@org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { - ApiResponse localVarResponse = getPlaylistUserWithHttpInfo(playlistId, userId); + return getPlaylistUser(playlistId, userId, null); + } + + /** + * Get a playlist user. + * + * @param playlistId The playlist id. (required) + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @return PlaylistUserPermissions + * @throws ApiException if fails to make API call + */ + public PlaylistUserPermissions getPlaylistUser(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getPlaylistUserWithHttpInfo(playlistId, userId, + headers); return localVarResponse.getData(); } @@ -562,7 +824,22 @@ public PlaylistUserPermissions getPlaylistUser(@org.eclipse.jdt.annotation.Nulla public ApiResponse getPlaylistUserWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPlaylistUserRequestBuilder(playlistId, userId); + return getPlaylistUserWithHttpInfo(playlistId, userId, null); + } + + /** + * Get a playlist user. + * + * @param playlistId The playlist id. (required) + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<PlaylistUserPermissions> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPlaylistUserWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPlaylistUserRequestBuilder(playlistId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -579,14 +856,14 @@ public ApiResponse getPlaylistUserWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + PlaylistUserPermissions responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -598,7 +875,7 @@ public ApiResponse getPlaylistUserWithHttpInfo( } private HttpRequest.Builder getPlaylistUserRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId, - @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { // verify the required parameter 'playlistId' is set if (playlistId == null) { throw new ApiException(400, "Missing the required parameter 'playlistId' when calling getPlaylistUser"); @@ -623,6 +900,8 @@ private HttpRequest.Builder getPlaylistUserRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -638,7 +917,20 @@ private HttpRequest.Builder getPlaylistUserRequestBuilder(@org.eclipse.jdt.annot */ public List getPlaylistUsers(@org.eclipse.jdt.annotation.Nullable UUID playlistId) throws ApiException { - ApiResponse> localVarResponse = getPlaylistUsersWithHttpInfo(playlistId); + return getPlaylistUsers(playlistId, null); + } + + /** + * Get a playlist's users. + * + * @param playlistId The playlist id. (required) + * @param headers Optional headers to include in the request + * @return List<PlaylistUserPermissions> + * @throws ApiException if fails to make API call + */ + public List getPlaylistUsers(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getPlaylistUsersWithHttpInfo(playlistId, headers); return localVarResponse.getData(); } @@ -651,7 +943,20 @@ public List getPlaylistUsers(@org.eclipse.jdt.annotatio */ public ApiResponse> getPlaylistUsersWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UUID playlistId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPlaylistUsersRequestBuilder(playlistId); + return getPlaylistUsersWithHttpInfo(playlistId, null); + } + + /** + * Get a playlist's users. + * + * @param playlistId The playlist id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<PlaylistUserPermissions>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPlaylistUsersWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID playlistId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPlaylistUsersRequestBuilder(playlistId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -668,14 +973,15 @@ public ApiResponse> getPlaylistUsersWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -686,8 +992,8 @@ public ApiResponse> getPlaylistUsersWithHttpInfo( } } - private HttpRequest.Builder getPlaylistUsersRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId) - throws ApiException { + private HttpRequest.Builder getPlaylistUsersRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + Map headers) throws ApiException { // verify the required parameter 'playlistId' is set if (playlistId == null) { throw new ApiException(400, "Missing the required parameter 'playlistId' when calling getPlaylistUsers"); @@ -707,6 +1013,8 @@ private HttpRequest.Builder getPlaylistUsersRequestBuilder(@org.eclipse.jdt.anno if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -724,7 +1032,22 @@ private HttpRequest.Builder getPlaylistUsersRequestBuilder(@org.eclipse.jdt.anno public void moveItem(@org.eclipse.jdt.annotation.Nullable String playlistId, @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable Integer newIndex) throws ApiException { - moveItemWithHttpInfo(playlistId, itemId, newIndex); + moveItem(playlistId, itemId, newIndex, null); + } + + /** + * Moves a playlist item. + * + * @param playlistId The playlist id. (required) + * @param itemId The item id. (required) + * @param newIndex The new index. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void moveItem(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable Integer newIndex, + Map headers) throws ApiException { + moveItemWithHttpInfo(playlistId, itemId, newIndex, headers); } /** @@ -739,7 +1062,23 @@ public void moveItem(@org.eclipse.jdt.annotation.Nullable String playlistId, public ApiResponse moveItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String playlistId, @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable Integer newIndex) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = moveItemRequestBuilder(playlistId, itemId, newIndex); + return moveItemWithHttpInfo(playlistId, itemId, newIndex, null); + } + + /** + * Moves a playlist item. + * + * @param playlistId The playlist id. (required) + * @param itemId The item id. (required) + * @param newIndex The new index. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse moveItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable Integer newIndex, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = moveItemRequestBuilder(playlistId, itemId, newIndex, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -767,8 +1106,8 @@ public ApiResponse moveItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullab } private HttpRequest.Builder moveItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable String playlistId, - @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable Integer newIndex) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable Integer newIndex, + Map headers) throws ApiException { // verify the required parameter 'playlistId' is set if (playlistId == null) { throw new ApiException(400, "Missing the required parameter 'playlistId' when calling moveItem"); @@ -798,6 +1137,8 @@ private HttpRequest.Builder moveItemRequestBuilder(@org.eclipse.jdt.annotation.N if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -813,7 +1154,21 @@ private HttpRequest.Builder moveItemRequestBuilder(@org.eclipse.jdt.annotation.N */ public void removeItemFromPlaylist(@org.eclipse.jdt.annotation.Nullable String playlistId, @org.eclipse.jdt.annotation.NonNull List entryIds) throws ApiException { - removeItemFromPlaylistWithHttpInfo(playlistId, entryIds); + removeItemFromPlaylist(playlistId, entryIds, null); + } + + /** + * Removes items from a playlist. + * + * @param playlistId The playlist id. (required) + * @param entryIds The item ids, comma delimited. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void removeItemFromPlaylist(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.NonNull List entryIds, Map headers) + throws ApiException { + removeItemFromPlaylistWithHttpInfo(playlistId, entryIds, headers); } /** @@ -826,7 +1181,23 @@ public void removeItemFromPlaylist(@org.eclipse.jdt.annotation.Nullable String p */ public ApiResponse removeItemFromPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String playlistId, @org.eclipse.jdt.annotation.NonNull List entryIds) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = removeItemFromPlaylistRequestBuilder(playlistId, entryIds); + return removeItemFromPlaylistWithHttpInfo(playlistId, entryIds, null); + } + + /** + * Removes items from a playlist. + * + * @param playlistId The playlist id. (required) + * @param entryIds The item ids, comma delimited. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeItemFromPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.NonNull List entryIds, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeItemFromPlaylistRequestBuilder(playlistId, entryIds, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -855,7 +1226,8 @@ public ApiResponse removeItemFromPlaylistWithHttpInfo(@org.eclipse.jdt.ann private HttpRequest.Builder removeItemFromPlaylistRequestBuilder( @org.eclipse.jdt.annotation.Nullable String playlistId, - @org.eclipse.jdt.annotation.NonNull List entryIds) throws ApiException { + @org.eclipse.jdt.annotation.NonNull List entryIds, Map headers) + throws ApiException { // verify the required parameter 'playlistId' is set if (playlistId == null) { throw new ApiException(400, @@ -891,6 +1263,8 @@ private HttpRequest.Builder removeItemFromPlaylistRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -906,7 +1280,20 @@ private HttpRequest.Builder removeItemFromPlaylistRequestBuilder( */ public void removeUserFromPlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { - removeUserFromPlaylistWithHttpInfo(playlistId, userId); + removeUserFromPlaylist(playlistId, userId, null); + } + + /** + * Remove a user from a playlist's users. + * + * @param playlistId The playlist id. (required) + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void removeUserFromPlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { + removeUserFromPlaylistWithHttpInfo(playlistId, userId, headers); } /** @@ -919,7 +1306,21 @@ public void removeUserFromPlaylist(@org.eclipse.jdt.annotation.Nullable UUID pla */ public ApiResponse removeUserFromPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = removeUserFromPlaylistRequestBuilder(playlistId, userId); + return removeUserFromPlaylistWithHttpInfo(playlistId, userId, null); + } + + /** + * Remove a user from a playlist's users. + * + * @param playlistId The playlist id. (required) + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeUserFromPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeUserFromPlaylistRequestBuilder(playlistId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -947,8 +1348,8 @@ public ApiResponse removeUserFromPlaylistWithHttpInfo(@org.eclipse.jdt.ann } private HttpRequest.Builder removeUserFromPlaylistRequestBuilder( - @org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.Nullable UUID userId) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { // verify the required parameter 'playlistId' is set if (playlistId == null) { throw new ApiException(400, @@ -974,6 +1375,8 @@ private HttpRequest.Builder removeUserFromPlaylistRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -989,7 +1392,21 @@ private HttpRequest.Builder removeUserFromPlaylistRequestBuilder( */ public void updatePlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.Nullable UpdatePlaylistDto updatePlaylistDto) throws ApiException { - updatePlaylistWithHttpInfo(playlistId, updatePlaylistDto); + updatePlaylist(playlistId, updatePlaylistDto, null); + } + + /** + * Updates a playlist. + * + * @param playlistId The playlist id. (required) + * @param updatePlaylistDto The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistDto id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updatePlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UpdatePlaylistDto updatePlaylistDto, Map headers) + throws ApiException { + updatePlaylistWithHttpInfo(playlistId, updatePlaylistDto, headers); } /** @@ -1002,7 +1419,23 @@ public void updatePlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlistId, */ public ApiResponse updatePlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.Nullable UpdatePlaylistDto updatePlaylistDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updatePlaylistRequestBuilder(playlistId, updatePlaylistDto); + return updatePlaylistWithHttpInfo(playlistId, updatePlaylistDto, null); + } + + /** + * Updates a playlist. + * + * @param playlistId The playlist id. (required) + * @param updatePlaylistDto The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistDto id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updatePlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UpdatePlaylistDto updatePlaylistDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updatePlaylistRequestBuilder(playlistId, updatePlaylistDto, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1030,7 +1463,8 @@ public ApiResponse updatePlaylistWithHttpInfo(@org.eclipse.jdt.annotation. } private HttpRequest.Builder updatePlaylistRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId, - @org.eclipse.jdt.annotation.Nullable UpdatePlaylistDto updatePlaylistDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable UpdatePlaylistDto updatePlaylistDto, Map headers) + throws ApiException { // verify the required parameter 'playlistId' is set if (playlistId == null) { throw new ApiException(400, "Missing the required parameter 'playlistId' when calling updatePlaylist"); @@ -1061,6 +1495,8 @@ private HttpRequest.Builder updatePlaylistRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1078,7 +1514,23 @@ private HttpRequest.Builder updatePlaylistRequestBuilder(@org.eclipse.jdt.annota public void updatePlaylistUser(@org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable UpdatePlaylistUserDto updatePlaylistUserDto) throws ApiException { - updatePlaylistUserWithHttpInfo(playlistId, userId, updatePlaylistUserDto); + updatePlaylistUser(playlistId, userId, updatePlaylistUserDto, null); + } + + /** + * Modify a user of a playlist's users. + * + * @param playlistId The playlist id. (required) + * @param userId The user id. (required) + * @param updatePlaylistUserDto The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistUserDto. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updatePlaylistUser(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UpdatePlaylistUserDto updatePlaylistUserDto, + Map headers) throws ApiException { + updatePlaylistUserWithHttpInfo(playlistId, userId, updatePlaylistUserDto, headers); } /** @@ -1093,8 +1545,25 @@ public void updatePlaylistUser(@org.eclipse.jdt.annotation.Nullable UUID playlis public ApiResponse updatePlaylistUserWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable UpdatePlaylistUserDto updatePlaylistUserDto) throws ApiException { + return updatePlaylistUserWithHttpInfo(playlistId, userId, updatePlaylistUserDto, null); + } + + /** + * Modify a user of a playlist's users. + * + * @param playlistId The playlist id. (required) + * @param userId The user id. (required) + * @param updatePlaylistUserDto The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistUserDto. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updatePlaylistUserWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UpdatePlaylistUserDto updatePlaylistUserDto, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = updatePlaylistUserRequestBuilder(playlistId, userId, - updatePlaylistUserDto); + updatePlaylistUserDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1123,7 +1592,8 @@ public ApiResponse updatePlaylistUserWithHttpInfo(@org.eclipse.jdt.annotat private HttpRequest.Builder updatePlaylistUserRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.Nullable UUID userId, - @org.eclipse.jdt.annotation.Nullable UpdatePlaylistUserDto updatePlaylistUserDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable UpdatePlaylistUserDto updatePlaylistUserDto, + Map headers) throws ApiException { // verify the required parameter 'playlistId' is set if (playlistId == null) { throw new ApiException(400, "Missing the required parameter 'playlistId' when calling updatePlaylistUser"); @@ -1159,6 +1629,8 @@ private HttpRequest.Builder updatePlaylistUserRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PlaystateApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PlaystateApi.java index 96044de897ac0..5e0f2eeac501f 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PlaystateApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PlaystateApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -22,6 +23,7 @@ import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -43,6 +45,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class PlaystateApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -78,6 +102,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Marks an item as played for user. * @@ -90,7 +164,24 @@ private String formatExceptionMessage(String operationId, int statusCode, String public UserItemDataDto markPlayedItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull OffsetDateTime datePlayed) throws ApiException { - ApiResponse localVarResponse = markPlayedItemWithHttpInfo(itemId, userId, datePlayed); + return markPlayedItem(itemId, userId, datePlayed, null); + } + + /** + * Marks an item as played for user. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param datePlayed Optional. The date the item was played. (optional) + * @param headers Optional headers to include in the request + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto markPlayedItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime datePlayed, Map headers) + throws ApiException { + ApiResponse localVarResponse = markPlayedItemWithHttpInfo(itemId, userId, datePlayed, headers); return localVarResponse.getData(); } @@ -106,7 +197,24 @@ public UserItemDataDto markPlayedItem(@org.eclipse.jdt.annotation.Nullable UUID public ApiResponse markPlayedItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull OffsetDateTime datePlayed) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = markPlayedItemRequestBuilder(itemId, userId, datePlayed); + return markPlayedItemWithHttpInfo(itemId, userId, datePlayed, null); + } + + /** + * Marks an item as played for user. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param datePlayed Optional. The date the item was played. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse markPlayedItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime datePlayed, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = markPlayedItemRequestBuilder(itemId, userId, datePlayed, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -123,12 +231,14 @@ public ApiResponse markPlayedItemWithHttpInfo(@org.eclipse.jdt. } String responseBody = new String(localVarResponse.body().readAllBytes()); + UserItemDataDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -141,7 +251,8 @@ public ApiResponse markPlayedItemWithHttpInfo(@org.eclipse.jdt. private HttpRequest.Builder markPlayedItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, - @org.eclipse.jdt.annotation.NonNull OffsetDateTime datePlayed) throws ApiException { + @org.eclipse.jdt.annotation.NonNull OffsetDateTime datePlayed, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling markPlayedItem"); @@ -177,6 +288,8 @@ private HttpRequest.Builder markPlayedItemRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -193,7 +306,21 @@ private HttpRequest.Builder markPlayedItemRequestBuilder(@org.eclipse.jdt.annota */ public UserItemDataDto markUnplayedItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = markUnplayedItemWithHttpInfo(itemId, userId); + return markUnplayedItem(itemId, userId, null); + } + + /** + * Marks an item as unplayed for user. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto markUnplayedItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = markUnplayedItemWithHttpInfo(itemId, userId, headers); return localVarResponse.getData(); } @@ -207,7 +334,21 @@ public UserItemDataDto markUnplayedItem(@org.eclipse.jdt.annotation.Nullable UUI */ public ApiResponse markUnplayedItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = markUnplayedItemRequestBuilder(itemId, userId); + return markUnplayedItemWithHttpInfo(itemId, userId, null); + } + + /** + * Marks an item as unplayed for user. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse markUnplayedItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = markUnplayedItemRequestBuilder(itemId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -224,12 +365,14 @@ public ApiResponse markUnplayedItemWithHttpInfo(@org.eclipse.jd } String responseBody = new String(localVarResponse.body().readAllBytes()); + UserItemDataDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -241,7 +384,7 @@ public ApiResponse markUnplayedItemWithHttpInfo(@org.eclipse.jd } private HttpRequest.Builder markUnplayedItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling markUnplayedItem"); @@ -275,6 +418,8 @@ private HttpRequest.Builder markUnplayedItemRequestBuilder(@org.eclipse.jdt.anno if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -310,8 +455,42 @@ public void onPlaybackProgress(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode, @org.eclipse.jdt.annotation.NonNull Boolean isPaused, @org.eclipse.jdt.annotation.NonNull Boolean isMuted) throws ApiException { + onPlaybackProgress(itemId, mediaSourceId, positionTicks, audioStreamIndex, subtitleStreamIndex, volumeLevel, + playMethod, liveStreamId, playSessionId, repeatMode, isPaused, isMuted, null); + } + + /** + * Reports a session's playback progress. + * + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param positionTicks Optional. The current position, in ticks. 1 tick = 10000 ms. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param volumeLevel Scale of 0-100. (optional) + * @param playMethod The play method. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param repeatMode The repeat mode. (optional) + * @param isPaused Indicates if the player is paused. (optional, default to false) + * @param isMuted Indicates if the player is muted. (optional, default to false) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void onPlaybackProgress(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer volumeLevel, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode, + @org.eclipse.jdt.annotation.NonNull Boolean isPaused, @org.eclipse.jdt.annotation.NonNull Boolean isMuted, + Map headers) throws ApiException { onPlaybackProgressWithHttpInfo(itemId, mediaSourceId, positionTicks, audioStreamIndex, subtitleStreamIndex, - volumeLevel, playMethod, liveStreamId, playSessionId, repeatMode, isPaused, isMuted); + volumeLevel, playMethod, liveStreamId, playSessionId, repeatMode, isPaused, isMuted, headers); } /** @@ -344,9 +523,45 @@ public ApiResponse onPlaybackProgressWithHttpInfo(@org.eclipse.jdt.annotat @org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode, @org.eclipse.jdt.annotation.NonNull Boolean isPaused, @org.eclipse.jdt.annotation.NonNull Boolean isMuted) throws ApiException { + return onPlaybackProgressWithHttpInfo(itemId, mediaSourceId, positionTicks, audioStreamIndex, + subtitleStreamIndex, volumeLevel, playMethod, liveStreamId, playSessionId, repeatMode, isPaused, + isMuted, null); + } + + /** + * Reports a session's playback progress. + * + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param positionTicks Optional. The current position, in ticks. 1 tick = 10000 ms. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param volumeLevel Scale of 0-100. (optional) + * @param playMethod The play method. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param repeatMode The repeat mode. (optional) + * @param isPaused Indicates if the player is paused. (optional, default to false) + * @param isMuted Indicates if the player is muted. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse onPlaybackProgressWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer volumeLevel, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode, + @org.eclipse.jdt.annotation.NonNull Boolean isPaused, @org.eclipse.jdt.annotation.NonNull Boolean isMuted, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = onPlaybackProgressRequestBuilder(itemId, mediaSourceId, positionTicks, audioStreamIndex, subtitleStreamIndex, volumeLevel, playMethod, liveStreamId, - playSessionId, repeatMode, isPaused, isMuted); + playSessionId, repeatMode, isPaused, isMuted, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -383,8 +598,8 @@ private HttpRequest.Builder onPlaybackProgressRequestBuilder(@org.eclipse.jdt.an @org.eclipse.jdt.annotation.NonNull String liveStreamId, @org.eclipse.jdt.annotation.NonNull String playSessionId, @org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode, - @org.eclipse.jdt.annotation.NonNull Boolean isPaused, @org.eclipse.jdt.annotation.NonNull Boolean isMuted) - throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean isPaused, @org.eclipse.jdt.annotation.NonNull Boolean isMuted, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling onPlaybackProgress"); @@ -438,6 +653,8 @@ private HttpRequest.Builder onPlaybackProgressRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -465,8 +682,34 @@ public void onPlaybackStart(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String liveStreamId, @org.eclipse.jdt.annotation.NonNull String playSessionId, @org.eclipse.jdt.annotation.NonNull Boolean canSeek) throws ApiException { + onPlaybackStart(itemId, mediaSourceId, audioStreamIndex, subtitleStreamIndex, playMethod, liveStreamId, + playSessionId, canSeek, null); + } + + /** + * Reports that a session has begun playing an item. + * + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param playMethod The play method. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param canSeek Indicates if the client can seek. (optional, default to false) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void onPlaybackStart(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Boolean canSeek, Map headers) throws ApiException { onPlaybackStartWithHttpInfo(itemId, mediaSourceId, audioStreamIndex, subtitleStreamIndex, playMethod, - liveStreamId, playSessionId, canSeek); + liveStreamId, playSessionId, canSeek, headers); } /** @@ -491,8 +734,35 @@ public ApiResponse onPlaybackStartWithHttpInfo(@org.eclipse.jdt.annotation @org.eclipse.jdt.annotation.NonNull String liveStreamId, @org.eclipse.jdt.annotation.NonNull String playSessionId, @org.eclipse.jdt.annotation.NonNull Boolean canSeek) throws ApiException { + return onPlaybackStartWithHttpInfo(itemId, mediaSourceId, audioStreamIndex, subtitleStreamIndex, playMethod, + liveStreamId, playSessionId, canSeek, null); + } + + /** + * Reports that a session has begun playing an item. + * + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param playMethod The play method. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param canSeek Indicates if the client can seek. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse onPlaybackStartWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Boolean canSeek, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = onPlaybackStartRequestBuilder(itemId, mediaSourceId, - audioStreamIndex, subtitleStreamIndex, playMethod, liveStreamId, playSessionId, canSeek); + audioStreamIndex, subtitleStreamIndex, playMethod, liveStreamId, playSessionId, canSeek, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -526,7 +796,7 @@ private HttpRequest.Builder onPlaybackStartRequestBuilder(@org.eclipse.jdt.annot @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, @org.eclipse.jdt.annotation.NonNull String liveStreamId, @org.eclipse.jdt.annotation.NonNull String playSessionId, - @org.eclipse.jdt.annotation.NonNull Boolean canSeek) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean canSeek, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling onPlaybackStart"); @@ -571,6 +841,8 @@ private HttpRequest.Builder onPlaybackStartRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -594,7 +866,29 @@ public void onPlaybackStopped(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull Long positionTicks, @org.eclipse.jdt.annotation.NonNull String liveStreamId, @org.eclipse.jdt.annotation.NonNull String playSessionId) throws ApiException { - onPlaybackStoppedWithHttpInfo(itemId, mediaSourceId, nextMediaType, positionTicks, liveStreamId, playSessionId); + onPlaybackStopped(itemId, mediaSourceId, nextMediaType, positionTicks, liveStreamId, playSessionId, null); + } + + /** + * Reports that a session has stopped playing an item. + * + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param nextMediaType The next media type that will play. (optional) + * @param positionTicks Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void onPlaybackStopped(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String nextMediaType, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, Map headers) throws ApiException { + onPlaybackStoppedWithHttpInfo(itemId, mediaSourceId, nextMediaType, positionTicks, liveStreamId, playSessionId, + headers); } /** @@ -615,8 +909,31 @@ public ApiResponse onPlaybackStoppedWithHttpInfo(@org.eclipse.jdt.annotati @org.eclipse.jdt.annotation.NonNull Long positionTicks, @org.eclipse.jdt.annotation.NonNull String liveStreamId, @org.eclipse.jdt.annotation.NonNull String playSessionId) throws ApiException { + return onPlaybackStoppedWithHttpInfo(itemId, mediaSourceId, nextMediaType, positionTicks, liveStreamId, + playSessionId, null); + } + + /** + * Reports that a session has stopped playing an item. + * + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param nextMediaType The next media type that will play. (optional) + * @param positionTicks Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse onPlaybackStoppedWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String nextMediaType, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = onPlaybackStoppedRequestBuilder(itemId, mediaSourceId, - nextMediaType, positionTicks, liveStreamId, playSessionId); + nextMediaType, positionTicks, liveStreamId, playSessionId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -648,7 +965,7 @@ private HttpRequest.Builder onPlaybackStoppedRequestBuilder(@org.eclipse.jdt.ann @org.eclipse.jdt.annotation.NonNull String nextMediaType, @org.eclipse.jdt.annotation.NonNull Long positionTicks, @org.eclipse.jdt.annotation.NonNull String liveStreamId, - @org.eclipse.jdt.annotation.NonNull String playSessionId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String playSessionId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling onPlaybackStopped"); @@ -689,6 +1006,8 @@ private HttpRequest.Builder onPlaybackStoppedRequestBuilder(@org.eclipse.jdt.ann if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -702,7 +1021,19 @@ private HttpRequest.Builder onPlaybackStoppedRequestBuilder(@org.eclipse.jdt.ann * @throws ApiException if fails to make API call */ public void pingPlaybackSession(@org.eclipse.jdt.annotation.Nullable String playSessionId) throws ApiException { - pingPlaybackSessionWithHttpInfo(playSessionId); + pingPlaybackSession(playSessionId, null); + } + + /** + * Pings a playback session. + * + * @param playSessionId Playback session id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void pingPlaybackSession(@org.eclipse.jdt.annotation.Nullable String playSessionId, + Map headers) throws ApiException { + pingPlaybackSessionWithHttpInfo(playSessionId, headers); } /** @@ -714,7 +1045,20 @@ public void pingPlaybackSession(@org.eclipse.jdt.annotation.Nullable String play */ public ApiResponse pingPlaybackSessionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String playSessionId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = pingPlaybackSessionRequestBuilder(playSessionId); + return pingPlaybackSessionWithHttpInfo(playSessionId, null); + } + + /** + * Pings a playback session. + * + * @param playSessionId Playback session id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse pingPlaybackSessionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String playSessionId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = pingPlaybackSessionRequestBuilder(playSessionId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -742,7 +1086,8 @@ public ApiResponse pingPlaybackSessionWithHttpInfo(@org.eclipse.jdt.annota } private HttpRequest.Builder pingPlaybackSessionRequestBuilder( - @org.eclipse.jdt.annotation.Nullable String playSessionId) throws ApiException { + @org.eclipse.jdt.annotation.Nullable String playSessionId, Map headers) + throws ApiException { // verify the required parameter 'playSessionId' is set if (playSessionId == null) { throw new ApiException(400, @@ -776,6 +1121,8 @@ private HttpRequest.Builder pingPlaybackSessionRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -790,7 +1137,19 @@ private HttpRequest.Builder pingPlaybackSessionRequestBuilder( */ public void reportPlaybackProgress(@org.eclipse.jdt.annotation.NonNull PlaybackProgressInfo playbackProgressInfo) throws ApiException { - reportPlaybackProgressWithHttpInfo(playbackProgressInfo); + reportPlaybackProgress(playbackProgressInfo, null); + } + + /** + * Reports playback progress within a session. + * + * @param playbackProgressInfo The playback progress info. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void reportPlaybackProgress(@org.eclipse.jdt.annotation.NonNull PlaybackProgressInfo playbackProgressInfo, + Map headers) throws ApiException { + reportPlaybackProgressWithHttpInfo(playbackProgressInfo, headers); } /** @@ -802,7 +1161,22 @@ public void reportPlaybackProgress(@org.eclipse.jdt.annotation.NonNull PlaybackP */ public ApiResponse reportPlaybackProgressWithHttpInfo( @org.eclipse.jdt.annotation.NonNull PlaybackProgressInfo playbackProgressInfo) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = reportPlaybackProgressRequestBuilder(playbackProgressInfo); + return reportPlaybackProgressWithHttpInfo(playbackProgressInfo, null); + } + + /** + * Reports playback progress within a session. + * + * @param playbackProgressInfo The playback progress info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportPlaybackProgressWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull PlaybackProgressInfo playbackProgressInfo, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = reportPlaybackProgressRequestBuilder(playbackProgressInfo, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -830,7 +1204,8 @@ public ApiResponse reportPlaybackProgressWithHttpInfo( } private HttpRequest.Builder reportPlaybackProgressRequestBuilder( - @org.eclipse.jdt.annotation.NonNull PlaybackProgressInfo playbackProgressInfo) throws ApiException { + @org.eclipse.jdt.annotation.NonNull PlaybackProgressInfo playbackProgressInfo, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -850,6 +1225,8 @@ private HttpRequest.Builder reportPlaybackProgressRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -864,7 +1241,19 @@ private HttpRequest.Builder reportPlaybackProgressRequestBuilder( */ public void reportPlaybackStart(@org.eclipse.jdt.annotation.NonNull PlaybackStartInfo playbackStartInfo) throws ApiException { - reportPlaybackStartWithHttpInfo(playbackStartInfo); + reportPlaybackStart(playbackStartInfo, null); + } + + /** + * Reports playback has started within a session. + * + * @param playbackStartInfo The playback start info. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void reportPlaybackStart(@org.eclipse.jdt.annotation.NonNull PlaybackStartInfo playbackStartInfo, + Map headers) throws ApiException { + reportPlaybackStartWithHttpInfo(playbackStartInfo, headers); } /** @@ -876,7 +1265,21 @@ public void reportPlaybackStart(@org.eclipse.jdt.annotation.NonNull PlaybackStar */ public ApiResponse reportPlaybackStartWithHttpInfo( @org.eclipse.jdt.annotation.NonNull PlaybackStartInfo playbackStartInfo) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = reportPlaybackStartRequestBuilder(playbackStartInfo); + return reportPlaybackStartWithHttpInfo(playbackStartInfo, null); + } + + /** + * Reports playback has started within a session. + * + * @param playbackStartInfo The playback start info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportPlaybackStartWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull PlaybackStartInfo playbackStartInfo, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = reportPlaybackStartRequestBuilder(playbackStartInfo, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -904,7 +1307,8 @@ public ApiResponse reportPlaybackStartWithHttpInfo( } private HttpRequest.Builder reportPlaybackStartRequestBuilder( - @org.eclipse.jdt.annotation.NonNull PlaybackStartInfo playbackStartInfo) throws ApiException { + @org.eclipse.jdt.annotation.NonNull PlaybackStartInfo playbackStartInfo, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -924,6 +1328,8 @@ private HttpRequest.Builder reportPlaybackStartRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -938,7 +1344,19 @@ private HttpRequest.Builder reportPlaybackStartRequestBuilder( */ public void reportPlaybackStopped(@org.eclipse.jdt.annotation.NonNull PlaybackStopInfo playbackStopInfo) throws ApiException { - reportPlaybackStoppedWithHttpInfo(playbackStopInfo); + reportPlaybackStopped(playbackStopInfo, null); + } + + /** + * Reports playback has stopped within a session. + * + * @param playbackStopInfo The playback stop info. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void reportPlaybackStopped(@org.eclipse.jdt.annotation.NonNull PlaybackStopInfo playbackStopInfo, + Map headers) throws ApiException { + reportPlaybackStoppedWithHttpInfo(playbackStopInfo, headers); } /** @@ -950,7 +1368,21 @@ public void reportPlaybackStopped(@org.eclipse.jdt.annotation.NonNull PlaybackSt */ public ApiResponse reportPlaybackStoppedWithHttpInfo( @org.eclipse.jdt.annotation.NonNull PlaybackStopInfo playbackStopInfo) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = reportPlaybackStoppedRequestBuilder(playbackStopInfo); + return reportPlaybackStoppedWithHttpInfo(playbackStopInfo, null); + } + + /** + * Reports playback has stopped within a session. + * + * @param playbackStopInfo The playback stop info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportPlaybackStoppedWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull PlaybackStopInfo playbackStopInfo, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = reportPlaybackStoppedRequestBuilder(playbackStopInfo, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -978,7 +1410,8 @@ public ApiResponse reportPlaybackStoppedWithHttpInfo( } private HttpRequest.Builder reportPlaybackStoppedRequestBuilder( - @org.eclipse.jdt.annotation.NonNull PlaybackStopInfo playbackStopInfo) throws ApiException { + @org.eclipse.jdt.annotation.NonNull PlaybackStopInfo playbackStopInfo, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -998,6 +1431,8 @@ private HttpRequest.Builder reportPlaybackStoppedRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PluginsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PluginsApi.java index d8c2c3ddd5868..2c037de5418b2 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PluginsApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/PluginsApi.java @@ -21,6 +21,7 @@ import java.net.http.HttpResponse; import java.time.Duration; import java.util.List; +import java.util.Map; import java.util.UUID; import java.util.function.Consumer; @@ -35,6 +36,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class PluginsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -70,6 +93,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Disable a plugin. * @@ -79,7 +152,20 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public void disablePlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId, @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { - disablePluginWithHttpInfo(pluginId, version); + disablePlugin(pluginId, version, null); + } + + /** + * Disable a plugin. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void disablePlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + disablePluginWithHttpInfo(pluginId, version, headers); } /** @@ -92,7 +178,21 @@ public void disablePlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId, */ public ApiResponse disablePluginWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = disablePluginRequestBuilder(pluginId, version); + return disablePluginWithHttpInfo(pluginId, version, null); + } + + /** + * Disable a plugin. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse disablePluginWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = disablePluginRequestBuilder(pluginId, version, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -120,7 +220,7 @@ public ApiResponse disablePluginWithHttpInfo(@org.eclipse.jdt.annotation.N } private HttpRequest.Builder disablePluginRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId, - @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { // verify the required parameter 'pluginId' is set if (pluginId == null) { throw new ApiException(400, "Missing the required parameter 'pluginId' when calling disablePlugin"); @@ -145,6 +245,8 @@ private HttpRequest.Builder disablePluginRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -160,7 +262,20 @@ private HttpRequest.Builder disablePluginRequestBuilder(@org.eclipse.jdt.annotat */ public void enablePlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId, @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { - enablePluginWithHttpInfo(pluginId, version); + enablePlugin(pluginId, version, null); + } + + /** + * Enables a disabled plugin. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void enablePlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + enablePluginWithHttpInfo(pluginId, version, headers); } /** @@ -173,7 +288,21 @@ public void enablePlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId, */ public ApiResponse enablePluginWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = enablePluginRequestBuilder(pluginId, version); + return enablePluginWithHttpInfo(pluginId, version, null); + } + + /** + * Enables a disabled plugin. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse enablePluginWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = enablePluginRequestBuilder(pluginId, version, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -201,7 +330,7 @@ public ApiResponse enablePluginWithHttpInfo(@org.eclipse.jdt.annotation.Nu } private HttpRequest.Builder enablePluginRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId, - @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { // verify the required parameter 'pluginId' is set if (pluginId == null) { throw new ApiException(400, "Missing the required parameter 'pluginId' when calling enablePlugin"); @@ -226,6 +355,8 @@ private HttpRequest.Builder enablePluginRequestBuilder(@org.eclipse.jdt.annotati if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -240,7 +371,20 @@ private HttpRequest.Builder enablePluginRequestBuilder(@org.eclipse.jdt.annotati * @throws ApiException if fails to make API call */ public Object getPluginConfiguration(@org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { - ApiResponse localVarResponse = getPluginConfigurationWithHttpInfo(pluginId); + return getPluginConfiguration(pluginId, null); + } + + /** + * Gets plugin configuration. + * + * @param pluginId Plugin id. (required) + * @param headers Optional headers to include in the request + * @return Object + * @throws ApiException if fails to make API call + */ + public Object getPluginConfiguration(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getPluginConfigurationWithHttpInfo(pluginId, headers); return localVarResponse.getData(); } @@ -253,7 +397,20 @@ public Object getPluginConfiguration(@org.eclipse.jdt.annotation.Nullable UUID p */ public ApiResponse getPluginConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPluginConfigurationRequestBuilder(pluginId); + return getPluginConfigurationWithHttpInfo(pluginId, null); + } + + /** + * Gets plugin configuration. + * + * @param pluginId Plugin id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPluginConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPluginConfigurationRequestBuilder(pluginId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -270,12 +427,14 @@ public ApiResponse getPluginConfigurationWithHttpInfo(@org.eclipse.jdt.a } String responseBody = new String(localVarResponse.body().readAllBytes()); + Object responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -286,8 +445,8 @@ public ApiResponse getPluginConfigurationWithHttpInfo(@org.eclipse.jdt.a } } - private HttpRequest.Builder getPluginConfigurationRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId) - throws ApiException { + private HttpRequest.Builder getPluginConfigurationRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { // verify the required parameter 'pluginId' is set if (pluginId == null) { throw new ApiException(400, @@ -308,6 +467,8 @@ private HttpRequest.Builder getPluginConfigurationRequestBuilder(@org.eclipse.jd if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -324,7 +485,21 @@ private HttpRequest.Builder getPluginConfigurationRequestBuilder(@org.eclipse.jd */ public File getPluginImage(@org.eclipse.jdt.annotation.Nullable UUID pluginId, @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { - ApiResponse localVarResponse = getPluginImageWithHttpInfo(pluginId, version); + return getPluginImage(pluginId, version, null); + } + + /** + * Gets a plugin's image. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getPluginImage(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + ApiResponse localVarResponse = getPluginImageWithHttpInfo(pluginId, version, headers); return localVarResponse.getData(); } @@ -338,7 +513,21 @@ public File getPluginImage(@org.eclipse.jdt.annotation.Nullable UUID pluginId, */ public ApiResponse getPluginImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPluginImageRequestBuilder(pluginId, version); + return getPluginImageWithHttpInfo(pluginId, version, null); + } + + /** + * Gets a plugin's image. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPluginImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPluginImageRequestBuilder(pluginId, version, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -353,13 +542,13 @@ public ApiResponse getPluginImageWithHttpInfo(@org.eclipse.jdt.annotation. return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -371,7 +560,7 @@ public ApiResponse getPluginImageWithHttpInfo(@org.eclipse.jdt.annotation. } private HttpRequest.Builder getPluginImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId, - @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { // verify the required parameter 'pluginId' is set if (pluginId == null) { throw new ApiException(400, "Missing the required parameter 'pluginId' when calling getPluginImage"); @@ -396,6 +585,8 @@ private HttpRequest.Builder getPluginImageRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -409,7 +600,19 @@ private HttpRequest.Builder getPluginImageRequestBuilder(@org.eclipse.jdt.annota * @throws ApiException if fails to make API call */ public void getPluginManifest(@org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { - getPluginManifestWithHttpInfo(pluginId); + getPluginManifest(pluginId, null); + } + + /** + * Gets a plugin's manifest. + * + * @param pluginId Plugin id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void getPluginManifest(@org.eclipse.jdt.annotation.Nullable UUID pluginId, Map headers) + throws ApiException { + getPluginManifestWithHttpInfo(pluginId, headers); } /** @@ -421,7 +624,20 @@ public void getPluginManifest(@org.eclipse.jdt.annotation.Nullable UUID pluginId */ public ApiResponse getPluginManifestWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPluginManifestRequestBuilder(pluginId); + return getPluginManifestWithHttpInfo(pluginId, null); + } + + /** + * Gets a plugin's manifest. + * + * @param pluginId Plugin id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPluginManifestWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPluginManifestRequestBuilder(pluginId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -448,8 +664,8 @@ public ApiResponse getPluginManifestWithHttpInfo(@org.eclipse.jdt.annotati } } - private HttpRequest.Builder getPluginManifestRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId) - throws ApiException { + private HttpRequest.Builder getPluginManifestRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { // verify the required parameter 'pluginId' is set if (pluginId == null) { throw new ApiException(400, "Missing the required parameter 'pluginId' when calling getPluginManifest"); @@ -469,6 +685,8 @@ private HttpRequest.Builder getPluginManifestRequestBuilder(@org.eclipse.jdt.ann if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -482,7 +700,18 @@ private HttpRequest.Builder getPluginManifestRequestBuilder(@org.eclipse.jdt.ann * @throws ApiException if fails to make API call */ public List getPlugins() throws ApiException { - ApiResponse> localVarResponse = getPluginsWithHttpInfo(); + return getPlugins(null); + } + + /** + * Gets a list of currently installed plugins. + * + * @param headers Optional headers to include in the request + * @return List<PluginInfo> + * @throws ApiException if fails to make API call + */ + public List getPlugins(Map headers) throws ApiException { + ApiResponse> localVarResponse = getPluginsWithHttpInfo(headers); return localVarResponse.getData(); } @@ -493,7 +722,18 @@ public List getPlugins() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getPluginsWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPluginsRequestBuilder(); + return getPluginsWithHttpInfo(null); + } + + /** + * Gets a list of currently installed plugins. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<PluginInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPluginsWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPluginsRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -510,12 +750,14 @@ public ApiResponse> getPluginsWithHttpInfo() throws ApiExceptio } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -526,7 +768,7 @@ public ApiResponse> getPluginsWithHttpInfo() throws ApiExceptio } } - private HttpRequest.Builder getPluginsRequestBuilder() throws ApiException { + private HttpRequest.Builder getPluginsRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -541,6 +783,8 @@ private HttpRequest.Builder getPluginsRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -556,7 +800,21 @@ private HttpRequest.Builder getPluginsRequestBuilder() throws ApiException { */ @Deprecated public void uninstallPlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { - uninstallPluginWithHttpInfo(pluginId); + uninstallPlugin(pluginId, null); + } + + /** + * Uninstalls a plugin. + * + * @param pluginId Plugin id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public void uninstallPlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId, Map headers) + throws ApiException { + uninstallPluginWithHttpInfo(pluginId, headers); } /** @@ -570,7 +828,22 @@ public void uninstallPlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId) @Deprecated public ApiResponse uninstallPluginWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = uninstallPluginRequestBuilder(pluginId); + return uninstallPluginWithHttpInfo(pluginId, null); + } + + /** + * Uninstalls a plugin. + * + * @param pluginId Plugin id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse uninstallPluginWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uninstallPluginRequestBuilder(pluginId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -597,8 +870,8 @@ public ApiResponse uninstallPluginWithHttpInfo(@org.eclipse.jdt.annotation } } - private HttpRequest.Builder uninstallPluginRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId) - throws ApiException { + private HttpRequest.Builder uninstallPluginRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { // verify the required parameter 'pluginId' is set if (pluginId == null) { throw new ApiException(400, "Missing the required parameter 'pluginId' when calling uninstallPlugin"); @@ -617,6 +890,8 @@ private HttpRequest.Builder uninstallPluginRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -632,7 +907,20 @@ private HttpRequest.Builder uninstallPluginRequestBuilder(@org.eclipse.jdt.annot */ public void uninstallPluginByVersion(@org.eclipse.jdt.annotation.Nullable UUID pluginId, @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { - uninstallPluginByVersionWithHttpInfo(pluginId, version); + uninstallPluginByVersion(pluginId, version, null); + } + + /** + * Uninstalls a plugin by version. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void uninstallPluginByVersion(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + uninstallPluginByVersionWithHttpInfo(pluginId, version, headers); } /** @@ -645,7 +933,21 @@ public void uninstallPluginByVersion(@org.eclipse.jdt.annotation.Nullable UUID p */ public ApiResponse uninstallPluginByVersionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = uninstallPluginByVersionRequestBuilder(pluginId, version); + return uninstallPluginByVersionWithHttpInfo(pluginId, version, null); + } + + /** + * Uninstalls a plugin by version. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse uninstallPluginByVersionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uninstallPluginByVersionRequestBuilder(pluginId, version, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -673,8 +975,8 @@ public ApiResponse uninstallPluginByVersionWithHttpInfo(@org.eclipse.jdt.a } private HttpRequest.Builder uninstallPluginByVersionRequestBuilder( - @org.eclipse.jdt.annotation.Nullable UUID pluginId, @org.eclipse.jdt.annotation.Nullable String version) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable UUID pluginId, @org.eclipse.jdt.annotation.Nullable String version, + Map headers) throws ApiException { // verify the required parameter 'pluginId' is set if (pluginId == null) { throw new ApiException(400, @@ -701,6 +1003,8 @@ private HttpRequest.Builder uninstallPluginByVersionRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -715,7 +1019,20 @@ private HttpRequest.Builder uninstallPluginByVersionRequestBuilder( * @throws ApiException if fails to make API call */ public void updatePluginConfiguration(@org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { - updatePluginConfigurationWithHttpInfo(pluginId); + updatePluginConfiguration(pluginId, null); + } + + /** + * Updates plugin configuration. + * Accepts plugin configuration as JSON body. + * + * @param pluginId Plugin id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updatePluginConfiguration(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { + updatePluginConfigurationWithHttpInfo(pluginId, headers); } /** @@ -728,7 +1045,21 @@ public void updatePluginConfiguration(@org.eclipse.jdt.annotation.Nullable UUID */ public ApiResponse updatePluginConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updatePluginConfigurationRequestBuilder(pluginId); + return updatePluginConfigurationWithHttpInfo(pluginId, null); + } + + /** + * Updates plugin configuration. + * Accepts plugin configuration as JSON body. + * + * @param pluginId Plugin id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updatePluginConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updatePluginConfigurationRequestBuilder(pluginId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -756,7 +1087,7 @@ public ApiResponse updatePluginConfigurationWithHttpInfo(@org.eclipse.jdt. } private HttpRequest.Builder updatePluginConfigurationRequestBuilder( - @org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { + @org.eclipse.jdt.annotation.Nullable UUID pluginId, Map headers) throws ApiException { // verify the required parameter 'pluginId' is set if (pluginId == null) { throw new ApiException(400, @@ -777,6 +1108,8 @@ private HttpRequest.Builder updatePluginConfigurationRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/QuickConnectApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/QuickConnectApi.java index 647bd3a2659e4..e3904b198f8fb 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/QuickConnectApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/QuickConnectApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -37,6 +39,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class QuickConnectApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -72,6 +96,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Authorizes a pending quick connect request. * @@ -82,7 +156,21 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public Boolean authorizeQuickConnect(@org.eclipse.jdt.annotation.Nullable String code, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = authorizeQuickConnectWithHttpInfo(code, userId); + return authorizeQuickConnect(code, userId, null); + } + + /** + * Authorizes a pending quick connect request. + * + * @param code Quick connect code to authorize. (required) + * @param userId The user the authorize. Access to the requested user is required. (optional) + * @param headers Optional headers to include in the request + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean authorizeQuickConnect(@org.eclipse.jdt.annotation.Nullable String code, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = authorizeQuickConnectWithHttpInfo(code, userId, headers); return localVarResponse.getData(); } @@ -96,7 +184,21 @@ public Boolean authorizeQuickConnect(@org.eclipse.jdt.annotation.Nullable String */ public ApiResponse authorizeQuickConnectWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String code, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = authorizeQuickConnectRequestBuilder(code, userId); + return authorizeQuickConnectWithHttpInfo(code, userId, null); + } + + /** + * Authorizes a pending quick connect request. + * + * @param code Quick connect code to authorize. (required) + * @param userId The user the authorize. Access to the requested user is required. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Boolean> + * @throws ApiException if fails to make API call + */ + public ApiResponse authorizeQuickConnectWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String code, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = authorizeQuickConnectRequestBuilder(code, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -113,12 +215,14 @@ public ApiResponse authorizeQuickConnectWithHttpInfo(@org.eclipse.jdt.a } String responseBody = new String(localVarResponse.body().readAllBytes()); + Boolean responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -130,7 +234,7 @@ public ApiResponse authorizeQuickConnectWithHttpInfo(@org.eclipse.jdt.a } private HttpRequest.Builder authorizeQuickConnectRequestBuilder(@org.eclipse.jdt.annotation.Nullable String code, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'code' is set if (code == null) { throw new ApiException(400, "Missing the required parameter 'code' when calling authorizeQuickConnect"); @@ -166,6 +270,8 @@ private HttpRequest.Builder authorizeQuickConnectRequestBuilder(@org.eclipse.jdt if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -179,7 +285,18 @@ private HttpRequest.Builder authorizeQuickConnectRequestBuilder(@org.eclipse.jdt * @throws ApiException if fails to make API call */ public Boolean getQuickConnectEnabled() throws ApiException { - ApiResponse localVarResponse = getQuickConnectEnabledWithHttpInfo(); + return getQuickConnectEnabled(null); + } + + /** + * Gets the current quick connect state. + * + * @param headers Optional headers to include in the request + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean getQuickConnectEnabled(Map headers) throws ApiException { + ApiResponse localVarResponse = getQuickConnectEnabledWithHttpInfo(headers); return localVarResponse.getData(); } @@ -190,7 +307,18 @@ public Boolean getQuickConnectEnabled() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getQuickConnectEnabledWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getQuickConnectEnabledRequestBuilder(); + return getQuickConnectEnabledWithHttpInfo(null); + } + + /** + * Gets the current quick connect state. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Boolean> + * @throws ApiException if fails to make API call + */ + public ApiResponse getQuickConnectEnabledWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getQuickConnectEnabledRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -207,12 +335,14 @@ public ApiResponse getQuickConnectEnabledWithHttpInfo() throws ApiExcep } String responseBody = new String(localVarResponse.body().readAllBytes()); + Boolean responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -223,7 +353,7 @@ public ApiResponse getQuickConnectEnabledWithHttpInfo() throws ApiExcep } } - private HttpRequest.Builder getQuickConnectEnabledRequestBuilder() throws ApiException { + private HttpRequest.Builder getQuickConnectEnabledRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -238,6 +368,8 @@ private HttpRequest.Builder getQuickConnectEnabledRequestBuilder() throws ApiExc if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -253,7 +385,20 @@ private HttpRequest.Builder getQuickConnectEnabledRequestBuilder() throws ApiExc */ public QuickConnectResult getQuickConnectState(@org.eclipse.jdt.annotation.Nullable String secret) throws ApiException { - ApiResponse localVarResponse = getQuickConnectStateWithHttpInfo(secret); + return getQuickConnectState(secret, null); + } + + /** + * Attempts to retrieve authentication information. + * + * @param secret Secret previously returned from the Initiate endpoint. (required) + * @param headers Optional headers to include in the request + * @return QuickConnectResult + * @throws ApiException if fails to make API call + */ + public QuickConnectResult getQuickConnectState(@org.eclipse.jdt.annotation.Nullable String secret, + Map headers) throws ApiException { + ApiResponse localVarResponse = getQuickConnectStateWithHttpInfo(secret, headers); return localVarResponse.getData(); } @@ -266,7 +411,20 @@ public QuickConnectResult getQuickConnectState(@org.eclipse.jdt.annotation.Nulla */ public ApiResponse getQuickConnectStateWithHttpInfo( @org.eclipse.jdt.annotation.Nullable String secret) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getQuickConnectStateRequestBuilder(secret); + return getQuickConnectStateWithHttpInfo(secret, null); + } + + /** + * Attempts to retrieve authentication information. + * + * @param secret Secret previously returned from the Initiate endpoint. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<QuickConnectResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getQuickConnectStateWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String secret, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getQuickConnectStateRequestBuilder(secret, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -283,14 +441,14 @@ public ApiResponse getQuickConnectStateWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + QuickConnectResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -301,8 +459,8 @@ public ApiResponse getQuickConnectStateWithHttpInfo( } } - private HttpRequest.Builder getQuickConnectStateRequestBuilder(@org.eclipse.jdt.annotation.Nullable String secret) - throws ApiException { + private HttpRequest.Builder getQuickConnectStateRequestBuilder(@org.eclipse.jdt.annotation.Nullable String secret, + Map headers) throws ApiException { // verify the required parameter 'secret' is set if (secret == null) { throw new ApiException(400, "Missing the required parameter 'secret' when calling getQuickConnectState"); @@ -336,6 +494,8 @@ private HttpRequest.Builder getQuickConnectStateRequestBuilder(@org.eclipse.jdt. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -349,7 +509,18 @@ private HttpRequest.Builder getQuickConnectStateRequestBuilder(@org.eclipse.jdt. * @throws ApiException if fails to make API call */ public QuickConnectResult initiateQuickConnect() throws ApiException { - ApiResponse localVarResponse = initiateQuickConnectWithHttpInfo(); + return initiateQuickConnect(null); + } + + /** + * Initiate a new quick connect request. + * + * @param headers Optional headers to include in the request + * @return QuickConnectResult + * @throws ApiException if fails to make API call + */ + public QuickConnectResult initiateQuickConnect(Map headers) throws ApiException { + ApiResponse localVarResponse = initiateQuickConnectWithHttpInfo(headers); return localVarResponse.getData(); } @@ -360,7 +531,19 @@ public QuickConnectResult initiateQuickConnect() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse initiateQuickConnectWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = initiateQuickConnectRequestBuilder(); + return initiateQuickConnectWithHttpInfo(null); + } + + /** + * Initiate a new quick connect request. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<QuickConnectResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse initiateQuickConnectWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = initiateQuickConnectRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -377,14 +560,14 @@ public ApiResponse initiateQuickConnectWithHttpInfo() throws } String responseBody = new String(localVarResponse.body().readAllBytes()); + QuickConnectResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -395,7 +578,7 @@ public ApiResponse initiateQuickConnectWithHttpInfo() throws } } - private HttpRequest.Builder initiateQuickConnectRequestBuilder() throws ApiException { + private HttpRequest.Builder initiateQuickConnectRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -410,6 +593,8 @@ private HttpRequest.Builder initiateQuickConnectRequestBuilder() throws ApiExcep if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/RemoteImageApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/RemoteImageApi.java index 36ad675ebd225..c774487c68d08 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/RemoteImageApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/RemoteImageApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -39,6 +41,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class RemoteImageApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -74,6 +98,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Downloads a remote image for an item. * @@ -85,7 +159,22 @@ private String formatExceptionMessage(String operationId, int statusCode, String public void downloadRemoteImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable ImageType type, @org.eclipse.jdt.annotation.NonNull String imageUrl) throws ApiException { - downloadRemoteImageWithHttpInfo(itemId, type, imageUrl); + downloadRemoteImage(itemId, type, imageUrl, null); + } + + /** + * Downloads a remote image for an item. + * + * @param itemId Item Id. (required) + * @param type The image type. (required) + * @param imageUrl The image url. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void downloadRemoteImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType type, @org.eclipse.jdt.annotation.NonNull String imageUrl, + Map headers) throws ApiException { + downloadRemoteImageWithHttpInfo(itemId, type, imageUrl, headers); } /** @@ -100,7 +189,23 @@ public void downloadRemoteImage(@org.eclipse.jdt.annotation.Nullable UUID itemId public ApiResponse downloadRemoteImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable ImageType type, @org.eclipse.jdt.annotation.NonNull String imageUrl) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = downloadRemoteImageRequestBuilder(itemId, type, imageUrl); + return downloadRemoteImageWithHttpInfo(itemId, type, imageUrl, null); + } + + /** + * Downloads a remote image for an item. + * + * @param itemId Item Id. (required) + * @param type The image type. (required) + * @param imageUrl The image url. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse downloadRemoteImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType type, @org.eclipse.jdt.annotation.NonNull String imageUrl, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = downloadRemoteImageRequestBuilder(itemId, type, imageUrl, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -128,8 +233,8 @@ public ApiResponse downloadRemoteImageWithHttpInfo(@org.eclipse.jdt.annota } private HttpRequest.Builder downloadRemoteImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.Nullable ImageType type, @org.eclipse.jdt.annotation.NonNull String imageUrl) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable ImageType type, @org.eclipse.jdt.annotation.NonNull String imageUrl, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling downloadRemoteImage"); @@ -170,6 +275,8 @@ private HttpRequest.Builder downloadRemoteImageRequestBuilder(@org.eclipse.jdt.a if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -185,7 +292,20 @@ private HttpRequest.Builder downloadRemoteImageRequestBuilder(@org.eclipse.jdt.a */ public List getRemoteImageProviders(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - ApiResponse> localVarResponse = getRemoteImageProvidersWithHttpInfo(itemId); + return getRemoteImageProviders(itemId, null); + } + + /** + * Gets available remote image providers for an item. + * + * @param itemId Item Id. (required) + * @param headers Optional headers to include in the request + * @return List<ImageProviderInfo> + * @throws ApiException if fails to make API call + */ + public List getRemoteImageProviders(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getRemoteImageProvidersWithHttpInfo(itemId, headers); return localVarResponse.getData(); } @@ -198,7 +318,20 @@ public List getRemoteImageProviders(@org.eclipse.jdt.annotati */ public ApiResponse> getRemoteImageProvidersWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getRemoteImageProvidersRequestBuilder(itemId); + return getRemoteImageProvidersWithHttpInfo(itemId, null); + } + + /** + * Gets available remote image providers for an item. + * + * @param itemId Item Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<ImageProviderInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getRemoteImageProvidersWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRemoteImageProvidersRequestBuilder(itemId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -215,14 +348,14 @@ public ApiResponse> getRemoteImageProvidersWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -233,8 +366,8 @@ public ApiResponse> getRemoteImageProvidersWithHttpInfo( } } - private HttpRequest.Builder getRemoteImageProvidersRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) - throws ApiException { + private HttpRequest.Builder getRemoteImageProvidersRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getRemoteImageProviders"); @@ -254,6 +387,8 @@ private HttpRequest.Builder getRemoteImageProvidersRequestBuilder(@org.eclipse.j if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -277,8 +412,30 @@ public RemoteImageResult getRemoteImages(@org.eclipse.jdt.annotation.Nullable UU @org.eclipse.jdt.annotation.NonNull ImageType type, @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String providerName, @org.eclipse.jdt.annotation.NonNull Boolean includeAllLanguages) throws ApiException { + return getRemoteImages(itemId, type, startIndex, limit, providerName, includeAllLanguages, null); + } + + /** + * Gets available remote images for an item. + * + * @param itemId Item Id. (required) + * @param type The image type. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param providerName Optional. The image provider to use. (optional) + * @param includeAllLanguages Optional. Include all languages. (optional, default to false) + * @param headers Optional headers to include in the request + * @return RemoteImageResult + * @throws ApiException if fails to make API call + */ + public RemoteImageResult getRemoteImages(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull ImageType type, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String providerName, + @org.eclipse.jdt.annotation.NonNull Boolean includeAllLanguages, Map headers) + throws ApiException { ApiResponse localVarResponse = getRemoteImagesWithHttpInfo(itemId, type, startIndex, limit, - providerName, includeAllLanguages); + providerName, includeAllLanguages, headers); return localVarResponse.getData(); } @@ -299,8 +456,30 @@ public ApiResponse getRemoteImagesWithHttpInfo(@org.eclipse.j @org.eclipse.jdt.annotation.NonNull ImageType type, @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String providerName, @org.eclipse.jdt.annotation.NonNull Boolean includeAllLanguages) throws ApiException { + return getRemoteImagesWithHttpInfo(itemId, type, startIndex, limit, providerName, includeAllLanguages, null); + } + + /** + * Gets available remote images for an item. + * + * @param itemId Item Id. (required) + * @param type The image type. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param providerName Optional. The image provider to use. (optional) + * @param includeAllLanguages Optional. Include all languages. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<RemoteImageResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRemoteImagesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull ImageType type, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String providerName, + @org.eclipse.jdt.annotation.NonNull Boolean includeAllLanguages, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getRemoteImagesRequestBuilder(itemId, type, startIndex, limit, - providerName, includeAllLanguages); + providerName, includeAllLanguages, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -317,12 +496,14 @@ public ApiResponse getRemoteImagesWithHttpInfo(@org.eclipse.j } String responseBody = new String(localVarResponse.body().readAllBytes()); + RemoteImageResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -336,7 +517,8 @@ public ApiResponse getRemoteImagesWithHttpInfo(@org.eclipse.j private HttpRequest.Builder getRemoteImagesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull ImageType type, @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String providerName, - @org.eclipse.jdt.annotation.NonNull Boolean includeAllLanguages) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean includeAllLanguages, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getRemoteImages"); @@ -379,6 +561,8 @@ private HttpRequest.Builder getRemoteImagesRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ScheduledTasksApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ScheduledTasksApi.java index c1e4dd40b62e9..a6bada0bf8f6f 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ScheduledTasksApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/ScheduledTasksApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.function.Consumer; @@ -37,6 +39,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class ScheduledTasksApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -72,6 +96,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Get task by id. * @@ -80,7 +154,20 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public TaskInfo getTask(@org.eclipse.jdt.annotation.Nullable String taskId) throws ApiException { - ApiResponse localVarResponse = getTaskWithHttpInfo(taskId); + return getTask(taskId, null); + } + + /** + * Get task by id. + * + * @param taskId Task Id. (required) + * @param headers Optional headers to include in the request + * @return TaskInfo + * @throws ApiException if fails to make API call + */ + public TaskInfo getTask(@org.eclipse.jdt.annotation.Nullable String taskId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getTaskWithHttpInfo(taskId, headers); return localVarResponse.getData(); } @@ -93,7 +180,20 @@ public TaskInfo getTask(@org.eclipse.jdt.annotation.Nullable String taskId) thro */ public ApiResponse getTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getTaskRequestBuilder(taskId); + return getTaskWithHttpInfo(taskId, null); + } + + /** + * Get task by id. + * + * @param taskId Task Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<TaskInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTaskRequestBuilder(taskId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -110,12 +210,14 @@ public ApiResponse getTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nul } String responseBody = new String(localVarResponse.body().readAllBytes()); + TaskInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -126,8 +228,8 @@ public ApiResponse getTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nul } } - private HttpRequest.Builder getTaskRequestBuilder(@org.eclipse.jdt.annotation.Nullable String taskId) - throws ApiException { + private HttpRequest.Builder getTaskRequestBuilder(@org.eclipse.jdt.annotation.Nullable String taskId, + Map headers) throws ApiException { // verify the required parameter 'taskId' is set if (taskId == null) { throw new ApiException(400, "Missing the required parameter 'taskId' when calling getTask"); @@ -146,6 +248,8 @@ private HttpRequest.Builder getTaskRequestBuilder(@org.eclipse.jdt.annotation.Nu if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -162,7 +266,21 @@ private HttpRequest.Builder getTaskRequestBuilder(@org.eclipse.jdt.annotation.Nu */ public List getTasks(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, @org.eclipse.jdt.annotation.NonNull Boolean isEnabled) throws ApiException { - ApiResponse> localVarResponse = getTasksWithHttpInfo(isHidden, isEnabled); + return getTasks(isHidden, isEnabled, null); + } + + /** + * Get tasks. + * + * @param isHidden Optional filter tasks that are hidden, or not. (optional) + * @param isEnabled Optional filter tasks that are enabled, or not. (optional) + * @param headers Optional headers to include in the request + * @return List<TaskInfo> + * @throws ApiException if fails to make API call + */ + public List getTasks(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isEnabled, Map headers) throws ApiException { + ApiResponse> localVarResponse = getTasksWithHttpInfo(isHidden, isEnabled, headers); return localVarResponse.getData(); } @@ -176,7 +294,21 @@ public List getTasks(@org.eclipse.jdt.annotation.NonNull Boolean isHid */ public ApiResponse> getTasksWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, @org.eclipse.jdt.annotation.NonNull Boolean isEnabled) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getTasksRequestBuilder(isHidden, isEnabled); + return getTasksWithHttpInfo(isHidden, isEnabled, null); + } + + /** + * Get tasks. + * + * @param isHidden Optional filter tasks that are hidden, or not. (optional) + * @param isEnabled Optional filter tasks that are enabled, or not. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<TaskInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getTasksWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isEnabled, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTasksRequestBuilder(isHidden, isEnabled, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -193,12 +325,14 @@ public ApiResponse> getTasksWithHttpInfo(@org.eclipse.jdt.annotat } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -210,7 +344,7 @@ public ApiResponse> getTasksWithHttpInfo(@org.eclipse.jdt.annotat } private HttpRequest.Builder getTasksRequestBuilder(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, - @org.eclipse.jdt.annotation.NonNull Boolean isEnabled) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean isEnabled, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -242,6 +376,8 @@ private HttpRequest.Builder getTasksRequestBuilder(@org.eclipse.jdt.annotation.N if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -255,7 +391,19 @@ private HttpRequest.Builder getTasksRequestBuilder(@org.eclipse.jdt.annotation.N * @throws ApiException if fails to make API call */ public void startTask(@org.eclipse.jdt.annotation.Nullable String taskId) throws ApiException { - startTaskWithHttpInfo(taskId); + startTask(taskId, null); + } + + /** + * Start specified task. + * + * @param taskId Task Id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void startTask(@org.eclipse.jdt.annotation.Nullable String taskId, Map headers) + throws ApiException { + startTaskWithHttpInfo(taskId, headers); } /** @@ -267,7 +415,20 @@ public void startTask(@org.eclipse.jdt.annotation.Nullable String taskId) throws */ public ApiResponse startTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = startTaskRequestBuilder(taskId); + return startTaskWithHttpInfo(taskId, null); + } + + /** + * Start specified task. + * + * @param taskId Task Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse startTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = startTaskRequestBuilder(taskId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -294,8 +455,8 @@ public ApiResponse startTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nulla } } - private HttpRequest.Builder startTaskRequestBuilder(@org.eclipse.jdt.annotation.Nullable String taskId) - throws ApiException { + private HttpRequest.Builder startTaskRequestBuilder(@org.eclipse.jdt.annotation.Nullable String taskId, + Map headers) throws ApiException { // verify the required parameter 'taskId' is set if (taskId == null) { throw new ApiException(400, "Missing the required parameter 'taskId' when calling startTask"); @@ -315,6 +476,8 @@ private HttpRequest.Builder startTaskRequestBuilder(@org.eclipse.jdt.annotation. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -328,7 +491,19 @@ private HttpRequest.Builder startTaskRequestBuilder(@org.eclipse.jdt.annotation. * @throws ApiException if fails to make API call */ public void stopTask(@org.eclipse.jdt.annotation.Nullable String taskId) throws ApiException { - stopTaskWithHttpInfo(taskId); + stopTask(taskId, null); + } + + /** + * Stop specified task. + * + * @param taskId Task Id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void stopTask(@org.eclipse.jdt.annotation.Nullable String taskId, Map headers) + throws ApiException { + stopTaskWithHttpInfo(taskId, headers); } /** @@ -340,7 +515,20 @@ public void stopTask(@org.eclipse.jdt.annotation.Nullable String taskId) throws */ public ApiResponse stopTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = stopTaskRequestBuilder(taskId); + return stopTaskWithHttpInfo(taskId, null); + } + + /** + * Stop specified task. + * + * @param taskId Task Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse stopTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = stopTaskRequestBuilder(taskId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -367,8 +555,8 @@ public ApiResponse stopTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullab } } - private HttpRequest.Builder stopTaskRequestBuilder(@org.eclipse.jdt.annotation.Nullable String taskId) - throws ApiException { + private HttpRequest.Builder stopTaskRequestBuilder(@org.eclipse.jdt.annotation.Nullable String taskId, + Map headers) throws ApiException { // verify the required parameter 'taskId' is set if (taskId == null) { throw new ApiException(400, "Missing the required parameter 'taskId' when calling stopTask"); @@ -388,6 +576,8 @@ private HttpRequest.Builder stopTaskRequestBuilder(@org.eclipse.jdt.annotation.N if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -403,7 +593,21 @@ private HttpRequest.Builder stopTaskRequestBuilder(@org.eclipse.jdt.annotation.N */ public void updateTask(@org.eclipse.jdt.annotation.Nullable String taskId, @org.eclipse.jdt.annotation.Nullable List taskTriggerInfo) throws ApiException { - updateTaskWithHttpInfo(taskId, taskTriggerInfo); + updateTask(taskId, taskTriggerInfo, null); + } + + /** + * Update specified task triggers. + * + * @param taskId Task Id. (required) + * @param taskTriggerInfo Triggers. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateTask(@org.eclipse.jdt.annotation.Nullable String taskId, + @org.eclipse.jdt.annotation.Nullable List taskTriggerInfo, Map headers) + throws ApiException { + updateTaskWithHttpInfo(taskId, taskTriggerInfo, headers); } /** @@ -416,7 +620,22 @@ public void updateTask(@org.eclipse.jdt.annotation.Nullable String taskId, */ public ApiResponse updateTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId, @org.eclipse.jdt.annotation.Nullable List taskTriggerInfo) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateTaskRequestBuilder(taskId, taskTriggerInfo); + return updateTaskWithHttpInfo(taskId, taskTriggerInfo, null); + } + + /** + * Update specified task triggers. + * + * @param taskId Task Id. (required) + * @param taskTriggerInfo Triggers. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId, + @org.eclipse.jdt.annotation.Nullable List taskTriggerInfo, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateTaskRequestBuilder(taskId, taskTriggerInfo, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -444,7 +663,8 @@ public ApiResponse updateTaskWithHttpInfo(@org.eclipse.jdt.annotation.Null } private HttpRequest.Builder updateTaskRequestBuilder(@org.eclipse.jdt.annotation.Nullable String taskId, - @org.eclipse.jdt.annotation.Nullable List taskTriggerInfo) throws ApiException { + @org.eclipse.jdt.annotation.Nullable List taskTriggerInfo, Map headers) + throws ApiException { // verify the required parameter 'taskId' is set if (taskId == null) { throw new ApiException(400, "Missing the required parameter 'taskId' when calling updateTask"); @@ -474,6 +694,8 @@ private HttpRequest.Builder updateTaskRequestBuilder(@org.eclipse.jdt.annotation if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SearchApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SearchApi.java index 3a83976b8cbf1..97990c934c5a0 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SearchApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SearchApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -39,6 +41,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class SearchApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -74,6 +98,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets the search hint result. * @@ -116,9 +190,58 @@ public SearchHintResult getSearchHints(@org.eclipse.jdt.annotation.Nullable Stri @org.eclipse.jdt.annotation.NonNull Boolean includeGenres, @org.eclipse.jdt.annotation.NonNull Boolean includeStudios, @org.eclipse.jdt.annotation.NonNull Boolean includeArtists) throws ApiException { + return getSearchHints(searchTerm, startIndex, limit, userId, includeItemTypes, excludeItemTypes, mediaTypes, + parentId, isMovie, isSeries, isNews, isKids, isSports, includePeople, includeMedia, includeGenres, + includeStudios, includeArtists, null); + } + + /** + * Gets the search hint result. + * + * @param searchTerm The search term to filter on. (required) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param userId Optional. Supply a user id to search within a user's library or omit to search all. (optional) + * @param includeItemTypes If specified, only results with the specified item types are returned. This allows + * multiple, comma delimited. (optional) + * @param excludeItemTypes If specified, results with these item types are filtered out. This allows multiple, comma + * delimited. (optional) + * @param mediaTypes If specified, only results with the specified media types are returned. This allows multiple, + * comma delimited. (optional) + * @param parentId If specified, only children of the parent are returned. (optional) + * @param isMovie Optional filter for movies. (optional) + * @param isSeries Optional filter for series. (optional) + * @param isNews Optional filter for news. (optional) + * @param isKids Optional filter for kids. (optional) + * @param isSports Optional filter for sports. (optional) + * @param includePeople Optional filter whether to include people. (optional, default to true) + * @param includeMedia Optional filter whether to include media. (optional, default to true) + * @param includeGenres Optional filter whether to include genres. (optional, default to true) + * @param includeStudios Optional filter whether to include studios. (optional, default to true) + * @param includeArtists Optional filter whether to include artists. (optional, default to true) + * @param headers Optional headers to include in the request + * @return SearchHintResult + * @throws ApiException if fails to make API call + */ + public SearchHintResult getSearchHints(@org.eclipse.jdt.annotation.Nullable String searchTerm, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean includePeople, + @org.eclipse.jdt.annotation.NonNull Boolean includeMedia, + @org.eclipse.jdt.annotation.NonNull Boolean includeGenres, + @org.eclipse.jdt.annotation.NonNull Boolean includeStudios, + @org.eclipse.jdt.annotation.NonNull Boolean includeArtists, Map headers) + throws ApiException { ApiResponse localVarResponse = getSearchHintsWithHttpInfo(searchTerm, startIndex, limit, userId, includeItemTypes, excludeItemTypes, mediaTypes, parentId, isMovie, isSeries, isNews, isKids, - isSports, includePeople, includeMedia, includeGenres, includeStudios, includeArtists); + isSports, includePeople, includeMedia, includeGenres, includeStudios, includeArtists, headers); return localVarResponse.getData(); } @@ -165,9 +288,59 @@ public ApiResponse getSearchHintsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Boolean includeGenres, @org.eclipse.jdt.annotation.NonNull Boolean includeStudios, @org.eclipse.jdt.annotation.NonNull Boolean includeArtists) throws ApiException { + return getSearchHintsWithHttpInfo(searchTerm, startIndex, limit, userId, includeItemTypes, excludeItemTypes, + mediaTypes, parentId, isMovie, isSeries, isNews, isKids, isSports, includePeople, includeMedia, + includeGenres, includeStudios, includeArtists, null); + } + + /** + * Gets the search hint result. + * + * @param searchTerm The search term to filter on. (required) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param userId Optional. Supply a user id to search within a user's library or omit to search all. (optional) + * @param includeItemTypes If specified, only results with the specified item types are returned. This allows + * multiple, comma delimited. (optional) + * @param excludeItemTypes If specified, results with these item types are filtered out. This allows multiple, comma + * delimited. (optional) + * @param mediaTypes If specified, only results with the specified media types are returned. This allows multiple, + * comma delimited. (optional) + * @param parentId If specified, only children of the parent are returned. (optional) + * @param isMovie Optional filter for movies. (optional) + * @param isSeries Optional filter for series. (optional) + * @param isNews Optional filter for news. (optional) + * @param isKids Optional filter for kids. (optional) + * @param isSports Optional filter for sports. (optional) + * @param includePeople Optional filter whether to include people. (optional, default to true) + * @param includeMedia Optional filter whether to include media. (optional, default to true) + * @param includeGenres Optional filter whether to include genres. (optional, default to true) + * @param includeStudios Optional filter whether to include studios. (optional, default to true) + * @param includeArtists Optional filter whether to include artists. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<SearchHintResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSearchHintsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String searchTerm, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean includePeople, + @org.eclipse.jdt.annotation.NonNull Boolean includeMedia, + @org.eclipse.jdt.annotation.NonNull Boolean includeGenres, + @org.eclipse.jdt.annotation.NonNull Boolean includeStudios, + @org.eclipse.jdt.annotation.NonNull Boolean includeArtists, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getSearchHintsRequestBuilder(searchTerm, startIndex, limit, userId, includeItemTypes, excludeItemTypes, mediaTypes, parentId, isMovie, isSeries, isNews, isKids, isSports, - includePeople, includeMedia, includeGenres, includeStudios, includeArtists); + includePeople, includeMedia, includeGenres, includeStudios, includeArtists, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -184,12 +357,14 @@ public ApiResponse getSearchHintsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + SearchHintResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -213,7 +388,8 @@ private HttpRequest.Builder getSearchHintsRequestBuilder(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.NonNull Boolean includeMedia, @org.eclipse.jdt.annotation.NonNull Boolean includeGenres, @org.eclipse.jdt.annotation.NonNull Boolean includeStudios, - @org.eclipse.jdt.annotation.NonNull Boolean includeArtists) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean includeArtists, Map headers) + throws ApiException { // verify the required parameter 'searchTerm' is set if (searchTerm == null) { throw new ApiException(400, "Missing the required parameter 'searchTerm' when calling getSearchHints"); @@ -281,6 +457,8 @@ private HttpRequest.Builder getSearchHintsRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SessionApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SessionApi.java index 045df6b7226ae..c51cac6ccd01f 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SessionApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SessionApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -46,6 +48,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class SessionApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -81,6 +105,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Adds an additional user to a session. * @@ -90,7 +164,20 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public void addUserToSession(@org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { - addUserToSessionWithHttpInfo(sessionId, userId); + addUserToSession(sessionId, userId, null); + } + + /** + * Adds an additional user to a session. + * + * @param sessionId The session id. (required) + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void addUserToSession(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { + addUserToSessionWithHttpInfo(sessionId, userId, headers); } /** @@ -103,7 +190,21 @@ public void addUserToSession(@org.eclipse.jdt.annotation.Nullable String session */ public ApiResponse addUserToSessionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = addUserToSessionRequestBuilder(sessionId, userId); + return addUserToSessionWithHttpInfo(sessionId, userId, null); + } + + /** + * Adds an additional user to a session. + * + * @param sessionId The session id. (required) + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addUserToSessionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addUserToSessionRequestBuilder(sessionId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -131,7 +232,7 @@ public ApiResponse addUserToSessionWithHttpInfo(@org.eclipse.jdt.annotatio } private HttpRequest.Builder addUserToSessionRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, - @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { // verify the required parameter 'sessionId' is set if (sessionId == null) { throw new ApiException(400, "Missing the required parameter 'sessionId' when calling addUserToSession"); @@ -155,6 +256,8 @@ private HttpRequest.Builder addUserToSessionRequestBuilder(@org.eclipse.jdt.anno if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -174,7 +277,24 @@ public void displayContent(@org.eclipse.jdt.annotation.Nullable String sessionId @org.eclipse.jdt.annotation.Nullable BaseItemKind itemType, @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String itemName) throws ApiException { - displayContentWithHttpInfo(sessionId, itemType, itemId, itemName); + displayContent(sessionId, itemType, itemId, itemName, null); + } + + /** + * Instructs a session to browse to an item or view. + * + * @param sessionId The session Id. (required) + * @param itemType The type of item to browse to. (required) + * @param itemId The Id of the item. (required) + * @param itemName The name of the item. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void displayContent(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable BaseItemKind itemType, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String itemName, + Map headers) throws ApiException { + displayContentWithHttpInfo(sessionId, itemType, itemId, itemName, headers); } /** @@ -191,8 +311,26 @@ public ApiResponse displayContentWithHttpInfo(@org.eclipse.jdt.annotation. @org.eclipse.jdt.annotation.Nullable BaseItemKind itemType, @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String itemName) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = displayContentRequestBuilder(sessionId, itemType, itemId, - itemName); + return displayContentWithHttpInfo(sessionId, itemType, itemId, itemName, null); + } + + /** + * Instructs a session to browse to an item or view. + * + * @param sessionId The session Id. (required) + * @param itemType The type of item to browse to. (required) + * @param itemId The Id of the item. (required) + * @param itemName The name of the item. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse displayContentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable BaseItemKind itemType, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String itemName, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = displayContentRequestBuilder(sessionId, itemType, itemId, itemName, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -221,8 +359,8 @@ public ApiResponse displayContentWithHttpInfo(@org.eclipse.jdt.annotation. private HttpRequest.Builder displayContentRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable BaseItemKind itemType, - @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String itemName) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String itemName, + Map headers) throws ApiException { // verify the required parameter 'sessionId' is set if (sessionId == null) { throw new ApiException(400, "Missing the required parameter 'sessionId' when calling displayContent"); @@ -272,6 +410,8 @@ private HttpRequest.Builder displayContentRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -285,7 +425,18 @@ private HttpRequest.Builder displayContentRequestBuilder(@org.eclipse.jdt.annota * @throws ApiException if fails to make API call */ public List getAuthProviders() throws ApiException { - ApiResponse> localVarResponse = getAuthProvidersWithHttpInfo(); + return getAuthProviders(null); + } + + /** + * Get all auth providers. + * + * @param headers Optional headers to include in the request + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getAuthProviders(Map headers) throws ApiException { + ApiResponse> localVarResponse = getAuthProvidersWithHttpInfo(headers); return localVarResponse.getData(); } @@ -296,7 +447,18 @@ public List getAuthProviders() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getAuthProvidersWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getAuthProvidersRequestBuilder(); + return getAuthProvidersWithHttpInfo(null); + } + + /** + * Get all auth providers. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getAuthProvidersWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAuthProvidersRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -313,12 +475,14 @@ public ApiResponse> getAuthProvidersWithHttpInfo() throws ApiEx } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -329,7 +493,7 @@ public ApiResponse> getAuthProvidersWithHttpInfo() throws ApiEx } } - private HttpRequest.Builder getAuthProvidersRequestBuilder() throws ApiException { + private HttpRequest.Builder getAuthProvidersRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -344,6 +508,8 @@ private HttpRequest.Builder getAuthProvidersRequestBuilder() throws ApiException if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -357,7 +523,18 @@ private HttpRequest.Builder getAuthProvidersRequestBuilder() throws ApiException * @throws ApiException if fails to make API call */ public List getPasswordResetProviders() throws ApiException { - ApiResponse> localVarResponse = getPasswordResetProvidersWithHttpInfo(); + return getPasswordResetProviders(null); + } + + /** + * Get all password reset providers. + * + * @param headers Optional headers to include in the request + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getPasswordResetProviders(Map headers) throws ApiException { + ApiResponse> localVarResponse = getPasswordResetProvidersWithHttpInfo(headers); return localVarResponse.getData(); } @@ -368,7 +545,19 @@ public List getPasswordResetProviders() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getPasswordResetProvidersWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPasswordResetProvidersRequestBuilder(); + return getPasswordResetProvidersWithHttpInfo(null); + } + + /** + * Get all password reset providers. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPasswordResetProvidersWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPasswordResetProvidersRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -385,12 +574,14 @@ public ApiResponse> getPasswordResetProvidersWithHttpInfo() thr } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -401,7 +592,8 @@ public ApiResponse> getPasswordResetProvidersWithHttpInfo() thr } } - private HttpRequest.Builder getPasswordResetProvidersRequestBuilder() throws ApiException { + private HttpRequest.Builder getPasswordResetProvidersRequestBuilder(Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -416,6 +608,8 @@ private HttpRequest.Builder getPasswordResetProvidersRequestBuilder() throws Api if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -434,8 +628,25 @@ private HttpRequest.Builder getPasswordResetProvidersRequestBuilder() throws Api public List getSessions(@org.eclipse.jdt.annotation.NonNull UUID controllableByUserId, @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull Integer activeWithinSeconds) throws ApiException { + return getSessions(controllableByUserId, deviceId, activeWithinSeconds, null); + } + + /** + * Gets a list of sessions. + * + * @param controllableByUserId Filter by sessions that a given user is allowed to remote control. (optional) + * @param deviceId Filter by device Id. (optional) + * @param activeWithinSeconds Optional. Filter by sessions that were active in the last n seconds. (optional) + * @param headers Optional headers to include in the request + * @return List<SessionInfoDto> + * @throws ApiException if fails to make API call + */ + public List getSessions(@org.eclipse.jdt.annotation.NonNull UUID controllableByUserId, + @org.eclipse.jdt.annotation.NonNull String deviceId, + @org.eclipse.jdt.annotation.NonNull Integer activeWithinSeconds, Map headers) + throws ApiException { ApiResponse> localVarResponse = getSessionsWithHttpInfo(controllableByUserId, deviceId, - activeWithinSeconds); + activeWithinSeconds, headers); return localVarResponse.getData(); } @@ -452,8 +663,26 @@ public ApiResponse> getSessionsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull UUID controllableByUserId, @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull Integer activeWithinSeconds) throws ApiException { + return getSessionsWithHttpInfo(controllableByUserId, deviceId, activeWithinSeconds, null); + } + + /** + * Gets a list of sessions. + * + * @param controllableByUserId Filter by sessions that a given user is allowed to remote control. (optional) + * @param deviceId Filter by device Id. (optional) + * @param activeWithinSeconds Optional. Filter by sessions that were active in the last n seconds. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<SessionInfoDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getSessionsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID controllableByUserId, + @org.eclipse.jdt.annotation.NonNull String deviceId, + @org.eclipse.jdt.annotation.NonNull Integer activeWithinSeconds, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getSessionsRequestBuilder(controllableByUserId, deviceId, - activeWithinSeconds); + activeWithinSeconds, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -470,14 +699,14 @@ public ApiResponse> getSessionsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -490,7 +719,8 @@ public ApiResponse> getSessionsWithHttpInfo( private HttpRequest.Builder getSessionsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID controllableByUserId, @org.eclipse.jdt.annotation.NonNull String deviceId, - @org.eclipse.jdt.annotation.NonNull Integer activeWithinSeconds) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer activeWithinSeconds, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -524,6 +754,8 @@ private HttpRequest.Builder getSessionsRequestBuilder(@org.eclipse.jdt.annotatio if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -552,8 +784,35 @@ public void play(@org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, @org.eclipse.jdt.annotation.NonNull Integer startIndex) throws ApiException { + play(sessionId, playCommand, itemIds, startPositionTicks, mediaSourceId, audioStreamIndex, subtitleStreamIndex, + startIndex, null); + } + + /** + * Instructs a session to play an item. + * + * @param sessionId The session id. (required) + * @param playCommand The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet + * implemented play next and play last may play now. (required) + * @param itemIds The ids of the items to play, comma delimited. (required) + * @param startPositionTicks The starting position of the first item. (optional) + * @param mediaSourceId Optional. The media source id. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to play. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to play. (optional) + * @param startIndex Optional. The start index. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void play(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlayCommand playCommand, + @org.eclipse.jdt.annotation.Nullable List itemIds, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, Map headers) throws ApiException { playWithHttpInfo(sessionId, playCommand, itemIds, startPositionTicks, mediaSourceId, audioStreamIndex, - subtitleStreamIndex, startIndex); + subtitleStreamIndex, startIndex, headers); } /** @@ -579,8 +838,36 @@ public ApiResponse playWithHttpInfo(@org.eclipse.jdt.annotation.Nullable S @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, @org.eclipse.jdt.annotation.NonNull Integer startIndex) throws ApiException { + return playWithHttpInfo(sessionId, playCommand, itemIds, startPositionTicks, mediaSourceId, audioStreamIndex, + subtitleStreamIndex, startIndex, null); + } + + /** + * Instructs a session to play an item. + * + * @param sessionId The session id. (required) + * @param playCommand The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet + * implemented play next and play last may play now. (required) + * @param itemIds The ids of the items to play, comma delimited. (required) + * @param startPositionTicks The starting position of the first item. (optional) + * @param mediaSourceId Optional. The media source id. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to play. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to play. (optional) + * @param startIndex Optional. The start index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse playWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlayCommand playCommand, + @org.eclipse.jdt.annotation.Nullable List itemIds, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = playRequestBuilder(sessionId, playCommand, itemIds, - startPositionTicks, mediaSourceId, audioStreamIndex, subtitleStreamIndex, startIndex); + startPositionTicks, mediaSourceId, audioStreamIndex, subtitleStreamIndex, startIndex, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -614,7 +901,7 @@ private HttpRequest.Builder playRequestBuilder(@org.eclipse.jdt.annotation.Nulla @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, - @org.eclipse.jdt.annotation.NonNull Integer startIndex) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer startIndex, Map headers) throws ApiException { // verify the required parameter 'sessionId' is set if (sessionId == null) { throw new ApiException(400, "Missing the required parameter 'sessionId' when calling play"); @@ -668,6 +955,8 @@ private HttpRequest.Builder playRequestBuilder(@org.eclipse.jdt.annotation.Nulla if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -690,8 +979,30 @@ public void postCapabilities(@org.eclipse.jdt.annotation.NonNull String id, @org.eclipse.jdt.annotation.NonNull List supportedCommands, @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl, @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier) throws ApiException { + postCapabilities(id, playableMediaTypes, supportedCommands, supportsMediaControl, supportsPersistentIdentifier, + null); + } + + /** + * Updates capabilities for a device. + * + * @param id The session id. (optional) + * @param playableMediaTypes A list of playable media types, comma delimited. Audio, Video, Book, Photo. (optional) + * @param supportedCommands A list of supported remote control commands, comma delimited. (optional) + * @param supportsMediaControl Determines whether media can be played remotely.. (optional, default to false) + * @param supportsPersistentIdentifier Determines whether the device supports a unique identifier. (optional, + * default to true) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postCapabilities(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull List playableMediaTypes, + @org.eclipse.jdt.annotation.NonNull List supportedCommands, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl, + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier, Map headers) + throws ApiException { postCapabilitiesWithHttpInfo(id, playableMediaTypes, supportedCommands, supportsMediaControl, - supportsPersistentIdentifier); + supportsPersistentIdentifier, headers); } /** @@ -711,8 +1022,31 @@ public ApiResponse postCapabilitiesWithHttpInfo(@org.eclipse.jdt.annotatio @org.eclipse.jdt.annotation.NonNull List supportedCommands, @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl, @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier) throws ApiException { + return postCapabilitiesWithHttpInfo(id, playableMediaTypes, supportedCommands, supportsMediaControl, + supportsPersistentIdentifier, null); + } + + /** + * Updates capabilities for a device. + * + * @param id The session id. (optional) + * @param playableMediaTypes A list of playable media types, comma delimited. Audio, Video, Book, Photo. (optional) + * @param supportedCommands A list of supported remote control commands, comma delimited. (optional) + * @param supportsMediaControl Determines whether media can be played remotely.. (optional, default to false) + * @param supportsPersistentIdentifier Determines whether the device supports a unique identifier. (optional, + * default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postCapabilitiesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull List playableMediaTypes, + @org.eclipse.jdt.annotation.NonNull List supportedCommands, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl, + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = postCapabilitiesRequestBuilder(id, playableMediaTypes, - supportedCommands, supportsMediaControl, supportsPersistentIdentifier); + supportedCommands, supportsMediaControl, supportsPersistentIdentifier, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -743,7 +1077,8 @@ private HttpRequest.Builder postCapabilitiesRequestBuilder(@org.eclipse.jdt.anno @org.eclipse.jdt.annotation.NonNull List playableMediaTypes, @org.eclipse.jdt.annotation.NonNull List supportedCommands, @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl, - @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -781,6 +1116,8 @@ private HttpRequest.Builder postCapabilitiesRequestBuilder(@org.eclipse.jdt.anno if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -796,7 +1133,20 @@ private HttpRequest.Builder postCapabilitiesRequestBuilder(@org.eclipse.jdt.anno */ public void postFullCapabilities(@org.eclipse.jdt.annotation.Nullable ClientCapabilitiesDto clientCapabilitiesDto, @org.eclipse.jdt.annotation.NonNull String id) throws ApiException { - postFullCapabilitiesWithHttpInfo(clientCapabilitiesDto, id); + postFullCapabilities(clientCapabilitiesDto, id, null); + } + + /** + * Updates capabilities for a device. + * + * @param clientCapabilitiesDto The MediaBrowser.Model.Session.ClientCapabilities. (required) + * @param id The session id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postFullCapabilities(@org.eclipse.jdt.annotation.Nullable ClientCapabilitiesDto clientCapabilitiesDto, + @org.eclipse.jdt.annotation.NonNull String id, Map headers) throws ApiException { + postFullCapabilitiesWithHttpInfo(clientCapabilitiesDto, id, headers); } /** @@ -810,7 +1160,23 @@ public void postFullCapabilities(@org.eclipse.jdt.annotation.Nullable ClientCapa public ApiResponse postFullCapabilitiesWithHttpInfo( @org.eclipse.jdt.annotation.Nullable ClientCapabilitiesDto clientCapabilitiesDto, @org.eclipse.jdt.annotation.NonNull String id) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = postFullCapabilitiesRequestBuilder(clientCapabilitiesDto, id); + return postFullCapabilitiesWithHttpInfo(clientCapabilitiesDto, id, null); + } + + /** + * Updates capabilities for a device. + * + * @param clientCapabilitiesDto The MediaBrowser.Model.Session.ClientCapabilities. (required) + * @param id The session id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postFullCapabilitiesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ClientCapabilitiesDto clientCapabilitiesDto, + @org.eclipse.jdt.annotation.NonNull String id, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postFullCapabilitiesRequestBuilder(clientCapabilitiesDto, id, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -839,7 +1205,7 @@ public ApiResponse postFullCapabilitiesWithHttpInfo( private HttpRequest.Builder postFullCapabilitiesRequestBuilder( @org.eclipse.jdt.annotation.Nullable ClientCapabilitiesDto clientCapabilitiesDto, - @org.eclipse.jdt.annotation.NonNull String id) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String id, Map headers) throws ApiException { // verify the required parameter 'clientCapabilitiesDto' is set if (clientCapabilitiesDto == null) { throw new ApiException(400, @@ -879,6 +1245,8 @@ private HttpRequest.Builder postFullCapabilitiesRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -894,7 +1262,20 @@ private HttpRequest.Builder postFullCapabilitiesRequestBuilder( */ public void removeUserFromSession(@org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { - removeUserFromSessionWithHttpInfo(sessionId, userId); + removeUserFromSession(sessionId, userId, null); + } + + /** + * Removes an additional user from a session. + * + * @param sessionId The session id. (required) + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void removeUserFromSession(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { + removeUserFromSessionWithHttpInfo(sessionId, userId, headers); } /** @@ -907,7 +1288,21 @@ public void removeUserFromSession(@org.eclipse.jdt.annotation.Nullable String se */ public ApiResponse removeUserFromSessionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = removeUserFromSessionRequestBuilder(sessionId, userId); + return removeUserFromSessionWithHttpInfo(sessionId, userId, null); + } + + /** + * Removes an additional user from a session. + * + * @param sessionId The session id. (required) + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeUserFromSessionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeUserFromSessionRequestBuilder(sessionId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -935,8 +1330,8 @@ public ApiResponse removeUserFromSessionWithHttpInfo(@org.eclipse.jdt.anno } private HttpRequest.Builder removeUserFromSessionRequestBuilder( - @org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable UUID userId) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { // verify the required parameter 'sessionId' is set if (sessionId == null) { throw new ApiException(400, @@ -961,6 +1356,8 @@ private HttpRequest.Builder removeUserFromSessionRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -973,7 +1370,17 @@ private HttpRequest.Builder removeUserFromSessionRequestBuilder( * @throws ApiException if fails to make API call */ public void reportSessionEnded() throws ApiException { - reportSessionEndedWithHttpInfo(); + reportSessionEnded(null); + } + + /** + * Reports that a session has ended. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void reportSessionEnded(Map headers) throws ApiException { + reportSessionEndedWithHttpInfo(headers); } /** @@ -983,7 +1390,18 @@ public void reportSessionEnded() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse reportSessionEndedWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = reportSessionEndedRequestBuilder(); + return reportSessionEndedWithHttpInfo(null); + } + + /** + * Reports that a session has ended. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportSessionEndedWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = reportSessionEndedRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1010,7 +1428,7 @@ public ApiResponse reportSessionEndedWithHttpInfo() throws ApiException { } } - private HttpRequest.Builder reportSessionEndedRequestBuilder() throws ApiException { + private HttpRequest.Builder reportSessionEndedRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -1024,6 +1442,8 @@ private HttpRequest.Builder reportSessionEndedRequestBuilder() throws ApiExcepti if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1039,7 +1459,20 @@ private HttpRequest.Builder reportSessionEndedRequestBuilder() throws ApiExcepti */ public void reportViewing(@org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.NonNull String sessionId) throws ApiException { - reportViewingWithHttpInfo(itemId, sessionId); + reportViewing(itemId, sessionId, null); + } + + /** + * Reports that a session is viewing an item. + * + * @param itemId The item id. (required) + * @param sessionId The session id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void reportViewing(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.NonNull String sessionId, Map headers) throws ApiException { + reportViewingWithHttpInfo(itemId, sessionId, headers); } /** @@ -1052,7 +1485,21 @@ public void reportViewing(@org.eclipse.jdt.annotation.Nullable String itemId, */ public ApiResponse reportViewingWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.NonNull String sessionId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = reportViewingRequestBuilder(itemId, sessionId); + return reportViewingWithHttpInfo(itemId, sessionId, null); + } + + /** + * Reports that a session is viewing an item. + * + * @param itemId The item id. (required) + * @param sessionId The session id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportViewingWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.NonNull String sessionId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = reportViewingRequestBuilder(itemId, sessionId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1080,7 +1527,7 @@ public ApiResponse reportViewingWithHttpInfo(@org.eclipse.jdt.annotation.N } private HttpRequest.Builder reportViewingRequestBuilder(@org.eclipse.jdt.annotation.Nullable String itemId, - @org.eclipse.jdt.annotation.NonNull String sessionId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String sessionId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling reportViewing"); @@ -1115,6 +1562,8 @@ private HttpRequest.Builder reportViewingRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1130,7 +1579,21 @@ private HttpRequest.Builder reportViewingRequestBuilder(@org.eclipse.jdt.annotat */ public void sendFullGeneralCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable GeneralCommand generalCommand) throws ApiException { - sendFullGeneralCommandWithHttpInfo(sessionId, generalCommand); + sendFullGeneralCommand(sessionId, generalCommand, null); + } + + /** + * Issues a full general command to a client. + * + * @param sessionId The session id. (required) + * @param generalCommand The MediaBrowser.Model.Session.GeneralCommand. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void sendFullGeneralCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommand generalCommand, Map headers) + throws ApiException { + sendFullGeneralCommandWithHttpInfo(sessionId, generalCommand, headers); } /** @@ -1143,7 +1606,23 @@ public void sendFullGeneralCommand(@org.eclipse.jdt.annotation.Nullable String s */ public ApiResponse sendFullGeneralCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable GeneralCommand generalCommand) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = sendFullGeneralCommandRequestBuilder(sessionId, generalCommand); + return sendFullGeneralCommandWithHttpInfo(sessionId, generalCommand, null); + } + + /** + * Issues a full general command to a client. + * + * @param sessionId The session id. (required) + * @param generalCommand The MediaBrowser.Model.Session.GeneralCommand. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendFullGeneralCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommand generalCommand, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendFullGeneralCommandRequestBuilder(sessionId, generalCommand, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1172,7 +1651,8 @@ public ApiResponse sendFullGeneralCommandWithHttpInfo(@org.eclipse.jdt.ann private HttpRequest.Builder sendFullGeneralCommandRequestBuilder( @org.eclipse.jdt.annotation.Nullable String sessionId, - @org.eclipse.jdt.annotation.Nullable GeneralCommand generalCommand) throws ApiException { + @org.eclipse.jdt.annotation.Nullable GeneralCommand generalCommand, Map headers) + throws ApiException { // verify the required parameter 'sessionId' is set if (sessionId == null) { throw new ApiException(400, @@ -1203,6 +1683,8 @@ private HttpRequest.Builder sendFullGeneralCommandRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1218,7 +1700,21 @@ private HttpRequest.Builder sendFullGeneralCommandRequestBuilder( */ public void sendGeneralCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable GeneralCommandType command) throws ApiException { - sendGeneralCommandWithHttpInfo(sessionId, command); + sendGeneralCommand(sessionId, command, null); + } + + /** + * Issues a general command to a client. + * + * @param sessionId The session id. (required) + * @param command The command to send. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void sendGeneralCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command, Map headers) + throws ApiException { + sendGeneralCommandWithHttpInfo(sessionId, command, headers); } /** @@ -1231,7 +1727,22 @@ public void sendGeneralCommand(@org.eclipse.jdt.annotation.Nullable String sessi */ public ApiResponse sendGeneralCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable GeneralCommandType command) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = sendGeneralCommandRequestBuilder(sessionId, command); + return sendGeneralCommandWithHttpInfo(sessionId, command, null); + } + + /** + * Issues a general command to a client. + * + * @param sessionId The session id. (required) + * @param command The command to send. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendGeneralCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendGeneralCommandRequestBuilder(sessionId, command, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1259,7 +1770,8 @@ public ApiResponse sendGeneralCommandWithHttpInfo(@org.eclipse.jdt.annotat } private HttpRequest.Builder sendGeneralCommandRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, - @org.eclipse.jdt.annotation.Nullable GeneralCommandType command) throws ApiException { + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command, Map headers) + throws ApiException { // verify the required parameter 'sessionId' is set if (sessionId == null) { throw new ApiException(400, "Missing the required parameter 'sessionId' when calling sendGeneralCommand"); @@ -1283,6 +1795,8 @@ private HttpRequest.Builder sendGeneralCommandRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1299,7 +1813,22 @@ private HttpRequest.Builder sendGeneralCommandRequestBuilder(@org.eclipse.jdt.an */ public void sendMessageCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable MessageCommand messageCommand) throws ApiException { - sendMessageCommandWithHttpInfo(sessionId, messageCommand); + sendMessageCommand(sessionId, messageCommand, null); + } + + /** + * Issues a command to a client to display a message to the user. + * + * @param sessionId The session id. (required) + * @param messageCommand The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and + * TimeoutMs. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void sendMessageCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable MessageCommand messageCommand, Map headers) + throws ApiException { + sendMessageCommandWithHttpInfo(sessionId, messageCommand, headers); } /** @@ -1313,7 +1842,24 @@ public void sendMessageCommand(@org.eclipse.jdt.annotation.Nullable String sessi */ public ApiResponse sendMessageCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable MessageCommand messageCommand) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = sendMessageCommandRequestBuilder(sessionId, messageCommand); + return sendMessageCommandWithHttpInfo(sessionId, messageCommand, null); + } + + /** + * Issues a command to a client to display a message to the user. + * + * @param sessionId The session id. (required) + * @param messageCommand The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and + * TimeoutMs. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendMessageCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable MessageCommand messageCommand, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendMessageCommandRequestBuilder(sessionId, messageCommand, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1341,7 +1887,8 @@ public ApiResponse sendMessageCommandWithHttpInfo(@org.eclipse.jdt.annotat } private HttpRequest.Builder sendMessageCommandRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, - @org.eclipse.jdt.annotation.Nullable MessageCommand messageCommand) throws ApiException { + @org.eclipse.jdt.annotation.Nullable MessageCommand messageCommand, Map headers) + throws ApiException { // verify the required parameter 'sessionId' is set if (sessionId == null) { throw new ApiException(400, "Missing the required parameter 'sessionId' when calling sendMessageCommand"); @@ -1371,6 +1918,8 @@ private HttpRequest.Builder sendMessageCommandRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1390,7 +1939,25 @@ public void sendPlaystateCommand(@org.eclipse.jdt.annotation.Nullable String ses @org.eclipse.jdt.annotation.Nullable PlaystateCommand command, @org.eclipse.jdt.annotation.NonNull Long seekPositionTicks, @org.eclipse.jdt.annotation.NonNull String controllingUserId) throws ApiException { - sendPlaystateCommandWithHttpInfo(sessionId, command, seekPositionTicks, controllingUserId); + sendPlaystateCommand(sessionId, command, seekPositionTicks, controllingUserId, null); + } + + /** + * Issues a playstate command to a client. + * + * @param sessionId The session id. (required) + * @param command The MediaBrowser.Model.Session.PlaystateCommand. (required) + * @param seekPositionTicks The optional position ticks. (optional) + * @param controllingUserId The optional controlling user id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void sendPlaystateCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlaystateCommand command, + @org.eclipse.jdt.annotation.NonNull Long seekPositionTicks, + @org.eclipse.jdt.annotation.NonNull String controllingUserId, Map headers) + throws ApiException { + sendPlaystateCommandWithHttpInfo(sessionId, command, seekPositionTicks, controllingUserId, headers); } /** @@ -1407,8 +1974,27 @@ public ApiResponse sendPlaystateCommandWithHttpInfo(@org.eclipse.jdt.annot @org.eclipse.jdt.annotation.Nullable PlaystateCommand command, @org.eclipse.jdt.annotation.NonNull Long seekPositionTicks, @org.eclipse.jdt.annotation.NonNull String controllingUserId) throws ApiException { + return sendPlaystateCommandWithHttpInfo(sessionId, command, seekPositionTicks, controllingUserId, null); + } + + /** + * Issues a playstate command to a client. + * + * @param sessionId The session id. (required) + * @param command The MediaBrowser.Model.Session.PlaystateCommand. (required) + * @param seekPositionTicks The optional position ticks. (optional) + * @param controllingUserId The optional controlling user id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendPlaystateCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlaystateCommand command, + @org.eclipse.jdt.annotation.NonNull Long seekPositionTicks, + @org.eclipse.jdt.annotation.NonNull String controllingUserId, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = sendPlaystateCommandRequestBuilder(sessionId, command, - seekPositionTicks, controllingUserId); + seekPositionTicks, controllingUserId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1439,7 +2025,8 @@ private HttpRequest.Builder sendPlaystateCommandRequestBuilder( @org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable PlaystateCommand command, @org.eclipse.jdt.annotation.NonNull Long seekPositionTicks, - @org.eclipse.jdt.annotation.NonNull String controllingUserId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull String controllingUserId, Map headers) + throws ApiException { // verify the required parameter 'sessionId' is set if (sessionId == null) { throw new ApiException(400, "Missing the required parameter 'sessionId' when calling sendPlaystateCommand"); @@ -1480,6 +2067,8 @@ private HttpRequest.Builder sendPlaystateCommandRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1495,7 +2084,21 @@ private HttpRequest.Builder sendPlaystateCommandRequestBuilder( */ public void sendSystemCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable GeneralCommandType command) throws ApiException { - sendSystemCommandWithHttpInfo(sessionId, command); + sendSystemCommand(sessionId, command, null); + } + + /** + * Issues a system command to a client. + * + * @param sessionId The session id. (required) + * @param command The command to send. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void sendSystemCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command, Map headers) + throws ApiException { + sendSystemCommandWithHttpInfo(sessionId, command, headers); } /** @@ -1508,7 +2111,22 @@ public void sendSystemCommand(@org.eclipse.jdt.annotation.Nullable String sessio */ public ApiResponse sendSystemCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable GeneralCommandType command) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = sendSystemCommandRequestBuilder(sessionId, command); + return sendSystemCommandWithHttpInfo(sessionId, command, null); + } + + /** + * Issues a system command to a client. + * + * @param sessionId The session id. (required) + * @param command The command to send. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendSystemCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendSystemCommandRequestBuilder(sessionId, command, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1536,7 +2154,8 @@ public ApiResponse sendSystemCommandWithHttpInfo(@org.eclipse.jdt.annotati } private HttpRequest.Builder sendSystemCommandRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, - @org.eclipse.jdt.annotation.Nullable GeneralCommandType command) throws ApiException { + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command, Map headers) + throws ApiException { // verify the required parameter 'sessionId' is set if (sessionId == null) { throw new ApiException(400, "Missing the required parameter 'sessionId' when calling sendSystemCommand"); @@ -1560,6 +2179,8 @@ private HttpRequest.Builder sendSystemCommandRequestBuilder(@org.eclipse.jdt.ann if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/StartupApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/StartupApi.java index 2a95121d4173e..b2eb2d679cf20 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/StartupApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/StartupApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -19,6 +20,7 @@ import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; +import java.util.Map; import java.util.function.Consumer; import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; @@ -34,6 +36,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class StartupApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -69,13 +93,73 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Completes the startup wizard. * * @throws ApiException if fails to make API call */ public void completeWizard() throws ApiException { - completeWizardWithHttpInfo(); + completeWizard(null); + } + + /** + * Completes the startup wizard. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void completeWizard(Map headers) throws ApiException { + completeWizardWithHttpInfo(headers); } /** @@ -85,7 +169,18 @@ public void completeWizard() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse completeWizardWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = completeWizardRequestBuilder(); + return completeWizardWithHttpInfo(null); + } + + /** + * Completes the startup wizard. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse completeWizardWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = completeWizardRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -112,7 +207,7 @@ public ApiResponse completeWizardWithHttpInfo() throws ApiException { } } - private HttpRequest.Builder completeWizardRequestBuilder() throws ApiException { + private HttpRequest.Builder completeWizardRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -126,6 +221,8 @@ private HttpRequest.Builder completeWizardRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -139,7 +236,18 @@ private HttpRequest.Builder completeWizardRequestBuilder() throws ApiException { * @throws ApiException if fails to make API call */ public StartupUserDto getFirstUser() throws ApiException { - ApiResponse localVarResponse = getFirstUserWithHttpInfo(); + return getFirstUser(null); + } + + /** + * Gets the first user. + * + * @param headers Optional headers to include in the request + * @return StartupUserDto + * @throws ApiException if fails to make API call + */ + public StartupUserDto getFirstUser(Map headers) throws ApiException { + ApiResponse localVarResponse = getFirstUserWithHttpInfo(headers); return localVarResponse.getData(); } @@ -150,7 +258,18 @@ public StartupUserDto getFirstUser() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getFirstUserWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getFirstUserRequestBuilder(); + return getFirstUserWithHttpInfo(null); + } + + /** + * Gets the first user. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<StartupUserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFirstUserWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFirstUserRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -167,12 +286,14 @@ public ApiResponse getFirstUserWithHttpInfo() throws ApiExceptio } String responseBody = new String(localVarResponse.body().readAllBytes()); + StartupUserDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -183,7 +304,7 @@ public ApiResponse getFirstUserWithHttpInfo() throws ApiExceptio } } - private HttpRequest.Builder getFirstUserRequestBuilder() throws ApiException { + private HttpRequest.Builder getFirstUserRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -198,6 +319,8 @@ private HttpRequest.Builder getFirstUserRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -211,7 +334,18 @@ private HttpRequest.Builder getFirstUserRequestBuilder() throws ApiException { * @throws ApiException if fails to make API call */ public StartupUserDto getFirstUser2() throws ApiException { - ApiResponse localVarResponse = getFirstUser2WithHttpInfo(); + return getFirstUser2(null); + } + + /** + * Gets the first user. + * + * @param headers Optional headers to include in the request + * @return StartupUserDto + * @throws ApiException if fails to make API call + */ + public StartupUserDto getFirstUser2(Map headers) throws ApiException { + ApiResponse localVarResponse = getFirstUser2WithHttpInfo(headers); return localVarResponse.getData(); } @@ -222,7 +356,18 @@ public StartupUserDto getFirstUser2() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getFirstUser2WithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getFirstUser2RequestBuilder(); + return getFirstUser2WithHttpInfo(null); + } + + /** + * Gets the first user. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<StartupUserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFirstUser2WithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFirstUser2RequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -239,12 +384,14 @@ public ApiResponse getFirstUser2WithHttpInfo() throws ApiExcepti } String responseBody = new String(localVarResponse.body().readAllBytes()); + StartupUserDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -255,7 +402,7 @@ public ApiResponse getFirstUser2WithHttpInfo() throws ApiExcepti } } - private HttpRequest.Builder getFirstUser2RequestBuilder() throws ApiException { + private HttpRequest.Builder getFirstUser2RequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -270,6 +417,8 @@ private HttpRequest.Builder getFirstUser2RequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -283,7 +432,18 @@ private HttpRequest.Builder getFirstUser2RequestBuilder() throws ApiException { * @throws ApiException if fails to make API call */ public StartupConfigurationDto getStartupConfiguration() throws ApiException { - ApiResponse localVarResponse = getStartupConfigurationWithHttpInfo(); + return getStartupConfiguration(null); + } + + /** + * Gets the initial startup wizard configuration. + * + * @param headers Optional headers to include in the request + * @return StartupConfigurationDto + * @throws ApiException if fails to make API call + */ + public StartupConfigurationDto getStartupConfiguration(Map headers) throws ApiException { + ApiResponse localVarResponse = getStartupConfigurationWithHttpInfo(headers); return localVarResponse.getData(); } @@ -294,7 +454,19 @@ public StartupConfigurationDto getStartupConfiguration() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getStartupConfigurationWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getStartupConfigurationRequestBuilder(); + return getStartupConfigurationWithHttpInfo(null); + } + + /** + * Gets the initial startup wizard configuration. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<StartupConfigurationDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStartupConfigurationWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getStartupConfigurationRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -311,14 +483,14 @@ public ApiResponse getStartupConfigurationWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + StartupConfigurationDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -329,7 +501,7 @@ public ApiResponse getStartupConfigurationWithHttpInfo( } } - private HttpRequest.Builder getStartupConfigurationRequestBuilder() throws ApiException { + private HttpRequest.Builder getStartupConfigurationRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -344,6 +516,8 @@ private HttpRequest.Builder getStartupConfigurationRequestBuilder() throws ApiEx if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -358,7 +532,19 @@ private HttpRequest.Builder getStartupConfigurationRequestBuilder() throws ApiEx */ public void setRemoteAccess(@org.eclipse.jdt.annotation.Nullable StartupRemoteAccessDto startupRemoteAccessDto) throws ApiException { - setRemoteAccessWithHttpInfo(startupRemoteAccessDto); + setRemoteAccess(startupRemoteAccessDto, null); + } + + /** + * Sets remote access and UPnP. + * + * @param startupRemoteAccessDto The startup remote access dto. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void setRemoteAccess(@org.eclipse.jdt.annotation.Nullable StartupRemoteAccessDto startupRemoteAccessDto, + Map headers) throws ApiException { + setRemoteAccessWithHttpInfo(startupRemoteAccessDto, headers); } /** @@ -370,7 +556,21 @@ public void setRemoteAccess(@org.eclipse.jdt.annotation.Nullable StartupRemoteAc */ public ApiResponse setRemoteAccessWithHttpInfo( @org.eclipse.jdt.annotation.Nullable StartupRemoteAccessDto startupRemoteAccessDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = setRemoteAccessRequestBuilder(startupRemoteAccessDto); + return setRemoteAccessWithHttpInfo(startupRemoteAccessDto, null); + } + + /** + * Sets remote access and UPnP. + * + * @param startupRemoteAccessDto The startup remote access dto. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setRemoteAccessWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable StartupRemoteAccessDto startupRemoteAccessDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = setRemoteAccessRequestBuilder(startupRemoteAccessDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -398,7 +598,8 @@ public ApiResponse setRemoteAccessWithHttpInfo( } private HttpRequest.Builder setRemoteAccessRequestBuilder( - @org.eclipse.jdt.annotation.Nullable StartupRemoteAccessDto startupRemoteAccessDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable StartupRemoteAccessDto startupRemoteAccessDto, + Map headers) throws ApiException { // verify the required parameter 'startupRemoteAccessDto' is set if (startupRemoteAccessDto == null) { throw new ApiException(400, @@ -423,6 +624,8 @@ private HttpRequest.Builder setRemoteAccessRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -437,7 +640,20 @@ private HttpRequest.Builder setRemoteAccessRequestBuilder( */ public void updateInitialConfiguration( @org.eclipse.jdt.annotation.Nullable StartupConfigurationDto startupConfigurationDto) throws ApiException { - updateInitialConfigurationWithHttpInfo(startupConfigurationDto); + updateInitialConfiguration(startupConfigurationDto, null); + } + + /** + * Sets the initial startup wizard configuration. + * + * @param startupConfigurationDto The updated startup configuration. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateInitialConfiguration( + @org.eclipse.jdt.annotation.Nullable StartupConfigurationDto startupConfigurationDto, + Map headers) throws ApiException { + updateInitialConfigurationWithHttpInfo(startupConfigurationDto, headers); } /** @@ -449,7 +665,22 @@ public void updateInitialConfiguration( */ public ApiResponse updateInitialConfigurationWithHttpInfo( @org.eclipse.jdt.annotation.Nullable StartupConfigurationDto startupConfigurationDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateInitialConfigurationRequestBuilder(startupConfigurationDto); + return updateInitialConfigurationWithHttpInfo(startupConfigurationDto, null); + } + + /** + * Sets the initial startup wizard configuration. + * + * @param startupConfigurationDto The updated startup configuration. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateInitialConfigurationWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable StartupConfigurationDto startupConfigurationDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateInitialConfigurationRequestBuilder(startupConfigurationDto, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -477,7 +708,8 @@ public ApiResponse updateInitialConfigurationWithHttpInfo( } private HttpRequest.Builder updateInitialConfigurationRequestBuilder( - @org.eclipse.jdt.annotation.Nullable StartupConfigurationDto startupConfigurationDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable StartupConfigurationDto startupConfigurationDto, + Map headers) throws ApiException { // verify the required parameter 'startupConfigurationDto' is set if (startupConfigurationDto == null) { throw new ApiException(400, @@ -502,6 +734,8 @@ private HttpRequest.Builder updateInitialConfigurationRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -516,7 +750,19 @@ private HttpRequest.Builder updateInitialConfigurationRequestBuilder( */ public void updateStartupUser(@org.eclipse.jdt.annotation.NonNull StartupUserDto startupUserDto) throws ApiException { - updateStartupUserWithHttpInfo(startupUserDto); + updateStartupUser(startupUserDto, null); + } + + /** + * Sets the user name and password. + * + * @param startupUserDto The DTO containing username and password. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateStartupUser(@org.eclipse.jdt.annotation.NonNull StartupUserDto startupUserDto, + Map headers) throws ApiException { + updateStartupUserWithHttpInfo(startupUserDto, headers); } /** @@ -528,7 +774,21 @@ public void updateStartupUser(@org.eclipse.jdt.annotation.NonNull StartupUserDto */ public ApiResponse updateStartupUserWithHttpInfo( @org.eclipse.jdt.annotation.NonNull StartupUserDto startupUserDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateStartupUserRequestBuilder(startupUserDto); + return updateStartupUserWithHttpInfo(startupUserDto, null); + } + + /** + * Sets the user name and password. + * + * @param startupUserDto The DTO containing username and password. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateStartupUserWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull StartupUserDto startupUserDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateStartupUserRequestBuilder(startupUserDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -556,7 +816,8 @@ public ApiResponse updateStartupUserWithHttpInfo( } private HttpRequest.Builder updateStartupUserRequestBuilder( - @org.eclipse.jdt.annotation.NonNull StartupUserDto startupUserDto) throws ApiException { + @org.eclipse.jdt.annotation.NonNull StartupUserDto startupUserDto, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -576,6 +837,8 @@ private HttpRequest.Builder updateStartupUserRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/StudiosApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/StudiosApi.java index 8a22e8f421271..d5d1061b65088 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/StudiosApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/StudiosApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -41,6 +43,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class StudiosApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -76,6 +100,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets a studio by name. * @@ -86,7 +160,21 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public BaseItemDto getStudio(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getStudioWithHttpInfo(name, userId); + return getStudio(name, userId, null); + } + + /** + * Gets a studio by name. + * + * @param name Studio name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getStudio(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getStudioWithHttpInfo(name, userId, headers); return localVarResponse.getData(); } @@ -100,7 +188,21 @@ public BaseItemDto getStudio(@org.eclipse.jdt.annotation.Nullable String name, */ public ApiResponse getStudioWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getStudioRequestBuilder(name, userId); + return getStudioWithHttpInfo(name, userId, null); + } + + /** + * Gets a studio by name. + * + * @param name Studio name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStudioWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getStudioRequestBuilder(name, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -117,12 +219,14 @@ public ApiResponse getStudioWithHttpInfo(@org.eclipse.jdt.annotatio } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -134,7 +238,7 @@ public ApiResponse getStudioWithHttpInfo(@org.eclipse.jdt.annotatio } private HttpRequest.Builder getStudioRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling getStudio"); @@ -168,6 +272,8 @@ private HttpRequest.Builder getStudioRequestBuilder(@org.eclipse.jdt.annotation. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -219,10 +325,62 @@ public BaseItemDtoQueryResult getStudios(@org.eclipse.jdt.annotation.NonNull Int @org.eclipse.jdt.annotation.NonNull String nameLessThan, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getStudios(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, + isFavorite, enableUserData, imageTypeLimit, enableImageTypes, userId, nameStartsWithOrGreater, + nameStartsWith, nameLessThan, enableImages, enableTotalRecordCount, null); + } + + /** + * Gets all studios from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getStudios(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { ApiResponse localVarResponse = getStudiosWithHttpInfo(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, isFavorite, enableUserData, imageTypeLimit, enableImageTypes, userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, enableImages, - enableTotalRecordCount); + enableTotalRecordCount, headers); return localVarResponse.getData(); } @@ -271,10 +429,62 @@ public ApiResponse getStudiosWithHttpInfo( @org.eclipse.jdt.annotation.NonNull String nameLessThan, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getStudiosWithHttpInfo(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, + includeItemTypes, isFavorite, enableUserData, imageTypeLimit, enableImageTypes, userId, + nameStartsWithOrGreater, nameStartsWith, nameLessThan, enableImages, enableTotalRecordCount, null); + } + + /** + * Gets all studios from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStudiosWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getStudiosRequestBuilder(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, isFavorite, enableUserData, imageTypeLimit, enableImageTypes, userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, enableImages, - enableTotalRecordCount); + enableTotalRecordCount, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -291,14 +501,14 @@ public ApiResponse getStudiosWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -324,7 +534,8 @@ private HttpRequest.Builder getStudiosRequestBuilder(@org.eclipse.jdt.annotation @org.eclipse.jdt.annotation.NonNull String nameStartsWith, @org.eclipse.jdt.annotation.NonNull String nameLessThan, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, - @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -386,6 +597,8 @@ private HttpRequest.Builder getStudiosRequestBuilder(@org.eclipse.jdt.annotation if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SubtitleApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SubtitleApi.java index 90b8857fea3ae..e8f267bc88638 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SubtitleApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SubtitleApi.java @@ -22,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -40,6 +41,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class SubtitleApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -75,6 +98,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Deletes an external subtitle file. * @@ -84,7 +157,20 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public void deleteSubtitle(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { - deleteSubtitleWithHttpInfo(itemId, index); + deleteSubtitle(itemId, index, null); + } + + /** + * Deletes an external subtitle file. + * + * @param itemId The item id. (required) + * @param index The index of the subtitle file. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteSubtitle(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index, Map headers) throws ApiException { + deleteSubtitleWithHttpInfo(itemId, index, headers); } /** @@ -97,7 +183,21 @@ public void deleteSubtitle(@org.eclipse.jdt.annotation.Nullable UUID itemId, */ public ApiResponse deleteSubtitleWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteSubtitleRequestBuilder(itemId, index); + return deleteSubtitleWithHttpInfo(itemId, index, null); + } + + /** + * Deletes an external subtitle file. + * + * @param itemId The item id. (required) + * @param index The index of the subtitle file. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteSubtitleWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteSubtitleRequestBuilder(itemId, index, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -125,7 +225,7 @@ public ApiResponse deleteSubtitleWithHttpInfo(@org.eclipse.jdt.annotation. } private HttpRequest.Builder deleteSubtitleRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { + @org.eclipse.jdt.annotation.Nullable Integer index, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteSubtitle"); @@ -150,6 +250,8 @@ private HttpRequest.Builder deleteSubtitleRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -165,7 +267,20 @@ private HttpRequest.Builder deleteSubtitleRequestBuilder(@org.eclipse.jdt.annota */ public void downloadRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String subtitleId) throws ApiException { - downloadRemoteSubtitlesWithHttpInfo(itemId, subtitleId); + downloadRemoteSubtitles(itemId, subtitleId, null); + } + + /** + * Downloads a remote subtitle. + * + * @param itemId The item id. (required) + * @param subtitleId The subtitle id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void downloadRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String subtitleId, Map headers) throws ApiException { + downloadRemoteSubtitlesWithHttpInfo(itemId, subtitleId, headers); } /** @@ -178,7 +293,21 @@ public void downloadRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable UUID it */ public ApiResponse downloadRemoteSubtitlesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String subtitleId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = downloadRemoteSubtitlesRequestBuilder(itemId, subtitleId); + return downloadRemoteSubtitlesWithHttpInfo(itemId, subtitleId, null); + } + + /** + * Downloads a remote subtitle. + * + * @param itemId The item id. (required) + * @param subtitleId The subtitle id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse downloadRemoteSubtitlesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String subtitleId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = downloadRemoteSubtitlesRequestBuilder(itemId, subtitleId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -206,7 +335,7 @@ public ApiResponse downloadRemoteSubtitlesWithHttpInfo(@org.eclipse.jdt.an } private HttpRequest.Builder downloadRemoteSubtitlesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.Nullable String subtitleId) throws ApiException { + @org.eclipse.jdt.annotation.Nullable String subtitleId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling downloadRemoteSubtitles"); @@ -232,6 +361,8 @@ private HttpRequest.Builder downloadRemoteSubtitlesRequestBuilder(@org.eclipse.j if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -246,7 +377,20 @@ private HttpRequest.Builder downloadRemoteSubtitlesRequestBuilder(@org.eclipse.j * @throws ApiException if fails to make API call */ public File getFallbackFont(@org.eclipse.jdt.annotation.Nullable String name) throws ApiException { - ApiResponse localVarResponse = getFallbackFontWithHttpInfo(name); + return getFallbackFont(name, null); + } + + /** + * Gets a fallback font file. + * + * @param name The name of the fallback font file to get. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getFallbackFont(@org.eclipse.jdt.annotation.Nullable String name, Map headers) + throws ApiException { + ApiResponse localVarResponse = getFallbackFontWithHttpInfo(name, headers); return localVarResponse.getData(); } @@ -259,7 +403,20 @@ public File getFallbackFont(@org.eclipse.jdt.annotation.Nullable String name) th */ public ApiResponse getFallbackFontWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getFallbackFontRequestBuilder(name); + return getFallbackFontWithHttpInfo(name, null); + } + + /** + * Gets a fallback font file. + * + * @param name The name of the fallback font file to get. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFallbackFontWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFallbackFontRequestBuilder(name, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -274,13 +431,13 @@ public ApiResponse getFallbackFontWithHttpInfo(@org.eclipse.jdt.annotation return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -291,8 +448,8 @@ public ApiResponse getFallbackFontWithHttpInfo(@org.eclipse.jdt.annotation } } - private HttpRequest.Builder getFallbackFontRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name) - throws ApiException { + private HttpRequest.Builder getFallbackFontRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + Map headers) throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling getFallbackFont"); @@ -310,6 +467,8 @@ private HttpRequest.Builder getFallbackFontRequestBuilder(@org.eclipse.jdt.annot if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -323,7 +482,18 @@ private HttpRequest.Builder getFallbackFontRequestBuilder(@org.eclipse.jdt.annot * @throws ApiException if fails to make API call */ public List getFallbackFontList() throws ApiException { - ApiResponse> localVarResponse = getFallbackFontListWithHttpInfo(); + return getFallbackFontList(null); + } + + /** + * Gets a list of available fallback font files. + * + * @param headers Optional headers to include in the request + * @return List<FontFile> + * @throws ApiException if fails to make API call + */ + public List getFallbackFontList(Map headers) throws ApiException { + ApiResponse> localVarResponse = getFallbackFontListWithHttpInfo(headers); return localVarResponse.getData(); } @@ -334,7 +504,19 @@ public List getFallbackFontList() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getFallbackFontListWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getFallbackFontListRequestBuilder(); + return getFallbackFontListWithHttpInfo(null); + } + + /** + * Gets a list of available fallback font files. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<FontFile>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getFallbackFontListWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFallbackFontListRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -351,12 +533,14 @@ public ApiResponse> getFallbackFontListWithHttpInfo() throws ApiE } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -367,7 +551,7 @@ public ApiResponse> getFallbackFontListWithHttpInfo() throws ApiE } } - private HttpRequest.Builder getFallbackFontListRequestBuilder() throws ApiException { + private HttpRequest.Builder getFallbackFontListRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -382,6 +566,8 @@ private HttpRequest.Builder getFallbackFontListRequestBuilder() throws ApiExcept if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -396,7 +582,20 @@ private HttpRequest.Builder getFallbackFontListRequestBuilder() throws ApiExcept * @throws ApiException if fails to make API call */ public File getRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable String subtitleId) throws ApiException { - ApiResponse localVarResponse = getRemoteSubtitlesWithHttpInfo(subtitleId); + return getRemoteSubtitles(subtitleId, null); + } + + /** + * Gets the remote subtitles. + * + * @param subtitleId The item id. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable String subtitleId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getRemoteSubtitlesWithHttpInfo(subtitleId, headers); return localVarResponse.getData(); } @@ -409,7 +608,20 @@ public File getRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable String subti */ public ApiResponse getRemoteSubtitlesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String subtitleId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getRemoteSubtitlesRequestBuilder(subtitleId); + return getRemoteSubtitlesWithHttpInfo(subtitleId, null); + } + + /** + * Gets the remote subtitles. + * + * @param subtitleId The item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRemoteSubtitlesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String subtitleId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRemoteSubtitlesRequestBuilder(subtitleId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -424,13 +636,13 @@ public ApiResponse getRemoteSubtitlesWithHttpInfo(@org.eclipse.jdt.annotat return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -441,8 +653,8 @@ public ApiResponse getRemoteSubtitlesWithHttpInfo(@org.eclipse.jdt.annotat } } - private HttpRequest.Builder getRemoteSubtitlesRequestBuilder(@org.eclipse.jdt.annotation.Nullable String subtitleId) - throws ApiException { + private HttpRequest.Builder getRemoteSubtitlesRequestBuilder(@org.eclipse.jdt.annotation.Nullable String subtitleId, + Map headers) throws ApiException { // verify the required parameter 'subtitleId' is set if (subtitleId == null) { throw new ApiException(400, "Missing the required parameter 'subtitleId' when calling getRemoteSubtitles"); @@ -461,6 +673,8 @@ private HttpRequest.Builder getRemoteSubtitlesRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -495,9 +709,43 @@ public File getSubtitle(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, @org.eclipse.jdt.annotation.NonNull Long startPositionTicks) throws ApiException { + return getSubtitle(routeItemId, routeMediaSourceId, routeIndex, routeFormat, itemId, mediaSourceId, index, + format, endPositionTicks, copyTimestamps, addVttTimeMap, startPositionTicks, null); + } + + /** + * Gets subtitles in a specified format. + * + * @param routeItemId The (route) item id. (required) + * @param routeMediaSourceId The (route) media source id. (required) + * @param routeIndex The (route) subtitle stream index. (required) + * @param routeFormat The (route) format of the returned subtitle. (required) + * @param itemId The item id. (optional) + * @param mediaSourceId The media source id. (optional) + * @param index The subtitle stream index. (optional) + * @param format The format of the returned subtitle. (optional) + * @param endPositionTicks Optional. The end position of the subtitle in ticks. (optional) + * @param copyTimestamps Optional. Whether to copy the timestamps. (optional, default to false) + * @param addVttTimeMap Optional. Whether to add a VTT time map. (optional, default to false) + * @param startPositionTicks The start position of the subtitle in ticks. (optional, default to 0) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getSubtitle(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, Map headers) + throws ApiException { ApiResponse localVarResponse = getSubtitleWithHttpInfo(routeItemId, routeMediaSourceId, routeIndex, routeFormat, itemId, mediaSourceId, index, format, endPositionTicks, copyTimestamps, addVttTimeMap, - startPositionTicks); + startPositionTicks, headers); return localVarResponse.getData(); } @@ -529,9 +777,43 @@ public ApiResponse getSubtitleWithHttpInfo(@org.eclipse.jdt.annotation.Nul @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, @org.eclipse.jdt.annotation.NonNull Long startPositionTicks) throws ApiException { + return getSubtitleWithHttpInfo(routeItemId, routeMediaSourceId, routeIndex, routeFormat, itemId, mediaSourceId, + index, format, endPositionTicks, copyTimestamps, addVttTimeMap, startPositionTicks, null); + } + + /** + * Gets subtitles in a specified format. + * + * @param routeItemId The (route) item id. (required) + * @param routeMediaSourceId The (route) media source id. (required) + * @param routeIndex The (route) subtitle stream index. (required) + * @param routeFormat The (route) format of the returned subtitle. (required) + * @param itemId The item id. (optional) + * @param mediaSourceId The media source id. (optional) + * @param index The subtitle stream index. (optional) + * @param format The format of the returned subtitle. (optional) + * @param endPositionTicks Optional. The end position of the subtitle in ticks. (optional) + * @param copyTimestamps Optional. Whether to copy the timestamps. (optional, default to false) + * @param addVttTimeMap Optional. Whether to add a VTT time map. (optional, default to false) + * @param startPositionTicks The start position of the subtitle in ticks. (optional, default to 0) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSubtitleWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getSubtitleRequestBuilder(routeItemId, routeMediaSourceId, routeIndex, routeFormat, itemId, mediaSourceId, index, format, endPositionTicks, copyTimestamps, - addVttTimeMap, startPositionTicks); + addVttTimeMap, startPositionTicks, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -546,13 +828,13 @@ public ApiResponse getSubtitleWithHttpInfo(@org.eclipse.jdt.annotation.Nul return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -572,7 +854,8 @@ private HttpRequest.Builder getSubtitleRequestBuilder(@org.eclipse.jdt.annotatio @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, - @org.eclipse.jdt.annotation.NonNull Long startPositionTicks) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, Map headers) + throws ApiException { // verify the required parameter 'routeItemId' is set if (routeItemId == null) { throw new ApiException(400, "Missing the required parameter 'routeItemId' when calling getSubtitle"); @@ -635,6 +918,8 @@ private HttpRequest.Builder getSubtitleRequestBuilder(@org.eclipse.jdt.annotatio if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -655,8 +940,27 @@ public File getSubtitlePlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId @org.eclipse.jdt.annotation.Nullable Integer index, @org.eclipse.jdt.annotation.Nullable String mediaSourceId, @org.eclipse.jdt.annotation.Nullable Integer segmentLength) throws ApiException { + return getSubtitlePlaylist(itemId, index, mediaSourceId, segmentLength, null); + } + + /** + * Gets an HLS subtitle playlist. + * + * @param itemId The item id. (required) + * @param index The subtitle stream index. (required) + * @param mediaSourceId The media source id. (required) + * @param segmentLength The subtitle segment length. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getSubtitlePlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer segmentLength, Map headers) + throws ApiException { ApiResponse localVarResponse = getSubtitlePlaylistWithHttpInfo(itemId, index, mediaSourceId, - segmentLength); + segmentLength, headers); return localVarResponse.getData(); } @@ -674,8 +978,27 @@ public ApiResponse getSubtitlePlaylistWithHttpInfo(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.Nullable Integer index, @org.eclipse.jdt.annotation.Nullable String mediaSourceId, @org.eclipse.jdt.annotation.Nullable Integer segmentLength) throws ApiException { + return getSubtitlePlaylistWithHttpInfo(itemId, index, mediaSourceId, segmentLength, null); + } + + /** + * Gets an HLS subtitle playlist. + * + * @param itemId The item id. (required) + * @param index The subtitle stream index. (required) + * @param mediaSourceId The media source id. (required) + * @param segmentLength The subtitle segment length. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSubtitlePlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer segmentLength, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getSubtitlePlaylistRequestBuilder(itemId, index, mediaSourceId, - segmentLength); + segmentLength, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -690,13 +1013,13 @@ public ApiResponse getSubtitlePlaylistWithHttpInfo(@org.eclipse.jdt.annota return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -710,7 +1033,8 @@ public ApiResponse getSubtitlePlaylistWithHttpInfo(@org.eclipse.jdt.annota private HttpRequest.Builder getSubtitlePlaylistRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable Integer index, @org.eclipse.jdt.annotation.Nullable String mediaSourceId, - @org.eclipse.jdt.annotation.Nullable Integer segmentLength) throws ApiException { + @org.eclipse.jdt.annotation.Nullable Integer segmentLength, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSubtitlePlaylist"); @@ -761,6 +1085,8 @@ private HttpRequest.Builder getSubtitlePlaylistRequestBuilder(@org.eclipse.jdt.a if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -797,9 +1123,46 @@ public File getSubtitleWithTicks(@org.eclipse.jdt.annotation.Nullable UUID route @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap) throws ApiException { + return getSubtitleWithTicks(routeItemId, routeMediaSourceId, routeIndex, routeStartPositionTicks, routeFormat, + itemId, mediaSourceId, index, startPositionTicks, format, endPositionTicks, copyTimestamps, + addVttTimeMap, null); + } + + /** + * Gets subtitles in a specified format. + * + * @param routeItemId The (route) item id. (required) + * @param routeMediaSourceId The (route) media source id. (required) + * @param routeIndex The (route) subtitle stream index. (required) + * @param routeStartPositionTicks The (route) start position of the subtitle in ticks. (required) + * @param routeFormat The (route) format of the returned subtitle. (required) + * @param itemId The item id. (optional) + * @param mediaSourceId The media source id. (optional) + * @param index The subtitle stream index. (optional) + * @param startPositionTicks The start position of the subtitle in ticks. (optional) + * @param format The format of the returned subtitle. (optional) + * @param endPositionTicks Optional. The end position of the subtitle in ticks. (optional) + * @param copyTimestamps Optional. Whether to copy the timestamps. (optional, default to false) + * @param addVttTimeMap Optional. Whether to add a VTT time map. (optional, default to false) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getSubtitleWithTicks(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable Long routeStartPositionTicks, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, Map headers) + throws ApiException { ApiResponse localVarResponse = getSubtitleWithTicksWithHttpInfo(routeItemId, routeMediaSourceId, routeIndex, routeStartPositionTicks, routeFormat, itemId, mediaSourceId, index, startPositionTicks, - format, endPositionTicks, copyTimestamps, addVttTimeMap); + format, endPositionTicks, copyTimestamps, addVttTimeMap, headers); return localVarResponse.getData(); } @@ -833,9 +1196,46 @@ public ApiResponse getSubtitleWithTicksWithHttpInfo(@org.eclipse.jdt.annot @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap) throws ApiException { + return getSubtitleWithTicksWithHttpInfo(routeItemId, routeMediaSourceId, routeIndex, routeStartPositionTicks, + routeFormat, itemId, mediaSourceId, index, startPositionTicks, format, endPositionTicks, copyTimestamps, + addVttTimeMap, null); + } + + /** + * Gets subtitles in a specified format. + * + * @param routeItemId The (route) item id. (required) + * @param routeMediaSourceId The (route) media source id. (required) + * @param routeIndex The (route) subtitle stream index. (required) + * @param routeStartPositionTicks The (route) start position of the subtitle in ticks. (required) + * @param routeFormat The (route) format of the returned subtitle. (required) + * @param itemId The item id. (optional) + * @param mediaSourceId The media source id. (optional) + * @param index The subtitle stream index. (optional) + * @param startPositionTicks The start position of the subtitle in ticks. (optional) + * @param format The format of the returned subtitle. (optional) + * @param endPositionTicks Optional. The end position of the subtitle in ticks. (optional) + * @param copyTimestamps Optional. Whether to copy the timestamps. (optional, default to false) + * @param addVttTimeMap Optional. Whether to add a VTT time map. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSubtitleWithTicksWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable Long routeStartPositionTicks, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getSubtitleWithTicksRequestBuilder(routeItemId, routeMediaSourceId, routeIndex, routeStartPositionTicks, routeFormat, itemId, mediaSourceId, index, startPositionTicks, - format, endPositionTicks, copyTimestamps, addVttTimeMap); + format, endPositionTicks, copyTimestamps, addVttTimeMap, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -850,13 +1250,13 @@ public ApiResponse getSubtitleWithTicksWithHttpInfo(@org.eclipse.jdt.annot return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -878,7 +1278,8 @@ private HttpRequest.Builder getSubtitleWithTicksRequestBuilder( @org.eclipse.jdt.annotation.NonNull String format, @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, - @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, Map headers) + throws ApiException { // verify the required parameter 'routeItemId' is set if (routeItemId == null) { throw new ApiException(400, @@ -951,6 +1352,8 @@ private HttpRequest.Builder getSubtitleWithTicksRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -969,8 +1372,25 @@ private HttpRequest.Builder getSubtitleWithTicksRequestBuilder( public List searchRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String language, @org.eclipse.jdt.annotation.NonNull Boolean isPerfectMatch) throws ApiException { + return searchRemoteSubtitles(itemId, language, isPerfectMatch, null); + } + + /** + * Search remote subtitles. + * + * @param itemId The item id. (required) + * @param language The language of the subtitles. (required) + * @param isPerfectMatch Optional. Only show subtitles which are a perfect match. (optional) + * @param headers Optional headers to include in the request + * @return List<RemoteSubtitleInfo> + * @throws ApiException if fails to make API call + */ + public List searchRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String language, + @org.eclipse.jdt.annotation.NonNull Boolean isPerfectMatch, Map headers) + throws ApiException { ApiResponse> localVarResponse = searchRemoteSubtitlesWithHttpInfo(itemId, language, - isPerfectMatch); + isPerfectMatch, headers); return localVarResponse.getData(); } @@ -986,8 +1406,25 @@ public List searchRemoteSubtitles(@org.eclipse.jdt.annotatio public ApiResponse> searchRemoteSubtitlesWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String language, @org.eclipse.jdt.annotation.NonNull Boolean isPerfectMatch) throws ApiException { + return searchRemoteSubtitlesWithHttpInfo(itemId, language, isPerfectMatch, null); + } + + /** + * Search remote subtitles. + * + * @param itemId The item id. (required) + * @param language The language of the subtitles. (required) + * @param isPerfectMatch Optional. Only show subtitles which are a perfect match. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSubtitleInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> searchRemoteSubtitlesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String language, + @org.eclipse.jdt.annotation.NonNull Boolean isPerfectMatch, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = searchRemoteSubtitlesRequestBuilder(itemId, language, - isPerfectMatch); + isPerfectMatch, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1004,14 +1441,14 @@ public ApiResponse> searchRemoteSubtitlesWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -1024,7 +1461,8 @@ public ApiResponse> searchRemoteSubtitlesWithHttpInfo( private HttpRequest.Builder searchRemoteSubtitlesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String language, - @org.eclipse.jdt.annotation.NonNull Boolean isPerfectMatch) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean isPerfectMatch, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling searchRemoteSubtitles"); @@ -1064,6 +1502,8 @@ private HttpRequest.Builder searchRemoteSubtitlesRequestBuilder(@org.eclipse.jdt if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1079,7 +1519,21 @@ private HttpRequest.Builder searchRemoteSubtitlesRequestBuilder(@org.eclipse.jdt */ public void uploadSubtitle(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable UploadSubtitleDto uploadSubtitleDto) throws ApiException { - uploadSubtitleWithHttpInfo(itemId, uploadSubtitleDto); + uploadSubtitle(itemId, uploadSubtitleDto, null); + } + + /** + * Upload an external subtitle file. + * + * @param itemId The item the subtitle belongs to. (required) + * @param uploadSubtitleDto The request body. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void uploadSubtitle(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UploadSubtitleDto uploadSubtitleDto, Map headers) + throws ApiException { + uploadSubtitleWithHttpInfo(itemId, uploadSubtitleDto, headers); } /** @@ -1092,7 +1546,22 @@ public void uploadSubtitle(@org.eclipse.jdt.annotation.Nullable UUID itemId, */ public ApiResponse uploadSubtitleWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable UploadSubtitleDto uploadSubtitleDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = uploadSubtitleRequestBuilder(itemId, uploadSubtitleDto); + return uploadSubtitleWithHttpInfo(itemId, uploadSubtitleDto, null); + } + + /** + * Upload an external subtitle file. + * + * @param itemId The item the subtitle belongs to. (required) + * @param uploadSubtitleDto The request body. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse uploadSubtitleWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UploadSubtitleDto uploadSubtitleDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uploadSubtitleRequestBuilder(itemId, uploadSubtitleDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1120,7 +1589,8 @@ public ApiResponse uploadSubtitleWithHttpInfo(@org.eclipse.jdt.annotation. } private HttpRequest.Builder uploadSubtitleRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.Nullable UploadSubtitleDto uploadSubtitleDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable UploadSubtitleDto uploadSubtitleDto, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling uploadSubtitle"); @@ -1150,6 +1620,8 @@ private HttpRequest.Builder uploadSubtitleRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SuggestionsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SuggestionsApi.java index e80d55ddd13a3..ddfe2071afb3b 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SuggestionsApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SuggestionsApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -39,6 +41,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class SuggestionsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -74,6 +98,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets suggestions. * @@ -91,8 +165,30 @@ public BaseItemDtoQueryResult getSuggestions(@org.eclipse.jdt.annotation.NonNull @org.eclipse.jdt.annotation.NonNull List type, @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getSuggestions(userId, mediaType, type, startIndex, limit, enableTotalRecordCount, null); + } + + /** + * Gets suggestions. + * + * @param userId The user id. (optional) + * @param mediaType The media types. (optional) + * @param type The type. (optional) + * @param startIndex Optional. The start index. (optional) + * @param limit Optional. The limit. (optional) + * @param enableTotalRecordCount Whether to enable the total record count. (optional, default to false) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSuggestions(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List mediaType, + @org.eclipse.jdt.annotation.NonNull List type, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { ApiResponse localVarResponse = getSuggestionsWithHttpInfo(userId, mediaType, type, - startIndex, limit, enableTotalRecordCount); + startIndex, limit, enableTotalRecordCount, headers); return localVarResponse.getData(); } @@ -114,8 +210,31 @@ public ApiResponse getSuggestionsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull List type, @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getSuggestionsWithHttpInfo(userId, mediaType, type, startIndex, limit, enableTotalRecordCount, null); + } + + /** + * Gets suggestions. + * + * @param userId The user id. (optional) + * @param mediaType The media types. (optional) + * @param type The type. (optional) + * @param startIndex Optional. The start index. (optional) + * @param limit Optional. The limit. (optional) + * @param enableTotalRecordCount Whether to enable the total record count. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSuggestionsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List mediaType, + @org.eclipse.jdt.annotation.NonNull List type, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getSuggestionsRequestBuilder(userId, mediaType, type, startIndex, - limit, enableTotalRecordCount); + limit, enableTotalRecordCount, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -132,14 +251,14 @@ public ApiResponse getSuggestionsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -154,7 +273,8 @@ private HttpRequest.Builder getSuggestionsRequestBuilder(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.NonNull List mediaType, @org.eclipse.jdt.annotation.NonNull List type, @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, - @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -194,6 +314,8 @@ private HttpRequest.Builder getSuggestionsRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SyncPlayApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SyncPlayApi.java index 35978f8d7b9e3..facd7f7fedaab 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SyncPlayApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SyncPlayApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -20,6 +21,7 @@ import java.net.http.HttpResponse; import java.time.Duration; import java.util.List; +import java.util.Map; import java.util.function.Consumer; import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; @@ -49,6 +51,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class SyncPlayApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -84,6 +108,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Notify SyncPlay group that member is buffering. * @@ -92,7 +166,19 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public void syncPlayBuffering(@org.eclipse.jdt.annotation.Nullable BufferRequestDto bufferRequestDto) throws ApiException { - syncPlayBufferingWithHttpInfo(bufferRequestDto); + syncPlayBuffering(bufferRequestDto, null); + } + + /** + * Notify SyncPlay group that member is buffering. + * + * @param bufferRequestDto The player status. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayBuffering(@org.eclipse.jdt.annotation.Nullable BufferRequestDto bufferRequestDto, + Map headers) throws ApiException { + syncPlayBufferingWithHttpInfo(bufferRequestDto, headers); } /** @@ -104,7 +190,21 @@ public void syncPlayBuffering(@org.eclipse.jdt.annotation.Nullable BufferRequest */ public ApiResponse syncPlayBufferingWithHttpInfo( @org.eclipse.jdt.annotation.Nullable BufferRequestDto bufferRequestDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlayBufferingRequestBuilder(bufferRequestDto); + return syncPlayBufferingWithHttpInfo(bufferRequestDto, null); + } + + /** + * Notify SyncPlay group that member is buffering. + * + * @param bufferRequestDto The player status. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayBufferingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable BufferRequestDto bufferRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayBufferingRequestBuilder(bufferRequestDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -132,7 +232,8 @@ public ApiResponse syncPlayBufferingWithHttpInfo( } private HttpRequest.Builder syncPlayBufferingRequestBuilder( - @org.eclipse.jdt.annotation.Nullable BufferRequestDto bufferRequestDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable BufferRequestDto bufferRequestDto, Map headers) + throws ApiException { // verify the required parameter 'bufferRequestDto' is set if (bufferRequestDto == null) { throw new ApiException(400, @@ -157,6 +258,8 @@ private HttpRequest.Builder syncPlayBufferingRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -171,7 +274,19 @@ private HttpRequest.Builder syncPlayBufferingRequestBuilder( */ public void syncPlayCreateGroup(@org.eclipse.jdt.annotation.Nullable NewGroupRequestDto newGroupRequestDto) throws ApiException { - syncPlayCreateGroupWithHttpInfo(newGroupRequestDto); + syncPlayCreateGroup(newGroupRequestDto, null); + } + + /** + * Create a new SyncPlay group. + * + * @param newGroupRequestDto The settings of the new group. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayCreateGroup(@org.eclipse.jdt.annotation.Nullable NewGroupRequestDto newGroupRequestDto, + Map headers) throws ApiException { + syncPlayCreateGroupWithHttpInfo(newGroupRequestDto, headers); } /** @@ -183,7 +298,21 @@ public void syncPlayCreateGroup(@org.eclipse.jdt.annotation.Nullable NewGroupReq */ public ApiResponse syncPlayCreateGroupWithHttpInfo( @org.eclipse.jdt.annotation.Nullable NewGroupRequestDto newGroupRequestDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlayCreateGroupRequestBuilder(newGroupRequestDto); + return syncPlayCreateGroupWithHttpInfo(newGroupRequestDto, null); + } + + /** + * Create a new SyncPlay group. + * + * @param newGroupRequestDto The settings of the new group. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayCreateGroupWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable NewGroupRequestDto newGroupRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayCreateGroupRequestBuilder(newGroupRequestDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -211,7 +340,8 @@ public ApiResponse syncPlayCreateGroupWithHttpInfo( } private HttpRequest.Builder syncPlayCreateGroupRequestBuilder( - @org.eclipse.jdt.annotation.Nullable NewGroupRequestDto newGroupRequestDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable NewGroupRequestDto newGroupRequestDto, Map headers) + throws ApiException { // verify the required parameter 'newGroupRequestDto' is set if (newGroupRequestDto == null) { throw new ApiException(400, @@ -236,6 +366,8 @@ private HttpRequest.Builder syncPlayCreateGroupRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -249,7 +381,18 @@ private HttpRequest.Builder syncPlayCreateGroupRequestBuilder( * @throws ApiException if fails to make API call */ public List syncPlayGetGroups() throws ApiException { - ApiResponse> localVarResponse = syncPlayGetGroupsWithHttpInfo(); + return syncPlayGetGroups(null); + } + + /** + * Gets all SyncPlay groups. + * + * @param headers Optional headers to include in the request + * @return List<GroupInfoDto> + * @throws ApiException if fails to make API call + */ + public List syncPlayGetGroups(Map headers) throws ApiException { + ApiResponse> localVarResponse = syncPlayGetGroupsWithHttpInfo(headers); return localVarResponse.getData(); } @@ -260,7 +403,19 @@ public List syncPlayGetGroups() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> syncPlayGetGroupsWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlayGetGroupsRequestBuilder(); + return syncPlayGetGroupsWithHttpInfo(null); + } + + /** + * Gets all SyncPlay groups. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<GroupInfoDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> syncPlayGetGroupsWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayGetGroupsRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -277,14 +432,14 @@ public ApiResponse> syncPlayGetGroupsWithHttpInfo() throws Ap } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -295,7 +450,7 @@ public ApiResponse> syncPlayGetGroupsWithHttpInfo() throws Ap } } - private HttpRequest.Builder syncPlayGetGroupsRequestBuilder() throws ApiException { + private HttpRequest.Builder syncPlayGetGroupsRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -310,6 +465,8 @@ private HttpRequest.Builder syncPlayGetGroupsRequestBuilder() throws ApiExceptio if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -324,7 +481,19 @@ private HttpRequest.Builder syncPlayGetGroupsRequestBuilder() throws ApiExceptio */ public void syncPlayJoinGroup(@org.eclipse.jdt.annotation.Nullable JoinGroupRequestDto joinGroupRequestDto) throws ApiException { - syncPlayJoinGroupWithHttpInfo(joinGroupRequestDto); + syncPlayJoinGroup(joinGroupRequestDto, null); + } + + /** + * Join an existing SyncPlay group. + * + * @param joinGroupRequestDto The group to join. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayJoinGroup(@org.eclipse.jdt.annotation.Nullable JoinGroupRequestDto joinGroupRequestDto, + Map headers) throws ApiException { + syncPlayJoinGroupWithHttpInfo(joinGroupRequestDto, headers); } /** @@ -336,7 +505,21 @@ public void syncPlayJoinGroup(@org.eclipse.jdt.annotation.Nullable JoinGroupRequ */ public ApiResponse syncPlayJoinGroupWithHttpInfo( @org.eclipse.jdt.annotation.Nullable JoinGroupRequestDto joinGroupRequestDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlayJoinGroupRequestBuilder(joinGroupRequestDto); + return syncPlayJoinGroupWithHttpInfo(joinGroupRequestDto, null); + } + + /** + * Join an existing SyncPlay group. + * + * @param joinGroupRequestDto The group to join. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayJoinGroupWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable JoinGroupRequestDto joinGroupRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayJoinGroupRequestBuilder(joinGroupRequestDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -364,7 +547,8 @@ public ApiResponse syncPlayJoinGroupWithHttpInfo( } private HttpRequest.Builder syncPlayJoinGroupRequestBuilder( - @org.eclipse.jdt.annotation.Nullable JoinGroupRequestDto joinGroupRequestDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable JoinGroupRequestDto joinGroupRequestDto, Map headers) + throws ApiException { // verify the required parameter 'joinGroupRequestDto' is set if (joinGroupRequestDto == null) { throw new ApiException(400, @@ -389,6 +573,8 @@ private HttpRequest.Builder syncPlayJoinGroupRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -401,7 +587,17 @@ private HttpRequest.Builder syncPlayJoinGroupRequestBuilder( * @throws ApiException if fails to make API call */ public void syncPlayLeaveGroup() throws ApiException { - syncPlayLeaveGroupWithHttpInfo(); + syncPlayLeaveGroup(null); + } + + /** + * Leave the joined SyncPlay group. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayLeaveGroup(Map headers) throws ApiException { + syncPlayLeaveGroupWithHttpInfo(headers); } /** @@ -411,7 +607,18 @@ public void syncPlayLeaveGroup() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse syncPlayLeaveGroupWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlayLeaveGroupRequestBuilder(); + return syncPlayLeaveGroupWithHttpInfo(null); + } + + /** + * Leave the joined SyncPlay group. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayLeaveGroupWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayLeaveGroupRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -438,7 +645,7 @@ public ApiResponse syncPlayLeaveGroupWithHttpInfo() throws ApiException { } } - private HttpRequest.Builder syncPlayLeaveGroupRequestBuilder() throws ApiException { + private HttpRequest.Builder syncPlayLeaveGroupRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -452,6 +659,8 @@ private HttpRequest.Builder syncPlayLeaveGroupRequestBuilder() throws ApiExcepti if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -467,7 +676,20 @@ private HttpRequest.Builder syncPlayLeaveGroupRequestBuilder() throws ApiExcepti public void syncPlayMovePlaylistItem( @org.eclipse.jdt.annotation.Nullable MovePlaylistItemRequestDto movePlaylistItemRequestDto) throws ApiException { - syncPlayMovePlaylistItemWithHttpInfo(movePlaylistItemRequestDto); + syncPlayMovePlaylistItem(movePlaylistItemRequestDto, null); + } + + /** + * Request to move an item in the playlist in SyncPlay group. + * + * @param movePlaylistItemRequestDto The new position for the item. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayMovePlaylistItem( + @org.eclipse.jdt.annotation.Nullable MovePlaylistItemRequestDto movePlaylistItemRequestDto, + Map headers) throws ApiException { + syncPlayMovePlaylistItemWithHttpInfo(movePlaylistItemRequestDto, headers); } /** @@ -480,7 +702,22 @@ public void syncPlayMovePlaylistItem( public ApiResponse syncPlayMovePlaylistItemWithHttpInfo( @org.eclipse.jdt.annotation.Nullable MovePlaylistItemRequestDto movePlaylistItemRequestDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlayMovePlaylistItemRequestBuilder(movePlaylistItemRequestDto); + return syncPlayMovePlaylistItemWithHttpInfo(movePlaylistItemRequestDto, null); + } + + /** + * Request to move an item in the playlist in SyncPlay group. + * + * @param movePlaylistItemRequestDto The new position for the item. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayMovePlaylistItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MovePlaylistItemRequestDto movePlaylistItemRequestDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayMovePlaylistItemRequestBuilder(movePlaylistItemRequestDto, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -508,8 +745,8 @@ public ApiResponse syncPlayMovePlaylistItemWithHttpInfo( } private HttpRequest.Builder syncPlayMovePlaylistItemRequestBuilder( - @org.eclipse.jdt.annotation.Nullable MovePlaylistItemRequestDto movePlaylistItemRequestDto) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable MovePlaylistItemRequestDto movePlaylistItemRequestDto, + Map headers) throws ApiException { // verify the required parameter 'movePlaylistItemRequestDto' is set if (movePlaylistItemRequestDto == null) { throw new ApiException(400, @@ -534,6 +771,8 @@ private HttpRequest.Builder syncPlayMovePlaylistItemRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -548,7 +787,19 @@ private HttpRequest.Builder syncPlayMovePlaylistItemRequestBuilder( */ public void syncPlayNextItem(@org.eclipse.jdt.annotation.Nullable NextItemRequestDto nextItemRequestDto) throws ApiException { - syncPlayNextItemWithHttpInfo(nextItemRequestDto); + syncPlayNextItem(nextItemRequestDto, null); + } + + /** + * Request next item in SyncPlay group. + * + * @param nextItemRequestDto The current item information. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayNextItem(@org.eclipse.jdt.annotation.Nullable NextItemRequestDto nextItemRequestDto, + Map headers) throws ApiException { + syncPlayNextItemWithHttpInfo(nextItemRequestDto, headers); } /** @@ -560,7 +811,21 @@ public void syncPlayNextItem(@org.eclipse.jdt.annotation.Nullable NextItemReques */ public ApiResponse syncPlayNextItemWithHttpInfo( @org.eclipse.jdt.annotation.Nullable NextItemRequestDto nextItemRequestDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlayNextItemRequestBuilder(nextItemRequestDto); + return syncPlayNextItemWithHttpInfo(nextItemRequestDto, null); + } + + /** + * Request next item in SyncPlay group. + * + * @param nextItemRequestDto The current item information. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayNextItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable NextItemRequestDto nextItemRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayNextItemRequestBuilder(nextItemRequestDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -588,7 +853,8 @@ public ApiResponse syncPlayNextItemWithHttpInfo( } private HttpRequest.Builder syncPlayNextItemRequestBuilder( - @org.eclipse.jdt.annotation.Nullable NextItemRequestDto nextItemRequestDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable NextItemRequestDto nextItemRequestDto, Map headers) + throws ApiException { // verify the required parameter 'nextItemRequestDto' is set if (nextItemRequestDto == null) { throw new ApiException(400, @@ -613,6 +879,8 @@ private HttpRequest.Builder syncPlayNextItemRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -625,7 +893,17 @@ private HttpRequest.Builder syncPlayNextItemRequestBuilder( * @throws ApiException if fails to make API call */ public void syncPlayPause() throws ApiException { - syncPlayPauseWithHttpInfo(); + syncPlayPause(null); + } + + /** + * Request pause in SyncPlay group. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayPause(Map headers) throws ApiException { + syncPlayPauseWithHttpInfo(headers); } /** @@ -635,7 +913,18 @@ public void syncPlayPause() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse syncPlayPauseWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlayPauseRequestBuilder(); + return syncPlayPauseWithHttpInfo(null); + } + + /** + * Request pause in SyncPlay group. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayPauseWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayPauseRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -662,7 +951,7 @@ public ApiResponse syncPlayPauseWithHttpInfo() throws ApiException { } } - private HttpRequest.Builder syncPlayPauseRequestBuilder() throws ApiException { + private HttpRequest.Builder syncPlayPauseRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -676,6 +965,8 @@ private HttpRequest.Builder syncPlayPauseRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -689,7 +980,19 @@ private HttpRequest.Builder syncPlayPauseRequestBuilder() throws ApiException { * @throws ApiException if fails to make API call */ public void syncPlayPing(@org.eclipse.jdt.annotation.Nullable PingRequestDto pingRequestDto) throws ApiException { - syncPlayPingWithHttpInfo(pingRequestDto); + syncPlayPing(pingRequestDto, null); + } + + /** + * Update session ping. + * + * @param pingRequestDto The new ping. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayPing(@org.eclipse.jdt.annotation.Nullable PingRequestDto pingRequestDto, + Map headers) throws ApiException { + syncPlayPingWithHttpInfo(pingRequestDto, headers); } /** @@ -701,7 +1004,21 @@ public void syncPlayPing(@org.eclipse.jdt.annotation.Nullable PingRequestDto pin */ public ApiResponse syncPlayPingWithHttpInfo( @org.eclipse.jdt.annotation.Nullable PingRequestDto pingRequestDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlayPingRequestBuilder(pingRequestDto); + return syncPlayPingWithHttpInfo(pingRequestDto, null); + } + + /** + * Update session ping. + * + * @param pingRequestDto The new ping. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayPingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable PingRequestDto pingRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayPingRequestBuilder(pingRequestDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -729,7 +1046,8 @@ public ApiResponse syncPlayPingWithHttpInfo( } private HttpRequest.Builder syncPlayPingRequestBuilder( - @org.eclipse.jdt.annotation.Nullable PingRequestDto pingRequestDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable PingRequestDto pingRequestDto, Map headers) + throws ApiException { // verify the required parameter 'pingRequestDto' is set if (pingRequestDto == null) { throw new ApiException(400, "Missing the required parameter 'pingRequestDto' when calling syncPlayPing"); @@ -753,6 +1071,8 @@ private HttpRequest.Builder syncPlayPingRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -767,7 +1087,19 @@ private HttpRequest.Builder syncPlayPingRequestBuilder( */ public void syncPlayPreviousItem(@org.eclipse.jdt.annotation.Nullable PreviousItemRequestDto previousItemRequestDto) throws ApiException { - syncPlayPreviousItemWithHttpInfo(previousItemRequestDto); + syncPlayPreviousItem(previousItemRequestDto, null); + } + + /** + * Request previous item in SyncPlay group. + * + * @param previousItemRequestDto The current item information. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayPreviousItem(@org.eclipse.jdt.annotation.Nullable PreviousItemRequestDto previousItemRequestDto, + Map headers) throws ApiException { + syncPlayPreviousItemWithHttpInfo(previousItemRequestDto, headers); } /** @@ -779,7 +1111,22 @@ public void syncPlayPreviousItem(@org.eclipse.jdt.annotation.Nullable PreviousIt */ public ApiResponse syncPlayPreviousItemWithHttpInfo( @org.eclipse.jdt.annotation.Nullable PreviousItemRequestDto previousItemRequestDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlayPreviousItemRequestBuilder(previousItemRequestDto); + return syncPlayPreviousItemWithHttpInfo(previousItemRequestDto, null); + } + + /** + * Request previous item in SyncPlay group. + * + * @param previousItemRequestDto The current item information. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayPreviousItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable PreviousItemRequestDto previousItemRequestDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayPreviousItemRequestBuilder(previousItemRequestDto, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -807,7 +1154,8 @@ public ApiResponse syncPlayPreviousItemWithHttpInfo( } private HttpRequest.Builder syncPlayPreviousItemRequestBuilder( - @org.eclipse.jdt.annotation.Nullable PreviousItemRequestDto previousItemRequestDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable PreviousItemRequestDto previousItemRequestDto, + Map headers) throws ApiException { // verify the required parameter 'previousItemRequestDto' is set if (previousItemRequestDto == null) { throw new ApiException(400, @@ -832,6 +1180,8 @@ private HttpRequest.Builder syncPlayPreviousItemRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -846,7 +1196,19 @@ private HttpRequest.Builder syncPlayPreviousItemRequestBuilder( */ public void syncPlayQueue(@org.eclipse.jdt.annotation.Nullable QueueRequestDto queueRequestDto) throws ApiException { - syncPlayQueueWithHttpInfo(queueRequestDto); + syncPlayQueue(queueRequestDto, null); + } + + /** + * Request to queue items to the playlist of a SyncPlay group. + * + * @param queueRequestDto The items to add. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayQueue(@org.eclipse.jdt.annotation.Nullable QueueRequestDto queueRequestDto, + Map headers) throws ApiException { + syncPlayQueueWithHttpInfo(queueRequestDto, headers); } /** @@ -858,7 +1220,21 @@ public void syncPlayQueue(@org.eclipse.jdt.annotation.Nullable QueueRequestDto q */ public ApiResponse syncPlayQueueWithHttpInfo( @org.eclipse.jdt.annotation.Nullable QueueRequestDto queueRequestDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlayQueueRequestBuilder(queueRequestDto); + return syncPlayQueueWithHttpInfo(queueRequestDto, null); + } + + /** + * Request to queue items to the playlist of a SyncPlay group. + * + * @param queueRequestDto The items to add. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayQueueWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable QueueRequestDto queueRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayQueueRequestBuilder(queueRequestDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -886,7 +1262,8 @@ public ApiResponse syncPlayQueueWithHttpInfo( } private HttpRequest.Builder syncPlayQueueRequestBuilder( - @org.eclipse.jdt.annotation.Nullable QueueRequestDto queueRequestDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable QueueRequestDto queueRequestDto, Map headers) + throws ApiException { // verify the required parameter 'queueRequestDto' is set if (queueRequestDto == null) { throw new ApiException(400, "Missing the required parameter 'queueRequestDto' when calling syncPlayQueue"); @@ -910,6 +1287,8 @@ private HttpRequest.Builder syncPlayQueueRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -924,7 +1303,19 @@ private HttpRequest.Builder syncPlayQueueRequestBuilder( */ public void syncPlayReady(@org.eclipse.jdt.annotation.Nullable ReadyRequestDto readyRequestDto) throws ApiException { - syncPlayReadyWithHttpInfo(readyRequestDto); + syncPlayReady(readyRequestDto, null); + } + + /** + * Notify SyncPlay group that member is ready for playback. + * + * @param readyRequestDto The player status. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayReady(@org.eclipse.jdt.annotation.Nullable ReadyRequestDto readyRequestDto, + Map headers) throws ApiException { + syncPlayReadyWithHttpInfo(readyRequestDto, headers); } /** @@ -936,7 +1327,21 @@ public void syncPlayReady(@org.eclipse.jdt.annotation.Nullable ReadyRequestDto r */ public ApiResponse syncPlayReadyWithHttpInfo( @org.eclipse.jdt.annotation.Nullable ReadyRequestDto readyRequestDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlayReadyRequestBuilder(readyRequestDto); + return syncPlayReadyWithHttpInfo(readyRequestDto, null); + } + + /** + * Notify SyncPlay group that member is ready for playback. + * + * @param readyRequestDto The player status. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayReadyWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ReadyRequestDto readyRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayReadyRequestBuilder(readyRequestDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -964,7 +1369,8 @@ public ApiResponse syncPlayReadyWithHttpInfo( } private HttpRequest.Builder syncPlayReadyRequestBuilder( - @org.eclipse.jdt.annotation.Nullable ReadyRequestDto readyRequestDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable ReadyRequestDto readyRequestDto, Map headers) + throws ApiException { // verify the required parameter 'readyRequestDto' is set if (readyRequestDto == null) { throw new ApiException(400, "Missing the required parameter 'readyRequestDto' when calling syncPlayReady"); @@ -988,6 +1394,8 @@ private HttpRequest.Builder syncPlayReadyRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1003,7 +1411,20 @@ private HttpRequest.Builder syncPlayReadyRequestBuilder( public void syncPlayRemoveFromPlaylist( @org.eclipse.jdt.annotation.Nullable RemoveFromPlaylistRequestDto removeFromPlaylistRequestDto) throws ApiException { - syncPlayRemoveFromPlaylistWithHttpInfo(removeFromPlaylistRequestDto); + syncPlayRemoveFromPlaylist(removeFromPlaylistRequestDto, null); + } + + /** + * Request to remove items from the playlist in SyncPlay group. + * + * @param removeFromPlaylistRequestDto The items to remove. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayRemoveFromPlaylist( + @org.eclipse.jdt.annotation.Nullable RemoveFromPlaylistRequestDto removeFromPlaylistRequestDto, + Map headers) throws ApiException { + syncPlayRemoveFromPlaylistWithHttpInfo(removeFromPlaylistRequestDto, headers); } /** @@ -1016,8 +1437,22 @@ public void syncPlayRemoveFromPlaylist( public ApiResponse syncPlayRemoveFromPlaylistWithHttpInfo( @org.eclipse.jdt.annotation.Nullable RemoveFromPlaylistRequestDto removeFromPlaylistRequestDto) throws ApiException { + return syncPlayRemoveFromPlaylistWithHttpInfo(removeFromPlaylistRequestDto, null); + } + + /** + * Request to remove items from the playlist in SyncPlay group. + * + * @param removeFromPlaylistRequestDto The items to remove. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayRemoveFromPlaylistWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable RemoveFromPlaylistRequestDto removeFromPlaylistRequestDto, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = syncPlayRemoveFromPlaylistRequestBuilder( - removeFromPlaylistRequestDto); + removeFromPlaylistRequestDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1045,8 +1480,8 @@ public ApiResponse syncPlayRemoveFromPlaylistWithHttpInfo( } private HttpRequest.Builder syncPlayRemoveFromPlaylistRequestBuilder( - @org.eclipse.jdt.annotation.Nullable RemoveFromPlaylistRequestDto removeFromPlaylistRequestDto) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable RemoveFromPlaylistRequestDto removeFromPlaylistRequestDto, + Map headers) throws ApiException { // verify the required parameter 'removeFromPlaylistRequestDto' is set if (removeFromPlaylistRequestDto == null) { throw new ApiException(400, @@ -1071,6 +1506,8 @@ private HttpRequest.Builder syncPlayRemoveFromPlaylistRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1084,7 +1521,19 @@ private HttpRequest.Builder syncPlayRemoveFromPlaylistRequestBuilder( * @throws ApiException if fails to make API call */ public void syncPlaySeek(@org.eclipse.jdt.annotation.Nullable SeekRequestDto seekRequestDto) throws ApiException { - syncPlaySeekWithHttpInfo(seekRequestDto); + syncPlaySeek(seekRequestDto, null); + } + + /** + * Request seek in SyncPlay group. + * + * @param seekRequestDto The new playback position. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlaySeek(@org.eclipse.jdt.annotation.Nullable SeekRequestDto seekRequestDto, + Map headers) throws ApiException { + syncPlaySeekWithHttpInfo(seekRequestDto, headers); } /** @@ -1096,7 +1545,21 @@ public void syncPlaySeek(@org.eclipse.jdt.annotation.Nullable SeekRequestDto see */ public ApiResponse syncPlaySeekWithHttpInfo( @org.eclipse.jdt.annotation.Nullable SeekRequestDto seekRequestDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlaySeekRequestBuilder(seekRequestDto); + return syncPlaySeekWithHttpInfo(seekRequestDto, null); + } + + /** + * Request seek in SyncPlay group. + * + * @param seekRequestDto The new playback position. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySeekWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SeekRequestDto seekRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySeekRequestBuilder(seekRequestDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1124,7 +1587,8 @@ public ApiResponse syncPlaySeekWithHttpInfo( } private HttpRequest.Builder syncPlaySeekRequestBuilder( - @org.eclipse.jdt.annotation.Nullable SeekRequestDto seekRequestDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable SeekRequestDto seekRequestDto, Map headers) + throws ApiException { // verify the required parameter 'seekRequestDto' is set if (seekRequestDto == null) { throw new ApiException(400, "Missing the required parameter 'seekRequestDto' when calling syncPlaySeek"); @@ -1148,6 +1612,8 @@ private HttpRequest.Builder syncPlaySeekRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1162,7 +1628,19 @@ private HttpRequest.Builder syncPlaySeekRequestBuilder( */ public void syncPlaySetIgnoreWait(@org.eclipse.jdt.annotation.Nullable IgnoreWaitRequestDto ignoreWaitRequestDto) throws ApiException { - syncPlaySetIgnoreWaitWithHttpInfo(ignoreWaitRequestDto); + syncPlaySetIgnoreWait(ignoreWaitRequestDto, null); + } + + /** + * Request SyncPlay group to ignore member during group-wait. + * + * @param ignoreWaitRequestDto The settings to set. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlaySetIgnoreWait(@org.eclipse.jdt.annotation.Nullable IgnoreWaitRequestDto ignoreWaitRequestDto, + Map headers) throws ApiException { + syncPlaySetIgnoreWaitWithHttpInfo(ignoreWaitRequestDto, headers); } /** @@ -1174,7 +1652,21 @@ public void syncPlaySetIgnoreWait(@org.eclipse.jdt.annotation.Nullable IgnoreWai */ public ApiResponse syncPlaySetIgnoreWaitWithHttpInfo( @org.eclipse.jdt.annotation.Nullable IgnoreWaitRequestDto ignoreWaitRequestDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlaySetIgnoreWaitRequestBuilder(ignoreWaitRequestDto); + return syncPlaySetIgnoreWaitWithHttpInfo(ignoreWaitRequestDto, null); + } + + /** + * Request SyncPlay group to ignore member during group-wait. + * + * @param ignoreWaitRequestDto The settings to set. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetIgnoreWaitWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable IgnoreWaitRequestDto ignoreWaitRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySetIgnoreWaitRequestBuilder(ignoreWaitRequestDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1202,7 +1694,8 @@ public ApiResponse syncPlaySetIgnoreWaitWithHttpInfo( } private HttpRequest.Builder syncPlaySetIgnoreWaitRequestBuilder( - @org.eclipse.jdt.annotation.Nullable IgnoreWaitRequestDto ignoreWaitRequestDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable IgnoreWaitRequestDto ignoreWaitRequestDto, Map headers) + throws ApiException { // verify the required parameter 'ignoreWaitRequestDto' is set if (ignoreWaitRequestDto == null) { throw new ApiException(400, @@ -1227,6 +1720,8 @@ private HttpRequest.Builder syncPlaySetIgnoreWaitRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1241,7 +1736,19 @@ private HttpRequest.Builder syncPlaySetIgnoreWaitRequestBuilder( */ public void syncPlaySetNewQueue(@org.eclipse.jdt.annotation.Nullable PlayRequestDto playRequestDto) throws ApiException { - syncPlaySetNewQueueWithHttpInfo(playRequestDto); + syncPlaySetNewQueue(playRequestDto, null); + } + + /** + * Request to set new playlist in SyncPlay group. + * + * @param playRequestDto The new playlist to play in the group. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlaySetNewQueue(@org.eclipse.jdt.annotation.Nullable PlayRequestDto playRequestDto, + Map headers) throws ApiException { + syncPlaySetNewQueueWithHttpInfo(playRequestDto, headers); } /** @@ -1253,7 +1760,21 @@ public void syncPlaySetNewQueue(@org.eclipse.jdt.annotation.Nullable PlayRequest */ public ApiResponse syncPlaySetNewQueueWithHttpInfo( @org.eclipse.jdt.annotation.Nullable PlayRequestDto playRequestDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlaySetNewQueueRequestBuilder(playRequestDto); + return syncPlaySetNewQueueWithHttpInfo(playRequestDto, null); + } + + /** + * Request to set new playlist in SyncPlay group. + * + * @param playRequestDto The new playlist to play in the group. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetNewQueueWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable PlayRequestDto playRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySetNewQueueRequestBuilder(playRequestDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1281,7 +1802,8 @@ public ApiResponse syncPlaySetNewQueueWithHttpInfo( } private HttpRequest.Builder syncPlaySetNewQueueRequestBuilder( - @org.eclipse.jdt.annotation.Nullable PlayRequestDto playRequestDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable PlayRequestDto playRequestDto, Map headers) + throws ApiException { // verify the required parameter 'playRequestDto' is set if (playRequestDto == null) { throw new ApiException(400, @@ -1306,6 +1828,8 @@ private HttpRequest.Builder syncPlaySetNewQueueRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1321,7 +1845,20 @@ private HttpRequest.Builder syncPlaySetNewQueueRequestBuilder( public void syncPlaySetPlaylistItem( @org.eclipse.jdt.annotation.Nullable SetPlaylistItemRequestDto setPlaylistItemRequestDto) throws ApiException { - syncPlaySetPlaylistItemWithHttpInfo(setPlaylistItemRequestDto); + syncPlaySetPlaylistItem(setPlaylistItemRequestDto, null); + } + + /** + * Request to change playlist item in SyncPlay group. + * + * @param setPlaylistItemRequestDto The new item to play. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlaySetPlaylistItem( + @org.eclipse.jdt.annotation.Nullable SetPlaylistItemRequestDto setPlaylistItemRequestDto, + Map headers) throws ApiException { + syncPlaySetPlaylistItemWithHttpInfo(setPlaylistItemRequestDto, headers); } /** @@ -1334,7 +1871,22 @@ public void syncPlaySetPlaylistItem( public ApiResponse syncPlaySetPlaylistItemWithHttpInfo( @org.eclipse.jdt.annotation.Nullable SetPlaylistItemRequestDto setPlaylistItemRequestDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlaySetPlaylistItemRequestBuilder(setPlaylistItemRequestDto); + return syncPlaySetPlaylistItemWithHttpInfo(setPlaylistItemRequestDto, null); + } + + /** + * Request to change playlist item in SyncPlay group. + * + * @param setPlaylistItemRequestDto The new item to play. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetPlaylistItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SetPlaylistItemRequestDto setPlaylistItemRequestDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySetPlaylistItemRequestBuilder(setPlaylistItemRequestDto, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1362,8 +1914,8 @@ public ApiResponse syncPlaySetPlaylistItemWithHttpInfo( } private HttpRequest.Builder syncPlaySetPlaylistItemRequestBuilder( - @org.eclipse.jdt.annotation.Nullable SetPlaylistItemRequestDto setPlaylistItemRequestDto) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable SetPlaylistItemRequestDto setPlaylistItemRequestDto, + Map headers) throws ApiException { // verify the required parameter 'setPlaylistItemRequestDto' is set if (setPlaylistItemRequestDto == null) { throw new ApiException(400, @@ -1388,6 +1940,8 @@ private HttpRequest.Builder syncPlaySetPlaylistItemRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1402,7 +1956,20 @@ private HttpRequest.Builder syncPlaySetPlaylistItemRequestBuilder( */ public void syncPlaySetRepeatMode( @org.eclipse.jdt.annotation.Nullable SetRepeatModeRequestDto setRepeatModeRequestDto) throws ApiException { - syncPlaySetRepeatModeWithHttpInfo(setRepeatModeRequestDto); + syncPlaySetRepeatMode(setRepeatModeRequestDto, null); + } + + /** + * Request to set repeat mode in SyncPlay group. + * + * @param setRepeatModeRequestDto The new repeat mode. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlaySetRepeatMode( + @org.eclipse.jdt.annotation.Nullable SetRepeatModeRequestDto setRepeatModeRequestDto, + Map headers) throws ApiException { + syncPlaySetRepeatModeWithHttpInfo(setRepeatModeRequestDto, headers); } /** @@ -1414,7 +1981,22 @@ public void syncPlaySetRepeatMode( */ public ApiResponse syncPlaySetRepeatModeWithHttpInfo( @org.eclipse.jdt.annotation.Nullable SetRepeatModeRequestDto setRepeatModeRequestDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlaySetRepeatModeRequestBuilder(setRepeatModeRequestDto); + return syncPlaySetRepeatModeWithHttpInfo(setRepeatModeRequestDto, null); + } + + /** + * Request to set repeat mode in SyncPlay group. + * + * @param setRepeatModeRequestDto The new repeat mode. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetRepeatModeWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SetRepeatModeRequestDto setRepeatModeRequestDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySetRepeatModeRequestBuilder(setRepeatModeRequestDto, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1442,7 +2024,8 @@ public ApiResponse syncPlaySetRepeatModeWithHttpInfo( } private HttpRequest.Builder syncPlaySetRepeatModeRequestBuilder( - @org.eclipse.jdt.annotation.Nullable SetRepeatModeRequestDto setRepeatModeRequestDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable SetRepeatModeRequestDto setRepeatModeRequestDto, + Map headers) throws ApiException { // verify the required parameter 'setRepeatModeRequestDto' is set if (setRepeatModeRequestDto == null) { throw new ApiException(400, @@ -1467,6 +2050,8 @@ private HttpRequest.Builder syncPlaySetRepeatModeRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1482,7 +2067,20 @@ private HttpRequest.Builder syncPlaySetRepeatModeRequestBuilder( public void syncPlaySetShuffleMode( @org.eclipse.jdt.annotation.Nullable SetShuffleModeRequestDto setShuffleModeRequestDto) throws ApiException { - syncPlaySetShuffleModeWithHttpInfo(setShuffleModeRequestDto); + syncPlaySetShuffleMode(setShuffleModeRequestDto, null); + } + + /** + * Request to set shuffle mode in SyncPlay group. + * + * @param setShuffleModeRequestDto The new shuffle mode. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlaySetShuffleMode( + @org.eclipse.jdt.annotation.Nullable SetShuffleModeRequestDto setShuffleModeRequestDto, + Map headers) throws ApiException { + syncPlaySetShuffleModeWithHttpInfo(setShuffleModeRequestDto, headers); } /** @@ -1495,7 +2093,22 @@ public void syncPlaySetShuffleMode( public ApiResponse syncPlaySetShuffleModeWithHttpInfo( @org.eclipse.jdt.annotation.Nullable SetShuffleModeRequestDto setShuffleModeRequestDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlaySetShuffleModeRequestBuilder(setShuffleModeRequestDto); + return syncPlaySetShuffleModeWithHttpInfo(setShuffleModeRequestDto, null); + } + + /** + * Request to set shuffle mode in SyncPlay group. + * + * @param setShuffleModeRequestDto The new shuffle mode. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetShuffleModeWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SetShuffleModeRequestDto setShuffleModeRequestDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySetShuffleModeRequestBuilder(setShuffleModeRequestDto, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1523,8 +2136,8 @@ public ApiResponse syncPlaySetShuffleModeWithHttpInfo( } private HttpRequest.Builder syncPlaySetShuffleModeRequestBuilder( - @org.eclipse.jdt.annotation.Nullable SetShuffleModeRequestDto setShuffleModeRequestDto) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable SetShuffleModeRequestDto setShuffleModeRequestDto, + Map headers) throws ApiException { // verify the required parameter 'setShuffleModeRequestDto' is set if (setShuffleModeRequestDto == null) { throw new ApiException(400, @@ -1549,6 +2162,8 @@ private HttpRequest.Builder syncPlaySetShuffleModeRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1561,7 +2176,17 @@ private HttpRequest.Builder syncPlaySetShuffleModeRequestBuilder( * @throws ApiException if fails to make API call */ public void syncPlayStop() throws ApiException { - syncPlayStopWithHttpInfo(); + syncPlayStop(null); + } + + /** + * Request stop in SyncPlay group. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayStop(Map headers) throws ApiException { + syncPlayStopWithHttpInfo(headers); } /** @@ -1571,7 +2196,18 @@ public void syncPlayStop() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse syncPlayStopWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlayStopRequestBuilder(); + return syncPlayStopWithHttpInfo(null); + } + + /** + * Request stop in SyncPlay group. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayStopWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayStopRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1598,7 +2234,7 @@ public ApiResponse syncPlayStopWithHttpInfo() throws ApiException { } } - private HttpRequest.Builder syncPlayStopRequestBuilder() throws ApiException { + private HttpRequest.Builder syncPlayStopRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -1612,6 +2248,8 @@ private HttpRequest.Builder syncPlayStopRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1624,7 +2262,17 @@ private HttpRequest.Builder syncPlayStopRequestBuilder() throws ApiException { * @throws ApiException if fails to make API call */ public void syncPlayUnpause() throws ApiException { - syncPlayUnpauseWithHttpInfo(); + syncPlayUnpause(null); + } + + /** + * Request unpause in SyncPlay group. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayUnpause(Map headers) throws ApiException { + syncPlayUnpauseWithHttpInfo(headers); } /** @@ -1634,7 +2282,18 @@ public void syncPlayUnpause() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse syncPlayUnpauseWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = syncPlayUnpauseRequestBuilder(); + return syncPlayUnpauseWithHttpInfo(null); + } + + /** + * Request unpause in SyncPlay group. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayUnpauseWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayUnpauseRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1661,7 +2320,7 @@ public ApiResponse syncPlayUnpauseWithHttpInfo() throws ApiException { } } - private HttpRequest.Builder syncPlayUnpauseRequestBuilder() throws ApiException { + private HttpRequest.Builder syncPlayUnpauseRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -1675,6 +2334,8 @@ private HttpRequest.Builder syncPlayUnpauseRequestBuilder() throws ApiException if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SystemApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SystemApi.java index a4021fe6c5b45..1ec77a1927c1d 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SystemApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/SystemApi.java @@ -22,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.function.Consumer; @@ -41,6 +42,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class SystemApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -76,6 +99,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets information about the request endpoint. * @@ -83,7 +156,18 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public EndPointInfo getEndpointInfo() throws ApiException { - ApiResponse localVarResponse = getEndpointInfoWithHttpInfo(); + return getEndpointInfo(null); + } + + /** + * Gets information about the request endpoint. + * + * @param headers Optional headers to include in the request + * @return EndPointInfo + * @throws ApiException if fails to make API call + */ + public EndPointInfo getEndpointInfo(Map headers) throws ApiException { + ApiResponse localVarResponse = getEndpointInfoWithHttpInfo(headers); return localVarResponse.getData(); } @@ -94,7 +178,18 @@ public EndPointInfo getEndpointInfo() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getEndpointInfoWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getEndpointInfoRequestBuilder(); + return getEndpointInfoWithHttpInfo(null); + } + + /** + * Gets information about the request endpoint. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<EndPointInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEndpointInfoWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getEndpointInfoRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -111,12 +206,14 @@ public ApiResponse getEndpointInfoWithHttpInfo() throws ApiExcepti } String responseBody = new String(localVarResponse.body().readAllBytes()); + EndPointInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -127,7 +224,7 @@ public ApiResponse getEndpointInfoWithHttpInfo() throws ApiExcepti } } - private HttpRequest.Builder getEndpointInfoRequestBuilder() throws ApiException { + private HttpRequest.Builder getEndpointInfoRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -142,6 +239,8 @@ private HttpRequest.Builder getEndpointInfoRequestBuilder() throws ApiException if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -156,7 +255,20 @@ private HttpRequest.Builder getEndpointInfoRequestBuilder() throws ApiException * @throws ApiException if fails to make API call */ public File getLogFile(@org.eclipse.jdt.annotation.Nullable String name) throws ApiException { - ApiResponse localVarResponse = getLogFileWithHttpInfo(name); + return getLogFile(name, null); + } + + /** + * Gets a log file. + * + * @param name The name of the log file to get. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getLogFile(@org.eclipse.jdt.annotation.Nullable String name, Map headers) + throws ApiException { + ApiResponse localVarResponse = getLogFileWithHttpInfo(name, headers); return localVarResponse.getData(); } @@ -169,7 +281,20 @@ public File getLogFile(@org.eclipse.jdt.annotation.Nullable String name) throws */ public ApiResponse getLogFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getLogFileRequestBuilder(name); + return getLogFileWithHttpInfo(name, null); + } + + /** + * Gets a log file. + * + * @param name The name of the log file to get. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLogFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLogFileRequestBuilder(name, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -184,13 +309,13 @@ public ApiResponse getLogFileWithHttpInfo(@org.eclipse.jdt.annotation.Null return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -201,8 +326,8 @@ public ApiResponse getLogFileWithHttpInfo(@org.eclipse.jdt.annotation.Null } } - private HttpRequest.Builder getLogFileRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name) - throws ApiException { + private HttpRequest.Builder getLogFileRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + Map headers) throws ApiException { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing the required parameter 'name' when calling getLogFile"); @@ -236,6 +361,8 @@ private HttpRequest.Builder getLogFileRequestBuilder(@org.eclipse.jdt.annotation if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -249,7 +376,18 @@ private HttpRequest.Builder getLogFileRequestBuilder(@org.eclipse.jdt.annotation * @throws ApiException if fails to make API call */ public String getPingSystem() throws ApiException { - ApiResponse localVarResponse = getPingSystemWithHttpInfo(); + return getPingSystem(null); + } + + /** + * Pings the system. + * + * @param headers Optional headers to include in the request + * @return String + * @throws ApiException if fails to make API call + */ + public String getPingSystem(Map headers) throws ApiException { + ApiResponse localVarResponse = getPingSystemWithHttpInfo(headers); return localVarResponse.getData(); } @@ -260,7 +398,18 @@ public String getPingSystem() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getPingSystemWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPingSystemRequestBuilder(); + return getPingSystemWithHttpInfo(null); + } + + /** + * Pings the system. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPingSystemWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPingSystemRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -277,12 +426,14 @@ public ApiResponse getPingSystemWithHttpInfo() throws ApiException { } String responseBody = new String(localVarResponse.body().readAllBytes()); + String responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -293,7 +444,7 @@ public ApiResponse getPingSystemWithHttpInfo() throws ApiException { } } - private HttpRequest.Builder getPingSystemRequestBuilder() throws ApiException { + private HttpRequest.Builder getPingSystemRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -308,6 +459,8 @@ private HttpRequest.Builder getPingSystemRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -321,7 +474,18 @@ private HttpRequest.Builder getPingSystemRequestBuilder() throws ApiException { * @throws ApiException if fails to make API call */ public PublicSystemInfo getPublicSystemInfo() throws ApiException { - ApiResponse localVarResponse = getPublicSystemInfoWithHttpInfo(); + return getPublicSystemInfo(null); + } + + /** + * Gets public information about the server. + * + * @param headers Optional headers to include in the request + * @return PublicSystemInfo + * @throws ApiException if fails to make API call + */ + public PublicSystemInfo getPublicSystemInfo(Map headers) throws ApiException { + ApiResponse localVarResponse = getPublicSystemInfoWithHttpInfo(headers); return localVarResponse.getData(); } @@ -332,7 +496,19 @@ public PublicSystemInfo getPublicSystemInfo() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getPublicSystemInfoWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPublicSystemInfoRequestBuilder(); + return getPublicSystemInfoWithHttpInfo(null); + } + + /** + * Gets public information about the server. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<PublicSystemInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPublicSystemInfoWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPublicSystemInfoRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -349,12 +525,14 @@ public ApiResponse getPublicSystemInfoWithHttpInfo() throws Ap } String responseBody = new String(localVarResponse.body().readAllBytes()); + PublicSystemInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -365,7 +543,7 @@ public ApiResponse getPublicSystemInfoWithHttpInfo() throws Ap } } - private HttpRequest.Builder getPublicSystemInfoRequestBuilder() throws ApiException { + private HttpRequest.Builder getPublicSystemInfoRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -380,6 +558,8 @@ private HttpRequest.Builder getPublicSystemInfoRequestBuilder() throws ApiExcept if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -393,7 +573,18 @@ private HttpRequest.Builder getPublicSystemInfoRequestBuilder() throws ApiExcept * @throws ApiException if fails to make API call */ public List getServerLogs() throws ApiException { - ApiResponse> localVarResponse = getServerLogsWithHttpInfo(); + return getServerLogs(null); + } + + /** + * Gets a list of available server log files. + * + * @param headers Optional headers to include in the request + * @return List<LogFile> + * @throws ApiException if fails to make API call + */ + public List getServerLogs(Map headers) throws ApiException { + ApiResponse> localVarResponse = getServerLogsWithHttpInfo(headers); return localVarResponse.getData(); } @@ -404,7 +595,18 @@ public List getServerLogs() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getServerLogsWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getServerLogsRequestBuilder(); + return getServerLogsWithHttpInfo(null); + } + + /** + * Gets a list of available server log files. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<LogFile>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getServerLogsWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getServerLogsRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -421,12 +623,14 @@ public ApiResponse> getServerLogsWithHttpInfo() throws ApiExceptio } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -437,7 +641,7 @@ public ApiResponse> getServerLogsWithHttpInfo() throws ApiExceptio } } - private HttpRequest.Builder getServerLogsRequestBuilder() throws ApiException { + private HttpRequest.Builder getServerLogsRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -452,6 +656,8 @@ private HttpRequest.Builder getServerLogsRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -465,7 +671,18 @@ private HttpRequest.Builder getServerLogsRequestBuilder() throws ApiException { * @throws ApiException if fails to make API call */ public SystemInfo getSystemInfo() throws ApiException { - ApiResponse localVarResponse = getSystemInfoWithHttpInfo(); + return getSystemInfo(null); + } + + /** + * Gets information about the server. + * + * @param headers Optional headers to include in the request + * @return SystemInfo + * @throws ApiException if fails to make API call + */ + public SystemInfo getSystemInfo(Map headers) throws ApiException { + ApiResponse localVarResponse = getSystemInfoWithHttpInfo(headers); return localVarResponse.getData(); } @@ -476,7 +693,18 @@ public SystemInfo getSystemInfo() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getSystemInfoWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getSystemInfoRequestBuilder(); + return getSystemInfoWithHttpInfo(null); + } + + /** + * Gets information about the server. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<SystemInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSystemInfoWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSystemInfoRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -493,12 +721,14 @@ public ApiResponse getSystemInfoWithHttpInfo() throws ApiException { } String responseBody = new String(localVarResponse.body().readAllBytes()); + SystemInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -509,7 +739,7 @@ public ApiResponse getSystemInfoWithHttpInfo() throws ApiException { } } - private HttpRequest.Builder getSystemInfoRequestBuilder() throws ApiException { + private HttpRequest.Builder getSystemInfoRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -524,6 +754,8 @@ private HttpRequest.Builder getSystemInfoRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -539,7 +771,20 @@ private HttpRequest.Builder getSystemInfoRequestBuilder() throws ApiException { */ @Deprecated public List getWakeOnLanInfo() throws ApiException { - ApiResponse> localVarResponse = getWakeOnLanInfoWithHttpInfo(); + return getWakeOnLanInfo(null); + } + + /** + * Gets wake on lan information. + * + * @param headers Optional headers to include in the request + * @return List<WakeOnLanInfo> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public List getWakeOnLanInfo(Map headers) throws ApiException { + ApiResponse> localVarResponse = getWakeOnLanInfoWithHttpInfo(headers); return localVarResponse.getData(); } @@ -552,7 +797,21 @@ public List getWakeOnLanInfo() throws ApiException { */ @Deprecated public ApiResponse> getWakeOnLanInfoWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getWakeOnLanInfoRequestBuilder(); + return getWakeOnLanInfoWithHttpInfo(null); + } + + /** + * Gets wake on lan information. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<WakeOnLanInfo>> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse> getWakeOnLanInfoWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getWakeOnLanInfoRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -569,14 +828,14 @@ public ApiResponse> getWakeOnLanInfoWithHttpInfo() throws Ap } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -587,7 +846,7 @@ public ApiResponse> getWakeOnLanInfoWithHttpInfo() throws Ap } } - private HttpRequest.Builder getWakeOnLanInfoRequestBuilder() throws ApiException { + private HttpRequest.Builder getWakeOnLanInfoRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -602,6 +861,8 @@ private HttpRequest.Builder getWakeOnLanInfoRequestBuilder() throws ApiException if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -615,7 +876,18 @@ private HttpRequest.Builder getWakeOnLanInfoRequestBuilder() throws ApiException * @throws ApiException if fails to make API call */ public String postPingSystem() throws ApiException { - ApiResponse localVarResponse = postPingSystemWithHttpInfo(); + return postPingSystem(null); + } + + /** + * Pings the system. + * + * @param headers Optional headers to include in the request + * @return String + * @throws ApiException if fails to make API call + */ + public String postPingSystem(Map headers) throws ApiException { + ApiResponse localVarResponse = postPingSystemWithHttpInfo(headers); return localVarResponse.getData(); } @@ -626,7 +898,18 @@ public String postPingSystem() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse postPingSystemWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = postPingSystemRequestBuilder(); + return postPingSystemWithHttpInfo(null); + } + + /** + * Pings the system. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse postPingSystemWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postPingSystemRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -643,12 +926,14 @@ public ApiResponse postPingSystemWithHttpInfo() throws ApiException { } String responseBody = new String(localVarResponse.body().readAllBytes()); + String responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -659,7 +944,7 @@ public ApiResponse postPingSystemWithHttpInfo() throws ApiException { } } - private HttpRequest.Builder postPingSystemRequestBuilder() throws ApiException { + private HttpRequest.Builder postPingSystemRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -674,6 +959,8 @@ private HttpRequest.Builder postPingSystemRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -686,7 +973,17 @@ private HttpRequest.Builder postPingSystemRequestBuilder() throws ApiException { * @throws ApiException if fails to make API call */ public void restartApplication() throws ApiException { - restartApplicationWithHttpInfo(); + restartApplication(null); + } + + /** + * Restarts the application. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void restartApplication(Map headers) throws ApiException { + restartApplicationWithHttpInfo(headers); } /** @@ -696,7 +993,18 @@ public void restartApplication() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse restartApplicationWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = restartApplicationRequestBuilder(); + return restartApplicationWithHttpInfo(null); + } + + /** + * Restarts the application. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse restartApplicationWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = restartApplicationRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -723,7 +1031,7 @@ public ApiResponse restartApplicationWithHttpInfo() throws ApiException { } } - private HttpRequest.Builder restartApplicationRequestBuilder() throws ApiException { + private HttpRequest.Builder restartApplicationRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -738,6 +1046,8 @@ private HttpRequest.Builder restartApplicationRequestBuilder() throws ApiExcepti if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -750,7 +1060,17 @@ private HttpRequest.Builder restartApplicationRequestBuilder() throws ApiExcepti * @throws ApiException if fails to make API call */ public void shutdownApplication() throws ApiException { - shutdownApplicationWithHttpInfo(); + shutdownApplication(null); + } + + /** + * Shuts down the application. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void shutdownApplication(Map headers) throws ApiException { + shutdownApplicationWithHttpInfo(headers); } /** @@ -760,7 +1080,18 @@ public void shutdownApplication() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse shutdownApplicationWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = shutdownApplicationRequestBuilder(); + return shutdownApplicationWithHttpInfo(null); + } + + /** + * Shuts down the application. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse shutdownApplicationWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = shutdownApplicationRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -787,7 +1118,7 @@ public ApiResponse shutdownApplicationWithHttpInfo() throws ApiException { } } - private HttpRequest.Builder shutdownApplicationRequestBuilder() throws ApiException { + private HttpRequest.Builder shutdownApplicationRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -802,6 +1133,8 @@ private HttpRequest.Builder shutdownApplicationRequestBuilder() throws ApiExcept if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TimeSyncApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TimeSyncApi.java index 2c616aaee4dca..95886c7c9dfc3 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TimeSyncApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TimeSyncApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -19,6 +20,7 @@ import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; +import java.util.Map; import java.util.function.Consumer; import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; @@ -32,6 +34,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class TimeSyncApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -67,6 +91,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets the current UTC time. * @@ -74,7 +148,18 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public UtcTimeResponse getUtcTime() throws ApiException { - ApiResponse localVarResponse = getUtcTimeWithHttpInfo(); + return getUtcTime(null); + } + + /** + * Gets the current UTC time. + * + * @param headers Optional headers to include in the request + * @return UtcTimeResponse + * @throws ApiException if fails to make API call + */ + public UtcTimeResponse getUtcTime(Map headers) throws ApiException { + ApiResponse localVarResponse = getUtcTimeWithHttpInfo(headers); return localVarResponse.getData(); } @@ -85,7 +170,18 @@ public UtcTimeResponse getUtcTime() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getUtcTimeWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getUtcTimeRequestBuilder(); + return getUtcTimeWithHttpInfo(null); + } + + /** + * Gets the current UTC time. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<UtcTimeResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUtcTimeWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUtcTimeRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -102,12 +198,14 @@ public ApiResponse getUtcTimeWithHttpInfo() throws ApiException } String responseBody = new String(localVarResponse.body().readAllBytes()); + UtcTimeResponse responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -118,7 +216,7 @@ public ApiResponse getUtcTimeWithHttpInfo() throws ApiException } } - private HttpRequest.Builder getUtcTimeRequestBuilder() throws ApiException { + private HttpRequest.Builder getUtcTimeRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -133,6 +231,8 @@ private HttpRequest.Builder getUtcTimeRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TmdbApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TmdbApi.java index 3669cc8f127d8..627ace21cf094 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TmdbApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TmdbApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -19,6 +20,7 @@ import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; +import java.util.Map; import java.util.function.Consumer; import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; @@ -32,6 +34,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class TmdbApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -67,6 +91,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets the TMDb image configuration options. * @@ -74,7 +148,18 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public ConfigImageTypes tmdbClientConfiguration() throws ApiException { - ApiResponse localVarResponse = tmdbClientConfigurationWithHttpInfo(); + return tmdbClientConfiguration(null); + } + + /** + * Gets the TMDb image configuration options. + * + * @param headers Optional headers to include in the request + * @return ConfigImageTypes + * @throws ApiException if fails to make API call + */ + public ConfigImageTypes tmdbClientConfiguration(Map headers) throws ApiException { + ApiResponse localVarResponse = tmdbClientConfigurationWithHttpInfo(headers); return localVarResponse.getData(); } @@ -85,7 +170,19 @@ public ConfigImageTypes tmdbClientConfiguration() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse tmdbClientConfigurationWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = tmdbClientConfigurationRequestBuilder(); + return tmdbClientConfigurationWithHttpInfo(null); + } + + /** + * Gets the TMDb image configuration options. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<ConfigImageTypes> + * @throws ApiException if fails to make API call + */ + public ApiResponse tmdbClientConfigurationWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = tmdbClientConfigurationRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -102,12 +199,14 @@ public ApiResponse tmdbClientConfigurationWithHttpInfo() throw } String responseBody = new String(localVarResponse.body().readAllBytes()); + ConfigImageTypes responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -118,7 +217,7 @@ public ApiResponse tmdbClientConfigurationWithHttpInfo() throw } } - private HttpRequest.Builder tmdbClientConfigurationRequestBuilder() throws ApiException { + private HttpRequest.Builder tmdbClientConfigurationRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -132,6 +231,8 @@ private HttpRequest.Builder tmdbClientConfigurationRequestBuilder() throws ApiEx if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TrailersApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TrailersApi.java index cd311b8da360c..0d91f2b34abf5 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TrailersApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TrailersApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -22,6 +23,7 @@ import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -48,6 +50,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class TrailersApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -83,6 +107,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Finds movies and trailers similar to a given trailer. * @@ -283,6 +357,221 @@ public BaseItemDtoQueryResult getTrailers(@org.eclipse.jdt.annotation.NonNull UU @org.eclipse.jdt.annotation.NonNull List genreIds, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getTrailers(userId, maxOfficialRating, hasThemeSong, hasThemeVideo, hasSubtitles, hasSpecialFeature, + hasTrailer, adjacentTo, parentIndexNumber, hasParentalRating, isHd, is4K, locationTypes, + excludeLocationTypes, isMissing, isUnaired, minCommunityRating, minCriticRating, minPremiereDate, + minDateLastSaved, minDateLastSavedForUser, maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, + hasTvdbId, isMovie, isSeries, isNews, isKids, isSports, excludeItemIds, startIndex, limit, recursive, + searchTerm, sortOrder, parentId, fields, excludeItemTypes, filters, isFavorite, mediaTypes, imageTypes, + sortBy, isPlayed, genres, officialRatings, tags, years, enableUserData, imageTypeLimit, + enableImageTypes, person, personIds, personTypes, studios, artists, excludeArtistIds, artistIds, + albumArtistIds, contributingArtistIds, albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, + isPlaceHolder, hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, + seriesStatus, nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, + enableTotalRecordCount, enableImages, null); + } + + /** + * Finds movies and trailers similar to a given trailer. + * + * @param userId The user id supplied as query parameter; this is required when not using an API key. (optional) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an IMDb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a TMDb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a TVDb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending, Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getTrailers(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { ApiResponse localVarResponse = getTrailersWithHttpInfo(userId, maxOfficialRating, hasThemeSong, hasThemeVideo, hasSubtitles, hasSpecialFeature, hasTrailer, adjacentTo, parentIndexNumber, hasParentalRating, isHd, is4K, locationTypes, excludeLocationTypes, isMissing, isUnaired, @@ -295,7 +584,7 @@ public BaseItemDtoQueryResult getTrailers(@org.eclipse.jdt.annotation.NonNull UU albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, isPlaceHolder, hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, seriesStatus, nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, enableTotalRecordCount, - enableImages); + enableImages, headers); return localVarResponse.getData(); } @@ -499,6 +788,221 @@ public ApiResponse getTrailersWithHttpInfo(@org.eclipse. @org.eclipse.jdt.annotation.NonNull List genreIds, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getTrailersWithHttpInfo(userId, maxOfficialRating, hasThemeSong, hasThemeVideo, hasSubtitles, + hasSpecialFeature, hasTrailer, adjacentTo, parentIndexNumber, hasParentalRating, isHd, is4K, + locationTypes, excludeLocationTypes, isMissing, isUnaired, minCommunityRating, minCriticRating, + minPremiereDate, minDateLastSaved, minDateLastSavedForUser, maxPremiereDate, hasOverview, hasImdbId, + hasTmdbId, hasTvdbId, isMovie, isSeries, isNews, isKids, isSports, excludeItemIds, startIndex, limit, + recursive, searchTerm, sortOrder, parentId, fields, excludeItemTypes, filters, isFavorite, mediaTypes, + imageTypes, sortBy, isPlayed, genres, officialRatings, tags, years, enableUserData, imageTypeLimit, + enableImageTypes, person, personIds, personTypes, studios, artists, excludeArtistIds, artistIds, + albumArtistIds, contributingArtistIds, albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, + isPlaceHolder, hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, + seriesStatus, nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, + enableTotalRecordCount, enableImages, null); + } + + /** + * Finds movies and trailers similar to a given trailer. + * + * @param userId The user id supplied as query parameter; this is required when not using an API key. (optional) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an IMDb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a TMDb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a TVDb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending, Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTrailersWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getTrailersRequestBuilder(userId, maxOfficialRating, hasThemeSong, hasThemeVideo, hasSubtitles, hasSpecialFeature, hasTrailer, adjacentTo, parentIndexNumber, hasParentalRating, isHd, is4K, locationTypes, excludeLocationTypes, isMissing, isUnaired, @@ -511,7 +1015,7 @@ public ApiResponse getTrailersWithHttpInfo(@org.eclipse. albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, isPlaceHolder, hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, seriesStatus, nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, enableTotalRecordCount, - enableImages); + enableImages, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -528,14 +1032,14 @@ public ApiResponse getTrailersWithHttpInfo(@org.eclipse. } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -619,7 +1123,7 @@ private HttpRequest.Builder getTrailersRequestBuilder(@org.eclipse.jdt.annotatio @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull List genreIds, @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, - @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -815,6 +1319,8 @@ private HttpRequest.Builder getTrailersRequestBuilder(@org.eclipse.jdt.annotatio if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TrickplayApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TrickplayApi.java index 8a24a184b1764..6874dca5ff021 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TrickplayApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TrickplayApi.java @@ -22,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -32,11 +33,32 @@ import org.openhab.binding.jellyfin.internal.api.generated.Configuration; import org.openhab.binding.jellyfin.internal.api.generated.Pair; -import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class TrickplayApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -72,6 +94,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets an image tiles playlist for trickplay. * @@ -84,7 +156,23 @@ private String formatExceptionMessage(String operationId, int statusCode, String public File getTrickplayHlsPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId) throws ApiException { - ApiResponse localVarResponse = getTrickplayHlsPlaylistWithHttpInfo(itemId, width, mediaSourceId); + return getTrickplayHlsPlaylist(itemId, width, mediaSourceId, null); + } + + /** + * Gets an image tiles playlist for trickplay. + * + * @param itemId The item id. (required) + * @param width The width of a single tile. (required) + * @param mediaSourceId The media version id, if using an alternate version. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getTrickplayHlsPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getTrickplayHlsPlaylistWithHttpInfo(itemId, width, mediaSourceId, headers); return localVarResponse.getData(); } @@ -100,8 +188,24 @@ public File getTrickplayHlsPlaylist(@org.eclipse.jdt.annotation.Nullable UUID it public ApiResponse getTrickplayHlsPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getTrickplayHlsPlaylistRequestBuilder(itemId, width, - mediaSourceId); + return getTrickplayHlsPlaylistWithHttpInfo(itemId, width, mediaSourceId, null); + } + + /** + * Gets an image tiles playlist for trickplay. + * + * @param itemId The item id. (required) + * @param width The width of a single tile. (required) + * @param mediaSourceId The media version id, if using an alternate version. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTrickplayHlsPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTrickplayHlsPlaylistRequestBuilder(itemId, width, mediaSourceId, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -116,13 +220,13 @@ public ApiResponse getTrickplayHlsPlaylistWithHttpInfo(@org.eclipse.jdt.an return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -134,8 +238,8 @@ public ApiResponse getTrickplayHlsPlaylistWithHttpInfo(@org.eclipse.jdt.an } private HttpRequest.Builder getTrickplayHlsPlaylistRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId) - throws ApiException { + @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getTrickplayHlsPlaylist"); @@ -175,6 +279,8 @@ private HttpRequest.Builder getTrickplayHlsPlaylistRequestBuilder(@org.eclipse.j if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -194,7 +300,25 @@ private HttpRequest.Builder getTrickplayHlsPlaylistRequestBuilder(@org.eclipse.j public File getTrickplayTileImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.Nullable Integer index, @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId) throws ApiException { - ApiResponse localVarResponse = getTrickplayTileImageWithHttpInfo(itemId, width, index, mediaSourceId); + return getTrickplayTileImage(itemId, width, index, mediaSourceId, null); + } + + /** + * Gets a trickplay tile image. + * + * @param itemId The item id. (required) + * @param width The width of a single tile. (required) + * @param index The index of the desired tile. (required) + * @param mediaSourceId The media version id, if using an alternate version. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getTrickplayTileImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.Nullable Integer index, + @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId, Map headers) throws ApiException { + ApiResponse localVarResponse = getTrickplayTileImageWithHttpInfo(itemId, width, index, mediaSourceId, + headers); return localVarResponse.getData(); } @@ -211,8 +335,25 @@ public File getTrickplayTileImage(@org.eclipse.jdt.annotation.Nullable UUID item public ApiResponse getTrickplayTileImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.Nullable Integer index, @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId) throws ApiException { + return getTrickplayTileImageWithHttpInfo(itemId, width, index, mediaSourceId, null); + } + + /** + * Gets a trickplay tile image. + * + * @param itemId The item id. (required) + * @param width The width of a single tile. (required) + * @param index The index of the desired tile. (required) + * @param mediaSourceId The media version id, if using an alternate version. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTrickplayTileImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.Nullable Integer index, + @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getTrickplayTileImageRequestBuilder(itemId, width, index, - mediaSourceId); + mediaSourceId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -227,13 +368,13 @@ public ApiResponse getTrickplayTileImageWithHttpInfo(@org.eclipse.jdt.anno return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -246,7 +387,7 @@ public ApiResponse getTrickplayTileImageWithHttpInfo(@org.eclipse.jdt.anno private HttpRequest.Builder getTrickplayTileImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable Integer width, @org.eclipse.jdt.annotation.Nullable Integer index, - @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID mediaSourceId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getTrickplayTileImage"); @@ -291,6 +432,8 @@ private HttpRequest.Builder getTrickplayTileImageRequestBuilder(@org.eclipse.jdt if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TvShowsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TvShowsApi.java index ae656a52bcf36..62cb62649e16c 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TvShowsApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/TvShowsApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -22,6 +23,7 @@ import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -41,6 +43,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class TvShowsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -76,6 +100,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets episodes for a tv season. * @@ -115,9 +189,53 @@ public BaseItemDtoQueryResult getEpisodes(@org.eclipse.jdt.annotation.Nullable U @org.eclipse.jdt.annotation.NonNull List enableImageTypes, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull ItemSortBy sortBy) throws ApiException { + return getEpisodes(seriesId, userId, fields, season, seasonId, isMissing, adjacentTo, startItemId, startIndex, + limit, enableImages, imageTypeLimit, enableImageTypes, enableUserData, sortBy, null); + } + + /** + * Gets episodes for a tv season. + * + * @param seriesId The series id. (required) + * @param userId The user id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param season Optional filter by season number. (optional) + * @param seasonId Optional. Filter by season id. (optional) + * @param isMissing Optional. Filter by items that are missing episodes or not. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param startItemId Optional. Skip through the list until a given item is found. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param enableImages Optional, include image information in output. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getEpisodes(@org.eclipse.jdt.annotation.Nullable UUID seriesId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer season, @org.eclipse.jdt.annotation.NonNull UUID seasonId, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull UUID startItemId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull ItemSortBy sortBy, Map headers) throws ApiException { ApiResponse localVarResponse = getEpisodesWithHttpInfo(seriesId, userId, fields, season, seasonId, isMissing, adjacentTo, startItemId, startIndex, limit, enableImages, imageTypeLimit, - enableImageTypes, enableUserData, sortBy); + enableImageTypes, enableUserData, sortBy, headers); return localVarResponse.getData(); } @@ -160,9 +278,53 @@ public ApiResponse getEpisodesWithHttpInfo( @org.eclipse.jdt.annotation.NonNull List enableImageTypes, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull ItemSortBy sortBy) throws ApiException { + return getEpisodesWithHttpInfo(seriesId, userId, fields, season, seasonId, isMissing, adjacentTo, startItemId, + startIndex, limit, enableImages, imageTypeLimit, enableImageTypes, enableUserData, sortBy, null); + } + + /** + * Gets episodes for a tv season. + * + * @param seriesId The series id. (required) + * @param userId The user id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param season Optional filter by season number. (optional) + * @param seasonId Optional. Filter by season id. (optional) + * @param isMissing Optional. Filter by items that are missing episodes or not. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param startItemId Optional. Skip through the list until a given item is found. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param enableImages Optional, include image information in output. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEpisodesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID seriesId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer season, @org.eclipse.jdt.annotation.NonNull UUID seasonId, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull UUID startItemId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull ItemSortBy sortBy, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getEpisodesRequestBuilder(seriesId, userId, fields, season, seasonId, isMissing, adjacentTo, startItemId, startIndex, limit, enableImages, imageTypeLimit, - enableImageTypes, enableUserData, sortBy); + enableImageTypes, enableUserData, sortBy, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -179,14 +341,14 @@ public ApiResponse getEpisodesWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -208,7 +370,7 @@ private HttpRequest.Builder getEpisodesRequestBuilder(@org.eclipse.jdt.annotatio @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, - @org.eclipse.jdt.annotation.NonNull ItemSortBy sortBy) throws ApiException { + @org.eclipse.jdt.annotation.NonNull ItemSortBy sortBy, Map headers) throws ApiException { // verify the required parameter 'seriesId' is set if (seriesId == null) { throw new ApiException(400, "Missing the required parameter 'seriesId' when calling getEpisodes"); @@ -269,6 +431,8 @@ private HttpRequest.Builder getEpisodesRequestBuilder(@org.eclipse.jdt.annotatio if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -313,9 +477,54 @@ public BaseItemDtoQueryResult getNextUp(@org.eclipse.jdt.annotation.NonNull UUID @org.eclipse.jdt.annotation.NonNull Boolean disableFirstEpisode, @org.eclipse.jdt.annotation.NonNull Boolean enableResumable, @org.eclipse.jdt.annotation.NonNull Boolean enableRewatching) throws ApiException { + return getNextUp(userId, startIndex, limit, fields, seriesId, parentId, enableImages, imageTypeLimit, + enableImageTypes, enableUserData, nextUpDateCutoff, enableTotalRecordCount, disableFirstEpisode, + enableResumable, enableRewatching, null); + } + + /** + * Gets a list of next up episodes. + * + * @param userId The user id of the user to get the next up episodes for. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param seriesId Optional. Filter by series id. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param nextUpDateCutoff Optional. Starting date of shows to show in Next Up section. (optional) + * @param enableTotalRecordCount Whether to enable the total records count. Defaults to true. (optional, default to + * true) + * @param disableFirstEpisode Whether to disable sending the first episode in a series as next up. (optional, + * default to false) + * @param enableResumable Whether to include resumable episodes in next up results. (optional, default to true) + * @param enableRewatching Whether to include watched episodes in next up results. (optional, default to false) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getNextUp(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull UUID seriesId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime nextUpDateCutoff, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean disableFirstEpisode, + @org.eclipse.jdt.annotation.NonNull Boolean enableResumable, + @org.eclipse.jdt.annotation.NonNull Boolean enableRewatching, Map headers) + throws ApiException { ApiResponse localVarResponse = getNextUpWithHttpInfo(userId, startIndex, limit, fields, seriesId, parentId, enableImages, imageTypeLimit, enableImageTypes, enableUserData, nextUpDateCutoff, - enableTotalRecordCount, disableFirstEpisode, enableResumable, enableRewatching); + enableTotalRecordCount, disableFirstEpisode, enableResumable, enableRewatching, headers); return localVarResponse.getData(); } @@ -357,9 +566,54 @@ public ApiResponse getNextUpWithHttpInfo(@org.eclipse.jd @org.eclipse.jdt.annotation.NonNull Boolean disableFirstEpisode, @org.eclipse.jdt.annotation.NonNull Boolean enableResumable, @org.eclipse.jdt.annotation.NonNull Boolean enableRewatching) throws ApiException { + return getNextUpWithHttpInfo(userId, startIndex, limit, fields, seriesId, parentId, enableImages, + imageTypeLimit, enableImageTypes, enableUserData, nextUpDateCutoff, enableTotalRecordCount, + disableFirstEpisode, enableResumable, enableRewatching, null); + } + + /** + * Gets a list of next up episodes. + * + * @param userId The user id of the user to get the next up episodes for. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param seriesId Optional. Filter by series id. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param nextUpDateCutoff Optional. Starting date of shows to show in Next Up section. (optional) + * @param enableTotalRecordCount Whether to enable the total records count. Defaults to true. (optional, default to + * true) + * @param disableFirstEpisode Whether to disable sending the first episode in a series as next up. (optional, + * default to false) + * @param enableResumable Whether to include resumable episodes in next up results. (optional, default to true) + * @param enableRewatching Whether to include watched episodes in next up results. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getNextUpWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull UUID seriesId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime nextUpDateCutoff, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean disableFirstEpisode, + @org.eclipse.jdt.annotation.NonNull Boolean enableResumable, + @org.eclipse.jdt.annotation.NonNull Boolean enableRewatching, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getNextUpRequestBuilder(userId, startIndex, limit, fields, seriesId, parentId, enableImages, imageTypeLimit, enableImageTypes, enableUserData, nextUpDateCutoff, - enableTotalRecordCount, disableFirstEpisode, enableResumable, enableRewatching); + enableTotalRecordCount, disableFirstEpisode, enableResumable, enableRewatching, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -376,14 +630,14 @@ public ApiResponse getNextUpWithHttpInfo(@org.eclipse.jd } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -406,7 +660,8 @@ private HttpRequest.Builder getNextUpRequestBuilder(@org.eclipse.jdt.annotation. @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, @org.eclipse.jdt.annotation.NonNull Boolean disableFirstEpisode, @org.eclipse.jdt.annotation.NonNull Boolean enableResumable, - @org.eclipse.jdt.annotation.NonNull Boolean enableRewatching) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableRewatching, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -464,6 +719,8 @@ private HttpRequest.Builder getNextUpRequestBuilder(@org.eclipse.jdt.annotation. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -498,8 +755,43 @@ public BaseItemDtoQueryResult getSeasons(@org.eclipse.jdt.annotation.Nullable UU @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData) throws ApiException { + return getSeasons(seriesId, userId, fields, isSpecialSeason, isMissing, adjacentTo, enableImages, + imageTypeLimit, enableImageTypes, enableUserData, null); + } + + /** + * Gets seasons for a tv series. + * + * @param seriesId The series id. (required) + * @param userId The user id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param isSpecialSeason Optional. Filter by special season. (optional) + * @param isMissing Optional. Filter by items that are missing episodes or not. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSeasons(@org.eclipse.jdt.annotation.Nullable UUID seriesId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean isSpecialSeason, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, Map headers) + throws ApiException { ApiResponse localVarResponse = getSeasonsWithHttpInfo(seriesId, userId, fields, - isSpecialSeason, isMissing, adjacentTo, enableImages, imageTypeLimit, enableImageTypes, enableUserData); + isSpecialSeason, isMissing, adjacentTo, enableImages, imageTypeLimit, enableImageTypes, enableUserData, + headers); return localVarResponse.getData(); } @@ -531,8 +823,42 @@ public ApiResponse getSeasonsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData) throws ApiException { + return getSeasonsWithHttpInfo(seriesId, userId, fields, isSpecialSeason, isMissing, adjacentTo, enableImages, + imageTypeLimit, enableImageTypes, enableUserData, null); + } + + /** + * Gets seasons for a tv series. + * + * @param seriesId The series id. (required) + * @param userId The user id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param isSpecialSeason Optional. Filter by special season. (optional) + * @param isMissing Optional. Filter by items that are missing episodes or not. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSeasonsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID seriesId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean isSpecialSeason, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, @org.eclipse.jdt.annotation.NonNull UUID adjacentTo, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getSeasonsRequestBuilder(seriesId, userId, fields, isSpecialSeason, - isMissing, adjacentTo, enableImages, imageTypeLimit, enableImageTypes, enableUserData); + isMissing, adjacentTo, enableImages, imageTypeLimit, enableImageTypes, enableUserData, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -549,14 +875,14 @@ public ApiResponse getSeasonsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -575,7 +901,8 @@ private HttpRequest.Builder getSeasonsRequestBuilder(@org.eclipse.jdt.annotation @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes, - @org.eclipse.jdt.annotation.NonNull Boolean enableUserData) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, Map headers) + throws ApiException { // verify the required parameter 'seriesId' is set if (seriesId == null) { throw new ApiException(400, "Missing the required parameter 'seriesId' when calling getSeasons"); @@ -626,6 +953,8 @@ private HttpRequest.Builder getSeasonsRequestBuilder(@org.eclipse.jdt.annotation if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -656,8 +985,38 @@ public BaseItemDtoQueryResult getUpcomingEpisodes(@org.eclipse.jdt.annotation.No @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData) throws ApiException { + return getUpcomingEpisodes(userId, startIndex, limit, fields, parentId, enableImages, imageTypeLimit, + enableImageTypes, enableUserData, null); + } + + /** + * Gets a list of upcoming episodes. + * + * @param userId The user id of the user to get the upcoming episodes for. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getUpcomingEpisodes(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, Map headers) + throws ApiException { ApiResponse localVarResponse = getUpcomingEpisodesWithHttpInfo(userId, startIndex, - limit, fields, parentId, enableImages, imageTypeLimit, enableImageTypes, enableUserData); + limit, fields, parentId, enableImages, imageTypeLimit, enableImageTypes, enableUserData, headers); return localVarResponse.getData(); } @@ -686,8 +1045,39 @@ public ApiResponse getUpcomingEpisodesWithHttpInfo( @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData) throws ApiException { + return getUpcomingEpisodesWithHttpInfo(userId, startIndex, limit, fields, parentId, enableImages, + imageTypeLimit, enableImageTypes, enableUserData, null); + } + + /** + * Gets a list of upcoming episodes. + * + * @param userId The user id of the user to get the upcoming episodes for. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUpcomingEpisodesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getUpcomingEpisodesRequestBuilder(userId, startIndex, limit, - fields, parentId, enableImages, imageTypeLimit, enableImageTypes, enableUserData); + fields, parentId, enableImages, imageTypeLimit, enableImageTypes, enableUserData, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -704,14 +1094,14 @@ public ApiResponse getUpcomingEpisodesWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -728,7 +1118,8 @@ private HttpRequest.Builder getUpcomingEpisodesRequestBuilder(@org.eclipse.jdt.a @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes, - @org.eclipse.jdt.annotation.NonNull Boolean enableUserData) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -774,6 +1165,8 @@ private HttpRequest.Builder getUpcomingEpisodesRequestBuilder(@org.eclipse.jdt.a if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UniversalAudioApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UniversalAudioApi.java index 579f59894fe0b..c03dcb11579e2 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UniversalAudioApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UniversalAudioApi.java @@ -22,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -33,11 +34,32 @@ import org.openhab.binding.jellyfin.internal.api.generated.Pair; import org.openhab.binding.jellyfin.internal.api.generated.current.model.MediaStreamProtocol; -import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class UniversalAudioApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -73,6 +95,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets an audio stream. * @@ -117,10 +189,63 @@ public File getUniversalAudioStream(@org.eclipse.jdt.annotation.Nullable UUID it @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection) throws ApiException { + return getUniversalAudioStream(itemId, container, mediaSourceId, deviceId, userId, audioCodec, maxAudioChannels, + transcodingAudioChannels, maxStreamingBitrate, audioBitRate, startTimeTicks, transcodingContainer, + transcodingProtocol, maxAudioSampleRate, maxAudioBitDepth, enableRemoteMedia, enableAudioVbrEncoding, + breakOnNonKeyFrames, enableRedirection, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container Optional. The audio container. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param userId Optional. The user id. (optional) + * @param audioCodec Optional. The audio codec to transcode to. (optional) + * @param maxAudioChannels Optional. The maximum number of audio channels. (optional) + * @param transcodingAudioChannels Optional. The number of how many audio channels to transcode to. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param transcodingContainer Optional. The container to transcode to. (optional) + * @param transcodingProtocol Optional. The transcoding protocol. (optional) + * @param maxAudioSampleRate Optional. The maximum audio sample rate. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param enableRemoteMedia Optional. Whether to enable remote media. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional, default to false) + * @param enableRedirection Whether to enable redirection. Defaults to true. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getUniversalAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull MediaStreamProtocol transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection, Map headers) + throws ApiException { ApiResponse localVarResponse = getUniversalAudioStreamWithHttpInfo(itemId, container, mediaSourceId, deviceId, userId, audioCodec, maxAudioChannels, transcodingAudioChannels, maxStreamingBitrate, audioBitRate, startTimeTicks, transcodingContainer, transcodingProtocol, maxAudioSampleRate, - maxAudioBitDepth, enableRemoteMedia, enableAudioVbrEncoding, breakOnNonKeyFrames, enableRedirection); + maxAudioBitDepth, enableRemoteMedia, enableAudioVbrEncoding, breakOnNonKeyFrames, enableRedirection, + headers); return localVarResponse.getData(); } @@ -168,11 +293,63 @@ public ApiResponse getUniversalAudioStreamWithHttpInfo(@org.eclipse.jdt.an @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection) throws ApiException { + return getUniversalAudioStreamWithHttpInfo(itemId, container, mediaSourceId, deviceId, userId, audioCodec, + maxAudioChannels, transcodingAudioChannels, maxStreamingBitrate, audioBitRate, startTimeTicks, + transcodingContainer, transcodingProtocol, maxAudioSampleRate, maxAudioBitDepth, enableRemoteMedia, + enableAudioVbrEncoding, breakOnNonKeyFrames, enableRedirection, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container Optional. The audio container. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param userId Optional. The user id. (optional) + * @param audioCodec Optional. The audio codec to transcode to. (optional) + * @param maxAudioChannels Optional. The maximum number of audio channels. (optional) + * @param transcodingAudioChannels Optional. The number of how many audio channels to transcode to. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param transcodingContainer Optional. The container to transcode to. (optional) + * @param transcodingProtocol Optional. The transcoding protocol. (optional) + * @param maxAudioSampleRate Optional. The maximum audio sample rate. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param enableRemoteMedia Optional. Whether to enable remote media. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional, default to false) + * @param enableRedirection Whether to enable redirection. Defaults to true. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUniversalAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull MediaStreamProtocol transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getUniversalAudioStreamRequestBuilder(itemId, container, mediaSourceId, deviceId, userId, audioCodec, maxAudioChannels, transcodingAudioChannels, maxStreamingBitrate, audioBitRate, startTimeTicks, transcodingContainer, transcodingProtocol, maxAudioSampleRate, maxAudioBitDepth, enableRemoteMedia, enableAudioVbrEncoding, breakOnNonKeyFrames, - enableRedirection); + enableRedirection, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -187,13 +364,13 @@ public ApiResponse getUniversalAudioStreamWithHttpInfo(@org.eclipse.jdt.an return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -221,7 +398,8 @@ private HttpRequest.Builder getUniversalAudioStreamRequestBuilder(@org.eclipse.j @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, - @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getUniversalAudioStream"); @@ -289,6 +467,8 @@ private HttpRequest.Builder getUniversalAudioStreamRequestBuilder(@org.eclipse.j if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -339,10 +519,63 @@ public File headUniversalAudioStream(@org.eclipse.jdt.annotation.Nullable UUID i @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection) throws ApiException { + return headUniversalAudioStream(itemId, container, mediaSourceId, deviceId, userId, audioCodec, + maxAudioChannels, transcodingAudioChannels, maxStreamingBitrate, audioBitRate, startTimeTicks, + transcodingContainer, transcodingProtocol, maxAudioSampleRate, maxAudioBitDepth, enableRemoteMedia, + enableAudioVbrEncoding, breakOnNonKeyFrames, enableRedirection, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container Optional. The audio container. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param userId Optional. The user id. (optional) + * @param audioCodec Optional. The audio codec to transcode to. (optional) + * @param maxAudioChannels Optional. The maximum number of audio channels. (optional) + * @param transcodingAudioChannels Optional. The number of how many audio channels to transcode to. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param transcodingContainer Optional. The container to transcode to. (optional) + * @param transcodingProtocol Optional. The transcoding protocol. (optional) + * @param maxAudioSampleRate Optional. The maximum audio sample rate. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param enableRemoteMedia Optional. Whether to enable remote media. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional, default to false) + * @param enableRedirection Whether to enable redirection. Defaults to true. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headUniversalAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull MediaStreamProtocol transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection, Map headers) + throws ApiException { ApiResponse localVarResponse = headUniversalAudioStreamWithHttpInfo(itemId, container, mediaSourceId, deviceId, userId, audioCodec, maxAudioChannels, transcodingAudioChannels, maxStreamingBitrate, audioBitRate, startTimeTicks, transcodingContainer, transcodingProtocol, maxAudioSampleRate, - maxAudioBitDepth, enableRemoteMedia, enableAudioVbrEncoding, breakOnNonKeyFrames, enableRedirection); + maxAudioBitDepth, enableRemoteMedia, enableAudioVbrEncoding, breakOnNonKeyFrames, enableRedirection, + headers); return localVarResponse.getData(); } @@ -390,11 +623,63 @@ public ApiResponse headUniversalAudioStreamWithHttpInfo(@org.eclipse.jdt.a @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection) throws ApiException { + return headUniversalAudioStreamWithHttpInfo(itemId, container, mediaSourceId, deviceId, userId, audioCodec, + maxAudioChannels, transcodingAudioChannels, maxStreamingBitrate, audioBitRate, startTimeTicks, + transcodingContainer, transcodingProtocol, maxAudioSampleRate, maxAudioBitDepth, enableRemoteMedia, + enableAudioVbrEncoding, breakOnNonKeyFrames, enableRedirection, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container Optional. The audio container. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param userId Optional. The user id. (optional) + * @param audioCodec Optional. The audio codec to transcode to. (optional) + * @param maxAudioChannels Optional. The maximum number of audio channels. (optional) + * @param transcodingAudioChannels Optional. The number of how many audio channels to transcode to. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param transcodingContainer Optional. The container to transcode to. (optional) + * @param transcodingProtocol Optional. The transcoding protocol. (optional) + * @param maxAudioSampleRate Optional. The maximum audio sample rate. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param enableRemoteMedia Optional. Whether to enable remote media. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional, default to false) + * @param enableRedirection Whether to enable redirection. Defaults to true. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headUniversalAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull MediaStreamProtocol transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = headUniversalAudioStreamRequestBuilder(itemId, container, mediaSourceId, deviceId, userId, audioCodec, maxAudioChannels, transcodingAudioChannels, maxStreamingBitrate, audioBitRate, startTimeTicks, transcodingContainer, transcodingProtocol, maxAudioSampleRate, maxAudioBitDepth, enableRemoteMedia, enableAudioVbrEncoding, breakOnNonKeyFrames, - enableRedirection); + enableRedirection, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -409,13 +694,13 @@ public ApiResponse headUniversalAudioStreamWithHttpInfo(@org.eclipse.jdt.a return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -443,7 +728,8 @@ private HttpRequest.Builder headUniversalAudioStreamRequestBuilder(@org.eclipse. @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, - @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, @@ -512,6 +798,8 @@ private HttpRequest.Builder headUniversalAudioStreamRequestBuilder(@org.eclipse. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserApi.java index 098db53b2c3b8..fc9b2b4444a14 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -48,6 +50,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class UserApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -83,6 +107,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Authenticates a user by name. * @@ -94,7 +168,24 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public AuthenticationResult authenticateUserByName( @org.eclipse.jdt.annotation.Nullable AuthenticateUserByName authenticateUserByName) throws ApiException { - ApiResponse localVarResponse = authenticateUserByNameWithHttpInfo(authenticateUserByName); + return authenticateUserByName(authenticateUserByName, null); + } + + /** + * Authenticates a user by name. + * + * @param authenticateUserByName The + * M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) + * request. (required) + * @param headers Optional headers to include in the request + * @return AuthenticationResult + * @throws ApiException if fails to make API call + */ + public AuthenticationResult authenticateUserByName( + @org.eclipse.jdt.annotation.Nullable AuthenticateUserByName authenticateUserByName, + Map headers) throws ApiException { + ApiResponse localVarResponse = authenticateUserByNameWithHttpInfo(authenticateUserByName, + headers); return localVarResponse.getData(); } @@ -109,7 +200,24 @@ public AuthenticationResult authenticateUserByName( */ public ApiResponse authenticateUserByNameWithHttpInfo( @org.eclipse.jdt.annotation.Nullable AuthenticateUserByName authenticateUserByName) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = authenticateUserByNameRequestBuilder(authenticateUserByName); + return authenticateUserByNameWithHttpInfo(authenticateUserByName, null); + } + + /** + * Authenticates a user by name. + * + * @param authenticateUserByName The + * M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) + * request. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<AuthenticationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse authenticateUserByNameWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable AuthenticateUserByName authenticateUserByName, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = authenticateUserByNameRequestBuilder(authenticateUserByName, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -126,14 +234,14 @@ public ApiResponse authenticateUserByNameWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + AuthenticationResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -145,7 +253,8 @@ public ApiResponse authenticateUserByNameWithHttpInfo( } private HttpRequest.Builder authenticateUserByNameRequestBuilder( - @org.eclipse.jdt.annotation.Nullable AuthenticateUserByName authenticateUserByName) throws ApiException { + @org.eclipse.jdt.annotation.Nullable AuthenticateUserByName authenticateUserByName, + Map headers) throws ApiException { // verify the required parameter 'authenticateUserByName' is set if (authenticateUserByName == null) { throw new ApiException(400, @@ -171,6 +280,8 @@ private HttpRequest.Builder authenticateUserByNameRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -186,7 +297,22 @@ private HttpRequest.Builder authenticateUserByNameRequestBuilder( */ public AuthenticationResult authenticateWithQuickConnect( @org.eclipse.jdt.annotation.Nullable QuickConnectDto quickConnectDto) throws ApiException { - ApiResponse localVarResponse = authenticateWithQuickConnectWithHttpInfo(quickConnectDto); + return authenticateWithQuickConnect(quickConnectDto, null); + } + + /** + * Authenticates a user with quick connect. + * + * @param quickConnectDto The Jellyfin.Api.Models.UserDtos.QuickConnectDto request. (required) + * @param headers Optional headers to include in the request + * @return AuthenticationResult + * @throws ApiException if fails to make API call + */ + public AuthenticationResult authenticateWithQuickConnect( + @org.eclipse.jdt.annotation.Nullable QuickConnectDto quickConnectDto, Map headers) + throws ApiException { + ApiResponse localVarResponse = authenticateWithQuickConnectWithHttpInfo(quickConnectDto, + headers); return localVarResponse.getData(); } @@ -199,7 +325,22 @@ public AuthenticationResult authenticateWithQuickConnect( */ public ApiResponse authenticateWithQuickConnectWithHttpInfo( @org.eclipse.jdt.annotation.Nullable QuickConnectDto quickConnectDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = authenticateWithQuickConnectRequestBuilder(quickConnectDto); + return authenticateWithQuickConnectWithHttpInfo(quickConnectDto, null); + } + + /** + * Authenticates a user with quick connect. + * + * @param quickConnectDto The Jellyfin.Api.Models.UserDtos.QuickConnectDto request. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<AuthenticationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse authenticateWithQuickConnectWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable QuickConnectDto quickConnectDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = authenticateWithQuickConnectRequestBuilder(quickConnectDto, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -216,14 +357,14 @@ public ApiResponse authenticateWithQuickConnectWithHttpInf } String responseBody = new String(localVarResponse.body().readAllBytes()); + AuthenticationResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -235,7 +376,8 @@ public ApiResponse authenticateWithQuickConnectWithHttpInf } private HttpRequest.Builder authenticateWithQuickConnectRequestBuilder( - @org.eclipse.jdt.annotation.Nullable QuickConnectDto quickConnectDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable QuickConnectDto quickConnectDto, Map headers) + throws ApiException { // verify the required parameter 'quickConnectDto' is set if (quickConnectDto == null) { throw new ApiException(400, @@ -261,6 +403,8 @@ private HttpRequest.Builder authenticateWithQuickConnectRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -276,7 +420,20 @@ private HttpRequest.Builder authenticateWithQuickConnectRequestBuilder( */ public UserDto createUserByName(@org.eclipse.jdt.annotation.Nullable CreateUserByName createUserByName) throws ApiException { - ApiResponse localVarResponse = createUserByNameWithHttpInfo(createUserByName); + return createUserByName(createUserByName, null); + } + + /** + * Creates a user. + * + * @param createUserByName The create user by name request body. (required) + * @param headers Optional headers to include in the request + * @return UserDto + * @throws ApiException if fails to make API call + */ + public UserDto createUserByName(@org.eclipse.jdt.annotation.Nullable CreateUserByName createUserByName, + Map headers) throws ApiException { + ApiResponse localVarResponse = createUserByNameWithHttpInfo(createUserByName, headers); return localVarResponse.getData(); } @@ -289,7 +446,21 @@ public UserDto createUserByName(@org.eclipse.jdt.annotation.Nullable CreateUserB */ public ApiResponse createUserByNameWithHttpInfo( @org.eclipse.jdt.annotation.Nullable CreateUserByName createUserByName) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = createUserByNameRequestBuilder(createUserByName); + return createUserByNameWithHttpInfo(createUserByName, null); + } + + /** + * Creates a user. + * + * @param createUserByName The create user by name request body. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse createUserByNameWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable CreateUserByName createUserByName, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createUserByNameRequestBuilder(createUserByName, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -306,12 +477,14 @@ public ApiResponse createUserByNameWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + UserDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -323,7 +496,8 @@ public ApiResponse createUserByNameWithHttpInfo( } private HttpRequest.Builder createUserByNameRequestBuilder( - @org.eclipse.jdt.annotation.Nullable CreateUserByName createUserByName) throws ApiException { + @org.eclipse.jdt.annotation.Nullable CreateUserByName createUserByName, Map headers) + throws ApiException { // verify the required parameter 'createUserByName' is set if (createUserByName == null) { throw new ApiException(400, @@ -349,6 +523,8 @@ private HttpRequest.Builder createUserByNameRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -362,7 +538,19 @@ private HttpRequest.Builder createUserByNameRequestBuilder( * @throws ApiException if fails to make API call */ public void deleteUser(@org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { - deleteUserWithHttpInfo(userId); + deleteUser(userId, null); + } + + /** + * Deletes a user. + * + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteUser(@org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) + throws ApiException { + deleteUserWithHttpInfo(userId, headers); } /** @@ -374,7 +562,20 @@ public void deleteUser(@org.eclipse.jdt.annotation.Nullable UUID userId) throws */ public ApiResponse deleteUserWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteUserRequestBuilder(userId); + return deleteUserWithHttpInfo(userId, null); + } + + /** + * Deletes a user. + * + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteUserRequestBuilder(userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -401,8 +602,8 @@ public ApiResponse deleteUserWithHttpInfo(@org.eclipse.jdt.annotation.Null } } - private HttpRequest.Builder deleteUserRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId) - throws ApiException { + private HttpRequest.Builder deleteUserRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { // verify the required parameter 'userId' is set if (userId == null) { throw new ApiException(400, "Missing the required parameter 'userId' when calling deleteUser"); @@ -421,6 +622,8 @@ private HttpRequest.Builder deleteUserRequestBuilder(@org.eclipse.jdt.annotation if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -436,7 +639,20 @@ private HttpRequest.Builder deleteUserRequestBuilder(@org.eclipse.jdt.annotation */ public ForgotPasswordResult forgotPassword(@org.eclipse.jdt.annotation.Nullable ForgotPasswordDto forgotPasswordDto) throws ApiException { - ApiResponse localVarResponse = forgotPasswordWithHttpInfo(forgotPasswordDto); + return forgotPassword(forgotPasswordDto, null); + } + + /** + * Initiates the forgot password process for a local user. + * + * @param forgotPasswordDto The forgot password request containing the entered username. (required) + * @param headers Optional headers to include in the request + * @return ForgotPasswordResult + * @throws ApiException if fails to make API call + */ + public ForgotPasswordResult forgotPassword(@org.eclipse.jdt.annotation.Nullable ForgotPasswordDto forgotPasswordDto, + Map headers) throws ApiException { + ApiResponse localVarResponse = forgotPasswordWithHttpInfo(forgotPasswordDto, headers); return localVarResponse.getData(); } @@ -449,7 +665,21 @@ public ForgotPasswordResult forgotPassword(@org.eclipse.jdt.annotation.Nullable */ public ApiResponse forgotPasswordWithHttpInfo( @org.eclipse.jdt.annotation.Nullable ForgotPasswordDto forgotPasswordDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = forgotPasswordRequestBuilder(forgotPasswordDto); + return forgotPasswordWithHttpInfo(forgotPasswordDto, null); + } + + /** + * Initiates the forgot password process for a local user. + * + * @param forgotPasswordDto The forgot password request containing the entered username. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<ForgotPasswordResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse forgotPasswordWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ForgotPasswordDto forgotPasswordDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = forgotPasswordRequestBuilder(forgotPasswordDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -466,14 +696,14 @@ public ApiResponse forgotPasswordWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + ForgotPasswordResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -485,7 +715,8 @@ public ApiResponse forgotPasswordWithHttpInfo( } private HttpRequest.Builder forgotPasswordRequestBuilder( - @org.eclipse.jdt.annotation.Nullable ForgotPasswordDto forgotPasswordDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable ForgotPasswordDto forgotPasswordDto, Map headers) + throws ApiException { // verify the required parameter 'forgotPasswordDto' is set if (forgotPasswordDto == null) { throw new ApiException(400, @@ -511,6 +742,8 @@ private HttpRequest.Builder forgotPasswordRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -526,7 +759,21 @@ private HttpRequest.Builder forgotPasswordRequestBuilder( */ public PinRedeemResult forgotPasswordPin( @org.eclipse.jdt.annotation.Nullable ForgotPasswordPinDto forgotPasswordPinDto) throws ApiException { - ApiResponse localVarResponse = forgotPasswordPinWithHttpInfo(forgotPasswordPinDto); + return forgotPasswordPin(forgotPasswordPinDto, null); + } + + /** + * Redeems a forgot password pin. + * + * @param forgotPasswordPinDto The forgot password pin request containing the entered pin. (required) + * @param headers Optional headers to include in the request + * @return PinRedeemResult + * @throws ApiException if fails to make API call + */ + public PinRedeemResult forgotPasswordPin( + @org.eclipse.jdt.annotation.Nullable ForgotPasswordPinDto forgotPasswordPinDto, Map headers) + throws ApiException { + ApiResponse localVarResponse = forgotPasswordPinWithHttpInfo(forgotPasswordPinDto, headers); return localVarResponse.getData(); } @@ -539,7 +786,21 @@ public PinRedeemResult forgotPasswordPin( */ public ApiResponse forgotPasswordPinWithHttpInfo( @org.eclipse.jdt.annotation.Nullable ForgotPasswordPinDto forgotPasswordPinDto) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = forgotPasswordPinRequestBuilder(forgotPasswordPinDto); + return forgotPasswordPinWithHttpInfo(forgotPasswordPinDto, null); + } + + /** + * Redeems a forgot password pin. + * + * @param forgotPasswordPinDto The forgot password pin request containing the entered pin. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<PinRedeemResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse forgotPasswordPinWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ForgotPasswordPinDto forgotPasswordPinDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = forgotPasswordPinRequestBuilder(forgotPasswordPinDto, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -556,12 +817,14 @@ public ApiResponse forgotPasswordPinWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + PinRedeemResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -573,7 +836,8 @@ public ApiResponse forgotPasswordPinWithHttpInfo( } private HttpRequest.Builder forgotPasswordPinRequestBuilder( - @org.eclipse.jdt.annotation.Nullable ForgotPasswordPinDto forgotPasswordPinDto) throws ApiException { + @org.eclipse.jdt.annotation.Nullable ForgotPasswordPinDto forgotPasswordPinDto, Map headers) + throws ApiException { // verify the required parameter 'forgotPasswordPinDto' is set if (forgotPasswordPinDto == null) { throw new ApiException(400, @@ -599,6 +863,8 @@ private HttpRequest.Builder forgotPasswordPinRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -612,7 +878,18 @@ private HttpRequest.Builder forgotPasswordPinRequestBuilder( * @throws ApiException if fails to make API call */ public UserDto getCurrentUser() throws ApiException { - ApiResponse localVarResponse = getCurrentUserWithHttpInfo(); + return getCurrentUser(null); + } + + /** + * Gets the user based on auth token. + * + * @param headers Optional headers to include in the request + * @return UserDto + * @throws ApiException if fails to make API call + */ + public UserDto getCurrentUser(Map headers) throws ApiException { + ApiResponse localVarResponse = getCurrentUserWithHttpInfo(headers); return localVarResponse.getData(); } @@ -623,7 +900,18 @@ public UserDto getCurrentUser() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse getCurrentUserWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getCurrentUserRequestBuilder(); + return getCurrentUserWithHttpInfo(null); + } + + /** + * Gets the user based on auth token. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<UserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getCurrentUserWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getCurrentUserRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -640,12 +928,14 @@ public ApiResponse getCurrentUserWithHttpInfo() throws ApiException { } String responseBody = new String(localVarResponse.body().readAllBytes()); + UserDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -656,7 +946,7 @@ public ApiResponse getCurrentUserWithHttpInfo() throws ApiException { } } - private HttpRequest.Builder getCurrentUserRequestBuilder() throws ApiException { + private HttpRequest.Builder getCurrentUserRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -671,6 +961,8 @@ private HttpRequest.Builder getCurrentUserRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -684,7 +976,18 @@ private HttpRequest.Builder getCurrentUserRequestBuilder() throws ApiException { * @throws ApiException if fails to make API call */ public List getPublicUsers() throws ApiException { - ApiResponse> localVarResponse = getPublicUsersWithHttpInfo(); + return getPublicUsers(null); + } + + /** + * Gets a list of publicly visible users for display on a login screen. + * + * @param headers Optional headers to include in the request + * @return List<UserDto> + * @throws ApiException if fails to make API call + */ + public List getPublicUsers(Map headers) throws ApiException { + ApiResponse> localVarResponse = getPublicUsersWithHttpInfo(headers); return localVarResponse.getData(); } @@ -695,7 +998,18 @@ public List getPublicUsers() throws ApiException { * @throws ApiException if fails to make API call */ public ApiResponse> getPublicUsersWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPublicUsersRequestBuilder(); + return getPublicUsersWithHttpInfo(null); + } + + /** + * Gets a list of publicly visible users for display on a login screen. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<UserDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPublicUsersWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPublicUsersRequestBuilder(headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -712,12 +1026,14 @@ public ApiResponse> getPublicUsersWithHttpInfo() throws ApiExcepti } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -728,7 +1044,7 @@ public ApiResponse> getPublicUsersWithHttpInfo() throws ApiExcepti } } - private HttpRequest.Builder getPublicUsersRequestBuilder() throws ApiException { + private HttpRequest.Builder getPublicUsersRequestBuilder(Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -743,6 +1059,8 @@ private HttpRequest.Builder getPublicUsersRequestBuilder() throws ApiException { if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -757,7 +1075,20 @@ private HttpRequest.Builder getPublicUsersRequestBuilder() throws ApiException { * @throws ApiException if fails to make API call */ public UserDto getUserById(@org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { - ApiResponse localVarResponse = getUserByIdWithHttpInfo(userId); + return getUserById(userId, null); + } + + /** + * Gets a user by Id. + * + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @return UserDto + * @throws ApiException if fails to make API call + */ + public UserDto getUserById(@org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getUserByIdWithHttpInfo(userId, headers); return localVarResponse.getData(); } @@ -770,7 +1101,20 @@ public UserDto getUserById(@org.eclipse.jdt.annotation.Nullable UUID userId) thr */ public ApiResponse getUserByIdWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getUserByIdRequestBuilder(userId); + return getUserByIdWithHttpInfo(userId, null); + } + + /** + * Gets a user by Id. + * + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserByIdWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUserByIdRequestBuilder(userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -787,12 +1131,14 @@ public ApiResponse getUserByIdWithHttpInfo(@org.eclipse.jdt.annotation. } String responseBody = new String(localVarResponse.body().readAllBytes()); + UserDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -803,8 +1149,8 @@ public ApiResponse getUserByIdWithHttpInfo(@org.eclipse.jdt.annotation. } } - private HttpRequest.Builder getUserByIdRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId) - throws ApiException { + private HttpRequest.Builder getUserByIdRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { // verify the required parameter 'userId' is set if (userId == null) { throw new ApiException(400, "Missing the required parameter 'userId' when calling getUserById"); @@ -823,6 +1169,8 @@ private HttpRequest.Builder getUserByIdRequestBuilder(@org.eclipse.jdt.annotatio if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -839,7 +1187,21 @@ private HttpRequest.Builder getUserByIdRequestBuilder(@org.eclipse.jdt.annotatio */ public List getUsers(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, @org.eclipse.jdt.annotation.NonNull Boolean isDisabled) throws ApiException { - ApiResponse> localVarResponse = getUsersWithHttpInfo(isHidden, isDisabled); + return getUsers(isHidden, isDisabled, null); + } + + /** + * Gets a list of users. + * + * @param isHidden Optional filter by IsHidden=true or false. (optional) + * @param isDisabled Optional filter by IsDisabled=true or false. (optional) + * @param headers Optional headers to include in the request + * @return List<UserDto> + * @throws ApiException if fails to make API call + */ + public List getUsers(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isDisabled, Map headers) throws ApiException { + ApiResponse> localVarResponse = getUsersWithHttpInfo(isHidden, isDisabled, headers); return localVarResponse.getData(); } @@ -853,7 +1215,21 @@ public List getUsers(@org.eclipse.jdt.annotation.NonNull Boolean isHidd */ public ApiResponse> getUsersWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, @org.eclipse.jdt.annotation.NonNull Boolean isDisabled) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getUsersRequestBuilder(isHidden, isDisabled); + return getUsersWithHttpInfo(isHidden, isDisabled, null); + } + + /** + * Gets a list of users. + * + * @param isHidden Optional filter by IsHidden=true or false. (optional) + * @param isDisabled Optional filter by IsDisabled=true or false. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<UserDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getUsersWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isDisabled, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUsersRequestBuilder(isHidden, isDisabled, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -870,12 +1246,14 @@ public ApiResponse> getUsersWithHttpInfo(@org.eclipse.jdt.annotati } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -887,7 +1265,7 @@ public ApiResponse> getUsersWithHttpInfo(@org.eclipse.jdt.annotati } private HttpRequest.Builder getUsersRequestBuilder(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, - @org.eclipse.jdt.annotation.NonNull Boolean isDisabled) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean isDisabled, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -919,6 +1297,8 @@ private HttpRequest.Builder getUsersRequestBuilder(@org.eclipse.jdt.annotation.N if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -934,7 +1314,20 @@ private HttpRequest.Builder getUsersRequestBuilder(@org.eclipse.jdt.annotation.N */ public void updateUser(@org.eclipse.jdt.annotation.Nullable UserDto userDto, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - updateUserWithHttpInfo(userDto, userId); + updateUser(userDto, userId, null); + } + + /** + * Updates a user. + * + * @param userDto The updated user model. (required) + * @param userId The user id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateUser(@org.eclipse.jdt.annotation.Nullable UserDto userDto, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + updateUserWithHttpInfo(userDto, userId, headers); } /** @@ -947,7 +1340,21 @@ public void updateUser(@org.eclipse.jdt.annotation.Nullable UserDto userDto, */ public ApiResponse updateUserWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UserDto userDto, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateUserRequestBuilder(userDto, userId); + return updateUserWithHttpInfo(userDto, userId, null); + } + + /** + * Updates a user. + * + * @param userDto The updated user model. (required) + * @param userId The user id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UserDto userDto, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserRequestBuilder(userDto, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -975,7 +1382,7 @@ public ApiResponse updateUserWithHttpInfo(@org.eclipse.jdt.annotation.Null } private HttpRequest.Builder updateUserRequestBuilder(@org.eclipse.jdt.annotation.Nullable UserDto userDto, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'userDto' is set if (userDto == null) { throw new ApiException(400, "Missing the required parameter 'userDto' when calling updateUser"); @@ -1015,6 +1422,8 @@ private HttpRequest.Builder updateUserRequestBuilder(@org.eclipse.jdt.annotation if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1030,7 +1439,20 @@ private HttpRequest.Builder updateUserRequestBuilder(@org.eclipse.jdt.annotation */ public void updateUserConfiguration(@org.eclipse.jdt.annotation.Nullable UserConfiguration userConfiguration, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - updateUserConfigurationWithHttpInfo(userConfiguration, userId); + updateUserConfiguration(userConfiguration, userId, null); + } + + /** + * Updates a user configuration. + * + * @param userConfiguration The new user configuration. (required) + * @param userId The user id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateUserConfiguration(@org.eclipse.jdt.annotation.Nullable UserConfiguration userConfiguration, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + updateUserConfigurationWithHttpInfo(userConfiguration, userId, headers); } /** @@ -1044,7 +1466,23 @@ public void updateUserConfiguration(@org.eclipse.jdt.annotation.Nullable UserCon public ApiResponse updateUserConfigurationWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UserConfiguration userConfiguration, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateUserConfigurationRequestBuilder(userConfiguration, userId); + return updateUserConfigurationWithHttpInfo(userConfiguration, userId, null); + } + + /** + * Updates a user configuration. + * + * @param userConfiguration The new user configuration. (required) + * @param userId The user id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserConfigurationWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UserConfiguration userConfiguration, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserConfigurationRequestBuilder(userConfiguration, userId, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1073,7 +1511,7 @@ public ApiResponse updateUserConfigurationWithHttpInfo( private HttpRequest.Builder updateUserConfigurationRequestBuilder( @org.eclipse.jdt.annotation.Nullable UserConfiguration userConfiguration, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'userConfiguration' is set if (userConfiguration == null) { throw new ApiException(400, @@ -1114,6 +1552,8 @@ private HttpRequest.Builder updateUserConfigurationRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1131,7 +1571,22 @@ private HttpRequest.Builder updateUserConfigurationRequestBuilder( */ public void updateUserPassword(@org.eclipse.jdt.annotation.Nullable UpdateUserPassword updateUserPassword, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - updateUserPasswordWithHttpInfo(updateUserPassword, userId); + updateUserPassword(updateUserPassword, userId, null); + } + + /** + * Updates a user's password. + * + * @param updateUserPassword The + * M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Nullable{System.Guid},Jellyfin.Api.Models.UserDtos.UpdateUserPassword) + * request. (required) + * @param userId The user id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateUserPassword(@org.eclipse.jdt.annotation.Nullable UpdateUserPassword updateUserPassword, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + updateUserPasswordWithHttpInfo(updateUserPassword, userId, headers); } /** @@ -1147,7 +1602,25 @@ public void updateUserPassword(@org.eclipse.jdt.annotation.Nullable UpdateUserPa public ApiResponse updateUserPasswordWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UpdateUserPassword updateUserPassword, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateUserPasswordRequestBuilder(updateUserPassword, userId); + return updateUserPasswordWithHttpInfo(updateUserPassword, userId, null); + } + + /** + * Updates a user's password. + * + * @param updateUserPassword The + * M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Nullable{System.Guid},Jellyfin.Api.Models.UserDtos.UpdateUserPassword) + * request. (required) + * @param userId The user id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserPasswordWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UpdateUserPassword updateUserPassword, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserPasswordRequestBuilder(updateUserPassword, userId, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1176,7 +1649,7 @@ public ApiResponse updateUserPasswordWithHttpInfo( private HttpRequest.Builder updateUserPasswordRequestBuilder( @org.eclipse.jdt.annotation.Nullable UpdateUserPassword updateUserPassword, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'updateUserPassword' is set if (updateUserPassword == null) { throw new ApiException(400, @@ -1217,6 +1690,8 @@ private HttpRequest.Builder updateUserPasswordRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1232,7 +1707,21 @@ private HttpRequest.Builder updateUserPasswordRequestBuilder( */ public void updateUserPolicy(@org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable UserPolicy userPolicy) throws ApiException { - updateUserPolicyWithHttpInfo(userId, userPolicy); + updateUserPolicy(userId, userPolicy, null); + } + + /** + * Updates a user policy. + * + * @param userId The user id. (required) + * @param userPolicy The new user policy. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateUserPolicy(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserPolicy userPolicy, Map headers) + throws ApiException { + updateUserPolicyWithHttpInfo(userId, userPolicy, headers); } /** @@ -1245,7 +1734,22 @@ public void updateUserPolicy(@org.eclipse.jdt.annotation.Nullable UUID userId, */ public ApiResponse updateUserPolicyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable UserPolicy userPolicy) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateUserPolicyRequestBuilder(userId, userPolicy); + return updateUserPolicyWithHttpInfo(userId, userPolicy, null); + } + + /** + * Updates a user policy. + * + * @param userId The user id. (required) + * @param userPolicy The new user policy. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserPolicyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserPolicy userPolicy, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserPolicyRequestBuilder(userId, userPolicy, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1273,7 +1777,8 @@ public ApiResponse updateUserPolicyWithHttpInfo(@org.eclipse.jdt.annotatio } private HttpRequest.Builder updateUserPolicyRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, - @org.eclipse.jdt.annotation.Nullable UserPolicy userPolicy) throws ApiException { + @org.eclipse.jdt.annotation.Nullable UserPolicy userPolicy, Map headers) + throws ApiException { // verify the required parameter 'userId' is set if (userId == null) { throw new ApiException(400, "Missing the required parameter 'userId' when calling updateUserPolicy"); @@ -1302,6 +1807,8 @@ private HttpRequest.Builder updateUserPolicyRequestBuilder(@org.eclipse.jdt.anno if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserLibraryApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserLibraryApi.java index 9318661c87add..dcbef5bcb1598 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserLibraryApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserLibraryApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -42,6 +44,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class UserLibraryApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -77,6 +101,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Deletes a user's saved personal rating for an item. * @@ -87,7 +161,21 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public UserItemDataDto deleteUserItemRating(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = deleteUserItemRatingWithHttpInfo(itemId, userId); + return deleteUserItemRating(itemId, userId, null); + } + + /** + * Deletes a user's saved personal rating for an item. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto deleteUserItemRating(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = deleteUserItemRatingWithHttpInfo(itemId, userId, headers); return localVarResponse.getData(); } @@ -102,7 +190,22 @@ public UserItemDataDto deleteUserItemRating(@org.eclipse.jdt.annotation.Nullable public ApiResponse deleteUserItemRatingWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteUserItemRatingRequestBuilder(itemId, userId); + return deleteUserItemRatingWithHttpInfo(itemId, userId, null); + } + + /** + * Deletes a user's saved personal rating for an item. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserItemRatingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteUserItemRatingRequestBuilder(itemId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -119,12 +222,14 @@ public ApiResponse deleteUserItemRatingWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + UserItemDataDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -136,7 +241,7 @@ public ApiResponse deleteUserItemRatingWithHttpInfo( } private HttpRequest.Builder deleteUserItemRatingRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteUserItemRating"); @@ -170,6 +275,8 @@ private HttpRequest.Builder deleteUserItemRatingRequestBuilder(@org.eclipse.jdt. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -186,7 +293,21 @@ private HttpRequest.Builder deleteUserItemRatingRequestBuilder(@org.eclipse.jdt. */ public BaseItemDtoQueryResult getIntros(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getIntrosWithHttpInfo(itemId, userId); + return getIntros(itemId, userId, null); + } + + /** + * Gets intros to play before the main media item plays. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getIntros(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getIntrosWithHttpInfo(itemId, userId, headers); return localVarResponse.getData(); } @@ -200,7 +321,21 @@ public BaseItemDtoQueryResult getIntros(@org.eclipse.jdt.annotation.Nullable UUI */ public ApiResponse getIntrosWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getIntrosRequestBuilder(itemId, userId); + return getIntrosWithHttpInfo(itemId, userId, null); + } + + /** + * Gets intros to play before the main media item plays. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getIntrosWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getIntrosRequestBuilder(itemId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -217,14 +352,14 @@ public ApiResponse getIntrosWithHttpInfo(@org.eclipse.jd } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -236,7 +371,7 @@ public ApiResponse getIntrosWithHttpInfo(@org.eclipse.jd } private HttpRequest.Builder getIntrosRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getIntros"); @@ -270,6 +405,8 @@ private HttpRequest.Builder getIntrosRequestBuilder(@org.eclipse.jdt.annotation. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -286,7 +423,21 @@ private HttpRequest.Builder getIntrosRequestBuilder(@org.eclipse.jdt.annotation. */ public BaseItemDto getItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getItemWithHttpInfo(itemId, userId); + return getItem(itemId, userId, null); + } + + /** + * Gets an item from a user's library. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getItemWithHttpInfo(itemId, userId, headers); return localVarResponse.getData(); } @@ -300,7 +451,21 @@ public BaseItemDto getItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, */ public ApiResponse getItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getItemRequestBuilder(itemId, userId); + return getItemWithHttpInfo(itemId, userId, null); + } + + /** + * Gets an item from a user's library. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemRequestBuilder(itemId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -317,12 +482,14 @@ public ApiResponse getItemWithHttpInfo(@org.eclipse.jdt.annotation. } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -334,7 +501,7 @@ public ApiResponse getItemWithHttpInfo(@org.eclipse.jdt.annotation. } private HttpRequest.Builder getItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItem"); @@ -368,6 +535,8 @@ private HttpRequest.Builder getItemRequestBuilder(@org.eclipse.jdt.annotation.Nu if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -404,9 +573,44 @@ public List getLatestMedia(@org.eclipse.jdt.annotation.NonNull UUID @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean groupItems) throws ApiException { + return getLatestMedia(userId, parentId, fields, includeItemTypes, isPlayed, enableImages, imageTypeLimit, + enableImageTypes, enableUserData, limit, groupItems, null); + } + + /** + * Gets latest media. + * + * @param userId User id. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isPlayed Filter by items that are played, or not. (optional) + * @param enableImages Optional. include image information in output. (optional) + * @param imageTypeLimit Optional. the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. include user data. (optional) + * @param limit Return item limit. (optional, default to 20) + * @param groupItems Whether or not to group items into a parent container. (optional, default to true) + * @param headers Optional headers to include in the request + * @return List<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public List getLatestMedia(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean groupItems, + Map headers) throws ApiException { ApiResponse> localVarResponse = getLatestMediaWithHttpInfo(userId, parentId, fields, includeItemTypes, isPlayed, enableImages, imageTypeLimit, enableImageTypes, enableUserData, limit, - groupItems); + groupItems, headers); return localVarResponse.getData(); } @@ -440,9 +644,44 @@ public ApiResponse> getLatestMediaWithHttpInfo(@org.eclipse.jd @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean groupItems) throws ApiException { + return getLatestMediaWithHttpInfo(userId, parentId, fields, includeItemTypes, isPlayed, enableImages, + imageTypeLimit, enableImageTypes, enableUserData, limit, groupItems, null); + } + + /** + * Gets latest media. + * + * @param userId User id. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isPlayed Filter by items that are played, or not. (optional) + * @param enableImages Optional. include image information in output. (optional) + * @param imageTypeLimit Optional. the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. include user data. (optional) + * @param limit Return item limit. (optional, default to 20) + * @param groupItems Whether or not to group items into a parent container. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<BaseItemDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getLatestMediaWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean groupItems, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getLatestMediaRequestBuilder(userId, parentId, fields, includeItemTypes, isPlayed, enableImages, imageTypeLimit, enableImageTypes, enableUserData, limit, - groupItems); + groupItems, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -459,12 +698,14 @@ public ApiResponse> getLatestMediaWithHttpInfo(@org.eclipse.jd } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -484,8 +725,8 @@ private HttpRequest.Builder getLatestMediaRequestBuilder(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes, @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, - @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean groupItems) - throws ApiException { + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean groupItems, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -535,6 +776,8 @@ private HttpRequest.Builder getLatestMediaRequestBuilder(@org.eclipse.jdt.annota if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -551,7 +794,21 @@ private HttpRequest.Builder getLatestMediaRequestBuilder(@org.eclipse.jdt.annota */ public List getLocalTrailers(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse> localVarResponse = getLocalTrailersWithHttpInfo(itemId, userId); + return getLocalTrailers(itemId, userId, null); + } + + /** + * Gets local trailers for an item. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return List<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public List getLocalTrailers(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse> localVarResponse = getLocalTrailersWithHttpInfo(itemId, userId, headers); return localVarResponse.getData(); } @@ -565,7 +822,21 @@ public List getLocalTrailers(@org.eclipse.jdt.annotation.Nullable U */ public ApiResponse> getLocalTrailersWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getLocalTrailersRequestBuilder(itemId, userId); + return getLocalTrailersWithHttpInfo(itemId, userId, null); + } + + /** + * Gets local trailers for an item. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<BaseItemDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getLocalTrailersWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLocalTrailersRequestBuilder(itemId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -582,12 +853,14 @@ public ApiResponse> getLocalTrailersWithHttpInfo(@org.eclipse. } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -599,7 +872,7 @@ public ApiResponse> getLocalTrailersWithHttpInfo(@org.eclipse. } private HttpRequest.Builder getLocalTrailersRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getLocalTrailers"); @@ -634,6 +907,8 @@ private HttpRequest.Builder getLocalTrailersRequestBuilder(@org.eclipse.jdt.anno if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -648,7 +923,20 @@ private HttpRequest.Builder getLocalTrailersRequestBuilder(@org.eclipse.jdt.anno * @throws ApiException if fails to make API call */ public BaseItemDto getRootFolder(@org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getRootFolderWithHttpInfo(userId); + return getRootFolder(userId, null); + } + + /** + * Gets the root folder from a user's library. + * + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getRootFolder(@org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getRootFolderWithHttpInfo(userId, headers); return localVarResponse.getData(); } @@ -661,7 +949,20 @@ public BaseItemDto getRootFolder(@org.eclipse.jdt.annotation.NonNull UUID userId */ public ApiResponse getRootFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getRootFolderRequestBuilder(userId); + return getRootFolderWithHttpInfo(userId, null); + } + + /** + * Gets the root folder from a user's library. + * + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRootFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRootFolderRequestBuilder(userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -678,12 +979,14 @@ public ApiResponse getRootFolderWithHttpInfo(@org.eclipse.jdt.annot } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -694,8 +997,8 @@ public ApiResponse getRootFolderWithHttpInfo(@org.eclipse.jdt.annot } } - private HttpRequest.Builder getRootFolderRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId) - throws ApiException { + private HttpRequest.Builder getRootFolderRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -725,6 +1028,8 @@ private HttpRequest.Builder getRootFolderRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -741,7 +1046,21 @@ private HttpRequest.Builder getRootFolderRequestBuilder(@org.eclipse.jdt.annotat */ public List getSpecialFeatures(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse> localVarResponse = getSpecialFeaturesWithHttpInfo(itemId, userId); + return getSpecialFeatures(itemId, userId, null); + } + + /** + * Gets special features for an item. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return List<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public List getSpecialFeatures(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse> localVarResponse = getSpecialFeaturesWithHttpInfo(itemId, userId, headers); return localVarResponse.getData(); } @@ -756,7 +1075,22 @@ public List getSpecialFeatures(@org.eclipse.jdt.annotation.Nullable public ApiResponse> getSpecialFeaturesWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getSpecialFeaturesRequestBuilder(itemId, userId); + return getSpecialFeaturesWithHttpInfo(itemId, userId, null); + } + + /** + * Gets special features for an item. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<BaseItemDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getSpecialFeaturesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSpecialFeaturesRequestBuilder(itemId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -773,12 +1107,14 @@ public ApiResponse> getSpecialFeaturesWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -790,7 +1126,7 @@ public ApiResponse> getSpecialFeaturesWithHttpInfo( } private HttpRequest.Builder getSpecialFeaturesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSpecialFeatures"); @@ -825,6 +1161,8 @@ private HttpRequest.Builder getSpecialFeaturesRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -841,7 +1179,21 @@ private HttpRequest.Builder getSpecialFeaturesRequestBuilder(@org.eclipse.jdt.an */ public UserItemDataDto markFavoriteItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = markFavoriteItemWithHttpInfo(itemId, userId); + return markFavoriteItem(itemId, userId, null); + } + + /** + * Marks an item as a favorite. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto markFavoriteItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = markFavoriteItemWithHttpInfo(itemId, userId, headers); return localVarResponse.getData(); } @@ -855,7 +1207,21 @@ public UserItemDataDto markFavoriteItem(@org.eclipse.jdt.annotation.Nullable UUI */ public ApiResponse markFavoriteItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = markFavoriteItemRequestBuilder(itemId, userId); + return markFavoriteItemWithHttpInfo(itemId, userId, null); + } + + /** + * Marks an item as a favorite. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse markFavoriteItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = markFavoriteItemRequestBuilder(itemId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -872,12 +1238,14 @@ public ApiResponse markFavoriteItemWithHttpInfo(@org.eclipse.jd } String responseBody = new String(localVarResponse.body().readAllBytes()); + UserItemDataDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -889,7 +1257,7 @@ public ApiResponse markFavoriteItemWithHttpInfo(@org.eclipse.jd } private HttpRequest.Builder markFavoriteItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling markFavoriteItem"); @@ -923,6 +1291,8 @@ private HttpRequest.Builder markFavoriteItemRequestBuilder(@org.eclipse.jdt.anno if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -939,7 +1309,21 @@ private HttpRequest.Builder markFavoriteItemRequestBuilder(@org.eclipse.jdt.anno */ public UserItemDataDto unmarkFavoriteItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = unmarkFavoriteItemWithHttpInfo(itemId, userId); + return unmarkFavoriteItem(itemId, userId, null); + } + + /** + * Unmarks item as a favorite. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto unmarkFavoriteItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = unmarkFavoriteItemWithHttpInfo(itemId, userId, headers); return localVarResponse.getData(); } @@ -953,7 +1337,21 @@ public UserItemDataDto unmarkFavoriteItem(@org.eclipse.jdt.annotation.Nullable U */ public ApiResponse unmarkFavoriteItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = unmarkFavoriteItemRequestBuilder(itemId, userId); + return unmarkFavoriteItemWithHttpInfo(itemId, userId, null); + } + + /** + * Unmarks item as a favorite. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse unmarkFavoriteItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = unmarkFavoriteItemRequestBuilder(itemId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -970,12 +1368,14 @@ public ApiResponse unmarkFavoriteItemWithHttpInfo(@org.eclipse. } String responseBody = new String(localVarResponse.body().readAllBytes()); + UserItemDataDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -987,7 +1387,7 @@ public ApiResponse unmarkFavoriteItemWithHttpInfo(@org.eclipse. } private HttpRequest.Builder unmarkFavoriteItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling unmarkFavoriteItem"); @@ -1021,6 +1421,8 @@ private HttpRequest.Builder unmarkFavoriteItemRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1041,7 +1443,26 @@ private HttpRequest.Builder unmarkFavoriteItemRequestBuilder(@org.eclipse.jdt.an public UserItemDataDto updateUserItemRating(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean likes) throws ApiException { - ApiResponse localVarResponse = updateUserItemRatingWithHttpInfo(itemId, userId, likes); + return updateUserItemRating(itemId, userId, likes, null); + } + + /** + * Updates a user's rating for an item. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param likes Whether this + * M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Nullable{System.Guid},System.Guid,System.Nullable{System.Boolean}) + * is likes. (optional) + * @param headers Optional headers to include in the request + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto updateUserItemRating(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean likes, + Map headers) throws ApiException { + ApiResponse localVarResponse = updateUserItemRatingWithHttpInfo(itemId, userId, likes, + headers); return localVarResponse.getData(); } @@ -1059,7 +1480,25 @@ public UserItemDataDto updateUserItemRating(@org.eclipse.jdt.annotation.Nullable public ApiResponse updateUserItemRatingWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean likes) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateUserItemRatingRequestBuilder(itemId, userId, likes); + return updateUserItemRatingWithHttpInfo(itemId, userId, likes, null); + } + + /** + * Updates a user's rating for an item. + * + * @param itemId Item id. (required) + * @param userId User id. (optional) + * @param likes Whether this + * M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Nullable{System.Guid},System.Guid,System.Nullable{System.Boolean}) + * is likes. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserItemRatingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean likes, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserItemRatingRequestBuilder(itemId, userId, likes, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1076,12 +1515,14 @@ public ApiResponse updateUserItemRatingWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + UserItemDataDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1093,8 +1534,8 @@ public ApiResponse updateUserItemRatingWithHttpInfo( } private HttpRequest.Builder updateUserItemRatingRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean likes) - throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean likes, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling updateUserItemRating"); @@ -1130,6 +1571,8 @@ private HttpRequest.Builder updateUserItemRatingRequestBuilder(@org.eclipse.jdt. if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserViewsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserViewsApi.java index e9cc4d3ed9cd7..f998ce187b9fc 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserViewsApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/UserViewsApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -39,6 +41,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class UserViewsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -74,6 +98,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Get user view grouping options. * @@ -83,7 +157,20 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public List getGroupingOptions(@org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse> localVarResponse = getGroupingOptionsWithHttpInfo(userId); + return getGroupingOptions(userId, null); + } + + /** + * Get user view grouping options. + * + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return List<SpecialViewOptionDto> + * @throws ApiException if fails to make API call + */ + public List getGroupingOptions(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getGroupingOptionsWithHttpInfo(userId, headers); return localVarResponse.getData(); } @@ -96,7 +183,20 @@ public List getGroupingOptions(@org.eclipse.jdt.annotation */ public ApiResponse> getGroupingOptionsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getGroupingOptionsRequestBuilder(userId); + return getGroupingOptionsWithHttpInfo(userId, null); + } + + /** + * Get user view grouping options. + * + * @param userId User id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<SpecialViewOptionDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getGroupingOptionsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGroupingOptionsRequestBuilder(userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -113,14 +213,15 @@ public ApiResponse> getGroupingOptionsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + }); + localVarResponse.body().close(); return new ApiResponse>(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference>() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -131,8 +232,8 @@ public ApiResponse> getGroupingOptionsWithHttpInfo( } } - private HttpRequest.Builder getGroupingOptionsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId) - throws ApiException { + private HttpRequest.Builder getGroupingOptionsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -162,6 +263,8 @@ private HttpRequest.Builder getGroupingOptionsRequestBuilder(@org.eclipse.jdt.an if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -182,8 +285,27 @@ public BaseItemDtoQueryResult getUserViews(@org.eclipse.jdt.annotation.NonNull U @org.eclipse.jdt.annotation.NonNull Boolean includeExternalContent, @org.eclipse.jdt.annotation.NonNull List presetViews, @org.eclipse.jdt.annotation.NonNull Boolean includeHidden) throws ApiException { + return getUserViews(userId, includeExternalContent, presetViews, includeHidden, null); + } + + /** + * Get user views. + * + * @param userId User id. (optional) + * @param includeExternalContent Whether or not to include external views such as channels or live tv. (optional) + * @param presetViews Preset views. (optional) + * @param includeHidden Whether or not to include hidden content. (optional, default to false) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getUserViews(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean includeExternalContent, + @org.eclipse.jdt.annotation.NonNull List presetViews, + @org.eclipse.jdt.annotation.NonNull Boolean includeHidden, Map headers) + throws ApiException { ApiResponse localVarResponse = getUserViewsWithHttpInfo(userId, includeExternalContent, - presetViews, includeHidden); + presetViews, includeHidden, headers); return localVarResponse.getData(); } @@ -201,8 +323,27 @@ public ApiResponse getUserViewsWithHttpInfo(@org.eclipse @org.eclipse.jdt.annotation.NonNull Boolean includeExternalContent, @org.eclipse.jdt.annotation.NonNull List presetViews, @org.eclipse.jdt.annotation.NonNull Boolean includeHidden) throws ApiException { + return getUserViewsWithHttpInfo(userId, includeExternalContent, presetViews, includeHidden, null); + } + + /** + * Get user views. + * + * @param userId User id. (optional) + * @param includeExternalContent Whether or not to include external views such as channels or live tv. (optional) + * @param presetViews Preset views. (optional) + * @param includeHidden Whether or not to include hidden content. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserViewsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean includeExternalContent, + @org.eclipse.jdt.annotation.NonNull List presetViews, + @org.eclipse.jdt.annotation.NonNull Boolean includeHidden, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = getUserViewsRequestBuilder(userId, includeExternalContent, - presetViews, includeHidden); + presetViews, includeHidden, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -219,14 +360,14 @@ public ApiResponse getUserViewsWithHttpInfo(@org.eclipse } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -240,7 +381,8 @@ public ApiResponse getUserViewsWithHttpInfo(@org.eclipse private HttpRequest.Builder getUserViewsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean includeExternalContent, @org.eclipse.jdt.annotation.NonNull List presetViews, - @org.eclipse.jdt.annotation.NonNull Boolean includeHidden) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean includeHidden, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -276,6 +418,8 @@ private HttpRequest.Builder getUserViewsRequestBuilder(@org.eclipse.jdt.annotati if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/VideoAttachmentsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/VideoAttachmentsApi.java index fd7fc2b31d497..b1f5658c37982 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/VideoAttachmentsApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/VideoAttachmentsApi.java @@ -20,6 +20,7 @@ import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; +import java.util.Map; import java.util.UUID; import java.util.function.Consumer; @@ -28,11 +29,32 @@ import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; import org.openhab.binding.jellyfin.internal.api.generated.Configuration; -import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class VideoAttachmentsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -68,6 +90,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Get video attachment. * @@ -80,7 +152,23 @@ private String formatExceptionMessage(String operationId, int statusCode, String public File getAttachment(@org.eclipse.jdt.annotation.Nullable UUID videoId, @org.eclipse.jdt.annotation.Nullable String mediaSourceId, @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { - ApiResponse localVarResponse = getAttachmentWithHttpInfo(videoId, mediaSourceId, index); + return getAttachment(videoId, mediaSourceId, index, null); + } + + /** + * Get video attachment. + * + * @param videoId Video ID. (required) + * @param mediaSourceId Media Source ID. (required) + * @param index Attachment Index. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getAttachment(@org.eclipse.jdt.annotation.Nullable UUID videoId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer index, Map headers) throws ApiException { + ApiResponse localVarResponse = getAttachmentWithHttpInfo(videoId, mediaSourceId, index, headers); return localVarResponse.getData(); } @@ -96,7 +184,24 @@ public File getAttachment(@org.eclipse.jdt.annotation.Nullable UUID videoId, public ApiResponse getAttachmentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID videoId, @org.eclipse.jdt.annotation.Nullable String mediaSourceId, @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getAttachmentRequestBuilder(videoId, mediaSourceId, index); + return getAttachmentWithHttpInfo(videoId, mediaSourceId, index, null); + } + + /** + * Get video attachment. + * + * @param videoId Video ID. (required) + * @param mediaSourceId Media Source ID. (required) + * @param index Attachment Index. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAttachmentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID videoId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer index, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAttachmentRequestBuilder(videoId, mediaSourceId, index, + headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -111,13 +216,13 @@ public ApiResponse getAttachmentWithHttpInfo(@org.eclipse.jdt.annotation.N return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -130,7 +235,7 @@ public ApiResponse getAttachmentWithHttpInfo(@org.eclipse.jdt.annotation.N private HttpRequest.Builder getAttachmentRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID videoId, @org.eclipse.jdt.annotation.Nullable String mediaSourceId, - @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { + @org.eclipse.jdt.annotation.Nullable Integer index, Map headers) throws ApiException { // verify the required parameter 'videoId' is set if (videoId == null) { throw new ApiException(400, "Missing the required parameter 'videoId' when calling getAttachment"); @@ -160,6 +265,8 @@ private HttpRequest.Builder getAttachmentRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/VideosApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/VideosApi.java index b485d7800468a..2210d1710f109 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/VideosApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/VideosApi.java @@ -41,6 +41,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class VideosApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -76,6 +98,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Removes alternate video sources. * @@ -83,7 +155,19 @@ private String formatExceptionMessage(String operationId, int statusCode, String * @throws ApiException if fails to make API call */ public void deleteAlternateSources(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - deleteAlternateSourcesWithHttpInfo(itemId); + deleteAlternateSources(itemId, null); + } + + /** + * Removes alternate video sources. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteAlternateSources(@org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) + throws ApiException { + deleteAlternateSourcesWithHttpInfo(itemId, headers); } /** @@ -95,7 +179,20 @@ public void deleteAlternateSources(@org.eclipse.jdt.annotation.Nullable UUID ite */ public ApiResponse deleteAlternateSourcesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteAlternateSourcesRequestBuilder(itemId); + return deleteAlternateSourcesWithHttpInfo(itemId, null); + } + + /** + * Removes alternate video sources. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteAlternateSourcesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteAlternateSourcesRequestBuilder(itemId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -122,8 +219,8 @@ public ApiResponse deleteAlternateSourcesWithHttpInfo(@org.eclipse.jdt.ann } } - private HttpRequest.Builder deleteAlternateSourcesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId) - throws ApiException { + private HttpRequest.Builder deleteAlternateSourcesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteAlternateSources"); @@ -143,6 +240,8 @@ private HttpRequest.Builder deleteAlternateSourcesRequestBuilder(@org.eclipse.jd if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -159,7 +258,21 @@ private HttpRequest.Builder deleteAlternateSourcesRequestBuilder(@org.eclipse.jd */ public BaseItemDtoQueryResult getAdditionalPart(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getAdditionalPartWithHttpInfo(itemId, userId); + return getAdditionalPart(itemId, userId, null); + } + + /** + * Gets additional parts for a video. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getAdditionalPart(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getAdditionalPartWithHttpInfo(itemId, userId, headers); return localVarResponse.getData(); } @@ -174,7 +287,22 @@ public BaseItemDtoQueryResult getAdditionalPart(@org.eclipse.jdt.annotation.Null public ApiResponse getAdditionalPartWithHttpInfo( @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getAdditionalPartRequestBuilder(itemId, userId); + return getAdditionalPartWithHttpInfo(itemId, userId, null); + } + + /** + * Gets additional parts for a video. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAdditionalPartWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAdditionalPartRequestBuilder(itemId, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -191,14 +319,14 @@ public ApiResponse getAdditionalPartWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -210,7 +338,7 @@ public ApiResponse getAdditionalPartWithHttpInfo( } private HttpRequest.Builder getAdditionalPartRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, "Missing the required parameter 'itemId' when calling getAdditionalPart"); @@ -245,6 +373,8 @@ private HttpRequest.Builder getAdditionalPartRequestBuilder(@org.eclipse.jdt.ann if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -368,6 +498,136 @@ public File getVideoStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + return getVideoStream(itemId, container, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, + segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, null); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getVideoStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { ApiResponse localVarResponse = getVideoStreamWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, @@ -376,7 +636,7 @@ public File getVideoStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, - context, streamOptions, enableAudioVbrEncoding); + context, streamOptions, enableAudioVbrEncoding, headers); return localVarResponse.getData(); } @@ -497,47 +757,1304 @@ public ApiResponse getVideoStreamWithHttpInfo(@org.eclipse.jdt.annotation. @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getVideoStreamRequestBuilder(itemId, container, _static, params, - tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, - deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, - breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, - profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, - maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, - requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, - enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, - context, streamOptions, enableAudioVbrEncoding); - try { - HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode() / 100 != 2) { - throw getApiException("getVideoStream", localVarResponse); - } - if (localVarResponse.body() == null) { - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); - } - - String responseBody = new String(localVarResponse.body().readAllBytes()); - localVarResponse.body().close(); - - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } + return getVideoStreamWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, null); } - private HttpRequest.Builder getVideoStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVideoStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getVideoStreamRequestBuilder(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAudioVbrEncoding, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getVideoStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getVideoStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getVideoStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/stream".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "container"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("container", container)); + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "video/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File getVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + return getVideoStreamByContainer(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, null); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { + ApiResponse localVarResponse = getVideoStreamByContainerWithHttpInfo(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAudioVbrEncoding, headers); + return localVarResponse.getData(); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVideoStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + return getVideoStreamByContainerWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, + playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, + enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, + maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, null); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVideoStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getVideoStreamByContainerRequestBuilder(itemId, container, _static, + params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAudioVbrEncoding, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getVideoStreamByContainer", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getVideoStreamByContainerRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getVideoStreamByContainer"); + } + // verify the required parameter 'container' is set + if (container == null) { + throw new ApiException(400, + "Missing the required parameter 'container' when calling getVideoStreamByContainer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/stream.{container}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{container}", ApiClient.urlEncode(container.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAudioVbrEncoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "video/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File headVideoStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + return headVideoStream(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, null); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headVideoStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, @@ -581,144 +2098,18 @@ private HttpRequest.Builder getVideoStreamRequestBuilder(@org.eclipse.jdt.annota @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { - // verify the required parameter 'itemId' is set - if (itemId == null) { - throw new ApiException(400, "Missing the required parameter 'itemId' when calling getVideoStream"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/Videos/{itemId}/stream".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); - - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "container"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("container", container)); - localVarQueryParameterBaseName = "static"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); - localVarQueryParameterBaseName = "params"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); - localVarQueryParameterBaseName = "tag"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); - localVarQueryParameterBaseName = "deviceProfileId"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); - localVarQueryParameterBaseName = "playSessionId"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); - localVarQueryParameterBaseName = "segmentContainer"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); - localVarQueryParameterBaseName = "segmentLength"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); - localVarQueryParameterBaseName = "minSegments"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); - localVarQueryParameterBaseName = "mediaSourceId"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); - localVarQueryParameterBaseName = "deviceId"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); - localVarQueryParameterBaseName = "audioCodec"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); - localVarQueryParameterBaseName = "enableAutoStreamCopy"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); - localVarQueryParameterBaseName = "allowVideoStreamCopy"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); - localVarQueryParameterBaseName = "allowAudioStreamCopy"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); - localVarQueryParameterBaseName = "breakOnNonKeyFrames"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); - localVarQueryParameterBaseName = "audioSampleRate"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); - localVarQueryParameterBaseName = "maxAudioBitDepth"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); - localVarQueryParameterBaseName = "audioBitRate"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); - localVarQueryParameterBaseName = "audioChannels"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); - localVarQueryParameterBaseName = "maxAudioChannels"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); - localVarQueryParameterBaseName = "profile"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); - localVarQueryParameterBaseName = "level"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); - localVarQueryParameterBaseName = "framerate"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); - localVarQueryParameterBaseName = "maxFramerate"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); - localVarQueryParameterBaseName = "copyTimestamps"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); - localVarQueryParameterBaseName = "startTimeTicks"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); - localVarQueryParameterBaseName = "width"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); - localVarQueryParameterBaseName = "height"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); - localVarQueryParameterBaseName = "maxWidth"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); - localVarQueryParameterBaseName = "maxHeight"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); - localVarQueryParameterBaseName = "videoBitRate"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); - localVarQueryParameterBaseName = "subtitleStreamIndex"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); - localVarQueryParameterBaseName = "subtitleMethod"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); - localVarQueryParameterBaseName = "maxRefFrames"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); - localVarQueryParameterBaseName = "maxVideoBitDepth"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); - localVarQueryParameterBaseName = "requireAvc"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); - localVarQueryParameterBaseName = "deInterlace"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); - localVarQueryParameterBaseName = "requireNonAnamorphic"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); - localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; - localVarQueryParams - .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); - localVarQueryParameterBaseName = "cpuCoreLimit"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); - localVarQueryParameterBaseName = "liveStreamId"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); - localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); - localVarQueryParameterBaseName = "videoCodec"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); - localVarQueryParameterBaseName = "subtitleCodec"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); - localVarQueryParameterBaseName = "transcodeReasons"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); - localVarQueryParameterBaseName = "audioStreamIndex"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); - localVarQueryParameterBaseName = "videoStreamIndex"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); - localVarQueryParameterBaseName = "context"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); - localVarQueryParameterBaseName = "streamOptions"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); - localVarQueryParameterBaseName = "enableAudioVbrEncoding"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); - - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - } - - localVarRequestBuilder.header("Accept", "video/*"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { + ApiResponse localVarResponse = headVideoStreamWithHttpInfo(itemId, container, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, + videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, + deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAudioVbrEncoding, headers); + return localVarResponse.getData(); } /** @@ -726,7 +2117,7 @@ private HttpRequest.Builder getVideoStreamRequestBuilder(@org.eclipse.jdt.annota * * @param itemId The item id. (required) * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, - * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either * no url extension or the original file extension. true/false. (optional) * @param params The streaming parameters. (optional) @@ -790,11 +2181,11 @@ private HttpRequest.Builder getVideoStreamRequestBuilder(@org.eclipse.jdt.annota * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) * @param streamOptions Optional. The streaming options. (optional) * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) - * @return File + * @return ApiResponse<File> * @throws ApiException if fails to make API call */ - public File getVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + public ApiResponse headVideoStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, @org.eclipse.jdt.annotation.NonNull String playSessionId, @@ -838,16 +2229,15 @@ public File getVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { - ApiResponse localVarResponse = getVideoStreamByContainerWithHttpInfo(itemId, container, _static, params, - tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, - deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, - breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, - profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, - maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, - requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, - enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, - context, streamOptions, enableAudioVbrEncoding); - return localVarResponse.getData(); + return headVideoStreamWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, null); } /** @@ -855,7 +2245,7 @@ public File getVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID * * @param itemId The item id. (required) * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, - * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either * no url extension or the original file extension. true/false. (optional) * @param params The streaming parameters. (optional) @@ -919,11 +2309,12 @@ public File getVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) * @param streamOptions Optional. The streaming options. (optional) * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request * @return ApiResponse<File> * @throws ApiException if fails to make API call */ - public ApiResponse getVideoStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + public ApiResponse headVideoStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, @org.eclipse.jdt.annotation.NonNull String playSessionId, @@ -966,16 +2357,17 @@ public ApiResponse getVideoStreamByContainerWithHttpInfo(@org.eclipse.jdt. @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getVideoStreamByContainerRequestBuilder(itemId, container, _static, - params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, - mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headVideoStreamRequestBuilder(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, - context, streamOptions, enableAudioVbrEncoding); + context, streamOptions, enableAudioVbrEncoding, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -984,19 +2376,19 @@ public ApiResponse getVideoStreamByContainerWithHttpInfo(@org.eclipse.jdt. } try { if (localVarResponse.statusCode() / 100 != 2) { - throw getApiException("getVideoStreamByContainer", localVarResponse); + throw getApiException("headVideoStream", localVarResponse); } if (localVarResponse.body() == null) { return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1007,10 +2399,10 @@ public ApiResponse getVideoStreamByContainerWithHttpInfo(@org.eclipse.jdt. } } - private HttpRequest.Builder getVideoStreamByContainerRequestBuilder( - @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String container, - @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, - @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + private HttpRequest.Builder headVideoStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, @org.eclipse.jdt.annotation.NonNull String playSessionId, @org.eclipse.jdt.annotation.NonNull String segmentContainer, @org.eclipse.jdt.annotation.NonNull Integer segmentLength, @@ -1051,27 +2443,22 @@ private HttpRequest.Builder getVideoStreamByContainerRequestBuilder( @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { - throw new ApiException(400, - "Missing the required parameter 'itemId' when calling getVideoStreamByContainer"); - } - // verify the required parameter 'container' is set - if (container == null) { - throw new ApiException(400, - "Missing the required parameter 'container' when calling getVideoStreamByContainer"); + throw new ApiException(400, "Missing the required parameter 'itemId' when calling headVideoStream"); } HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - String localVarPath = "/Videos/{itemId}/stream.{container}" - .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) - .replace("{container}", ApiClient.urlEncode(container.toString())); + String localVarPath = "/Videos/{itemId}/stream".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); List localVarQueryParams = new ArrayList<>(); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "container"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("container", container)); localVarQueryParameterBaseName = "static"; localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); localVarQueryParameterBaseName = "params"; @@ -1187,10 +2574,12 @@ private HttpRequest.Builder getVideoStreamByContainerRequestBuilder( localVarRequestBuilder.header("Accept", "video/*"); - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -1202,7 +2591,7 @@ private HttpRequest.Builder getVideoStreamByContainerRequestBuilder( * * @param itemId The item id. (required) * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, - * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either * no url extension or the original file extension. true/false. (optional) * @param params The streaming parameters. (optional) @@ -1269,8 +2658,8 @@ private HttpRequest.Builder getVideoStreamByContainerRequestBuilder( * @return File * @throws ApiException if fails to make API call */ - public File headVideoStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + public File headVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, @org.eclipse.jdt.annotation.NonNull String playSessionId, @@ -1314,16 +2703,15 @@ public File headVideoStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { - ApiResponse localVarResponse = headVideoStreamWithHttpInfo(itemId, container, _static, params, tag, - deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, - audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, - audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, - framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, - videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, - deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, - enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, - context, streamOptions, enableAudioVbrEncoding); - return localVarResponse.getData(); + return headVideoStreamByContainer(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, null); } /** @@ -1331,7 +2719,7 @@ public File headVideoStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, * * @param itemId The item id. (required) * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, - * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either * no url extension or the original file extension. true/false. (optional) * @param params The streaming parameters. (optional) @@ -1395,11 +2783,12 @@ public File headVideoStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) * @param streamOptions Optional. The streaming options. (optional) * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) - * @return ApiResponse<File> + * @param headers Optional headers to include in the request + * @return File * @throws ApiException if fails to make API call - */ - public ApiResponse headVideoStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + */ + public File headVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, @org.eclipse.jdt.annotation.NonNull String playSessionId, @@ -1442,8 +2831,9 @@ public ApiResponse headVideoStreamWithHttpInfo(@org.eclipse.jdt.annotation @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = headVideoStreamRequestBuilder(itemId, container, _static, params, + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { + ApiResponse localVarResponse = headVideoStreamByContainerWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, @@ -1451,220 +2841,8 @@ public ApiResponse headVideoStreamWithHttpInfo(@org.eclipse.jdt.annotation maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, - context, streamOptions, enableAudioVbrEncoding); - try { - HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode() / 100 != 2) { - throw getApiException("headVideoStream", localVarResponse); - } - if (localVarResponse.body() == null) { - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); - } - - String responseBody = new String(localVarResponse.body().readAllBytes()); - localVarResponse.body().close(); - - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder headVideoStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, - @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, - @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, - @org.eclipse.jdt.annotation.NonNull String deviceProfileId, - @org.eclipse.jdt.annotation.NonNull String playSessionId, - @org.eclipse.jdt.annotation.NonNull String segmentContainer, - @org.eclipse.jdt.annotation.NonNull Integer segmentLength, - @org.eclipse.jdt.annotation.NonNull Integer minSegments, - @org.eclipse.jdt.annotation.NonNull String mediaSourceId, - @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, - @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, - @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, - @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, - @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, - @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, - @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, - @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, - @org.eclipse.jdt.annotation.NonNull Integer audioChannels, - @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, - @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, - @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, - @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, - @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, - @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, - @org.eclipse.jdt.annotation.NonNull Integer maxHeight, - @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, - @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, - @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, - @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, - @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, - @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, - @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, - @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, - @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, - @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, - @org.eclipse.jdt.annotation.NonNull String liveStreamId, - @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, - @org.eclipse.jdt.annotation.NonNull String videoCodec, - @org.eclipse.jdt.annotation.NonNull String subtitleCodec, - @org.eclipse.jdt.annotation.NonNull String transcodeReasons, - @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, - @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, - @org.eclipse.jdt.annotation.NonNull EncodingContext context, - @org.eclipse.jdt.annotation.NonNull Map streamOptions, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { - // verify the required parameter 'itemId' is set - if (itemId == null) { - throw new ApiException(400, "Missing the required parameter 'itemId' when calling headVideoStream"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/Videos/{itemId}/stream".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); - - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "container"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("container", container)); - localVarQueryParameterBaseName = "static"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); - localVarQueryParameterBaseName = "params"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); - localVarQueryParameterBaseName = "tag"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); - localVarQueryParameterBaseName = "deviceProfileId"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); - localVarQueryParameterBaseName = "playSessionId"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); - localVarQueryParameterBaseName = "segmentContainer"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); - localVarQueryParameterBaseName = "segmentLength"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); - localVarQueryParameterBaseName = "minSegments"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); - localVarQueryParameterBaseName = "mediaSourceId"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); - localVarQueryParameterBaseName = "deviceId"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); - localVarQueryParameterBaseName = "audioCodec"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); - localVarQueryParameterBaseName = "enableAutoStreamCopy"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); - localVarQueryParameterBaseName = "allowVideoStreamCopy"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); - localVarQueryParameterBaseName = "allowAudioStreamCopy"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); - localVarQueryParameterBaseName = "breakOnNonKeyFrames"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); - localVarQueryParameterBaseName = "audioSampleRate"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); - localVarQueryParameterBaseName = "maxAudioBitDepth"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); - localVarQueryParameterBaseName = "audioBitRate"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); - localVarQueryParameterBaseName = "audioChannels"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); - localVarQueryParameterBaseName = "maxAudioChannels"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); - localVarQueryParameterBaseName = "profile"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); - localVarQueryParameterBaseName = "level"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); - localVarQueryParameterBaseName = "framerate"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); - localVarQueryParameterBaseName = "maxFramerate"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); - localVarQueryParameterBaseName = "copyTimestamps"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); - localVarQueryParameterBaseName = "startTimeTicks"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); - localVarQueryParameterBaseName = "width"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); - localVarQueryParameterBaseName = "height"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); - localVarQueryParameterBaseName = "maxWidth"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); - localVarQueryParameterBaseName = "maxHeight"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); - localVarQueryParameterBaseName = "videoBitRate"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); - localVarQueryParameterBaseName = "subtitleStreamIndex"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); - localVarQueryParameterBaseName = "subtitleMethod"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); - localVarQueryParameterBaseName = "maxRefFrames"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); - localVarQueryParameterBaseName = "maxVideoBitDepth"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); - localVarQueryParameterBaseName = "requireAvc"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); - localVarQueryParameterBaseName = "deInterlace"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); - localVarQueryParameterBaseName = "requireNonAnamorphic"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); - localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; - localVarQueryParams - .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); - localVarQueryParameterBaseName = "cpuCoreLimit"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); - localVarQueryParameterBaseName = "liveStreamId"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); - localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); - localVarQueryParameterBaseName = "videoCodec"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); - localVarQueryParameterBaseName = "subtitleCodec"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); - localVarQueryParameterBaseName = "transcodeReasons"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); - localVarQueryParameterBaseName = "audioStreamIndex"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); - localVarQueryParameterBaseName = "videoStreamIndex"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); - localVarQueryParameterBaseName = "context"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); - localVarQueryParameterBaseName = "streamOptions"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); - localVarQueryParameterBaseName = "enableAudioVbrEncoding"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAudioVbrEncoding", enableAudioVbrEncoding)); - - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - } - - localVarRequestBuilder.header("Accept", "video/*"); - - localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; + context, streamOptions, enableAudioVbrEncoding, headers); + return localVarResponse.getData(); } /** @@ -1736,10 +2914,10 @@ private HttpRequest.Builder headVideoStreamRequestBuilder(@org.eclipse.jdt.annot * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) * @param streamOptions Optional. The streaming options. (optional) * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) - * @return File + * @return ApiResponse<File> * @throws ApiException if fails to make API call */ - public File headVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + public ApiResponse headVideoStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, @@ -1784,16 +2962,15 @@ public File headVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { - ApiResponse localVarResponse = headVideoStreamByContainerWithHttpInfo(itemId, container, _static, params, - tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, - deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, - breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, - profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, - maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, - requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, - enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, - context, streamOptions, enableAudioVbrEncoding); - return localVarResponse.getData(); + return headVideoStreamByContainerWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, + playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, + enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, + maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAudioVbrEncoding, null); } /** @@ -1865,6 +3042,7 @@ public File headVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) * @param streamOptions Optional. The streaming options. (optional) * @param enableAudioVbrEncoding Optional. Whether to enable Audio Encoding. (optional, default to true) + * @param headers Optional headers to include in the request * @return ApiResponse<File> * @throws ApiException if fails to make API call */ @@ -1912,7 +3090,8 @@ public ApiResponse headVideoStreamByContainerWithHttpInfo(@org.eclipse.jdt @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { HttpRequest.Builder localVarRequestBuilder = headVideoStreamByContainerRequestBuilder(itemId, container, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, @@ -1921,7 +3100,7 @@ public ApiResponse headVideoStreamByContainerWithHttpInfo(@org.eclipse.jdt maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, - context, streamOptions, enableAudioVbrEncoding); + context, streamOptions, enableAudioVbrEncoding, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -1936,13 +3115,13 @@ public ApiResponse headVideoStreamByContainerWithHttpInfo(@org.eclipse.jdt return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - String responseBody = new String(localVarResponse.body().readAllBytes()); + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -1997,7 +3176,8 @@ private HttpRequest.Builder headVideoStreamByContainerRequestBuilder( @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, @org.eclipse.jdt.annotation.NonNull EncodingContext context, @org.eclipse.jdt.annotation.NonNull Map streamOptions, - @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioVbrEncoding, Map headers) + throws ApiException { // verify the required parameter 'itemId' is set if (itemId == null) { throw new ApiException(400, @@ -2137,6 +3317,8 @@ private HttpRequest.Builder headVideoStreamByContainerRequestBuilder( if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -2150,7 +3332,19 @@ private HttpRequest.Builder headVideoStreamByContainerRequestBuilder( * @throws ApiException if fails to make API call */ public void mergeVersions(@org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { - mergeVersionsWithHttpInfo(ids); + mergeVersions(ids, null); + } + + /** + * Merges videos into a single record. + * + * @param ids Item id list. This allows multiple, comma delimited. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void mergeVersions(@org.eclipse.jdt.annotation.Nullable List ids, Map headers) + throws ApiException { + mergeVersionsWithHttpInfo(ids, headers); } /** @@ -2162,7 +3356,20 @@ public void mergeVersions(@org.eclipse.jdt.annotation.Nullable List ids) t */ public ApiResponse mergeVersionsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = mergeVersionsRequestBuilder(ids); + return mergeVersionsWithHttpInfo(ids, null); + } + + /** + * Merges videos into a single record. + * + * @param ids Item id list. This allows multiple, comma delimited. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse mergeVersionsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable List ids, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = mergeVersionsRequestBuilder(ids, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -2189,8 +3396,8 @@ public ApiResponse mergeVersionsWithHttpInfo(@org.eclipse.jdt.annotation.N } } - private HttpRequest.Builder mergeVersionsRequestBuilder(@org.eclipse.jdt.annotation.Nullable List ids) - throws ApiException { + private HttpRequest.Builder mergeVersionsRequestBuilder(@org.eclipse.jdt.annotation.Nullable List ids, + Map headers) throws ApiException { // verify the required parameter 'ids' is set if (ids == null) { throw new ApiException(400, "Missing the required parameter 'ids' when calling mergeVersions"); @@ -2224,6 +3431,8 @@ private HttpRequest.Builder mergeVersionsRequestBuilder(@org.eclipse.jdt.annotat if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/YearsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/YearsApi.java index 78c3a5b874ae7..79ecf596d78a0 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/YearsApi.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/YearsApi.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.jellyfin.internal.api.generated.current; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,6 +22,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.function.Consumer; @@ -44,6 +46,28 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") public class YearsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; private final ObjectMapper memberVarObjectMapper; private final String memberVarBaseUri; @@ -79,6 +103,56 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + /** * Gets a year. * @@ -89,7 +163,21 @@ private String formatExceptionMessage(String operationId, int statusCode, String */ public BaseItemDto getYear(@org.eclipse.jdt.annotation.Nullable Integer year, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - ApiResponse localVarResponse = getYearWithHttpInfo(year, userId); + return getYear(year, userId, null); + } + + /** + * Gets a year. + * + * @param year The year. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getYear(@org.eclipse.jdt.annotation.Nullable Integer year, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getYearWithHttpInfo(year, userId, headers); return localVarResponse.getData(); } @@ -103,7 +191,21 @@ public BaseItemDto getYear(@org.eclipse.jdt.annotation.Nullable Integer year, */ public ApiResponse getYearWithHttpInfo(@org.eclipse.jdt.annotation.Nullable Integer year, @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getYearRequestBuilder(year, userId); + return getYearWithHttpInfo(year, userId, null); + } + + /** + * Gets a year. + * + * @param year The year. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getYearWithHttpInfo(@org.eclipse.jdt.annotation.Nullable Integer year, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getYearRequestBuilder(year, userId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -120,12 +222,14 @@ public ApiResponse getYearWithHttpInfo(@org.eclipse.jdt.annotation. } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, new TypeReference() { - })); + responseValue); } finally { } } catch (IOException e) { @@ -137,7 +241,7 @@ public ApiResponse getYearWithHttpInfo(@org.eclipse.jdt.annotation. } private HttpRequest.Builder getYearRequestBuilder(@org.eclipse.jdt.annotation.Nullable Integer year, - @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { // verify the required parameter 'year' is set if (year == null) { throw new ApiException(400, "Missing the required parameter 'year' when calling getYear"); @@ -171,6 +275,8 @@ private HttpRequest.Builder getYearRequestBuilder(@org.eclipse.jdt.annotation.Nu if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } @@ -217,9 +323,54 @@ public BaseItemDtoQueryResult getYears(@org.eclipse.jdt.annotation.NonNull Integ @org.eclipse.jdt.annotation.NonNull List enableImageTypes, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean recursive, @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getYears(startIndex, limit, sortOrder, parentId, fields, excludeItemTypes, includeItemTypes, mediaTypes, + sortBy, enableUserData, imageTypeLimit, enableImageTypes, userId, recursive, enableImages, null); + } + + /** + * Get years. + * + * @param startIndex Skips over a given number of items within the results. Use for paging. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be excluded based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be included based on item type. This allows + * multiple, comma delimited. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User Id. (optional) + * @param recursive Search recursively. (optional, default to true) + * @param enableImages Optional. Include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getYears(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { ApiResponse localVarResponse = getYearsWithHttpInfo(startIndex, limit, sortOrder, parentId, fields, excludeItemTypes, includeItemTypes, mediaTypes, sortBy, enableUserData, - imageTypeLimit, enableImageTypes, userId, recursive, enableImages); + imageTypeLimit, enableImageTypes, userId, recursive, enableImages, headers); return localVarResponse.getData(); } @@ -263,9 +414,55 @@ public ApiResponse getYearsWithHttpInfo( @org.eclipse.jdt.annotation.NonNull List enableImageTypes, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean recursive, @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getYearsWithHttpInfo(startIndex, limit, sortOrder, parentId, fields, excludeItemTypes, includeItemTypes, + mediaTypes, sortBy, enableUserData, imageTypeLimit, enableImageTypes, userId, recursive, enableImages, + null); + } + + /** + * Get years. + * + * @param startIndex Skips over a given number of items within the results. Use for paging. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be excluded based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be included based on item type. This allows + * multiple, comma delimited. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User Id. (optional) + * @param recursive Search recursively. (optional, default to true) + * @param enableImages Optional. Include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getYearsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getYearsRequestBuilder(startIndex, limit, sortOrder, parentId, fields, excludeItemTypes, includeItemTypes, mediaTypes, sortBy, enableUserData, imageTypeLimit, - enableImageTypes, userId, recursive, enableImages); + enableImageTypes, userId, recursive, enableImages, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); @@ -282,14 +479,14 @@ public ApiResponse getYearsWithHttpInfo( } String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + localVarResponse.body().close(); return new ApiResponse(localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody.isBlank() ? null - : memberVarObjectMapper.readValue(responseBody, - new TypeReference() { - })); + localVarResponse.headers().map(), responseValue); } finally { } } catch (IOException e) { @@ -313,7 +510,7 @@ private HttpRequest.Builder getYearsRequestBuilder(@org.eclipse.jdt.annotation.N @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, @org.eclipse.jdt.annotation.NonNull List enableImageTypes, @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean recursive, - @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -371,6 +568,8 @@ private HttpRequest.Builder getYearsRequestBuilder(@org.eclipse.jdt.annotation.N if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); if (memberVarInterceptor != null) { memberVarInterceptor.accept(localVarRequestBuilder); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupUpdate.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupUpdate.java index 63ca046789615..04b3333460e26 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupUpdate.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/GroupUpdate.java @@ -284,10 +284,6 @@ public GroupUpdate(StringGroupUpdate o) { mappings.put("StateUpdate", GroupStateUpdateGroupUpdate.class); mappings.put("UserJoined", StringGroupUpdate.class); mappings.put("UserLeft", StringGroupUpdate.class); - mappings.put("GroupInfoDtoGroupUpdate", GroupInfoDtoGroupUpdate.class); - mappings.put("GroupStateUpdateGroupUpdate", GroupStateUpdateGroupUpdate.class); - mappings.put("PlayQueueUpdateGroupUpdate", PlayQueueUpdateGroupUpdate.class); - mappings.put("StringGroupUpdate", StringGroupUpdate.class); mappings.put("GroupUpdate", GroupUpdate.class); JSON.registerDiscriminator(GroupUpdate.class, "Type", mappings); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/InboundWebSocketMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/InboundWebSocketMessage.java index 107ce8538bc07..407990c14afa6 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/InboundWebSocketMessage.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/InboundWebSocketMessage.java @@ -412,13 +412,6 @@ public InboundWebSocketMessage(SessionsStopMessage o) { mappings.put("ScheduledTasksInfoStop", ScheduledTasksInfoStopMessage.class); mappings.put("SessionsStart", SessionsStartMessage.class); mappings.put("SessionsStop", SessionsStopMessage.class); - mappings.put("ActivityLogEntryStartMessage", ActivityLogEntryStartMessage.class); - mappings.put("ActivityLogEntryStopMessage", ActivityLogEntryStopMessage.class); - mappings.put("InboundKeepAliveMessage", InboundKeepAliveMessage.class); - mappings.put("ScheduledTasksInfoStartMessage", ScheduledTasksInfoStartMessage.class); - mappings.put("ScheduledTasksInfoStopMessage", ScheduledTasksInfoStopMessage.class); - mappings.put("SessionsStartMessage", SessionsStartMessage.class); - mappings.put("SessionsStopMessage", SessionsStopMessage.class); mappings.put("InboundWebSocketMessage", InboundWebSocketMessage.class); JSON.registerDiscriminator(InboundWebSocketMessage.class, "MessageType", mappings); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/OutboundWebSocketMessage.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/OutboundWebSocketMessage.java index 4bf540256c85c..9a3e5b67608fb 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/OutboundWebSocketMessage.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/OutboundWebSocketMessage.java @@ -1314,34 +1314,6 @@ public OutboundWebSocketMessage(UserUpdatedMessage o) { mappings.put("UserDataChanged", UserDataChangedMessage.class); mappings.put("UserDeleted", UserDeletedMessage.class); mappings.put("UserUpdated", UserUpdatedMessage.class); - mappings.put("ActivityLogEntryMessage", ActivityLogEntryMessage.class); - mappings.put("ForceKeepAliveMessage", ForceKeepAliveMessage.class); - mappings.put("GeneralCommandMessage", GeneralCommandMessage.class); - mappings.put("LibraryChangedMessage", LibraryChangedMessage.class); - mappings.put("OutboundKeepAliveMessage", OutboundKeepAliveMessage.class); - mappings.put("PlayMessage", PlayMessage.class); - mappings.put("PlaystateMessage", PlaystateMessage.class); - mappings.put("PluginInstallationCancelledMessage", PluginInstallationCancelledMessage.class); - mappings.put("PluginInstallationCompletedMessage", PluginInstallationCompletedMessage.class); - mappings.put("PluginInstallationFailedMessage", PluginInstallationFailedMessage.class); - mappings.put("PluginInstallingMessage", PluginInstallingMessage.class); - mappings.put("PluginUninstalledMessage", PluginUninstalledMessage.class); - mappings.put("RefreshProgressMessage", RefreshProgressMessage.class); - mappings.put("RestartRequiredMessage", RestartRequiredMessage.class); - mappings.put("ScheduledTaskEndedMessage", ScheduledTaskEndedMessage.class); - mappings.put("ScheduledTasksInfoMessage", ScheduledTasksInfoMessage.class); - mappings.put("SeriesTimerCancelledMessage", SeriesTimerCancelledMessage.class); - mappings.put("SeriesTimerCreatedMessage", SeriesTimerCreatedMessage.class); - mappings.put("ServerRestartingMessage", ServerRestartingMessage.class); - mappings.put("ServerShuttingDownMessage", ServerShuttingDownMessage.class); - mappings.put("SessionsMessage", SessionsMessage.class); - mappings.put("SyncPlayCommandMessage", SyncPlayCommandMessage.class); - mappings.put("SyncPlayGroupUpdateCommandMessage", SyncPlayGroupUpdateCommandMessage.class); - mappings.put("TimerCancelledMessage", TimerCancelledMessage.class); - mappings.put("TimerCreatedMessage", TimerCreatedMessage.class); - mappings.put("UserDataChangedMessage", UserDataChangedMessage.class); - mappings.put("UserDeletedMessage", UserDeletedMessage.class); - mappings.put("UserUpdatedMessage", UserUpdatedMessage.class); mappings.put("OutboundWebSocketMessage", OutboundWebSocketMessage.class); JSON.registerDiscriminator(OutboundWebSocketMessage.class, "MessageType", mappings); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProblemDetails.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProblemDetails.java index c1fae34c8c497..57c012520e6f6 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProblemDetails.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/current/model/ProblemDetails.java @@ -33,7 +33,7 @@ ProblemDetails.JSON_PROPERTY_STATUS, ProblemDetails.JSON_PROPERTY_DETAIL, ProblemDetails.JSON_PROPERTY_INSTANCE }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") -public class ProblemDetails extends HashMap { +public class ProblemDetails { public static final String JSON_PROPERTY_TYPE = "type"; @org.eclipse.jdt.annotation.NonNull private String type; @@ -235,19 +235,18 @@ public boolean equals(Object o) { && Objects.equals(this.status, problemDetails.status) && Objects.equals(this.detail, problemDetails.detail) && Objects.equals(this.instance, problemDetails.instance) - && Objects.equals(this.additionalProperties, problemDetails.additionalProperties) && super.equals(o); + && Objects.equals(this.additionalProperties, problemDetails.additionalProperties); } @Override public int hashCode() { - return Objects.hash(type, title, status, detail, instance, super.hashCode(), additionalProperties); + return Objects.hash(type, title, status, detail, instance, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ProblemDetails {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ActivityLogApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ActivityLogApi.java new file mode 100644 index 0000000000000..7b6e38a4fb52c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ActivityLogApi.java @@ -0,0 +1,305 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ActivityLogEntryQueryResult; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ActivityLogApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ActivityLogApi() { + this(Configuration.getDefaultApiClient()); + } + + public ActivityLogApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets activity log entries. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param minDate Optional. The minimum date. Format = ISO. (optional) + * @param hasUserId Optional. Filter log entries if it has user id, or not. (optional) + * @return ActivityLogEntryQueryResult + * @throws ApiException if fails to make API call + */ + public ActivityLogEntryQueryResult getLogEntries(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasUserId) throws ApiException { + return getLogEntries(startIndex, limit, minDate, hasUserId, null); + } + + /** + * Gets activity log entries. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param minDate Optional. The minimum date. Format = ISO. (optional) + * @param hasUserId Optional. Filter log entries if it has user id, or not. (optional) + * @param headers Optional headers to include in the request + * @return ActivityLogEntryQueryResult + * @throws ApiException if fails to make API call + */ + public ActivityLogEntryQueryResult getLogEntries(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasUserId, Map headers) throws ApiException { + ApiResponse localVarResponse = getLogEntriesWithHttpInfo(startIndex, limit, + minDate, hasUserId, headers); + return localVarResponse.getData(); + } + + /** + * Gets activity log entries. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param minDate Optional. The minimum date. Format = ISO. (optional) + * @param hasUserId Optional. Filter log entries if it has user id, or not. (optional) + * @return ApiResponse<ActivityLogEntryQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLogEntriesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasUserId) throws ApiException { + return getLogEntriesWithHttpInfo(startIndex, limit, minDate, hasUserId, null); + } + + /** + * Gets activity log entries. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param minDate Optional. The minimum date. Format = ISO. (optional) + * @param hasUserId Optional. Filter log entries if it has user id, or not. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<ActivityLogEntryQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLogEntriesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasUserId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLogEntriesRequestBuilder(startIndex, limit, minDate, hasUserId, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLogEntries", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + ActivityLogEntryQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLogEntriesRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasUserId, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/ActivityLog/Entries"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "minDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minDate", minDate)); + localVarQueryParameterBaseName = "hasUserId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasUserId", hasUserId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ApiKeyApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ApiKeyApi.java new file mode 100644 index 0000000000000..a5f913346e9f6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ApiKeyApi.java @@ -0,0 +1,458 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.AuthenticationInfoQueryResult; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ApiKeyApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ApiKeyApi() { + this(Configuration.getDefaultApiClient()); + } + + public ApiKeyApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Create a new api key. + * + * @param app Name of the app using the authentication key. (required) + * @throws ApiException if fails to make API call + */ + public void createKey(@org.eclipse.jdt.annotation.Nullable String app) throws ApiException { + createKey(app, null); + } + + /** + * Create a new api key. + * + * @param app Name of the app using the authentication key. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void createKey(@org.eclipse.jdt.annotation.Nullable String app, Map headers) + throws ApiException { + createKeyWithHttpInfo(app, headers); + } + + /** + * Create a new api key. + * + * @param app Name of the app using the authentication key. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createKeyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String app) + throws ApiException { + return createKeyWithHttpInfo(app, null); + } + + /** + * Create a new api key. + * + * @param app Name of the app using the authentication key. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createKeyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String app, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createKeyRequestBuilder(app, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createKey", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createKeyRequestBuilder(@org.eclipse.jdt.annotation.Nullable String app, + Map headers) throws ApiException { + // verify the required parameter 'app' is set + if (app == null) { + throw new ApiException(400, "Missing the required parameter 'app' when calling createKey"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Auth/Keys"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "app"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("app", app)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get all keys. + * + * @return AuthenticationInfoQueryResult + * @throws ApiException if fails to make API call + */ + public AuthenticationInfoQueryResult getKeys() throws ApiException { + return getKeys(null); + } + + /** + * Get all keys. + * + * @param headers Optional headers to include in the request + * @return AuthenticationInfoQueryResult + * @throws ApiException if fails to make API call + */ + public AuthenticationInfoQueryResult getKeys(Map headers) throws ApiException { + ApiResponse localVarResponse = getKeysWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Get all keys. + * + * @return ApiResponse<AuthenticationInfoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getKeysWithHttpInfo() throws ApiException { + return getKeysWithHttpInfo(null); + } + + /** + * Get all keys. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<AuthenticationInfoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getKeysWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getKeysRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getKeys", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + AuthenticationInfoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getKeysRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Auth/Keys"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Remove an api key. + * + * @param key The access token to delete. (required) + * @throws ApiException if fails to make API call + */ + public void revokeKey(@org.eclipse.jdt.annotation.Nullable String key) throws ApiException { + revokeKey(key, null); + } + + /** + * Remove an api key. + * + * @param key The access token to delete. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void revokeKey(@org.eclipse.jdt.annotation.Nullable String key, Map headers) + throws ApiException { + revokeKeyWithHttpInfo(key, headers); + } + + /** + * Remove an api key. + * + * @param key The access token to delete. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse revokeKeyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String key) + throws ApiException { + return revokeKeyWithHttpInfo(key, null); + } + + /** + * Remove an api key. + * + * @param key The access token to delete. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse revokeKeyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String key, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = revokeKeyRequestBuilder(key, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("revokeKey", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder revokeKeyRequestBuilder(@org.eclipse.jdt.annotation.Nullable String key, + Map headers) throws ApiException { + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException(400, "Missing the required parameter 'key' when calling revokeKey"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Auth/Keys/{key}".replace("{key}", ApiClient.urlEncode(key.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ArtistsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ArtistsApi.java new file mode 100644 index 0000000000000..1788f6885da53 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ArtistsApi.java @@ -0,0 +1,1331 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFilter; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SortOrder; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ArtistsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ArtistsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ArtistsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets all album artists from a given item, folder, or the entire library. + * + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person ids. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getAlbumArtists(@org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getAlbumArtists(minCommunityRating, startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, + includeItemTypes, filters, isFavorite, mediaTypes, genres, genreIds, officialRatings, tags, years, + enableUserData, imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, studioIds, + userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, + enableTotalRecordCount, null); + } + + /** + * Gets all album artists from a given item, folder, or the entire library. + * + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person ids. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getAlbumArtists(@org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + ApiResponse localVarResponse = getAlbumArtistsWithHttpInfo(minCommunityRating, + startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, filters, + isFavorite, mediaTypes, genres, genreIds, officialRatings, tags, years, enableUserData, imageTypeLimit, + enableImageTypes, person, personIds, personTypes, studios, studioIds, userId, nameStartsWithOrGreater, + nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount, headers); + return localVarResponse.getData(); + } + + /** + * Gets all album artists from a given item, folder, or the entire library. + * + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person ids. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAlbumArtistsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getAlbumArtistsWithHttpInfo(minCommunityRating, startIndex, limit, searchTerm, parentId, fields, + excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, genres, genreIds, officialRatings, + tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, + studioIds, userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, + enableImages, enableTotalRecordCount, null); + } + + /** + * Gets all album artists from a given item, folder, or the entire library. + * + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person ids. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAlbumArtistsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAlbumArtistsRequestBuilder(minCommunityRating, startIndex, + limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, filters, isFavorite, + mediaTypes, genres, genreIds, officialRatings, tags, years, enableUserData, imageTypeLimit, + enableImageTypes, person, personIds, personTypes, studios, studioIds, userId, nameStartsWithOrGreater, + nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getAlbumArtists", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAlbumArtistsRequestBuilder( + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Artists/AlbumArtists"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "minCommunityRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minCommunityRating", minCommunityRating)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "filters"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "filters", filters)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + localVarQueryParameterBaseName = "genres"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genres", genres)); + localVarQueryParameterBaseName = "genreIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genreIds", genreIds)); + localVarQueryParameterBaseName = "officialRatings"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "officialRatings", officialRatings)); + localVarQueryParameterBaseName = "tags"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "tags", tags)); + localVarQueryParameterBaseName = "years"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "years", years)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "person"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("person", person)); + localVarQueryParameterBaseName = "personIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personIds", personIds)); + localVarQueryParameterBaseName = "personTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personTypes", personTypes)); + localVarQueryParameterBaseName = "studios"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studios", studios)); + localVarQueryParameterBaseName = "studioIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studioIds", studioIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "nameStartsWithOrGreater"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWithOrGreater", nameStartsWithOrGreater)); + localVarQueryParameterBaseName = "nameStartsWith"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWith", nameStartsWith)); + localVarQueryParameterBaseName = "nameLessThan"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameLessThan", nameLessThan)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an artist by name. + * + * @param name Studio name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getArtistByName(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getArtistByName(name, userId, null); + } + + /** + * Gets an artist by name. + * + * @param name Studio name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getArtistByName(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getArtistByNameWithHttpInfo(name, userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets an artist by name. + * + * @param name Studio name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getArtistByNameWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getArtistByNameWithHttpInfo(name, userId, null); + } + + /** + * Gets an artist by name. + * + * @param name Studio name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getArtistByNameWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getArtistByNameRequestBuilder(name, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getArtistByName", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getArtistByNameRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getArtistByName"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Artists/{name}".replace("{name}", ApiClient.urlEncode(name.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all artists from a given item, folder, or the entire library. + * + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person ids. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getArtists(@org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getArtists(minCommunityRating, startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, + includeItemTypes, filters, isFavorite, mediaTypes, genres, genreIds, officialRatings, tags, years, + enableUserData, imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, studioIds, + userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, + enableTotalRecordCount, null); + } + + /** + * Gets all artists from a given item, folder, or the entire library. + * + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person ids. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getArtists(@org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + ApiResponse localVarResponse = getArtistsWithHttpInfo(minCommunityRating, startIndex, + limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, filters, isFavorite, + mediaTypes, genres, genreIds, officialRatings, tags, years, enableUserData, imageTypeLimit, + enableImageTypes, person, personIds, personTypes, studios, studioIds, userId, nameStartsWithOrGreater, + nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount, headers); + return localVarResponse.getData(); + } + + /** + * Gets all artists from a given item, folder, or the entire library. + * + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person ids. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getArtistsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getArtistsWithHttpInfo(minCommunityRating, startIndex, limit, searchTerm, parentId, fields, + excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, genres, genreIds, officialRatings, + tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, + studioIds, userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, + enableImages, enableTotalRecordCount, null); + } + + /** + * Gets all artists from a given item, folder, or the entire library. + * + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person ids. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getArtistsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getArtistsRequestBuilder(minCommunityRating, startIndex, limit, + searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, + genres, genreIds, officialRatings, tags, years, enableUserData, imageTypeLimit, enableImageTypes, + person, personIds, personTypes, studios, studioIds, userId, nameStartsWithOrGreater, nameStartsWith, + nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getArtists", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getArtistsRequestBuilder(@org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List studioIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Artists"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "minCommunityRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minCommunityRating", minCommunityRating)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "filters"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "filters", filters)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + localVarQueryParameterBaseName = "genres"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genres", genres)); + localVarQueryParameterBaseName = "genreIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genreIds", genreIds)); + localVarQueryParameterBaseName = "officialRatings"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "officialRatings", officialRatings)); + localVarQueryParameterBaseName = "tags"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "tags", tags)); + localVarQueryParameterBaseName = "years"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "years", years)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "person"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("person", person)); + localVarQueryParameterBaseName = "personIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personIds", personIds)); + localVarQueryParameterBaseName = "personTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personTypes", personTypes)); + localVarQueryParameterBaseName = "studios"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studios", studios)); + localVarQueryParameterBaseName = "studioIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studioIds", studioIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "nameStartsWithOrGreater"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWithOrGreater", nameStartsWithOrGreater)); + localVarQueryParameterBaseName = "nameStartsWith"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWith", nameStartsWith)); + localVarQueryParameterBaseName = "nameLessThan"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameLessThan", nameLessThan)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/AudioApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/AudioApi.java new file mode 100644 index 0000000000000..9a0ae57cfde42 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/AudioApi.java @@ -0,0 +1,2972 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.EncodingContext; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SubtitleDeliveryMethod; + +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AudioApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public AudioApi() { + this(Configuration.getDefaultApiClient()); + } + + public AudioApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return getAudioStream(itemId, container, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, + segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + ApiResponse localVarResponse = getAudioStreamWithHttpInfo(itemId, container, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + headers); + return localVarResponse.getData(); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return getAudioStreamWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAudioStreamRequestBuilder(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getAudioStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAudioStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getAudioStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/stream".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "container"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("container", container)); + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "audio/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment lenght. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamporphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getAudioStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return getAudioStreamByContainer(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment lenght. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamporphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getAudioStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + ApiResponse localVarResponse = getAudioStreamByContainerWithHttpInfo(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + headers); + return localVarResponse.getData(); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment lenght. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamporphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAudioStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return getAudioStreamByContainerWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, + playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, + enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, + maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment lenght. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamporphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAudioStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAudioStreamByContainerRequestBuilder(itemId, container, _static, + params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getAudioStreamByContainer", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAudioStreamByContainerRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getAudioStreamByContainer"); + } + // verify the required parameter 'container' is set + if (container == null) { + throw new ApiException(400, + "Missing the required parameter 'container' when calling getAudioStreamByContainer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/stream.{container}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{container}", ApiClient.urlEncode(container.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "audio/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return headAudioStream(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + ApiResponse localVarResponse = headAudioStreamWithHttpInfo(itemId, container, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + headers); + return localVarResponse.getData(); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return headAudioStreamWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headAudioStreamRequestBuilder(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headAudioStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headAudioStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling headAudioStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/stream".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "container"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("container", container)); + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "audio/*"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment lenght. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamporphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headAudioStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return headAudioStreamByContainer(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment lenght. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamporphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headAudioStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + ApiResponse localVarResponse = headAudioStreamByContainerWithHttpInfo(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + headers); + return localVarResponse.getData(); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment lenght. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamporphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headAudioStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return headAudioStreamByContainerWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, + playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, + enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, + maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment lenght. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamporphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headAudioStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headAudioStreamByContainerRequestBuilder(itemId, container, + _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headAudioStreamByContainer", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headAudioStreamByContainerRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling headAudioStreamByContainer"); + } + // verify the required parameter 'container' is set + if (container == null) { + throw new ApiException(400, + "Missing the required parameter 'container' when calling headAudioStreamByContainer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/stream.{container}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{container}", ApiClient.urlEncode(container.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "audio/*"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/BrandingApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/BrandingApi.java new file mode 100644 index 0000000000000..64ee15dd801f8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/BrandingApi.java @@ -0,0 +1,438 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.Map; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BrandingOptions; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BrandingApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public BrandingApi() { + this(Configuration.getDefaultApiClient()); + } + + public BrandingApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets branding css. + * + * @return String + * @throws ApiException if fails to make API call + */ + public String getBrandingCss() throws ApiException { + return getBrandingCss(null); + } + + /** + * Gets branding css. + * + * @param headers Optional headers to include in the request + * @return String + * @throws ApiException if fails to make API call + */ + public String getBrandingCss(Map headers) throws ApiException { + ApiResponse localVarResponse = getBrandingCssWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets branding css. + * + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getBrandingCssWithHttpInfo() throws ApiException { + return getBrandingCssWithHttpInfo(null); + } + + /** + * Gets branding css. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getBrandingCssWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBrandingCssRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getBrandingCss", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + String responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getBrandingCssRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Branding/Css"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "text/css, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets branding css. + * + * @return String + * @throws ApiException if fails to make API call + */ + public String getBrandingCss2() throws ApiException { + return getBrandingCss2(null); + } + + /** + * Gets branding css. + * + * @param headers Optional headers to include in the request + * @return String + * @throws ApiException if fails to make API call + */ + public String getBrandingCss2(Map headers) throws ApiException { + ApiResponse localVarResponse = getBrandingCss2WithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets branding css. + * + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getBrandingCss2WithHttpInfo() throws ApiException { + return getBrandingCss2WithHttpInfo(null); + } + + /** + * Gets branding css. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getBrandingCss2WithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBrandingCss2RequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getBrandingCss2", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + String responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getBrandingCss2RequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Branding/Css.css"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "text/css, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets branding configuration. + * + * @return BrandingOptions + * @throws ApiException if fails to make API call + */ + public BrandingOptions getBrandingOptions() throws ApiException { + return getBrandingOptions(null); + } + + /** + * Gets branding configuration. + * + * @param headers Optional headers to include in the request + * @return BrandingOptions + * @throws ApiException if fails to make API call + */ + public BrandingOptions getBrandingOptions(Map headers) throws ApiException { + ApiResponse localVarResponse = getBrandingOptionsWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets branding configuration. + * + * @return ApiResponse<BrandingOptions> + * @throws ApiException if fails to make API call + */ + public ApiResponse getBrandingOptionsWithHttpInfo() throws ApiException { + return getBrandingOptionsWithHttpInfo(null); + } + + /** + * Gets branding configuration. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<BrandingOptions> + * @throws ApiException if fails to make API call + */ + public ApiResponse getBrandingOptionsWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBrandingOptionsRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getBrandingOptions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BrandingOptions responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getBrandingOptionsRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Branding/Configuration"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ChannelsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ChannelsApi.java new file mode 100644 index 0000000000000..05e952e78a287 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ChannelsApi.java @@ -0,0 +1,933 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ChannelFeatures; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFilter; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SortOrder; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ChannelsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ChannelsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ChannelsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Get all channel features. + * + * @return List<ChannelFeatures> + * @throws ApiException if fails to make API call + */ + public List getAllChannelFeatures() throws ApiException { + return getAllChannelFeatures(null); + } + + /** + * Get all channel features. + * + * @param headers Optional headers to include in the request + * @return List<ChannelFeatures> + * @throws ApiException if fails to make API call + */ + public List getAllChannelFeatures(Map headers) throws ApiException { + ApiResponse> localVarResponse = getAllChannelFeaturesWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Get all channel features. + * + * @return ApiResponse<List<ChannelFeatures>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getAllChannelFeaturesWithHttpInfo() throws ApiException { + return getAllChannelFeaturesWithHttpInfo(null); + } + + /** + * Get all channel features. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<ChannelFeatures>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getAllChannelFeaturesWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAllChannelFeaturesRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getAllChannelFeatures", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAllChannelFeaturesRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Channels/Features"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get channel features. + * + * @param channelId Channel id. (required) + * @return ChannelFeatures + * @throws ApiException if fails to make API call + */ + public ChannelFeatures getChannelFeatures(@org.eclipse.jdt.annotation.Nullable UUID channelId) throws ApiException { + return getChannelFeatures(channelId, null); + } + + /** + * Get channel features. + * + * @param channelId Channel id. (required) + * @param headers Optional headers to include in the request + * @return ChannelFeatures + * @throws ApiException if fails to make API call + */ + public ChannelFeatures getChannelFeatures(@org.eclipse.jdt.annotation.Nullable UUID channelId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getChannelFeaturesWithHttpInfo(channelId, headers); + return localVarResponse.getData(); + } + + /** + * Get channel features. + * + * @param channelId Channel id. (required) + * @return ApiResponse<ChannelFeatures> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelFeaturesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID channelId) throws ApiException { + return getChannelFeaturesWithHttpInfo(channelId, null); + } + + /** + * Get channel features. + * + * @param channelId Channel id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<ChannelFeatures> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelFeaturesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID channelId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getChannelFeaturesRequestBuilder(channelId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getChannelFeatures", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + ChannelFeatures responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getChannelFeaturesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID channelId, + Map headers) throws ApiException { + // verify the required parameter 'channelId' is set + if (channelId == null) { + throw new ApiException(400, "Missing the required parameter 'channelId' when calling getChannelFeatures"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Channels/{channelId}/Features".replace("{channelId}", + ApiClient.urlEncode(channelId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get channel items. + * + * @param channelId Channel Id. (required) + * @param folderId Optional. Folder Id. (optional) + * @param userId Optional. User Id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortOrder Optional. Sort Order - Ascending,Descending. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getChannelItems(@org.eclipse.jdt.annotation.Nullable UUID channelId, + @org.eclipse.jdt.annotation.NonNull UUID folderId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getChannelItems(channelId, folderId, userId, startIndex, limit, sortOrder, filters, sortBy, fields, + null); + } + + /** + * Get channel items. + * + * @param channelId Channel Id. (required) + * @param folderId Optional. Folder Id. (optional) + * @param userId Optional. User Id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortOrder Optional. Sort Order - Ascending,Descending. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getChannelItems(@org.eclipse.jdt.annotation.Nullable UUID channelId, + @org.eclipse.jdt.annotation.NonNull UUID folderId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + ApiResponse localVarResponse = getChannelItemsWithHttpInfo(channelId, folderId, userId, + startIndex, limit, sortOrder, filters, sortBy, fields, headers); + return localVarResponse.getData(); + } + + /** + * Get channel items. + * + * @param channelId Channel Id. (required) + * @param folderId Optional. Folder Id. (optional) + * @param userId Optional. User Id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortOrder Optional. Sort Order - Ascending,Descending. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelItemsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID channelId, @org.eclipse.jdt.annotation.NonNull UUID folderId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getChannelItemsWithHttpInfo(channelId, folderId, userId, startIndex, limit, sortOrder, filters, sortBy, + fields, null); + } + + /** + * Get channel items. + * + * @param channelId Channel Id. (required) + * @param folderId Optional. Folder Id. (optional) + * @param userId Optional. User Id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortOrder Optional. Sort Order - Ascending,Descending. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelItemsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID channelId, @org.eclipse.jdt.annotation.NonNull UUID folderId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getChannelItemsRequestBuilder(channelId, folderId, userId, + startIndex, limit, sortOrder, filters, sortBy, fields, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getChannelItems", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getChannelItemsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID channelId, + @org.eclipse.jdt.annotation.NonNull UUID folderId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + // verify the required parameter 'channelId' is set + if (channelId == null) { + throw new ApiException(400, "Missing the required parameter 'channelId' when calling getChannelItems"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Channels/{channelId}/Items".replace("{channelId}", + ApiClient.urlEncode(channelId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "folderId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("folderId", folderId)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "filters"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "filters", filters)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available channels. + * + * @param userId User Id to filter by. Use System.Guid.Empty to not filter by user. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param supportsLatestItems Optional. Filter by channels that support getting latest items. (optional) + * @param supportsMediaDeletion Optional. Filter by channels that support media deletion. (optional) + * @param isFavorite Optional. Filter by channels that are favorite. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getChannels(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean supportsLatestItems, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaDeletion, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite) throws ApiException { + return getChannels(userId, startIndex, limit, supportsLatestItems, supportsMediaDeletion, isFavorite, null); + } + + /** + * Gets available channels. + * + * @param userId User Id to filter by. Use System.Guid.Empty to not filter by user. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param supportsLatestItems Optional. Filter by channels that support getting latest items. (optional) + * @param supportsMediaDeletion Optional. Filter by channels that support media deletion. (optional) + * @param isFavorite Optional. Filter by channels that are favorite. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getChannels(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean supportsLatestItems, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaDeletion, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, Map headers) throws ApiException { + ApiResponse localVarResponse = getChannelsWithHttpInfo(userId, startIndex, limit, + supportsLatestItems, supportsMediaDeletion, isFavorite, headers); + return localVarResponse.getData(); + } + + /** + * Gets available channels. + * + * @param userId User Id to filter by. Use System.Guid.Empty to not filter by user. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param supportsLatestItems Optional. Filter by channels that support getting latest items. (optional) + * @param supportsMediaDeletion Optional. Filter by channels that support media deletion. (optional) + * @param isFavorite Optional. Filter by channels that are favorite. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean supportsLatestItems, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaDeletion, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite) throws ApiException { + return getChannelsWithHttpInfo(userId, startIndex, limit, supportsLatestItems, supportsMediaDeletion, + isFavorite, null); + } + + /** + * Gets available channels. + * + * @param userId User Id to filter by. Use System.Guid.Empty to not filter by user. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param supportsLatestItems Optional. Filter by channels that support getting latest items. (optional) + * @param supportsMediaDeletion Optional. Filter by channels that support media deletion. (optional) + * @param isFavorite Optional. Filter by channels that are favorite. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean supportsLatestItems, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaDeletion, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getChannelsRequestBuilder(userId, startIndex, limit, + supportsLatestItems, supportsMediaDeletion, isFavorite, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getChannels", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getChannelsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean supportsLatestItems, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaDeletion, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Channels"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "supportsLatestItems"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("supportsLatestItems", supportsLatestItems)); + localVarQueryParameterBaseName = "supportsMediaDeletion"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("supportsMediaDeletion", supportsMediaDeletion)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets latest channel items. + * + * @param userId Optional. User Id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param channelIds Optional. Specify one or more channel id's, comma delimited. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getLatestChannelItems(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List channelIds) throws ApiException { + return getLatestChannelItems(userId, startIndex, limit, filters, fields, channelIds, null); + } + + /** + * Gets latest channel items. + * + * @param userId Optional. User Id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param channelIds Optional. Specify one or more channel id's, comma delimited. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getLatestChannelItems(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List channelIds, Map headers) + throws ApiException { + ApiResponse localVarResponse = getLatestChannelItemsWithHttpInfo(userId, startIndex, + limit, filters, fields, channelIds, headers); + return localVarResponse.getData(); + } + + /** + * Gets latest channel items. + * + * @param userId Optional. User Id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param channelIds Optional. Specify one or more channel id's, comma delimited. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLatestChannelItemsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List channelIds) throws ApiException { + return getLatestChannelItemsWithHttpInfo(userId, startIndex, limit, filters, fields, channelIds, null); + } + + /** + * Gets latest channel items. + * + * @param userId Optional. User Id. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param channelIds Optional. Specify one or more channel id's, comma delimited. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLatestChannelItemsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List channelIds, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLatestChannelItemsRequestBuilder(userId, startIndex, limit, + filters, fields, channelIds, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLatestChannelItems", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLatestChannelItemsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List channelIds, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Channels/Items/Latest"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "filters"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "filters", filters)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "channelIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "channelIds", channelIds)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ClientLogApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ClientLogApi.java new file mode 100644 index 0000000000000..0f07073c9e6eb --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ClientLogApi.java @@ -0,0 +1,256 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.Map; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ClientLogDocumentResponseDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ClientLogApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ClientLogApi() { + this(Configuration.getDefaultApiClient()); + } + + public ClientLogApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Upload a document. + * + * @param body (optional) + * @return ClientLogDocumentResponseDto + * @throws ApiException if fails to make API call + */ + public ClientLogDocumentResponseDto logFile(@org.eclipse.jdt.annotation.NonNull File body) throws ApiException { + return logFile(body, null); + } + + /** + * Upload a document. + * + * @param body (optional) + * @param headers Optional headers to include in the request + * @return ClientLogDocumentResponseDto + * @throws ApiException if fails to make API call + */ + public ClientLogDocumentResponseDto logFile(@org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + ApiResponse localVarResponse = logFileWithHttpInfo(body, headers); + return localVarResponse.getData(); + } + + /** + * Upload a document. + * + * @param body (optional) + * @return ApiResponse<ClientLogDocumentResponseDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse logFileWithHttpInfo(@org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + return logFileWithHttpInfo(body, null); + } + + /** + * Upload a document. + * + * @param body (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<ClientLogDocumentResponseDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse logFileWithHttpInfo(@org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = logFileRequestBuilder(body, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("logFile", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + ClientLogDocumentResponseDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder logFileRequestBuilder(@org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/ClientLog/Document"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "text/plain"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/CollectionApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/CollectionApi.java new file mode 100644 index 0000000000000..13573a312d193 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/CollectionApi.java @@ -0,0 +1,545 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.CollectionCreationResult; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class CollectionApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public CollectionApi() { + this(Configuration.getDefaultApiClient()); + } + + public CollectionApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Adds items to a collection. + * + * @param collectionId The collection id. (required) + * @param ids Item ids, comma delimited. (required) + * @throws ApiException if fails to make API call + */ + public void addToCollection(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { + addToCollection(collectionId, ids, null); + } + + /** + * Adds items to a collection. + * + * @param collectionId The collection id. (required) + * @param ids Item ids, comma delimited. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void addToCollection(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids, Map headers) throws ApiException { + addToCollectionWithHttpInfo(collectionId, ids, headers); + } + + /** + * Adds items to a collection. + * + * @param collectionId The collection id. (required) + * @param ids Item ids, comma delimited. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addToCollectionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { + return addToCollectionWithHttpInfo(collectionId, ids, null); + } + + /** + * Adds items to a collection. + * + * @param collectionId The collection id. (required) + * @param ids Item ids, comma delimited. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addToCollectionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addToCollectionRequestBuilder(collectionId, ids, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("addToCollection", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder addToCollectionRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids, Map headers) throws ApiException { + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new ApiException(400, "Missing the required parameter 'collectionId' when calling addToCollection"); + } + // verify the required parameter 'ids' is set + if (ids == null) { + throw new ApiException(400, "Missing the required parameter 'ids' when calling addToCollection"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Collections/{collectionId}/Items".replace("{collectionId}", + ApiClient.urlEncode(collectionId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates a new collection. + * + * @param name The name of the collection. (optional) + * @param ids Item Ids to add to the collection. (optional) + * @param parentId Optional. Create the collection within a specific folder. (optional) + * @param isLocked Whether or not to lock the new collection. (optional, default to false) + * @return CollectionCreationResult + * @throws ApiException if fails to make API call + */ + public CollectionCreationResult createCollection(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked) throws ApiException { + return createCollection(name, ids, parentId, isLocked, null); + } + + /** + * Creates a new collection. + * + * @param name The name of the collection. (optional) + * @param ids Item Ids to add to the collection. (optional) + * @param parentId Optional. Create the collection within a specific folder. (optional) + * @param isLocked Whether or not to lock the new collection. (optional, default to false) + * @param headers Optional headers to include in the request + * @return CollectionCreationResult + * @throws ApiException if fails to make API call + */ + public CollectionCreationResult createCollection(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, Map headers) throws ApiException { + ApiResponse localVarResponse = createCollectionWithHttpInfo(name, ids, parentId, + isLocked, headers); + return localVarResponse.getData(); + } + + /** + * Creates a new collection. + * + * @param name The name of the collection. (optional) + * @param ids Item Ids to add to the collection. (optional) + * @param parentId Optional. Create the collection within a specific folder. (optional) + * @param isLocked Whether or not to lock the new collection. (optional, default to false) + * @return ApiResponse<CollectionCreationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse createCollectionWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean isLocked) + throws ApiException { + return createCollectionWithHttpInfo(name, ids, parentId, isLocked, null); + } + + /** + * Creates a new collection. + * + * @param name The name of the collection. (optional) + * @param ids Item Ids to add to the collection. (optional) + * @param parentId Optional. Create the collection within a specific folder. (optional) + * @param isLocked Whether or not to lock the new collection. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<CollectionCreationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse createCollectionWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createCollectionRequestBuilder(name, ids, parentId, isLocked, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createCollection", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + CollectionCreationResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createCollectionRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Collections"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "isLocked"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isLocked", isLocked)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Removes items from a collection. + * + * @param collectionId The collection id. (required) + * @param ids Item ids, comma delimited. (required) + * @throws ApiException if fails to make API call + */ + public void removeFromCollection(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { + removeFromCollection(collectionId, ids, null); + } + + /** + * Removes items from a collection. + * + * @param collectionId The collection id. (required) + * @param ids Item ids, comma delimited. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void removeFromCollection(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids, Map headers) throws ApiException { + removeFromCollectionWithHttpInfo(collectionId, ids, headers); + } + + /** + * Removes items from a collection. + * + * @param collectionId The collection id. (required) + * @param ids Item ids, comma delimited. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeFromCollectionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { + return removeFromCollectionWithHttpInfo(collectionId, ids, null); + } + + /** + * Removes items from a collection. + * + * @param collectionId The collection id. (required) + * @param ids Item ids, comma delimited. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeFromCollectionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID collectionId, + @org.eclipse.jdt.annotation.Nullable List ids, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeFromCollectionRequestBuilder(collectionId, ids, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("removeFromCollection", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder removeFromCollectionRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID collectionId, @org.eclipse.jdt.annotation.Nullable List ids, + Map headers) throws ApiException { + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new ApiException(400, + "Missing the required parameter 'collectionId' when calling removeFromCollection"); + } + // verify the required parameter 'ids' is set + if (ids == null) { + throw new ApiException(400, "Missing the required parameter 'ids' when calling removeFromCollection"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Collections/{collectionId}/Items".replace("{collectionId}", + ApiClient.urlEncode(collectionId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ConfigurationApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ConfigurationApi.java new file mode 100644 index 0000000000000..368f56f3e3713 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ConfigurationApi.java @@ -0,0 +1,787 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.Map; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.MediaEncoderPathDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.MetadataOptions; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ServerConfiguration; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ConfigurationApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ConfigurationApi() { + this(Configuration.getDefaultApiClient()); + } + + public ConfigurationApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets application configuration. + * + * @return ServerConfiguration + * @throws ApiException if fails to make API call + */ + public ServerConfiguration getConfiguration() throws ApiException { + return getConfiguration(null); + } + + /** + * Gets application configuration. + * + * @param headers Optional headers to include in the request + * @return ServerConfiguration + * @throws ApiException if fails to make API call + */ + public ServerConfiguration getConfiguration(Map headers) throws ApiException { + ApiResponse localVarResponse = getConfigurationWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets application configuration. + * + * @return ApiResponse<ServerConfiguration> + * @throws ApiException if fails to make API call + */ + public ApiResponse getConfigurationWithHttpInfo() throws ApiException { + return getConfigurationWithHttpInfo(null); + } + + /** + * Gets application configuration. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<ServerConfiguration> + * @throws ApiException if fails to make API call + */ + public ApiResponse getConfigurationWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getConfigurationRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getConfiguration", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + ServerConfiguration responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getConfigurationRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Configuration"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a default MetadataOptions object. + * + * @return MetadataOptions + * @throws ApiException if fails to make API call + */ + public MetadataOptions getDefaultMetadataOptions() throws ApiException { + return getDefaultMetadataOptions(null); + } + + /** + * Gets a default MetadataOptions object. + * + * @param headers Optional headers to include in the request + * @return MetadataOptions + * @throws ApiException if fails to make API call + */ + public MetadataOptions getDefaultMetadataOptions(Map headers) throws ApiException { + ApiResponse localVarResponse = getDefaultMetadataOptionsWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets a default MetadataOptions object. + * + * @return ApiResponse<MetadataOptions> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultMetadataOptionsWithHttpInfo() throws ApiException { + return getDefaultMetadataOptionsWithHttpInfo(null); + } + + /** + * Gets a default MetadataOptions object. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<MetadataOptions> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultMetadataOptionsWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDefaultMetadataOptionsRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDefaultMetadataOptions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + MetadataOptions responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDefaultMetadataOptionsRequestBuilder(Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Configuration/MetadataOptions/Default"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a named configuration. + * + * @param key Configuration key. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getNamedConfiguration(@org.eclipse.jdt.annotation.Nullable String key) throws ApiException { + return getNamedConfiguration(key, null); + } + + /** + * Gets a named configuration. + * + * @param key Configuration key. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getNamedConfiguration(@org.eclipse.jdt.annotation.Nullable String key, Map headers) + throws ApiException { + ApiResponse localVarResponse = getNamedConfigurationWithHttpInfo(key, headers); + return localVarResponse.getData(); + } + + /** + * Gets a named configuration. + * + * @param key Configuration key. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getNamedConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String key) + throws ApiException { + return getNamedConfigurationWithHttpInfo(key, null); + } + + /** + * Gets a named configuration. + * + * @param key Configuration key. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getNamedConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String key, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getNamedConfigurationRequestBuilder(key, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getNamedConfiguration", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getNamedConfigurationRequestBuilder(@org.eclipse.jdt.annotation.Nullable String key, + Map headers) throws ApiException { + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException(400, "Missing the required parameter 'key' when calling getNamedConfiguration"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Configuration/{key}".replace("{key}", ApiClient.urlEncode(key.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates application configuration. + * + * @param serverConfiguration Configuration. (required) + * @throws ApiException if fails to make API call + */ + public void updateConfiguration(@org.eclipse.jdt.annotation.Nullable ServerConfiguration serverConfiguration) + throws ApiException { + updateConfiguration(serverConfiguration, null); + } + + /** + * Updates application configuration. + * + * @param serverConfiguration Configuration. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateConfiguration(@org.eclipse.jdt.annotation.Nullable ServerConfiguration serverConfiguration, + Map headers) throws ApiException { + updateConfigurationWithHttpInfo(serverConfiguration, headers); + } + + /** + * Updates application configuration. + * + * @param serverConfiguration Configuration. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateConfigurationWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ServerConfiguration serverConfiguration) throws ApiException { + return updateConfigurationWithHttpInfo(serverConfiguration, null); + } + + /** + * Updates application configuration. + * + * @param serverConfiguration Configuration. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateConfigurationWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ServerConfiguration serverConfiguration, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateConfigurationRequestBuilder(serverConfiguration, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateConfiguration", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateConfigurationRequestBuilder( + @org.eclipse.jdt.annotation.Nullable ServerConfiguration serverConfiguration, Map headers) + throws ApiException { + // verify the required parameter 'serverConfiguration' is set + if (serverConfiguration == null) { + throw new ApiException(400, + "Missing the required parameter 'serverConfiguration' when calling updateConfiguration"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Configuration"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(serverConfiguration); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates the path to the media encoder. + * + * @param mediaEncoderPathDto Media encoder path form body. (required) + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public void updateMediaEncoderPath(@org.eclipse.jdt.annotation.Nullable MediaEncoderPathDto mediaEncoderPathDto) + throws ApiException { + updateMediaEncoderPath(mediaEncoderPathDto, null); + } + + /** + * Updates the path to the media encoder. + * + * @param mediaEncoderPathDto Media encoder path form body. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public void updateMediaEncoderPath(@org.eclipse.jdt.annotation.Nullable MediaEncoderPathDto mediaEncoderPathDto, + Map headers) throws ApiException { + updateMediaEncoderPathWithHttpInfo(mediaEncoderPathDto, headers); + } + + /** + * Updates the path to the media encoder. + * + * @param mediaEncoderPathDto Media encoder path form body. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse updateMediaEncoderPathWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MediaEncoderPathDto mediaEncoderPathDto) throws ApiException { + return updateMediaEncoderPathWithHttpInfo(mediaEncoderPathDto, null); + } + + /** + * Updates the path to the media encoder. + * + * @param mediaEncoderPathDto Media encoder path form body. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse updateMediaEncoderPathWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MediaEncoderPathDto mediaEncoderPathDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateMediaEncoderPathRequestBuilder(mediaEncoderPathDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateMediaEncoderPath", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateMediaEncoderPathRequestBuilder( + @org.eclipse.jdt.annotation.Nullable MediaEncoderPathDto mediaEncoderPathDto, Map headers) + throws ApiException { + // verify the required parameter 'mediaEncoderPathDto' is set + if (mediaEncoderPathDto == null) { + throw new ApiException(400, + "Missing the required parameter 'mediaEncoderPathDto' when calling updateMediaEncoderPath"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/MediaEncoder/Path"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(mediaEncoderPathDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates named configuration. + * + * @param key Configuration key. (required) + * @param body Configuration. (required) + * @throws ApiException if fails to make API call + */ + public void updateNamedConfiguration(@org.eclipse.jdt.annotation.Nullable String key, + @org.eclipse.jdt.annotation.Nullable Object body) throws ApiException { + updateNamedConfiguration(key, body, null); + } + + /** + * Updates named configuration. + * + * @param key Configuration key. (required) + * @param body Configuration. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateNamedConfiguration(@org.eclipse.jdt.annotation.Nullable String key, + @org.eclipse.jdt.annotation.Nullable Object body, Map headers) throws ApiException { + updateNamedConfigurationWithHttpInfo(key, body, headers); + } + + /** + * Updates named configuration. + * + * @param key Configuration key. (required) + * @param body Configuration. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateNamedConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String key, + @org.eclipse.jdt.annotation.Nullable Object body) throws ApiException { + return updateNamedConfigurationWithHttpInfo(key, body, null); + } + + /** + * Updates named configuration. + * + * @param key Configuration key. (required) + * @param body Configuration. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateNamedConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String key, + @org.eclipse.jdt.annotation.Nullable Object body, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateNamedConfigurationRequestBuilder(key, body, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateNamedConfiguration", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateNamedConfigurationRequestBuilder(@org.eclipse.jdt.annotation.Nullable String key, + @org.eclipse.jdt.annotation.Nullable Object body, Map headers) throws ApiException { + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException(400, "Missing the required parameter 'key' when calling updateNamedConfiguration"); + } + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling updateNamedConfiguration"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Configuration/{key}".replace("{key}", ApiClient.urlEncode(key.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DashboardApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DashboardApi.java new file mode 100644 index 0000000000000..22303878ba7cf --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DashboardApi.java @@ -0,0 +1,392 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ConfigurationPageInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DashboardApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public DashboardApi() { + this(Configuration.getDefaultApiClient()); + } + + public DashboardApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets the configuration pages. + * + * @param enableInMainMenu Whether to enable in the main menu. (optional) + * @return List<ConfigurationPageInfo> + * @throws ApiException if fails to make API call + */ + public List getConfigurationPages( + @org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu) throws ApiException { + return getConfigurationPages(enableInMainMenu, null); + } + + /** + * Gets the configuration pages. + * + * @param enableInMainMenu Whether to enable in the main menu. (optional) + * @param headers Optional headers to include in the request + * @return List<ConfigurationPageInfo> + * @throws ApiException if fails to make API call + */ + public List getConfigurationPages( + @org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu, Map headers) + throws ApiException { + ApiResponse> localVarResponse = getConfigurationPagesWithHttpInfo(enableInMainMenu, + headers); + return localVarResponse.getData(); + } + + /** + * Gets the configuration pages. + * + * @param enableInMainMenu Whether to enable in the main menu. (optional) + * @return ApiResponse<List<ConfigurationPageInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getConfigurationPagesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu) throws ApiException { + return getConfigurationPagesWithHttpInfo(enableInMainMenu, null); + } + + /** + * Gets the configuration pages. + * + * @param enableInMainMenu Whether to enable in the main menu. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<ConfigurationPageInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getConfigurationPagesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getConfigurationPagesRequestBuilder(enableInMainMenu, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getConfigurationPages", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getConfigurationPagesRequestBuilder( + @org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/web/ConfigurationPages"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "enableInMainMenu"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableInMainMenu", enableInMainMenu)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a dashboard configuration page. + * + * @param name The name of the page. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getDashboardConfigurationPage(@org.eclipse.jdt.annotation.NonNull String name) throws ApiException { + return getDashboardConfigurationPage(name, null); + } + + /** + * Gets a dashboard configuration page. + * + * @param name The name of the page. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getDashboardConfigurationPage(@org.eclipse.jdt.annotation.NonNull String name, + Map headers) throws ApiException { + ApiResponse localVarResponse = getDashboardConfigurationPageWithHttpInfo(name, headers); + return localVarResponse.getData(); + } + + /** + * Gets a dashboard configuration page. + * + * @param name The name of the page. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDashboardConfigurationPageWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name) + throws ApiException { + return getDashboardConfigurationPageWithHttpInfo(name, null); + } + + /** + * Gets a dashboard configuration page. + * + * @param name The name of the page. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDashboardConfigurationPageWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDashboardConfigurationPageRequestBuilder(name, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDashboardConfigurationPage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDashboardConfigurationPageRequestBuilder( + @org.eclipse.jdt.annotation.NonNull String name, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/web/ConfigurationPage"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "text/html, application/x-javascript, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DevicesApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DevicesApi.java new file mode 100644 index 0000000000000..60e6efc1aeea5 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DevicesApi.java @@ -0,0 +1,777 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.DeviceInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.DeviceInfoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.DeviceOptions; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.DeviceOptionsDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DevicesApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public DevicesApi() { + this(Configuration.getDefaultApiClient()); + } + + public DevicesApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Deletes a device. + * + * @param id Device Id. (required) + * @throws ApiException if fails to make API call + */ + public void deleteDevice(@org.eclipse.jdt.annotation.Nullable String id) throws ApiException { + deleteDevice(id, null); + } + + /** + * Deletes a device. + * + * @param id Device Id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteDevice(@org.eclipse.jdt.annotation.Nullable String id, Map headers) + throws ApiException { + deleteDeviceWithHttpInfo(id, headers); + } + + /** + * Deletes a device. + * + * @param id Device Id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteDeviceWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id) + throws ApiException { + return deleteDeviceWithHttpInfo(id, null); + } + + /** + * Deletes a device. + * + * @param id Device Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteDeviceWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteDeviceRequestBuilder(id, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteDevice", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteDeviceRequestBuilder(@org.eclipse.jdt.annotation.Nullable String id, + Map headers) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling deleteDevice"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Devices"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get info for a device. + * + * @param id Device Id. (required) + * @return DeviceInfo + * @throws ApiException if fails to make API call + */ + public DeviceInfo getDeviceInfo(@org.eclipse.jdt.annotation.Nullable String id) throws ApiException { + return getDeviceInfo(id, null); + } + + /** + * Get info for a device. + * + * @param id Device Id. (required) + * @param headers Optional headers to include in the request + * @return DeviceInfo + * @throws ApiException if fails to make API call + */ + public DeviceInfo getDeviceInfo(@org.eclipse.jdt.annotation.Nullable String id, Map headers) + throws ApiException { + ApiResponse localVarResponse = getDeviceInfoWithHttpInfo(id, headers); + return localVarResponse.getData(); + } + + /** + * Get info for a device. + * + * @param id Device Id. (required) + * @return ApiResponse<DeviceInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDeviceInfoWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id) + throws ApiException { + return getDeviceInfoWithHttpInfo(id, null); + } + + /** + * Get info for a device. + * + * @param id Device Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<DeviceInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDeviceInfoWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDeviceInfoRequestBuilder(id, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDeviceInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + DeviceInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDeviceInfoRequestBuilder(@org.eclipse.jdt.annotation.Nullable String id, + Map headers) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getDeviceInfo"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Devices/Info"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get options for a device. + * + * @param id Device Id. (required) + * @return DeviceOptions + * @throws ApiException if fails to make API call + */ + public DeviceOptions getDeviceOptions(@org.eclipse.jdt.annotation.Nullable String id) throws ApiException { + return getDeviceOptions(id, null); + } + + /** + * Get options for a device. + * + * @param id Device Id. (required) + * @param headers Optional headers to include in the request + * @return DeviceOptions + * @throws ApiException if fails to make API call + */ + public DeviceOptions getDeviceOptions(@org.eclipse.jdt.annotation.Nullable String id, Map headers) + throws ApiException { + ApiResponse localVarResponse = getDeviceOptionsWithHttpInfo(id, headers); + return localVarResponse.getData(); + } + + /** + * Get options for a device. + * + * @param id Device Id. (required) + * @return ApiResponse<DeviceOptions> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDeviceOptionsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id) + throws ApiException { + return getDeviceOptionsWithHttpInfo(id, null); + } + + /** + * Get options for a device. + * + * @param id Device Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<DeviceOptions> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDeviceOptionsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDeviceOptionsRequestBuilder(id, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDeviceOptions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + DeviceOptions responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDeviceOptionsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String id, + Map headers) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getDeviceOptions"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Devices/Options"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get Devices. + * + * @param supportsSync Gets or sets a value indicating whether [supports synchronize]. (optional) + * @param userId Gets or sets the user identifier. (optional) + * @return DeviceInfoQueryResult + * @throws ApiException if fails to make API call + */ + public DeviceInfoQueryResult getDevices(@org.eclipse.jdt.annotation.NonNull Boolean supportsSync, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getDevices(supportsSync, userId, null); + } + + /** + * Get Devices. + * + * @param supportsSync Gets or sets a value indicating whether [supports synchronize]. (optional) + * @param userId Gets or sets the user identifier. (optional) + * @param headers Optional headers to include in the request + * @return DeviceInfoQueryResult + * @throws ApiException if fails to make API call + */ + public DeviceInfoQueryResult getDevices(@org.eclipse.jdt.annotation.NonNull Boolean supportsSync, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getDevicesWithHttpInfo(supportsSync, userId, headers); + return localVarResponse.getData(); + } + + /** + * Get Devices. + * + * @param supportsSync Gets or sets a value indicating whether [supports synchronize]. (optional) + * @param userId Gets or sets the user identifier. (optional) + * @return ApiResponse<DeviceInfoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDevicesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean supportsSync, @org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + return getDevicesWithHttpInfo(supportsSync, userId, null); + } + + /** + * Get Devices. + * + * @param supportsSync Gets or sets a value indicating whether [supports synchronize]. (optional) + * @param userId Gets or sets the user identifier. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<DeviceInfoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDevicesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean supportsSync, @org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDevicesRequestBuilder(supportsSync, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDevices", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + DeviceInfoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDevicesRequestBuilder(@org.eclipse.jdt.annotation.NonNull Boolean supportsSync, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Devices"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "supportsSync"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("supportsSync", supportsSync)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update device options. + * + * @param id Device Id. (required) + * @param deviceOptionsDto Device Options. (required) + * @throws ApiException if fails to make API call + */ + public void updateDeviceOptions(@org.eclipse.jdt.annotation.Nullable String id, + @org.eclipse.jdt.annotation.Nullable DeviceOptionsDto deviceOptionsDto) throws ApiException { + updateDeviceOptions(id, deviceOptionsDto, null); + } + + /** + * Update device options. + * + * @param id Device Id. (required) + * @param deviceOptionsDto Device Options. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateDeviceOptions(@org.eclipse.jdt.annotation.Nullable String id, + @org.eclipse.jdt.annotation.Nullable DeviceOptionsDto deviceOptionsDto, Map headers) + throws ApiException { + updateDeviceOptionsWithHttpInfo(id, deviceOptionsDto, headers); + } + + /** + * Update device options. + * + * @param id Device Id. (required) + * @param deviceOptionsDto Device Options. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateDeviceOptionsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id, + @org.eclipse.jdt.annotation.Nullable DeviceOptionsDto deviceOptionsDto) throws ApiException { + return updateDeviceOptionsWithHttpInfo(id, deviceOptionsDto, null); + } + + /** + * Update device options. + * + * @param id Device Id. (required) + * @param deviceOptionsDto Device Options. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateDeviceOptionsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id, + @org.eclipse.jdt.annotation.Nullable DeviceOptionsDto deviceOptionsDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateDeviceOptionsRequestBuilder(id, deviceOptionsDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateDeviceOptions", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateDeviceOptionsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String id, + @org.eclipse.jdt.annotation.Nullable DeviceOptionsDto deviceOptionsDto, Map headers) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling updateDeviceOptions"); + } + // verify the required parameter 'deviceOptionsDto' is set + if (deviceOptionsDto == null) { + throw new ApiException(400, + "Missing the required parameter 'deviceOptionsDto' when calling updateDeviceOptions"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Devices/Options"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(deviceOptionsDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DisplayPreferencesApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DisplayPreferencesApi.java new file mode 100644 index 0000000000000..1baf19af80ce9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DisplayPreferencesApi.java @@ -0,0 +1,467 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.DisplayPreferencesDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DisplayPreferencesApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public DisplayPreferencesApi() { + this(Configuration.getDefaultApiClient()); + } + + public DisplayPreferencesApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Get Display Preferences. + * + * @param displayPreferencesId Display preferences id. (required) + * @param userId User id. (required) + * @param client Client. (required) + * @return DisplayPreferencesDto + * @throws ApiException if fails to make API call + */ + public DisplayPreferencesDto getDisplayPreferences(@org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable String client) + throws ApiException { + return getDisplayPreferences(displayPreferencesId, userId, client, null); + } + + /** + * Get Display Preferences. + * + * @param displayPreferencesId Display preferences id. (required) + * @param userId User id. (required) + * @param client Client. (required) + * @param headers Optional headers to include in the request + * @return DisplayPreferencesDto + * @throws ApiException if fails to make API call + */ + public DisplayPreferencesDto getDisplayPreferences(@org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable String client, + Map headers) throws ApiException { + ApiResponse localVarResponse = getDisplayPreferencesWithHttpInfo(displayPreferencesId, + userId, client, headers); + return localVarResponse.getData(); + } + + /** + * Get Display Preferences. + * + * @param displayPreferencesId Display preferences id. (required) + * @param userId User id. (required) + * @param client Client. (required) + * @return ApiResponse<DisplayPreferencesDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDisplayPreferencesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable String client) + throws ApiException { + return getDisplayPreferencesWithHttpInfo(displayPreferencesId, userId, client, null); + } + + /** + * Get Display Preferences. + * + * @param displayPreferencesId Display preferences id. (required) + * @param userId User id. (required) + * @param client Client. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<DisplayPreferencesDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDisplayPreferencesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable String client, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDisplayPreferencesRequestBuilder(displayPreferencesId, userId, + client, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDisplayPreferences", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + DisplayPreferencesDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDisplayPreferencesRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable String client, + Map headers) throws ApiException { + // verify the required parameter 'displayPreferencesId' is set + if (displayPreferencesId == null) { + throw new ApiException(400, + "Missing the required parameter 'displayPreferencesId' when calling getDisplayPreferences"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getDisplayPreferences"); + } + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling getDisplayPreferences"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/DisplayPreferences/{displayPreferencesId}".replace("{displayPreferencesId}", + ApiClient.urlEncode(displayPreferencesId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "client"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("client", client)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update Display Preferences. + * + * @param displayPreferencesId Display preferences id. (required) + * @param userId User Id. (required) + * @param client Client. (required) + * @param displayPreferencesDto New Display Preferences object. (required) + * @throws ApiException if fails to make API call + */ + public void updateDisplayPreferences(@org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable String client, + @org.eclipse.jdt.annotation.Nullable DisplayPreferencesDto displayPreferencesDto) throws ApiException { + updateDisplayPreferences(displayPreferencesId, userId, client, displayPreferencesDto, null); + } + + /** + * Update Display Preferences. + * + * @param displayPreferencesId Display preferences id. (required) + * @param userId User Id. (required) + * @param client Client. (required) + * @param displayPreferencesDto New Display Preferences object. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateDisplayPreferences(@org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable String client, + @org.eclipse.jdt.annotation.Nullable DisplayPreferencesDto displayPreferencesDto, + Map headers) throws ApiException { + updateDisplayPreferencesWithHttpInfo(displayPreferencesId, userId, client, displayPreferencesDto, headers); + } + + /** + * Update Display Preferences. + * + * @param displayPreferencesId Display preferences id. (required) + * @param userId User Id. (required) + * @param client Client. (required) + * @param displayPreferencesDto New Display Preferences object. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateDisplayPreferencesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable String client, + @org.eclipse.jdt.annotation.Nullable DisplayPreferencesDto displayPreferencesDto) throws ApiException { + return updateDisplayPreferencesWithHttpInfo(displayPreferencesId, userId, client, displayPreferencesDto, null); + } + + /** + * Update Display Preferences. + * + * @param displayPreferencesId Display preferences id. (required) + * @param userId User Id. (required) + * @param client Client. (required) + * @param displayPreferencesDto New Display Preferences object. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateDisplayPreferencesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable String client, + @org.eclipse.jdt.annotation.Nullable DisplayPreferencesDto displayPreferencesDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateDisplayPreferencesRequestBuilder(displayPreferencesId, + userId, client, displayPreferencesDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateDisplayPreferences", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateDisplayPreferencesRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String displayPreferencesId, + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable String client, + @org.eclipse.jdt.annotation.Nullable DisplayPreferencesDto displayPreferencesDto, + Map headers) throws ApiException { + // verify the required parameter 'displayPreferencesId' is set + if (displayPreferencesId == null) { + throw new ApiException(400, + "Missing the required parameter 'displayPreferencesId' when calling updateDisplayPreferences"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, + "Missing the required parameter 'userId' when calling updateDisplayPreferences"); + } + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, + "Missing the required parameter 'client' when calling updateDisplayPreferences"); + } + // verify the required parameter 'displayPreferencesDto' is set + if (displayPreferencesDto == null) { + throw new ApiException(400, + "Missing the required parameter 'displayPreferencesDto' when calling updateDisplayPreferences"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/DisplayPreferences/{displayPreferencesId}".replace("{displayPreferencesId}", + ApiClient.urlEncode(displayPreferencesId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "client"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("client", client)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(displayPreferencesDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DlnaApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DlnaApi.java new file mode 100644 index 0000000000000..7b52c49980c0b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DlnaApi.java @@ -0,0 +1,768 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.DeviceProfile; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.DeviceProfileInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DlnaApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public DlnaApi() { + this(Configuration.getDefaultApiClient()); + } + + public DlnaApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Creates a profile. + * + * @param deviceProfile Device profile. (optional) + * @throws ApiException if fails to make API call + */ + public void createProfile(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) throws ApiException { + createProfile(deviceProfile, null); + } + + /** + * Creates a profile. + * + * @param deviceProfile Device profile. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void createProfile(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile, + Map headers) throws ApiException { + createProfileWithHttpInfo(deviceProfile, headers); + } + + /** + * Creates a profile. + * + * @param deviceProfile Device profile. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createProfileWithHttpInfo(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) + throws ApiException { + return createProfileWithHttpInfo(deviceProfile, null); + } + + /** + * Creates a profile. + * + * @param deviceProfile Device profile. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createProfileWithHttpInfo(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createProfileRequestBuilder(deviceProfile, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createProfile", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createProfileRequestBuilder( + @org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/Profiles"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(deviceProfile); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Deletes a profile. + * + * @param profileId Profile id. (required) + * @throws ApiException if fails to make API call + */ + public void deleteProfile(@org.eclipse.jdt.annotation.Nullable String profileId) throws ApiException { + deleteProfile(profileId, null); + } + + /** + * Deletes a profile. + * + * @param profileId Profile id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteProfile(@org.eclipse.jdt.annotation.Nullable String profileId, Map headers) + throws ApiException { + deleteProfileWithHttpInfo(profileId, headers); + } + + /** + * Deletes a profile. + * + * @param profileId Profile id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteProfileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String profileId) + throws ApiException { + return deleteProfileWithHttpInfo(profileId, null); + } + + /** + * Deletes a profile. + * + * @param profileId Profile id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteProfileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String profileId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteProfileRequestBuilder(profileId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteProfile", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteProfileRequestBuilder(@org.eclipse.jdt.annotation.Nullable String profileId, + Map headers) throws ApiException { + // verify the required parameter 'profileId' is set + if (profileId == null) { + throw new ApiException(400, "Missing the required parameter 'profileId' when calling deleteProfile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/Profiles/{profileId}".replace("{profileId}", + ApiClient.urlEncode(profileId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the default profile. + * + * @return DeviceProfile + * @throws ApiException if fails to make API call + */ + public DeviceProfile getDefaultProfile() throws ApiException { + return getDefaultProfile(null); + } + + /** + * Gets the default profile. + * + * @param headers Optional headers to include in the request + * @return DeviceProfile + * @throws ApiException if fails to make API call + */ + public DeviceProfile getDefaultProfile(Map headers) throws ApiException { + ApiResponse localVarResponse = getDefaultProfileWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets the default profile. + * + * @return ApiResponse<DeviceProfile> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultProfileWithHttpInfo() throws ApiException { + return getDefaultProfileWithHttpInfo(null); + } + + /** + * Gets the default profile. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<DeviceProfile> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultProfileWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDefaultProfileRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDefaultProfile", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + DeviceProfile responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDefaultProfileRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/Profiles/Default"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a single profile. + * + * @param profileId Profile Id. (required) + * @return DeviceProfile + * @throws ApiException if fails to make API call + */ + public DeviceProfile getProfile(@org.eclipse.jdt.annotation.Nullable String profileId) throws ApiException { + return getProfile(profileId, null); + } + + /** + * Gets a single profile. + * + * @param profileId Profile Id. (required) + * @param headers Optional headers to include in the request + * @return DeviceProfile + * @throws ApiException if fails to make API call + */ + public DeviceProfile getProfile(@org.eclipse.jdt.annotation.Nullable String profileId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getProfileWithHttpInfo(profileId, headers); + return localVarResponse.getData(); + } + + /** + * Gets a single profile. + * + * @param profileId Profile Id. (required) + * @return ApiResponse<DeviceProfile> + * @throws ApiException if fails to make API call + */ + public ApiResponse getProfileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String profileId) + throws ApiException { + return getProfileWithHttpInfo(profileId, null); + } + + /** + * Gets a single profile. + * + * @param profileId Profile Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<DeviceProfile> + * @throws ApiException if fails to make API call + */ + public ApiResponse getProfileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String profileId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getProfileRequestBuilder(profileId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getProfile", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + DeviceProfile responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getProfileRequestBuilder(@org.eclipse.jdt.annotation.Nullable String profileId, + Map headers) throws ApiException { + // verify the required parameter 'profileId' is set + if (profileId == null) { + throw new ApiException(400, "Missing the required parameter 'profileId' when calling getProfile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/Profiles/{profileId}".replace("{profileId}", + ApiClient.urlEncode(profileId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get profile infos. + * + * @return List<DeviceProfileInfo> + * @throws ApiException if fails to make API call + */ + public List getProfileInfos() throws ApiException { + return getProfileInfos(null); + } + + /** + * Get profile infos. + * + * @param headers Optional headers to include in the request + * @return List<DeviceProfileInfo> + * @throws ApiException if fails to make API call + */ + public List getProfileInfos(Map headers) throws ApiException { + ApiResponse> localVarResponse = getProfileInfosWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Get profile infos. + * + * @return ApiResponse<List<DeviceProfileInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getProfileInfosWithHttpInfo() throws ApiException { + return getProfileInfosWithHttpInfo(null); + } + + /** + * Get profile infos. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<DeviceProfileInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getProfileInfosWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getProfileInfosRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getProfileInfos", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getProfileInfosRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/ProfileInfos"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a profile. + * + * @param profileId Profile id. (required) + * @param deviceProfile Device profile. (optional) + * @throws ApiException if fails to make API call + */ + public void updateProfile(@org.eclipse.jdt.annotation.Nullable String profileId, + @org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) throws ApiException { + updateProfile(profileId, deviceProfile, null); + } + + /** + * Updates a profile. + * + * @param profileId Profile id. (required) + * @param deviceProfile Device profile. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateProfile(@org.eclipse.jdt.annotation.Nullable String profileId, + @org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile, Map headers) + throws ApiException { + updateProfileWithHttpInfo(profileId, deviceProfile, headers); + } + + /** + * Updates a profile. + * + * @param profileId Profile id. (required) + * @param deviceProfile Device profile. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateProfileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String profileId, + @org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) throws ApiException { + return updateProfileWithHttpInfo(profileId, deviceProfile, null); + } + + /** + * Updates a profile. + * + * @param profileId Profile id. (required) + * @param deviceProfile Device profile. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateProfileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String profileId, + @org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateProfileRequestBuilder(profileId, deviceProfile, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateProfile", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateProfileRequestBuilder(@org.eclipse.jdt.annotation.Nullable String profileId, + @org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile, Map headers) + throws ApiException { + // verify the required parameter 'profileId' is set + if (profileId == null) { + throw new ApiException(400, "Missing the required parameter 'profileId' when calling updateProfile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/Profiles/{profileId}".replace("{profileId}", + ApiClient.urlEncode(profileId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(deviceProfile); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DlnaServerApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DlnaServerApi.java new file mode 100644 index 0000000000000..2da6eaf930777 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DlnaServerApi.java @@ -0,0 +1,1876 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.Map; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; + +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DlnaServerApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public DlnaServerApi() { + this(Configuration.getDefaultApiClient()); + } + + public DlnaServerApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getConnectionManager(@org.eclipse.jdt.annotation.Nullable String serverId) throws ApiException { + return getConnectionManager(serverId, null); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getConnectionManager(@org.eclipse.jdt.annotation.Nullable String serverId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getConnectionManagerWithHttpInfo(serverId, headers); + return localVarResponse.getData(); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getConnectionManagerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId) + throws ApiException { + return getConnectionManagerWithHttpInfo(serverId, null); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getConnectionManagerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getConnectionManagerRequestBuilder(serverId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getConnectionManager", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getConnectionManagerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException(400, "Missing the required parameter 'serverId' when calling getConnectionManager"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/{serverId}/ConnectionManager".replace("{serverId}", + ApiClient.urlEncode(serverId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/xml"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getConnectionManager2(@org.eclipse.jdt.annotation.Nullable String serverId) throws ApiException { + return getConnectionManager2(serverId, null); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getConnectionManager2(@org.eclipse.jdt.annotation.Nullable String serverId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getConnectionManager2WithHttpInfo(serverId, headers); + return localVarResponse.getData(); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getConnectionManager2WithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId) + throws ApiException { + return getConnectionManager2WithHttpInfo(serverId, null); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getConnectionManager2WithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getConnectionManager2RequestBuilder(serverId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getConnectionManager2", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getConnectionManager2RequestBuilder( + @org.eclipse.jdt.annotation.Nullable String serverId, Map headers) throws ApiException { + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException(400, "Missing the required parameter 'serverId' when calling getConnectionManager2"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/{serverId}/ConnectionManager/ConnectionManager".replace("{serverId}", + ApiClient.urlEncode(serverId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/xml"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getConnectionManager3(@org.eclipse.jdt.annotation.Nullable String serverId) throws ApiException { + return getConnectionManager3(serverId, null); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getConnectionManager3(@org.eclipse.jdt.annotation.Nullable String serverId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getConnectionManager3WithHttpInfo(serverId, headers); + return localVarResponse.getData(); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getConnectionManager3WithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId) + throws ApiException { + return getConnectionManager3WithHttpInfo(serverId, null); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getConnectionManager3WithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getConnectionManager3RequestBuilder(serverId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getConnectionManager3", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getConnectionManager3RequestBuilder( + @org.eclipse.jdt.annotation.Nullable String serverId, Map headers) throws ApiException { + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException(400, "Missing the required parameter 'serverId' when calling getConnectionManager3"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/{serverId}/ConnectionManager/ConnectionManager.xml".replace("{serverId}", + ApiClient.urlEncode(serverId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/xml"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets Dlna content directory xml. + * + * @param serverId Server UUID. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getContentDirectory(@org.eclipse.jdt.annotation.Nullable String serverId) throws ApiException { + return getContentDirectory(serverId, null); + } + + /** + * Gets Dlna content directory xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getContentDirectory(@org.eclipse.jdt.annotation.Nullable String serverId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getContentDirectoryWithHttpInfo(serverId, headers); + return localVarResponse.getData(); + } + + /** + * Gets Dlna content directory xml. + * + * @param serverId Server UUID. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getContentDirectoryWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId) + throws ApiException { + return getContentDirectoryWithHttpInfo(serverId, null); + } + + /** + * Gets Dlna content directory xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getContentDirectoryWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getContentDirectoryRequestBuilder(serverId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getContentDirectory", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getContentDirectoryRequestBuilder(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException(400, "Missing the required parameter 'serverId' when calling getContentDirectory"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/{serverId}/ContentDirectory".replace("{serverId}", + ApiClient.urlEncode(serverId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/xml"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets Dlna content directory xml. + * + * @param serverId Server UUID. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getContentDirectory2(@org.eclipse.jdt.annotation.Nullable String serverId) throws ApiException { + return getContentDirectory2(serverId, null); + } + + /** + * Gets Dlna content directory xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getContentDirectory2(@org.eclipse.jdt.annotation.Nullable String serverId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getContentDirectory2WithHttpInfo(serverId, headers); + return localVarResponse.getData(); + } + + /** + * Gets Dlna content directory xml. + * + * @param serverId Server UUID. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getContentDirectory2WithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId) + throws ApiException { + return getContentDirectory2WithHttpInfo(serverId, null); + } + + /** + * Gets Dlna content directory xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getContentDirectory2WithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getContentDirectory2RequestBuilder(serverId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getContentDirectory2", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getContentDirectory2RequestBuilder(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException(400, "Missing the required parameter 'serverId' when calling getContentDirectory2"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/{serverId}/ContentDirectory/ContentDirectory".replace("{serverId}", + ApiClient.urlEncode(serverId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/xml"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets Dlna content directory xml. + * + * @param serverId Server UUID. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getContentDirectory3(@org.eclipse.jdt.annotation.Nullable String serverId) throws ApiException { + return getContentDirectory3(serverId, null); + } + + /** + * Gets Dlna content directory xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getContentDirectory3(@org.eclipse.jdt.annotation.Nullable String serverId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getContentDirectory3WithHttpInfo(serverId, headers); + return localVarResponse.getData(); + } + + /** + * Gets Dlna content directory xml. + * + * @param serverId Server UUID. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getContentDirectory3WithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId) + throws ApiException { + return getContentDirectory3WithHttpInfo(serverId, null); + } + + /** + * Gets Dlna content directory xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getContentDirectory3WithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getContentDirectory3RequestBuilder(serverId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getContentDirectory3", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getContentDirectory3RequestBuilder(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException(400, "Missing the required parameter 'serverId' when calling getContentDirectory3"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/{serverId}/ContentDirectory/ContentDirectory.xml".replace("{serverId}", + ApiClient.urlEncode(serverId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/xml"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get Description Xml. + * + * @param serverId Server UUID. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getDescriptionXml(@org.eclipse.jdt.annotation.Nullable String serverId) throws ApiException { + return getDescriptionXml(serverId, null); + } + + /** + * Get Description Xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getDescriptionXml(@org.eclipse.jdt.annotation.Nullable String serverId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getDescriptionXmlWithHttpInfo(serverId, headers); + return localVarResponse.getData(); + } + + /** + * Get Description Xml. + * + * @param serverId Server UUID. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDescriptionXmlWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId) + throws ApiException { + return getDescriptionXmlWithHttpInfo(serverId, null); + } + + /** + * Get Description Xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDescriptionXmlWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDescriptionXmlRequestBuilder(serverId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDescriptionXml", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDescriptionXmlRequestBuilder(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException(400, "Missing the required parameter 'serverId' when calling getDescriptionXml"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/{serverId}/description".replace("{serverId}", + ApiClient.urlEncode(serverId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/xml"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get Description Xml. + * + * @param serverId Server UUID. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getDescriptionXml2(@org.eclipse.jdt.annotation.Nullable String serverId) throws ApiException { + return getDescriptionXml2(serverId, null); + } + + /** + * Get Description Xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getDescriptionXml2(@org.eclipse.jdt.annotation.Nullable String serverId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getDescriptionXml2WithHttpInfo(serverId, headers); + return localVarResponse.getData(); + } + + /** + * Get Description Xml. + * + * @param serverId Server UUID. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDescriptionXml2WithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId) + throws ApiException { + return getDescriptionXml2WithHttpInfo(serverId, null); + } + + /** + * Get Description Xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDescriptionXml2WithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDescriptionXml2RequestBuilder(serverId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDescriptionXml2", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDescriptionXml2RequestBuilder(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException(400, "Missing the required parameter 'serverId' when calling getDescriptionXml2"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/{serverId}/description.xml".replace("{serverId}", + ApiClient.urlEncode(serverId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/xml"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a server icon. + * + * @param fileName The icon filename. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getIcon(@org.eclipse.jdt.annotation.Nullable String fileName) throws ApiException { + return getIcon(fileName, null); + } + + /** + * Gets a server icon. + * + * @param fileName The icon filename. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getIcon(@org.eclipse.jdt.annotation.Nullable String fileName, Map headers) + throws ApiException { + ApiResponse localVarResponse = getIconWithHttpInfo(fileName, headers); + return localVarResponse.getData(); + } + + /** + * Gets a server icon. + * + * @param fileName The icon filename. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getIconWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String fileName) + throws ApiException { + return getIconWithHttpInfo(fileName, null); + } + + /** + * Gets a server icon. + * + * @param fileName The icon filename. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getIconWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String fileName, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getIconRequestBuilder(fileName, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getIcon", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getIconRequestBuilder(@org.eclipse.jdt.annotation.Nullable String fileName, + Map headers) throws ApiException { + // verify the required parameter 'fileName' is set + if (fileName == null) { + throw new ApiException(400, "Missing the required parameter 'fileName' when calling getIcon"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/icons/{fileName}".replace("{fileName}", ApiClient.urlEncode(fileName.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a server icon. + * + * @param serverId Server UUID. (required) + * @param fileName The icon filename. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getIconId(@org.eclipse.jdt.annotation.Nullable String serverId, + @org.eclipse.jdt.annotation.Nullable String fileName) throws ApiException { + return getIconId(serverId, fileName, null); + } + + /** + * Gets a server icon. + * + * @param serverId Server UUID. (required) + * @param fileName The icon filename. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getIconId(@org.eclipse.jdt.annotation.Nullable String serverId, + @org.eclipse.jdt.annotation.Nullable String fileName, Map headers) throws ApiException { + ApiResponse localVarResponse = getIconIdWithHttpInfo(serverId, fileName, headers); + return localVarResponse.getData(); + } + + /** + * Gets a server icon. + * + * @param serverId Server UUID. (required) + * @param fileName The icon filename. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getIconIdWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId, + @org.eclipse.jdt.annotation.Nullable String fileName) throws ApiException { + return getIconIdWithHttpInfo(serverId, fileName, null); + } + + /** + * Gets a server icon. + * + * @param serverId Server UUID. (required) + * @param fileName The icon filename. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getIconIdWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId, + @org.eclipse.jdt.annotation.Nullable String fileName, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getIconIdRequestBuilder(serverId, fileName, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getIconId", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getIconIdRequestBuilder(@org.eclipse.jdt.annotation.Nullable String serverId, + @org.eclipse.jdt.annotation.Nullable String fileName, Map headers) throws ApiException { + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException(400, "Missing the required parameter 'serverId' when calling getIconId"); + } + // verify the required parameter 'fileName' is set + if (fileName == null) { + throw new ApiException(400, "Missing the required parameter 'fileName' when calling getIconId"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/{serverId}/icons/{fileName}" + .replace("{serverId}", ApiClient.urlEncode(serverId.toString())) + .replace("{fileName}", ApiClient.urlEncode(fileName.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getMediaReceiverRegistrar(@org.eclipse.jdt.annotation.Nullable String serverId) throws ApiException { + return getMediaReceiverRegistrar(serverId, null); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getMediaReceiverRegistrar(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getMediaReceiverRegistrarWithHttpInfo(serverId, headers); + return localVarResponse.getData(); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMediaReceiverRegistrarWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId) + throws ApiException { + return getMediaReceiverRegistrarWithHttpInfo(serverId, null); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMediaReceiverRegistrarWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMediaReceiverRegistrarRequestBuilder(serverId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMediaReceiverRegistrar", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMediaReceiverRegistrarRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String serverId, Map headers) throws ApiException { + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException(400, + "Missing the required parameter 'serverId' when calling getMediaReceiverRegistrar"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/{serverId}/MediaReceiverRegistrar".replace("{serverId}", + ApiClient.urlEncode(serverId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/xml"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getMediaReceiverRegistrar2(@org.eclipse.jdt.annotation.Nullable String serverId) throws ApiException { + return getMediaReceiverRegistrar2(serverId, null); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getMediaReceiverRegistrar2(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getMediaReceiverRegistrar2WithHttpInfo(serverId, headers); + return localVarResponse.getData(); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMediaReceiverRegistrar2WithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String serverId) throws ApiException { + return getMediaReceiverRegistrar2WithHttpInfo(serverId, null); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMediaReceiverRegistrar2WithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String serverId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMediaReceiverRegistrar2RequestBuilder(serverId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMediaReceiverRegistrar2", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMediaReceiverRegistrar2RequestBuilder( + @org.eclipse.jdt.annotation.Nullable String serverId, Map headers) throws ApiException { + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException(400, + "Missing the required parameter 'serverId' when calling getMediaReceiverRegistrar2"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar".replace("{serverId}", + ApiClient.urlEncode(serverId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/xml"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getMediaReceiverRegistrar3(@org.eclipse.jdt.annotation.Nullable String serverId) throws ApiException { + return getMediaReceiverRegistrar3(serverId, null); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getMediaReceiverRegistrar3(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getMediaReceiverRegistrar3WithHttpInfo(serverId, headers); + return localVarResponse.getData(); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMediaReceiverRegistrar3WithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String serverId) throws ApiException { + return getMediaReceiverRegistrar3WithHttpInfo(serverId, null); + } + + /** + * Gets Dlna media receiver registrar xml. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMediaReceiverRegistrar3WithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String serverId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMediaReceiverRegistrar3RequestBuilder(serverId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMediaReceiverRegistrar3", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMediaReceiverRegistrar3RequestBuilder( + @org.eclipse.jdt.annotation.Nullable String serverId, Map headers) throws ApiException { + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException(400, + "Missing the required parameter 'serverId' when calling getMediaReceiverRegistrar3"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar.xml".replace("{serverId}", + ApiClient.urlEncode(serverId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/xml"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Process a connection manager control request. + * + * @param serverId Server UUID. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File processConnectionManagerControlRequest(@org.eclipse.jdt.annotation.Nullable String serverId) + throws ApiException { + return processConnectionManagerControlRequest(serverId, null); + } + + /** + * Process a connection manager control request. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File processConnectionManagerControlRequest(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + ApiResponse localVarResponse = processConnectionManagerControlRequestWithHttpInfo(serverId, headers); + return localVarResponse.getData(); + } + + /** + * Process a connection manager control request. + * + * @param serverId Server UUID. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse processConnectionManagerControlRequestWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String serverId) throws ApiException { + return processConnectionManagerControlRequestWithHttpInfo(serverId, null); + } + + /** + * Process a connection manager control request. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse processConnectionManagerControlRequestWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String serverId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = processConnectionManagerControlRequestRequestBuilder(serverId, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("processConnectionManagerControlRequest", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder processConnectionManagerControlRequestRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String serverId, Map headers) throws ApiException { + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException(400, + "Missing the required parameter 'serverId' when calling processConnectionManagerControlRequest"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/{serverId}/ConnectionManager/Control".replace("{serverId}", + ApiClient.urlEncode(serverId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/xml"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Process a content directory control request. + * + * @param serverId Server UUID. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File processContentDirectoryControlRequest(@org.eclipse.jdt.annotation.Nullable String serverId) + throws ApiException { + return processContentDirectoryControlRequest(serverId, null); + } + + /** + * Process a content directory control request. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File processContentDirectoryControlRequest(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + ApiResponse localVarResponse = processContentDirectoryControlRequestWithHttpInfo(serverId, headers); + return localVarResponse.getData(); + } + + /** + * Process a content directory control request. + * + * @param serverId Server UUID. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse processContentDirectoryControlRequestWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String serverId) throws ApiException { + return processContentDirectoryControlRequestWithHttpInfo(serverId, null); + } + + /** + * Process a content directory control request. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse processContentDirectoryControlRequestWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String serverId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = processContentDirectoryControlRequestRequestBuilder(serverId, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("processContentDirectoryControlRequest", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder processContentDirectoryControlRequestRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String serverId, Map headers) throws ApiException { + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException(400, + "Missing the required parameter 'serverId' when calling processContentDirectoryControlRequest"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/{serverId}/ContentDirectory/Control".replace("{serverId}", + ApiClient.urlEncode(serverId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/xml"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Process a media receiver registrar control request. + * + * @param serverId Server UUID. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File processMediaReceiverRegistrarControlRequest(@org.eclipse.jdt.annotation.Nullable String serverId) + throws ApiException { + return processMediaReceiverRegistrarControlRequest(serverId, null); + } + + /** + * Process a media receiver registrar control request. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File processMediaReceiverRegistrarControlRequest(@org.eclipse.jdt.annotation.Nullable String serverId, + Map headers) throws ApiException { + ApiResponse localVarResponse = processMediaReceiverRegistrarControlRequestWithHttpInfo(serverId, headers); + return localVarResponse.getData(); + } + + /** + * Process a media receiver registrar control request. + * + * @param serverId Server UUID. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse processMediaReceiverRegistrarControlRequestWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String serverId) throws ApiException { + return processMediaReceiverRegistrarControlRequestWithHttpInfo(serverId, null); + } + + /** + * Process a media receiver registrar control request. + * + * @param serverId Server UUID. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse processMediaReceiverRegistrarControlRequestWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String serverId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = processMediaReceiverRegistrarControlRequestRequestBuilder(serverId, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("processMediaReceiverRegistrarControlRequest", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder processMediaReceiverRegistrarControlRequestRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String serverId, Map headers) throws ApiException { + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException(400, + "Missing the required parameter 'serverId' when calling processMediaReceiverRegistrarControlRequest"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Dlna/{serverId}/MediaReceiverRegistrar/Control".replace("{serverId}", + ApiClient.urlEncode(serverId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/xml"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DynamicHlsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DynamicHlsApi.java new file mode 100644 index 0000000000000..d71fc9ad6fe9c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/DynamicHlsApi.java @@ -0,0 +1,6769 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.EncodingContext; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SubtitleDeliveryMethod; + +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DynamicHlsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public DynamicHlsApi() { + this(Configuration.getDefaultApiClient()); + } + + public DynamicHlsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param runtimeTicks The position of the requested segment in ticks. (required) + * @param actualSegmentLengthTicks The length of the requested segment in ticks. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsAudioSegment(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return getHlsAudioSegment(itemId, playlistId, segmentId, container, runtimeTicks, actualSegmentLengthTicks, + _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, + audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param runtimeTicks The position of the requested segment in ticks. (required) + * @param actualSegmentLengthTicks The length of the requested segment in ticks. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsAudioSegment(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + ApiResponse localVarResponse = getHlsAudioSegmentWithHttpInfo(itemId, playlistId, segmentId, container, + runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, headers); + return localVarResponse.getData(); + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param runtimeTicks The position of the requested segment in ticks. (required) + * @param actualSegmentLengthTicks The length of the requested segment in ticks. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsAudioSegmentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return getHlsAudioSegmentWithHttpInfo(itemId, playlistId, segmentId, container, runtimeTicks, + actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, + segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param runtimeTicks The position of the requested segment in ticks. (required) + * @param actualSegmentLengthTicks The length of the requested segment in ticks. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsAudioSegmentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsAudioSegmentRequestBuilder(itemId, playlistId, segmentId, + container, runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getHlsAudioSegment", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getHlsAudioSegmentRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getHlsAudioSegment"); + } + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling getHlsAudioSegment"); + } + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException(400, "Missing the required parameter 'segmentId' when calling getHlsAudioSegment"); + } + // verify the required parameter 'container' is set + if (container == null) { + throw new ApiException(400, "Missing the required parameter 'container' when calling getHlsAudioSegment"); + } + // verify the required parameter 'runtimeTicks' is set + if (runtimeTicks == null) { + throw new ApiException(400, + "Missing the required parameter 'runtimeTicks' when calling getHlsAudioSegment"); + } + // verify the required parameter 'actualSegmentLengthTicks' is set + if (actualSegmentLengthTicks == null) { + throw new ApiException(400, + "Missing the required parameter 'actualSegmentLengthTicks' when calling getHlsAudioSegment"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/hls1/{playlistId}/{segmentId}.{container}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{playlistId}", ApiClient.urlEncode(playlistId.toString())) + .replace("{segmentId}", ApiClient.urlEncode(segmentId.toString())) + .replace("{container}", ApiClient.urlEncode(container.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "runtimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("runtimeTicks", runtimeTicks)); + localVarQueryParameterBaseName = "actualSegmentLengthTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("actualSegmentLengthTicks", actualSegmentLengthTicks)); + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "maxStreamingBitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStreamingBitrate", maxStreamingBitrate)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "audio/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param runtimeTicks The position of the requested segment in ticks. (required) + * @param actualSegmentLengthTicks The length of the requested segment in ticks. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The desired segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsVideoSegment(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return getHlsVideoSegment(itemId, playlistId, segmentId, container, runtimeTicks, actualSegmentLengthTicks, + _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, null); + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param runtimeTicks The position of the requested segment in ticks. (required) + * @param actualSegmentLengthTicks The length of the requested segment in ticks. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The desired segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsVideoSegment(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + ApiResponse localVarResponse = getHlsVideoSegmentWithHttpInfo(itemId, playlistId, segmentId, container, + runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, headers); + return localVarResponse.getData(); + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param runtimeTicks The position of the requested segment in ticks. (required) + * @param actualSegmentLengthTicks The length of the requested segment in ticks. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The desired segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsVideoSegmentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return getHlsVideoSegmentWithHttpInfo(itemId, playlistId, segmentId, container, runtimeTicks, + actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, + segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param runtimeTicks The position of the requested segment in ticks. (required) + * @param actualSegmentLengthTicks The length of the requested segment in ticks. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The desired segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsVideoSegmentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsVideoSegmentRequestBuilder(itemId, playlistId, segmentId, + container, runtimeTicks, actualSegmentLengthTicks, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getHlsVideoSegment", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getHlsVideoSegmentRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable Integer segmentId, + @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.Nullable Long runtimeTicks, + @org.eclipse.jdt.annotation.Nullable Long actualSegmentLengthTicks, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getHlsVideoSegment"); + } + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling getHlsVideoSegment"); + } + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException(400, "Missing the required parameter 'segmentId' when calling getHlsVideoSegment"); + } + // verify the required parameter 'container' is set + if (container == null) { + throw new ApiException(400, "Missing the required parameter 'container' when calling getHlsVideoSegment"); + } + // verify the required parameter 'runtimeTicks' is set + if (runtimeTicks == null) { + throw new ApiException(400, + "Missing the required parameter 'runtimeTicks' when calling getHlsVideoSegment"); + } + // verify the required parameter 'actualSegmentLengthTicks' is set + if (actualSegmentLengthTicks == null) { + throw new ApiException(400, + "Missing the required parameter 'actualSegmentLengthTicks' when calling getHlsVideoSegment"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/hls1/{playlistId}/{segmentId}.{container}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{playlistId}", ApiClient.urlEncode(playlistId.toString())) + .replace("{segmentId}", ApiClient.urlEncode(segmentId.toString())) + .replace("{container}", ApiClient.urlEncode(container.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "runtimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("runtimeTicks", runtimeTicks)); + localVarQueryParameterBaseName = "actualSegmentLengthTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("actualSegmentLengthTicks", actualSegmentLengthTicks)); + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "video/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a hls live stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment lenght. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param maxWidth Optional. The max width. (optional) + * @param maxHeight Optional. The max height. (optional) + * @param enableSubtitlesInManifest Optional. Whether to enable subtitles in the manifest. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getLiveHlsStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest) throws ApiException { + return getLiveHlsStream(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, maxWidth, maxHeight, + enableSubtitlesInManifest, null); + } + + /** + * Gets a hls live stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment lenght. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param maxWidth Optional. The max width. (optional) + * @param maxHeight Optional. The max height. (optional) + * @param enableSubtitlesInManifest Optional. Whether to enable subtitles in the manifest. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getLiveHlsStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest, Map headers) + throws ApiException { + ApiResponse localVarResponse = getLiveHlsStreamWithHttpInfo(itemId, container, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + maxWidth, maxHeight, enableSubtitlesInManifest, headers); + return localVarResponse.getData(); + } + + /** + * Gets a hls live stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment lenght. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param maxWidth Optional. The max width. (optional) + * @param maxHeight Optional. The max height. (optional) + * @param enableSubtitlesInManifest Optional. Whether to enable subtitles in the manifest. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveHlsStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest) throws ApiException { + return getLiveHlsStreamWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, maxWidth, maxHeight, + enableSubtitlesInManifest, null); + } + + /** + * Gets a hls live stream. + * + * @param itemId The item id. (required) + * @param container The audio container. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment lenght. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param maxWidth Optional. The max width. (optional) + * @param maxHeight Optional. The max height. (optional) + * @param enableSubtitlesInManifest Optional. Whether to enable subtitles in the manifest. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveHlsStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLiveHlsStreamRequestBuilder(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + maxWidth, maxHeight, enableSubtitlesInManifest, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLiveHlsStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLiveHlsStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getLiveHlsStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/live.m3u8".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "container"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("container", container)); + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "enableSubtitlesInManifest"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableSubtitlesInManifest", enableSubtitlesInManifest)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an audio hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File getMasterHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming) throws ApiException { + return getMasterHlsAudioPlaylist(itemId, mediaSourceId, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, null); + } + + /** + * Gets an audio hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getMasterHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, Map headers) + throws ApiException { + ApiResponse localVarResponse = getMasterHlsAudioPlaylistWithHttpInfo(itemId, mediaSourceId, _static, + params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, headers); + return localVarResponse.getData(); + } + + /** + * Gets an audio hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMasterHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming) throws ApiException { + return getMasterHlsAudioPlaylistWithHttpInfo(itemId, mediaSourceId, _static, params, tag, deviceProfileId, + playSessionId, segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, null); + } + + /** + * Gets an audio hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMasterHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMasterHlsAudioPlaylistRequestBuilder(itemId, mediaSourceId, + _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, + audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, enableAdaptiveBitrateStreaming, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMasterHlsAudioPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMasterHlsAudioPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getMasterHlsAudioPlaylist"); + } + // verify the required parameter 'mediaSourceId' is set + if (mediaSourceId == null) { + throw new ApiException(400, + "Missing the required parameter 'mediaSourceId' when calling getMasterHlsAudioPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/master.m3u8".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "maxStreamingBitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStreamingBitrate", maxStreamingBitrate)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAdaptiveBitrateStreaming"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("enableAdaptiveBitrateStreaming", enableAdaptiveBitrateStreaming)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File getMasterHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming) throws ApiException { + return getMasterHlsVideoPlaylist(itemId, mediaSourceId, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, null); + } + + /** + * Gets a video hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getMasterHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, Map headers) + throws ApiException { + ApiResponse localVarResponse = getMasterHlsVideoPlaylistWithHttpInfo(itemId, mediaSourceId, _static, + params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, + videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, + deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAdaptiveBitrateStreaming, headers); + return localVarResponse.getData(); + } + + /** + * Gets a video hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMasterHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming) throws ApiException { + return getMasterHlsVideoPlaylistWithHttpInfo(itemId, mediaSourceId, _static, params, tag, deviceProfileId, + playSessionId, segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, null); + } + + /** + * Gets a video hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMasterHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMasterHlsVideoPlaylistRequestBuilder(itemId, mediaSourceId, + _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAdaptiveBitrateStreaming, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMasterHlsVideoPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMasterHlsVideoPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getMasterHlsVideoPlaylist"); + } + // verify the required parameter 'mediaSourceId' is set + if (mediaSourceId == null) { + throw new ApiException(400, + "Missing the required parameter 'mediaSourceId' when calling getMasterHlsVideoPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/master.m3u8".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAdaptiveBitrateStreaming"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("enableAdaptiveBitrateStreaming", enableAdaptiveBitrateStreaming)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an audio stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getVariantHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return getVariantHlsAudioPlaylist(itemId, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets an audio stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getVariantHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + ApiResponse localVarResponse = getVariantHlsAudioPlaylistWithHttpInfo(itemId, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + headers); + return localVarResponse.getData(); + } + + /** + * Gets an audio stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVariantHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return getVariantHlsAudioPlaylistWithHttpInfo(itemId, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets an audio stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVariantHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getVariantHlsAudioPlaylistRequestBuilder(itemId, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, + audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getVariantHlsAudioPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getVariantHlsAudioPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getVariantHlsAudioPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/main.m3u8".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "maxStreamingBitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStreamingBitrate", maxStreamingBitrate)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getVariantHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return getVariantHlsVideoPlaylist(itemId, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getVariantHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + ApiResponse localVarResponse = getVariantHlsVideoPlaylistWithHttpInfo(itemId, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, + videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, + deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, headers); + return localVarResponse.getData(); + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVariantHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return getVariantHlsVideoPlaylistWithHttpInfo(itemId, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets a video stream using HTTP live streaming. + * + * @param itemId The item id. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVariantHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getVariantHlsVideoPlaylistRequestBuilder(itemId, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getVariantHlsVideoPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getVariantHlsVideoPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getVariantHlsVideoPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/main.m3u8".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an audio hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File headMasterHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming) throws ApiException { + return headMasterHlsAudioPlaylist(itemId, mediaSourceId, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, null); + } + + /** + * Gets an audio hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headMasterHlsAudioPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, Map headers) + throws ApiException { + ApiResponse localVarResponse = headMasterHlsAudioPlaylistWithHttpInfo(itemId, mediaSourceId, _static, + params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, headers); + return localVarResponse.getData(); + } + + /** + * Gets an audio hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headMasterHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming) throws ApiException { + return headMasterHlsAudioPlaylistWithHttpInfo(itemId, mediaSourceId, _static, params, tag, deviceProfileId, + playSessionId, segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + maxStreamingBitrate, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, + subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, null); + } + + /** + * Gets an audio hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headMasterHlsAudioPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headMasterHlsAudioPlaylistRequestBuilder(itemId, mediaSourceId, + _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, maxStreamingBitrate, audioBitRate, + audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, + maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, + cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, + audioStreamIndex, videoStreamIndex, context, streamOptions, enableAdaptiveBitrateStreaming, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headMasterHlsAudioPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headMasterHlsAudioPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling headMasterHlsAudioPlaylist"); + } + // verify the required parameter 'mediaSourceId' is set + if (mediaSourceId == null) { + throw new ApiException(400, + "Missing the required parameter 'mediaSourceId' when calling headMasterHlsAudioPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/master.m3u8".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "maxStreamingBitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStreamingBitrate", maxStreamingBitrate)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAdaptiveBitrateStreaming"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("enableAdaptiveBitrateStreaming", enableAdaptiveBitrateStreaming)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File headMasterHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming) throws ApiException { + return headMasterHlsVideoPlaylist(itemId, mediaSourceId, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, null); + } + + /** + * Gets a video hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headMasterHlsVideoPlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, Map headers) + throws ApiException { + ApiResponse localVarResponse = headMasterHlsVideoPlaylistWithHttpInfo(itemId, mediaSourceId, _static, + params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, + videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, + deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAdaptiveBitrateStreaming, headers); + return localVarResponse.getData(); + } + + /** + * Gets a video hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headMasterHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming) throws ApiException { + return headMasterHlsVideoPlaylistWithHttpInfo(itemId, mediaSourceId, _static, params, tag, deviceProfileId, + playSessionId, segmentContainer, segmentLength, minSegments, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + enableAdaptiveBitrateStreaming, null); + } + + /** + * Gets a video hls playlist stream. + * + * @param itemId The item id. (required) + * @param mediaSourceId The media version id, if playing an alternate version. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param enableAdaptiveBitrateStreaming Enable adaptive bitrate streaming. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headMasterHlsVideoPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headMasterHlsVideoPlaylistRequestBuilder(itemId, mediaSourceId, + _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, enableAdaptiveBitrateStreaming, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headMasterHlsVideoPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headMasterHlsVideoPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, + @org.eclipse.jdt.annotation.NonNull Boolean enableAdaptiveBitrateStreaming, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling headMasterHlsVideoPlaylist"); + } + // verify the required parameter 'mediaSourceId' is set + if (mediaSourceId == null) { + throw new ApiException(400, + "Missing the required parameter 'mediaSourceId' when calling headMasterHlsVideoPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/master.m3u8".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + localVarQueryParameterBaseName = "enableAdaptiveBitrateStreaming"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("enableAdaptiveBitrateStreaming", enableAdaptiveBitrateStreaming)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/EnvironmentApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/EnvironmentApi.java new file mode 100644 index 0000000000000..df2dcffa87904 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/EnvironmentApi.java @@ -0,0 +1,844 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.DefaultDirectoryBrowserInfoDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.FileSystemEntryInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ValidatePathDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class EnvironmentApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public EnvironmentApi() { + this(Configuration.getDefaultApiClient()); + } + + public EnvironmentApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Get Default directory browser. + * + * @return DefaultDirectoryBrowserInfoDto + * @throws ApiException if fails to make API call + */ + public DefaultDirectoryBrowserInfoDto getDefaultDirectoryBrowser() throws ApiException { + return getDefaultDirectoryBrowser(null); + } + + /** + * Get Default directory browser. + * + * @param headers Optional headers to include in the request + * @return DefaultDirectoryBrowserInfoDto + * @throws ApiException if fails to make API call + */ + public DefaultDirectoryBrowserInfoDto getDefaultDirectoryBrowser(Map headers) throws ApiException { + ApiResponse localVarResponse = getDefaultDirectoryBrowserWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Get Default directory browser. + * + * @return ApiResponse<DefaultDirectoryBrowserInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultDirectoryBrowserWithHttpInfo() throws ApiException { + return getDefaultDirectoryBrowserWithHttpInfo(null); + } + + /** + * Get Default directory browser. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<DefaultDirectoryBrowserInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultDirectoryBrowserWithHttpInfo( + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDefaultDirectoryBrowserRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDefaultDirectoryBrowser", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + DefaultDirectoryBrowserInfoDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDefaultDirectoryBrowserRequestBuilder(Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Environment/DefaultDirectoryBrowser"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the contents of a given directory in the file system. + * + * @param path The path. (required) + * @param includeFiles An optional filter to include or exclude files from the results. true/false. (optional, + * default to false) + * @param includeDirectories An optional filter to include or exclude folders from the results. true/false. + * (optional, default to false) + * @return List<FileSystemEntryInfo> + * @throws ApiException if fails to make API call + */ + public List getDirectoryContents(@org.eclipse.jdt.annotation.Nullable String path, + @org.eclipse.jdt.annotation.NonNull Boolean includeFiles, + @org.eclipse.jdt.annotation.NonNull Boolean includeDirectories) throws ApiException { + return getDirectoryContents(path, includeFiles, includeDirectories, null); + } + + /** + * Gets the contents of a given directory in the file system. + * + * @param path The path. (required) + * @param includeFiles An optional filter to include or exclude files from the results. true/false. (optional, + * default to false) + * @param includeDirectories An optional filter to include or exclude folders from the results. true/false. + * (optional, default to false) + * @param headers Optional headers to include in the request + * @return List<FileSystemEntryInfo> + * @throws ApiException if fails to make API call + */ + public List getDirectoryContents(@org.eclipse.jdt.annotation.Nullable String path, + @org.eclipse.jdt.annotation.NonNull Boolean includeFiles, + @org.eclipse.jdt.annotation.NonNull Boolean includeDirectories, Map headers) + throws ApiException { + ApiResponse> localVarResponse = getDirectoryContentsWithHttpInfo(path, includeFiles, + includeDirectories, headers); + return localVarResponse.getData(); + } + + /** + * Gets the contents of a given directory in the file system. + * + * @param path The path. (required) + * @param includeFiles An optional filter to include or exclude files from the results. true/false. (optional, + * default to false) + * @param includeDirectories An optional filter to include or exclude folders from the results. true/false. + * (optional, default to false) + * @return ApiResponse<List<FileSystemEntryInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getDirectoryContentsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String path, @org.eclipse.jdt.annotation.NonNull Boolean includeFiles, + @org.eclipse.jdt.annotation.NonNull Boolean includeDirectories) throws ApiException { + return getDirectoryContentsWithHttpInfo(path, includeFiles, includeDirectories, null); + } + + /** + * Gets the contents of a given directory in the file system. + * + * @param path The path. (required) + * @param includeFiles An optional filter to include or exclude files from the results. true/false. (optional, + * default to false) + * @param includeDirectories An optional filter to include or exclude folders from the results. true/false. + * (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<FileSystemEntryInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getDirectoryContentsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String path, @org.eclipse.jdt.annotation.NonNull Boolean includeFiles, + @org.eclipse.jdt.annotation.NonNull Boolean includeDirectories, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDirectoryContentsRequestBuilder(path, includeFiles, + includeDirectories, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDirectoryContents", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDirectoryContentsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String path, + @org.eclipse.jdt.annotation.NonNull Boolean includeFiles, + @org.eclipse.jdt.annotation.NonNull Boolean includeDirectories, Map headers) + throws ApiException { + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException(400, "Missing the required parameter 'path' when calling getDirectoryContents"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Environment/DirectoryContents"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "path"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("path", path)); + localVarQueryParameterBaseName = "includeFiles"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeFiles", includeFiles)); + localVarQueryParameterBaseName = "includeDirectories"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeDirectories", includeDirectories)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available drives from the server's file system. + * + * @return List<FileSystemEntryInfo> + * @throws ApiException if fails to make API call + */ + public List getDrives() throws ApiException { + return getDrives(null); + } + + /** + * Gets available drives from the server's file system. + * + * @param headers Optional headers to include in the request + * @return List<FileSystemEntryInfo> + * @throws ApiException if fails to make API call + */ + public List getDrives(Map headers) throws ApiException { + ApiResponse> localVarResponse = getDrivesWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets available drives from the server's file system. + * + * @return ApiResponse<List<FileSystemEntryInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getDrivesWithHttpInfo() throws ApiException { + return getDrivesWithHttpInfo(null); + } + + /** + * Gets available drives from the server's file system. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<FileSystemEntryInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getDrivesWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDrivesRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDrives", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDrivesRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Environment/Drives"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets network paths. + * + * @return List<FileSystemEntryInfo> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public List getNetworkShares() throws ApiException { + return getNetworkShares(null); + } + + /** + * Gets network paths. + * + * @param headers Optional headers to include in the request + * @return List<FileSystemEntryInfo> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public List getNetworkShares(Map headers) throws ApiException { + ApiResponse> localVarResponse = getNetworkSharesWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets network paths. + * + * @return ApiResponse<List<FileSystemEntryInfo>> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse> getNetworkSharesWithHttpInfo() throws ApiException { + return getNetworkSharesWithHttpInfo(null); + } + + /** + * Gets network paths. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<FileSystemEntryInfo>> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse> getNetworkSharesWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getNetworkSharesRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getNetworkShares", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getNetworkSharesRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Environment/NetworkShares"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the parent path of a given path. + * + * @param path The path. (required) + * @return String + * @throws ApiException if fails to make API call + */ + public String getParentPath(@org.eclipse.jdt.annotation.Nullable String path) throws ApiException { + return getParentPath(path, null); + } + + /** + * Gets the parent path of a given path. + * + * @param path The path. (required) + * @param headers Optional headers to include in the request + * @return String + * @throws ApiException if fails to make API call + */ + public String getParentPath(@org.eclipse.jdt.annotation.Nullable String path, Map headers) + throws ApiException { + ApiResponse localVarResponse = getParentPathWithHttpInfo(path, headers); + return localVarResponse.getData(); + } + + /** + * Gets the parent path of a given path. + * + * @param path The path. (required) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getParentPathWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String path) + throws ApiException { + return getParentPathWithHttpInfo(path, null); + } + + /** + * Gets the parent path of a given path. + * + * @param path The path. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getParentPathWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String path, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getParentPathRequestBuilder(path, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getParentPath", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + String responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getParentPathRequestBuilder(@org.eclipse.jdt.annotation.Nullable String path, + Map headers) throws ApiException { + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException(400, "Missing the required parameter 'path' when calling getParentPath"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Environment/ParentPath"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "path"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("path", path)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Validates path. + * + * @param validatePathDto Validate request object. (required) + * @throws ApiException if fails to make API call + */ + public void validatePath(@org.eclipse.jdt.annotation.Nullable ValidatePathDto validatePathDto) throws ApiException { + validatePath(validatePathDto, null); + } + + /** + * Validates path. + * + * @param validatePathDto Validate request object. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void validatePath(@org.eclipse.jdt.annotation.Nullable ValidatePathDto validatePathDto, + Map headers) throws ApiException { + validatePathWithHttpInfo(validatePathDto, headers); + } + + /** + * Validates path. + * + * @param validatePathDto Validate request object. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse validatePathWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ValidatePathDto validatePathDto) throws ApiException { + return validatePathWithHttpInfo(validatePathDto, null); + } + + /** + * Validates path. + * + * @param validatePathDto Validate request object. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse validatePathWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ValidatePathDto validatePathDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = validatePathRequestBuilder(validatePathDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("validatePath", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder validatePathRequestBuilder( + @org.eclipse.jdt.annotation.Nullable ValidatePathDto validatePathDto, Map headers) + throws ApiException { + // verify the required parameter 'validatePathDto' is set + if (validatePathDto == null) { + throw new ApiException(400, "Missing the required parameter 'validatePathDto' when calling validatePath"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Environment/ValidatePath"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(validatePathDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/FilterApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/FilterApi.java new file mode 100644 index 0000000000000..68176e61c51d3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/FilterApi.java @@ -0,0 +1,522 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.QueryFilters; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.QueryFiltersLegacy; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class FilterApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public FilterApi() { + this(Configuration.getDefaultApiClient()); + } + + public FilterApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets query filters. + * + * @param userId Optional. User id. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isAiring Optional. Is item airing. (optional) + * @param isMovie Optional. Is item movie. (optional) + * @param isSports Optional. Is item sports. (optional) + * @param isKids Optional. Is item kids. (optional) + * @param isNews Optional. Is item news. (optional) + * @param isSeries Optional. Is item series. (optional) + * @param recursive Optional. Search recursive. (optional) + * @return QueryFilters + * @throws ApiException if fails to make API call + */ + public QueryFilters getQueryFilters(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean recursive) throws ApiException { + return getQueryFilters(userId, parentId, includeItemTypes, isAiring, isMovie, isSports, isKids, isNews, + isSeries, recursive, null); + } + + /** + * Gets query filters. + * + * @param userId Optional. User id. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isAiring Optional. Is item airing. (optional) + * @param isMovie Optional. Is item movie. (optional) + * @param isSports Optional. Is item sports. (optional) + * @param isKids Optional. Is item kids. (optional) + * @param isNews Optional. Is item news. (optional) + * @param isSeries Optional. Is item series. (optional) + * @param recursive Optional. Search recursive. (optional) + * @param headers Optional headers to include in the request + * @return QueryFilters + * @throws ApiException if fails to make API call + */ + public QueryFilters getQueryFilters(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, Map headers) throws ApiException { + ApiResponse localVarResponse = getQueryFiltersWithHttpInfo(userId, parentId, includeItemTypes, + isAiring, isMovie, isSports, isKids, isNews, isSeries, recursive, headers); + return localVarResponse.getData(); + } + + /** + * Gets query filters. + * + * @param userId Optional. User id. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isAiring Optional. Is item airing. (optional) + * @param isMovie Optional. Is item movie. (optional) + * @param isSports Optional. Is item sports. (optional) + * @param isKids Optional. Is item kids. (optional) + * @param isNews Optional. Is item news. (optional) + * @param isSeries Optional. Is item series. (optional) + * @param recursive Optional. Search recursive. (optional) + * @return ApiResponse<QueryFilters> + * @throws ApiException if fails to make API call + */ + public ApiResponse getQueryFiltersWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean recursive) throws ApiException { + return getQueryFiltersWithHttpInfo(userId, parentId, includeItemTypes, isAiring, isMovie, isSports, isKids, + isNews, isSeries, recursive, null); + } + + /** + * Gets query filters. + * + * @param userId Optional. User id. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isAiring Optional. Is item airing. (optional) + * @param isMovie Optional. Is item movie. (optional) + * @param isSports Optional. Is item sports. (optional) + * @param isKids Optional. Is item kids. (optional) + * @param isNews Optional. Is item news. (optional) + * @param isSeries Optional. Is item series. (optional) + * @param recursive Optional. Search recursive. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<QueryFilters> + * @throws ApiException if fails to make API call + */ + public ApiResponse getQueryFiltersWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getQueryFiltersRequestBuilder(userId, parentId, includeItemTypes, + isAiring, isMovie, isSports, isKids, isNews, isSeries, recursive, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getQueryFilters", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + QueryFilters responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getQueryFiltersRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/Filters2"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "isAiring"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isAiring", isAiring)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "recursive"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("recursive", recursive)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets legacy query filters. + * + * @param userId Optional. User id. (optional) + * @param parentId Optional. Parent id. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @return QueryFiltersLegacy + * @throws ApiException if fails to make API call + */ + public QueryFiltersLegacy getQueryFiltersLegacy(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes) throws ApiException { + return getQueryFiltersLegacy(userId, parentId, includeItemTypes, mediaTypes, null); + } + + /** + * Gets legacy query filters. + * + * @param userId Optional. User id. (optional) + * @param parentId Optional. Parent id. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param headers Optional headers to include in the request + * @return QueryFiltersLegacy + * @throws ApiException if fails to make API call + */ + public QueryFiltersLegacy getQueryFiltersLegacy(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, Map headers) + throws ApiException { + ApiResponse localVarResponse = getQueryFiltersLegacyWithHttpInfo(userId, parentId, + includeItemTypes, mediaTypes, headers); + return localVarResponse.getData(); + } + + /** + * Gets legacy query filters. + * + * @param userId Optional. User id. (optional) + * @param parentId Optional. Parent id. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @return ApiResponse<QueryFiltersLegacy> + * @throws ApiException if fails to make API call + */ + public ApiResponse getQueryFiltersLegacyWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes) throws ApiException { + return getQueryFiltersLegacyWithHttpInfo(userId, parentId, includeItemTypes, mediaTypes, null); + } + + /** + * Gets legacy query filters. + * + * @param userId Optional. User id. (optional) + * @param parentId Optional. Parent id. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<QueryFiltersLegacy> + * @throws ApiException if fails to make API call + */ + public ApiResponse getQueryFiltersLegacyWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getQueryFiltersLegacyRequestBuilder(userId, parentId, + includeItemTypes, mediaTypes, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getQueryFiltersLegacy", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + QueryFiltersLegacy responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getQueryFiltersLegacyRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/Filters"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/GenresApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/GenresApi.java new file mode 100644 index 0000000000000..f8d09a1063b1d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/GenresApi.java @@ -0,0 +1,619 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SortOrder; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class GenresApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public GenresApi() { + this(Configuration.getDefaultApiClient()); + } + + public GenresApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets a genre, by name. + * + * @param genreName The genre name. (required) + * @param userId The user id. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getGenre(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getGenre(genreName, userId, null); + } + + /** + * Gets a genre, by name. + * + * @param genreName The genre name. (required) + * @param userId The user id. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getGenre(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getGenreWithHttpInfo(genreName, userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets a genre, by name. + * + * @param genreName The genre name. (required) + * @param userId The user id. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenreWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getGenreWithHttpInfo(genreName, userId, null); + } + + /** + * Gets a genre, by name. + * + * @param genreName The genre name. (required) + * @param userId The user id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenreWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGenreRequestBuilder(genreName, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getGenre", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getGenreRequestBuilder(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + // verify the required parameter 'genreName' is set + if (genreName == null) { + throw new ApiException(400, "Missing the required parameter 'genreName' when calling getGenre"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Genres/{genreName}".replace("{genreName}", ApiClient.urlEncode(genreName.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all genres from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered in based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Optional. Include total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getGenres(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getGenres(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, + isFavorite, imageTypeLimit, enableImageTypes, userId, nameStartsWithOrGreater, nameStartsWith, + nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount, null); + } + + /** + * Gets all genres from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered in based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Optional. Include total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getGenres(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + ApiResponse localVarResponse = getGenresWithHttpInfo(startIndex, limit, searchTerm, + parentId, fields, excludeItemTypes, includeItemTypes, isFavorite, imageTypeLimit, enableImageTypes, + userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, + enableTotalRecordCount, headers); + return localVarResponse.getData(); + } + + /** + * Gets all genres from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered in based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Optional. Include total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenresWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getGenresWithHttpInfo(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, + includeItemTypes, isFavorite, imageTypeLimit, enableImageTypes, userId, nameStartsWithOrGreater, + nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount, null); + } + + /** + * Gets all genres from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered in based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Optional. Include total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenresWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGenresRequestBuilder(startIndex, limit, searchTerm, parentId, + fields, excludeItemTypes, includeItemTypes, isFavorite, imageTypeLimit, enableImageTypes, userId, + nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, + enableTotalRecordCount, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getGenres", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getGenresRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Genres"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "nameStartsWithOrGreater"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWithOrGreater", nameStartsWithOrGreater)); + localVarQueryParameterBaseName = "nameStartsWith"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWith", nameStartsWith)); + localVarQueryParameterBaseName = "nameLessThan"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameLessThan", nameLessThan)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/HlsSegmentApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/HlsSegmentApi.java new file mode 100644 index 0000000000000..e20b6f3a7489c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/HlsSegmentApi.java @@ -0,0 +1,789 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; + +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class HlsSegmentApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public HlsSegmentApi() { + this(Configuration.getDefaultApiClient()); + } + + public HlsSegmentApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets the specified audio segment for an audio item. + * + * @param itemId The item id. (required) + * @param segmentId The segment id. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsAudioSegmentLegacyAac(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String segmentId) throws ApiException { + return getHlsAudioSegmentLegacyAac(itemId, segmentId, null); + } + + /** + * Gets the specified audio segment for an audio item. + * + * @param itemId The item id. (required) + * @param segmentId The segment id. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsAudioSegmentLegacyAac(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String segmentId, Map headers) throws ApiException { + ApiResponse localVarResponse = getHlsAudioSegmentLegacyAacWithHttpInfo(itemId, segmentId, headers); + return localVarResponse.getData(); + } + + /** + * Gets the specified audio segment for an audio item. + * + * @param itemId The item id. (required) + * @param segmentId The segment id. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsAudioSegmentLegacyAacWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String segmentId) throws ApiException { + return getHlsAudioSegmentLegacyAacWithHttpInfo(itemId, segmentId, null); + } + + /** + * Gets the specified audio segment for an audio item. + * + * @param itemId The item id. (required) + * @param segmentId The segment id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsAudioSegmentLegacyAacWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String segmentId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsAudioSegmentLegacyAacRequestBuilder(itemId, segmentId, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getHlsAudioSegmentLegacyAac", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getHlsAudioSegmentLegacyAacRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String segmentId, + Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getHlsAudioSegmentLegacyAac"); + } + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException(400, + "Missing the required parameter 'segmentId' when calling getHlsAudioSegmentLegacyAac"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/hls/{segmentId}/stream.aac" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{segmentId}", ApiClient.urlEncode(segmentId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "audio/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the specified audio segment for an audio item. + * + * @param itemId The item id. (required) + * @param segmentId The segment id. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsAudioSegmentLegacyMp3(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String segmentId) throws ApiException { + return getHlsAudioSegmentLegacyMp3(itemId, segmentId, null); + } + + /** + * Gets the specified audio segment for an audio item. + * + * @param itemId The item id. (required) + * @param segmentId The segment id. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsAudioSegmentLegacyMp3(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String segmentId, Map headers) throws ApiException { + ApiResponse localVarResponse = getHlsAudioSegmentLegacyMp3WithHttpInfo(itemId, segmentId, headers); + return localVarResponse.getData(); + } + + /** + * Gets the specified audio segment for an audio item. + * + * @param itemId The item id. (required) + * @param segmentId The segment id. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsAudioSegmentLegacyMp3WithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String segmentId) throws ApiException { + return getHlsAudioSegmentLegacyMp3WithHttpInfo(itemId, segmentId, null); + } + + /** + * Gets the specified audio segment for an audio item. + * + * @param itemId The item id. (required) + * @param segmentId The segment id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsAudioSegmentLegacyMp3WithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String segmentId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsAudioSegmentLegacyMp3RequestBuilder(itemId, segmentId, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getHlsAudioSegmentLegacyMp3", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getHlsAudioSegmentLegacyMp3RequestBuilder( + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String segmentId, + Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getHlsAudioSegmentLegacyMp3"); + } + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException(400, + "Missing the required parameter 'segmentId' when calling getHlsAudioSegmentLegacyMp3"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/hls/{segmentId}/stream.mp3" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{segmentId}", ApiClient.urlEncode(segmentId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "audio/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a hls video playlist. + * + * @param itemId The video id. (required) + * @param playlistId The playlist id. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsPlaylistLegacy(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId) throws ApiException { + return getHlsPlaylistLegacy(itemId, playlistId, null); + } + + /** + * Gets a hls video playlist. + * + * @param itemId The video id. (required) + * @param playlistId The playlist id. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsPlaylistLegacy(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, Map headers) throws ApiException { + ApiResponse localVarResponse = getHlsPlaylistLegacyWithHttpInfo(itemId, playlistId, headers); + return localVarResponse.getData(); + } + + /** + * Gets a hls video playlist. + * + * @param itemId The video id. (required) + * @param playlistId The playlist id. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsPlaylistLegacyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId) throws ApiException { + return getHlsPlaylistLegacyWithHttpInfo(itemId, playlistId, null); + } + + /** + * Gets a hls video playlist. + * + * @param itemId The video id. (required) + * @param playlistId The playlist id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsPlaylistLegacyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsPlaylistLegacyRequestBuilder(itemId, playlistId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getHlsPlaylistLegacy", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getHlsPlaylistLegacyRequestBuilder(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getHlsPlaylistLegacy"); + } + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, + "Missing the required parameter 'playlistId' when calling getHlsPlaylistLegacy"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/hls/{playlistId}/stream.m3u8" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{playlistId}", ApiClient.urlEncode(playlistId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a hls video segment. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param segmentContainer The segment container. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsVideoSegmentLegacy(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String segmentId, + @org.eclipse.jdt.annotation.Nullable String segmentContainer) throws ApiException { + return getHlsVideoSegmentLegacy(itemId, playlistId, segmentId, segmentContainer, null); + } + + /** + * Gets a hls video segment. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param segmentContainer The segment container. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getHlsVideoSegmentLegacy(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String segmentId, + @org.eclipse.jdt.annotation.Nullable String segmentContainer, Map headers) + throws ApiException { + ApiResponse localVarResponse = getHlsVideoSegmentLegacyWithHttpInfo(itemId, playlistId, segmentId, + segmentContainer, headers); + return localVarResponse.getData(); + } + + /** + * Gets a hls video segment. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param segmentContainer The segment container. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsVideoSegmentLegacyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String segmentId, + @org.eclipse.jdt.annotation.Nullable String segmentContainer) throws ApiException { + return getHlsVideoSegmentLegacyWithHttpInfo(itemId, playlistId, segmentId, segmentContainer, null); + } + + /** + * Gets a hls video segment. + * + * @param itemId The item id. (required) + * @param playlistId The playlist id. (required) + * @param segmentId The segment id. (required) + * @param segmentContainer The segment container. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getHlsVideoSegmentLegacyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String segmentId, + @org.eclipse.jdt.annotation.Nullable String segmentContainer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getHlsVideoSegmentLegacyRequestBuilder(itemId, playlistId, + segmentId, segmentContainer, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getHlsVideoSegmentLegacy", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getHlsVideoSegmentLegacyRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String segmentId, + @org.eclipse.jdt.annotation.Nullable String segmentContainer, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getHlsVideoSegmentLegacy"); + } + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, + "Missing the required parameter 'playlistId' when calling getHlsVideoSegmentLegacy"); + } + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException(400, + "Missing the required parameter 'segmentId' when calling getHlsVideoSegmentLegacy"); + } + // verify the required parameter 'segmentContainer' is set + if (segmentContainer == null) { + throw new ApiException(400, + "Missing the required parameter 'segmentContainer' when calling getHlsVideoSegmentLegacy"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/hls/{playlistId}/{segmentId}.{segmentContainer}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{playlistId}", ApiClient.urlEncode(playlistId.toString())) + .replace("{segmentId}", ApiClient.urlEncode(segmentId.toString())) + .replace("{segmentContainer}", ApiClient.urlEncode(segmentContainer.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "video/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Stops an active encoding. + * + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (required) + * @param playSessionId The play session id. (required) + * @throws ApiException if fails to make API call + */ + public void stopEncodingProcess(@org.eclipse.jdt.annotation.Nullable String deviceId, + @org.eclipse.jdt.annotation.Nullable String playSessionId) throws ApiException { + stopEncodingProcess(deviceId, playSessionId, null); + } + + /** + * Stops an active encoding. + * + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (required) + * @param playSessionId The play session id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void stopEncodingProcess(@org.eclipse.jdt.annotation.Nullable String deviceId, + @org.eclipse.jdt.annotation.Nullable String playSessionId, Map headers) + throws ApiException { + stopEncodingProcessWithHttpInfo(deviceId, playSessionId, headers); + } + + /** + * Stops an active encoding. + * + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (required) + * @param playSessionId The play session id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse stopEncodingProcessWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String deviceId, + @org.eclipse.jdt.annotation.Nullable String playSessionId) throws ApiException { + return stopEncodingProcessWithHttpInfo(deviceId, playSessionId, null); + } + + /** + * Stops an active encoding. + * + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (required) + * @param playSessionId The play session id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse stopEncodingProcessWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String deviceId, + @org.eclipse.jdt.annotation.Nullable String playSessionId, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = stopEncodingProcessRequestBuilder(deviceId, playSessionId, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("stopEncodingProcess", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder stopEncodingProcessRequestBuilder(@org.eclipse.jdt.annotation.Nullable String deviceId, + @org.eclipse.jdt.annotation.Nullable String playSessionId, Map headers) + throws ApiException { + // verify the required parameter 'deviceId' is set + if (deviceId == null) { + throw new ApiException(400, "Missing the required parameter 'deviceId' when calling stopEncodingProcess"); + } + // verify the required parameter 'playSessionId' is set + if (playSessionId == null) { + throw new ApiException(400, + "Missing the required parameter 'playSessionId' when calling stopEncodingProcess"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/ActiveEncodings"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ImageApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ImageApi.java new file mode 100644 index 0000000000000..e33aeb9905529 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ImageApi.java @@ -0,0 +1,10719 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageFormat; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageType; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ImageApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ImageApi() { + this(Configuration.getDefaultApiClient()); + } + + public ImageApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Delete a custom splashscreen. + * + * @throws ApiException if fails to make API call + */ + public void deleteCustomSplashscreen() throws ApiException { + deleteCustomSplashscreen(null); + } + + /** + * Delete a custom splashscreen. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteCustomSplashscreen(Map headers) throws ApiException { + deleteCustomSplashscreenWithHttpInfo(headers); + } + + /** + * Delete a custom splashscreen. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteCustomSplashscreenWithHttpInfo() throws ApiException { + return deleteCustomSplashscreenWithHttpInfo(null); + } + + /** + * Delete a custom splashscreen. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteCustomSplashscreenWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteCustomSplashscreenRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteCustomSplashscreen", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteCustomSplashscreenRequestBuilder(Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Branding/Splashscreen"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete an item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex The image index. (optional) + * @throws ApiException if fails to make API call + */ + public void deleteItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + deleteItemImage(itemId, imageType, imageIndex, null); + } + + /** + * Delete an item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex The image index. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + deleteItemImageWithHttpInfo(itemId, imageType, imageIndex, headers); + } + + /** + * Delete an item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex The image index. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return deleteItemImageWithHttpInfo(itemId, imageType, imageIndex, null); + } + + /** + * Delete an item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex The image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteItemImageRequestBuilder(itemId, imageType, imageIndex, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteItemImage", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteItemImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteItemImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling deleteItemImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete an item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex The image index. (required) + * @throws ApiException if fails to make API call + */ + public void deleteItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex) throws ApiException { + deleteItemImageByIndex(itemId, imageType, imageIndex, null); + } + + /** + * Delete an item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex The image index. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, Map headers) throws ApiException { + deleteItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, headers); + } + + /** + * Delete an item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex The image index. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex) throws ApiException { + return deleteItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, null); + } + + /** + * Delete an item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex The image index. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteItemImageByIndexRequestBuilder(itemId, imageType, imageIndex, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteItemImageByIndex", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteItemImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteItemImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling deleteItemImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling deleteItemImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}/{imageIndex}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete the user's image. + * + * @param userId User Id. (required) + * @param imageType (Unused) Image type. (required) + * @param index (Unused) Image index. (optional) + * @throws ApiException if fails to make API call + */ + public void deleteUserImage(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull Integer index) + throws ApiException { + deleteUserImage(userId, imageType, index, null); + } + + /** + * Delete the user's image. + * + * @param userId User Id. (required) + * @param imageType (Unused) Image type. (required) + * @param index (Unused) Image index. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteUserImage(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull Integer index, + Map headers) throws ApiException { + deleteUserImageWithHttpInfo(userId, imageType, index, headers); + } + + /** + * Delete the user's image. + * + * @param userId User Id. (required) + * @param imageType (Unused) Image type. (required) + * @param index (Unused) Image index. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull Integer index) + throws ApiException { + return deleteUserImageWithHttpInfo(userId, imageType, index, null); + } + + /** + * Delete the user's image. + * + * @param userId User Id. (required) + * @param imageType (Unused) Image type. (required) + * @param index (Unused) Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull Integer index, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteUserImageRequestBuilder(userId, imageType, index, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteUserImage", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteUserImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull Integer index, + Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling deleteUserImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling deleteUserImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Images/{imageType}" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "index"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("index", index)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete the user's image. + * + * @param userId User Id. (required) + * @param imageType (Unused) Image type. (required) + * @param index (Unused) Image index. (required) + * @throws ApiException if fails to make API call + */ + public void deleteUserImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { + deleteUserImageByIndex(userId, imageType, index, null); + } + + /** + * Delete the user's image. + * + * @param userId User Id. (required) + * @param imageType (Unused) Image type. (required) + * @param index (Unused) Image index. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteUserImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer index, Map headers) throws ApiException { + deleteUserImageByIndexWithHttpInfo(userId, imageType, index, headers); + } + + /** + * Delete the user's image. + * + * @param userId User Id. (required) + * @param imageType (Unused) Image type. (required) + * @param index (Unused) Image index. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { + return deleteUserImageByIndexWithHttpInfo(userId, imageType, index, null); + } + + /** + * Delete the user's image. + * + * @param userId User Id. (required) + * @param imageType (Unused) Image type. (required) + * @param index (Unused) Image index. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer index, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteUserImageByIndexRequestBuilder(userId, imageType, index, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteUserImageByIndex", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteUserImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer index, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling deleteUserImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling deleteUserImageByIndex"); + } + // verify the required parameter 'index' is set + if (index == null) { + throw new ApiException(400, "Missing the required parameter 'index' when calling deleteUserImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Images/{imageType}/{index}" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{index}", ApiClient.urlEncode(index.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get artist image by name. + * + * @param name Artist name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getArtistImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getArtistImage(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, null); + } + + /** + * Get artist image by name. + * + * @param name Artist name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getArtistImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = getArtistImageWithHttpInfo(name, imageType, imageIndex, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Get artist image by name. + * + * @param name Artist name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getArtistImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getArtistImageWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, null); + } + + /** + * Get artist image by name. + * + * @param name Artist name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getArtistImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getArtistImageRequestBuilder(name, imageType, imageIndex, tag, + format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getArtistImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getArtistImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getArtistImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getArtistImage"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, "Missing the required parameter 'imageIndex' when calling getArtistImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Artists/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getGenreImage(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, + height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, + foregroundLayer, imageIndex, null); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + ApiResponse localVarResponse = getGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + return localVarResponse.getData(); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGenreImageRequestBuilder(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getGenreImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getGenreImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getGenreImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getGenreImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Genres/{name}/Images/{imageType}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getGenreImageByIndex(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, null); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = getGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, null); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGenreImageByIndexRequestBuilder(name, imageType, imageIndex, + tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getGenreImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getGenreImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getGenreImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getGenreImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling getGenreImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Genres/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getItemImage(itemId, imageType, maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, + cropWhitespace, format, addPlayedIndicator, percentPlayed, unplayedCount, blur, backgroundColor, + foregroundLayer, imageIndex, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + ApiResponse localVarResponse = getItemImageWithHttpInfo(itemId, imageType, maxWidth, maxHeight, width, + height, quality, fillWidth, fillHeight, tag, cropWhitespace, format, addPlayedIndicator, percentPlayed, + unplayedCount, blur, backgroundColor, foregroundLayer, imageIndex, headers); + return localVarResponse.getData(); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getItemImageWithHttpInfo(itemId, imageType, maxWidth, maxHeight, width, height, quality, fillWidth, + fillHeight, tag, cropWhitespace, format, addPlayedIndicator, percentPlayed, unplayedCount, blur, + backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemImageRequestBuilder(itemId, imageType, maxWidth, maxHeight, + width, height, quality, fillWidth, fillHeight, tag, cropWhitespace, format, addPlayedIndicator, + percentPlayed, unplayedCount, blur, backgroundColor, foregroundLayer, imageIndex, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItemImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getItemImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (required) + * @param maxHeight The maximum image height to return. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (required) + * @param format Determines the output format of the image - original,gif,jpg,png. (required) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (required) + * @param unplayedCount Optional. Unplayed count overlay to render. (required) + * @param imageIndex Image index. (required) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getItemImage2(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getItemImage2(itemId, imageType, maxWidth, maxHeight, tag, format, percentPlayed, unplayedCount, + imageIndex, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (required) + * @param maxHeight The maximum image height to return. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (required) + * @param format Determines the output format of the image - original,gif,jpg,png. (required) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (required) + * @param unplayedCount Optional. Unplayed count overlay to render. (required) + * @param imageIndex Image index. (required) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getItemImage2(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = getItemImage2WithHttpInfo(itemId, imageType, maxWidth, maxHeight, tag, + format, percentPlayed, unplayedCount, imageIndex, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (required) + * @param maxHeight The maximum image height to return. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (required) + * @param format Determines the output format of the image - original,gif,jpg,png. (required) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (required) + * @param unplayedCount Optional. Unplayed count overlay to render. (required) + * @param imageIndex Image index. (required) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemImage2WithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getItemImage2WithHttpInfo(itemId, imageType, maxWidth, maxHeight, tag, format, percentPlayed, + unplayedCount, imageIndex, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (required) + * @param maxHeight The maximum image height to return. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (required) + * @param format Determines the output format of the image - original,gif,jpg,png. (required) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (required) + * @param unplayedCount Optional. Unplayed count overlay to render. (required) + * @param imageIndex Image index. (required) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemImage2WithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemImage2RequestBuilder(itemId, imageType, maxWidth, maxHeight, + tag, format, percentPlayed, unplayedCount, imageIndex, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItemImage2", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemImage2RequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemImage2"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getItemImage2"); + } + // verify the required parameter 'maxWidth' is set + if (maxWidth == null) { + throw new ApiException(400, "Missing the required parameter 'maxWidth' when calling getItemImage2"); + } + // verify the required parameter 'maxHeight' is set + if (maxHeight == null) { + throw new ApiException(400, "Missing the required parameter 'maxHeight' when calling getItemImage2"); + } + // verify the required parameter 'tag' is set + if (tag == null) { + throw new ApiException(400, "Missing the required parameter 'tag' when calling getItemImage2"); + } + // verify the required parameter 'format' is set + if (format == null) { + throw new ApiException(400, "Missing the required parameter 'format' when calling getItemImage2"); + } + // verify the required parameter 'percentPlayed' is set + if (percentPlayed == null) { + throw new ApiException(400, "Missing the required parameter 'percentPlayed' when calling getItemImage2"); + } + // verify the required parameter 'unplayedCount' is set + if (unplayedCount == null) { + throw new ApiException(400, "Missing the required parameter 'unplayedCount' when calling getItemImage2"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, "Missing the required parameter 'imageIndex' when calling getItemImage2"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{maxWidth}", ApiClient.urlEncode(maxWidth.toString())) + .replace("{maxHeight}", ApiClient.urlEncode(maxHeight.toString())) + .replace("{tag}", ApiClient.urlEncode(tag.toString())) + .replace("{format}", ApiClient.urlEncode(format.toString())) + .replace("{percentPlayed}", ApiClient.urlEncode(percentPlayed.toString())) + .replace("{unplayedCount}", ApiClient.urlEncode(unplayedCount.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getItemImageByIndex(itemId, imageType, imageIndex, maxWidth, maxHeight, width, height, quality, + fillWidth, fillHeight, tag, cropWhitespace, format, addPlayedIndicator, percentPlayed, unplayedCount, + blur, backgroundColor, foregroundLayer, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = getItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, maxWidth, + maxHeight, width, height, quality, fillWidth, fillHeight, tag, cropWhitespace, format, + addPlayedIndicator, percentPlayed, unplayedCount, blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, maxWidth, maxHeight, width, height, + quality, fillWidth, fillHeight, tag, cropWhitespace, format, addPlayedIndicator, percentPlayed, + unplayedCount, blur, backgroundColor, foregroundLayer, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemImageByIndexRequestBuilder(itemId, imageType, imageIndex, + maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, cropWhitespace, format, + addPlayedIndicator, percentPlayed, unplayedCount, blur, backgroundColor, foregroundLayer, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItemImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getItemImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, "Missing the required parameter 'imageIndex' when calling getItemImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}/{imageIndex}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get item image infos. + * + * @param itemId Item id. (required) + * @return List<ImageInfo> + * @throws ApiException if fails to make API call + */ + public List getItemImageInfos(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return getItemImageInfos(itemId, null); + } + + /** + * Get item image infos. + * + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return List<ImageInfo> + * @throws ApiException if fails to make API call + */ + public List getItemImageInfos(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getItemImageInfosWithHttpInfo(itemId, headers); + return localVarResponse.getData(); + } + + /** + * Get item image infos. + * + * @param itemId Item id. (required) + * @return ApiResponse<List<ImageInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getItemImageInfosWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + return getItemImageInfosWithHttpInfo(itemId, null); + } + + /** + * Get item image infos. + * + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<ImageInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getItemImageInfosWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemImageInfosRequestBuilder(itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItemImageInfos", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemImageInfosRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItemImageInfos"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getMusicGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getMusicGenreImage(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, + width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getMusicGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + ApiResponse localVarResponse = getMusicGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + return localVarResponse.getData(); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMusicGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getMusicGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMusicGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMusicGenreImageRequestBuilder(name, imageType, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMusicGenreImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMusicGenreImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getMusicGenreImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getMusicGenreImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MusicGenres/{name}/Images/{imageType}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getMusicGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getMusicGenreImageByIndex(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, null); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getMusicGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = getMusicGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, + format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMusicGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getMusicGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, null); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMusicGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMusicGenreImageByIndexRequestBuilder(name, imageType, + imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, + fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMusicGenreImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMusicGenreImageByIndexRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getMusicGenreImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling getMusicGenreImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling getMusicGenreImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MusicGenres/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getPersonImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getPersonImage(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, + height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, + foregroundLayer, imageIndex, null); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getPersonImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + ApiResponse localVarResponse = getPersonImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + return localVarResponse.getData(); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPersonImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getPersonImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPersonImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPersonImageRequestBuilder(name, imageType, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPersonImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPersonImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getPersonImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getPersonImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Persons/{name}/Images/{imageType}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getPersonImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getPersonImageByIndex(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, null); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getPersonImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = getPersonImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPersonImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getPersonImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, null); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPersonImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPersonImageByIndexRequestBuilder(name, imageType, imageIndex, + tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPersonImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPersonImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getPersonImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling getPersonImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling getPersonImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Persons/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Generates or gets the splashscreen. + * + * @param tag Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Blur image. (optional) + * @param backgroundColor Apply a background color for transparent images. (optional) + * @param foregroundLayer Apply a foreground layer on top of the image. (optional) + * @param quality Quality setting, from 0-100. (optional, default to 90) + * @return File + * @throws ApiException if fails to make API call + */ + public File getSplashscreen(@org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer quality) throws ApiException { + return getSplashscreen(tag, format, maxWidth, maxHeight, width, height, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, quality, null); + } + + /** + * Generates or gets the splashscreen. + * + * @param tag Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Blur image. (optional) + * @param backgroundColor Apply a background color for transparent images. (optional) + * @param foregroundLayer Apply a foreground layer on top of the image. (optional) + * @param quality Quality setting, from 0-100. (optional, default to 90) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getSplashscreen(@org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer quality, Map headers) throws ApiException { + ApiResponse localVarResponse = getSplashscreenWithHttpInfo(tag, format, maxWidth, maxHeight, width, + height, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, quality, headers); + return localVarResponse.getData(); + } + + /** + * Generates or gets the splashscreen. + * + * @param tag Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Blur image. (optional) + * @param backgroundColor Apply a background color for transparent images. (optional) + * @param foregroundLayer Apply a foreground layer on top of the image. (optional) + * @param quality Quality setting, from 0-100. (optional, default to 90) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSplashscreenWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer quality) throws ApiException { + return getSplashscreenWithHttpInfo(tag, format, maxWidth, maxHeight, width, height, fillWidth, fillHeight, blur, + backgroundColor, foregroundLayer, quality, null); + } + + /** + * Generates or gets the splashscreen. + * + * @param tag Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param blur Blur image. (optional) + * @param backgroundColor Apply a background color for transparent images. (optional) + * @param foregroundLayer Apply a foreground layer on top of the image. (optional) + * @param quality Quality setting, from 0-100. (optional, default to 90) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSplashscreenWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer quality, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSplashscreenRequestBuilder(tag, format, maxWidth, maxHeight, + width, height, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, quality, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSplashscreen", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSplashscreenRequestBuilder(@org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer quality, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Branding/Splashscreen"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "image/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getStudioImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getStudioImage(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, + height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, + foregroundLayer, imageIndex, null); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getStudioImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + ApiResponse localVarResponse = getStudioImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + return localVarResponse.getData(); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStudioImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getStudioImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStudioImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getStudioImageRequestBuilder(name, imageType, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getStudioImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getStudioImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getStudioImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getStudioImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Studios/{name}/Images/{imageType}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getStudioImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getStudioImageByIndex(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, null); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getStudioImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = getStudioImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStudioImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getStudioImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, null); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStudioImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getStudioImageByIndexRequestBuilder(name, imageType, imageIndex, + tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getStudioImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getStudioImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getStudioImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling getStudioImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling getStudioImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Studios/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get user profile image. + * + * @param userId User id. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getUserImage(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getUserImage(userId, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, + height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, + foregroundLayer, imageIndex, null); + } + + /** + * Get user profile image. + * + * @param userId User id. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getUserImage(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + ApiResponse localVarResponse = getUserImageWithHttpInfo(userId, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + return localVarResponse.getData(); + } + + /** + * Get user profile image. + * + * @param userId User id. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return getUserImageWithHttpInfo(userId, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get user profile image. + * + * @param userId User id. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUserImageRequestBuilder(userId, imageType, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getUserImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUserImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getUserImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getUserImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Images/{imageType}" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get user profile image. + * + * @param userId User id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getUserImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getUserImageByIndex(userId, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, null); + } + + /** + * Get user profile image. + * + * @param userId User id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getUserImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = getUserImageByIndexWithHttpInfo(userId, imageType, imageIndex, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Get user profile image. + * + * @param userId User id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return getUserImageByIndexWithHttpInfo(userId, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, null); + } + + /** + * Get user profile image. + * + * @param userId User id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUserImageByIndexRequestBuilder(userId, imageType, imageIndex, + tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getUserImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUserImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getUserImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling getUserImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, "Missing the required parameter 'imageIndex' when calling getUserImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Images/{imageType}/{imageIndex}" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get artist image by name. + * + * @param name Artist name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headArtistImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headArtistImage(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, null); + } + + /** + * Get artist image by name. + * + * @param name Artist name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headArtistImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = headArtistImageWithHttpInfo(name, imageType, imageIndex, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Get artist image by name. + * + * @param name Artist name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headArtistImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headArtistImageWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, null); + } + + /** + * Get artist image by name. + * + * @param name Artist name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headArtistImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headArtistImageRequestBuilder(name, imageType, imageIndex, tag, + format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headArtistImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headArtistImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling headArtistImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headArtistImage"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, "Missing the required parameter 'imageIndex' when calling headArtistImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Artists/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headGenreImage(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, + height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, + foregroundLayer, imageIndex, null); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + ApiResponse localVarResponse = headGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + return localVarResponse.getData(); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headGenreImageRequestBuilder(name, imageType, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headGenreImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headGenreImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling headGenreImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headGenreImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Genres/{name}/Images/{imageType}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headGenreImageByIndex(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, null); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = headGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, null); + } + + /** + * Get genre image by name. + * + * @param name Genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headGenreImageByIndexRequestBuilder(name, imageType, imageIndex, + tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headGenreImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headGenreImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling headGenreImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling headGenreImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling headGenreImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Genres/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headItemImage(itemId, imageType, maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, + cropWhitespace, format, addPlayedIndicator, percentPlayed, unplayedCount, blur, backgroundColor, + foregroundLayer, imageIndex, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + ApiResponse localVarResponse = headItemImageWithHttpInfo(itemId, imageType, maxWidth, maxHeight, width, + height, quality, fillWidth, fillHeight, tag, cropWhitespace, format, addPlayedIndicator, percentPlayed, + unplayedCount, blur, backgroundColor, foregroundLayer, imageIndex, headers); + return localVarResponse.getData(); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headItemImageWithHttpInfo(itemId, imageType, maxWidth, maxHeight, width, height, quality, fillWidth, + fillHeight, tag, cropWhitespace, format, addPlayedIndicator, percentPlayed, unplayedCount, blur, + backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headItemImageRequestBuilder(itemId, imageType, maxWidth, maxHeight, + width, height, quality, fillWidth, fillHeight, tag, cropWhitespace, format, addPlayedIndicator, + percentPlayed, unplayedCount, blur, backgroundColor, foregroundLayer, imageIndex, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headItemImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headItemImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling headItemImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headItemImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (required) + * @param maxHeight The maximum image height to return. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (required) + * @param format Determines the output format of the image - original,gif,jpg,png. (required) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (required) + * @param unplayedCount Optional. Unplayed count overlay to render. (required) + * @param imageIndex Image index. (required) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headItemImage2(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headItemImage2(itemId, imageType, maxWidth, maxHeight, tag, format, percentPlayed, unplayedCount, + imageIndex, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (required) + * @param maxHeight The maximum image height to return. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (required) + * @param format Determines the output format of the image - original,gif,jpg,png. (required) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (required) + * @param unplayedCount Optional. Unplayed count overlay to render. (required) + * @param imageIndex Image index. (required) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headItemImage2(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = headItemImage2WithHttpInfo(itemId, imageType, maxWidth, maxHeight, tag, + format, percentPlayed, unplayedCount, imageIndex, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (required) + * @param maxHeight The maximum image height to return. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (required) + * @param format Determines the output format of the image - original,gif,jpg,png. (required) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (required) + * @param unplayedCount Optional. Unplayed count overlay to render. (required) + * @param imageIndex Image index. (required) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headItemImage2WithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headItemImage2WithHttpInfo(itemId, imageType, maxWidth, maxHeight, tag, format, percentPlayed, + unplayedCount, imageIndex, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param maxWidth The maximum image width to return. (required) + * @param maxHeight The maximum image height to return. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (required) + * @param format Determines the output format of the image - original,gif,jpg,png. (required) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (required) + * @param unplayedCount Optional. Unplayed count overlay to render. (required) + * @param imageIndex Image index. (required) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headItemImage2WithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headItemImage2RequestBuilder(itemId, imageType, maxWidth, + maxHeight, tag, format, percentPlayed, unplayedCount, imageIndex, width, height, quality, fillWidth, + fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headItemImage2", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headItemImage2RequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer maxWidth, + @org.eclipse.jdt.annotation.Nullable Integer maxHeight, @org.eclipse.jdt.annotation.Nullable String tag, + @org.eclipse.jdt.annotation.Nullable ImageFormat format, + @org.eclipse.jdt.annotation.Nullable Double percentPlayed, + @org.eclipse.jdt.annotation.Nullable Integer unplayedCount, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer quality, + @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling headItemImage2"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headItemImage2"); + } + // verify the required parameter 'maxWidth' is set + if (maxWidth == null) { + throw new ApiException(400, "Missing the required parameter 'maxWidth' when calling headItemImage2"); + } + // verify the required parameter 'maxHeight' is set + if (maxHeight == null) { + throw new ApiException(400, "Missing the required parameter 'maxHeight' when calling headItemImage2"); + } + // verify the required parameter 'tag' is set + if (tag == null) { + throw new ApiException(400, "Missing the required parameter 'tag' when calling headItemImage2"); + } + // verify the required parameter 'format' is set + if (format == null) { + throw new ApiException(400, "Missing the required parameter 'format' when calling headItemImage2"); + } + // verify the required parameter 'percentPlayed' is set + if (percentPlayed == null) { + throw new ApiException(400, "Missing the required parameter 'percentPlayed' when calling headItemImage2"); + } + // verify the required parameter 'unplayedCount' is set + if (unplayedCount == null) { + throw new ApiException(400, "Missing the required parameter 'unplayedCount' when calling headItemImage2"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, "Missing the required parameter 'imageIndex' when calling headItemImage2"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{maxWidth}", ApiClient.urlEncode(maxWidth.toString())) + .replace("{maxHeight}", ApiClient.urlEncode(maxHeight.toString())) + .replace("{tag}", ApiClient.urlEncode(tag.toString())) + .replace("{format}", ApiClient.urlEncode(format.toString())) + .replace("{percentPlayed}", ApiClient.urlEncode(percentPlayed.toString())) + .replace("{unplayedCount}", ApiClient.urlEncode(unplayedCount.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headItemImageByIndex(itemId, imageType, imageIndex, maxWidth, maxHeight, width, height, quality, + fillWidth, fillHeight, tag, cropWhitespace, format, addPlayedIndicator, percentPlayed, unplayedCount, + blur, backgroundColor, foregroundLayer, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = headItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, maxWidth, + maxHeight, width, height, quality, fillWidth, fillHeight, tag, cropWhitespace, format, + addPlayedIndicator, percentPlayed, unplayedCount, blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, maxWidth, maxHeight, width, height, + quality, fillWidth, fillHeight, tag, cropWhitespace, format, addPlayedIndicator, percentPlayed, + unplayedCount, blur, backgroundColor, foregroundLayer, null); + } + + /** + * Gets the item's image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headItemImageByIndexRequestBuilder(itemId, imageType, imageIndex, + maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, cropWhitespace, format, + addPlayedIndicator, percentPlayed, unplayedCount, blur, backgroundColor, foregroundLayer, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headItemImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headItemImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling headItemImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headItemImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling headItemImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}/{imageIndex}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headMusicGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headMusicGenreImage(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, + width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headMusicGenreImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + ApiResponse localVarResponse = headMusicGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + return localVarResponse.getData(); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headMusicGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headMusicGenreImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headMusicGenreImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headMusicGenreImageRequestBuilder(name, imageType, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headMusicGenreImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headMusicGenreImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling headMusicGenreImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headMusicGenreImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MusicGenres/{name}/Images/{imageType}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headMusicGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headMusicGenreImageByIndex(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, null); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headMusicGenreImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = headMusicGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, + format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headMusicGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headMusicGenreImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, null); + } + + /** + * Get music genre image by name. + * + * @param name Music genre name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headMusicGenreImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headMusicGenreImageByIndexRequestBuilder(name, imageType, + imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, + fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headMusicGenreImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headMusicGenreImageByIndexRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, + "Missing the required parameter 'name' when calling headMusicGenreImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling headMusicGenreImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling headMusicGenreImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MusicGenres/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headPersonImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headPersonImage(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, + height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, + foregroundLayer, imageIndex, null); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headPersonImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + ApiResponse localVarResponse = headPersonImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + return localVarResponse.getData(); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headPersonImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headPersonImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headPersonImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headPersonImageRequestBuilder(name, imageType, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headPersonImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headPersonImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling headPersonImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headPersonImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Persons/{name}/Images/{imageType}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headPersonImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headPersonImageByIndex(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, null); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headPersonImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = headPersonImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, + format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headPersonImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headPersonImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, null); + } + + /** + * Get person image by name. + * + * @param name Person name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headPersonImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headPersonImageByIndexRequestBuilder(name, imageType, imageIndex, + tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headPersonImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headPersonImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling headPersonImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling headPersonImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling headPersonImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Persons/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headStudioImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headStudioImage(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, + height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, + foregroundLayer, imageIndex, null); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headStudioImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + ApiResponse localVarResponse = headStudioImageWithHttpInfo(name, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + return localVarResponse.getData(); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headStudioImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headStudioImageWithHttpInfo(name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headStudioImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headStudioImageRequestBuilder(name, imageType, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headStudioImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headStudioImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling headStudioImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headStudioImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Studios/{name}/Images/{imageType}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headStudioImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headStudioImageByIndex(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, null); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headStudioImageByIndex(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = headStudioImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, + format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headStudioImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headStudioImageByIndexWithHttpInfo(name, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, null); + } + + /** + * Get studio image by name. + * + * @param name Studio name. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headStudioImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headStudioImageByIndexRequestBuilder(name, imageType, imageIndex, + tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headStudioImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headStudioImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling headStudioImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, + "Missing the required parameter 'imageType' when calling headStudioImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling headStudioImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Studios/{name}/Images/{imageType}/{imageIndex}" + .replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get user profile image. + * + * @param userId User id. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headUserImage(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headUserImage(userId, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, + height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, + foregroundLayer, imageIndex, null); + } + + /** + * Get user profile image. + * + * @param userId User id. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headUserImage(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + ApiResponse localVarResponse = headUserImageWithHttpInfo(userId, imageType, tag, format, maxWidth, + maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + return localVarResponse.getData(); + } + + /** + * Get user profile image. + * + * @param userId User id. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headUserImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex) throws ApiException { + return headUserImageWithHttpInfo(userId, imageType, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, imageIndex, null); + } + + /** + * Get user profile image. + * + * @param userId User id. (required) + * @param imageType Image type. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param imageIndex Image index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headUserImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headUserImageRequestBuilder(userId, imageType, tag, format, + maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, + cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, imageIndex, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headUserImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headUserImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, + @org.eclipse.jdt.annotation.NonNull Integer imageIndex, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling headUserImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headUserImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Images/{imageType}" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + localVarQueryParameterBaseName = "imageIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageIndex", imageIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get user profile image. + * + * @param userId User id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headUserImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headUserImageByIndex(userId, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, + unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, addPlayedIndicator, blur, + backgroundColor, foregroundLayer, null); + } + + /** + * Get user profile image. + * + * @param userId User id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headUserImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + ApiResponse localVarResponse = headUserImageByIndexWithHttpInfo(userId, imageType, imageIndex, tag, + format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + return localVarResponse.getData(); + } + + /** + * Get user profile image. + * + * @param userId User id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headUserImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer) throws ApiException { + return headUserImageByIndexWithHttpInfo(userId, imageType, imageIndex, tag, format, maxWidth, maxHeight, + percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, cropWhitespace, + addPlayedIndicator, blur, backgroundColor, foregroundLayer, null); + } + + /** + * Get user profile image. + * + * @param userId User id. (required) + * @param imageType Image type. (required) + * @param imageIndex Image index. (required) + * @param tag Optional. Supply the cache tag from the item object to receive strong caching headers. (optional) + * @param format Determines the output format of the image - original,gif,jpg,png. (optional) + * @param maxWidth The maximum image width to return. (optional) + * @param maxHeight The maximum image height to return. (optional) + * @param percentPlayed Optional. Percent to render for the percent played overlay. (optional) + * @param unplayedCount Optional. Unplayed count overlay to render. (optional) + * @param width The fixed image width to return. (optional) + * @param height The fixed image height to return. (optional) + * @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. (optional) + * @param fillWidth Width of box to fill. (optional) + * @param fillHeight Height of box to fill. (optional) + * @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If + * unspecified, whitespace will be cropped from logos and clear art. (optional) + * @param addPlayedIndicator Optional. Add a played indicator. (optional) + * @param blur Optional. Blur image. (optional) + * @param backgroundColor Optional. Apply a background color for transparent images. (optional) + * @param foregroundLayer Optional. Apply a foreground layer on top of the image. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headUserImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headUserImageByIndexRequestBuilder(userId, imageType, imageIndex, + tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, + fillHeight, cropWhitespace, addPlayedIndicator, blur, backgroundColor, foregroundLayer, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headUserImageByIndex", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headUserImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull ImageFormat format, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Double percentPlayed, + @org.eclipse.jdt.annotation.NonNull Integer unplayedCount, + @org.eclipse.jdt.annotation.NonNull Integer width, @org.eclipse.jdt.annotation.NonNull Integer height, + @org.eclipse.jdt.annotation.NonNull Integer quality, @org.eclipse.jdt.annotation.NonNull Integer fillWidth, + @org.eclipse.jdt.annotation.NonNull Integer fillHeight, + @org.eclipse.jdt.annotation.NonNull Boolean cropWhitespace, + @org.eclipse.jdt.annotation.NonNull Boolean addPlayedIndicator, + @org.eclipse.jdt.annotation.NonNull Integer blur, + @org.eclipse.jdt.annotation.NonNull String backgroundColor, + @org.eclipse.jdt.annotation.NonNull String foregroundLayer, Map headers) + throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling headUserImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling headUserImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling headUserImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Images/{imageType}/{imageIndex}" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "percentPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("percentPlayed", percentPlayed)); + localVarQueryParameterBaseName = "unplayedCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("unplayedCount", unplayedCount)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "fillWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillWidth", fillWidth)); + localVarQueryParameterBaseName = "fillHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fillHeight", fillHeight)); + localVarQueryParameterBaseName = "cropWhitespace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cropWhitespace", cropWhitespace)); + localVarQueryParameterBaseName = "addPlayedIndicator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addPlayedIndicator", addPlayedIndicator)); + localVarQueryParameterBaseName = "blur"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("blur", blur)); + localVarQueryParameterBaseName = "backgroundColor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backgroundColor", backgroundColor)); + localVarQueryParameterBaseName = "foregroundLayer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("foregroundLayer", foregroundLayer)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sets the user image. + * + * @param userId User Id. (required) + * @param imageType (Unused) Image type. (required) + * @param index (Unused) Image index. (optional) + * @param body (optional) + * @throws ApiException if fails to make API call + */ + public void postUserImage(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull File body) throws ApiException { + postUserImage(userId, imageType, index, body, null); + } + + /** + * Sets the user image. + * + * @param userId User Id. (required) + * @param imageType (Unused) Image type. (required) + * @param index (Unused) Image index. (optional) + * @param body (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postUserImage(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull File body, Map headers) throws ApiException { + postUserImageWithHttpInfo(userId, imageType, index, body, headers); + } + + /** + * Sets the user image. + * + * @param userId User Id. (required) + * @param imageType (Unused) Image type. (required) + * @param index (Unused) Image index. (optional) + * @param body (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUserImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull File body) throws ApiException { + return postUserImageWithHttpInfo(userId, imageType, index, body, null); + } + + /** + * Sets the user image. + * + * @param userId User Id. (required) + * @param imageType (Unused) Image type. (required) + * @param index (Unused) Image index. (optional) + * @param body (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUserImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull File body, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postUserImageRequestBuilder(userId, imageType, index, body, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postUserImage", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postUserImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull File body, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling postUserImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling postUserImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Images/{imageType}" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "index"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("index", index)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "image/*"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sets the user image. + * + * @param userId User Id. (required) + * @param imageType (Unused) Image type. (required) + * @param index (Unused) Image index. (required) + * @param body (optional) + * @throws ApiException if fails to make API call + */ + public void postUserImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer index, @org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + postUserImageByIndex(userId, imageType, index, body, null); + } + + /** + * Sets the user image. + * + * @param userId User Id. (required) + * @param imageType (Unused) Image type. (required) + * @param index (Unused) Image index. (required) + * @param body (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postUserImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer index, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + postUserImageByIndexWithHttpInfo(userId, imageType, index, body, headers); + } + + /** + * Sets the user image. + * + * @param userId User Id. (required) + * @param imageType (Unused) Image type. (required) + * @param index (Unused) Image index. (required) + * @param body (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUserImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer index, @org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + return postUserImageByIndexWithHttpInfo(userId, imageType, index, body, null); + } + + /** + * Sets the user image. + * + * @param userId User Id. (required) + * @param imageType (Unused) Image type. (required) + * @param index (Unused) Image index. (required) + * @param body (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUserImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer index, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postUserImageByIndexRequestBuilder(userId, imageType, index, body, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postUserImageByIndex", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postUserImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer index, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling postUserImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling postUserImageByIndex"); + } + // verify the required parameter 'index' is set + if (index == null) { + throw new ApiException(400, "Missing the required parameter 'index' when calling postUserImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Images/{imageType}/{index}" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{index}", ApiClient.urlEncode(index.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "image/*"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param body (optional) + * @throws ApiException if fails to make API call + */ + public void setItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + setItemImage(itemId, imageType, body, null); + } + + /** + * Set item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param body (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void setItemImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + setItemImageWithHttpInfo(itemId, imageType, body, headers); + } + + /** + * Set item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param body (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + return setItemImageWithHttpInfo(itemId, imageType, body, null); + } + + /** + * Set item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param body (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setItemImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = setItemImageRequestBuilder(itemId, imageType, body, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("setItemImage", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder setItemImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling setItemImage"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling setItemImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "image/*"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex (Unused) Image index. (required) + * @param body (optional) + * @throws ApiException if fails to make API call + */ + public void setItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + setItemImageByIndex(itemId, imageType, imageIndex, body, null); + } + + /** + * Set item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex (Unused) Image index. (required) + * @param body (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void setItemImageByIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + setItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, body, headers); + } + + /** + * Set item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex (Unused) Image index. (required) + * @param body (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + return setItemImageByIndexWithHttpInfo(itemId, imageType, imageIndex, body, null); + } + + /** + * Set item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex (Unused) Image index. (required) + * @param body (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setItemImageByIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = setItemImageByIndexRequestBuilder(itemId, imageType, imageIndex, + body, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("setItemImageByIndex", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder setItemImageByIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, @org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling setItemImageByIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling setItemImageByIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, "Missing the required parameter 'imageIndex' when calling setItemImageByIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}/{imageIndex}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "image/*"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates the index for an item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Old image index. (required) + * @param newIndex New image index. (required) + * @throws ApiException if fails to make API call + */ + public void updateItemImageIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.Nullable Integer newIndex) throws ApiException { + updateItemImageIndex(itemId, imageType, imageIndex, newIndex, null); + } + + /** + * Updates the index for an item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Old image index. (required) + * @param newIndex New image index. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateItemImageIndex(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.Nullable Integer newIndex, Map headers) throws ApiException { + updateItemImageIndexWithHttpInfo(itemId, imageType, imageIndex, newIndex, headers); + } + + /** + * Updates the index for an item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Old image index. (required) + * @param newIndex New image index. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateItemImageIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.Nullable Integer newIndex) throws ApiException { + return updateItemImageIndexWithHttpInfo(itemId, imageType, imageIndex, newIndex, null); + } + + /** + * Updates the index for an item image. + * + * @param itemId Item id. (required) + * @param imageType Image type. (required) + * @param imageIndex Old image index. (required) + * @param newIndex New image index. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateItemImageIndexWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.Nullable Integer newIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateItemImageIndexRequestBuilder(itemId, imageType, imageIndex, + newIndex, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateItemImageIndex", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateItemImageIndexRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType imageType, + @org.eclipse.jdt.annotation.Nullable Integer imageIndex, + @org.eclipse.jdt.annotation.Nullable Integer newIndex, Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling updateItemImageIndex"); + } + // verify the required parameter 'imageType' is set + if (imageType == null) { + throw new ApiException(400, "Missing the required parameter 'imageType' when calling updateItemImageIndex"); + } + // verify the required parameter 'imageIndex' is set + if (imageIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'imageIndex' when calling updateItemImageIndex"); + } + // verify the required parameter 'newIndex' is set + if (newIndex == null) { + throw new ApiException(400, "Missing the required parameter 'newIndex' when calling updateItemImageIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Images/{imageType}/{imageIndex}/Index" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{imageType}", ApiClient.urlEncode(imageType.toString())) + .replace("{imageIndex}", ApiClient.urlEncode(imageIndex.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "newIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("newIndex", newIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Uploads a custom splashscreen. The body is expected to the image contents base64 encoded. + * + * @param body (optional) + * @throws ApiException if fails to make API call + */ + public void uploadCustomSplashscreen(@org.eclipse.jdt.annotation.NonNull File body) throws ApiException { + uploadCustomSplashscreen(body, null); + } + + /** + * Uploads a custom splashscreen. The body is expected to the image contents base64 encoded. + * + * @param body (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void uploadCustomSplashscreen(@org.eclipse.jdt.annotation.NonNull File body, Map headers) + throws ApiException { + uploadCustomSplashscreenWithHttpInfo(body, headers); + } + + /** + * Uploads a custom splashscreen. The body is expected to the image contents base64 encoded. + * + * @param body (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse uploadCustomSplashscreenWithHttpInfo(@org.eclipse.jdt.annotation.NonNull File body) + throws ApiException { + return uploadCustomSplashscreenWithHttpInfo(body, null); + } + + /** + * Uploads a custom splashscreen. The body is expected to the image contents base64 encoded. + * + * @param body (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse uploadCustomSplashscreenWithHttpInfo(@org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uploadCustomSplashscreenRequestBuilder(body, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("uploadCustomSplashscreen", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uploadCustomSplashscreenRequestBuilder(@org.eclipse.jdt.annotation.NonNull File body, + Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Branding/Splashscreen"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "image/*"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ImageByNameApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ImageByNameApi.java new file mode 100644 index 0000000000000..c5a8f1f57f35a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ImageByNameApi.java @@ -0,0 +1,793 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageByNameInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ImageByNameApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ImageByNameApi() { + this(Configuration.getDefaultApiClient()); + } + + public ImageByNameApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Get General Image. + * + * @param name The name of the image. (required) + * @param type Image Type (primary, backdrop, logo, etc). (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getGeneralImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable String type) throws ApiException { + return getGeneralImage(name, type, null); + } + + /** + * Get General Image. + * + * @param name The name of the image. (required) + * @param type Image Type (primary, backdrop, logo, etc). (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getGeneralImage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable String type, Map headers) throws ApiException { + ApiResponse localVarResponse = getGeneralImageWithHttpInfo(name, type, headers); + return localVarResponse.getData(); + } + + /** + * Get General Image. + * + * @param name The name of the image. (required) + * @param type Image Type (primary, backdrop, logo, etc). (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGeneralImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable String type) throws ApiException { + return getGeneralImageWithHttpInfo(name, type, null); + } + + /** + * Get General Image. + * + * @param name The name of the image. (required) + * @param type Image Type (primary, backdrop, logo, etc). (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGeneralImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable String type, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGeneralImageRequestBuilder(name, type, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getGeneralImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getGeneralImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.Nullable String type, Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getGeneralImage"); + } + // verify the required parameter 'type' is set + if (type == null) { + throw new ApiException(400, "Missing the required parameter 'type' when calling getGeneralImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Images/General/{name}/{type}".replace("{name}", ApiClient.urlEncode(name.toString())) + .replace("{type}", ApiClient.urlEncode(type.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "image/*, application/octet-stream, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get all general images. + * + * @return List<ImageByNameInfo> + * @throws ApiException if fails to make API call + */ + public List getGeneralImages() throws ApiException { + return getGeneralImages(null); + } + + /** + * Get all general images. + * + * @param headers Optional headers to include in the request + * @return List<ImageByNameInfo> + * @throws ApiException if fails to make API call + */ + public List getGeneralImages(Map headers) throws ApiException { + ApiResponse> localVarResponse = getGeneralImagesWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Get all general images. + * + * @return ApiResponse<List<ImageByNameInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getGeneralImagesWithHttpInfo() throws ApiException { + return getGeneralImagesWithHttpInfo(null); + } + + /** + * Get all general images. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<ImageByNameInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getGeneralImagesWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGeneralImagesRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getGeneralImages", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getGeneralImagesRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Images/General"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get media info image. + * + * @param theme The theme to get the image from. (required) + * @param name The name of the image. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getMediaInfoImage(@org.eclipse.jdt.annotation.Nullable String theme, + @org.eclipse.jdt.annotation.Nullable String name) throws ApiException { + return getMediaInfoImage(theme, name, null); + } + + /** + * Get media info image. + * + * @param theme The theme to get the image from. (required) + * @param name The name of the image. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getMediaInfoImage(@org.eclipse.jdt.annotation.Nullable String theme, + @org.eclipse.jdt.annotation.Nullable String name, Map headers) throws ApiException { + ApiResponse localVarResponse = getMediaInfoImageWithHttpInfo(theme, name, headers); + return localVarResponse.getData(); + } + + /** + * Get media info image. + * + * @param theme The theme to get the image from. (required) + * @param name The name of the image. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMediaInfoImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String theme, + @org.eclipse.jdt.annotation.Nullable String name) throws ApiException { + return getMediaInfoImageWithHttpInfo(theme, name, null); + } + + /** + * Get media info image. + * + * @param theme The theme to get the image from. (required) + * @param name The name of the image. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMediaInfoImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String theme, + @org.eclipse.jdt.annotation.Nullable String name, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMediaInfoImageRequestBuilder(theme, name, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMediaInfoImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMediaInfoImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String theme, + @org.eclipse.jdt.annotation.Nullable String name, Map headers) throws ApiException { + // verify the required parameter 'theme' is set + if (theme == null) { + throw new ApiException(400, "Missing the required parameter 'theme' when calling getMediaInfoImage"); + } + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getMediaInfoImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Images/MediaInfo/{theme}/{name}" + .replace("{theme}", ApiClient.urlEncode(theme.toString())) + .replace("{name}", ApiClient.urlEncode(name.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "image/*, application/octet-stream, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get all media info images. + * + * @return List<ImageByNameInfo> + * @throws ApiException if fails to make API call + */ + public List getMediaInfoImages() throws ApiException { + return getMediaInfoImages(null); + } + + /** + * Get all media info images. + * + * @param headers Optional headers to include in the request + * @return List<ImageByNameInfo> + * @throws ApiException if fails to make API call + */ + public List getMediaInfoImages(Map headers) throws ApiException { + ApiResponse> localVarResponse = getMediaInfoImagesWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Get all media info images. + * + * @return ApiResponse<List<ImageByNameInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMediaInfoImagesWithHttpInfo() throws ApiException { + return getMediaInfoImagesWithHttpInfo(null); + } + + /** + * Get all media info images. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<ImageByNameInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMediaInfoImagesWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMediaInfoImagesRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMediaInfoImages", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMediaInfoImagesRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Images/MediaInfo"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get rating image. + * + * @param theme The theme to get the image from. (required) + * @param name The name of the image. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getRatingImage(@org.eclipse.jdt.annotation.Nullable String theme, + @org.eclipse.jdt.annotation.Nullable String name) throws ApiException { + return getRatingImage(theme, name, null); + } + + /** + * Get rating image. + * + * @param theme The theme to get the image from. (required) + * @param name The name of the image. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getRatingImage(@org.eclipse.jdt.annotation.Nullable String theme, + @org.eclipse.jdt.annotation.Nullable String name, Map headers) throws ApiException { + ApiResponse localVarResponse = getRatingImageWithHttpInfo(theme, name, headers); + return localVarResponse.getData(); + } + + /** + * Get rating image. + * + * @param theme The theme to get the image from. (required) + * @param name The name of the image. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRatingImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String theme, + @org.eclipse.jdt.annotation.Nullable String name) throws ApiException { + return getRatingImageWithHttpInfo(theme, name, null); + } + + /** + * Get rating image. + * + * @param theme The theme to get the image from. (required) + * @param name The name of the image. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRatingImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String theme, + @org.eclipse.jdt.annotation.Nullable String name, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRatingImageRequestBuilder(theme, name, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRatingImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRatingImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String theme, + @org.eclipse.jdt.annotation.Nullable String name, Map headers) throws ApiException { + // verify the required parameter 'theme' is set + if (theme == null) { + throw new ApiException(400, "Missing the required parameter 'theme' when calling getRatingImage"); + } + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getRatingImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Images/Ratings/{theme}/{name}".replace("{theme}", ApiClient.urlEncode(theme.toString())) + .replace("{name}", ApiClient.urlEncode(name.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "image/*, application/octet-stream, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get all general images. + * + * @return List<ImageByNameInfo> + * @throws ApiException if fails to make API call + */ + public List getRatingImages() throws ApiException { + return getRatingImages(null); + } + + /** + * Get all general images. + * + * @param headers Optional headers to include in the request + * @return List<ImageByNameInfo> + * @throws ApiException if fails to make API call + */ + public List getRatingImages(Map headers) throws ApiException { + ApiResponse> localVarResponse = getRatingImagesWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Get all general images. + * + * @return ApiResponse<List<ImageByNameInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getRatingImagesWithHttpInfo() throws ApiException { + return getRatingImagesWithHttpInfo(null); + } + + /** + * Get all general images. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<ImageByNameInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getRatingImagesWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRatingImagesRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRatingImages", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRatingImagesRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Images/Ratings"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/InstantMixApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/InstantMixApi.java new file mode 100644 index 0000000000000..e2269eecc480b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/InstantMixApi.java @@ -0,0 +1,1766 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFields; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class InstantMixApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public InstantMixApi() { + this(Configuration.getDefaultApiClient()); + } + + public InstantMixApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Creates an instant playlist based on a given album. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromAlbum(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromAlbum(id, userId, limit, fields, enableImages, enableUserData, imageTypeLimit, + enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given album. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromAlbum(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + ApiResponse localVarResponse = getInstantMixFromAlbumWithHttpInfo(id, userId, limit, + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + return localVarResponse.getData(); + } + + /** + * Creates an instant playlist based on a given album. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromAlbumWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromAlbumWithHttpInfo(id, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given album. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromAlbumWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInstantMixFromAlbumRequestBuilder(id, userId, limit, fields, + enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInstantMixFromAlbum", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInstantMixFromAlbumRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getInstantMixFromAlbum"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Albums/{id}/InstantMix".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates an instant playlist based on a given artist. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromArtists(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromArtists(id, userId, limit, fields, enableImages, enableUserData, imageTypeLimit, + enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given artist. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromArtists(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + ApiResponse localVarResponse = getInstantMixFromArtistsWithHttpInfo(id, userId, limit, + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + return localVarResponse.getData(); + } + + /** + * Creates an instant playlist based on a given artist. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromArtistsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromArtistsWithHttpInfo(id, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given artist. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromArtistsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInstantMixFromArtistsRequestBuilder(id, userId, limit, fields, + enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInstantMixFromArtists", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInstantMixFromArtistsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getInstantMixFromArtists"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Artists/{id}/InstantMix".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates an instant playlist based on a given artist. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getInstantMixFromArtists2(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromArtists2(id, userId, limit, fields, enableImages, enableUserData, imageTypeLimit, + enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given artist. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getInstantMixFromArtists2(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + ApiResponse localVarResponse = getInstantMixFromArtists2WithHttpInfo(id, userId, limit, + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + return localVarResponse.getData(); + } + + /** + * Creates an instant playlist based on a given artist. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getInstantMixFromArtists2WithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromArtists2WithHttpInfo(id, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given artist. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getInstantMixFromArtists2WithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInstantMixFromArtists2RequestBuilder(id, userId, limit, fields, + enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInstantMixFromArtists2", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInstantMixFromArtists2RequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getInstantMixFromArtists2"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Artists/InstantMix"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates an instant playlist based on a given item. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromItem(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromItem(id, userId, limit, fields, enableImages, enableUserData, imageTypeLimit, + enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given item. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromItem(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + ApiResponse localVarResponse = getInstantMixFromItemWithHttpInfo(id, userId, limit, + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + return localVarResponse.getData(); + } + + /** + * Creates an instant playlist based on a given item. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromItemWithHttpInfo(id, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given item. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInstantMixFromItemRequestBuilder(id, userId, limit, fields, + enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInstantMixFromItem", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInstantMixFromItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getInstantMixFromItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{id}/InstantMix".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates an instant playlist based on a given genre. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromMusicGenreById(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromMusicGenreById(id, userId, limit, fields, enableImages, enableUserData, imageTypeLimit, + enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given genre. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromMusicGenreById(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + ApiResponse localVarResponse = getInstantMixFromMusicGenreByIdWithHttpInfo(id, userId, + limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + return localVarResponse.getData(); + } + + /** + * Creates an instant playlist based on a given genre. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromMusicGenreByIdWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromMusicGenreByIdWithHttpInfo(id, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given genre. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromMusicGenreByIdWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInstantMixFromMusicGenreByIdRequestBuilder(id, userId, limit, + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInstantMixFromMusicGenreById", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInstantMixFromMusicGenreByIdRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, + "Missing the required parameter 'id' when calling getInstantMixFromMusicGenreById"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MusicGenres/InstantMix"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates an instant playlist based on a given genre. + * + * @param name The genre name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromMusicGenreByName(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromMusicGenreByName(name, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given genre. + * + * @param name The genre name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromMusicGenreByName(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + ApiResponse localVarResponse = getInstantMixFromMusicGenreByNameWithHttpInfo(name, + userId, limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + return localVarResponse.getData(); + } + + /** + * Creates an instant playlist based on a given genre. + * + * @param name The genre name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromMusicGenreByNameWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromMusicGenreByNameWithHttpInfo(name, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given genre. + * + * @param name The genre name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromMusicGenreByNameWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInstantMixFromMusicGenreByNameRequestBuilder(name, userId, + limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInstantMixFromMusicGenreByName", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInstantMixFromMusicGenreByNameRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String name, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, + "Missing the required parameter 'name' when calling getInstantMixFromMusicGenreByName"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MusicGenres/{name}/InstantMix".replace("{name}", ApiClient.urlEncode(name.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates an instant playlist based on a given playlist. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromPlaylist(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromPlaylist(id, userId, limit, fields, enableImages, enableUserData, imageTypeLimit, + enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given playlist. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromPlaylist(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + ApiResponse localVarResponse = getInstantMixFromPlaylistWithHttpInfo(id, userId, limit, + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + return localVarResponse.getData(); + } + + /** + * Creates an instant playlist based on a given playlist. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromPlaylistWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromPlaylistWithHttpInfo(id, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given playlist. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromPlaylistWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInstantMixFromPlaylistRequestBuilder(id, userId, limit, fields, + enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInstantMixFromPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInstantMixFromPlaylistRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getInstantMixFromPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists/{id}/InstantMix".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates an instant playlist based on a given song. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromSong(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromSong(id, userId, limit, fields, enableImages, enableUserData, imageTypeLimit, + enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given song. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getInstantMixFromSong(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + ApiResponse localVarResponse = getInstantMixFromSongWithHttpInfo(id, userId, limit, + fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + return localVarResponse.getData(); + } + + /** + * Creates an instant playlist based on a given song. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromSongWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getInstantMixFromSongWithHttpInfo(id, userId, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Creates an instant playlist based on a given song. + * + * @param id The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getInstantMixFromSongWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID id, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInstantMixFromSongRequestBuilder(id, userId, limit, fields, + enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInstantMixFromSong", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInstantMixFromSongRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID id, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getInstantMixFromSong"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Songs/{id}/InstantMix".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ItemLookupApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ItemLookupApi.java new file mode 100644 index 0000000000000..bcfba5614c1d9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ItemLookupApi.java @@ -0,0 +1,1542 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.AlbumInfoRemoteSearchQuery; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ArtistInfoRemoteSearchQuery; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BookInfoRemoteSearchQuery; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BoxSetInfoRemoteSearchQuery; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ExternalIdInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.MovieInfoRemoteSearchQuery; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.MusicVideoInfoRemoteSearchQuery; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PersonLookupInfoRemoteSearchQuery; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.RemoteSearchResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SeriesInfoRemoteSearchQuery; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.TrailerInfoRemoteSearchQuery; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ItemLookupApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ItemLookupApi() { + this(Configuration.getDefaultApiClient()); + } + + public ItemLookupApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Applies search criteria to an item and refreshes metadata. + * + * @param itemId Item id. (required) + * @param remoteSearchResult The remote search result. (required) + * @param replaceAllImages Optional. Whether or not to replace all images. Default: True. (optional, default to + * true) + * @throws ApiException if fails to make API call + */ + public void applySearchCriteria(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable RemoteSearchResult remoteSearchResult, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages) throws ApiException { + applySearchCriteria(itemId, remoteSearchResult, replaceAllImages, null); + } + + /** + * Applies search criteria to an item and refreshes metadata. + * + * @param itemId Item id. (required) + * @param remoteSearchResult The remote search result. (required) + * @param replaceAllImages Optional. Whether or not to replace all images. Default: True. (optional, default to + * true) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void applySearchCriteria(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable RemoteSearchResult remoteSearchResult, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, Map headers) + throws ApiException { + applySearchCriteriaWithHttpInfo(itemId, remoteSearchResult, replaceAllImages, headers); + } + + /** + * Applies search criteria to an item and refreshes metadata. + * + * @param itemId Item id. (required) + * @param remoteSearchResult The remote search result. (required) + * @param replaceAllImages Optional. Whether or not to replace all images. Default: True. (optional, default to + * true) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse applySearchCriteriaWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable RemoteSearchResult remoteSearchResult, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages) throws ApiException { + return applySearchCriteriaWithHttpInfo(itemId, remoteSearchResult, replaceAllImages, null); + } + + /** + * Applies search criteria to an item and refreshes metadata. + * + * @param itemId Item id. (required) + * @param remoteSearchResult The remote search result. (required) + * @param replaceAllImages Optional. Whether or not to replace all images. Default: True. (optional, default to + * true) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse applySearchCriteriaWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable RemoteSearchResult remoteSearchResult, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = applySearchCriteriaRequestBuilder(itemId, remoteSearchResult, + replaceAllImages, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("applySearchCriteria", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder applySearchCriteriaRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable RemoteSearchResult remoteSearchResult, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling applySearchCriteria"); + } + // verify the required parameter 'remoteSearchResult' is set + if (remoteSearchResult == null) { + throw new ApiException(400, + "Missing the required parameter 'remoteSearchResult' when calling applySearchCriteria"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/Apply/{itemId}".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "replaceAllImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("replaceAllImages", replaceAllImages)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(remoteSearchResult); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get book remote search. + * + * @param bookInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getBookRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable BookInfoRemoteSearchQuery bookInfoRemoteSearchQuery) + throws ApiException { + return getBookRemoteSearchResults(bookInfoRemoteSearchQuery, null); + } + + /** + * Get book remote search. + * + * @param bookInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getBookRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable BookInfoRemoteSearchQuery bookInfoRemoteSearchQuery, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getBookRemoteSearchResultsWithHttpInfo( + bookInfoRemoteSearchQuery, headers); + return localVarResponse.getData(); + } + + /** + * Get book remote search. + * + * @param bookInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getBookRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable BookInfoRemoteSearchQuery bookInfoRemoteSearchQuery) + throws ApiException { + return getBookRemoteSearchResultsWithHttpInfo(bookInfoRemoteSearchQuery, null); + } + + /** + * Get book remote search. + * + * @param bookInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getBookRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable BookInfoRemoteSearchQuery bookInfoRemoteSearchQuery, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBookRemoteSearchResultsRequestBuilder(bookInfoRemoteSearchQuery, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getBookRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getBookRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable BookInfoRemoteSearchQuery bookInfoRemoteSearchQuery, + Map headers) throws ApiException { + // verify the required parameter 'bookInfoRemoteSearchQuery' is set + if (bookInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'bookInfoRemoteSearchQuery' when calling getBookRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/Book"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(bookInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get box set remote search. + * + * @param boxSetInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getBoxSetRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable BoxSetInfoRemoteSearchQuery boxSetInfoRemoteSearchQuery) + throws ApiException { + return getBoxSetRemoteSearchResults(boxSetInfoRemoteSearchQuery, null); + } + + /** + * Get box set remote search. + * + * @param boxSetInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getBoxSetRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable BoxSetInfoRemoteSearchQuery boxSetInfoRemoteSearchQuery, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getBoxSetRemoteSearchResultsWithHttpInfo( + boxSetInfoRemoteSearchQuery, headers); + return localVarResponse.getData(); + } + + /** + * Get box set remote search. + * + * @param boxSetInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getBoxSetRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable BoxSetInfoRemoteSearchQuery boxSetInfoRemoteSearchQuery) + throws ApiException { + return getBoxSetRemoteSearchResultsWithHttpInfo(boxSetInfoRemoteSearchQuery, null); + } + + /** + * Get box set remote search. + * + * @param boxSetInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getBoxSetRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable BoxSetInfoRemoteSearchQuery boxSetInfoRemoteSearchQuery, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBoxSetRemoteSearchResultsRequestBuilder( + boxSetInfoRemoteSearchQuery, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getBoxSetRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getBoxSetRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable BoxSetInfoRemoteSearchQuery boxSetInfoRemoteSearchQuery, + Map headers) throws ApiException { + // verify the required parameter 'boxSetInfoRemoteSearchQuery' is set + if (boxSetInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'boxSetInfoRemoteSearchQuery' when calling getBoxSetRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/BoxSet"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(boxSetInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get the item's external id info. + * + * @param itemId Item id. (required) + * @return List<ExternalIdInfo> + * @throws ApiException if fails to make API call + */ + public List getExternalIdInfos(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + return getExternalIdInfos(itemId, null); + } + + /** + * Get the item's external id info. + * + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return List<ExternalIdInfo> + * @throws ApiException if fails to make API call + */ + public List getExternalIdInfos(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getExternalIdInfosWithHttpInfo(itemId, headers); + return localVarResponse.getData(); + } + + /** + * Get the item's external id info. + * + * @param itemId Item id. (required) + * @return ApiResponse<List<ExternalIdInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getExternalIdInfosWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return getExternalIdInfosWithHttpInfo(itemId, null); + } + + /** + * Get the item's external id info. + * + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<ExternalIdInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getExternalIdInfosWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getExternalIdInfosRequestBuilder(itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getExternalIdInfos", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getExternalIdInfosRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getExternalIdInfos"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/ExternalIdInfos".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get movie remote search. + * + * @param movieInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getMovieRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable MovieInfoRemoteSearchQuery movieInfoRemoteSearchQuery) + throws ApiException { + return getMovieRemoteSearchResults(movieInfoRemoteSearchQuery, null); + } + + /** + * Get movie remote search. + * + * @param movieInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getMovieRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable MovieInfoRemoteSearchQuery movieInfoRemoteSearchQuery, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getMovieRemoteSearchResultsWithHttpInfo( + movieInfoRemoteSearchQuery, headers); + return localVarResponse.getData(); + } + + /** + * Get movie remote search. + * + * @param movieInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMovieRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MovieInfoRemoteSearchQuery movieInfoRemoteSearchQuery) + throws ApiException { + return getMovieRemoteSearchResultsWithHttpInfo(movieInfoRemoteSearchQuery, null); + } + + /** + * Get movie remote search. + * + * @param movieInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMovieRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MovieInfoRemoteSearchQuery movieInfoRemoteSearchQuery, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMovieRemoteSearchResultsRequestBuilder( + movieInfoRemoteSearchQuery, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMovieRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMovieRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable MovieInfoRemoteSearchQuery movieInfoRemoteSearchQuery, + Map headers) throws ApiException { + // verify the required parameter 'movieInfoRemoteSearchQuery' is set + if (movieInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'movieInfoRemoteSearchQuery' when calling getMovieRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/Movie"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(movieInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get music album remote search. + * + * @param albumInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getMusicAlbumRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable AlbumInfoRemoteSearchQuery albumInfoRemoteSearchQuery) + throws ApiException { + return getMusicAlbumRemoteSearchResults(albumInfoRemoteSearchQuery, null); + } + + /** + * Get music album remote search. + * + * @param albumInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getMusicAlbumRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable AlbumInfoRemoteSearchQuery albumInfoRemoteSearchQuery, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getMusicAlbumRemoteSearchResultsWithHttpInfo( + albumInfoRemoteSearchQuery, headers); + return localVarResponse.getData(); + } + + /** + * Get music album remote search. + * + * @param albumInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMusicAlbumRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable AlbumInfoRemoteSearchQuery albumInfoRemoteSearchQuery) + throws ApiException { + return getMusicAlbumRemoteSearchResultsWithHttpInfo(albumInfoRemoteSearchQuery, null); + } + + /** + * Get music album remote search. + * + * @param albumInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMusicAlbumRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable AlbumInfoRemoteSearchQuery albumInfoRemoteSearchQuery, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMusicAlbumRemoteSearchResultsRequestBuilder( + albumInfoRemoteSearchQuery, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMusicAlbumRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMusicAlbumRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable AlbumInfoRemoteSearchQuery albumInfoRemoteSearchQuery, + Map headers) throws ApiException { + // verify the required parameter 'albumInfoRemoteSearchQuery' is set + if (albumInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'albumInfoRemoteSearchQuery' when calling getMusicAlbumRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/MusicAlbum"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(albumInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get music artist remote search. + * + * @param artistInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getMusicArtistRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable ArtistInfoRemoteSearchQuery artistInfoRemoteSearchQuery) + throws ApiException { + return getMusicArtistRemoteSearchResults(artistInfoRemoteSearchQuery, null); + } + + /** + * Get music artist remote search. + * + * @param artistInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getMusicArtistRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable ArtistInfoRemoteSearchQuery artistInfoRemoteSearchQuery, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getMusicArtistRemoteSearchResultsWithHttpInfo( + artistInfoRemoteSearchQuery, headers); + return localVarResponse.getData(); + } + + /** + * Get music artist remote search. + * + * @param artistInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMusicArtistRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ArtistInfoRemoteSearchQuery artistInfoRemoteSearchQuery) + throws ApiException { + return getMusicArtistRemoteSearchResultsWithHttpInfo(artistInfoRemoteSearchQuery, null); + } + + /** + * Get music artist remote search. + * + * @param artistInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMusicArtistRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ArtistInfoRemoteSearchQuery artistInfoRemoteSearchQuery, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMusicArtistRemoteSearchResultsRequestBuilder( + artistInfoRemoteSearchQuery, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMusicArtistRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMusicArtistRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable ArtistInfoRemoteSearchQuery artistInfoRemoteSearchQuery, + Map headers) throws ApiException { + // verify the required parameter 'artistInfoRemoteSearchQuery' is set + if (artistInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'artistInfoRemoteSearchQuery' when calling getMusicArtistRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/MusicArtist"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(artistInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get music video remote search. + * + * @param musicVideoInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getMusicVideoRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable MusicVideoInfoRemoteSearchQuery musicVideoInfoRemoteSearchQuery) + throws ApiException { + return getMusicVideoRemoteSearchResults(musicVideoInfoRemoteSearchQuery, null); + } + + /** + * Get music video remote search. + * + * @param musicVideoInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getMusicVideoRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable MusicVideoInfoRemoteSearchQuery musicVideoInfoRemoteSearchQuery, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getMusicVideoRemoteSearchResultsWithHttpInfo( + musicVideoInfoRemoteSearchQuery, headers); + return localVarResponse.getData(); + } + + /** + * Get music video remote search. + * + * @param musicVideoInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMusicVideoRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MusicVideoInfoRemoteSearchQuery musicVideoInfoRemoteSearchQuery) + throws ApiException { + return getMusicVideoRemoteSearchResultsWithHttpInfo(musicVideoInfoRemoteSearchQuery, null); + } + + /** + * Get music video remote search. + * + * @param musicVideoInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMusicVideoRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MusicVideoInfoRemoteSearchQuery musicVideoInfoRemoteSearchQuery, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMusicVideoRemoteSearchResultsRequestBuilder( + musicVideoInfoRemoteSearchQuery, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMusicVideoRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMusicVideoRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable MusicVideoInfoRemoteSearchQuery musicVideoInfoRemoteSearchQuery, + Map headers) throws ApiException { + // verify the required parameter 'musicVideoInfoRemoteSearchQuery' is set + if (musicVideoInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'musicVideoInfoRemoteSearchQuery' when calling getMusicVideoRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/MusicVideo"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(musicVideoInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get person remote search. + * + * @param personLookupInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getPersonRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable PersonLookupInfoRemoteSearchQuery personLookupInfoRemoteSearchQuery) + throws ApiException { + return getPersonRemoteSearchResults(personLookupInfoRemoteSearchQuery, null); + } + + /** + * Get person remote search. + * + * @param personLookupInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getPersonRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable PersonLookupInfoRemoteSearchQuery personLookupInfoRemoteSearchQuery, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getPersonRemoteSearchResultsWithHttpInfo( + personLookupInfoRemoteSearchQuery, headers); + return localVarResponse.getData(); + } + + /** + * Get person remote search. + * + * @param personLookupInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPersonRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable PersonLookupInfoRemoteSearchQuery personLookupInfoRemoteSearchQuery) + throws ApiException { + return getPersonRemoteSearchResultsWithHttpInfo(personLookupInfoRemoteSearchQuery, null); + } + + /** + * Get person remote search. + * + * @param personLookupInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPersonRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable PersonLookupInfoRemoteSearchQuery personLookupInfoRemoteSearchQuery, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPersonRemoteSearchResultsRequestBuilder( + personLookupInfoRemoteSearchQuery, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPersonRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPersonRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable PersonLookupInfoRemoteSearchQuery personLookupInfoRemoteSearchQuery, + Map headers) throws ApiException { + // verify the required parameter 'personLookupInfoRemoteSearchQuery' is set + if (personLookupInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'personLookupInfoRemoteSearchQuery' when calling getPersonRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/Person"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(personLookupInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get series remote search. + * + * @param seriesInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getSeriesRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable SeriesInfoRemoteSearchQuery seriesInfoRemoteSearchQuery) + throws ApiException { + return getSeriesRemoteSearchResults(seriesInfoRemoteSearchQuery, null); + } + + /** + * Get series remote search. + * + * @param seriesInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getSeriesRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable SeriesInfoRemoteSearchQuery seriesInfoRemoteSearchQuery, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getSeriesRemoteSearchResultsWithHttpInfo( + seriesInfoRemoteSearchQuery, headers); + return localVarResponse.getData(); + } + + /** + * Get series remote search. + * + * @param seriesInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getSeriesRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SeriesInfoRemoteSearchQuery seriesInfoRemoteSearchQuery) + throws ApiException { + return getSeriesRemoteSearchResultsWithHttpInfo(seriesInfoRemoteSearchQuery, null); + } + + /** + * Get series remote search. + * + * @param seriesInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getSeriesRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SeriesInfoRemoteSearchQuery seriesInfoRemoteSearchQuery, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSeriesRemoteSearchResultsRequestBuilder( + seriesInfoRemoteSearchQuery, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSeriesRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSeriesRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable SeriesInfoRemoteSearchQuery seriesInfoRemoteSearchQuery, + Map headers) throws ApiException { + // verify the required parameter 'seriesInfoRemoteSearchQuery' is set + if (seriesInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'seriesInfoRemoteSearchQuery' when calling getSeriesRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/Series"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(seriesInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get trailer remote search. + * + * @param trailerInfoRemoteSearchQuery Remote search query. (required) + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getTrailerRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable TrailerInfoRemoteSearchQuery trailerInfoRemoteSearchQuery) + throws ApiException { + return getTrailerRemoteSearchResults(trailerInfoRemoteSearchQuery, null); + } + + /** + * Get trailer remote search. + * + * @param trailerInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return List<RemoteSearchResult> + * @throws ApiException if fails to make API call + */ + public List getTrailerRemoteSearchResults( + @org.eclipse.jdt.annotation.Nullable TrailerInfoRemoteSearchQuery trailerInfoRemoteSearchQuery, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getTrailerRemoteSearchResultsWithHttpInfo( + trailerInfoRemoteSearchQuery, headers); + return localVarResponse.getData(); + } + + /** + * Get trailer remote search. + * + * @param trailerInfoRemoteSearchQuery Remote search query. (required) + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getTrailerRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable TrailerInfoRemoteSearchQuery trailerInfoRemoteSearchQuery) + throws ApiException { + return getTrailerRemoteSearchResultsWithHttpInfo(trailerInfoRemoteSearchQuery, null); + } + + /** + * Get trailer remote search. + * + * @param trailerInfoRemoteSearchQuery Remote search query. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSearchResult>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getTrailerRemoteSearchResultsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable TrailerInfoRemoteSearchQuery trailerInfoRemoteSearchQuery, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTrailerRemoteSearchResultsRequestBuilder( + trailerInfoRemoteSearchQuery, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getTrailerRemoteSearchResults", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getTrailerRemoteSearchResultsRequestBuilder( + @org.eclipse.jdt.annotation.Nullable TrailerInfoRemoteSearchQuery trailerInfoRemoteSearchQuery, + Map headers) throws ApiException { + // verify the required parameter 'trailerInfoRemoteSearchQuery' is set + if (trailerInfoRemoteSearchQuery == null) { + throw new ApiException(400, + "Missing the required parameter 'trailerInfoRemoteSearchQuery' when calling getTrailerRemoteSearchResults"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/RemoteSearch/Trailer"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(trailerInfoRemoteSearchQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ItemRefreshApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ItemRefreshApi.java new file mode 100644 index 0000000000000..4d04271d838ac --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ItemRefreshApi.java @@ -0,0 +1,313 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.MetadataRefreshMode; + +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ItemRefreshApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ItemRefreshApi() { + this(Configuration.getDefaultApiClient()); + } + + public ItemRefreshApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Refreshes metadata for an item. + * + * @param itemId Item id. (required) + * @param metadataRefreshMode (Optional) Specifies the metadata refresh mode. (optional, default to None) + * @param imageRefreshMode (Optional) Specifies the image refresh mode. (optional, default to None) + * @param replaceAllMetadata (Optional) Determines if metadata should be replaced. Only applicable if mode is + * FullRefresh. (optional, default to false) + * @param replaceAllImages (Optional) Determines if images should be replaced. Only applicable if mode is + * FullRefresh. (optional, default to false) + * @throws ApiException if fails to make API call + */ + public void refreshItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode metadataRefreshMode, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode imageRefreshMode, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllMetadata, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages) throws ApiException { + refreshItem(itemId, metadataRefreshMode, imageRefreshMode, replaceAllMetadata, replaceAllImages, null); + } + + /** + * Refreshes metadata for an item. + * + * @param itemId Item id. (required) + * @param metadataRefreshMode (Optional) Specifies the metadata refresh mode. (optional, default to None) + * @param imageRefreshMode (Optional) Specifies the image refresh mode. (optional, default to None) + * @param replaceAllMetadata (Optional) Determines if metadata should be replaced. Only applicable if mode is + * FullRefresh. (optional, default to false) + * @param replaceAllImages (Optional) Determines if images should be replaced. Only applicable if mode is + * FullRefresh. (optional, default to false) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void refreshItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode metadataRefreshMode, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode imageRefreshMode, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllMetadata, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, Map headers) + throws ApiException { + refreshItemWithHttpInfo(itemId, metadataRefreshMode, imageRefreshMode, replaceAllMetadata, replaceAllImages, + headers); + } + + /** + * Refreshes metadata for an item. + * + * @param itemId Item id. (required) + * @param metadataRefreshMode (Optional) Specifies the metadata refresh mode. (optional, default to None) + * @param imageRefreshMode (Optional) Specifies the image refresh mode. (optional, default to None) + * @param replaceAllMetadata (Optional) Determines if metadata should be replaced. Only applicable if mode is + * FullRefresh. (optional, default to false) + * @param replaceAllImages (Optional) Determines if images should be replaced. Only applicable if mode is + * FullRefresh. (optional, default to false) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse refreshItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode metadataRefreshMode, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode imageRefreshMode, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllMetadata, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages) throws ApiException { + return refreshItemWithHttpInfo(itemId, metadataRefreshMode, imageRefreshMode, replaceAllMetadata, + replaceAllImages, null); + } + + /** + * Refreshes metadata for an item. + * + * @param itemId Item id. (required) + * @param metadataRefreshMode (Optional) Specifies the metadata refresh mode. (optional, default to None) + * @param imageRefreshMode (Optional) Specifies the image refresh mode. (optional, default to None) + * @param replaceAllMetadata (Optional) Determines if metadata should be replaced. Only applicable if mode is + * FullRefresh. (optional, default to false) + * @param replaceAllImages (Optional) Determines if images should be replaced. Only applicable if mode is + * FullRefresh. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse refreshItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode metadataRefreshMode, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode imageRefreshMode, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllMetadata, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = refreshItemRequestBuilder(itemId, metadataRefreshMode, + imageRefreshMode, replaceAllMetadata, replaceAllImages, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("refreshItem", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder refreshItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode metadataRefreshMode, + @org.eclipse.jdt.annotation.NonNull MetadataRefreshMode imageRefreshMode, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllMetadata, + @org.eclipse.jdt.annotation.NonNull Boolean replaceAllImages, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling refreshItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Refresh".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "metadataRefreshMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("metadataRefreshMode", metadataRefreshMode)); + localVarQueryParameterBaseName = "imageRefreshMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageRefreshMode", imageRefreshMode)); + localVarQueryParameterBaseName = "replaceAllMetadata"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("replaceAllMetadata", replaceAllMetadata)); + localVarQueryParameterBaseName = "replaceAllImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("replaceAllImages", replaceAllImages)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ItemUpdateApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ItemUpdateApi.java new file mode 100644 index 0000000000000..a6ee852adfd92 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ItemUpdateApi.java @@ -0,0 +1,497 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.MetadataEditorInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ItemUpdateApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ItemUpdateApi() { + this(Configuration.getDefaultApiClient()); + } + + public ItemUpdateApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets metadata editor info for an item. + * + * @param itemId The item id. (required) + * @return MetadataEditorInfo + * @throws ApiException if fails to make API call + */ + public MetadataEditorInfo getMetadataEditorInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + return getMetadataEditorInfo(itemId, null); + } + + /** + * Gets metadata editor info for an item. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return MetadataEditorInfo + * @throws ApiException if fails to make API call + */ + public MetadataEditorInfo getMetadataEditorInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getMetadataEditorInfoWithHttpInfo(itemId, headers); + return localVarResponse.getData(); + } + + /** + * Gets metadata editor info for an item. + * + * @param itemId The item id. (required) + * @return ApiResponse<MetadataEditorInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMetadataEditorInfoWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return getMetadataEditorInfoWithHttpInfo(itemId, null); + } + + /** + * Gets metadata editor info for an item. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<MetadataEditorInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMetadataEditorInfoWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMetadataEditorInfoRequestBuilder(itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMetadataEditorInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + MetadataEditorInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMetadataEditorInfoRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getMetadataEditorInfo"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/MetadataEditor".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates an item. + * + * @param itemId The item id. (required) + * @param baseItemDto The new item properties. (required) + * @throws ApiException if fails to make API call + */ + public void updateItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable BaseItemDto baseItemDto) throws ApiException { + updateItem(itemId, baseItemDto, null); + } + + /** + * Updates an item. + * + * @param itemId The item id. (required) + * @param baseItemDto The new item properties. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable BaseItemDto baseItemDto, Map headers) + throws ApiException { + updateItemWithHttpInfo(itemId, baseItemDto, headers); + } + + /** + * Updates an item. + * + * @param itemId The item id. (required) + * @param baseItemDto The new item properties. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable BaseItemDto baseItemDto) throws ApiException { + return updateItemWithHttpInfo(itemId, baseItemDto, null); + } + + /** + * Updates an item. + * + * @param itemId The item id. (required) + * @param baseItemDto The new item properties. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable BaseItemDto baseItemDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateItemRequestBuilder(itemId, baseItemDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateItem", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable BaseItemDto baseItemDto, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling updateItem"); + } + // verify the required parameter 'baseItemDto' is set + if (baseItemDto == null) { + throw new ApiException(400, "Missing the required parameter 'baseItemDto' when calling updateItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(baseItemDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates an item's content type. + * + * @param itemId The item id. (required) + * @param contentType The content type of the item. (optional) + * @throws ApiException if fails to make API call + */ + public void updateItemContentType(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String contentType) throws ApiException { + updateItemContentType(itemId, contentType, null); + } + + /** + * Updates an item's content type. + * + * @param itemId The item id. (required) + * @param contentType The content type of the item. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateItemContentType(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String contentType, Map headers) throws ApiException { + updateItemContentTypeWithHttpInfo(itemId, contentType, headers); + } + + /** + * Updates an item's content type. + * + * @param itemId The item id. (required) + * @param contentType The content type of the item. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateItemContentTypeWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String contentType) throws ApiException { + return updateItemContentTypeWithHttpInfo(itemId, contentType, null); + } + + /** + * Updates an item's content type. + * + * @param itemId The item id. (required) + * @param contentType The content type of the item. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateItemContentTypeWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String contentType, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateItemContentTypeRequestBuilder(itemId, contentType, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateItemContentType", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateItemContentTypeRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String contentType, Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling updateItemContentType"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/ContentType".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "contentType"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("contentType", contentType)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ItemsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ItemsApi.java new file mode 100644 index 0000000000000..f968e63f20773 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ItemsApi.java @@ -0,0 +1,2847 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFilter; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.LocationType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SeriesStatus; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SortOrder; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.VideoType; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ItemsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ItemsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ItemsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets items based on a query. + * + * @param userId The user id supplied as query parameter. (optional) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an imdb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a tmdb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a tvdb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getItems(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getItems(userId, maxOfficialRating, hasThemeSong, hasThemeVideo, hasSubtitles, hasSpecialFeature, + hasTrailer, adjacentTo, parentIndexNumber, hasParentalRating, isHd, is4K, locationTypes, + excludeLocationTypes, isMissing, isUnaired, minCommunityRating, minCriticRating, minPremiereDate, + minDateLastSaved, minDateLastSavedForUser, maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, + hasTvdbId, isMovie, isSeries, isNews, isKids, isSports, excludeItemIds, startIndex, limit, recursive, + searchTerm, sortOrder, parentId, fields, excludeItemTypes, includeItemTypes, filters, isFavorite, + mediaTypes, imageTypes, sortBy, isPlayed, genres, officialRatings, tags, years, enableUserData, + imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, artists, excludeArtistIds, + artistIds, albumArtistIds, contributingArtistIds, albums, albumIds, ids, videoTypes, minOfficialRating, + isLocked, isPlaceHolder, hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, + maxHeight, is3D, seriesStatus, nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, + genreIds, enableTotalRecordCount, enableImages, null); + } + + /** + * Gets items based on a query. + * + * @param userId The user id supplied as query parameter. (optional) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an imdb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a tmdb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a tvdb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getItems(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { + ApiResponse localVarResponse = getItemsWithHttpInfo(userId, maxOfficialRating, + hasThemeSong, hasThemeVideo, hasSubtitles, hasSpecialFeature, hasTrailer, adjacentTo, parentIndexNumber, + hasParentalRating, isHd, is4K, locationTypes, excludeLocationTypes, isMissing, isUnaired, + minCommunityRating, minCriticRating, minPremiereDate, minDateLastSaved, minDateLastSavedForUser, + maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, hasTvdbId, isMovie, isSeries, isNews, isKids, + isSports, excludeItemIds, startIndex, limit, recursive, searchTerm, sortOrder, parentId, fields, + excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, imageTypes, sortBy, isPlayed, + genres, officialRatings, tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, + personIds, personTypes, studios, artists, excludeArtistIds, artistIds, albumArtistIds, + contributingArtistIds, albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, isPlaceHolder, + hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, seriesStatus, + nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, enableTotalRecordCount, + enableImages, headers); + return localVarResponse.getData(); + } + + /** + * Gets items based on a query. + * + * @param userId The user id supplied as query parameter. (optional) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an imdb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a tmdb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a tvdb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getItemsWithHttpInfo(userId, maxOfficialRating, hasThemeSong, hasThemeVideo, hasSubtitles, + hasSpecialFeature, hasTrailer, adjacentTo, parentIndexNumber, hasParentalRating, isHd, is4K, + locationTypes, excludeLocationTypes, isMissing, isUnaired, minCommunityRating, minCriticRating, + minPremiereDate, minDateLastSaved, minDateLastSavedForUser, maxPremiereDate, hasOverview, hasImdbId, + hasTmdbId, hasTvdbId, isMovie, isSeries, isNews, isKids, isSports, excludeItemIds, startIndex, limit, + recursive, searchTerm, sortOrder, parentId, fields, excludeItemTypes, includeItemTypes, filters, + isFavorite, mediaTypes, imageTypes, sortBy, isPlayed, genres, officialRatings, tags, years, + enableUserData, imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, artists, + excludeArtistIds, artistIds, albumArtistIds, contributingArtistIds, albums, albumIds, ids, videoTypes, + minOfficialRating, isLocked, isPlaceHolder, hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, + maxWidth, maxHeight, is3D, seriesStatus, nameStartsWithOrGreater, nameStartsWith, nameLessThan, + studioIds, genreIds, enableTotalRecordCount, enableImages, null); + } + + /** + * Gets items based on a query. + * + * @param userId The user id supplied as query parameter. (optional) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an imdb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a tmdb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a tvdb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemsRequestBuilder(userId, maxOfficialRating, hasThemeSong, + hasThemeVideo, hasSubtitles, hasSpecialFeature, hasTrailer, adjacentTo, parentIndexNumber, + hasParentalRating, isHd, is4K, locationTypes, excludeLocationTypes, isMissing, isUnaired, + minCommunityRating, minCriticRating, minPremiereDate, minDateLastSaved, minDateLastSavedForUser, + maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, hasTvdbId, isMovie, isSeries, isNews, isKids, + isSports, excludeItemIds, startIndex, limit, recursive, searchTerm, sortOrder, parentId, fields, + excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, imageTypes, sortBy, isPlayed, + genres, officialRatings, tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, + personIds, personTypes, studios, artists, excludeArtistIds, artistIds, albumArtistIds, + contributingArtistIds, albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, isPlaceHolder, + hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, seriesStatus, + nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, enableTotalRecordCount, + enableImages, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItems", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "maxOfficialRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxOfficialRating", maxOfficialRating)); + localVarQueryParameterBaseName = "hasThemeSong"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasThemeSong", hasThemeSong)); + localVarQueryParameterBaseName = "hasThemeVideo"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasThemeVideo", hasThemeVideo)); + localVarQueryParameterBaseName = "hasSubtitles"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasSubtitles", hasSubtitles)); + localVarQueryParameterBaseName = "hasSpecialFeature"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasSpecialFeature", hasSpecialFeature)); + localVarQueryParameterBaseName = "hasTrailer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasTrailer", hasTrailer)); + localVarQueryParameterBaseName = "adjacentTo"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("adjacentTo", adjacentTo)); + localVarQueryParameterBaseName = "parentIndexNumber"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentIndexNumber", parentIndexNumber)); + localVarQueryParameterBaseName = "hasParentalRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasParentalRating", hasParentalRating)); + localVarQueryParameterBaseName = "isHd"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isHd", isHd)); + localVarQueryParameterBaseName = "is4K"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("is4K", is4K)); + localVarQueryParameterBaseName = "locationTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "locationTypes", locationTypes)); + localVarQueryParameterBaseName = "excludeLocationTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeLocationTypes", excludeLocationTypes)); + localVarQueryParameterBaseName = "isMissing"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMissing", isMissing)); + localVarQueryParameterBaseName = "isUnaired"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isUnaired", isUnaired)); + localVarQueryParameterBaseName = "minCommunityRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minCommunityRating", minCommunityRating)); + localVarQueryParameterBaseName = "minCriticRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minCriticRating", minCriticRating)); + localVarQueryParameterBaseName = "minPremiereDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minPremiereDate", minPremiereDate)); + localVarQueryParameterBaseName = "minDateLastSaved"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minDateLastSaved", minDateLastSaved)); + localVarQueryParameterBaseName = "minDateLastSavedForUser"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minDateLastSavedForUser", minDateLastSavedForUser)); + localVarQueryParameterBaseName = "maxPremiereDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxPremiereDate", maxPremiereDate)); + localVarQueryParameterBaseName = "hasOverview"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasOverview", hasOverview)); + localVarQueryParameterBaseName = "hasImdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasImdbId", hasImdbId)); + localVarQueryParameterBaseName = "hasTmdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasTmdbId", hasTmdbId)); + localVarQueryParameterBaseName = "hasTvdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasTvdbId", hasTvdbId)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "excludeItemIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemIds", excludeItemIds)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "recursive"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("recursive", recursive)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "filters"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "filters", filters)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + localVarQueryParameterBaseName = "imageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "imageTypes", imageTypes)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "isPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isPlayed", isPlayed)); + localVarQueryParameterBaseName = "genres"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genres", genres)); + localVarQueryParameterBaseName = "officialRatings"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "officialRatings", officialRatings)); + localVarQueryParameterBaseName = "tags"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "tags", tags)); + localVarQueryParameterBaseName = "years"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "years", years)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "person"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("person", person)); + localVarQueryParameterBaseName = "personIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personIds", personIds)); + localVarQueryParameterBaseName = "personTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personTypes", personTypes)); + localVarQueryParameterBaseName = "studios"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studios", studios)); + localVarQueryParameterBaseName = "artists"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "artists", artists)); + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "artistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "artistIds", artistIds)); + localVarQueryParameterBaseName = "albumArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "albumArtistIds", albumArtistIds)); + localVarQueryParameterBaseName = "contributingArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "contributingArtistIds", contributingArtistIds)); + localVarQueryParameterBaseName = "albums"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "albums", albums)); + localVarQueryParameterBaseName = "albumIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "albumIds", albumIds)); + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + localVarQueryParameterBaseName = "videoTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "videoTypes", videoTypes)); + localVarQueryParameterBaseName = "minOfficialRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minOfficialRating", minOfficialRating)); + localVarQueryParameterBaseName = "isLocked"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isLocked", isLocked)); + localVarQueryParameterBaseName = "isPlaceHolder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isPlaceHolder", isPlaceHolder)); + localVarQueryParameterBaseName = "hasOfficialRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasOfficialRating", hasOfficialRating)); + localVarQueryParameterBaseName = "collapseBoxSetItems"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("collapseBoxSetItems", collapseBoxSetItems)); + localVarQueryParameterBaseName = "minWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minWidth", minWidth)); + localVarQueryParameterBaseName = "minHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minHeight", minHeight)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "is3D"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("is3D", is3D)); + localVarQueryParameterBaseName = "seriesStatus"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "seriesStatus", seriesStatus)); + localVarQueryParameterBaseName = "nameStartsWithOrGreater"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWithOrGreater", nameStartsWithOrGreater)); + localVarQueryParameterBaseName = "nameStartsWith"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWith", nameStartsWith)); + localVarQueryParameterBaseName = "nameLessThan"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameLessThan", nameLessThan)); + localVarQueryParameterBaseName = "studioIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studioIds", studioIds)); + localVarQueryParameterBaseName = "genreIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genreIds", genreIds)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets items based on a query. + * + * @param userId The user id supplied as query parameter. (required) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an imdb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a tmdb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a tvdb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getItemsByUserId(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getItemsByUserId(userId, maxOfficialRating, hasThemeSong, hasThemeVideo, hasSubtitles, hasSpecialFeature, + hasTrailer, adjacentTo, parentIndexNumber, hasParentalRating, isHd, is4K, locationTypes, + excludeLocationTypes, isMissing, isUnaired, minCommunityRating, minCriticRating, minPremiereDate, + minDateLastSaved, minDateLastSavedForUser, maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, + hasTvdbId, isMovie, isSeries, isNews, isKids, isSports, excludeItemIds, startIndex, limit, recursive, + searchTerm, sortOrder, parentId, fields, excludeItemTypes, includeItemTypes, filters, isFavorite, + mediaTypes, imageTypes, sortBy, isPlayed, genres, officialRatings, tags, years, enableUserData, + imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, artists, excludeArtistIds, + artistIds, albumArtistIds, contributingArtistIds, albums, albumIds, ids, videoTypes, minOfficialRating, + isLocked, isPlaceHolder, hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, + maxHeight, is3D, seriesStatus, nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, + genreIds, enableTotalRecordCount, enableImages, null); + } + + /** + * Gets items based on a query. + * + * @param userId The user id supplied as query parameter. (required) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an imdb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a tmdb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a tvdb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getItemsByUserId(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { + ApiResponse localVarResponse = getItemsByUserIdWithHttpInfo(userId, maxOfficialRating, + hasThemeSong, hasThemeVideo, hasSubtitles, hasSpecialFeature, hasTrailer, adjacentTo, parentIndexNumber, + hasParentalRating, isHd, is4K, locationTypes, excludeLocationTypes, isMissing, isUnaired, + minCommunityRating, minCriticRating, minPremiereDate, minDateLastSaved, minDateLastSavedForUser, + maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, hasTvdbId, isMovie, isSeries, isNews, isKids, + isSports, excludeItemIds, startIndex, limit, recursive, searchTerm, sortOrder, parentId, fields, + excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, imageTypes, sortBy, isPlayed, + genres, officialRatings, tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, + personIds, personTypes, studios, artists, excludeArtistIds, artistIds, albumArtistIds, + contributingArtistIds, albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, isPlaceHolder, + hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, seriesStatus, + nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, enableTotalRecordCount, + enableImages, headers); + return localVarResponse.getData(); + } + + /** + * Gets items based on a query. + * + * @param userId The user id supplied as query parameter. (required) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an imdb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a tmdb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a tvdb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemsByUserIdWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getItemsByUserIdWithHttpInfo(userId, maxOfficialRating, hasThemeSong, hasThemeVideo, hasSubtitles, + hasSpecialFeature, hasTrailer, adjacentTo, parentIndexNumber, hasParentalRating, isHd, is4K, + locationTypes, excludeLocationTypes, isMissing, isUnaired, minCommunityRating, minCriticRating, + minPremiereDate, minDateLastSaved, minDateLastSavedForUser, maxPremiereDate, hasOverview, hasImdbId, + hasTmdbId, hasTvdbId, isMovie, isSeries, isNews, isKids, isSports, excludeItemIds, startIndex, limit, + recursive, searchTerm, sortOrder, parentId, fields, excludeItemTypes, includeItemTypes, filters, + isFavorite, mediaTypes, imageTypes, sortBy, isPlayed, genres, officialRatings, tags, years, + enableUserData, imageTypeLimit, enableImageTypes, person, personIds, personTypes, studios, artists, + excludeArtistIds, artistIds, albumArtistIds, contributingArtistIds, albums, albumIds, ids, videoTypes, + minOfficialRating, isLocked, isPlaceHolder, hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, + maxWidth, maxHeight, is3D, seriesStatus, nameStartsWithOrGreater, nameStartsWith, nameLessThan, + studioIds, genreIds, enableTotalRecordCount, enableImages, null); + } + + /** + * Gets items based on a query. + * + * @param userId The user id supplied as query parameter. (required) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an imdb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a tmdb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a tvdb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemsByUserIdWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemsByUserIdRequestBuilder(userId, maxOfficialRating, + hasThemeSong, hasThemeVideo, hasSubtitles, hasSpecialFeature, hasTrailer, adjacentTo, parentIndexNumber, + hasParentalRating, isHd, is4K, locationTypes, excludeLocationTypes, isMissing, isUnaired, + minCommunityRating, minCriticRating, minPremiereDate, minDateLastSaved, minDateLastSavedForUser, + maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, hasTvdbId, isMovie, isSeries, isNews, isKids, + isSports, excludeItemIds, startIndex, limit, recursive, searchTerm, sortOrder, parentId, fields, + excludeItemTypes, includeItemTypes, filters, isFavorite, mediaTypes, imageTypes, sortBy, isPlayed, + genres, officialRatings, tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, + personIds, personTypes, studios, artists, excludeArtistIds, artistIds, albumArtistIds, + contributingArtistIds, albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, isPlaceHolder, + hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, seriesStatus, + nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, enableTotalRecordCount, + enableImages, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItemsByUserId", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemsByUserIdRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getItemsByUserId"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Items".replace("{userId}", ApiClient.urlEncode(userId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "maxOfficialRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxOfficialRating", maxOfficialRating)); + localVarQueryParameterBaseName = "hasThemeSong"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasThemeSong", hasThemeSong)); + localVarQueryParameterBaseName = "hasThemeVideo"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasThemeVideo", hasThemeVideo)); + localVarQueryParameterBaseName = "hasSubtitles"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasSubtitles", hasSubtitles)); + localVarQueryParameterBaseName = "hasSpecialFeature"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasSpecialFeature", hasSpecialFeature)); + localVarQueryParameterBaseName = "hasTrailer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasTrailer", hasTrailer)); + localVarQueryParameterBaseName = "adjacentTo"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("adjacentTo", adjacentTo)); + localVarQueryParameterBaseName = "parentIndexNumber"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentIndexNumber", parentIndexNumber)); + localVarQueryParameterBaseName = "hasParentalRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasParentalRating", hasParentalRating)); + localVarQueryParameterBaseName = "isHd"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isHd", isHd)); + localVarQueryParameterBaseName = "is4K"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("is4K", is4K)); + localVarQueryParameterBaseName = "locationTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "locationTypes", locationTypes)); + localVarQueryParameterBaseName = "excludeLocationTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeLocationTypes", excludeLocationTypes)); + localVarQueryParameterBaseName = "isMissing"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMissing", isMissing)); + localVarQueryParameterBaseName = "isUnaired"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isUnaired", isUnaired)); + localVarQueryParameterBaseName = "minCommunityRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minCommunityRating", minCommunityRating)); + localVarQueryParameterBaseName = "minCriticRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minCriticRating", minCriticRating)); + localVarQueryParameterBaseName = "minPremiereDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minPremiereDate", minPremiereDate)); + localVarQueryParameterBaseName = "minDateLastSaved"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minDateLastSaved", minDateLastSaved)); + localVarQueryParameterBaseName = "minDateLastSavedForUser"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minDateLastSavedForUser", minDateLastSavedForUser)); + localVarQueryParameterBaseName = "maxPremiereDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxPremiereDate", maxPremiereDate)); + localVarQueryParameterBaseName = "hasOverview"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasOverview", hasOverview)); + localVarQueryParameterBaseName = "hasImdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasImdbId", hasImdbId)); + localVarQueryParameterBaseName = "hasTmdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasTmdbId", hasTmdbId)); + localVarQueryParameterBaseName = "hasTvdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasTvdbId", hasTvdbId)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "excludeItemIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemIds", excludeItemIds)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "recursive"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("recursive", recursive)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "filters"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "filters", filters)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + localVarQueryParameterBaseName = "imageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "imageTypes", imageTypes)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "isPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isPlayed", isPlayed)); + localVarQueryParameterBaseName = "genres"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genres", genres)); + localVarQueryParameterBaseName = "officialRatings"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "officialRatings", officialRatings)); + localVarQueryParameterBaseName = "tags"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "tags", tags)); + localVarQueryParameterBaseName = "years"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "years", years)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "person"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("person", person)); + localVarQueryParameterBaseName = "personIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personIds", personIds)); + localVarQueryParameterBaseName = "personTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personTypes", personTypes)); + localVarQueryParameterBaseName = "studios"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studios", studios)); + localVarQueryParameterBaseName = "artists"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "artists", artists)); + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "artistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "artistIds", artistIds)); + localVarQueryParameterBaseName = "albumArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "albumArtistIds", albumArtistIds)); + localVarQueryParameterBaseName = "contributingArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "contributingArtistIds", contributingArtistIds)); + localVarQueryParameterBaseName = "albums"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "albums", albums)); + localVarQueryParameterBaseName = "albumIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "albumIds", albumIds)); + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + localVarQueryParameterBaseName = "videoTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "videoTypes", videoTypes)); + localVarQueryParameterBaseName = "minOfficialRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minOfficialRating", minOfficialRating)); + localVarQueryParameterBaseName = "isLocked"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isLocked", isLocked)); + localVarQueryParameterBaseName = "isPlaceHolder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isPlaceHolder", isPlaceHolder)); + localVarQueryParameterBaseName = "hasOfficialRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasOfficialRating", hasOfficialRating)); + localVarQueryParameterBaseName = "collapseBoxSetItems"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("collapseBoxSetItems", collapseBoxSetItems)); + localVarQueryParameterBaseName = "minWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minWidth", minWidth)); + localVarQueryParameterBaseName = "minHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minHeight", minHeight)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "is3D"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("is3D", is3D)); + localVarQueryParameterBaseName = "seriesStatus"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "seriesStatus", seriesStatus)); + localVarQueryParameterBaseName = "nameStartsWithOrGreater"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWithOrGreater", nameStartsWithOrGreater)); + localVarQueryParameterBaseName = "nameStartsWith"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWith", nameStartsWith)); + localVarQueryParameterBaseName = "nameLessThan"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameLessThan", nameLessThan)); + localVarQueryParameterBaseName = "studioIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studioIds", studioIds)); + localVarQueryParameterBaseName = "genreIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genreIds", genreIds)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets items based on a query. + * + * @param userId The user id. (required) + * @param startIndex The start index. (optional) + * @param limit The item limit. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional. Include image information in output. (optional, default to true) + * @param excludeActiveSessions Optional. Whether to exclude the currently active sessions. (optional, default to + * false) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getResumeItems(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean excludeActiveSessions) throws ApiException { + return getResumeItems(userId, startIndex, limit, searchTerm, parentId, fields, mediaTypes, enableUserData, + imageTypeLimit, enableImageTypes, excludeItemTypes, includeItemTypes, enableTotalRecordCount, + enableImages, excludeActiveSessions, null); + } + + /** + * Gets items based on a query. + * + * @param userId The user id. (required) + * @param startIndex The start index. (optional) + * @param limit The item limit. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional. Include image information in output. (optional, default to true) + * @param excludeActiveSessions Optional. Whether to exclude the currently active sessions. (optional, default to + * false) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getResumeItems(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean excludeActiveSessions, Map headers) + throws ApiException { + ApiResponse localVarResponse = getResumeItemsWithHttpInfo(userId, startIndex, limit, + searchTerm, parentId, fields, mediaTypes, enableUserData, imageTypeLimit, enableImageTypes, + excludeItemTypes, includeItemTypes, enableTotalRecordCount, enableImages, excludeActiveSessions, + headers); + return localVarResponse.getData(); + } + + /** + * Gets items based on a query. + * + * @param userId The user id. (required) + * @param startIndex The start index. (optional) + * @param limit The item limit. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional. Include image information in output. (optional, default to true) + * @param excludeActiveSessions Optional. Whether to exclude the currently active sessions. (optional, default to + * false) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getResumeItemsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean excludeActiveSessions) throws ApiException { + return getResumeItemsWithHttpInfo(userId, startIndex, limit, searchTerm, parentId, fields, mediaTypes, + enableUserData, imageTypeLimit, enableImageTypes, excludeItemTypes, includeItemTypes, + enableTotalRecordCount, enableImages, excludeActiveSessions, null); + } + + /** + * Gets items based on a query. + * + * @param userId The user id. (required) + * @param startIndex The start index. (optional) + * @param limit The item limit. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows + * multiple, comma delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional. Include image information in output. (optional, default to true) + * @param excludeActiveSessions Optional. Whether to exclude the currently active sessions. (optional, default to + * false) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getResumeItemsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean excludeActiveSessions, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getResumeItemsRequestBuilder(userId, startIndex, limit, searchTerm, + parentId, fields, mediaTypes, enableUserData, imageTypeLimit, enableImageTypes, excludeItemTypes, + includeItemTypes, enableTotalRecordCount, enableImages, excludeActiveSessions, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getResumeItems", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getResumeItemsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean excludeActiveSessions, Map headers) + throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getResumeItems"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Items/Resume".replace("{userId}", + ApiClient.urlEncode(userId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "excludeActiveSessions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("excludeActiveSessions", excludeActiveSessions)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/LibraryApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/LibraryApi.java new file mode 100644 index 0000000000000..fa4248585f09f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/LibraryApi.java @@ -0,0 +1,3464 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.AllThemeMediaResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemCounts; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.LibraryOptionsResultDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.MediaUpdateInfoDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ThemeMediaResult; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LibraryApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public LibraryApi() { + this(Configuration.getDefaultApiClient()); + } + + public LibraryApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Deletes an item from the library and filesystem. + * + * @param itemId The item id. (required) + * @throws ApiException if fails to make API call + */ + public void deleteItem(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + deleteItem(itemId, null); + } + + /** + * Deletes an item from the library and filesystem. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteItem(@org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) + throws ApiException { + deleteItemWithHttpInfo(itemId, headers); + } + + /** + * Deletes an item from the library and filesystem. + * + * @param itemId The item id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + return deleteItemWithHttpInfo(itemId, null); + } + + /** + * Deletes an item from the library and filesystem. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteItemRequestBuilder(itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteItem", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Deletes items from the library and filesystem. + * + * @param ids The item ids. (optional) + * @throws ApiException if fails to make API call + */ + public void deleteItems(@org.eclipse.jdt.annotation.NonNull List ids) throws ApiException { + deleteItems(ids, null); + } + + /** + * Deletes items from the library and filesystem. + * + * @param ids The item ids. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteItems(@org.eclipse.jdt.annotation.NonNull List ids, Map headers) + throws ApiException { + deleteItemsWithHttpInfo(ids, headers); + } + + /** + * Deletes items from the library and filesystem. + * + * @param ids The item ids. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteItemsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull List ids) + throws ApiException { + return deleteItemsWithHttpInfo(ids, null); + } + + /** + * Deletes items from the library and filesystem. + * + * @param ids The item ids. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteItemsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull List ids, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteItemsRequestBuilder(ids, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteItems", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteItemsRequestBuilder(@org.eclipse.jdt.annotation.NonNull List ids, + Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all parents of an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return List<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public List getAncestors(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getAncestors(itemId, userId, null); + } + + /** + * Gets all parents of an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return List<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public List getAncestors(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse> localVarResponse = getAncestorsWithHttpInfo(itemId, userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets all parents of an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return ApiResponse<List<BaseItemDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getAncestorsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getAncestorsWithHttpInfo(itemId, userId, null); + } + + /** + * Gets all parents of an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<BaseItemDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getAncestorsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAncestorsRequestBuilder(itemId, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getAncestors", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAncestorsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getAncestors"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Ancestors".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets critic review for an item. + * + * @param itemId (required) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getCriticReviews(@org.eclipse.jdt.annotation.Nullable String itemId) + throws ApiException { + return getCriticReviews(itemId, null); + } + + /** + * Gets critic review for an item. + * + * @param itemId (required) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getCriticReviews(@org.eclipse.jdt.annotation.Nullable String itemId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getCriticReviewsWithHttpInfo(itemId, headers); + return localVarResponse.getData(); + } + + /** + * Gets critic review for an item. + * + * @param itemId (required) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getCriticReviewsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String itemId) throws ApiException { + return getCriticReviewsWithHttpInfo(itemId, null); + } + + /** + * Gets critic review for an item. + * + * @param itemId (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getCriticReviewsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String itemId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getCriticReviewsRequestBuilder(itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getCriticReviews", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getCriticReviewsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String itemId, + Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getCriticReviews"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/CriticReviews".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Downloads item media. + * + * @param itemId The item id. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getDownload(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return getDownload(itemId, null); + } + + /** + * Downloads item media. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getDownload(@org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getDownloadWithHttpInfo(itemId, headers); + return localVarResponse.getData(); + } + + /** + * Downloads item media. + * + * @param itemId The item id. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDownloadWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + return getDownloadWithHttpInfo(itemId, null); + } + + /** + * Downloads item media. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDownloadWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDownloadRequestBuilder(itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDownload", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDownloadRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getDownload"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Download".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "video/*, audio/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get the original file of an item. + * + * @param itemId The item id. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getFile(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return getFile(itemId, null); + } + + /** + * Get the original file of an item. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getFile(@org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getFileWithHttpInfo(itemId, headers); + return localVarResponse.getData(); + } + + /** + * Get the original file of an item. + * + * @param itemId The item id. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return getFileWithHttpInfo(itemId, null); + } + + /** + * Get the original file of an item. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFileRequestBuilder(itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getFile", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getFileRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getFile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/File".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "video/*, audio/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get item counts. + * + * @param userId Optional. Get counts from a specific user's library. (optional) + * @param isFavorite Optional. Get counts of favorite items. (optional) + * @return ItemCounts + * @throws ApiException if fails to make API call + */ + public ItemCounts getItemCounts(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite) throws ApiException { + return getItemCounts(userId, isFavorite, null); + } + + /** + * Get item counts. + * + * @param userId Optional. Get counts from a specific user's library. (optional) + * @param isFavorite Optional. Get counts of favorite items. (optional) + * @param headers Optional headers to include in the request + * @return ItemCounts + * @throws ApiException if fails to make API call + */ + public ItemCounts getItemCounts(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, Map headers) throws ApiException { + ApiResponse localVarResponse = getItemCountsWithHttpInfo(userId, isFavorite, headers); + return localVarResponse.getData(); + } + + /** + * Get item counts. + * + * @param userId Optional. Get counts from a specific user's library. (optional) + * @param isFavorite Optional. Get counts of favorite items. (optional) + * @return ApiResponse<ItemCounts> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemCountsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite) throws ApiException { + return getItemCountsWithHttpInfo(userId, isFavorite, null); + } + + /** + * Get item counts. + * + * @param userId Optional. Get counts from a specific user's library. (optional) + * @param isFavorite Optional. Get counts of favorite items. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<ItemCounts> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemCountsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemCountsRequestBuilder(userId, isFavorite, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItemCounts", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + ItemCounts responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemCountsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/Counts"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the library options info. + * + * @param libraryContentType Library content type. (optional) + * @param isNewLibrary Whether this is a new library. (optional, default to false) + * @return LibraryOptionsResultDto + * @throws ApiException if fails to make API call + */ + public LibraryOptionsResultDto getLibraryOptionsInfo(@org.eclipse.jdt.annotation.NonNull String libraryContentType, + @org.eclipse.jdt.annotation.NonNull Boolean isNewLibrary) throws ApiException { + return getLibraryOptionsInfo(libraryContentType, isNewLibrary, null); + } + + /** + * Gets the library options info. + * + * @param libraryContentType Library content type. (optional) + * @param isNewLibrary Whether this is a new library. (optional, default to false) + * @param headers Optional headers to include in the request + * @return LibraryOptionsResultDto + * @throws ApiException if fails to make API call + */ + public LibraryOptionsResultDto getLibraryOptionsInfo(@org.eclipse.jdt.annotation.NonNull String libraryContentType, + @org.eclipse.jdt.annotation.NonNull Boolean isNewLibrary, Map headers) throws ApiException { + ApiResponse localVarResponse = getLibraryOptionsInfoWithHttpInfo(libraryContentType, + isNewLibrary, headers); + return localVarResponse.getData(); + } + + /** + * Gets the library options info. + * + * @param libraryContentType Library content type. (optional) + * @param isNewLibrary Whether this is a new library. (optional, default to false) + * @return ApiResponse<LibraryOptionsResultDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLibraryOptionsInfoWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String libraryContentType, + @org.eclipse.jdt.annotation.NonNull Boolean isNewLibrary) throws ApiException { + return getLibraryOptionsInfoWithHttpInfo(libraryContentType, isNewLibrary, null); + } + + /** + * Gets the library options info. + * + * @param libraryContentType Library content type. (optional) + * @param isNewLibrary Whether this is a new library. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<LibraryOptionsResultDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLibraryOptionsInfoWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String libraryContentType, + @org.eclipse.jdt.annotation.NonNull Boolean isNewLibrary, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLibraryOptionsInfoRequestBuilder(libraryContentType, + isNewLibrary, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLibraryOptionsInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + LibraryOptionsResultDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLibraryOptionsInfoRequestBuilder( + @org.eclipse.jdt.annotation.NonNull String libraryContentType, + @org.eclipse.jdt.annotation.NonNull Boolean isNewLibrary, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Libraries/AvailableOptions"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "libraryContentType"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("libraryContentType", libraryContentType)); + localVarQueryParameterBaseName = "isNewLibrary"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNewLibrary", isNewLibrary)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all user media folders. + * + * @param isHidden Optional. Filter by folders that are marked hidden, or not. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getMediaFolders(@org.eclipse.jdt.annotation.NonNull Boolean isHidden) + throws ApiException { + return getMediaFolders(isHidden, null); + } + + /** + * Gets all user media folders. + * + * @param isHidden Optional. Filter by folders that are marked hidden, or not. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getMediaFolders(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + Map headers) throws ApiException { + ApiResponse localVarResponse = getMediaFoldersWithHttpInfo(isHidden, headers); + return localVarResponse.getData(); + } + + /** + * Gets all user media folders. + * + * @param isHidden Optional. Filter by folders that are marked hidden, or not. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMediaFoldersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean isHidden) throws ApiException { + return getMediaFoldersWithHttpInfo(isHidden, null); + } + + /** + * Gets all user media folders. + * + * @param isHidden Optional. Filter by folders that are marked hidden, or not. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMediaFoldersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean isHidden, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMediaFoldersRequestBuilder(isHidden, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMediaFolders", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMediaFoldersRequestBuilder(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/MediaFolders"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "isHidden"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isHidden", isHidden)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of physical paths from virtual folders. + * + * @return List<String> + * @throws ApiException if fails to make API call + */ + public List getPhysicalPaths() throws ApiException { + return getPhysicalPaths(null); + } + + /** + * Gets a list of physical paths from virtual folders. + * + * @param headers Optional headers to include in the request + * @return List<String> + * @throws ApiException if fails to make API call + */ + public List getPhysicalPaths(Map headers) throws ApiException { + ApiResponse> localVarResponse = getPhysicalPathsWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets a list of physical paths from virtual folders. + * + * @return ApiResponse<List<String>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPhysicalPathsWithHttpInfo() throws ApiException { + return getPhysicalPathsWithHttpInfo(null); + } + + /** + * Gets a list of physical paths from virtual folders. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<String>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPhysicalPathsWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPhysicalPathsRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPhysicalPaths", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPhysicalPathsRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/PhysicalPaths"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarAlbums(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarAlbums(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarAlbums(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + ApiResponse localVarResponse = getSimilarAlbumsWithHttpInfo(itemId, excludeArtistIds, + userId, limit, fields, headers); + return localVarResponse.getData(); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarAlbumsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarAlbumsWithHttpInfo(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarAlbumsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSimilarAlbumsRequestBuilder(itemId, excludeArtistIds, userId, + limit, fields, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSimilarAlbums", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSimilarAlbumsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarAlbums"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Albums/{itemId}/Similar".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarArtists(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarArtists(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarArtists(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + ApiResponse localVarResponse = getSimilarArtistsWithHttpInfo(itemId, excludeArtistIds, + userId, limit, fields, headers); + return localVarResponse.getData(); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarArtistsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarArtistsWithHttpInfo(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarArtistsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSimilarArtistsRequestBuilder(itemId, excludeArtistIds, userId, + limit, fields, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSimilarArtists", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSimilarArtistsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarArtists"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Artists/{itemId}/Similar".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarItems(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarItems(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarItems(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + ApiResponse localVarResponse = getSimilarItemsWithHttpInfo(itemId, excludeArtistIds, + userId, limit, fields, headers); + return localVarResponse.getData(); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarItemsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarItemsWithHttpInfo(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarItemsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSimilarItemsRequestBuilder(itemId, excludeArtistIds, userId, + limit, fields, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSimilarItems", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSimilarItemsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarItems"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/Similar".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarMovies(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarMovies(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarMovies(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + ApiResponse localVarResponse = getSimilarMoviesWithHttpInfo(itemId, excludeArtistIds, + userId, limit, fields, headers); + return localVarResponse.getData(); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarMoviesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarMoviesWithHttpInfo(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarMoviesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSimilarMoviesRequestBuilder(itemId, excludeArtistIds, userId, + limit, fields, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSimilarMovies", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSimilarMoviesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarMovies"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Movies/{itemId}/Similar".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarShows(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarShows(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarShows(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + ApiResponse localVarResponse = getSimilarShowsWithHttpInfo(itemId, excludeArtistIds, + userId, limit, fields, headers); + return localVarResponse.getData(); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarShowsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarShowsWithHttpInfo(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarShowsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSimilarShowsRequestBuilder(itemId, excludeArtistIds, userId, + limit, fields, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSimilarShows", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSimilarShowsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarShows"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Shows/{itemId}/Similar".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarTrailers(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarTrailers(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSimilarTrailers(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + ApiResponse localVarResponse = getSimilarTrailersWithHttpInfo(itemId, excludeArtistIds, + userId, limit, fields, headers); + return localVarResponse.getData(); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarTrailersWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields) throws ApiException { + return getSimilarTrailersWithHttpInfo(itemId, excludeArtistIds, userId, limit, fields, null); + } + + /** + * Gets similar items. + * + * @param itemId The item id. (required) + * @param excludeArtistIds Exclude artist ids. (optional) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSimilarTrailersWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSimilarTrailersRequestBuilder(itemId, excludeArtistIds, userId, + limit, fields, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSimilarTrailers", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSimilarTrailersRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSimilarTrailers"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Trailers/{itemId}/Similar".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get theme songs and videos for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @return AllThemeMediaResult + * @throws ApiException if fails to make API call + */ + public AllThemeMediaResult getThemeMedia(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent) throws ApiException { + return getThemeMedia(itemId, userId, inheritFromParent, null); + } + + /** + * Get theme songs and videos for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param headers Optional headers to include in the request + * @return AllThemeMediaResult + * @throws ApiException if fails to make API call + */ + public AllThemeMediaResult getThemeMedia(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, Map headers) + throws ApiException { + ApiResponse localVarResponse = getThemeMediaWithHttpInfo(itemId, userId, inheritFromParent, + headers); + return localVarResponse.getData(); + } + + /** + * Get theme songs and videos for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @return ApiResponse<AllThemeMediaResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getThemeMediaWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent) throws ApiException { + return getThemeMediaWithHttpInfo(itemId, userId, inheritFromParent, null); + } + + /** + * Get theme songs and videos for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<AllThemeMediaResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getThemeMediaWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getThemeMediaRequestBuilder(itemId, userId, inheritFromParent, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getThemeMedia", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + AllThemeMediaResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getThemeMediaRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getThemeMedia"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/ThemeMedia".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "inheritFromParent"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("inheritFromParent", inheritFromParent)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get theme songs for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @return ThemeMediaResult + * @throws ApiException if fails to make API call + */ + public ThemeMediaResult getThemeSongs(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent) throws ApiException { + return getThemeSongs(itemId, userId, inheritFromParent, null); + } + + /** + * Get theme songs for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param headers Optional headers to include in the request + * @return ThemeMediaResult + * @throws ApiException if fails to make API call + */ + public ThemeMediaResult getThemeSongs(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, Map headers) + throws ApiException { + ApiResponse localVarResponse = getThemeSongsWithHttpInfo(itemId, userId, inheritFromParent, + headers); + return localVarResponse.getData(); + } + + /** + * Get theme songs for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @return ApiResponse<ThemeMediaResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getThemeSongsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent) throws ApiException { + return getThemeSongsWithHttpInfo(itemId, userId, inheritFromParent, null); + } + + /** + * Get theme songs for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<ThemeMediaResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getThemeSongsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getThemeSongsRequestBuilder(itemId, userId, inheritFromParent, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getThemeSongs", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + ThemeMediaResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getThemeSongsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getThemeSongs"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/ThemeSongs".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "inheritFromParent"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("inheritFromParent", inheritFromParent)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get theme videos for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @return ThemeMediaResult + * @throws ApiException if fails to make API call + */ + public ThemeMediaResult getThemeVideos(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent) throws ApiException { + return getThemeVideos(itemId, userId, inheritFromParent, null); + } + + /** + * Get theme videos for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param headers Optional headers to include in the request + * @return ThemeMediaResult + * @throws ApiException if fails to make API call + */ + public ThemeMediaResult getThemeVideos(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, Map headers) + throws ApiException { + ApiResponse localVarResponse = getThemeVideosWithHttpInfo(itemId, userId, inheritFromParent, + headers); + return localVarResponse.getData(); + } + + /** + * Get theme videos for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @return ApiResponse<ThemeMediaResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getThemeVideosWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent) throws ApiException { + return getThemeVideosWithHttpInfo(itemId, userId, inheritFromParent, null); + } + + /** + * Get theme videos for an item. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param inheritFromParent Optional. Determines whether or not parent items should be searched for theme media. + * (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<ThemeMediaResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getThemeVideosWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getThemeVideosRequestBuilder(itemId, userId, inheritFromParent, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getThemeVideos", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + ThemeMediaResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getThemeVideosRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean inheritFromParent, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getThemeVideos"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/ThemeVideos".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "inheritFromParent"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("inheritFromParent", inheritFromParent)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that new movies have been added by an external source. + * + * @param tmdbId The tmdbId. (optional) + * @param imdbId The imdbId. (optional) + * @throws ApiException if fails to make API call + */ + public void postAddedMovies(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId) throws ApiException { + postAddedMovies(tmdbId, imdbId, null); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param tmdbId The tmdbId. (optional) + * @param imdbId The imdbId. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postAddedMovies(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId, Map headers) throws ApiException { + postAddedMoviesWithHttpInfo(tmdbId, imdbId, headers); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param tmdbId The tmdbId. (optional) + * @param imdbId The imdbId. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postAddedMoviesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId) throws ApiException { + return postAddedMoviesWithHttpInfo(tmdbId, imdbId, null); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param tmdbId The tmdbId. (optional) + * @param imdbId The imdbId. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postAddedMoviesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postAddedMoviesRequestBuilder(tmdbId, imdbId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postAddedMovies", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postAddedMoviesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/Movies/Added"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tmdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tmdbId", tmdbId)); + localVarQueryParameterBaseName = "imdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imdbId", imdbId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that new episodes of a series have been added by an external source. + * + * @param tvdbId The tvdbId. (optional) + * @throws ApiException if fails to make API call + */ + public void postAddedSeries(@org.eclipse.jdt.annotation.NonNull String tvdbId) throws ApiException { + postAddedSeries(tvdbId, null); + } + + /** + * Reports that new episodes of a series have been added by an external source. + * + * @param tvdbId The tvdbId. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postAddedSeries(@org.eclipse.jdt.annotation.NonNull String tvdbId, Map headers) + throws ApiException { + postAddedSeriesWithHttpInfo(tvdbId, headers); + } + + /** + * Reports that new episodes of a series have been added by an external source. + * + * @param tvdbId The tvdbId. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postAddedSeriesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tvdbId) + throws ApiException { + return postAddedSeriesWithHttpInfo(tvdbId, null); + } + + /** + * Reports that new episodes of a series have been added by an external source. + * + * @param tvdbId The tvdbId. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postAddedSeriesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tvdbId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postAddedSeriesRequestBuilder(tvdbId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postAddedSeries", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postAddedSeriesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String tvdbId, + Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/Series/Added"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tvdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tvdbId", tvdbId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that new movies have been added by an external source. + * + * @param mediaUpdateInfoDto The update paths. (required) + * @throws ApiException if fails to make API call + */ + public void postUpdatedMedia(@org.eclipse.jdt.annotation.Nullable MediaUpdateInfoDto mediaUpdateInfoDto) + throws ApiException { + postUpdatedMedia(mediaUpdateInfoDto, null); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param mediaUpdateInfoDto The update paths. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postUpdatedMedia(@org.eclipse.jdt.annotation.Nullable MediaUpdateInfoDto mediaUpdateInfoDto, + Map headers) throws ApiException { + postUpdatedMediaWithHttpInfo(mediaUpdateInfoDto, headers); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param mediaUpdateInfoDto The update paths. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUpdatedMediaWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MediaUpdateInfoDto mediaUpdateInfoDto) throws ApiException { + return postUpdatedMediaWithHttpInfo(mediaUpdateInfoDto, null); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param mediaUpdateInfoDto The update paths. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUpdatedMediaWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MediaUpdateInfoDto mediaUpdateInfoDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postUpdatedMediaRequestBuilder(mediaUpdateInfoDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postUpdatedMedia", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postUpdatedMediaRequestBuilder( + @org.eclipse.jdt.annotation.Nullable MediaUpdateInfoDto mediaUpdateInfoDto, Map headers) + throws ApiException { + // verify the required parameter 'mediaUpdateInfoDto' is set + if (mediaUpdateInfoDto == null) { + throw new ApiException(400, + "Missing the required parameter 'mediaUpdateInfoDto' when calling postUpdatedMedia"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/Media/Updated"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(mediaUpdateInfoDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that new movies have been added by an external source. + * + * @param tmdbId The tmdbId. (optional) + * @param imdbId The imdbId. (optional) + * @throws ApiException if fails to make API call + */ + public void postUpdatedMovies(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId) throws ApiException { + postUpdatedMovies(tmdbId, imdbId, null); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param tmdbId The tmdbId. (optional) + * @param imdbId The imdbId. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postUpdatedMovies(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId, Map headers) throws ApiException { + postUpdatedMoviesWithHttpInfo(tmdbId, imdbId, headers); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param tmdbId The tmdbId. (optional) + * @param imdbId The imdbId. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUpdatedMoviesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId) throws ApiException { + return postUpdatedMoviesWithHttpInfo(tmdbId, imdbId, null); + } + + /** + * Reports that new movies have been added by an external source. + * + * @param tmdbId The tmdbId. (optional) + * @param imdbId The imdbId. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUpdatedMoviesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postUpdatedMoviesRequestBuilder(tmdbId, imdbId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postUpdatedMovies", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postUpdatedMoviesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String tmdbId, + @org.eclipse.jdt.annotation.NonNull String imdbId, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/Movies/Updated"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tmdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tmdbId", tmdbId)); + localVarQueryParameterBaseName = "imdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imdbId", imdbId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that new episodes of a series have been added by an external source. + * + * @param tvdbId The tvdbId. (optional) + * @throws ApiException if fails to make API call + */ + public void postUpdatedSeries(@org.eclipse.jdt.annotation.NonNull String tvdbId) throws ApiException { + postUpdatedSeries(tvdbId, null); + } + + /** + * Reports that new episodes of a series have been added by an external source. + * + * @param tvdbId The tvdbId. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postUpdatedSeries(@org.eclipse.jdt.annotation.NonNull String tvdbId, Map headers) + throws ApiException { + postUpdatedSeriesWithHttpInfo(tvdbId, headers); + } + + /** + * Reports that new episodes of a series have been added by an external source. + * + * @param tvdbId The tvdbId. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUpdatedSeriesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tvdbId) + throws ApiException { + return postUpdatedSeriesWithHttpInfo(tvdbId, null); + } + + /** + * Reports that new episodes of a series have been added by an external source. + * + * @param tvdbId The tvdbId. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postUpdatedSeriesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String tvdbId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postUpdatedSeriesRequestBuilder(tvdbId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postUpdatedSeries", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postUpdatedSeriesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String tvdbId, + Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/Series/Updated"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tvdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tvdbId", tvdbId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Starts a library scan. + * + * @throws ApiException if fails to make API call + */ + public void refreshLibrary() throws ApiException { + refreshLibrary(null); + } + + /** + * Starts a library scan. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void refreshLibrary(Map headers) throws ApiException { + refreshLibraryWithHttpInfo(headers); + } + + /** + * Starts a library scan. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse refreshLibraryWithHttpInfo() throws ApiException { + return refreshLibraryWithHttpInfo(null); + } + + /** + * Starts a library scan. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse refreshLibraryWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = refreshLibraryRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("refreshLibrary", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder refreshLibraryRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/Refresh"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/LibraryStructureApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/LibraryStructureApi.java new file mode 100644 index 0000000000000..f1fb85a207377 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/LibraryStructureApi.java @@ -0,0 +1,1130 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.AddVirtualFolderDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.CollectionTypeOptions; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.MediaPathDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.UpdateLibraryOptionsDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.UpdateMediaPathRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.VirtualFolderInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LibraryStructureApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public LibraryStructureApi() { + this(Configuration.getDefaultApiClient()); + } + + public LibraryStructureApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Add a media path to a library. + * + * @param mediaPathDto The media path dto. (required) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @throws ApiException if fails to make API call + */ + public void addMediaPath(@org.eclipse.jdt.annotation.Nullable MediaPathDto mediaPathDto, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + addMediaPath(mediaPathDto, refreshLibrary, null); + } + + /** + * Add a media path to a library. + * + * @param mediaPathDto The media path dto. (required) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void addMediaPath(@org.eclipse.jdt.annotation.Nullable MediaPathDto mediaPathDto, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { + addMediaPathWithHttpInfo(mediaPathDto, refreshLibrary, headers); + } + + /** + * Add a media path to a library. + * + * @param mediaPathDto The media path dto. (required) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addMediaPathWithHttpInfo(@org.eclipse.jdt.annotation.Nullable MediaPathDto mediaPathDto, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + return addMediaPathWithHttpInfo(mediaPathDto, refreshLibrary, null); + } + + /** + * Add a media path to a library. + * + * @param mediaPathDto The media path dto. (required) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addMediaPathWithHttpInfo(@org.eclipse.jdt.annotation.Nullable MediaPathDto mediaPathDto, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addMediaPathRequestBuilder(mediaPathDto, refreshLibrary, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("addMediaPath", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder addMediaPathRequestBuilder( + @org.eclipse.jdt.annotation.Nullable MediaPathDto mediaPathDto, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { + // verify the required parameter 'mediaPathDto' is set + if (mediaPathDto == null) { + throw new ApiException(400, "Missing the required parameter 'mediaPathDto' when calling addMediaPath"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/VirtualFolders/Paths"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "refreshLibrary"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("refreshLibrary", refreshLibrary)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(mediaPathDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Adds a virtual folder. + * + * @param name The name of the virtual folder. (optional) + * @param collectionType The type of the collection. (optional) + * @param paths The paths of the virtual folder. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param addVirtualFolderDto The library options. (optional) + * @throws ApiException if fails to make API call + */ + public void addVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull CollectionTypeOptions collectionType, + @org.eclipse.jdt.annotation.NonNull List paths, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, + @org.eclipse.jdt.annotation.NonNull AddVirtualFolderDto addVirtualFolderDto) throws ApiException { + addVirtualFolder(name, collectionType, paths, refreshLibrary, addVirtualFolderDto, null); + } + + /** + * Adds a virtual folder. + * + * @param name The name of the virtual folder. (optional) + * @param collectionType The type of the collection. (optional) + * @param paths The paths of the virtual folder. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param addVirtualFolderDto The library options. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void addVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull CollectionTypeOptions collectionType, + @org.eclipse.jdt.annotation.NonNull List paths, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, + @org.eclipse.jdt.annotation.NonNull AddVirtualFolderDto addVirtualFolderDto, Map headers) + throws ApiException { + addVirtualFolderWithHttpInfo(name, collectionType, paths, refreshLibrary, addVirtualFolderDto, headers); + } + + /** + * Adds a virtual folder. + * + * @param name The name of the virtual folder. (optional) + * @param collectionType The type of the collection. (optional) + * @param paths The paths of the virtual folder. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param addVirtualFolderDto The library options. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addVirtualFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull CollectionTypeOptions collectionType, + @org.eclipse.jdt.annotation.NonNull List paths, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, + @org.eclipse.jdt.annotation.NonNull AddVirtualFolderDto addVirtualFolderDto) throws ApiException { + return addVirtualFolderWithHttpInfo(name, collectionType, paths, refreshLibrary, addVirtualFolderDto, null); + } + + /** + * Adds a virtual folder. + * + * @param name The name of the virtual folder. (optional) + * @param collectionType The type of the collection. (optional) + * @param paths The paths of the virtual folder. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param addVirtualFolderDto The library options. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addVirtualFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull CollectionTypeOptions collectionType, + @org.eclipse.jdt.annotation.NonNull List paths, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, + @org.eclipse.jdt.annotation.NonNull AddVirtualFolderDto addVirtualFolderDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addVirtualFolderRequestBuilder(name, collectionType, paths, + refreshLibrary, addVirtualFolderDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("addVirtualFolder", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder addVirtualFolderRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull CollectionTypeOptions collectionType, + @org.eclipse.jdt.annotation.NonNull List paths, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, + @org.eclipse.jdt.annotation.NonNull AddVirtualFolderDto addVirtualFolderDto, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/VirtualFolders"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + localVarQueryParameterBaseName = "collectionType"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("collectionType", collectionType)); + localVarQueryParameterBaseName = "paths"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "paths", paths)); + localVarQueryParameterBaseName = "refreshLibrary"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("refreshLibrary", refreshLibrary)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(addVirtualFolderDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all virtual folders. + * + * @return List<VirtualFolderInfo> + * @throws ApiException if fails to make API call + */ + public List getVirtualFolders() throws ApiException { + return getVirtualFolders(null); + } + + /** + * Gets all virtual folders. + * + * @param headers Optional headers to include in the request + * @return List<VirtualFolderInfo> + * @throws ApiException if fails to make API call + */ + public List getVirtualFolders(Map headers) throws ApiException { + ApiResponse> localVarResponse = getVirtualFoldersWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets all virtual folders. + * + * @return ApiResponse<List<VirtualFolderInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getVirtualFoldersWithHttpInfo() throws ApiException { + return getVirtualFoldersWithHttpInfo(null); + } + + /** + * Gets all virtual folders. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<VirtualFolderInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getVirtualFoldersWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getVirtualFoldersRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getVirtualFolders", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getVirtualFoldersRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/VirtualFolders"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Remove a media path. + * + * @param name The name of the library. (optional) + * @param path The path to remove. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @throws ApiException if fails to make API call + */ + public void removeMediaPath(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String path, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) + throws ApiException { + removeMediaPath(name, path, refreshLibrary, null); + } + + /** + * Remove a media path. + * + * @param name The name of the library. (optional) + * @param path The path to remove. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void removeMediaPath(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String path, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, + Map headers) throws ApiException { + removeMediaPathWithHttpInfo(name, path, refreshLibrary, headers); + } + + /** + * Remove a media path. + * + * @param name The name of the library. (optional) + * @param path The path to remove. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeMediaPathWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String path, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) + throws ApiException { + return removeMediaPathWithHttpInfo(name, path, refreshLibrary, null); + } + + /** + * Remove a media path. + * + * @param name The name of the library. (optional) + * @param path The path to remove. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeMediaPathWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String path, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeMediaPathRequestBuilder(name, path, refreshLibrary, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("removeMediaPath", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder removeMediaPathRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String path, @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, + Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/VirtualFolders/Paths"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + localVarQueryParameterBaseName = "path"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("path", path)); + localVarQueryParameterBaseName = "refreshLibrary"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("refreshLibrary", refreshLibrary)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Removes a virtual folder. + * + * @param name The name of the folder. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @throws ApiException if fails to make API call + */ + public void removeVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + removeVirtualFolder(name, refreshLibrary, null); + } + + /** + * Removes a virtual folder. + * + * @param name The name of the folder. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void removeVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { + removeVirtualFolderWithHttpInfo(name, refreshLibrary, headers); + } + + /** + * Removes a virtual folder. + * + * @param name The name of the folder. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeVirtualFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + return removeVirtualFolderWithHttpInfo(name, refreshLibrary, null); + } + + /** + * Removes a virtual folder. + * + * @param name The name of the folder. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeVirtualFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeVirtualFolderRequestBuilder(name, refreshLibrary, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("removeVirtualFolder", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder removeVirtualFolderRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/VirtualFolders"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + localVarQueryParameterBaseName = "refreshLibrary"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("refreshLibrary", refreshLibrary)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Renames a virtual folder. + * + * @param name The name of the virtual folder. (optional) + * @param newName The new name. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @throws ApiException if fails to make API call + */ + public void renameVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String newName, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + renameVirtualFolder(name, newName, refreshLibrary, null); + } + + /** + * Renames a virtual folder. + * + * @param name The name of the virtual folder. (optional) + * @param newName The new name. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void renameVirtualFolder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String newName, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { + renameVirtualFolderWithHttpInfo(name, newName, refreshLibrary, headers); + } + + /** + * Renames a virtual folder. + * + * @param name The name of the virtual folder. (optional) + * @param newName The new name. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse renameVirtualFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String newName, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary) throws ApiException { + return renameVirtualFolderWithHttpInfo(name, newName, refreshLibrary, null); + } + + /** + * Renames a virtual folder. + * + * @param name The name of the virtual folder. (optional) + * @param newName The new name. (optional) + * @param refreshLibrary Whether to refresh the library. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse renameVirtualFolderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String newName, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = renameVirtualFolderRequestBuilder(name, newName, refreshLibrary, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("renameVirtualFolder", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder renameVirtualFolderRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull String newName, + @org.eclipse.jdt.annotation.NonNull Boolean refreshLibrary, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/VirtualFolders/Name"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + localVarQueryParameterBaseName = "newName"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("newName", newName)); + localVarQueryParameterBaseName = "refreshLibrary"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("refreshLibrary", refreshLibrary)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update library options. + * + * @param updateLibraryOptionsDto The library name and options. (optional) + * @throws ApiException if fails to make API call + */ + public void updateLibraryOptions( + @org.eclipse.jdt.annotation.NonNull UpdateLibraryOptionsDto updateLibraryOptionsDto) throws ApiException { + updateLibraryOptions(updateLibraryOptionsDto, null); + } + + /** + * Update library options. + * + * @param updateLibraryOptionsDto The library name and options. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateLibraryOptions( + @org.eclipse.jdt.annotation.NonNull UpdateLibraryOptionsDto updateLibraryOptionsDto, + Map headers) throws ApiException { + updateLibraryOptionsWithHttpInfo(updateLibraryOptionsDto, headers); + } + + /** + * Update library options. + * + * @param updateLibraryOptionsDto The library name and options. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateLibraryOptionsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UpdateLibraryOptionsDto updateLibraryOptionsDto) throws ApiException { + return updateLibraryOptionsWithHttpInfo(updateLibraryOptionsDto, null); + } + + /** + * Update library options. + * + * @param updateLibraryOptionsDto The library name and options. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateLibraryOptionsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UpdateLibraryOptionsDto updateLibraryOptionsDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateLibraryOptionsRequestBuilder(updateLibraryOptionsDto, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateLibraryOptions", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateLibraryOptionsRequestBuilder( + @org.eclipse.jdt.annotation.NonNull UpdateLibraryOptionsDto updateLibraryOptionsDto, + Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/VirtualFolders/LibraryOptions"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(updateLibraryOptionsDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a media path. + * + * @param updateMediaPathRequestDto The name of the library and path infos. (required) + * @throws ApiException if fails to make API call + */ + public void updateMediaPath( + @org.eclipse.jdt.annotation.Nullable UpdateMediaPathRequestDto updateMediaPathRequestDto) + throws ApiException { + updateMediaPath(updateMediaPathRequestDto, null); + } + + /** + * Updates a media path. + * + * @param updateMediaPathRequestDto The name of the library and path infos. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateMediaPath( + @org.eclipse.jdt.annotation.Nullable UpdateMediaPathRequestDto updateMediaPathRequestDto, + Map headers) throws ApiException { + updateMediaPathWithHttpInfo(updateMediaPathRequestDto, headers); + } + + /** + * Updates a media path. + * + * @param updateMediaPathRequestDto The name of the library and path infos. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateMediaPathWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UpdateMediaPathRequestDto updateMediaPathRequestDto) + throws ApiException { + return updateMediaPathWithHttpInfo(updateMediaPathRequestDto, null); + } + + /** + * Updates a media path. + * + * @param updateMediaPathRequestDto The name of the library and path infos. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateMediaPathWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UpdateMediaPathRequestDto updateMediaPathRequestDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateMediaPathRequestBuilder(updateMediaPathRequestDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateMediaPath", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateMediaPathRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UpdateMediaPathRequestDto updateMediaPathRequestDto, + Map headers) throws ApiException { + // verify the required parameter 'updateMediaPathRequestDto' is set + if (updateMediaPathRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'updateMediaPathRequestDto' when calling updateMediaPath"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Library/VirtualFolders/Paths/Update"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(updateMediaPathRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/LiveTvApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/LiveTvApi.java new file mode 100644 index 0000000000000..70f2c56a63140 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/LiveTvApi.java @@ -0,0 +1,5938 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ChannelMappingOptionsDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ChannelType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.GetProgramsDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.GuideInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ListingsProviderInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.LiveTvInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.NameIdPair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.RecordingStatus; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SeriesTimerInfoDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SeriesTimerInfoDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SetChannelMappingDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SortOrder; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.TimerInfoDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.TimerInfoDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.TunerChannelMapping; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.TunerHostInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LiveTvApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public LiveTvApi() { + this(Configuration.getDefaultApiClient()); + } + + public LiveTvApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Adds a listings provider. + * + * @param pw Password. (optional) + * @param validateListings Validate listings. (optional, default to false) + * @param validateLogin Validate login. (optional, default to false) + * @param listingsProviderInfo New listings info. (optional) + * @return ListingsProviderInfo + * @throws ApiException if fails to make API call + */ + public ListingsProviderInfo addListingProvider(@org.eclipse.jdt.annotation.NonNull String pw, + @org.eclipse.jdt.annotation.NonNull Boolean validateListings, + @org.eclipse.jdt.annotation.NonNull Boolean validateLogin, + @org.eclipse.jdt.annotation.NonNull ListingsProviderInfo listingsProviderInfo) throws ApiException { + return addListingProvider(pw, validateListings, validateLogin, listingsProviderInfo, null); + } + + /** + * Adds a listings provider. + * + * @param pw Password. (optional) + * @param validateListings Validate listings. (optional, default to false) + * @param validateLogin Validate login. (optional, default to false) + * @param listingsProviderInfo New listings info. (optional) + * @param headers Optional headers to include in the request + * @return ListingsProviderInfo + * @throws ApiException if fails to make API call + */ + public ListingsProviderInfo addListingProvider(@org.eclipse.jdt.annotation.NonNull String pw, + @org.eclipse.jdt.annotation.NonNull Boolean validateListings, + @org.eclipse.jdt.annotation.NonNull Boolean validateLogin, + @org.eclipse.jdt.annotation.NonNull ListingsProviderInfo listingsProviderInfo, Map headers) + throws ApiException { + ApiResponse localVarResponse = addListingProviderWithHttpInfo(pw, validateListings, + validateLogin, listingsProviderInfo, headers); + return localVarResponse.getData(); + } + + /** + * Adds a listings provider. + * + * @param pw Password. (optional) + * @param validateListings Validate listings. (optional, default to false) + * @param validateLogin Validate login. (optional, default to false) + * @param listingsProviderInfo New listings info. (optional) + * @return ApiResponse<ListingsProviderInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse addListingProviderWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String pw, @org.eclipse.jdt.annotation.NonNull Boolean validateListings, + @org.eclipse.jdt.annotation.NonNull Boolean validateLogin, + @org.eclipse.jdt.annotation.NonNull ListingsProviderInfo listingsProviderInfo) throws ApiException { + return addListingProviderWithHttpInfo(pw, validateListings, validateLogin, listingsProviderInfo, null); + } + + /** + * Adds a listings provider. + * + * @param pw Password. (optional) + * @param validateListings Validate listings. (optional, default to false) + * @param validateLogin Validate login. (optional, default to false) + * @param listingsProviderInfo New listings info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<ListingsProviderInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse addListingProviderWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String pw, @org.eclipse.jdt.annotation.NonNull Boolean validateListings, + @org.eclipse.jdt.annotation.NonNull Boolean validateLogin, + @org.eclipse.jdt.annotation.NonNull ListingsProviderInfo listingsProviderInfo, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addListingProviderRequestBuilder(pw, validateListings, + validateLogin, listingsProviderInfo, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("addListingProvider", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + ListingsProviderInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder addListingProviderRequestBuilder(@org.eclipse.jdt.annotation.NonNull String pw, + @org.eclipse.jdt.annotation.NonNull Boolean validateListings, + @org.eclipse.jdt.annotation.NonNull Boolean validateLogin, + @org.eclipse.jdt.annotation.NonNull ListingsProviderInfo listingsProviderInfo, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/ListingProviders"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "pw"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("pw", pw)); + localVarQueryParameterBaseName = "validateListings"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("validateListings", validateListings)); + localVarQueryParameterBaseName = "validateLogin"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("validateLogin", validateLogin)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(listingsProviderInfo); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Adds a tuner host. + * + * @param tunerHostInfo New tuner host. (optional) + * @return TunerHostInfo + * @throws ApiException if fails to make API call + */ + public TunerHostInfo addTunerHost(@org.eclipse.jdt.annotation.NonNull TunerHostInfo tunerHostInfo) + throws ApiException { + return addTunerHost(tunerHostInfo, null); + } + + /** + * Adds a tuner host. + * + * @param tunerHostInfo New tuner host. (optional) + * @param headers Optional headers to include in the request + * @return TunerHostInfo + * @throws ApiException if fails to make API call + */ + public TunerHostInfo addTunerHost(@org.eclipse.jdt.annotation.NonNull TunerHostInfo tunerHostInfo, + Map headers) throws ApiException { + ApiResponse localVarResponse = addTunerHostWithHttpInfo(tunerHostInfo, headers); + return localVarResponse.getData(); + } + + /** + * Adds a tuner host. + * + * @param tunerHostInfo New tuner host. (optional) + * @return ApiResponse<TunerHostInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse addTunerHostWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull TunerHostInfo tunerHostInfo) throws ApiException { + return addTunerHostWithHttpInfo(tunerHostInfo, null); + } + + /** + * Adds a tuner host. + * + * @param tunerHostInfo New tuner host. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<TunerHostInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse addTunerHostWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull TunerHostInfo tunerHostInfo, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addTunerHostRequestBuilder(tunerHostInfo, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("addTunerHost", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + TunerHostInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder addTunerHostRequestBuilder( + @org.eclipse.jdt.annotation.NonNull TunerHostInfo tunerHostInfo, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/TunerHosts"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(tunerHostInfo); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Cancels a live tv series timer. + * + * @param timerId Timer id. (required) + * @throws ApiException if fails to make API call + */ + public void cancelSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { + cancelSeriesTimer(timerId, null); + } + + /** + * Cancels a live tv series timer. + * + * @param timerId Timer id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void cancelSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerId, Map headers) + throws ApiException { + cancelSeriesTimerWithHttpInfo(timerId, headers); + } + + /** + * Cancels a live tv series timer. + * + * @param timerId Timer id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse cancelSeriesTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId) + throws ApiException { + return cancelSeriesTimerWithHttpInfo(timerId, null); + } + + /** + * Cancels a live tv series timer. + * + * @param timerId Timer id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse cancelSeriesTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = cancelSeriesTimerRequestBuilder(timerId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("cancelSeriesTimer", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder cancelSeriesTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId, + Map headers) throws ApiException { + // verify the required parameter 'timerId' is set + if (timerId == null) { + throw new ApiException(400, "Missing the required parameter 'timerId' when calling cancelSeriesTimer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/SeriesTimers/{timerId}".replace("{timerId}", + ApiClient.urlEncode(timerId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Cancels a live tv timer. + * + * @param timerId Timer id. (required) + * @throws ApiException if fails to make API call + */ + public void cancelTimer(@org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { + cancelTimer(timerId, null); + } + + /** + * Cancels a live tv timer. + * + * @param timerId Timer id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void cancelTimer(@org.eclipse.jdt.annotation.Nullable String timerId, Map headers) + throws ApiException { + cancelTimerWithHttpInfo(timerId, headers); + } + + /** + * Cancels a live tv timer. + * + * @param timerId Timer id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse cancelTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId) + throws ApiException { + return cancelTimerWithHttpInfo(timerId, null); + } + + /** + * Cancels a live tv timer. + * + * @param timerId Timer id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse cancelTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = cancelTimerRequestBuilder(timerId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("cancelTimer", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder cancelTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId, + Map headers) throws ApiException { + // verify the required parameter 'timerId' is set + if (timerId == null) { + throw new ApiException(400, "Missing the required parameter 'timerId' when calling cancelTimer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Timers/{timerId}".replace("{timerId}", ApiClient.urlEncode(timerId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates a live tv series timer. + * + * @param seriesTimerInfoDto New series timer info. (optional) + * @throws ApiException if fails to make API call + */ + public void createSeriesTimer(@org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto) + throws ApiException { + createSeriesTimer(seriesTimerInfoDto, null); + } + + /** + * Creates a live tv series timer. + * + * @param seriesTimerInfoDto New series timer info. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void createSeriesTimer(@org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto, + Map headers) throws ApiException { + createSeriesTimerWithHttpInfo(seriesTimerInfoDto, headers); + } + + /** + * Creates a live tv series timer. + * + * @param seriesTimerInfoDto New series timer info. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createSeriesTimerWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto) throws ApiException { + return createSeriesTimerWithHttpInfo(seriesTimerInfoDto, null); + } + + /** + * Creates a live tv series timer. + * + * @param seriesTimerInfoDto New series timer info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createSeriesTimerWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createSeriesTimerRequestBuilder(seriesTimerInfoDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createSeriesTimer", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createSeriesTimerRequestBuilder( + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/SeriesTimers"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(seriesTimerInfoDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates a live tv timer. + * + * @param timerInfoDto New timer info. (optional) + * @throws ApiException if fails to make API call + */ + public void createTimer(@org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto) throws ApiException { + createTimer(timerInfoDto, null); + } + + /** + * Creates a live tv timer. + * + * @param timerInfoDto New timer info. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void createTimer(@org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto, Map headers) + throws ApiException { + createTimerWithHttpInfo(timerInfoDto, headers); + } + + /** + * Creates a live tv timer. + * + * @param timerInfoDto New timer info. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createTimerWithHttpInfo(@org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto) + throws ApiException { + return createTimerWithHttpInfo(timerInfoDto, null); + } + + /** + * Creates a live tv timer. + * + * @param timerInfoDto New timer info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createTimerWithHttpInfo(@org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createTimerRequestBuilder(timerInfoDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createTimer", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createTimerRequestBuilder(@org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto, + Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Timers"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(timerInfoDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete listing provider. + * + * @param id Listing provider id. (optional) + * @throws ApiException if fails to make API call + */ + public void deleteListingProvider(@org.eclipse.jdt.annotation.NonNull String id) throws ApiException { + deleteListingProvider(id, null); + } + + /** + * Delete listing provider. + * + * @param id Listing provider id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteListingProvider(@org.eclipse.jdt.annotation.NonNull String id, Map headers) + throws ApiException { + deleteListingProviderWithHttpInfo(id, headers); + } + + /** + * Delete listing provider. + * + * @param id Listing provider id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteListingProviderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id) + throws ApiException { + return deleteListingProviderWithHttpInfo(id, null); + } + + /** + * Delete listing provider. + * + * @param id Listing provider id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteListingProviderWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteListingProviderRequestBuilder(id, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteListingProvider", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteListingProviderRequestBuilder(@org.eclipse.jdt.annotation.NonNull String id, + Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/ListingProviders"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Deletes a live tv recording. + * + * @param recordingId Recording id. (required) + * @throws ApiException if fails to make API call + */ + public void deleteRecording(@org.eclipse.jdt.annotation.Nullable UUID recordingId) throws ApiException { + deleteRecording(recordingId, null); + } + + /** + * Deletes a live tv recording. + * + * @param recordingId Recording id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteRecording(@org.eclipse.jdt.annotation.Nullable UUID recordingId, Map headers) + throws ApiException { + deleteRecordingWithHttpInfo(recordingId, headers); + } + + /** + * Deletes a live tv recording. + * + * @param recordingId Recording id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteRecordingWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID recordingId) + throws ApiException { + return deleteRecordingWithHttpInfo(recordingId, null); + } + + /** + * Deletes a live tv recording. + * + * @param recordingId Recording id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteRecordingWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID recordingId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteRecordingRequestBuilder(recordingId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteRecording", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteRecordingRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID recordingId, + Map headers) throws ApiException { + // verify the required parameter 'recordingId' is set + if (recordingId == null) { + throw new ApiException(400, "Missing the required parameter 'recordingId' when calling deleteRecording"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Recordings/{recordingId}".replace("{recordingId}", + ApiClient.urlEncode(recordingId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Deletes a tuner host. + * + * @param id Tuner host id. (optional) + * @throws ApiException if fails to make API call + */ + public void deleteTunerHost(@org.eclipse.jdt.annotation.NonNull String id) throws ApiException { + deleteTunerHost(id, null); + } + + /** + * Deletes a tuner host. + * + * @param id Tuner host id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteTunerHost(@org.eclipse.jdt.annotation.NonNull String id, Map headers) + throws ApiException { + deleteTunerHostWithHttpInfo(id, headers); + } + + /** + * Deletes a tuner host. + * + * @param id Tuner host id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteTunerHostWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id) + throws ApiException { + return deleteTunerHostWithHttpInfo(id, null); + } + + /** + * Deletes a tuner host. + * + * @param id Tuner host id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteTunerHostWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteTunerHostRequestBuilder(id, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteTunerHost", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteTunerHostRequestBuilder(@org.eclipse.jdt.annotation.NonNull String id, + Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/TunerHosts"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Discover tuners. + * + * @param newDevicesOnly Only discover new tuners. (optional, default to false) + * @return List<TunerHostInfo> + * @throws ApiException if fails to make API call + */ + public List discoverTuners(@org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly) + throws ApiException { + return discoverTuners(newDevicesOnly, null); + } + + /** + * Discover tuners. + * + * @param newDevicesOnly Only discover new tuners. (optional, default to false) + * @param headers Optional headers to include in the request + * @return List<TunerHostInfo> + * @throws ApiException if fails to make API call + */ + public List discoverTuners(@org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly, + Map headers) throws ApiException { + ApiResponse> localVarResponse = discoverTunersWithHttpInfo(newDevicesOnly, headers); + return localVarResponse.getData(); + } + + /** + * Discover tuners. + * + * @param newDevicesOnly Only discover new tuners. (optional, default to false) + * @return ApiResponse<List<TunerHostInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> discoverTunersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly) throws ApiException { + return discoverTunersWithHttpInfo(newDevicesOnly, null); + } + + /** + * Discover tuners. + * + * @param newDevicesOnly Only discover new tuners. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<TunerHostInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> discoverTunersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = discoverTunersRequestBuilder(newDevicesOnly, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("discoverTuners", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder discoverTunersRequestBuilder(@org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly, + Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Tuners/Discover"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "newDevicesOnly"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("newDevicesOnly", newDevicesOnly)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Discover tuners. + * + * @param newDevicesOnly Only discover new tuners. (optional, default to false) + * @return List<TunerHostInfo> + * @throws ApiException if fails to make API call + */ + public List discvoverTuners(@org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly) + throws ApiException { + return discvoverTuners(newDevicesOnly, null); + } + + /** + * Discover tuners. + * + * @param newDevicesOnly Only discover new tuners. (optional, default to false) + * @param headers Optional headers to include in the request + * @return List<TunerHostInfo> + * @throws ApiException if fails to make API call + */ + public List discvoverTuners(@org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly, + Map headers) throws ApiException { + ApiResponse> localVarResponse = discvoverTunersWithHttpInfo(newDevicesOnly, headers); + return localVarResponse.getData(); + } + + /** + * Discover tuners. + * + * @param newDevicesOnly Only discover new tuners. (optional, default to false) + * @return ApiResponse<List<TunerHostInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> discvoverTunersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly) throws ApiException { + return discvoverTunersWithHttpInfo(newDevicesOnly, null); + } + + /** + * Discover tuners. + * + * @param newDevicesOnly Only discover new tuners. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<TunerHostInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> discvoverTunersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = discvoverTunersRequestBuilder(newDevicesOnly, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("discvoverTuners", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder discvoverTunersRequestBuilder( + @org.eclipse.jdt.annotation.NonNull Boolean newDevicesOnly, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Tuners/Discvover"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "newDevicesOnly"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("newDevicesOnly", newDevicesOnly)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a live tv channel. + * + * @param channelId Channel id. (required) + * @param userId Optional. Attach user data. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getChannel(@org.eclipse.jdt.annotation.Nullable UUID channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getChannel(channelId, userId, null); + } + + /** + * Gets a live tv channel. + * + * @param channelId Channel id. (required) + * @param userId Optional. Attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getChannel(@org.eclipse.jdt.annotation.Nullable UUID channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getChannelWithHttpInfo(channelId, userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets a live tv channel. + * + * @param channelId Channel id. (required) + * @param userId Optional. Attach user data. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getChannelWithHttpInfo(channelId, userId, null); + } + + /** + * Gets a live tv channel. + * + * @param channelId Channel id. (required) + * @param userId Optional. Attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getChannelRequestBuilder(channelId, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getChannel", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getChannelRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + // verify the required parameter 'channelId' is set + if (channelId == null) { + throw new ApiException(400, "Missing the required parameter 'channelId' when calling getChannel"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Channels/{channelId}".replace("{channelId}", + ApiClient.urlEncode(channelId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get channel mapping options. + * + * @param providerId Provider id. (optional) + * @return ChannelMappingOptionsDto + * @throws ApiException if fails to make API call + */ + public ChannelMappingOptionsDto getChannelMappingOptions(@org.eclipse.jdt.annotation.NonNull String providerId) + throws ApiException { + return getChannelMappingOptions(providerId, null); + } + + /** + * Get channel mapping options. + * + * @param providerId Provider id. (optional) + * @param headers Optional headers to include in the request + * @return ChannelMappingOptionsDto + * @throws ApiException if fails to make API call + */ + public ChannelMappingOptionsDto getChannelMappingOptions(@org.eclipse.jdt.annotation.NonNull String providerId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getChannelMappingOptionsWithHttpInfo(providerId, + headers); + return localVarResponse.getData(); + } + + /** + * Get channel mapping options. + * + * @param providerId Provider id. (optional) + * @return ApiResponse<ChannelMappingOptionsDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelMappingOptionsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String providerId) throws ApiException { + return getChannelMappingOptionsWithHttpInfo(providerId, null); + } + + /** + * Get channel mapping options. + * + * @param providerId Provider id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<ChannelMappingOptionsDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getChannelMappingOptionsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String providerId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getChannelMappingOptionsRequestBuilder(providerId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getChannelMappingOptions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + ChannelMappingOptionsDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getChannelMappingOptionsRequestBuilder( + @org.eclipse.jdt.annotation.NonNull String providerId, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/ChannelMappingOptions"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "providerId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("providerId", providerId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets default listings provider info. + * + * @return ListingsProviderInfo + * @throws ApiException if fails to make API call + */ + public ListingsProviderInfo getDefaultListingProvider() throws ApiException { + return getDefaultListingProvider(null); + } + + /** + * Gets default listings provider info. + * + * @param headers Optional headers to include in the request + * @return ListingsProviderInfo + * @throws ApiException if fails to make API call + */ + public ListingsProviderInfo getDefaultListingProvider(Map headers) throws ApiException { + ApiResponse localVarResponse = getDefaultListingProviderWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets default listings provider info. + * + * @return ApiResponse<ListingsProviderInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultListingProviderWithHttpInfo() throws ApiException { + return getDefaultListingProviderWithHttpInfo(null); + } + + /** + * Gets default listings provider info. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<ListingsProviderInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultListingProviderWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDefaultListingProviderRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDefaultListingProvider", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + ListingsProviderInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDefaultListingProviderRequestBuilder(Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/ListingProviders/Default"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the default values for a new timer. + * + * @param programId Optional. To attach default values based on a program. (optional) + * @return SeriesTimerInfoDto + * @throws ApiException if fails to make API call + */ + public SeriesTimerInfoDto getDefaultTimer(@org.eclipse.jdt.annotation.NonNull String programId) + throws ApiException { + return getDefaultTimer(programId, null); + } + + /** + * Gets the default values for a new timer. + * + * @param programId Optional. To attach default values based on a program. (optional) + * @param headers Optional headers to include in the request + * @return SeriesTimerInfoDto + * @throws ApiException if fails to make API call + */ + public SeriesTimerInfoDto getDefaultTimer(@org.eclipse.jdt.annotation.NonNull String programId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getDefaultTimerWithHttpInfo(programId, headers); + return localVarResponse.getData(); + } + + /** + * Gets the default values for a new timer. + * + * @param programId Optional. To attach default values based on a program. (optional) + * @return ApiResponse<SeriesTimerInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultTimerWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String programId) throws ApiException { + return getDefaultTimerWithHttpInfo(programId, null); + } + + /** + * Gets the default values for a new timer. + * + * @param programId Optional. To attach default values based on a program. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<SeriesTimerInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getDefaultTimerWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String programId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getDefaultTimerRequestBuilder(programId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getDefaultTimer", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + SeriesTimerInfoDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getDefaultTimerRequestBuilder(@org.eclipse.jdt.annotation.NonNull String programId, + Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Timers/Defaults"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "programId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("programId", programId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get guid info. + * + * @return GuideInfo + * @throws ApiException if fails to make API call + */ + public GuideInfo getGuideInfo() throws ApiException { + return getGuideInfo(null); + } + + /** + * Get guid info. + * + * @param headers Optional headers to include in the request + * @return GuideInfo + * @throws ApiException if fails to make API call + */ + public GuideInfo getGuideInfo(Map headers) throws ApiException { + ApiResponse localVarResponse = getGuideInfoWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Get guid info. + * + * @return ApiResponse<GuideInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGuideInfoWithHttpInfo() throws ApiException { + return getGuideInfoWithHttpInfo(null); + } + + /** + * Get guid info. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<GuideInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getGuideInfoWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGuideInfoRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getGuideInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + GuideInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getGuideInfoRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/GuideInfo"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available lineups. + * + * @param id Provider id. (optional) + * @param type Provider type. (optional) + * @param location Location. (optional) + * @param country Country. (optional) + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getLineups(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull String type, @org.eclipse.jdt.annotation.NonNull String location, + @org.eclipse.jdt.annotation.NonNull String country) throws ApiException { + return getLineups(id, type, location, country, null); + } + + /** + * Gets available lineups. + * + * @param id Provider id. (optional) + * @param type Provider type. (optional) + * @param location Location. (optional) + * @param country Country. (optional) + * @param headers Optional headers to include in the request + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getLineups(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull String type, @org.eclipse.jdt.annotation.NonNull String location, + @org.eclipse.jdt.annotation.NonNull String country, Map headers) throws ApiException { + ApiResponse> localVarResponse = getLineupsWithHttpInfo(id, type, location, country, headers); + return localVarResponse.getData(); + } + + /** + * Gets available lineups. + * + * @param id Provider id. (optional) + * @param type Provider type. (optional) + * @param location Location. (optional) + * @param country Country. (optional) + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getLineupsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull String type, @org.eclipse.jdt.annotation.NonNull String location, + @org.eclipse.jdt.annotation.NonNull String country) throws ApiException { + return getLineupsWithHttpInfo(id, type, location, country, null); + } + + /** + * Gets available lineups. + * + * @param id Provider id. (optional) + * @param type Provider type. (optional) + * @param location Location. (optional) + * @param country Country. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getLineupsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull String type, @org.eclipse.jdt.annotation.NonNull String location, + @org.eclipse.jdt.annotation.NonNull String country, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLineupsRequestBuilder(id, type, location, country, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLineups", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLineupsRequestBuilder(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull String type, @org.eclipse.jdt.annotation.NonNull String location, + @org.eclipse.jdt.annotation.NonNull String country, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/ListingProviders/Lineups"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + localVarQueryParameterBaseName = "type"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("type", type)); + localVarQueryParameterBaseName = "location"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("location", location)); + localVarQueryParameterBaseName = "country"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("country", country)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a live tv recording stream. + * + * @param recordingId Recording id. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getLiveRecordingFile(@org.eclipse.jdt.annotation.Nullable String recordingId) throws ApiException { + return getLiveRecordingFile(recordingId, null); + } + + /** + * Gets a live tv recording stream. + * + * @param recordingId Recording id. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getLiveRecordingFile(@org.eclipse.jdt.annotation.Nullable String recordingId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getLiveRecordingFileWithHttpInfo(recordingId, headers); + return localVarResponse.getData(); + } + + /** + * Gets a live tv recording stream. + * + * @param recordingId Recording id. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveRecordingFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String recordingId) + throws ApiException { + return getLiveRecordingFileWithHttpInfo(recordingId, null); + } + + /** + * Gets a live tv recording stream. + * + * @param recordingId Recording id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveRecordingFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String recordingId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLiveRecordingFileRequestBuilder(recordingId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLiveRecordingFile", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLiveRecordingFileRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String recordingId, Map headers) throws ApiException { + // verify the required parameter 'recordingId' is set + if (recordingId == null) { + throw new ApiException(400, + "Missing the required parameter 'recordingId' when calling getLiveRecordingFile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/LiveRecordings/{recordingId}/stream".replace("{recordingId}", + ApiClient.urlEncode(recordingId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "video/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a live tv channel stream. + * + * @param streamId Stream id. (required) + * @param container Container type. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getLiveStreamFile(@org.eclipse.jdt.annotation.Nullable String streamId, + @org.eclipse.jdt.annotation.Nullable String container) throws ApiException { + return getLiveStreamFile(streamId, container, null); + } + + /** + * Gets a live tv channel stream. + * + * @param streamId Stream id. (required) + * @param container Container type. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getLiveStreamFile(@org.eclipse.jdt.annotation.Nullable String streamId, + @org.eclipse.jdt.annotation.Nullable String container, Map headers) throws ApiException { + ApiResponse localVarResponse = getLiveStreamFileWithHttpInfo(streamId, container, headers); + return localVarResponse.getData(); + } + + /** + * Gets a live tv channel stream. + * + * @param streamId Stream id. (required) + * @param container Container type. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveStreamFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String streamId, + @org.eclipse.jdt.annotation.Nullable String container) throws ApiException { + return getLiveStreamFileWithHttpInfo(streamId, container, null); + } + + /** + * Gets a live tv channel stream. + * + * @param streamId Stream id. (required) + * @param container Container type. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveStreamFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String streamId, + @org.eclipse.jdt.annotation.Nullable String container, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLiveStreamFileRequestBuilder(streamId, container, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLiveStreamFile", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLiveStreamFileRequestBuilder(@org.eclipse.jdt.annotation.Nullable String streamId, + @org.eclipse.jdt.annotation.Nullable String container, Map headers) throws ApiException { + // verify the required parameter 'streamId' is set + if (streamId == null) { + throw new ApiException(400, "Missing the required parameter 'streamId' when calling getLiveStreamFile"); + } + // verify the required parameter 'container' is set + if (container == null) { + throw new ApiException(400, "Missing the required parameter 'container' when calling getLiveStreamFile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/LiveStreamFiles/{streamId}/stream.{container}" + .replace("{streamId}", ApiClient.urlEncode(streamId.toString())) + .replace("{container}", ApiClient.urlEncode(container.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "video/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available live tv channels. + * + * @param type Optional. Filter by channel type. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param isFavorite Optional. Filter by channels that are favorites, or not. (optional) + * @param isLiked Optional. Filter by channels that are liked, or not. (optional) + * @param isDisliked Optional. Filter by channels that are disliked, or not. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes \"Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param sortBy Optional. Key to sort by. (optional) + * @param sortOrder Optional. Sort order. (optional) + * @param enableFavoriteSorting Optional. Incorporate favorite and like status into channel sorting. (optional, + * default to false) + * @param addCurrentProgram Optional. Adds current program info to each channel. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getLiveTvChannels(@org.eclipse.jdt.annotation.NonNull ChannelType type, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, @org.eclipse.jdt.annotation.NonNull Boolean isLiked, + @org.eclipse.jdt.annotation.NonNull Boolean isDisliked, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableFavoriteSorting, + @org.eclipse.jdt.annotation.NonNull Boolean addCurrentProgram) throws ApiException { + return getLiveTvChannels(type, userId, startIndex, isMovie, isSeries, isNews, isKids, isSports, limit, + isFavorite, isLiked, isDisliked, enableImages, imageTypeLimit, enableImageTypes, fields, enableUserData, + sortBy, sortOrder, enableFavoriteSorting, addCurrentProgram, null); + } + + /** + * Gets available live tv channels. + * + * @param type Optional. Filter by channel type. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param isFavorite Optional. Filter by channels that are favorites, or not. (optional) + * @param isLiked Optional. Filter by channels that are liked, or not. (optional) + * @param isDisliked Optional. Filter by channels that are disliked, or not. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes \"Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param sortBy Optional. Key to sort by. (optional) + * @param sortOrder Optional. Sort order. (optional) + * @param enableFavoriteSorting Optional. Incorporate favorite and like status into channel sorting. (optional, + * default to false) + * @param addCurrentProgram Optional. Adds current program info to each channel. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getLiveTvChannels(@org.eclipse.jdt.annotation.NonNull ChannelType type, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, @org.eclipse.jdt.annotation.NonNull Boolean isLiked, + @org.eclipse.jdt.annotation.NonNull Boolean isDisliked, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableFavoriteSorting, + @org.eclipse.jdt.annotation.NonNull Boolean addCurrentProgram, Map headers) + throws ApiException { + ApiResponse localVarResponse = getLiveTvChannelsWithHttpInfo(type, userId, startIndex, + isMovie, isSeries, isNews, isKids, isSports, limit, isFavorite, isLiked, isDisliked, enableImages, + imageTypeLimit, enableImageTypes, fields, enableUserData, sortBy, sortOrder, enableFavoriteSorting, + addCurrentProgram, headers); + return localVarResponse.getData(); + } + + /** + * Gets available live tv channels. + * + * @param type Optional. Filter by channel type. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param isFavorite Optional. Filter by channels that are favorites, or not. (optional) + * @param isLiked Optional. Filter by channels that are liked, or not. (optional) + * @param isDisliked Optional. Filter by channels that are disliked, or not. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes \"Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param sortBy Optional. Key to sort by. (optional) + * @param sortOrder Optional. Sort order. (optional) + * @param enableFavoriteSorting Optional. Incorporate favorite and like status into channel sorting. (optional, + * default to false) + * @param addCurrentProgram Optional. Adds current program info to each channel. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveTvChannelsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull ChannelType type, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean isLiked, @org.eclipse.jdt.annotation.NonNull Boolean isDisliked, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableFavoriteSorting, + @org.eclipse.jdt.annotation.NonNull Boolean addCurrentProgram) throws ApiException { + return getLiveTvChannelsWithHttpInfo(type, userId, startIndex, isMovie, isSeries, isNews, isKids, isSports, + limit, isFavorite, isLiked, isDisliked, enableImages, imageTypeLimit, enableImageTypes, fields, + enableUserData, sortBy, sortOrder, enableFavoriteSorting, addCurrentProgram, null); + } + + /** + * Gets available live tv channels. + * + * @param type Optional. Filter by channel type. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param isFavorite Optional. Filter by channels that are favorites, or not. (optional) + * @param isLiked Optional. Filter by channels that are liked, or not. (optional) + * @param isDisliked Optional. Filter by channels that are disliked, or not. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes \"Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param sortBy Optional. Key to sort by. (optional) + * @param sortOrder Optional. Sort order. (optional) + * @param enableFavoriteSorting Optional. Incorporate favorite and like status into channel sorting. (optional, + * default to false) + * @param addCurrentProgram Optional. Adds current program info to each channel. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveTvChannelsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull ChannelType type, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean isLiked, @org.eclipse.jdt.annotation.NonNull Boolean isDisliked, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableFavoriteSorting, + @org.eclipse.jdt.annotation.NonNull Boolean addCurrentProgram, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLiveTvChannelsRequestBuilder(type, userId, startIndex, isMovie, + isSeries, isNews, isKids, isSports, limit, isFavorite, isLiked, isDisliked, enableImages, + imageTypeLimit, enableImageTypes, fields, enableUserData, sortBy, sortOrder, enableFavoriteSorting, + addCurrentProgram, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLiveTvChannels", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLiveTvChannelsRequestBuilder(@org.eclipse.jdt.annotation.NonNull ChannelType type, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, @org.eclipse.jdt.annotation.NonNull Boolean isLiked, + @org.eclipse.jdt.annotation.NonNull Boolean isDisliked, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableFavoriteSorting, + @org.eclipse.jdt.annotation.NonNull Boolean addCurrentProgram, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Channels"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "type"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("type", type)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "isLiked"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isLiked", isLiked)); + localVarQueryParameterBaseName = "isDisliked"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isDisliked", isDisliked)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sortOrder", sortOrder)); + localVarQueryParameterBaseName = "enableFavoriteSorting"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableFavoriteSorting", enableFavoriteSorting)); + localVarQueryParameterBaseName = "addCurrentProgram"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addCurrentProgram", addCurrentProgram)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available live tv services. + * + * @return LiveTvInfo + * @throws ApiException if fails to make API call + */ + public LiveTvInfo getLiveTvInfo() throws ApiException { + return getLiveTvInfo(null); + } + + /** + * Gets available live tv services. + * + * @param headers Optional headers to include in the request + * @return LiveTvInfo + * @throws ApiException if fails to make API call + */ + public LiveTvInfo getLiveTvInfo(Map headers) throws ApiException { + ApiResponse localVarResponse = getLiveTvInfoWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets available live tv services. + * + * @return ApiResponse<LiveTvInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveTvInfoWithHttpInfo() throws ApiException { + return getLiveTvInfoWithHttpInfo(null); + } + + /** + * Gets available live tv services. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<LiveTvInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveTvInfoWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLiveTvInfoRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLiveTvInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + LiveTvInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLiveTvInfoRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Info"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available live tv epgs. + * + * @param channelIds The channels to return guide information for. (optional) + * @param userId Optional. Filter by user id. (optional) + * @param minStartDate Optional. The minimum premiere start date. (optional) + * @param hasAired Optional. Filter by programs that have completed airing, or not. (optional) + * @param isAiring Optional. Filter by programs that are currently airing, or not. (optional) + * @param maxStartDate Optional. The maximum premiere start date. (optional) + * @param minEndDate Optional. The minimum premiere end date. (optional) + * @param maxEndDate Optional. The maximum premiere end date. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param genres The genres to return guide information for. (optional) + * @param genreIds The genre ids to return guide information for. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param seriesTimerId Optional. Filter by series timer id. (optional) + * @param librarySeriesId Optional. Filter by library series id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getLiveTvPrograms(@org.eclipse.jdt.annotation.NonNull List channelIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minStartDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasAired, @org.eclipse.jdt.annotation.NonNull Boolean isAiring, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxStartDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minEndDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxEndDate, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull UUID librarySeriesId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getLiveTvPrograms(channelIds, userId, minStartDate, hasAired, isAiring, maxStartDate, minEndDate, + maxEndDate, isMovie, isSeries, isNews, isKids, isSports, startIndex, limit, sortBy, sortOrder, genres, + genreIds, enableImages, imageTypeLimit, enableImageTypes, enableUserData, seriesTimerId, + librarySeriesId, fields, enableTotalRecordCount, null); + } + + /** + * Gets available live tv epgs. + * + * @param channelIds The channels to return guide information for. (optional) + * @param userId Optional. Filter by user id. (optional) + * @param minStartDate Optional. The minimum premiere start date. (optional) + * @param hasAired Optional. Filter by programs that have completed airing, or not. (optional) + * @param isAiring Optional. Filter by programs that are currently airing, or not. (optional) + * @param maxStartDate Optional. The maximum premiere start date. (optional) + * @param minEndDate Optional. The minimum premiere end date. (optional) + * @param maxEndDate Optional. The maximum premiere end date. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param genres The genres to return guide information for. (optional) + * @param genreIds The genre ids to return guide information for. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param seriesTimerId Optional. Filter by series timer id. (optional) + * @param librarySeriesId Optional. Filter by library series id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getLiveTvPrograms(@org.eclipse.jdt.annotation.NonNull List channelIds, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minStartDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasAired, @org.eclipse.jdt.annotation.NonNull Boolean isAiring, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxStartDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minEndDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxEndDate, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull UUID librarySeriesId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + ApiResponse localVarResponse = getLiveTvProgramsWithHttpInfo(channelIds, userId, + minStartDate, hasAired, isAiring, maxStartDate, minEndDate, maxEndDate, isMovie, isSeries, isNews, + isKids, isSports, startIndex, limit, sortBy, sortOrder, genres, genreIds, enableImages, imageTypeLimit, + enableImageTypes, enableUserData, seriesTimerId, librarySeriesId, fields, enableTotalRecordCount, + headers); + return localVarResponse.getData(); + } + + /** + * Gets available live tv epgs. + * + * @param channelIds The channels to return guide information for. (optional) + * @param userId Optional. Filter by user id. (optional) + * @param minStartDate Optional. The minimum premiere start date. (optional) + * @param hasAired Optional. Filter by programs that have completed airing, or not. (optional) + * @param isAiring Optional. Filter by programs that are currently airing, or not. (optional) + * @param maxStartDate Optional. The maximum premiere start date. (optional) + * @param minEndDate Optional. The minimum premiere end date. (optional) + * @param maxEndDate Optional. The maximum premiere end date. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param genres The genres to return guide information for. (optional) + * @param genreIds The genre ids to return guide information for. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param seriesTimerId Optional. Filter by series timer id. (optional) + * @param librarySeriesId Optional. Filter by library series id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveTvProgramsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull List channelIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minStartDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasAired, @org.eclipse.jdt.annotation.NonNull Boolean isAiring, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxStartDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minEndDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxEndDate, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull UUID librarySeriesId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getLiveTvProgramsWithHttpInfo(channelIds, userId, minStartDate, hasAired, isAiring, maxStartDate, + minEndDate, maxEndDate, isMovie, isSeries, isNews, isKids, isSports, startIndex, limit, sortBy, + sortOrder, genres, genreIds, enableImages, imageTypeLimit, enableImageTypes, enableUserData, + seriesTimerId, librarySeriesId, fields, enableTotalRecordCount, null); + } + + /** + * Gets available live tv epgs. + * + * @param channelIds The channels to return guide information for. (optional) + * @param userId Optional. Filter by user id. (optional) + * @param minStartDate Optional. The minimum premiere start date. (optional) + * @param hasAired Optional. Filter by programs that have completed airing, or not. (optional) + * @param isAiring Optional. Filter by programs that are currently airing, or not. (optional) + * @param maxStartDate Optional. The maximum premiere start date. (optional) + * @param minEndDate Optional. The minimum premiere end date. (optional) + * @param maxEndDate Optional. The maximum premiere end date. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param genres The genres to return guide information for. (optional) + * @param genreIds The genre ids to return guide information for. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param seriesTimerId Optional. Filter by series timer id. (optional) + * @param librarySeriesId Optional. Filter by library series id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLiveTvProgramsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull List channelIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minStartDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasAired, @org.eclipse.jdt.annotation.NonNull Boolean isAiring, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxStartDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minEndDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxEndDate, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull UUID librarySeriesId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLiveTvProgramsRequestBuilder(channelIds, userId, minStartDate, + hasAired, isAiring, maxStartDate, minEndDate, maxEndDate, isMovie, isSeries, isNews, isKids, isSports, + startIndex, limit, sortBy, sortOrder, genres, genreIds, enableImages, imageTypeLimit, enableImageTypes, + enableUserData, seriesTimerId, librarySeriesId, fields, enableTotalRecordCount, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLiveTvPrograms", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLiveTvProgramsRequestBuilder( + @org.eclipse.jdt.annotation.NonNull List channelIds, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minStartDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasAired, @org.eclipse.jdt.annotation.NonNull Boolean isAiring, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxStartDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minEndDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxEndDate, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull UUID librarySeriesId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Programs"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "channelIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "channelIds", channelIds)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "minStartDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minStartDate", minStartDate)); + localVarQueryParameterBaseName = "hasAired"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasAired", hasAired)); + localVarQueryParameterBaseName = "isAiring"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isAiring", isAiring)); + localVarQueryParameterBaseName = "maxStartDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStartDate", maxStartDate)); + localVarQueryParameterBaseName = "minEndDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minEndDate", minEndDate)); + localVarQueryParameterBaseName = "maxEndDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxEndDate", maxEndDate)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "genres"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genres", genres)); + localVarQueryParameterBaseName = "genreIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genreIds", genreIds)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "seriesTimerId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("seriesTimerId", seriesTimerId)); + localVarQueryParameterBaseName = "librarySeriesId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("librarySeriesId", librarySeriesId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a live tv program. + * + * @param programId Program id. (required) + * @param userId Optional. Attach user data. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getProgram(@org.eclipse.jdt.annotation.Nullable String programId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getProgram(programId, userId, null); + } + + /** + * Gets a live tv program. + * + * @param programId Program id. (required) + * @param userId Optional. Attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getProgram(@org.eclipse.jdt.annotation.Nullable String programId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getProgramWithHttpInfo(programId, userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets a live tv program. + * + * @param programId Program id. (required) + * @param userId Optional. Attach user data. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getProgramWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String programId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getProgramWithHttpInfo(programId, userId, null); + } + + /** + * Gets a live tv program. + * + * @param programId Program id. (required) + * @param userId Optional. Attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getProgramWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String programId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getProgramRequestBuilder(programId, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getProgram", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getProgramRequestBuilder(@org.eclipse.jdt.annotation.Nullable String programId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + // verify the required parameter 'programId' is set + if (programId == null) { + throw new ApiException(400, "Missing the required parameter 'programId' when calling getProgram"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Programs/{programId}".replace("{programId}", + ApiClient.urlEncode(programId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available live tv epgs. + * + * @param getProgramsDto Request body. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getPrograms(@org.eclipse.jdt.annotation.NonNull GetProgramsDto getProgramsDto) + throws ApiException { + return getPrograms(getProgramsDto, null); + } + + /** + * Gets available live tv epgs. + * + * @param getProgramsDto Request body. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getPrograms(@org.eclipse.jdt.annotation.NonNull GetProgramsDto getProgramsDto, + Map headers) throws ApiException { + ApiResponse localVarResponse = getProgramsWithHttpInfo(getProgramsDto, headers); + return localVarResponse.getData(); + } + + /** + * Gets available live tv epgs. + * + * @param getProgramsDto Request body. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getProgramsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull GetProgramsDto getProgramsDto) throws ApiException { + return getProgramsWithHttpInfo(getProgramsDto, null); + } + + /** + * Gets available live tv epgs. + * + * @param getProgramsDto Request body. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getProgramsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull GetProgramsDto getProgramsDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getProgramsRequestBuilder(getProgramsDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPrograms", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getProgramsRequestBuilder( + @org.eclipse.jdt.annotation.NonNull GetProgramsDto getProgramsDto, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Programs"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(getProgramsDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets recommended live tv epgs. + * + * @param userId Optional. filter by user id. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param isAiring Optional. Filter by programs that are currently airing, or not. (optional) + * @param hasAired Optional. Filter by programs that have completed airing, or not. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param genreIds The genres to return guide information for. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. include user data. (optional) + * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getRecommendedPrograms(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean isAiring, + @org.eclipse.jdt.annotation.NonNull Boolean hasAired, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getRecommendedPrograms(userId, limit, isAiring, hasAired, isSeries, isMovie, isNews, isKids, isSports, + enableImages, imageTypeLimit, enableImageTypes, genreIds, fields, enableUserData, + enableTotalRecordCount, null); + } + + /** + * Gets recommended live tv epgs. + * + * @param userId Optional. filter by user id. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param isAiring Optional. Filter by programs that are currently airing, or not. (optional) + * @param hasAired Optional. Filter by programs that have completed airing, or not. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param genreIds The genres to return guide information for. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. include user data. (optional) + * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getRecommendedPrograms(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean isAiring, + @org.eclipse.jdt.annotation.NonNull Boolean hasAired, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + ApiResponse localVarResponse = getRecommendedProgramsWithHttpInfo(userId, limit, + isAiring, hasAired, isSeries, isMovie, isNews, isKids, isSports, enableImages, imageTypeLimit, + enableImageTypes, genreIds, fields, enableUserData, enableTotalRecordCount, headers); + return localVarResponse.getData(); + } + + /** + * Gets recommended live tv epgs. + * + * @param userId Optional. filter by user id. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param isAiring Optional. Filter by programs that are currently airing, or not. (optional) + * @param hasAired Optional. Filter by programs that have completed airing, or not. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param genreIds The genres to return guide information for. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. include user data. (optional) + * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecommendedProgramsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean hasAired, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getRecommendedProgramsWithHttpInfo(userId, limit, isAiring, hasAired, isSeries, isMovie, isNews, isKids, + isSports, enableImages, imageTypeLimit, enableImageTypes, genreIds, fields, enableUserData, + enableTotalRecordCount, null); + } + + /** + * Gets recommended live tv epgs. + * + * @param userId Optional. filter by user id. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param isAiring Optional. Filter by programs that are currently airing, or not. (optional) + * @param hasAired Optional. Filter by programs that have completed airing, or not. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param genreIds The genres to return guide information for. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. include user data. (optional) + * @param enableTotalRecordCount Retrieve total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecommendedProgramsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean isAiring, @org.eclipse.jdt.annotation.NonNull Boolean hasAired, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, @org.eclipse.jdt.annotation.NonNull Boolean isKids, + @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecommendedProgramsRequestBuilder(userId, limit, isAiring, + hasAired, isSeries, isMovie, isNews, isKids, isSports, enableImages, imageTypeLimit, enableImageTypes, + genreIds, fields, enableUserData, enableTotalRecordCount, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRecommendedPrograms", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRecommendedProgramsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean isAiring, + @org.eclipse.jdt.annotation.NonNull Boolean hasAired, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Programs/Recommended"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "isAiring"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isAiring", isAiring)); + localVarQueryParameterBaseName = "hasAired"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasAired", hasAired)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "genreIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genreIds", genreIds)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a live tv recording. + * + * @param recordingId Recording id. (required) + * @param userId Optional. Attach user data. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getRecording(@org.eclipse.jdt.annotation.Nullable UUID recordingId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getRecording(recordingId, userId, null); + } + + /** + * Gets a live tv recording. + * + * @param recordingId Recording id. (required) + * @param userId Optional. Attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getRecording(@org.eclipse.jdt.annotation.Nullable UUID recordingId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getRecordingWithHttpInfo(recordingId, userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets a live tv recording. + * + * @param recordingId Recording id. (required) + * @param userId Optional. Attach user data. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecordingWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID recordingId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getRecordingWithHttpInfo(recordingId, userId, null); + } + + /** + * Gets a live tv recording. + * + * @param recordingId Recording id. (required) + * @param userId Optional. Attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecordingWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID recordingId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecordingRequestBuilder(recordingId, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRecording", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRecordingRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID recordingId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + // verify the required parameter 'recordingId' is set + if (recordingId == null) { + throw new ApiException(400, "Missing the required parameter 'recordingId' when calling getRecording"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Recordings/{recordingId}".replace("{recordingId}", + ApiClient.urlEncode(recordingId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets recording folders. + * + * @param userId Optional. Filter by user and attach user data. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getRecordingFolders(@org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + return getRecordingFolders(userId, null); + } + + /** + * Gets recording folders. + * + * @param userId Optional. Filter by user and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getRecordingFolders(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getRecordingFoldersWithHttpInfo(userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets recording folders. + * + * @param userId Optional. Filter by user and attach user data. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecordingFoldersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getRecordingFoldersWithHttpInfo(userId, null); + } + + /** + * Gets recording folders. + * + * @param userId Optional. Filter by user and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecordingFoldersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecordingFoldersRequestBuilder(userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRecordingFolders", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRecordingFoldersRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Recordings/Folders"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get recording group. + * + * @param groupId Group id. (required) + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public void getRecordingGroup(@org.eclipse.jdt.annotation.Nullable UUID groupId) throws ApiException { + getRecordingGroup(groupId, null); + } + + /** + * Get recording group. + * + * @param groupId Group id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public void getRecordingGroup(@org.eclipse.jdt.annotation.Nullable UUID groupId, Map headers) + throws ApiException { + getRecordingGroupWithHttpInfo(groupId, headers); + } + + /** + * Get recording group. + * + * @param groupId Group id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getRecordingGroupWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID groupId) + throws ApiException { + return getRecordingGroupWithHttpInfo(groupId, null); + } + + /** + * Get recording group. + * + * @param groupId Group id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getRecordingGroupWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID groupId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecordingGroupRequestBuilder(groupId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRecordingGroup", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRecordingGroupRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID groupId, + Map headers) throws ApiException { + // verify the required parameter 'groupId' is set + if (groupId == null) { + throw new ApiException(400, "Missing the required parameter 'groupId' when calling getRecordingGroup"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Recordings/Groups/{groupId}".replace("{groupId}", + ApiClient.urlEncode(groupId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets live tv recording groups. + * + * @param userId Optional. Filter by user and attach user data. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getRecordingGroups(@org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + return getRecordingGroups(userId, null); + } + + /** + * Gets live tv recording groups. + * + * @param userId Optional. Filter by user and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getRecordingGroups(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getRecordingGroupsWithHttpInfo(userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets live tv recording groups. + * + * @param userId Optional. Filter by user and attach user data. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getRecordingGroupsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getRecordingGroupsWithHttpInfo(userId, null); + } + + /** + * Gets live tv recording groups. + * + * @param userId Optional. Filter by user and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getRecordingGroupsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecordingGroupsRequestBuilder(userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRecordingGroups", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRecordingGroupsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Recordings/Groups"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets live tv recordings. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param status Optional. Filter by recording status. (optional) + * @param isInProgress Optional. Filter by recordings that are in progress, or not. (optional) + * @param seriesTimerId Optional. Filter by recordings belonging to a series timer. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isLibraryItem Optional. Filter for is library item. (optional) + * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getRecordings(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isLibraryItem, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getRecordings(channelId, userId, startIndex, limit, status, isInProgress, seriesTimerId, enableImages, + imageTypeLimit, enableImageTypes, fields, enableUserData, isMovie, isSeries, isKids, isSports, isNews, + isLibraryItem, enableTotalRecordCount, null); + } + + /** + * Gets live tv recordings. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param status Optional. Filter by recording status. (optional) + * @param isInProgress Optional. Filter by recordings that are in progress, or not. (optional) + * @param seriesTimerId Optional. Filter by recordings belonging to a series timer. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isLibraryItem Optional. Filter for is library item. (optional) + * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getRecordings(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isLibraryItem, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + ApiResponse localVarResponse = getRecordingsWithHttpInfo(channelId, userId, startIndex, + limit, status, isInProgress, seriesTimerId, enableImages, imageTypeLimit, enableImageTypes, fields, + enableUserData, isMovie, isSeries, isKids, isSports, isNews, isLibraryItem, enableTotalRecordCount, + headers); + return localVarResponse.getData(); + } + + /** + * Gets live tv recordings. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param status Optional. Filter by recording status. (optional) + * @param isInProgress Optional. Filter by recordings that are in progress, or not. (optional) + * @param seriesTimerId Optional. Filter by recordings belonging to a series timer. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isLibraryItem Optional. Filter for is library item. (optional) + * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecordingsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String channelId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isLibraryItem, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getRecordingsWithHttpInfo(channelId, userId, startIndex, limit, status, isInProgress, seriesTimerId, + enableImages, imageTypeLimit, enableImageTypes, fields, enableUserData, isMovie, isSeries, isKids, + isSports, isNews, isLibraryItem, enableTotalRecordCount, null); + } + + /** + * Gets live tv recordings. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param status Optional. Filter by recording status. (optional) + * @param isInProgress Optional. Filter by recordings that are in progress, or not. (optional) + * @param seriesTimerId Optional. Filter by recordings belonging to a series timer. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param isMovie Optional. Filter for movies. (optional) + * @param isSeries Optional. Filter for series. (optional) + * @param isKids Optional. Filter for kids. (optional) + * @param isSports Optional. Filter for sports. (optional) + * @param isNews Optional. Filter for news. (optional) + * @param isLibraryItem Optional. Filter for is library item. (optional) + * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRecordingsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String channelId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isLibraryItem, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecordingsRequestBuilder(channelId, userId, startIndex, limit, + status, isInProgress, seriesTimerId, enableImages, imageTypeLimit, enableImageTypes, fields, + enableUserData, isMovie, isSeries, isKids, isSports, isNews, isLibraryItem, enableTotalRecordCount, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRecordings", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRecordingsRequestBuilder(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean isMovie, @org.eclipse.jdt.annotation.NonNull Boolean isSeries, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isLibraryItem, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Recordings"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "channelId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("channelId", channelId)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "status"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("status", status)); + localVarQueryParameterBaseName = "isInProgress"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isInProgress", isInProgress)); + localVarQueryParameterBaseName = "seriesTimerId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("seriesTimerId", seriesTimerId)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isLibraryItem"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isLibraryItem", isLibraryItem)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets live tv recording series. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param groupId Optional. Filter by recording group. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param status Optional. Filter by recording status. (optional) + * @param isInProgress Optional. Filter by recordings that are in progress, or not. (optional) + * @param seriesTimerId Optional. Filter by recordings belonging to a series timer. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getRecordingsSeries(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String groupId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getRecordingsSeries(channelId, userId, groupId, startIndex, limit, status, isInProgress, seriesTimerId, + enableImages, imageTypeLimit, enableImageTypes, fields, enableUserData, enableTotalRecordCount, null); + } + + /** + * Gets live tv recording series. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param groupId Optional. Filter by recording group. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param status Optional. Filter by recording status. (optional) + * @param isInProgress Optional. Filter by recordings that are in progress, or not. (optional) + * @param seriesTimerId Optional. Filter by recordings belonging to a series timer. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getRecordingsSeries(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String groupId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + ApiResponse localVarResponse = getRecordingsSeriesWithHttpInfo(channelId, userId, + groupId, startIndex, limit, status, isInProgress, seriesTimerId, enableImages, imageTypeLimit, + enableImageTypes, fields, enableUserData, enableTotalRecordCount, headers); + return localVarResponse.getData(); + } + + /** + * Gets live tv recording series. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param groupId Optional. Filter by recording group. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param status Optional. Filter by recording status. (optional) + * @param isInProgress Optional. Filter by recordings that are in progress, or not. (optional) + * @param seriesTimerId Optional. Filter by recordings belonging to a series timer. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getRecordingsSeriesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String channelId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String groupId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getRecordingsSeriesWithHttpInfo(channelId, userId, groupId, startIndex, limit, status, isInProgress, + seriesTimerId, enableImages, imageTypeLimit, enableImageTypes, fields, enableUserData, + enableTotalRecordCount, null); + } + + /** + * Gets live tv recording series. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param userId Optional. Filter by user and attach user data. (optional) + * @param groupId Optional. Filter by recording group. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param status Optional. Filter by recording status. (optional) + * @param isInProgress Optional. Filter by recordings that are in progress, or not. (optional) + * @param seriesTimerId Optional. Filter by recordings belonging to a series timer. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param enableTotalRecordCount Optional. Return total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getRecordingsSeriesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String channelId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String groupId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRecordingsSeriesRequestBuilder(channelId, userId, groupId, + startIndex, limit, status, isInProgress, seriesTimerId, enableImages, imageTypeLimit, enableImageTypes, + fields, enableUserData, enableTotalRecordCount, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRecordingsSeries", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRecordingsSeriesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String groupId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull RecordingStatus status, + @org.eclipse.jdt.annotation.NonNull Boolean isInProgress, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Recordings/Series"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "channelId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("channelId", channelId)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "groupId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("groupId", groupId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "status"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("status", status)); + localVarQueryParameterBaseName = "isInProgress"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isInProgress", isInProgress)); + localVarQueryParameterBaseName = "seriesTimerId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("seriesTimerId", seriesTimerId)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available countries. + * + * @return File + * @throws ApiException if fails to make API call + */ + public File getSchedulesDirectCountries() throws ApiException { + return getSchedulesDirectCountries(null); + } + + /** + * Gets available countries. + * + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getSchedulesDirectCountries(Map headers) throws ApiException { + ApiResponse localVarResponse = getSchedulesDirectCountriesWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets available countries. + * + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSchedulesDirectCountriesWithHttpInfo() throws ApiException { + return getSchedulesDirectCountriesWithHttpInfo(null); + } + + /** + * Gets available countries. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSchedulesDirectCountriesWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSchedulesDirectCountriesRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSchedulesDirectCountries", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSchedulesDirectCountriesRequestBuilder(Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/ListingProviders/SchedulesDirect/Countries"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a live tv series timer. + * + * @param timerId Timer id. (required) + * @return SeriesTimerInfoDto + * @throws ApiException if fails to make API call + */ + public SeriesTimerInfoDto getSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { + return getSeriesTimer(timerId, null); + } + + /** + * Gets a live tv series timer. + * + * @param timerId Timer id. (required) + * @param headers Optional headers to include in the request + * @return SeriesTimerInfoDto + * @throws ApiException if fails to make API call + */ + public SeriesTimerInfoDto getSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getSeriesTimerWithHttpInfo(timerId, headers); + return localVarResponse.getData(); + } + + /** + * Gets a live tv series timer. + * + * @param timerId Timer id. (required) + * @return ApiResponse<SeriesTimerInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSeriesTimerWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { + return getSeriesTimerWithHttpInfo(timerId, null); + } + + /** + * Gets a live tv series timer. + * + * @param timerId Timer id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<SeriesTimerInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSeriesTimerWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String timerId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSeriesTimerRequestBuilder(timerId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSeriesTimer", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + SeriesTimerInfoDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSeriesTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId, + Map headers) throws ApiException { + // verify the required parameter 'timerId' is set + if (timerId == null) { + throw new ApiException(400, "Missing the required parameter 'timerId' when calling getSeriesTimer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/SeriesTimers/{timerId}".replace("{timerId}", + ApiClient.urlEncode(timerId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets live tv series timers. + * + * @param sortBy Optional. Sort by SortName or Priority. (optional) + * @param sortOrder Optional. Sort in Ascending or Descending order. (optional) + * @return SeriesTimerInfoDtoQueryResult + * @throws ApiException if fails to make API call + */ + public SeriesTimerInfoDtoQueryResult getSeriesTimers(@org.eclipse.jdt.annotation.NonNull String sortBy, + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder) throws ApiException { + return getSeriesTimers(sortBy, sortOrder, null); + } + + /** + * Gets live tv series timers. + * + * @param sortBy Optional. Sort by SortName or Priority. (optional) + * @param sortOrder Optional. Sort in Ascending or Descending order. (optional) + * @param headers Optional headers to include in the request + * @return SeriesTimerInfoDtoQueryResult + * @throws ApiException if fails to make API call + */ + public SeriesTimerInfoDtoQueryResult getSeriesTimers(@org.eclipse.jdt.annotation.NonNull String sortBy, + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, Map headers) throws ApiException { + ApiResponse localVarResponse = getSeriesTimersWithHttpInfo(sortBy, sortOrder, + headers); + return localVarResponse.getData(); + } + + /** + * Gets live tv series timers. + * + * @param sortBy Optional. Sort by SortName or Priority. (optional) + * @param sortOrder Optional. Sort in Ascending or Descending order. (optional) + * @return ApiResponse<SeriesTimerInfoDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSeriesTimersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String sortBy, @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder) + throws ApiException { + return getSeriesTimersWithHttpInfo(sortBy, sortOrder, null); + } + + /** + * Gets live tv series timers. + * + * @param sortBy Optional. Sort by SortName or Priority. (optional) + * @param sortOrder Optional. Sort in Ascending or Descending order. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<SeriesTimerInfoDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSeriesTimersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String sortBy, @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSeriesTimersRequestBuilder(sortBy, sortOrder, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSeriesTimers", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + SeriesTimerInfoDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSeriesTimersRequestBuilder(@org.eclipse.jdt.annotation.NonNull String sortBy, + @org.eclipse.jdt.annotation.NonNull SortOrder sortOrder, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/SeriesTimers"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sortOrder", sortOrder)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a timer. + * + * @param timerId Timer id. (required) + * @return TimerInfoDto + * @throws ApiException if fails to make API call + */ + public TimerInfoDto getTimer(@org.eclipse.jdt.annotation.Nullable String timerId) throws ApiException { + return getTimer(timerId, null); + } + + /** + * Gets a timer. + * + * @param timerId Timer id. (required) + * @param headers Optional headers to include in the request + * @return TimerInfoDto + * @throws ApiException if fails to make API call + */ + public TimerInfoDto getTimer(@org.eclipse.jdt.annotation.Nullable String timerId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getTimerWithHttpInfo(timerId, headers); + return localVarResponse.getData(); + } + + /** + * Gets a timer. + * + * @param timerId Timer id. (required) + * @return ApiResponse<TimerInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId) + throws ApiException { + return getTimerWithHttpInfo(timerId, null); + } + + /** + * Gets a timer. + * + * @param timerId Timer id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<TimerInfoDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTimerRequestBuilder(timerId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getTimer", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + TimerInfoDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId, + Map headers) throws ApiException { + // verify the required parameter 'timerId' is set + if (timerId == null) { + throw new ApiException(400, "Missing the required parameter 'timerId' when calling getTimer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Timers/{timerId}".replace("{timerId}", ApiClient.urlEncode(timerId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the live tv timers. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param seriesTimerId Optional. Filter by timers belonging to a series timer. (optional) + * @param isActive Optional. Filter by timers that are active. (optional) + * @param isScheduled Optional. Filter by timers that are scheduled. (optional) + * @return TimerInfoDtoQueryResult + * @throws ApiException if fails to make API call + */ + public TimerInfoDtoQueryResult getTimers(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean isActive, + @org.eclipse.jdt.annotation.NonNull Boolean isScheduled) throws ApiException { + return getTimers(channelId, seriesTimerId, isActive, isScheduled, null); + } + + /** + * Gets the live tv timers. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param seriesTimerId Optional. Filter by timers belonging to a series timer. (optional) + * @param isActive Optional. Filter by timers that are active. (optional) + * @param isScheduled Optional. Filter by timers that are scheduled. (optional) + * @param headers Optional headers to include in the request + * @return TimerInfoDtoQueryResult + * @throws ApiException if fails to make API call + */ + public TimerInfoDtoQueryResult getTimers(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean isActive, + @org.eclipse.jdt.annotation.NonNull Boolean isScheduled, Map headers) throws ApiException { + ApiResponse localVarResponse = getTimersWithHttpInfo(channelId, seriesTimerId, + isActive, isScheduled, headers); + return localVarResponse.getData(); + } + + /** + * Gets the live tv timers. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param seriesTimerId Optional. Filter by timers belonging to a series timer. (optional) + * @param isActive Optional. Filter by timers that are active. (optional) + * @param isScheduled Optional. Filter by timers that are scheduled. (optional) + * @return ApiResponse<TimerInfoDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTimersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean isActive, + @org.eclipse.jdt.annotation.NonNull Boolean isScheduled) throws ApiException { + return getTimersWithHttpInfo(channelId, seriesTimerId, isActive, isScheduled, null); + } + + /** + * Gets the live tv timers. + * + * @param channelId Optional. Filter by channel id. (optional) + * @param seriesTimerId Optional. Filter by timers belonging to a series timer. (optional) + * @param isActive Optional. Filter by timers that are active. (optional) + * @param isScheduled Optional. Filter by timers that are scheduled. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<TimerInfoDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTimersWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean isActive, + @org.eclipse.jdt.annotation.NonNull Boolean isScheduled, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTimersRequestBuilder(channelId, seriesTimerId, isActive, + isScheduled, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getTimers", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + TimerInfoDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getTimersRequestBuilder(@org.eclipse.jdt.annotation.NonNull String channelId, + @org.eclipse.jdt.annotation.NonNull String seriesTimerId, + @org.eclipse.jdt.annotation.NonNull Boolean isActive, + @org.eclipse.jdt.annotation.NonNull Boolean isScheduled, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Timers"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "channelId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("channelId", channelId)); + localVarQueryParameterBaseName = "seriesTimerId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("seriesTimerId", seriesTimerId)); + localVarQueryParameterBaseName = "isActive"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isActive", isActive)); + localVarQueryParameterBaseName = "isScheduled"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isScheduled", isScheduled)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get tuner host types. + * + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getTunerHostTypes() throws ApiException { + return getTunerHostTypes(null); + } + + /** + * Get tuner host types. + * + * @param headers Optional headers to include in the request + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getTunerHostTypes(Map headers) throws ApiException { + ApiResponse> localVarResponse = getTunerHostTypesWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Get tuner host types. + * + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getTunerHostTypesWithHttpInfo() throws ApiException { + return getTunerHostTypesWithHttpInfo(null); + } + + /** + * Get tuner host types. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getTunerHostTypesWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTunerHostTypesRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getTunerHostTypes", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getTunerHostTypesRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/TunerHosts/Types"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Resets a tv tuner. + * + * @param tunerId Tuner id. (required) + * @throws ApiException if fails to make API call + */ + public void resetTuner(@org.eclipse.jdt.annotation.Nullable String tunerId) throws ApiException { + resetTuner(tunerId, null); + } + + /** + * Resets a tv tuner. + * + * @param tunerId Tuner id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void resetTuner(@org.eclipse.jdt.annotation.Nullable String tunerId, Map headers) + throws ApiException { + resetTunerWithHttpInfo(tunerId, headers); + } + + /** + * Resets a tv tuner. + * + * @param tunerId Tuner id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse resetTunerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String tunerId) + throws ApiException { + return resetTunerWithHttpInfo(tunerId, null); + } + + /** + * Resets a tv tuner. + * + * @param tunerId Tuner id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse resetTunerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String tunerId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = resetTunerRequestBuilder(tunerId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("resetTuner", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder resetTunerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String tunerId, + Map headers) throws ApiException { + // verify the required parameter 'tunerId' is set + if (tunerId == null) { + throw new ApiException(400, "Missing the required parameter 'tunerId' when calling resetTuner"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Tuners/{tunerId}/Reset".replace("{tunerId}", + ApiClient.urlEncode(tunerId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set channel mappings. + * + * @param setChannelMappingDto The set channel mapping dto. (required) + * @return TunerChannelMapping + * @throws ApiException if fails to make API call + */ + public TunerChannelMapping setChannelMapping( + @org.eclipse.jdt.annotation.Nullable SetChannelMappingDto setChannelMappingDto) throws ApiException { + return setChannelMapping(setChannelMappingDto, null); + } + + /** + * Set channel mappings. + * + * @param setChannelMappingDto The set channel mapping dto. (required) + * @param headers Optional headers to include in the request + * @return TunerChannelMapping + * @throws ApiException if fails to make API call + */ + public TunerChannelMapping setChannelMapping( + @org.eclipse.jdt.annotation.Nullable SetChannelMappingDto setChannelMappingDto, Map headers) + throws ApiException { + ApiResponse localVarResponse = setChannelMappingWithHttpInfo(setChannelMappingDto, + headers); + return localVarResponse.getData(); + } + + /** + * Set channel mappings. + * + * @param setChannelMappingDto The set channel mapping dto. (required) + * @return ApiResponse<TunerChannelMapping> + * @throws ApiException if fails to make API call + */ + public ApiResponse setChannelMappingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SetChannelMappingDto setChannelMappingDto) throws ApiException { + return setChannelMappingWithHttpInfo(setChannelMappingDto, null); + } + + /** + * Set channel mappings. + * + * @param setChannelMappingDto The set channel mapping dto. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<TunerChannelMapping> + * @throws ApiException if fails to make API call + */ + public ApiResponse setChannelMappingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SetChannelMappingDto setChannelMappingDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = setChannelMappingRequestBuilder(setChannelMappingDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("setChannelMapping", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + TunerChannelMapping responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder setChannelMappingRequestBuilder( + @org.eclipse.jdt.annotation.Nullable SetChannelMappingDto setChannelMappingDto, Map headers) + throws ApiException { + // verify the required parameter 'setChannelMappingDto' is set + if (setChannelMappingDto == null) { + throw new ApiException(400, + "Missing the required parameter 'setChannelMappingDto' when calling setChannelMapping"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/ChannelMappings"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(setChannelMappingDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a live tv series timer. + * + * @param timerId Timer id. (required) + * @param seriesTimerInfoDto New series timer info. (optional) + * @throws ApiException if fails to make API call + */ + public void updateSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto) throws ApiException { + updateSeriesTimer(timerId, seriesTimerInfoDto, null); + } + + /** + * Updates a live tv series timer. + * + * @param timerId Timer id. (required) + * @param seriesTimerInfoDto New series timer info. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateSeriesTimer(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto, Map headers) + throws ApiException { + updateSeriesTimerWithHttpInfo(timerId, seriesTimerInfoDto, headers); + } + + /** + * Updates a live tv series timer. + * + * @param timerId Timer id. (required) + * @param seriesTimerInfoDto New series timer info. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateSeriesTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto) throws ApiException { + return updateSeriesTimerWithHttpInfo(timerId, seriesTimerInfoDto, null); + } + + /** + * Updates a live tv series timer. + * + * @param timerId Timer id. (required) + * @param seriesTimerInfoDto New series timer info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateSeriesTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateSeriesTimerRequestBuilder(timerId, seriesTimerInfoDto, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateSeriesTimer", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateSeriesTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull SeriesTimerInfoDto seriesTimerInfoDto, Map headers) + throws ApiException { + // verify the required parameter 'timerId' is set + if (timerId == null) { + throw new ApiException(400, "Missing the required parameter 'timerId' when calling updateSeriesTimer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/SeriesTimers/{timerId}".replace("{timerId}", + ApiClient.urlEncode(timerId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(seriesTimerInfoDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a live tv timer. + * + * @param timerId Timer id. (required) + * @param timerInfoDto New timer info. (optional) + * @throws ApiException if fails to make API call + */ + public void updateTimer(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto) throws ApiException { + updateTimer(timerId, timerInfoDto, null); + } + + /** + * Updates a live tv timer. + * + * @param timerId Timer id. (required) + * @param timerInfoDto New timer info. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateTimer(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto, Map headers) + throws ApiException { + updateTimerWithHttpInfo(timerId, timerInfoDto, headers); + } + + /** + * Updates a live tv timer. + * + * @param timerId Timer id. (required) + * @param timerInfoDto New timer info. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto) throws ApiException { + return updateTimerWithHttpInfo(timerId, timerInfoDto, null); + } + + /** + * Updates a live tv timer. + * + * @param timerId Timer id. (required) + * @param timerInfoDto New timer info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateTimerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateTimerRequestBuilder(timerId, timerInfoDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateTimer", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateTimerRequestBuilder(@org.eclipse.jdt.annotation.Nullable String timerId, + @org.eclipse.jdt.annotation.NonNull TimerInfoDto timerInfoDto, Map headers) + throws ApiException { + // verify the required parameter 'timerId' is set + if (timerId == null) { + throw new ApiException(400, "Missing the required parameter 'timerId' when calling updateTimer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveTv/Timers/{timerId}".replace("{timerId}", ApiClient.urlEncode(timerId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(timerInfoDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/LocalizationApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/LocalizationApi.java new file mode 100644 index 0000000000000..34076ff47de7c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/LocalizationApi.java @@ -0,0 +1,541 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.CountryInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.CultureDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.LocalizationOption; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ParentalRating; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LocalizationApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public LocalizationApi() { + this(Configuration.getDefaultApiClient()); + } + + public LocalizationApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets known countries. + * + * @return List<CountryInfo> + * @throws ApiException if fails to make API call + */ + public List getCountries() throws ApiException { + return getCountries(null); + } + + /** + * Gets known countries. + * + * @param headers Optional headers to include in the request + * @return List<CountryInfo> + * @throws ApiException if fails to make API call + */ + public List getCountries(Map headers) throws ApiException { + ApiResponse> localVarResponse = getCountriesWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets known countries. + * + * @return ApiResponse<List<CountryInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getCountriesWithHttpInfo() throws ApiException { + return getCountriesWithHttpInfo(null); + } + + /** + * Gets known countries. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<CountryInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getCountriesWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getCountriesRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getCountries", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getCountriesRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Localization/Countries"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets known cultures. + * + * @return List<CultureDto> + * @throws ApiException if fails to make API call + */ + public List getCultures() throws ApiException { + return getCultures(null); + } + + /** + * Gets known cultures. + * + * @param headers Optional headers to include in the request + * @return List<CultureDto> + * @throws ApiException if fails to make API call + */ + public List getCultures(Map headers) throws ApiException { + ApiResponse> localVarResponse = getCulturesWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets known cultures. + * + * @return ApiResponse<List<CultureDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getCulturesWithHttpInfo() throws ApiException { + return getCulturesWithHttpInfo(null); + } + + /** + * Gets known cultures. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<CultureDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getCulturesWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getCulturesRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getCultures", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getCulturesRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Localization/Cultures"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets localization options. + * + * @return List<LocalizationOption> + * @throws ApiException if fails to make API call + */ + public List getLocalizationOptions() throws ApiException { + return getLocalizationOptions(null); + } + + /** + * Gets localization options. + * + * @param headers Optional headers to include in the request + * @return List<LocalizationOption> + * @throws ApiException if fails to make API call + */ + public List getLocalizationOptions(Map headers) throws ApiException { + ApiResponse> localVarResponse = getLocalizationOptionsWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets localization options. + * + * @return ApiResponse<List<LocalizationOption>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getLocalizationOptionsWithHttpInfo() throws ApiException { + return getLocalizationOptionsWithHttpInfo(null); + } + + /** + * Gets localization options. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<LocalizationOption>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getLocalizationOptionsWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLocalizationOptionsRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLocalizationOptions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLocalizationOptionsRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Localization/Options"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets known parental ratings. + * + * @return List<ParentalRating> + * @throws ApiException if fails to make API call + */ + public List getParentalRatings() throws ApiException { + return getParentalRatings(null); + } + + /** + * Gets known parental ratings. + * + * @param headers Optional headers to include in the request + * @return List<ParentalRating> + * @throws ApiException if fails to make API call + */ + public List getParentalRatings(Map headers) throws ApiException { + ApiResponse> localVarResponse = getParentalRatingsWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets known parental ratings. + * + * @return ApiResponse<List<ParentalRating>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getParentalRatingsWithHttpInfo() throws ApiException { + return getParentalRatingsWithHttpInfo(null); + } + + /** + * Gets known parental ratings. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<ParentalRating>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getParentalRatingsWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getParentalRatingsRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getParentalRatings", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getParentalRatingsRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Localization/ParentalRatings"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/MediaInfoApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/MediaInfoApi.java new file mode 100644 index 0000000000000..ecf3ca6b8ab5b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/MediaInfoApi.java @@ -0,0 +1,1080 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.LiveStreamResponse; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.OpenLiveStreamDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PlaybackInfoDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PlaybackInfoResponse; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaInfoApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public MediaInfoApi() { + this(Configuration.getDefaultApiClient()); + } + + public MediaInfoApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Closes a media source. + * + * @param liveStreamId The livestream id. (required) + * @throws ApiException if fails to make API call + */ + public void closeLiveStream(@org.eclipse.jdt.annotation.Nullable String liveStreamId) throws ApiException { + closeLiveStream(liveStreamId, null); + } + + /** + * Closes a media source. + * + * @param liveStreamId The livestream id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void closeLiveStream(@org.eclipse.jdt.annotation.Nullable String liveStreamId, Map headers) + throws ApiException { + closeLiveStreamWithHttpInfo(liveStreamId, headers); + } + + /** + * Closes a media source. + * + * @param liveStreamId The livestream id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse closeLiveStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String liveStreamId) + throws ApiException { + return closeLiveStreamWithHttpInfo(liveStreamId, null); + } + + /** + * Closes a media source. + * + * @param liveStreamId The livestream id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse closeLiveStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String liveStreamId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = closeLiveStreamRequestBuilder(liveStreamId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("closeLiveStream", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder closeLiveStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable String liveStreamId, + Map headers) throws ApiException { + // verify the required parameter 'liveStreamId' is set + if (liveStreamId == null) { + throw new ApiException(400, "Missing the required parameter 'liveStreamId' when calling closeLiveStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveStreams/Close"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Tests the network with a request with the size of the bitrate. + * + * @param size The bitrate. Defaults to 102400. (optional, default to 102400) + * @return File + * @throws ApiException if fails to make API call + */ + public File getBitrateTestBytes(@org.eclipse.jdt.annotation.NonNull Integer size) throws ApiException { + return getBitrateTestBytes(size, null); + } + + /** + * Tests the network with a request with the size of the bitrate. + * + * @param size The bitrate. Defaults to 102400. (optional, default to 102400) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getBitrateTestBytes(@org.eclipse.jdt.annotation.NonNull Integer size, Map headers) + throws ApiException { + ApiResponse localVarResponse = getBitrateTestBytesWithHttpInfo(size, headers); + return localVarResponse.getData(); + } + + /** + * Tests the network with a request with the size of the bitrate. + * + * @param size The bitrate. Defaults to 102400. (optional, default to 102400) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getBitrateTestBytesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Integer size) + throws ApiException { + return getBitrateTestBytesWithHttpInfo(size, null); + } + + /** + * Tests the network with a request with the size of the bitrate. + * + * @param size The bitrate. Defaults to 102400. (optional, default to 102400) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getBitrateTestBytesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Integer size, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getBitrateTestBytesRequestBuilder(size, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getBitrateTestBytes", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getBitrateTestBytesRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer size, + Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playback/BitrateTest"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "size"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("size", size)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/octet-stream"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets live playback media info for an item. + * + * @param itemId The item id. (required) + * @param userId The user id. (required) + * @return PlaybackInfoResponse + * @throws ApiException if fails to make API call + */ + public PlaybackInfoResponse getPlaybackInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + return getPlaybackInfo(itemId, userId, null); + } + + /** + * Gets live playback media info for an item. + * + * @param itemId The item id. (required) + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @return PlaybackInfoResponse + * @throws ApiException if fails to make API call + */ + public PlaybackInfoResponse getPlaybackInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getPlaybackInfoWithHttpInfo(itemId, userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets live playback media info for an item. + * + * @param itemId The item id. (required) + * @param userId The user id. (required) + * @return ApiResponse<PlaybackInfoResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPlaybackInfoWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable UUID userId) + throws ApiException { + return getPlaybackInfoWithHttpInfo(itemId, userId, null); + } + + /** + * Gets live playback media info for an item. + * + * @param itemId The item id. (required) + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<PlaybackInfoResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPlaybackInfoWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPlaybackInfoRequestBuilder(itemId, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPlaybackInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + PlaybackInfoResponse responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPlaybackInfoRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getPlaybackInfo"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getPlaybackInfo"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/PlaybackInfo".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets live playback media info for an item. + * For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query + * parameters are obsolete. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @param maxStreamingBitrate The maximum streaming bitrate. (optional) + * @param startTimeTicks The start time in ticks. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param maxAudioChannels The maximum number of audio channels. (optional) + * @param mediaSourceId The media source id. (optional) + * @param liveStreamId The livestream id. (optional) + * @param autoOpenLiveStream Whether to auto open the livestream. (optional) + * @param enableDirectPlay Whether to enable direct play. Default: true. (optional) + * @param enableDirectStream Whether to enable direct stream. Default: true. (optional) + * @param enableTranscoding Whether to enable transcoding. Default: true. (optional) + * @param allowVideoStreamCopy Whether to allow to copy the video stream. Default: true. (optional) + * @param allowAudioStreamCopy Whether to allow to copy the audio stream. Default: true. (optional) + * @param playbackInfoDto The playback info. (optional) + * @return PlaybackInfoResponse + * @throws ApiException if fails to make API call + */ + public PlaybackInfoResponse getPostedPlaybackInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean autoOpenLiveStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableTranscoding, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull PlaybackInfoDto playbackInfoDto) throws ApiException { + return getPostedPlaybackInfo(itemId, userId, maxStreamingBitrate, startTimeTicks, audioStreamIndex, + subtitleStreamIndex, maxAudioChannels, mediaSourceId, liveStreamId, autoOpenLiveStream, + enableDirectPlay, enableDirectStream, enableTranscoding, allowVideoStreamCopy, allowAudioStreamCopy, + playbackInfoDto, null); + } + + /** + * Gets live playback media info for an item. + * For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query + * parameters are obsolete. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @param maxStreamingBitrate The maximum streaming bitrate. (optional) + * @param startTimeTicks The start time in ticks. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param maxAudioChannels The maximum number of audio channels. (optional) + * @param mediaSourceId The media source id. (optional) + * @param liveStreamId The livestream id. (optional) + * @param autoOpenLiveStream Whether to auto open the livestream. (optional) + * @param enableDirectPlay Whether to enable direct play. Default: true. (optional) + * @param enableDirectStream Whether to enable direct stream. Default: true. (optional) + * @param enableTranscoding Whether to enable transcoding. Default: true. (optional) + * @param allowVideoStreamCopy Whether to allow to copy the video stream. Default: true. (optional) + * @param allowAudioStreamCopy Whether to allow to copy the audio stream. Default: true. (optional) + * @param playbackInfoDto The playback info. (optional) + * @param headers Optional headers to include in the request + * @return PlaybackInfoResponse + * @throws ApiException if fails to make API call + */ + public PlaybackInfoResponse getPostedPlaybackInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean autoOpenLiveStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableTranscoding, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull PlaybackInfoDto playbackInfoDto, Map headers) + throws ApiException { + ApiResponse localVarResponse = getPostedPlaybackInfoWithHttpInfo(itemId, userId, + maxStreamingBitrate, startTimeTicks, audioStreamIndex, subtitleStreamIndex, maxAudioChannels, + mediaSourceId, liveStreamId, autoOpenLiveStream, enableDirectPlay, enableDirectStream, + enableTranscoding, allowVideoStreamCopy, allowAudioStreamCopy, playbackInfoDto, headers); + return localVarResponse.getData(); + } + + /** + * Gets live playback media info for an item. + * For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query + * parameters are obsolete. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @param maxStreamingBitrate The maximum streaming bitrate. (optional) + * @param startTimeTicks The start time in ticks. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param maxAudioChannels The maximum number of audio channels. (optional) + * @param mediaSourceId The media source id. (optional) + * @param liveStreamId The livestream id. (optional) + * @param autoOpenLiveStream Whether to auto open the livestream. (optional) + * @param enableDirectPlay Whether to enable direct play. Default: true. (optional) + * @param enableDirectStream Whether to enable direct stream. Default: true. (optional) + * @param enableTranscoding Whether to enable transcoding. Default: true. (optional) + * @param allowVideoStreamCopy Whether to allow to copy the video stream. Default: true. (optional) + * @param allowAudioStreamCopy Whether to allow to copy the audio stream. Default: true. (optional) + * @param playbackInfoDto The playback info. (optional) + * @return ApiResponse<PlaybackInfoResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPostedPlaybackInfoWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean autoOpenLiveStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableTranscoding, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull PlaybackInfoDto playbackInfoDto) throws ApiException { + return getPostedPlaybackInfoWithHttpInfo(itemId, userId, maxStreamingBitrate, startTimeTicks, audioStreamIndex, + subtitleStreamIndex, maxAudioChannels, mediaSourceId, liveStreamId, autoOpenLiveStream, + enableDirectPlay, enableDirectStream, enableTranscoding, allowVideoStreamCopy, allowAudioStreamCopy, + playbackInfoDto, null); + } + + /** + * Gets live playback media info for an item. + * For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query + * parameters are obsolete. + * + * @param itemId The item id. (required) + * @param userId The user id. (optional) + * @param maxStreamingBitrate The maximum streaming bitrate. (optional) + * @param startTimeTicks The start time in ticks. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param maxAudioChannels The maximum number of audio channels. (optional) + * @param mediaSourceId The media source id. (optional) + * @param liveStreamId The livestream id. (optional) + * @param autoOpenLiveStream Whether to auto open the livestream. (optional) + * @param enableDirectPlay Whether to enable direct play. Default: true. (optional) + * @param enableDirectStream Whether to enable direct stream. Default: true. (optional) + * @param enableTranscoding Whether to enable transcoding. Default: true. (optional) + * @param allowVideoStreamCopy Whether to allow to copy the video stream. Default: true. (optional) + * @param allowAudioStreamCopy Whether to allow to copy the audio stream. Default: true. (optional) + * @param playbackInfoDto The playback info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<PlaybackInfoResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPostedPlaybackInfoWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean autoOpenLiveStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableTranscoding, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull PlaybackInfoDto playbackInfoDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPostedPlaybackInfoRequestBuilder(itemId, userId, + maxStreamingBitrate, startTimeTicks, audioStreamIndex, subtitleStreamIndex, maxAudioChannels, + mediaSourceId, liveStreamId, autoOpenLiveStream, enableDirectPlay, enableDirectStream, + enableTranscoding, allowVideoStreamCopy, allowAudioStreamCopy, playbackInfoDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPostedPlaybackInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + PlaybackInfoResponse responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPostedPlaybackInfoRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean autoOpenLiveStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull Boolean enableTranscoding, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull PlaybackInfoDto playbackInfoDto, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getPostedPlaybackInfo"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/PlaybackInfo".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "maxStreamingBitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStreamingBitrate", maxStreamingBitrate)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "autoOpenLiveStream"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("autoOpenLiveStream", autoOpenLiveStream)); + localVarQueryParameterBaseName = "enableDirectPlay"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableDirectPlay", enableDirectPlay)); + localVarQueryParameterBaseName = "enableDirectStream"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableDirectStream", enableDirectStream)); + localVarQueryParameterBaseName = "enableTranscoding"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTranscoding", enableTranscoding)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(playbackInfoDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Opens a media source. + * + * @param openToken The open token. (optional) + * @param userId The user id. (optional) + * @param playSessionId The play session id. (optional) + * @param maxStreamingBitrate The maximum streaming bitrate. (optional) + * @param startTimeTicks The start time in ticks. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param maxAudioChannels The maximum number of audio channels. (optional) + * @param itemId The item id. (optional) + * @param enableDirectPlay Whether to enable direct play. Default: true. (optional) + * @param enableDirectStream Whether to enable direct stream. Default: true. (optional) + * @param openLiveStreamDto The open live stream dto. (optional) + * @return LiveStreamResponse + * @throws ApiException if fails to make API call + */ + public LiveStreamResponse openLiveStream(@org.eclipse.jdt.annotation.NonNull String openToken, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull OpenLiveStreamDto openLiveStreamDto) throws ApiException { + return openLiveStream(openToken, userId, playSessionId, maxStreamingBitrate, startTimeTicks, audioStreamIndex, + subtitleStreamIndex, maxAudioChannels, itemId, enableDirectPlay, enableDirectStream, openLiveStreamDto, + null); + } + + /** + * Opens a media source. + * + * @param openToken The open token. (optional) + * @param userId The user id. (optional) + * @param playSessionId The play session id. (optional) + * @param maxStreamingBitrate The maximum streaming bitrate. (optional) + * @param startTimeTicks The start time in ticks. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param maxAudioChannels The maximum number of audio channels. (optional) + * @param itemId The item id. (optional) + * @param enableDirectPlay Whether to enable direct play. Default: true. (optional) + * @param enableDirectStream Whether to enable direct stream. Default: true. (optional) + * @param openLiveStreamDto The open live stream dto. (optional) + * @param headers Optional headers to include in the request + * @return LiveStreamResponse + * @throws ApiException if fails to make API call + */ + public LiveStreamResponse openLiveStream(@org.eclipse.jdt.annotation.NonNull String openToken, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull OpenLiveStreamDto openLiveStreamDto, Map headers) + throws ApiException { + ApiResponse localVarResponse = openLiveStreamWithHttpInfo(openToken, userId, playSessionId, + maxStreamingBitrate, startTimeTicks, audioStreamIndex, subtitleStreamIndex, maxAudioChannels, itemId, + enableDirectPlay, enableDirectStream, openLiveStreamDto, headers); + return localVarResponse.getData(); + } + + /** + * Opens a media source. + * + * @param openToken The open token. (optional) + * @param userId The user id. (optional) + * @param playSessionId The play session id. (optional) + * @param maxStreamingBitrate The maximum streaming bitrate. (optional) + * @param startTimeTicks The start time in ticks. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param maxAudioChannels The maximum number of audio channels. (optional) + * @param itemId The item id. (optional) + * @param enableDirectPlay Whether to enable direct play. Default: true. (optional) + * @param enableDirectStream Whether to enable direct stream. Default: true. (optional) + * @param openLiveStreamDto The open live stream dto. (optional) + * @return ApiResponse<LiveStreamResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse openLiveStreamWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String openToken, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull OpenLiveStreamDto openLiveStreamDto) throws ApiException { + return openLiveStreamWithHttpInfo(openToken, userId, playSessionId, maxStreamingBitrate, startTimeTicks, + audioStreamIndex, subtitleStreamIndex, maxAudioChannels, itemId, enableDirectPlay, enableDirectStream, + openLiveStreamDto, null); + } + + /** + * Opens a media source. + * + * @param openToken The open token. (optional) + * @param userId The user id. (optional) + * @param playSessionId The play session id. (optional) + * @param maxStreamingBitrate The maximum streaming bitrate. (optional) + * @param startTimeTicks The start time in ticks. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param maxAudioChannels The maximum number of audio channels. (optional) + * @param itemId The item id. (optional) + * @param enableDirectPlay Whether to enable direct play. Default: true. (optional) + * @param enableDirectStream Whether to enable direct stream. Default: true. (optional) + * @param openLiveStreamDto The open live stream dto. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<LiveStreamResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse openLiveStreamWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String openToken, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull OpenLiveStreamDto openLiveStreamDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = openLiveStreamRequestBuilder(openToken, userId, playSessionId, + maxStreamingBitrate, startTimeTicks, audioStreamIndex, subtitleStreamIndex, maxAudioChannels, itemId, + enableDirectPlay, enableDirectStream, openLiveStreamDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("openLiveStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + LiveStreamResponse responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder openLiveStreamRequestBuilder(@org.eclipse.jdt.annotation.NonNull String openToken, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay, + @org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream, + @org.eclipse.jdt.annotation.NonNull OpenLiveStreamDto openLiveStreamDto, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/LiveStreams/Open"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "openToken"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("openToken", openToken)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "maxStreamingBitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStreamingBitrate", maxStreamingBitrate)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "itemId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("itemId", itemId)); + localVarQueryParameterBaseName = "enableDirectPlay"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableDirectPlay", enableDirectPlay)); + localVarQueryParameterBaseName = "enableDirectStream"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableDirectStream", enableDirectStream)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(openLiveStreamDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/MoviesApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/MoviesApi.java new file mode 100644 index 0000000000000..d434b7f7d9461 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/MoviesApi.java @@ -0,0 +1,316 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.RecommendationDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MoviesApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public MoviesApi() { + this(Configuration.getDefaultApiClient()); + } + + public MoviesApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets movie recommendations. + * + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. The fields to return. (optional) + * @param categoryLimit The max number of categories to return. (optional, default to 5) + * @param itemLimit The max number of items to return per category. (optional, default to 8) + * @return List<RecommendationDto> + * @throws ApiException if fails to make API call + */ + public List getMovieRecommendations(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer categoryLimit, + @org.eclipse.jdt.annotation.NonNull Integer itemLimit) throws ApiException { + return getMovieRecommendations(userId, parentId, fields, categoryLimit, itemLimit, null); + } + + /** + * Gets movie recommendations. + * + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. The fields to return. (optional) + * @param categoryLimit The max number of categories to return. (optional, default to 5) + * @param itemLimit The max number of items to return per category. (optional, default to 8) + * @param headers Optional headers to include in the request + * @return List<RecommendationDto> + * @throws ApiException if fails to make API call + */ + public List getMovieRecommendations(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer categoryLimit, + @org.eclipse.jdt.annotation.NonNull Integer itemLimit, Map headers) throws ApiException { + ApiResponse> localVarResponse = getMovieRecommendationsWithHttpInfo(userId, parentId, + fields, categoryLimit, itemLimit, headers); + return localVarResponse.getData(); + } + + /** + * Gets movie recommendations. + * + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. The fields to return. (optional) + * @param categoryLimit The max number of categories to return. (optional, default to 5) + * @param itemLimit The max number of items to return per category. (optional, default to 8) + * @return ApiResponse<List<RecommendationDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMovieRecommendationsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer categoryLimit, + @org.eclipse.jdt.annotation.NonNull Integer itemLimit) throws ApiException { + return getMovieRecommendationsWithHttpInfo(userId, parentId, fields, categoryLimit, itemLimit, null); + } + + /** + * Gets movie recommendations. + * + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. The fields to return. (optional) + * @param categoryLimit The max number of categories to return. (optional, default to 5) + * @param itemLimit The max number of items to return per category. (optional, default to 8) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RecommendationDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getMovieRecommendationsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer categoryLimit, + @org.eclipse.jdt.annotation.NonNull Integer itemLimit, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMovieRecommendationsRequestBuilder(userId, parentId, fields, + categoryLimit, itemLimit, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMovieRecommendations", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMovieRecommendationsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer categoryLimit, + @org.eclipse.jdt.annotation.NonNull Integer itemLimit, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Movies/Recommendations"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "categoryLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("categoryLimit", categoryLimit)); + localVarQueryParameterBaseName = "itemLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("itemLimit", itemLimit)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/MusicGenresApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/MusicGenresApi.java new file mode 100644 index 0000000000000..8dd9a2ef46d92 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/MusicGenresApi.java @@ -0,0 +1,628 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SortOrder; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MusicGenresApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public MusicGenresApi() { + this(Configuration.getDefaultApiClient()); + } + + public MusicGenresApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets a music genre, by name. + * + * @param genreName The genre name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getMusicGenre(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getMusicGenre(genreName, userId, null); + } + + /** + * Gets a music genre, by name. + * + * @param genreName The genre name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getMusicGenre(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getMusicGenreWithHttpInfo(genreName, userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets a music genre, by name. + * + * @param genreName The genre name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMusicGenreWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getMusicGenreWithHttpInfo(genreName, userId, null); + } + + /** + * Gets a music genre, by name. + * + * @param genreName The genre name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getMusicGenreWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMusicGenreRequestBuilder(genreName, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMusicGenre", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMusicGenreRequestBuilder(@org.eclipse.jdt.annotation.Nullable String genreName, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + // verify the required parameter 'genreName' is set + if (genreName == null) { + throw new ApiException(400, "Missing the required parameter 'genreName' when calling getMusicGenre"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MusicGenres/{genreName}".replace("{genreName}", + ApiClient.urlEncode(genreName.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all music genres from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered in based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Optional. Include total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getMusicGenres(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getMusicGenres(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, + isFavorite, imageTypeLimit, enableImageTypes, userId, nameStartsWithOrGreater, nameStartsWith, + nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount, null); + } + + /** + * Gets all music genres from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered in based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Optional. Include total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public BaseItemDtoQueryResult getMusicGenres(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + ApiResponse localVarResponse = getMusicGenresWithHttpInfo(startIndex, limit, searchTerm, + parentId, fields, excludeItemTypes, includeItemTypes, isFavorite, imageTypeLimit, enableImageTypes, + userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, + enableTotalRecordCount, headers); + return localVarResponse.getData(); + } + + /** + * Gets all music genres from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered in based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Optional. Include total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getMusicGenresWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getMusicGenresWithHttpInfo(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, + includeItemTypes, isFavorite, imageTypeLimit, enableImageTypes, userId, nameStartsWithOrGreater, + nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, enableTotalRecordCount, null); + } + + /** + * Gets all music genres from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered in based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Optional. Include total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse getMusicGenresWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getMusicGenresRequestBuilder(startIndex, limit, searchTerm, + parentId, fields, excludeItemTypes, includeItemTypes, isFavorite, imageTypeLimit, enableImageTypes, + userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, sortBy, sortOrder, enableImages, + enableTotalRecordCount, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getMusicGenres", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getMusicGenresRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/MusicGenres"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "nameStartsWithOrGreater"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWithOrGreater", nameStartsWithOrGreater)); + localVarQueryParameterBaseName = "nameStartsWith"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWith", nameStartsWith)); + localVarQueryParameterBaseName = "nameLessThan"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameLessThan", nameLessThan)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/NotificationsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/NotificationsApi.java new file mode 100644 index 0000000000000..418e44d59a450 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/NotificationsApi.java @@ -0,0 +1,877 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.AdminNotificationDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.NameIdPair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.NotificationResultDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.NotificationTypeInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.NotificationsSummaryDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NotificationsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public NotificationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public NotificationsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Sends a notification to all admins. + * + * @param adminNotificationDto The notification request. (required) + * @throws ApiException if fails to make API call + */ + public void createAdminNotification(@org.eclipse.jdt.annotation.Nullable AdminNotificationDto adminNotificationDto) + throws ApiException { + createAdminNotification(adminNotificationDto, null); + } + + /** + * Sends a notification to all admins. + * + * @param adminNotificationDto The notification request. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void createAdminNotification(@org.eclipse.jdt.annotation.Nullable AdminNotificationDto adminNotificationDto, + Map headers) throws ApiException { + createAdminNotificationWithHttpInfo(adminNotificationDto, headers); + } + + /** + * Sends a notification to all admins. + * + * @param adminNotificationDto The notification request. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createAdminNotificationWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable AdminNotificationDto adminNotificationDto) throws ApiException { + return createAdminNotificationWithHttpInfo(adminNotificationDto, null); + } + + /** + * Sends a notification to all admins. + * + * @param adminNotificationDto The notification request. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createAdminNotificationWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable AdminNotificationDto adminNotificationDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createAdminNotificationRequestBuilder(adminNotificationDto, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createAdminNotification", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createAdminNotificationRequestBuilder( + @org.eclipse.jdt.annotation.Nullable AdminNotificationDto adminNotificationDto, Map headers) + throws ApiException { + // verify the required parameter 'adminNotificationDto' is set + if (adminNotificationDto == null) { + throw new ApiException(400, + "Missing the required parameter 'adminNotificationDto' when calling createAdminNotification"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Notifications/Admin"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(adminNotificationDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets notification services. + * + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getNotificationServices() throws ApiException { + return getNotificationServices(null); + } + + /** + * Gets notification services. + * + * @param headers Optional headers to include in the request + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getNotificationServices(Map headers) throws ApiException { + ApiResponse> localVarResponse = getNotificationServicesWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets notification services. + * + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getNotificationServicesWithHttpInfo() throws ApiException { + return getNotificationServicesWithHttpInfo(null); + } + + /** + * Gets notification services. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getNotificationServicesWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getNotificationServicesRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getNotificationServices", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getNotificationServicesRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Notifications/Services"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets notification types. + * + * @return List<NotificationTypeInfo> + * @throws ApiException if fails to make API call + */ + public List getNotificationTypes() throws ApiException { + return getNotificationTypes(null); + } + + /** + * Gets notification types. + * + * @param headers Optional headers to include in the request + * @return List<NotificationTypeInfo> + * @throws ApiException if fails to make API call + */ + public List getNotificationTypes(Map headers) throws ApiException { + ApiResponse> localVarResponse = getNotificationTypesWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets notification types. + * + * @return ApiResponse<List<NotificationTypeInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getNotificationTypesWithHttpInfo() throws ApiException { + return getNotificationTypesWithHttpInfo(null); + } + + /** + * Gets notification types. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<NotificationTypeInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getNotificationTypesWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getNotificationTypesRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getNotificationTypes", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getNotificationTypesRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Notifications/Types"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a user's notifications. + * + * @param userId (required) + * @return NotificationResultDto + * @throws ApiException if fails to make API call + */ + public NotificationResultDto getNotifications(@org.eclipse.jdt.annotation.Nullable String userId) + throws ApiException { + return getNotifications(userId, null); + } + + /** + * Gets a user's notifications. + * + * @param userId (required) + * @param headers Optional headers to include in the request + * @return NotificationResultDto + * @throws ApiException if fails to make API call + */ + public NotificationResultDto getNotifications(@org.eclipse.jdt.annotation.Nullable String userId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getNotificationsWithHttpInfo(userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets a user's notifications. + * + * @param userId (required) + * @return ApiResponse<NotificationResultDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getNotificationsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String userId) throws ApiException { + return getNotificationsWithHttpInfo(userId, null); + } + + /** + * Gets a user's notifications. + * + * @param userId (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<NotificationResultDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getNotificationsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getNotificationsRequestBuilder(userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getNotifications", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + NotificationResultDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getNotificationsRequestBuilder(@org.eclipse.jdt.annotation.Nullable String userId, + Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getNotifications"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Notifications/{userId}".replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a user's notification summary. + * + * @param userId (required) + * @return NotificationsSummaryDto + * @throws ApiException if fails to make API call + */ + public NotificationsSummaryDto getNotificationsSummary(@org.eclipse.jdt.annotation.Nullable String userId) + throws ApiException { + return getNotificationsSummary(userId, null); + } + + /** + * Gets a user's notification summary. + * + * @param userId (required) + * @param headers Optional headers to include in the request + * @return NotificationsSummaryDto + * @throws ApiException if fails to make API call + */ + public NotificationsSummaryDto getNotificationsSummary(@org.eclipse.jdt.annotation.Nullable String userId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getNotificationsSummaryWithHttpInfo(userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets a user's notification summary. + * + * @param userId (required) + * @return ApiResponse<NotificationsSummaryDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getNotificationsSummaryWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String userId) throws ApiException { + return getNotificationsSummaryWithHttpInfo(userId, null); + } + + /** + * Gets a user's notification summary. + * + * @param userId (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<NotificationsSummaryDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getNotificationsSummaryWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable String userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getNotificationsSummaryRequestBuilder(userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getNotificationsSummary", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + NotificationsSummaryDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getNotificationsSummaryRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String userId, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getNotificationsSummary"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Notifications/{userId}/Summary".replace("{userId}", + ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sets notifications as read. + * + * @param userId (required) + * @throws ApiException if fails to make API call + */ + public void setRead(@org.eclipse.jdt.annotation.Nullable String userId) throws ApiException { + setRead(userId, null); + } + + /** + * Sets notifications as read. + * + * @param userId (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void setRead(@org.eclipse.jdt.annotation.Nullable String userId, Map headers) + throws ApiException { + setReadWithHttpInfo(userId, headers); + } + + /** + * Sets notifications as read. + * + * @param userId (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setReadWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String userId) + throws ApiException { + return setReadWithHttpInfo(userId, null); + } + + /** + * Sets notifications as read. + * + * @param userId (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setReadWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = setReadRequestBuilder(userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("setRead", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder setReadRequestBuilder(@org.eclipse.jdt.annotation.Nullable String userId, + Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling setRead"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Notifications/{userId}/Read".replace("{userId}", + ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sets notifications as unread. + * + * @param userId (required) + * @throws ApiException if fails to make API call + */ + public void setUnread(@org.eclipse.jdt.annotation.Nullable String userId) throws ApiException { + setUnread(userId, null); + } + + /** + * Sets notifications as unread. + * + * @param userId (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void setUnread(@org.eclipse.jdt.annotation.Nullable String userId, Map headers) + throws ApiException { + setUnreadWithHttpInfo(userId, headers); + } + + /** + * Sets notifications as unread. + * + * @param userId (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setUnreadWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String userId) + throws ApiException { + return setUnreadWithHttpInfo(userId, null); + } + + /** + * Sets notifications as unread. + * + * @param userId (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setUnreadWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = setUnreadRequestBuilder(userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("setUnread", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder setUnreadRequestBuilder(@org.eclipse.jdt.annotation.Nullable String userId, + Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling setUnread"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Notifications/{userId}/Unread".replace("{userId}", + ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PackageApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PackageApi.java new file mode 100644 index 0000000000000..8b376aae34d8d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PackageApi.java @@ -0,0 +1,820 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PackageInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.RepositoryInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PackageApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public PackageApi() { + this(Configuration.getDefaultApiClient()); + } + + public PackageApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Cancels a package installation. + * + * @param packageId Installation Id. (required) + * @throws ApiException if fails to make API call + */ + public void cancelPackageInstallation(@org.eclipse.jdt.annotation.Nullable UUID packageId) throws ApiException { + cancelPackageInstallation(packageId, null); + } + + /** + * Cancels a package installation. + * + * @param packageId Installation Id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void cancelPackageInstallation(@org.eclipse.jdt.annotation.Nullable UUID packageId, + Map headers) throws ApiException { + cancelPackageInstallationWithHttpInfo(packageId, headers); + } + + /** + * Cancels a package installation. + * + * @param packageId Installation Id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse cancelPackageInstallationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID packageId) + throws ApiException { + return cancelPackageInstallationWithHttpInfo(packageId, null); + } + + /** + * Cancels a package installation. + * + * @param packageId Installation Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse cancelPackageInstallationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID packageId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = cancelPackageInstallationRequestBuilder(packageId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("cancelPackageInstallation", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder cancelPackageInstallationRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID packageId, Map headers) throws ApiException { + // verify the required parameter 'packageId' is set + if (packageId == null) { + throw new ApiException(400, + "Missing the required parameter 'packageId' when calling cancelPackageInstallation"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Packages/Installing/{packageId}".replace("{packageId}", + ApiClient.urlEncode(packageId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a package by name or assembly GUID. + * + * @param name The name of the package. (required) + * @param assemblyGuid The GUID of the associated assembly. (optional) + * @return PackageInfo + * @throws ApiException if fails to make API call + */ + public PackageInfo getPackageInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid) throws ApiException { + return getPackageInfo(name, assemblyGuid, null); + } + + /** + * Gets a package by name or assembly GUID. + * + * @param name The name of the package. (required) + * @param assemblyGuid The GUID of the associated assembly. (optional) + * @param headers Optional headers to include in the request + * @return PackageInfo + * @throws ApiException if fails to make API call + */ + public PackageInfo getPackageInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, Map headers) throws ApiException { + ApiResponse localVarResponse = getPackageInfoWithHttpInfo(name, assemblyGuid, headers); + return localVarResponse.getData(); + } + + /** + * Gets a package by name or assembly GUID. + * + * @param name The name of the package. (required) + * @param assemblyGuid The GUID of the associated assembly. (optional) + * @return ApiResponse<PackageInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPackageInfoWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid) throws ApiException { + return getPackageInfoWithHttpInfo(name, assemblyGuid, null); + } + + /** + * Gets a package by name or assembly GUID. + * + * @param name The name of the package. (required) + * @param assemblyGuid The GUID of the associated assembly. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<PackageInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPackageInfoWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPackageInfoRequestBuilder(name, assemblyGuid, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPackageInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + PackageInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPackageInfoRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getPackageInfo"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Packages/{name}".replace("{name}", ApiClient.urlEncode(name.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "assemblyGuid"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("assemblyGuid", assemblyGuid)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available packages. + * + * @return List<PackageInfo> + * @throws ApiException if fails to make API call + */ + public List getPackages() throws ApiException { + return getPackages(null); + } + + /** + * Gets available packages. + * + * @param headers Optional headers to include in the request + * @return List<PackageInfo> + * @throws ApiException if fails to make API call + */ + public List getPackages(Map headers) throws ApiException { + ApiResponse> localVarResponse = getPackagesWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets available packages. + * + * @return ApiResponse<List<PackageInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPackagesWithHttpInfo() throws ApiException { + return getPackagesWithHttpInfo(null); + } + + /** + * Gets available packages. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<PackageInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPackagesWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPackagesRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPackages", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPackagesRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Packages"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all package repositories. + * + * @return List<RepositoryInfo> + * @throws ApiException if fails to make API call + */ + public List getRepositories() throws ApiException { + return getRepositories(null); + } + + /** + * Gets all package repositories. + * + * @param headers Optional headers to include in the request + * @return List<RepositoryInfo> + * @throws ApiException if fails to make API call + */ + public List getRepositories(Map headers) throws ApiException { + ApiResponse> localVarResponse = getRepositoriesWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets all package repositories. + * + * @return ApiResponse<List<RepositoryInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getRepositoriesWithHttpInfo() throws ApiException { + return getRepositoriesWithHttpInfo(null); + } + + /** + * Gets all package repositories. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RepositoryInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getRepositoriesWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRepositoriesRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRepositories", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRepositoriesRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Repositories"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Installs a package. + * + * @param name Package name. (required) + * @param assemblyGuid GUID of the associated assembly. (optional) + * @param version Optional version. Defaults to latest version. (optional) + * @param repositoryUrl Optional. Specify the repository to install from. (optional) + * @throws ApiException if fails to make API call + */ + public void installPackage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, @org.eclipse.jdt.annotation.NonNull String version, + @org.eclipse.jdt.annotation.NonNull String repositoryUrl) throws ApiException { + installPackage(name, assemblyGuid, version, repositoryUrl, null); + } + + /** + * Installs a package. + * + * @param name Package name. (required) + * @param assemblyGuid GUID of the associated assembly. (optional) + * @param version Optional version. Defaults to latest version. (optional) + * @param repositoryUrl Optional. Specify the repository to install from. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void installPackage(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, @org.eclipse.jdt.annotation.NonNull String version, + @org.eclipse.jdt.annotation.NonNull String repositoryUrl, Map headers) throws ApiException { + installPackageWithHttpInfo(name, assemblyGuid, version, repositoryUrl, headers); + } + + /** + * Installs a package. + * + * @param name Package name. (required) + * @param assemblyGuid GUID of the associated assembly. (optional) + * @param version Optional version. Defaults to latest version. (optional) + * @param repositoryUrl Optional. Specify the repository to install from. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse installPackageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, @org.eclipse.jdt.annotation.NonNull String version, + @org.eclipse.jdt.annotation.NonNull String repositoryUrl) throws ApiException { + return installPackageWithHttpInfo(name, assemblyGuid, version, repositoryUrl, null); + } + + /** + * Installs a package. + * + * @param name Package name. (required) + * @param assemblyGuid GUID of the associated assembly. (optional) + * @param version Optional version. Defaults to latest version. (optional) + * @param repositoryUrl Optional. Specify the repository to install from. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse installPackageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, @org.eclipse.jdt.annotation.NonNull String version, + @org.eclipse.jdt.annotation.NonNull String repositoryUrl, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = installPackageRequestBuilder(name, assemblyGuid, version, + repositoryUrl, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("installPackage", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder installPackageRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID assemblyGuid, @org.eclipse.jdt.annotation.NonNull String version, + @org.eclipse.jdt.annotation.NonNull String repositoryUrl, Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling installPackage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Packages/Installed/{name}".replace("{name}", ApiClient.urlEncode(name.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "assemblyGuid"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("assemblyGuid", assemblyGuid)); + localVarQueryParameterBaseName = "version"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("version", version)); + localVarQueryParameterBaseName = "repositoryUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("repositoryUrl", repositoryUrl)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sets the enabled and existing package repositories. + * + * @param repositoryInfo The list of package repositories. (required) + * @throws ApiException if fails to make API call + */ + public void setRepositories(@org.eclipse.jdt.annotation.Nullable List repositoryInfo) + throws ApiException { + setRepositories(repositoryInfo, null); + } + + /** + * Sets the enabled and existing package repositories. + * + * @param repositoryInfo The list of package repositories. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void setRepositories(@org.eclipse.jdt.annotation.Nullable List repositoryInfo, + Map headers) throws ApiException { + setRepositoriesWithHttpInfo(repositoryInfo, headers); + } + + /** + * Sets the enabled and existing package repositories. + * + * @param repositoryInfo The list of package repositories. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setRepositoriesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable List repositoryInfo) throws ApiException { + return setRepositoriesWithHttpInfo(repositoryInfo, null); + } + + /** + * Sets the enabled and existing package repositories. + * + * @param repositoryInfo The list of package repositories. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setRepositoriesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable List repositoryInfo, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = setRepositoriesRequestBuilder(repositoryInfo, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("setRepositories", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder setRepositoriesRequestBuilder( + @org.eclipse.jdt.annotation.Nullable List repositoryInfo, Map headers) + throws ApiException { + // verify the required parameter 'repositoryInfo' is set + if (repositoryInfo == null) { + throw new ApiException(400, "Missing the required parameter 'repositoryInfo' when calling setRepositories"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Repositories"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(repositoryInfo); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PersonsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PersonsApi.java new file mode 100644 index 0000000000000..a8b75a59e998b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PersonsApi.java @@ -0,0 +1,544 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFilter; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PersonsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public PersonsApi() { + this(Configuration.getDefaultApiClient()); + } + + public PersonsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Get person by name. + * + * @param name Person name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getPerson(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getPerson(name, userId, null); + } + + /** + * Get person by name. + * + * @param name Person name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getPerson(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getPersonWithHttpInfo(name, userId, headers); + return localVarResponse.getData(); + } + + /** + * Get person by name. + * + * @param name Person name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPersonWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getPersonWithHttpInfo(name, userId, null); + } + + /** + * Get person by name. + * + * @param name Person name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPersonWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPersonRequestBuilder(name, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPerson", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPersonRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getPerson"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Persons/{name}".replace("{name}", ApiClient.urlEncode(name.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all persons. + * + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. userId is required. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param excludePersonTypes Optional. If specified results will be filtered to exclude those containing the + * specified PersonType. Allows multiple, comma-delimited. (optional) + * @param personTypes Optional. If specified results will be filtered to include only those containing the specified + * PersonType. Allows multiple, comma-delimited. (optional) + * @param appearsInItemId Optional. If specified, person results will be filtered on items related to said persons. + * (optional) + * @param userId User id. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getPersons(@org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludePersonTypes, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull UUID appearsInItemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getPersons(limit, searchTerm, fields, filters, isFavorite, enableUserData, imageTypeLimit, + enableImageTypes, excludePersonTypes, personTypes, appearsInItemId, userId, enableImages, null); + } + + /** + * Gets all persons. + * + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. userId is required. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param excludePersonTypes Optional. If specified results will be filtered to exclude those containing the + * specified PersonType. Allows multiple, comma-delimited. (optional) + * @param personTypes Optional. If specified results will be filtered to include only those containing the specified + * PersonType. Allows multiple, comma-delimited. (optional) + * @param appearsInItemId Optional. If specified, person results will be filtered on items related to said persons. + * (optional) + * @param userId User id. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getPersons(@org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludePersonTypes, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull UUID appearsInItemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { + ApiResponse localVarResponse = getPersonsWithHttpInfo(limit, searchTerm, fields, + filters, isFavorite, enableUserData, imageTypeLimit, enableImageTypes, excludePersonTypes, personTypes, + appearsInItemId, userId, enableImages, headers); + return localVarResponse.getData(); + } + + /** + * Gets all persons. + * + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. userId is required. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param excludePersonTypes Optional. If specified results will be filtered to exclude those containing the + * specified PersonType. Allows multiple, comma-delimited. (optional) + * @param personTypes Optional. If specified results will be filtered to include only those containing the specified + * PersonType. Allows multiple, comma-delimited. (optional) + * @param appearsInItemId Optional. If specified, person results will be filtered on items related to said persons. + * (optional) + * @param userId User id. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPersonsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludePersonTypes, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull UUID appearsInItemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getPersonsWithHttpInfo(limit, searchTerm, fields, filters, isFavorite, enableUserData, imageTypeLimit, + enableImageTypes, excludePersonTypes, personTypes, appearsInItemId, userId, enableImages, null); + } + + /** + * Gets all persons. + * + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm The search term. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param filters Optional. Specify additional filters to apply. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. userId is required. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param excludePersonTypes Optional. If specified results will be filtered to exclude those containing the + * specified PersonType. Allows multiple, comma-delimited. (optional) + * @param personTypes Optional. If specified results will be filtered to include only those containing the specified + * PersonType. Allows multiple, comma-delimited. (optional) + * @param appearsInItemId Optional. If specified, person results will be filtered on items related to said persons. + * (optional) + * @param userId User id. (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPersonsWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludePersonTypes, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull UUID appearsInItemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPersonsRequestBuilder(limit, searchTerm, fields, filters, + isFavorite, enableUserData, imageTypeLimit, enableImageTypes, excludePersonTypes, personTypes, + appearsInItemId, userId, enableImages, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPersons", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPersonsRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull List excludePersonTypes, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull UUID appearsInItemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Persons"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "filters"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "filters", filters)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "excludePersonTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludePersonTypes", excludePersonTypes)); + localVarQueryParameterBaseName = "personTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personTypes", personTypes)); + localVarQueryParameterBaseName = "appearsInItemId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("appearsInItemId", appearsInItemId)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PlaylistsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PlaylistsApi.java new file mode 100644 index 0000000000000..27ae057bfe14a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PlaylistsApi.java @@ -0,0 +1,918 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.CreatePlaylistDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PlaylistCreationResult; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaylistsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public PlaylistsApi() { + this(Configuration.getDefaultApiClient()); + } + + public PlaylistsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Adds items to a playlist. + * + * @param playlistId The playlist id. (required) + * @param ids Item id, comma delimited. (optional) + * @param userId The userId. (optional) + * @throws ApiException if fails to make API call + */ + public void addToPlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + addToPlaylist(playlistId, ids, userId, null); + } + + /** + * Adds items to a playlist. + * + * @param playlistId The playlist id. (required) + * @param ids Item id, comma delimited. (optional) + * @param userId The userId. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void addToPlaylist(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + addToPlaylistWithHttpInfo(playlistId, ids, userId, headers); + } + + /** + * Adds items to a playlist. + * + * @param playlistId The playlist id. (required) + * @param ids Item id, comma delimited. (optional) + * @param userId The userId. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addToPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + return addToPlaylistWithHttpInfo(playlistId, ids, userId, null); + } + + /** + * Adds items to a playlist. + * + * @param playlistId The playlist id. (required) + * @param ids Item id, comma delimited. (optional) + * @param userId The userId. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addToPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addToPlaylistRequestBuilder(playlistId, ids, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("addToPlaylist", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder addToPlaylistRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling addToPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists/{playlistId}/Items".replace("{playlistId}", + ApiClient.urlEncode(playlistId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates a new playlist. + * For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query + * parameters are obsolete. + * + * @param name The playlist name. (optional) + * @param ids The item ids. (optional) + * @param userId The user id. (optional) + * @param mediaType The media type. (optional) + * @param createPlaylistDto The create playlist payload. (optional) + * @return PlaylistCreationResult + * @throws ApiException if fails to make API call + */ + public PlaylistCreationResult createPlaylist(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String mediaType, + @org.eclipse.jdt.annotation.NonNull CreatePlaylistDto createPlaylistDto) throws ApiException { + return createPlaylist(name, ids, userId, mediaType, createPlaylistDto, null); + } + + /** + * Creates a new playlist. + * For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query + * parameters are obsolete. + * + * @param name The playlist name. (optional) + * @param ids The item ids. (optional) + * @param userId The user id. (optional) + * @param mediaType The media type. (optional) + * @param createPlaylistDto The create playlist payload. (optional) + * @param headers Optional headers to include in the request + * @return PlaylistCreationResult + * @throws ApiException if fails to make API call + */ + public PlaylistCreationResult createPlaylist(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String mediaType, + @org.eclipse.jdt.annotation.NonNull CreatePlaylistDto createPlaylistDto, Map headers) + throws ApiException { + ApiResponse localVarResponse = createPlaylistWithHttpInfo(name, ids, userId, mediaType, + createPlaylistDto, headers); + return localVarResponse.getData(); + } + + /** + * Creates a new playlist. + * For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query + * parameters are obsolete. + * + * @param name The playlist name. (optional) + * @param ids The item ids. (optional) + * @param userId The user id. (optional) + * @param mediaType The media type. (optional) + * @param createPlaylistDto The create playlist payload. (optional) + * @return ApiResponse<PlaylistCreationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse createPlaylistWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String mediaType, + @org.eclipse.jdt.annotation.NonNull CreatePlaylistDto createPlaylistDto) throws ApiException { + return createPlaylistWithHttpInfo(name, ids, userId, mediaType, createPlaylistDto, null); + } + + /** + * Creates a new playlist. + * For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query + * parameters are obsolete. + * + * @param name The playlist name. (optional) + * @param ids The item ids. (optional) + * @param userId The user id. (optional) + * @param mediaType The media type. (optional) + * @param createPlaylistDto The create playlist payload. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<PlaylistCreationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse createPlaylistWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull String name, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull String mediaType, + @org.eclipse.jdt.annotation.NonNull CreatePlaylistDto createPlaylistDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createPlaylistRequestBuilder(name, ids, userId, mediaType, + createPlaylistDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createPlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + PlaylistCreationResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createPlaylistRequestBuilder(@org.eclipse.jdt.annotation.NonNull String name, + @org.eclipse.jdt.annotation.NonNull List ids, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String mediaType, + @org.eclipse.jdt.annotation.NonNull CreatePlaylistDto createPlaylistDto, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "mediaType"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaType", mediaType)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createPlaylistDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the original items of a playlist. + * + * @param playlistId The playlist id. (required) + * @param userId User id. (required) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getPlaylistItems(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getPlaylistItems(playlistId, userId, startIndex, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Gets the original items of a playlist. + * + * @param playlistId The playlist id. (required) + * @param userId User id. (required) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getPlaylistItems(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + ApiResponse localVarResponse = getPlaylistItemsWithHttpInfo(playlistId, userId, + startIndex, limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + return localVarResponse.getData(); + } + + /** + * Gets the original items of a playlist. + * + * @param playlistId The playlist id. (required) + * @param userId User id. (required) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPlaylistItemsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes) throws ApiException { + return getPlaylistItemsWithHttpInfo(playlistId, userId, startIndex, limit, fields, enableImages, enableUserData, + imageTypeLimit, enableImageTypes, null); + } + + /** + * Gets the original items of a playlist. + * + * @param playlistId The playlist id. (required) + * @param userId User id. (required) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPlaylistItemsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID playlistId, @org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPlaylistItemsRequestBuilder(playlistId, userId, startIndex, + limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPlaylistItems", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPlaylistItemsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID playlistId, + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, Map headers) + throws ApiException { + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling getPlaylistItems"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getPlaylistItems"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists/{playlistId}/Items".replace("{playlistId}", + ApiClient.urlEncode(playlistId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Moves a playlist item. + * + * @param playlistId The playlist id. (required) + * @param itemId The item id. (required) + * @param newIndex The new index. (required) + * @throws ApiException if fails to make API call + */ + public void moveItem(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable Integer newIndex) + throws ApiException { + moveItem(playlistId, itemId, newIndex, null); + } + + /** + * Moves a playlist item. + * + * @param playlistId The playlist id. (required) + * @param itemId The item id. (required) + * @param newIndex The new index. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void moveItem(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable Integer newIndex, + Map headers) throws ApiException { + moveItemWithHttpInfo(playlistId, itemId, newIndex, headers); + } + + /** + * Moves a playlist item. + * + * @param playlistId The playlist id. (required) + * @param itemId The item id. (required) + * @param newIndex The new index. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse moveItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable Integer newIndex) + throws ApiException { + return moveItemWithHttpInfo(playlistId, itemId, newIndex, null); + } + + /** + * Moves a playlist item. + * + * @param playlistId The playlist id. (required) + * @param itemId The item id. (required) + * @param newIndex The new index. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse moveItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable Integer newIndex, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = moveItemRequestBuilder(playlistId, itemId, newIndex, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("moveItem", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder moveItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable Integer newIndex, + Map headers) throws ApiException { + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling moveItem"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling moveItem"); + } + // verify the required parameter 'newIndex' is set + if (newIndex == null) { + throw new ApiException(400, "Missing the required parameter 'newIndex' when calling moveItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists/{playlistId}/Items/{itemId}/Move/{newIndex}" + .replace("{playlistId}", ApiClient.urlEncode(playlistId.toString())) + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{newIndex}", ApiClient.urlEncode(newIndex.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Removes items from a playlist. + * + * @param playlistId The playlist id. (required) + * @param entryIds The item ids, comma delimited. (optional) + * @throws ApiException if fails to make API call + */ + public void removeFromPlaylist(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.NonNull List entryIds) throws ApiException { + removeFromPlaylist(playlistId, entryIds, null); + } + + /** + * Removes items from a playlist. + * + * @param playlistId The playlist id. (required) + * @param entryIds The item ids, comma delimited. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void removeFromPlaylist(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.NonNull List entryIds, Map headers) + throws ApiException { + removeFromPlaylistWithHttpInfo(playlistId, entryIds, headers); + } + + /** + * Removes items from a playlist. + * + * @param playlistId The playlist id. (required) + * @param entryIds The item ids, comma delimited. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeFromPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.NonNull List entryIds) throws ApiException { + return removeFromPlaylistWithHttpInfo(playlistId, entryIds, null); + } + + /** + * Removes items from a playlist. + * + * @param playlistId The playlist id. (required) + * @param entryIds The item ids, comma delimited. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeFromPlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.NonNull List entryIds, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeFromPlaylistRequestBuilder(playlistId, entryIds, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("removeFromPlaylist", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder removeFromPlaylistRequestBuilder(@org.eclipse.jdt.annotation.Nullable String playlistId, + @org.eclipse.jdt.annotation.NonNull List entryIds, Map headers) + throws ApiException { + // verify the required parameter 'playlistId' is set + if (playlistId == null) { + throw new ApiException(400, "Missing the required parameter 'playlistId' when calling removeFromPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Playlists/{playlistId}/Items".replace("{playlistId}", + ApiClient.urlEncode(playlistId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "entryIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "entryIds", entryIds)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PlaystateApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PlaystateApi.java new file mode 100644 index 0000000000000..e533aadfb8a74 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PlaystateApi.java @@ -0,0 +1,1467 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PlayMethod; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PlaybackProgressInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PlaybackStartInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PlaybackStopInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.RepeatMode; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.UserItemDataDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaystateApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public PlaystateApi() { + this(Configuration.getDefaultApiClient()); + } + + public PlaystateApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Marks an item as played for user. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param datePlayed Optional. The date the item was played. (optional) + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto markPlayedItem(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime datePlayed) throws ApiException { + return markPlayedItem(userId, itemId, datePlayed, null); + } + + /** + * Marks an item as played for user. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param datePlayed Optional. The date the item was played. (optional) + * @param headers Optional headers to include in the request + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto markPlayedItem(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime datePlayed, Map headers) + throws ApiException { + ApiResponse localVarResponse = markPlayedItemWithHttpInfo(userId, itemId, datePlayed, headers); + return localVarResponse.getData(); + } + + /** + * Marks an item as played for user. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param datePlayed Optional. The date the item was played. (optional) + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse markPlayedItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime datePlayed) throws ApiException { + return markPlayedItemWithHttpInfo(userId, itemId, datePlayed, null); + } + + /** + * Marks an item as played for user. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param datePlayed Optional. The date the item was played. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse markPlayedItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime datePlayed, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = markPlayedItemRequestBuilder(userId, itemId, datePlayed, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("markPlayedItem", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + UserItemDataDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder markPlayedItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime datePlayed, Map headers) + throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling markPlayedItem"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling markPlayedItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/PlayedItems/{itemId}" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "datePlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("datePlayed", datePlayed)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Marks an item as unplayed for user. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto markUnplayedItem(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return markUnplayedItem(userId, itemId, null); + } + + /** + * Marks an item as unplayed for user. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto markUnplayedItem(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + ApiResponse localVarResponse = markUnplayedItemWithHttpInfo(userId, itemId, headers); + return localVarResponse.getData(); + } + + /** + * Marks an item as unplayed for user. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse markUnplayedItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return markUnplayedItemWithHttpInfo(userId, itemId, null); + } + + /** + * Marks an item as unplayed for user. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse markUnplayedItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = markUnplayedItemRequestBuilder(userId, itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("markUnplayedItem", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + UserItemDataDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder markUnplayedItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling markUnplayedItem"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling markUnplayedItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/PlayedItems/{itemId}" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports a user's playback progress. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param positionTicks Optional. The current position, in ticks. 1 tick = 10000 ms. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param volumeLevel Scale of 0-100. (optional) + * @param playMethod The play method. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param repeatMode The repeat mode. (optional) + * @param isPaused Indicates if the player is paused. (optional, default to false) + * @param isMuted Indicates if the player is muted. (optional, default to false) + * @throws ApiException if fails to make API call + */ + public void onPlaybackProgress(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer volumeLevel, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode, + @org.eclipse.jdt.annotation.NonNull Boolean isPaused, @org.eclipse.jdt.annotation.NonNull Boolean isMuted) + throws ApiException { + onPlaybackProgress(userId, itemId, mediaSourceId, positionTicks, audioStreamIndex, subtitleStreamIndex, + volumeLevel, playMethod, liveStreamId, playSessionId, repeatMode, isPaused, isMuted, null); + } + + /** + * Reports a user's playback progress. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param positionTicks Optional. The current position, in ticks. 1 tick = 10000 ms. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param volumeLevel Scale of 0-100. (optional) + * @param playMethod The play method. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param repeatMode The repeat mode. (optional) + * @param isPaused Indicates if the player is paused. (optional, default to false) + * @param isMuted Indicates if the player is muted. (optional, default to false) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void onPlaybackProgress(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer volumeLevel, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode, + @org.eclipse.jdt.annotation.NonNull Boolean isPaused, @org.eclipse.jdt.annotation.NonNull Boolean isMuted, + Map headers) throws ApiException { + onPlaybackProgressWithHttpInfo(userId, itemId, mediaSourceId, positionTicks, audioStreamIndex, + subtitleStreamIndex, volumeLevel, playMethod, liveStreamId, playSessionId, repeatMode, isPaused, + isMuted, headers); + } + + /** + * Reports a user's playback progress. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param positionTicks Optional. The current position, in ticks. 1 tick = 10000 ms. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param volumeLevel Scale of 0-100. (optional) + * @param playMethod The play method. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param repeatMode The repeat mode. (optional) + * @param isPaused Indicates if the player is paused. (optional, default to false) + * @param isMuted Indicates if the player is muted. (optional, default to false) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse onPlaybackProgressWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer volumeLevel, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode, + @org.eclipse.jdt.annotation.NonNull Boolean isPaused, @org.eclipse.jdt.annotation.NonNull Boolean isMuted) + throws ApiException { + return onPlaybackProgressWithHttpInfo(userId, itemId, mediaSourceId, positionTicks, audioStreamIndex, + subtitleStreamIndex, volumeLevel, playMethod, liveStreamId, playSessionId, repeatMode, isPaused, + isMuted, null); + } + + /** + * Reports a user's playback progress. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param positionTicks Optional. The current position, in ticks. 1 tick = 10000 ms. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param volumeLevel Scale of 0-100. (optional) + * @param playMethod The play method. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param repeatMode The repeat mode. (optional) + * @param isPaused Indicates if the player is paused. (optional, default to false) + * @param isMuted Indicates if the player is muted. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse onPlaybackProgressWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer volumeLevel, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode, + @org.eclipse.jdt.annotation.NonNull Boolean isPaused, @org.eclipse.jdt.annotation.NonNull Boolean isMuted, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = onPlaybackProgressRequestBuilder(userId, itemId, mediaSourceId, + positionTicks, audioStreamIndex, subtitleStreamIndex, volumeLevel, playMethod, liveStreamId, + playSessionId, repeatMode, isPaused, isMuted, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("onPlaybackProgress", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder onPlaybackProgressRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer volumeLevel, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode, + @org.eclipse.jdt.annotation.NonNull Boolean isPaused, @org.eclipse.jdt.annotation.NonNull Boolean isMuted, + Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling onPlaybackProgress"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling onPlaybackProgress"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/PlayingItems/{itemId}/Progress" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "positionTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("positionTicks", positionTicks)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "volumeLevel"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("volumeLevel", volumeLevel)); + localVarQueryParameterBaseName = "playMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playMethod", playMethod)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "repeatMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("repeatMode", repeatMode)); + localVarQueryParameterBaseName = "isPaused"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isPaused", isPaused)); + localVarQueryParameterBaseName = "isMuted"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMuted", isMuted)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that a user has begun playing an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param playMethod The play method. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param canSeek Indicates if the client can seek. (optional, default to false) + * @throws ApiException if fails to make API call + */ + public void onPlaybackStart(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Boolean canSeek) throws ApiException { + onPlaybackStart(userId, itemId, mediaSourceId, audioStreamIndex, subtitleStreamIndex, playMethod, liveStreamId, + playSessionId, canSeek, null); + } + + /** + * Reports that a user has begun playing an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param playMethod The play method. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param canSeek Indicates if the client can seek. (optional, default to false) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void onPlaybackStart(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Boolean canSeek, Map headers) throws ApiException { + onPlaybackStartWithHttpInfo(userId, itemId, mediaSourceId, audioStreamIndex, subtitleStreamIndex, playMethod, + liveStreamId, playSessionId, canSeek, headers); + } + + /** + * Reports that a user has begun playing an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param playMethod The play method. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param canSeek Indicates if the client can seek. (optional, default to false) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse onPlaybackStartWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Boolean canSeek) throws ApiException { + return onPlaybackStartWithHttpInfo(userId, itemId, mediaSourceId, audioStreamIndex, subtitleStreamIndex, + playMethod, liveStreamId, playSessionId, canSeek, null); + } + + /** + * Reports that a user has begun playing an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param audioStreamIndex The audio stream index. (optional) + * @param subtitleStreamIndex The subtitle stream index. (optional) + * @param playMethod The play method. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param canSeek Indicates if the client can seek. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse onPlaybackStartWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Boolean canSeek, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = onPlaybackStartRequestBuilder(userId, itemId, mediaSourceId, + audioStreamIndex, subtitleStreamIndex, playMethod, liveStreamId, playSessionId, canSeek, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("onPlaybackStart", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder onPlaybackStartRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull PlayMethod playMethod, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull Boolean canSeek, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling onPlaybackStart"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling onPlaybackStart"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/PlayingItems/{itemId}" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "playMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playMethod", playMethod)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "canSeek"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("canSeek", canSeek)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that a user has stopped playing an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param nextMediaType The next media type that will play. (optional) + * @param positionTicks Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @throws ApiException if fails to make API call + */ + public void onPlaybackStopped(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String nextMediaType, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId) throws ApiException { + onPlaybackStopped(userId, itemId, mediaSourceId, nextMediaType, positionTicks, liveStreamId, playSessionId, + null); + } + + /** + * Reports that a user has stopped playing an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param nextMediaType The next media type that will play. (optional) + * @param positionTicks Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void onPlaybackStopped(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String nextMediaType, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, Map headers) throws ApiException { + onPlaybackStoppedWithHttpInfo(userId, itemId, mediaSourceId, nextMediaType, positionTicks, liveStreamId, + playSessionId, headers); + } + + /** + * Reports that a user has stopped playing an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param nextMediaType The next media type that will play. (optional) + * @param positionTicks Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse onPlaybackStoppedWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String nextMediaType, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId) throws ApiException { + return onPlaybackStoppedWithHttpInfo(userId, itemId, mediaSourceId, nextMediaType, positionTicks, liveStreamId, + playSessionId, null); + } + + /** + * Reports that a user has stopped playing an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param mediaSourceId The id of the MediaSource. (optional) + * @param nextMediaType The next media type that will play. (optional) + * @param positionTicks Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms. (optional) + * @param liveStreamId The live stream id. (optional) + * @param playSessionId The play session id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse onPlaybackStoppedWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String nextMediaType, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = onPlaybackStoppedRequestBuilder(userId, itemId, mediaSourceId, + nextMediaType, positionTicks, liveStreamId, playSessionId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("onPlaybackStopped", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder onPlaybackStoppedRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String nextMediaType, + @org.eclipse.jdt.annotation.NonNull Long positionTicks, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling onPlaybackStopped"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling onPlaybackStopped"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/PlayingItems/{itemId}" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "nextMediaType"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nextMediaType", nextMediaType)); + localVarQueryParameterBaseName = "positionTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("positionTicks", positionTicks)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Pings a playback session. + * + * @param playSessionId Playback session id. (required) + * @throws ApiException if fails to make API call + */ + public void pingPlaybackSession(@org.eclipse.jdt.annotation.Nullable String playSessionId) throws ApiException { + pingPlaybackSession(playSessionId, null); + } + + /** + * Pings a playback session. + * + * @param playSessionId Playback session id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void pingPlaybackSession(@org.eclipse.jdt.annotation.Nullable String playSessionId, + Map headers) throws ApiException { + pingPlaybackSessionWithHttpInfo(playSessionId, headers); + } + + /** + * Pings a playback session. + * + * @param playSessionId Playback session id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse pingPlaybackSessionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String playSessionId) + throws ApiException { + return pingPlaybackSessionWithHttpInfo(playSessionId, null); + } + + /** + * Pings a playback session. + * + * @param playSessionId Playback session id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse pingPlaybackSessionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String playSessionId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = pingPlaybackSessionRequestBuilder(playSessionId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("pingPlaybackSession", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder pingPlaybackSessionRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String playSessionId, Map headers) + throws ApiException { + // verify the required parameter 'playSessionId' is set + if (playSessionId == null) { + throw new ApiException(400, + "Missing the required parameter 'playSessionId' when calling pingPlaybackSession"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/Playing/Ping"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports playback progress within a session. + * + * @param playbackProgressInfo The playback progress info. (optional) + * @throws ApiException if fails to make API call + */ + public void reportPlaybackProgress(@org.eclipse.jdt.annotation.NonNull PlaybackProgressInfo playbackProgressInfo) + throws ApiException { + reportPlaybackProgress(playbackProgressInfo, null); + } + + /** + * Reports playback progress within a session. + * + * @param playbackProgressInfo The playback progress info. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void reportPlaybackProgress(@org.eclipse.jdt.annotation.NonNull PlaybackProgressInfo playbackProgressInfo, + Map headers) throws ApiException { + reportPlaybackProgressWithHttpInfo(playbackProgressInfo, headers); + } + + /** + * Reports playback progress within a session. + * + * @param playbackProgressInfo The playback progress info. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportPlaybackProgressWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull PlaybackProgressInfo playbackProgressInfo) throws ApiException { + return reportPlaybackProgressWithHttpInfo(playbackProgressInfo, null); + } + + /** + * Reports playback progress within a session. + * + * @param playbackProgressInfo The playback progress info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportPlaybackProgressWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull PlaybackProgressInfo playbackProgressInfo, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = reportPlaybackProgressRequestBuilder(playbackProgressInfo, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("reportPlaybackProgress", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder reportPlaybackProgressRequestBuilder( + @org.eclipse.jdt.annotation.NonNull PlaybackProgressInfo playbackProgressInfo, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/Playing/Progress"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(playbackProgressInfo); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports playback has started within a session. + * + * @param playbackStartInfo The playback start info. (optional) + * @throws ApiException if fails to make API call + */ + public void reportPlaybackStart(@org.eclipse.jdt.annotation.NonNull PlaybackStartInfo playbackStartInfo) + throws ApiException { + reportPlaybackStart(playbackStartInfo, null); + } + + /** + * Reports playback has started within a session. + * + * @param playbackStartInfo The playback start info. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void reportPlaybackStart(@org.eclipse.jdt.annotation.NonNull PlaybackStartInfo playbackStartInfo, + Map headers) throws ApiException { + reportPlaybackStartWithHttpInfo(playbackStartInfo, headers); + } + + /** + * Reports playback has started within a session. + * + * @param playbackStartInfo The playback start info. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportPlaybackStartWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull PlaybackStartInfo playbackStartInfo) throws ApiException { + return reportPlaybackStartWithHttpInfo(playbackStartInfo, null); + } + + /** + * Reports playback has started within a session. + * + * @param playbackStartInfo The playback start info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportPlaybackStartWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull PlaybackStartInfo playbackStartInfo, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = reportPlaybackStartRequestBuilder(playbackStartInfo, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("reportPlaybackStart", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder reportPlaybackStartRequestBuilder( + @org.eclipse.jdt.annotation.NonNull PlaybackStartInfo playbackStartInfo, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/Playing"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(playbackStartInfo); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports playback has stopped within a session. + * + * @param playbackStopInfo The playback stop info. (optional) + * @throws ApiException if fails to make API call + */ + public void reportPlaybackStopped(@org.eclipse.jdt.annotation.NonNull PlaybackStopInfo playbackStopInfo) + throws ApiException { + reportPlaybackStopped(playbackStopInfo, null); + } + + /** + * Reports playback has stopped within a session. + * + * @param playbackStopInfo The playback stop info. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void reportPlaybackStopped(@org.eclipse.jdt.annotation.NonNull PlaybackStopInfo playbackStopInfo, + Map headers) throws ApiException { + reportPlaybackStoppedWithHttpInfo(playbackStopInfo, headers); + } + + /** + * Reports playback has stopped within a session. + * + * @param playbackStopInfo The playback stop info. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportPlaybackStoppedWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull PlaybackStopInfo playbackStopInfo) throws ApiException { + return reportPlaybackStoppedWithHttpInfo(playbackStopInfo, null); + } + + /** + * Reports playback has stopped within a session. + * + * @param playbackStopInfo The playback stop info. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportPlaybackStoppedWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull PlaybackStopInfo playbackStopInfo, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = reportPlaybackStoppedRequestBuilder(playbackStopInfo, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("reportPlaybackStopped", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder reportPlaybackStoppedRequestBuilder( + @org.eclipse.jdt.annotation.NonNull PlaybackStopInfo playbackStopInfo, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/Playing/Stopped"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(playbackStopInfo); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PluginsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PluginsApi.java new file mode 100644 index 0000000000000..12a551526f9e5 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/PluginsApi.java @@ -0,0 +1,1118 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PluginInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PluginsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public PluginsApi() { + this(Configuration.getDefaultApiClient()); + } + + public PluginsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Disable a plugin. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @throws ApiException if fails to make API call + */ + public void disablePlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + disablePlugin(pluginId, version, null); + } + + /** + * Disable a plugin. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void disablePlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + disablePluginWithHttpInfo(pluginId, version, headers); + } + + /** + * Disable a plugin. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse disablePluginWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + return disablePluginWithHttpInfo(pluginId, version, null); + } + + /** + * Disable a plugin. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse disablePluginWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = disablePluginRequestBuilder(pluginId, version, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("disablePlugin", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder disablePluginRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + // verify the required parameter 'pluginId' is set + if (pluginId == null) { + throw new ApiException(400, "Missing the required parameter 'pluginId' when calling disablePlugin"); + } + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException(400, "Missing the required parameter 'version' when calling disablePlugin"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins/{pluginId}/{version}/Disable" + .replace("{pluginId}", ApiClient.urlEncode(pluginId.toString())) + .replace("{version}", ApiClient.urlEncode(version.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Enables a disabled plugin. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @throws ApiException if fails to make API call + */ + public void enablePlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + enablePlugin(pluginId, version, null); + } + + /** + * Enables a disabled plugin. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void enablePlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + enablePluginWithHttpInfo(pluginId, version, headers); + } + + /** + * Enables a disabled plugin. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse enablePluginWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + return enablePluginWithHttpInfo(pluginId, version, null); + } + + /** + * Enables a disabled plugin. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse enablePluginWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = enablePluginRequestBuilder(pluginId, version, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("enablePlugin", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder enablePluginRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + // verify the required parameter 'pluginId' is set + if (pluginId == null) { + throw new ApiException(400, "Missing the required parameter 'pluginId' when calling enablePlugin"); + } + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException(400, "Missing the required parameter 'version' when calling enablePlugin"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins/{pluginId}/{version}/Enable" + .replace("{pluginId}", ApiClient.urlEncode(pluginId.toString())) + .replace("{version}", ApiClient.urlEncode(version.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets plugin configuration. + * + * @param pluginId Plugin id. (required) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object getPluginConfiguration(@org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { + return getPluginConfiguration(pluginId, null); + } + + /** + * Gets plugin configuration. + * + * @param pluginId Plugin id. (required) + * @param headers Optional headers to include in the request + * @return Object + * @throws ApiException if fails to make API call + */ + public Object getPluginConfiguration(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { + ApiResponse localVarResponse = getPluginConfigurationWithHttpInfo(pluginId, headers); + return localVarResponse.getData(); + } + + /** + * Gets plugin configuration. + * + * @param pluginId Plugin id. (required) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPluginConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId) + throws ApiException { + return getPluginConfigurationWithHttpInfo(pluginId, null); + } + + /** + * Gets plugin configuration. + * + * @param pluginId Plugin id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPluginConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPluginConfigurationRequestBuilder(pluginId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPluginConfiguration", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + Object responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPluginConfigurationRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { + // verify the required parameter 'pluginId' is set + if (pluginId == null) { + throw new ApiException(400, + "Missing the required parameter 'pluginId' when calling getPluginConfiguration"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins/{pluginId}/Configuration".replace("{pluginId}", + ApiClient.urlEncode(pluginId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a plugin's image. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getPluginImage(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + return getPluginImage(pluginId, version, null); + } + + /** + * Gets a plugin's image. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getPluginImage(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + ApiResponse localVarResponse = getPluginImageWithHttpInfo(pluginId, version, headers); + return localVarResponse.getData(); + } + + /** + * Gets a plugin's image. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPluginImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + return getPluginImageWithHttpInfo(pluginId, version, null); + } + + /** + * Gets a plugin's image. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPluginImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPluginImageRequestBuilder(pluginId, version, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPluginImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPluginImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + // verify the required parameter 'pluginId' is set + if (pluginId == null) { + throw new ApiException(400, "Missing the required parameter 'pluginId' when calling getPluginImage"); + } + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException(400, "Missing the required parameter 'version' when calling getPluginImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins/{pluginId}/{version}/Image" + .replace("{pluginId}", ApiClient.urlEncode(pluginId.toString())) + .replace("{version}", ApiClient.urlEncode(version.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "image/*, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a plugin's manifest. + * + * @param pluginId Plugin id. (required) + * @throws ApiException if fails to make API call + */ + public void getPluginManifest(@org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { + getPluginManifest(pluginId, null); + } + + /** + * Gets a plugin's manifest. + * + * @param pluginId Plugin id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void getPluginManifest(@org.eclipse.jdt.annotation.Nullable UUID pluginId, Map headers) + throws ApiException { + getPluginManifestWithHttpInfo(pluginId, headers); + } + + /** + * Gets a plugin's manifest. + * + * @param pluginId Plugin id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPluginManifestWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId) + throws ApiException { + return getPluginManifestWithHttpInfo(pluginId, null); + } + + /** + * Gets a plugin's manifest. + * + * @param pluginId Plugin id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPluginManifestWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPluginManifestRequestBuilder(pluginId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPluginManifest", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPluginManifestRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { + // verify the required parameter 'pluginId' is set + if (pluginId == null) { + throw new ApiException(400, "Missing the required parameter 'pluginId' when calling getPluginManifest"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins/{pluginId}/Manifest".replace("{pluginId}", + ApiClient.urlEncode(pluginId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of currently installed plugins. + * + * @return List<PluginInfo> + * @throws ApiException if fails to make API call + */ + public List getPlugins() throws ApiException { + return getPlugins(null); + } + + /** + * Gets a list of currently installed plugins. + * + * @param headers Optional headers to include in the request + * @return List<PluginInfo> + * @throws ApiException if fails to make API call + */ + public List getPlugins(Map headers) throws ApiException { + ApiResponse> localVarResponse = getPluginsWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets a list of currently installed plugins. + * + * @return ApiResponse<List<PluginInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPluginsWithHttpInfo() throws ApiException { + return getPluginsWithHttpInfo(null); + } + + /** + * Gets a list of currently installed plugins. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<PluginInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPluginsWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPluginsRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPlugins", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPluginsRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Uninstalls a plugin. + * + * @param pluginId Plugin id. (required) + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public void uninstallPlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { + uninstallPlugin(pluginId, null); + } + + /** + * Uninstalls a plugin. + * + * @param pluginId Plugin id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public void uninstallPlugin(@org.eclipse.jdt.annotation.Nullable UUID pluginId, Map headers) + throws ApiException { + uninstallPluginWithHttpInfo(pluginId, headers); + } + + /** + * Uninstalls a plugin. + * + * @param pluginId Plugin id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse uninstallPluginWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId) + throws ApiException { + return uninstallPluginWithHttpInfo(pluginId, null); + } + + /** + * Uninstalls a plugin. + * + * @param pluginId Plugin id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse uninstallPluginWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uninstallPluginRequestBuilder(pluginId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("uninstallPlugin", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uninstallPluginRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { + // verify the required parameter 'pluginId' is set + if (pluginId == null) { + throw new ApiException(400, "Missing the required parameter 'pluginId' when calling uninstallPlugin"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins/{pluginId}".replace("{pluginId}", ApiClient.urlEncode(pluginId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Uninstalls a plugin by version. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @throws ApiException if fails to make API call + */ + public void uninstallPluginByVersion(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + uninstallPluginByVersion(pluginId, version, null); + } + + /** + * Uninstalls a plugin by version. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void uninstallPluginByVersion(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + uninstallPluginByVersionWithHttpInfo(pluginId, version, headers); + } + + /** + * Uninstalls a plugin by version. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse uninstallPluginByVersionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version) throws ApiException { + return uninstallPluginByVersionWithHttpInfo(pluginId, version, null); + } + + /** + * Uninstalls a plugin by version. + * + * @param pluginId Plugin id. (required) + * @param version Plugin version. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse uninstallPluginByVersionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + @org.eclipse.jdt.annotation.Nullable String version, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uninstallPluginByVersionRequestBuilder(pluginId, version, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("uninstallPluginByVersion", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uninstallPluginByVersionRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID pluginId, @org.eclipse.jdt.annotation.Nullable String version, + Map headers) throws ApiException { + // verify the required parameter 'pluginId' is set + if (pluginId == null) { + throw new ApiException(400, + "Missing the required parameter 'pluginId' when calling uninstallPluginByVersion"); + } + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException(400, + "Missing the required parameter 'version' when calling uninstallPluginByVersion"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins/{pluginId}/{version}" + .replace("{pluginId}", ApiClient.urlEncode(pluginId.toString())) + .replace("{version}", ApiClient.urlEncode(version.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates plugin configuration. + * Accepts plugin configuration as JSON body. + * + * @param pluginId Plugin id. (required) + * @throws ApiException if fails to make API call + */ + public void updatePluginConfiguration(@org.eclipse.jdt.annotation.Nullable UUID pluginId) throws ApiException { + updatePluginConfiguration(pluginId, null); + } + + /** + * Updates plugin configuration. + * Accepts plugin configuration as JSON body. + * + * @param pluginId Plugin id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updatePluginConfiguration(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { + updatePluginConfigurationWithHttpInfo(pluginId, headers); + } + + /** + * Updates plugin configuration. + * Accepts plugin configuration as JSON body. + * + * @param pluginId Plugin id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updatePluginConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId) + throws ApiException { + return updatePluginConfigurationWithHttpInfo(pluginId, null); + } + + /** + * Updates plugin configuration. + * Accepts plugin configuration as JSON body. + * + * @param pluginId Plugin id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updatePluginConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID pluginId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updatePluginConfigurationRequestBuilder(pluginId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updatePluginConfiguration", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updatePluginConfigurationRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID pluginId, Map headers) throws ApiException { + // verify the required parameter 'pluginId' is set + if (pluginId == null) { + throw new ApiException(400, + "Missing the required parameter 'pluginId' when calling updatePluginConfiguration"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Plugins/{pluginId}/Configuration".replace("{pluginId}", + ApiClient.urlEncode(pluginId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/QuickConnectApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/QuickConnectApi.java new file mode 100644 index 0000000000000..e13045edb8d8b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/QuickConnectApi.java @@ -0,0 +1,593 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.QuickConnectResult; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class QuickConnectApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public QuickConnectApi() { + this(Configuration.getDefaultApiClient()); + } + + public QuickConnectApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Authorizes a pending quick connect request. + * + * @param code Quick connect code to authorize. (required) + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean authorize(@org.eclipse.jdt.annotation.Nullable String code) throws ApiException { + return authorize(code, null); + } + + /** + * Authorizes a pending quick connect request. + * + * @param code Quick connect code to authorize. (required) + * @param headers Optional headers to include in the request + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean authorize(@org.eclipse.jdt.annotation.Nullable String code, Map headers) + throws ApiException { + ApiResponse localVarResponse = authorizeWithHttpInfo(code, headers); + return localVarResponse.getData(); + } + + /** + * Authorizes a pending quick connect request. + * + * @param code Quick connect code to authorize. (required) + * @return ApiResponse<Boolean> + * @throws ApiException if fails to make API call + */ + public ApiResponse authorizeWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String code) + throws ApiException { + return authorizeWithHttpInfo(code, null); + } + + /** + * Authorizes a pending quick connect request. + * + * @param code Quick connect code to authorize. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Boolean> + * @throws ApiException if fails to make API call + */ + public ApiResponse authorizeWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String code, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = authorizeRequestBuilder(code, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("authorize", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + Boolean responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder authorizeRequestBuilder(@org.eclipse.jdt.annotation.Nullable String code, + Map headers) throws ApiException { + // verify the required parameter 'code' is set + if (code == null) { + throw new ApiException(400, "Missing the required parameter 'code' when calling authorize"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/QuickConnect/Authorize"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "code"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("code", code)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Attempts to retrieve authentication information. + * + * @param secret Secret previously returned from the Initiate endpoint. (required) + * @return QuickConnectResult + * @throws ApiException if fails to make API call + */ + public QuickConnectResult connect(@org.eclipse.jdt.annotation.Nullable String secret) throws ApiException { + return connect(secret, null); + } + + /** + * Attempts to retrieve authentication information. + * + * @param secret Secret previously returned from the Initiate endpoint. (required) + * @param headers Optional headers to include in the request + * @return QuickConnectResult + * @throws ApiException if fails to make API call + */ + public QuickConnectResult connect(@org.eclipse.jdt.annotation.Nullable String secret, Map headers) + throws ApiException { + ApiResponse localVarResponse = connectWithHttpInfo(secret, headers); + return localVarResponse.getData(); + } + + /** + * Attempts to retrieve authentication information. + * + * @param secret Secret previously returned from the Initiate endpoint. (required) + * @return ApiResponse<QuickConnectResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse connectWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String secret) + throws ApiException { + return connectWithHttpInfo(secret, null); + } + + /** + * Attempts to retrieve authentication information. + * + * @param secret Secret previously returned from the Initiate endpoint. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<QuickConnectResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse connectWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String secret, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = connectRequestBuilder(secret, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("connect", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + QuickConnectResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder connectRequestBuilder(@org.eclipse.jdt.annotation.Nullable String secret, + Map headers) throws ApiException { + // verify the required parameter 'secret' is set + if (secret == null) { + throw new ApiException(400, "Missing the required parameter 'secret' when calling connect"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/QuickConnect/Connect"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "secret"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("secret", secret)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the current quick connect state. + * + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean getEnabled() throws ApiException { + return getEnabled(null); + } + + /** + * Gets the current quick connect state. + * + * @param headers Optional headers to include in the request + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean getEnabled(Map headers) throws ApiException { + ApiResponse localVarResponse = getEnabledWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets the current quick connect state. + * + * @return ApiResponse<Boolean> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEnabledWithHttpInfo() throws ApiException { + return getEnabledWithHttpInfo(null); + } + + /** + * Gets the current quick connect state. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Boolean> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEnabledWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getEnabledRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getEnabled", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + Boolean responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getEnabledRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/QuickConnect/Enabled"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Initiate a new quick connect request. + * + * @return QuickConnectResult + * @throws ApiException if fails to make API call + */ + public QuickConnectResult initiate() throws ApiException { + return initiate(null); + } + + /** + * Initiate a new quick connect request. + * + * @param headers Optional headers to include in the request + * @return QuickConnectResult + * @throws ApiException if fails to make API call + */ + public QuickConnectResult initiate(Map headers) throws ApiException { + ApiResponse localVarResponse = initiateWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Initiate a new quick connect request. + * + * @return ApiResponse<QuickConnectResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse initiateWithHttpInfo() throws ApiException { + return initiateWithHttpInfo(null); + } + + /** + * Initiate a new quick connect request. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<QuickConnectResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse initiateWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = initiateRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("initiate", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + QuickConnectResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder initiateRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/QuickConnect/Initiate"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/RemoteImageApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/RemoteImageApi.java new file mode 100644 index 0000000000000..5b5b5afeeb483 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/RemoteImageApi.java @@ -0,0 +1,571 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageProviderInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.RemoteImageResult; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RemoteImageApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public RemoteImageApi() { + this(Configuration.getDefaultApiClient()); + } + + public RemoteImageApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Downloads a remote image for an item. + * + * @param itemId Item Id. (required) + * @param type The image type. (required) + * @param imageUrl The image url. (optional) + * @throws ApiException if fails to make API call + */ + public void downloadRemoteImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType type, @org.eclipse.jdt.annotation.NonNull String imageUrl) + throws ApiException { + downloadRemoteImage(itemId, type, imageUrl, null); + } + + /** + * Downloads a remote image for an item. + * + * @param itemId Item Id. (required) + * @param type The image type. (required) + * @param imageUrl The image url. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void downloadRemoteImage(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType type, @org.eclipse.jdt.annotation.NonNull String imageUrl, + Map headers) throws ApiException { + downloadRemoteImageWithHttpInfo(itemId, type, imageUrl, headers); + } + + /** + * Downloads a remote image for an item. + * + * @param itemId Item Id. (required) + * @param type The image type. (required) + * @param imageUrl The image url. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse downloadRemoteImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType type, @org.eclipse.jdt.annotation.NonNull String imageUrl) + throws ApiException { + return downloadRemoteImageWithHttpInfo(itemId, type, imageUrl, null); + } + + /** + * Downloads a remote image for an item. + * + * @param itemId Item Id. (required) + * @param type The image type. (required) + * @param imageUrl The image url. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse downloadRemoteImageWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType type, @org.eclipse.jdt.annotation.NonNull String imageUrl, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = downloadRemoteImageRequestBuilder(itemId, type, imageUrl, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("downloadRemoteImage", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder downloadRemoteImageRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable ImageType type, @org.eclipse.jdt.annotation.NonNull String imageUrl, + Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling downloadRemoteImage"); + } + // verify the required parameter 'type' is set + if (type == null) { + throw new ApiException(400, "Missing the required parameter 'type' when calling downloadRemoteImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/RemoteImages/Download".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "type"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("type", type)); + localVarQueryParameterBaseName = "imageUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageUrl", imageUrl)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available remote image providers for an item. + * + * @param itemId Item Id. (required) + * @return List<ImageProviderInfo> + * @throws ApiException if fails to make API call + */ + public List getRemoteImageProviders(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + return getRemoteImageProviders(itemId, null); + } + + /** + * Gets available remote image providers for an item. + * + * @param itemId Item Id. (required) + * @param headers Optional headers to include in the request + * @return List<ImageProviderInfo> + * @throws ApiException if fails to make API call + */ + public List getRemoteImageProviders(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getRemoteImageProvidersWithHttpInfo(itemId, headers); + return localVarResponse.getData(); + } + + /** + * Gets available remote image providers for an item. + * + * @param itemId Item Id. (required) + * @return ApiResponse<List<ImageProviderInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getRemoteImageProvidersWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return getRemoteImageProvidersWithHttpInfo(itemId, null); + } + + /** + * Gets available remote image providers for an item. + * + * @param itemId Item Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<ImageProviderInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getRemoteImageProvidersWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRemoteImageProvidersRequestBuilder(itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRemoteImageProviders", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRemoteImageProvidersRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getRemoteImageProviders"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/RemoteImages/Providers".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets available remote images for an item. + * + * @param itemId Item Id. (required) + * @param type The image type. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param providerName Optional. The image provider to use. (optional) + * @param includeAllLanguages Optional. Include all languages. (optional, default to false) + * @return RemoteImageResult + * @throws ApiException if fails to make API call + */ + public RemoteImageResult getRemoteImages(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull ImageType type, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String providerName, + @org.eclipse.jdt.annotation.NonNull Boolean includeAllLanguages) throws ApiException { + return getRemoteImages(itemId, type, startIndex, limit, providerName, includeAllLanguages, null); + } + + /** + * Gets available remote images for an item. + * + * @param itemId Item Id. (required) + * @param type The image type. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param providerName Optional. The image provider to use. (optional) + * @param includeAllLanguages Optional. Include all languages. (optional, default to false) + * @param headers Optional headers to include in the request + * @return RemoteImageResult + * @throws ApiException if fails to make API call + */ + public RemoteImageResult getRemoteImages(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull ImageType type, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String providerName, + @org.eclipse.jdt.annotation.NonNull Boolean includeAllLanguages, Map headers) + throws ApiException { + ApiResponse localVarResponse = getRemoteImagesWithHttpInfo(itemId, type, startIndex, limit, + providerName, includeAllLanguages, headers); + return localVarResponse.getData(); + } + + /** + * Gets available remote images for an item. + * + * @param itemId Item Id. (required) + * @param type The image type. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param providerName Optional. The image provider to use. (optional) + * @param includeAllLanguages Optional. Include all languages. (optional, default to false) + * @return ApiResponse<RemoteImageResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRemoteImagesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull ImageType type, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String providerName, + @org.eclipse.jdt.annotation.NonNull Boolean includeAllLanguages) throws ApiException { + return getRemoteImagesWithHttpInfo(itemId, type, startIndex, limit, providerName, includeAllLanguages, null); + } + + /** + * Gets available remote images for an item. + * + * @param itemId Item Id. (required) + * @param type The image type. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param providerName Optional. The image provider to use. (optional) + * @param includeAllLanguages Optional. Include all languages. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<RemoteImageResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRemoteImagesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull ImageType type, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String providerName, + @org.eclipse.jdt.annotation.NonNull Boolean includeAllLanguages, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRemoteImagesRequestBuilder(itemId, type, startIndex, limit, + providerName, includeAllLanguages, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRemoteImages", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + RemoteImageResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRemoteImagesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull ImageType type, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String providerName, + @org.eclipse.jdt.annotation.NonNull Boolean includeAllLanguages, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getRemoteImages"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/RemoteImages".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "type"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("type", type)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "providerName"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("providerName", providerName)); + localVarQueryParameterBaseName = "includeAllLanguages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeAllLanguages", includeAllLanguages)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ScheduledTasksApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ScheduledTasksApi.java new file mode 100644 index 0000000000000..c9d8d2be7a70b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/ScheduledTasksApi.java @@ -0,0 +1,704 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.TaskInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.TaskTriggerInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ScheduledTasksApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ScheduledTasksApi() { + this(Configuration.getDefaultApiClient()); + } + + public ScheduledTasksApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Get task by id. + * + * @param taskId Task Id. (required) + * @return TaskInfo + * @throws ApiException if fails to make API call + */ + public TaskInfo getTask(@org.eclipse.jdt.annotation.Nullable String taskId) throws ApiException { + return getTask(taskId, null); + } + + /** + * Get task by id. + * + * @param taskId Task Id. (required) + * @param headers Optional headers to include in the request + * @return TaskInfo + * @throws ApiException if fails to make API call + */ + public TaskInfo getTask(@org.eclipse.jdt.annotation.Nullable String taskId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getTaskWithHttpInfo(taskId, headers); + return localVarResponse.getData(); + } + + /** + * Get task by id. + * + * @param taskId Task Id. (required) + * @return ApiResponse<TaskInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId) + throws ApiException { + return getTaskWithHttpInfo(taskId, null); + } + + /** + * Get task by id. + * + * @param taskId Task Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<TaskInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTaskRequestBuilder(taskId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getTask", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + TaskInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getTaskRequestBuilder(@org.eclipse.jdt.annotation.Nullable String taskId, + Map headers) throws ApiException { + // verify the required parameter 'taskId' is set + if (taskId == null) { + throw new ApiException(400, "Missing the required parameter 'taskId' when calling getTask"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/ScheduledTasks/{taskId}".replace("{taskId}", ApiClient.urlEncode(taskId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get tasks. + * + * @param isHidden Optional filter tasks that are hidden, or not. (optional) + * @param isEnabled Optional filter tasks that are enabled, or not. (optional) + * @return List<TaskInfo> + * @throws ApiException if fails to make API call + */ + public List getTasks(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isEnabled) throws ApiException { + return getTasks(isHidden, isEnabled, null); + } + + /** + * Get tasks. + * + * @param isHidden Optional filter tasks that are hidden, or not. (optional) + * @param isEnabled Optional filter tasks that are enabled, or not. (optional) + * @param headers Optional headers to include in the request + * @return List<TaskInfo> + * @throws ApiException if fails to make API call + */ + public List getTasks(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isEnabled, Map headers) throws ApiException { + ApiResponse> localVarResponse = getTasksWithHttpInfo(isHidden, isEnabled, headers); + return localVarResponse.getData(); + } + + /** + * Get tasks. + * + * @param isHidden Optional filter tasks that are hidden, or not. (optional) + * @param isEnabled Optional filter tasks that are enabled, or not. (optional) + * @return ApiResponse<List<TaskInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getTasksWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isEnabled) throws ApiException { + return getTasksWithHttpInfo(isHidden, isEnabled, null); + } + + /** + * Get tasks. + * + * @param isHidden Optional filter tasks that are hidden, or not. (optional) + * @param isEnabled Optional filter tasks that are enabled, or not. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<TaskInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getTasksWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isEnabled, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTasksRequestBuilder(isHidden, isEnabled, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getTasks", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getTasksRequestBuilder(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isEnabled, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/ScheduledTasks"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "isHidden"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isHidden", isHidden)); + localVarQueryParameterBaseName = "isEnabled"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isEnabled", isEnabled)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Start specified task. + * + * @param taskId Task Id. (required) + * @throws ApiException if fails to make API call + */ + public void startTask(@org.eclipse.jdt.annotation.Nullable String taskId) throws ApiException { + startTask(taskId, null); + } + + /** + * Start specified task. + * + * @param taskId Task Id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void startTask(@org.eclipse.jdt.annotation.Nullable String taskId, Map headers) + throws ApiException { + startTaskWithHttpInfo(taskId, headers); + } + + /** + * Start specified task. + * + * @param taskId Task Id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse startTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId) + throws ApiException { + return startTaskWithHttpInfo(taskId, null); + } + + /** + * Start specified task. + * + * @param taskId Task Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse startTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = startTaskRequestBuilder(taskId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("startTask", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder startTaskRequestBuilder(@org.eclipse.jdt.annotation.Nullable String taskId, + Map headers) throws ApiException { + // verify the required parameter 'taskId' is set + if (taskId == null) { + throw new ApiException(400, "Missing the required parameter 'taskId' when calling startTask"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/ScheduledTasks/Running/{taskId}".replace("{taskId}", + ApiClient.urlEncode(taskId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Stop specified task. + * + * @param taskId Task Id. (required) + * @throws ApiException if fails to make API call + */ + public void stopTask(@org.eclipse.jdt.annotation.Nullable String taskId) throws ApiException { + stopTask(taskId, null); + } + + /** + * Stop specified task. + * + * @param taskId Task Id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void stopTask(@org.eclipse.jdt.annotation.Nullable String taskId, Map headers) + throws ApiException { + stopTaskWithHttpInfo(taskId, headers); + } + + /** + * Stop specified task. + * + * @param taskId Task Id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse stopTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId) + throws ApiException { + return stopTaskWithHttpInfo(taskId, null); + } + + /** + * Stop specified task. + * + * @param taskId Task Id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse stopTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = stopTaskRequestBuilder(taskId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("stopTask", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder stopTaskRequestBuilder(@org.eclipse.jdt.annotation.Nullable String taskId, + Map headers) throws ApiException { + // verify the required parameter 'taskId' is set + if (taskId == null) { + throw new ApiException(400, "Missing the required parameter 'taskId' when calling stopTask"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/ScheduledTasks/Running/{taskId}".replace("{taskId}", + ApiClient.urlEncode(taskId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update specified task triggers. + * + * @param taskId Task Id. (required) + * @param taskTriggerInfo Triggers. (required) + * @throws ApiException if fails to make API call + */ + public void updateTask(@org.eclipse.jdt.annotation.Nullable String taskId, + @org.eclipse.jdt.annotation.Nullable List taskTriggerInfo) throws ApiException { + updateTask(taskId, taskTriggerInfo, null); + } + + /** + * Update specified task triggers. + * + * @param taskId Task Id. (required) + * @param taskTriggerInfo Triggers. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateTask(@org.eclipse.jdt.annotation.Nullable String taskId, + @org.eclipse.jdt.annotation.Nullable List taskTriggerInfo, Map headers) + throws ApiException { + updateTaskWithHttpInfo(taskId, taskTriggerInfo, headers); + } + + /** + * Update specified task triggers. + * + * @param taskId Task Id. (required) + * @param taskTriggerInfo Triggers. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId, + @org.eclipse.jdt.annotation.Nullable List taskTriggerInfo) throws ApiException { + return updateTaskWithHttpInfo(taskId, taskTriggerInfo, null); + } + + /** + * Update specified task triggers. + * + * @param taskId Task Id. (required) + * @param taskTriggerInfo Triggers. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateTaskWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String taskId, + @org.eclipse.jdt.annotation.Nullable List taskTriggerInfo, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateTaskRequestBuilder(taskId, taskTriggerInfo, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateTask", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateTaskRequestBuilder(@org.eclipse.jdt.annotation.Nullable String taskId, + @org.eclipse.jdt.annotation.Nullable List taskTriggerInfo, Map headers) + throws ApiException { + // verify the required parameter 'taskId' is set + if (taskId == null) { + throw new ApiException(400, "Missing the required parameter 'taskId' when calling updateTask"); + } + // verify the required parameter 'taskTriggerInfo' is set + if (taskTriggerInfo == null) { + throw new ApiException(400, "Missing the required parameter 'taskTriggerInfo' when calling updateTask"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/ScheduledTasks/{taskId}/Triggers".replace("{taskId}", + ApiClient.urlEncode(taskId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(taskTriggerInfo); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SearchApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SearchApi.java new file mode 100644 index 0000000000000..2305e12959789 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SearchApi.java @@ -0,0 +1,464 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SearchHintResult; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SearchApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public SearchApi() { + this(Configuration.getDefaultApiClient()); + } + + public SearchApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets the search hint result. + * + * @param searchTerm The search term to filter on. (required) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param userId Optional. Supply a user id to search within a user's library or omit to search all. (optional) + * @param includeItemTypes If specified, only results with the specified item types are returned. This allows + * multiple, comma delimeted. (optional) + * @param excludeItemTypes If specified, results with these item types are filtered out. This allows multiple, comma + * delimeted. (optional) + * @param mediaTypes If specified, only results with the specified media types are returned. This allows multiple, + * comma delimeted. (optional) + * @param parentId If specified, only children of the parent are returned. (optional) + * @param isMovie Optional filter for movies. (optional) + * @param isSeries Optional filter for series. (optional) + * @param isNews Optional filter for news. (optional) + * @param isKids Optional filter for kids. (optional) + * @param isSports Optional filter for sports. (optional) + * @param includePeople Optional filter whether to include people. (optional, default to true) + * @param includeMedia Optional filter whether to include media. (optional, default to true) + * @param includeGenres Optional filter whether to include genres. (optional, default to true) + * @param includeStudios Optional filter whether to include studios. (optional, default to true) + * @param includeArtists Optional filter whether to include artists. (optional, default to true) + * @return SearchHintResult + * @throws ApiException if fails to make API call + */ + public SearchHintResult get(@org.eclipse.jdt.annotation.Nullable String searchTerm, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean includePeople, + @org.eclipse.jdt.annotation.NonNull Boolean includeMedia, + @org.eclipse.jdt.annotation.NonNull Boolean includeGenres, + @org.eclipse.jdt.annotation.NonNull Boolean includeStudios, + @org.eclipse.jdt.annotation.NonNull Boolean includeArtists) throws ApiException { + return get(searchTerm, startIndex, limit, userId, includeItemTypes, excludeItemTypes, mediaTypes, parentId, + isMovie, isSeries, isNews, isKids, isSports, includePeople, includeMedia, includeGenres, includeStudios, + includeArtists, null); + } + + /** + * Gets the search hint result. + * + * @param searchTerm The search term to filter on. (required) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param userId Optional. Supply a user id to search within a user's library or omit to search all. (optional) + * @param includeItemTypes If specified, only results with the specified item types are returned. This allows + * multiple, comma delimeted. (optional) + * @param excludeItemTypes If specified, results with these item types are filtered out. This allows multiple, comma + * delimeted. (optional) + * @param mediaTypes If specified, only results with the specified media types are returned. This allows multiple, + * comma delimeted. (optional) + * @param parentId If specified, only children of the parent are returned. (optional) + * @param isMovie Optional filter for movies. (optional) + * @param isSeries Optional filter for series. (optional) + * @param isNews Optional filter for news. (optional) + * @param isKids Optional filter for kids. (optional) + * @param isSports Optional filter for sports. (optional) + * @param includePeople Optional filter whether to include people. (optional, default to true) + * @param includeMedia Optional filter whether to include media. (optional, default to true) + * @param includeGenres Optional filter whether to include genres. (optional, default to true) + * @param includeStudios Optional filter whether to include studios. (optional, default to true) + * @param includeArtists Optional filter whether to include artists. (optional, default to true) + * @param headers Optional headers to include in the request + * @return SearchHintResult + * @throws ApiException if fails to make API call + */ + public SearchHintResult get(@org.eclipse.jdt.annotation.Nullable String searchTerm, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean includePeople, + @org.eclipse.jdt.annotation.NonNull Boolean includeMedia, + @org.eclipse.jdt.annotation.NonNull Boolean includeGenres, + @org.eclipse.jdt.annotation.NonNull Boolean includeStudios, + @org.eclipse.jdt.annotation.NonNull Boolean includeArtists, Map headers) + throws ApiException { + ApiResponse localVarResponse = getWithHttpInfo(searchTerm, startIndex, limit, userId, + includeItemTypes, excludeItemTypes, mediaTypes, parentId, isMovie, isSeries, isNews, isKids, isSports, + includePeople, includeMedia, includeGenres, includeStudios, includeArtists, headers); + return localVarResponse.getData(); + } + + /** + * Gets the search hint result. + * + * @param searchTerm The search term to filter on. (required) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param userId Optional. Supply a user id to search within a user's library or omit to search all. (optional) + * @param includeItemTypes If specified, only results with the specified item types are returned. This allows + * multiple, comma delimeted. (optional) + * @param excludeItemTypes If specified, results with these item types are filtered out. This allows multiple, comma + * delimeted. (optional) + * @param mediaTypes If specified, only results with the specified media types are returned. This allows multiple, + * comma delimeted. (optional) + * @param parentId If specified, only children of the parent are returned. (optional) + * @param isMovie Optional filter for movies. (optional) + * @param isSeries Optional filter for series. (optional) + * @param isNews Optional filter for news. (optional) + * @param isKids Optional filter for kids. (optional) + * @param isSports Optional filter for sports. (optional) + * @param includePeople Optional filter whether to include people. (optional, default to true) + * @param includeMedia Optional filter whether to include media. (optional, default to true) + * @param includeGenres Optional filter whether to include genres. (optional, default to true) + * @param includeStudios Optional filter whether to include studios. (optional, default to true) + * @param includeArtists Optional filter whether to include artists. (optional, default to true) + * @return ApiResponse<SearchHintResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String searchTerm, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean includePeople, + @org.eclipse.jdt.annotation.NonNull Boolean includeMedia, + @org.eclipse.jdt.annotation.NonNull Boolean includeGenres, + @org.eclipse.jdt.annotation.NonNull Boolean includeStudios, + @org.eclipse.jdt.annotation.NonNull Boolean includeArtists) throws ApiException { + return getWithHttpInfo(searchTerm, startIndex, limit, userId, includeItemTypes, excludeItemTypes, mediaTypes, + parentId, isMovie, isSeries, isNews, isKids, isSports, includePeople, includeMedia, includeGenres, + includeStudios, includeArtists, null); + } + + /** + * Gets the search hint result. + * + * @param searchTerm The search term to filter on. (required) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param userId Optional. Supply a user id to search within a user's library or omit to search all. (optional) + * @param includeItemTypes If specified, only results with the specified item types are returned. This allows + * multiple, comma delimeted. (optional) + * @param excludeItemTypes If specified, results with these item types are filtered out. This allows multiple, comma + * delimeted. (optional) + * @param mediaTypes If specified, only results with the specified media types are returned. This allows multiple, + * comma delimeted. (optional) + * @param parentId If specified, only children of the parent are returned. (optional) + * @param isMovie Optional filter for movies. (optional) + * @param isSeries Optional filter for series. (optional) + * @param isNews Optional filter for news. (optional) + * @param isKids Optional filter for kids. (optional) + * @param isSports Optional filter for sports. (optional) + * @param includePeople Optional filter whether to include people. (optional, default to true) + * @param includeMedia Optional filter whether to include media. (optional, default to true) + * @param includeGenres Optional filter whether to include genres. (optional, default to true) + * @param includeStudios Optional filter whether to include studios. (optional, default to true) + * @param includeArtists Optional filter whether to include artists. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<SearchHintResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String searchTerm, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean includePeople, + @org.eclipse.jdt.annotation.NonNull Boolean includeMedia, + @org.eclipse.jdt.annotation.NonNull Boolean includeGenres, + @org.eclipse.jdt.annotation.NonNull Boolean includeStudios, + @org.eclipse.jdt.annotation.NonNull Boolean includeArtists, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRequestBuilder(searchTerm, startIndex, limit, userId, + includeItemTypes, excludeItemTypes, mediaTypes, parentId, isMovie, isSeries, isNews, isKids, isSports, + includePeople, includeMedia, includeGenres, includeStudios, includeArtists, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("get", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + SearchHintResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRequestBuilder(@org.eclipse.jdt.annotation.Nullable String searchTerm, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull Boolean includePeople, + @org.eclipse.jdt.annotation.NonNull Boolean includeMedia, + @org.eclipse.jdt.annotation.NonNull Boolean includeGenres, + @org.eclipse.jdt.annotation.NonNull Boolean includeStudios, + @org.eclipse.jdt.annotation.NonNull Boolean includeArtists, Map headers) + throws ApiException { + // verify the required parameter 'searchTerm' is set + if (searchTerm == null) { + throw new ApiException(400, "Missing the required parameter 'searchTerm' when calling get"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Search/Hints"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "includePeople"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includePeople", includePeople)); + localVarQueryParameterBaseName = "includeMedia"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeMedia", includeMedia)); + localVarQueryParameterBaseName = "includeGenres"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeGenres", includeGenres)); + localVarQueryParameterBaseName = "includeStudios"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeStudios", includeStudios)); + localVarQueryParameterBaseName = "includeArtists"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeArtists", includeArtists)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SessionApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SessionApi.java new file mode 100644 index 0000000000000..59620bb7339bf --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SessionApi.java @@ -0,0 +1,2199 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ClientCapabilitiesDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.GeneralCommand; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.GeneralCommandType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.MessageCommand; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.NameIdPair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PlayCommand; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PlaystateCommand; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SessionInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SessionApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public SessionApi() { + this(Configuration.getDefaultApiClient()); + } + + public SessionApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Adds an additional user to a session. + * + * @param sessionId The session id. (required) + * @param userId The user id. (required) + * @throws ApiException if fails to make API call + */ + public void addUserToSession(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + addUserToSession(sessionId, userId, null); + } + + /** + * Adds an additional user to a session. + * + * @param sessionId The session id. (required) + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void addUserToSession(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { + addUserToSessionWithHttpInfo(sessionId, userId, headers); + } + + /** + * Adds an additional user to a session. + * + * @param sessionId The session id. (required) + * @param userId The user id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addUserToSessionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + return addUserToSessionWithHttpInfo(sessionId, userId, null); + } + + /** + * Adds an additional user to a session. + * + * @param sessionId The session id. (required) + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addUserToSessionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addUserToSessionRequestBuilder(sessionId, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("addUserToSession", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder addUserToSessionRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, "Missing the required parameter 'sessionId' when calling addUserToSession"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling addUserToSession"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/User/{userId}" + .replace("{sessionId}", ApiClient.urlEncode(sessionId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Instructs a session to browse to an item or view. + * + * @param sessionId The session Id. (required) + * @param itemType The type of item to browse to. (required) + * @param itemId The Id of the item. (required) + * @param itemName The name of the item. (required) + * @throws ApiException if fails to make API call + */ + public void displayContent(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable BaseItemKind itemType, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String itemName) + throws ApiException { + displayContent(sessionId, itemType, itemId, itemName, null); + } + + /** + * Instructs a session to browse to an item or view. + * + * @param sessionId The session Id. (required) + * @param itemType The type of item to browse to. (required) + * @param itemId The Id of the item. (required) + * @param itemName The name of the item. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void displayContent(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable BaseItemKind itemType, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String itemName, + Map headers) throws ApiException { + displayContentWithHttpInfo(sessionId, itemType, itemId, itemName, headers); + } + + /** + * Instructs a session to browse to an item or view. + * + * @param sessionId The session Id. (required) + * @param itemType The type of item to browse to. (required) + * @param itemId The Id of the item. (required) + * @param itemName The name of the item. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse displayContentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable BaseItemKind itemType, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String itemName) + throws ApiException { + return displayContentWithHttpInfo(sessionId, itemType, itemId, itemName, null); + } + + /** + * Instructs a session to browse to an item or view. + * + * @param sessionId The session Id. (required) + * @param itemType The type of item to browse to. (required) + * @param itemId The Id of the item. (required) + * @param itemName The name of the item. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse displayContentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable BaseItemKind itemType, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String itemName, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = displayContentRequestBuilder(sessionId, itemType, itemId, itemName, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("displayContent", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder displayContentRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable BaseItemKind itemType, + @org.eclipse.jdt.annotation.Nullable String itemId, @org.eclipse.jdt.annotation.Nullable String itemName, + Map headers) throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, "Missing the required parameter 'sessionId' when calling displayContent"); + } + // verify the required parameter 'itemType' is set + if (itemType == null) { + throw new ApiException(400, "Missing the required parameter 'itemType' when calling displayContent"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling displayContent"); + } + // verify the required parameter 'itemName' is set + if (itemName == null) { + throw new ApiException(400, "Missing the required parameter 'itemName' when calling displayContent"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/Viewing".replace("{sessionId}", + ApiClient.urlEncode(sessionId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "itemType"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("itemType", itemType)); + localVarQueryParameterBaseName = "itemId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("itemId", itemId)); + localVarQueryParameterBaseName = "itemName"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("itemName", itemName)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get all auth providers. + * + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getAuthProviders() throws ApiException { + return getAuthProviders(null); + } + + /** + * Get all auth providers. + * + * @param headers Optional headers to include in the request + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getAuthProviders(Map headers) throws ApiException { + ApiResponse> localVarResponse = getAuthProvidersWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Get all auth providers. + * + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getAuthProvidersWithHttpInfo() throws ApiException { + return getAuthProvidersWithHttpInfo(null); + } + + /** + * Get all auth providers. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getAuthProvidersWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAuthProvidersRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getAuthProviders", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAuthProvidersRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Auth/Providers"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get all password reset providers. + * + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getPasswordResetProviders() throws ApiException { + return getPasswordResetProviders(null); + } + + /** + * Get all password reset providers. + * + * @param headers Optional headers to include in the request + * @return List<NameIdPair> + * @throws ApiException if fails to make API call + */ + public List getPasswordResetProviders(Map headers) throws ApiException { + ApiResponse> localVarResponse = getPasswordResetProvidersWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Get all password reset providers. + * + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPasswordResetProvidersWithHttpInfo() throws ApiException { + return getPasswordResetProvidersWithHttpInfo(null); + } + + /** + * Get all password reset providers. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<NameIdPair>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPasswordResetProvidersWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPasswordResetProvidersRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPasswordResetProviders", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPasswordResetProvidersRequestBuilder(Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Auth/PasswordResetProviders"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of sessions. + * + * @param controllableByUserId Filter by sessions that a given user is allowed to remote control. (optional) + * @param deviceId Filter by device Id. (optional) + * @param activeWithinSeconds Optional. Filter by sessions that were active in the last n seconds. (optional) + * @return List<SessionInfo> + * @throws ApiException if fails to make API call + */ + public List getSessions(@org.eclipse.jdt.annotation.NonNull UUID controllableByUserId, + @org.eclipse.jdt.annotation.NonNull String deviceId, + @org.eclipse.jdt.annotation.NonNull Integer activeWithinSeconds) throws ApiException { + return getSessions(controllableByUserId, deviceId, activeWithinSeconds, null); + } + + /** + * Gets a list of sessions. + * + * @param controllableByUserId Filter by sessions that a given user is allowed to remote control. (optional) + * @param deviceId Filter by device Id. (optional) + * @param activeWithinSeconds Optional. Filter by sessions that were active in the last n seconds. (optional) + * @param headers Optional headers to include in the request + * @return List<SessionInfo> + * @throws ApiException if fails to make API call + */ + public List getSessions(@org.eclipse.jdt.annotation.NonNull UUID controllableByUserId, + @org.eclipse.jdt.annotation.NonNull String deviceId, + @org.eclipse.jdt.annotation.NonNull Integer activeWithinSeconds, Map headers) + throws ApiException { + ApiResponse> localVarResponse = getSessionsWithHttpInfo(controllableByUserId, deviceId, + activeWithinSeconds, headers); + return localVarResponse.getData(); + } + + /** + * Gets a list of sessions. + * + * @param controllableByUserId Filter by sessions that a given user is allowed to remote control. (optional) + * @param deviceId Filter by device Id. (optional) + * @param activeWithinSeconds Optional. Filter by sessions that were active in the last n seconds. (optional) + * @return ApiResponse<List<SessionInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getSessionsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID controllableByUserId, + @org.eclipse.jdt.annotation.NonNull String deviceId, + @org.eclipse.jdt.annotation.NonNull Integer activeWithinSeconds) throws ApiException { + return getSessionsWithHttpInfo(controllableByUserId, deviceId, activeWithinSeconds, null); + } + + /** + * Gets a list of sessions. + * + * @param controllableByUserId Filter by sessions that a given user is allowed to remote control. (optional) + * @param deviceId Filter by device Id. (optional) + * @param activeWithinSeconds Optional. Filter by sessions that were active in the last n seconds. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<SessionInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getSessionsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID controllableByUserId, + @org.eclipse.jdt.annotation.NonNull String deviceId, + @org.eclipse.jdt.annotation.NonNull Integer activeWithinSeconds, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSessionsRequestBuilder(controllableByUserId, deviceId, + activeWithinSeconds, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSessions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSessionsRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID controllableByUserId, + @org.eclipse.jdt.annotation.NonNull String deviceId, + @org.eclipse.jdt.annotation.NonNull Integer activeWithinSeconds, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "controllableByUserId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("controllableByUserId", controllableByUserId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "activeWithinSeconds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("activeWithinSeconds", activeWithinSeconds)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Instructs a session to play an item. + * + * @param sessionId The session id. (required) + * @param playCommand The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet + * implemented play next and play last may play now. (required) + * @param itemIds The ids of the items to play, comma delimited. (required) + * @param startPositionTicks The starting position of the first item. (optional) + * @param mediaSourceId Optional. The media source id. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to play. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to play. (optional) + * @param startIndex Optional. The start index. (optional) + * @throws ApiException if fails to make API call + */ + public void play(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlayCommand playCommand, + @org.eclipse.jdt.annotation.Nullable List itemIds, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer startIndex) throws ApiException { + play(sessionId, playCommand, itemIds, startPositionTicks, mediaSourceId, audioStreamIndex, subtitleStreamIndex, + startIndex, null); + } + + /** + * Instructs a session to play an item. + * + * @param sessionId The session id. (required) + * @param playCommand The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet + * implemented play next and play last may play now. (required) + * @param itemIds The ids of the items to play, comma delimited. (required) + * @param startPositionTicks The starting position of the first item. (optional) + * @param mediaSourceId Optional. The media source id. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to play. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to play. (optional) + * @param startIndex Optional. The start index. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void play(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlayCommand playCommand, + @org.eclipse.jdt.annotation.Nullable List itemIds, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, Map headers) throws ApiException { + playWithHttpInfo(sessionId, playCommand, itemIds, startPositionTicks, mediaSourceId, audioStreamIndex, + subtitleStreamIndex, startIndex, headers); + } + + /** + * Instructs a session to play an item. + * + * @param sessionId The session id. (required) + * @param playCommand The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet + * implemented play next and play last may play now. (required) + * @param itemIds The ids of the items to play, comma delimited. (required) + * @param startPositionTicks The starting position of the first item. (optional) + * @param mediaSourceId Optional. The media source id. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to play. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to play. (optional) + * @param startIndex Optional. The start index. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse playWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlayCommand playCommand, + @org.eclipse.jdt.annotation.Nullable List itemIds, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer startIndex) throws ApiException { + return playWithHttpInfo(sessionId, playCommand, itemIds, startPositionTicks, mediaSourceId, audioStreamIndex, + subtitleStreamIndex, startIndex, null); + } + + /** + * Instructs a session to play an item. + * + * @param sessionId The session id. (required) + * @param playCommand The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet + * implemented play next and play last may play now. (required) + * @param itemIds The ids of the items to play, comma delimited. (required) + * @param startPositionTicks The starting position of the first item. (optional) + * @param mediaSourceId Optional. The media source id. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to play. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to play. (optional) + * @param startIndex Optional. The start index. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse playWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlayCommand playCommand, + @org.eclipse.jdt.annotation.Nullable List itemIds, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = playRequestBuilder(sessionId, playCommand, itemIds, + startPositionTicks, mediaSourceId, audioStreamIndex, subtitleStreamIndex, startIndex, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("play", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder playRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlayCommand playCommand, + @org.eclipse.jdt.annotation.Nullable List itemIds, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, Map headers) throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, "Missing the required parameter 'sessionId' when calling play"); + } + // verify the required parameter 'playCommand' is set + if (playCommand == null) { + throw new ApiException(400, "Missing the required parameter 'playCommand' when calling play"); + } + // verify the required parameter 'itemIds' is set + if (itemIds == null) { + throw new ApiException(400, "Missing the required parameter 'itemIds' when calling play"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/Playing".replace("{sessionId}", + ApiClient.urlEncode(sessionId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "playCommand"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playCommand", playCommand)); + localVarQueryParameterBaseName = "itemIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "itemIds", itemIds)); + localVarQueryParameterBaseName = "startPositionTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startPositionTicks", startPositionTicks)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates capabilities for a device. + * + * @param id The session id. (optional) + * @param playableMediaTypes A list of playable media types, comma delimited. Audio, Video, Book, Photo. (optional) + * @param supportedCommands A list of supported remote control commands, comma delimited. (optional) + * @param supportsMediaControl Determines whether media can be played remotely.. (optional, default to false) + * @param supportsSync Determines whether sync is supported. (optional, default to false) + * @param supportsPersistentIdentifier Determines whether the device supports a unique identifier. (optional, + * default to true) + * @throws ApiException if fails to make API call + */ + public void postCapabilities(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull List playableMediaTypes, + @org.eclipse.jdt.annotation.NonNull List supportedCommands, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl, + @org.eclipse.jdt.annotation.NonNull Boolean supportsSync, + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier) throws ApiException { + postCapabilities(id, playableMediaTypes, supportedCommands, supportsMediaControl, supportsSync, + supportsPersistentIdentifier, null); + } + + /** + * Updates capabilities for a device. + * + * @param id The session id. (optional) + * @param playableMediaTypes A list of playable media types, comma delimited. Audio, Video, Book, Photo. (optional) + * @param supportedCommands A list of supported remote control commands, comma delimited. (optional) + * @param supportsMediaControl Determines whether media can be played remotely.. (optional, default to false) + * @param supportsSync Determines whether sync is supported. (optional, default to false) + * @param supportsPersistentIdentifier Determines whether the device supports a unique identifier. (optional, + * default to true) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postCapabilities(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull List playableMediaTypes, + @org.eclipse.jdt.annotation.NonNull List supportedCommands, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl, + @org.eclipse.jdt.annotation.NonNull Boolean supportsSync, + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier, Map headers) + throws ApiException { + postCapabilitiesWithHttpInfo(id, playableMediaTypes, supportedCommands, supportsMediaControl, supportsSync, + supportsPersistentIdentifier, headers); + } + + /** + * Updates capabilities for a device. + * + * @param id The session id. (optional) + * @param playableMediaTypes A list of playable media types, comma delimited. Audio, Video, Book, Photo. (optional) + * @param supportedCommands A list of supported remote control commands, comma delimited. (optional) + * @param supportsMediaControl Determines whether media can be played remotely.. (optional, default to false) + * @param supportsSync Determines whether sync is supported. (optional, default to false) + * @param supportsPersistentIdentifier Determines whether the device supports a unique identifier. (optional, + * default to true) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postCapabilitiesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull List playableMediaTypes, + @org.eclipse.jdt.annotation.NonNull List supportedCommands, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl, + @org.eclipse.jdt.annotation.NonNull Boolean supportsSync, + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier) throws ApiException { + return postCapabilitiesWithHttpInfo(id, playableMediaTypes, supportedCommands, supportsMediaControl, + supportsSync, supportsPersistentIdentifier, null); + } + + /** + * Updates capabilities for a device. + * + * @param id The session id. (optional) + * @param playableMediaTypes A list of playable media types, comma delimited. Audio, Video, Book, Photo. (optional) + * @param supportedCommands A list of supported remote control commands, comma delimited. (optional) + * @param supportsMediaControl Determines whether media can be played remotely.. (optional, default to false) + * @param supportsSync Determines whether sync is supported. (optional, default to false) + * @param supportsPersistentIdentifier Determines whether the device supports a unique identifier. (optional, + * default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postCapabilitiesWithHttpInfo(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull List playableMediaTypes, + @org.eclipse.jdt.annotation.NonNull List supportedCommands, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl, + @org.eclipse.jdt.annotation.NonNull Boolean supportsSync, + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postCapabilitiesRequestBuilder(id, playableMediaTypes, + supportedCommands, supportsMediaControl, supportsSync, supportsPersistentIdentifier, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postCapabilities", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postCapabilitiesRequestBuilder(@org.eclipse.jdt.annotation.NonNull String id, + @org.eclipse.jdt.annotation.NonNull List playableMediaTypes, + @org.eclipse.jdt.annotation.NonNull List supportedCommands, + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl, + @org.eclipse.jdt.annotation.NonNull Boolean supportsSync, + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/Capabilities"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + localVarQueryParameterBaseName = "playableMediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "playableMediaTypes", playableMediaTypes)); + localVarQueryParameterBaseName = "supportedCommands"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "supportedCommands", supportedCommands)); + localVarQueryParameterBaseName = "supportsMediaControl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("supportsMediaControl", supportsMediaControl)); + localVarQueryParameterBaseName = "supportsSync"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("supportsSync", supportsSync)); + localVarQueryParameterBaseName = "supportsPersistentIdentifier"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("supportsPersistentIdentifier", supportsPersistentIdentifier)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates capabilities for a device. + * + * @param clientCapabilitiesDto The MediaBrowser.Model.Session.ClientCapabilities. (required) + * @param id The session id. (optional) + * @throws ApiException if fails to make API call + */ + public void postFullCapabilities(@org.eclipse.jdt.annotation.Nullable ClientCapabilitiesDto clientCapabilitiesDto, + @org.eclipse.jdt.annotation.NonNull String id) throws ApiException { + postFullCapabilities(clientCapabilitiesDto, id, null); + } + + /** + * Updates capabilities for a device. + * + * @param clientCapabilitiesDto The MediaBrowser.Model.Session.ClientCapabilities. (required) + * @param id The session id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void postFullCapabilities(@org.eclipse.jdt.annotation.Nullable ClientCapabilitiesDto clientCapabilitiesDto, + @org.eclipse.jdt.annotation.NonNull String id, Map headers) throws ApiException { + postFullCapabilitiesWithHttpInfo(clientCapabilitiesDto, id, headers); + } + + /** + * Updates capabilities for a device. + * + * @param clientCapabilitiesDto The MediaBrowser.Model.Session.ClientCapabilities. (required) + * @param id The session id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postFullCapabilitiesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ClientCapabilitiesDto clientCapabilitiesDto, + @org.eclipse.jdt.annotation.NonNull String id) throws ApiException { + return postFullCapabilitiesWithHttpInfo(clientCapabilitiesDto, id, null); + } + + /** + * Updates capabilities for a device. + * + * @param clientCapabilitiesDto The MediaBrowser.Model.Session.ClientCapabilities. (required) + * @param id The session id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse postFullCapabilitiesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ClientCapabilitiesDto clientCapabilitiesDto, + @org.eclipse.jdt.annotation.NonNull String id, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postFullCapabilitiesRequestBuilder(clientCapabilitiesDto, id, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postFullCapabilities", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postFullCapabilitiesRequestBuilder( + @org.eclipse.jdt.annotation.Nullable ClientCapabilitiesDto clientCapabilitiesDto, + @org.eclipse.jdt.annotation.NonNull String id, Map headers) throws ApiException { + // verify the required parameter 'clientCapabilitiesDto' is set + if (clientCapabilitiesDto == null) { + throw new ApiException(400, + "Missing the required parameter 'clientCapabilitiesDto' when calling postFullCapabilities"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/Capabilities/Full"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "id"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("id", id)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(clientCapabilitiesDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Removes an additional user from a session. + * + * @param sessionId The session id. (required) + * @param userId The user id. (required) + * @throws ApiException if fails to make API call + */ + public void removeUserFromSession(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + removeUserFromSession(sessionId, userId, null); + } + + /** + * Removes an additional user from a session. + * + * @param sessionId The session id. (required) + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void removeUserFromSession(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { + removeUserFromSessionWithHttpInfo(sessionId, userId, headers); + } + + /** + * Removes an additional user from a session. + * + * @param sessionId The session id. (required) + * @param userId The user id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeUserFromSessionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + return removeUserFromSessionWithHttpInfo(sessionId, userId, null); + } + + /** + * Removes an additional user from a session. + * + * @param sessionId The session id. (required) + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse removeUserFromSessionWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = removeUserFromSessionRequestBuilder(sessionId, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("removeUserFromSession", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder removeUserFromSessionRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String sessionId, @org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, + "Missing the required parameter 'sessionId' when calling removeUserFromSession"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling removeUserFromSession"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/User/{userId}" + .replace("{sessionId}", ApiClient.urlEncode(sessionId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that a session has ended. + * + * @throws ApiException if fails to make API call + */ + public void reportSessionEnded() throws ApiException { + reportSessionEnded(null); + } + + /** + * Reports that a session has ended. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void reportSessionEnded(Map headers) throws ApiException { + reportSessionEndedWithHttpInfo(headers); + } + + /** + * Reports that a session has ended. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportSessionEndedWithHttpInfo() throws ApiException { + return reportSessionEndedWithHttpInfo(null); + } + + /** + * Reports that a session has ended. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportSessionEndedWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = reportSessionEndedRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("reportSessionEnded", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder reportSessionEndedRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/Logout"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reports that a session is viewing an item. + * + * @param itemId The item id. (required) + * @param sessionId The session id. (optional) + * @throws ApiException if fails to make API call + */ + public void reportViewing(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.NonNull String sessionId) throws ApiException { + reportViewing(itemId, sessionId, null); + } + + /** + * Reports that a session is viewing an item. + * + * @param itemId The item id. (required) + * @param sessionId The session id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void reportViewing(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.NonNull String sessionId, Map headers) throws ApiException { + reportViewingWithHttpInfo(itemId, sessionId, headers); + } + + /** + * Reports that a session is viewing an item. + * + * @param itemId The item id. (required) + * @param sessionId The session id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportViewingWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.NonNull String sessionId) throws ApiException { + return reportViewingWithHttpInfo(itemId, sessionId, null); + } + + /** + * Reports that a session is viewing an item. + * + * @param itemId The item id. (required) + * @param sessionId The session id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse reportViewingWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.NonNull String sessionId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = reportViewingRequestBuilder(itemId, sessionId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("reportViewing", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder reportViewingRequestBuilder(@org.eclipse.jdt.annotation.Nullable String itemId, + @org.eclipse.jdt.annotation.NonNull String sessionId, Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling reportViewing"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/Viewing"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "sessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sessionId", sessionId)); + localVarQueryParameterBaseName = "itemId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("itemId", itemId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Issues a full general command to a client. + * + * @param sessionId The session id. (required) + * @param generalCommand The MediaBrowser.Model.Session.GeneralCommand. (required) + * @throws ApiException if fails to make API call + */ + public void sendFullGeneralCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommand generalCommand) throws ApiException { + sendFullGeneralCommand(sessionId, generalCommand, null); + } + + /** + * Issues a full general command to a client. + * + * @param sessionId The session id. (required) + * @param generalCommand The MediaBrowser.Model.Session.GeneralCommand. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void sendFullGeneralCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommand generalCommand, Map headers) + throws ApiException { + sendFullGeneralCommandWithHttpInfo(sessionId, generalCommand, headers); + } + + /** + * Issues a full general command to a client. + * + * @param sessionId The session id. (required) + * @param generalCommand The MediaBrowser.Model.Session.GeneralCommand. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendFullGeneralCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommand generalCommand) throws ApiException { + return sendFullGeneralCommandWithHttpInfo(sessionId, generalCommand, null); + } + + /** + * Issues a full general command to a client. + * + * @param sessionId The session id. (required) + * @param generalCommand The MediaBrowser.Model.Session.GeneralCommand. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendFullGeneralCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommand generalCommand, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendFullGeneralCommandRequestBuilder(sessionId, generalCommand, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("sendFullGeneralCommand", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendFullGeneralCommandRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommand generalCommand, Map headers) + throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, + "Missing the required parameter 'sessionId' when calling sendFullGeneralCommand"); + } + // verify the required parameter 'generalCommand' is set + if (generalCommand == null) { + throw new ApiException(400, + "Missing the required parameter 'generalCommand' when calling sendFullGeneralCommand"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/Command".replace("{sessionId}", + ApiClient.urlEncode(sessionId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(generalCommand); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Issues a general command to a client. + * + * @param sessionId The session id. (required) + * @param command The command to send. (required) + * @throws ApiException if fails to make API call + */ + public void sendGeneralCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command) throws ApiException { + sendGeneralCommand(sessionId, command, null); + } + + /** + * Issues a general command to a client. + * + * @param sessionId The session id. (required) + * @param command The command to send. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void sendGeneralCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command, Map headers) + throws ApiException { + sendGeneralCommandWithHttpInfo(sessionId, command, headers); + } + + /** + * Issues a general command to a client. + * + * @param sessionId The session id. (required) + * @param command The command to send. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendGeneralCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command) throws ApiException { + return sendGeneralCommandWithHttpInfo(sessionId, command, null); + } + + /** + * Issues a general command to a client. + * + * @param sessionId The session id. (required) + * @param command The command to send. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendGeneralCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendGeneralCommandRequestBuilder(sessionId, command, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("sendGeneralCommand", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendGeneralCommandRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command, Map headers) + throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, "Missing the required parameter 'sessionId' when calling sendGeneralCommand"); + } + // verify the required parameter 'command' is set + if (command == null) { + throw new ApiException(400, "Missing the required parameter 'command' when calling sendGeneralCommand"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/Command/{command}" + .replace("{sessionId}", ApiClient.urlEncode(sessionId.toString())) + .replace("{command}", ApiClient.urlEncode(command.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Issues a command to a client to display a message to the user. + * + * @param sessionId The session id. (required) + * @param messageCommand The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and + * TimeoutMs. (required) + * @throws ApiException if fails to make API call + */ + public void sendMessageCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable MessageCommand messageCommand) throws ApiException { + sendMessageCommand(sessionId, messageCommand, null); + } + + /** + * Issues a command to a client to display a message to the user. + * + * @param sessionId The session id. (required) + * @param messageCommand The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and + * TimeoutMs. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void sendMessageCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable MessageCommand messageCommand, Map headers) + throws ApiException { + sendMessageCommandWithHttpInfo(sessionId, messageCommand, headers); + } + + /** + * Issues a command to a client to display a message to the user. + * + * @param sessionId The session id. (required) + * @param messageCommand The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and + * TimeoutMs. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendMessageCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable MessageCommand messageCommand) throws ApiException { + return sendMessageCommandWithHttpInfo(sessionId, messageCommand, null); + } + + /** + * Issues a command to a client to display a message to the user. + * + * @param sessionId The session id. (required) + * @param messageCommand The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and + * TimeoutMs. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendMessageCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable MessageCommand messageCommand, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendMessageCommandRequestBuilder(sessionId, messageCommand, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("sendMessageCommand", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendMessageCommandRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable MessageCommand messageCommand, Map headers) + throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, "Missing the required parameter 'sessionId' when calling sendMessageCommand"); + } + // verify the required parameter 'messageCommand' is set + if (messageCommand == null) { + throw new ApiException(400, + "Missing the required parameter 'messageCommand' when calling sendMessageCommand"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/Message".replace("{sessionId}", + ApiClient.urlEncode(sessionId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(messageCommand); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Issues a playstate command to a client. + * + * @param sessionId The session id. (required) + * @param command The MediaBrowser.Model.Session.PlaystateCommand. (required) + * @param seekPositionTicks The optional position ticks. (optional) + * @param controllingUserId The optional controlling user id. (optional) + * @throws ApiException if fails to make API call + */ + public void sendPlaystateCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlaystateCommand command, + @org.eclipse.jdt.annotation.NonNull Long seekPositionTicks, + @org.eclipse.jdt.annotation.NonNull String controllingUserId) throws ApiException { + sendPlaystateCommand(sessionId, command, seekPositionTicks, controllingUserId, null); + } + + /** + * Issues a playstate command to a client. + * + * @param sessionId The session id. (required) + * @param command The MediaBrowser.Model.Session.PlaystateCommand. (required) + * @param seekPositionTicks The optional position ticks. (optional) + * @param controllingUserId The optional controlling user id. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void sendPlaystateCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlaystateCommand command, + @org.eclipse.jdt.annotation.NonNull Long seekPositionTicks, + @org.eclipse.jdt.annotation.NonNull String controllingUserId, Map headers) + throws ApiException { + sendPlaystateCommandWithHttpInfo(sessionId, command, seekPositionTicks, controllingUserId, headers); + } + + /** + * Issues a playstate command to a client. + * + * @param sessionId The session id. (required) + * @param command The MediaBrowser.Model.Session.PlaystateCommand. (required) + * @param seekPositionTicks The optional position ticks. (optional) + * @param controllingUserId The optional controlling user id. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendPlaystateCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlaystateCommand command, + @org.eclipse.jdt.annotation.NonNull Long seekPositionTicks, + @org.eclipse.jdt.annotation.NonNull String controllingUserId) throws ApiException { + return sendPlaystateCommandWithHttpInfo(sessionId, command, seekPositionTicks, controllingUserId, null); + } + + /** + * Issues a playstate command to a client. + * + * @param sessionId The session id. (required) + * @param command The MediaBrowser.Model.Session.PlaystateCommand. (required) + * @param seekPositionTicks The optional position ticks. (optional) + * @param controllingUserId The optional controlling user id. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendPlaystateCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlaystateCommand command, + @org.eclipse.jdt.annotation.NonNull Long seekPositionTicks, + @org.eclipse.jdt.annotation.NonNull String controllingUserId, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendPlaystateCommandRequestBuilder(sessionId, command, + seekPositionTicks, controllingUserId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("sendPlaystateCommand", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendPlaystateCommandRequestBuilder( + @org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable PlaystateCommand command, + @org.eclipse.jdt.annotation.NonNull Long seekPositionTicks, + @org.eclipse.jdt.annotation.NonNull String controllingUserId, Map headers) + throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, "Missing the required parameter 'sessionId' when calling sendPlaystateCommand"); + } + // verify the required parameter 'command' is set + if (command == null) { + throw new ApiException(400, "Missing the required parameter 'command' when calling sendPlaystateCommand"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/Playing/{command}" + .replace("{sessionId}", ApiClient.urlEncode(sessionId.toString())) + .replace("{command}", ApiClient.urlEncode(command.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "seekPositionTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("seekPositionTicks", seekPositionTicks)); + localVarQueryParameterBaseName = "controllingUserId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("controllingUserId", controllingUserId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Issues a system command to a client. + * + * @param sessionId The session id. (required) + * @param command The command to send. (required) + * @throws ApiException if fails to make API call + */ + public void sendSystemCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command) throws ApiException { + sendSystemCommand(sessionId, command, null); + } + + /** + * Issues a system command to a client. + * + * @param sessionId The session id. (required) + * @param command The command to send. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void sendSystemCommand(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command, Map headers) + throws ApiException { + sendSystemCommandWithHttpInfo(sessionId, command, headers); + } + + /** + * Issues a system command to a client. + * + * @param sessionId The session id. (required) + * @param command The command to send. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendSystemCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command) throws ApiException { + return sendSystemCommandWithHttpInfo(sessionId, command, null); + } + + /** + * Issues a system command to a client. + * + * @param sessionId The session id. (required) + * @param command The command to send. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendSystemCommandWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendSystemCommandRequestBuilder(sessionId, command, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("sendSystemCommand", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendSystemCommandRequestBuilder(@org.eclipse.jdt.annotation.Nullable String sessionId, + @org.eclipse.jdt.annotation.Nullable GeneralCommandType command, Map headers) + throws ApiException { + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, "Missing the required parameter 'sessionId' when calling sendSystemCommand"); + } + // verify the required parameter 'command' is set + if (command == null) { + throw new ApiException(400, "Missing the required parameter 'command' when calling sendSystemCommand"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Sessions/{sessionId}/System/{command}" + .replace("{sessionId}", ApiClient.urlEncode(sessionId.toString())) + .replace("{command}", ApiClient.urlEncode(command.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/StartupApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/StartupApi.java new file mode 100644 index 0000000000000..ee083662315ee --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/StartupApi.java @@ -0,0 +1,847 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.Map; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.StartupConfigurationDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.StartupRemoteAccessDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.StartupUserDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class StartupApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public StartupApi() { + this(Configuration.getDefaultApiClient()); + } + + public StartupApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Completes the startup wizard. + * + * @throws ApiException if fails to make API call + */ + public void completeWizard() throws ApiException { + completeWizard(null); + } + + /** + * Completes the startup wizard. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void completeWizard(Map headers) throws ApiException { + completeWizardWithHttpInfo(headers); + } + + /** + * Completes the startup wizard. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse completeWizardWithHttpInfo() throws ApiException { + return completeWizardWithHttpInfo(null); + } + + /** + * Completes the startup wizard. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse completeWizardWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = completeWizardRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("completeWizard", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder completeWizardRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Startup/Complete"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the first user. + * + * @return StartupUserDto + * @throws ApiException if fails to make API call + */ + public StartupUserDto getFirstUser() throws ApiException { + return getFirstUser(null); + } + + /** + * Gets the first user. + * + * @param headers Optional headers to include in the request + * @return StartupUserDto + * @throws ApiException if fails to make API call + */ + public StartupUserDto getFirstUser(Map headers) throws ApiException { + ApiResponse localVarResponse = getFirstUserWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets the first user. + * + * @return ApiResponse<StartupUserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFirstUserWithHttpInfo() throws ApiException { + return getFirstUserWithHttpInfo(null); + } + + /** + * Gets the first user. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<StartupUserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFirstUserWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFirstUserRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getFirstUser", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + StartupUserDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getFirstUserRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Startup/User"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the first user. + * + * @return StartupUserDto + * @throws ApiException if fails to make API call + */ + public StartupUserDto getFirstUser2() throws ApiException { + return getFirstUser2(null); + } + + /** + * Gets the first user. + * + * @param headers Optional headers to include in the request + * @return StartupUserDto + * @throws ApiException if fails to make API call + */ + public StartupUserDto getFirstUser2(Map headers) throws ApiException { + ApiResponse localVarResponse = getFirstUser2WithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets the first user. + * + * @return ApiResponse<StartupUserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFirstUser2WithHttpInfo() throws ApiException { + return getFirstUser2WithHttpInfo(null); + } + + /** + * Gets the first user. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<StartupUserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFirstUser2WithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFirstUser2RequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getFirstUser2", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + StartupUserDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getFirstUser2RequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Startup/FirstUser"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the initial startup wizard configuration. + * + * @return StartupConfigurationDto + * @throws ApiException if fails to make API call + */ + public StartupConfigurationDto getStartupConfiguration() throws ApiException { + return getStartupConfiguration(null); + } + + /** + * Gets the initial startup wizard configuration. + * + * @param headers Optional headers to include in the request + * @return StartupConfigurationDto + * @throws ApiException if fails to make API call + */ + public StartupConfigurationDto getStartupConfiguration(Map headers) throws ApiException { + ApiResponse localVarResponse = getStartupConfigurationWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets the initial startup wizard configuration. + * + * @return ApiResponse<StartupConfigurationDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStartupConfigurationWithHttpInfo() throws ApiException { + return getStartupConfigurationWithHttpInfo(null); + } + + /** + * Gets the initial startup wizard configuration. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<StartupConfigurationDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStartupConfigurationWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getStartupConfigurationRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getStartupConfiguration", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + StartupConfigurationDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getStartupConfigurationRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Startup/Configuration"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sets remote access and UPnP. + * + * @param startupRemoteAccessDto The startup remote access dto. (required) + * @throws ApiException if fails to make API call + */ + public void setRemoteAccess(@org.eclipse.jdt.annotation.Nullable StartupRemoteAccessDto startupRemoteAccessDto) + throws ApiException { + setRemoteAccess(startupRemoteAccessDto, null); + } + + /** + * Sets remote access and UPnP. + * + * @param startupRemoteAccessDto The startup remote access dto. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void setRemoteAccess(@org.eclipse.jdt.annotation.Nullable StartupRemoteAccessDto startupRemoteAccessDto, + Map headers) throws ApiException { + setRemoteAccessWithHttpInfo(startupRemoteAccessDto, headers); + } + + /** + * Sets remote access and UPnP. + * + * @param startupRemoteAccessDto The startup remote access dto. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setRemoteAccessWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable StartupRemoteAccessDto startupRemoteAccessDto) throws ApiException { + return setRemoteAccessWithHttpInfo(startupRemoteAccessDto, null); + } + + /** + * Sets remote access and UPnP. + * + * @param startupRemoteAccessDto The startup remote access dto. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse setRemoteAccessWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable StartupRemoteAccessDto startupRemoteAccessDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = setRemoteAccessRequestBuilder(startupRemoteAccessDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("setRemoteAccess", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder setRemoteAccessRequestBuilder( + @org.eclipse.jdt.annotation.Nullable StartupRemoteAccessDto startupRemoteAccessDto, + Map headers) throws ApiException { + // verify the required parameter 'startupRemoteAccessDto' is set + if (startupRemoteAccessDto == null) { + throw new ApiException(400, + "Missing the required parameter 'startupRemoteAccessDto' when calling setRemoteAccess"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Startup/RemoteAccess"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(startupRemoteAccessDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sets the initial startup wizard configuration. + * + * @param startupConfigurationDto The updated startup configuration. (required) + * @throws ApiException if fails to make API call + */ + public void updateInitialConfiguration( + @org.eclipse.jdt.annotation.Nullable StartupConfigurationDto startupConfigurationDto) throws ApiException { + updateInitialConfiguration(startupConfigurationDto, null); + } + + /** + * Sets the initial startup wizard configuration. + * + * @param startupConfigurationDto The updated startup configuration. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateInitialConfiguration( + @org.eclipse.jdt.annotation.Nullable StartupConfigurationDto startupConfigurationDto, + Map headers) throws ApiException { + updateInitialConfigurationWithHttpInfo(startupConfigurationDto, headers); + } + + /** + * Sets the initial startup wizard configuration. + * + * @param startupConfigurationDto The updated startup configuration. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateInitialConfigurationWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable StartupConfigurationDto startupConfigurationDto) throws ApiException { + return updateInitialConfigurationWithHttpInfo(startupConfigurationDto, null); + } + + /** + * Sets the initial startup wizard configuration. + * + * @param startupConfigurationDto The updated startup configuration. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateInitialConfigurationWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable StartupConfigurationDto startupConfigurationDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateInitialConfigurationRequestBuilder(startupConfigurationDto, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateInitialConfiguration", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateInitialConfigurationRequestBuilder( + @org.eclipse.jdt.annotation.Nullable StartupConfigurationDto startupConfigurationDto, + Map headers) throws ApiException { + // verify the required parameter 'startupConfigurationDto' is set + if (startupConfigurationDto == null) { + throw new ApiException(400, + "Missing the required parameter 'startupConfigurationDto' when calling updateInitialConfiguration"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Startup/Configuration"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(startupConfigurationDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sets the user name and password. + * + * @param startupUserDto The DTO containing username and password. (optional) + * @throws ApiException if fails to make API call + */ + public void updateStartupUser(@org.eclipse.jdt.annotation.NonNull StartupUserDto startupUserDto) + throws ApiException { + updateStartupUser(startupUserDto, null); + } + + /** + * Sets the user name and password. + * + * @param startupUserDto The DTO containing username and password. (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateStartupUser(@org.eclipse.jdt.annotation.NonNull StartupUserDto startupUserDto, + Map headers) throws ApiException { + updateStartupUserWithHttpInfo(startupUserDto, headers); + } + + /** + * Sets the user name and password. + * + * @param startupUserDto The DTO containing username and password. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateStartupUserWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull StartupUserDto startupUserDto) throws ApiException { + return updateStartupUserWithHttpInfo(startupUserDto, null); + } + + /** + * Sets the user name and password. + * + * @param startupUserDto The DTO containing username and password. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateStartupUserWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull StartupUserDto startupUserDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateStartupUserRequestBuilder(startupUserDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateStartupUser", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateStartupUserRequestBuilder( + @org.eclipse.jdt.annotation.NonNull StartupUserDto startupUserDto, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Startup/User"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(startupUserDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/StudiosApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/StudiosApi.java new file mode 100644 index 0000000000000..5560e1d206cc1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/StudiosApi.java @@ -0,0 +1,607 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFields; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class StudiosApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public StudiosApi() { + this(Configuration.getDefaultApiClient()); + } + + public StudiosApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets a studio by name. + * + * @param name Studio name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getStudio(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getStudio(name, userId, null); + } + + /** + * Gets a studio by name. + * + * @param name Studio name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getStudio(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getStudioWithHttpInfo(name, userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets a studio by name. + * + * @param name Studio name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStudioWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getStudioWithHttpInfo(name, userId, null); + } + + /** + * Gets a studio by name. + * + * @param name Studio name. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStudioWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getStudioRequestBuilder(name, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getStudio", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getStudioRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getStudio"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Studios/{name}".replace("{name}", ApiClient.urlEncode(name.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all studios from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getStudios(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getStudios(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, includeItemTypes, + isFavorite, enableUserData, imageTypeLimit, enableImageTypes, userId, nameStartsWithOrGreater, + nameStartsWith, nameLessThan, enableImages, enableTotalRecordCount, null); + } + + /** + * Gets all studios from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getStudios(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + ApiResponse localVarResponse = getStudiosWithHttpInfo(startIndex, limit, searchTerm, + parentId, fields, excludeItemTypes, includeItemTypes, isFavorite, enableUserData, imageTypeLimit, + enableImageTypes, userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, enableImages, + enableTotalRecordCount, headers); + return localVarResponse.getData(); + } + + /** + * Gets all studios from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStudiosWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getStudiosWithHttpInfo(startIndex, limit, searchTerm, parentId, fields, excludeItemTypes, + includeItemTypes, isFavorite, enableUserData, imageTypeLimit, enableImageTypes, userId, + nameStartsWithOrGreater, nameStartsWith, nameLessThan, enableImages, enableTotalRecordCount, null); + } + + /** + * Gets all studios from a given item, folder, or the entire library. + * + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param searchTerm Optional. Search term. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User id. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param enableTotalRecordCount Total record count. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getStudiosWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull String searchTerm, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getStudiosRequestBuilder(startIndex, limit, searchTerm, parentId, + fields, excludeItemTypes, includeItemTypes, isFavorite, enableUserData, imageTypeLimit, + enableImageTypes, userId, nameStartsWithOrGreater, nameStartsWith, nameLessThan, enableImages, + enableTotalRecordCount, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getStudios", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getStudiosRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Studios"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "nameStartsWithOrGreater"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWithOrGreater", nameStartsWithOrGreater)); + localVarQueryParameterBaseName = "nameStartsWith"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWith", nameStartsWith)); + localVarQueryParameterBaseName = "nameLessThan"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameLessThan", nameLessThan)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SubtitleApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SubtitleApi.java new file mode 100644 index 0000000000000..0e9ebaa491e79 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SubtitleApi.java @@ -0,0 +1,1626 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.FontFile; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.RemoteSubtitleInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.UploadSubtitleDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SubtitleApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public SubtitleApi() { + this(Configuration.getDefaultApiClient()); + } + + public SubtitleApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Deletes an external subtitle file. + * + * @param itemId The item id. (required) + * @param index The index of the subtitle file. (required) + * @throws ApiException if fails to make API call + */ + public void deleteSubtitle(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { + deleteSubtitle(itemId, index, null); + } + + /** + * Deletes an external subtitle file. + * + * @param itemId The item id. (required) + * @param index The index of the subtitle file. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteSubtitle(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index, Map headers) throws ApiException { + deleteSubtitleWithHttpInfo(itemId, index, headers); + } + + /** + * Deletes an external subtitle file. + * + * @param itemId The item id. (required) + * @param index The index of the subtitle file. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteSubtitleWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { + return deleteSubtitleWithHttpInfo(itemId, index, null); + } + + /** + * Deletes an external subtitle file. + * + * @param itemId The item id. (required) + * @param index The index of the subtitle file. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteSubtitleWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteSubtitleRequestBuilder(itemId, index, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteSubtitle", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteSubtitleRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index, Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteSubtitle"); + } + // verify the required parameter 'index' is set + if (index == null) { + throw new ApiException(400, "Missing the required parameter 'index' when calling deleteSubtitle"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/Subtitles/{index}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{index}", ApiClient.urlEncode(index.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Downloads a remote subtitle. + * + * @param itemId The item id. (required) + * @param subtitleId The subtitle id. (required) + * @throws ApiException if fails to make API call + */ + public void downloadRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String subtitleId) throws ApiException { + downloadRemoteSubtitles(itemId, subtitleId, null); + } + + /** + * Downloads a remote subtitle. + * + * @param itemId The item id. (required) + * @param subtitleId The subtitle id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void downloadRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String subtitleId, Map headers) throws ApiException { + downloadRemoteSubtitlesWithHttpInfo(itemId, subtitleId, headers); + } + + /** + * Downloads a remote subtitle. + * + * @param itemId The item id. (required) + * @param subtitleId The subtitle id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse downloadRemoteSubtitlesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String subtitleId) throws ApiException { + return downloadRemoteSubtitlesWithHttpInfo(itemId, subtitleId, null); + } + + /** + * Downloads a remote subtitle. + * + * @param itemId The item id. (required) + * @param subtitleId The subtitle id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse downloadRemoteSubtitlesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String subtitleId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = downloadRemoteSubtitlesRequestBuilder(itemId, subtitleId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("downloadRemoteSubtitles", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder downloadRemoteSubtitlesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String subtitleId, Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling downloadRemoteSubtitles"); + } + // verify the required parameter 'subtitleId' is set + if (subtitleId == null) { + throw new ApiException(400, + "Missing the required parameter 'subtitleId' when calling downloadRemoteSubtitles"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/RemoteSearch/Subtitles/{subtitleId}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{subtitleId}", ApiClient.urlEncode(subtitleId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a fallback font file. + * + * @param name The name of the fallback font file to get. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getFallbackFont(@org.eclipse.jdt.annotation.Nullable String name) throws ApiException { + return getFallbackFont(name, null); + } + + /** + * Gets a fallback font file. + * + * @param name The name of the fallback font file to get. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getFallbackFont(@org.eclipse.jdt.annotation.Nullable String name, Map headers) + throws ApiException { + ApiResponse localVarResponse = getFallbackFontWithHttpInfo(name, headers); + return localVarResponse.getData(); + } + + /** + * Gets a fallback font file. + * + * @param name The name of the fallback font file to get. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFallbackFontWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name) + throws ApiException { + return getFallbackFontWithHttpInfo(name, null); + } + + /** + * Gets a fallback font file. + * + * @param name The name of the fallback font file to get. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getFallbackFontWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFallbackFontRequestBuilder(name, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getFallbackFont", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getFallbackFontRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getFallbackFont"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/FallbackFont/Fonts/{name}".replace("{name}", ApiClient.urlEncode(name.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "font/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of available fallback font files. + * + * @return List<FontFile> + * @throws ApiException if fails to make API call + */ + public List getFallbackFontList() throws ApiException { + return getFallbackFontList(null); + } + + /** + * Gets a list of available fallback font files. + * + * @param headers Optional headers to include in the request + * @return List<FontFile> + * @throws ApiException if fails to make API call + */ + public List getFallbackFontList(Map headers) throws ApiException { + ApiResponse> localVarResponse = getFallbackFontListWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets a list of available fallback font files. + * + * @return ApiResponse<List<FontFile>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getFallbackFontListWithHttpInfo() throws ApiException { + return getFallbackFontListWithHttpInfo(null); + } + + /** + * Gets a list of available fallback font files. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<FontFile>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getFallbackFontListWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getFallbackFontListRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getFallbackFontList", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getFallbackFontListRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/FallbackFont/Fonts"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the remote subtitles. + * + * @param id The item id. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable String id) throws ApiException { + return getRemoteSubtitles(id, null); + } + + /** + * Gets the remote subtitles. + * + * @param id The item id. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable String id, Map headers) + throws ApiException { + ApiResponse localVarResponse = getRemoteSubtitlesWithHttpInfo(id, headers); + return localVarResponse.getData(); + } + + /** + * Gets the remote subtitles. + * + * @param id The item id. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRemoteSubtitlesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id) + throws ApiException { + return getRemoteSubtitlesWithHttpInfo(id, null); + } + + /** + * Gets the remote subtitles. + * + * @param id The item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRemoteSubtitlesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String id, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRemoteSubtitlesRequestBuilder(id, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRemoteSubtitles", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRemoteSubtitlesRequestBuilder(@org.eclipse.jdt.annotation.Nullable String id, + Map headers) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getRemoteSubtitles"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Providers/Subtitles/Subtitles/{id}".replace("{id}", ApiClient.urlEncode(id.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets subtitles in a specified format. + * + * @param routeItemId The (route) item id. (required) + * @param routeMediaSourceId The (route) media source id. (required) + * @param routeIndex The (route) subtitle stream index. (required) + * @param routeFormat The (route) format of the returned subtitle. (required) + * @param itemId The item id. (optional) + * @param mediaSourceId The media source id. (optional) + * @param index The subtitle stream index. (optional) + * @param format The format of the returned subtitle. (optional) + * @param endPositionTicks Optional. The end position of the subtitle in ticks. (optional) + * @param copyTimestamps Optional. Whether to copy the timestamps. (optional, default to false) + * @param addVttTimeMap Optional. Whether to add a VTT time map. (optional, default to false) + * @param startPositionTicks The start position of the subtitle in ticks. (optional, default to 0) + * @return File + * @throws ApiException if fails to make API call + */ + public File getSubtitle(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks) throws ApiException { + return getSubtitle(routeItemId, routeMediaSourceId, routeIndex, routeFormat, itemId, mediaSourceId, index, + format, endPositionTicks, copyTimestamps, addVttTimeMap, startPositionTicks, null); + } + + /** + * Gets subtitles in a specified format. + * + * @param routeItemId The (route) item id. (required) + * @param routeMediaSourceId The (route) media source id. (required) + * @param routeIndex The (route) subtitle stream index. (required) + * @param routeFormat The (route) format of the returned subtitle. (required) + * @param itemId The item id. (optional) + * @param mediaSourceId The media source id. (optional) + * @param index The subtitle stream index. (optional) + * @param format The format of the returned subtitle. (optional) + * @param endPositionTicks Optional. The end position of the subtitle in ticks. (optional) + * @param copyTimestamps Optional. Whether to copy the timestamps. (optional, default to false) + * @param addVttTimeMap Optional. Whether to add a VTT time map. (optional, default to false) + * @param startPositionTicks The start position of the subtitle in ticks. (optional, default to 0) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getSubtitle(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, Map headers) + throws ApiException { + ApiResponse localVarResponse = getSubtitleWithHttpInfo(routeItemId, routeMediaSourceId, routeIndex, + routeFormat, itemId, mediaSourceId, index, format, endPositionTicks, copyTimestamps, addVttTimeMap, + startPositionTicks, headers); + return localVarResponse.getData(); + } + + /** + * Gets subtitles in a specified format. + * + * @param routeItemId The (route) item id. (required) + * @param routeMediaSourceId The (route) media source id. (required) + * @param routeIndex The (route) subtitle stream index. (required) + * @param routeFormat The (route) format of the returned subtitle. (required) + * @param itemId The item id. (optional) + * @param mediaSourceId The media source id. (optional) + * @param index The subtitle stream index. (optional) + * @param format The format of the returned subtitle. (optional) + * @param endPositionTicks Optional. The end position of the subtitle in ticks. (optional) + * @param copyTimestamps Optional. Whether to copy the timestamps. (optional, default to false) + * @param addVttTimeMap Optional. Whether to add a VTT time map. (optional, default to false) + * @param startPositionTicks The start position of the subtitle in ticks. (optional, default to 0) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSubtitleWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks) throws ApiException { + return getSubtitleWithHttpInfo(routeItemId, routeMediaSourceId, routeIndex, routeFormat, itemId, mediaSourceId, + index, format, endPositionTicks, copyTimestamps, addVttTimeMap, startPositionTicks, null); + } + + /** + * Gets subtitles in a specified format. + * + * @param routeItemId The (route) item id. (required) + * @param routeMediaSourceId The (route) media source id. (required) + * @param routeIndex The (route) subtitle stream index. (required) + * @param routeFormat The (route) format of the returned subtitle. (required) + * @param itemId The item id. (optional) + * @param mediaSourceId The media source id. (optional) + * @param index The subtitle stream index. (optional) + * @param format The format of the returned subtitle. (optional) + * @param endPositionTicks Optional. The end position of the subtitle in ticks. (optional) + * @param copyTimestamps Optional. Whether to copy the timestamps. (optional, default to false) + * @param addVttTimeMap Optional. Whether to add a VTT time map. (optional, default to false) + * @param startPositionTicks The start position of the subtitle in ticks. (optional, default to 0) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSubtitleWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSubtitleRequestBuilder(routeItemId, routeMediaSourceId, + routeIndex, routeFormat, itemId, mediaSourceId, index, format, endPositionTicks, copyTimestamps, + addVttTimeMap, startPositionTicks, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSubtitle", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSubtitleRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, Map headers) + throws ApiException { + // verify the required parameter 'routeItemId' is set + if (routeItemId == null) { + throw new ApiException(400, "Missing the required parameter 'routeItemId' when calling getSubtitle"); + } + // verify the required parameter 'routeMediaSourceId' is set + if (routeMediaSourceId == null) { + throw new ApiException(400, "Missing the required parameter 'routeMediaSourceId' when calling getSubtitle"); + } + // verify the required parameter 'routeIndex' is set + if (routeIndex == null) { + throw new ApiException(400, "Missing the required parameter 'routeIndex' when calling getSubtitle"); + } + // verify the required parameter 'routeFormat' is set + if (routeFormat == null) { + throw new ApiException(400, "Missing the required parameter 'routeFormat' when calling getSubtitle"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/Stream.{routeFormat}" + .replace("{routeItemId}", ApiClient.urlEncode(routeItemId.toString())) + .replace("{routeMediaSourceId}", ApiClient.urlEncode(routeMediaSourceId.toString())) + .replace("{routeIndex}", ApiClient.urlEncode(routeIndex.toString())) + .replace("{routeFormat}", ApiClient.urlEncode(routeFormat.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "itemId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("itemId", itemId)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "index"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("index", index)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "endPositionTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("endPositionTicks", endPositionTicks)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "addVttTimeMap"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addVttTimeMap", addVttTimeMap)); + localVarQueryParameterBaseName = "startPositionTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startPositionTicks", startPositionTicks)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "text/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an HLS subtitle playlist. + * + * @param itemId The item id. (required) + * @param index The subtitle stream index. (required) + * @param mediaSourceId The media source id. (required) + * @param segmentLength The subtitle segment length. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getSubtitlePlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer segmentLength) throws ApiException { + return getSubtitlePlaylist(itemId, index, mediaSourceId, segmentLength, null); + } + + /** + * Gets an HLS subtitle playlist. + * + * @param itemId The item id. (required) + * @param index The subtitle stream index. (required) + * @param mediaSourceId The media source id. (required) + * @param segmentLength The subtitle segment length. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getSubtitlePlaylist(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer segmentLength, Map headers) + throws ApiException { + ApiResponse localVarResponse = getSubtitlePlaylistWithHttpInfo(itemId, index, mediaSourceId, + segmentLength, headers); + return localVarResponse.getData(); + } + + /** + * Gets an HLS subtitle playlist. + * + * @param itemId The item id. (required) + * @param index The subtitle stream index. (required) + * @param mediaSourceId The media source id. (required) + * @param segmentLength The subtitle segment length. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSubtitlePlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer segmentLength) throws ApiException { + return getSubtitlePlaylistWithHttpInfo(itemId, index, mediaSourceId, segmentLength, null); + } + + /** + * Gets an HLS subtitle playlist. + * + * @param itemId The item id. (required) + * @param index The subtitle stream index. (required) + * @param mediaSourceId The media source id. (required) + * @param segmentLength The subtitle segment length. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSubtitlePlaylistWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer segmentLength, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSubtitlePlaylistRequestBuilder(itemId, index, mediaSourceId, + segmentLength, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSubtitlePlaylist", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSubtitlePlaylistRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable Integer index, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer segmentLength, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSubtitlePlaylist"); + } + // verify the required parameter 'index' is set + if (index == null) { + throw new ApiException(400, "Missing the required parameter 'index' when calling getSubtitlePlaylist"); + } + // verify the required parameter 'mediaSourceId' is set + if (mediaSourceId == null) { + throw new ApiException(400, + "Missing the required parameter 'mediaSourceId' when calling getSubtitlePlaylist"); + } + // verify the required parameter 'segmentLength' is set + if (segmentLength == null) { + throw new ApiException(400, + "Missing the required parameter 'segmentLength' when calling getSubtitlePlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/{mediaSourceId}/Subtitles/{index}/subtitles.m3u8" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{index}", ApiClient.urlEncode(index.toString())) + .replace("{mediaSourceId}", ApiClient.urlEncode(mediaSourceId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/x-mpegURL"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets subtitles in a specified format. + * + * @param routeItemId The (route) item id. (required) + * @param routeMediaSourceId The (route) media source id. (required) + * @param routeIndex The (route) subtitle stream index. (required) + * @param routeStartPositionTicks The (route) start position of the subtitle in ticks. (required) + * @param routeFormat The (route) format of the returned subtitle. (required) + * @param itemId The item id. (optional) + * @param mediaSourceId The media source id. (optional) + * @param index The subtitle stream index. (optional) + * @param startPositionTicks The start position of the subtitle in ticks. (optional) + * @param format The format of the returned subtitle. (optional) + * @param endPositionTicks Optional. The end position of the subtitle in ticks. (optional) + * @param copyTimestamps Optional. Whether to copy the timestamps. (optional, default to false) + * @param addVttTimeMap Optional. Whether to add a VTT time map. (optional, default to false) + * @return File + * @throws ApiException if fails to make API call + */ + public File getSubtitleWithTicks(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable Long routeStartPositionTicks, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap) throws ApiException { + return getSubtitleWithTicks(routeItemId, routeMediaSourceId, routeIndex, routeStartPositionTicks, routeFormat, + itemId, mediaSourceId, index, startPositionTicks, format, endPositionTicks, copyTimestamps, + addVttTimeMap, null); + } + + /** + * Gets subtitles in a specified format. + * + * @param routeItemId The (route) item id. (required) + * @param routeMediaSourceId The (route) media source id. (required) + * @param routeIndex The (route) subtitle stream index. (required) + * @param routeStartPositionTicks The (route) start position of the subtitle in ticks. (required) + * @param routeFormat The (route) format of the returned subtitle. (required) + * @param itemId The item id. (optional) + * @param mediaSourceId The media source id. (optional) + * @param index The subtitle stream index. (optional) + * @param startPositionTicks The start position of the subtitle in ticks. (optional) + * @param format The format of the returned subtitle. (optional) + * @param endPositionTicks Optional. The end position of the subtitle in ticks. (optional) + * @param copyTimestamps Optional. Whether to copy the timestamps. (optional, default to false) + * @param addVttTimeMap Optional. Whether to add a VTT time map. (optional, default to false) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getSubtitleWithTicks(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable Long routeStartPositionTicks, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, Map headers) + throws ApiException { + ApiResponse localVarResponse = getSubtitleWithTicksWithHttpInfo(routeItemId, routeMediaSourceId, + routeIndex, routeStartPositionTicks, routeFormat, itemId, mediaSourceId, index, startPositionTicks, + format, endPositionTicks, copyTimestamps, addVttTimeMap, headers); + return localVarResponse.getData(); + } + + /** + * Gets subtitles in a specified format. + * + * @param routeItemId The (route) item id. (required) + * @param routeMediaSourceId The (route) media source id. (required) + * @param routeIndex The (route) subtitle stream index. (required) + * @param routeStartPositionTicks The (route) start position of the subtitle in ticks. (required) + * @param routeFormat The (route) format of the returned subtitle. (required) + * @param itemId The item id. (optional) + * @param mediaSourceId The media source id. (optional) + * @param index The subtitle stream index. (optional) + * @param startPositionTicks The start position of the subtitle in ticks. (optional) + * @param format The format of the returned subtitle. (optional) + * @param endPositionTicks Optional. The end position of the subtitle in ticks. (optional) + * @param copyTimestamps Optional. Whether to copy the timestamps. (optional, default to false) + * @param addVttTimeMap Optional. Whether to add a VTT time map. (optional, default to false) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSubtitleWithTicksWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable Long routeStartPositionTicks, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap) throws ApiException { + return getSubtitleWithTicksWithHttpInfo(routeItemId, routeMediaSourceId, routeIndex, routeStartPositionTicks, + routeFormat, itemId, mediaSourceId, index, startPositionTicks, format, endPositionTicks, copyTimestamps, + addVttTimeMap, null); + } + + /** + * Gets subtitles in a specified format. + * + * @param routeItemId The (route) item id. (required) + * @param routeMediaSourceId The (route) media source id. (required) + * @param routeIndex The (route) subtitle stream index. (required) + * @param routeStartPositionTicks The (route) start position of the subtitle in ticks. (required) + * @param routeFormat The (route) format of the returned subtitle. (required) + * @param itemId The item id. (optional) + * @param mediaSourceId The media source id. (optional) + * @param index The subtitle stream index. (optional) + * @param startPositionTicks The start position of the subtitle in ticks. (optional) + * @param format The format of the returned subtitle. (optional) + * @param endPositionTicks Optional. The end position of the subtitle in ticks. (optional) + * @param copyTimestamps Optional. Whether to copy the timestamps. (optional, default to false) + * @param addVttTimeMap Optional. Whether to add a VTT time map. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSubtitleWithTicksWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable Long routeStartPositionTicks, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSubtitleWithTicksRequestBuilder(routeItemId, routeMediaSourceId, + routeIndex, routeStartPositionTicks, routeFormat, itemId, mediaSourceId, index, startPositionTicks, + format, endPositionTicks, copyTimestamps, addVttTimeMap, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSubtitleWithTicks", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSubtitleWithTicksRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID routeItemId, + @org.eclipse.jdt.annotation.Nullable String routeMediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer routeIndex, + @org.eclipse.jdt.annotation.Nullable Long routeStartPositionTicks, + @org.eclipse.jdt.annotation.Nullable String routeFormat, @org.eclipse.jdt.annotation.NonNull UUID itemId, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, @org.eclipse.jdt.annotation.NonNull Integer index, + @org.eclipse.jdt.annotation.NonNull Long startPositionTicks, + @org.eclipse.jdt.annotation.NonNull String format, + @org.eclipse.jdt.annotation.NonNull Long endPositionTicks, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Boolean addVttTimeMap, Map headers) + throws ApiException { + // verify the required parameter 'routeItemId' is set + if (routeItemId == null) { + throw new ApiException(400, + "Missing the required parameter 'routeItemId' when calling getSubtitleWithTicks"); + } + // verify the required parameter 'routeMediaSourceId' is set + if (routeMediaSourceId == null) { + throw new ApiException(400, + "Missing the required parameter 'routeMediaSourceId' when calling getSubtitleWithTicks"); + } + // verify the required parameter 'routeIndex' is set + if (routeIndex == null) { + throw new ApiException(400, + "Missing the required parameter 'routeIndex' when calling getSubtitleWithTicks"); + } + // verify the required parameter 'routeStartPositionTicks' is set + if (routeStartPositionTicks == null) { + throw new ApiException(400, + "Missing the required parameter 'routeStartPositionTicks' when calling getSubtitleWithTicks"); + } + // verify the required parameter 'routeFormat' is set + if (routeFormat == null) { + throw new ApiException(400, + "Missing the required parameter 'routeFormat' when calling getSubtitleWithTicks"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/{routeStartPositionTicks}/Stream.{routeFormat}" + .replace("{routeItemId}", ApiClient.urlEncode(routeItemId.toString())) + .replace("{routeMediaSourceId}", ApiClient.urlEncode(routeMediaSourceId.toString())) + .replace("{routeIndex}", ApiClient.urlEncode(routeIndex.toString())) + .replace("{routeStartPositionTicks}", ApiClient.urlEncode(routeStartPositionTicks.toString())) + .replace("{routeFormat}", ApiClient.urlEncode(routeFormat.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "itemId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("itemId", itemId)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "index"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("index", index)); + localVarQueryParameterBaseName = "startPositionTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startPositionTicks", startPositionTicks)); + localVarQueryParameterBaseName = "format"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("format", format)); + localVarQueryParameterBaseName = "endPositionTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("endPositionTicks", endPositionTicks)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "addVttTimeMap"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("addVttTimeMap", addVttTimeMap)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "text/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Search remote subtitles. + * + * @param itemId The item id. (required) + * @param language The language of the subtitles. (required) + * @param isPerfectMatch Optional. Only show subtitles which are a perfect match. (optional) + * @return List<RemoteSubtitleInfo> + * @throws ApiException if fails to make API call + */ + public List searchRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String language, + @org.eclipse.jdt.annotation.NonNull Boolean isPerfectMatch) throws ApiException { + return searchRemoteSubtitles(itemId, language, isPerfectMatch, null); + } + + /** + * Search remote subtitles. + * + * @param itemId The item id. (required) + * @param language The language of the subtitles. (required) + * @param isPerfectMatch Optional. Only show subtitles which are a perfect match. (optional) + * @param headers Optional headers to include in the request + * @return List<RemoteSubtitleInfo> + * @throws ApiException if fails to make API call + */ + public List searchRemoteSubtitles(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String language, + @org.eclipse.jdt.annotation.NonNull Boolean isPerfectMatch, Map headers) + throws ApiException { + ApiResponse> localVarResponse = searchRemoteSubtitlesWithHttpInfo(itemId, language, + isPerfectMatch, headers); + return localVarResponse.getData(); + } + + /** + * Search remote subtitles. + * + * @param itemId The item id. (required) + * @param language The language of the subtitles. (required) + * @param isPerfectMatch Optional. Only show subtitles which are a perfect match. (optional) + * @return ApiResponse<List<RemoteSubtitleInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> searchRemoteSubtitlesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String language, + @org.eclipse.jdt.annotation.NonNull Boolean isPerfectMatch) throws ApiException { + return searchRemoteSubtitlesWithHttpInfo(itemId, language, isPerfectMatch, null); + } + + /** + * Search remote subtitles. + * + * @param itemId The item id. (required) + * @param language The language of the subtitles. (required) + * @param isPerfectMatch Optional. Only show subtitles which are a perfect match. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<RemoteSubtitleInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> searchRemoteSubtitlesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String language, + @org.eclipse.jdt.annotation.NonNull Boolean isPerfectMatch, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = searchRemoteSubtitlesRequestBuilder(itemId, language, + isPerfectMatch, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("searchRemoteSubtitles", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder searchRemoteSubtitlesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String language, + @org.eclipse.jdt.annotation.NonNull Boolean isPerfectMatch, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling searchRemoteSubtitles"); + } + // verify the required parameter 'language' is set + if (language == null) { + throw new ApiException(400, "Missing the required parameter 'language' when calling searchRemoteSubtitles"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Items/{itemId}/RemoteSearch/Subtitles/{language}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{language}", ApiClient.urlEncode(language.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "isPerfectMatch"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isPerfectMatch", isPerfectMatch)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Upload an external subtitle file. + * + * @param itemId The item the subtitle belongs to. (required) + * @param uploadSubtitleDto The request body. (required) + * @throws ApiException if fails to make API call + */ + public void uploadSubtitle(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UploadSubtitleDto uploadSubtitleDto) throws ApiException { + uploadSubtitle(itemId, uploadSubtitleDto, null); + } + + /** + * Upload an external subtitle file. + * + * @param itemId The item the subtitle belongs to. (required) + * @param uploadSubtitleDto The request body. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void uploadSubtitle(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UploadSubtitleDto uploadSubtitleDto, Map headers) + throws ApiException { + uploadSubtitleWithHttpInfo(itemId, uploadSubtitleDto, headers); + } + + /** + * Upload an external subtitle file. + * + * @param itemId The item the subtitle belongs to. (required) + * @param uploadSubtitleDto The request body. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse uploadSubtitleWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UploadSubtitleDto uploadSubtitleDto) throws ApiException { + return uploadSubtitleWithHttpInfo(itemId, uploadSubtitleDto, null); + } + + /** + * Upload an external subtitle file. + * + * @param itemId The item the subtitle belongs to. (required) + * @param uploadSubtitleDto The request body. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse uploadSubtitleWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UploadSubtitleDto uploadSubtitleDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uploadSubtitleRequestBuilder(itemId, uploadSubtitleDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("uploadSubtitle", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uploadSubtitleRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable UploadSubtitleDto uploadSubtitleDto, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling uploadSubtitle"); + } + // verify the required parameter 'uploadSubtitleDto' is set + if (uploadSubtitleDto == null) { + throw new ApiException(400, + "Missing the required parameter 'uploadSubtitleDto' when calling uploadSubtitle"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/Subtitles".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(uploadSubtitleDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SuggestionsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SuggestionsApi.java new file mode 100644 index 0000000000000..c00eba3b91605 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SuggestionsApi.java @@ -0,0 +1,325 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemKind; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SuggestionsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public SuggestionsApi() { + this(Configuration.getDefaultApiClient()); + } + + public SuggestionsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets suggestions. + * + * @param userId The user id. (required) + * @param mediaType The media types. (optional) + * @param type The type. (optional) + * @param startIndex Optional. The start index. (optional) + * @param limit Optional. The limit. (optional) + * @param enableTotalRecordCount Whether to enable the total record count. (optional, default to false) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSuggestions(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull List mediaType, + @org.eclipse.jdt.annotation.NonNull List type, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getSuggestions(userId, mediaType, type, startIndex, limit, enableTotalRecordCount, null); + } + + /** + * Gets suggestions. + * + * @param userId The user id. (required) + * @param mediaType The media types. (optional) + * @param type The type. (optional) + * @param startIndex Optional. The start index. (optional) + * @param limit Optional. The limit. (optional) + * @param enableTotalRecordCount Whether to enable the total record count. (optional, default to false) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSuggestions(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull List mediaType, + @org.eclipse.jdt.annotation.NonNull List type, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + ApiResponse localVarResponse = getSuggestionsWithHttpInfo(userId, mediaType, type, + startIndex, limit, enableTotalRecordCount, headers); + return localVarResponse.getData(); + } + + /** + * Gets suggestions. + * + * @param userId The user id. (required) + * @param mediaType The media types. (optional) + * @param type The type. (optional) + * @param startIndex Optional. The start index. (optional) + * @param limit Optional. The limit. (optional) + * @param enableTotalRecordCount Whether to enable the total record count. (optional, default to false) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSuggestionsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull List mediaType, + @org.eclipse.jdt.annotation.NonNull List type, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) throws ApiException { + return getSuggestionsWithHttpInfo(userId, mediaType, type, startIndex, limit, enableTotalRecordCount, null); + } + + /** + * Gets suggestions. + * + * @param userId The user id. (required) + * @param mediaType The media types. (optional) + * @param type The type. (optional) + * @param startIndex Optional. The start index. (optional) + * @param limit Optional. The limit. (optional) + * @param enableTotalRecordCount Whether to enable the total record count. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSuggestionsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull List mediaType, + @org.eclipse.jdt.annotation.NonNull List type, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSuggestionsRequestBuilder(userId, mediaType, type, startIndex, + limit, enableTotalRecordCount, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSuggestions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSuggestionsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull List mediaType, + @org.eclipse.jdt.annotation.NonNull List type, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, Map headers) + throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getSuggestions"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Suggestions".replace("{userId}", ApiClient.urlEncode(userId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "mediaType"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaType", mediaType)); + localVarQueryParameterBaseName = "type"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "type", type)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SyncPlayApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SyncPlayApi.java new file mode 100644 index 0000000000000..6ad8c96b9945d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SyncPlayApi.java @@ -0,0 +1,2344 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BufferRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.GroupInfoDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.IgnoreWaitRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.JoinGroupRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.MovePlaylistItemRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.NewGroupRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.NextItemRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PingRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PlayRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PreviousItemRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.QueueRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ReadyRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.RemoveFromPlaylistRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SeekRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SetPlaylistItemRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SetRepeatModeRequestDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SetShuffleModeRequestDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SyncPlayApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public SyncPlayApi() { + this(Configuration.getDefaultApiClient()); + } + + public SyncPlayApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Notify SyncPlay group that member is buffering. + * + * @param bufferRequestDto The player status. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayBuffering(@org.eclipse.jdt.annotation.Nullable BufferRequestDto bufferRequestDto) + throws ApiException { + syncPlayBuffering(bufferRequestDto, null); + } + + /** + * Notify SyncPlay group that member is buffering. + * + * @param bufferRequestDto The player status. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayBuffering(@org.eclipse.jdt.annotation.Nullable BufferRequestDto bufferRequestDto, + Map headers) throws ApiException { + syncPlayBufferingWithHttpInfo(bufferRequestDto, headers); + } + + /** + * Notify SyncPlay group that member is buffering. + * + * @param bufferRequestDto The player status. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayBufferingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable BufferRequestDto bufferRequestDto) throws ApiException { + return syncPlayBufferingWithHttpInfo(bufferRequestDto, null); + } + + /** + * Notify SyncPlay group that member is buffering. + * + * @param bufferRequestDto The player status. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayBufferingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable BufferRequestDto bufferRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayBufferingRequestBuilder(bufferRequestDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayBuffering", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayBufferingRequestBuilder( + @org.eclipse.jdt.annotation.Nullable BufferRequestDto bufferRequestDto, Map headers) + throws ApiException { + // verify the required parameter 'bufferRequestDto' is set + if (bufferRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'bufferRequestDto' when calling syncPlayBuffering"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Buffering"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(bufferRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a new SyncPlay group. + * + * @param newGroupRequestDto The settings of the new group. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayCreateGroup(@org.eclipse.jdt.annotation.Nullable NewGroupRequestDto newGroupRequestDto) + throws ApiException { + syncPlayCreateGroup(newGroupRequestDto, null); + } + + /** + * Create a new SyncPlay group. + * + * @param newGroupRequestDto The settings of the new group. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayCreateGroup(@org.eclipse.jdt.annotation.Nullable NewGroupRequestDto newGroupRequestDto, + Map headers) throws ApiException { + syncPlayCreateGroupWithHttpInfo(newGroupRequestDto, headers); + } + + /** + * Create a new SyncPlay group. + * + * @param newGroupRequestDto The settings of the new group. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayCreateGroupWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable NewGroupRequestDto newGroupRequestDto) throws ApiException { + return syncPlayCreateGroupWithHttpInfo(newGroupRequestDto, null); + } + + /** + * Create a new SyncPlay group. + * + * @param newGroupRequestDto The settings of the new group. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayCreateGroupWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable NewGroupRequestDto newGroupRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayCreateGroupRequestBuilder(newGroupRequestDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayCreateGroup", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayCreateGroupRequestBuilder( + @org.eclipse.jdt.annotation.Nullable NewGroupRequestDto newGroupRequestDto, Map headers) + throws ApiException { + // verify the required parameter 'newGroupRequestDto' is set + if (newGroupRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'newGroupRequestDto' when calling syncPlayCreateGroup"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/New"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(newGroupRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets all SyncPlay groups. + * + * @return List<GroupInfoDto> + * @throws ApiException if fails to make API call + */ + public List syncPlayGetGroups() throws ApiException { + return syncPlayGetGroups(null); + } + + /** + * Gets all SyncPlay groups. + * + * @param headers Optional headers to include in the request + * @return List<GroupInfoDto> + * @throws ApiException if fails to make API call + */ + public List syncPlayGetGroups(Map headers) throws ApiException { + ApiResponse> localVarResponse = syncPlayGetGroupsWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets all SyncPlay groups. + * + * @return ApiResponse<List<GroupInfoDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> syncPlayGetGroupsWithHttpInfo() throws ApiException { + return syncPlayGetGroupsWithHttpInfo(null); + } + + /** + * Gets all SyncPlay groups. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<GroupInfoDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> syncPlayGetGroupsWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayGetGroupsRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayGetGroups", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayGetGroupsRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/List"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Join an existing SyncPlay group. + * + * @param joinGroupRequestDto The group to join. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayJoinGroup(@org.eclipse.jdt.annotation.Nullable JoinGroupRequestDto joinGroupRequestDto) + throws ApiException { + syncPlayJoinGroup(joinGroupRequestDto, null); + } + + /** + * Join an existing SyncPlay group. + * + * @param joinGroupRequestDto The group to join. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayJoinGroup(@org.eclipse.jdt.annotation.Nullable JoinGroupRequestDto joinGroupRequestDto, + Map headers) throws ApiException { + syncPlayJoinGroupWithHttpInfo(joinGroupRequestDto, headers); + } + + /** + * Join an existing SyncPlay group. + * + * @param joinGroupRequestDto The group to join. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayJoinGroupWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable JoinGroupRequestDto joinGroupRequestDto) throws ApiException { + return syncPlayJoinGroupWithHttpInfo(joinGroupRequestDto, null); + } + + /** + * Join an existing SyncPlay group. + * + * @param joinGroupRequestDto The group to join. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayJoinGroupWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable JoinGroupRequestDto joinGroupRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayJoinGroupRequestBuilder(joinGroupRequestDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayJoinGroup", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayJoinGroupRequestBuilder( + @org.eclipse.jdt.annotation.Nullable JoinGroupRequestDto joinGroupRequestDto, Map headers) + throws ApiException { + // verify the required parameter 'joinGroupRequestDto' is set + if (joinGroupRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'joinGroupRequestDto' when calling syncPlayJoinGroup"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Join"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(joinGroupRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Leave the joined SyncPlay group. + * + * @throws ApiException if fails to make API call + */ + public void syncPlayLeaveGroup() throws ApiException { + syncPlayLeaveGroup(null); + } + + /** + * Leave the joined SyncPlay group. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayLeaveGroup(Map headers) throws ApiException { + syncPlayLeaveGroupWithHttpInfo(headers); + } + + /** + * Leave the joined SyncPlay group. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayLeaveGroupWithHttpInfo() throws ApiException { + return syncPlayLeaveGroupWithHttpInfo(null); + } + + /** + * Leave the joined SyncPlay group. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayLeaveGroupWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayLeaveGroupRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayLeaveGroup", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayLeaveGroupRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Leave"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request to move an item in the playlist in SyncPlay group. + * + * @param movePlaylistItemRequestDto The new position for the item. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayMovePlaylistItem( + @org.eclipse.jdt.annotation.Nullable MovePlaylistItemRequestDto movePlaylistItemRequestDto) + throws ApiException { + syncPlayMovePlaylistItem(movePlaylistItemRequestDto, null); + } + + /** + * Request to move an item in the playlist in SyncPlay group. + * + * @param movePlaylistItemRequestDto The new position for the item. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayMovePlaylistItem( + @org.eclipse.jdt.annotation.Nullable MovePlaylistItemRequestDto movePlaylistItemRequestDto, + Map headers) throws ApiException { + syncPlayMovePlaylistItemWithHttpInfo(movePlaylistItemRequestDto, headers); + } + + /** + * Request to move an item in the playlist in SyncPlay group. + * + * @param movePlaylistItemRequestDto The new position for the item. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayMovePlaylistItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MovePlaylistItemRequestDto movePlaylistItemRequestDto) + throws ApiException { + return syncPlayMovePlaylistItemWithHttpInfo(movePlaylistItemRequestDto, null); + } + + /** + * Request to move an item in the playlist in SyncPlay group. + * + * @param movePlaylistItemRequestDto The new position for the item. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayMovePlaylistItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable MovePlaylistItemRequestDto movePlaylistItemRequestDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayMovePlaylistItemRequestBuilder(movePlaylistItemRequestDto, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayMovePlaylistItem", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayMovePlaylistItemRequestBuilder( + @org.eclipse.jdt.annotation.Nullable MovePlaylistItemRequestDto movePlaylistItemRequestDto, + Map headers) throws ApiException { + // verify the required parameter 'movePlaylistItemRequestDto' is set + if (movePlaylistItemRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'movePlaylistItemRequestDto' when calling syncPlayMovePlaylistItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/MovePlaylistItem"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(movePlaylistItemRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request next item in SyncPlay group. + * + * @param nextItemRequestDto The current item information. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayNextItem(@org.eclipse.jdt.annotation.Nullable NextItemRequestDto nextItemRequestDto) + throws ApiException { + syncPlayNextItem(nextItemRequestDto, null); + } + + /** + * Request next item in SyncPlay group. + * + * @param nextItemRequestDto The current item information. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayNextItem(@org.eclipse.jdt.annotation.Nullable NextItemRequestDto nextItemRequestDto, + Map headers) throws ApiException { + syncPlayNextItemWithHttpInfo(nextItemRequestDto, headers); + } + + /** + * Request next item in SyncPlay group. + * + * @param nextItemRequestDto The current item information. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayNextItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable NextItemRequestDto nextItemRequestDto) throws ApiException { + return syncPlayNextItemWithHttpInfo(nextItemRequestDto, null); + } + + /** + * Request next item in SyncPlay group. + * + * @param nextItemRequestDto The current item information. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayNextItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable NextItemRequestDto nextItemRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayNextItemRequestBuilder(nextItemRequestDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayNextItem", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayNextItemRequestBuilder( + @org.eclipse.jdt.annotation.Nullable NextItemRequestDto nextItemRequestDto, Map headers) + throws ApiException { + // verify the required parameter 'nextItemRequestDto' is set + if (nextItemRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'nextItemRequestDto' when calling syncPlayNextItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/NextItem"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(nextItemRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request pause in SyncPlay group. + * + * @throws ApiException if fails to make API call + */ + public void syncPlayPause() throws ApiException { + syncPlayPause(null); + } + + /** + * Request pause in SyncPlay group. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayPause(Map headers) throws ApiException { + syncPlayPauseWithHttpInfo(headers); + } + + /** + * Request pause in SyncPlay group. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayPauseWithHttpInfo() throws ApiException { + return syncPlayPauseWithHttpInfo(null); + } + + /** + * Request pause in SyncPlay group. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayPauseWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayPauseRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayPause", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayPauseRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Pause"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update session ping. + * + * @param pingRequestDto The new ping. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayPing(@org.eclipse.jdt.annotation.Nullable PingRequestDto pingRequestDto) throws ApiException { + syncPlayPing(pingRequestDto, null); + } + + /** + * Update session ping. + * + * @param pingRequestDto The new ping. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayPing(@org.eclipse.jdt.annotation.Nullable PingRequestDto pingRequestDto, + Map headers) throws ApiException { + syncPlayPingWithHttpInfo(pingRequestDto, headers); + } + + /** + * Update session ping. + * + * @param pingRequestDto The new ping. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayPingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable PingRequestDto pingRequestDto) throws ApiException { + return syncPlayPingWithHttpInfo(pingRequestDto, null); + } + + /** + * Update session ping. + * + * @param pingRequestDto The new ping. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayPingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable PingRequestDto pingRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayPingRequestBuilder(pingRequestDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayPing", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayPingRequestBuilder( + @org.eclipse.jdt.annotation.Nullable PingRequestDto pingRequestDto, Map headers) + throws ApiException { + // verify the required parameter 'pingRequestDto' is set + if (pingRequestDto == null) { + throw new ApiException(400, "Missing the required parameter 'pingRequestDto' when calling syncPlayPing"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Ping"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(pingRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request previous item in SyncPlay group. + * + * @param previousItemRequestDto The current item information. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayPreviousItem(@org.eclipse.jdt.annotation.Nullable PreviousItemRequestDto previousItemRequestDto) + throws ApiException { + syncPlayPreviousItem(previousItemRequestDto, null); + } + + /** + * Request previous item in SyncPlay group. + * + * @param previousItemRequestDto The current item information. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayPreviousItem(@org.eclipse.jdt.annotation.Nullable PreviousItemRequestDto previousItemRequestDto, + Map headers) throws ApiException { + syncPlayPreviousItemWithHttpInfo(previousItemRequestDto, headers); + } + + /** + * Request previous item in SyncPlay group. + * + * @param previousItemRequestDto The current item information. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayPreviousItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable PreviousItemRequestDto previousItemRequestDto) throws ApiException { + return syncPlayPreviousItemWithHttpInfo(previousItemRequestDto, null); + } + + /** + * Request previous item in SyncPlay group. + * + * @param previousItemRequestDto The current item information. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayPreviousItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable PreviousItemRequestDto previousItemRequestDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayPreviousItemRequestBuilder(previousItemRequestDto, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayPreviousItem", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayPreviousItemRequestBuilder( + @org.eclipse.jdt.annotation.Nullable PreviousItemRequestDto previousItemRequestDto, + Map headers) throws ApiException { + // verify the required parameter 'previousItemRequestDto' is set + if (previousItemRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'previousItemRequestDto' when calling syncPlayPreviousItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/PreviousItem"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(previousItemRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request to queue items to the playlist of a SyncPlay group. + * + * @param queueRequestDto The items to add. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayQueue(@org.eclipse.jdt.annotation.Nullable QueueRequestDto queueRequestDto) + throws ApiException { + syncPlayQueue(queueRequestDto, null); + } + + /** + * Request to queue items to the playlist of a SyncPlay group. + * + * @param queueRequestDto The items to add. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayQueue(@org.eclipse.jdt.annotation.Nullable QueueRequestDto queueRequestDto, + Map headers) throws ApiException { + syncPlayQueueWithHttpInfo(queueRequestDto, headers); + } + + /** + * Request to queue items to the playlist of a SyncPlay group. + * + * @param queueRequestDto The items to add. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayQueueWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable QueueRequestDto queueRequestDto) throws ApiException { + return syncPlayQueueWithHttpInfo(queueRequestDto, null); + } + + /** + * Request to queue items to the playlist of a SyncPlay group. + * + * @param queueRequestDto The items to add. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayQueueWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable QueueRequestDto queueRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayQueueRequestBuilder(queueRequestDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayQueue", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayQueueRequestBuilder( + @org.eclipse.jdt.annotation.Nullable QueueRequestDto queueRequestDto, Map headers) + throws ApiException { + // verify the required parameter 'queueRequestDto' is set + if (queueRequestDto == null) { + throw new ApiException(400, "Missing the required parameter 'queueRequestDto' when calling syncPlayQueue"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Queue"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(queueRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Notify SyncPlay group that member is ready for playback. + * + * @param readyRequestDto The player status. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayReady(@org.eclipse.jdt.annotation.Nullable ReadyRequestDto readyRequestDto) + throws ApiException { + syncPlayReady(readyRequestDto, null); + } + + /** + * Notify SyncPlay group that member is ready for playback. + * + * @param readyRequestDto The player status. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayReady(@org.eclipse.jdt.annotation.Nullable ReadyRequestDto readyRequestDto, + Map headers) throws ApiException { + syncPlayReadyWithHttpInfo(readyRequestDto, headers); + } + + /** + * Notify SyncPlay group that member is ready for playback. + * + * @param readyRequestDto The player status. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayReadyWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ReadyRequestDto readyRequestDto) throws ApiException { + return syncPlayReadyWithHttpInfo(readyRequestDto, null); + } + + /** + * Notify SyncPlay group that member is ready for playback. + * + * @param readyRequestDto The player status. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayReadyWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ReadyRequestDto readyRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayReadyRequestBuilder(readyRequestDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayReady", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayReadyRequestBuilder( + @org.eclipse.jdt.annotation.Nullable ReadyRequestDto readyRequestDto, Map headers) + throws ApiException { + // verify the required parameter 'readyRequestDto' is set + if (readyRequestDto == null) { + throw new ApiException(400, "Missing the required parameter 'readyRequestDto' when calling syncPlayReady"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Ready"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(readyRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request to remove items from the playlist in SyncPlay group. + * + * @param removeFromPlaylistRequestDto The items to remove. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlayRemoveFromPlaylist( + @org.eclipse.jdt.annotation.Nullable RemoveFromPlaylistRequestDto removeFromPlaylistRequestDto) + throws ApiException { + syncPlayRemoveFromPlaylist(removeFromPlaylistRequestDto, null); + } + + /** + * Request to remove items from the playlist in SyncPlay group. + * + * @param removeFromPlaylistRequestDto The items to remove. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayRemoveFromPlaylist( + @org.eclipse.jdt.annotation.Nullable RemoveFromPlaylistRequestDto removeFromPlaylistRequestDto, + Map headers) throws ApiException { + syncPlayRemoveFromPlaylistWithHttpInfo(removeFromPlaylistRequestDto, headers); + } + + /** + * Request to remove items from the playlist in SyncPlay group. + * + * @param removeFromPlaylistRequestDto The items to remove. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayRemoveFromPlaylistWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable RemoveFromPlaylistRequestDto removeFromPlaylistRequestDto) + throws ApiException { + return syncPlayRemoveFromPlaylistWithHttpInfo(removeFromPlaylistRequestDto, null); + } + + /** + * Request to remove items from the playlist in SyncPlay group. + * + * @param removeFromPlaylistRequestDto The items to remove. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayRemoveFromPlaylistWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable RemoveFromPlaylistRequestDto removeFromPlaylistRequestDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayRemoveFromPlaylistRequestBuilder( + removeFromPlaylistRequestDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayRemoveFromPlaylist", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayRemoveFromPlaylistRequestBuilder( + @org.eclipse.jdt.annotation.Nullable RemoveFromPlaylistRequestDto removeFromPlaylistRequestDto, + Map headers) throws ApiException { + // verify the required parameter 'removeFromPlaylistRequestDto' is set + if (removeFromPlaylistRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'removeFromPlaylistRequestDto' when calling syncPlayRemoveFromPlaylist"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/RemoveFromPlaylist"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(removeFromPlaylistRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request seek in SyncPlay group. + * + * @param seekRequestDto The new playback position. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlaySeek(@org.eclipse.jdt.annotation.Nullable SeekRequestDto seekRequestDto) throws ApiException { + syncPlaySeek(seekRequestDto, null); + } + + /** + * Request seek in SyncPlay group. + * + * @param seekRequestDto The new playback position. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlaySeek(@org.eclipse.jdt.annotation.Nullable SeekRequestDto seekRequestDto, + Map headers) throws ApiException { + syncPlaySeekWithHttpInfo(seekRequestDto, headers); + } + + /** + * Request seek in SyncPlay group. + * + * @param seekRequestDto The new playback position. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySeekWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SeekRequestDto seekRequestDto) throws ApiException { + return syncPlaySeekWithHttpInfo(seekRequestDto, null); + } + + /** + * Request seek in SyncPlay group. + * + * @param seekRequestDto The new playback position. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySeekWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SeekRequestDto seekRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySeekRequestBuilder(seekRequestDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlaySeek", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlaySeekRequestBuilder( + @org.eclipse.jdt.annotation.Nullable SeekRequestDto seekRequestDto, Map headers) + throws ApiException { + // verify the required parameter 'seekRequestDto' is set + if (seekRequestDto == null) { + throw new ApiException(400, "Missing the required parameter 'seekRequestDto' when calling syncPlaySeek"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Seek"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(seekRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request SyncPlay group to ignore member during group-wait. + * + * @param ignoreWaitRequestDto The settings to set. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlaySetIgnoreWait(@org.eclipse.jdt.annotation.Nullable IgnoreWaitRequestDto ignoreWaitRequestDto) + throws ApiException { + syncPlaySetIgnoreWait(ignoreWaitRequestDto, null); + } + + /** + * Request SyncPlay group to ignore member during group-wait. + * + * @param ignoreWaitRequestDto The settings to set. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlaySetIgnoreWait(@org.eclipse.jdt.annotation.Nullable IgnoreWaitRequestDto ignoreWaitRequestDto, + Map headers) throws ApiException { + syncPlaySetIgnoreWaitWithHttpInfo(ignoreWaitRequestDto, headers); + } + + /** + * Request SyncPlay group to ignore member during group-wait. + * + * @param ignoreWaitRequestDto The settings to set. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetIgnoreWaitWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable IgnoreWaitRequestDto ignoreWaitRequestDto) throws ApiException { + return syncPlaySetIgnoreWaitWithHttpInfo(ignoreWaitRequestDto, null); + } + + /** + * Request SyncPlay group to ignore member during group-wait. + * + * @param ignoreWaitRequestDto The settings to set. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetIgnoreWaitWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable IgnoreWaitRequestDto ignoreWaitRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySetIgnoreWaitRequestBuilder(ignoreWaitRequestDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlaySetIgnoreWait", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlaySetIgnoreWaitRequestBuilder( + @org.eclipse.jdt.annotation.Nullable IgnoreWaitRequestDto ignoreWaitRequestDto, Map headers) + throws ApiException { + // verify the required parameter 'ignoreWaitRequestDto' is set + if (ignoreWaitRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'ignoreWaitRequestDto' when calling syncPlaySetIgnoreWait"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/SetIgnoreWait"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(ignoreWaitRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request to set new playlist in SyncPlay group. + * + * @param playRequestDto The new playlist to play in the group. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlaySetNewQueue(@org.eclipse.jdt.annotation.Nullable PlayRequestDto playRequestDto) + throws ApiException { + syncPlaySetNewQueue(playRequestDto, null); + } + + /** + * Request to set new playlist in SyncPlay group. + * + * @param playRequestDto The new playlist to play in the group. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlaySetNewQueue(@org.eclipse.jdt.annotation.Nullable PlayRequestDto playRequestDto, + Map headers) throws ApiException { + syncPlaySetNewQueueWithHttpInfo(playRequestDto, headers); + } + + /** + * Request to set new playlist in SyncPlay group. + * + * @param playRequestDto The new playlist to play in the group. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetNewQueueWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable PlayRequestDto playRequestDto) throws ApiException { + return syncPlaySetNewQueueWithHttpInfo(playRequestDto, null); + } + + /** + * Request to set new playlist in SyncPlay group. + * + * @param playRequestDto The new playlist to play in the group. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetNewQueueWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable PlayRequestDto playRequestDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySetNewQueueRequestBuilder(playRequestDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlaySetNewQueue", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlaySetNewQueueRequestBuilder( + @org.eclipse.jdt.annotation.Nullable PlayRequestDto playRequestDto, Map headers) + throws ApiException { + // verify the required parameter 'playRequestDto' is set + if (playRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'playRequestDto' when calling syncPlaySetNewQueue"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/SetNewQueue"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(playRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request to change playlist item in SyncPlay group. + * + * @param setPlaylistItemRequestDto The new item to play. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlaySetPlaylistItem( + @org.eclipse.jdt.annotation.Nullable SetPlaylistItemRequestDto setPlaylistItemRequestDto) + throws ApiException { + syncPlaySetPlaylistItem(setPlaylistItemRequestDto, null); + } + + /** + * Request to change playlist item in SyncPlay group. + * + * @param setPlaylistItemRequestDto The new item to play. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlaySetPlaylistItem( + @org.eclipse.jdt.annotation.Nullable SetPlaylistItemRequestDto setPlaylistItemRequestDto, + Map headers) throws ApiException { + syncPlaySetPlaylistItemWithHttpInfo(setPlaylistItemRequestDto, headers); + } + + /** + * Request to change playlist item in SyncPlay group. + * + * @param setPlaylistItemRequestDto The new item to play. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetPlaylistItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SetPlaylistItemRequestDto setPlaylistItemRequestDto) + throws ApiException { + return syncPlaySetPlaylistItemWithHttpInfo(setPlaylistItemRequestDto, null); + } + + /** + * Request to change playlist item in SyncPlay group. + * + * @param setPlaylistItemRequestDto The new item to play. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetPlaylistItemWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SetPlaylistItemRequestDto setPlaylistItemRequestDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySetPlaylistItemRequestBuilder(setPlaylistItemRequestDto, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlaySetPlaylistItem", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlaySetPlaylistItemRequestBuilder( + @org.eclipse.jdt.annotation.Nullable SetPlaylistItemRequestDto setPlaylistItemRequestDto, + Map headers) throws ApiException { + // verify the required parameter 'setPlaylistItemRequestDto' is set + if (setPlaylistItemRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'setPlaylistItemRequestDto' when calling syncPlaySetPlaylistItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/SetPlaylistItem"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(setPlaylistItemRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request to set repeat mode in SyncPlay group. + * + * @param setRepeatModeRequestDto The new repeat mode. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlaySetRepeatMode( + @org.eclipse.jdt.annotation.Nullable SetRepeatModeRequestDto setRepeatModeRequestDto) throws ApiException { + syncPlaySetRepeatMode(setRepeatModeRequestDto, null); + } + + /** + * Request to set repeat mode in SyncPlay group. + * + * @param setRepeatModeRequestDto The new repeat mode. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlaySetRepeatMode( + @org.eclipse.jdt.annotation.Nullable SetRepeatModeRequestDto setRepeatModeRequestDto, + Map headers) throws ApiException { + syncPlaySetRepeatModeWithHttpInfo(setRepeatModeRequestDto, headers); + } + + /** + * Request to set repeat mode in SyncPlay group. + * + * @param setRepeatModeRequestDto The new repeat mode. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetRepeatModeWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SetRepeatModeRequestDto setRepeatModeRequestDto) throws ApiException { + return syncPlaySetRepeatModeWithHttpInfo(setRepeatModeRequestDto, null); + } + + /** + * Request to set repeat mode in SyncPlay group. + * + * @param setRepeatModeRequestDto The new repeat mode. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetRepeatModeWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SetRepeatModeRequestDto setRepeatModeRequestDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySetRepeatModeRequestBuilder(setRepeatModeRequestDto, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlaySetRepeatMode", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlaySetRepeatModeRequestBuilder( + @org.eclipse.jdt.annotation.Nullable SetRepeatModeRequestDto setRepeatModeRequestDto, + Map headers) throws ApiException { + // verify the required parameter 'setRepeatModeRequestDto' is set + if (setRepeatModeRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'setRepeatModeRequestDto' when calling syncPlaySetRepeatMode"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/SetRepeatMode"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(setRepeatModeRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request to set shuffle mode in SyncPlay group. + * + * @param setShuffleModeRequestDto The new shuffle mode. (required) + * @throws ApiException if fails to make API call + */ + public void syncPlaySetShuffleMode( + @org.eclipse.jdt.annotation.Nullable SetShuffleModeRequestDto setShuffleModeRequestDto) + throws ApiException { + syncPlaySetShuffleMode(setShuffleModeRequestDto, null); + } + + /** + * Request to set shuffle mode in SyncPlay group. + * + * @param setShuffleModeRequestDto The new shuffle mode. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlaySetShuffleMode( + @org.eclipse.jdt.annotation.Nullable SetShuffleModeRequestDto setShuffleModeRequestDto, + Map headers) throws ApiException { + syncPlaySetShuffleModeWithHttpInfo(setShuffleModeRequestDto, headers); + } + + /** + * Request to set shuffle mode in SyncPlay group. + * + * @param setShuffleModeRequestDto The new shuffle mode. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetShuffleModeWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SetShuffleModeRequestDto setShuffleModeRequestDto) + throws ApiException { + return syncPlaySetShuffleModeWithHttpInfo(setShuffleModeRequestDto, null); + } + + /** + * Request to set shuffle mode in SyncPlay group. + * + * @param setShuffleModeRequestDto The new shuffle mode. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlaySetShuffleModeWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable SetShuffleModeRequestDto setShuffleModeRequestDto, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlaySetShuffleModeRequestBuilder(setShuffleModeRequestDto, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlaySetShuffleMode", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlaySetShuffleModeRequestBuilder( + @org.eclipse.jdt.annotation.Nullable SetShuffleModeRequestDto setShuffleModeRequestDto, + Map headers) throws ApiException { + // verify the required parameter 'setShuffleModeRequestDto' is set + if (setShuffleModeRequestDto == null) { + throw new ApiException(400, + "Missing the required parameter 'setShuffleModeRequestDto' when calling syncPlaySetShuffleMode"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/SetShuffleMode"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(setShuffleModeRequestDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request stop in SyncPlay group. + * + * @throws ApiException if fails to make API call + */ + public void syncPlayStop() throws ApiException { + syncPlayStop(null); + } + + /** + * Request stop in SyncPlay group. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayStop(Map headers) throws ApiException { + syncPlayStopWithHttpInfo(headers); + } + + /** + * Request stop in SyncPlay group. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayStopWithHttpInfo() throws ApiException { + return syncPlayStopWithHttpInfo(null); + } + + /** + * Request stop in SyncPlay group. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayStopWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayStopRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayStop", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayStopRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Stop"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Request unpause in SyncPlay group. + * + * @throws ApiException if fails to make API call + */ + public void syncPlayUnpause() throws ApiException { + syncPlayUnpause(null); + } + + /** + * Request unpause in SyncPlay group. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void syncPlayUnpause(Map headers) throws ApiException { + syncPlayUnpauseWithHttpInfo(headers); + } + + /** + * Request unpause in SyncPlay group. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayUnpauseWithHttpInfo() throws ApiException { + return syncPlayUnpauseWithHttpInfo(null); + } + + /** + * Request unpause in SyncPlay group. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse syncPlayUnpauseWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = syncPlayUnpauseRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("syncPlayUnpause", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder syncPlayUnpauseRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/SyncPlay/Unpause"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SystemApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SystemApi.java new file mode 100644 index 0000000000000..4d85a31c63727 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/SystemApi.java @@ -0,0 +1,1140 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.EndPointInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.LogFile; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PublicSystemInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SystemInfo; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.WakeOnLanInfo; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SystemApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public SystemApi() { + this(Configuration.getDefaultApiClient()); + } + + public SystemApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets information about the request endpoint. + * + * @return EndPointInfo + * @throws ApiException if fails to make API call + */ + public EndPointInfo getEndpointInfo() throws ApiException { + return getEndpointInfo(null); + } + + /** + * Gets information about the request endpoint. + * + * @param headers Optional headers to include in the request + * @return EndPointInfo + * @throws ApiException if fails to make API call + */ + public EndPointInfo getEndpointInfo(Map headers) throws ApiException { + ApiResponse localVarResponse = getEndpointInfoWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets information about the request endpoint. + * + * @return ApiResponse<EndPointInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEndpointInfoWithHttpInfo() throws ApiException { + return getEndpointInfoWithHttpInfo(null); + } + + /** + * Gets information about the request endpoint. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<EndPointInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEndpointInfoWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getEndpointInfoRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getEndpointInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + EndPointInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getEndpointInfoRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Endpoint"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a log file. + * + * @param name The name of the log file to get. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getLogFile(@org.eclipse.jdt.annotation.Nullable String name) throws ApiException { + return getLogFile(name, null); + } + + /** + * Gets a log file. + * + * @param name The name of the log file to get. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getLogFile(@org.eclipse.jdt.annotation.Nullable String name, Map headers) + throws ApiException { + ApiResponse localVarResponse = getLogFileWithHttpInfo(name, headers); + return localVarResponse.getData(); + } + + /** + * Gets a log file. + * + * @param name The name of the log file to get. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLogFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name) + throws ApiException { + return getLogFileWithHttpInfo(name, null); + } + + /** + * Gets a log file. + * + * @param name The name of the log file to get. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLogFileWithHttpInfo(@org.eclipse.jdt.annotation.Nullable String name, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLogFileRequestBuilder(name, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLogFile", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLogFileRequestBuilder(@org.eclipse.jdt.annotation.Nullable String name, + Map headers) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling getLogFile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Logs/Log"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "name"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "text/plain"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Pings the system. + * + * @return String + * @throws ApiException if fails to make API call + */ + public String getPingSystem() throws ApiException { + return getPingSystem(null); + } + + /** + * Pings the system. + * + * @param headers Optional headers to include in the request + * @return String + * @throws ApiException if fails to make API call + */ + public String getPingSystem(Map headers) throws ApiException { + ApiResponse localVarResponse = getPingSystemWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Pings the system. + * + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPingSystemWithHttpInfo() throws ApiException { + return getPingSystemWithHttpInfo(null); + } + + /** + * Pings the system. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPingSystemWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPingSystemRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPingSystem", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + String responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPingSystemRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Ping"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets public information about the server. + * + * @return PublicSystemInfo + * @throws ApiException if fails to make API call + */ + public PublicSystemInfo getPublicSystemInfo() throws ApiException { + return getPublicSystemInfo(null); + } + + /** + * Gets public information about the server. + * + * @param headers Optional headers to include in the request + * @return PublicSystemInfo + * @throws ApiException if fails to make API call + */ + public PublicSystemInfo getPublicSystemInfo(Map headers) throws ApiException { + ApiResponse localVarResponse = getPublicSystemInfoWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets public information about the server. + * + * @return ApiResponse<PublicSystemInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPublicSystemInfoWithHttpInfo() throws ApiException { + return getPublicSystemInfoWithHttpInfo(null); + } + + /** + * Gets public information about the server. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<PublicSystemInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPublicSystemInfoWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPublicSystemInfoRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPublicSystemInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + PublicSystemInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPublicSystemInfoRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Info/Public"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of available server log files. + * + * @return List<LogFile> + * @throws ApiException if fails to make API call + */ + public List getServerLogs() throws ApiException { + return getServerLogs(null); + } + + /** + * Gets a list of available server log files. + * + * @param headers Optional headers to include in the request + * @return List<LogFile> + * @throws ApiException if fails to make API call + */ + public List getServerLogs(Map headers) throws ApiException { + ApiResponse> localVarResponse = getServerLogsWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets a list of available server log files. + * + * @return ApiResponse<List<LogFile>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getServerLogsWithHttpInfo() throws ApiException { + return getServerLogsWithHttpInfo(null); + } + + /** + * Gets a list of available server log files. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<LogFile>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getServerLogsWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getServerLogsRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getServerLogs", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getServerLogsRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Logs"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets information about the server. + * + * @return SystemInfo + * @throws ApiException if fails to make API call + */ + public SystemInfo getSystemInfo() throws ApiException { + return getSystemInfo(null); + } + + /** + * Gets information about the server. + * + * @param headers Optional headers to include in the request + * @return SystemInfo + * @throws ApiException if fails to make API call + */ + public SystemInfo getSystemInfo(Map headers) throws ApiException { + ApiResponse localVarResponse = getSystemInfoWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets information about the server. + * + * @return ApiResponse<SystemInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSystemInfoWithHttpInfo() throws ApiException { + return getSystemInfoWithHttpInfo(null); + } + + /** + * Gets information about the server. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<SystemInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSystemInfoWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSystemInfoRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSystemInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + SystemInfo responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSystemInfoRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Info"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets wake on lan information. + * + * @return List<WakeOnLanInfo> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public List getWakeOnLanInfo() throws ApiException { + return getWakeOnLanInfo(null); + } + + /** + * Gets wake on lan information. + * + * @param headers Optional headers to include in the request + * @return List<WakeOnLanInfo> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public List getWakeOnLanInfo(Map headers) throws ApiException { + ApiResponse> localVarResponse = getWakeOnLanInfoWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets wake on lan information. + * + * @return ApiResponse<List<WakeOnLanInfo>> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse> getWakeOnLanInfoWithHttpInfo() throws ApiException { + return getWakeOnLanInfoWithHttpInfo(null); + } + + /** + * Gets wake on lan information. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<WakeOnLanInfo>> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse> getWakeOnLanInfoWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getWakeOnLanInfoRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getWakeOnLanInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getWakeOnLanInfoRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/WakeOnLanInfo"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Pings the system. + * + * @return String + * @throws ApiException if fails to make API call + */ + public String postPingSystem() throws ApiException { + return postPingSystem(null); + } + + /** + * Pings the system. + * + * @param headers Optional headers to include in the request + * @return String + * @throws ApiException if fails to make API call + */ + public String postPingSystem(Map headers) throws ApiException { + ApiResponse localVarResponse = postPingSystemWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Pings the system. + * + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse postPingSystemWithHttpInfo() throws ApiException { + return postPingSystemWithHttpInfo(null); + } + + /** + * Pings the system. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse postPingSystemWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = postPingSystemRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("postPingSystem", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + String responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder postPingSystemRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Ping"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Restarts the application. + * + * @throws ApiException if fails to make API call + */ + public void restartApplication() throws ApiException { + restartApplication(null); + } + + /** + * Restarts the application. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void restartApplication(Map headers) throws ApiException { + restartApplicationWithHttpInfo(headers); + } + + /** + * Restarts the application. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse restartApplicationWithHttpInfo() throws ApiException { + return restartApplicationWithHttpInfo(null); + } + + /** + * Restarts the application. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse restartApplicationWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = restartApplicationRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("restartApplication", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder restartApplicationRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Restart"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Shuts down the application. + * + * @throws ApiException if fails to make API call + */ + public void shutdownApplication() throws ApiException { + shutdownApplication(null); + } + + /** + * Shuts down the application. + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void shutdownApplication(Map headers) throws ApiException { + shutdownApplicationWithHttpInfo(headers); + } + + /** + * Shuts down the application. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse shutdownApplicationWithHttpInfo() throws ApiException { + return shutdownApplicationWithHttpInfo(null); + } + + /** + * Shuts down the application. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse shutdownApplicationWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = shutdownApplicationRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("shutdownApplication", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder shutdownApplicationRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/System/Shutdown"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/TimeSyncApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/TimeSyncApi.java new file mode 100644 index 0000000000000..7f6aaf10dab8c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/TimeSyncApi.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.Map; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.UtcTimeResponse; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TimeSyncApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public TimeSyncApi() { + this(Configuration.getDefaultApiClient()); + } + + public TimeSyncApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets the current UTC time. + * + * @return UtcTimeResponse + * @throws ApiException if fails to make API call + */ + public UtcTimeResponse getUtcTime() throws ApiException { + return getUtcTime(null); + } + + /** + * Gets the current UTC time. + * + * @param headers Optional headers to include in the request + * @return UtcTimeResponse + * @throws ApiException if fails to make API call + */ + public UtcTimeResponse getUtcTime(Map headers) throws ApiException { + ApiResponse localVarResponse = getUtcTimeWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets the current UTC time. + * + * @return ApiResponse<UtcTimeResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUtcTimeWithHttpInfo() throws ApiException { + return getUtcTimeWithHttpInfo(null); + } + + /** + * Gets the current UTC time. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<UtcTimeResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUtcTimeWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUtcTimeRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getUtcTime", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + UtcTimeResponse responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUtcTimeRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/GetUtcTime"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/TmdbApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/TmdbApi.java new file mode 100644 index 0000000000000..4b3ecc5db6bae --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/TmdbApi.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.Map; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ConfigImageTypes; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TmdbApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public TmdbApi() { + this(Configuration.getDefaultApiClient()); + } + + public TmdbApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets the TMDb image configuration options. + * + * @return ConfigImageTypes + * @throws ApiException if fails to make API call + */ + public ConfigImageTypes tmdbClientConfiguration() throws ApiException { + return tmdbClientConfiguration(null); + } + + /** + * Gets the TMDb image configuration options. + * + * @param headers Optional headers to include in the request + * @return ConfigImageTypes + * @throws ApiException if fails to make API call + */ + public ConfigImageTypes tmdbClientConfiguration(Map headers) throws ApiException { + ApiResponse localVarResponse = tmdbClientConfigurationWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets the TMDb image configuration options. + * + * @return ApiResponse<ConfigImageTypes> + * @throws ApiException if fails to make API call + */ + public ApiResponse tmdbClientConfigurationWithHttpInfo() throws ApiException { + return tmdbClientConfigurationWithHttpInfo(null); + } + + /** + * Gets the TMDb image configuration options. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<ConfigImageTypes> + * @throws ApiException if fails to make API call + */ + public ApiResponse tmdbClientConfigurationWithHttpInfo(Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = tmdbClientConfigurationRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("tmdbClientConfiguration", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + ConfigImageTypes responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder tmdbClientConfigurationRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Tmdb/ClientConfiguration"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/TrailersApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/TrailersApi.java new file mode 100644 index 0000000000000..1941d5dec56c8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/TrailersApi.java @@ -0,0 +1,1332 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFilter; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.LocationType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SeriesStatus; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SortOrder; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.VideoType; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TrailersApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public TrailersApi() { + this(Configuration.getDefaultApiClient()); + } + + public TrailersApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Finds movies and trailers similar to a given trailer. + * + * @param userId The user id. (optional) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an imdb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a tmdb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a tvdb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getTrailers(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getTrailers(userId, maxOfficialRating, hasThemeSong, hasThemeVideo, hasSubtitles, hasSpecialFeature, + hasTrailer, adjacentTo, parentIndexNumber, hasParentalRating, isHd, is4K, locationTypes, + excludeLocationTypes, isMissing, isUnaired, minCommunityRating, minCriticRating, minPremiereDate, + minDateLastSaved, minDateLastSavedForUser, maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, + hasTvdbId, isMovie, isSeries, isNews, isKids, isSports, excludeItemIds, startIndex, limit, recursive, + searchTerm, sortOrder, parentId, fields, excludeItemTypes, filters, isFavorite, mediaTypes, imageTypes, + sortBy, isPlayed, genres, officialRatings, tags, years, enableUserData, imageTypeLimit, + enableImageTypes, person, personIds, personTypes, studios, artists, excludeArtistIds, artistIds, + albumArtistIds, contributingArtistIds, albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, + isPlaceHolder, hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, + seriesStatus, nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, + enableTotalRecordCount, enableImages, null); + } + + /** + * Finds movies and trailers similar to a given trailer. + * + * @param userId The user id. (optional) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an imdb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a tmdb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a tvdb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getTrailers(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { + ApiResponse localVarResponse = getTrailersWithHttpInfo(userId, maxOfficialRating, + hasThemeSong, hasThemeVideo, hasSubtitles, hasSpecialFeature, hasTrailer, adjacentTo, parentIndexNumber, + hasParentalRating, isHd, is4K, locationTypes, excludeLocationTypes, isMissing, isUnaired, + minCommunityRating, minCriticRating, minPremiereDate, minDateLastSaved, minDateLastSavedForUser, + maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, hasTvdbId, isMovie, isSeries, isNews, isKids, + isSports, excludeItemIds, startIndex, limit, recursive, searchTerm, sortOrder, parentId, fields, + excludeItemTypes, filters, isFavorite, mediaTypes, imageTypes, sortBy, isPlayed, genres, + officialRatings, tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, personIds, + personTypes, studios, artists, excludeArtistIds, artistIds, albumArtistIds, contributingArtistIds, + albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, isPlaceHolder, hasOfficialRating, + collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, seriesStatus, + nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, enableTotalRecordCount, + enableImages, headers); + return localVarResponse.getData(); + } + + /** + * Finds movies and trailers similar to a given trailer. + * + * @param userId The user id. (optional) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an imdb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a tmdb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a tvdb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTrailersWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getTrailersWithHttpInfo(userId, maxOfficialRating, hasThemeSong, hasThemeVideo, hasSubtitles, + hasSpecialFeature, hasTrailer, adjacentTo, parentIndexNumber, hasParentalRating, isHd, is4K, + locationTypes, excludeLocationTypes, isMissing, isUnaired, minCommunityRating, minCriticRating, + minPremiereDate, minDateLastSaved, minDateLastSavedForUser, maxPremiereDate, hasOverview, hasImdbId, + hasTmdbId, hasTvdbId, isMovie, isSeries, isNews, isKids, isSports, excludeItemIds, startIndex, limit, + recursive, searchTerm, sortOrder, parentId, fields, excludeItemTypes, filters, isFavorite, mediaTypes, + imageTypes, sortBy, isPlayed, genres, officialRatings, tags, years, enableUserData, imageTypeLimit, + enableImageTypes, person, personIds, personTypes, studios, artists, excludeArtistIds, artistIds, + albumArtistIds, contributingArtistIds, albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, + isPlaceHolder, hasOfficialRating, collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, + seriesStatus, nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, + enableTotalRecordCount, enableImages, null); + } + + /** + * Finds movies and trailers similar to a given trailer. + * + * @param userId The user id. (optional) + * @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param hasThemeSong Optional filter by items with theme songs. (optional) + * @param hasThemeVideo Optional filter by items with theme videos. (optional) + * @param hasSubtitles Optional filter by items with subtitles. (optional) + * @param hasSpecialFeature Optional filter by items with special features. (optional) + * @param hasTrailer Optional filter by items with trailers. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param parentIndexNumber Optional filter by parent index number. (optional) + * @param hasParentalRating Optional filter by items that have or do not have a parental rating. (optional) + * @param isHd Optional filter by items that are HD or not. (optional) + * @param is4K Optional filter by items that are 4K or not. (optional) + * @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows + * multiple, comma delimited. (optional) + * @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This + * allows multiple, comma delimited. (optional) + * @param isMissing Optional filter by items that are missing episodes or not. (optional) + * @param isUnaired Optional filter by items that are unaired episodes or not. (optional) + * @param minCommunityRating Optional filter by minimum community rating. (optional) + * @param minCriticRating Optional filter by minimum critic rating. (optional) + * @param minPremiereDate Optional. The minimum premiere date. Format = ISO. (optional) + * @param minDateLastSaved Optional. The minimum last saved date. Format = ISO. (optional) + * @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format = ISO. + * (optional) + * @param maxPremiereDate Optional. The maximum premiere date. Format = ISO. (optional) + * @param hasOverview Optional filter by items that have an overview or not. (optional) + * @param hasImdbId Optional filter by items that have an imdb id or not. (optional) + * @param hasTmdbId Optional filter by items that have a tmdb id or not. (optional) + * @param hasTvdbId Optional filter by items that have a tvdb id or not. (optional) + * @param isMovie Optional filter for live tv movies. (optional) + * @param isSeries Optional filter for live tv series. (optional) + * @param isNews Optional filter for live tv news. (optional) + * @param isKids Optional filter for live tv kids. (optional) + * @param isSports Optional filter for live tv sports. (optional) + * @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows + * multiple, comma delimited. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param recursive When searching within folders, this determines whether or not the search will be recursive. + * true/false. (optional) + * @param searchTerm Optional. Filter based on a search term. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines. (optional) + * @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: + * IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. (optional) + * @param isFavorite Optional filter by items that are marked as favorite, or not. (optional) + * @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited. (optional) + * @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This + * allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param isPlayed Optional filter by items that are played, or not. (optional) + * @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe + * delimited. (optional) + * @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows + * multiple, pipe delimited. (optional) + * @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. + * (optional) + * @param years Optional. If specified, results will be filtered based on production year. This allows multiple, + * comma delimited. (optional) + * @param enableUserData Optional, include user data. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param person Optional. If specified, results will be filtered to include only those containing the specified + * person. (optional) + * @param personIds Optional. If specified, results will be filtered to include only those containing the specified + * person id. (optional) + * @param personTypes Optional. If specified, along with Person, results will be filtered to include only those + * containing the specified person and PersonType. Allows multiple, comma-delimited. (optional) + * @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe + * delimited. (optional) + * @param artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe + * delimited. (optional) + * @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows + * multiple, pipe delimited. (optional) + * @param artistIds Optional. If specified, results will be filtered to include only those containing the specified + * artist id. (optional) + * @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the + * specified album artist id. (optional) + * @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing + * the specified contributing artist id. (optional) + * @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe + * delimited. (optional) + * @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe + * delimited. (optional) + * @param ids Optional. If specific items are needed, specify a list of item id's to retrieve. This allows + * multiple, comma delimited. (optional) + * @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. + * (optional) + * @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). (optional) + * @param isLocked Optional filter by items that are locked. (optional) + * @param isPlaceHolder Optional filter by items that are placeholders. (optional) + * @param hasOfficialRating Optional filter by items that have official ratings. (optional) + * @param collapseBoxSetItems Whether or not to hide items behind their boxsets. (optional) + * @param minWidth Optional. Filter by the minimum width of the item. (optional) + * @param minHeight Optional. Filter by the minimum height of the item. (optional) + * @param maxWidth Optional. Filter by the maximum width of the item. (optional) + * @param maxHeight Optional. Filter by the maximum height of the item. (optional) + * @param is3D Optional filter by items that are 3D, or not. (optional) + * @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited. (optional) + * @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given + * input string. (optional) + * @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string. (optional) + * @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string. + * (optional) + * @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe + * delimited. (optional) + * @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe + * delimited. (optional) + * @param enableTotalRecordCount Optional. Enable the total record count. (optional, default to true) + * @param enableImages Optional, include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getTrailersWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getTrailersRequestBuilder(userId, maxOfficialRating, hasThemeSong, + hasThemeVideo, hasSubtitles, hasSpecialFeature, hasTrailer, adjacentTo, parentIndexNumber, + hasParentalRating, isHd, is4K, locationTypes, excludeLocationTypes, isMissing, isUnaired, + minCommunityRating, minCriticRating, minPremiereDate, minDateLastSaved, minDateLastSavedForUser, + maxPremiereDate, hasOverview, hasImdbId, hasTmdbId, hasTvdbId, isMovie, isSeries, isNews, isKids, + isSports, excludeItemIds, startIndex, limit, recursive, searchTerm, sortOrder, parentId, fields, + excludeItemTypes, filters, isFavorite, mediaTypes, imageTypes, sortBy, isPlayed, genres, + officialRatings, tags, years, enableUserData, imageTypeLimit, enableImageTypes, person, personIds, + personTypes, studios, artists, excludeArtistIds, artistIds, albumArtistIds, contributingArtistIds, + albums, albumIds, ids, videoTypes, minOfficialRating, isLocked, isPlaceHolder, hasOfficialRating, + collapseBoxSetItems, minWidth, minHeight, maxWidth, maxHeight, is3D, seriesStatus, + nameStartsWithOrGreater, nameStartsWith, nameLessThan, studioIds, genreIds, enableTotalRecordCount, + enableImages, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getTrailers", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getTrailersRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String maxOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeSong, + @org.eclipse.jdt.annotation.NonNull Boolean hasThemeVideo, + @org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles, + @org.eclipse.jdt.annotation.NonNull Boolean hasSpecialFeature, + @org.eclipse.jdt.annotation.NonNull Boolean hasTrailer, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber, + @org.eclipse.jdt.annotation.NonNull Boolean hasParentalRating, + @org.eclipse.jdt.annotation.NonNull Boolean isHd, @org.eclipse.jdt.annotation.NonNull Boolean is4K, + @org.eclipse.jdt.annotation.NonNull List locationTypes, + @org.eclipse.jdt.annotation.NonNull List excludeLocationTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull Boolean isUnaired, + @org.eclipse.jdt.annotation.NonNull Double minCommunityRating, + @org.eclipse.jdt.annotation.NonNull Double minCriticRating, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minPremiereDate, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSaved, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime minDateLastSavedForUser, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime maxPremiereDate, + @org.eclipse.jdt.annotation.NonNull Boolean hasOverview, + @org.eclipse.jdt.annotation.NonNull Boolean hasImdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTmdbId, + @org.eclipse.jdt.annotation.NonNull Boolean hasTvdbId, @org.eclipse.jdt.annotation.NonNull Boolean isMovie, + @org.eclipse.jdt.annotation.NonNull Boolean isSeries, @org.eclipse.jdt.annotation.NonNull Boolean isNews, + @org.eclipse.jdt.annotation.NonNull Boolean isKids, @org.eclipse.jdt.annotation.NonNull Boolean isSports, + @org.eclipse.jdt.annotation.NonNull List excludeItemIds, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull String searchTerm, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List filters, + @org.eclipse.jdt.annotation.NonNull Boolean isFavorite, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List imageTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull List genres, + @org.eclipse.jdt.annotation.NonNull List officialRatings, + @org.eclipse.jdt.annotation.NonNull List tags, + @org.eclipse.jdt.annotation.NonNull List years, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull String person, @org.eclipse.jdt.annotation.NonNull List personIds, + @org.eclipse.jdt.annotation.NonNull List personTypes, + @org.eclipse.jdt.annotation.NonNull List studios, + @org.eclipse.jdt.annotation.NonNull List artists, + @org.eclipse.jdt.annotation.NonNull List excludeArtistIds, + @org.eclipse.jdt.annotation.NonNull List artistIds, + @org.eclipse.jdt.annotation.NonNull List albumArtistIds, + @org.eclipse.jdt.annotation.NonNull List contributingArtistIds, + @org.eclipse.jdt.annotation.NonNull List albums, + @org.eclipse.jdt.annotation.NonNull List albumIds, @org.eclipse.jdt.annotation.NonNull List ids, + @org.eclipse.jdt.annotation.NonNull List videoTypes, + @org.eclipse.jdt.annotation.NonNull String minOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean isLocked, + @org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder, + @org.eclipse.jdt.annotation.NonNull Boolean hasOfficialRating, + @org.eclipse.jdt.annotation.NonNull Boolean collapseBoxSetItems, + @org.eclipse.jdt.annotation.NonNull Integer minWidth, @org.eclipse.jdt.annotation.NonNull Integer minHeight, + @org.eclipse.jdt.annotation.NonNull Integer maxWidth, @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Boolean is3D, + @org.eclipse.jdt.annotation.NonNull List seriesStatus, + @org.eclipse.jdt.annotation.NonNull String nameStartsWithOrGreater, + @org.eclipse.jdt.annotation.NonNull String nameStartsWith, + @org.eclipse.jdt.annotation.NonNull String nameLessThan, + @org.eclipse.jdt.annotation.NonNull List studioIds, + @org.eclipse.jdt.annotation.NonNull List genreIds, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Trailers"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "maxOfficialRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxOfficialRating", maxOfficialRating)); + localVarQueryParameterBaseName = "hasThemeSong"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasThemeSong", hasThemeSong)); + localVarQueryParameterBaseName = "hasThemeVideo"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasThemeVideo", hasThemeVideo)); + localVarQueryParameterBaseName = "hasSubtitles"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasSubtitles", hasSubtitles)); + localVarQueryParameterBaseName = "hasSpecialFeature"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasSpecialFeature", hasSpecialFeature)); + localVarQueryParameterBaseName = "hasTrailer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasTrailer", hasTrailer)); + localVarQueryParameterBaseName = "adjacentTo"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("adjacentTo", adjacentTo)); + localVarQueryParameterBaseName = "parentIndexNumber"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentIndexNumber", parentIndexNumber)); + localVarQueryParameterBaseName = "hasParentalRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasParentalRating", hasParentalRating)); + localVarQueryParameterBaseName = "isHd"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isHd", isHd)); + localVarQueryParameterBaseName = "is4K"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("is4K", is4K)); + localVarQueryParameterBaseName = "locationTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "locationTypes", locationTypes)); + localVarQueryParameterBaseName = "excludeLocationTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeLocationTypes", excludeLocationTypes)); + localVarQueryParameterBaseName = "isMissing"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMissing", isMissing)); + localVarQueryParameterBaseName = "isUnaired"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isUnaired", isUnaired)); + localVarQueryParameterBaseName = "minCommunityRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minCommunityRating", minCommunityRating)); + localVarQueryParameterBaseName = "minCriticRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minCriticRating", minCriticRating)); + localVarQueryParameterBaseName = "minPremiereDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minPremiereDate", minPremiereDate)); + localVarQueryParameterBaseName = "minDateLastSaved"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minDateLastSaved", minDateLastSaved)); + localVarQueryParameterBaseName = "minDateLastSavedForUser"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minDateLastSavedForUser", minDateLastSavedForUser)); + localVarQueryParameterBaseName = "maxPremiereDate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxPremiereDate", maxPremiereDate)); + localVarQueryParameterBaseName = "hasOverview"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasOverview", hasOverview)); + localVarQueryParameterBaseName = "hasImdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasImdbId", hasImdbId)); + localVarQueryParameterBaseName = "hasTmdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasTmdbId", hasTmdbId)); + localVarQueryParameterBaseName = "hasTvdbId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasTvdbId", hasTvdbId)); + localVarQueryParameterBaseName = "isMovie"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMovie", isMovie)); + localVarQueryParameterBaseName = "isSeries"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSeries", isSeries)); + localVarQueryParameterBaseName = "isNews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isNews", isNews)); + localVarQueryParameterBaseName = "isKids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isKids", isKids)); + localVarQueryParameterBaseName = "isSports"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSports", isSports)); + localVarQueryParameterBaseName = "excludeItemIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemIds", excludeItemIds)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "recursive"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("recursive", recursive)); + localVarQueryParameterBaseName = "searchTerm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchTerm", searchTerm)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "filters"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "filters", filters)); + localVarQueryParameterBaseName = "isFavorite"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isFavorite", isFavorite)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + localVarQueryParameterBaseName = "imageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "imageTypes", imageTypes)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "isPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isPlayed", isPlayed)); + localVarQueryParameterBaseName = "genres"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genres", genres)); + localVarQueryParameterBaseName = "officialRatings"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "officialRatings", officialRatings)); + localVarQueryParameterBaseName = "tags"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "tags", tags)); + localVarQueryParameterBaseName = "years"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "years", years)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "person"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("person", person)); + localVarQueryParameterBaseName = "personIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personIds", personIds)); + localVarQueryParameterBaseName = "personTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "personTypes", personTypes)); + localVarQueryParameterBaseName = "studios"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studios", studios)); + localVarQueryParameterBaseName = "artists"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "artists", artists)); + localVarQueryParameterBaseName = "excludeArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeArtistIds", excludeArtistIds)); + localVarQueryParameterBaseName = "artistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "artistIds", artistIds)); + localVarQueryParameterBaseName = "albumArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "albumArtistIds", albumArtistIds)); + localVarQueryParameterBaseName = "contributingArtistIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "contributingArtistIds", contributingArtistIds)); + localVarQueryParameterBaseName = "albums"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "albums", albums)); + localVarQueryParameterBaseName = "albumIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "albumIds", albumIds)); + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + localVarQueryParameterBaseName = "videoTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "videoTypes", videoTypes)); + localVarQueryParameterBaseName = "minOfficialRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minOfficialRating", minOfficialRating)); + localVarQueryParameterBaseName = "isLocked"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isLocked", isLocked)); + localVarQueryParameterBaseName = "isPlaceHolder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isPlaceHolder", isPlaceHolder)); + localVarQueryParameterBaseName = "hasOfficialRating"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("hasOfficialRating", hasOfficialRating)); + localVarQueryParameterBaseName = "collapseBoxSetItems"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("collapseBoxSetItems", collapseBoxSetItems)); + localVarQueryParameterBaseName = "minWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minWidth", minWidth)); + localVarQueryParameterBaseName = "minHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minHeight", minHeight)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "is3D"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("is3D", is3D)); + localVarQueryParameterBaseName = "seriesStatus"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "seriesStatus", seriesStatus)); + localVarQueryParameterBaseName = "nameStartsWithOrGreater"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWithOrGreater", nameStartsWithOrGreater)); + localVarQueryParameterBaseName = "nameStartsWith"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameStartsWith", nameStartsWith)); + localVarQueryParameterBaseName = "nameLessThan"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nameLessThan", nameLessThan)); + localVarQueryParameterBaseName = "studioIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "studioIds", studioIds)); + localVarQueryParameterBaseName = "genreIds"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "genreIds", genreIds)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/TvShowsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/TvShowsApi.java new file mode 100644 index 0000000000000..db1c0ceb3c258 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/TvShowsApi.java @@ -0,0 +1,1168 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFields; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TvShowsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public TvShowsApi() { + this(Configuration.getDefaultApiClient()); + } + + public TvShowsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets episodes for a tv season. + * + * @param seriesId The series id. (required) + * @param userId The user id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param season Optional filter by season number. (optional) + * @param seasonId Optional. Filter by season id. (optional) + * @param isMissing Optional. Filter by items that are missing episodes or not. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param startItemId Optional. Skip through the list until a given item is found. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param enableImages Optional, include image information in output. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getEpisodes(@org.eclipse.jdt.annotation.Nullable UUID seriesId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer season, @org.eclipse.jdt.annotation.NonNull UUID seasonId, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, @org.eclipse.jdt.annotation.NonNull UUID startItemId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull String sortBy) throws ApiException { + return getEpisodes(seriesId, userId, fields, season, seasonId, isMissing, adjacentTo, startItemId, startIndex, + limit, enableImages, imageTypeLimit, enableImageTypes, enableUserData, sortBy, null); + } + + /** + * Gets episodes for a tv season. + * + * @param seriesId The series id. (required) + * @param userId The user id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param season Optional filter by season number. (optional) + * @param seasonId Optional. Filter by season id. (optional) + * @param isMissing Optional. Filter by items that are missing episodes or not. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param startItemId Optional. Skip through the list until a given item is found. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param enableImages Optional, include image information in output. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getEpisodes(@org.eclipse.jdt.annotation.Nullable UUID seriesId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer season, @org.eclipse.jdt.annotation.NonNull UUID seasonId, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, @org.eclipse.jdt.annotation.NonNull UUID startItemId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull String sortBy, Map headers) throws ApiException { + ApiResponse localVarResponse = getEpisodesWithHttpInfo(seriesId, userId, fields, season, + seasonId, isMissing, adjacentTo, startItemId, startIndex, limit, enableImages, imageTypeLimit, + enableImageTypes, enableUserData, sortBy, headers); + return localVarResponse.getData(); + } + + /** + * Gets episodes for a tv season. + * + * @param seriesId The series id. (required) + * @param userId The user id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param season Optional filter by season number. (optional) + * @param seasonId Optional. Filter by season id. (optional) + * @param isMissing Optional. Filter by items that are missing episodes or not. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param startItemId Optional. Skip through the list until a given item is found. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param enableImages Optional, include image information in output. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEpisodesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID seriesId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer season, @org.eclipse.jdt.annotation.NonNull UUID seasonId, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, @org.eclipse.jdt.annotation.NonNull UUID startItemId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull String sortBy) throws ApiException { + return getEpisodesWithHttpInfo(seriesId, userId, fields, season, seasonId, isMissing, adjacentTo, startItemId, + startIndex, limit, enableImages, imageTypeLimit, enableImageTypes, enableUserData, sortBy, null); + } + + /** + * Gets episodes for a tv season. + * + * @param seriesId The series id. (required) + * @param userId The user id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param season Optional filter by season number. (optional) + * @param seasonId Optional. Filter by season id. (optional) + * @param isMissing Optional. Filter by items that are missing episodes or not. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param startItemId Optional. Skip through the list until a given item is found. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param enableImages Optional, include image information in output. (optional) + * @param imageTypeLimit Optional, the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getEpisodesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID seriesId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer season, @org.eclipse.jdt.annotation.NonNull UUID seasonId, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, @org.eclipse.jdt.annotation.NonNull UUID startItemId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull String sortBy, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getEpisodesRequestBuilder(seriesId, userId, fields, season, + seasonId, isMissing, adjacentTo, startItemId, startIndex, limit, enableImages, imageTypeLimit, + enableImageTypes, enableUserData, sortBy, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getEpisodes", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getEpisodesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID seriesId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Integer season, @org.eclipse.jdt.annotation.NonNull UUID seasonId, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, @org.eclipse.jdt.annotation.NonNull UUID startItemId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull String sortBy, Map headers) throws ApiException { + // verify the required parameter 'seriesId' is set + if (seriesId == null) { + throw new ApiException(400, "Missing the required parameter 'seriesId' when calling getEpisodes"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Shows/{seriesId}/Episodes".replace("{seriesId}", + ApiClient.urlEncode(seriesId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "season"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("season", season)); + localVarQueryParameterBaseName = "seasonId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("seasonId", seasonId)); + localVarQueryParameterBaseName = "isMissing"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMissing", isMissing)); + localVarQueryParameterBaseName = "adjacentTo"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("adjacentTo", adjacentTo)); + localVarQueryParameterBaseName = "startItemId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startItemId", startItemId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sortBy", sortBy)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of next up episodes. + * + * @param userId The user id of the user to get the next up episodes for. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param seriesId Optional. Filter by series id. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param nextUpDateCutoff Optional. Starting date of shows to show in Next Up section. (optional) + * @param enableTotalRecordCount Whether to enable the total records count. Defaults to true. (optional, default to + * true) + * @param disableFirstEpisode Whether to disable sending the first episode in a series as next up. (optional, + * default to false) + * @param enableRewatching Whether to include watched episode in next up results. (optional, default to false) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getNextUp(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull String seriesId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime nextUpDateCutoff, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean disableFirstEpisode, + @org.eclipse.jdt.annotation.NonNull Boolean enableRewatching) throws ApiException { + return getNextUp(userId, startIndex, limit, fields, seriesId, parentId, enableImages, imageTypeLimit, + enableImageTypes, enableUserData, nextUpDateCutoff, enableTotalRecordCount, disableFirstEpisode, + enableRewatching, null); + } + + /** + * Gets a list of next up episodes. + * + * @param userId The user id of the user to get the next up episodes for. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param seriesId Optional. Filter by series id. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param nextUpDateCutoff Optional. Starting date of shows to show in Next Up section. (optional) + * @param enableTotalRecordCount Whether to enable the total records count. Defaults to true. (optional, default to + * true) + * @param disableFirstEpisode Whether to disable sending the first episode in a series as next up. (optional, + * default to false) + * @param enableRewatching Whether to include watched episode in next up results. (optional, default to false) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getNextUp(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull String seriesId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime nextUpDateCutoff, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean disableFirstEpisode, + @org.eclipse.jdt.annotation.NonNull Boolean enableRewatching, Map headers) + throws ApiException { + ApiResponse localVarResponse = getNextUpWithHttpInfo(userId, startIndex, limit, fields, + seriesId, parentId, enableImages, imageTypeLimit, enableImageTypes, enableUserData, nextUpDateCutoff, + enableTotalRecordCount, disableFirstEpisode, enableRewatching, headers); + return localVarResponse.getData(); + } + + /** + * Gets a list of next up episodes. + * + * @param userId The user id of the user to get the next up episodes for. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param seriesId Optional. Filter by series id. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param nextUpDateCutoff Optional. Starting date of shows to show in Next Up section. (optional) + * @param enableTotalRecordCount Whether to enable the total records count. Defaults to true. (optional, default to + * true) + * @param disableFirstEpisode Whether to disable sending the first episode in a series as next up. (optional, + * default to false) + * @param enableRewatching Whether to include watched episode in next up results. (optional, default to false) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getNextUpWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull String seriesId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime nextUpDateCutoff, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean disableFirstEpisode, + @org.eclipse.jdt.annotation.NonNull Boolean enableRewatching) throws ApiException { + return getNextUpWithHttpInfo(userId, startIndex, limit, fields, seriesId, parentId, enableImages, + imageTypeLimit, enableImageTypes, enableUserData, nextUpDateCutoff, enableTotalRecordCount, + disableFirstEpisode, enableRewatching, null); + } + + /** + * Gets a list of next up episodes. + * + * @param userId The user id of the user to get the next up episodes for. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param seriesId Optional. Filter by series id. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param nextUpDateCutoff Optional. Starting date of shows to show in Next Up section. (optional) + * @param enableTotalRecordCount Whether to enable the total records count. Defaults to true. (optional, default to + * true) + * @param disableFirstEpisode Whether to disable sending the first episode in a series as next up. (optional, + * default to false) + * @param enableRewatching Whether to include watched episode in next up results. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getNextUpWithHttpInfo(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull String seriesId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime nextUpDateCutoff, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean disableFirstEpisode, + @org.eclipse.jdt.annotation.NonNull Boolean enableRewatching, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getNextUpRequestBuilder(userId, startIndex, limit, fields, + seriesId, parentId, enableImages, imageTypeLimit, enableImageTypes, enableUserData, nextUpDateCutoff, + enableTotalRecordCount, disableFirstEpisode, enableRewatching, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getNextUp", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getNextUpRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull String seriesId, @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull OffsetDateTime nextUpDateCutoff, + @org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount, + @org.eclipse.jdt.annotation.NonNull Boolean disableFirstEpisode, + @org.eclipse.jdt.annotation.NonNull Boolean enableRewatching, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Shows/NextUp"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "seriesId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("seriesId", seriesId)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "nextUpDateCutoff"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("nextUpDateCutoff", nextUpDateCutoff)); + localVarQueryParameterBaseName = "enableTotalRecordCount"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableTotalRecordCount", enableTotalRecordCount)); + localVarQueryParameterBaseName = "disableFirstEpisode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("disableFirstEpisode", disableFirstEpisode)); + localVarQueryParameterBaseName = "enableRewatching"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableRewatching", enableRewatching)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets seasons for a tv series. + * + * @param seriesId The series id. (required) + * @param userId The user id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param isSpecialSeason Optional. Filter by special season. (optional) + * @param isMissing Optional. Filter by items that are missing episodes or not. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSeasons(@org.eclipse.jdt.annotation.Nullable UUID seriesId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean isSpecialSeason, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData) throws ApiException { + return getSeasons(seriesId, userId, fields, isSpecialSeason, isMissing, adjacentTo, enableImages, + imageTypeLimit, enableImageTypes, enableUserData, null); + } + + /** + * Gets seasons for a tv series. + * + * @param seriesId The series id. (required) + * @param userId The user id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param isSpecialSeason Optional. Filter by special season. (optional) + * @param isMissing Optional. Filter by items that are missing episodes or not. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getSeasons(@org.eclipse.jdt.annotation.Nullable UUID seriesId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean isSpecialSeason, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, Map headers) + throws ApiException { + ApiResponse localVarResponse = getSeasonsWithHttpInfo(seriesId, userId, fields, + isSpecialSeason, isMissing, adjacentTo, enableImages, imageTypeLimit, enableImageTypes, enableUserData, + headers); + return localVarResponse.getData(); + } + + /** + * Gets seasons for a tv series. + * + * @param seriesId The series id. (required) + * @param userId The user id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param isSpecialSeason Optional. Filter by special season. (optional) + * @param isMissing Optional. Filter by items that are missing episodes or not. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSeasonsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID seriesId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean isSpecialSeason, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData) throws ApiException { + return getSeasonsWithHttpInfo(seriesId, userId, fields, isSpecialSeason, isMissing, adjacentTo, enableImages, + imageTypeLimit, enableImageTypes, enableUserData, null); + } + + /** + * Gets seasons for a tv series. + * + * @param seriesId The series id. (required) + * @param userId The user id. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. This allows multiple, + * comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, + * MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, + * SortName, Studios, Taglines, TrailerUrls. (optional) + * @param isSpecialSeason Optional. Filter by special season. (optional) + * @param isMissing Optional. Filter by items that are missing episodes or not. (optional) + * @param adjacentTo Optional. Return items that are siblings of a supplied item. (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSeasonsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID seriesId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean isSpecialSeason, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSeasonsRequestBuilder(seriesId, userId, fields, isSpecialSeason, + isMissing, adjacentTo, enableImages, imageTypeLimit, enableImageTypes, enableUserData, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSeasons", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSeasonsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID seriesId, + @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull Boolean isSpecialSeason, + @org.eclipse.jdt.annotation.NonNull Boolean isMissing, + @org.eclipse.jdt.annotation.NonNull String adjacentTo, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, Map headers) + throws ApiException { + // verify the required parameter 'seriesId' is set + if (seriesId == null) { + throw new ApiException(400, "Missing the required parameter 'seriesId' when calling getSeasons"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Shows/{seriesId}/Seasons".replace("{seriesId}", + ApiClient.urlEncode(seriesId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "isSpecialSeason"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isSpecialSeason", isSpecialSeason)); + localVarQueryParameterBaseName = "isMissing"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isMissing", isMissing)); + localVarQueryParameterBaseName = "adjacentTo"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("adjacentTo", adjacentTo)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of upcoming episodes. + * + * @param userId The user id of the user to get the upcoming episodes for. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getUpcomingEpisodes(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData) throws ApiException { + return getUpcomingEpisodes(userId, startIndex, limit, fields, parentId, enableImages, imageTypeLimit, + enableImageTypes, enableUserData, null); + } + + /** + * Gets a list of upcoming episodes. + * + * @param userId The user id of the user to get the upcoming episodes for. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getUpcomingEpisodes(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, Map headers) + throws ApiException { + ApiResponse localVarResponse = getUpcomingEpisodesWithHttpInfo(userId, startIndex, + limit, fields, parentId, enableImages, imageTypeLimit, enableImageTypes, enableUserData, headers); + return localVarResponse.getData(); + } + + /** + * Gets a list of upcoming episodes. + * + * @param userId The user id of the user to get the upcoming episodes for. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUpcomingEpisodesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData) throws ApiException { + return getUpcomingEpisodesWithHttpInfo(userId, startIndex, limit, fields, parentId, enableImages, + imageTypeLimit, enableImageTypes, enableUserData, null); + } + + /** + * Gets a list of upcoming episodes. + * + * @param userId The user id of the user to get the upcoming episodes for. (optional) + * @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the + * results. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param parentId Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param enableImages Optional. Include image information in output. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUpcomingEpisodesWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUpcomingEpisodesRequestBuilder(userId, startIndex, limit, + fields, parentId, enableImages, imageTypeLimit, enableImageTypes, enableUserData, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getUpcomingEpisodes", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUpcomingEpisodesRequestBuilder(@org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull UUID parentId, @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, Map headers) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Shows/Upcoming"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/UniversalAudioApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/UniversalAudioApi.java new file mode 100644 index 0000000000000..e3d4654bb7cad --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/UniversalAudioApi.java @@ -0,0 +1,781 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; + +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UniversalAudioApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public UniversalAudioApi() { + this(Configuration.getDefaultApiClient()); + } + + public UniversalAudioApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container Optional. The audio container. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param userId Optional. The user id. (optional) + * @param audioCodec Optional. The audio codec to transcode to. (optional) + * @param maxAudioChannels Optional. The maximum number of audio channels. (optional) + * @param transcodingAudioChannels Optional. The number of how many audio channels to transcode to. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param transcodingContainer Optional. The container to transcode to. (optional) + * @param transcodingProtocol Optional. The transcoding protocol. (optional) + * @param maxAudioSampleRate Optional. The maximum audio sample rate. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param enableRemoteMedia Optional. Whether to enable remote media. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional, default to false) + * @param enableRedirection Whether to enable redirection. Defaults to true. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File getUniversalAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull String transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection) throws ApiException { + return getUniversalAudioStream(itemId, container, mediaSourceId, deviceId, userId, audioCodec, maxAudioChannels, + transcodingAudioChannels, maxStreamingBitrate, audioBitRate, startTimeTicks, transcodingContainer, + transcodingProtocol, maxAudioSampleRate, maxAudioBitDepth, enableRemoteMedia, breakOnNonKeyFrames, + enableRedirection, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container Optional. The audio container. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param userId Optional. The user id. (optional) + * @param audioCodec Optional. The audio codec to transcode to. (optional) + * @param maxAudioChannels Optional. The maximum number of audio channels. (optional) + * @param transcodingAudioChannels Optional. The number of how many audio channels to transcode to. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param transcodingContainer Optional. The container to transcode to. (optional) + * @param transcodingProtocol Optional. The transcoding protocol. (optional) + * @param maxAudioSampleRate Optional. The maximum audio sample rate. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param enableRemoteMedia Optional. Whether to enable remote media. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional, default to false) + * @param enableRedirection Whether to enable redirection. Defaults to true. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getUniversalAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull String transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection, Map headers) + throws ApiException { + ApiResponse localVarResponse = getUniversalAudioStreamWithHttpInfo(itemId, container, mediaSourceId, + deviceId, userId, audioCodec, maxAudioChannels, transcodingAudioChannels, maxStreamingBitrate, + audioBitRate, startTimeTicks, transcodingContainer, transcodingProtocol, maxAudioSampleRate, + maxAudioBitDepth, enableRemoteMedia, breakOnNonKeyFrames, enableRedirection, headers); + return localVarResponse.getData(); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container Optional. The audio container. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param userId Optional. The user id. (optional) + * @param audioCodec Optional. The audio codec to transcode to. (optional) + * @param maxAudioChannels Optional. The maximum number of audio channels. (optional) + * @param transcodingAudioChannels Optional. The number of how many audio channels to transcode to. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param transcodingContainer Optional. The container to transcode to. (optional) + * @param transcodingProtocol Optional. The transcoding protocol. (optional) + * @param maxAudioSampleRate Optional. The maximum audio sample rate. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param enableRemoteMedia Optional. Whether to enable remote media. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional, default to false) + * @param enableRedirection Whether to enable redirection. Defaults to true. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUniversalAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull String transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection) throws ApiException { + return getUniversalAudioStreamWithHttpInfo(itemId, container, mediaSourceId, deviceId, userId, audioCodec, + maxAudioChannels, transcodingAudioChannels, maxStreamingBitrate, audioBitRate, startTimeTicks, + transcodingContainer, transcodingProtocol, maxAudioSampleRate, maxAudioBitDepth, enableRemoteMedia, + breakOnNonKeyFrames, enableRedirection, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container Optional. The audio container. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param userId Optional. The user id. (optional) + * @param audioCodec Optional. The audio codec to transcode to. (optional) + * @param maxAudioChannels Optional. The maximum number of audio channels. (optional) + * @param transcodingAudioChannels Optional. The number of how many audio channels to transcode to. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param transcodingContainer Optional. The container to transcode to. (optional) + * @param transcodingProtocol Optional. The transcoding protocol. (optional) + * @param maxAudioSampleRate Optional. The maximum audio sample rate. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param enableRemoteMedia Optional. Whether to enable remote media. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional, default to false) + * @param enableRedirection Whether to enable redirection. Defaults to true. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUniversalAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull String transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUniversalAudioStreamRequestBuilder(itemId, container, + mediaSourceId, deviceId, userId, audioCodec, maxAudioChannels, transcodingAudioChannels, + maxStreamingBitrate, audioBitRate, startTimeTicks, transcodingContainer, transcodingProtocol, + maxAudioSampleRate, maxAudioBitDepth, enableRemoteMedia, breakOnNonKeyFrames, enableRedirection, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getUniversalAudioStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUniversalAudioStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull String transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getUniversalAudioStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/universal".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "container"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "container", container)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "transcodingAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodingAudioChannels", transcodingAudioChannels)); + localVarQueryParameterBaseName = "maxStreamingBitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStreamingBitrate", maxStreamingBitrate)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "transcodingContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodingContainer", transcodingContainer)); + localVarQueryParameterBaseName = "transcodingProtocol"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodingProtocol", transcodingProtocol)); + localVarQueryParameterBaseName = "maxAudioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioSampleRate", maxAudioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "enableRemoteMedia"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableRemoteMedia", enableRemoteMedia)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "enableRedirection"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableRedirection", enableRedirection)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "audio/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container Optional. The audio container. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param userId Optional. The user id. (optional) + * @param audioCodec Optional. The audio codec to transcode to. (optional) + * @param maxAudioChannels Optional. The maximum number of audio channels. (optional) + * @param transcodingAudioChannels Optional. The number of how many audio channels to transcode to. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param transcodingContainer Optional. The container to transcode to. (optional) + * @param transcodingProtocol Optional. The transcoding protocol. (optional) + * @param maxAudioSampleRate Optional. The maximum audio sample rate. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param enableRemoteMedia Optional. Whether to enable remote media. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional, default to false) + * @param enableRedirection Whether to enable redirection. Defaults to true. (optional, default to true) + * @return File + * @throws ApiException if fails to make API call + */ + public File headUniversalAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull String transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection) throws ApiException { + return headUniversalAudioStream(itemId, container, mediaSourceId, deviceId, userId, audioCodec, + maxAudioChannels, transcodingAudioChannels, maxStreamingBitrate, audioBitRate, startTimeTicks, + transcodingContainer, transcodingProtocol, maxAudioSampleRate, maxAudioBitDepth, enableRemoteMedia, + breakOnNonKeyFrames, enableRedirection, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container Optional. The audio container. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param userId Optional. The user id. (optional) + * @param audioCodec Optional. The audio codec to transcode to. (optional) + * @param maxAudioChannels Optional. The maximum number of audio channels. (optional) + * @param transcodingAudioChannels Optional. The number of how many audio channels to transcode to. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param transcodingContainer Optional. The container to transcode to. (optional) + * @param transcodingProtocol Optional. The transcoding protocol. (optional) + * @param maxAudioSampleRate Optional. The maximum audio sample rate. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param enableRemoteMedia Optional. Whether to enable remote media. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional, default to false) + * @param enableRedirection Whether to enable redirection. Defaults to true. (optional, default to true) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headUniversalAudioStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull String transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection, Map headers) + throws ApiException { + ApiResponse localVarResponse = headUniversalAudioStreamWithHttpInfo(itemId, container, mediaSourceId, + deviceId, userId, audioCodec, maxAudioChannels, transcodingAudioChannels, maxStreamingBitrate, + audioBitRate, startTimeTicks, transcodingContainer, transcodingProtocol, maxAudioSampleRate, + maxAudioBitDepth, enableRemoteMedia, breakOnNonKeyFrames, enableRedirection, headers); + return localVarResponse.getData(); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container Optional. The audio container. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param userId Optional. The user id. (optional) + * @param audioCodec Optional. The audio codec to transcode to. (optional) + * @param maxAudioChannels Optional. The maximum number of audio channels. (optional) + * @param transcodingAudioChannels Optional. The number of how many audio channels to transcode to. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param transcodingContainer Optional. The container to transcode to. (optional) + * @param transcodingProtocol Optional. The transcoding protocol. (optional) + * @param maxAudioSampleRate Optional. The maximum audio sample rate. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param enableRemoteMedia Optional. Whether to enable remote media. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional, default to false) + * @param enableRedirection Whether to enable redirection. Defaults to true. (optional, default to true) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headUniversalAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull String transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection) throws ApiException { + return headUniversalAudioStreamWithHttpInfo(itemId, container, mediaSourceId, deviceId, userId, audioCodec, + maxAudioChannels, transcodingAudioChannels, maxStreamingBitrate, audioBitRate, startTimeTicks, + transcodingContainer, transcodingProtocol, maxAudioSampleRate, maxAudioBitDepth, enableRemoteMedia, + breakOnNonKeyFrames, enableRedirection, null); + } + + /** + * Gets an audio stream. + * + * @param itemId The item id. (required) + * @param container Optional. The audio container. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param userId Optional. The user id. (optional) + * @param audioCodec Optional. The audio codec to transcode to. (optional) + * @param maxAudioChannels Optional. The maximum number of audio channels. (optional) + * @param transcodingAudioChannels Optional. The number of how many audio channels to transcode to. (optional) + * @param maxStreamingBitrate Optional. The maximum streaming bitrate. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param transcodingContainer Optional. The container to transcode to. (optional) + * @param transcodingProtocol Optional. The transcoding protocol. (optional) + * @param maxAudioSampleRate Optional. The maximum audio sample rate. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param enableRemoteMedia Optional. Whether to enable remote media. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional, default to false) + * @param enableRedirection Whether to enable redirection. Defaults to true. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headUniversalAudioStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull String transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headUniversalAudioStreamRequestBuilder(itemId, container, + mediaSourceId, deviceId, userId, audioCodec, maxAudioChannels, transcodingAudioChannels, + maxStreamingBitrate, audioBitRate, startTimeTicks, transcodingContainer, transcodingProtocol, + maxAudioSampleRate, maxAudioBitDepth, enableRemoteMedia, breakOnNonKeyFrames, enableRedirection, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headUniversalAudioStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headUniversalAudioStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull List container, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull UUID userId, + @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer transcodingAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, + @org.eclipse.jdt.annotation.NonNull String transcodingContainer, + @org.eclipse.jdt.annotation.NonNull String transcodingProtocol, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteMedia, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Boolean enableRedirection, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling headUniversalAudioStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Audio/{itemId}/universal".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "container"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "container", container)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "transcodingAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodingAudioChannels", transcodingAudioChannels)); + localVarQueryParameterBaseName = "maxStreamingBitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxStreamingBitrate", maxStreamingBitrate)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "transcodingContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodingContainer", transcodingContainer)); + localVarQueryParameterBaseName = "transcodingProtocol"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodingProtocol", transcodingProtocol)); + localVarQueryParameterBaseName = "maxAudioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioSampleRate", maxAudioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "enableRemoteMedia"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableRemoteMedia", enableRemoteMedia)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "enableRedirection"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableRedirection", enableRedirection)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "audio/*"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/UserApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/UserApi.java new file mode 100644 index 0000000000000..2567c9d63e9a9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/UserApi.java @@ -0,0 +1,2061 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.AuthenticateUserByName; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.AuthenticationResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.CreateUserByName; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ForgotPasswordDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ForgotPasswordPinDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ForgotPasswordResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.PinRedeemResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.QuickConnectDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.UpdateUserEasyPassword; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.UpdateUserPassword; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.UserConfiguration; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.UserDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.UserPolicy; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public UserApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Authenticates a user. + * + * @param userId The user id. (required) + * @param pw The password as plain text. (required) + * @param password The password sha1-hash. (optional) + * @return AuthenticationResult + * @throws ApiException if fails to make API call + */ + public AuthenticationResult authenticateUser(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable String pw, @org.eclipse.jdt.annotation.NonNull String password) + throws ApiException { + return authenticateUser(userId, pw, password, null); + } + + /** + * Authenticates a user. + * + * @param userId The user id. (required) + * @param pw The password as plain text. (required) + * @param password The password sha1-hash. (optional) + * @param headers Optional headers to include in the request + * @return AuthenticationResult + * @throws ApiException if fails to make API call + */ + public AuthenticationResult authenticateUser(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable String pw, @org.eclipse.jdt.annotation.NonNull String password, + Map headers) throws ApiException { + ApiResponse localVarResponse = authenticateUserWithHttpInfo(userId, pw, password, + headers); + return localVarResponse.getData(); + } + + /** + * Authenticates a user. + * + * @param userId The user id. (required) + * @param pw The password as plain text. (required) + * @param password The password sha1-hash. (optional) + * @return ApiResponse<AuthenticationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse authenticateUserWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable String pw, + @org.eclipse.jdt.annotation.NonNull String password) throws ApiException { + return authenticateUserWithHttpInfo(userId, pw, password, null); + } + + /** + * Authenticates a user. + * + * @param userId The user id. (required) + * @param pw The password as plain text. (required) + * @param password The password sha1-hash. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<AuthenticationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse authenticateUserWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable String pw, + @org.eclipse.jdt.annotation.NonNull String password, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = authenticateUserRequestBuilder(userId, pw, password, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("authenticateUser", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + AuthenticationResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder authenticateUserRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable String pw, @org.eclipse.jdt.annotation.NonNull String password, + Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling authenticateUser"); + } + // verify the required parameter 'pw' is set + if (pw == null) { + throw new ApiException(400, "Missing the required parameter 'pw' when calling authenticateUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Authenticate".replace("{userId}", + ApiClient.urlEncode(userId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "pw"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("pw", pw)); + localVarQueryParameterBaseName = "password"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("password", password)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Authenticates a user by name. + * + * @param authenticateUserByName The + * M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) + * request. (required) + * @return AuthenticationResult + * @throws ApiException if fails to make API call + */ + public AuthenticationResult authenticateUserByName( + @org.eclipse.jdt.annotation.Nullable AuthenticateUserByName authenticateUserByName) throws ApiException { + return authenticateUserByName(authenticateUserByName, null); + } + + /** + * Authenticates a user by name. + * + * @param authenticateUserByName The + * M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) + * request. (required) + * @param headers Optional headers to include in the request + * @return AuthenticationResult + * @throws ApiException if fails to make API call + */ + public AuthenticationResult authenticateUserByName( + @org.eclipse.jdt.annotation.Nullable AuthenticateUserByName authenticateUserByName, + Map headers) throws ApiException { + ApiResponse localVarResponse = authenticateUserByNameWithHttpInfo(authenticateUserByName, + headers); + return localVarResponse.getData(); + } + + /** + * Authenticates a user by name. + * + * @param authenticateUserByName The + * M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) + * request. (required) + * @return ApiResponse<AuthenticationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse authenticateUserByNameWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable AuthenticateUserByName authenticateUserByName) throws ApiException { + return authenticateUserByNameWithHttpInfo(authenticateUserByName, null); + } + + /** + * Authenticates a user by name. + * + * @param authenticateUserByName The + * M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) + * request. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<AuthenticationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse authenticateUserByNameWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable AuthenticateUserByName authenticateUserByName, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = authenticateUserByNameRequestBuilder(authenticateUserByName, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("authenticateUserByName", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + AuthenticationResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder authenticateUserByNameRequestBuilder( + @org.eclipse.jdt.annotation.Nullable AuthenticateUserByName authenticateUserByName, + Map headers) throws ApiException { + // verify the required parameter 'authenticateUserByName' is set + if (authenticateUserByName == null) { + throw new ApiException(400, + "Missing the required parameter 'authenticateUserByName' when calling authenticateUserByName"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/AuthenticateByName"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(authenticateUserByName); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Authenticates a user with quick connect. + * + * @param quickConnectDto The Jellyfin.Api.Models.UserDtos.QuickConnectDto request. (required) + * @return AuthenticationResult + * @throws ApiException if fails to make API call + */ + public AuthenticationResult authenticateWithQuickConnect( + @org.eclipse.jdt.annotation.Nullable QuickConnectDto quickConnectDto) throws ApiException { + return authenticateWithQuickConnect(quickConnectDto, null); + } + + /** + * Authenticates a user with quick connect. + * + * @param quickConnectDto The Jellyfin.Api.Models.UserDtos.QuickConnectDto request. (required) + * @param headers Optional headers to include in the request + * @return AuthenticationResult + * @throws ApiException if fails to make API call + */ + public AuthenticationResult authenticateWithQuickConnect( + @org.eclipse.jdt.annotation.Nullable QuickConnectDto quickConnectDto, Map headers) + throws ApiException { + ApiResponse localVarResponse = authenticateWithQuickConnectWithHttpInfo(quickConnectDto, + headers); + return localVarResponse.getData(); + } + + /** + * Authenticates a user with quick connect. + * + * @param quickConnectDto The Jellyfin.Api.Models.UserDtos.QuickConnectDto request. (required) + * @return ApiResponse<AuthenticationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse authenticateWithQuickConnectWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable QuickConnectDto quickConnectDto) throws ApiException { + return authenticateWithQuickConnectWithHttpInfo(quickConnectDto, null); + } + + /** + * Authenticates a user with quick connect. + * + * @param quickConnectDto The Jellyfin.Api.Models.UserDtos.QuickConnectDto request. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<AuthenticationResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse authenticateWithQuickConnectWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable QuickConnectDto quickConnectDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = authenticateWithQuickConnectRequestBuilder(quickConnectDto, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("authenticateWithQuickConnect", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + AuthenticationResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder authenticateWithQuickConnectRequestBuilder( + @org.eclipse.jdt.annotation.Nullable QuickConnectDto quickConnectDto, Map headers) + throws ApiException { + // verify the required parameter 'quickConnectDto' is set + if (quickConnectDto == null) { + throw new ApiException(400, + "Missing the required parameter 'quickConnectDto' when calling authenticateWithQuickConnect"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/AuthenticateWithQuickConnect"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(quickConnectDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates a user. + * + * @param createUserByName The create user by name request body. (required) + * @return UserDto + * @throws ApiException if fails to make API call + */ + public UserDto createUserByName(@org.eclipse.jdt.annotation.Nullable CreateUserByName createUserByName) + throws ApiException { + return createUserByName(createUserByName, null); + } + + /** + * Creates a user. + * + * @param createUserByName The create user by name request body. (required) + * @param headers Optional headers to include in the request + * @return UserDto + * @throws ApiException if fails to make API call + */ + public UserDto createUserByName(@org.eclipse.jdt.annotation.Nullable CreateUserByName createUserByName, + Map headers) throws ApiException { + ApiResponse localVarResponse = createUserByNameWithHttpInfo(createUserByName, headers); + return localVarResponse.getData(); + } + + /** + * Creates a user. + * + * @param createUserByName The create user by name request body. (required) + * @return ApiResponse<UserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse createUserByNameWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable CreateUserByName createUserByName) throws ApiException { + return createUserByNameWithHttpInfo(createUserByName, null); + } + + /** + * Creates a user. + * + * @param createUserByName The create user by name request body. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse createUserByNameWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable CreateUserByName createUserByName, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createUserByNameRequestBuilder(createUserByName, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createUserByName", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + UserDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createUserByNameRequestBuilder( + @org.eclipse.jdt.annotation.Nullable CreateUserByName createUserByName, Map headers) + throws ApiException { + // verify the required parameter 'createUserByName' is set + if (createUserByName == null) { + throw new ApiException(400, + "Missing the required parameter 'createUserByName' when calling createUserByName"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/New"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createUserByName); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Deletes a user. + * + * @param userId The user id. (required) + * @throws ApiException if fails to make API call + */ + public void deleteUser(@org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + deleteUser(userId, null); + } + + /** + * Deletes a user. + * + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteUser(@org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) + throws ApiException { + deleteUserWithHttpInfo(userId, headers); + } + + /** + * Deletes a user. + * + * @param userId The user id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId) + throws ApiException { + return deleteUserWithHttpInfo(userId, null); + } + + /** + * Deletes a user. + * + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteUserRequestBuilder(userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteUser", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteUserRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling deleteUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}".replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Initiates the forgot password process for a local user. + * + * @param forgotPasswordDto The forgot password request containing the entered username. (required) + * @return ForgotPasswordResult + * @throws ApiException if fails to make API call + */ + public ForgotPasswordResult forgotPassword(@org.eclipse.jdt.annotation.Nullable ForgotPasswordDto forgotPasswordDto) + throws ApiException { + return forgotPassword(forgotPasswordDto, null); + } + + /** + * Initiates the forgot password process for a local user. + * + * @param forgotPasswordDto The forgot password request containing the entered username. (required) + * @param headers Optional headers to include in the request + * @return ForgotPasswordResult + * @throws ApiException if fails to make API call + */ + public ForgotPasswordResult forgotPassword(@org.eclipse.jdt.annotation.Nullable ForgotPasswordDto forgotPasswordDto, + Map headers) throws ApiException { + ApiResponse localVarResponse = forgotPasswordWithHttpInfo(forgotPasswordDto, headers); + return localVarResponse.getData(); + } + + /** + * Initiates the forgot password process for a local user. + * + * @param forgotPasswordDto The forgot password request containing the entered username. (required) + * @return ApiResponse<ForgotPasswordResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse forgotPasswordWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ForgotPasswordDto forgotPasswordDto) throws ApiException { + return forgotPasswordWithHttpInfo(forgotPasswordDto, null); + } + + /** + * Initiates the forgot password process for a local user. + * + * @param forgotPasswordDto The forgot password request containing the entered username. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<ForgotPasswordResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse forgotPasswordWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ForgotPasswordDto forgotPasswordDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = forgotPasswordRequestBuilder(forgotPasswordDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("forgotPassword", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + ForgotPasswordResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder forgotPasswordRequestBuilder( + @org.eclipse.jdt.annotation.Nullable ForgotPasswordDto forgotPasswordDto, Map headers) + throws ApiException { + // verify the required parameter 'forgotPasswordDto' is set + if (forgotPasswordDto == null) { + throw new ApiException(400, + "Missing the required parameter 'forgotPasswordDto' when calling forgotPassword"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/ForgotPassword"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(forgotPasswordDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Redeems a forgot password pin. + * + * @param forgotPasswordPinDto The forgot password pin request containing the entered pin. (required) + * @return PinRedeemResult + * @throws ApiException if fails to make API call + */ + public PinRedeemResult forgotPasswordPin( + @org.eclipse.jdt.annotation.Nullable ForgotPasswordPinDto forgotPasswordPinDto) throws ApiException { + return forgotPasswordPin(forgotPasswordPinDto, null); + } + + /** + * Redeems a forgot password pin. + * + * @param forgotPasswordPinDto The forgot password pin request containing the entered pin. (required) + * @param headers Optional headers to include in the request + * @return PinRedeemResult + * @throws ApiException if fails to make API call + */ + public PinRedeemResult forgotPasswordPin( + @org.eclipse.jdt.annotation.Nullable ForgotPasswordPinDto forgotPasswordPinDto, Map headers) + throws ApiException { + ApiResponse localVarResponse = forgotPasswordPinWithHttpInfo(forgotPasswordPinDto, headers); + return localVarResponse.getData(); + } + + /** + * Redeems a forgot password pin. + * + * @param forgotPasswordPinDto The forgot password pin request containing the entered pin. (required) + * @return ApiResponse<PinRedeemResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse forgotPasswordPinWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ForgotPasswordPinDto forgotPasswordPinDto) throws ApiException { + return forgotPasswordPinWithHttpInfo(forgotPasswordPinDto, null); + } + + /** + * Redeems a forgot password pin. + * + * @param forgotPasswordPinDto The forgot password pin request containing the entered pin. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<PinRedeemResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse forgotPasswordPinWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable ForgotPasswordPinDto forgotPasswordPinDto, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = forgotPasswordPinRequestBuilder(forgotPasswordPinDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("forgotPasswordPin", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + PinRedeemResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder forgotPasswordPinRequestBuilder( + @org.eclipse.jdt.annotation.Nullable ForgotPasswordPinDto forgotPasswordPinDto, Map headers) + throws ApiException { + // verify the required parameter 'forgotPasswordPinDto' is set + if (forgotPasswordPinDto == null) { + throw new ApiException(400, + "Missing the required parameter 'forgotPasswordPinDto' when calling forgotPasswordPin"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/ForgotPassword/Pin"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(forgotPasswordPinDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the user based on auth token. + * + * @return UserDto + * @throws ApiException if fails to make API call + */ + public UserDto getCurrentUser() throws ApiException { + return getCurrentUser(null); + } + + /** + * Gets the user based on auth token. + * + * @param headers Optional headers to include in the request + * @return UserDto + * @throws ApiException if fails to make API call + */ + public UserDto getCurrentUser(Map headers) throws ApiException { + ApiResponse localVarResponse = getCurrentUserWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets the user based on auth token. + * + * @return ApiResponse<UserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getCurrentUserWithHttpInfo() throws ApiException { + return getCurrentUserWithHttpInfo(null); + } + + /** + * Gets the user based on auth token. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<UserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getCurrentUserWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getCurrentUserRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getCurrentUser", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + UserDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getCurrentUserRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/Me"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of publicly visible users for display on a login screen. + * + * @return List<UserDto> + * @throws ApiException if fails to make API call + */ + public List getPublicUsers() throws ApiException { + return getPublicUsers(null); + } + + /** + * Gets a list of publicly visible users for display on a login screen. + * + * @param headers Optional headers to include in the request + * @return List<UserDto> + * @throws ApiException if fails to make API call + */ + public List getPublicUsers(Map headers) throws ApiException { + ApiResponse> localVarResponse = getPublicUsersWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Gets a list of publicly visible users for display on a login screen. + * + * @return ApiResponse<List<UserDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPublicUsersWithHttpInfo() throws ApiException { + return getPublicUsersWithHttpInfo(null); + } + + /** + * Gets a list of publicly visible users for display on a login screen. + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<UserDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getPublicUsersWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPublicUsersRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPublicUsers", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPublicUsersRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/Public"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a user by Id. + * + * @param userId The user id. (required) + * @return UserDto + * @throws ApiException if fails to make API call + */ + public UserDto getUserById(@org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + return getUserById(userId, null); + } + + /** + * Gets a user by Id. + * + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @return UserDto + * @throws ApiException if fails to make API call + */ + public UserDto getUserById(@org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getUserByIdWithHttpInfo(userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets a user by Id. + * + * @param userId The user id. (required) + * @return ApiResponse<UserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserByIdWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId) + throws ApiException { + return getUserByIdWithHttpInfo(userId, null); + } + + /** + * Gets a user by Id. + * + * @param userId The user id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserByIdWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUserByIdRequestBuilder(userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getUserById", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + UserDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUserByIdRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getUserById"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}".replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a list of users. + * + * @param isHidden Optional filter by IsHidden=true or false. (optional) + * @param isDisabled Optional filter by IsDisabled=true or false. (optional) + * @return List<UserDto> + * @throws ApiException if fails to make API call + */ + public List getUsers(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isDisabled) throws ApiException { + return getUsers(isHidden, isDisabled, null); + } + + /** + * Gets a list of users. + * + * @param isHidden Optional filter by IsHidden=true or false. (optional) + * @param isDisabled Optional filter by IsDisabled=true or false. (optional) + * @param headers Optional headers to include in the request + * @return List<UserDto> + * @throws ApiException if fails to make API call + */ + public List getUsers(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isDisabled, Map headers) throws ApiException { + ApiResponse> localVarResponse = getUsersWithHttpInfo(isHidden, isDisabled, headers); + return localVarResponse.getData(); + } + + /** + * Gets a list of users. + * + * @param isHidden Optional filter by IsHidden=true or false. (optional) + * @param isDisabled Optional filter by IsDisabled=true or false. (optional) + * @return ApiResponse<List<UserDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getUsersWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isDisabled) throws ApiException { + return getUsersWithHttpInfo(isHidden, isDisabled, null); + } + + /** + * Gets a list of users. + * + * @param isHidden Optional filter by IsHidden=true or false. (optional) + * @param isDisabled Optional filter by IsDisabled=true or false. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<UserDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getUsersWithHttpInfo(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isDisabled, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUsersRequestBuilder(isHidden, isDisabled, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getUsers", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUsersRequestBuilder(@org.eclipse.jdt.annotation.NonNull Boolean isHidden, + @org.eclipse.jdt.annotation.NonNull Boolean isDisabled, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "isHidden"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isHidden", isHidden)); + localVarQueryParameterBaseName = "isDisabled"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isDisabled", isDisabled)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a user. + * + * @param userId The user id. (required) + * @param userDto The updated user model. (required) + * @throws ApiException if fails to make API call + */ + public void updateUser(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserDto userDto) throws ApiException { + updateUser(userId, userDto, null); + } + + /** + * Updates a user. + * + * @param userId The user id. (required) + * @param userDto The updated user model. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateUser(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserDto userDto, Map headers) throws ApiException { + updateUserWithHttpInfo(userId, userDto, headers); + } + + /** + * Updates a user. + * + * @param userId The user id. (required) + * @param userDto The updated user model. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserDto userDto) throws ApiException { + return updateUserWithHttpInfo(userId, userDto, null); + } + + /** + * Updates a user. + * + * @param userId The user id. (required) + * @param userDto The updated user model. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserDto userDto, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserRequestBuilder(userId, userDto, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateUser", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateUserRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserDto userDto, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling updateUser"); + } + // verify the required parameter 'userDto' is set + if (userDto == null) { + throw new ApiException(400, "Missing the required parameter 'userDto' when calling updateUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}".replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(userDto); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a user configuration. + * + * @param userId The user id. (required) + * @param userConfiguration The new user configuration. (required) + * @throws ApiException if fails to make API call + */ + public void updateUserConfiguration(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserConfiguration userConfiguration) throws ApiException { + updateUserConfiguration(userId, userConfiguration, null); + } + + /** + * Updates a user configuration. + * + * @param userId The user id. (required) + * @param userConfiguration The new user configuration. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateUserConfiguration(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserConfiguration userConfiguration, Map headers) + throws ApiException { + updateUserConfigurationWithHttpInfo(userId, userConfiguration, headers); + } + + /** + * Updates a user configuration. + * + * @param userId The user id. (required) + * @param userConfiguration The new user configuration. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserConfiguration userConfiguration) throws ApiException { + return updateUserConfigurationWithHttpInfo(userId, userConfiguration, null); + } + + /** + * Updates a user configuration. + * + * @param userId The user id. (required) + * @param userConfiguration The new user configuration. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserConfigurationWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserConfiguration userConfiguration, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserConfigurationRequestBuilder(userId, userConfiguration, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateUserConfiguration", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateUserConfigurationRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserConfiguration userConfiguration, Map headers) + throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling updateUserConfiguration"); + } + // verify the required parameter 'userConfiguration' is set + if (userConfiguration == null) { + throw new ApiException(400, + "Missing the required parameter 'userConfiguration' when calling updateUserConfiguration"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Configuration".replace("{userId}", + ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(userConfiguration); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a user's easy password. + * + * @param userId The user id. (required) + * @param updateUserEasyPassword The + * M:Jellyfin.Api.Controllers.UserController.UpdateUserEasyPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserEasyPassword) + * request. (required) + * @throws ApiException if fails to make API call + */ + public void updateUserEasyPassword(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UpdateUserEasyPassword updateUserEasyPassword) throws ApiException { + updateUserEasyPassword(userId, updateUserEasyPassword, null); + } + + /** + * Updates a user's easy password. + * + * @param userId The user id. (required) + * @param updateUserEasyPassword The + * M:Jellyfin.Api.Controllers.UserController.UpdateUserEasyPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserEasyPassword) + * request. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateUserEasyPassword(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UpdateUserEasyPassword updateUserEasyPassword, + Map headers) throws ApiException { + updateUserEasyPasswordWithHttpInfo(userId, updateUserEasyPassword, headers); + } + + /** + * Updates a user's easy password. + * + * @param userId The user id. (required) + * @param updateUserEasyPassword The + * M:Jellyfin.Api.Controllers.UserController.UpdateUserEasyPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserEasyPassword) + * request. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserEasyPasswordWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UpdateUserEasyPassword updateUserEasyPassword) throws ApiException { + return updateUserEasyPasswordWithHttpInfo(userId, updateUserEasyPassword, null); + } + + /** + * Updates a user's easy password. + * + * @param userId The user id. (required) + * @param updateUserEasyPassword The + * M:Jellyfin.Api.Controllers.UserController.UpdateUserEasyPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserEasyPassword) + * request. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserEasyPasswordWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UpdateUserEasyPassword updateUserEasyPassword, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserEasyPasswordRequestBuilder(userId, + updateUserEasyPassword, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateUserEasyPassword", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateUserEasyPasswordRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UpdateUserEasyPassword updateUserEasyPassword, + Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling updateUserEasyPassword"); + } + // verify the required parameter 'updateUserEasyPassword' is set + if (updateUserEasyPassword == null) { + throw new ApiException(400, + "Missing the required parameter 'updateUserEasyPassword' when calling updateUserEasyPassword"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/EasyPassword".replace("{userId}", + ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(updateUserEasyPassword); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a user's password. + * + * @param userId The user id. (required) + * @param updateUserPassword The + * M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserPassword) + * request. (required) + * @throws ApiException if fails to make API call + */ + public void updateUserPassword(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UpdateUserPassword updateUserPassword) throws ApiException { + updateUserPassword(userId, updateUserPassword, null); + } + + /** + * Updates a user's password. + * + * @param userId The user id. (required) + * @param updateUserPassword The + * M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserPassword) + * request. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateUserPassword(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UpdateUserPassword updateUserPassword, Map headers) + throws ApiException { + updateUserPasswordWithHttpInfo(userId, updateUserPassword, headers); + } + + /** + * Updates a user's password. + * + * @param userId The user id. (required) + * @param updateUserPassword The + * M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserPassword) + * request. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserPasswordWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UpdateUserPassword updateUserPassword) throws ApiException { + return updateUserPasswordWithHttpInfo(userId, updateUserPassword, null); + } + + /** + * Updates a user's password. + * + * @param userId The user id. (required) + * @param updateUserPassword The + * M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserPassword) + * request. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserPasswordWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UpdateUserPassword updateUserPassword, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserPasswordRequestBuilder(userId, updateUserPassword, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateUserPassword", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateUserPasswordRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UpdateUserPassword updateUserPassword, Map headers) + throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling updateUserPassword"); + } + // verify the required parameter 'updateUserPassword' is set + if (updateUserPassword == null) { + throw new ApiException(400, + "Missing the required parameter 'updateUserPassword' when calling updateUserPassword"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Password".replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(updateUserPassword); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a user policy. + * + * @param userId The user id. (required) + * @param userPolicy The new user policy. (required) + * @throws ApiException if fails to make API call + */ + public void updateUserPolicy(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserPolicy userPolicy) throws ApiException { + updateUserPolicy(userId, userPolicy, null); + } + + /** + * Updates a user policy. + * + * @param userId The user id. (required) + * @param userPolicy The new user policy. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateUserPolicy(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserPolicy userPolicy, Map headers) + throws ApiException { + updateUserPolicyWithHttpInfo(userId, userPolicy, headers); + } + + /** + * Updates a user policy. + * + * @param userId The user id. (required) + * @param userPolicy The new user policy. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserPolicyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserPolicy userPolicy) throws ApiException { + return updateUserPolicyWithHttpInfo(userId, userPolicy, null); + } + + /** + * Updates a user policy. + * + * @param userId The user id. (required) + * @param userPolicy The new user policy. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserPolicyWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserPolicy userPolicy, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserPolicyRequestBuilder(userId, userPolicy, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateUserPolicy", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateUserPolicyRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UserPolicy userPolicy, Map headers) + throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling updateUserPolicy"); + } + // verify the required parameter 'userPolicy' is set + if (userPolicy == null) { + throw new ApiException(400, "Missing the required parameter 'userPolicy' when calling updateUserPolicy"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Policy".replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(userPolicy); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/UserLibraryApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/UserLibraryApi.java new file mode 100644 index 0000000000000..dd6784625e2dc --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/UserLibraryApi.java @@ -0,0 +1,1512 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.UserItemDataDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserLibraryApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public UserLibraryApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserLibraryApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Deletes a user's saved personal rating for an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto deleteUserItemRating(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return deleteUserItemRating(userId, itemId, null); + } + + /** + * Deletes a user's saved personal rating for an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto deleteUserItemRating(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + ApiResponse localVarResponse = deleteUserItemRatingWithHttpInfo(userId, itemId, headers); + return localVarResponse.getData(); + } + + /** + * Deletes a user's saved personal rating for an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserItemRatingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + return deleteUserItemRatingWithHttpInfo(userId, itemId, null); + } + + /** + * Deletes a user's saved personal rating for an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserItemRatingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteUserItemRatingRequestBuilder(userId, itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteUserItemRating", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + UserItemDataDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteUserItemRatingRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling deleteUserItemRating"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteUserItemRating"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Items/{itemId}/Rating" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets intros to play before the main media item plays. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getIntros(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return getIntros(userId, itemId, null); + } + + /** + * Gets intros to play before the main media item plays. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getIntros(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + ApiResponse localVarResponse = getIntrosWithHttpInfo(userId, itemId, headers); + return localVarResponse.getData(); + } + + /** + * Gets intros to play before the main media item plays. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getIntrosWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return getIntrosWithHttpInfo(userId, itemId, null); + } + + /** + * Gets intros to play before the main media item plays. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getIntrosWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getIntrosRequestBuilder(userId, itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getIntros", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getIntrosRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getIntros"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getIntros"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Items/{itemId}/Intros" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets an item from a user's library. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getItem(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return getItem(userId, itemId, null); + } + + /** + * Gets an item from a user's library. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getItem(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + ApiResponse localVarResponse = getItemWithHttpInfo(userId, itemId, headers); + return localVarResponse.getData(); + } + + /** + * Gets an item from a user's library. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return getItemWithHttpInfo(userId, itemId, null); + } + + /** + * Gets an item from a user's library. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getItemRequestBuilder(userId, itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getItem", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getItem"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Items/{itemId}" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets latest media. + * + * @param userId User id. (required) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isPlayed Filter by items that are played, or not. (optional) + * @param enableImages Optional. include image information in output. (optional) + * @param imageTypeLimit Optional. the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. include user data. (optional) + * @param limit Return item limit. (optional, default to 20) + * @param groupItems Whether or not to group items into a parent container. (optional, default to true) + * @return List<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public List getLatestMedia(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean groupItems) + throws ApiException { + return getLatestMedia(userId, parentId, fields, includeItemTypes, isPlayed, enableImages, imageTypeLimit, + enableImageTypes, enableUserData, limit, groupItems, null); + } + + /** + * Gets latest media. + * + * @param userId User id. (required) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isPlayed Filter by items that are played, or not. (optional) + * @param enableImages Optional. include image information in output. (optional) + * @param imageTypeLimit Optional. the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. include user data. (optional) + * @param limit Return item limit. (optional, default to 20) + * @param groupItems Whether or not to group items into a parent container. (optional, default to true) + * @param headers Optional headers to include in the request + * @return List<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public List getLatestMedia(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean groupItems, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getLatestMediaWithHttpInfo(userId, parentId, fields, + includeItemTypes, isPlayed, enableImages, imageTypeLimit, enableImageTypes, enableUserData, limit, + groupItems, headers); + return localVarResponse.getData(); + } + + /** + * Gets latest media. + * + * @param userId User id. (required) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isPlayed Filter by items that are played, or not. (optional) + * @param enableImages Optional. include image information in output. (optional) + * @param imageTypeLimit Optional. the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. include user data. (optional) + * @param limit Return item limit. (optional, default to 20) + * @param groupItems Whether or not to group items into a parent container. (optional, default to true) + * @return ApiResponse<List<BaseItemDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getLatestMediaWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean groupItems) + throws ApiException { + return getLatestMediaWithHttpInfo(userId, parentId, fields, includeItemTypes, isPlayed, enableImages, + imageTypeLimit, enableImageTypes, enableUserData, limit, groupItems, null); + } + + /** + * Gets latest media. + * + * @param userId User id. (required) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows + * multiple, comma delimited. (optional) + * @param isPlayed Filter by items that are played, or not. (optional) + * @param enableImages Optional. include image information in output. (optional) + * @param imageTypeLimit Optional. the max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param enableUserData Optional. include user data. (optional) + * @param limit Return item limit. (optional, default to 20) + * @param groupItems Whether or not to group items into a parent container. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<BaseItemDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getLatestMediaWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean groupItems, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLatestMediaRequestBuilder(userId, parentId, fields, + includeItemTypes, isPlayed, enableImages, imageTypeLimit, enableImageTypes, enableUserData, limit, + groupItems, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLatestMedia", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLatestMediaRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull Boolean isPlayed, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer limit, @org.eclipse.jdt.annotation.NonNull Boolean groupItems, + Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getLatestMedia"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Items/Latest".replace("{userId}", + ApiClient.urlEncode(userId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "isPlayed"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("isPlayed", isPlayed)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "groupItems"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("groupItems", groupItems)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets local trailers for an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @return List<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public List getLocalTrailers(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return getLocalTrailers(userId, itemId, null); + } + + /** + * Gets local trailers for an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return List<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public List getLocalTrailers(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + ApiResponse> localVarResponse = getLocalTrailersWithHttpInfo(userId, itemId, headers); + return localVarResponse.getData(); + } + + /** + * Gets local trailers for an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @return ApiResponse<List<BaseItemDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getLocalTrailersWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return getLocalTrailersWithHttpInfo(userId, itemId, null); + } + + /** + * Gets local trailers for an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<BaseItemDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getLocalTrailersWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLocalTrailersRequestBuilder(userId, itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getLocalTrailers", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLocalTrailersRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getLocalTrailers"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getLocalTrailers"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Items/{itemId}/LocalTrailers" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets the root folder from a user's library. + * + * @param userId User id. (required) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getRootFolder(@org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + return getRootFolder(userId, null); + } + + /** + * Gets the root folder from a user's library. + * + * @param userId User id. (required) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getRootFolder(@org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) + throws ApiException { + ApiResponse localVarResponse = getRootFolderWithHttpInfo(userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets the root folder from a user's library. + * + * @param userId User id. (required) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRootFolderWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId) + throws ApiException { + return getRootFolderWithHttpInfo(userId, null); + } + + /** + * Gets the root folder from a user's library. + * + * @param userId User id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getRootFolderWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getRootFolderRequestBuilder(userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getRootFolder", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getRootFolderRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getRootFolder"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Items/Root".replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets special features for an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @return List<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public List getSpecialFeatures(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return getSpecialFeatures(userId, itemId, null); + } + + /** + * Gets special features for an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return List<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public List getSpecialFeatures(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + ApiResponse> localVarResponse = getSpecialFeaturesWithHttpInfo(userId, itemId, headers); + return localVarResponse.getData(); + } + + /** + * Gets special features for an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @return ApiResponse<List<BaseItemDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getSpecialFeaturesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + return getSpecialFeaturesWithHttpInfo(userId, itemId, null); + } + + /** + * Gets special features for an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<BaseItemDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getSpecialFeaturesWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSpecialFeaturesRequestBuilder(userId, itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getSpecialFeatures", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSpecialFeaturesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getSpecialFeatures"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getSpecialFeatures"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Items/{itemId}/SpecialFeatures" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Marks an item as a favorite. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto markFavoriteItem(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return markFavoriteItem(userId, itemId, null); + } + + /** + * Marks an item as a favorite. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto markFavoriteItem(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + ApiResponse localVarResponse = markFavoriteItemWithHttpInfo(userId, itemId, headers); + return localVarResponse.getData(); + } + + /** + * Marks an item as a favorite. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse markFavoriteItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return markFavoriteItemWithHttpInfo(userId, itemId, null); + } + + /** + * Marks an item as a favorite. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse markFavoriteItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = markFavoriteItemRequestBuilder(userId, itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("markFavoriteItem", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + UserItemDataDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder markFavoriteItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling markFavoriteItem"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling markFavoriteItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/FavoriteItems/{itemId}" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Unmarks item as a favorite. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto unmarkFavoriteItem(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return unmarkFavoriteItem(userId, itemId, null); + } + + /** + * Unmarks item as a favorite. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto unmarkFavoriteItem(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + ApiResponse localVarResponse = unmarkFavoriteItemWithHttpInfo(userId, itemId, headers); + return localVarResponse.getData(); + } + + /** + * Unmarks item as a favorite. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse unmarkFavoriteItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + return unmarkFavoriteItemWithHttpInfo(userId, itemId, null); + } + + /** + * Unmarks item as a favorite. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse unmarkFavoriteItemWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = unmarkFavoriteItemRequestBuilder(userId, itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("unmarkFavoriteItem", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + UserItemDataDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder unmarkFavoriteItemRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling unmarkFavoriteItem"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling unmarkFavoriteItem"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/FavoriteItems/{itemId}" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a user's rating for an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param likes Whether this + * M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Guid,System.Guid,System.Nullable{System.Boolean}) + * is likes. (optional) + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto updateUserItemRating(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull Boolean likes) + throws ApiException { + return updateUserItemRating(userId, itemId, likes, null); + } + + /** + * Updates a user's rating for an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param likes Whether this + * M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Guid,System.Guid,System.Nullable{System.Boolean}) + * is likes. (optional) + * @param headers Optional headers to include in the request + * @return UserItemDataDto + * @throws ApiException if fails to make API call + */ + public UserItemDataDto updateUserItemRating(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull Boolean likes, + Map headers) throws ApiException { + ApiResponse localVarResponse = updateUserItemRatingWithHttpInfo(userId, itemId, likes, + headers); + return localVarResponse.getData(); + } + + /** + * Updates a user's rating for an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param likes Whether this + * M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Guid,System.Guid,System.Nullable{System.Boolean}) + * is likes. (optional) + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserItemRatingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean likes) throws ApiException { + return updateUserItemRatingWithHttpInfo(userId, itemId, likes, null); + } + + /** + * Updates a user's rating for an item. + * + * @param userId User id. (required) + * @param itemId Item id. (required) + * @param likes Whether this + * M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Guid,System.Guid,System.Nullable{System.Boolean}) + * is likes. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<UserItemDataDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserItemRatingWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, @org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull Boolean likes, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserItemRatingRequestBuilder(userId, itemId, likes, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateUserItemRating", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + UserItemDataDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateUserItemRatingRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull Boolean likes, + Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling updateUserItemRating"); + } + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling updateUserItemRating"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Items/{itemId}/Rating" + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "likes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("likes", likes)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/UserViewsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/UserViewsApi.java new file mode 100644 index 0000000000000..285f5feec87bd --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/UserViewsApi.java @@ -0,0 +1,421 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SpecialViewOptionDto; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserViewsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public UserViewsApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserViewsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Get user view grouping options. + * + * @param userId User id. (required) + * @return List<SpecialViewOptionDto> + * @throws ApiException if fails to make API call + */ + public List getGroupingOptions(@org.eclipse.jdt.annotation.Nullable UUID userId) + throws ApiException { + return getGroupingOptions(userId, null); + } + + /** + * Get user view grouping options. + * + * @param userId User id. (required) + * @param headers Optional headers to include in the request + * @return List<SpecialViewOptionDto> + * @throws ApiException if fails to make API call + */ + public List getGroupingOptions(@org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { + ApiResponse> localVarResponse = getGroupingOptionsWithHttpInfo(userId, headers); + return localVarResponse.getData(); + } + + /** + * Get user view grouping options. + * + * @param userId User id. (required) + * @return ApiResponse<List<SpecialViewOptionDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getGroupingOptionsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId) throws ApiException { + return getGroupingOptionsWithHttpInfo(userId, null); + } + + /** + * Get user view grouping options. + * + * @param userId User id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<SpecialViewOptionDto>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getGroupingOptionsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getGroupingOptionsRequestBuilder(userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getGroupingOptions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + List responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, + new TypeReference>() { + }); + + localVarResponse.body().close(); + + return new ApiResponse>(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getGroupingOptionsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + Map headers) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getGroupingOptions"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/GroupingOptions".replace("{userId}", + ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get user views. + * + * @param userId User id. (required) + * @param includeExternalContent Whether or not to include external views such as channels or live tv. (optional) + * @param presetViews Preset views. (optional) + * @param includeHidden Whether or not to include hidden content. (optional, default to false) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getUserViews(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean includeExternalContent, + @org.eclipse.jdt.annotation.NonNull List presetViews, + @org.eclipse.jdt.annotation.NonNull Boolean includeHidden) throws ApiException { + return getUserViews(userId, includeExternalContent, presetViews, includeHidden, null); + } + + /** + * Get user views. + * + * @param userId User id. (required) + * @param includeExternalContent Whether or not to include external views such as channels or live tv. (optional) + * @param presetViews Preset views. (optional) + * @param includeHidden Whether or not to include hidden content. (optional, default to false) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getUserViews(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean includeExternalContent, + @org.eclipse.jdt.annotation.NonNull List presetViews, + @org.eclipse.jdt.annotation.NonNull Boolean includeHidden, Map headers) + throws ApiException { + ApiResponse localVarResponse = getUserViewsWithHttpInfo(userId, includeExternalContent, + presetViews, includeHidden, headers); + return localVarResponse.getData(); + } + + /** + * Get user views. + * + * @param userId User id. (required) + * @param includeExternalContent Whether or not to include external views such as channels or live tv. (optional) + * @param presetViews Preset views. (optional) + * @param includeHidden Whether or not to include hidden content. (optional, default to false) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserViewsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean includeExternalContent, + @org.eclipse.jdt.annotation.NonNull List presetViews, + @org.eclipse.jdt.annotation.NonNull Boolean includeHidden) throws ApiException { + return getUserViewsWithHttpInfo(userId, includeExternalContent, presetViews, includeHidden, null); + } + + /** + * Get user views. + * + * @param userId User id. (required) + * @param includeExternalContent Whether or not to include external views such as channels or live tv. (optional) + * @param presetViews Preset views. (optional) + * @param includeHidden Whether or not to include hidden content. (optional, default to false) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserViewsWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean includeExternalContent, + @org.eclipse.jdt.annotation.NonNull List presetViews, + @org.eclipse.jdt.annotation.NonNull Boolean includeHidden, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUserViewsRequestBuilder(userId, includeExternalContent, + presetViews, includeHidden, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getUserViews", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUserViewsRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID userId, + @org.eclipse.jdt.annotation.NonNull Boolean includeExternalContent, + @org.eclipse.jdt.annotation.NonNull List presetViews, + @org.eclipse.jdt.annotation.NonNull Boolean includeHidden, Map headers) + throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling getUserViews"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Users/{userId}/Views".replace("{userId}", ApiClient.urlEncode(userId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "includeExternalContent"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeExternalContent", includeExternalContent)); + localVarQueryParameterBaseName = "presetViews"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "presetViews", presetViews)); + localVarQueryParameterBaseName = "includeHidden"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("includeHidden", includeHidden)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/VideoAttachmentsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/VideoAttachmentsApi.java new file mode 100644 index 0000000000000..9bf6c27c8b9b6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/VideoAttachmentsApi.java @@ -0,0 +1,275 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.Map; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; + +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class VideoAttachmentsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public VideoAttachmentsApi() { + this(Configuration.getDefaultApiClient()); + } + + public VideoAttachmentsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Get video attachment. + * + * @param videoId Video ID. (required) + * @param mediaSourceId Media Source ID. (required) + * @param index Attachment Index. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getAttachment(@org.eclipse.jdt.annotation.Nullable UUID videoId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { + return getAttachment(videoId, mediaSourceId, index, null); + } + + /** + * Get video attachment. + * + * @param videoId Video ID. (required) + * @param mediaSourceId Media Source ID. (required) + * @param index Attachment Index. (required) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getAttachment(@org.eclipse.jdt.annotation.Nullable UUID videoId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer index, Map headers) throws ApiException { + ApiResponse localVarResponse = getAttachmentWithHttpInfo(videoId, mediaSourceId, index, headers); + return localVarResponse.getData(); + } + + /** + * Get video attachment. + * + * @param videoId Video ID. (required) + * @param mediaSourceId Media Source ID. (required) + * @param index Attachment Index. (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAttachmentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID videoId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer index) throws ApiException { + return getAttachmentWithHttpInfo(videoId, mediaSourceId, index, null); + } + + /** + * Get video attachment. + * + * @param videoId Video ID. (required) + * @param mediaSourceId Media Source ID. (required) + * @param index Attachment Index. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAttachmentWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID videoId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer index, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAttachmentRequestBuilder(videoId, mediaSourceId, index, + headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getAttachment", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAttachmentRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID videoId, + @org.eclipse.jdt.annotation.Nullable String mediaSourceId, + @org.eclipse.jdt.annotation.Nullable Integer index, Map headers) throws ApiException { + // verify the required parameter 'videoId' is set + if (videoId == null) { + throw new ApiException(400, "Missing the required parameter 'videoId' when calling getAttachment"); + } + // verify the required parameter 'mediaSourceId' is set + if (mediaSourceId == null) { + throw new ApiException(400, "Missing the required parameter 'mediaSourceId' when calling getAttachment"); + } + // verify the required parameter 'index' is set + if (index == null) { + throw new ApiException(400, "Missing the required parameter 'index' when calling getAttachment"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{videoId}/{mediaSourceId}/Attachments/{index}" + .replace("{videoId}", ApiClient.urlEncode(videoId.toString())) + .replace("{mediaSourceId}", ApiClient.urlEncode(mediaSourceId.toString())) + .replace("{index}", ApiClient.urlEncode(index.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/octet-stream, application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/VideosApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/VideosApi.java new file mode 100644 index 0000000000000..b4f85af422861 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/VideosApi.java @@ -0,0 +1,3407 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.EncodingContext; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SubtitleDeliveryMethod; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class VideosApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public VideosApi() { + this(Configuration.getDefaultApiClient()); + } + + public VideosApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Removes alternate video sources. + * + * @param itemId The item id. (required) + * @throws ApiException if fails to make API call + */ + public void deleteAlternateSources(@org.eclipse.jdt.annotation.Nullable UUID itemId) throws ApiException { + deleteAlternateSources(itemId, null); + } + + /** + * Removes alternate video sources. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteAlternateSources(@org.eclipse.jdt.annotation.Nullable UUID itemId, Map headers) + throws ApiException { + deleteAlternateSourcesWithHttpInfo(itemId, headers); + } + + /** + * Removes alternate video sources. + * + * @param itemId The item id. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteAlternateSourcesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId) + throws ApiException { + return deleteAlternateSourcesWithHttpInfo(itemId, null); + } + + /** + * Removes alternate video sources. + * + * @param itemId The item id. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteAlternateSourcesWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteAlternateSourcesRequestBuilder(itemId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteAlternateSources", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteAlternateSourcesRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling deleteAlternateSources"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/AlternateSources".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets additional parts for a video. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getAdditionalPart(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getAdditionalPart(itemId, userId, null); + } + + /** + * Gets additional parts for a video. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getAdditionalPart(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getAdditionalPartWithHttpInfo(itemId, userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets additional parts for a video. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAdditionalPartWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId) + throws ApiException { + return getAdditionalPartWithHttpInfo(itemId, userId, null); + } + + /** + * Gets additional parts for a video. + * + * @param itemId The item id. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAdditionalPartWithHttpInfo( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.NonNull UUID userId, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAdditionalPartRequestBuilder(itemId, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getAdditionalPart", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAdditionalPartRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getAdditionalPart"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/AdditionalParts".replace("{itemId}", + ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getVideoStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return getVideoStream(itemId, container, _static, params, tag, deviceProfileId, playSessionId, segmentContainer, + segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getVideoStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + ApiResponse localVarResponse = getVideoStreamWithHttpInfo(itemId, container, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, + videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, + deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, headers); + return localVarResponse.getData(); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVideoStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return getVideoStreamWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVideoStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getVideoStreamRequestBuilder(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getVideoStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getVideoStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling getVideoStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/stream".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "container"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("container", container)); + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "video/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File getVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return getVideoStreamByContainer(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File getVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + ApiResponse localVarResponse = getVideoStreamByContainerWithHttpInfo(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, headers); + return localVarResponse.getData(); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVideoStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return getVideoStreamByContainerWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, + playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, + enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, + maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + null); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse getVideoStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getVideoStreamByContainerRequestBuilder(itemId, container, _static, + params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getVideoStreamByContainer", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getVideoStreamByContainerRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling getVideoStreamByContainer"); + } + // verify the required parameter 'container' is set + if (container == null) { + throw new ApiException(400, + "Missing the required parameter 'container' when calling getVideoStreamByContainer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/stream.{container}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{container}", ApiClient.urlEncode(container.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "video/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headVideoStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return headVideoStream(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headVideoStream(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + ApiResponse localVarResponse = headVideoStreamWithHttpInfo(itemId, container, _static, params, tag, + deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, + audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, + audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, + framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, + videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, + deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, headers); + return localVarResponse.getData(); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headVideoStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return headVideoStreamWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (optional) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headVideoStreamWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headVideoStreamRequestBuilder(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headVideoStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headVideoStreamRequestBuilder(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.NonNull String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, "Missing the required parameter 'itemId' when calling headVideoStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/stream".replace("{itemId}", ApiClient.urlEncode(itemId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "container"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("container", container)); + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "video/*"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return File + * @throws ApiException if fails to make API call + */ + public File headVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return headVideoStreamByContainer(itemId, container, _static, params, tag, deviceProfileId, playSessionId, + segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, + allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, + audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, maxFramerate, copyTimestamps, + startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, + maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, requireNonAnamorphic, + transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, videoCodec, + subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, null); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return File + * @throws ApiException if fails to make API call + */ + public File headVideoStreamByContainer(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + ApiResponse localVarResponse = headVideoStreamByContainerWithHttpInfo(itemId, container, _static, params, + tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, + deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, headers); + return localVarResponse.getData(); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headVideoStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions) throws ApiException { + return headVideoStreamByContainerWithHttpInfo(itemId, container, _static, params, tag, deviceProfileId, + playSessionId, segmentContainer, segmentLength, minSegments, mediaSourceId, deviceId, audioCodec, + enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, breakOnNonKeyFrames, audioSampleRate, + maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, profile, level, framerate, + maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, maxHeight, videoBitRate, + subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, requireAvc, deInterlace, + requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, enableMpegtsM2TsMode, + videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, context, streamOptions, + null); + } + + /** + * Gets a video stream. + * + * @param itemId The item id. (required) + * @param container The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, + * avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. (required) + * @param _static Optional. If true, the original file will be streamed statically without any encoding. Use either + * no url extension or the original file extension. true/false. (optional) + * @param params The streaming parameters. (optional) + * @param tag The tag. (optional) + * @param deviceProfileId Optional. The dlna device profile id to utilize. (optional) + * @param playSessionId The play session id. (optional) + * @param segmentContainer The segment container. (optional) + * @param segmentLength The segment length. (optional) + * @param minSegments The minimum number of segments. (optional) + * @param mediaSourceId The media version id, if playing an alternate version. (optional) + * @param deviceId The device id of the client requesting. Used to stop encoding processes when needed. (optional) + * @param audioCodec Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select + * using the url's extension. Options: aac, mp3, vorbis, wma. (optional) + * @param enableAutoStreamCopy Whether or not to allow automatic stream copy if requested values match the original + * source. Defaults to true. (optional) + * @param allowVideoStreamCopy Whether or not to allow copying of the video stream url. (optional) + * @param allowAudioStreamCopy Whether or not to allow copying of the audio stream url. (optional) + * @param breakOnNonKeyFrames Optional. Whether to break on non key frames. (optional) + * @param audioSampleRate Optional. Specify a specific audio sample rate, e.g. 44100. (optional) + * @param maxAudioBitDepth Optional. The maximum audio bit depth. (optional) + * @param audioBitRate Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to + * encoder defaults. (optional) + * @param audioChannels Optional. Specify a specific number of audio channels to encode to, e.g. 2. (optional) + * @param maxAudioChannels Optional. Specify a maximum number of audio channels to encode to, e.g. 2. (optional) + * @param profile Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. + * (optional) + * @param level Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. (optional) + * @param framerate Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted + * unless the device has specific requirements. (optional) + * @param maxFramerate Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should + * be omitted unless the device has specific requirements. (optional) + * @param copyTimestamps Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + * (optional) + * @param startTimeTicks Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. (optional) + * @param width Optional. The fixed horizontal resolution of the encoded video. (optional) + * @param height Optional. The fixed vertical resolution of the encoded video. (optional) + * @param maxWidth Optional. The maximum horizontal resolution of the encoded video. (optional) + * @param maxHeight Optional. The maximum vertical resolution of the encoded video. (optional) + * @param videoBitRate Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to + * encoder defaults. (optional) + * @param subtitleStreamIndex Optional. The index of the subtitle stream to use. If omitted no subtitles will be + * used. (optional) + * @param subtitleMethod Optional. Specify the subtitle delivery method. (optional) + * @param maxRefFrames Optional. (optional) + * @param maxVideoBitDepth Optional. The maximum video bit depth. (optional) + * @param requireAvc Optional. Whether to require avc. (optional) + * @param deInterlace Optional. Whether to deinterlace the video. (optional) + * @param requireNonAnamorphic Optional. Whether to require a non anamorphic stream. (optional) + * @param transcodingMaxAudioChannels Optional. The maximum number of audio channels to transcode. (optional) + * @param cpuCoreLimit Optional. The limit of how many cpu cores to use. (optional) + * @param liveStreamId The live stream id. (optional) + * @param enableMpegtsM2TsMode Optional. Whether to enable the MpegtsM2Ts mode. (optional) + * @param videoCodec Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select + * using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. + * (optional) + * @param subtitleCodec Optional. Specify a subtitle codec to encode to. (optional) + * @param transcodeReasons Optional. The transcoding reason. (optional) + * @param audioStreamIndex Optional. The index of the audio stream to use. If omitted the first audio stream will be + * used. (optional) + * @param videoStreamIndex Optional. The index of the video stream to use. If omitted the first video stream will be + * used. (optional) + * @param context Optional. The MediaBrowser.Model.Dlna.EncodingContext. (optional) + * @param streamOptions Optional. The streaming options. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse headVideoStreamByContainerWithHttpInfo(@org.eclipse.jdt.annotation.Nullable UUID itemId, + @org.eclipse.jdt.annotation.Nullable String container, @org.eclipse.jdt.annotation.NonNull Boolean _static, + @org.eclipse.jdt.annotation.NonNull String params, @org.eclipse.jdt.annotation.NonNull String tag, + @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = headVideoStreamByContainerRequestBuilder(itemId, container, + _static, params, tag, deviceProfileId, playSessionId, segmentContainer, segmentLength, minSegments, + mediaSourceId, deviceId, audioCodec, enableAutoStreamCopy, allowVideoStreamCopy, allowAudioStreamCopy, + breakOnNonKeyFrames, audioSampleRate, maxAudioBitDepth, audioBitRate, audioChannels, maxAudioChannels, + profile, level, framerate, maxFramerate, copyTimestamps, startTimeTicks, width, height, maxWidth, + maxHeight, videoBitRate, subtitleStreamIndex, subtitleMethod, maxRefFrames, maxVideoBitDepth, + requireAvc, deInterlace, requireNonAnamorphic, transcodingMaxAudioChannels, cpuCoreLimit, liveStreamId, + enableMpegtsM2TsMode, videoCodec, subtitleCodec, transcodeReasons, audioStreamIndex, videoStreamIndex, + context, streamOptions, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("headVideoStreamByContainer", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + + // Handle file downloading. + File responseValue = downloadFileFromResponse(localVarResponse); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder headVideoStreamByContainerRequestBuilder( + @org.eclipse.jdt.annotation.Nullable UUID itemId, @org.eclipse.jdt.annotation.Nullable String container, + @org.eclipse.jdt.annotation.NonNull Boolean _static, @org.eclipse.jdt.annotation.NonNull String params, + @org.eclipse.jdt.annotation.NonNull String tag, @org.eclipse.jdt.annotation.NonNull String deviceProfileId, + @org.eclipse.jdt.annotation.NonNull String playSessionId, + @org.eclipse.jdt.annotation.NonNull String segmentContainer, + @org.eclipse.jdt.annotation.NonNull Integer segmentLength, + @org.eclipse.jdt.annotation.NonNull Integer minSegments, + @org.eclipse.jdt.annotation.NonNull String mediaSourceId, + @org.eclipse.jdt.annotation.NonNull String deviceId, @org.eclipse.jdt.annotation.NonNull String audioCodec, + @org.eclipse.jdt.annotation.NonNull Boolean enableAutoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy, + @org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames, + @org.eclipse.jdt.annotation.NonNull Integer audioSampleRate, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioBitDepth, + @org.eclipse.jdt.annotation.NonNull Integer audioBitRate, + @org.eclipse.jdt.annotation.NonNull Integer audioChannels, + @org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels, + @org.eclipse.jdt.annotation.NonNull String profile, @org.eclipse.jdt.annotation.NonNull String level, + @org.eclipse.jdt.annotation.NonNull Float framerate, @org.eclipse.jdt.annotation.NonNull Float maxFramerate, + @org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps, + @org.eclipse.jdt.annotation.NonNull Long startTimeTicks, @org.eclipse.jdt.annotation.NonNull Integer width, + @org.eclipse.jdt.annotation.NonNull Integer height, @org.eclipse.jdt.annotation.NonNull Integer maxWidth, + @org.eclipse.jdt.annotation.NonNull Integer maxHeight, + @org.eclipse.jdt.annotation.NonNull Integer videoBitRate, + @org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex, + @org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod subtitleMethod, + @org.eclipse.jdt.annotation.NonNull Integer maxRefFrames, + @org.eclipse.jdt.annotation.NonNull Integer maxVideoBitDepth, + @org.eclipse.jdt.annotation.NonNull Boolean requireAvc, + @org.eclipse.jdt.annotation.NonNull Boolean deInterlace, + @org.eclipse.jdt.annotation.NonNull Boolean requireNonAnamorphic, + @org.eclipse.jdt.annotation.NonNull Integer transcodingMaxAudioChannels, + @org.eclipse.jdt.annotation.NonNull Integer cpuCoreLimit, + @org.eclipse.jdt.annotation.NonNull String liveStreamId, + @org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode, + @org.eclipse.jdt.annotation.NonNull String videoCodec, + @org.eclipse.jdt.annotation.NonNull String subtitleCodec, + @org.eclipse.jdt.annotation.NonNull String transcodeReasons, + @org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex, + @org.eclipse.jdt.annotation.NonNull Integer videoStreamIndex, + @org.eclipse.jdt.annotation.NonNull EncodingContext context, + @org.eclipse.jdt.annotation.NonNull Map streamOptions, Map headers) + throws ApiException { + // verify the required parameter 'itemId' is set + if (itemId == null) { + throw new ApiException(400, + "Missing the required parameter 'itemId' when calling headVideoStreamByContainer"); + } + // verify the required parameter 'container' is set + if (container == null) { + throw new ApiException(400, + "Missing the required parameter 'container' when calling headVideoStreamByContainer"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/{itemId}/stream.{container}" + .replace("{itemId}", ApiClient.urlEncode(itemId.toString())) + .replace("{container}", ApiClient.urlEncode(container.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "static"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("static", _static)); + localVarQueryParameterBaseName = "params"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("params", params)); + localVarQueryParameterBaseName = "tag"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("tag", tag)); + localVarQueryParameterBaseName = "deviceProfileId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceProfileId", deviceProfileId)); + localVarQueryParameterBaseName = "playSessionId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("playSessionId", playSessionId)); + localVarQueryParameterBaseName = "segmentContainer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentContainer", segmentContainer)); + localVarQueryParameterBaseName = "segmentLength"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("segmentLength", segmentLength)); + localVarQueryParameterBaseName = "minSegments"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("minSegments", minSegments)); + localVarQueryParameterBaseName = "mediaSourceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mediaSourceId", mediaSourceId)); + localVarQueryParameterBaseName = "deviceId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deviceId", deviceId)); + localVarQueryParameterBaseName = "audioCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioCodec", audioCodec)); + localVarQueryParameterBaseName = "enableAutoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableAutoStreamCopy", enableAutoStreamCopy)); + localVarQueryParameterBaseName = "allowVideoStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowVideoStreamCopy", allowVideoStreamCopy)); + localVarQueryParameterBaseName = "allowAudioStreamCopy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("allowAudioStreamCopy", allowAudioStreamCopy)); + localVarQueryParameterBaseName = "breakOnNonKeyFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("breakOnNonKeyFrames", breakOnNonKeyFrames)); + localVarQueryParameterBaseName = "audioSampleRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioSampleRate", audioSampleRate)); + localVarQueryParameterBaseName = "maxAudioBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioBitDepth", maxAudioBitDepth)); + localVarQueryParameterBaseName = "audioBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioBitRate", audioBitRate)); + localVarQueryParameterBaseName = "audioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioChannels", audioChannels)); + localVarQueryParameterBaseName = "maxAudioChannels"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxAudioChannels", maxAudioChannels)); + localVarQueryParameterBaseName = "profile"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profile", profile)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "framerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("framerate", framerate)); + localVarQueryParameterBaseName = "maxFramerate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxFramerate", maxFramerate)); + localVarQueryParameterBaseName = "copyTimestamps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("copyTimestamps", copyTimestamps)); + localVarQueryParameterBaseName = "startTimeTicks"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTimeTicks", startTimeTicks)); + localVarQueryParameterBaseName = "width"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("width", width)); + localVarQueryParameterBaseName = "height"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("height", height)); + localVarQueryParameterBaseName = "maxWidth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxWidth", maxWidth)); + localVarQueryParameterBaseName = "maxHeight"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxHeight", maxHeight)); + localVarQueryParameterBaseName = "videoBitRate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoBitRate", videoBitRate)); + localVarQueryParameterBaseName = "subtitleStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleStreamIndex", subtitleStreamIndex)); + localVarQueryParameterBaseName = "subtitleMethod"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleMethod", subtitleMethod)); + localVarQueryParameterBaseName = "maxRefFrames"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxRefFrames", maxRefFrames)); + localVarQueryParameterBaseName = "maxVideoBitDepth"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("maxVideoBitDepth", maxVideoBitDepth)); + localVarQueryParameterBaseName = "requireAvc"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireAvc", requireAvc)); + localVarQueryParameterBaseName = "deInterlace"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("deInterlace", deInterlace)); + localVarQueryParameterBaseName = "requireNonAnamorphic"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("requireNonAnamorphic", requireNonAnamorphic)); + localVarQueryParameterBaseName = "transcodingMaxAudioChannels"; + localVarQueryParams + .addAll(ApiClient.parameterToPairs("transcodingMaxAudioChannels", transcodingMaxAudioChannels)); + localVarQueryParameterBaseName = "cpuCoreLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cpuCoreLimit", cpuCoreLimit)); + localVarQueryParameterBaseName = "liveStreamId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("liveStreamId", liveStreamId)); + localVarQueryParameterBaseName = "enableMpegtsM2TsMode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableMpegtsM2TsMode", enableMpegtsM2TsMode)); + localVarQueryParameterBaseName = "videoCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoCodec", videoCodec)); + localVarQueryParameterBaseName = "subtitleCodec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subtitleCodec", subtitleCodec)); + localVarQueryParameterBaseName = "transcodeReasons"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("transcodeReasons", transcodeReasons)); + localVarQueryParameterBaseName = "audioStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("audioStreamIndex", audioStreamIndex)); + localVarQueryParameterBaseName = "videoStreamIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("videoStreamIndex", videoStreamIndex)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("context", context)); + localVarQueryParameterBaseName = "streamOptions"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("streamOptions", streamOptions)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "video/*"); + + localVarRequestBuilder.method("HEAD", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Merges videos into a single record. + * + * @param ids Item id list. This allows multiple, comma delimited. (required) + * @throws ApiException if fails to make API call + */ + public void mergeVersions(@org.eclipse.jdt.annotation.Nullable List ids) throws ApiException { + mergeVersions(ids, null); + } + + /** + * Merges videos into a single record. + * + * @param ids Item id list. This allows multiple, comma delimited. (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void mergeVersions(@org.eclipse.jdt.annotation.Nullable List ids, Map headers) + throws ApiException { + mergeVersionsWithHttpInfo(ids, headers); + } + + /** + * Merges videos into a single record. + * + * @param ids Item id list. This allows multiple, comma delimited. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse mergeVersionsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable List ids) + throws ApiException { + return mergeVersionsWithHttpInfo(ids, null); + } + + /** + * Merges videos into a single record. + * + * @param ids Item id list. This allows multiple, comma delimited. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse mergeVersionsWithHttpInfo(@org.eclipse.jdt.annotation.Nullable List ids, + Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = mergeVersionsRequestBuilder(ids, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("mergeVersions", localVarResponse); + } + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder mergeVersionsRequestBuilder(@org.eclipse.jdt.annotation.Nullable List ids, + Map headers) throws ApiException { + // verify the required parameter 'ids' is set + if (ids == null) { + throw new ApiException(400, "Missing the required parameter 'ids' when calling mergeVersions"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Videos/MergeVersions"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "ids"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "ids", ids)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/YearsApi.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/YearsApi.java new file mode 100644 index 0000000000000..65d524ab0e539 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/YearsApi.java @@ -0,0 +1,576 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.generated.legacy; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.UUID; +import java.util.function.Consumer; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.ApiResponse; +import org.openhab.binding.jellyfin.internal.api.generated.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.Pair; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDto; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemDtoQueryResult; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.BaseItemKind; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ImageType; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.ItemFields; +import org.openhab.binding.jellyfin.internal.api.generated.legacy.model.SortOrder; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class YearsApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific + * headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public YearsApi() { + this(Configuration.getDefaultApiClient()); + } + + public YearsApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response) throws ApiException { + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(response.body(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

+ * Prepare the file for download from the response. + *

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Gets a year. + * + * @param year The year. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getYear(@org.eclipse.jdt.annotation.Nullable Integer year, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getYear(year, userId, null); + } + + /** + * Gets a year. + * + * @param year The year. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return BaseItemDto + * @throws ApiException if fails to make API call + */ + public BaseItemDto getYear(@org.eclipse.jdt.annotation.Nullable Integer year, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + ApiResponse localVarResponse = getYearWithHttpInfo(year, userId, headers); + return localVarResponse.getData(); + } + + /** + * Gets a year. + * + * @param year The year. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getYearWithHttpInfo(@org.eclipse.jdt.annotation.Nullable Integer year, + @org.eclipse.jdt.annotation.NonNull UUID userId) throws ApiException { + return getYearWithHttpInfo(year, userId, null); + } + + /** + * Gets a year. + * + * @param year The year. (required) + * @param userId Optional. Filter by user id, and attach user data. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDto> + * @throws ApiException if fails to make API call + */ + public ApiResponse getYearWithHttpInfo(@org.eclipse.jdt.annotation.Nullable Integer year, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getYearRequestBuilder(year, userId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getYear", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDto responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), + responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getYearRequestBuilder(@org.eclipse.jdt.annotation.Nullable Integer year, + @org.eclipse.jdt.annotation.NonNull UUID userId, Map headers) throws ApiException { + // verify the required parameter 'year' is set + if (year == null) { + throw new ApiException(400, "Missing the required parameter 'year' when calling getYear"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Years/{year}".replace("{year}", ApiClient.urlEncode(year.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get years. + * + * @param startIndex Skips over a given number of items within the results. Use for paging. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be excluded based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be included based on item type. This allows + * multiple, comma delimited. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User Id. (optional) + * @param recursive Search recursively. (optional, default to true) + * @param enableImages Optional. Include image information in output. (optional, default to true) + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getYears(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getYears(startIndex, limit, sortOrder, parentId, fields, excludeItemTypes, includeItemTypes, mediaTypes, + sortBy, enableUserData, imageTypeLimit, enableImageTypes, userId, recursive, enableImages, null); + } + + /** + * Get years. + * + * @param startIndex Skips over a given number of items within the results. Use for paging. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be excluded based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be included based on item type. This allows + * multiple, comma delimited. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User Id. (optional) + * @param recursive Search recursively. (optional, default to true) + * @param enableImages Optional. Include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return BaseItemDtoQueryResult + * @throws ApiException if fails to make API call + */ + public BaseItemDtoQueryResult getYears(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { + ApiResponse localVarResponse = getYearsWithHttpInfo(startIndex, limit, sortOrder, + parentId, fields, excludeItemTypes, includeItemTypes, mediaTypes, sortBy, enableUserData, + imageTypeLimit, enableImageTypes, userId, recursive, enableImages, headers); + return localVarResponse.getData(); + } + + /** + * Get years. + * + * @param startIndex Skips over a given number of items within the results. Use for paging. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be excluded based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be included based on item type. This allows + * multiple, comma delimited. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User Id. (optional) + * @param recursive Search recursively. (optional, default to true) + * @param enableImages Optional. Include image information in output. (optional, default to true) + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getYearsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages) throws ApiException { + return getYearsWithHttpInfo(startIndex, limit, sortOrder, parentId, fields, excludeItemTypes, includeItemTypes, + mediaTypes, sortBy, enableUserData, imageTypeLimit, enableImageTypes, userId, recursive, enableImages, + null); + } + + /** + * Get years. + * + * @param startIndex Skips over a given number of items within the results. Use for paging. (optional) + * @param limit Optional. The maximum number of records to return. (optional) + * @param sortOrder Sort Order - Ascending,Descending. (optional) + * @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root. + * (optional) + * @param fields Optional. Specify additional fields of information to return in the output. (optional) + * @param excludeItemTypes Optional. If specified, results will be excluded based on item type. This allows + * multiple, comma delimited. (optional) + * @param includeItemTypes Optional. If specified, results will be included based on item type. This allows + * multiple, comma delimited. (optional) + * @param mediaTypes Optional. Filter by MediaType. Allows multiple, comma delimited. (optional) + * @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, + * Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, + * ProductionYear, SortName, Random, Revenue, Runtime. (optional) + * @param enableUserData Optional. Include user data. (optional) + * @param imageTypeLimit Optional. The max number of images to return, per image type. (optional) + * @param enableImageTypes Optional. The image types to include in the output. (optional) + * @param userId User Id. (optional) + * @param recursive Search recursively. (optional, default to true) + * @param enableImages Optional. Include image information in output. (optional, default to true) + * @param headers Optional headers to include in the request + * @return ApiResponse<BaseItemDtoQueryResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse getYearsWithHttpInfo( + @org.eclipse.jdt.annotation.NonNull Integer startIndex, @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getYearsRequestBuilder(startIndex, limit, sortOrder, parentId, + fields, excludeItemTypes, includeItemTypes, mediaTypes, sortBy, enableUserData, imageTypeLimit, + enableImageTypes, userId, recursive, enableImages, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getYears", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), null); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + BaseItemDtoQueryResult responseValue = responseBody.isBlank() ? null + : memberVarObjectMapper.readValue(responseBody, new TypeReference() { + }); + + localVarResponse.body().close(); + + return new ApiResponse(localVarResponse.statusCode(), + localVarResponse.headers().map(), responseValue); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getYearsRequestBuilder(@org.eclipse.jdt.annotation.NonNull Integer startIndex, + @org.eclipse.jdt.annotation.NonNull Integer limit, + @org.eclipse.jdt.annotation.NonNull List sortOrder, + @org.eclipse.jdt.annotation.NonNull UUID parentId, + @org.eclipse.jdt.annotation.NonNull List fields, + @org.eclipse.jdt.annotation.NonNull List excludeItemTypes, + @org.eclipse.jdt.annotation.NonNull List includeItemTypes, + @org.eclipse.jdt.annotation.NonNull List mediaTypes, + @org.eclipse.jdt.annotation.NonNull List sortBy, + @org.eclipse.jdt.annotation.NonNull Boolean enableUserData, + @org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit, + @org.eclipse.jdt.annotation.NonNull List enableImageTypes, + @org.eclipse.jdt.annotation.NonNull UUID userId, @org.eclipse.jdt.annotation.NonNull Boolean recursive, + @org.eclipse.jdt.annotation.NonNull Boolean enableImages, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/Years"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "startIndex"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startIndex", startIndex)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortOrder", sortOrder)); + localVarQueryParameterBaseName = "parentId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("parentId", parentId)); + localVarQueryParameterBaseName = "fields"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "fields", fields)); + localVarQueryParameterBaseName = "excludeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "excludeItemTypes", excludeItemTypes)); + localVarQueryParameterBaseName = "includeItemTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "includeItemTypes", includeItemTypes)); + localVarQueryParameterBaseName = "mediaTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "mediaTypes", mediaTypes)); + localVarQueryParameterBaseName = "sortBy"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "sortBy", sortBy)); + localVarQueryParameterBaseName = "enableUserData"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableUserData", enableUserData)); + localVarQueryParameterBaseName = "imageTypeLimit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("imageTypeLimit", imageTypeLimit)); + localVarQueryParameterBaseName = "enableImageTypes"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enableImageTypes", enableImageTypes)); + localVarQueryParameterBaseName = "userId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("userId", userId)); + localVarQueryParameterBaseName = "recursive"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("recursive", recursive)); + localVarQueryParameterBaseName = "enableImages"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enableImages", enableImages)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", + "application/json, application/json; profile=CamelCase, application/json; profile=PascalCase"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AbstractOpenApiSchema.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000000..741844aca3d62 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AbstractOpenApiSchema.java @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Map; +import java.util.Objects; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + @JsonValue + public Object getActualInstance() { + return instance; + } + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) { + this.instance = instance; + } + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && Objects.equals(this.isNullable, a.isNullable) + && Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AccessSchedule.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AccessSchedule.java new file mode 100644 index 0000000000000..6b163562cf47e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AccessSchedule.java @@ -0,0 +1,351 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * An entity representing a user's access schedule. + */ +@JsonPropertyOrder({ AccessSchedule.JSON_PROPERTY_ID, AccessSchedule.JSON_PROPERTY_USER_ID, + AccessSchedule.JSON_PROPERTY_DAY_OF_WEEK, AccessSchedule.JSON_PROPERTY_START_HOUR, + AccessSchedule.JSON_PROPERTY_END_HOUR }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AccessSchedule { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private Integer id; + + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_DAY_OF_WEEK = "DayOfWeek"; + @org.eclipse.jdt.annotation.NonNull + private DynamicDayOfWeek dayOfWeek; + + public static final String JSON_PROPERTY_START_HOUR = "StartHour"; + @org.eclipse.jdt.annotation.NonNull + private Double startHour; + + public static final String JSON_PROPERTY_END_HOUR = "EndHour"; + @org.eclipse.jdt.annotation.NonNull + private Double endHour; + + public AccessSchedule() { + } + + @JsonCreator + public AccessSchedule(@JsonProperty(JSON_PROPERTY_ID) Integer id) { + this(); + this.id = id; + } + + /** + * Gets the id of this instance. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getId() { + return id; + } + + public AccessSchedule userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets the id of the associated user. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public AccessSchedule dayOfWeek(@org.eclipse.jdt.annotation.NonNull DynamicDayOfWeek dayOfWeek) { + this.dayOfWeek = dayOfWeek; + return this; + } + + /** + * Gets or sets the day of week. + * + * @return dayOfWeek + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DAY_OF_WEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DynamicDayOfWeek getDayOfWeek() { + return dayOfWeek; + } + + @JsonProperty(JSON_PROPERTY_DAY_OF_WEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDayOfWeek(@org.eclipse.jdt.annotation.NonNull DynamicDayOfWeek dayOfWeek) { + this.dayOfWeek = dayOfWeek; + } + + public AccessSchedule startHour(@org.eclipse.jdt.annotation.NonNull Double startHour) { + this.startHour = startHour; + return this; + } + + /** + * Gets or sets the start hour. + * + * @return startHour + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_HOUR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getStartHour() { + return startHour; + } + + @JsonProperty(JSON_PROPERTY_START_HOUR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartHour(@org.eclipse.jdt.annotation.NonNull Double startHour) { + this.startHour = startHour; + } + + public AccessSchedule endHour(@org.eclipse.jdt.annotation.NonNull Double endHour) { + this.endHour = endHour; + return this; + } + + /** + * Gets or sets the end hour. + * + * @return endHour + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_END_HOUR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getEndHour() { + return endHour; + } + + @JsonProperty(JSON_PROPERTY_END_HOUR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndHour(@org.eclipse.jdt.annotation.NonNull Double endHour) { + this.endHour = endHour; + } + + /** + * Return true if this AccessSchedule object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessSchedule accessSchedule = (AccessSchedule) o; + return Objects.equals(this.id, accessSchedule.id) && Objects.equals(this.userId, accessSchedule.userId) + && Objects.equals(this.dayOfWeek, accessSchedule.dayOfWeek) + && Objects.equals(this.startHour, accessSchedule.startHour) + && Objects.equals(this.endHour, accessSchedule.endHour); + } + + @Override + public int hashCode() { + return Objects.hash(id, userId, dayOfWeek, startHour, endHour); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessSchedule {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" dayOfWeek: ").append(toIndentedString(dayOfWeek)).append("\n"); + sb.append(" startHour: ").append(toIndentedString(startHour)).append("\n"); + sb.append(" endHour: ").append(toIndentedString(endHour)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `DayOfWeek` to the URL query string + if (getDayOfWeek() != null) { + joiner.add(String.format("%sDayOfWeek%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDayOfWeek())))); + } + + // add `StartHour` to the URL query string + if (getStartHour() != null) { + joiner.add(String.format("%sStartHour%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartHour())))); + } + + // add `EndHour` to the URL query string + if (getEndHour() != null) { + joiner.add(String.format("%sEndHour%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndHour())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AccessSchedule instance; + + public Builder() { + this(new AccessSchedule()); + } + + protected Builder(AccessSchedule instance) { + this.instance = instance; + } + + public AccessSchedule.Builder id(Integer id) { + this.instance.id = id; + return this; + } + + public AccessSchedule.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public AccessSchedule.Builder dayOfWeek(DynamicDayOfWeek dayOfWeek) { + this.instance.dayOfWeek = dayOfWeek; + return this; + } + + public AccessSchedule.Builder startHour(Double startHour) { + this.instance.startHour = startHour; + return this; + } + + public AccessSchedule.Builder endHour(Double endHour) { + this.instance.endHour = endHour; + return this; + } + + /** + * returns a built AccessSchedule instance. + * + * The builder is not reusable. + */ + public AccessSchedule build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AccessSchedule.Builder builder() { + return new AccessSchedule.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AccessSchedule.Builder toBuilder() { + return new AccessSchedule.Builder().id(getId()).userId(getUserId()).dayOfWeek(getDayOfWeek()) + .startHour(getStartHour()).endHour(getEndHour()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ActivityLogEntry.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ActivityLogEntry.java new file mode 100644 index 0000000000000..36f6065470b49 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ActivityLogEntry.java @@ -0,0 +1,562 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * An activity log entry. + */ +@JsonPropertyOrder({ ActivityLogEntry.JSON_PROPERTY_ID, ActivityLogEntry.JSON_PROPERTY_NAME, + ActivityLogEntry.JSON_PROPERTY_OVERVIEW, ActivityLogEntry.JSON_PROPERTY_SHORT_OVERVIEW, + ActivityLogEntry.JSON_PROPERTY_TYPE, ActivityLogEntry.JSON_PROPERTY_ITEM_ID, + ActivityLogEntry.JSON_PROPERTY_DATE, ActivityLogEntry.JSON_PROPERTY_USER_ID, + ActivityLogEntry.JSON_PROPERTY_USER_PRIMARY_IMAGE_TAG, ActivityLogEntry.JSON_PROPERTY_SEVERITY }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ActivityLogEntry { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private Long id; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_OVERVIEW = "Overview"; + @org.eclipse.jdt.annotation.NonNull + private String overview; + + public static final String JSON_PROPERTY_SHORT_OVERVIEW = "ShortOverview"; + @org.eclipse.jdt.annotation.NonNull + private String shortOverview; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private String itemId; + + public static final String JSON_PROPERTY_DATE = "Date"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime date; + + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_USER_PRIMARY_IMAGE_TAG = "UserPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String userPrimaryImageTag; + + public static final String JSON_PROPERTY_SEVERITY = "Severity"; + @org.eclipse.jdt.annotation.NonNull + private LogLevel severity; + + public ActivityLogEntry() { + } + + public ActivityLogEntry id(@org.eclipse.jdt.annotation.NonNull Long id) { + this.id = id; + return this; + } + + /** + * Gets or sets the identifier. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull Long id) { + this.id = id; + } + + public ActivityLogEntry name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ActivityLogEntry overview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + return this; + } + + /** + * Gets or sets the overview. + * + * @return overview + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOverview() { + return overview; + } + + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOverview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + } + + public ActivityLogEntry shortOverview(@org.eclipse.jdt.annotation.NonNull String shortOverview) { + this.shortOverview = shortOverview; + return this; + } + + /** + * Gets or sets the short overview. + * + * @return shortOverview + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SHORT_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getShortOverview() { + return shortOverview; + } + + @JsonProperty(JSON_PROPERTY_SHORT_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShortOverview(@org.eclipse.jdt.annotation.NonNull String shortOverview) { + this.shortOverview = shortOverview; + } + + public ActivityLogEntry type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public ActivityLogEntry itemId(@org.eclipse.jdt.annotation.NonNull String itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item identifier. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull String itemId) { + this.itemId = itemId; + } + + public ActivityLogEntry date(@org.eclipse.jdt.annotation.NonNull OffsetDateTime date) { + this.date = date; + return this; + } + + /** + * Gets or sets the date. + * + * @return date + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDate() { + return date; + } + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime date) { + this.date = date; + } + + public ActivityLogEntry userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the user identifier. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public ActivityLogEntry userPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String userPrimaryImageTag) { + this.userPrimaryImageTag = userPrimaryImageTag; + return this; + } + + /** + * Gets or sets the user primary image tag. + * + * @return userPrimaryImageTag + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserPrimaryImageTag() { + return userPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_USER_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String userPrimaryImageTag) { + this.userPrimaryImageTag = userPrimaryImageTag; + } + + public ActivityLogEntry severity(@org.eclipse.jdt.annotation.NonNull LogLevel severity) { + this.severity = severity; + return this; + } + + /** + * Gets or sets the log severity. + * + * @return severity + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEVERITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LogLevel getSeverity() { + return severity; + } + + @JsonProperty(JSON_PROPERTY_SEVERITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeverity(@org.eclipse.jdt.annotation.NonNull LogLevel severity) { + this.severity = severity; + } + + /** + * Return true if this ActivityLogEntry object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActivityLogEntry activityLogEntry = (ActivityLogEntry) o; + return Objects.equals(this.id, activityLogEntry.id) && Objects.equals(this.name, activityLogEntry.name) + && Objects.equals(this.overview, activityLogEntry.overview) + && Objects.equals(this.shortOverview, activityLogEntry.shortOverview) + && Objects.equals(this.type, activityLogEntry.type) + && Objects.equals(this.itemId, activityLogEntry.itemId) + && Objects.equals(this.date, activityLogEntry.date) + && Objects.equals(this.userId, activityLogEntry.userId) + && Objects.equals(this.userPrimaryImageTag, activityLogEntry.userPrimaryImageTag) + && Objects.equals(this.severity, activityLogEntry.severity); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, overview, shortOverview, type, itemId, date, userId, userPrimaryImageTag, + severity); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActivityLogEntry {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" overview: ").append(toIndentedString(overview)).append("\n"); + sb.append(" shortOverview: ").append(toIndentedString(shortOverview)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" userPrimaryImageTag: ").append(toIndentedString(userPrimaryImageTag)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Overview` to the URL query string + if (getOverview() != null) { + joiner.add(String.format("%sOverview%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOverview())))); + } + + // add `ShortOverview` to the URL query string + if (getShortOverview() != null) { + joiner.add(String.format("%sShortOverview%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getShortOverview())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `Date` to the URL query string + if (getDate() != null) { + joiner.add(String.format("%sDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDate())))); + } + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `UserPrimaryImageTag` to the URL query string + if (getUserPrimaryImageTag() != null) { + joiner.add(String.format("%sUserPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserPrimaryImageTag())))); + } + + // add `Severity` to the URL query string + if (getSeverity() != null) { + joiner.add(String.format("%sSeverity%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeverity())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ActivityLogEntry instance; + + public Builder() { + this(new ActivityLogEntry()); + } + + protected Builder(ActivityLogEntry instance) { + this.instance = instance; + } + + public ActivityLogEntry.Builder id(Long id) { + this.instance.id = id; + return this; + } + + public ActivityLogEntry.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ActivityLogEntry.Builder overview(String overview) { + this.instance.overview = overview; + return this; + } + + public ActivityLogEntry.Builder shortOverview(String shortOverview) { + this.instance.shortOverview = shortOverview; + return this; + } + + public ActivityLogEntry.Builder type(String type) { + this.instance.type = type; + return this; + } + + public ActivityLogEntry.Builder itemId(String itemId) { + this.instance.itemId = itemId; + return this; + } + + public ActivityLogEntry.Builder date(OffsetDateTime date) { + this.instance.date = date; + return this; + } + + public ActivityLogEntry.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public ActivityLogEntry.Builder userPrimaryImageTag(String userPrimaryImageTag) { + this.instance.userPrimaryImageTag = userPrimaryImageTag; + return this; + } + + public ActivityLogEntry.Builder severity(LogLevel severity) { + this.instance.severity = severity; + return this; + } + + /** + * returns a built ActivityLogEntry instance. + * + * The builder is not reusable. + */ + public ActivityLogEntry build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ActivityLogEntry.Builder builder() { + return new ActivityLogEntry.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ActivityLogEntry.Builder toBuilder() { + return new ActivityLogEntry.Builder().id(getId()).name(getName()).overview(getOverview()) + .shortOverview(getShortOverview()).type(getType()).itemId(getItemId()).date(getDate()) + .userId(getUserId()).userPrimaryImageTag(getUserPrimaryImageTag()).severity(getSeverity()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ActivityLogEntryQueryResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ActivityLogEntryQueryResult.java new file mode 100644 index 0000000000000..79cdacf4a37ff --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ActivityLogEntryQueryResult.java @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ActivityLogEntryQueryResult + */ +@JsonPropertyOrder({ ActivityLogEntryQueryResult.JSON_PROPERTY_ITEMS, + ActivityLogEntryQueryResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, + ActivityLogEntryQueryResult.JSON_PROPERTY_START_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ActivityLogEntryQueryResult { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items; + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public ActivityLogEntryQueryResult() { + } + + public ActivityLogEntryQueryResult items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public ActivityLogEntryQueryResult addItemsItem(ActivityLogEntry itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Gets or sets the items. + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public ActivityLogEntryQueryResult totalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total number of records available. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public ActivityLogEntryQueryResult startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the index of the first record in Items. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + /** + * Return true if this ActivityLogEntryQueryResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActivityLogEntryQueryResult activityLogEntryQueryResult = (ActivityLogEntryQueryResult) o; + return Objects.equals(this.items, activityLogEntryQueryResult.items) + && Objects.equals(this.totalRecordCount, activityLogEntryQueryResult.totalRecordCount) + && Objects.equals(this.startIndex, activityLogEntryQueryResult.startIndex); + } + + @Override + public int hashCode() { + return Objects.hash(items, totalRecordCount, startIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActivityLogEntryQueryResult {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ActivityLogEntryQueryResult instance; + + public Builder() { + this(new ActivityLogEntryQueryResult()); + } + + protected Builder(ActivityLogEntryQueryResult instance) { + this.instance = instance; + } + + public ActivityLogEntryQueryResult.Builder items(List items) { + this.instance.items = items; + return this; + } + + public ActivityLogEntryQueryResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public ActivityLogEntryQueryResult.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + /** + * returns a built ActivityLogEntryQueryResult instance. + * + * The builder is not reusable. + */ + public ActivityLogEntryQueryResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ActivityLogEntryQueryResult.Builder builder() { + return new ActivityLogEntryQueryResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ActivityLogEntryQueryResult.Builder toBuilder() { + return new ActivityLogEntryQueryResult.Builder().items(getItems()).totalRecordCount(getTotalRecordCount()) + .startIndex(getStartIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AddVirtualFolderDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AddVirtualFolderDto.java new file mode 100644 index 0000000000000..90240def0671b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AddVirtualFolderDto.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Add virtual folder dto. + */ +@JsonPropertyOrder({ AddVirtualFolderDto.JSON_PROPERTY_LIBRARY_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AddVirtualFolderDto { + public static final String JSON_PROPERTY_LIBRARY_OPTIONS = "LibraryOptions"; + @org.eclipse.jdt.annotation.NonNull + private LibraryOptions libraryOptions; + + public AddVirtualFolderDto() { + } + + public AddVirtualFolderDto libraryOptions(@org.eclipse.jdt.annotation.NonNull LibraryOptions libraryOptions) { + this.libraryOptions = libraryOptions; + return this; + } + + /** + * Gets or sets library options. + * + * @return libraryOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIBRARY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LibraryOptions getLibraryOptions() { + return libraryOptions; + } + + @JsonProperty(JSON_PROPERTY_LIBRARY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLibraryOptions(@org.eclipse.jdt.annotation.NonNull LibraryOptions libraryOptions) { + this.libraryOptions = libraryOptions; + } + + /** + * Return true if this AddVirtualFolderDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddVirtualFolderDto addVirtualFolderDto = (AddVirtualFolderDto) o; + return Objects.equals(this.libraryOptions, addVirtualFolderDto.libraryOptions); + } + + @Override + public int hashCode() { + return Objects.hash(libraryOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddVirtualFolderDto {\n"); + sb.append(" libraryOptions: ").append(toIndentedString(libraryOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `LibraryOptions` to the URL query string + if (getLibraryOptions() != null) { + joiner.add(getLibraryOptions().toUrlQueryString(prefix + "LibraryOptions" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private AddVirtualFolderDto instance; + + public Builder() { + this(new AddVirtualFolderDto()); + } + + protected Builder(AddVirtualFolderDto instance) { + this.instance = instance; + } + + public AddVirtualFolderDto.Builder libraryOptions(LibraryOptions libraryOptions) { + this.instance.libraryOptions = libraryOptions; + return this; + } + + /** + * returns a built AddVirtualFolderDto instance. + * + * The builder is not reusable. + */ + public AddVirtualFolderDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AddVirtualFolderDto.Builder builder() { + return new AddVirtualFolderDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AddVirtualFolderDto.Builder toBuilder() { + return new AddVirtualFolderDto.Builder().libraryOptions(getLibraryOptions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AdminNotificationDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AdminNotificationDto.java new file mode 100644 index 0000000000000..10ecdddbe9328 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AdminNotificationDto.java @@ -0,0 +1,315 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The admin notification dto. + */ +@JsonPropertyOrder({ AdminNotificationDto.JSON_PROPERTY_NAME, AdminNotificationDto.JSON_PROPERTY_DESCRIPTION, + AdminNotificationDto.JSON_PROPERTY_NOTIFICATION_LEVEL, AdminNotificationDto.JSON_PROPERTY_URL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AdminNotificationDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_DESCRIPTION = "Description"; + @org.eclipse.jdt.annotation.NonNull + private String description; + + public static final String JSON_PROPERTY_NOTIFICATION_LEVEL = "NotificationLevel"; + @org.eclipse.jdt.annotation.NonNull + private NotificationLevel notificationLevel; + + public static final String JSON_PROPERTY_URL = "Url"; + @org.eclipse.jdt.annotation.NonNull + private String url; + + public AdminNotificationDto() { + } + + public AdminNotificationDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the notification name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public AdminNotificationDto description(@org.eclipse.jdt.annotation.NonNull String description) { + this.description = description; + return this; + } + + /** + * Gets or sets the notification description. + * + * @return description + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@org.eclipse.jdt.annotation.NonNull String description) { + this.description = description; + } + + public AdminNotificationDto notificationLevel( + @org.eclipse.jdt.annotation.NonNull NotificationLevel notificationLevel) { + this.notificationLevel = notificationLevel; + return this; + } + + /** + * Gets or sets the notification level. + * + * @return notificationLevel + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NOTIFICATION_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public NotificationLevel getNotificationLevel() { + return notificationLevel; + } + + @JsonProperty(JSON_PROPERTY_NOTIFICATION_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNotificationLevel(@org.eclipse.jdt.annotation.NonNull NotificationLevel notificationLevel) { + this.notificationLevel = notificationLevel; + } + + public AdminNotificationDto url(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + return this; + } + + /** + * Gets or sets the notification url. + * + * @return url + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + } + + /** + * Return true if this AdminNotificationDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdminNotificationDto adminNotificationDto = (AdminNotificationDto) o; + return Objects.equals(this.name, adminNotificationDto.name) + && Objects.equals(this.description, adminNotificationDto.description) + && Objects.equals(this.notificationLevel, adminNotificationDto.notificationLevel) + && Objects.equals(this.url, adminNotificationDto.url); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, notificationLevel, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdminNotificationDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" notificationLevel: ").append(toIndentedString(notificationLevel)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sDescription%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `NotificationLevel` to the URL query string + if (getNotificationLevel() != null) { + joiner.add(String.format("%sNotificationLevel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getNotificationLevel())))); + } + + // add `Url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format("%sUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AdminNotificationDto instance; + + public Builder() { + this(new AdminNotificationDto()); + } + + protected Builder(AdminNotificationDto instance) { + this.instance = instance; + } + + public AdminNotificationDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public AdminNotificationDto.Builder description(String description) { + this.instance.description = description; + return this; + } + + public AdminNotificationDto.Builder notificationLevel(NotificationLevel notificationLevel) { + this.instance.notificationLevel = notificationLevel; + return this; + } + + public AdminNotificationDto.Builder url(String url) { + this.instance.url = url; + return this; + } + + /** + * returns a built AdminNotificationDto instance. + * + * The builder is not reusable. + */ + public AdminNotificationDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AdminNotificationDto.Builder builder() { + return new AdminNotificationDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AdminNotificationDto.Builder toBuilder() { + return new AdminNotificationDto.Builder().name(getName()).description(getDescription()) + .notificationLevel(getNotificationLevel()).url(getUrl()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AlbumInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AlbumInfo.java new file mode 100644 index 0000000000000..140807da34f95 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AlbumInfo.java @@ -0,0 +1,772 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AlbumInfo + */ +@JsonPropertyOrder({ AlbumInfo.JSON_PROPERTY_NAME, AlbumInfo.JSON_PROPERTY_ORIGINAL_TITLE, AlbumInfo.JSON_PROPERTY_PATH, + AlbumInfo.JSON_PROPERTY_METADATA_LANGUAGE, AlbumInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, + AlbumInfo.JSON_PROPERTY_PROVIDER_IDS, AlbumInfo.JSON_PROPERTY_YEAR, AlbumInfo.JSON_PROPERTY_INDEX_NUMBER, + AlbumInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, AlbumInfo.JSON_PROPERTY_PREMIERE_DATE, + AlbumInfo.JSON_PROPERTY_IS_AUTOMATED, AlbumInfo.JSON_PROPERTY_ALBUM_ARTISTS, + AlbumInfo.JSON_PROPERTY_ARTIST_PROVIDER_IDS, AlbumInfo.JSON_PROPERTY_SONG_INFOS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AlbumInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public static final String JSON_PROPERTY_ALBUM_ARTISTS = "AlbumArtists"; + @org.eclipse.jdt.annotation.NonNull + private List albumArtists = new ArrayList<>(); + + public static final String JSON_PROPERTY_ARTIST_PROVIDER_IDS = "ArtistProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map artistProviderIds = new HashMap<>(); + + public static final String JSON_PROPERTY_SONG_INFOS = "SongInfos"; + @org.eclipse.jdt.annotation.NonNull + private List songInfos = new ArrayList<>(); + + public AlbumInfo() { + } + + public AlbumInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public AlbumInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public AlbumInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public AlbumInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public AlbumInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public AlbumInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public AlbumInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public AlbumInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public AlbumInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public AlbumInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public AlbumInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public AlbumInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + public AlbumInfo albumArtists(@org.eclipse.jdt.annotation.NonNull List albumArtists) { + this.albumArtists = albumArtists; + return this; + } + + public AlbumInfo addAlbumArtistsItem(String albumArtistsItem) { + if (this.albumArtists == null) { + this.albumArtists = new ArrayList<>(); + } + this.albumArtists.add(albumArtistsItem); + return this; + } + + /** + * Gets or sets the album artist. + * + * @return albumArtists + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAlbumArtists() { + return albumArtists; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumArtists(@org.eclipse.jdt.annotation.NonNull List albumArtists) { + this.albumArtists = albumArtists; + } + + public AlbumInfo artistProviderIds(@org.eclipse.jdt.annotation.NonNull Map artistProviderIds) { + this.artistProviderIds = artistProviderIds; + return this; + } + + public AlbumInfo putArtistProviderIdsItem(String key, String artistProviderIdsItem) { + if (this.artistProviderIds == null) { + this.artistProviderIds = new HashMap<>(); + } + this.artistProviderIds.put(key, artistProviderIdsItem); + return this; + } + + /** + * Gets or sets the artist provider ids. + * + * @return artistProviderIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTIST_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getArtistProviderIds() { + return artistProviderIds; + } + + @JsonProperty(JSON_PROPERTY_ARTIST_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setArtistProviderIds(@org.eclipse.jdt.annotation.NonNull Map artistProviderIds) { + this.artistProviderIds = artistProviderIds; + } + + public AlbumInfo songInfos(@org.eclipse.jdt.annotation.NonNull List songInfos) { + this.songInfos = songInfos; + return this; + } + + public AlbumInfo addSongInfosItem(SongInfo songInfosItem) { + if (this.songInfos == null) { + this.songInfos = new ArrayList<>(); + } + this.songInfos.add(songInfosItem); + return this; + } + + /** + * Get songInfos + * + * @return songInfos + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SONG_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSongInfos() { + return songInfos; + } + + @JsonProperty(JSON_PROPERTY_SONG_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSongInfos(@org.eclipse.jdt.annotation.NonNull List songInfos) { + this.songInfos = songInfos; + } + + /** + * Return true if this AlbumInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlbumInfo albumInfo = (AlbumInfo) o; + return Objects.equals(this.name, albumInfo.name) && Objects.equals(this.originalTitle, albumInfo.originalTitle) + && Objects.equals(this.path, albumInfo.path) + && Objects.equals(this.metadataLanguage, albumInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, albumInfo.metadataCountryCode) + && Objects.equals(this.providerIds, albumInfo.providerIds) && Objects.equals(this.year, albumInfo.year) + && Objects.equals(this.indexNumber, albumInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, albumInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, albumInfo.premiereDate) + && Objects.equals(this.isAutomated, albumInfo.isAutomated) + && Objects.equals(this.albumArtists, albumInfo.albumArtists) + && Objects.equals(this.artistProviderIds, albumInfo.artistProviderIds) + && Objects.equals(this.songInfos, albumInfo.songInfos); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated, albumArtists, artistProviderIds, songInfos); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlbumInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append(" albumArtists: ").append(toIndentedString(albumArtists)).append("\n"); + sb.append(" artistProviderIds: ").append(toIndentedString(artistProviderIds)).append("\n"); + sb.append(" songInfos: ").append(toIndentedString(songInfos)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + // add `AlbumArtists` to the URL query string + if (getAlbumArtists() != null) { + for (int i = 0; i < getAlbumArtists().size(); i++) { + joiner.add(String.format("%sAlbumArtists%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getAlbumArtists().get(i))))); + } + } + + // add `ArtistProviderIds` to the URL query string + if (getArtistProviderIds() != null) { + for (String _key : getArtistProviderIds().keySet()) { + joiner.add(String.format("%sArtistProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getArtistProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getArtistProviderIds().get(_key))))); + } + } + + // add `SongInfos` to the URL query string + if (getSongInfos() != null) { + for (int i = 0; i < getSongInfos().size(); i++) { + if (getSongInfos().get(i) != null) { + joiner.add(getSongInfos().get(i).toUrlQueryString(String.format("%sSongInfos%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private AlbumInfo instance; + + public Builder() { + this(new AlbumInfo()); + } + + protected Builder(AlbumInfo instance) { + this.instance = instance; + } + + public AlbumInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public AlbumInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public AlbumInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public AlbumInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public AlbumInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public AlbumInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public AlbumInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public AlbumInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public AlbumInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public AlbumInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public AlbumInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + public AlbumInfo.Builder albumArtists(List albumArtists) { + this.instance.albumArtists = albumArtists; + return this; + } + + public AlbumInfo.Builder artistProviderIds(Map artistProviderIds) { + this.instance.artistProviderIds = artistProviderIds; + return this; + } + + public AlbumInfo.Builder songInfos(List songInfos) { + this.instance.songInfos = songInfos; + return this; + } + + /** + * returns a built AlbumInfo instance. + * + * The builder is not reusable. + */ + public AlbumInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AlbumInfo.Builder builder() { + return new AlbumInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AlbumInfo.Builder toBuilder() { + return new AlbumInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()).isAutomated(getIsAutomated()) + .albumArtists(getAlbumArtists()).artistProviderIds(getArtistProviderIds()).songInfos(getSongInfos()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AlbumInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AlbumInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..2a6ebf445a1d2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AlbumInfoRemoteSearchQuery.java @@ -0,0 +1,317 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AlbumInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ AlbumInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + AlbumInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, AlbumInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + AlbumInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AlbumInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private AlbumInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public AlbumInfoRemoteSearchQuery() { + } + + public AlbumInfoRemoteSearchQuery searchInfo(@org.eclipse.jdt.annotation.NonNull AlbumInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AlbumInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull AlbumInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public AlbumInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public AlbumInfoRemoteSearchQuery searchProviderName( + @org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public AlbumInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this AlbumInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlbumInfoRemoteSearchQuery albumInfoRemoteSearchQuery = (AlbumInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, albumInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, albumInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, albumInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, albumInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlbumInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AlbumInfoRemoteSearchQuery instance; + + public Builder() { + this(new AlbumInfoRemoteSearchQuery()); + } + + protected Builder(AlbumInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public AlbumInfoRemoteSearchQuery.Builder searchInfo(AlbumInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public AlbumInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public AlbumInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public AlbumInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built AlbumInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public AlbumInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AlbumInfoRemoteSearchQuery.Builder builder() { + return new AlbumInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AlbumInfoRemoteSearchQuery.Builder toBuilder() { + return new AlbumInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AllThemeMediaResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AllThemeMediaResult.java new file mode 100644 index 0000000000000..a73d0eb65e8e2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AllThemeMediaResult.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AllThemeMediaResult + */ +@JsonPropertyOrder({ AllThemeMediaResult.JSON_PROPERTY_THEME_VIDEOS_RESULT, + AllThemeMediaResult.JSON_PROPERTY_THEME_SONGS_RESULT, + AllThemeMediaResult.JSON_PROPERTY_SOUNDTRACK_SONGS_RESULT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AllThemeMediaResult { + public static final String JSON_PROPERTY_THEME_VIDEOS_RESULT = "ThemeVideosResult"; + @org.eclipse.jdt.annotation.NonNull + private ThemeMediaResult themeVideosResult; + + public static final String JSON_PROPERTY_THEME_SONGS_RESULT = "ThemeSongsResult"; + @org.eclipse.jdt.annotation.NonNull + private ThemeMediaResult themeSongsResult; + + public static final String JSON_PROPERTY_SOUNDTRACK_SONGS_RESULT = "SoundtrackSongsResult"; + @org.eclipse.jdt.annotation.NonNull + private ThemeMediaResult soundtrackSongsResult; + + public AllThemeMediaResult() { + } + + public AllThemeMediaResult themeVideosResult( + @org.eclipse.jdt.annotation.NonNull ThemeMediaResult themeVideosResult) { + this.themeVideosResult = themeVideosResult; + return this; + } + + /** + * Class ThemeMediaResult. + * + * @return themeVideosResult + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THEME_VIDEOS_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ThemeMediaResult getThemeVideosResult() { + return themeVideosResult; + } + + @JsonProperty(JSON_PROPERTY_THEME_VIDEOS_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThemeVideosResult(@org.eclipse.jdt.annotation.NonNull ThemeMediaResult themeVideosResult) { + this.themeVideosResult = themeVideosResult; + } + + public AllThemeMediaResult themeSongsResult(@org.eclipse.jdt.annotation.NonNull ThemeMediaResult themeSongsResult) { + this.themeSongsResult = themeSongsResult; + return this; + } + + /** + * Class ThemeMediaResult. + * + * @return themeSongsResult + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THEME_SONGS_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ThemeMediaResult getThemeSongsResult() { + return themeSongsResult; + } + + @JsonProperty(JSON_PROPERTY_THEME_SONGS_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThemeSongsResult(@org.eclipse.jdt.annotation.NonNull ThemeMediaResult themeSongsResult) { + this.themeSongsResult = themeSongsResult; + } + + public AllThemeMediaResult soundtrackSongsResult( + @org.eclipse.jdt.annotation.NonNull ThemeMediaResult soundtrackSongsResult) { + this.soundtrackSongsResult = soundtrackSongsResult; + return this; + } + + /** + * Class ThemeMediaResult. + * + * @return soundtrackSongsResult + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SOUNDTRACK_SONGS_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ThemeMediaResult getSoundtrackSongsResult() { + return soundtrackSongsResult; + } + + @JsonProperty(JSON_PROPERTY_SOUNDTRACK_SONGS_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSoundtrackSongsResult(@org.eclipse.jdt.annotation.NonNull ThemeMediaResult soundtrackSongsResult) { + this.soundtrackSongsResult = soundtrackSongsResult; + } + + /** + * Return true if this AllThemeMediaResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllThemeMediaResult allThemeMediaResult = (AllThemeMediaResult) o; + return Objects.equals(this.themeVideosResult, allThemeMediaResult.themeVideosResult) + && Objects.equals(this.themeSongsResult, allThemeMediaResult.themeSongsResult) + && Objects.equals(this.soundtrackSongsResult, allThemeMediaResult.soundtrackSongsResult); + } + + @Override + public int hashCode() { + return Objects.hash(themeVideosResult, themeSongsResult, soundtrackSongsResult); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllThemeMediaResult {\n"); + sb.append(" themeVideosResult: ").append(toIndentedString(themeVideosResult)).append("\n"); + sb.append(" themeSongsResult: ").append(toIndentedString(themeSongsResult)).append("\n"); + sb.append(" soundtrackSongsResult: ").append(toIndentedString(soundtrackSongsResult)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ThemeVideosResult` to the URL query string + if (getThemeVideosResult() != null) { + joiner.add(getThemeVideosResult().toUrlQueryString(prefix + "ThemeVideosResult" + suffix)); + } + + // add `ThemeSongsResult` to the URL query string + if (getThemeSongsResult() != null) { + joiner.add(getThemeSongsResult().toUrlQueryString(prefix + "ThemeSongsResult" + suffix)); + } + + // add `SoundtrackSongsResult` to the URL query string + if (getSoundtrackSongsResult() != null) { + joiner.add(getSoundtrackSongsResult().toUrlQueryString(prefix + "SoundtrackSongsResult" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private AllThemeMediaResult instance; + + public Builder() { + this(new AllThemeMediaResult()); + } + + protected Builder(AllThemeMediaResult instance) { + this.instance = instance; + } + + public AllThemeMediaResult.Builder themeVideosResult(ThemeMediaResult themeVideosResult) { + this.instance.themeVideosResult = themeVideosResult; + return this; + } + + public AllThemeMediaResult.Builder themeSongsResult(ThemeMediaResult themeSongsResult) { + this.instance.themeSongsResult = themeSongsResult; + return this; + } + + public AllThemeMediaResult.Builder soundtrackSongsResult(ThemeMediaResult soundtrackSongsResult) { + this.instance.soundtrackSongsResult = soundtrackSongsResult; + return this; + } + + /** + * returns a built AllThemeMediaResult instance. + * + * The builder is not reusable. + */ + public AllThemeMediaResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AllThemeMediaResult.Builder builder() { + return new AllThemeMediaResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AllThemeMediaResult.Builder toBuilder() { + return new AllThemeMediaResult.Builder().themeVideosResult(getThemeVideosResult()) + .themeSongsResult(getThemeSongsResult()).soundtrackSongsResult(getSoundtrackSongsResult()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/Architecture.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/Architecture.java new file mode 100644 index 0000000000000..1d86decd7bff0 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/Architecture.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets Architecture + */ +public enum Architecture { + + X86("X86"), + + X64("X64"), + + ARM("Arm"), + + ARM64("Arm64"), + + WASM("Wasm"), + + S390X("S390x"); + + private String value; + + Architecture(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Architecture fromValue(String value) { + for (Architecture b : Architecture.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ArtistInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ArtistInfo.java new file mode 100644 index 0000000000000..a2e02510e3929 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ArtistInfo.java @@ -0,0 +1,671 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ArtistInfo + */ +@JsonPropertyOrder({ ArtistInfo.JSON_PROPERTY_NAME, ArtistInfo.JSON_PROPERTY_ORIGINAL_TITLE, + ArtistInfo.JSON_PROPERTY_PATH, ArtistInfo.JSON_PROPERTY_METADATA_LANGUAGE, + ArtistInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, ArtistInfo.JSON_PROPERTY_PROVIDER_IDS, + ArtistInfo.JSON_PROPERTY_YEAR, ArtistInfo.JSON_PROPERTY_INDEX_NUMBER, + ArtistInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, ArtistInfo.JSON_PROPERTY_PREMIERE_DATE, + ArtistInfo.JSON_PROPERTY_IS_AUTOMATED, ArtistInfo.JSON_PROPERTY_SONG_INFOS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ArtistInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public static final String JSON_PROPERTY_SONG_INFOS = "SongInfos"; + @org.eclipse.jdt.annotation.NonNull + private List songInfos = new ArrayList<>(); + + public ArtistInfo() { + } + + public ArtistInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ArtistInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public ArtistInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public ArtistInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public ArtistInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public ArtistInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public ArtistInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public ArtistInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public ArtistInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public ArtistInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public ArtistInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public ArtistInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + public ArtistInfo songInfos(@org.eclipse.jdt.annotation.NonNull List songInfos) { + this.songInfos = songInfos; + return this; + } + + public ArtistInfo addSongInfosItem(SongInfo songInfosItem) { + if (this.songInfos == null) { + this.songInfos = new ArrayList<>(); + } + this.songInfos.add(songInfosItem); + return this; + } + + /** + * Get songInfos + * + * @return songInfos + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SONG_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSongInfos() { + return songInfos; + } + + @JsonProperty(JSON_PROPERTY_SONG_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSongInfos(@org.eclipse.jdt.annotation.NonNull List songInfos) { + this.songInfos = songInfos; + } + + /** + * Return true if this ArtistInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArtistInfo artistInfo = (ArtistInfo) o; + return Objects.equals(this.name, artistInfo.name) + && Objects.equals(this.originalTitle, artistInfo.originalTitle) + && Objects.equals(this.path, artistInfo.path) + && Objects.equals(this.metadataLanguage, artistInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, artistInfo.metadataCountryCode) + && Objects.equals(this.providerIds, artistInfo.providerIds) + && Objects.equals(this.year, artistInfo.year) + && Objects.equals(this.indexNumber, artistInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, artistInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, artistInfo.premiereDate) + && Objects.equals(this.isAutomated, artistInfo.isAutomated) + && Objects.equals(this.songInfos, artistInfo.songInfos); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated, songInfos); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArtistInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append(" songInfos: ").append(toIndentedString(songInfos)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + // add `SongInfos` to the URL query string + if (getSongInfos() != null) { + for (int i = 0; i < getSongInfos().size(); i++) { + if (getSongInfos().get(i) != null) { + joiner.add(getSongInfos().get(i).toUrlQueryString(String.format("%sSongInfos%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private ArtistInfo instance; + + public Builder() { + this(new ArtistInfo()); + } + + protected Builder(ArtistInfo instance) { + this.instance = instance; + } + + public ArtistInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ArtistInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public ArtistInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public ArtistInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public ArtistInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public ArtistInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public ArtistInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public ArtistInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public ArtistInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public ArtistInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public ArtistInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + public ArtistInfo.Builder songInfos(List songInfos) { + this.instance.songInfos = songInfos; + return this; + } + + /** + * returns a built ArtistInfo instance. + * + * The builder is not reusable. + */ + public ArtistInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ArtistInfo.Builder builder() { + return new ArtistInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ArtistInfo.Builder toBuilder() { + return new ArtistInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()).isAutomated(getIsAutomated()) + .songInfos(getSongInfos()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ArtistInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ArtistInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..60bda8e9dbfb9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ArtistInfoRemoteSearchQuery.java @@ -0,0 +1,318 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ArtistInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ ArtistInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + ArtistInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, + ArtistInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + ArtistInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ArtistInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private ArtistInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public ArtistInfoRemoteSearchQuery() { + } + + public ArtistInfoRemoteSearchQuery searchInfo(@org.eclipse.jdt.annotation.NonNull ArtistInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ArtistInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull ArtistInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public ArtistInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public ArtistInfoRemoteSearchQuery searchProviderName( + @org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public ArtistInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this ArtistInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArtistInfoRemoteSearchQuery artistInfoRemoteSearchQuery = (ArtistInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, artistInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, artistInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, artistInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, artistInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArtistInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ArtistInfoRemoteSearchQuery instance; + + public Builder() { + this(new ArtistInfoRemoteSearchQuery()); + } + + protected Builder(ArtistInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public ArtistInfoRemoteSearchQuery.Builder searchInfo(ArtistInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public ArtistInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public ArtistInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public ArtistInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built ArtistInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public ArtistInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ArtistInfoRemoteSearchQuery.Builder builder() { + return new ArtistInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ArtistInfoRemoteSearchQuery.Builder toBuilder() { + return new ArtistInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AuthenticateUserByName.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AuthenticateUserByName.java new file mode 100644 index 0000000000000..d7a7ad3e94dc4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AuthenticateUserByName.java @@ -0,0 +1,275 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The authenticate user by name request body. + */ +@JsonPropertyOrder({ AuthenticateUserByName.JSON_PROPERTY_USERNAME, AuthenticateUserByName.JSON_PROPERTY_PW, + AuthenticateUserByName.JSON_PROPERTY_PASSWORD }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AuthenticateUserByName { + public static final String JSON_PROPERTY_USERNAME = "Username"; + @org.eclipse.jdt.annotation.NonNull + private String username; + + public static final String JSON_PROPERTY_PW = "Pw"; + @org.eclipse.jdt.annotation.NonNull + private String pw; + + public static final String JSON_PROPERTY_PASSWORD = "Password"; + @org.eclipse.jdt.annotation.NonNull + private String password; + + public AuthenticateUserByName() { + } + + public AuthenticateUserByName username(@org.eclipse.jdt.annotation.NonNull String username) { + this.username = username; + return this; + } + + /** + * Gets or sets the username. + * + * @return username + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; + } + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(@org.eclipse.jdt.annotation.NonNull String username) { + this.username = username; + } + + public AuthenticateUserByName pw(@org.eclipse.jdt.annotation.NonNull String pw) { + this.pw = pw; + return this; + } + + /** + * Gets or sets the plain text password. + * + * @return pw + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPw() { + return pw; + } + + @JsonProperty(JSON_PROPERTY_PW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPw(@org.eclipse.jdt.annotation.NonNull String pw) { + this.pw = pw; + } + + public AuthenticateUserByName password(@org.eclipse.jdt.annotation.NonNull String password) { + this.password = password; + return this; + } + + /** + * Gets or sets the sha1-hashed password. + * + * @return password + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(@org.eclipse.jdt.annotation.NonNull String password) { + this.password = password; + } + + /** + * Return true if this AuthenticateUserByName object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthenticateUserByName authenticateUserByName = (AuthenticateUserByName) o; + return Objects.equals(this.username, authenticateUserByName.username) + && Objects.equals(this.pw, authenticateUserByName.pw) + && Objects.equals(this.password, authenticateUserByName.password); + } + + @Override + public int hashCode() { + return Objects.hash(username, pw, password); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthenticateUserByName {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" pw: ").append(toIndentedString(pw)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Username` to the URL query string + if (getUsername() != null) { + joiner.add(String.format("%sUsername%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUsername())))); + } + + // add `Pw` to the URL query string + if (getPw() != null) { + joiner.add( + String.format("%sPw%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPw())))); + } + + // add `Password` to the URL query string + if (getPassword() != null) { + joiner.add(String.format("%sPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPassword())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AuthenticateUserByName instance; + + public Builder() { + this(new AuthenticateUserByName()); + } + + protected Builder(AuthenticateUserByName instance) { + this.instance = instance; + } + + public AuthenticateUserByName.Builder username(String username) { + this.instance.username = username; + return this; + } + + public AuthenticateUserByName.Builder pw(String pw) { + this.instance.pw = pw; + return this; + } + + public AuthenticateUserByName.Builder password(String password) { + this.instance.password = password; + return this; + } + + /** + * returns a built AuthenticateUserByName instance. + * + * The builder is not reusable. + */ + public AuthenticateUserByName build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AuthenticateUserByName.Builder builder() { + return new AuthenticateUserByName.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AuthenticateUserByName.Builder toBuilder() { + return new AuthenticateUserByName.Builder().username(getUsername()).pw(getPw()).password(getPassword()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AuthenticationInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AuthenticationInfo.java new file mode 100644 index 0000000000000..0a0528830eb76 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AuthenticationInfo.java @@ -0,0 +1,643 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AuthenticationInfo + */ +@JsonPropertyOrder({ AuthenticationInfo.JSON_PROPERTY_ID, AuthenticationInfo.JSON_PROPERTY_ACCESS_TOKEN, + AuthenticationInfo.JSON_PROPERTY_DEVICE_ID, AuthenticationInfo.JSON_PROPERTY_APP_NAME, + AuthenticationInfo.JSON_PROPERTY_APP_VERSION, AuthenticationInfo.JSON_PROPERTY_DEVICE_NAME, + AuthenticationInfo.JSON_PROPERTY_USER_ID, AuthenticationInfo.JSON_PROPERTY_IS_ACTIVE, + AuthenticationInfo.JSON_PROPERTY_DATE_CREATED, AuthenticationInfo.JSON_PROPERTY_DATE_REVOKED, + AuthenticationInfo.JSON_PROPERTY_DATE_LAST_ACTIVITY, AuthenticationInfo.JSON_PROPERTY_USER_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AuthenticationInfo { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private Long id; + + public static final String JSON_PROPERTY_ACCESS_TOKEN = "AccessToken"; + @org.eclipse.jdt.annotation.NonNull + private String accessToken; + + public static final String JSON_PROPERTY_DEVICE_ID = "DeviceId"; + @org.eclipse.jdt.annotation.NonNull + private String deviceId; + + public static final String JSON_PROPERTY_APP_NAME = "AppName"; + @org.eclipse.jdt.annotation.NonNull + private String appName; + + public static final String JSON_PROPERTY_APP_VERSION = "AppVersion"; + @org.eclipse.jdt.annotation.NonNull + private String appVersion; + + public static final String JSON_PROPERTY_DEVICE_NAME = "DeviceName"; + @org.eclipse.jdt.annotation.NonNull + private String deviceName; + + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_IS_ACTIVE = "IsActive"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isActive; + + public static final String JSON_PROPERTY_DATE_CREATED = "DateCreated"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateCreated; + + public static final String JSON_PROPERTY_DATE_REVOKED = "DateRevoked"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateRevoked; + + public static final String JSON_PROPERTY_DATE_LAST_ACTIVITY = "DateLastActivity"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateLastActivity; + + public static final String JSON_PROPERTY_USER_NAME = "UserName"; + @org.eclipse.jdt.annotation.NonNull + private String userName; + + public AuthenticationInfo() { + } + + public AuthenticationInfo id(@org.eclipse.jdt.annotation.NonNull Long id) { + this.id = id; + return this; + } + + /** + * Gets or sets the identifier. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull Long id) { + this.id = id; + } + + public AuthenticationInfo accessToken(@org.eclipse.jdt.annotation.NonNull String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Gets or sets the access token. + * + * @return accessToken + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccessToken() { + return accessToken; + } + + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessToken(@org.eclipse.jdt.annotation.NonNull String accessToken) { + this.accessToken = accessToken; + } + + public AuthenticationInfo deviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Gets or sets the device identifier. + * + * @return deviceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceId() { + return deviceId; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + } + + public AuthenticationInfo appName(@org.eclipse.jdt.annotation.NonNull String appName) { + this.appName = appName; + return this; + } + + /** + * Gets or sets the name of the application. + * + * @return appName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppName() { + return appName; + } + + @JsonProperty(JSON_PROPERTY_APP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppName(@org.eclipse.jdt.annotation.NonNull String appName) { + this.appName = appName; + } + + public AuthenticationInfo appVersion(@org.eclipse.jdt.annotation.NonNull String appVersion) { + this.appVersion = appVersion; + return this; + } + + /** + * Gets or sets the application version. + * + * @return appVersion + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APP_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppVersion() { + return appVersion; + } + + @JsonProperty(JSON_PROPERTY_APP_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppVersion(@org.eclipse.jdt.annotation.NonNull String appVersion) { + this.appVersion = appVersion; + } + + public AuthenticationInfo deviceName(@org.eclipse.jdt.annotation.NonNull String deviceName) { + this.deviceName = deviceName; + return this; + } + + /** + * Gets or sets the name of the device. + * + * @return deviceName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceName() { + return deviceName; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceName(@org.eclipse.jdt.annotation.NonNull String deviceName) { + this.deviceName = deviceName; + } + + public AuthenticationInfo userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the user identifier. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public AuthenticationInfo isActive(@org.eclipse.jdt.annotation.NonNull Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is active. + * + * @return isActive + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsActive() { + return isActive; + } + + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsActive(@org.eclipse.jdt.annotation.NonNull Boolean isActive) { + this.isActive = isActive; + } + + public AuthenticationInfo dateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + return this; + } + + /** + * Gets or sets the date created. + * + * @return dateCreated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateCreated() { + return dateCreated; + } + + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + } + + public AuthenticationInfo dateRevoked(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateRevoked) { + this.dateRevoked = dateRevoked; + return this; + } + + /** + * Gets or sets the date revoked. + * + * @return dateRevoked + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_REVOKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateRevoked() { + return dateRevoked; + } + + @JsonProperty(JSON_PROPERTY_DATE_REVOKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateRevoked(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateRevoked) { + this.dateRevoked = dateRevoked; + } + + public AuthenticationInfo dateLastActivity(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateLastActivity) { + this.dateLastActivity = dateLastActivity; + return this; + } + + /** + * Get dateLastActivity + * + * @return dateLastActivity + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_LAST_ACTIVITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateLastActivity() { + return dateLastActivity; + } + + @JsonProperty(JSON_PROPERTY_DATE_LAST_ACTIVITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateLastActivity(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateLastActivity) { + this.dateLastActivity = dateLastActivity; + } + + public AuthenticationInfo userName(@org.eclipse.jdt.annotation.NonNull String userName) { + this.userName = userName; + return this; + } + + /** + * Get userName + * + * @return userName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserName() { + return userName; + } + + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserName(@org.eclipse.jdt.annotation.NonNull String userName) { + this.userName = userName; + } + + /** + * Return true if this AuthenticationInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthenticationInfo authenticationInfo = (AuthenticationInfo) o; + return Objects.equals(this.id, authenticationInfo.id) + && Objects.equals(this.accessToken, authenticationInfo.accessToken) + && Objects.equals(this.deviceId, authenticationInfo.deviceId) + && Objects.equals(this.appName, authenticationInfo.appName) + && Objects.equals(this.appVersion, authenticationInfo.appVersion) + && Objects.equals(this.deviceName, authenticationInfo.deviceName) + && Objects.equals(this.userId, authenticationInfo.userId) + && Objects.equals(this.isActive, authenticationInfo.isActive) + && Objects.equals(this.dateCreated, authenticationInfo.dateCreated) + && Objects.equals(this.dateRevoked, authenticationInfo.dateRevoked) + && Objects.equals(this.dateLastActivity, authenticationInfo.dateLastActivity) + && Objects.equals(this.userName, authenticationInfo.userName); + } + + @Override + public int hashCode() { + return Objects.hash(id, accessToken, deviceId, appName, appVersion, deviceName, userId, isActive, dateCreated, + dateRevoked, dateLastActivity, userName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthenticationInfo {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" deviceId: ").append(toIndentedString(deviceId)).append("\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); + sb.append(" deviceName: ").append(toIndentedString(deviceName)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" dateCreated: ").append(toIndentedString(dateCreated)).append("\n"); + sb.append(" dateRevoked: ").append(toIndentedString(dateRevoked)).append("\n"); + sb.append(" dateLastActivity: ").append(toIndentedString(dateLastActivity)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `AccessToken` to the URL query string + if (getAccessToken() != null) { + joiner.add(String.format("%sAccessToken%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAccessToken())))); + } + + // add `DeviceId` to the URL query string + if (getDeviceId() != null) { + joiner.add(String.format("%sDeviceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceId())))); + } + + // add `AppName` to the URL query string + if (getAppName() != null) { + joiner.add(String.format("%sAppName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAppName())))); + } + + // add `AppVersion` to the URL query string + if (getAppVersion() != null) { + joiner.add(String.format("%sAppVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAppVersion())))); + } + + // add `DeviceName` to the URL query string + if (getDeviceName() != null) { + joiner.add(String.format("%sDeviceName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceName())))); + } + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `IsActive` to the URL query string + if (getIsActive() != null) { + joiner.add(String.format("%sIsActive%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsActive())))); + } + + // add `DateCreated` to the URL query string + if (getDateCreated() != null) { + joiner.add(String.format("%sDateCreated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateCreated())))); + } + + // add `DateRevoked` to the URL query string + if (getDateRevoked() != null) { + joiner.add(String.format("%sDateRevoked%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateRevoked())))); + } + + // add `DateLastActivity` to the URL query string + if (getDateLastActivity() != null) { + joiner.add(String.format("%sDateLastActivity%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateLastActivity())))); + } + + // add `UserName` to the URL query string + if (getUserName() != null) { + joiner.add(String.format("%sUserName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AuthenticationInfo instance; + + public Builder() { + this(new AuthenticationInfo()); + } + + protected Builder(AuthenticationInfo instance) { + this.instance = instance; + } + + public AuthenticationInfo.Builder id(Long id) { + this.instance.id = id; + return this; + } + + public AuthenticationInfo.Builder accessToken(String accessToken) { + this.instance.accessToken = accessToken; + return this; + } + + public AuthenticationInfo.Builder deviceId(String deviceId) { + this.instance.deviceId = deviceId; + return this; + } + + public AuthenticationInfo.Builder appName(String appName) { + this.instance.appName = appName; + return this; + } + + public AuthenticationInfo.Builder appVersion(String appVersion) { + this.instance.appVersion = appVersion; + return this; + } + + public AuthenticationInfo.Builder deviceName(String deviceName) { + this.instance.deviceName = deviceName; + return this; + } + + public AuthenticationInfo.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public AuthenticationInfo.Builder isActive(Boolean isActive) { + this.instance.isActive = isActive; + return this; + } + + public AuthenticationInfo.Builder dateCreated(OffsetDateTime dateCreated) { + this.instance.dateCreated = dateCreated; + return this; + } + + public AuthenticationInfo.Builder dateRevoked(OffsetDateTime dateRevoked) { + this.instance.dateRevoked = dateRevoked; + return this; + } + + public AuthenticationInfo.Builder dateLastActivity(OffsetDateTime dateLastActivity) { + this.instance.dateLastActivity = dateLastActivity; + return this; + } + + public AuthenticationInfo.Builder userName(String userName) { + this.instance.userName = userName; + return this; + } + + /** + * returns a built AuthenticationInfo instance. + * + * The builder is not reusable. + */ + public AuthenticationInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AuthenticationInfo.Builder builder() { + return new AuthenticationInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AuthenticationInfo.Builder toBuilder() { + return new AuthenticationInfo.Builder().id(getId()).accessToken(getAccessToken()).deviceId(getDeviceId()) + .appName(getAppName()).appVersion(getAppVersion()).deviceName(getDeviceName()).userId(getUserId()) + .isActive(getIsActive()).dateCreated(getDateCreated()).dateRevoked(getDateRevoked()) + .dateLastActivity(getDateLastActivity()).userName(getUserName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AuthenticationInfoQueryResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AuthenticationInfoQueryResult.java new file mode 100644 index 0000000000000..0d302a3b7e9af --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AuthenticationInfoQueryResult.java @@ -0,0 +1,290 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AuthenticationInfoQueryResult + */ +@JsonPropertyOrder({ AuthenticationInfoQueryResult.JSON_PROPERTY_ITEMS, + AuthenticationInfoQueryResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, + AuthenticationInfoQueryResult.JSON_PROPERTY_START_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AuthenticationInfoQueryResult { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items; + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public AuthenticationInfoQueryResult() { + } + + public AuthenticationInfoQueryResult items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public AuthenticationInfoQueryResult addItemsItem(AuthenticationInfo itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Gets or sets the items. + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public AuthenticationInfoQueryResult totalRecordCount( + @org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total number of records available. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public AuthenticationInfoQueryResult startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the index of the first record in Items. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + /** + * Return true if this AuthenticationInfoQueryResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthenticationInfoQueryResult authenticationInfoQueryResult = (AuthenticationInfoQueryResult) o; + return Objects.equals(this.items, authenticationInfoQueryResult.items) + && Objects.equals(this.totalRecordCount, authenticationInfoQueryResult.totalRecordCount) + && Objects.equals(this.startIndex, authenticationInfoQueryResult.startIndex); + } + + @Override + public int hashCode() { + return Objects.hash(items, totalRecordCount, startIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthenticationInfoQueryResult {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AuthenticationInfoQueryResult instance; + + public Builder() { + this(new AuthenticationInfoQueryResult()); + } + + protected Builder(AuthenticationInfoQueryResult instance) { + this.instance = instance; + } + + public AuthenticationInfoQueryResult.Builder items(List items) { + this.instance.items = items; + return this; + } + + public AuthenticationInfoQueryResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public AuthenticationInfoQueryResult.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + /** + * returns a built AuthenticationInfoQueryResult instance. + * + * The builder is not reusable. + */ + public AuthenticationInfoQueryResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AuthenticationInfoQueryResult.Builder builder() { + return new AuthenticationInfoQueryResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AuthenticationInfoQueryResult.Builder toBuilder() { + return new AuthenticationInfoQueryResult.Builder().items(getItems()).totalRecordCount(getTotalRecordCount()) + .startIndex(getStartIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AuthenticationResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AuthenticationResult.java new file mode 100644 index 0000000000000..90085ded78a29 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/AuthenticationResult.java @@ -0,0 +1,312 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AuthenticationResult + */ +@JsonPropertyOrder({ AuthenticationResult.JSON_PROPERTY_USER, AuthenticationResult.JSON_PROPERTY_SESSION_INFO, + AuthenticationResult.JSON_PROPERTY_ACCESS_TOKEN, AuthenticationResult.JSON_PROPERTY_SERVER_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class AuthenticationResult { + public static final String JSON_PROPERTY_USER = "User"; + @org.eclipse.jdt.annotation.NonNull + private UserDto user; + + public static final String JSON_PROPERTY_SESSION_INFO = "SessionInfo"; + @org.eclipse.jdt.annotation.NonNull + private SessionInfo sessionInfo; + + public static final String JSON_PROPERTY_ACCESS_TOKEN = "AccessToken"; + @org.eclipse.jdt.annotation.NonNull + private String accessToken; + + public static final String JSON_PROPERTY_SERVER_ID = "ServerId"; + @org.eclipse.jdt.annotation.NonNull + private String serverId; + + public AuthenticationResult() { + } + + public AuthenticationResult user(@org.eclipse.jdt.annotation.NonNull UserDto user) { + this.user = user; + return this; + } + + /** + * Class UserDto. + * + * @return user + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserDto getUser() { + return user; + } + + @JsonProperty(JSON_PROPERTY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUser(@org.eclipse.jdt.annotation.NonNull UserDto user) { + this.user = user; + } + + public AuthenticationResult sessionInfo(@org.eclipse.jdt.annotation.NonNull SessionInfo sessionInfo) { + this.sessionInfo = sessionInfo; + return this; + } + + /** + * Class SessionInfo. + * + * @return sessionInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SESSION_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SessionInfo getSessionInfo() { + return sessionInfo; + } + + @JsonProperty(JSON_PROPERTY_SESSION_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSessionInfo(@org.eclipse.jdt.annotation.NonNull SessionInfo sessionInfo) { + this.sessionInfo = sessionInfo; + } + + public AuthenticationResult accessToken(@org.eclipse.jdt.annotation.NonNull String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get accessToken + * + * @return accessToken + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccessToken() { + return accessToken; + } + + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessToken(@org.eclipse.jdt.annotation.NonNull String accessToken) { + this.accessToken = accessToken; + } + + public AuthenticationResult serverId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + return this; + } + + /** + * Get serverId + * + * @return serverId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerId() { + return serverId; + } + + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + } + + /** + * Return true if this AuthenticationResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthenticationResult authenticationResult = (AuthenticationResult) o; + return Objects.equals(this.user, authenticationResult.user) + && Objects.equals(this.sessionInfo, authenticationResult.sessionInfo) + && Objects.equals(this.accessToken, authenticationResult.accessToken) + && Objects.equals(this.serverId, authenticationResult.serverId); + } + + @Override + public int hashCode() { + return Objects.hash(user, sessionInfo, accessToken, serverId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthenticationResult {\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" sessionInfo: ").append(toIndentedString(sessionInfo)).append("\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `User` to the URL query string + if (getUser() != null) { + joiner.add(getUser().toUrlQueryString(prefix + "User" + suffix)); + } + + // add `SessionInfo` to the URL query string + if (getSessionInfo() != null) { + joiner.add(getSessionInfo().toUrlQueryString(prefix + "SessionInfo" + suffix)); + } + + // add `AccessToken` to the URL query string + if (getAccessToken() != null) { + joiner.add(String.format("%sAccessToken%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAccessToken())))); + } + + // add `ServerId` to the URL query string + if (getServerId() != null) { + joiner.add(String.format("%sServerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AuthenticationResult instance; + + public Builder() { + this(new AuthenticationResult()); + } + + protected Builder(AuthenticationResult instance) { + this.instance = instance; + } + + public AuthenticationResult.Builder user(UserDto user) { + this.instance.user = user; + return this; + } + + public AuthenticationResult.Builder sessionInfo(SessionInfo sessionInfo) { + this.instance.sessionInfo = sessionInfo; + return this; + } + + public AuthenticationResult.Builder accessToken(String accessToken) { + this.instance.accessToken = accessToken; + return this; + } + + public AuthenticationResult.Builder serverId(String serverId) { + this.instance.serverId = serverId; + return this; + } + + /** + * returns a built AuthenticationResult instance. + * + * The builder is not reusable. + */ + public AuthenticationResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AuthenticationResult.Builder builder() { + return new AuthenticationResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AuthenticationResult.Builder toBuilder() { + return new AuthenticationResult.Builder().user(getUser()).sessionInfo(getSessionInfo()) + .accessToken(getAccessToken()).serverId(getServerId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItem.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItem.java new file mode 100644 index 0000000000000..2881a69f03cd1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItem.java @@ -0,0 +1,613 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class BaseItem. + */ +@JsonPropertyOrder({ BaseItem.JSON_PROPERTY_SIZE, BaseItem.JSON_PROPERTY_CONTAINER, BaseItem.JSON_PROPERTY_IS_H_D, + BaseItem.JSON_PROPERTY_IS_SHORTCUT, BaseItem.JSON_PROPERTY_SHORTCUT_PATH, BaseItem.JSON_PROPERTY_WIDTH, + BaseItem.JSON_PROPERTY_HEIGHT, BaseItem.JSON_PROPERTY_EXTRA_IDS, BaseItem.JSON_PROPERTY_DATE_LAST_SAVED, + BaseItem.JSON_PROPERTY_REMOTE_TRAILERS, BaseItem.JSON_PROPERTY_SUPPORTS_EXTERNAL_TRANSFER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BaseItem { + public static final String JSON_PROPERTY_SIZE = "Size"; + @org.eclipse.jdt.annotation.NonNull + private Long size; + + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public static final String JSON_PROPERTY_IS_H_D = "IsHD"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isHD; + + public static final String JSON_PROPERTY_IS_SHORTCUT = "IsShortcut"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isShortcut; + + public static final String JSON_PROPERTY_SHORTCUT_PATH = "ShortcutPath"; + @org.eclipse.jdt.annotation.NonNull + private String shortcutPath; + + public static final String JSON_PROPERTY_WIDTH = "Width"; + @org.eclipse.jdt.annotation.NonNull + private Integer width; + + public static final String JSON_PROPERTY_HEIGHT = "Height"; + @org.eclipse.jdt.annotation.NonNull + private Integer height; + + public static final String JSON_PROPERTY_EXTRA_IDS = "ExtraIds"; + @org.eclipse.jdt.annotation.NonNull + private List extraIds; + + public static final String JSON_PROPERTY_DATE_LAST_SAVED = "DateLastSaved"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateLastSaved; + + public static final String JSON_PROPERTY_REMOTE_TRAILERS = "RemoteTrailers"; + @org.eclipse.jdt.annotation.NonNull + private List remoteTrailers; + + public static final String JSON_PROPERTY_SUPPORTS_EXTERNAL_TRANSFER = "SupportsExternalTransfer"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsExternalTransfer; + + public BaseItem() { + } + + @JsonCreator + public BaseItem(@JsonProperty(JSON_PROPERTY_IS_H_D) Boolean isHD, + @JsonProperty(JSON_PROPERTY_SUPPORTS_EXTERNAL_TRANSFER) Boolean supportsExternalTransfer) { + this(); + this.isHD = isHD; + this.supportsExternalTransfer = supportsExternalTransfer; + } + + public BaseItem size(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + return this; + } + + /** + * Get size + * + * @return size + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSize() { + return size; + } + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSize(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + } + + public BaseItem container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Get container + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + /** + * Get isHD + * + * @return isHD + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_H_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsHD() { + return isHD; + } + + public BaseItem isShortcut(@org.eclipse.jdt.annotation.NonNull Boolean isShortcut) { + this.isShortcut = isShortcut; + return this; + } + + /** + * Get isShortcut + * + * @return isShortcut + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_SHORTCUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsShortcut() { + return isShortcut; + } + + @JsonProperty(JSON_PROPERTY_IS_SHORTCUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsShortcut(@org.eclipse.jdt.annotation.NonNull Boolean isShortcut) { + this.isShortcut = isShortcut; + } + + public BaseItem shortcutPath(@org.eclipse.jdt.annotation.NonNull String shortcutPath) { + this.shortcutPath = shortcutPath; + return this; + } + + /** + * Get shortcutPath + * + * @return shortcutPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SHORTCUT_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getShortcutPath() { + return shortcutPath; + } + + @JsonProperty(JSON_PROPERTY_SHORTCUT_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShortcutPath(@org.eclipse.jdt.annotation.NonNull String shortcutPath) { + this.shortcutPath = shortcutPath; + } + + public BaseItem width(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + return this; + } + + /** + * Get width + * + * @return width + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + } + + public BaseItem height(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + return this; + } + + /** + * Get height + * + * @return height + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHeight() { + return height; + } + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + } + + public BaseItem extraIds(@org.eclipse.jdt.annotation.NonNull List extraIds) { + this.extraIds = extraIds; + return this; + } + + public BaseItem addExtraIdsItem(UUID extraIdsItem) { + if (this.extraIds == null) { + this.extraIds = new ArrayList<>(); + } + this.extraIds.add(extraIdsItem); + return this; + } + + /** + * Get extraIds + * + * @return extraIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTRA_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getExtraIds() { + return extraIds; + } + + @JsonProperty(JSON_PROPERTY_EXTRA_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExtraIds(@org.eclipse.jdt.annotation.NonNull List extraIds) { + this.extraIds = extraIds; + } + + public BaseItem dateLastSaved(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateLastSaved) { + this.dateLastSaved = dateLastSaved; + return this; + } + + /** + * Get dateLastSaved + * + * @return dateLastSaved + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_LAST_SAVED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateLastSaved() { + return dateLastSaved; + } + + @JsonProperty(JSON_PROPERTY_DATE_LAST_SAVED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateLastSaved(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateLastSaved) { + this.dateLastSaved = dateLastSaved; + } + + public BaseItem remoteTrailers(@org.eclipse.jdt.annotation.NonNull List remoteTrailers) { + this.remoteTrailers = remoteTrailers; + return this; + } + + public BaseItem addRemoteTrailersItem(MediaUrl remoteTrailersItem) { + if (this.remoteTrailers == null) { + this.remoteTrailers = new ArrayList<>(); + } + this.remoteTrailers.add(remoteTrailersItem); + return this; + } + + /** + * Gets or sets the remote trailers. + * + * @return remoteTrailers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMOTE_TRAILERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRemoteTrailers() { + return remoteTrailers; + } + + @JsonProperty(JSON_PROPERTY_REMOTE_TRAILERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemoteTrailers(@org.eclipse.jdt.annotation.NonNull List remoteTrailers) { + this.remoteTrailers = remoteTrailers; + } + + /** + * Get supportsExternalTransfer + * + * @return supportsExternalTransfer + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_EXTERNAL_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsExternalTransfer() { + return supportsExternalTransfer; + } + + /** + * Return true if this BaseItem object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseItem baseItem = (BaseItem) o; + return Objects.equals(this.size, baseItem.size) && Objects.equals(this.container, baseItem.container) + && Objects.equals(this.isHD, baseItem.isHD) && Objects.equals(this.isShortcut, baseItem.isShortcut) + && Objects.equals(this.shortcutPath, baseItem.shortcutPath) + && Objects.equals(this.width, baseItem.width) && Objects.equals(this.height, baseItem.height) + && Objects.equals(this.extraIds, baseItem.extraIds) + && Objects.equals(this.dateLastSaved, baseItem.dateLastSaved) + && Objects.equals(this.remoteTrailers, baseItem.remoteTrailers) + && Objects.equals(this.supportsExternalTransfer, baseItem.supportsExternalTransfer); + } + + @Override + public int hashCode() { + return Objects.hash(size, container, isHD, isShortcut, shortcutPath, width, height, extraIds, dateLastSaved, + remoteTrailers, supportsExternalTransfer); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseItem {\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" isHD: ").append(toIndentedString(isHD)).append("\n"); + sb.append(" isShortcut: ").append(toIndentedString(isShortcut)).append("\n"); + sb.append(" shortcutPath: ").append(toIndentedString(shortcutPath)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" extraIds: ").append(toIndentedString(extraIds)).append("\n"); + sb.append(" dateLastSaved: ").append(toIndentedString(dateLastSaved)).append("\n"); + sb.append(" remoteTrailers: ").append(toIndentedString(remoteTrailers)).append("\n"); + sb.append(" supportsExternalTransfer: ").append(toIndentedString(supportsExternalTransfer)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Size` to the URL query string + if (getSize() != null) { + joiner.add(String.format("%sSize%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSize())))); + } + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + // add `IsHD` to the URL query string + if (getIsHD() != null) { + joiner.add(String.format("%sIsHD%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsHD())))); + } + + // add `IsShortcut` to the URL query string + if (getIsShortcut() != null) { + joiner.add(String.format("%sIsShortcut%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsShortcut())))); + } + + // add `ShortcutPath` to the URL query string + if (getShortcutPath() != null) { + joiner.add(String.format("%sShortcutPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getShortcutPath())))); + } + + // add `Width` to the URL query string + if (getWidth() != null) { + joiner.add(String.format("%sWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWidth())))); + } + + // add `Height` to the URL query string + if (getHeight() != null) { + joiner.add(String.format("%sHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHeight())))); + } + + // add `ExtraIds` to the URL query string + if (getExtraIds() != null) { + for (int i = 0; i < getExtraIds().size(); i++) { + if (getExtraIds().get(i) != null) { + joiner.add(String.format("%sExtraIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getExtraIds().get(i))))); + } + } + } + + // add `DateLastSaved` to the URL query string + if (getDateLastSaved() != null) { + joiner.add(String.format("%sDateLastSaved%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateLastSaved())))); + } + + // add `RemoteTrailers` to the URL query string + if (getRemoteTrailers() != null) { + for (int i = 0; i < getRemoteTrailers().size(); i++) { + if (getRemoteTrailers().get(i) != null) { + joiner.add(getRemoteTrailers().get(i).toUrlQueryString(String.format("%sRemoteTrailers%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `SupportsExternalTransfer` to the URL query string + if (getSupportsExternalTransfer() != null) { + joiner.add(String.format("%sSupportsExternalTransfer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsExternalTransfer())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BaseItem instance; + + public Builder() { + this(new BaseItem()); + } + + protected Builder(BaseItem instance) { + this.instance = instance; + } + + public BaseItem.Builder size(Long size) { + this.instance.size = size; + return this; + } + + public BaseItem.Builder container(String container) { + this.instance.container = container; + return this; + } + + public BaseItem.Builder isHD(Boolean isHD) { + this.instance.isHD = isHD; + return this; + } + + public BaseItem.Builder isShortcut(Boolean isShortcut) { + this.instance.isShortcut = isShortcut; + return this; + } + + public BaseItem.Builder shortcutPath(String shortcutPath) { + this.instance.shortcutPath = shortcutPath; + return this; + } + + public BaseItem.Builder width(Integer width) { + this.instance.width = width; + return this; + } + + public BaseItem.Builder height(Integer height) { + this.instance.height = height; + return this; + } + + public BaseItem.Builder extraIds(List extraIds) { + this.instance.extraIds = extraIds; + return this; + } + + public BaseItem.Builder dateLastSaved(OffsetDateTime dateLastSaved) { + this.instance.dateLastSaved = dateLastSaved; + return this; + } + + public BaseItem.Builder remoteTrailers(List remoteTrailers) { + this.instance.remoteTrailers = remoteTrailers; + return this; + } + + public BaseItem.Builder supportsExternalTransfer(Boolean supportsExternalTransfer) { + this.instance.supportsExternalTransfer = supportsExternalTransfer; + return this; + } + + /** + * returns a built BaseItem instance. + * + * The builder is not reusable. + */ + public BaseItem build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BaseItem.Builder builder() { + return new BaseItem.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BaseItem.Builder toBuilder() { + return new BaseItem.Builder().size(getSize()).container(getContainer()).isHD(getIsHD()) + .isShortcut(getIsShortcut()).shortcutPath(getShortcutPath()).width(getWidth()).height(getHeight()) + .extraIds(getExtraIds()).dateLastSaved(getDateLastSaved()).remoteTrailers(getRemoteTrailers()) + .supportsExternalTransfer(getSupportsExternalTransfer()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemDto.java new file mode 100644 index 0000000000000..3bd55baad5a72 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemDto.java @@ -0,0 +1,6600 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * This is strictly used as a data transfer object from the api layer. This holds information about a BaseItem in a + * format that is convenient for the client. + */ +@JsonPropertyOrder({ BaseItemDto.JSON_PROPERTY_NAME, BaseItemDto.JSON_PROPERTY_ORIGINAL_TITLE, + BaseItemDto.JSON_PROPERTY_SERVER_ID, BaseItemDto.JSON_PROPERTY_ID, BaseItemDto.JSON_PROPERTY_ETAG, + BaseItemDto.JSON_PROPERTY_SOURCE_TYPE, BaseItemDto.JSON_PROPERTY_PLAYLIST_ITEM_ID, + BaseItemDto.JSON_PROPERTY_DATE_CREATED, BaseItemDto.JSON_PROPERTY_DATE_LAST_MEDIA_ADDED, + BaseItemDto.JSON_PROPERTY_EXTRA_TYPE, BaseItemDto.JSON_PROPERTY_AIRS_BEFORE_SEASON_NUMBER, + BaseItemDto.JSON_PROPERTY_AIRS_AFTER_SEASON_NUMBER, BaseItemDto.JSON_PROPERTY_AIRS_BEFORE_EPISODE_NUMBER, + BaseItemDto.JSON_PROPERTY_CAN_DELETE, BaseItemDto.JSON_PROPERTY_CAN_DOWNLOAD, + BaseItemDto.JSON_PROPERTY_HAS_SUBTITLES, BaseItemDto.JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE, + BaseItemDto.JSON_PROPERTY_PREFERRED_METADATA_COUNTRY_CODE, BaseItemDto.JSON_PROPERTY_SUPPORTS_SYNC, + BaseItemDto.JSON_PROPERTY_CONTAINER, BaseItemDto.JSON_PROPERTY_SORT_NAME, + BaseItemDto.JSON_PROPERTY_FORCED_SORT_NAME, BaseItemDto.JSON_PROPERTY_VIDEO3_D_FORMAT, + BaseItemDto.JSON_PROPERTY_PREMIERE_DATE, BaseItemDto.JSON_PROPERTY_EXTERNAL_URLS, + BaseItemDto.JSON_PROPERTY_MEDIA_SOURCES, BaseItemDto.JSON_PROPERTY_CRITIC_RATING, + BaseItemDto.JSON_PROPERTY_PRODUCTION_LOCATIONS, BaseItemDto.JSON_PROPERTY_PATH, + BaseItemDto.JSON_PROPERTY_ENABLE_MEDIA_SOURCE_DISPLAY, BaseItemDto.JSON_PROPERTY_OFFICIAL_RATING, + BaseItemDto.JSON_PROPERTY_CUSTOM_RATING, BaseItemDto.JSON_PROPERTY_CHANNEL_ID, + BaseItemDto.JSON_PROPERTY_CHANNEL_NAME, BaseItemDto.JSON_PROPERTY_OVERVIEW, BaseItemDto.JSON_PROPERTY_TAGLINES, + BaseItemDto.JSON_PROPERTY_GENRES, BaseItemDto.JSON_PROPERTY_COMMUNITY_RATING, + BaseItemDto.JSON_PROPERTY_CUMULATIVE_RUN_TIME_TICKS, BaseItemDto.JSON_PROPERTY_RUN_TIME_TICKS, + BaseItemDto.JSON_PROPERTY_PLAY_ACCESS, BaseItemDto.JSON_PROPERTY_ASPECT_RATIO, + BaseItemDto.JSON_PROPERTY_PRODUCTION_YEAR, BaseItemDto.JSON_PROPERTY_IS_PLACE_HOLDER, + BaseItemDto.JSON_PROPERTY_NUMBER, BaseItemDto.JSON_PROPERTY_CHANNEL_NUMBER, + BaseItemDto.JSON_PROPERTY_INDEX_NUMBER, BaseItemDto.JSON_PROPERTY_INDEX_NUMBER_END, + BaseItemDto.JSON_PROPERTY_PARENT_INDEX_NUMBER, BaseItemDto.JSON_PROPERTY_REMOTE_TRAILERS, + BaseItemDto.JSON_PROPERTY_PROVIDER_IDS, BaseItemDto.JSON_PROPERTY_IS_H_D, BaseItemDto.JSON_PROPERTY_IS_FOLDER, + BaseItemDto.JSON_PROPERTY_PARENT_ID, BaseItemDto.JSON_PROPERTY_TYPE, BaseItemDto.JSON_PROPERTY_PEOPLE, + BaseItemDto.JSON_PROPERTY_STUDIOS, BaseItemDto.JSON_PROPERTY_GENRE_ITEMS, + BaseItemDto.JSON_PROPERTY_PARENT_LOGO_ITEM_ID, BaseItemDto.JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID, + BaseItemDto.JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS, BaseItemDto.JSON_PROPERTY_LOCAL_TRAILER_COUNT, + BaseItemDto.JSON_PROPERTY_USER_DATA, BaseItemDto.JSON_PROPERTY_RECURSIVE_ITEM_COUNT, + BaseItemDto.JSON_PROPERTY_CHILD_COUNT, BaseItemDto.JSON_PROPERTY_SERIES_NAME, + BaseItemDto.JSON_PROPERTY_SERIES_ID, BaseItemDto.JSON_PROPERTY_SEASON_ID, + BaseItemDto.JSON_PROPERTY_SPECIAL_FEATURE_COUNT, BaseItemDto.JSON_PROPERTY_DISPLAY_PREFERENCES_ID, + BaseItemDto.JSON_PROPERTY_STATUS, BaseItemDto.JSON_PROPERTY_AIR_TIME, BaseItemDto.JSON_PROPERTY_AIR_DAYS, + BaseItemDto.JSON_PROPERTY_TAGS, BaseItemDto.JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO, + BaseItemDto.JSON_PROPERTY_ARTISTS, BaseItemDto.JSON_PROPERTY_ARTIST_ITEMS, BaseItemDto.JSON_PROPERTY_ALBUM, + BaseItemDto.JSON_PROPERTY_COLLECTION_TYPE, BaseItemDto.JSON_PROPERTY_DISPLAY_ORDER, + BaseItemDto.JSON_PROPERTY_ALBUM_ID, BaseItemDto.JSON_PROPERTY_ALBUM_PRIMARY_IMAGE_TAG, + BaseItemDto.JSON_PROPERTY_SERIES_PRIMARY_IMAGE_TAG, BaseItemDto.JSON_PROPERTY_ALBUM_ARTIST, + BaseItemDto.JSON_PROPERTY_ALBUM_ARTISTS, BaseItemDto.JSON_PROPERTY_SEASON_NAME, + BaseItemDto.JSON_PROPERTY_MEDIA_STREAMS, BaseItemDto.JSON_PROPERTY_VIDEO_TYPE, + BaseItemDto.JSON_PROPERTY_PART_COUNT, BaseItemDto.JSON_PROPERTY_MEDIA_SOURCE_COUNT, + BaseItemDto.JSON_PROPERTY_IMAGE_TAGS, BaseItemDto.JSON_PROPERTY_BACKDROP_IMAGE_TAGS, + BaseItemDto.JSON_PROPERTY_SCREENSHOT_IMAGE_TAGS, BaseItemDto.JSON_PROPERTY_PARENT_LOGO_IMAGE_TAG, + BaseItemDto.JSON_PROPERTY_PARENT_ART_ITEM_ID, BaseItemDto.JSON_PROPERTY_PARENT_ART_IMAGE_TAG, + BaseItemDto.JSON_PROPERTY_SERIES_THUMB_IMAGE_TAG, BaseItemDto.JSON_PROPERTY_IMAGE_BLUR_HASHES, + BaseItemDto.JSON_PROPERTY_SERIES_STUDIO, BaseItemDto.JSON_PROPERTY_PARENT_THUMB_ITEM_ID, + BaseItemDto.JSON_PROPERTY_PARENT_THUMB_IMAGE_TAG, BaseItemDto.JSON_PROPERTY_PARENT_PRIMARY_IMAGE_ITEM_ID, + BaseItemDto.JSON_PROPERTY_PARENT_PRIMARY_IMAGE_TAG, BaseItemDto.JSON_PROPERTY_CHAPTERS, + BaseItemDto.JSON_PROPERTY_LOCATION_TYPE, BaseItemDto.JSON_PROPERTY_ISO_TYPE, + BaseItemDto.JSON_PROPERTY_MEDIA_TYPE, BaseItemDto.JSON_PROPERTY_END_DATE, + BaseItemDto.JSON_PROPERTY_LOCKED_FIELDS, BaseItemDto.JSON_PROPERTY_TRAILER_COUNT, + BaseItemDto.JSON_PROPERTY_MOVIE_COUNT, BaseItemDto.JSON_PROPERTY_SERIES_COUNT, + BaseItemDto.JSON_PROPERTY_PROGRAM_COUNT, BaseItemDto.JSON_PROPERTY_EPISODE_COUNT, + BaseItemDto.JSON_PROPERTY_SONG_COUNT, BaseItemDto.JSON_PROPERTY_ALBUM_COUNT, + BaseItemDto.JSON_PROPERTY_ARTIST_COUNT, BaseItemDto.JSON_PROPERTY_MUSIC_VIDEO_COUNT, + BaseItemDto.JSON_PROPERTY_LOCK_DATA, BaseItemDto.JSON_PROPERTY_WIDTH, BaseItemDto.JSON_PROPERTY_HEIGHT, + BaseItemDto.JSON_PROPERTY_CAMERA_MAKE, BaseItemDto.JSON_PROPERTY_CAMERA_MODEL, + BaseItemDto.JSON_PROPERTY_SOFTWARE, BaseItemDto.JSON_PROPERTY_EXPOSURE_TIME, + BaseItemDto.JSON_PROPERTY_FOCAL_LENGTH, BaseItemDto.JSON_PROPERTY_IMAGE_ORIENTATION, + BaseItemDto.JSON_PROPERTY_APERTURE, BaseItemDto.JSON_PROPERTY_SHUTTER_SPEED, BaseItemDto.JSON_PROPERTY_LATITUDE, + BaseItemDto.JSON_PROPERTY_LONGITUDE, BaseItemDto.JSON_PROPERTY_ALTITUDE, + BaseItemDto.JSON_PROPERTY_ISO_SPEED_RATING, BaseItemDto.JSON_PROPERTY_SERIES_TIMER_ID, + BaseItemDto.JSON_PROPERTY_PROGRAM_ID, BaseItemDto.JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG, + BaseItemDto.JSON_PROPERTY_START_DATE, BaseItemDto.JSON_PROPERTY_COMPLETION_PERCENTAGE, + BaseItemDto.JSON_PROPERTY_IS_REPEAT, BaseItemDto.JSON_PROPERTY_EPISODE_TITLE, + BaseItemDto.JSON_PROPERTY_CHANNEL_TYPE, BaseItemDto.JSON_PROPERTY_AUDIO, BaseItemDto.JSON_PROPERTY_IS_MOVIE, + BaseItemDto.JSON_PROPERTY_IS_SPORTS, BaseItemDto.JSON_PROPERTY_IS_SERIES, BaseItemDto.JSON_PROPERTY_IS_LIVE, + BaseItemDto.JSON_PROPERTY_IS_NEWS, BaseItemDto.JSON_PROPERTY_IS_KIDS, BaseItemDto.JSON_PROPERTY_IS_PREMIERE, + BaseItemDto.JSON_PROPERTY_TIMER_ID, BaseItemDto.JSON_PROPERTY_CURRENT_PROGRAM }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BaseItemDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_SERVER_ID = "ServerId"; + @org.eclipse.jdt.annotation.NonNull + private String serverId; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_ETAG = "Etag"; + @org.eclipse.jdt.annotation.NonNull + private String etag; + + public static final String JSON_PROPERTY_SOURCE_TYPE = "SourceType"; + @org.eclipse.jdt.annotation.NonNull + private String sourceType; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private String playlistItemId; + + public static final String JSON_PROPERTY_DATE_CREATED = "DateCreated"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateCreated; + + public static final String JSON_PROPERTY_DATE_LAST_MEDIA_ADDED = "DateLastMediaAdded"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateLastMediaAdded; + + public static final String JSON_PROPERTY_EXTRA_TYPE = "ExtraType"; + @org.eclipse.jdt.annotation.NonNull + private String extraType; + + public static final String JSON_PROPERTY_AIRS_BEFORE_SEASON_NUMBER = "AirsBeforeSeasonNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer airsBeforeSeasonNumber; + + public static final String JSON_PROPERTY_AIRS_AFTER_SEASON_NUMBER = "AirsAfterSeasonNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer airsAfterSeasonNumber; + + public static final String JSON_PROPERTY_AIRS_BEFORE_EPISODE_NUMBER = "AirsBeforeEpisodeNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer airsBeforeEpisodeNumber; + + public static final String JSON_PROPERTY_CAN_DELETE = "CanDelete"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canDelete; + + public static final String JSON_PROPERTY_CAN_DOWNLOAD = "CanDownload"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canDownload; + + public static final String JSON_PROPERTY_HAS_SUBTITLES = "HasSubtitles"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasSubtitles; + + public static final String JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE = "PreferredMetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String preferredMetadataLanguage; + + public static final String JSON_PROPERTY_PREFERRED_METADATA_COUNTRY_CODE = "PreferredMetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String preferredMetadataCountryCode; + + public static final String JSON_PROPERTY_SUPPORTS_SYNC = "SupportsSync"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsSync; + + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public static final String JSON_PROPERTY_SORT_NAME = "SortName"; + @org.eclipse.jdt.annotation.NonNull + private String sortName; + + public static final String JSON_PROPERTY_FORCED_SORT_NAME = "ForcedSortName"; + @org.eclipse.jdt.annotation.NonNull + private String forcedSortName; + + public static final String JSON_PROPERTY_VIDEO3_D_FORMAT = "Video3DFormat"; + @org.eclipse.jdt.annotation.NonNull + private Video3DFormat video3DFormat; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_EXTERNAL_URLS = "ExternalUrls"; + @org.eclipse.jdt.annotation.NonNull + private List externalUrls; + + public static final String JSON_PROPERTY_MEDIA_SOURCES = "MediaSources"; + @org.eclipse.jdt.annotation.NonNull + private List mediaSources; + + public static final String JSON_PROPERTY_CRITIC_RATING = "CriticRating"; + @org.eclipse.jdt.annotation.NonNull + private Float criticRating; + + public static final String JSON_PROPERTY_PRODUCTION_LOCATIONS = "ProductionLocations"; + @org.eclipse.jdt.annotation.NonNull + private List productionLocations; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_ENABLE_MEDIA_SOURCE_DISPLAY = "EnableMediaSourceDisplay"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableMediaSourceDisplay; + + public static final String JSON_PROPERTY_OFFICIAL_RATING = "OfficialRating"; + @org.eclipse.jdt.annotation.NonNull + private String officialRating; + + public static final String JSON_PROPERTY_CUSTOM_RATING = "CustomRating"; + @org.eclipse.jdt.annotation.NonNull + private String customRating; + + public static final String JSON_PROPERTY_CHANNEL_ID = "ChannelId"; + @org.eclipse.jdt.annotation.NonNull + private UUID channelId; + + public static final String JSON_PROPERTY_CHANNEL_NAME = "ChannelName"; + @org.eclipse.jdt.annotation.NonNull + private String channelName; + + public static final String JSON_PROPERTY_OVERVIEW = "Overview"; + @org.eclipse.jdt.annotation.NonNull + private String overview; + + public static final String JSON_PROPERTY_TAGLINES = "Taglines"; + @org.eclipse.jdt.annotation.NonNull + private List taglines; + + public static final String JSON_PROPERTY_GENRES = "Genres"; + @org.eclipse.jdt.annotation.NonNull + private List genres; + + public static final String JSON_PROPERTY_COMMUNITY_RATING = "CommunityRating"; + @org.eclipse.jdt.annotation.NonNull + private Float communityRating; + + public static final String JSON_PROPERTY_CUMULATIVE_RUN_TIME_TICKS = "CumulativeRunTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long cumulativeRunTimeTicks; + + public static final String JSON_PROPERTY_RUN_TIME_TICKS = "RunTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long runTimeTicks; + + public static final String JSON_PROPERTY_PLAY_ACCESS = "PlayAccess"; + @org.eclipse.jdt.annotation.NonNull + private PlayAccess playAccess; + + public static final String JSON_PROPERTY_ASPECT_RATIO = "AspectRatio"; + @org.eclipse.jdt.annotation.NonNull + private String aspectRatio; + + public static final String JSON_PROPERTY_PRODUCTION_YEAR = "ProductionYear"; + @org.eclipse.jdt.annotation.NonNull + private Integer productionYear; + + public static final String JSON_PROPERTY_IS_PLACE_HOLDER = "IsPlaceHolder"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPlaceHolder; + + public static final String JSON_PROPERTY_NUMBER = "Number"; + @org.eclipse.jdt.annotation.NonNull + private String number; + + public static final String JSON_PROPERTY_CHANNEL_NUMBER = "ChannelNumber"; + @org.eclipse.jdt.annotation.NonNull + private String channelNumber; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_INDEX_NUMBER_END = "IndexNumberEnd"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumberEnd; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_REMOTE_TRAILERS = "RemoteTrailers"; + @org.eclipse.jdt.annotation.NonNull + private List remoteTrailers; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_IS_H_D = "IsHD"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isHD; + + public static final String JSON_PROPERTY_IS_FOLDER = "IsFolder"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isFolder; + + public static final String JSON_PROPERTY_PARENT_ID = "ParentId"; + @org.eclipse.jdt.annotation.NonNull + private UUID parentId; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemKind type; + + public static final String JSON_PROPERTY_PEOPLE = "People"; + @org.eclipse.jdt.annotation.NonNull + private List people; + + public static final String JSON_PROPERTY_STUDIOS = "Studios"; + @org.eclipse.jdt.annotation.NonNull + private List studios; + + public static final String JSON_PROPERTY_GENRE_ITEMS = "GenreItems"; + @org.eclipse.jdt.annotation.NonNull + private List genreItems; + + public static final String JSON_PROPERTY_PARENT_LOGO_ITEM_ID = "ParentLogoItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID parentLogoItemId; + + public static final String JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID = "ParentBackdropItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID parentBackdropItemId; + + public static final String JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS = "ParentBackdropImageTags"; + @org.eclipse.jdt.annotation.NonNull + private List parentBackdropImageTags; + + public static final String JSON_PROPERTY_LOCAL_TRAILER_COUNT = "LocalTrailerCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer localTrailerCount; + + public static final String JSON_PROPERTY_USER_DATA = "UserData"; + @org.eclipse.jdt.annotation.NonNull + private UserItemDataDto userData; + + public static final String JSON_PROPERTY_RECURSIVE_ITEM_COUNT = "RecursiveItemCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer recursiveItemCount; + + public static final String JSON_PROPERTY_CHILD_COUNT = "ChildCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer childCount; + + public static final String JSON_PROPERTY_SERIES_NAME = "SeriesName"; + @org.eclipse.jdt.annotation.NonNull + private String seriesName; + + public static final String JSON_PROPERTY_SERIES_ID = "SeriesId"; + @org.eclipse.jdt.annotation.NonNull + private UUID seriesId; + + public static final String JSON_PROPERTY_SEASON_ID = "SeasonId"; + @org.eclipse.jdt.annotation.NonNull + private UUID seasonId; + + public static final String JSON_PROPERTY_SPECIAL_FEATURE_COUNT = "SpecialFeatureCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer specialFeatureCount; + + public static final String JSON_PROPERTY_DISPLAY_PREFERENCES_ID = "DisplayPreferencesId"; + @org.eclipse.jdt.annotation.NonNull + private String displayPreferencesId; + + public static final String JSON_PROPERTY_STATUS = "Status"; + @org.eclipse.jdt.annotation.NonNull + private String status; + + public static final String JSON_PROPERTY_AIR_TIME = "AirTime"; + @org.eclipse.jdt.annotation.NonNull + private String airTime; + + public static final String JSON_PROPERTY_AIR_DAYS = "AirDays"; + @org.eclipse.jdt.annotation.NonNull + private List airDays; + + public static final String JSON_PROPERTY_TAGS = "Tags"; + @org.eclipse.jdt.annotation.NonNull + private List tags; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO = "PrimaryImageAspectRatio"; + @org.eclipse.jdt.annotation.NonNull + private Double primaryImageAspectRatio; + + public static final String JSON_PROPERTY_ARTISTS = "Artists"; + @org.eclipse.jdt.annotation.NonNull + private List artists; + + public static final String JSON_PROPERTY_ARTIST_ITEMS = "ArtistItems"; + @org.eclipse.jdt.annotation.NonNull + private List artistItems; + + public static final String JSON_PROPERTY_ALBUM = "Album"; + @org.eclipse.jdt.annotation.NonNull + private String album; + + public static final String JSON_PROPERTY_COLLECTION_TYPE = "CollectionType"; + @org.eclipse.jdt.annotation.NonNull + private String collectionType; + + public static final String JSON_PROPERTY_DISPLAY_ORDER = "DisplayOrder"; + @org.eclipse.jdt.annotation.NonNull + private String displayOrder; + + public static final String JSON_PROPERTY_ALBUM_ID = "AlbumId"; + @org.eclipse.jdt.annotation.NonNull + private UUID albumId; + + public static final String JSON_PROPERTY_ALBUM_PRIMARY_IMAGE_TAG = "AlbumPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String albumPrimaryImageTag; + + public static final String JSON_PROPERTY_SERIES_PRIMARY_IMAGE_TAG = "SeriesPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String seriesPrimaryImageTag; + + public static final String JSON_PROPERTY_ALBUM_ARTIST = "AlbumArtist"; + @org.eclipse.jdt.annotation.NonNull + private String albumArtist; + + public static final String JSON_PROPERTY_ALBUM_ARTISTS = "AlbumArtists"; + @org.eclipse.jdt.annotation.NonNull + private List albumArtists; + + public static final String JSON_PROPERTY_SEASON_NAME = "SeasonName"; + @org.eclipse.jdt.annotation.NonNull + private String seasonName; + + public static final String JSON_PROPERTY_MEDIA_STREAMS = "MediaStreams"; + @org.eclipse.jdt.annotation.NonNull + private List mediaStreams; + + public static final String JSON_PROPERTY_VIDEO_TYPE = "VideoType"; + @org.eclipse.jdt.annotation.NonNull + private VideoType videoType; + + public static final String JSON_PROPERTY_PART_COUNT = "PartCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer partCount; + + public static final String JSON_PROPERTY_MEDIA_SOURCE_COUNT = "MediaSourceCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer mediaSourceCount; + + public static final String JSON_PROPERTY_IMAGE_TAGS = "ImageTags"; + @org.eclipse.jdt.annotation.NonNull + private Map imageTags; + + public static final String JSON_PROPERTY_BACKDROP_IMAGE_TAGS = "BackdropImageTags"; + @org.eclipse.jdt.annotation.NonNull + private List backdropImageTags; + + public static final String JSON_PROPERTY_SCREENSHOT_IMAGE_TAGS = "ScreenshotImageTags"; + @org.eclipse.jdt.annotation.NonNull + private List screenshotImageTags; + + public static final String JSON_PROPERTY_PARENT_LOGO_IMAGE_TAG = "ParentLogoImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String parentLogoImageTag; + + public static final String JSON_PROPERTY_PARENT_ART_ITEM_ID = "ParentArtItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID parentArtItemId; + + public static final String JSON_PROPERTY_PARENT_ART_IMAGE_TAG = "ParentArtImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String parentArtImageTag; + + public static final String JSON_PROPERTY_SERIES_THUMB_IMAGE_TAG = "SeriesThumbImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String seriesThumbImageTag; + + public static final String JSON_PROPERTY_IMAGE_BLUR_HASHES = "ImageBlurHashes"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemDtoImageBlurHashes imageBlurHashes; + + public static final String JSON_PROPERTY_SERIES_STUDIO = "SeriesStudio"; + @org.eclipse.jdt.annotation.NonNull + private String seriesStudio; + + public static final String JSON_PROPERTY_PARENT_THUMB_ITEM_ID = "ParentThumbItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID parentThumbItemId; + + public static final String JSON_PROPERTY_PARENT_THUMB_IMAGE_TAG = "ParentThumbImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String parentThumbImageTag; + + public static final String JSON_PROPERTY_PARENT_PRIMARY_IMAGE_ITEM_ID = "ParentPrimaryImageItemId"; + @org.eclipse.jdt.annotation.NonNull + private String parentPrimaryImageItemId; + + public static final String JSON_PROPERTY_PARENT_PRIMARY_IMAGE_TAG = "ParentPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String parentPrimaryImageTag; + + public static final String JSON_PROPERTY_CHAPTERS = "Chapters"; + @org.eclipse.jdt.annotation.NonNull + private List chapters; + + public static final String JSON_PROPERTY_LOCATION_TYPE = "LocationType"; + @org.eclipse.jdt.annotation.NonNull + private LocationType locationType; + + public static final String JSON_PROPERTY_ISO_TYPE = "IsoType"; + @org.eclipse.jdt.annotation.NonNull + private IsoType isoType; + + public static final String JSON_PROPERTY_MEDIA_TYPE = "MediaType"; + @org.eclipse.jdt.annotation.NonNull + private String mediaType; + + public static final String JSON_PROPERTY_END_DATE = "EndDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime endDate; + + public static final String JSON_PROPERTY_LOCKED_FIELDS = "LockedFields"; + @org.eclipse.jdt.annotation.NonNull + private List lockedFields; + + public static final String JSON_PROPERTY_TRAILER_COUNT = "TrailerCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer trailerCount; + + public static final String JSON_PROPERTY_MOVIE_COUNT = "MovieCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer movieCount; + + public static final String JSON_PROPERTY_SERIES_COUNT = "SeriesCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer seriesCount; + + public static final String JSON_PROPERTY_PROGRAM_COUNT = "ProgramCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer programCount; + + public static final String JSON_PROPERTY_EPISODE_COUNT = "EpisodeCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer episodeCount; + + public static final String JSON_PROPERTY_SONG_COUNT = "SongCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer songCount; + + public static final String JSON_PROPERTY_ALBUM_COUNT = "AlbumCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer albumCount; + + public static final String JSON_PROPERTY_ARTIST_COUNT = "ArtistCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer artistCount; + + public static final String JSON_PROPERTY_MUSIC_VIDEO_COUNT = "MusicVideoCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer musicVideoCount; + + public static final String JSON_PROPERTY_LOCK_DATA = "LockData"; + @org.eclipse.jdt.annotation.NonNull + private Boolean lockData; + + public static final String JSON_PROPERTY_WIDTH = "Width"; + @org.eclipse.jdt.annotation.NonNull + private Integer width; + + public static final String JSON_PROPERTY_HEIGHT = "Height"; + @org.eclipse.jdt.annotation.NonNull + private Integer height; + + public static final String JSON_PROPERTY_CAMERA_MAKE = "CameraMake"; + @org.eclipse.jdt.annotation.NonNull + private String cameraMake; + + public static final String JSON_PROPERTY_CAMERA_MODEL = "CameraModel"; + @org.eclipse.jdt.annotation.NonNull + private String cameraModel; + + public static final String JSON_PROPERTY_SOFTWARE = "Software"; + @org.eclipse.jdt.annotation.NonNull + private String software; + + public static final String JSON_PROPERTY_EXPOSURE_TIME = "ExposureTime"; + @org.eclipse.jdt.annotation.NonNull + private Double exposureTime; + + public static final String JSON_PROPERTY_FOCAL_LENGTH = "FocalLength"; + @org.eclipse.jdt.annotation.NonNull + private Double focalLength; + + public static final String JSON_PROPERTY_IMAGE_ORIENTATION = "ImageOrientation"; + @org.eclipse.jdt.annotation.NonNull + private ImageOrientation imageOrientation; + + public static final String JSON_PROPERTY_APERTURE = "Aperture"; + @org.eclipse.jdt.annotation.NonNull + private Double aperture; + + public static final String JSON_PROPERTY_SHUTTER_SPEED = "ShutterSpeed"; + @org.eclipse.jdt.annotation.NonNull + private Double shutterSpeed; + + public static final String JSON_PROPERTY_LATITUDE = "Latitude"; + @org.eclipse.jdt.annotation.NonNull + private Double latitude; + + public static final String JSON_PROPERTY_LONGITUDE = "Longitude"; + @org.eclipse.jdt.annotation.NonNull + private Double longitude; + + public static final String JSON_PROPERTY_ALTITUDE = "Altitude"; + @org.eclipse.jdt.annotation.NonNull + private Double altitude; + + public static final String JSON_PROPERTY_ISO_SPEED_RATING = "IsoSpeedRating"; + @org.eclipse.jdt.annotation.NonNull + private Integer isoSpeedRating; + + public static final String JSON_PROPERTY_SERIES_TIMER_ID = "SeriesTimerId"; + @org.eclipse.jdt.annotation.NonNull + private String seriesTimerId; + + public static final String JSON_PROPERTY_PROGRAM_ID = "ProgramId"; + @org.eclipse.jdt.annotation.NonNull + private String programId; + + public static final String JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG = "ChannelPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String channelPrimaryImageTag; + + public static final String JSON_PROPERTY_START_DATE = "StartDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime startDate; + + public static final String JSON_PROPERTY_COMPLETION_PERCENTAGE = "CompletionPercentage"; + @org.eclipse.jdt.annotation.NonNull + private Double completionPercentage; + + public static final String JSON_PROPERTY_IS_REPEAT = "IsRepeat"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isRepeat; + + public static final String JSON_PROPERTY_EPISODE_TITLE = "EpisodeTitle"; + @org.eclipse.jdt.annotation.NonNull + private String episodeTitle; + + public static final String JSON_PROPERTY_CHANNEL_TYPE = "ChannelType"; + @org.eclipse.jdt.annotation.NonNull + private ChannelType channelType; + + public static final String JSON_PROPERTY_AUDIO = "Audio"; + @org.eclipse.jdt.annotation.NonNull + private ProgramAudio audio; + + public static final String JSON_PROPERTY_IS_MOVIE = "IsMovie"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isMovie; + + public static final String JSON_PROPERTY_IS_SPORTS = "IsSports"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isSports; + + public static final String JSON_PROPERTY_IS_SERIES = "IsSeries"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isSeries; + + public static final String JSON_PROPERTY_IS_LIVE = "IsLive"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isLive; + + public static final String JSON_PROPERTY_IS_NEWS = "IsNews"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isNews; + + public static final String JSON_PROPERTY_IS_KIDS = "IsKids"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isKids; + + public static final String JSON_PROPERTY_IS_PREMIERE = "IsPremiere"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPremiere; + + public static final String JSON_PROPERTY_TIMER_ID = "TimerId"; + @org.eclipse.jdt.annotation.NonNull + private String timerId; + + public static final String JSON_PROPERTY_CURRENT_PROGRAM = "CurrentProgram"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemDto currentProgram; + + public BaseItemDto() { + } + + public BaseItemDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public BaseItemDto originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Get originalTitle + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public BaseItemDto serverId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + return this; + } + + /** + * Gets or sets the server identifier. + * + * @return serverId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerId() { + return serverId; + } + + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + } + + public BaseItemDto id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public BaseItemDto etag(@org.eclipse.jdt.annotation.NonNull String etag) { + this.etag = etag; + return this; + } + + /** + * Gets or sets the etag. + * + * @return etag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ETAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEtag() { + return etag; + } + + @JsonProperty(JSON_PROPERTY_ETAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEtag(@org.eclipse.jdt.annotation.NonNull String etag) { + this.etag = etag; + } + + public BaseItemDto sourceType(@org.eclipse.jdt.annotation.NonNull String sourceType) { + this.sourceType = sourceType; + return this; + } + + /** + * Gets or sets the type of the source. + * + * @return sourceType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SOURCE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceType() { + return sourceType; + } + + @JsonProperty(JSON_PROPERTY_SOURCE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceType(@org.eclipse.jdt.annotation.NonNull String sourceType) { + this.sourceType = sourceType; + } + + public BaseItemDto playlistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets or sets the playlist item identifier. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + } + + public BaseItemDto dateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + return this; + } + + /** + * Gets or sets the date created. + * + * @return dateCreated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateCreated() { + return dateCreated; + } + + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + } + + public BaseItemDto dateLastMediaAdded(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateLastMediaAdded) { + this.dateLastMediaAdded = dateLastMediaAdded; + return this; + } + + /** + * Get dateLastMediaAdded + * + * @return dateLastMediaAdded + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_LAST_MEDIA_ADDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateLastMediaAdded() { + return dateLastMediaAdded; + } + + @JsonProperty(JSON_PROPERTY_DATE_LAST_MEDIA_ADDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateLastMediaAdded(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateLastMediaAdded) { + this.dateLastMediaAdded = dateLastMediaAdded; + } + + public BaseItemDto extraType(@org.eclipse.jdt.annotation.NonNull String extraType) { + this.extraType = extraType; + return this; + } + + /** + * Get extraType + * + * @return extraType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTRA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExtraType() { + return extraType; + } + + @JsonProperty(JSON_PROPERTY_EXTRA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExtraType(@org.eclipse.jdt.annotation.NonNull String extraType) { + this.extraType = extraType; + } + + public BaseItemDto airsBeforeSeasonNumber(@org.eclipse.jdt.annotation.NonNull Integer airsBeforeSeasonNumber) { + this.airsBeforeSeasonNumber = airsBeforeSeasonNumber; + return this; + } + + /** + * Get airsBeforeSeasonNumber + * + * @return airsBeforeSeasonNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AIRS_BEFORE_SEASON_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAirsBeforeSeasonNumber() { + return airsBeforeSeasonNumber; + } + + @JsonProperty(JSON_PROPERTY_AIRS_BEFORE_SEASON_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAirsBeforeSeasonNumber(@org.eclipse.jdt.annotation.NonNull Integer airsBeforeSeasonNumber) { + this.airsBeforeSeasonNumber = airsBeforeSeasonNumber; + } + + public BaseItemDto airsAfterSeasonNumber(@org.eclipse.jdt.annotation.NonNull Integer airsAfterSeasonNumber) { + this.airsAfterSeasonNumber = airsAfterSeasonNumber; + return this; + } + + /** + * Get airsAfterSeasonNumber + * + * @return airsAfterSeasonNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AIRS_AFTER_SEASON_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAirsAfterSeasonNumber() { + return airsAfterSeasonNumber; + } + + @JsonProperty(JSON_PROPERTY_AIRS_AFTER_SEASON_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAirsAfterSeasonNumber(@org.eclipse.jdt.annotation.NonNull Integer airsAfterSeasonNumber) { + this.airsAfterSeasonNumber = airsAfterSeasonNumber; + } + + public BaseItemDto airsBeforeEpisodeNumber(@org.eclipse.jdt.annotation.NonNull Integer airsBeforeEpisodeNumber) { + this.airsBeforeEpisodeNumber = airsBeforeEpisodeNumber; + return this; + } + + /** + * Get airsBeforeEpisodeNumber + * + * @return airsBeforeEpisodeNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AIRS_BEFORE_EPISODE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAirsBeforeEpisodeNumber() { + return airsBeforeEpisodeNumber; + } + + @JsonProperty(JSON_PROPERTY_AIRS_BEFORE_EPISODE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAirsBeforeEpisodeNumber(@org.eclipse.jdt.annotation.NonNull Integer airsBeforeEpisodeNumber) { + this.airsBeforeEpisodeNumber = airsBeforeEpisodeNumber; + } + + public BaseItemDto canDelete(@org.eclipse.jdt.annotation.NonNull Boolean canDelete) { + this.canDelete = canDelete; + return this; + } + + /** + * Get canDelete + * + * @return canDelete + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_DELETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanDelete() { + return canDelete; + } + + @JsonProperty(JSON_PROPERTY_CAN_DELETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanDelete(@org.eclipse.jdt.annotation.NonNull Boolean canDelete) { + this.canDelete = canDelete; + } + + public BaseItemDto canDownload(@org.eclipse.jdt.annotation.NonNull Boolean canDownload) { + this.canDownload = canDownload; + return this; + } + + /** + * Get canDownload + * + * @return canDownload + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_DOWNLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanDownload() { + return canDownload; + } + + @JsonProperty(JSON_PROPERTY_CAN_DOWNLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanDownload(@org.eclipse.jdt.annotation.NonNull Boolean canDownload) { + this.canDownload = canDownload; + } + + public BaseItemDto hasSubtitles(@org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles) { + this.hasSubtitles = hasSubtitles; + return this; + } + + /** + * Get hasSubtitles + * + * @return hasSubtitles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_SUBTITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasSubtitles() { + return hasSubtitles; + } + + @JsonProperty(JSON_PROPERTY_HAS_SUBTITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasSubtitles(@org.eclipse.jdt.annotation.NonNull Boolean hasSubtitles) { + this.hasSubtitles = hasSubtitles; + } + + public BaseItemDto preferredMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String preferredMetadataLanguage) { + this.preferredMetadataLanguage = preferredMetadataLanguage; + return this; + } + + /** + * Get preferredMetadataLanguage + * + * @return preferredMetadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPreferredMetadataLanguage() { + return preferredMetadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreferredMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String preferredMetadataLanguage) { + this.preferredMetadataLanguage = preferredMetadataLanguage; + } + + public BaseItemDto preferredMetadataCountryCode( + @org.eclipse.jdt.annotation.NonNull String preferredMetadataCountryCode) { + this.preferredMetadataCountryCode = preferredMetadataCountryCode; + return this; + } + + /** + * Get preferredMetadataCountryCode + * + * @return preferredMetadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPreferredMetadataCountryCode() { + return preferredMetadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreferredMetadataCountryCode( + @org.eclipse.jdt.annotation.NonNull String preferredMetadataCountryCode) { + this.preferredMetadataCountryCode = preferredMetadataCountryCode; + } + + public BaseItemDto supportsSync(@org.eclipse.jdt.annotation.NonNull Boolean supportsSync) { + this.supportsSync = supportsSync; + return this; + } + + /** + * Gets or sets a value indicating whether [supports synchronize]. + * + * @return supportsSync + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_SYNC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsSync() { + return supportsSync; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_SYNC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsSync(@org.eclipse.jdt.annotation.NonNull Boolean supportsSync) { + this.supportsSync = supportsSync; + } + + public BaseItemDto container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Get container + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + public BaseItemDto sortName(@org.eclipse.jdt.annotation.NonNull String sortName) { + this.sortName = sortName; + return this; + } + + /** + * Gets or sets the name of the sort. + * + * @return sortName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SORT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSortName() { + return sortName; + } + + @JsonProperty(JSON_PROPERTY_SORT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortName(@org.eclipse.jdt.annotation.NonNull String sortName) { + this.sortName = sortName; + } + + public BaseItemDto forcedSortName(@org.eclipse.jdt.annotation.NonNull String forcedSortName) { + this.forcedSortName = forcedSortName; + return this; + } + + /** + * Get forcedSortName + * + * @return forcedSortName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FORCED_SORT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getForcedSortName() { + return forcedSortName; + } + + @JsonProperty(JSON_PROPERTY_FORCED_SORT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForcedSortName(@org.eclipse.jdt.annotation.NonNull String forcedSortName) { + this.forcedSortName = forcedSortName; + } + + public BaseItemDto video3DFormat(@org.eclipse.jdt.annotation.NonNull Video3DFormat video3DFormat) { + this.video3DFormat = video3DFormat; + return this; + } + + /** + * Gets or sets the video3 D format. + * + * @return video3DFormat + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO3_D_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Video3DFormat getVideo3DFormat() { + return video3DFormat; + } + + @JsonProperty(JSON_PROPERTY_VIDEO3_D_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVideo3DFormat(@org.eclipse.jdt.annotation.NonNull Video3DFormat video3DFormat) { + this.video3DFormat = video3DFormat; + } + + public BaseItemDto premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Gets or sets the premiere date. + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public BaseItemDto externalUrls(@org.eclipse.jdt.annotation.NonNull List externalUrls) { + this.externalUrls = externalUrls; + return this; + } + + public BaseItemDto addExternalUrlsItem(ExternalUrl externalUrlsItem) { + if (this.externalUrls == null) { + this.externalUrls = new ArrayList<>(); + } + this.externalUrls.add(externalUrlsItem); + return this; + } + + /** + * Gets or sets the external urls. + * + * @return externalUrls + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getExternalUrls() { + return externalUrls; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalUrls(@org.eclipse.jdt.annotation.NonNull List externalUrls) { + this.externalUrls = externalUrls; + } + + public BaseItemDto mediaSources(@org.eclipse.jdt.annotation.NonNull List mediaSources) { + this.mediaSources = mediaSources; + return this; + } + + public BaseItemDto addMediaSourcesItem(MediaSourceInfo mediaSourcesItem) { + if (this.mediaSources == null) { + this.mediaSources = new ArrayList<>(); + } + this.mediaSources.add(mediaSourcesItem); + return this; + } + + /** + * Gets or sets the media versions. + * + * @return mediaSources + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMediaSources() { + return mediaSources; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSources(@org.eclipse.jdt.annotation.NonNull List mediaSources) { + this.mediaSources = mediaSources; + } + + public BaseItemDto criticRating(@org.eclipse.jdt.annotation.NonNull Float criticRating) { + this.criticRating = criticRating; + return this; + } + + /** + * Gets or sets the critic rating. + * + * @return criticRating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CRITIC_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getCriticRating() { + return criticRating; + } + + @JsonProperty(JSON_PROPERTY_CRITIC_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCriticRating(@org.eclipse.jdt.annotation.NonNull Float criticRating) { + this.criticRating = criticRating; + } + + public BaseItemDto productionLocations(@org.eclipse.jdt.annotation.NonNull List productionLocations) { + this.productionLocations = productionLocations; + return this; + } + + public BaseItemDto addProductionLocationsItem(String productionLocationsItem) { + if (this.productionLocations == null) { + this.productionLocations = new ArrayList<>(); + } + this.productionLocations.add(productionLocationsItem); + return this; + } + + /** + * Get productionLocations + * + * @return productionLocations + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRODUCTION_LOCATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getProductionLocations() { + return productionLocations; + } + + @JsonProperty(JSON_PROPERTY_PRODUCTION_LOCATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProductionLocations(@org.eclipse.jdt.annotation.NonNull List productionLocations) { + this.productionLocations = productionLocations; + } + + public BaseItemDto path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public BaseItemDto enableMediaSourceDisplay(@org.eclipse.jdt.annotation.NonNull Boolean enableMediaSourceDisplay) { + this.enableMediaSourceDisplay = enableMediaSourceDisplay; + return this; + } + + /** + * Get enableMediaSourceDisplay + * + * @return enableMediaSourceDisplay + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_MEDIA_SOURCE_DISPLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableMediaSourceDisplay() { + return enableMediaSourceDisplay; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_MEDIA_SOURCE_DISPLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableMediaSourceDisplay(@org.eclipse.jdt.annotation.NonNull Boolean enableMediaSourceDisplay) { + this.enableMediaSourceDisplay = enableMediaSourceDisplay; + } + + public BaseItemDto officialRating(@org.eclipse.jdt.annotation.NonNull String officialRating) { + this.officialRating = officialRating; + return this; + } + + /** + * Gets or sets the official rating. + * + * @return officialRating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OFFICIAL_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOfficialRating() { + return officialRating; + } + + @JsonProperty(JSON_PROPERTY_OFFICIAL_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOfficialRating(@org.eclipse.jdt.annotation.NonNull String officialRating) { + this.officialRating = officialRating; + } + + public BaseItemDto customRating(@org.eclipse.jdt.annotation.NonNull String customRating) { + this.customRating = customRating; + return this; + } + + /** + * Gets or sets the custom rating. + * + * @return customRating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CUSTOM_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCustomRating() { + return customRating; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomRating(@org.eclipse.jdt.annotation.NonNull String customRating) { + this.customRating = customRating; + } + + public BaseItemDto channelId(@org.eclipse.jdt.annotation.NonNull UUID channelId) { + this.channelId = channelId; + return this; + } + + /** + * Gets or sets the channel identifier. + * + * @return channelId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getChannelId() { + return channelId; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelId(@org.eclipse.jdt.annotation.NonNull UUID channelId) { + this.channelId = channelId; + } + + public BaseItemDto channelName(@org.eclipse.jdt.annotation.NonNull String channelName) { + this.channelName = channelName; + return this; + } + + /** + * Get channelName + * + * @return channelName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelName() { + return channelName; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelName(@org.eclipse.jdt.annotation.NonNull String channelName) { + this.channelName = channelName; + } + + public BaseItemDto overview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + return this; + } + + /** + * Gets or sets the overview. + * + * @return overview + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOverview() { + return overview; + } + + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOverview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + } + + public BaseItemDto taglines(@org.eclipse.jdt.annotation.NonNull List taglines) { + this.taglines = taglines; + return this; + } + + public BaseItemDto addTaglinesItem(String taglinesItem) { + if (this.taglines == null) { + this.taglines = new ArrayList<>(); + } + this.taglines.add(taglinesItem); + return this; + } + + /** + * Gets or sets the taglines. + * + * @return taglines + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TAGLINES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTaglines() { + return taglines; + } + + @JsonProperty(JSON_PROPERTY_TAGLINES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTaglines(@org.eclipse.jdt.annotation.NonNull List taglines) { + this.taglines = taglines; + } + + public BaseItemDto genres(@org.eclipse.jdt.annotation.NonNull List genres) { + this.genres = genres; + return this; + } + + public BaseItemDto addGenresItem(String genresItem) { + if (this.genres == null) { + this.genres = new ArrayList<>(); + } + this.genres.add(genresItem); + return this; + } + + /** + * Gets or sets the genres. + * + * @return genres + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GENRES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGenres() { + return genres; + } + + @JsonProperty(JSON_PROPERTY_GENRES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGenres(@org.eclipse.jdt.annotation.NonNull List genres) { + this.genres = genres; + } + + public BaseItemDto communityRating(@org.eclipse.jdt.annotation.NonNull Float communityRating) { + this.communityRating = communityRating; + return this; + } + + /** + * Gets or sets the community rating. + * + * @return communityRating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMMUNITY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getCommunityRating() { + return communityRating; + } + + @JsonProperty(JSON_PROPERTY_COMMUNITY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCommunityRating(@org.eclipse.jdt.annotation.NonNull Float communityRating) { + this.communityRating = communityRating; + } + + public BaseItemDto cumulativeRunTimeTicks(@org.eclipse.jdt.annotation.NonNull Long cumulativeRunTimeTicks) { + this.cumulativeRunTimeTicks = cumulativeRunTimeTicks; + return this; + } + + /** + * Gets or sets the cumulative run time ticks. + * + * @return cumulativeRunTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CUMULATIVE_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCumulativeRunTimeTicks() { + return cumulativeRunTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_CUMULATIVE_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCumulativeRunTimeTicks(@org.eclipse.jdt.annotation.NonNull Long cumulativeRunTimeTicks) { + this.cumulativeRunTimeTicks = cumulativeRunTimeTicks; + } + + public BaseItemDto runTimeTicks(@org.eclipse.jdt.annotation.NonNull Long runTimeTicks) { + this.runTimeTicks = runTimeTicks; + return this; + } + + /** + * Gets or sets the run time ticks. + * + * @return runTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getRunTimeTicks() { + return runTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRunTimeTicks(@org.eclipse.jdt.annotation.NonNull Long runTimeTicks) { + this.runTimeTicks = runTimeTicks; + } + + public BaseItemDto playAccess(@org.eclipse.jdt.annotation.NonNull PlayAccess playAccess) { + this.playAccess = playAccess; + return this; + } + + /** + * Gets or sets the play access. + * + * @return playAccess + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlayAccess getPlayAccess() { + return playAccess; + } + + @JsonProperty(JSON_PROPERTY_PLAY_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayAccess(@org.eclipse.jdt.annotation.NonNull PlayAccess playAccess) { + this.playAccess = playAccess; + } + + public BaseItemDto aspectRatio(@org.eclipse.jdt.annotation.NonNull String aspectRatio) { + this.aspectRatio = aspectRatio; + return this; + } + + /** + * Gets or sets the aspect ratio. + * + * @return aspectRatio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAspectRatio() { + return aspectRatio; + } + + @JsonProperty(JSON_PROPERTY_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAspectRatio(@org.eclipse.jdt.annotation.NonNull String aspectRatio) { + this.aspectRatio = aspectRatio; + } + + public BaseItemDto productionYear(@org.eclipse.jdt.annotation.NonNull Integer productionYear) { + this.productionYear = productionYear; + return this; + } + + /** + * Gets or sets the production year. + * + * @return productionYear + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRODUCTION_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getProductionYear() { + return productionYear; + } + + @JsonProperty(JSON_PROPERTY_PRODUCTION_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProductionYear(@org.eclipse.jdt.annotation.NonNull Integer productionYear) { + this.productionYear = productionYear; + } + + public BaseItemDto isPlaceHolder(@org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder) { + this.isPlaceHolder = isPlaceHolder; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is place holder. + * + * @return isPlaceHolder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PLACE_HOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPlaceHolder() { + return isPlaceHolder; + } + + @JsonProperty(JSON_PROPERTY_IS_PLACE_HOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPlaceHolder(@org.eclipse.jdt.annotation.NonNull Boolean isPlaceHolder) { + this.isPlaceHolder = isPlaceHolder; + } + + public BaseItemDto number(@org.eclipse.jdt.annotation.NonNull String number) { + this.number = number; + return this; + } + + /** + * Gets or sets the number. + * + * @return number + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNumber() { + return number; + } + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumber(@org.eclipse.jdt.annotation.NonNull String number) { + this.number = number; + } + + public BaseItemDto channelNumber(@org.eclipse.jdt.annotation.NonNull String channelNumber) { + this.channelNumber = channelNumber; + return this; + } + + /** + * Get channelNumber + * + * @return channelNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelNumber() { + return channelNumber; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelNumber(@org.eclipse.jdt.annotation.NonNull String channelNumber) { + this.channelNumber = channelNumber; + } + + public BaseItemDto indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Gets or sets the index number. + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public BaseItemDto indexNumberEnd(@org.eclipse.jdt.annotation.NonNull Integer indexNumberEnd) { + this.indexNumberEnd = indexNumberEnd; + return this; + } + + /** + * Gets or sets the index number end. + * + * @return indexNumberEnd + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER_END) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumberEnd() { + return indexNumberEnd; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER_END) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumberEnd(@org.eclipse.jdt.annotation.NonNull Integer indexNumberEnd) { + this.indexNumberEnd = indexNumberEnd; + } + + public BaseItemDto parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Gets or sets the parent index number. + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public BaseItemDto remoteTrailers(@org.eclipse.jdt.annotation.NonNull List remoteTrailers) { + this.remoteTrailers = remoteTrailers; + return this; + } + + public BaseItemDto addRemoteTrailersItem(MediaUrl remoteTrailersItem) { + if (this.remoteTrailers == null) { + this.remoteTrailers = new ArrayList<>(); + } + this.remoteTrailers.add(remoteTrailersItem); + return this; + } + + /** + * Gets or sets the trailer urls. + * + * @return remoteTrailers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMOTE_TRAILERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRemoteTrailers() { + return remoteTrailers; + } + + @JsonProperty(JSON_PROPERTY_REMOTE_TRAILERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemoteTrailers(@org.eclipse.jdt.annotation.NonNull List remoteTrailers) { + this.remoteTrailers = remoteTrailers; + } + + public BaseItemDto providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public BaseItemDto putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public BaseItemDto isHD(@org.eclipse.jdt.annotation.NonNull Boolean isHD) { + this.isHD = isHD; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is HD. + * + * @return isHD + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_H_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsHD() { + return isHD; + } + + @JsonProperty(JSON_PROPERTY_IS_H_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsHD(@org.eclipse.jdt.annotation.NonNull Boolean isHD) { + this.isHD = isHD; + } + + public BaseItemDto isFolder(@org.eclipse.jdt.annotation.NonNull Boolean isFolder) { + this.isFolder = isFolder; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is folder. + * + * @return isFolder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_FOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsFolder() { + return isFolder; + } + + @JsonProperty(JSON_PROPERTY_IS_FOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsFolder(@org.eclipse.jdt.annotation.NonNull Boolean isFolder) { + this.isFolder = isFolder; + } + + public BaseItemDto parentId(@org.eclipse.jdt.annotation.NonNull UUID parentId) { + this.parentId = parentId; + return this; + } + + /** + * Gets or sets the parent id. + * + * @return parentId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getParentId() { + return parentId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentId(@org.eclipse.jdt.annotation.NonNull UUID parentId) { + this.parentId = parentId; + } + + public BaseItemDto type(@org.eclipse.jdt.annotation.NonNull BaseItemKind type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemKind getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull BaseItemKind type) { + this.type = type; + } + + public BaseItemDto people(@org.eclipse.jdt.annotation.NonNull List people) { + this.people = people; + return this; + } + + public BaseItemDto addPeopleItem(BaseItemPerson peopleItem) { + if (this.people == null) { + this.people = new ArrayList<>(); + } + this.people.add(peopleItem); + return this; + } + + /** + * Gets or sets the people. + * + * @return people + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PEOPLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPeople() { + return people; + } + + @JsonProperty(JSON_PROPERTY_PEOPLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPeople(@org.eclipse.jdt.annotation.NonNull List people) { + this.people = people; + } + + public BaseItemDto studios(@org.eclipse.jdt.annotation.NonNull List studios) { + this.studios = studios; + return this; + } + + public BaseItemDto addStudiosItem(NameGuidPair studiosItem) { + if (this.studios == null) { + this.studios = new ArrayList<>(); + } + this.studios.add(studiosItem); + return this; + } + + /** + * Gets or sets the studios. + * + * @return studios + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STUDIOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStudios() { + return studios; + } + + @JsonProperty(JSON_PROPERTY_STUDIOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStudios(@org.eclipse.jdt.annotation.NonNull List studios) { + this.studios = studios; + } + + public BaseItemDto genreItems(@org.eclipse.jdt.annotation.NonNull List genreItems) { + this.genreItems = genreItems; + return this; + } + + public BaseItemDto addGenreItemsItem(NameGuidPair genreItemsItem) { + if (this.genreItems == null) { + this.genreItems = new ArrayList<>(); + } + this.genreItems.add(genreItemsItem); + return this; + } + + /** + * Get genreItems + * + * @return genreItems + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GENRE_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGenreItems() { + return genreItems; + } + + @JsonProperty(JSON_PROPERTY_GENRE_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGenreItems(@org.eclipse.jdt.annotation.NonNull List genreItems) { + this.genreItems = genreItems; + } + + public BaseItemDto parentLogoItemId(@org.eclipse.jdt.annotation.NonNull UUID parentLogoItemId) { + this.parentLogoItemId = parentLogoItemId; + return this; + } + + /** + * Gets or sets wether the item has a logo, this will hold the Id of the Parent that has one. + * + * @return parentLogoItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_LOGO_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getParentLogoItemId() { + return parentLogoItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_LOGO_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentLogoItemId(@org.eclipse.jdt.annotation.NonNull UUID parentLogoItemId) { + this.parentLogoItemId = parentLogoItemId; + } + + public BaseItemDto parentBackdropItemId(@org.eclipse.jdt.annotation.NonNull UUID parentBackdropItemId) { + this.parentBackdropItemId = parentBackdropItemId; + return this; + } + + /** + * Gets or sets wether the item has any backdrops, this will hold the Id of the Parent that has one. + * + * @return parentBackdropItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getParentBackdropItemId() { + return parentBackdropItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentBackdropItemId(@org.eclipse.jdt.annotation.NonNull UUID parentBackdropItemId) { + this.parentBackdropItemId = parentBackdropItemId; + } + + public BaseItemDto parentBackdropImageTags( + @org.eclipse.jdt.annotation.NonNull List parentBackdropImageTags) { + this.parentBackdropImageTags = parentBackdropImageTags; + return this; + } + + public BaseItemDto addParentBackdropImageTagsItem(String parentBackdropImageTagsItem) { + if (this.parentBackdropImageTags == null) { + this.parentBackdropImageTags = new ArrayList<>(); + } + this.parentBackdropImageTags.add(parentBackdropImageTagsItem); + return this; + } + + /** + * Gets or sets the parent backdrop image tags. + * + * @return parentBackdropImageTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getParentBackdropImageTags() { + return parentBackdropImageTags; + } + + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentBackdropImageTags(@org.eclipse.jdt.annotation.NonNull List parentBackdropImageTags) { + this.parentBackdropImageTags = parentBackdropImageTags; + } + + public BaseItemDto localTrailerCount(@org.eclipse.jdt.annotation.NonNull Integer localTrailerCount) { + this.localTrailerCount = localTrailerCount; + return this; + } + + /** + * Gets or sets the local trailer count. + * + * @return localTrailerCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCAL_TRAILER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLocalTrailerCount() { + return localTrailerCount; + } + + @JsonProperty(JSON_PROPERTY_LOCAL_TRAILER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalTrailerCount(@org.eclipse.jdt.annotation.NonNull Integer localTrailerCount) { + this.localTrailerCount = localTrailerCount; + } + + public BaseItemDto userData(@org.eclipse.jdt.annotation.NonNull UserItemDataDto userData) { + this.userData = userData; + return this; + } + + /** + * Gets or sets the user data for this item based on the user it's being requested for. + * + * @return userData + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserItemDataDto getUserData() { + return userData; + } + + @JsonProperty(JSON_PROPERTY_USER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserData(@org.eclipse.jdt.annotation.NonNull UserItemDataDto userData) { + this.userData = userData; + } + + public BaseItemDto recursiveItemCount(@org.eclipse.jdt.annotation.NonNull Integer recursiveItemCount) { + this.recursiveItemCount = recursiveItemCount; + return this; + } + + /** + * Gets or sets the recursive item count. + * + * @return recursiveItemCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RECURSIVE_ITEM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRecursiveItemCount() { + return recursiveItemCount; + } + + @JsonProperty(JSON_PROPERTY_RECURSIVE_ITEM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecursiveItemCount(@org.eclipse.jdt.annotation.NonNull Integer recursiveItemCount) { + this.recursiveItemCount = recursiveItemCount; + } + + public BaseItemDto childCount(@org.eclipse.jdt.annotation.NonNull Integer childCount) { + this.childCount = childCount; + return this; + } + + /** + * Gets or sets the child count. + * + * @return childCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHILD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getChildCount() { + return childCount; + } + + @JsonProperty(JSON_PROPERTY_CHILD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChildCount(@org.eclipse.jdt.annotation.NonNull Integer childCount) { + this.childCount = childCount; + } + + public BaseItemDto seriesName(@org.eclipse.jdt.annotation.NonNull String seriesName) { + this.seriesName = seriesName; + return this; + } + + /** + * Gets or sets the name of the series. + * + * @return seriesName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesName() { + return seriesName; + } + + @JsonProperty(JSON_PROPERTY_SERIES_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesName(@org.eclipse.jdt.annotation.NonNull String seriesName) { + this.seriesName = seriesName; + } + + public BaseItemDto seriesId(@org.eclipse.jdt.annotation.NonNull UUID seriesId) { + this.seriesId = seriesId; + return this; + } + + /** + * Gets or sets the series id. + * + * @return seriesId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getSeriesId() { + return seriesId; + } + + @JsonProperty(JSON_PROPERTY_SERIES_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesId(@org.eclipse.jdt.annotation.NonNull UUID seriesId) { + this.seriesId = seriesId; + } + + public BaseItemDto seasonId(@org.eclipse.jdt.annotation.NonNull UUID seasonId) { + this.seasonId = seasonId; + return this; + } + + /** + * Gets or sets the season identifier. + * + * @return seasonId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEASON_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getSeasonId() { + return seasonId; + } + + @JsonProperty(JSON_PROPERTY_SEASON_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeasonId(@org.eclipse.jdt.annotation.NonNull UUID seasonId) { + this.seasonId = seasonId; + } + + public BaseItemDto specialFeatureCount(@org.eclipse.jdt.annotation.NonNull Integer specialFeatureCount) { + this.specialFeatureCount = specialFeatureCount; + return this; + } + + /** + * Gets or sets the special feature count. + * + * @return specialFeatureCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SPECIAL_FEATURE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSpecialFeatureCount() { + return specialFeatureCount; + } + + @JsonProperty(JSON_PROPERTY_SPECIAL_FEATURE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSpecialFeatureCount(@org.eclipse.jdt.annotation.NonNull Integer specialFeatureCount) { + this.specialFeatureCount = specialFeatureCount; + } + + public BaseItemDto displayPreferencesId(@org.eclipse.jdt.annotation.NonNull String displayPreferencesId) { + this.displayPreferencesId = displayPreferencesId; + return this; + } + + /** + * Gets or sets the display preferences id. + * + * @return displayPreferencesId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_PREFERENCES_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayPreferencesId() { + return displayPreferencesId; + } + + @JsonProperty(JSON_PROPERTY_DISPLAY_PREFERENCES_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayPreferencesId(@org.eclipse.jdt.annotation.NonNull String displayPreferencesId) { + this.displayPreferencesId = displayPreferencesId; + } + + public BaseItemDto status(@org.eclipse.jdt.annotation.NonNull String status) { + this.status = status; + return this; + } + + /** + * Gets or sets the status. + * + * @return status + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@org.eclipse.jdt.annotation.NonNull String status) { + this.status = status; + } + + public BaseItemDto airTime(@org.eclipse.jdt.annotation.NonNull String airTime) { + this.airTime = airTime; + return this; + } + + /** + * Gets or sets the air time. + * + * @return airTime + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AIR_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAirTime() { + return airTime; + } + + @JsonProperty(JSON_PROPERTY_AIR_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAirTime(@org.eclipse.jdt.annotation.NonNull String airTime) { + this.airTime = airTime; + } + + public BaseItemDto airDays(@org.eclipse.jdt.annotation.NonNull List airDays) { + this.airDays = airDays; + return this; + } + + public BaseItemDto addAirDaysItem(DayOfWeek airDaysItem) { + if (this.airDays == null) { + this.airDays = new ArrayList<>(); + } + this.airDays.add(airDaysItem); + return this; + } + + /** + * Gets or sets the air days. + * + * @return airDays + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AIR_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAirDays() { + return airDays; + } + + @JsonProperty(JSON_PROPERTY_AIR_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAirDays(@org.eclipse.jdt.annotation.NonNull List airDays) { + this.airDays = airDays; + } + + public BaseItemDto tags(@org.eclipse.jdt.annotation.NonNull List tags) { + this.tags = tags; + return this; + } + + public BaseItemDto addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Gets or sets the tags. + * + * @return tags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(@org.eclipse.jdt.annotation.NonNull List tags) { + this.tags = tags; + } + + public BaseItemDto primaryImageAspectRatio(@org.eclipse.jdt.annotation.NonNull Double primaryImageAspectRatio) { + this.primaryImageAspectRatio = primaryImageAspectRatio; + return this; + } + + /** + * Gets or sets the primary image aspect ratio, after image enhancements. + * + * @return primaryImageAspectRatio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getPrimaryImageAspectRatio() { + return primaryImageAspectRatio; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageAspectRatio(@org.eclipse.jdt.annotation.NonNull Double primaryImageAspectRatio) { + this.primaryImageAspectRatio = primaryImageAspectRatio; + } + + public BaseItemDto artists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + return this; + } + + public BaseItemDto addArtistsItem(String artistsItem) { + if (this.artists == null) { + this.artists = new ArrayList<>(); + } + this.artists.add(artistsItem); + return this; + } + + /** + * Gets or sets the artists. + * + * @return artists + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArtists() { + return artists; + } + + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + } + + public BaseItemDto artistItems(@org.eclipse.jdt.annotation.NonNull List artistItems) { + this.artistItems = artistItems; + return this; + } + + public BaseItemDto addArtistItemsItem(NameGuidPair artistItemsItem) { + if (this.artistItems == null) { + this.artistItems = new ArrayList<>(); + } + this.artistItems.add(artistItemsItem); + return this; + } + + /** + * Gets or sets the artist items. + * + * @return artistItems + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTIST_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArtistItems() { + return artistItems; + } + + @JsonProperty(JSON_PROPERTY_ARTIST_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtistItems(@org.eclipse.jdt.annotation.NonNull List artistItems) { + this.artistItems = artistItems; + } + + public BaseItemDto album(@org.eclipse.jdt.annotation.NonNull String album) { + this.album = album; + return this; + } + + /** + * Gets or sets the album. + * + * @return album + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlbum() { + return album; + } + + @JsonProperty(JSON_PROPERTY_ALBUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbum(@org.eclipse.jdt.annotation.NonNull String album) { + this.album = album; + } + + public BaseItemDto collectionType(@org.eclipse.jdt.annotation.NonNull String collectionType) { + this.collectionType = collectionType; + return this; + } + + /** + * Gets or sets the type of the collection. + * + * @return collectionType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COLLECTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCollectionType() { + return collectionType; + } + + @JsonProperty(JSON_PROPERTY_COLLECTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCollectionType(@org.eclipse.jdt.annotation.NonNull String collectionType) { + this.collectionType = collectionType; + } + + public BaseItemDto displayOrder(@org.eclipse.jdt.annotation.NonNull String displayOrder) { + this.displayOrder = displayOrder; + return this; + } + + /** + * Gets or sets the display order. + * + * @return displayOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayOrder() { + return displayOrder; + } + + @JsonProperty(JSON_PROPERTY_DISPLAY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayOrder(@org.eclipse.jdt.annotation.NonNull String displayOrder) { + this.displayOrder = displayOrder; + } + + public BaseItemDto albumId(@org.eclipse.jdt.annotation.NonNull UUID albumId) { + this.albumId = albumId; + return this; + } + + /** + * Gets or sets the album id. + * + * @return albumId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getAlbumId() { + return albumId; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumId(@org.eclipse.jdt.annotation.NonNull UUID albumId) { + this.albumId = albumId; + } + + public BaseItemDto albumPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String albumPrimaryImageTag) { + this.albumPrimaryImageTag = albumPrimaryImageTag; + return this; + } + + /** + * Gets or sets the album image tag. + * + * @return albumPrimaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlbumPrimaryImageTag() { + return albumPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String albumPrimaryImageTag) { + this.albumPrimaryImageTag = albumPrimaryImageTag; + } + + public BaseItemDto seriesPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String seriesPrimaryImageTag) { + this.seriesPrimaryImageTag = seriesPrimaryImageTag; + return this; + } + + /** + * Gets or sets the series primary image tag. + * + * @return seriesPrimaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesPrimaryImageTag() { + return seriesPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_SERIES_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String seriesPrimaryImageTag) { + this.seriesPrimaryImageTag = seriesPrimaryImageTag; + } + + public BaseItemDto albumArtist(@org.eclipse.jdt.annotation.NonNull String albumArtist) { + this.albumArtist = albumArtist; + return this; + } + + /** + * Gets or sets the album artist. + * + * @return albumArtist + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ARTIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlbumArtist() { + return albumArtist; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ARTIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumArtist(@org.eclipse.jdt.annotation.NonNull String albumArtist) { + this.albumArtist = albumArtist; + } + + public BaseItemDto albumArtists(@org.eclipse.jdt.annotation.NonNull List albumArtists) { + this.albumArtists = albumArtists; + return this; + } + + public BaseItemDto addAlbumArtistsItem(NameGuidPair albumArtistsItem) { + if (this.albumArtists == null) { + this.albumArtists = new ArrayList<>(); + } + this.albumArtists.add(albumArtistsItem); + return this; + } + + /** + * Gets or sets the album artists. + * + * @return albumArtists + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAlbumArtists() { + return albumArtists; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumArtists(@org.eclipse.jdt.annotation.NonNull List albumArtists) { + this.albumArtists = albumArtists; + } + + public BaseItemDto seasonName(@org.eclipse.jdt.annotation.NonNull String seasonName) { + this.seasonName = seasonName; + return this; + } + + /** + * Gets or sets the name of the season. + * + * @return seasonName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEASON_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeasonName() { + return seasonName; + } + + @JsonProperty(JSON_PROPERTY_SEASON_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeasonName(@org.eclipse.jdt.annotation.NonNull String seasonName) { + this.seasonName = seasonName; + } + + public BaseItemDto mediaStreams(@org.eclipse.jdt.annotation.NonNull List mediaStreams) { + this.mediaStreams = mediaStreams; + return this; + } + + public BaseItemDto addMediaStreamsItem(MediaStream mediaStreamsItem) { + if (this.mediaStreams == null) { + this.mediaStreams = new ArrayList<>(); + } + this.mediaStreams.add(mediaStreamsItem); + return this; + } + + /** + * Gets or sets the media streams. + * + * @return mediaStreams + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_STREAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMediaStreams() { + return mediaStreams; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_STREAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaStreams(@org.eclipse.jdt.annotation.NonNull List mediaStreams) { + this.mediaStreams = mediaStreams; + } + + public BaseItemDto videoType(@org.eclipse.jdt.annotation.NonNull VideoType videoType) { + this.videoType = videoType; + return this; + } + + /** + * Gets or sets the type of the video. + * + * @return videoType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public VideoType getVideoType() { + return videoType; + } + + @JsonProperty(JSON_PROPERTY_VIDEO_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVideoType(@org.eclipse.jdt.annotation.NonNull VideoType videoType) { + this.videoType = videoType; + } + + public BaseItemDto partCount(@org.eclipse.jdt.annotation.NonNull Integer partCount) { + this.partCount = partCount; + return this; + } + + /** + * Gets or sets the part count. + * + * @return partCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PART_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPartCount() { + return partCount; + } + + @JsonProperty(JSON_PROPERTY_PART_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPartCount(@org.eclipse.jdt.annotation.NonNull Integer partCount) { + this.partCount = partCount; + } + + public BaseItemDto mediaSourceCount(@org.eclipse.jdt.annotation.NonNull Integer mediaSourceCount) { + this.mediaSourceCount = mediaSourceCount; + return this; + } + + /** + * Get mediaSourceCount + * + * @return mediaSourceCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMediaSourceCount() { + return mediaSourceCount; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSourceCount(@org.eclipse.jdt.annotation.NonNull Integer mediaSourceCount) { + this.mediaSourceCount = mediaSourceCount; + } + + public BaseItemDto imageTags(@org.eclipse.jdt.annotation.NonNull Map imageTags) { + this.imageTags = imageTags; + return this; + } + + public BaseItemDto putImageTagsItem(String key, String imageTagsItem) { + if (this.imageTags == null) { + this.imageTags = new HashMap<>(); + } + this.imageTags.put(key, imageTagsItem); + return this; + } + + /** + * Gets or sets the image tags. + * + * @return imageTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getImageTags() { + return imageTags; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageTags(@org.eclipse.jdt.annotation.NonNull Map imageTags) { + this.imageTags = imageTags; + } + + public BaseItemDto backdropImageTags(@org.eclipse.jdt.annotation.NonNull List backdropImageTags) { + this.backdropImageTags = backdropImageTags; + return this; + } + + public BaseItemDto addBackdropImageTagsItem(String backdropImageTagsItem) { + if (this.backdropImageTags == null) { + this.backdropImageTags = new ArrayList<>(); + } + this.backdropImageTags.add(backdropImageTagsItem); + return this; + } + + /** + * Gets or sets the backdrop image tags. + * + * @return backdropImageTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BACKDROP_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBackdropImageTags() { + return backdropImageTags; + } + + @JsonProperty(JSON_PROPERTY_BACKDROP_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBackdropImageTags(@org.eclipse.jdt.annotation.NonNull List backdropImageTags) { + this.backdropImageTags = backdropImageTags; + } + + public BaseItemDto screenshotImageTags(@org.eclipse.jdt.annotation.NonNull List screenshotImageTags) { + this.screenshotImageTags = screenshotImageTags; + return this; + } + + public BaseItemDto addScreenshotImageTagsItem(String screenshotImageTagsItem) { + if (this.screenshotImageTags == null) { + this.screenshotImageTags = new ArrayList<>(); + } + this.screenshotImageTags.add(screenshotImageTagsItem); + return this; + } + + /** + * Gets or sets the screenshot image tags. + * + * @return screenshotImageTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SCREENSHOT_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getScreenshotImageTags() { + return screenshotImageTags; + } + + @JsonProperty(JSON_PROPERTY_SCREENSHOT_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScreenshotImageTags(@org.eclipse.jdt.annotation.NonNull List screenshotImageTags) { + this.screenshotImageTags = screenshotImageTags; + } + + public BaseItemDto parentLogoImageTag(@org.eclipse.jdt.annotation.NonNull String parentLogoImageTag) { + this.parentLogoImageTag = parentLogoImageTag; + return this; + } + + /** + * Gets or sets the parent logo image tag. + * + * @return parentLogoImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_LOGO_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentLogoImageTag() { + return parentLogoImageTag; + } + + @JsonProperty(JSON_PROPERTY_PARENT_LOGO_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentLogoImageTag(@org.eclipse.jdt.annotation.NonNull String parentLogoImageTag) { + this.parentLogoImageTag = parentLogoImageTag; + } + + public BaseItemDto parentArtItemId(@org.eclipse.jdt.annotation.NonNull UUID parentArtItemId) { + this.parentArtItemId = parentArtItemId; + return this; + } + + /** + * Gets or sets wether the item has fan art, this will hold the Id of the Parent that has one. + * + * @return parentArtItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_ART_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getParentArtItemId() { + return parentArtItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_ART_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentArtItemId(@org.eclipse.jdt.annotation.NonNull UUID parentArtItemId) { + this.parentArtItemId = parentArtItemId; + } + + public BaseItemDto parentArtImageTag(@org.eclipse.jdt.annotation.NonNull String parentArtImageTag) { + this.parentArtImageTag = parentArtImageTag; + return this; + } + + /** + * Gets or sets the parent art image tag. + * + * @return parentArtImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_ART_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentArtImageTag() { + return parentArtImageTag; + } + + @JsonProperty(JSON_PROPERTY_PARENT_ART_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentArtImageTag(@org.eclipse.jdt.annotation.NonNull String parentArtImageTag) { + this.parentArtImageTag = parentArtImageTag; + } + + public BaseItemDto seriesThumbImageTag(@org.eclipse.jdt.annotation.NonNull String seriesThumbImageTag) { + this.seriesThumbImageTag = seriesThumbImageTag; + return this; + } + + /** + * Gets or sets the series thumb image tag. + * + * @return seriesThumbImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_THUMB_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesThumbImageTag() { + return seriesThumbImageTag; + } + + @JsonProperty(JSON_PROPERTY_SERIES_THUMB_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesThumbImageTag(@org.eclipse.jdt.annotation.NonNull String seriesThumbImageTag) { + this.seriesThumbImageTag = seriesThumbImageTag; + } + + public BaseItemDto imageBlurHashes(@org.eclipse.jdt.annotation.NonNull BaseItemDtoImageBlurHashes imageBlurHashes) { + this.imageBlurHashes = imageBlurHashes; + return this; + } + + /** + * Get imageBlurHashes + * + * @return imageBlurHashes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_BLUR_HASHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemDtoImageBlurHashes getImageBlurHashes() { + return imageBlurHashes; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_BLUR_HASHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageBlurHashes(@org.eclipse.jdt.annotation.NonNull BaseItemDtoImageBlurHashes imageBlurHashes) { + this.imageBlurHashes = imageBlurHashes; + } + + public BaseItemDto seriesStudio(@org.eclipse.jdt.annotation.NonNull String seriesStudio) { + this.seriesStudio = seriesStudio; + return this; + } + + /** + * Gets or sets the series studio. + * + * @return seriesStudio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_STUDIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesStudio() { + return seriesStudio; + } + + @JsonProperty(JSON_PROPERTY_SERIES_STUDIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesStudio(@org.eclipse.jdt.annotation.NonNull String seriesStudio) { + this.seriesStudio = seriesStudio; + } + + public BaseItemDto parentThumbItemId(@org.eclipse.jdt.annotation.NonNull UUID parentThumbItemId) { + this.parentThumbItemId = parentThumbItemId; + return this; + } + + /** + * Gets or sets the parent thumb item id. + * + * @return parentThumbItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_THUMB_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getParentThumbItemId() { + return parentThumbItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_THUMB_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentThumbItemId(@org.eclipse.jdt.annotation.NonNull UUID parentThumbItemId) { + this.parentThumbItemId = parentThumbItemId; + } + + public BaseItemDto parentThumbImageTag(@org.eclipse.jdt.annotation.NonNull String parentThumbImageTag) { + this.parentThumbImageTag = parentThumbImageTag; + return this; + } + + /** + * Gets or sets the parent thumb image tag. + * + * @return parentThumbImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_THUMB_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentThumbImageTag() { + return parentThumbImageTag; + } + + @JsonProperty(JSON_PROPERTY_PARENT_THUMB_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentThumbImageTag(@org.eclipse.jdt.annotation.NonNull String parentThumbImageTag) { + this.parentThumbImageTag = parentThumbImageTag; + } + + public BaseItemDto parentPrimaryImageItemId(@org.eclipse.jdt.annotation.NonNull String parentPrimaryImageItemId) { + this.parentPrimaryImageItemId = parentPrimaryImageItemId; + return this; + } + + /** + * Gets or sets the parent primary image item identifier. + * + * @return parentPrimaryImageItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_PRIMARY_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentPrimaryImageItemId() { + return parentPrimaryImageItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_PRIMARY_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentPrimaryImageItemId(@org.eclipse.jdt.annotation.NonNull String parentPrimaryImageItemId) { + this.parentPrimaryImageItemId = parentPrimaryImageItemId; + } + + public BaseItemDto parentPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String parentPrimaryImageTag) { + this.parentPrimaryImageTag = parentPrimaryImageTag; + return this; + } + + /** + * Gets or sets the parent primary image tag. + * + * @return parentPrimaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentPrimaryImageTag() { + return parentPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_PARENT_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String parentPrimaryImageTag) { + this.parentPrimaryImageTag = parentPrimaryImageTag; + } + + public BaseItemDto chapters(@org.eclipse.jdt.annotation.NonNull List chapters) { + this.chapters = chapters; + return this; + } + + public BaseItemDto addChaptersItem(ChapterInfo chaptersItem) { + if (this.chapters == null) { + this.chapters = new ArrayList<>(); + } + this.chapters.add(chaptersItem); + return this; + } + + /** + * Gets or sets the chapters. + * + * @return chapters + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHAPTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getChapters() { + return chapters; + } + + @JsonProperty(JSON_PROPERTY_CHAPTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChapters(@org.eclipse.jdt.annotation.NonNull List chapters) { + this.chapters = chapters; + } + + public BaseItemDto locationType(@org.eclipse.jdt.annotation.NonNull LocationType locationType) { + this.locationType = locationType; + return this; + } + + /** + * Gets or sets the type of the location. + * + * @return locationType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LocationType getLocationType() { + return locationType; + } + + @JsonProperty(JSON_PROPERTY_LOCATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocationType(@org.eclipse.jdt.annotation.NonNull LocationType locationType) { + this.locationType = locationType; + } + + public BaseItemDto isoType(@org.eclipse.jdt.annotation.NonNull IsoType isoType) { + this.isoType = isoType; + return this; + } + + /** + * Gets or sets the type of the iso. + * + * @return isoType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ISO_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IsoType getIsoType() { + return isoType; + } + + @JsonProperty(JSON_PROPERTY_ISO_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsoType(@org.eclipse.jdt.annotation.NonNull IsoType isoType) { + this.isoType = isoType; + } + + public BaseItemDto mediaType(@org.eclipse.jdt.annotation.NonNull String mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Gets or sets the type of the media. + * + * @return mediaType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMediaType() { + return mediaType; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaType(@org.eclipse.jdt.annotation.NonNull String mediaType) { + this.mediaType = mediaType; + } + + public BaseItemDto endDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Gets or sets the end date. + * + * @return endDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndDate() { + return endDate; + } + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + } + + public BaseItemDto lockedFields(@org.eclipse.jdt.annotation.NonNull List lockedFields) { + this.lockedFields = lockedFields; + return this; + } + + public BaseItemDto addLockedFieldsItem(MetadataField lockedFieldsItem) { + if (this.lockedFields == null) { + this.lockedFields = new ArrayList<>(); + } + this.lockedFields.add(lockedFieldsItem); + return this; + } + + /** + * Gets or sets the locked fields. + * + * @return lockedFields + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCKED_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLockedFields() { + return lockedFields; + } + + @JsonProperty(JSON_PROPERTY_LOCKED_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLockedFields(@org.eclipse.jdt.annotation.NonNull List lockedFields) { + this.lockedFields = lockedFields; + } + + public BaseItemDto trailerCount(@org.eclipse.jdt.annotation.NonNull Integer trailerCount) { + this.trailerCount = trailerCount; + return this; + } + + /** + * Gets or sets the trailer count. + * + * @return trailerCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRAILER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTrailerCount() { + return trailerCount; + } + + @JsonProperty(JSON_PROPERTY_TRAILER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrailerCount(@org.eclipse.jdt.annotation.NonNull Integer trailerCount) { + this.trailerCount = trailerCount; + } + + public BaseItemDto movieCount(@org.eclipse.jdt.annotation.NonNull Integer movieCount) { + this.movieCount = movieCount; + return this; + } + + /** + * Gets or sets the movie count. + * + * @return movieCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MOVIE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMovieCount() { + return movieCount; + } + + @JsonProperty(JSON_PROPERTY_MOVIE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMovieCount(@org.eclipse.jdt.annotation.NonNull Integer movieCount) { + this.movieCount = movieCount; + } + + public BaseItemDto seriesCount(@org.eclipse.jdt.annotation.NonNull Integer seriesCount) { + this.seriesCount = seriesCount; + return this; + } + + /** + * Gets or sets the series count. + * + * @return seriesCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSeriesCount() { + return seriesCount; + } + + @JsonProperty(JSON_PROPERTY_SERIES_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesCount(@org.eclipse.jdt.annotation.NonNull Integer seriesCount) { + this.seriesCount = seriesCount; + } + + public BaseItemDto programCount(@org.eclipse.jdt.annotation.NonNull Integer programCount) { + this.programCount = programCount; + return this; + } + + /** + * Get programCount + * + * @return programCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROGRAM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getProgramCount() { + return programCount; + } + + @JsonProperty(JSON_PROPERTY_PROGRAM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgramCount(@org.eclipse.jdt.annotation.NonNull Integer programCount) { + this.programCount = programCount; + } + + public BaseItemDto episodeCount(@org.eclipse.jdt.annotation.NonNull Integer episodeCount) { + this.episodeCount = episodeCount; + return this; + } + + /** + * Gets or sets the episode count. + * + * @return episodeCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EPISODE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getEpisodeCount() { + return episodeCount; + } + + @JsonProperty(JSON_PROPERTY_EPISODE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEpisodeCount(@org.eclipse.jdt.annotation.NonNull Integer episodeCount) { + this.episodeCount = episodeCount; + } + + public BaseItemDto songCount(@org.eclipse.jdt.annotation.NonNull Integer songCount) { + this.songCount = songCount; + return this; + } + + /** + * Gets or sets the song count. + * + * @return songCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SONG_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSongCount() { + return songCount; + } + + @JsonProperty(JSON_PROPERTY_SONG_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSongCount(@org.eclipse.jdt.annotation.NonNull Integer songCount) { + this.songCount = songCount; + } + + public BaseItemDto albumCount(@org.eclipse.jdt.annotation.NonNull Integer albumCount) { + this.albumCount = albumCount; + return this; + } + + /** + * Gets or sets the album count. + * + * @return albumCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAlbumCount() { + return albumCount; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumCount(@org.eclipse.jdt.annotation.NonNull Integer albumCount) { + this.albumCount = albumCount; + } + + public BaseItemDto artistCount(@org.eclipse.jdt.annotation.NonNull Integer artistCount) { + this.artistCount = artistCount; + return this; + } + + /** + * Get artistCount + * + * @return artistCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTIST_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getArtistCount() { + return artistCount; + } + + @JsonProperty(JSON_PROPERTY_ARTIST_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtistCount(@org.eclipse.jdt.annotation.NonNull Integer artistCount) { + this.artistCount = artistCount; + } + + public BaseItemDto musicVideoCount(@org.eclipse.jdt.annotation.NonNull Integer musicVideoCount) { + this.musicVideoCount = musicVideoCount; + return this; + } + + /** + * Gets or sets the music video count. + * + * @return musicVideoCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MUSIC_VIDEO_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMusicVideoCount() { + return musicVideoCount; + } + + @JsonProperty(JSON_PROPERTY_MUSIC_VIDEO_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMusicVideoCount(@org.eclipse.jdt.annotation.NonNull Integer musicVideoCount) { + this.musicVideoCount = musicVideoCount; + } + + public BaseItemDto lockData(@org.eclipse.jdt.annotation.NonNull Boolean lockData) { + this.lockData = lockData; + return this; + } + + /** + * Gets or sets a value indicating whether [enable internet providers]. + * + * @return lockData + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCK_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getLockData() { + return lockData; + } + + @JsonProperty(JSON_PROPERTY_LOCK_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLockData(@org.eclipse.jdt.annotation.NonNull Boolean lockData) { + this.lockData = lockData; + } + + public BaseItemDto width(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + return this; + } + + /** + * Get width + * + * @return width + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + } + + public BaseItemDto height(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + return this; + } + + /** + * Get height + * + * @return height + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHeight() { + return height; + } + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + } + + public BaseItemDto cameraMake(@org.eclipse.jdt.annotation.NonNull String cameraMake) { + this.cameraMake = cameraMake; + return this; + } + + /** + * Get cameraMake + * + * @return cameraMake + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAMERA_MAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCameraMake() { + return cameraMake; + } + + @JsonProperty(JSON_PROPERTY_CAMERA_MAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCameraMake(@org.eclipse.jdt.annotation.NonNull String cameraMake) { + this.cameraMake = cameraMake; + } + + public BaseItemDto cameraModel(@org.eclipse.jdt.annotation.NonNull String cameraModel) { + this.cameraModel = cameraModel; + return this; + } + + /** + * Get cameraModel + * + * @return cameraModel + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAMERA_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCameraModel() { + return cameraModel; + } + + @JsonProperty(JSON_PROPERTY_CAMERA_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCameraModel(@org.eclipse.jdt.annotation.NonNull String cameraModel) { + this.cameraModel = cameraModel; + } + + public BaseItemDto software(@org.eclipse.jdt.annotation.NonNull String software) { + this.software = software; + return this; + } + + /** + * Get software + * + * @return software + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SOFTWARE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSoftware() { + return software; + } + + @JsonProperty(JSON_PROPERTY_SOFTWARE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSoftware(@org.eclipse.jdt.annotation.NonNull String software) { + this.software = software; + } + + public BaseItemDto exposureTime(@org.eclipse.jdt.annotation.NonNull Double exposureTime) { + this.exposureTime = exposureTime; + return this; + } + + /** + * Get exposureTime + * + * @return exposureTime + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXPOSURE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getExposureTime() { + return exposureTime; + } + + @JsonProperty(JSON_PROPERTY_EXPOSURE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExposureTime(@org.eclipse.jdt.annotation.NonNull Double exposureTime) { + this.exposureTime = exposureTime; + } + + public BaseItemDto focalLength(@org.eclipse.jdt.annotation.NonNull Double focalLength) { + this.focalLength = focalLength; + return this; + } + + /** + * Get focalLength + * + * @return focalLength + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FOCAL_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getFocalLength() { + return focalLength; + } + + @JsonProperty(JSON_PROPERTY_FOCAL_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFocalLength(@org.eclipse.jdt.annotation.NonNull Double focalLength) { + this.focalLength = focalLength; + } + + public BaseItemDto imageOrientation(@org.eclipse.jdt.annotation.NonNull ImageOrientation imageOrientation) { + this.imageOrientation = imageOrientation; + return this; + } + + /** + * Get imageOrientation + * + * @return imageOrientation + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_ORIENTATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ImageOrientation getImageOrientation() { + return imageOrientation; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_ORIENTATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageOrientation(@org.eclipse.jdt.annotation.NonNull ImageOrientation imageOrientation) { + this.imageOrientation = imageOrientation; + } + + public BaseItemDto aperture(@org.eclipse.jdt.annotation.NonNull Double aperture) { + this.aperture = aperture; + return this; + } + + /** + * Get aperture + * + * @return aperture + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APERTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getAperture() { + return aperture; + } + + @JsonProperty(JSON_PROPERTY_APERTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAperture(@org.eclipse.jdt.annotation.NonNull Double aperture) { + this.aperture = aperture; + } + + public BaseItemDto shutterSpeed(@org.eclipse.jdt.annotation.NonNull Double shutterSpeed) { + this.shutterSpeed = shutterSpeed; + return this; + } + + /** + * Get shutterSpeed + * + * @return shutterSpeed + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SHUTTER_SPEED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getShutterSpeed() { + return shutterSpeed; + } + + @JsonProperty(JSON_PROPERTY_SHUTTER_SPEED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShutterSpeed(@org.eclipse.jdt.annotation.NonNull Double shutterSpeed) { + this.shutterSpeed = shutterSpeed; + } + + public BaseItemDto latitude(@org.eclipse.jdt.annotation.NonNull Double latitude) { + this.latitude = latitude; + return this; + } + + /** + * Get latitude + * + * @return latitude + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LATITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getLatitude() { + return latitude; + } + + @JsonProperty(JSON_PROPERTY_LATITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLatitude(@org.eclipse.jdt.annotation.NonNull Double latitude) { + this.latitude = latitude; + } + + public BaseItemDto longitude(@org.eclipse.jdt.annotation.NonNull Double longitude) { + this.longitude = longitude; + return this; + } + + /** + * Get longitude + * + * @return longitude + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LONGITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getLongitude() { + return longitude; + } + + @JsonProperty(JSON_PROPERTY_LONGITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLongitude(@org.eclipse.jdt.annotation.NonNull Double longitude) { + this.longitude = longitude; + } + + public BaseItemDto altitude(@org.eclipse.jdt.annotation.NonNull Double altitude) { + this.altitude = altitude; + return this; + } + + /** + * Get altitude + * + * @return altitude + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALTITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getAltitude() { + return altitude; + } + + @JsonProperty(JSON_PROPERTY_ALTITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAltitude(@org.eclipse.jdt.annotation.NonNull Double altitude) { + this.altitude = altitude; + } + + public BaseItemDto isoSpeedRating(@org.eclipse.jdt.annotation.NonNull Integer isoSpeedRating) { + this.isoSpeedRating = isoSpeedRating; + return this; + } + + /** + * Get isoSpeedRating + * + * @return isoSpeedRating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ISO_SPEED_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIsoSpeedRating() { + return isoSpeedRating; + } + + @JsonProperty(JSON_PROPERTY_ISO_SPEED_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsoSpeedRating(@org.eclipse.jdt.annotation.NonNull Integer isoSpeedRating) { + this.isoSpeedRating = isoSpeedRating; + } + + public BaseItemDto seriesTimerId(@org.eclipse.jdt.annotation.NonNull String seriesTimerId) { + this.seriesTimerId = seriesTimerId; + return this; + } + + /** + * Gets or sets the series timer identifier. + * + * @return seriesTimerId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesTimerId() { + return seriesTimerId; + } + + @JsonProperty(JSON_PROPERTY_SERIES_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesTimerId(@org.eclipse.jdt.annotation.NonNull String seriesTimerId) { + this.seriesTimerId = seriesTimerId; + } + + public BaseItemDto programId(@org.eclipse.jdt.annotation.NonNull String programId) { + this.programId = programId; + return this; + } + + /** + * Gets or sets the program identifier. + * + * @return programId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProgramId() { + return programId; + } + + @JsonProperty(JSON_PROPERTY_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgramId(@org.eclipse.jdt.annotation.NonNull String programId) { + this.programId = programId; + } + + public BaseItemDto channelPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String channelPrimaryImageTag) { + this.channelPrimaryImageTag = channelPrimaryImageTag; + return this; + } + + /** + * Gets or sets the channel primary image tag. + * + * @return channelPrimaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelPrimaryImageTag() { + return channelPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String channelPrimaryImageTag) { + this.channelPrimaryImageTag = channelPrimaryImageTag; + } + + public BaseItemDto startDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Gets or sets the start date of the recording, in UTC. + * + * @return startDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartDate() { + return startDate; + } + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + } + + public BaseItemDto completionPercentage(@org.eclipse.jdt.annotation.NonNull Double completionPercentage) { + this.completionPercentage = completionPercentage; + return this; + } + + /** + * Gets or sets the completion percentage. + * + * @return completionPercentage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMPLETION_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getCompletionPercentage() { + return completionPercentage; + } + + @JsonProperty(JSON_PROPERTY_COMPLETION_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompletionPercentage(@org.eclipse.jdt.annotation.NonNull Double completionPercentage) { + this.completionPercentage = completionPercentage; + } + + public BaseItemDto isRepeat(@org.eclipse.jdt.annotation.NonNull Boolean isRepeat) { + this.isRepeat = isRepeat; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is repeat. + * + * @return isRepeat + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_REPEAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsRepeat() { + return isRepeat; + } + + @JsonProperty(JSON_PROPERTY_IS_REPEAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsRepeat(@org.eclipse.jdt.annotation.NonNull Boolean isRepeat) { + this.isRepeat = isRepeat; + } + + public BaseItemDto episodeTitle(@org.eclipse.jdt.annotation.NonNull String episodeTitle) { + this.episodeTitle = episodeTitle; + return this; + } + + /** + * Gets or sets the episode title. + * + * @return episodeTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EPISODE_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEpisodeTitle() { + return episodeTitle; + } + + @JsonProperty(JSON_PROPERTY_EPISODE_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEpisodeTitle(@org.eclipse.jdt.annotation.NonNull String episodeTitle) { + this.episodeTitle = episodeTitle; + } + + public BaseItemDto channelType(@org.eclipse.jdt.annotation.NonNull ChannelType channelType) { + this.channelType = channelType; + return this; + } + + /** + * Gets or sets the type of the channel. + * + * @return channelType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChannelType getChannelType() { + return channelType; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelType(@org.eclipse.jdt.annotation.NonNull ChannelType channelType) { + this.channelType = channelType; + } + + public BaseItemDto audio(@org.eclipse.jdt.annotation.NonNull ProgramAudio audio) { + this.audio = audio; + return this; + } + + /** + * Gets or sets the audio. + * + * @return audio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProgramAudio getAudio() { + return audio; + } + + @JsonProperty(JSON_PROPERTY_AUDIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudio(@org.eclipse.jdt.annotation.NonNull ProgramAudio audio) { + this.audio = audio; + } + + public BaseItemDto isMovie(@org.eclipse.jdt.annotation.NonNull Boolean isMovie) { + this.isMovie = isMovie; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is movie. + * + * @return isMovie + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_MOVIE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsMovie() { + return isMovie; + } + + @JsonProperty(JSON_PROPERTY_IS_MOVIE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMovie(@org.eclipse.jdt.annotation.NonNull Boolean isMovie) { + this.isMovie = isMovie; + } + + public BaseItemDto isSports(@org.eclipse.jdt.annotation.NonNull Boolean isSports) { + this.isSports = isSports; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is sports. + * + * @return isSports + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_SPORTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsSports() { + return isSports; + } + + @JsonProperty(JSON_PROPERTY_IS_SPORTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsSports(@org.eclipse.jdt.annotation.NonNull Boolean isSports) { + this.isSports = isSports; + } + + public BaseItemDto isSeries(@org.eclipse.jdt.annotation.NonNull Boolean isSeries) { + this.isSeries = isSeries; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is series. + * + * @return isSeries + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_SERIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsSeries() { + return isSeries; + } + + @JsonProperty(JSON_PROPERTY_IS_SERIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsSeries(@org.eclipse.jdt.annotation.NonNull Boolean isSeries) { + this.isSeries = isSeries; + } + + public BaseItemDto isLive(@org.eclipse.jdt.annotation.NonNull Boolean isLive) { + this.isLive = isLive; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is live. + * + * @return isLive + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_LIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsLive() { + return isLive; + } + + @JsonProperty(JSON_PROPERTY_IS_LIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsLive(@org.eclipse.jdt.annotation.NonNull Boolean isLive) { + this.isLive = isLive; + } + + public BaseItemDto isNews(@org.eclipse.jdt.annotation.NonNull Boolean isNews) { + this.isNews = isNews; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is news. + * + * @return isNews + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_NEWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsNews() { + return isNews; + } + + @JsonProperty(JSON_PROPERTY_IS_NEWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsNews(@org.eclipse.jdt.annotation.NonNull Boolean isNews) { + this.isNews = isNews; + } + + public BaseItemDto isKids(@org.eclipse.jdt.annotation.NonNull Boolean isKids) { + this.isKids = isKids; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is kids. + * + * @return isKids + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_KIDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsKids() { + return isKids; + } + + @JsonProperty(JSON_PROPERTY_IS_KIDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsKids(@org.eclipse.jdt.annotation.NonNull Boolean isKids) { + this.isKids = isKids; + } + + public BaseItemDto isPremiere(@org.eclipse.jdt.annotation.NonNull Boolean isPremiere) { + this.isPremiere = isPremiere; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is premiere. + * + * @return isPremiere + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PREMIERE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPremiere() { + return isPremiere; + } + + @JsonProperty(JSON_PROPERTY_IS_PREMIERE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPremiere(@org.eclipse.jdt.annotation.NonNull Boolean isPremiere) { + this.isPremiere = isPremiere; + } + + public BaseItemDto timerId(@org.eclipse.jdt.annotation.NonNull String timerId) { + this.timerId = timerId; + return this; + } + + /** + * Gets or sets the timer identifier. + * + * @return timerId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTimerId() { + return timerId; + } + + @JsonProperty(JSON_PROPERTY_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimerId(@org.eclipse.jdt.annotation.NonNull String timerId) { + this.timerId = timerId; + } + + public BaseItemDto currentProgram(@org.eclipse.jdt.annotation.NonNull BaseItemDto currentProgram) { + this.currentProgram = currentProgram; + return this; + } + + /** + * Gets or sets the current program. + * + * @return currentProgram + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CURRENT_PROGRAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemDto getCurrentProgram() { + return currentProgram; + } + + @JsonProperty(JSON_PROPERTY_CURRENT_PROGRAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrentProgram(@org.eclipse.jdt.annotation.NonNull BaseItemDto currentProgram) { + this.currentProgram = currentProgram; + } + + /** + * Return true if this BaseItemDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseItemDto baseItemDto = (BaseItemDto) o; + return Objects.equals(this.name, baseItemDto.name) + && Objects.equals(this.originalTitle, baseItemDto.originalTitle) + && Objects.equals(this.serverId, baseItemDto.serverId) && Objects.equals(this.id, baseItemDto.id) + && Objects.equals(this.etag, baseItemDto.etag) + && Objects.equals(this.sourceType, baseItemDto.sourceType) + && Objects.equals(this.playlistItemId, baseItemDto.playlistItemId) + && Objects.equals(this.dateCreated, baseItemDto.dateCreated) + && Objects.equals(this.dateLastMediaAdded, baseItemDto.dateLastMediaAdded) + && Objects.equals(this.extraType, baseItemDto.extraType) + && Objects.equals(this.airsBeforeSeasonNumber, baseItemDto.airsBeforeSeasonNumber) + && Objects.equals(this.airsAfterSeasonNumber, baseItemDto.airsAfterSeasonNumber) + && Objects.equals(this.airsBeforeEpisodeNumber, baseItemDto.airsBeforeEpisodeNumber) + && Objects.equals(this.canDelete, baseItemDto.canDelete) + && Objects.equals(this.canDownload, baseItemDto.canDownload) + && Objects.equals(this.hasSubtitles, baseItemDto.hasSubtitles) + && Objects.equals(this.preferredMetadataLanguage, baseItemDto.preferredMetadataLanguage) + && Objects.equals(this.preferredMetadataCountryCode, baseItemDto.preferredMetadataCountryCode) + && Objects.equals(this.supportsSync, baseItemDto.supportsSync) + && Objects.equals(this.container, baseItemDto.container) + && Objects.equals(this.sortName, baseItemDto.sortName) + && Objects.equals(this.forcedSortName, baseItemDto.forcedSortName) + && Objects.equals(this.video3DFormat, baseItemDto.video3DFormat) + && Objects.equals(this.premiereDate, baseItemDto.premiereDate) + && Objects.equals(this.externalUrls, baseItemDto.externalUrls) + && Objects.equals(this.mediaSources, baseItemDto.mediaSources) + && Objects.equals(this.criticRating, baseItemDto.criticRating) + && Objects.equals(this.productionLocations, baseItemDto.productionLocations) + && Objects.equals(this.path, baseItemDto.path) + && Objects.equals(this.enableMediaSourceDisplay, baseItemDto.enableMediaSourceDisplay) + && Objects.equals(this.officialRating, baseItemDto.officialRating) + && Objects.equals(this.customRating, baseItemDto.customRating) + && Objects.equals(this.channelId, baseItemDto.channelId) + && Objects.equals(this.channelName, baseItemDto.channelName) + && Objects.equals(this.overview, baseItemDto.overview) + && Objects.equals(this.taglines, baseItemDto.taglines) + && Objects.equals(this.genres, baseItemDto.genres) + && Objects.equals(this.communityRating, baseItemDto.communityRating) + && Objects.equals(this.cumulativeRunTimeTicks, baseItemDto.cumulativeRunTimeTicks) + && Objects.equals(this.runTimeTicks, baseItemDto.runTimeTicks) + && Objects.equals(this.playAccess, baseItemDto.playAccess) + && Objects.equals(this.aspectRatio, baseItemDto.aspectRatio) + && Objects.equals(this.productionYear, baseItemDto.productionYear) + && Objects.equals(this.isPlaceHolder, baseItemDto.isPlaceHolder) + && Objects.equals(this.number, baseItemDto.number) + && Objects.equals(this.channelNumber, baseItemDto.channelNumber) + && Objects.equals(this.indexNumber, baseItemDto.indexNumber) + && Objects.equals(this.indexNumberEnd, baseItemDto.indexNumberEnd) + && Objects.equals(this.parentIndexNumber, baseItemDto.parentIndexNumber) + && Objects.equals(this.remoteTrailers, baseItemDto.remoteTrailers) + && Objects.equals(this.providerIds, baseItemDto.providerIds) + && Objects.equals(this.isHD, baseItemDto.isHD) && Objects.equals(this.isFolder, baseItemDto.isFolder) + && Objects.equals(this.parentId, baseItemDto.parentId) && Objects.equals(this.type, baseItemDto.type) + && Objects.equals(this.people, baseItemDto.people) && Objects.equals(this.studios, baseItemDto.studios) + && Objects.equals(this.genreItems, baseItemDto.genreItems) + && Objects.equals(this.parentLogoItemId, baseItemDto.parentLogoItemId) + && Objects.equals(this.parentBackdropItemId, baseItemDto.parentBackdropItemId) + && Objects.equals(this.parentBackdropImageTags, baseItemDto.parentBackdropImageTags) + && Objects.equals(this.localTrailerCount, baseItemDto.localTrailerCount) + && Objects.equals(this.userData, baseItemDto.userData) + && Objects.equals(this.recursiveItemCount, baseItemDto.recursiveItemCount) + && Objects.equals(this.childCount, baseItemDto.childCount) + && Objects.equals(this.seriesName, baseItemDto.seriesName) + && Objects.equals(this.seriesId, baseItemDto.seriesId) + && Objects.equals(this.seasonId, baseItemDto.seasonId) + && Objects.equals(this.specialFeatureCount, baseItemDto.specialFeatureCount) + && Objects.equals(this.displayPreferencesId, baseItemDto.displayPreferencesId) + && Objects.equals(this.status, baseItemDto.status) && Objects.equals(this.airTime, baseItemDto.airTime) + && Objects.equals(this.airDays, baseItemDto.airDays) && Objects.equals(this.tags, baseItemDto.tags) + && Objects.equals(this.primaryImageAspectRatio, baseItemDto.primaryImageAspectRatio) + && Objects.equals(this.artists, baseItemDto.artists) + && Objects.equals(this.artistItems, baseItemDto.artistItems) + && Objects.equals(this.album, baseItemDto.album) + && Objects.equals(this.collectionType, baseItemDto.collectionType) + && Objects.equals(this.displayOrder, baseItemDto.displayOrder) + && Objects.equals(this.albumId, baseItemDto.albumId) + && Objects.equals(this.albumPrimaryImageTag, baseItemDto.albumPrimaryImageTag) + && Objects.equals(this.seriesPrimaryImageTag, baseItemDto.seriesPrimaryImageTag) + && Objects.equals(this.albumArtist, baseItemDto.albumArtist) + && Objects.equals(this.albumArtists, baseItemDto.albumArtists) + && Objects.equals(this.seasonName, baseItemDto.seasonName) + && Objects.equals(this.mediaStreams, baseItemDto.mediaStreams) + && Objects.equals(this.videoType, baseItemDto.videoType) + && Objects.equals(this.partCount, baseItemDto.partCount) + && Objects.equals(this.mediaSourceCount, baseItemDto.mediaSourceCount) + && Objects.equals(this.imageTags, baseItemDto.imageTags) + && Objects.equals(this.backdropImageTags, baseItemDto.backdropImageTags) + && Objects.equals(this.screenshotImageTags, baseItemDto.screenshotImageTags) + && Objects.equals(this.parentLogoImageTag, baseItemDto.parentLogoImageTag) + && Objects.equals(this.parentArtItemId, baseItemDto.parentArtItemId) + && Objects.equals(this.parentArtImageTag, baseItemDto.parentArtImageTag) + && Objects.equals(this.seriesThumbImageTag, baseItemDto.seriesThumbImageTag) + && Objects.equals(this.imageBlurHashes, baseItemDto.imageBlurHashes) + && Objects.equals(this.seriesStudio, baseItemDto.seriesStudio) + && Objects.equals(this.parentThumbItemId, baseItemDto.parentThumbItemId) + && Objects.equals(this.parentThumbImageTag, baseItemDto.parentThumbImageTag) + && Objects.equals(this.parentPrimaryImageItemId, baseItemDto.parentPrimaryImageItemId) + && Objects.equals(this.parentPrimaryImageTag, baseItemDto.parentPrimaryImageTag) + && Objects.equals(this.chapters, baseItemDto.chapters) + && Objects.equals(this.locationType, baseItemDto.locationType) + && Objects.equals(this.isoType, baseItemDto.isoType) + && Objects.equals(this.mediaType, baseItemDto.mediaType) + && Objects.equals(this.endDate, baseItemDto.endDate) + && Objects.equals(this.lockedFields, baseItemDto.lockedFields) + && Objects.equals(this.trailerCount, baseItemDto.trailerCount) + && Objects.equals(this.movieCount, baseItemDto.movieCount) + && Objects.equals(this.seriesCount, baseItemDto.seriesCount) + && Objects.equals(this.programCount, baseItemDto.programCount) + && Objects.equals(this.episodeCount, baseItemDto.episodeCount) + && Objects.equals(this.songCount, baseItemDto.songCount) + && Objects.equals(this.albumCount, baseItemDto.albumCount) + && Objects.equals(this.artistCount, baseItemDto.artistCount) + && Objects.equals(this.musicVideoCount, baseItemDto.musicVideoCount) + && Objects.equals(this.lockData, baseItemDto.lockData) && Objects.equals(this.width, baseItemDto.width) + && Objects.equals(this.height, baseItemDto.height) + && Objects.equals(this.cameraMake, baseItemDto.cameraMake) + && Objects.equals(this.cameraModel, baseItemDto.cameraModel) + && Objects.equals(this.software, baseItemDto.software) + && Objects.equals(this.exposureTime, baseItemDto.exposureTime) + && Objects.equals(this.focalLength, baseItemDto.focalLength) + && Objects.equals(this.imageOrientation, baseItemDto.imageOrientation) + && Objects.equals(this.aperture, baseItemDto.aperture) + && Objects.equals(this.shutterSpeed, baseItemDto.shutterSpeed) + && Objects.equals(this.latitude, baseItemDto.latitude) + && Objects.equals(this.longitude, baseItemDto.longitude) + && Objects.equals(this.altitude, baseItemDto.altitude) + && Objects.equals(this.isoSpeedRating, baseItemDto.isoSpeedRating) + && Objects.equals(this.seriesTimerId, baseItemDto.seriesTimerId) + && Objects.equals(this.programId, baseItemDto.programId) + && Objects.equals(this.channelPrimaryImageTag, baseItemDto.channelPrimaryImageTag) + && Objects.equals(this.startDate, baseItemDto.startDate) + && Objects.equals(this.completionPercentage, baseItemDto.completionPercentage) + && Objects.equals(this.isRepeat, baseItemDto.isRepeat) + && Objects.equals(this.episodeTitle, baseItemDto.episodeTitle) + && Objects.equals(this.channelType, baseItemDto.channelType) + && Objects.equals(this.audio, baseItemDto.audio) && Objects.equals(this.isMovie, baseItemDto.isMovie) + && Objects.equals(this.isSports, baseItemDto.isSports) + && Objects.equals(this.isSeries, baseItemDto.isSeries) + && Objects.equals(this.isLive, baseItemDto.isLive) && Objects.equals(this.isNews, baseItemDto.isNews) + && Objects.equals(this.isKids, baseItemDto.isKids) + && Objects.equals(this.isPremiere, baseItemDto.isPremiere) + && Objects.equals(this.timerId, baseItemDto.timerId) + && Objects.equals(this.currentProgram, baseItemDto.currentProgram); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, serverId, id, etag, sourceType, playlistItemId, dateCreated, + dateLastMediaAdded, extraType, airsBeforeSeasonNumber, airsAfterSeasonNumber, airsBeforeEpisodeNumber, + canDelete, canDownload, hasSubtitles, preferredMetadataLanguage, preferredMetadataCountryCode, + supportsSync, container, sortName, forcedSortName, video3DFormat, premiereDate, externalUrls, + mediaSources, criticRating, productionLocations, path, enableMediaSourceDisplay, officialRating, + customRating, channelId, channelName, overview, taglines, genres, communityRating, + cumulativeRunTimeTicks, runTimeTicks, playAccess, aspectRatio, productionYear, isPlaceHolder, number, + channelNumber, indexNumber, indexNumberEnd, parentIndexNumber, remoteTrailers, providerIds, isHD, + isFolder, parentId, type, people, studios, genreItems, parentLogoItemId, parentBackdropItemId, + parentBackdropImageTags, localTrailerCount, userData, recursiveItemCount, childCount, seriesName, + seriesId, seasonId, specialFeatureCount, displayPreferencesId, status, airTime, airDays, tags, + primaryImageAspectRatio, artists, artistItems, album, collectionType, displayOrder, albumId, + albumPrimaryImageTag, seriesPrimaryImageTag, albumArtist, albumArtists, seasonName, mediaStreams, + videoType, partCount, mediaSourceCount, imageTags, backdropImageTags, screenshotImageTags, + parentLogoImageTag, parentArtItemId, parentArtImageTag, seriesThumbImageTag, imageBlurHashes, + seriesStudio, parentThumbItemId, parentThumbImageTag, parentPrimaryImageItemId, parentPrimaryImageTag, + chapters, locationType, isoType, mediaType, endDate, lockedFields, trailerCount, movieCount, + seriesCount, programCount, episodeCount, songCount, albumCount, artistCount, musicVideoCount, lockData, + width, height, cameraMake, cameraModel, software, exposureTime, focalLength, imageOrientation, aperture, + shutterSpeed, latitude, longitude, altitude, isoSpeedRating, seriesTimerId, programId, + channelPrimaryImageTag, startDate, completionPercentage, isRepeat, episodeTitle, channelType, audio, + isMovie, isSports, isSeries, isLive, isNews, isKids, isPremiere, timerId, currentProgram); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseItemDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" etag: ").append(toIndentedString(etag)).append("\n"); + sb.append(" sourceType: ").append(toIndentedString(sourceType)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append(" dateCreated: ").append(toIndentedString(dateCreated)).append("\n"); + sb.append(" dateLastMediaAdded: ").append(toIndentedString(dateLastMediaAdded)).append("\n"); + sb.append(" extraType: ").append(toIndentedString(extraType)).append("\n"); + sb.append(" airsBeforeSeasonNumber: ").append(toIndentedString(airsBeforeSeasonNumber)).append("\n"); + sb.append(" airsAfterSeasonNumber: ").append(toIndentedString(airsAfterSeasonNumber)).append("\n"); + sb.append(" airsBeforeEpisodeNumber: ").append(toIndentedString(airsBeforeEpisodeNumber)).append("\n"); + sb.append(" canDelete: ").append(toIndentedString(canDelete)).append("\n"); + sb.append(" canDownload: ").append(toIndentedString(canDownload)).append("\n"); + sb.append(" hasSubtitles: ").append(toIndentedString(hasSubtitles)).append("\n"); + sb.append(" preferredMetadataLanguage: ").append(toIndentedString(preferredMetadataLanguage)).append("\n"); + sb.append(" preferredMetadataCountryCode: ").append(toIndentedString(preferredMetadataCountryCode)) + .append("\n"); + sb.append(" supportsSync: ").append(toIndentedString(supportsSync)).append("\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" sortName: ").append(toIndentedString(sortName)).append("\n"); + sb.append(" forcedSortName: ").append(toIndentedString(forcedSortName)).append("\n"); + sb.append(" video3DFormat: ").append(toIndentedString(video3DFormat)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" externalUrls: ").append(toIndentedString(externalUrls)).append("\n"); + sb.append(" mediaSources: ").append(toIndentedString(mediaSources)).append("\n"); + sb.append(" criticRating: ").append(toIndentedString(criticRating)).append("\n"); + sb.append(" productionLocations: ").append(toIndentedString(productionLocations)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" enableMediaSourceDisplay: ").append(toIndentedString(enableMediaSourceDisplay)).append("\n"); + sb.append(" officialRating: ").append(toIndentedString(officialRating)).append("\n"); + sb.append(" customRating: ").append(toIndentedString(customRating)).append("\n"); + sb.append(" channelId: ").append(toIndentedString(channelId)).append("\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" overview: ").append(toIndentedString(overview)).append("\n"); + sb.append(" taglines: ").append(toIndentedString(taglines)).append("\n"); + sb.append(" genres: ").append(toIndentedString(genres)).append("\n"); + sb.append(" communityRating: ").append(toIndentedString(communityRating)).append("\n"); + sb.append(" cumulativeRunTimeTicks: ").append(toIndentedString(cumulativeRunTimeTicks)).append("\n"); + sb.append(" runTimeTicks: ").append(toIndentedString(runTimeTicks)).append("\n"); + sb.append(" playAccess: ").append(toIndentedString(playAccess)).append("\n"); + sb.append(" aspectRatio: ").append(toIndentedString(aspectRatio)).append("\n"); + sb.append(" productionYear: ").append(toIndentedString(productionYear)).append("\n"); + sb.append(" isPlaceHolder: ").append(toIndentedString(isPlaceHolder)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" channelNumber: ").append(toIndentedString(channelNumber)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" indexNumberEnd: ").append(toIndentedString(indexNumberEnd)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" remoteTrailers: ").append(toIndentedString(remoteTrailers)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" isHD: ").append(toIndentedString(isHD)).append("\n"); + sb.append(" isFolder: ").append(toIndentedString(isFolder)).append("\n"); + sb.append(" parentId: ").append(toIndentedString(parentId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" people: ").append(toIndentedString(people)).append("\n"); + sb.append(" studios: ").append(toIndentedString(studios)).append("\n"); + sb.append(" genreItems: ").append(toIndentedString(genreItems)).append("\n"); + sb.append(" parentLogoItemId: ").append(toIndentedString(parentLogoItemId)).append("\n"); + sb.append(" parentBackdropItemId: ").append(toIndentedString(parentBackdropItemId)).append("\n"); + sb.append(" parentBackdropImageTags: ").append(toIndentedString(parentBackdropImageTags)).append("\n"); + sb.append(" localTrailerCount: ").append(toIndentedString(localTrailerCount)).append("\n"); + sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); + sb.append(" recursiveItemCount: ").append(toIndentedString(recursiveItemCount)).append("\n"); + sb.append(" childCount: ").append(toIndentedString(childCount)).append("\n"); + sb.append(" seriesName: ").append(toIndentedString(seriesName)).append("\n"); + sb.append(" seriesId: ").append(toIndentedString(seriesId)).append("\n"); + sb.append(" seasonId: ").append(toIndentedString(seasonId)).append("\n"); + sb.append(" specialFeatureCount: ").append(toIndentedString(specialFeatureCount)).append("\n"); + sb.append(" displayPreferencesId: ").append(toIndentedString(displayPreferencesId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" airTime: ").append(toIndentedString(airTime)).append("\n"); + sb.append(" airDays: ").append(toIndentedString(airDays)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" primaryImageAspectRatio: ").append(toIndentedString(primaryImageAspectRatio)).append("\n"); + sb.append(" artists: ").append(toIndentedString(artists)).append("\n"); + sb.append(" artistItems: ").append(toIndentedString(artistItems)).append("\n"); + sb.append(" album: ").append(toIndentedString(album)).append("\n"); + sb.append(" collectionType: ").append(toIndentedString(collectionType)).append("\n"); + sb.append(" displayOrder: ").append(toIndentedString(displayOrder)).append("\n"); + sb.append(" albumId: ").append(toIndentedString(albumId)).append("\n"); + sb.append(" albumPrimaryImageTag: ").append(toIndentedString(albumPrimaryImageTag)).append("\n"); + sb.append(" seriesPrimaryImageTag: ").append(toIndentedString(seriesPrimaryImageTag)).append("\n"); + sb.append(" albumArtist: ").append(toIndentedString(albumArtist)).append("\n"); + sb.append(" albumArtists: ").append(toIndentedString(albumArtists)).append("\n"); + sb.append(" seasonName: ").append(toIndentedString(seasonName)).append("\n"); + sb.append(" mediaStreams: ").append(toIndentedString(mediaStreams)).append("\n"); + sb.append(" videoType: ").append(toIndentedString(videoType)).append("\n"); + sb.append(" partCount: ").append(toIndentedString(partCount)).append("\n"); + sb.append(" mediaSourceCount: ").append(toIndentedString(mediaSourceCount)).append("\n"); + sb.append(" imageTags: ").append(toIndentedString(imageTags)).append("\n"); + sb.append(" backdropImageTags: ").append(toIndentedString(backdropImageTags)).append("\n"); + sb.append(" screenshotImageTags: ").append(toIndentedString(screenshotImageTags)).append("\n"); + sb.append(" parentLogoImageTag: ").append(toIndentedString(parentLogoImageTag)).append("\n"); + sb.append(" parentArtItemId: ").append(toIndentedString(parentArtItemId)).append("\n"); + sb.append(" parentArtImageTag: ").append(toIndentedString(parentArtImageTag)).append("\n"); + sb.append(" seriesThumbImageTag: ").append(toIndentedString(seriesThumbImageTag)).append("\n"); + sb.append(" imageBlurHashes: ").append(toIndentedString(imageBlurHashes)).append("\n"); + sb.append(" seriesStudio: ").append(toIndentedString(seriesStudio)).append("\n"); + sb.append(" parentThumbItemId: ").append(toIndentedString(parentThumbItemId)).append("\n"); + sb.append(" parentThumbImageTag: ").append(toIndentedString(parentThumbImageTag)).append("\n"); + sb.append(" parentPrimaryImageItemId: ").append(toIndentedString(parentPrimaryImageItemId)).append("\n"); + sb.append(" parentPrimaryImageTag: ").append(toIndentedString(parentPrimaryImageTag)).append("\n"); + sb.append(" chapters: ").append(toIndentedString(chapters)).append("\n"); + sb.append(" locationType: ").append(toIndentedString(locationType)).append("\n"); + sb.append(" isoType: ").append(toIndentedString(isoType)).append("\n"); + sb.append(" mediaType: ").append(toIndentedString(mediaType)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" lockedFields: ").append(toIndentedString(lockedFields)).append("\n"); + sb.append(" trailerCount: ").append(toIndentedString(trailerCount)).append("\n"); + sb.append(" movieCount: ").append(toIndentedString(movieCount)).append("\n"); + sb.append(" seriesCount: ").append(toIndentedString(seriesCount)).append("\n"); + sb.append(" programCount: ").append(toIndentedString(programCount)).append("\n"); + sb.append(" episodeCount: ").append(toIndentedString(episodeCount)).append("\n"); + sb.append(" songCount: ").append(toIndentedString(songCount)).append("\n"); + sb.append(" albumCount: ").append(toIndentedString(albumCount)).append("\n"); + sb.append(" artistCount: ").append(toIndentedString(artistCount)).append("\n"); + sb.append(" musicVideoCount: ").append(toIndentedString(musicVideoCount)).append("\n"); + sb.append(" lockData: ").append(toIndentedString(lockData)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" cameraMake: ").append(toIndentedString(cameraMake)).append("\n"); + sb.append(" cameraModel: ").append(toIndentedString(cameraModel)).append("\n"); + sb.append(" software: ").append(toIndentedString(software)).append("\n"); + sb.append(" exposureTime: ").append(toIndentedString(exposureTime)).append("\n"); + sb.append(" focalLength: ").append(toIndentedString(focalLength)).append("\n"); + sb.append(" imageOrientation: ").append(toIndentedString(imageOrientation)).append("\n"); + sb.append(" aperture: ").append(toIndentedString(aperture)).append("\n"); + sb.append(" shutterSpeed: ").append(toIndentedString(shutterSpeed)).append("\n"); + sb.append(" latitude: ").append(toIndentedString(latitude)).append("\n"); + sb.append(" longitude: ").append(toIndentedString(longitude)).append("\n"); + sb.append(" altitude: ").append(toIndentedString(altitude)).append("\n"); + sb.append(" isoSpeedRating: ").append(toIndentedString(isoSpeedRating)).append("\n"); + sb.append(" seriesTimerId: ").append(toIndentedString(seriesTimerId)).append("\n"); + sb.append(" programId: ").append(toIndentedString(programId)).append("\n"); + sb.append(" channelPrimaryImageTag: ").append(toIndentedString(channelPrimaryImageTag)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" completionPercentage: ").append(toIndentedString(completionPercentage)).append("\n"); + sb.append(" isRepeat: ").append(toIndentedString(isRepeat)).append("\n"); + sb.append(" episodeTitle: ").append(toIndentedString(episodeTitle)).append("\n"); + sb.append(" channelType: ").append(toIndentedString(channelType)).append("\n"); + sb.append(" audio: ").append(toIndentedString(audio)).append("\n"); + sb.append(" isMovie: ").append(toIndentedString(isMovie)).append("\n"); + sb.append(" isSports: ").append(toIndentedString(isSports)).append("\n"); + sb.append(" isSeries: ").append(toIndentedString(isSeries)).append("\n"); + sb.append(" isLive: ").append(toIndentedString(isLive)).append("\n"); + sb.append(" isNews: ").append(toIndentedString(isNews)).append("\n"); + sb.append(" isKids: ").append(toIndentedString(isKids)).append("\n"); + sb.append(" isPremiere: ").append(toIndentedString(isPremiere)).append("\n"); + sb.append(" timerId: ").append(toIndentedString(timerId)).append("\n"); + sb.append(" currentProgram: ").append(toIndentedString(currentProgram)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `ServerId` to the URL query string + if (getServerId() != null) { + joiner.add(String.format("%sServerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerId())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Etag` to the URL query string + if (getEtag() != null) { + joiner.add(String.format("%sEtag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEtag())))); + } + + // add `SourceType` to the URL query string + if (getSourceType() != null) { + joiner.add(String.format("%sSourceType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSourceType())))); + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + // add `DateCreated` to the URL query string + if (getDateCreated() != null) { + joiner.add(String.format("%sDateCreated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateCreated())))); + } + + // add `DateLastMediaAdded` to the URL query string + if (getDateLastMediaAdded() != null) { + joiner.add(String.format("%sDateLastMediaAdded%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateLastMediaAdded())))); + } + + // add `ExtraType` to the URL query string + if (getExtraType() != null) { + joiner.add(String.format("%sExtraType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExtraType())))); + } + + // add `AirsBeforeSeasonNumber` to the URL query string + if (getAirsBeforeSeasonNumber() != null) { + joiner.add(String.format("%sAirsBeforeSeasonNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAirsBeforeSeasonNumber())))); + } + + // add `AirsAfterSeasonNumber` to the URL query string + if (getAirsAfterSeasonNumber() != null) { + joiner.add(String.format("%sAirsAfterSeasonNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAirsAfterSeasonNumber())))); + } + + // add `AirsBeforeEpisodeNumber` to the URL query string + if (getAirsBeforeEpisodeNumber() != null) { + joiner.add(String.format("%sAirsBeforeEpisodeNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAirsBeforeEpisodeNumber())))); + } + + // add `CanDelete` to the URL query string + if (getCanDelete() != null) { + joiner.add(String.format("%sCanDelete%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanDelete())))); + } + + // add `CanDownload` to the URL query string + if (getCanDownload() != null) { + joiner.add(String.format("%sCanDownload%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanDownload())))); + } + + // add `HasSubtitles` to the URL query string + if (getHasSubtitles() != null) { + joiner.add(String.format("%sHasSubtitles%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasSubtitles())))); + } + + // add `PreferredMetadataLanguage` to the URL query string + if (getPreferredMetadataLanguage() != null) { + joiner.add(String.format("%sPreferredMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreferredMetadataLanguage())))); + } + + // add `PreferredMetadataCountryCode` to the URL query string + if (getPreferredMetadataCountryCode() != null) { + joiner.add(String.format("%sPreferredMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreferredMetadataCountryCode())))); + } + + // add `SupportsSync` to the URL query string + if (getSupportsSync() != null) { + joiner.add(String.format("%sSupportsSync%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsSync())))); + } + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + // add `SortName` to the URL query string + if (getSortName() != null) { + joiner.add(String.format("%sSortName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSortName())))); + } + + // add `ForcedSortName` to the URL query string + if (getForcedSortName() != null) { + joiner.add(String.format("%sForcedSortName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getForcedSortName())))); + } + + // add `Video3DFormat` to the URL query string + if (getVideo3DFormat() != null) { + joiner.add(String.format("%sVideo3DFormat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideo3DFormat())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `ExternalUrls` to the URL query string + if (getExternalUrls() != null) { + for (int i = 0; i < getExternalUrls().size(); i++) { + if (getExternalUrls().get(i) != null) { + joiner.add(getExternalUrls().get(i).toUrlQueryString(String.format("%sExternalUrls%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `MediaSources` to the URL query string + if (getMediaSources() != null) { + for (int i = 0; i < getMediaSources().size(); i++) { + if (getMediaSources().get(i) != null) { + joiner.add(getMediaSources().get(i).toUrlQueryString(String.format("%sMediaSources%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `CriticRating` to the URL query string + if (getCriticRating() != null) { + joiner.add(String.format("%sCriticRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCriticRating())))); + } + + // add `ProductionLocations` to the URL query string + if (getProductionLocations() != null) { + for (int i = 0; i < getProductionLocations().size(); i++) { + joiner.add(String.format("%sProductionLocations%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getProductionLocations().get(i))))); + } + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `EnableMediaSourceDisplay` to the URL query string + if (getEnableMediaSourceDisplay() != null) { + joiner.add(String.format("%sEnableMediaSourceDisplay%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableMediaSourceDisplay())))); + } + + // add `OfficialRating` to the URL query string + if (getOfficialRating() != null) { + joiner.add(String.format("%sOfficialRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOfficialRating())))); + } + + // add `CustomRating` to the URL query string + if (getCustomRating() != null) { + joiner.add(String.format("%sCustomRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCustomRating())))); + } + + // add `ChannelId` to the URL query string + if (getChannelId() != null) { + joiner.add(String.format("%sChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelId())))); + } + + // add `ChannelName` to the URL query string + if (getChannelName() != null) { + joiner.add(String.format("%sChannelName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelName())))); + } + + // add `Overview` to the URL query string + if (getOverview() != null) { + joiner.add(String.format("%sOverview%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOverview())))); + } + + // add `Taglines` to the URL query string + if (getTaglines() != null) { + for (int i = 0; i < getTaglines().size(); i++) { + joiner.add(String.format("%sTaglines%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getTaglines().get(i))))); + } + } + + // add `Genres` to the URL query string + if (getGenres() != null) { + for (int i = 0; i < getGenres().size(); i++) { + joiner.add(String.format("%sGenres%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getGenres().get(i))))); + } + } + + // add `CommunityRating` to the URL query string + if (getCommunityRating() != null) { + joiner.add(String.format("%sCommunityRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCommunityRating())))); + } + + // add `CumulativeRunTimeTicks` to the URL query string + if (getCumulativeRunTimeTicks() != null) { + joiner.add(String.format("%sCumulativeRunTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCumulativeRunTimeTicks())))); + } + + // add `RunTimeTicks` to the URL query string + if (getRunTimeTicks() != null) { + joiner.add(String.format("%sRunTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRunTimeTicks())))); + } + + // add `PlayAccess` to the URL query string + if (getPlayAccess() != null) { + joiner.add(String.format("%sPlayAccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayAccess())))); + } + + // add `AspectRatio` to the URL query string + if (getAspectRatio() != null) { + joiner.add(String.format("%sAspectRatio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAspectRatio())))); + } + + // add `ProductionYear` to the URL query string + if (getProductionYear() != null) { + joiner.add(String.format("%sProductionYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProductionYear())))); + } + + // add `IsPlaceHolder` to the URL query string + if (getIsPlaceHolder() != null) { + joiner.add(String.format("%sIsPlaceHolder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPlaceHolder())))); + } + + // add `Number` to the URL query string + if (getNumber() != null) { + joiner.add(String.format("%sNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getNumber())))); + } + + // add `ChannelNumber` to the URL query string + if (getChannelNumber() != null) { + joiner.add(String.format("%sChannelNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelNumber())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `IndexNumberEnd` to the URL query string + if (getIndexNumberEnd() != null) { + joiner.add(String.format("%sIndexNumberEnd%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumberEnd())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `RemoteTrailers` to the URL query string + if (getRemoteTrailers() != null) { + for (int i = 0; i < getRemoteTrailers().size(); i++) { + if (getRemoteTrailers().get(i) != null) { + joiner.add(getRemoteTrailers().get(i).toUrlQueryString(String.format("%sRemoteTrailers%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `IsHD` to the URL query string + if (getIsHD() != null) { + joiner.add(String.format("%sIsHD%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsHD())))); + } + + // add `IsFolder` to the URL query string + if (getIsFolder() != null) { + joiner.add(String.format("%sIsFolder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsFolder())))); + } + + // add `ParentId` to the URL query string + if (getParentId() != null) { + joiner.add(String.format("%sParentId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentId())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `People` to the URL query string + if (getPeople() != null) { + for (int i = 0; i < getPeople().size(); i++) { + if (getPeople().get(i) != null) { + joiner.add(getPeople().get(i).toUrlQueryString(String.format("%sPeople%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Studios` to the URL query string + if (getStudios() != null) { + for (int i = 0; i < getStudios().size(); i++) { + if (getStudios().get(i) != null) { + joiner.add(getStudios().get(i).toUrlQueryString(String.format("%sStudios%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `GenreItems` to the URL query string + if (getGenreItems() != null) { + for (int i = 0; i < getGenreItems().size(); i++) { + if (getGenreItems().get(i) != null) { + joiner.add(getGenreItems().get(i).toUrlQueryString(String.format("%sGenreItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ParentLogoItemId` to the URL query string + if (getParentLogoItemId() != null) { + joiner.add(String.format("%sParentLogoItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentLogoItemId())))); + } + + // add `ParentBackdropItemId` to the URL query string + if (getParentBackdropItemId() != null) { + joiner.add(String.format("%sParentBackdropItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentBackdropItemId())))); + } + + // add `ParentBackdropImageTags` to the URL query string + if (getParentBackdropImageTags() != null) { + for (int i = 0; i < getParentBackdropImageTags().size(); i++) { + joiner.add(String.format("%sParentBackdropImageTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getParentBackdropImageTags().get(i))))); + } + } + + // add `LocalTrailerCount` to the URL query string + if (getLocalTrailerCount() != null) { + joiner.add(String.format("%sLocalTrailerCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocalTrailerCount())))); + } + + // add `UserData` to the URL query string + if (getUserData() != null) { + joiner.add(getUserData().toUrlQueryString(prefix + "UserData" + suffix)); + } + + // add `RecursiveItemCount` to the URL query string + if (getRecursiveItemCount() != null) { + joiner.add(String.format("%sRecursiveItemCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRecursiveItemCount())))); + } + + // add `ChildCount` to the URL query string + if (getChildCount() != null) { + joiner.add(String.format("%sChildCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChildCount())))); + } + + // add `SeriesName` to the URL query string + if (getSeriesName() != null) { + joiner.add(String.format("%sSeriesName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesName())))); + } + + // add `SeriesId` to the URL query string + if (getSeriesId() != null) { + joiner.add(String.format("%sSeriesId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesId())))); + } + + // add `SeasonId` to the URL query string + if (getSeasonId() != null) { + joiner.add(String.format("%sSeasonId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeasonId())))); + } + + // add `SpecialFeatureCount` to the URL query string + if (getSpecialFeatureCount() != null) { + joiner.add(String.format("%sSpecialFeatureCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSpecialFeatureCount())))); + } + + // add `DisplayPreferencesId` to the URL query string + if (getDisplayPreferencesId() != null) { + joiner.add(String.format("%sDisplayPreferencesId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplayPreferencesId())))); + } + + // add `Status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sStatus%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `AirTime` to the URL query string + if (getAirTime() != null) { + joiner.add(String.format("%sAirTime%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAirTime())))); + } + + // add `AirDays` to the URL query string + if (getAirDays() != null) { + for (int i = 0; i < getAirDays().size(); i++) { + if (getAirDays().get(i) != null) { + joiner.add(String.format("%sAirDays%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getAirDays().get(i))))); + } + } + } + + // add `Tags` to the URL query string + if (getTags() != null) { + for (int i = 0; i < getTags().size(); i++) { + joiner.add(String.format("%sTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getTags().get(i))))); + } + } + + // add `PrimaryImageAspectRatio` to the URL query string + if (getPrimaryImageAspectRatio() != null) { + joiner.add(String.format("%sPrimaryImageAspectRatio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageAspectRatio())))); + } + + // add `Artists` to the URL query string + if (getArtists() != null) { + for (int i = 0; i < getArtists().size(); i++) { + joiner.add(String.format("%sArtists%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArtists().get(i))))); + } + } + + // add `ArtistItems` to the URL query string + if (getArtistItems() != null) { + for (int i = 0; i < getArtistItems().size(); i++) { + if (getArtistItems().get(i) != null) { + joiner.add(getArtistItems().get(i).toUrlQueryString(String.format("%sArtistItems%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Album` to the URL query string + if (getAlbum() != null) { + joiner.add(String.format("%sAlbum%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbum())))); + } + + // add `CollectionType` to the URL query string + if (getCollectionType() != null) { + joiner.add(String.format("%sCollectionType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCollectionType())))); + } + + // add `DisplayOrder` to the URL query string + if (getDisplayOrder() != null) { + joiner.add(String.format("%sDisplayOrder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplayOrder())))); + } + + // add `AlbumId` to the URL query string + if (getAlbumId() != null) { + joiner.add(String.format("%sAlbumId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbumId())))); + } + + // add `AlbumPrimaryImageTag` to the URL query string + if (getAlbumPrimaryImageTag() != null) { + joiner.add(String.format("%sAlbumPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbumPrimaryImageTag())))); + } + + // add `SeriesPrimaryImageTag` to the URL query string + if (getSeriesPrimaryImageTag() != null) { + joiner.add(String.format("%sSeriesPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesPrimaryImageTag())))); + } + + // add `AlbumArtist` to the URL query string + if (getAlbumArtist() != null) { + joiner.add(String.format("%sAlbumArtist%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbumArtist())))); + } + + // add `AlbumArtists` to the URL query string + if (getAlbumArtists() != null) { + for (int i = 0; i < getAlbumArtists().size(); i++) { + if (getAlbumArtists().get(i) != null) { + joiner.add(getAlbumArtists().get(i).toUrlQueryString(String.format("%sAlbumArtists%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `SeasonName` to the URL query string + if (getSeasonName() != null) { + joiner.add(String.format("%sSeasonName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeasonName())))); + } + + // add `MediaStreams` to the URL query string + if (getMediaStreams() != null) { + for (int i = 0; i < getMediaStreams().size(); i++) { + if (getMediaStreams().get(i) != null) { + joiner.add(getMediaStreams().get(i).toUrlQueryString(String.format("%sMediaStreams%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `VideoType` to the URL query string + if (getVideoType() != null) { + joiner.add(String.format("%sVideoType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoType())))); + } + + // add `PartCount` to the URL query string + if (getPartCount() != null) { + joiner.add(String.format("%sPartCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPartCount())))); + } + + // add `MediaSourceCount` to the URL query string + if (getMediaSourceCount() != null) { + joiner.add(String.format("%sMediaSourceCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaSourceCount())))); + } + + // add `ImageTags` to the URL query string + if (getImageTags() != null) { + for (String _key : getImageTags().keySet()) { + joiner.add(String.format("%sImageTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getImageTags().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getImageTags().get(_key))))); + } + } + + // add `BackdropImageTags` to the URL query string + if (getBackdropImageTags() != null) { + for (int i = 0; i < getBackdropImageTags().size(); i++) { + joiner.add(String.format("%sBackdropImageTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getBackdropImageTags().get(i))))); + } + } + + // add `ScreenshotImageTags` to the URL query string + if (getScreenshotImageTags() != null) { + for (int i = 0; i < getScreenshotImageTags().size(); i++) { + joiner.add(String.format("%sScreenshotImageTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getScreenshotImageTags().get(i))))); + } + } + + // add `ParentLogoImageTag` to the URL query string + if (getParentLogoImageTag() != null) { + joiner.add(String.format("%sParentLogoImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentLogoImageTag())))); + } + + // add `ParentArtItemId` to the URL query string + if (getParentArtItemId() != null) { + joiner.add(String.format("%sParentArtItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentArtItemId())))); + } + + // add `ParentArtImageTag` to the URL query string + if (getParentArtImageTag() != null) { + joiner.add(String.format("%sParentArtImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentArtImageTag())))); + } + + // add `SeriesThumbImageTag` to the URL query string + if (getSeriesThumbImageTag() != null) { + joiner.add(String.format("%sSeriesThumbImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesThumbImageTag())))); + } + + // add `ImageBlurHashes` to the URL query string + if (getImageBlurHashes() != null) { + joiner.add(getImageBlurHashes().toUrlQueryString(prefix + "ImageBlurHashes" + suffix)); + } + + // add `SeriesStudio` to the URL query string + if (getSeriesStudio() != null) { + joiner.add(String.format("%sSeriesStudio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesStudio())))); + } + + // add `ParentThumbItemId` to the URL query string + if (getParentThumbItemId() != null) { + joiner.add(String.format("%sParentThumbItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentThumbItemId())))); + } + + // add `ParentThumbImageTag` to the URL query string + if (getParentThumbImageTag() != null) { + joiner.add(String.format("%sParentThumbImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentThumbImageTag())))); + } + + // add `ParentPrimaryImageItemId` to the URL query string + if (getParentPrimaryImageItemId() != null) { + joiner.add(String.format("%sParentPrimaryImageItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentPrimaryImageItemId())))); + } + + // add `ParentPrimaryImageTag` to the URL query string + if (getParentPrimaryImageTag() != null) { + joiner.add(String.format("%sParentPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentPrimaryImageTag())))); + } + + // add `Chapters` to the URL query string + if (getChapters() != null) { + for (int i = 0; i < getChapters().size(); i++) { + if (getChapters().get(i) != null) { + joiner.add(getChapters().get(i).toUrlQueryString(String.format("%sChapters%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `LocationType` to the URL query string + if (getLocationType() != null) { + joiner.add(String.format("%sLocationType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocationType())))); + } + + // add `IsoType` to the URL query string + if (getIsoType() != null) { + joiner.add(String.format("%sIsoType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsoType())))); + } + + // add `MediaType` to the URL query string + if (getMediaType() != null) { + joiner.add(String.format("%sMediaType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaType())))); + } + + // add `EndDate` to the URL query string + if (getEndDate() != null) { + joiner.add(String.format("%sEndDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndDate())))); + } + + // add `LockedFields` to the URL query string + if (getLockedFields() != null) { + for (int i = 0; i < getLockedFields().size(); i++) { + if (getLockedFields().get(i) != null) { + joiner.add(String.format("%sLockedFields%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLockedFields().get(i))))); + } + } + } + + // add `TrailerCount` to the URL query string + if (getTrailerCount() != null) { + joiner.add(String.format("%sTrailerCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTrailerCount())))); + } + + // add `MovieCount` to the URL query string + if (getMovieCount() != null) { + joiner.add(String.format("%sMovieCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMovieCount())))); + } + + // add `SeriesCount` to the URL query string + if (getSeriesCount() != null) { + joiner.add(String.format("%sSeriesCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesCount())))); + } + + // add `ProgramCount` to the URL query string + if (getProgramCount() != null) { + joiner.add(String.format("%sProgramCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProgramCount())))); + } + + // add `EpisodeCount` to the URL query string + if (getEpisodeCount() != null) { + joiner.add(String.format("%sEpisodeCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEpisodeCount())))); + } + + // add `SongCount` to the URL query string + if (getSongCount() != null) { + joiner.add(String.format("%sSongCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSongCount())))); + } + + // add `AlbumCount` to the URL query string + if (getAlbumCount() != null) { + joiner.add(String.format("%sAlbumCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbumCount())))); + } + + // add `ArtistCount` to the URL query string + if (getArtistCount() != null) { + joiner.add(String.format("%sArtistCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getArtistCount())))); + } + + // add `MusicVideoCount` to the URL query string + if (getMusicVideoCount() != null) { + joiner.add(String.format("%sMusicVideoCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMusicVideoCount())))); + } + + // add `LockData` to the URL query string + if (getLockData() != null) { + joiner.add(String.format("%sLockData%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLockData())))); + } + + // add `Width` to the URL query string + if (getWidth() != null) { + joiner.add(String.format("%sWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWidth())))); + } + + // add `Height` to the URL query string + if (getHeight() != null) { + joiner.add(String.format("%sHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHeight())))); + } + + // add `CameraMake` to the URL query string + if (getCameraMake() != null) { + joiner.add(String.format("%sCameraMake%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCameraMake())))); + } + + // add `CameraModel` to the URL query string + if (getCameraModel() != null) { + joiner.add(String.format("%sCameraModel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCameraModel())))); + } + + // add `Software` to the URL query string + if (getSoftware() != null) { + joiner.add(String.format("%sSoftware%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSoftware())))); + } + + // add `ExposureTime` to the URL query string + if (getExposureTime() != null) { + joiner.add(String.format("%sExposureTime%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExposureTime())))); + } + + // add `FocalLength` to the URL query string + if (getFocalLength() != null) { + joiner.add(String.format("%sFocalLength%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFocalLength())))); + } + + // add `ImageOrientation` to the URL query string + if (getImageOrientation() != null) { + joiner.add(String.format("%sImageOrientation%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageOrientation())))); + } + + // add `Aperture` to the URL query string + if (getAperture() != null) { + joiner.add(String.format("%sAperture%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAperture())))); + } + + // add `ShutterSpeed` to the URL query string + if (getShutterSpeed() != null) { + joiner.add(String.format("%sShutterSpeed%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getShutterSpeed())))); + } + + // add `Latitude` to the URL query string + if (getLatitude() != null) { + joiner.add(String.format("%sLatitude%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLatitude())))); + } + + // add `Longitude` to the URL query string + if (getLongitude() != null) { + joiner.add(String.format("%sLongitude%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLongitude())))); + } + + // add `Altitude` to the URL query string + if (getAltitude() != null) { + joiner.add(String.format("%sAltitude%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAltitude())))); + } + + // add `IsoSpeedRating` to the URL query string + if (getIsoSpeedRating() != null) { + joiner.add(String.format("%sIsoSpeedRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsoSpeedRating())))); + } + + // add `SeriesTimerId` to the URL query string + if (getSeriesTimerId() != null) { + joiner.add(String.format("%sSeriesTimerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesTimerId())))); + } + + // add `ProgramId` to the URL query string + if (getProgramId() != null) { + joiner.add(String.format("%sProgramId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProgramId())))); + } + + // add `ChannelPrimaryImageTag` to the URL query string + if (getChannelPrimaryImageTag() != null) { + joiner.add(String.format("%sChannelPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelPrimaryImageTag())))); + } + + // add `StartDate` to the URL query string + if (getStartDate() != null) { + joiner.add(String.format("%sStartDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartDate())))); + } + + // add `CompletionPercentage` to the URL query string + if (getCompletionPercentage() != null) { + joiner.add(String.format("%sCompletionPercentage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCompletionPercentage())))); + } + + // add `IsRepeat` to the URL query string + if (getIsRepeat() != null) { + joiner.add(String.format("%sIsRepeat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsRepeat())))); + } + + // add `EpisodeTitle` to the URL query string + if (getEpisodeTitle() != null) { + joiner.add(String.format("%sEpisodeTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEpisodeTitle())))); + } + + // add `ChannelType` to the URL query string + if (getChannelType() != null) { + joiner.add(String.format("%sChannelType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelType())))); + } + + // add `Audio` to the URL query string + if (getAudio() != null) { + joiner.add(String.format("%sAudio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudio())))); + } + + // add `IsMovie` to the URL query string + if (getIsMovie() != null) { + joiner.add(String.format("%sIsMovie%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsMovie())))); + } + + // add `IsSports` to the URL query string + if (getIsSports() != null) { + joiner.add(String.format("%sIsSports%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsSports())))); + } + + // add `IsSeries` to the URL query string + if (getIsSeries() != null) { + joiner.add(String.format("%sIsSeries%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsSeries())))); + } + + // add `IsLive` to the URL query string + if (getIsLive() != null) { + joiner.add(String.format("%sIsLive%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsLive())))); + } + + // add `IsNews` to the URL query string + if (getIsNews() != null) { + joiner.add(String.format("%sIsNews%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsNews())))); + } + + // add `IsKids` to the URL query string + if (getIsKids() != null) { + joiner.add(String.format("%sIsKids%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsKids())))); + } + + // add `IsPremiere` to the URL query string + if (getIsPremiere() != null) { + joiner.add(String.format("%sIsPremiere%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPremiere())))); + } + + // add `TimerId` to the URL query string + if (getTimerId() != null) { + joiner.add(String.format("%sTimerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTimerId())))); + } + + // add `CurrentProgram` to the URL query string + if (getCurrentProgram() != null) { + joiner.add(getCurrentProgram().toUrlQueryString(prefix + "CurrentProgram" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private BaseItemDto instance; + + public Builder() { + this(new BaseItemDto()); + } + + protected Builder(BaseItemDto instance) { + this.instance = instance; + } + + public BaseItemDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public BaseItemDto.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public BaseItemDto.Builder serverId(String serverId) { + this.instance.serverId = serverId; + return this; + } + + public BaseItemDto.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public BaseItemDto.Builder etag(String etag) { + this.instance.etag = etag; + return this; + } + + public BaseItemDto.Builder sourceType(String sourceType) { + this.instance.sourceType = sourceType; + return this; + } + + public BaseItemDto.Builder playlistItemId(String playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + public BaseItemDto.Builder dateCreated(OffsetDateTime dateCreated) { + this.instance.dateCreated = dateCreated; + return this; + } + + public BaseItemDto.Builder dateLastMediaAdded(OffsetDateTime dateLastMediaAdded) { + this.instance.dateLastMediaAdded = dateLastMediaAdded; + return this; + } + + public BaseItemDto.Builder extraType(String extraType) { + this.instance.extraType = extraType; + return this; + } + + public BaseItemDto.Builder airsBeforeSeasonNumber(Integer airsBeforeSeasonNumber) { + this.instance.airsBeforeSeasonNumber = airsBeforeSeasonNumber; + return this; + } + + public BaseItemDto.Builder airsAfterSeasonNumber(Integer airsAfterSeasonNumber) { + this.instance.airsAfterSeasonNumber = airsAfterSeasonNumber; + return this; + } + + public BaseItemDto.Builder airsBeforeEpisodeNumber(Integer airsBeforeEpisodeNumber) { + this.instance.airsBeforeEpisodeNumber = airsBeforeEpisodeNumber; + return this; + } + + public BaseItemDto.Builder canDelete(Boolean canDelete) { + this.instance.canDelete = canDelete; + return this; + } + + public BaseItemDto.Builder canDownload(Boolean canDownload) { + this.instance.canDownload = canDownload; + return this; + } + + public BaseItemDto.Builder hasSubtitles(Boolean hasSubtitles) { + this.instance.hasSubtitles = hasSubtitles; + return this; + } + + public BaseItemDto.Builder preferredMetadataLanguage(String preferredMetadataLanguage) { + this.instance.preferredMetadataLanguage = preferredMetadataLanguage; + return this; + } + + public BaseItemDto.Builder preferredMetadataCountryCode(String preferredMetadataCountryCode) { + this.instance.preferredMetadataCountryCode = preferredMetadataCountryCode; + return this; + } + + public BaseItemDto.Builder supportsSync(Boolean supportsSync) { + this.instance.supportsSync = supportsSync; + return this; + } + + public BaseItemDto.Builder container(String container) { + this.instance.container = container; + return this; + } + + public BaseItemDto.Builder sortName(String sortName) { + this.instance.sortName = sortName; + return this; + } + + public BaseItemDto.Builder forcedSortName(String forcedSortName) { + this.instance.forcedSortName = forcedSortName; + return this; + } + + public BaseItemDto.Builder video3DFormat(Video3DFormat video3DFormat) { + this.instance.video3DFormat = video3DFormat; + return this; + } + + public BaseItemDto.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public BaseItemDto.Builder externalUrls(List externalUrls) { + this.instance.externalUrls = externalUrls; + return this; + } + + public BaseItemDto.Builder mediaSources(List mediaSources) { + this.instance.mediaSources = mediaSources; + return this; + } + + public BaseItemDto.Builder criticRating(Float criticRating) { + this.instance.criticRating = criticRating; + return this; + } + + public BaseItemDto.Builder productionLocations(List productionLocations) { + this.instance.productionLocations = productionLocations; + return this; + } + + public BaseItemDto.Builder path(String path) { + this.instance.path = path; + return this; + } + + public BaseItemDto.Builder enableMediaSourceDisplay(Boolean enableMediaSourceDisplay) { + this.instance.enableMediaSourceDisplay = enableMediaSourceDisplay; + return this; + } + + public BaseItemDto.Builder officialRating(String officialRating) { + this.instance.officialRating = officialRating; + return this; + } + + public BaseItemDto.Builder customRating(String customRating) { + this.instance.customRating = customRating; + return this; + } + + public BaseItemDto.Builder channelId(UUID channelId) { + this.instance.channelId = channelId; + return this; + } + + public BaseItemDto.Builder channelName(String channelName) { + this.instance.channelName = channelName; + return this; + } + + public BaseItemDto.Builder overview(String overview) { + this.instance.overview = overview; + return this; + } + + public BaseItemDto.Builder taglines(List taglines) { + this.instance.taglines = taglines; + return this; + } + + public BaseItemDto.Builder genres(List genres) { + this.instance.genres = genres; + return this; + } + + public BaseItemDto.Builder communityRating(Float communityRating) { + this.instance.communityRating = communityRating; + return this; + } + + public BaseItemDto.Builder cumulativeRunTimeTicks(Long cumulativeRunTimeTicks) { + this.instance.cumulativeRunTimeTicks = cumulativeRunTimeTicks; + return this; + } + + public BaseItemDto.Builder runTimeTicks(Long runTimeTicks) { + this.instance.runTimeTicks = runTimeTicks; + return this; + } + + public BaseItemDto.Builder playAccess(PlayAccess playAccess) { + this.instance.playAccess = playAccess; + return this; + } + + public BaseItemDto.Builder aspectRatio(String aspectRatio) { + this.instance.aspectRatio = aspectRatio; + return this; + } + + public BaseItemDto.Builder productionYear(Integer productionYear) { + this.instance.productionYear = productionYear; + return this; + } + + public BaseItemDto.Builder isPlaceHolder(Boolean isPlaceHolder) { + this.instance.isPlaceHolder = isPlaceHolder; + return this; + } + + public BaseItemDto.Builder number(String number) { + this.instance.number = number; + return this; + } + + public BaseItemDto.Builder channelNumber(String channelNumber) { + this.instance.channelNumber = channelNumber; + return this; + } + + public BaseItemDto.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public BaseItemDto.Builder indexNumberEnd(Integer indexNumberEnd) { + this.instance.indexNumberEnd = indexNumberEnd; + return this; + } + + public BaseItemDto.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public BaseItemDto.Builder remoteTrailers(List remoteTrailers) { + this.instance.remoteTrailers = remoteTrailers; + return this; + } + + public BaseItemDto.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public BaseItemDto.Builder isHD(Boolean isHD) { + this.instance.isHD = isHD; + return this; + } + + public BaseItemDto.Builder isFolder(Boolean isFolder) { + this.instance.isFolder = isFolder; + return this; + } + + public BaseItemDto.Builder parentId(UUID parentId) { + this.instance.parentId = parentId; + return this; + } + + public BaseItemDto.Builder type(BaseItemKind type) { + this.instance.type = type; + return this; + } + + public BaseItemDto.Builder people(List people) { + this.instance.people = people; + return this; + } + + public BaseItemDto.Builder studios(List studios) { + this.instance.studios = studios; + return this; + } + + public BaseItemDto.Builder genreItems(List genreItems) { + this.instance.genreItems = genreItems; + return this; + } + + public BaseItemDto.Builder parentLogoItemId(UUID parentLogoItemId) { + this.instance.parentLogoItemId = parentLogoItemId; + return this; + } + + public BaseItemDto.Builder parentBackdropItemId(UUID parentBackdropItemId) { + this.instance.parentBackdropItemId = parentBackdropItemId; + return this; + } + + public BaseItemDto.Builder parentBackdropImageTags(List parentBackdropImageTags) { + this.instance.parentBackdropImageTags = parentBackdropImageTags; + return this; + } + + public BaseItemDto.Builder localTrailerCount(Integer localTrailerCount) { + this.instance.localTrailerCount = localTrailerCount; + return this; + } + + public BaseItemDto.Builder userData(UserItemDataDto userData) { + this.instance.userData = userData; + return this; + } + + public BaseItemDto.Builder recursiveItemCount(Integer recursiveItemCount) { + this.instance.recursiveItemCount = recursiveItemCount; + return this; + } + + public BaseItemDto.Builder childCount(Integer childCount) { + this.instance.childCount = childCount; + return this; + } + + public BaseItemDto.Builder seriesName(String seriesName) { + this.instance.seriesName = seriesName; + return this; + } + + public BaseItemDto.Builder seriesId(UUID seriesId) { + this.instance.seriesId = seriesId; + return this; + } + + public BaseItemDto.Builder seasonId(UUID seasonId) { + this.instance.seasonId = seasonId; + return this; + } + + public BaseItemDto.Builder specialFeatureCount(Integer specialFeatureCount) { + this.instance.specialFeatureCount = specialFeatureCount; + return this; + } + + public BaseItemDto.Builder displayPreferencesId(String displayPreferencesId) { + this.instance.displayPreferencesId = displayPreferencesId; + return this; + } + + public BaseItemDto.Builder status(String status) { + this.instance.status = status; + return this; + } + + public BaseItemDto.Builder airTime(String airTime) { + this.instance.airTime = airTime; + return this; + } + + public BaseItemDto.Builder airDays(List airDays) { + this.instance.airDays = airDays; + return this; + } + + public BaseItemDto.Builder tags(List tags) { + this.instance.tags = tags; + return this; + } + + public BaseItemDto.Builder primaryImageAspectRatio(Double primaryImageAspectRatio) { + this.instance.primaryImageAspectRatio = primaryImageAspectRatio; + return this; + } + + public BaseItemDto.Builder artists(List artists) { + this.instance.artists = artists; + return this; + } + + public BaseItemDto.Builder artistItems(List artistItems) { + this.instance.artistItems = artistItems; + return this; + } + + public BaseItemDto.Builder album(String album) { + this.instance.album = album; + return this; + } + + public BaseItemDto.Builder collectionType(String collectionType) { + this.instance.collectionType = collectionType; + return this; + } + + public BaseItemDto.Builder displayOrder(String displayOrder) { + this.instance.displayOrder = displayOrder; + return this; + } + + public BaseItemDto.Builder albumId(UUID albumId) { + this.instance.albumId = albumId; + return this; + } + + public BaseItemDto.Builder albumPrimaryImageTag(String albumPrimaryImageTag) { + this.instance.albumPrimaryImageTag = albumPrimaryImageTag; + return this; + } + + public BaseItemDto.Builder seriesPrimaryImageTag(String seriesPrimaryImageTag) { + this.instance.seriesPrimaryImageTag = seriesPrimaryImageTag; + return this; + } + + public BaseItemDto.Builder albumArtist(String albumArtist) { + this.instance.albumArtist = albumArtist; + return this; + } + + public BaseItemDto.Builder albumArtists(List albumArtists) { + this.instance.albumArtists = albumArtists; + return this; + } + + public BaseItemDto.Builder seasonName(String seasonName) { + this.instance.seasonName = seasonName; + return this; + } + + public BaseItemDto.Builder mediaStreams(List mediaStreams) { + this.instance.mediaStreams = mediaStreams; + return this; + } + + public BaseItemDto.Builder videoType(VideoType videoType) { + this.instance.videoType = videoType; + return this; + } + + public BaseItemDto.Builder partCount(Integer partCount) { + this.instance.partCount = partCount; + return this; + } + + public BaseItemDto.Builder mediaSourceCount(Integer mediaSourceCount) { + this.instance.mediaSourceCount = mediaSourceCount; + return this; + } + + public BaseItemDto.Builder imageTags(Map imageTags) { + this.instance.imageTags = imageTags; + return this; + } + + public BaseItemDto.Builder backdropImageTags(List backdropImageTags) { + this.instance.backdropImageTags = backdropImageTags; + return this; + } + + public BaseItemDto.Builder screenshotImageTags(List screenshotImageTags) { + this.instance.screenshotImageTags = screenshotImageTags; + return this; + } + + public BaseItemDto.Builder parentLogoImageTag(String parentLogoImageTag) { + this.instance.parentLogoImageTag = parentLogoImageTag; + return this; + } + + public BaseItemDto.Builder parentArtItemId(UUID parentArtItemId) { + this.instance.parentArtItemId = parentArtItemId; + return this; + } + + public BaseItemDto.Builder parentArtImageTag(String parentArtImageTag) { + this.instance.parentArtImageTag = parentArtImageTag; + return this; + } + + public BaseItemDto.Builder seriesThumbImageTag(String seriesThumbImageTag) { + this.instance.seriesThumbImageTag = seriesThumbImageTag; + return this; + } + + public BaseItemDto.Builder imageBlurHashes(BaseItemDtoImageBlurHashes imageBlurHashes) { + this.instance.imageBlurHashes = imageBlurHashes; + return this; + } + + public BaseItemDto.Builder seriesStudio(String seriesStudio) { + this.instance.seriesStudio = seriesStudio; + return this; + } + + public BaseItemDto.Builder parentThumbItemId(UUID parentThumbItemId) { + this.instance.parentThumbItemId = parentThumbItemId; + return this; + } + + public BaseItemDto.Builder parentThumbImageTag(String parentThumbImageTag) { + this.instance.parentThumbImageTag = parentThumbImageTag; + return this; + } + + public BaseItemDto.Builder parentPrimaryImageItemId(String parentPrimaryImageItemId) { + this.instance.parentPrimaryImageItemId = parentPrimaryImageItemId; + return this; + } + + public BaseItemDto.Builder parentPrimaryImageTag(String parentPrimaryImageTag) { + this.instance.parentPrimaryImageTag = parentPrimaryImageTag; + return this; + } + + public BaseItemDto.Builder chapters(List chapters) { + this.instance.chapters = chapters; + return this; + } + + public BaseItemDto.Builder locationType(LocationType locationType) { + this.instance.locationType = locationType; + return this; + } + + public BaseItemDto.Builder isoType(IsoType isoType) { + this.instance.isoType = isoType; + return this; + } + + public BaseItemDto.Builder mediaType(String mediaType) { + this.instance.mediaType = mediaType; + return this; + } + + public BaseItemDto.Builder endDate(OffsetDateTime endDate) { + this.instance.endDate = endDate; + return this; + } + + public BaseItemDto.Builder lockedFields(List lockedFields) { + this.instance.lockedFields = lockedFields; + return this; + } + + public BaseItemDto.Builder trailerCount(Integer trailerCount) { + this.instance.trailerCount = trailerCount; + return this; + } + + public BaseItemDto.Builder movieCount(Integer movieCount) { + this.instance.movieCount = movieCount; + return this; + } + + public BaseItemDto.Builder seriesCount(Integer seriesCount) { + this.instance.seriesCount = seriesCount; + return this; + } + + public BaseItemDto.Builder programCount(Integer programCount) { + this.instance.programCount = programCount; + return this; + } + + public BaseItemDto.Builder episodeCount(Integer episodeCount) { + this.instance.episodeCount = episodeCount; + return this; + } + + public BaseItemDto.Builder songCount(Integer songCount) { + this.instance.songCount = songCount; + return this; + } + + public BaseItemDto.Builder albumCount(Integer albumCount) { + this.instance.albumCount = albumCount; + return this; + } + + public BaseItemDto.Builder artistCount(Integer artistCount) { + this.instance.artistCount = artistCount; + return this; + } + + public BaseItemDto.Builder musicVideoCount(Integer musicVideoCount) { + this.instance.musicVideoCount = musicVideoCount; + return this; + } + + public BaseItemDto.Builder lockData(Boolean lockData) { + this.instance.lockData = lockData; + return this; + } + + public BaseItemDto.Builder width(Integer width) { + this.instance.width = width; + return this; + } + + public BaseItemDto.Builder height(Integer height) { + this.instance.height = height; + return this; + } + + public BaseItemDto.Builder cameraMake(String cameraMake) { + this.instance.cameraMake = cameraMake; + return this; + } + + public BaseItemDto.Builder cameraModel(String cameraModel) { + this.instance.cameraModel = cameraModel; + return this; + } + + public BaseItemDto.Builder software(String software) { + this.instance.software = software; + return this; + } + + public BaseItemDto.Builder exposureTime(Double exposureTime) { + this.instance.exposureTime = exposureTime; + return this; + } + + public BaseItemDto.Builder focalLength(Double focalLength) { + this.instance.focalLength = focalLength; + return this; + } + + public BaseItemDto.Builder imageOrientation(ImageOrientation imageOrientation) { + this.instance.imageOrientation = imageOrientation; + return this; + } + + public BaseItemDto.Builder aperture(Double aperture) { + this.instance.aperture = aperture; + return this; + } + + public BaseItemDto.Builder shutterSpeed(Double shutterSpeed) { + this.instance.shutterSpeed = shutterSpeed; + return this; + } + + public BaseItemDto.Builder latitude(Double latitude) { + this.instance.latitude = latitude; + return this; + } + + public BaseItemDto.Builder longitude(Double longitude) { + this.instance.longitude = longitude; + return this; + } + + public BaseItemDto.Builder altitude(Double altitude) { + this.instance.altitude = altitude; + return this; + } + + public BaseItemDto.Builder isoSpeedRating(Integer isoSpeedRating) { + this.instance.isoSpeedRating = isoSpeedRating; + return this; + } + + public BaseItemDto.Builder seriesTimerId(String seriesTimerId) { + this.instance.seriesTimerId = seriesTimerId; + return this; + } + + public BaseItemDto.Builder programId(String programId) { + this.instance.programId = programId; + return this; + } + + public BaseItemDto.Builder channelPrimaryImageTag(String channelPrimaryImageTag) { + this.instance.channelPrimaryImageTag = channelPrimaryImageTag; + return this; + } + + public BaseItemDto.Builder startDate(OffsetDateTime startDate) { + this.instance.startDate = startDate; + return this; + } + + public BaseItemDto.Builder completionPercentage(Double completionPercentage) { + this.instance.completionPercentage = completionPercentage; + return this; + } + + public BaseItemDto.Builder isRepeat(Boolean isRepeat) { + this.instance.isRepeat = isRepeat; + return this; + } + + public BaseItemDto.Builder episodeTitle(String episodeTitle) { + this.instance.episodeTitle = episodeTitle; + return this; + } + + public BaseItemDto.Builder channelType(ChannelType channelType) { + this.instance.channelType = channelType; + return this; + } + + public BaseItemDto.Builder audio(ProgramAudio audio) { + this.instance.audio = audio; + return this; + } + + public BaseItemDto.Builder isMovie(Boolean isMovie) { + this.instance.isMovie = isMovie; + return this; + } + + public BaseItemDto.Builder isSports(Boolean isSports) { + this.instance.isSports = isSports; + return this; + } + + public BaseItemDto.Builder isSeries(Boolean isSeries) { + this.instance.isSeries = isSeries; + return this; + } + + public BaseItemDto.Builder isLive(Boolean isLive) { + this.instance.isLive = isLive; + return this; + } + + public BaseItemDto.Builder isNews(Boolean isNews) { + this.instance.isNews = isNews; + return this; + } + + public BaseItemDto.Builder isKids(Boolean isKids) { + this.instance.isKids = isKids; + return this; + } + + public BaseItemDto.Builder isPremiere(Boolean isPremiere) { + this.instance.isPremiere = isPremiere; + return this; + } + + public BaseItemDto.Builder timerId(String timerId) { + this.instance.timerId = timerId; + return this; + } + + public BaseItemDto.Builder currentProgram(BaseItemDto currentProgram) { + this.instance.currentProgram = currentProgram; + return this; + } + + /** + * returns a built BaseItemDto instance. + * + * The builder is not reusable. + */ + public BaseItemDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BaseItemDto.Builder builder() { + return new BaseItemDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BaseItemDto.Builder toBuilder() { + return new BaseItemDto.Builder().name(getName()).originalTitle(getOriginalTitle()).serverId(getServerId()) + .id(getId()).etag(getEtag()).sourceType(getSourceType()).playlistItemId(getPlaylistItemId()) + .dateCreated(getDateCreated()).dateLastMediaAdded(getDateLastMediaAdded()).extraType(getExtraType()) + .airsBeforeSeasonNumber(getAirsBeforeSeasonNumber()).airsAfterSeasonNumber(getAirsAfterSeasonNumber()) + .airsBeforeEpisodeNumber(getAirsBeforeEpisodeNumber()).canDelete(getCanDelete()) + .canDownload(getCanDownload()).hasSubtitles(getHasSubtitles()) + .preferredMetadataLanguage(getPreferredMetadataLanguage()) + .preferredMetadataCountryCode(getPreferredMetadataCountryCode()).supportsSync(getSupportsSync()) + .container(getContainer()).sortName(getSortName()).forcedSortName(getForcedSortName()) + .video3DFormat(getVideo3DFormat()).premiereDate(getPremiereDate()).externalUrls(getExternalUrls()) + .mediaSources(getMediaSources()).criticRating(getCriticRating()) + .productionLocations(getProductionLocations()).path(getPath()) + .enableMediaSourceDisplay(getEnableMediaSourceDisplay()).officialRating(getOfficialRating()) + .customRating(getCustomRating()).channelId(getChannelId()).channelName(getChannelName()) + .overview(getOverview()).taglines(getTaglines()).genres(getGenres()) + .communityRating(getCommunityRating()).cumulativeRunTimeTicks(getCumulativeRunTimeTicks()) + .runTimeTicks(getRunTimeTicks()).playAccess(getPlayAccess()).aspectRatio(getAspectRatio()) + .productionYear(getProductionYear()).isPlaceHolder(getIsPlaceHolder()).number(getNumber()) + .channelNumber(getChannelNumber()).indexNumber(getIndexNumber()).indexNumberEnd(getIndexNumberEnd()) + .parentIndexNumber(getParentIndexNumber()).remoteTrailers(getRemoteTrailers()) + .providerIds(getProviderIds()).isHD(getIsHD()).isFolder(getIsFolder()).parentId(getParentId()) + .type(getType()).people(getPeople()).studios(getStudios()).genreItems(getGenreItems()) + .parentLogoItemId(getParentLogoItemId()).parentBackdropItemId(getParentBackdropItemId()) + .parentBackdropImageTags(getParentBackdropImageTags()).localTrailerCount(getLocalTrailerCount()) + .userData(getUserData()).recursiveItemCount(getRecursiveItemCount()).childCount(getChildCount()) + .seriesName(getSeriesName()).seriesId(getSeriesId()).seasonId(getSeasonId()) + .specialFeatureCount(getSpecialFeatureCount()).displayPreferencesId(getDisplayPreferencesId()) + .status(getStatus()).airTime(getAirTime()).airDays(getAirDays()).tags(getTags()) + .primaryImageAspectRatio(getPrimaryImageAspectRatio()).artists(getArtists()) + .artistItems(getArtistItems()).album(getAlbum()).collectionType(getCollectionType()) + .displayOrder(getDisplayOrder()).albumId(getAlbumId()).albumPrimaryImageTag(getAlbumPrimaryImageTag()) + .seriesPrimaryImageTag(getSeriesPrimaryImageTag()).albumArtist(getAlbumArtist()) + .albumArtists(getAlbumArtists()).seasonName(getSeasonName()).mediaStreams(getMediaStreams()) + .videoType(getVideoType()).partCount(getPartCount()).mediaSourceCount(getMediaSourceCount()) + .imageTags(getImageTags()).backdropImageTags(getBackdropImageTags()) + .screenshotImageTags(getScreenshotImageTags()).parentLogoImageTag(getParentLogoImageTag()) + .parentArtItemId(getParentArtItemId()).parentArtImageTag(getParentArtImageTag()) + .seriesThumbImageTag(getSeriesThumbImageTag()).imageBlurHashes(getImageBlurHashes()) + .seriesStudio(getSeriesStudio()).parentThumbItemId(getParentThumbItemId()) + .parentThumbImageTag(getParentThumbImageTag()).parentPrimaryImageItemId(getParentPrimaryImageItemId()) + .parentPrimaryImageTag(getParentPrimaryImageTag()).chapters(getChapters()) + .locationType(getLocationType()).isoType(getIsoType()).mediaType(getMediaType()).endDate(getEndDate()) + .lockedFields(getLockedFields()).trailerCount(getTrailerCount()).movieCount(getMovieCount()) + .seriesCount(getSeriesCount()).programCount(getProgramCount()).episodeCount(getEpisodeCount()) + .songCount(getSongCount()).albumCount(getAlbumCount()).artistCount(getArtistCount()) + .musicVideoCount(getMusicVideoCount()).lockData(getLockData()).width(getWidth()).height(getHeight()) + .cameraMake(getCameraMake()).cameraModel(getCameraModel()).software(getSoftware()) + .exposureTime(getExposureTime()).focalLength(getFocalLength()).imageOrientation(getImageOrientation()) + .aperture(getAperture()).shutterSpeed(getShutterSpeed()).latitude(getLatitude()) + .longitude(getLongitude()).altitude(getAltitude()).isoSpeedRating(getIsoSpeedRating()) + .seriesTimerId(getSeriesTimerId()).programId(getProgramId()) + .channelPrimaryImageTag(getChannelPrimaryImageTag()).startDate(getStartDate()) + .completionPercentage(getCompletionPercentage()).isRepeat(getIsRepeat()).episodeTitle(getEpisodeTitle()) + .channelType(getChannelType()).audio(getAudio()).isMovie(getIsMovie()).isSports(getIsSports()) + .isSeries(getIsSeries()).isLive(getIsLive()).isNews(getIsNews()).isKids(getIsKids()) + .isPremiere(getIsPremiere()).timerId(getTimerId()).currentProgram(getCurrentProgram()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemDtoImageBlurHashes.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemDtoImageBlurHashes.java new file mode 100644 index 0000000000000..cb04654d5b167 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemDtoImageBlurHashes.java @@ -0,0 +1,829 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Gets or sets the blurhashes for the image tags. Maps image type to dictionary mapping image tag to blurhash value. + */ +@JsonPropertyOrder({ BaseItemDtoImageBlurHashes.JSON_PROPERTY_PRIMARY, BaseItemDtoImageBlurHashes.JSON_PROPERTY_ART, + BaseItemDtoImageBlurHashes.JSON_PROPERTY_BACKDROP, BaseItemDtoImageBlurHashes.JSON_PROPERTY_BANNER, + BaseItemDtoImageBlurHashes.JSON_PROPERTY_LOGO, BaseItemDtoImageBlurHashes.JSON_PROPERTY_THUMB, + BaseItemDtoImageBlurHashes.JSON_PROPERTY_DISC, BaseItemDtoImageBlurHashes.JSON_PROPERTY_BOX, + BaseItemDtoImageBlurHashes.JSON_PROPERTY_SCREENSHOT, BaseItemDtoImageBlurHashes.JSON_PROPERTY_MENU, + BaseItemDtoImageBlurHashes.JSON_PROPERTY_CHAPTER, BaseItemDtoImageBlurHashes.JSON_PROPERTY_BOX_REAR, + BaseItemDtoImageBlurHashes.JSON_PROPERTY_PROFILE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BaseItemDtoImageBlurHashes { + public static final String JSON_PROPERTY_PRIMARY = "Primary"; + @org.eclipse.jdt.annotation.NonNull + private Map primary = new HashMap<>(); + + public static final String JSON_PROPERTY_ART = "Art"; + @org.eclipse.jdt.annotation.NonNull + private Map art = new HashMap<>(); + + public static final String JSON_PROPERTY_BACKDROP = "Backdrop"; + @org.eclipse.jdt.annotation.NonNull + private Map backdrop = new HashMap<>(); + + public static final String JSON_PROPERTY_BANNER = "Banner"; + @org.eclipse.jdt.annotation.NonNull + private Map banner = new HashMap<>(); + + public static final String JSON_PROPERTY_LOGO = "Logo"; + @org.eclipse.jdt.annotation.NonNull + private Map logo = new HashMap<>(); + + public static final String JSON_PROPERTY_THUMB = "Thumb"; + @org.eclipse.jdt.annotation.NonNull + private Map thumb = new HashMap<>(); + + public static final String JSON_PROPERTY_DISC = "Disc"; + @org.eclipse.jdt.annotation.NonNull + private Map disc = new HashMap<>(); + + public static final String JSON_PROPERTY_BOX = "Box"; + @org.eclipse.jdt.annotation.NonNull + private Map box = new HashMap<>(); + + public static final String JSON_PROPERTY_SCREENSHOT = "Screenshot"; + @org.eclipse.jdt.annotation.NonNull + private Map screenshot = new HashMap<>(); + + public static final String JSON_PROPERTY_MENU = "Menu"; + @org.eclipse.jdt.annotation.NonNull + private Map menu = new HashMap<>(); + + public static final String JSON_PROPERTY_CHAPTER = "Chapter"; + @org.eclipse.jdt.annotation.NonNull + private Map chapter = new HashMap<>(); + + public static final String JSON_PROPERTY_BOX_REAR = "BoxRear"; + @org.eclipse.jdt.annotation.NonNull + private Map boxRear = new HashMap<>(); + + public static final String JSON_PROPERTY_PROFILE = "Profile"; + @org.eclipse.jdt.annotation.NonNull + private Map profile = new HashMap<>(); + + public BaseItemDtoImageBlurHashes() { + } + + public BaseItemDtoImageBlurHashes primary(@org.eclipse.jdt.annotation.NonNull Map primary) { + this.primary = primary; + return this; + } + + public BaseItemDtoImageBlurHashes putPrimaryItem(String key, String primaryItem) { + if (this.primary == null) { + this.primary = new HashMap<>(); + } + this.primary.put(key, primaryItem); + return this; + } + + /** + * Get primary + * + * @return primary + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getPrimary() { + return primary; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimary(@org.eclipse.jdt.annotation.NonNull Map primary) { + this.primary = primary; + } + + public BaseItemDtoImageBlurHashes art(@org.eclipse.jdt.annotation.NonNull Map art) { + this.art = art; + return this; + } + + public BaseItemDtoImageBlurHashes putArtItem(String key, String artItem) { + if (this.art == null) { + this.art = new HashMap<>(); + } + this.art.put(key, artItem); + return this; + } + + /** + * Get art + * + * @return art + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getArt() { + return art; + } + + @JsonProperty(JSON_PROPERTY_ART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArt(@org.eclipse.jdt.annotation.NonNull Map art) { + this.art = art; + } + + public BaseItemDtoImageBlurHashes backdrop(@org.eclipse.jdt.annotation.NonNull Map backdrop) { + this.backdrop = backdrop; + return this; + } + + public BaseItemDtoImageBlurHashes putBackdropItem(String key, String backdropItem) { + if (this.backdrop == null) { + this.backdrop = new HashMap<>(); + } + this.backdrop.put(key, backdropItem); + return this; + } + + /** + * Get backdrop + * + * @return backdrop + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BACKDROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBackdrop() { + return backdrop; + } + + @JsonProperty(JSON_PROPERTY_BACKDROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBackdrop(@org.eclipse.jdt.annotation.NonNull Map backdrop) { + this.backdrop = backdrop; + } + + public BaseItemDtoImageBlurHashes banner(@org.eclipse.jdt.annotation.NonNull Map banner) { + this.banner = banner; + return this; + } + + public BaseItemDtoImageBlurHashes putBannerItem(String key, String bannerItem) { + if (this.banner == null) { + this.banner = new HashMap<>(); + } + this.banner.put(key, bannerItem); + return this; + } + + /** + * Get banner + * + * @return banner + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BANNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBanner() { + return banner; + } + + @JsonProperty(JSON_PROPERTY_BANNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBanner(@org.eclipse.jdt.annotation.NonNull Map banner) { + this.banner = banner; + } + + public BaseItemDtoImageBlurHashes logo(@org.eclipse.jdt.annotation.NonNull Map logo) { + this.logo = logo; + return this; + } + + public BaseItemDtoImageBlurHashes putLogoItem(String key, String logoItem) { + if (this.logo == null) { + this.logo = new HashMap<>(); + } + this.logo.put(key, logoItem); + return this; + } + + /** + * Get logo + * + * @return logo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOGO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getLogo() { + return logo; + } + + @JsonProperty(JSON_PROPERTY_LOGO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogo(@org.eclipse.jdt.annotation.NonNull Map logo) { + this.logo = logo; + } + + public BaseItemDtoImageBlurHashes thumb(@org.eclipse.jdt.annotation.NonNull Map thumb) { + this.thumb = thumb; + return this; + } + + public BaseItemDtoImageBlurHashes putThumbItem(String key, String thumbItem) { + if (this.thumb == null) { + this.thumb = new HashMap<>(); + } + this.thumb.put(key, thumbItem); + return this; + } + + /** + * Get thumb + * + * @return thumb + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THUMB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getThumb() { + return thumb; + } + + @JsonProperty(JSON_PROPERTY_THUMB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThumb(@org.eclipse.jdt.annotation.NonNull Map thumb) { + this.thumb = thumb; + } + + public BaseItemDtoImageBlurHashes disc(@org.eclipse.jdt.annotation.NonNull Map disc) { + this.disc = disc; + return this; + } + + public BaseItemDtoImageBlurHashes putDiscItem(String key, String discItem) { + if (this.disc == null) { + this.disc = new HashMap<>(); + } + this.disc.put(key, discItem); + return this; + } + + /** + * Get disc + * + * @return disc + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDisc() { + return disc; + } + + @JsonProperty(JSON_PROPERTY_DISC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisc(@org.eclipse.jdt.annotation.NonNull Map disc) { + this.disc = disc; + } + + public BaseItemDtoImageBlurHashes box(@org.eclipse.jdt.annotation.NonNull Map box) { + this.box = box; + return this; + } + + public BaseItemDtoImageBlurHashes putBoxItem(String key, String boxItem) { + if (this.box == null) { + this.box = new HashMap<>(); + } + this.box.put(key, boxItem); + return this; + } + + /** + * Get box + * + * @return box + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BOX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBox() { + return box; + } + + @JsonProperty(JSON_PROPERTY_BOX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBox(@org.eclipse.jdt.annotation.NonNull Map box) { + this.box = box; + } + + public BaseItemDtoImageBlurHashes screenshot(@org.eclipse.jdt.annotation.NonNull Map screenshot) { + this.screenshot = screenshot; + return this; + } + + public BaseItemDtoImageBlurHashes putScreenshotItem(String key, String screenshotItem) { + if (this.screenshot == null) { + this.screenshot = new HashMap<>(); + } + this.screenshot.put(key, screenshotItem); + return this; + } + + /** + * Get screenshot + * + * @return screenshot + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SCREENSHOT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getScreenshot() { + return screenshot; + } + + @JsonProperty(JSON_PROPERTY_SCREENSHOT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScreenshot(@org.eclipse.jdt.annotation.NonNull Map screenshot) { + this.screenshot = screenshot; + } + + public BaseItemDtoImageBlurHashes menu(@org.eclipse.jdt.annotation.NonNull Map menu) { + this.menu = menu; + return this; + } + + public BaseItemDtoImageBlurHashes putMenuItem(String key, String menuItem) { + if (this.menu == null) { + this.menu = new HashMap<>(); + } + this.menu.put(key, menuItem); + return this; + } + + /** + * Get menu + * + * @return menu + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MENU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMenu() { + return menu; + } + + @JsonProperty(JSON_PROPERTY_MENU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMenu(@org.eclipse.jdt.annotation.NonNull Map menu) { + this.menu = menu; + } + + public BaseItemDtoImageBlurHashes chapter(@org.eclipse.jdt.annotation.NonNull Map chapter) { + this.chapter = chapter; + return this; + } + + public BaseItemDtoImageBlurHashes putChapterItem(String key, String chapterItem) { + if (this.chapter == null) { + this.chapter = new HashMap<>(); + } + this.chapter.put(key, chapterItem); + return this; + } + + /** + * Get chapter + * + * @return chapter + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHAPTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getChapter() { + return chapter; + } + + @JsonProperty(JSON_PROPERTY_CHAPTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChapter(@org.eclipse.jdt.annotation.NonNull Map chapter) { + this.chapter = chapter; + } + + public BaseItemDtoImageBlurHashes boxRear(@org.eclipse.jdt.annotation.NonNull Map boxRear) { + this.boxRear = boxRear; + return this; + } + + public BaseItemDtoImageBlurHashes putBoxRearItem(String key, String boxRearItem) { + if (this.boxRear == null) { + this.boxRear = new HashMap<>(); + } + this.boxRear.put(key, boxRearItem); + return this; + } + + /** + * Get boxRear + * + * @return boxRear + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BOX_REAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBoxRear() { + return boxRear; + } + + @JsonProperty(JSON_PROPERTY_BOX_REAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBoxRear(@org.eclipse.jdt.annotation.NonNull Map boxRear) { + this.boxRear = boxRear; + } + + public BaseItemDtoImageBlurHashes profile(@org.eclipse.jdt.annotation.NonNull Map profile) { + this.profile = profile; + return this; + } + + public BaseItemDtoImageBlurHashes putProfileItem(String key, String profileItem) { + if (this.profile == null) { + this.profile = new HashMap<>(); + } + this.profile.put(key, profileItem); + return this; + } + + /** + * Get profile + * + * @return profile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProfile() { + return profile; + } + + @JsonProperty(JSON_PROPERTY_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProfile(@org.eclipse.jdt.annotation.NonNull Map profile) { + this.profile = profile; + } + + /** + * Return true if this BaseItemDto_ImageBlurHashes object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseItemDtoImageBlurHashes baseItemDtoImageBlurHashes = (BaseItemDtoImageBlurHashes) o; + return Objects.equals(this.primary, baseItemDtoImageBlurHashes.primary) + && Objects.equals(this.art, baseItemDtoImageBlurHashes.art) + && Objects.equals(this.backdrop, baseItemDtoImageBlurHashes.backdrop) + && Objects.equals(this.banner, baseItemDtoImageBlurHashes.banner) + && Objects.equals(this.logo, baseItemDtoImageBlurHashes.logo) + && Objects.equals(this.thumb, baseItemDtoImageBlurHashes.thumb) + && Objects.equals(this.disc, baseItemDtoImageBlurHashes.disc) + && Objects.equals(this.box, baseItemDtoImageBlurHashes.box) + && Objects.equals(this.screenshot, baseItemDtoImageBlurHashes.screenshot) + && Objects.equals(this.menu, baseItemDtoImageBlurHashes.menu) + && Objects.equals(this.chapter, baseItemDtoImageBlurHashes.chapter) + && Objects.equals(this.boxRear, baseItemDtoImageBlurHashes.boxRear) + && Objects.equals(this.profile, baseItemDtoImageBlurHashes.profile); + } + + @Override + public int hashCode() { + return Objects.hash(primary, art, backdrop, banner, logo, thumb, disc, box, screenshot, menu, chapter, boxRear, + profile); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseItemDtoImageBlurHashes {\n"); + sb.append(" primary: ").append(toIndentedString(primary)).append("\n"); + sb.append(" art: ").append(toIndentedString(art)).append("\n"); + sb.append(" backdrop: ").append(toIndentedString(backdrop)).append("\n"); + sb.append(" banner: ").append(toIndentedString(banner)).append("\n"); + sb.append(" logo: ").append(toIndentedString(logo)).append("\n"); + sb.append(" thumb: ").append(toIndentedString(thumb)).append("\n"); + sb.append(" disc: ").append(toIndentedString(disc)).append("\n"); + sb.append(" box: ").append(toIndentedString(box)).append("\n"); + sb.append(" screenshot: ").append(toIndentedString(screenshot)).append("\n"); + sb.append(" menu: ").append(toIndentedString(menu)).append("\n"); + sb.append(" chapter: ").append(toIndentedString(chapter)).append("\n"); + sb.append(" boxRear: ").append(toIndentedString(boxRear)).append("\n"); + sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Primary` to the URL query string + if (getPrimary() != null) { + for (String _key : getPrimary().keySet()) { + joiner.add(String.format("%sPrimary%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getPrimary().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getPrimary().get(_key))))); + } + } + + // add `Art` to the URL query string + if (getArt() != null) { + for (String _key : getArt().keySet()) { + joiner.add(String.format("%sArt%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getArt().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getArt().get(_key))))); + } + } + + // add `Backdrop` to the URL query string + if (getBackdrop() != null) { + for (String _key : getBackdrop().keySet()) { + joiner.add(String.format("%sBackdrop%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getBackdrop().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getBackdrop().get(_key))))); + } + } + + // add `Banner` to the URL query string + if (getBanner() != null) { + for (String _key : getBanner().keySet()) { + joiner.add(String.format("%sBanner%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getBanner().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBanner().get(_key))))); + } + } + + // add `Logo` to the URL query string + if (getLogo() != null) { + for (String _key : getLogo().keySet()) { + joiner.add(String.format("%sLogo%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getLogo().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getLogo().get(_key))))); + } + } + + // add `Thumb` to the URL query string + if (getThumb() != null) { + for (String _key : getThumb().keySet()) { + joiner.add(String.format("%sThumb%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getThumb().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getThumb().get(_key))))); + } + } + + // add `Disc` to the URL query string + if (getDisc() != null) { + for (String _key : getDisc().keySet()) { + joiner.add(String.format("%sDisc%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getDisc().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getDisc().get(_key))))); + } + } + + // add `Box` to the URL query string + if (getBox() != null) { + for (String _key : getBox().keySet()) { + joiner.add(String.format("%sBox%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getBox().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBox().get(_key))))); + } + } + + // add `Screenshot` to the URL query string + if (getScreenshot() != null) { + for (String _key : getScreenshot().keySet()) { + joiner.add(String.format("%sScreenshot%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getScreenshot().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getScreenshot().get(_key))))); + } + } + + // add `Menu` to the URL query string + if (getMenu() != null) { + for (String _key : getMenu().keySet()) { + joiner.add(String.format("%sMenu%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getMenu().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getMenu().get(_key))))); + } + } + + // add `Chapter` to the URL query string + if (getChapter() != null) { + for (String _key : getChapter().keySet()) { + joiner.add(String.format("%sChapter%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getChapter().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getChapter().get(_key))))); + } + } + + // add `BoxRear` to the URL query string + if (getBoxRear() != null) { + for (String _key : getBoxRear().keySet()) { + joiner.add(String.format("%sBoxRear%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getBoxRear().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBoxRear().get(_key))))); + } + } + + // add `Profile` to the URL query string + if (getProfile() != null) { + for (String _key : getProfile().keySet()) { + joiner.add(String.format("%sProfile%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProfile().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getProfile().get(_key))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private BaseItemDtoImageBlurHashes instance; + + public Builder() { + this(new BaseItemDtoImageBlurHashes()); + } + + protected Builder(BaseItemDtoImageBlurHashes instance) { + this.instance = instance; + } + + public BaseItemDtoImageBlurHashes.Builder primary(Map primary) { + this.instance.primary = primary; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder art(Map art) { + this.instance.art = art; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder backdrop(Map backdrop) { + this.instance.backdrop = backdrop; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder banner(Map banner) { + this.instance.banner = banner; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder logo(Map logo) { + this.instance.logo = logo; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder thumb(Map thumb) { + this.instance.thumb = thumb; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder disc(Map disc) { + this.instance.disc = disc; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder box(Map box) { + this.instance.box = box; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder screenshot(Map screenshot) { + this.instance.screenshot = screenshot; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder menu(Map menu) { + this.instance.menu = menu; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder chapter(Map chapter) { + this.instance.chapter = chapter; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder boxRear(Map boxRear) { + this.instance.boxRear = boxRear; + return this; + } + + public BaseItemDtoImageBlurHashes.Builder profile(Map profile) { + this.instance.profile = profile; + return this; + } + + /** + * returns a built BaseItemDtoImageBlurHashes instance. + * + * The builder is not reusable. + */ + public BaseItemDtoImageBlurHashes build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BaseItemDtoImageBlurHashes.Builder builder() { + return new BaseItemDtoImageBlurHashes.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BaseItemDtoImageBlurHashes.Builder toBuilder() { + return new BaseItemDtoImageBlurHashes.Builder().primary(getPrimary()).art(getArt()).backdrop(getBackdrop()) + .banner(getBanner()).logo(getLogo()).thumb(getThumb()).disc(getDisc()).box(getBox()) + .screenshot(getScreenshot()).menu(getMenu()).chapter(getChapter()).boxRear(getBoxRear()) + .profile(getProfile()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemDtoQueryResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemDtoQueryResult.java new file mode 100644 index 0000000000000..88aeeb16ab9b7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemDtoQueryResult.java @@ -0,0 +1,288 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BaseItemDtoQueryResult + */ +@JsonPropertyOrder({ BaseItemDtoQueryResult.JSON_PROPERTY_ITEMS, + BaseItemDtoQueryResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, BaseItemDtoQueryResult.JSON_PROPERTY_START_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BaseItemDtoQueryResult { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items; + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public BaseItemDtoQueryResult() { + } + + public BaseItemDtoQueryResult items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public BaseItemDtoQueryResult addItemsItem(BaseItemDto itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Gets or sets the items. + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public BaseItemDtoQueryResult totalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total number of records available. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public BaseItemDtoQueryResult startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the index of the first record in Items. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + /** + * Return true if this BaseItemDtoQueryResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseItemDtoQueryResult baseItemDtoQueryResult = (BaseItemDtoQueryResult) o; + return Objects.equals(this.items, baseItemDtoQueryResult.items) + && Objects.equals(this.totalRecordCount, baseItemDtoQueryResult.totalRecordCount) + && Objects.equals(this.startIndex, baseItemDtoQueryResult.startIndex); + } + + @Override + public int hashCode() { + return Objects.hash(items, totalRecordCount, startIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseItemDtoQueryResult {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BaseItemDtoQueryResult instance; + + public Builder() { + this(new BaseItemDtoQueryResult()); + } + + protected Builder(BaseItemDtoQueryResult instance) { + this.instance = instance; + } + + public BaseItemDtoQueryResult.Builder items(List items) { + this.instance.items = items; + return this; + } + + public BaseItemDtoQueryResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public BaseItemDtoQueryResult.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + /** + * returns a built BaseItemDtoQueryResult instance. + * + * The builder is not reusable. + */ + public BaseItemDtoQueryResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BaseItemDtoQueryResult.Builder builder() { + return new BaseItemDtoQueryResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BaseItemDtoQueryResult.Builder toBuilder() { + return new BaseItemDtoQueryResult.Builder().items(getItems()).totalRecordCount(getTotalRecordCount()) + .startIndex(getStartIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemKind.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemKind.java new file mode 100644 index 0000000000000..f36d317dbe67a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemKind.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The base item kind. + */ +public enum BaseItemKind { + + AGGREGATE_FOLDER("AggregateFolder"), + + AUDIO("Audio"), + + AUDIO_BOOK("AudioBook"), + + BASE_PLUGIN_FOLDER("BasePluginFolder"), + + BOOK("Book"), + + BOX_SET("BoxSet"), + + CHANNEL("Channel"), + + CHANNEL_FOLDER_ITEM("ChannelFolderItem"), + + COLLECTION_FOLDER("CollectionFolder"), + + EPISODE("Episode"), + + FOLDER("Folder"), + + GENRE("Genre"), + + MANUAL_PLAYLISTS_FOLDER("ManualPlaylistsFolder"), + + MOVIE("Movie"), + + LIVE_TV_CHANNEL("LiveTvChannel"), + + LIVE_TV_PROGRAM("LiveTvProgram"), + + MUSIC_ALBUM("MusicAlbum"), + + MUSIC_ARTIST("MusicArtist"), + + MUSIC_GENRE("MusicGenre"), + + MUSIC_VIDEO("MusicVideo"), + + PERSON("Person"), + + PHOTO("Photo"), + + PHOTO_ALBUM("PhotoAlbum"), + + PLAYLIST("Playlist"), + + PLAYLISTS_FOLDER("PlaylistsFolder"), + + PROGRAM("Program"), + + RECORDING("Recording"), + + SEASON("Season"), + + SERIES("Series"), + + STUDIO("Studio"), + + TRAILER("Trailer"), + + TV_CHANNEL("TvChannel"), + + TV_PROGRAM("TvProgram"), + + USER_ROOT_FOLDER("UserRootFolder"), + + USER_VIEW("UserView"), + + VIDEO("Video"), + + YEAR("Year"); + + private String value; + + BaseItemKind(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static BaseItemKind fromValue(String value) { + for (BaseItemKind b : BaseItemKind.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemPerson.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemPerson.java new file mode 100644 index 0000000000000..19d014f718e02 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemPerson.java @@ -0,0 +1,394 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * This is used by the api to get information about a Person within a BaseItem. + */ +@JsonPropertyOrder({ BaseItemPerson.JSON_PROPERTY_NAME, BaseItemPerson.JSON_PROPERTY_ID, + BaseItemPerson.JSON_PROPERTY_ROLE, BaseItemPerson.JSON_PROPERTY_TYPE, + BaseItemPerson.JSON_PROPERTY_PRIMARY_IMAGE_TAG, BaseItemPerson.JSON_PROPERTY_IMAGE_BLUR_HASHES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BaseItemPerson { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_ROLE = "Role"; + @org.eclipse.jdt.annotation.NonNull + private String role; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_TAG = "PrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String primaryImageTag; + + public static final String JSON_PROPERTY_IMAGE_BLUR_HASHES = "ImageBlurHashes"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemPersonImageBlurHashes imageBlurHashes; + + public BaseItemPerson() { + } + + public BaseItemPerson name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public BaseItemPerson id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Gets or sets the identifier. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public BaseItemPerson role(@org.eclipse.jdt.annotation.NonNull String role) { + this.role = role; + return this; + } + + /** + * Gets or sets the role. + * + * @return role + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRole() { + return role; + } + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRole(@org.eclipse.jdt.annotation.NonNull String role) { + this.role = role; + } + + public BaseItemPerson type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public BaseItemPerson primaryImageTag(@org.eclipse.jdt.annotation.NonNull String primaryImageTag) { + this.primaryImageTag = primaryImageTag; + return this; + } + + /** + * Gets or sets the primary image tag. + * + * @return primaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryImageTag() { + return primaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String primaryImageTag) { + this.primaryImageTag = primaryImageTag; + } + + public BaseItemPerson imageBlurHashes( + @org.eclipse.jdt.annotation.NonNull BaseItemPersonImageBlurHashes imageBlurHashes) { + this.imageBlurHashes = imageBlurHashes; + return this; + } + + /** + * Get imageBlurHashes + * + * @return imageBlurHashes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_BLUR_HASHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemPersonImageBlurHashes getImageBlurHashes() { + return imageBlurHashes; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_BLUR_HASHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageBlurHashes(@org.eclipse.jdt.annotation.NonNull BaseItemPersonImageBlurHashes imageBlurHashes) { + this.imageBlurHashes = imageBlurHashes; + } + + /** + * Return true if this BaseItemPerson object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseItemPerson baseItemPerson = (BaseItemPerson) o; + return Objects.equals(this.name, baseItemPerson.name) && Objects.equals(this.id, baseItemPerson.id) + && Objects.equals(this.role, baseItemPerson.role) && Objects.equals(this.type, baseItemPerson.type) + && Objects.equals(this.primaryImageTag, baseItemPerson.primaryImageTag) + && Objects.equals(this.imageBlurHashes, baseItemPerson.imageBlurHashes); + } + + @Override + public int hashCode() { + return Objects.hash(name, id, role, type, primaryImageTag, imageBlurHashes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseItemPerson {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" primaryImageTag: ").append(toIndentedString(primaryImageTag)).append("\n"); + sb.append(" imageBlurHashes: ").append(toIndentedString(imageBlurHashes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Role` to the URL query string + if (getRole() != null) { + joiner.add(String.format("%sRole%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRole())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `PrimaryImageTag` to the URL query string + if (getPrimaryImageTag() != null) { + joiner.add(String.format("%sPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageTag())))); + } + + // add `ImageBlurHashes` to the URL query string + if (getImageBlurHashes() != null) { + joiner.add(getImageBlurHashes().toUrlQueryString(prefix + "ImageBlurHashes" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private BaseItemPerson instance; + + public Builder() { + this(new BaseItemPerson()); + } + + protected Builder(BaseItemPerson instance) { + this.instance = instance; + } + + public BaseItemPerson.Builder name(String name) { + this.instance.name = name; + return this; + } + + public BaseItemPerson.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public BaseItemPerson.Builder role(String role) { + this.instance.role = role; + return this; + } + + public BaseItemPerson.Builder type(String type) { + this.instance.type = type; + return this; + } + + public BaseItemPerson.Builder primaryImageTag(String primaryImageTag) { + this.instance.primaryImageTag = primaryImageTag; + return this; + } + + public BaseItemPerson.Builder imageBlurHashes(BaseItemPersonImageBlurHashes imageBlurHashes) { + this.instance.imageBlurHashes = imageBlurHashes; + return this; + } + + /** + * returns a built BaseItemPerson instance. + * + * The builder is not reusable. + */ + public BaseItemPerson build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BaseItemPerson.Builder builder() { + return new BaseItemPerson.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BaseItemPerson.Builder toBuilder() { + return new BaseItemPerson.Builder().name(getName()).id(getId()).role(getRole()).type(getType()) + .primaryImageTag(getPrimaryImageTag()).imageBlurHashes(getImageBlurHashes()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemPersonImageBlurHashes.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemPersonImageBlurHashes.java new file mode 100644 index 0000000000000..f5a27dbb5338b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BaseItemPersonImageBlurHashes.java @@ -0,0 +1,830 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Gets or sets the primary image blurhash. + */ +@JsonPropertyOrder({ BaseItemPersonImageBlurHashes.JSON_PROPERTY_PRIMARY, + BaseItemPersonImageBlurHashes.JSON_PROPERTY_ART, BaseItemPersonImageBlurHashes.JSON_PROPERTY_BACKDROP, + BaseItemPersonImageBlurHashes.JSON_PROPERTY_BANNER, BaseItemPersonImageBlurHashes.JSON_PROPERTY_LOGO, + BaseItemPersonImageBlurHashes.JSON_PROPERTY_THUMB, BaseItemPersonImageBlurHashes.JSON_PROPERTY_DISC, + BaseItemPersonImageBlurHashes.JSON_PROPERTY_BOX, BaseItemPersonImageBlurHashes.JSON_PROPERTY_SCREENSHOT, + BaseItemPersonImageBlurHashes.JSON_PROPERTY_MENU, BaseItemPersonImageBlurHashes.JSON_PROPERTY_CHAPTER, + BaseItemPersonImageBlurHashes.JSON_PROPERTY_BOX_REAR, BaseItemPersonImageBlurHashes.JSON_PROPERTY_PROFILE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BaseItemPersonImageBlurHashes { + public static final String JSON_PROPERTY_PRIMARY = "Primary"; + @org.eclipse.jdt.annotation.NonNull + private Map primary = new HashMap<>(); + + public static final String JSON_PROPERTY_ART = "Art"; + @org.eclipse.jdt.annotation.NonNull + private Map art = new HashMap<>(); + + public static final String JSON_PROPERTY_BACKDROP = "Backdrop"; + @org.eclipse.jdt.annotation.NonNull + private Map backdrop = new HashMap<>(); + + public static final String JSON_PROPERTY_BANNER = "Banner"; + @org.eclipse.jdt.annotation.NonNull + private Map banner = new HashMap<>(); + + public static final String JSON_PROPERTY_LOGO = "Logo"; + @org.eclipse.jdt.annotation.NonNull + private Map logo = new HashMap<>(); + + public static final String JSON_PROPERTY_THUMB = "Thumb"; + @org.eclipse.jdt.annotation.NonNull + private Map thumb = new HashMap<>(); + + public static final String JSON_PROPERTY_DISC = "Disc"; + @org.eclipse.jdt.annotation.NonNull + private Map disc = new HashMap<>(); + + public static final String JSON_PROPERTY_BOX = "Box"; + @org.eclipse.jdt.annotation.NonNull + private Map box = new HashMap<>(); + + public static final String JSON_PROPERTY_SCREENSHOT = "Screenshot"; + @org.eclipse.jdt.annotation.NonNull + private Map screenshot = new HashMap<>(); + + public static final String JSON_PROPERTY_MENU = "Menu"; + @org.eclipse.jdt.annotation.NonNull + private Map menu = new HashMap<>(); + + public static final String JSON_PROPERTY_CHAPTER = "Chapter"; + @org.eclipse.jdt.annotation.NonNull + private Map chapter = new HashMap<>(); + + public static final String JSON_PROPERTY_BOX_REAR = "BoxRear"; + @org.eclipse.jdt.annotation.NonNull + private Map boxRear = new HashMap<>(); + + public static final String JSON_PROPERTY_PROFILE = "Profile"; + @org.eclipse.jdt.annotation.NonNull + private Map profile = new HashMap<>(); + + public BaseItemPersonImageBlurHashes() { + } + + public BaseItemPersonImageBlurHashes primary(@org.eclipse.jdt.annotation.NonNull Map primary) { + this.primary = primary; + return this; + } + + public BaseItemPersonImageBlurHashes putPrimaryItem(String key, String primaryItem) { + if (this.primary == null) { + this.primary = new HashMap<>(); + } + this.primary.put(key, primaryItem); + return this; + } + + /** + * Get primary + * + * @return primary + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getPrimary() { + return primary; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimary(@org.eclipse.jdt.annotation.NonNull Map primary) { + this.primary = primary; + } + + public BaseItemPersonImageBlurHashes art(@org.eclipse.jdt.annotation.NonNull Map art) { + this.art = art; + return this; + } + + public BaseItemPersonImageBlurHashes putArtItem(String key, String artItem) { + if (this.art == null) { + this.art = new HashMap<>(); + } + this.art.put(key, artItem); + return this; + } + + /** + * Get art + * + * @return art + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getArt() { + return art; + } + + @JsonProperty(JSON_PROPERTY_ART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArt(@org.eclipse.jdt.annotation.NonNull Map art) { + this.art = art; + } + + public BaseItemPersonImageBlurHashes backdrop(@org.eclipse.jdt.annotation.NonNull Map backdrop) { + this.backdrop = backdrop; + return this; + } + + public BaseItemPersonImageBlurHashes putBackdropItem(String key, String backdropItem) { + if (this.backdrop == null) { + this.backdrop = new HashMap<>(); + } + this.backdrop.put(key, backdropItem); + return this; + } + + /** + * Get backdrop + * + * @return backdrop + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BACKDROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBackdrop() { + return backdrop; + } + + @JsonProperty(JSON_PROPERTY_BACKDROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBackdrop(@org.eclipse.jdt.annotation.NonNull Map backdrop) { + this.backdrop = backdrop; + } + + public BaseItemPersonImageBlurHashes banner(@org.eclipse.jdt.annotation.NonNull Map banner) { + this.banner = banner; + return this; + } + + public BaseItemPersonImageBlurHashes putBannerItem(String key, String bannerItem) { + if (this.banner == null) { + this.banner = new HashMap<>(); + } + this.banner.put(key, bannerItem); + return this; + } + + /** + * Get banner + * + * @return banner + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BANNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBanner() { + return banner; + } + + @JsonProperty(JSON_PROPERTY_BANNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBanner(@org.eclipse.jdt.annotation.NonNull Map banner) { + this.banner = banner; + } + + public BaseItemPersonImageBlurHashes logo(@org.eclipse.jdt.annotation.NonNull Map logo) { + this.logo = logo; + return this; + } + + public BaseItemPersonImageBlurHashes putLogoItem(String key, String logoItem) { + if (this.logo == null) { + this.logo = new HashMap<>(); + } + this.logo.put(key, logoItem); + return this; + } + + /** + * Get logo + * + * @return logo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOGO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getLogo() { + return logo; + } + + @JsonProperty(JSON_PROPERTY_LOGO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogo(@org.eclipse.jdt.annotation.NonNull Map logo) { + this.logo = logo; + } + + public BaseItemPersonImageBlurHashes thumb(@org.eclipse.jdt.annotation.NonNull Map thumb) { + this.thumb = thumb; + return this; + } + + public BaseItemPersonImageBlurHashes putThumbItem(String key, String thumbItem) { + if (this.thumb == null) { + this.thumb = new HashMap<>(); + } + this.thumb.put(key, thumbItem); + return this; + } + + /** + * Get thumb + * + * @return thumb + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THUMB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getThumb() { + return thumb; + } + + @JsonProperty(JSON_PROPERTY_THUMB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThumb(@org.eclipse.jdt.annotation.NonNull Map thumb) { + this.thumb = thumb; + } + + public BaseItemPersonImageBlurHashes disc(@org.eclipse.jdt.annotation.NonNull Map disc) { + this.disc = disc; + return this; + } + + public BaseItemPersonImageBlurHashes putDiscItem(String key, String discItem) { + if (this.disc == null) { + this.disc = new HashMap<>(); + } + this.disc.put(key, discItem); + return this; + } + + /** + * Get disc + * + * @return disc + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDisc() { + return disc; + } + + @JsonProperty(JSON_PROPERTY_DISC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisc(@org.eclipse.jdt.annotation.NonNull Map disc) { + this.disc = disc; + } + + public BaseItemPersonImageBlurHashes box(@org.eclipse.jdt.annotation.NonNull Map box) { + this.box = box; + return this; + } + + public BaseItemPersonImageBlurHashes putBoxItem(String key, String boxItem) { + if (this.box == null) { + this.box = new HashMap<>(); + } + this.box.put(key, boxItem); + return this; + } + + /** + * Get box + * + * @return box + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BOX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBox() { + return box; + } + + @JsonProperty(JSON_PROPERTY_BOX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBox(@org.eclipse.jdt.annotation.NonNull Map box) { + this.box = box; + } + + public BaseItemPersonImageBlurHashes screenshot( + @org.eclipse.jdt.annotation.NonNull Map screenshot) { + this.screenshot = screenshot; + return this; + } + + public BaseItemPersonImageBlurHashes putScreenshotItem(String key, String screenshotItem) { + if (this.screenshot == null) { + this.screenshot = new HashMap<>(); + } + this.screenshot.put(key, screenshotItem); + return this; + } + + /** + * Get screenshot + * + * @return screenshot + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SCREENSHOT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getScreenshot() { + return screenshot; + } + + @JsonProperty(JSON_PROPERTY_SCREENSHOT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScreenshot(@org.eclipse.jdt.annotation.NonNull Map screenshot) { + this.screenshot = screenshot; + } + + public BaseItemPersonImageBlurHashes menu(@org.eclipse.jdt.annotation.NonNull Map menu) { + this.menu = menu; + return this; + } + + public BaseItemPersonImageBlurHashes putMenuItem(String key, String menuItem) { + if (this.menu == null) { + this.menu = new HashMap<>(); + } + this.menu.put(key, menuItem); + return this; + } + + /** + * Get menu + * + * @return menu + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MENU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMenu() { + return menu; + } + + @JsonProperty(JSON_PROPERTY_MENU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMenu(@org.eclipse.jdt.annotation.NonNull Map menu) { + this.menu = menu; + } + + public BaseItemPersonImageBlurHashes chapter(@org.eclipse.jdt.annotation.NonNull Map chapter) { + this.chapter = chapter; + return this; + } + + public BaseItemPersonImageBlurHashes putChapterItem(String key, String chapterItem) { + if (this.chapter == null) { + this.chapter = new HashMap<>(); + } + this.chapter.put(key, chapterItem); + return this; + } + + /** + * Get chapter + * + * @return chapter + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHAPTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getChapter() { + return chapter; + } + + @JsonProperty(JSON_PROPERTY_CHAPTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChapter(@org.eclipse.jdt.annotation.NonNull Map chapter) { + this.chapter = chapter; + } + + public BaseItemPersonImageBlurHashes boxRear(@org.eclipse.jdt.annotation.NonNull Map boxRear) { + this.boxRear = boxRear; + return this; + } + + public BaseItemPersonImageBlurHashes putBoxRearItem(String key, String boxRearItem) { + if (this.boxRear == null) { + this.boxRear = new HashMap<>(); + } + this.boxRear.put(key, boxRearItem); + return this; + } + + /** + * Get boxRear + * + * @return boxRear + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BOX_REAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBoxRear() { + return boxRear; + } + + @JsonProperty(JSON_PROPERTY_BOX_REAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBoxRear(@org.eclipse.jdt.annotation.NonNull Map boxRear) { + this.boxRear = boxRear; + } + + public BaseItemPersonImageBlurHashes profile(@org.eclipse.jdt.annotation.NonNull Map profile) { + this.profile = profile; + return this; + } + + public BaseItemPersonImageBlurHashes putProfileItem(String key, String profileItem) { + if (this.profile == null) { + this.profile = new HashMap<>(); + } + this.profile.put(key, profileItem); + return this; + } + + /** + * Get profile + * + * @return profile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProfile() { + return profile; + } + + @JsonProperty(JSON_PROPERTY_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProfile(@org.eclipse.jdt.annotation.NonNull Map profile) { + this.profile = profile; + } + + /** + * Return true if this BaseItemPerson_ImageBlurHashes object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseItemPersonImageBlurHashes baseItemPersonImageBlurHashes = (BaseItemPersonImageBlurHashes) o; + return Objects.equals(this.primary, baseItemPersonImageBlurHashes.primary) + && Objects.equals(this.art, baseItemPersonImageBlurHashes.art) + && Objects.equals(this.backdrop, baseItemPersonImageBlurHashes.backdrop) + && Objects.equals(this.banner, baseItemPersonImageBlurHashes.banner) + && Objects.equals(this.logo, baseItemPersonImageBlurHashes.logo) + && Objects.equals(this.thumb, baseItemPersonImageBlurHashes.thumb) + && Objects.equals(this.disc, baseItemPersonImageBlurHashes.disc) + && Objects.equals(this.box, baseItemPersonImageBlurHashes.box) + && Objects.equals(this.screenshot, baseItemPersonImageBlurHashes.screenshot) + && Objects.equals(this.menu, baseItemPersonImageBlurHashes.menu) + && Objects.equals(this.chapter, baseItemPersonImageBlurHashes.chapter) + && Objects.equals(this.boxRear, baseItemPersonImageBlurHashes.boxRear) + && Objects.equals(this.profile, baseItemPersonImageBlurHashes.profile); + } + + @Override + public int hashCode() { + return Objects.hash(primary, art, backdrop, banner, logo, thumb, disc, box, screenshot, menu, chapter, boxRear, + profile); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseItemPersonImageBlurHashes {\n"); + sb.append(" primary: ").append(toIndentedString(primary)).append("\n"); + sb.append(" art: ").append(toIndentedString(art)).append("\n"); + sb.append(" backdrop: ").append(toIndentedString(backdrop)).append("\n"); + sb.append(" banner: ").append(toIndentedString(banner)).append("\n"); + sb.append(" logo: ").append(toIndentedString(logo)).append("\n"); + sb.append(" thumb: ").append(toIndentedString(thumb)).append("\n"); + sb.append(" disc: ").append(toIndentedString(disc)).append("\n"); + sb.append(" box: ").append(toIndentedString(box)).append("\n"); + sb.append(" screenshot: ").append(toIndentedString(screenshot)).append("\n"); + sb.append(" menu: ").append(toIndentedString(menu)).append("\n"); + sb.append(" chapter: ").append(toIndentedString(chapter)).append("\n"); + sb.append(" boxRear: ").append(toIndentedString(boxRear)).append("\n"); + sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Primary` to the URL query string + if (getPrimary() != null) { + for (String _key : getPrimary().keySet()) { + joiner.add(String.format("%sPrimary%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getPrimary().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getPrimary().get(_key))))); + } + } + + // add `Art` to the URL query string + if (getArt() != null) { + for (String _key : getArt().keySet()) { + joiner.add(String.format("%sArt%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getArt().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getArt().get(_key))))); + } + } + + // add `Backdrop` to the URL query string + if (getBackdrop() != null) { + for (String _key : getBackdrop().keySet()) { + joiner.add(String.format("%sBackdrop%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getBackdrop().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getBackdrop().get(_key))))); + } + } + + // add `Banner` to the URL query string + if (getBanner() != null) { + for (String _key : getBanner().keySet()) { + joiner.add(String.format("%sBanner%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getBanner().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBanner().get(_key))))); + } + } + + // add `Logo` to the URL query string + if (getLogo() != null) { + for (String _key : getLogo().keySet()) { + joiner.add(String.format("%sLogo%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getLogo().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getLogo().get(_key))))); + } + } + + // add `Thumb` to the URL query string + if (getThumb() != null) { + for (String _key : getThumb().keySet()) { + joiner.add(String.format("%sThumb%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getThumb().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getThumb().get(_key))))); + } + } + + // add `Disc` to the URL query string + if (getDisc() != null) { + for (String _key : getDisc().keySet()) { + joiner.add(String.format("%sDisc%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getDisc().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getDisc().get(_key))))); + } + } + + // add `Box` to the URL query string + if (getBox() != null) { + for (String _key : getBox().keySet()) { + joiner.add(String.format("%sBox%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getBox().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBox().get(_key))))); + } + } + + // add `Screenshot` to the URL query string + if (getScreenshot() != null) { + for (String _key : getScreenshot().keySet()) { + joiner.add(String.format("%sScreenshot%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getScreenshot().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getScreenshot().get(_key))))); + } + } + + // add `Menu` to the URL query string + if (getMenu() != null) { + for (String _key : getMenu().keySet()) { + joiner.add(String.format("%sMenu%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getMenu().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getMenu().get(_key))))); + } + } + + // add `Chapter` to the URL query string + if (getChapter() != null) { + for (String _key : getChapter().keySet()) { + joiner.add(String.format("%sChapter%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getChapter().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getChapter().get(_key))))); + } + } + + // add `BoxRear` to the URL query string + if (getBoxRear() != null) { + for (String _key : getBoxRear().keySet()) { + joiner.add(String.format("%sBoxRear%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getBoxRear().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getBoxRear().get(_key))))); + } + } + + // add `Profile` to the URL query string + if (getProfile() != null) { + for (String _key : getProfile().keySet()) { + joiner.add(String.format("%sProfile%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProfile().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getProfile().get(_key))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private BaseItemPersonImageBlurHashes instance; + + public Builder() { + this(new BaseItemPersonImageBlurHashes()); + } + + protected Builder(BaseItemPersonImageBlurHashes instance) { + this.instance = instance; + } + + public BaseItemPersonImageBlurHashes.Builder primary(Map primary) { + this.instance.primary = primary; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder art(Map art) { + this.instance.art = art; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder backdrop(Map backdrop) { + this.instance.backdrop = backdrop; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder banner(Map banner) { + this.instance.banner = banner; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder logo(Map logo) { + this.instance.logo = logo; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder thumb(Map thumb) { + this.instance.thumb = thumb; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder disc(Map disc) { + this.instance.disc = disc; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder box(Map box) { + this.instance.box = box; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder screenshot(Map screenshot) { + this.instance.screenshot = screenshot; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder menu(Map menu) { + this.instance.menu = menu; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder chapter(Map chapter) { + this.instance.chapter = chapter; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder boxRear(Map boxRear) { + this.instance.boxRear = boxRear; + return this; + } + + public BaseItemPersonImageBlurHashes.Builder profile(Map profile) { + this.instance.profile = profile; + return this; + } + + /** + * returns a built BaseItemPersonImageBlurHashes instance. + * + * The builder is not reusable. + */ + public BaseItemPersonImageBlurHashes build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BaseItemPersonImageBlurHashes.Builder builder() { + return new BaseItemPersonImageBlurHashes.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BaseItemPersonImageBlurHashes.Builder toBuilder() { + return new BaseItemPersonImageBlurHashes.Builder().primary(getPrimary()).art(getArt()).backdrop(getBackdrop()) + .banner(getBanner()).logo(getLogo()).thumb(getThumb()).disc(getDisc()).box(getBox()) + .screenshot(getScreenshot()).menu(getMenu()).chapter(getChapter()).boxRear(getBoxRear()) + .profile(getProfile()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BookInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BookInfo.java new file mode 100644 index 0000000000000..13562dbda5226 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BookInfo.java @@ -0,0 +1,654 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BookInfo + */ +@JsonPropertyOrder({ BookInfo.JSON_PROPERTY_NAME, BookInfo.JSON_PROPERTY_ORIGINAL_TITLE, BookInfo.JSON_PROPERTY_PATH, + BookInfo.JSON_PROPERTY_METADATA_LANGUAGE, BookInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, + BookInfo.JSON_PROPERTY_PROVIDER_IDS, BookInfo.JSON_PROPERTY_YEAR, BookInfo.JSON_PROPERTY_INDEX_NUMBER, + BookInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, BookInfo.JSON_PROPERTY_PREMIERE_DATE, + BookInfo.JSON_PROPERTY_IS_AUTOMATED, BookInfo.JSON_PROPERTY_SERIES_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BookInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public static final String JSON_PROPERTY_SERIES_NAME = "SeriesName"; + @org.eclipse.jdt.annotation.NonNull + private String seriesName; + + public BookInfo() { + } + + public BookInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public BookInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public BookInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public BookInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public BookInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public BookInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public BookInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public BookInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public BookInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public BookInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public BookInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public BookInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + public BookInfo seriesName(@org.eclipse.jdt.annotation.NonNull String seriesName) { + this.seriesName = seriesName; + return this; + } + + /** + * Get seriesName + * + * @return seriesName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesName() { + return seriesName; + } + + @JsonProperty(JSON_PROPERTY_SERIES_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesName(@org.eclipse.jdt.annotation.NonNull String seriesName) { + this.seriesName = seriesName; + } + + /** + * Return true if this BookInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BookInfo bookInfo = (BookInfo) o; + return Objects.equals(this.name, bookInfo.name) && Objects.equals(this.originalTitle, bookInfo.originalTitle) + && Objects.equals(this.path, bookInfo.path) + && Objects.equals(this.metadataLanguage, bookInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, bookInfo.metadataCountryCode) + && Objects.equals(this.providerIds, bookInfo.providerIds) && Objects.equals(this.year, bookInfo.year) + && Objects.equals(this.indexNumber, bookInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, bookInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, bookInfo.premiereDate) + && Objects.equals(this.isAutomated, bookInfo.isAutomated) + && Objects.equals(this.seriesName, bookInfo.seriesName); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated, seriesName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BookInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append(" seriesName: ").append(toIndentedString(seriesName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + // add `SeriesName` to the URL query string + if (getSeriesName() != null) { + joiner.add(String.format("%sSeriesName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BookInfo instance; + + public Builder() { + this(new BookInfo()); + } + + protected Builder(BookInfo instance) { + this.instance = instance; + } + + public BookInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public BookInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public BookInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public BookInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public BookInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public BookInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public BookInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public BookInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public BookInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public BookInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public BookInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + public BookInfo.Builder seriesName(String seriesName) { + this.instance.seriesName = seriesName; + return this; + } + + /** + * returns a built BookInfo instance. + * + * The builder is not reusable. + */ + public BookInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BookInfo.Builder builder() { + return new BookInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BookInfo.Builder toBuilder() { + return new BookInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()).isAutomated(getIsAutomated()) + .seriesName(getSeriesName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BookInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BookInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..a08010ac99ef0 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BookInfoRemoteSearchQuery.java @@ -0,0 +1,316 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BookInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ BookInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + BookInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, BookInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + BookInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BookInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private BookInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public BookInfoRemoteSearchQuery() { + } + + public BookInfoRemoteSearchQuery searchInfo(@org.eclipse.jdt.annotation.NonNull BookInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BookInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull BookInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public BookInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public BookInfoRemoteSearchQuery searchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public BookInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this BookInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BookInfoRemoteSearchQuery bookInfoRemoteSearchQuery = (BookInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, bookInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, bookInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, bookInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, bookInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BookInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BookInfoRemoteSearchQuery instance; + + public Builder() { + this(new BookInfoRemoteSearchQuery()); + } + + protected Builder(BookInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public BookInfoRemoteSearchQuery.Builder searchInfo(BookInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public BookInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public BookInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public BookInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built BookInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public BookInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BookInfoRemoteSearchQuery.Builder builder() { + return new BookInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BookInfoRemoteSearchQuery.Builder toBuilder() { + return new BookInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BoxSetInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BoxSetInfo.java new file mode 100644 index 0000000000000..daafee09f05d6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BoxSetInfo.java @@ -0,0 +1,617 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BoxSetInfo + */ +@JsonPropertyOrder({ BoxSetInfo.JSON_PROPERTY_NAME, BoxSetInfo.JSON_PROPERTY_ORIGINAL_TITLE, + BoxSetInfo.JSON_PROPERTY_PATH, BoxSetInfo.JSON_PROPERTY_METADATA_LANGUAGE, + BoxSetInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, BoxSetInfo.JSON_PROPERTY_PROVIDER_IDS, + BoxSetInfo.JSON_PROPERTY_YEAR, BoxSetInfo.JSON_PROPERTY_INDEX_NUMBER, + BoxSetInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, BoxSetInfo.JSON_PROPERTY_PREMIERE_DATE, + BoxSetInfo.JSON_PROPERTY_IS_AUTOMATED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BoxSetInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public BoxSetInfo() { + } + + public BoxSetInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public BoxSetInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public BoxSetInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public BoxSetInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public BoxSetInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public BoxSetInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public BoxSetInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public BoxSetInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public BoxSetInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public BoxSetInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public BoxSetInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public BoxSetInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + /** + * Return true if this BoxSetInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BoxSetInfo boxSetInfo = (BoxSetInfo) o; + return Objects.equals(this.name, boxSetInfo.name) + && Objects.equals(this.originalTitle, boxSetInfo.originalTitle) + && Objects.equals(this.path, boxSetInfo.path) + && Objects.equals(this.metadataLanguage, boxSetInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, boxSetInfo.metadataCountryCode) + && Objects.equals(this.providerIds, boxSetInfo.providerIds) + && Objects.equals(this.year, boxSetInfo.year) + && Objects.equals(this.indexNumber, boxSetInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, boxSetInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, boxSetInfo.premiereDate) + && Objects.equals(this.isAutomated, boxSetInfo.isAutomated); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BoxSetInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BoxSetInfo instance; + + public Builder() { + this(new BoxSetInfo()); + } + + protected Builder(BoxSetInfo instance) { + this.instance = instance; + } + + public BoxSetInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public BoxSetInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public BoxSetInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public BoxSetInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public BoxSetInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public BoxSetInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public BoxSetInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public BoxSetInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public BoxSetInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public BoxSetInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public BoxSetInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + /** + * returns a built BoxSetInfo instance. + * + * The builder is not reusable. + */ + public BoxSetInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BoxSetInfo.Builder builder() { + return new BoxSetInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BoxSetInfo.Builder toBuilder() { + return new BoxSetInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()) + .isAutomated(getIsAutomated()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BoxSetInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BoxSetInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..4e2f413575819 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BoxSetInfoRemoteSearchQuery.java @@ -0,0 +1,318 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BoxSetInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ BoxSetInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + BoxSetInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, + BoxSetInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + BoxSetInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BoxSetInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private BoxSetInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public BoxSetInfoRemoteSearchQuery() { + } + + public BoxSetInfoRemoteSearchQuery searchInfo(@org.eclipse.jdt.annotation.NonNull BoxSetInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BoxSetInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull BoxSetInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public BoxSetInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public BoxSetInfoRemoteSearchQuery searchProviderName( + @org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public BoxSetInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this BoxSetInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BoxSetInfoRemoteSearchQuery boxSetInfoRemoteSearchQuery = (BoxSetInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, boxSetInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, boxSetInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, boxSetInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, boxSetInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BoxSetInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BoxSetInfoRemoteSearchQuery instance; + + public Builder() { + this(new BoxSetInfoRemoteSearchQuery()); + } + + protected Builder(BoxSetInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public BoxSetInfoRemoteSearchQuery.Builder searchInfo(BoxSetInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public BoxSetInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public BoxSetInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public BoxSetInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built BoxSetInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public BoxSetInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BoxSetInfoRemoteSearchQuery.Builder builder() { + return new BoxSetInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BoxSetInfoRemoteSearchQuery.Builder toBuilder() { + return new BoxSetInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BrandingOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BrandingOptions.java new file mode 100644 index 0000000000000..eab6024f125dc --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BrandingOptions.java @@ -0,0 +1,274 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The branding options. + */ +@JsonPropertyOrder({ BrandingOptions.JSON_PROPERTY_LOGIN_DISCLAIMER, BrandingOptions.JSON_PROPERTY_CUSTOM_CSS, + BrandingOptions.JSON_PROPERTY_SPLASHSCREEN_ENABLED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BrandingOptions { + public static final String JSON_PROPERTY_LOGIN_DISCLAIMER = "LoginDisclaimer"; + @org.eclipse.jdt.annotation.NonNull + private String loginDisclaimer; + + public static final String JSON_PROPERTY_CUSTOM_CSS = "CustomCss"; + @org.eclipse.jdt.annotation.NonNull + private String customCss; + + public static final String JSON_PROPERTY_SPLASHSCREEN_ENABLED = "SplashscreenEnabled"; + @org.eclipse.jdt.annotation.NonNull + private Boolean splashscreenEnabled; + + public BrandingOptions() { + } + + public BrandingOptions loginDisclaimer(@org.eclipse.jdt.annotation.NonNull String loginDisclaimer) { + this.loginDisclaimer = loginDisclaimer; + return this; + } + + /** + * Gets or sets the login disclaimer. + * + * @return loginDisclaimer + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOGIN_DISCLAIMER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLoginDisclaimer() { + return loginDisclaimer; + } + + @JsonProperty(JSON_PROPERTY_LOGIN_DISCLAIMER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoginDisclaimer(@org.eclipse.jdt.annotation.NonNull String loginDisclaimer) { + this.loginDisclaimer = loginDisclaimer; + } + + public BrandingOptions customCss(@org.eclipse.jdt.annotation.NonNull String customCss) { + this.customCss = customCss; + return this; + } + + /** + * Gets or sets the custom CSS. + * + * @return customCss + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CUSTOM_CSS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCustomCss() { + return customCss; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_CSS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomCss(@org.eclipse.jdt.annotation.NonNull String customCss) { + this.customCss = customCss; + } + + public BrandingOptions splashscreenEnabled(@org.eclipse.jdt.annotation.NonNull Boolean splashscreenEnabled) { + this.splashscreenEnabled = splashscreenEnabled; + return this; + } + + /** + * Gets or sets a value indicating whether to enable the splashscreen. + * + * @return splashscreenEnabled + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SPLASHSCREEN_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSplashscreenEnabled() { + return splashscreenEnabled; + } + + @JsonProperty(JSON_PROPERTY_SPLASHSCREEN_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSplashscreenEnabled(@org.eclipse.jdt.annotation.NonNull Boolean splashscreenEnabled) { + this.splashscreenEnabled = splashscreenEnabled; + } + + /** + * Return true if this BrandingOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BrandingOptions brandingOptions = (BrandingOptions) o; + return Objects.equals(this.loginDisclaimer, brandingOptions.loginDisclaimer) + && Objects.equals(this.customCss, brandingOptions.customCss) + && Objects.equals(this.splashscreenEnabled, brandingOptions.splashscreenEnabled); + } + + @Override + public int hashCode() { + return Objects.hash(loginDisclaimer, customCss, splashscreenEnabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BrandingOptions {\n"); + sb.append(" loginDisclaimer: ").append(toIndentedString(loginDisclaimer)).append("\n"); + sb.append(" customCss: ").append(toIndentedString(customCss)).append("\n"); + sb.append(" splashscreenEnabled: ").append(toIndentedString(splashscreenEnabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `LoginDisclaimer` to the URL query string + if (getLoginDisclaimer() != null) { + joiner.add(String.format("%sLoginDisclaimer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLoginDisclaimer())))); + } + + // add `CustomCss` to the URL query string + if (getCustomCss() != null) { + joiner.add(String.format("%sCustomCss%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCustomCss())))); + } + + // add `SplashscreenEnabled` to the URL query string + if (getSplashscreenEnabled() != null) { + joiner.add(String.format("%sSplashscreenEnabled%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSplashscreenEnabled())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BrandingOptions instance; + + public Builder() { + this(new BrandingOptions()); + } + + protected Builder(BrandingOptions instance) { + this.instance = instance; + } + + public BrandingOptions.Builder loginDisclaimer(String loginDisclaimer) { + this.instance.loginDisclaimer = loginDisclaimer; + return this; + } + + public BrandingOptions.Builder customCss(String customCss) { + this.instance.customCss = customCss; + return this; + } + + public BrandingOptions.Builder splashscreenEnabled(Boolean splashscreenEnabled) { + this.instance.splashscreenEnabled = splashscreenEnabled; + return this; + } + + /** + * returns a built BrandingOptions instance. + * + * The builder is not reusable. + */ + public BrandingOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BrandingOptions.Builder builder() { + return new BrandingOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BrandingOptions.Builder toBuilder() { + return new BrandingOptions.Builder().loginDisclaimer(getLoginDisclaimer()).customCss(getCustomCss()) + .splashscreenEnabled(getSplashscreenEnabled()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BufferRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BufferRequestDto.java new file mode 100644 index 0000000000000..ee4b69b0f387b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/BufferRequestDto.java @@ -0,0 +1,316 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class BufferRequestDto. + */ +@JsonPropertyOrder({ BufferRequestDto.JSON_PROPERTY_WHEN, BufferRequestDto.JSON_PROPERTY_POSITION_TICKS, + BufferRequestDto.JSON_PROPERTY_IS_PLAYING, BufferRequestDto.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class BufferRequestDto { + public static final String JSON_PROPERTY_WHEN = "When"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime when; + + public static final String JSON_PROPERTY_POSITION_TICKS = "PositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long positionTicks; + + public static final String JSON_PROPERTY_IS_PLAYING = "IsPlaying"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPlaying; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID playlistItemId; + + public BufferRequestDto() { + } + + public BufferRequestDto when(@org.eclipse.jdt.annotation.NonNull OffsetDateTime when) { + this.when = when; + return this; + } + + /** + * Gets or sets when the request has been made by the client. + * + * @return when + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WHEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getWhen() { + return when; + } + + @JsonProperty(JSON_PROPERTY_WHEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhen(@org.eclipse.jdt.annotation.NonNull OffsetDateTime when) { + this.when = when; + } + + public BufferRequestDto positionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + return this; + } + + /** + * Gets or sets the position ticks. + * + * @return positionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPositionTicks() { + return positionTicks; + } + + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPositionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + } + + public BufferRequestDto isPlaying(@org.eclipse.jdt.annotation.NonNull Boolean isPlaying) { + this.isPlaying = isPlaying; + return this; + } + + /** + * Gets or sets a value indicating whether the client playback is unpaused. + * + * @return isPlaying + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PLAYING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPlaying() { + return isPlaying; + } + + @JsonProperty(JSON_PROPERTY_IS_PLAYING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPlaying(@org.eclipse.jdt.annotation.NonNull Boolean isPlaying) { + this.isPlaying = isPlaying; + } + + public BufferRequestDto playlistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets or sets the playlist item identifier of the playing item. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + } + + /** + * Return true if this BufferRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BufferRequestDto bufferRequestDto = (BufferRequestDto) o; + return Objects.equals(this.when, bufferRequestDto.when) + && Objects.equals(this.positionTicks, bufferRequestDto.positionTicks) + && Objects.equals(this.isPlaying, bufferRequestDto.isPlaying) + && Objects.equals(this.playlistItemId, bufferRequestDto.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(when, positionTicks, isPlaying, playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BufferRequestDto {\n"); + sb.append(" when: ").append(toIndentedString(when)).append("\n"); + sb.append(" positionTicks: ").append(toIndentedString(positionTicks)).append("\n"); + sb.append(" isPlaying: ").append(toIndentedString(isPlaying)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `When` to the URL query string + if (getWhen() != null) { + joiner.add(String.format("%sWhen%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWhen())))); + } + + // add `PositionTicks` to the URL query string + if (getPositionTicks() != null) { + joiner.add(String.format("%sPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPositionTicks())))); + } + + // add `IsPlaying` to the URL query string + if (getIsPlaying() != null) { + joiner.add(String.format("%sIsPlaying%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPlaying())))); + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BufferRequestDto instance; + + public Builder() { + this(new BufferRequestDto()); + } + + protected Builder(BufferRequestDto instance) { + this.instance = instance; + } + + public BufferRequestDto.Builder when(OffsetDateTime when) { + this.instance.when = when; + return this; + } + + public BufferRequestDto.Builder positionTicks(Long positionTicks) { + this.instance.positionTicks = positionTicks; + return this; + } + + public BufferRequestDto.Builder isPlaying(Boolean isPlaying) { + this.instance.isPlaying = isPlaying; + return this; + } + + public BufferRequestDto.Builder playlistItemId(UUID playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built BufferRequestDto instance. + * + * The builder is not reusable. + */ + public BufferRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BufferRequestDto.Builder builder() { + return new BufferRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BufferRequestDto.Builder toBuilder() { + return new BufferRequestDto.Builder().when(getWhen()).positionTicks(getPositionTicks()) + .isPlaying(getIsPlaying()).playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelFeatures.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelFeatures.java new file mode 100644 index 0000000000000..fe3139fc59844 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelFeatures.java @@ -0,0 +1,687 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ChannelFeatures + */ +@JsonPropertyOrder({ ChannelFeatures.JSON_PROPERTY_NAME, ChannelFeatures.JSON_PROPERTY_ID, + ChannelFeatures.JSON_PROPERTY_CAN_SEARCH, ChannelFeatures.JSON_PROPERTY_MEDIA_TYPES, + ChannelFeatures.JSON_PROPERTY_CONTENT_TYPES, ChannelFeatures.JSON_PROPERTY_MAX_PAGE_SIZE, + ChannelFeatures.JSON_PROPERTY_AUTO_REFRESH_LEVELS, ChannelFeatures.JSON_PROPERTY_DEFAULT_SORT_FIELDS, + ChannelFeatures.JSON_PROPERTY_SUPPORTS_SORT_ORDER_TOGGLE, ChannelFeatures.JSON_PROPERTY_SUPPORTS_LATEST_MEDIA, + ChannelFeatures.JSON_PROPERTY_CAN_FILTER, ChannelFeatures.JSON_PROPERTY_SUPPORTS_CONTENT_DOWNLOADING }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ChannelFeatures { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_CAN_SEARCH = "CanSearch"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canSearch; + + public static final String JSON_PROPERTY_MEDIA_TYPES = "MediaTypes"; + @org.eclipse.jdt.annotation.NonNull + private List mediaTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_CONTENT_TYPES = "ContentTypes"; + @org.eclipse.jdt.annotation.NonNull + private List contentTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_MAX_PAGE_SIZE = "MaxPageSize"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxPageSize; + + public static final String JSON_PROPERTY_AUTO_REFRESH_LEVELS = "AutoRefreshLevels"; + @org.eclipse.jdt.annotation.NonNull + private Integer autoRefreshLevels; + + public static final String JSON_PROPERTY_DEFAULT_SORT_FIELDS = "DefaultSortFields"; + @org.eclipse.jdt.annotation.NonNull + private List defaultSortFields = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUPPORTS_SORT_ORDER_TOGGLE = "SupportsSortOrderToggle"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsSortOrderToggle; + + public static final String JSON_PROPERTY_SUPPORTS_LATEST_MEDIA = "SupportsLatestMedia"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsLatestMedia; + + public static final String JSON_PROPERTY_CAN_FILTER = "CanFilter"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canFilter; + + public static final String JSON_PROPERTY_SUPPORTS_CONTENT_DOWNLOADING = "SupportsContentDownloading"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsContentDownloading; + + public ChannelFeatures() { + } + + public ChannelFeatures name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ChannelFeatures id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Gets or sets the identifier. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public ChannelFeatures canSearch(@org.eclipse.jdt.annotation.NonNull Boolean canSearch) { + this.canSearch = canSearch; + return this; + } + + /** + * Gets or sets a value indicating whether this instance can search. + * + * @return canSearch + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_SEARCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanSearch() { + return canSearch; + } + + @JsonProperty(JSON_PROPERTY_CAN_SEARCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanSearch(@org.eclipse.jdt.annotation.NonNull Boolean canSearch) { + this.canSearch = canSearch; + } + + public ChannelFeatures mediaTypes(@org.eclipse.jdt.annotation.NonNull List mediaTypes) { + this.mediaTypes = mediaTypes; + return this; + } + + public ChannelFeatures addMediaTypesItem(ChannelMediaType mediaTypesItem) { + if (this.mediaTypes == null) { + this.mediaTypes = new ArrayList<>(); + } + this.mediaTypes.add(mediaTypesItem); + return this; + } + + /** + * Gets or sets the media types. + * + * @return mediaTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMediaTypes() { + return mediaTypes; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaTypes(@org.eclipse.jdt.annotation.NonNull List mediaTypes) { + this.mediaTypes = mediaTypes; + } + + public ChannelFeatures contentTypes( + @org.eclipse.jdt.annotation.NonNull List contentTypes) { + this.contentTypes = contentTypes; + return this; + } + + public ChannelFeatures addContentTypesItem(ChannelMediaContentType contentTypesItem) { + if (this.contentTypes == null) { + this.contentTypes = new ArrayList<>(); + } + this.contentTypes.add(contentTypesItem); + return this; + } + + /** + * Gets or sets the content types. + * + * @return contentTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTENT_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getContentTypes() { + return contentTypes; + } + + @JsonProperty(JSON_PROPERTY_CONTENT_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentTypes(@org.eclipse.jdt.annotation.NonNull List contentTypes) { + this.contentTypes = contentTypes; + } + + public ChannelFeatures maxPageSize(@org.eclipse.jdt.annotation.NonNull Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Gets or sets the maximum number of records the channel allows retrieving at a time. + * + * @return maxPageSize + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_PAGE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxPageSize() { + return maxPageSize; + } + + @JsonProperty(JSON_PROPERTY_MAX_PAGE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxPageSize(@org.eclipse.jdt.annotation.NonNull Integer maxPageSize) { + this.maxPageSize = maxPageSize; + } + + public ChannelFeatures autoRefreshLevels(@org.eclipse.jdt.annotation.NonNull Integer autoRefreshLevels) { + this.autoRefreshLevels = autoRefreshLevels; + return this; + } + + /** + * Gets or sets the automatic refresh levels. + * + * @return autoRefreshLevels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTO_REFRESH_LEVELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAutoRefreshLevels() { + return autoRefreshLevels; + } + + @JsonProperty(JSON_PROPERTY_AUTO_REFRESH_LEVELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAutoRefreshLevels(@org.eclipse.jdt.annotation.NonNull Integer autoRefreshLevels) { + this.autoRefreshLevels = autoRefreshLevels; + } + + public ChannelFeatures defaultSortFields( + @org.eclipse.jdt.annotation.NonNull List defaultSortFields) { + this.defaultSortFields = defaultSortFields; + return this; + } + + public ChannelFeatures addDefaultSortFieldsItem(ChannelItemSortField defaultSortFieldsItem) { + if (this.defaultSortFields == null) { + this.defaultSortFields = new ArrayList<>(); + } + this.defaultSortFields.add(defaultSortFieldsItem); + return this; + } + + /** + * Gets or sets the default sort orders. + * + * @return defaultSortFields + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEFAULT_SORT_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDefaultSortFields() { + return defaultSortFields; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_SORT_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultSortFields(@org.eclipse.jdt.annotation.NonNull List defaultSortFields) { + this.defaultSortFields = defaultSortFields; + } + + public ChannelFeatures supportsSortOrderToggle( + @org.eclipse.jdt.annotation.NonNull Boolean supportsSortOrderToggle) { + this.supportsSortOrderToggle = supportsSortOrderToggle; + return this; + } + + /** + * Gets or sets a value indicating whether a sort ascending/descending toggle is supported. + * + * @return supportsSortOrderToggle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_SORT_ORDER_TOGGLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsSortOrderToggle() { + return supportsSortOrderToggle; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_SORT_ORDER_TOGGLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsSortOrderToggle(@org.eclipse.jdt.annotation.NonNull Boolean supportsSortOrderToggle) { + this.supportsSortOrderToggle = supportsSortOrderToggle; + } + + public ChannelFeatures supportsLatestMedia(@org.eclipse.jdt.annotation.NonNull Boolean supportsLatestMedia) { + this.supportsLatestMedia = supportsLatestMedia; + return this; + } + + /** + * Gets or sets a value indicating whether [supports latest media]. + * + * @return supportsLatestMedia + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_LATEST_MEDIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsLatestMedia() { + return supportsLatestMedia; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_LATEST_MEDIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsLatestMedia(@org.eclipse.jdt.annotation.NonNull Boolean supportsLatestMedia) { + this.supportsLatestMedia = supportsLatestMedia; + } + + public ChannelFeatures canFilter(@org.eclipse.jdt.annotation.NonNull Boolean canFilter) { + this.canFilter = canFilter; + return this; + } + + /** + * Gets or sets a value indicating whether this instance can filter. + * + * @return canFilter + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanFilter() { + return canFilter; + } + + @JsonProperty(JSON_PROPERTY_CAN_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanFilter(@org.eclipse.jdt.annotation.NonNull Boolean canFilter) { + this.canFilter = canFilter; + } + + public ChannelFeatures supportsContentDownloading( + @org.eclipse.jdt.annotation.NonNull Boolean supportsContentDownloading) { + this.supportsContentDownloading = supportsContentDownloading; + return this; + } + + /** + * Gets or sets a value indicating whether [supports content downloading]. + * + * @return supportsContentDownloading + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_CONTENT_DOWNLOADING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsContentDownloading() { + return supportsContentDownloading; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_CONTENT_DOWNLOADING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsContentDownloading(@org.eclipse.jdt.annotation.NonNull Boolean supportsContentDownloading) { + this.supportsContentDownloading = supportsContentDownloading; + } + + /** + * Return true if this ChannelFeatures object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChannelFeatures channelFeatures = (ChannelFeatures) o; + return Objects.equals(this.name, channelFeatures.name) && Objects.equals(this.id, channelFeatures.id) + && Objects.equals(this.canSearch, channelFeatures.canSearch) + && Objects.equals(this.mediaTypes, channelFeatures.mediaTypes) + && Objects.equals(this.contentTypes, channelFeatures.contentTypes) + && Objects.equals(this.maxPageSize, channelFeatures.maxPageSize) + && Objects.equals(this.autoRefreshLevels, channelFeatures.autoRefreshLevels) + && Objects.equals(this.defaultSortFields, channelFeatures.defaultSortFields) + && Objects.equals(this.supportsSortOrderToggle, channelFeatures.supportsSortOrderToggle) + && Objects.equals(this.supportsLatestMedia, channelFeatures.supportsLatestMedia) + && Objects.equals(this.canFilter, channelFeatures.canFilter) + && Objects.equals(this.supportsContentDownloading, channelFeatures.supportsContentDownloading); + } + + @Override + public int hashCode() { + return Objects.hash(name, id, canSearch, mediaTypes, contentTypes, maxPageSize, autoRefreshLevels, + defaultSortFields, supportsSortOrderToggle, supportsLatestMedia, canFilter, supportsContentDownloading); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChannelFeatures {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" canSearch: ").append(toIndentedString(canSearch)).append("\n"); + sb.append(" mediaTypes: ").append(toIndentedString(mediaTypes)).append("\n"); + sb.append(" contentTypes: ").append(toIndentedString(contentTypes)).append("\n"); + sb.append(" maxPageSize: ").append(toIndentedString(maxPageSize)).append("\n"); + sb.append(" autoRefreshLevels: ").append(toIndentedString(autoRefreshLevels)).append("\n"); + sb.append(" defaultSortFields: ").append(toIndentedString(defaultSortFields)).append("\n"); + sb.append(" supportsSortOrderToggle: ").append(toIndentedString(supportsSortOrderToggle)).append("\n"); + sb.append(" supportsLatestMedia: ").append(toIndentedString(supportsLatestMedia)).append("\n"); + sb.append(" canFilter: ").append(toIndentedString(canFilter)).append("\n"); + sb.append(" supportsContentDownloading: ").append(toIndentedString(supportsContentDownloading)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `CanSearch` to the URL query string + if (getCanSearch() != null) { + joiner.add(String.format("%sCanSearch%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanSearch())))); + } + + // add `MediaTypes` to the URL query string + if (getMediaTypes() != null) { + for (int i = 0; i < getMediaTypes().size(); i++) { + if (getMediaTypes().get(i) != null) { + joiner.add(String.format("%sMediaTypes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMediaTypes().get(i))))); + } + } + } + + // add `ContentTypes` to the URL query string + if (getContentTypes() != null) { + for (int i = 0; i < getContentTypes().size(); i++) { + if (getContentTypes().get(i) != null) { + joiner.add(String.format("%sContentTypes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getContentTypes().get(i))))); + } + } + } + + // add `MaxPageSize` to the URL query string + if (getMaxPageSize() != null) { + joiner.add(String.format("%sMaxPageSize%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxPageSize())))); + } + + // add `AutoRefreshLevels` to the URL query string + if (getAutoRefreshLevels() != null) { + joiner.add(String.format("%sAutoRefreshLevels%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAutoRefreshLevels())))); + } + + // add `DefaultSortFields` to the URL query string + if (getDefaultSortFields() != null) { + for (int i = 0; i < getDefaultSortFields().size(); i++) { + if (getDefaultSortFields().get(i) != null) { + joiner.add(String.format("%sDefaultSortFields%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDefaultSortFields().get(i))))); + } + } + } + + // add `SupportsSortOrderToggle` to the URL query string + if (getSupportsSortOrderToggle() != null) { + joiner.add(String.format("%sSupportsSortOrderToggle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsSortOrderToggle())))); + } + + // add `SupportsLatestMedia` to the URL query string + if (getSupportsLatestMedia() != null) { + joiner.add(String.format("%sSupportsLatestMedia%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsLatestMedia())))); + } + + // add `CanFilter` to the URL query string + if (getCanFilter() != null) { + joiner.add(String.format("%sCanFilter%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanFilter())))); + } + + // add `SupportsContentDownloading` to the URL query string + if (getSupportsContentDownloading() != null) { + joiner.add(String.format("%sSupportsContentDownloading%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsContentDownloading())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ChannelFeatures instance; + + public Builder() { + this(new ChannelFeatures()); + } + + protected Builder(ChannelFeatures instance) { + this.instance = instance; + } + + public ChannelFeatures.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ChannelFeatures.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public ChannelFeatures.Builder canSearch(Boolean canSearch) { + this.instance.canSearch = canSearch; + return this; + } + + public ChannelFeatures.Builder mediaTypes(List mediaTypes) { + this.instance.mediaTypes = mediaTypes; + return this; + } + + public ChannelFeatures.Builder contentTypes(List contentTypes) { + this.instance.contentTypes = contentTypes; + return this; + } + + public ChannelFeatures.Builder maxPageSize(Integer maxPageSize) { + this.instance.maxPageSize = maxPageSize; + return this; + } + + public ChannelFeatures.Builder autoRefreshLevels(Integer autoRefreshLevels) { + this.instance.autoRefreshLevels = autoRefreshLevels; + return this; + } + + public ChannelFeatures.Builder defaultSortFields(List defaultSortFields) { + this.instance.defaultSortFields = defaultSortFields; + return this; + } + + public ChannelFeatures.Builder supportsSortOrderToggle(Boolean supportsSortOrderToggle) { + this.instance.supportsSortOrderToggle = supportsSortOrderToggle; + return this; + } + + public ChannelFeatures.Builder supportsLatestMedia(Boolean supportsLatestMedia) { + this.instance.supportsLatestMedia = supportsLatestMedia; + return this; + } + + public ChannelFeatures.Builder canFilter(Boolean canFilter) { + this.instance.canFilter = canFilter; + return this; + } + + public ChannelFeatures.Builder supportsContentDownloading(Boolean supportsContentDownloading) { + this.instance.supportsContentDownloading = supportsContentDownloading; + return this; + } + + /** + * returns a built ChannelFeatures instance. + * + * The builder is not reusable. + */ + public ChannelFeatures build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ChannelFeatures.Builder builder() { + return new ChannelFeatures.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ChannelFeatures.Builder toBuilder() { + return new ChannelFeatures.Builder().name(getName()).id(getId()).canSearch(getCanSearch()) + .mediaTypes(getMediaTypes()).contentTypes(getContentTypes()).maxPageSize(getMaxPageSize()) + .autoRefreshLevels(getAutoRefreshLevels()).defaultSortFields(getDefaultSortFields()) + .supportsSortOrderToggle(getSupportsSortOrderToggle()).supportsLatestMedia(getSupportsLatestMedia()) + .canFilter(getCanFilter()).supportsContentDownloading(getSupportsContentDownloading()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelItemSortField.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelItemSortField.java new file mode 100644 index 0000000000000..d955d7d9479f0 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelItemSortField.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ChannelItemSortField + */ +public enum ChannelItemSortField { + + NAME("Name"), + + COMMUNITY_RATING("CommunityRating"), + + PREMIERE_DATE("PremiereDate"), + + DATE_CREATED("DateCreated"), + + RUNTIME("Runtime"), + + PLAY_COUNT("PlayCount"), + + COMMUNITY_PLAY_COUNT("CommunityPlayCount"); + + private String value; + + ChannelItemSortField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ChannelItemSortField fromValue(String value) { + for (ChannelItemSortField b : ChannelItemSortField.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelMappingOptionsDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelMappingOptionsDto.java new file mode 100644 index 0000000000000..5163881969798 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelMappingOptionsDto.java @@ -0,0 +1,357 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Channel mapping options dto. + */ +@JsonPropertyOrder({ ChannelMappingOptionsDto.JSON_PROPERTY_TUNER_CHANNELS, + ChannelMappingOptionsDto.JSON_PROPERTY_PROVIDER_CHANNELS, ChannelMappingOptionsDto.JSON_PROPERTY_MAPPINGS, + ChannelMappingOptionsDto.JSON_PROPERTY_PROVIDER_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ChannelMappingOptionsDto { + public static final String JSON_PROPERTY_TUNER_CHANNELS = "TunerChannels"; + @org.eclipse.jdt.annotation.NonNull + private List tunerChannels = new ArrayList<>(); + + public static final String JSON_PROPERTY_PROVIDER_CHANNELS = "ProviderChannels"; + @org.eclipse.jdt.annotation.NonNull + private List providerChannels = new ArrayList<>(); + + public static final String JSON_PROPERTY_MAPPINGS = "Mappings"; + @org.eclipse.jdt.annotation.NonNull + private List mappings = new ArrayList<>(); + + public static final String JSON_PROPERTY_PROVIDER_NAME = "ProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String providerName; + + public ChannelMappingOptionsDto() { + } + + public ChannelMappingOptionsDto tunerChannels( + @org.eclipse.jdt.annotation.NonNull List tunerChannels) { + this.tunerChannels = tunerChannels; + return this; + } + + public ChannelMappingOptionsDto addTunerChannelsItem(TunerChannelMapping tunerChannelsItem) { + if (this.tunerChannels == null) { + this.tunerChannels = new ArrayList<>(); + } + this.tunerChannels.add(tunerChannelsItem); + return this; + } + + /** + * Gets or sets list of tuner channels. + * + * @return tunerChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TUNER_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTunerChannels() { + return tunerChannels; + } + + @JsonProperty(JSON_PROPERTY_TUNER_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTunerChannels(@org.eclipse.jdt.annotation.NonNull List tunerChannels) { + this.tunerChannels = tunerChannels; + } + + public ChannelMappingOptionsDto providerChannels( + @org.eclipse.jdt.annotation.NonNull List providerChannels) { + this.providerChannels = providerChannels; + return this; + } + + public ChannelMappingOptionsDto addProviderChannelsItem(NameIdPair providerChannelsItem) { + if (this.providerChannels == null) { + this.providerChannels = new ArrayList<>(); + } + this.providerChannels.add(providerChannelsItem); + return this; + } + + /** + * Gets or sets list of provider channels. + * + * @return providerChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getProviderChannels() { + return providerChannels; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderChannels(@org.eclipse.jdt.annotation.NonNull List providerChannels) { + this.providerChannels = providerChannels; + } + + public ChannelMappingOptionsDto mappings(@org.eclipse.jdt.annotation.NonNull List mappings) { + this.mappings = mappings; + return this; + } + + public ChannelMappingOptionsDto addMappingsItem(NameValuePair mappingsItem) { + if (this.mappings == null) { + this.mappings = new ArrayList<>(); + } + this.mappings.add(mappingsItem); + return this; + } + + /** + * Gets or sets list of mappings. + * + * @return mappings + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAPPINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMappings() { + return mappings; + } + + @JsonProperty(JSON_PROPERTY_MAPPINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMappings(@org.eclipse.jdt.annotation.NonNull List mappings) { + this.mappings = mappings; + } + + public ChannelMappingOptionsDto providerName(@org.eclipse.jdt.annotation.NonNull String providerName) { + this.providerName = providerName; + return this; + } + + /** + * Gets or sets provider name. + * + * @return providerName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProviderName() { + return providerName; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderName(@org.eclipse.jdt.annotation.NonNull String providerName) { + this.providerName = providerName; + } + + /** + * Return true if this ChannelMappingOptionsDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChannelMappingOptionsDto channelMappingOptionsDto = (ChannelMappingOptionsDto) o; + return Objects.equals(this.tunerChannels, channelMappingOptionsDto.tunerChannels) + && Objects.equals(this.providerChannels, channelMappingOptionsDto.providerChannels) + && Objects.equals(this.mappings, channelMappingOptionsDto.mappings) + && Objects.equals(this.providerName, channelMappingOptionsDto.providerName); + } + + @Override + public int hashCode() { + return Objects.hash(tunerChannels, providerChannels, mappings, providerName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChannelMappingOptionsDto {\n"); + sb.append(" tunerChannels: ").append(toIndentedString(tunerChannels)).append("\n"); + sb.append(" providerChannels: ").append(toIndentedString(providerChannels)).append("\n"); + sb.append(" mappings: ").append(toIndentedString(mappings)).append("\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `TunerChannels` to the URL query string + if (getTunerChannels() != null) { + for (int i = 0; i < getTunerChannels().size(); i++) { + if (getTunerChannels().get(i) != null) { + joiner.add(getTunerChannels().get(i).toUrlQueryString(String.format("%sTunerChannels%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ProviderChannels` to the URL query string + if (getProviderChannels() != null) { + for (int i = 0; i < getProviderChannels().size(); i++) { + if (getProviderChannels().get(i) != null) { + joiner.add(getProviderChannels().get(i).toUrlQueryString(String.format("%sProviderChannels%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Mappings` to the URL query string + if (getMappings() != null) { + for (int i = 0; i < getMappings().size(); i++) { + if (getMappings().get(i) != null) { + joiner.add(getMappings().get(i).toUrlQueryString(String.format("%sMappings%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ProviderName` to the URL query string + if (getProviderName() != null) { + joiner.add(String.format("%sProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProviderName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ChannelMappingOptionsDto instance; + + public Builder() { + this(new ChannelMappingOptionsDto()); + } + + protected Builder(ChannelMappingOptionsDto instance) { + this.instance = instance; + } + + public ChannelMappingOptionsDto.Builder tunerChannels(List tunerChannels) { + this.instance.tunerChannels = tunerChannels; + return this; + } + + public ChannelMappingOptionsDto.Builder providerChannels(List providerChannels) { + this.instance.providerChannels = providerChannels; + return this; + } + + public ChannelMappingOptionsDto.Builder mappings(List mappings) { + this.instance.mappings = mappings; + return this; + } + + public ChannelMappingOptionsDto.Builder providerName(String providerName) { + this.instance.providerName = providerName; + return this; + } + + /** + * returns a built ChannelMappingOptionsDto instance. + * + * The builder is not reusable. + */ + public ChannelMappingOptionsDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ChannelMappingOptionsDto.Builder builder() { + return new ChannelMappingOptionsDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ChannelMappingOptionsDto.Builder toBuilder() { + return new ChannelMappingOptionsDto.Builder().tunerChannels(getTunerChannels()) + .providerChannels(getProviderChannels()).mappings(getMappings()).providerName(getProviderName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelMediaContentType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelMediaContentType.java new file mode 100644 index 0000000000000..ebbf8195c79fa --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelMediaContentType.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ChannelMediaContentType + */ +public enum ChannelMediaContentType { + + CLIP("Clip"), + + PODCAST("Podcast"), + + TRAILER("Trailer"), + + MOVIE("Movie"), + + EPISODE("Episode"), + + SONG("Song"), + + MOVIE_EXTRA("MovieExtra"), + + TV_EXTRA("TvExtra"); + + private String value; + + ChannelMediaContentType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ChannelMediaContentType fromValue(String value) { + for (ChannelMediaContentType b : ChannelMediaContentType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelMediaType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelMediaType.java new file mode 100644 index 0000000000000..bf00055de118a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelMediaType.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ChannelMediaType + */ +public enum ChannelMediaType { + + AUDIO("Audio"), + + VIDEO("Video"), + + PHOTO("Photo"); + + private String value; + + ChannelMediaType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ChannelMediaType fromValue(String value) { + for (ChannelMediaType b : ChannelMediaType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelType.java new file mode 100644 index 0000000000000..33817dc1db8d5 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChannelType.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum ChannelType. + */ +public enum ChannelType { + + TV("TV"), + + RADIO("Radio"); + + private String value; + + ChannelType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ChannelType fromValue(String value) { + for (ChannelType b : ChannelType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChapterInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChapterInfo.java new file mode 100644 index 0000000000000..eaca6e10880b4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ChapterInfo.java @@ -0,0 +1,355 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class ChapterInfo. + */ +@JsonPropertyOrder({ ChapterInfo.JSON_PROPERTY_START_POSITION_TICKS, ChapterInfo.JSON_PROPERTY_NAME, + ChapterInfo.JSON_PROPERTY_IMAGE_PATH, ChapterInfo.JSON_PROPERTY_IMAGE_DATE_MODIFIED, + ChapterInfo.JSON_PROPERTY_IMAGE_TAG }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ChapterInfo { + public static final String JSON_PROPERTY_START_POSITION_TICKS = "StartPositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long startPositionTicks; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_IMAGE_PATH = "ImagePath"; + @org.eclipse.jdt.annotation.NonNull + private String imagePath; + + public static final String JSON_PROPERTY_IMAGE_DATE_MODIFIED = "ImageDateModified"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime imageDateModified; + + public static final String JSON_PROPERTY_IMAGE_TAG = "ImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String imageTag; + + public ChapterInfo() { + } + + public ChapterInfo startPositionTicks(@org.eclipse.jdt.annotation.NonNull Long startPositionTicks) { + this.startPositionTicks = startPositionTicks; + return this; + } + + /** + * Gets or sets the start position ticks. + * + * @return startPositionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartPositionTicks() { + return startPositionTicks; + } + + @JsonProperty(JSON_PROPERTY_START_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartPositionTicks(@org.eclipse.jdt.annotation.NonNull Long startPositionTicks) { + this.startPositionTicks = startPositionTicks; + } + + public ChapterInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ChapterInfo imagePath(@org.eclipse.jdt.annotation.NonNull String imagePath) { + this.imagePath = imagePath; + return this; + } + + /** + * Gets or sets the image path. + * + * @return imagePath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getImagePath() { + return imagePath; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImagePath(@org.eclipse.jdt.annotation.NonNull String imagePath) { + this.imagePath = imagePath; + } + + public ChapterInfo imageDateModified(@org.eclipse.jdt.annotation.NonNull OffsetDateTime imageDateModified) { + this.imageDateModified = imageDateModified; + return this; + } + + /** + * Get imageDateModified + * + * @return imageDateModified + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_DATE_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getImageDateModified() { + return imageDateModified; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_DATE_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageDateModified(@org.eclipse.jdt.annotation.NonNull OffsetDateTime imageDateModified) { + this.imageDateModified = imageDateModified; + } + + public ChapterInfo imageTag(@org.eclipse.jdt.annotation.NonNull String imageTag) { + this.imageTag = imageTag; + return this; + } + + /** + * Get imageTag + * + * @return imageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getImageTag() { + return imageTag; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageTag(@org.eclipse.jdt.annotation.NonNull String imageTag) { + this.imageTag = imageTag; + } + + /** + * Return true if this ChapterInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChapterInfo chapterInfo = (ChapterInfo) o; + return Objects.equals(this.startPositionTicks, chapterInfo.startPositionTicks) + && Objects.equals(this.name, chapterInfo.name) && Objects.equals(this.imagePath, chapterInfo.imagePath) + && Objects.equals(this.imageDateModified, chapterInfo.imageDateModified) + && Objects.equals(this.imageTag, chapterInfo.imageTag); + } + + @Override + public int hashCode() { + return Objects.hash(startPositionTicks, name, imagePath, imageDateModified, imageTag); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChapterInfo {\n"); + sb.append(" startPositionTicks: ").append(toIndentedString(startPositionTicks)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" imagePath: ").append(toIndentedString(imagePath)).append("\n"); + sb.append(" imageDateModified: ").append(toIndentedString(imageDateModified)).append("\n"); + sb.append(" imageTag: ").append(toIndentedString(imageTag)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `StartPositionTicks` to the URL query string + if (getStartPositionTicks() != null) { + joiner.add(String.format("%sStartPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartPositionTicks())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `ImagePath` to the URL query string + if (getImagePath() != null) { + joiner.add(String.format("%sImagePath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImagePath())))); + } + + // add `ImageDateModified` to the URL query string + if (getImageDateModified() != null) { + joiner.add(String.format("%sImageDateModified%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageDateModified())))); + } + + // add `ImageTag` to the URL query string + if (getImageTag() != null) { + joiner.add(String.format("%sImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageTag())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ChapterInfo instance; + + public Builder() { + this(new ChapterInfo()); + } + + protected Builder(ChapterInfo instance) { + this.instance = instance; + } + + public ChapterInfo.Builder startPositionTicks(Long startPositionTicks) { + this.instance.startPositionTicks = startPositionTicks; + return this; + } + + public ChapterInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ChapterInfo.Builder imagePath(String imagePath) { + this.instance.imagePath = imagePath; + return this; + } + + public ChapterInfo.Builder imageDateModified(OffsetDateTime imageDateModified) { + this.instance.imageDateModified = imageDateModified; + return this; + } + + public ChapterInfo.Builder imageTag(String imageTag) { + this.instance.imageTag = imageTag; + return this; + } + + /** + * returns a built ChapterInfo instance. + * + * The builder is not reusable. + */ + public ChapterInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ChapterInfo.Builder builder() { + return new ChapterInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ChapterInfo.Builder toBuilder() { + return new ChapterInfo.Builder().startPositionTicks(getStartPositionTicks()).name(getName()) + .imagePath(getImagePath()).imageDateModified(getImageDateModified()).imageTag(getImageTag()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ClientCapabilities.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ClientCapabilities.java new file mode 100644 index 0000000000000..1592749a92ed4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ClientCapabilities.java @@ -0,0 +1,600 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ClientCapabilities + */ +@JsonPropertyOrder({ ClientCapabilities.JSON_PROPERTY_PLAYABLE_MEDIA_TYPES, + ClientCapabilities.JSON_PROPERTY_SUPPORTED_COMMANDS, ClientCapabilities.JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL, + ClientCapabilities.JSON_PROPERTY_SUPPORTS_CONTENT_UPLOADING, + ClientCapabilities.JSON_PROPERTY_MESSAGE_CALLBACK_URL, + ClientCapabilities.JSON_PROPERTY_SUPPORTS_PERSISTENT_IDENTIFIER, ClientCapabilities.JSON_PROPERTY_SUPPORTS_SYNC, + ClientCapabilities.JSON_PROPERTY_DEVICE_PROFILE, ClientCapabilities.JSON_PROPERTY_APP_STORE_URL, + ClientCapabilities.JSON_PROPERTY_ICON_URL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ClientCapabilities { + public static final String JSON_PROPERTY_PLAYABLE_MEDIA_TYPES = "PlayableMediaTypes"; + @org.eclipse.jdt.annotation.NonNull + private List playableMediaTypes; + + public static final String JSON_PROPERTY_SUPPORTED_COMMANDS = "SupportedCommands"; + @org.eclipse.jdt.annotation.NonNull + private List supportedCommands; + + public static final String JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL = "SupportsMediaControl"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsMediaControl; + + public static final String JSON_PROPERTY_SUPPORTS_CONTENT_UPLOADING = "SupportsContentUploading"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsContentUploading; + + public static final String JSON_PROPERTY_MESSAGE_CALLBACK_URL = "MessageCallbackUrl"; + @org.eclipse.jdt.annotation.NonNull + private String messageCallbackUrl; + + public static final String JSON_PROPERTY_SUPPORTS_PERSISTENT_IDENTIFIER = "SupportsPersistentIdentifier"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsPersistentIdentifier; + + public static final String JSON_PROPERTY_SUPPORTS_SYNC = "SupportsSync"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsSync; + + public static final String JSON_PROPERTY_DEVICE_PROFILE = "DeviceProfile"; + @org.eclipse.jdt.annotation.NonNull + private DeviceProfile deviceProfile; + + public static final String JSON_PROPERTY_APP_STORE_URL = "AppStoreUrl"; + @org.eclipse.jdt.annotation.NonNull + private String appStoreUrl; + + public static final String JSON_PROPERTY_ICON_URL = "IconUrl"; + @org.eclipse.jdt.annotation.NonNull + private String iconUrl; + + public ClientCapabilities() { + } + + public ClientCapabilities playableMediaTypes(@org.eclipse.jdt.annotation.NonNull List playableMediaTypes) { + this.playableMediaTypes = playableMediaTypes; + return this; + } + + public ClientCapabilities addPlayableMediaTypesItem(String playableMediaTypesItem) { + if (this.playableMediaTypes == null) { + this.playableMediaTypes = new ArrayList<>(); + } + this.playableMediaTypes.add(playableMediaTypesItem); + return this; + } + + /** + * Get playableMediaTypes + * + * @return playableMediaTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYABLE_MEDIA_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPlayableMediaTypes() { + return playableMediaTypes; + } + + @JsonProperty(JSON_PROPERTY_PLAYABLE_MEDIA_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayableMediaTypes(@org.eclipse.jdt.annotation.NonNull List playableMediaTypes) { + this.playableMediaTypes = playableMediaTypes; + } + + public ClientCapabilities supportedCommands( + @org.eclipse.jdt.annotation.NonNull List supportedCommands) { + this.supportedCommands = supportedCommands; + return this; + } + + public ClientCapabilities addSupportedCommandsItem(GeneralCommandType supportedCommandsItem) { + if (this.supportedCommands == null) { + this.supportedCommands = new ArrayList<>(); + } + this.supportedCommands.add(supportedCommandsItem); + return this; + } + + /** + * Get supportedCommands + * + * @return supportedCommands + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTED_COMMANDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSupportedCommands() { + return supportedCommands; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTED_COMMANDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportedCommands(@org.eclipse.jdt.annotation.NonNull List supportedCommands) { + this.supportedCommands = supportedCommands; + } + + public ClientCapabilities supportsMediaControl(@org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl) { + this.supportsMediaControl = supportsMediaControl; + return this; + } + + /** + * Get supportsMediaControl + * + * @return supportsMediaControl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsMediaControl() { + return supportsMediaControl; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsMediaControl(@org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl) { + this.supportsMediaControl = supportsMediaControl; + } + + public ClientCapabilities supportsContentUploading( + @org.eclipse.jdt.annotation.NonNull Boolean supportsContentUploading) { + this.supportsContentUploading = supportsContentUploading; + return this; + } + + /** + * Get supportsContentUploading + * + * @return supportsContentUploading + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_CONTENT_UPLOADING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsContentUploading() { + return supportsContentUploading; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_CONTENT_UPLOADING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsContentUploading(@org.eclipse.jdt.annotation.NonNull Boolean supportsContentUploading) { + this.supportsContentUploading = supportsContentUploading; + } + + public ClientCapabilities messageCallbackUrl(@org.eclipse.jdt.annotation.NonNull String messageCallbackUrl) { + this.messageCallbackUrl = messageCallbackUrl; + return this; + } + + /** + * Get messageCallbackUrl + * + * @return messageCallbackUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessageCallbackUrl() { + return messageCallbackUrl; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageCallbackUrl(@org.eclipse.jdt.annotation.NonNull String messageCallbackUrl) { + this.messageCallbackUrl = messageCallbackUrl; + } + + public ClientCapabilities supportsPersistentIdentifier( + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier) { + this.supportsPersistentIdentifier = supportsPersistentIdentifier; + return this; + } + + /** + * Get supportsPersistentIdentifier + * + * @return supportsPersistentIdentifier + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_PERSISTENT_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsPersistentIdentifier() { + return supportsPersistentIdentifier; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_PERSISTENT_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsPersistentIdentifier( + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier) { + this.supportsPersistentIdentifier = supportsPersistentIdentifier; + } + + public ClientCapabilities supportsSync(@org.eclipse.jdt.annotation.NonNull Boolean supportsSync) { + this.supportsSync = supportsSync; + return this; + } + + /** + * Get supportsSync + * + * @return supportsSync + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_SYNC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsSync() { + return supportsSync; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_SYNC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsSync(@org.eclipse.jdt.annotation.NonNull Boolean supportsSync) { + this.supportsSync = supportsSync; + } + + public ClientCapabilities deviceProfile(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) { + this.deviceProfile = deviceProfile; + return this; + } + + /** + * A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain + * device is able to play. <br /> Specifically, it defines the supported <see + * cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles\">containers</see> and + * <see cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles\">codecs</see> + * (video and/or audio, including codec profiles and levels) the device is able to direct play (without transcoding + * or remuxing), as well as which <see + * cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles\">containers/codecs to + * transcode to</see> in case it isn't. + * + * @return deviceProfile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceProfile getDeviceProfile() { + return deviceProfile; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceProfile(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) { + this.deviceProfile = deviceProfile; + } + + public ClientCapabilities appStoreUrl(@org.eclipse.jdt.annotation.NonNull String appStoreUrl) { + this.appStoreUrl = appStoreUrl; + return this; + } + + /** + * Get appStoreUrl + * + * @return appStoreUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APP_STORE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppStoreUrl() { + return appStoreUrl; + } + + @JsonProperty(JSON_PROPERTY_APP_STORE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppStoreUrl(@org.eclipse.jdt.annotation.NonNull String appStoreUrl) { + this.appStoreUrl = appStoreUrl; + } + + public ClientCapabilities iconUrl(@org.eclipse.jdt.annotation.NonNull String iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + /** + * Get iconUrl + * + * @return iconUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ICON_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIconUrl() { + return iconUrl; + } + + @JsonProperty(JSON_PROPERTY_ICON_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIconUrl(@org.eclipse.jdt.annotation.NonNull String iconUrl) { + this.iconUrl = iconUrl; + } + + /** + * Return true if this ClientCapabilities object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientCapabilities clientCapabilities = (ClientCapabilities) o; + return Objects.equals(this.playableMediaTypes, clientCapabilities.playableMediaTypes) + && Objects.equals(this.supportedCommands, clientCapabilities.supportedCommands) + && Objects.equals(this.supportsMediaControl, clientCapabilities.supportsMediaControl) + && Objects.equals(this.supportsContentUploading, clientCapabilities.supportsContentUploading) + && Objects.equals(this.messageCallbackUrl, clientCapabilities.messageCallbackUrl) + && Objects.equals(this.supportsPersistentIdentifier, clientCapabilities.supportsPersistentIdentifier) + && Objects.equals(this.supportsSync, clientCapabilities.supportsSync) + && Objects.equals(this.deviceProfile, clientCapabilities.deviceProfile) + && Objects.equals(this.appStoreUrl, clientCapabilities.appStoreUrl) + && Objects.equals(this.iconUrl, clientCapabilities.iconUrl); + } + + @Override + public int hashCode() { + return Objects.hash(playableMediaTypes, supportedCommands, supportsMediaControl, supportsContentUploading, + messageCallbackUrl, supportsPersistentIdentifier, supportsSync, deviceProfile, appStoreUrl, iconUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClientCapabilities {\n"); + sb.append(" playableMediaTypes: ").append(toIndentedString(playableMediaTypes)).append("\n"); + sb.append(" supportedCommands: ").append(toIndentedString(supportedCommands)).append("\n"); + sb.append(" supportsMediaControl: ").append(toIndentedString(supportsMediaControl)).append("\n"); + sb.append(" supportsContentUploading: ").append(toIndentedString(supportsContentUploading)).append("\n"); + sb.append(" messageCallbackUrl: ").append(toIndentedString(messageCallbackUrl)).append("\n"); + sb.append(" supportsPersistentIdentifier: ").append(toIndentedString(supportsPersistentIdentifier)) + .append("\n"); + sb.append(" supportsSync: ").append(toIndentedString(supportsSync)).append("\n"); + sb.append(" deviceProfile: ").append(toIndentedString(deviceProfile)).append("\n"); + sb.append(" appStoreUrl: ").append(toIndentedString(appStoreUrl)).append("\n"); + sb.append(" iconUrl: ").append(toIndentedString(iconUrl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlayableMediaTypes` to the URL query string + if (getPlayableMediaTypes() != null) { + for (int i = 0; i < getPlayableMediaTypes().size(); i++) { + joiner.add(String.format("%sPlayableMediaTypes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getPlayableMediaTypes().get(i))))); + } + } + + // add `SupportedCommands` to the URL query string + if (getSupportedCommands() != null) { + for (int i = 0; i < getSupportedCommands().size(); i++) { + if (getSupportedCommands().get(i) != null) { + joiner.add(String.format("%sSupportedCommands%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSupportedCommands().get(i))))); + } + } + } + + // add `SupportsMediaControl` to the URL query string + if (getSupportsMediaControl() != null) { + joiner.add(String.format("%sSupportsMediaControl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsMediaControl())))); + } + + // add `SupportsContentUploading` to the URL query string + if (getSupportsContentUploading() != null) { + joiner.add(String.format("%sSupportsContentUploading%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsContentUploading())))); + } + + // add `MessageCallbackUrl` to the URL query string + if (getMessageCallbackUrl() != null) { + joiner.add(String.format("%sMessageCallbackUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageCallbackUrl())))); + } + + // add `SupportsPersistentIdentifier` to the URL query string + if (getSupportsPersistentIdentifier() != null) { + joiner.add(String.format("%sSupportsPersistentIdentifier%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsPersistentIdentifier())))); + } + + // add `SupportsSync` to the URL query string + if (getSupportsSync() != null) { + joiner.add(String.format("%sSupportsSync%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsSync())))); + } + + // add `DeviceProfile` to the URL query string + if (getDeviceProfile() != null) { + joiner.add(getDeviceProfile().toUrlQueryString(prefix + "DeviceProfile" + suffix)); + } + + // add `AppStoreUrl` to the URL query string + if (getAppStoreUrl() != null) { + joiner.add(String.format("%sAppStoreUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAppStoreUrl())))); + } + + // add `IconUrl` to the URL query string + if (getIconUrl() != null) { + joiner.add(String.format("%sIconUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIconUrl())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ClientCapabilities instance; + + public Builder() { + this(new ClientCapabilities()); + } + + protected Builder(ClientCapabilities instance) { + this.instance = instance; + } + + public ClientCapabilities.Builder playableMediaTypes(List playableMediaTypes) { + this.instance.playableMediaTypes = playableMediaTypes; + return this; + } + + public ClientCapabilities.Builder supportedCommands(List supportedCommands) { + this.instance.supportedCommands = supportedCommands; + return this; + } + + public ClientCapabilities.Builder supportsMediaControl(Boolean supportsMediaControl) { + this.instance.supportsMediaControl = supportsMediaControl; + return this; + } + + public ClientCapabilities.Builder supportsContentUploading(Boolean supportsContentUploading) { + this.instance.supportsContentUploading = supportsContentUploading; + return this; + } + + public ClientCapabilities.Builder messageCallbackUrl(String messageCallbackUrl) { + this.instance.messageCallbackUrl = messageCallbackUrl; + return this; + } + + public ClientCapabilities.Builder supportsPersistentIdentifier(Boolean supportsPersistentIdentifier) { + this.instance.supportsPersistentIdentifier = supportsPersistentIdentifier; + return this; + } + + public ClientCapabilities.Builder supportsSync(Boolean supportsSync) { + this.instance.supportsSync = supportsSync; + return this; + } + + public ClientCapabilities.Builder deviceProfile(DeviceProfile deviceProfile) { + this.instance.deviceProfile = deviceProfile; + return this; + } + + public ClientCapabilities.Builder appStoreUrl(String appStoreUrl) { + this.instance.appStoreUrl = appStoreUrl; + return this; + } + + public ClientCapabilities.Builder iconUrl(String iconUrl) { + this.instance.iconUrl = iconUrl; + return this; + } + + /** + * returns a built ClientCapabilities instance. + * + * The builder is not reusable. + */ + public ClientCapabilities build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ClientCapabilities.Builder builder() { + return new ClientCapabilities.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ClientCapabilities.Builder toBuilder() { + return new ClientCapabilities.Builder().playableMediaTypes(getPlayableMediaTypes()) + .supportedCommands(getSupportedCommands()).supportsMediaControl(getSupportsMediaControl()) + .supportsContentUploading(getSupportsContentUploading()).messageCallbackUrl(getMessageCallbackUrl()) + .supportsPersistentIdentifier(getSupportsPersistentIdentifier()).supportsSync(getSupportsSync()) + .deviceProfile(getDeviceProfile()).appStoreUrl(getAppStoreUrl()).iconUrl(getIconUrl()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ClientCapabilitiesDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ClientCapabilitiesDto.java new file mode 100644 index 0000000000000..c4fe5366ec652 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ClientCapabilitiesDto.java @@ -0,0 +1,603 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Client capabilities dto. + */ +@JsonPropertyOrder({ ClientCapabilitiesDto.JSON_PROPERTY_PLAYABLE_MEDIA_TYPES, + ClientCapabilitiesDto.JSON_PROPERTY_SUPPORTED_COMMANDS, + ClientCapabilitiesDto.JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL, + ClientCapabilitiesDto.JSON_PROPERTY_SUPPORTS_CONTENT_UPLOADING, + ClientCapabilitiesDto.JSON_PROPERTY_MESSAGE_CALLBACK_URL, + ClientCapabilitiesDto.JSON_PROPERTY_SUPPORTS_PERSISTENT_IDENTIFIER, + ClientCapabilitiesDto.JSON_PROPERTY_SUPPORTS_SYNC, ClientCapabilitiesDto.JSON_PROPERTY_DEVICE_PROFILE, + ClientCapabilitiesDto.JSON_PROPERTY_APP_STORE_URL, ClientCapabilitiesDto.JSON_PROPERTY_ICON_URL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ClientCapabilitiesDto { + public static final String JSON_PROPERTY_PLAYABLE_MEDIA_TYPES = "PlayableMediaTypes"; + @org.eclipse.jdt.annotation.NonNull + private List playableMediaTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUPPORTED_COMMANDS = "SupportedCommands"; + @org.eclipse.jdt.annotation.NonNull + private List supportedCommands = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL = "SupportsMediaControl"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsMediaControl; + + public static final String JSON_PROPERTY_SUPPORTS_CONTENT_UPLOADING = "SupportsContentUploading"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsContentUploading; + + public static final String JSON_PROPERTY_MESSAGE_CALLBACK_URL = "MessageCallbackUrl"; + @org.eclipse.jdt.annotation.NonNull + private String messageCallbackUrl; + + public static final String JSON_PROPERTY_SUPPORTS_PERSISTENT_IDENTIFIER = "SupportsPersistentIdentifier"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsPersistentIdentifier; + + public static final String JSON_PROPERTY_SUPPORTS_SYNC = "SupportsSync"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsSync; + + public static final String JSON_PROPERTY_DEVICE_PROFILE = "DeviceProfile"; + @org.eclipse.jdt.annotation.NonNull + private DeviceProfile deviceProfile; + + public static final String JSON_PROPERTY_APP_STORE_URL = "AppStoreUrl"; + @org.eclipse.jdt.annotation.NonNull + private String appStoreUrl; + + public static final String JSON_PROPERTY_ICON_URL = "IconUrl"; + @org.eclipse.jdt.annotation.NonNull + private String iconUrl; + + public ClientCapabilitiesDto() { + } + + public ClientCapabilitiesDto playableMediaTypes( + @org.eclipse.jdt.annotation.NonNull List playableMediaTypes) { + this.playableMediaTypes = playableMediaTypes; + return this; + } + + public ClientCapabilitiesDto addPlayableMediaTypesItem(String playableMediaTypesItem) { + if (this.playableMediaTypes == null) { + this.playableMediaTypes = new ArrayList<>(); + } + this.playableMediaTypes.add(playableMediaTypesItem); + return this; + } + + /** + * Gets or sets the list of playable media types. + * + * @return playableMediaTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYABLE_MEDIA_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPlayableMediaTypes() { + return playableMediaTypes; + } + + @JsonProperty(JSON_PROPERTY_PLAYABLE_MEDIA_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayableMediaTypes(@org.eclipse.jdt.annotation.NonNull List playableMediaTypes) { + this.playableMediaTypes = playableMediaTypes; + } + + public ClientCapabilitiesDto supportedCommands( + @org.eclipse.jdt.annotation.NonNull List supportedCommands) { + this.supportedCommands = supportedCommands; + return this; + } + + public ClientCapabilitiesDto addSupportedCommandsItem(GeneralCommandType supportedCommandsItem) { + if (this.supportedCommands == null) { + this.supportedCommands = new ArrayList<>(); + } + this.supportedCommands.add(supportedCommandsItem); + return this; + } + + /** + * Gets or sets the list of supported commands. + * + * @return supportedCommands + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTED_COMMANDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSupportedCommands() { + return supportedCommands; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTED_COMMANDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportedCommands(@org.eclipse.jdt.annotation.NonNull List supportedCommands) { + this.supportedCommands = supportedCommands; + } + + public ClientCapabilitiesDto supportsMediaControl( + @org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl) { + this.supportsMediaControl = supportsMediaControl; + return this; + } + + /** + * Gets or sets a value indicating whether session supports media control. + * + * @return supportsMediaControl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsMediaControl() { + return supportsMediaControl; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsMediaControl(@org.eclipse.jdt.annotation.NonNull Boolean supportsMediaControl) { + this.supportsMediaControl = supportsMediaControl; + } + + public ClientCapabilitiesDto supportsContentUploading( + @org.eclipse.jdt.annotation.NonNull Boolean supportsContentUploading) { + this.supportsContentUploading = supportsContentUploading; + return this; + } + + /** + * Gets or sets a value indicating whether session supports content uploading. + * + * @return supportsContentUploading + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_CONTENT_UPLOADING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsContentUploading() { + return supportsContentUploading; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_CONTENT_UPLOADING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsContentUploading(@org.eclipse.jdt.annotation.NonNull Boolean supportsContentUploading) { + this.supportsContentUploading = supportsContentUploading; + } + + public ClientCapabilitiesDto messageCallbackUrl(@org.eclipse.jdt.annotation.NonNull String messageCallbackUrl) { + this.messageCallbackUrl = messageCallbackUrl; + return this; + } + + /** + * Gets or sets the message callback url. + * + * @return messageCallbackUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MESSAGE_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessageCallbackUrl() { + return messageCallbackUrl; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageCallbackUrl(@org.eclipse.jdt.annotation.NonNull String messageCallbackUrl) { + this.messageCallbackUrl = messageCallbackUrl; + } + + public ClientCapabilitiesDto supportsPersistentIdentifier( + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier) { + this.supportsPersistentIdentifier = supportsPersistentIdentifier; + return this; + } + + /** + * Gets or sets a value indicating whether session supports a persistent identifier. + * + * @return supportsPersistentIdentifier + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_PERSISTENT_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsPersistentIdentifier() { + return supportsPersistentIdentifier; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_PERSISTENT_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsPersistentIdentifier( + @org.eclipse.jdt.annotation.NonNull Boolean supportsPersistentIdentifier) { + this.supportsPersistentIdentifier = supportsPersistentIdentifier; + } + + public ClientCapabilitiesDto supportsSync(@org.eclipse.jdt.annotation.NonNull Boolean supportsSync) { + this.supportsSync = supportsSync; + return this; + } + + /** + * Gets or sets a value indicating whether session supports sync. + * + * @return supportsSync + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_SYNC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsSync() { + return supportsSync; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_SYNC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsSync(@org.eclipse.jdt.annotation.NonNull Boolean supportsSync) { + this.supportsSync = supportsSync; + } + + public ClientCapabilitiesDto deviceProfile(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) { + this.deviceProfile = deviceProfile; + return this; + } + + /** + * A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain + * device is able to play. <br /> Specifically, it defines the supported <see + * cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles\">containers</see> and + * <see cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles\">codecs</see> + * (video and/or audio, including codec profiles and levels) the device is able to direct play (without transcoding + * or remuxing), as well as which <see + * cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles\">containers/codecs to + * transcode to</see> in case it isn't. + * + * @return deviceProfile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceProfile getDeviceProfile() { + return deviceProfile; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceProfile(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) { + this.deviceProfile = deviceProfile; + } + + public ClientCapabilitiesDto appStoreUrl(@org.eclipse.jdt.annotation.NonNull String appStoreUrl) { + this.appStoreUrl = appStoreUrl; + return this; + } + + /** + * Gets or sets the app store url. + * + * @return appStoreUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APP_STORE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppStoreUrl() { + return appStoreUrl; + } + + @JsonProperty(JSON_PROPERTY_APP_STORE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppStoreUrl(@org.eclipse.jdt.annotation.NonNull String appStoreUrl) { + this.appStoreUrl = appStoreUrl; + } + + public ClientCapabilitiesDto iconUrl(@org.eclipse.jdt.annotation.NonNull String iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + /** + * Gets or sets the icon url. + * + * @return iconUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ICON_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIconUrl() { + return iconUrl; + } + + @JsonProperty(JSON_PROPERTY_ICON_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIconUrl(@org.eclipse.jdt.annotation.NonNull String iconUrl) { + this.iconUrl = iconUrl; + } + + /** + * Return true if this ClientCapabilitiesDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientCapabilitiesDto clientCapabilitiesDto = (ClientCapabilitiesDto) o; + return Objects.equals(this.playableMediaTypes, clientCapabilitiesDto.playableMediaTypes) + && Objects.equals(this.supportedCommands, clientCapabilitiesDto.supportedCommands) + && Objects.equals(this.supportsMediaControl, clientCapabilitiesDto.supportsMediaControl) + && Objects.equals(this.supportsContentUploading, clientCapabilitiesDto.supportsContentUploading) + && Objects.equals(this.messageCallbackUrl, clientCapabilitiesDto.messageCallbackUrl) + && Objects.equals(this.supportsPersistentIdentifier, clientCapabilitiesDto.supportsPersistentIdentifier) + && Objects.equals(this.supportsSync, clientCapabilitiesDto.supportsSync) + && Objects.equals(this.deviceProfile, clientCapabilitiesDto.deviceProfile) + && Objects.equals(this.appStoreUrl, clientCapabilitiesDto.appStoreUrl) + && Objects.equals(this.iconUrl, clientCapabilitiesDto.iconUrl); + } + + @Override + public int hashCode() { + return Objects.hash(playableMediaTypes, supportedCommands, supportsMediaControl, supportsContentUploading, + messageCallbackUrl, supportsPersistentIdentifier, supportsSync, deviceProfile, appStoreUrl, iconUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClientCapabilitiesDto {\n"); + sb.append(" playableMediaTypes: ").append(toIndentedString(playableMediaTypes)).append("\n"); + sb.append(" supportedCommands: ").append(toIndentedString(supportedCommands)).append("\n"); + sb.append(" supportsMediaControl: ").append(toIndentedString(supportsMediaControl)).append("\n"); + sb.append(" supportsContentUploading: ").append(toIndentedString(supportsContentUploading)).append("\n"); + sb.append(" messageCallbackUrl: ").append(toIndentedString(messageCallbackUrl)).append("\n"); + sb.append(" supportsPersistentIdentifier: ").append(toIndentedString(supportsPersistentIdentifier)) + .append("\n"); + sb.append(" supportsSync: ").append(toIndentedString(supportsSync)).append("\n"); + sb.append(" deviceProfile: ").append(toIndentedString(deviceProfile)).append("\n"); + sb.append(" appStoreUrl: ").append(toIndentedString(appStoreUrl)).append("\n"); + sb.append(" iconUrl: ").append(toIndentedString(iconUrl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlayableMediaTypes` to the URL query string + if (getPlayableMediaTypes() != null) { + for (int i = 0; i < getPlayableMediaTypes().size(); i++) { + joiner.add(String.format("%sPlayableMediaTypes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getPlayableMediaTypes().get(i))))); + } + } + + // add `SupportedCommands` to the URL query string + if (getSupportedCommands() != null) { + for (int i = 0; i < getSupportedCommands().size(); i++) { + if (getSupportedCommands().get(i) != null) { + joiner.add(String.format("%sSupportedCommands%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSupportedCommands().get(i))))); + } + } + } + + // add `SupportsMediaControl` to the URL query string + if (getSupportsMediaControl() != null) { + joiner.add(String.format("%sSupportsMediaControl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsMediaControl())))); + } + + // add `SupportsContentUploading` to the URL query string + if (getSupportsContentUploading() != null) { + joiner.add(String.format("%sSupportsContentUploading%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsContentUploading())))); + } + + // add `MessageCallbackUrl` to the URL query string + if (getMessageCallbackUrl() != null) { + joiner.add(String.format("%sMessageCallbackUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMessageCallbackUrl())))); + } + + // add `SupportsPersistentIdentifier` to the URL query string + if (getSupportsPersistentIdentifier() != null) { + joiner.add(String.format("%sSupportsPersistentIdentifier%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsPersistentIdentifier())))); + } + + // add `SupportsSync` to the URL query string + if (getSupportsSync() != null) { + joiner.add(String.format("%sSupportsSync%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsSync())))); + } + + // add `DeviceProfile` to the URL query string + if (getDeviceProfile() != null) { + joiner.add(getDeviceProfile().toUrlQueryString(prefix + "DeviceProfile" + suffix)); + } + + // add `AppStoreUrl` to the URL query string + if (getAppStoreUrl() != null) { + joiner.add(String.format("%sAppStoreUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAppStoreUrl())))); + } + + // add `IconUrl` to the URL query string + if (getIconUrl() != null) { + joiner.add(String.format("%sIconUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIconUrl())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ClientCapabilitiesDto instance; + + public Builder() { + this(new ClientCapabilitiesDto()); + } + + protected Builder(ClientCapabilitiesDto instance) { + this.instance = instance; + } + + public ClientCapabilitiesDto.Builder playableMediaTypes(List playableMediaTypes) { + this.instance.playableMediaTypes = playableMediaTypes; + return this; + } + + public ClientCapabilitiesDto.Builder supportedCommands(List supportedCommands) { + this.instance.supportedCommands = supportedCommands; + return this; + } + + public ClientCapabilitiesDto.Builder supportsMediaControl(Boolean supportsMediaControl) { + this.instance.supportsMediaControl = supportsMediaControl; + return this; + } + + public ClientCapabilitiesDto.Builder supportsContentUploading(Boolean supportsContentUploading) { + this.instance.supportsContentUploading = supportsContentUploading; + return this; + } + + public ClientCapabilitiesDto.Builder messageCallbackUrl(String messageCallbackUrl) { + this.instance.messageCallbackUrl = messageCallbackUrl; + return this; + } + + public ClientCapabilitiesDto.Builder supportsPersistentIdentifier(Boolean supportsPersistentIdentifier) { + this.instance.supportsPersistentIdentifier = supportsPersistentIdentifier; + return this; + } + + public ClientCapabilitiesDto.Builder supportsSync(Boolean supportsSync) { + this.instance.supportsSync = supportsSync; + return this; + } + + public ClientCapabilitiesDto.Builder deviceProfile(DeviceProfile deviceProfile) { + this.instance.deviceProfile = deviceProfile; + return this; + } + + public ClientCapabilitiesDto.Builder appStoreUrl(String appStoreUrl) { + this.instance.appStoreUrl = appStoreUrl; + return this; + } + + public ClientCapabilitiesDto.Builder iconUrl(String iconUrl) { + this.instance.iconUrl = iconUrl; + return this; + } + + /** + * returns a built ClientCapabilitiesDto instance. + * + * The builder is not reusable. + */ + public ClientCapabilitiesDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ClientCapabilitiesDto.Builder builder() { + return new ClientCapabilitiesDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ClientCapabilitiesDto.Builder toBuilder() { + return new ClientCapabilitiesDto.Builder().playableMediaTypes(getPlayableMediaTypes()) + .supportedCommands(getSupportedCommands()).supportsMediaControl(getSupportsMediaControl()) + .supportsContentUploading(getSupportsContentUploading()).messageCallbackUrl(getMessageCallbackUrl()) + .supportsPersistentIdentifier(getSupportsPersistentIdentifier()).supportsSync(getSupportsSync()) + .deviceProfile(getDeviceProfile()).appStoreUrl(getAppStoreUrl()).iconUrl(getIconUrl()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ClientLogDocumentResponseDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ClientLogDocumentResponseDto.java new file mode 100644 index 0000000000000..5763c9e4941e5 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ClientLogDocumentResponseDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Client log document response dto. + */ +@JsonPropertyOrder({ ClientLogDocumentResponseDto.JSON_PROPERTY_FILE_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ClientLogDocumentResponseDto { + public static final String JSON_PROPERTY_FILE_NAME = "FileName"; + @org.eclipse.jdt.annotation.NonNull + private String fileName; + + public ClientLogDocumentResponseDto() { + } + + public ClientLogDocumentResponseDto fileName(@org.eclipse.jdt.annotation.NonNull String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Gets the resulting filename. + * + * @return fileName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FILE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFileName() { + return fileName; + } + + @JsonProperty(JSON_PROPERTY_FILE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileName(@org.eclipse.jdt.annotation.NonNull String fileName) { + this.fileName = fileName; + } + + /** + * Return true if this ClientLogDocumentResponseDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientLogDocumentResponseDto clientLogDocumentResponseDto = (ClientLogDocumentResponseDto) o; + return Objects.equals(this.fileName, clientLogDocumentResponseDto.fileName); + } + + @Override + public int hashCode() { + return Objects.hash(fileName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClientLogDocumentResponseDto {\n"); + sb.append(" fileName: ").append(toIndentedString(fileName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `FileName` to the URL query string + if (getFileName() != null) { + joiner.add(String.format("%sFileName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFileName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ClientLogDocumentResponseDto instance; + + public Builder() { + this(new ClientLogDocumentResponseDto()); + } + + protected Builder(ClientLogDocumentResponseDto instance) { + this.instance = instance; + } + + public ClientLogDocumentResponseDto.Builder fileName(String fileName) { + this.instance.fileName = fileName; + return this; + } + + /** + * returns a built ClientLogDocumentResponseDto instance. + * + * The builder is not reusable. + */ + public ClientLogDocumentResponseDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ClientLogDocumentResponseDto.Builder builder() { + return new ClientLogDocumentResponseDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ClientLogDocumentResponseDto.Builder toBuilder() { + return new ClientLogDocumentResponseDto.Builder().fileName(getFileName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CodecProfile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CodecProfile.java new file mode 100644 index 0000000000000..9d0c7671779db --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CodecProfile.java @@ -0,0 +1,381 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * CodecProfile + */ +@JsonPropertyOrder({ CodecProfile.JSON_PROPERTY_TYPE, CodecProfile.JSON_PROPERTY_CONDITIONS, + CodecProfile.JSON_PROPERTY_APPLY_CONDITIONS, CodecProfile.JSON_PROPERTY_CODEC, + CodecProfile.JSON_PROPERTY_CONTAINER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class CodecProfile { + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private CodecType type; + + public static final String JSON_PROPERTY_CONDITIONS = "Conditions"; + @org.eclipse.jdt.annotation.NonNull + private List conditions; + + public static final String JSON_PROPERTY_APPLY_CONDITIONS = "ApplyConditions"; + @org.eclipse.jdt.annotation.NonNull + private List applyConditions; + + public static final String JSON_PROPERTY_CODEC = "Codec"; + @org.eclipse.jdt.annotation.NonNull + private String codec; + + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public CodecProfile() { + } + + public CodecProfile type(@org.eclipse.jdt.annotation.NonNull CodecType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CodecType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull CodecType type) { + this.type = type; + } + + public CodecProfile conditions(@org.eclipse.jdt.annotation.NonNull List conditions) { + this.conditions = conditions; + return this; + } + + public CodecProfile addConditionsItem(ProfileCondition conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * Get conditions + * + * @return conditions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getConditions() { + return conditions; + } + + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConditions(@org.eclipse.jdt.annotation.NonNull List conditions) { + this.conditions = conditions; + } + + public CodecProfile applyConditions(@org.eclipse.jdt.annotation.NonNull List applyConditions) { + this.applyConditions = applyConditions; + return this; + } + + public CodecProfile addApplyConditionsItem(ProfileCondition applyConditionsItem) { + if (this.applyConditions == null) { + this.applyConditions = new ArrayList<>(); + } + this.applyConditions.add(applyConditionsItem); + return this; + } + + /** + * Get applyConditions + * + * @return applyConditions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APPLY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getApplyConditions() { + return applyConditions; + } + + @JsonProperty(JSON_PROPERTY_APPLY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApplyConditions(@org.eclipse.jdt.annotation.NonNull List applyConditions) { + this.applyConditions = applyConditions; + } + + public CodecProfile codec(@org.eclipse.jdt.annotation.NonNull String codec) { + this.codec = codec; + return this; + } + + /** + * Get codec + * + * @return codec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCodec() { + return codec; + } + + @JsonProperty(JSON_PROPERTY_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCodec(@org.eclipse.jdt.annotation.NonNull String codec) { + this.codec = codec; + } + + public CodecProfile container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Get container + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + /** + * Return true if this CodecProfile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CodecProfile codecProfile = (CodecProfile) o; + return Objects.equals(this.type, codecProfile.type) && Objects.equals(this.conditions, codecProfile.conditions) + && Objects.equals(this.applyConditions, codecProfile.applyConditions) + && Objects.equals(this.codec, codecProfile.codec) + && Objects.equals(this.container, codecProfile.container); + } + + @Override + public int hashCode() { + return Objects.hash(type, conditions, applyConditions, codec, container); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CodecProfile {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" applyConditions: ").append(toIndentedString(applyConditions)).append("\n"); + sb.append(" codec: ").append(toIndentedString(codec)).append("\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `Conditions` to the URL query string + if (getConditions() != null) { + for (int i = 0; i < getConditions().size(); i++) { + if (getConditions().get(i) != null) { + joiner.add(getConditions().get(i).toUrlQueryString(String.format("%sConditions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ApplyConditions` to the URL query string + if (getApplyConditions() != null) { + for (int i = 0; i < getApplyConditions().size(); i++) { + if (getApplyConditions().get(i) != null) { + joiner.add(getApplyConditions().get(i).toUrlQueryString(String.format("%sApplyConditions%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Codec` to the URL query string + if (getCodec() != null) { + joiner.add(String.format("%sCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCodec())))); + } + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private CodecProfile instance; + + public Builder() { + this(new CodecProfile()); + } + + protected Builder(CodecProfile instance) { + this.instance = instance; + } + + public CodecProfile.Builder type(CodecType type) { + this.instance.type = type; + return this; + } + + public CodecProfile.Builder conditions(List conditions) { + this.instance.conditions = conditions; + return this; + } + + public CodecProfile.Builder applyConditions(List applyConditions) { + this.instance.applyConditions = applyConditions; + return this; + } + + public CodecProfile.Builder codec(String codec) { + this.instance.codec = codec; + return this; + } + + public CodecProfile.Builder container(String container) { + this.instance.container = container; + return this; + } + + /** + * returns a built CodecProfile instance. + * + * The builder is not reusable. + */ + public CodecProfile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CodecProfile.Builder builder() { + return new CodecProfile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CodecProfile.Builder toBuilder() { + return new CodecProfile.Builder().type(getType()).conditions(getConditions()) + .applyConditions(getApplyConditions()).codec(getCodec()).container(getContainer()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CodecType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CodecType.java new file mode 100644 index 0000000000000..10648ce3ac0fe --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CodecType.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets CodecType + */ +public enum CodecType { + + VIDEO("Video"), + + VIDEO_AUDIO("VideoAudio"), + + AUDIO("Audio"); + + private String value; + + CodecType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CodecType fromValue(String value) { + for (CodecType b : CodecType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CollectionCreationResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CollectionCreationResult.java new file mode 100644 index 0000000000000..427bfbab978e6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CollectionCreationResult.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * CollectionCreationResult + */ +@JsonPropertyOrder({ CollectionCreationResult.JSON_PROPERTY_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class CollectionCreationResult { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public CollectionCreationResult() { + } + + public CollectionCreationResult id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + /** + * Return true if this CollectionCreationResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CollectionCreationResult collectionCreationResult = (CollectionCreationResult) o; + return Objects.equals(this.id, collectionCreationResult.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CollectionCreationResult {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private CollectionCreationResult instance; + + public Builder() { + this(new CollectionCreationResult()); + } + + protected Builder(CollectionCreationResult instance) { + this.instance = instance; + } + + public CollectionCreationResult.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + /** + * returns a built CollectionCreationResult instance. + * + * The builder is not reusable. + */ + public CollectionCreationResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CollectionCreationResult.Builder builder() { + return new CollectionCreationResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CollectionCreationResult.Builder toBuilder() { + return new CollectionCreationResult.Builder().id(getId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CollectionTypeOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CollectionTypeOptions.java new file mode 100644 index 0000000000000..adf9a17ff6a3a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CollectionTypeOptions.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets CollectionTypeOptions + */ +public enum CollectionTypeOptions { + + MOVIES("Movies"), + + TV_SHOWS("TvShows"), + + MUSIC("Music"), + + MUSIC_VIDEOS("MusicVideos"), + + HOME_VIDEOS("HomeVideos"), + + BOX_SETS("BoxSets"), + + BOOKS("Books"), + + MIXED("Mixed"); + + private String value; + + CollectionTypeOptions(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CollectionTypeOptions fromValue(String value) { + for (CollectionTypeOptions b : CollectionTypeOptions.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ConfigImageTypes.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ConfigImageTypes.java new file mode 100644 index 0000000000000..df66e6fa22cfb --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ConfigImageTypes.java @@ -0,0 +1,494 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ConfigImageTypes + */ +@JsonPropertyOrder({ ConfigImageTypes.JSON_PROPERTY_BACKDROP_SIZES, ConfigImageTypes.JSON_PROPERTY_BASE_URL, + ConfigImageTypes.JSON_PROPERTY_LOGO_SIZES, ConfigImageTypes.JSON_PROPERTY_POSTER_SIZES, + ConfigImageTypes.JSON_PROPERTY_PROFILE_SIZES, ConfigImageTypes.JSON_PROPERTY_SECURE_BASE_URL, + ConfigImageTypes.JSON_PROPERTY_STILL_SIZES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ConfigImageTypes { + public static final String JSON_PROPERTY_BACKDROP_SIZES = "BackdropSizes"; + @org.eclipse.jdt.annotation.NonNull + private List backdropSizes; + + public static final String JSON_PROPERTY_BASE_URL = "BaseUrl"; + @org.eclipse.jdt.annotation.NonNull + private String baseUrl; + + public static final String JSON_PROPERTY_LOGO_SIZES = "LogoSizes"; + @org.eclipse.jdt.annotation.NonNull + private List logoSizes; + + public static final String JSON_PROPERTY_POSTER_SIZES = "PosterSizes"; + @org.eclipse.jdt.annotation.NonNull + private List posterSizes; + + public static final String JSON_PROPERTY_PROFILE_SIZES = "ProfileSizes"; + @org.eclipse.jdt.annotation.NonNull + private List profileSizes; + + public static final String JSON_PROPERTY_SECURE_BASE_URL = "SecureBaseUrl"; + @org.eclipse.jdt.annotation.NonNull + private String secureBaseUrl; + + public static final String JSON_PROPERTY_STILL_SIZES = "StillSizes"; + @org.eclipse.jdt.annotation.NonNull + private List stillSizes; + + public ConfigImageTypes() { + } + + public ConfigImageTypes backdropSizes(@org.eclipse.jdt.annotation.NonNull List backdropSizes) { + this.backdropSizes = backdropSizes; + return this; + } + + public ConfigImageTypes addBackdropSizesItem(String backdropSizesItem) { + if (this.backdropSizes == null) { + this.backdropSizes = new ArrayList<>(); + } + this.backdropSizes.add(backdropSizesItem); + return this; + } + + /** + * Get backdropSizes + * + * @return backdropSizes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BACKDROP_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBackdropSizes() { + return backdropSizes; + } + + @JsonProperty(JSON_PROPERTY_BACKDROP_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBackdropSizes(@org.eclipse.jdt.annotation.NonNull List backdropSizes) { + this.backdropSizes = backdropSizes; + } + + public ConfigImageTypes baseUrl(@org.eclipse.jdt.annotation.NonNull String baseUrl) { + this.baseUrl = baseUrl; + return this; + } + + /** + * Get baseUrl + * + * @return baseUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BASE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaseUrl() { + return baseUrl; + } + + @JsonProperty(JSON_PROPERTY_BASE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBaseUrl(@org.eclipse.jdt.annotation.NonNull String baseUrl) { + this.baseUrl = baseUrl; + } + + public ConfigImageTypes logoSizes(@org.eclipse.jdt.annotation.NonNull List logoSizes) { + this.logoSizes = logoSizes; + return this; + } + + public ConfigImageTypes addLogoSizesItem(String logoSizesItem) { + if (this.logoSizes == null) { + this.logoSizes = new ArrayList<>(); + } + this.logoSizes.add(logoSizesItem); + return this; + } + + /** + * Get logoSizes + * + * @return logoSizes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOGO_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLogoSizes() { + return logoSizes; + } + + @JsonProperty(JSON_PROPERTY_LOGO_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogoSizes(@org.eclipse.jdt.annotation.NonNull List logoSizes) { + this.logoSizes = logoSizes; + } + + public ConfigImageTypes posterSizes(@org.eclipse.jdt.annotation.NonNull List posterSizes) { + this.posterSizes = posterSizes; + return this; + } + + public ConfigImageTypes addPosterSizesItem(String posterSizesItem) { + if (this.posterSizes == null) { + this.posterSizes = new ArrayList<>(); + } + this.posterSizes.add(posterSizesItem); + return this; + } + + /** + * Get posterSizes + * + * @return posterSizes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSTER_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPosterSizes() { + return posterSizes; + } + + @JsonProperty(JSON_PROPERTY_POSTER_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPosterSizes(@org.eclipse.jdt.annotation.NonNull List posterSizes) { + this.posterSizes = posterSizes; + } + + public ConfigImageTypes profileSizes(@org.eclipse.jdt.annotation.NonNull List profileSizes) { + this.profileSizes = profileSizes; + return this; + } + + public ConfigImageTypes addProfileSizesItem(String profileSizesItem) { + if (this.profileSizes == null) { + this.profileSizes = new ArrayList<>(); + } + this.profileSizes.add(profileSizesItem); + return this; + } + + /** + * Get profileSizes + * + * @return profileSizes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROFILE_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getProfileSizes() { + return profileSizes; + } + + @JsonProperty(JSON_PROPERTY_PROFILE_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProfileSizes(@org.eclipse.jdt.annotation.NonNull List profileSizes) { + this.profileSizes = profileSizes; + } + + public ConfigImageTypes secureBaseUrl(@org.eclipse.jdt.annotation.NonNull String secureBaseUrl) { + this.secureBaseUrl = secureBaseUrl; + return this; + } + + /** + * Get secureBaseUrl + * + * @return secureBaseUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SECURE_BASE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecureBaseUrl() { + return secureBaseUrl; + } + + @JsonProperty(JSON_PROPERTY_SECURE_BASE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecureBaseUrl(@org.eclipse.jdt.annotation.NonNull String secureBaseUrl) { + this.secureBaseUrl = secureBaseUrl; + } + + public ConfigImageTypes stillSizes(@org.eclipse.jdt.annotation.NonNull List stillSizes) { + this.stillSizes = stillSizes; + return this; + } + + public ConfigImageTypes addStillSizesItem(String stillSizesItem) { + if (this.stillSizes == null) { + this.stillSizes = new ArrayList<>(); + } + this.stillSizes.add(stillSizesItem); + return this; + } + + /** + * Get stillSizes + * + * @return stillSizes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STILL_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStillSizes() { + return stillSizes; + } + + @JsonProperty(JSON_PROPERTY_STILL_SIZES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStillSizes(@org.eclipse.jdt.annotation.NonNull List stillSizes) { + this.stillSizes = stillSizes; + } + + /** + * Return true if this ConfigImageTypes object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConfigImageTypes configImageTypes = (ConfigImageTypes) o; + return Objects.equals(this.backdropSizes, configImageTypes.backdropSizes) + && Objects.equals(this.baseUrl, configImageTypes.baseUrl) + && Objects.equals(this.logoSizes, configImageTypes.logoSizes) + && Objects.equals(this.posterSizes, configImageTypes.posterSizes) + && Objects.equals(this.profileSizes, configImageTypes.profileSizes) + && Objects.equals(this.secureBaseUrl, configImageTypes.secureBaseUrl) + && Objects.equals(this.stillSizes, configImageTypes.stillSizes); + } + + @Override + public int hashCode() { + return Objects.hash(backdropSizes, baseUrl, logoSizes, posterSizes, profileSizes, secureBaseUrl, stillSizes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConfigImageTypes {\n"); + sb.append(" backdropSizes: ").append(toIndentedString(backdropSizes)).append("\n"); + sb.append(" baseUrl: ").append(toIndentedString(baseUrl)).append("\n"); + sb.append(" logoSizes: ").append(toIndentedString(logoSizes)).append("\n"); + sb.append(" posterSizes: ").append(toIndentedString(posterSizes)).append("\n"); + sb.append(" profileSizes: ").append(toIndentedString(profileSizes)).append("\n"); + sb.append(" secureBaseUrl: ").append(toIndentedString(secureBaseUrl)).append("\n"); + sb.append(" stillSizes: ").append(toIndentedString(stillSizes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `BackdropSizes` to the URL query string + if (getBackdropSizes() != null) { + for (int i = 0; i < getBackdropSizes().size(); i++) { + joiner.add(String.format("%sBackdropSizes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getBackdropSizes().get(i))))); + } + } + + // add `BaseUrl` to the URL query string + if (getBaseUrl() != null) { + joiner.add(String.format("%sBaseUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBaseUrl())))); + } + + // add `LogoSizes` to the URL query string + if (getLogoSizes() != null) { + for (int i = 0; i < getLogoSizes().size(); i++) { + joiner.add(String.format("%sLogoSizes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLogoSizes().get(i))))); + } + } + + // add `PosterSizes` to the URL query string + if (getPosterSizes() != null) { + for (int i = 0; i < getPosterSizes().size(); i++) { + joiner.add(String.format("%sPosterSizes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getPosterSizes().get(i))))); + } + } + + // add `ProfileSizes` to the URL query string + if (getProfileSizes() != null) { + for (int i = 0; i < getProfileSizes().size(); i++) { + joiner.add(String.format("%sProfileSizes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getProfileSizes().get(i))))); + } + } + + // add `SecureBaseUrl` to the URL query string + if (getSecureBaseUrl() != null) { + joiner.add(String.format("%sSecureBaseUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSecureBaseUrl())))); + } + + // add `StillSizes` to the URL query string + if (getStillSizes() != null) { + for (int i = 0; i < getStillSizes().size(); i++) { + joiner.add(String.format("%sStillSizes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getStillSizes().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private ConfigImageTypes instance; + + public Builder() { + this(new ConfigImageTypes()); + } + + protected Builder(ConfigImageTypes instance) { + this.instance = instance; + } + + public ConfigImageTypes.Builder backdropSizes(List backdropSizes) { + this.instance.backdropSizes = backdropSizes; + return this; + } + + public ConfigImageTypes.Builder baseUrl(String baseUrl) { + this.instance.baseUrl = baseUrl; + return this; + } + + public ConfigImageTypes.Builder logoSizes(List logoSizes) { + this.instance.logoSizes = logoSizes; + return this; + } + + public ConfigImageTypes.Builder posterSizes(List posterSizes) { + this.instance.posterSizes = posterSizes; + return this; + } + + public ConfigImageTypes.Builder profileSizes(List profileSizes) { + this.instance.profileSizes = profileSizes; + return this; + } + + public ConfigImageTypes.Builder secureBaseUrl(String secureBaseUrl) { + this.instance.secureBaseUrl = secureBaseUrl; + return this; + } + + public ConfigImageTypes.Builder stillSizes(List stillSizes) { + this.instance.stillSizes = stillSizes; + return this; + } + + /** + * returns a built ConfigImageTypes instance. + * + * The builder is not reusable. + */ + public ConfigImageTypes build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ConfigImageTypes.Builder builder() { + return new ConfigImageTypes.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ConfigImageTypes.Builder toBuilder() { + return new ConfigImageTypes.Builder().backdropSizes(getBackdropSizes()).baseUrl(getBaseUrl()) + .logoSizes(getLogoSizes()).posterSizes(getPosterSizes()).profileSizes(getProfileSizes()) + .secureBaseUrl(getSecureBaseUrl()).stillSizes(getStillSizes()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ConfigurationPageInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ConfigurationPageInfo.java new file mode 100644 index 0000000000000..4850e5e3e0f00 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ConfigurationPageInfo.java @@ -0,0 +1,397 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The configuration page info. + */ +@JsonPropertyOrder({ ConfigurationPageInfo.JSON_PROPERTY_NAME, ConfigurationPageInfo.JSON_PROPERTY_ENABLE_IN_MAIN_MENU, + ConfigurationPageInfo.JSON_PROPERTY_MENU_SECTION, ConfigurationPageInfo.JSON_PROPERTY_MENU_ICON, + ConfigurationPageInfo.JSON_PROPERTY_DISPLAY_NAME, ConfigurationPageInfo.JSON_PROPERTY_PLUGIN_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ConfigurationPageInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ENABLE_IN_MAIN_MENU = "EnableInMainMenu"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableInMainMenu; + + public static final String JSON_PROPERTY_MENU_SECTION = "MenuSection"; + @org.eclipse.jdt.annotation.NonNull + private String menuSection; + + public static final String JSON_PROPERTY_MENU_ICON = "MenuIcon"; + @org.eclipse.jdt.annotation.NonNull + private String menuIcon; + + public static final String JSON_PROPERTY_DISPLAY_NAME = "DisplayName"; + @org.eclipse.jdt.annotation.NonNull + private String displayName; + + public static final String JSON_PROPERTY_PLUGIN_ID = "PluginId"; + @org.eclipse.jdt.annotation.NonNull + private UUID pluginId; + + public ConfigurationPageInfo() { + } + + public ConfigurationPageInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ConfigurationPageInfo enableInMainMenu(@org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu) { + this.enableInMainMenu = enableInMainMenu; + return this; + } + + /** + * Gets or sets a value indicating whether the configurations page is enabled in the main menu. + * + * @return enableInMainMenu + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_IN_MAIN_MENU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableInMainMenu() { + return enableInMainMenu; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_IN_MAIN_MENU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableInMainMenu(@org.eclipse.jdt.annotation.NonNull Boolean enableInMainMenu) { + this.enableInMainMenu = enableInMainMenu; + } + + public ConfigurationPageInfo menuSection(@org.eclipse.jdt.annotation.NonNull String menuSection) { + this.menuSection = menuSection; + return this; + } + + /** + * Gets or sets the menu section. + * + * @return menuSection + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MENU_SECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMenuSection() { + return menuSection; + } + + @JsonProperty(JSON_PROPERTY_MENU_SECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMenuSection(@org.eclipse.jdt.annotation.NonNull String menuSection) { + this.menuSection = menuSection; + } + + public ConfigurationPageInfo menuIcon(@org.eclipse.jdt.annotation.NonNull String menuIcon) { + this.menuIcon = menuIcon; + return this; + } + + /** + * Gets or sets the menu icon. + * + * @return menuIcon + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MENU_ICON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMenuIcon() { + return menuIcon; + } + + @JsonProperty(JSON_PROPERTY_MENU_ICON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMenuIcon(@org.eclipse.jdt.annotation.NonNull String menuIcon) { + this.menuIcon = menuIcon; + } + + public ConfigurationPageInfo displayName(@org.eclipse.jdt.annotation.NonNull String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Gets or sets the display name. + * + * @return displayName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayName() { + return displayName; + } + + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayName(@org.eclipse.jdt.annotation.NonNull String displayName) { + this.displayName = displayName; + } + + public ConfigurationPageInfo pluginId(@org.eclipse.jdt.annotation.NonNull UUID pluginId) { + this.pluginId = pluginId; + return this; + } + + /** + * Gets or sets the plugin id. + * + * @return pluginId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLUGIN_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPluginId() { + return pluginId; + } + + @JsonProperty(JSON_PROPERTY_PLUGIN_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPluginId(@org.eclipse.jdt.annotation.NonNull UUID pluginId) { + this.pluginId = pluginId; + } + + /** + * Return true if this ConfigurationPageInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConfigurationPageInfo configurationPageInfo = (ConfigurationPageInfo) o; + return Objects.equals(this.name, configurationPageInfo.name) + && Objects.equals(this.enableInMainMenu, configurationPageInfo.enableInMainMenu) + && Objects.equals(this.menuSection, configurationPageInfo.menuSection) + && Objects.equals(this.menuIcon, configurationPageInfo.menuIcon) + && Objects.equals(this.displayName, configurationPageInfo.displayName) + && Objects.equals(this.pluginId, configurationPageInfo.pluginId); + } + + @Override + public int hashCode() { + return Objects.hash(name, enableInMainMenu, menuSection, menuIcon, displayName, pluginId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConfigurationPageInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" enableInMainMenu: ").append(toIndentedString(enableInMainMenu)).append("\n"); + sb.append(" menuSection: ").append(toIndentedString(menuSection)).append("\n"); + sb.append(" menuIcon: ").append(toIndentedString(menuIcon)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" pluginId: ").append(toIndentedString(pluginId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `EnableInMainMenu` to the URL query string + if (getEnableInMainMenu() != null) { + joiner.add(String.format("%sEnableInMainMenu%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableInMainMenu())))); + } + + // add `MenuSection` to the URL query string + if (getMenuSection() != null) { + joiner.add(String.format("%sMenuSection%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMenuSection())))); + } + + // add `MenuIcon` to the URL query string + if (getMenuIcon() != null) { + joiner.add(String.format("%sMenuIcon%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMenuIcon())))); + } + + // add `DisplayName` to the URL query string + if (getDisplayName() != null) { + joiner.add(String.format("%sDisplayName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplayName())))); + } + + // add `PluginId` to the URL query string + if (getPluginId() != null) { + joiner.add(String.format("%sPluginId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPluginId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ConfigurationPageInfo instance; + + public Builder() { + this(new ConfigurationPageInfo()); + } + + protected Builder(ConfigurationPageInfo instance) { + this.instance = instance; + } + + public ConfigurationPageInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ConfigurationPageInfo.Builder enableInMainMenu(Boolean enableInMainMenu) { + this.instance.enableInMainMenu = enableInMainMenu; + return this; + } + + public ConfigurationPageInfo.Builder menuSection(String menuSection) { + this.instance.menuSection = menuSection; + return this; + } + + public ConfigurationPageInfo.Builder menuIcon(String menuIcon) { + this.instance.menuIcon = menuIcon; + return this; + } + + public ConfigurationPageInfo.Builder displayName(String displayName) { + this.instance.displayName = displayName; + return this; + } + + public ConfigurationPageInfo.Builder pluginId(UUID pluginId) { + this.instance.pluginId = pluginId; + return this; + } + + /** + * returns a built ConfigurationPageInfo instance. + * + * The builder is not reusable. + */ + public ConfigurationPageInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ConfigurationPageInfo.Builder builder() { + return new ConfigurationPageInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ConfigurationPageInfo.Builder toBuilder() { + return new ConfigurationPageInfo.Builder().name(getName()).enableInMainMenu(getEnableInMainMenu()) + .menuSection(getMenuSection()).menuIcon(getMenuIcon()).displayName(getDisplayName()) + .pluginId(getPluginId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ContainerProfile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ContainerProfile.java new file mode 100644 index 0000000000000..25d554c21342c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ContainerProfile.java @@ -0,0 +1,287 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ContainerProfile + */ +@JsonPropertyOrder({ ContainerProfile.JSON_PROPERTY_TYPE, ContainerProfile.JSON_PROPERTY_CONDITIONS, + ContainerProfile.JSON_PROPERTY_CONTAINER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ContainerProfile { + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private DlnaProfileType type; + + public static final String JSON_PROPERTY_CONDITIONS = "Conditions"; + @org.eclipse.jdt.annotation.NonNull + private List conditions; + + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public ContainerProfile() { + } + + public ContainerProfile type(@org.eclipse.jdt.annotation.NonNull DlnaProfileType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DlnaProfileType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull DlnaProfileType type) { + this.type = type; + } + + public ContainerProfile conditions(@org.eclipse.jdt.annotation.NonNull List conditions) { + this.conditions = conditions; + return this; + } + + public ContainerProfile addConditionsItem(ProfileCondition conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * Get conditions + * + * @return conditions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getConditions() { + return conditions; + } + + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConditions(@org.eclipse.jdt.annotation.NonNull List conditions) { + this.conditions = conditions; + } + + public ContainerProfile container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Get container + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + /** + * Return true if this ContainerProfile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerProfile containerProfile = (ContainerProfile) o; + return Objects.equals(this.type, containerProfile.type) + && Objects.equals(this.conditions, containerProfile.conditions) + && Objects.equals(this.container, containerProfile.container); + } + + @Override + public int hashCode() { + return Objects.hash(type, conditions, container); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerProfile {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `Conditions` to the URL query string + if (getConditions() != null) { + for (int i = 0; i < getConditions().size(); i++) { + if (getConditions().get(i) != null) { + joiner.add(getConditions().get(i).toUrlQueryString(String.format("%sConditions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ContainerProfile instance; + + public Builder() { + this(new ContainerProfile()); + } + + protected Builder(ContainerProfile instance) { + this.instance = instance; + } + + public ContainerProfile.Builder type(DlnaProfileType type) { + this.instance.type = type; + return this; + } + + public ContainerProfile.Builder conditions(List conditions) { + this.instance.conditions = conditions; + return this; + } + + public ContainerProfile.Builder container(String container) { + this.instance.container = container; + return this; + } + + /** + * returns a built ContainerProfile instance. + * + * The builder is not reusable. + */ + public ContainerProfile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ContainerProfile.Builder builder() { + return new ContainerProfile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ContainerProfile.Builder toBuilder() { + return new ContainerProfile.Builder().type(getType()).conditions(getConditions()).container(getContainer()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ControlResponse.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ControlResponse.java new file mode 100644 index 0000000000000..ffcd3bd2cf729 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ControlResponse.java @@ -0,0 +1,273 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ControlResponse + */ +@JsonPropertyOrder({ ControlResponse.JSON_PROPERTY_HEADERS, ControlResponse.JSON_PROPERTY_XML, + ControlResponse.JSON_PROPERTY_IS_SUCCESSFUL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ControlResponse { + public static final String JSON_PROPERTY_HEADERS = "Headers"; + @org.eclipse.jdt.annotation.NonNull + private Map headers = new HashMap<>(); + + public static final String JSON_PROPERTY_XML = "Xml"; + @org.eclipse.jdt.annotation.NonNull + private String xml; + + public static final String JSON_PROPERTY_IS_SUCCESSFUL = "IsSuccessful"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isSuccessful; + + public ControlResponse() { + } + + @JsonCreator + public ControlResponse(@JsonProperty(JSON_PROPERTY_HEADERS) Map headers) { + this(); + this.headers = headers; + } + + /** + * Get headers + * + * @return headers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getHeaders() { + return headers; + } + + public ControlResponse xml(@org.eclipse.jdt.annotation.NonNull String xml) { + this.xml = xml; + return this; + } + + /** + * Get xml + * + * @return xml + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_XML) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getXml() { + return xml; + } + + @JsonProperty(JSON_PROPERTY_XML) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setXml(@org.eclipse.jdt.annotation.NonNull String xml) { + this.xml = xml; + } + + public ControlResponse isSuccessful(@org.eclipse.jdt.annotation.NonNull Boolean isSuccessful) { + this.isSuccessful = isSuccessful; + return this; + } + + /** + * Get isSuccessful + * + * @return isSuccessful + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_SUCCESSFUL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsSuccessful() { + return isSuccessful; + } + + @JsonProperty(JSON_PROPERTY_IS_SUCCESSFUL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsSuccessful(@org.eclipse.jdt.annotation.NonNull Boolean isSuccessful) { + this.isSuccessful = isSuccessful; + } + + /** + * Return true if this ControlResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ControlResponse controlResponse = (ControlResponse) o; + return Objects.equals(this.headers, controlResponse.headers) && Objects.equals(this.xml, controlResponse.xml) + && Objects.equals(this.isSuccessful, controlResponse.isSuccessful); + } + + @Override + public int hashCode() { + return Objects.hash(headers, xml, isSuccessful); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ControlResponse {\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" xml: ").append(toIndentedString(xml)).append("\n"); + sb.append(" isSuccessful: ").append(toIndentedString(isSuccessful)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Headers` to the URL query string + if (getHeaders() != null) { + for (String _key : getHeaders().keySet()) { + joiner.add(String.format("%sHeaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getHeaders().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getHeaders().get(_key))))); + } + } + + // add `Xml` to the URL query string + if (getXml() != null) { + joiner.add(String.format("%sXml%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getXml())))); + } + + // add `IsSuccessful` to the URL query string + if (getIsSuccessful() != null) { + joiner.add(String.format("%sIsSuccessful%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsSuccessful())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ControlResponse instance; + + public Builder() { + this(new ControlResponse()); + } + + protected Builder(ControlResponse instance) { + this.instance = instance; + } + + public ControlResponse.Builder headers(Map headers) { + this.instance.headers = headers; + return this; + } + + public ControlResponse.Builder xml(String xml) { + this.instance.xml = xml; + return this; + } + + public ControlResponse.Builder isSuccessful(Boolean isSuccessful) { + this.instance.isSuccessful = isSuccessful; + return this; + } + + /** + * returns a built ControlResponse instance. + * + * The builder is not reusable. + */ + public ControlResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ControlResponse.Builder builder() { + return new ControlResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ControlResponse.Builder toBuilder() { + return new ControlResponse.Builder().headers(getHeaders()).xml(getXml()).isSuccessful(getIsSuccessful()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CountryInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CountryInfo.java new file mode 100644 index 0000000000000..8df7b7cedec79 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CountryInfo.java @@ -0,0 +1,315 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class CountryInfo. + */ +@JsonPropertyOrder({ CountryInfo.JSON_PROPERTY_NAME, CountryInfo.JSON_PROPERTY_DISPLAY_NAME, + CountryInfo.JSON_PROPERTY_TWO_LETTER_I_S_O_REGION_NAME, + CountryInfo.JSON_PROPERTY_THREE_LETTER_I_S_O_REGION_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class CountryInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_DISPLAY_NAME = "DisplayName"; + @org.eclipse.jdt.annotation.NonNull + private String displayName; + + public static final String JSON_PROPERTY_TWO_LETTER_I_S_O_REGION_NAME = "TwoLetterISORegionName"; + @org.eclipse.jdt.annotation.NonNull + private String twoLetterISORegionName; + + public static final String JSON_PROPERTY_THREE_LETTER_I_S_O_REGION_NAME = "ThreeLetterISORegionName"; + @org.eclipse.jdt.annotation.NonNull + private String threeLetterISORegionName; + + public CountryInfo() { + } + + public CountryInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public CountryInfo displayName(@org.eclipse.jdt.annotation.NonNull String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Gets or sets the display name. + * + * @return displayName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayName() { + return displayName; + } + + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayName(@org.eclipse.jdt.annotation.NonNull String displayName) { + this.displayName = displayName; + } + + public CountryInfo twoLetterISORegionName(@org.eclipse.jdt.annotation.NonNull String twoLetterISORegionName) { + this.twoLetterISORegionName = twoLetterISORegionName; + return this; + } + + /** + * Gets or sets the name of the two letter ISO region. + * + * @return twoLetterISORegionName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TWO_LETTER_I_S_O_REGION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTwoLetterISORegionName() { + return twoLetterISORegionName; + } + + @JsonProperty(JSON_PROPERTY_TWO_LETTER_I_S_O_REGION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTwoLetterISORegionName(@org.eclipse.jdt.annotation.NonNull String twoLetterISORegionName) { + this.twoLetterISORegionName = twoLetterISORegionName; + } + + public CountryInfo threeLetterISORegionName(@org.eclipse.jdt.annotation.NonNull String threeLetterISORegionName) { + this.threeLetterISORegionName = threeLetterISORegionName; + return this; + } + + /** + * Gets or sets the name of the three letter ISO region. + * + * @return threeLetterISORegionName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THREE_LETTER_I_S_O_REGION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getThreeLetterISORegionName() { + return threeLetterISORegionName; + } + + @JsonProperty(JSON_PROPERTY_THREE_LETTER_I_S_O_REGION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThreeLetterISORegionName(@org.eclipse.jdt.annotation.NonNull String threeLetterISORegionName) { + this.threeLetterISORegionName = threeLetterISORegionName; + } + + /** + * Return true if this CountryInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CountryInfo countryInfo = (CountryInfo) o; + return Objects.equals(this.name, countryInfo.name) && Objects.equals(this.displayName, countryInfo.displayName) + && Objects.equals(this.twoLetterISORegionName, countryInfo.twoLetterISORegionName) + && Objects.equals(this.threeLetterISORegionName, countryInfo.threeLetterISORegionName); + } + + @Override + public int hashCode() { + return Objects.hash(name, displayName, twoLetterISORegionName, threeLetterISORegionName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CountryInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" twoLetterISORegionName: ").append(toIndentedString(twoLetterISORegionName)).append("\n"); + sb.append(" threeLetterISORegionName: ").append(toIndentedString(threeLetterISORegionName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `DisplayName` to the URL query string + if (getDisplayName() != null) { + joiner.add(String.format("%sDisplayName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplayName())))); + } + + // add `TwoLetterISORegionName` to the URL query string + if (getTwoLetterISORegionName() != null) { + joiner.add(String.format("%sTwoLetterISORegionName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTwoLetterISORegionName())))); + } + + // add `ThreeLetterISORegionName` to the URL query string + if (getThreeLetterISORegionName() != null) { + joiner.add(String.format("%sThreeLetterISORegionName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getThreeLetterISORegionName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private CountryInfo instance; + + public Builder() { + this(new CountryInfo()); + } + + protected Builder(CountryInfo instance) { + this.instance = instance; + } + + public CountryInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public CountryInfo.Builder displayName(String displayName) { + this.instance.displayName = displayName; + return this; + } + + public CountryInfo.Builder twoLetterISORegionName(String twoLetterISORegionName) { + this.instance.twoLetterISORegionName = twoLetterISORegionName; + return this; + } + + public CountryInfo.Builder threeLetterISORegionName(String threeLetterISORegionName) { + this.instance.threeLetterISORegionName = threeLetterISORegionName; + return this; + } + + /** + * returns a built CountryInfo instance. + * + * The builder is not reusable. + */ + public CountryInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CountryInfo.Builder builder() { + return new CountryInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CountryInfo.Builder toBuilder() { + return new CountryInfo.Builder().name(getName()).displayName(getDisplayName()) + .twoLetterISORegionName(getTwoLetterISORegionName()) + .threeLetterISORegionName(getThreeLetterISORegionName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CreatePlaylistDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CreatePlaylistDto.java new file mode 100644 index 0000000000000..4a0c570a44f7c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CreatePlaylistDto.java @@ -0,0 +1,329 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Create new playlist dto. + */ +@JsonPropertyOrder({ CreatePlaylistDto.JSON_PROPERTY_NAME, CreatePlaylistDto.JSON_PROPERTY_IDS, + CreatePlaylistDto.JSON_PROPERTY_USER_ID, CreatePlaylistDto.JSON_PROPERTY_MEDIA_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class CreatePlaylistDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_IDS = "Ids"; + @org.eclipse.jdt.annotation.NonNull + private List ids = new ArrayList<>(); + + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_MEDIA_TYPE = "MediaType"; + @org.eclipse.jdt.annotation.NonNull + private String mediaType; + + public CreatePlaylistDto() { + } + + public CreatePlaylistDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name of the new playlist. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public CreatePlaylistDto ids(@org.eclipse.jdt.annotation.NonNull List ids) { + this.ids = ids; + return this; + } + + public CreatePlaylistDto addIdsItem(UUID idsItem) { + if (this.ids == null) { + this.ids = new ArrayList<>(); + } + this.ids.add(idsItem); + return this; + } + + /** + * Gets or sets item ids to add to the playlist. + * + * @return ids + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIds() { + return ids; + } + + @JsonProperty(JSON_PROPERTY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIds(@org.eclipse.jdt.annotation.NonNull List ids) { + this.ids = ids; + } + + public CreatePlaylistDto userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the user id. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public CreatePlaylistDto mediaType(@org.eclipse.jdt.annotation.NonNull String mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Gets or sets the media type. + * + * @return mediaType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMediaType() { + return mediaType; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaType(@org.eclipse.jdt.annotation.NonNull String mediaType) { + this.mediaType = mediaType; + } + + /** + * Return true if this CreatePlaylistDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePlaylistDto createPlaylistDto = (CreatePlaylistDto) o; + return Objects.equals(this.name, createPlaylistDto.name) && Objects.equals(this.ids, createPlaylistDto.ids) + && Objects.equals(this.userId, createPlaylistDto.userId) + && Objects.equals(this.mediaType, createPlaylistDto.mediaType); + } + + @Override + public int hashCode() { + return Objects.hash(name, ids, userId, mediaType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreatePlaylistDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ids: ").append(toIndentedString(ids)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" mediaType: ").append(toIndentedString(mediaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Ids` to the URL query string + if (getIds() != null) { + for (int i = 0; i < getIds().size(); i++) { + if (getIds().get(i) != null) { + joiner.add(String.format("%sIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getIds().get(i))))); + } + } + } + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `MediaType` to the URL query string + if (getMediaType() != null) { + joiner.add(String.format("%sMediaType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private CreatePlaylistDto instance; + + public Builder() { + this(new CreatePlaylistDto()); + } + + protected Builder(CreatePlaylistDto instance) { + this.instance = instance; + } + + public CreatePlaylistDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public CreatePlaylistDto.Builder ids(List ids) { + this.instance.ids = ids; + return this; + } + + public CreatePlaylistDto.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public CreatePlaylistDto.Builder mediaType(String mediaType) { + this.instance.mediaType = mediaType; + return this; + } + + /** + * returns a built CreatePlaylistDto instance. + * + * The builder is not reusable. + */ + public CreatePlaylistDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CreatePlaylistDto.Builder builder() { + return new CreatePlaylistDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CreatePlaylistDto.Builder toBuilder() { + return new CreatePlaylistDto.Builder().name(getName()).ids(getIds()).userId(getUserId()) + .mediaType(getMediaType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CreateUserByName.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CreateUserByName.java new file mode 100644 index 0000000000000..3bfbd63f7629b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CreateUserByName.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The create user by name request body. + */ +@JsonPropertyOrder({ CreateUserByName.JSON_PROPERTY_NAME, CreateUserByName.JSON_PROPERTY_PASSWORD }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class CreateUserByName { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_PASSWORD = "Password"; + @org.eclipse.jdt.annotation.NonNull + private String password; + + public CreateUserByName() { + } + + public CreateUserByName name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the username. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public CreateUserByName password(@org.eclipse.jdt.annotation.NonNull String password) { + this.password = password; + return this; + } + + /** + * Gets or sets the password. + * + * @return password + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(@org.eclipse.jdt.annotation.NonNull String password) { + this.password = password; + } + + /** + * Return true if this CreateUserByName object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUserByName createUserByName = (CreateUserByName) o; + return Objects.equals(this.name, createUserByName.name) + && Objects.equals(this.password, createUserByName.password); + } + + @Override + public int hashCode() { + return Objects.hash(name, password); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUserByName {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Password` to the URL query string + if (getPassword() != null) { + joiner.add(String.format("%sPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPassword())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private CreateUserByName instance; + + public Builder() { + this(new CreateUserByName()); + } + + protected Builder(CreateUserByName instance) { + this.instance = instance; + } + + public CreateUserByName.Builder name(String name) { + this.instance.name = name; + return this; + } + + public CreateUserByName.Builder password(String password) { + this.instance.password = password; + return this; + } + + /** + * returns a built CreateUserByName instance. + * + * The builder is not reusable. + */ + public CreateUserByName build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CreateUserByName.Builder builder() { + return new CreateUserByName.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CreateUserByName.Builder toBuilder() { + return new CreateUserByName.Builder().name(getName()).password(getPassword()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CultureDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CultureDto.java new file mode 100644 index 0000000000000..c9592be424ef8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/CultureDto.java @@ -0,0 +1,370 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class CultureDto. + */ +@JsonPropertyOrder({ CultureDto.JSON_PROPERTY_NAME, CultureDto.JSON_PROPERTY_DISPLAY_NAME, + CultureDto.JSON_PROPERTY_TWO_LETTER_I_S_O_LANGUAGE_NAME, + CultureDto.JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME, + CultureDto.JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAMES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class CultureDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_DISPLAY_NAME = "DisplayName"; + @org.eclipse.jdt.annotation.NonNull + private String displayName; + + public static final String JSON_PROPERTY_TWO_LETTER_I_S_O_LANGUAGE_NAME = "TwoLetterISOLanguageName"; + @org.eclipse.jdt.annotation.NonNull + private String twoLetterISOLanguageName; + + public static final String JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME = "ThreeLetterISOLanguageName"; + @org.eclipse.jdt.annotation.NonNull + private String threeLetterISOLanguageName; + + public static final String JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAMES = "ThreeLetterISOLanguageNames"; + @org.eclipse.jdt.annotation.NonNull + private List threeLetterISOLanguageNames = new ArrayList<>(); + + public CultureDto() { + } + + @JsonCreator + public CultureDto(@JsonProperty(JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME) String threeLetterISOLanguageName) { + this(); + this.threeLetterISOLanguageName = threeLetterISOLanguageName; + } + + public CultureDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public CultureDto displayName(@org.eclipse.jdt.annotation.NonNull String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Gets the display name. + * + * @return displayName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayName() { + return displayName; + } + + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayName(@org.eclipse.jdt.annotation.NonNull String displayName) { + this.displayName = displayName; + } + + public CultureDto twoLetterISOLanguageName(@org.eclipse.jdt.annotation.NonNull String twoLetterISOLanguageName) { + this.twoLetterISOLanguageName = twoLetterISOLanguageName; + return this; + } + + /** + * Gets the name of the two letter ISO language. + * + * @return twoLetterISOLanguageName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TWO_LETTER_I_S_O_LANGUAGE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTwoLetterISOLanguageName() { + return twoLetterISOLanguageName; + } + + @JsonProperty(JSON_PROPERTY_TWO_LETTER_I_S_O_LANGUAGE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTwoLetterISOLanguageName(@org.eclipse.jdt.annotation.NonNull String twoLetterISOLanguageName) { + this.twoLetterISOLanguageName = twoLetterISOLanguageName; + } + + /** + * Gets the name of the three letter ISO language. + * + * @return threeLetterISOLanguageName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getThreeLetterISOLanguageName() { + return threeLetterISOLanguageName; + } + + public CultureDto threeLetterISOLanguageNames( + @org.eclipse.jdt.annotation.NonNull List threeLetterISOLanguageNames) { + this.threeLetterISOLanguageNames = threeLetterISOLanguageNames; + return this; + } + + public CultureDto addThreeLetterISOLanguageNamesItem(String threeLetterISOLanguageNamesItem) { + if (this.threeLetterISOLanguageNames == null) { + this.threeLetterISOLanguageNames = new ArrayList<>(); + } + this.threeLetterISOLanguageNames.add(threeLetterISOLanguageNamesItem); + return this; + } + + /** + * Get threeLetterISOLanguageNames + * + * @return threeLetterISOLanguageNames + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getThreeLetterISOLanguageNames() { + return threeLetterISOLanguageNames; + } + + @JsonProperty(JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThreeLetterISOLanguageNames( + @org.eclipse.jdt.annotation.NonNull List threeLetterISOLanguageNames) { + this.threeLetterISOLanguageNames = threeLetterISOLanguageNames; + } + + /** + * Return true if this CultureDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CultureDto cultureDto = (CultureDto) o; + return Objects.equals(this.name, cultureDto.name) && Objects.equals(this.displayName, cultureDto.displayName) + && Objects.equals(this.twoLetterISOLanguageName, cultureDto.twoLetterISOLanguageName) + && Objects.equals(this.threeLetterISOLanguageName, cultureDto.threeLetterISOLanguageName) + && Objects.equals(this.threeLetterISOLanguageNames, cultureDto.threeLetterISOLanguageNames); + } + + @Override + public int hashCode() { + return Objects.hash(name, displayName, twoLetterISOLanguageName, threeLetterISOLanguageName, + threeLetterISOLanguageNames); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CultureDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" twoLetterISOLanguageName: ").append(toIndentedString(twoLetterISOLanguageName)).append("\n"); + sb.append(" threeLetterISOLanguageName: ").append(toIndentedString(threeLetterISOLanguageName)).append("\n"); + sb.append(" threeLetterISOLanguageNames: ").append(toIndentedString(threeLetterISOLanguageNames)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `DisplayName` to the URL query string + if (getDisplayName() != null) { + joiner.add(String.format("%sDisplayName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplayName())))); + } + + // add `TwoLetterISOLanguageName` to the URL query string + if (getTwoLetterISOLanguageName() != null) { + joiner.add(String.format("%sTwoLetterISOLanguageName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTwoLetterISOLanguageName())))); + } + + // add `ThreeLetterISOLanguageName` to the URL query string + if (getThreeLetterISOLanguageName() != null) { + joiner.add(String.format("%sThreeLetterISOLanguageName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getThreeLetterISOLanguageName())))); + } + + // add `ThreeLetterISOLanguageNames` to the URL query string + if (getThreeLetterISOLanguageNames() != null) { + for (int i = 0; i < getThreeLetterISOLanguageNames().size(); i++) { + joiner.add(String.format("%sThreeLetterISOLanguageNames%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getThreeLetterISOLanguageNames().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private CultureDto instance; + + public Builder() { + this(new CultureDto()); + } + + protected Builder(CultureDto instance) { + this.instance = instance; + } + + public CultureDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public CultureDto.Builder displayName(String displayName) { + this.instance.displayName = displayName; + return this; + } + + public CultureDto.Builder twoLetterISOLanguageName(String twoLetterISOLanguageName) { + this.instance.twoLetterISOLanguageName = twoLetterISOLanguageName; + return this; + } + + public CultureDto.Builder threeLetterISOLanguageName(String threeLetterISOLanguageName) { + this.instance.threeLetterISOLanguageName = threeLetterISOLanguageName; + return this; + } + + public CultureDto.Builder threeLetterISOLanguageNames(List threeLetterISOLanguageNames) { + this.instance.threeLetterISOLanguageNames = threeLetterISOLanguageNames; + return this; + } + + /** + * returns a built CultureDto instance. + * + * The builder is not reusable. + */ + public CultureDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CultureDto.Builder builder() { + return new CultureDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CultureDto.Builder toBuilder() { + return new CultureDto.Builder().name(getName()).displayName(getDisplayName()) + .twoLetterISOLanguageName(getTwoLetterISOLanguageName()) + .threeLetterISOLanguageName(getThreeLetterISOLanguageName()) + .threeLetterISOLanguageNames(getThreeLetterISOLanguageNames()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DayOfWeek.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DayOfWeek.java new file mode 100644 index 0000000000000..3817fc2bb9956 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DayOfWeek.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets DayOfWeek + */ +public enum DayOfWeek { + + SUNDAY("Sunday"), + + MONDAY("Monday"), + + TUESDAY("Tuesday"), + + WEDNESDAY("Wednesday"), + + THURSDAY("Thursday"), + + FRIDAY("Friday"), + + SATURDAY("Saturday"); + + private String value; + + DayOfWeek(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DayOfWeek fromValue(String value) { + for (DayOfWeek b : DayOfWeek.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DayPattern.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DayPattern.java new file mode 100644 index 0000000000000..125432f23cae1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DayPattern.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets DayPattern + */ +public enum DayPattern { + + DAILY("Daily"), + + WEEKDAYS("Weekdays"), + + WEEKENDS("Weekends"); + + private String value; + + DayPattern(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DayPattern fromValue(String value) { + for (DayPattern b : DayPattern.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DefaultDirectoryBrowserInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DefaultDirectoryBrowserInfoDto.java new file mode 100644 index 0000000000000..155d06e5cfc78 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DefaultDirectoryBrowserInfoDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Default directory browser info. + */ +@JsonPropertyOrder({ DefaultDirectoryBrowserInfoDto.JSON_PROPERTY_PATH }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DefaultDirectoryBrowserInfoDto { + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public DefaultDirectoryBrowserInfoDto() { + } + + public DefaultDirectoryBrowserInfoDto path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + /** + * Return true if this DefaultDirectoryBrowserInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DefaultDirectoryBrowserInfoDto defaultDirectoryBrowserInfoDto = (DefaultDirectoryBrowserInfoDto) o; + return Objects.equals(this.path, defaultDirectoryBrowserInfoDto.path); + } + + @Override + public int hashCode() { + return Objects.hash(path); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DefaultDirectoryBrowserInfoDto {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DefaultDirectoryBrowserInfoDto instance; + + public Builder() { + this(new DefaultDirectoryBrowserInfoDto()); + } + + protected Builder(DefaultDirectoryBrowserInfoDto instance) { + this.instance = instance; + } + + public DefaultDirectoryBrowserInfoDto.Builder path(String path) { + this.instance.path = path; + return this; + } + + /** + * returns a built DefaultDirectoryBrowserInfoDto instance. + * + * The builder is not reusable. + */ + public DefaultDirectoryBrowserInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DefaultDirectoryBrowserInfoDto.Builder builder() { + return new DefaultDirectoryBrowserInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DefaultDirectoryBrowserInfoDto.Builder toBuilder() { + return new DefaultDirectoryBrowserInfoDto.Builder().path(getPath()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceIdentification.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceIdentification.java new file mode 100644 index 0000000000000..d163696407588 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceIdentification.java @@ -0,0 +1,534 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * DeviceIdentification + */ +@JsonPropertyOrder({ DeviceIdentification.JSON_PROPERTY_FRIENDLY_NAME, DeviceIdentification.JSON_PROPERTY_MODEL_NUMBER, + DeviceIdentification.JSON_PROPERTY_SERIAL_NUMBER, DeviceIdentification.JSON_PROPERTY_MODEL_NAME, + DeviceIdentification.JSON_PROPERTY_MODEL_DESCRIPTION, DeviceIdentification.JSON_PROPERTY_MODEL_URL, + DeviceIdentification.JSON_PROPERTY_MANUFACTURER, DeviceIdentification.JSON_PROPERTY_MANUFACTURER_URL, + DeviceIdentification.JSON_PROPERTY_HEADERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DeviceIdentification { + public static final String JSON_PROPERTY_FRIENDLY_NAME = "FriendlyName"; + @org.eclipse.jdt.annotation.NonNull + private String friendlyName; + + public static final String JSON_PROPERTY_MODEL_NUMBER = "ModelNumber"; + @org.eclipse.jdt.annotation.NonNull + private String modelNumber; + + public static final String JSON_PROPERTY_SERIAL_NUMBER = "SerialNumber"; + @org.eclipse.jdt.annotation.NonNull + private String serialNumber; + + public static final String JSON_PROPERTY_MODEL_NAME = "ModelName"; + @org.eclipse.jdt.annotation.NonNull + private String modelName; + + public static final String JSON_PROPERTY_MODEL_DESCRIPTION = "ModelDescription"; + @org.eclipse.jdt.annotation.NonNull + private String modelDescription; + + public static final String JSON_PROPERTY_MODEL_URL = "ModelUrl"; + @org.eclipse.jdt.annotation.NonNull + private String modelUrl; + + public static final String JSON_PROPERTY_MANUFACTURER = "Manufacturer"; + @org.eclipse.jdt.annotation.NonNull + private String manufacturer; + + public static final String JSON_PROPERTY_MANUFACTURER_URL = "ManufacturerUrl"; + @org.eclipse.jdt.annotation.NonNull + private String manufacturerUrl; + + public static final String JSON_PROPERTY_HEADERS = "Headers"; + @org.eclipse.jdt.annotation.NonNull + private List headers = new ArrayList<>(); + + public DeviceIdentification() { + } + + public DeviceIdentification friendlyName(@org.eclipse.jdt.annotation.NonNull String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Gets or sets the name of the friendly. + * + * @return friendlyName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FRIENDLY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFriendlyName() { + return friendlyName; + } + + @JsonProperty(JSON_PROPERTY_FRIENDLY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFriendlyName(@org.eclipse.jdt.annotation.NonNull String friendlyName) { + this.friendlyName = friendlyName; + } + + public DeviceIdentification modelNumber(@org.eclipse.jdt.annotation.NonNull String modelNumber) { + this.modelNumber = modelNumber; + return this; + } + + /** + * Gets or sets the model number. + * + * @return modelNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MODEL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getModelNumber() { + return modelNumber; + } + + @JsonProperty(JSON_PROPERTY_MODEL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setModelNumber(@org.eclipse.jdt.annotation.NonNull String modelNumber) { + this.modelNumber = modelNumber; + } + + public DeviceIdentification serialNumber(@org.eclipse.jdt.annotation.NonNull String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Gets or sets the serial number. + * + * @return serialNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIAL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSerialNumber() { + return serialNumber; + } + + @JsonProperty(JSON_PROPERTY_SERIAL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSerialNumber(@org.eclipse.jdt.annotation.NonNull String serialNumber) { + this.serialNumber = serialNumber; + } + + public DeviceIdentification modelName(@org.eclipse.jdt.annotation.NonNull String modelName) { + this.modelName = modelName; + return this; + } + + /** + * Gets or sets the name of the model. + * + * @return modelName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MODEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getModelName() { + return modelName; + } + + @JsonProperty(JSON_PROPERTY_MODEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setModelName(@org.eclipse.jdt.annotation.NonNull String modelName) { + this.modelName = modelName; + } + + public DeviceIdentification modelDescription(@org.eclipse.jdt.annotation.NonNull String modelDescription) { + this.modelDescription = modelDescription; + return this; + } + + /** + * Gets or sets the model description. + * + * @return modelDescription + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MODEL_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getModelDescription() { + return modelDescription; + } + + @JsonProperty(JSON_PROPERTY_MODEL_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setModelDescription(@org.eclipse.jdt.annotation.NonNull String modelDescription) { + this.modelDescription = modelDescription; + } + + public DeviceIdentification modelUrl(@org.eclipse.jdt.annotation.NonNull String modelUrl) { + this.modelUrl = modelUrl; + return this; + } + + /** + * Gets or sets the model URL. + * + * @return modelUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MODEL_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getModelUrl() { + return modelUrl; + } + + @JsonProperty(JSON_PROPERTY_MODEL_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setModelUrl(@org.eclipse.jdt.annotation.NonNull String modelUrl) { + this.modelUrl = modelUrl; + } + + public DeviceIdentification manufacturer(@org.eclipse.jdt.annotation.NonNull String manufacturer) { + this.manufacturer = manufacturer; + return this; + } + + /** + * Gets or sets the manufacturer. + * + * @return manufacturer + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MANUFACTURER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getManufacturer() { + return manufacturer; + } + + @JsonProperty(JSON_PROPERTY_MANUFACTURER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setManufacturer(@org.eclipse.jdt.annotation.NonNull String manufacturer) { + this.manufacturer = manufacturer; + } + + public DeviceIdentification manufacturerUrl(@org.eclipse.jdt.annotation.NonNull String manufacturerUrl) { + this.manufacturerUrl = manufacturerUrl; + return this; + } + + /** + * Gets or sets the manufacturer URL. + * + * @return manufacturerUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MANUFACTURER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getManufacturerUrl() { + return manufacturerUrl; + } + + @JsonProperty(JSON_PROPERTY_MANUFACTURER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setManufacturerUrl(@org.eclipse.jdt.annotation.NonNull String manufacturerUrl) { + this.manufacturerUrl = manufacturerUrl; + } + + public DeviceIdentification headers(@org.eclipse.jdt.annotation.NonNull List headers) { + this.headers = headers; + return this; + } + + public DeviceIdentification addHeadersItem(HttpHeaderInfo headersItem) { + if (this.headers == null) { + this.headers = new ArrayList<>(); + } + this.headers.add(headersItem); + return this; + } + + /** + * Gets or sets the headers. + * + * @return headers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getHeaders() { + return headers; + } + + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(@org.eclipse.jdt.annotation.NonNull List headers) { + this.headers = headers; + } + + /** + * Return true if this DeviceIdentification object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceIdentification deviceIdentification = (DeviceIdentification) o; + return Objects.equals(this.friendlyName, deviceIdentification.friendlyName) + && Objects.equals(this.modelNumber, deviceIdentification.modelNumber) + && Objects.equals(this.serialNumber, deviceIdentification.serialNumber) + && Objects.equals(this.modelName, deviceIdentification.modelName) + && Objects.equals(this.modelDescription, deviceIdentification.modelDescription) + && Objects.equals(this.modelUrl, deviceIdentification.modelUrl) + && Objects.equals(this.manufacturer, deviceIdentification.manufacturer) + && Objects.equals(this.manufacturerUrl, deviceIdentification.manufacturerUrl) + && Objects.equals(this.headers, deviceIdentification.headers); + } + + @Override + public int hashCode() { + return Objects.hash(friendlyName, modelNumber, serialNumber, modelName, modelDescription, modelUrl, + manufacturer, manufacturerUrl, headers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceIdentification {\n"); + sb.append(" friendlyName: ").append(toIndentedString(friendlyName)).append("\n"); + sb.append(" modelNumber: ").append(toIndentedString(modelNumber)).append("\n"); + sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); + sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); + sb.append(" modelDescription: ").append(toIndentedString(modelDescription)).append("\n"); + sb.append(" modelUrl: ").append(toIndentedString(modelUrl)).append("\n"); + sb.append(" manufacturer: ").append(toIndentedString(manufacturer)).append("\n"); + sb.append(" manufacturerUrl: ").append(toIndentedString(manufacturerUrl)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `FriendlyName` to the URL query string + if (getFriendlyName() != null) { + joiner.add(String.format("%sFriendlyName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFriendlyName())))); + } + + // add `ModelNumber` to the URL query string + if (getModelNumber() != null) { + joiner.add(String.format("%sModelNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getModelNumber())))); + } + + // add `SerialNumber` to the URL query string + if (getSerialNumber() != null) { + joiner.add(String.format("%sSerialNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSerialNumber())))); + } + + // add `ModelName` to the URL query string + if (getModelName() != null) { + joiner.add(String.format("%sModelName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getModelName())))); + } + + // add `ModelDescription` to the URL query string + if (getModelDescription() != null) { + joiner.add(String.format("%sModelDescription%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getModelDescription())))); + } + + // add `ModelUrl` to the URL query string + if (getModelUrl() != null) { + joiner.add(String.format("%sModelUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getModelUrl())))); + } + + // add `Manufacturer` to the URL query string + if (getManufacturer() != null) { + joiner.add(String.format("%sManufacturer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getManufacturer())))); + } + + // add `ManufacturerUrl` to the URL query string + if (getManufacturerUrl() != null) { + joiner.add(String.format("%sManufacturerUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getManufacturerUrl())))); + } + + // add `Headers` to the URL query string + if (getHeaders() != null) { + for (int i = 0; i < getHeaders().size(); i++) { + if (getHeaders().get(i) != null) { + joiner.add(getHeaders().get(i).toUrlQueryString(String.format("%sHeaders%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private DeviceIdentification instance; + + public Builder() { + this(new DeviceIdentification()); + } + + protected Builder(DeviceIdentification instance) { + this.instance = instance; + } + + public DeviceIdentification.Builder friendlyName(String friendlyName) { + this.instance.friendlyName = friendlyName; + return this; + } + + public DeviceIdentification.Builder modelNumber(String modelNumber) { + this.instance.modelNumber = modelNumber; + return this; + } + + public DeviceIdentification.Builder serialNumber(String serialNumber) { + this.instance.serialNumber = serialNumber; + return this; + } + + public DeviceIdentification.Builder modelName(String modelName) { + this.instance.modelName = modelName; + return this; + } + + public DeviceIdentification.Builder modelDescription(String modelDescription) { + this.instance.modelDescription = modelDescription; + return this; + } + + public DeviceIdentification.Builder modelUrl(String modelUrl) { + this.instance.modelUrl = modelUrl; + return this; + } + + public DeviceIdentification.Builder manufacturer(String manufacturer) { + this.instance.manufacturer = manufacturer; + return this; + } + + public DeviceIdentification.Builder manufacturerUrl(String manufacturerUrl) { + this.instance.manufacturerUrl = manufacturerUrl; + return this; + } + + public DeviceIdentification.Builder headers(List headers) { + this.instance.headers = headers; + return this; + } + + /** + * returns a built DeviceIdentification instance. + * + * The builder is not reusable. + */ + public DeviceIdentification build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DeviceIdentification.Builder builder() { + return new DeviceIdentification.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DeviceIdentification.Builder toBuilder() { + return new DeviceIdentification.Builder().friendlyName(getFriendlyName()).modelNumber(getModelNumber()) + .serialNumber(getSerialNumber()).modelName(getModelName()).modelDescription(getModelDescription()) + .modelUrl(getModelUrl()).manufacturer(getManufacturer()).manufacturerUrl(getManufacturerUrl()) + .headers(getHeaders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceInfo.java new file mode 100644 index 0000000000000..5cad436e5b84b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceInfo.java @@ -0,0 +1,559 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * DeviceInfo + */ +@JsonPropertyOrder({ DeviceInfo.JSON_PROPERTY_NAME, DeviceInfo.JSON_PROPERTY_ACCESS_TOKEN, DeviceInfo.JSON_PROPERTY_ID, + DeviceInfo.JSON_PROPERTY_LAST_USER_NAME, DeviceInfo.JSON_PROPERTY_APP_NAME, + DeviceInfo.JSON_PROPERTY_APP_VERSION, DeviceInfo.JSON_PROPERTY_LAST_USER_ID, + DeviceInfo.JSON_PROPERTY_DATE_LAST_ACTIVITY, DeviceInfo.JSON_PROPERTY_CAPABILITIES, + DeviceInfo.JSON_PROPERTY_ICON_URL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DeviceInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ACCESS_TOKEN = "AccessToken"; + @org.eclipse.jdt.annotation.NonNull + private String accessToken; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_LAST_USER_NAME = "LastUserName"; + @org.eclipse.jdt.annotation.NonNull + private String lastUserName; + + public static final String JSON_PROPERTY_APP_NAME = "AppName"; + @org.eclipse.jdt.annotation.NonNull + private String appName; + + public static final String JSON_PROPERTY_APP_VERSION = "AppVersion"; + @org.eclipse.jdt.annotation.NonNull + private String appVersion; + + public static final String JSON_PROPERTY_LAST_USER_ID = "LastUserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID lastUserId; + + public static final String JSON_PROPERTY_DATE_LAST_ACTIVITY = "DateLastActivity"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateLastActivity; + + public static final String JSON_PROPERTY_CAPABILITIES = "Capabilities"; + @org.eclipse.jdt.annotation.NonNull + private ClientCapabilities capabilities; + + public static final String JSON_PROPERTY_ICON_URL = "IconUrl"; + @org.eclipse.jdt.annotation.NonNull + private String iconUrl; + + public DeviceInfo() { + } + + public DeviceInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public DeviceInfo accessToken(@org.eclipse.jdt.annotation.NonNull String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Gets or sets the access token. + * + * @return accessToken + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccessToken() { + return accessToken; + } + + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessToken(@org.eclipse.jdt.annotation.NonNull String accessToken) { + this.accessToken = accessToken; + } + + public DeviceInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the identifier. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public DeviceInfo lastUserName(@org.eclipse.jdt.annotation.NonNull String lastUserName) { + this.lastUserName = lastUserName; + return this; + } + + /** + * Gets or sets the last name of the user. + * + * @return lastUserName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastUserName() { + return lastUserName; + } + + @JsonProperty(JSON_PROPERTY_LAST_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastUserName(@org.eclipse.jdt.annotation.NonNull String lastUserName) { + this.lastUserName = lastUserName; + } + + public DeviceInfo appName(@org.eclipse.jdt.annotation.NonNull String appName) { + this.appName = appName; + return this; + } + + /** + * Gets or sets the name of the application. + * + * @return appName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppName() { + return appName; + } + + @JsonProperty(JSON_PROPERTY_APP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppName(@org.eclipse.jdt.annotation.NonNull String appName) { + this.appName = appName; + } + + public DeviceInfo appVersion(@org.eclipse.jdt.annotation.NonNull String appVersion) { + this.appVersion = appVersion; + return this; + } + + /** + * Gets or sets the application version. + * + * @return appVersion + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APP_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppVersion() { + return appVersion; + } + + @JsonProperty(JSON_PROPERTY_APP_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppVersion(@org.eclipse.jdt.annotation.NonNull String appVersion) { + this.appVersion = appVersion; + } + + public DeviceInfo lastUserId(@org.eclipse.jdt.annotation.NonNull UUID lastUserId) { + this.lastUserId = lastUserId; + return this; + } + + /** + * Gets or sets the last user identifier. + * + * @return lastUserId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getLastUserId() { + return lastUserId; + } + + @JsonProperty(JSON_PROPERTY_LAST_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastUserId(@org.eclipse.jdt.annotation.NonNull UUID lastUserId) { + this.lastUserId = lastUserId; + } + + public DeviceInfo dateLastActivity(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateLastActivity) { + this.dateLastActivity = dateLastActivity; + return this; + } + + /** + * Gets or sets the date last modified. + * + * @return dateLastActivity + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_LAST_ACTIVITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateLastActivity() { + return dateLastActivity; + } + + @JsonProperty(JSON_PROPERTY_DATE_LAST_ACTIVITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateLastActivity(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateLastActivity) { + this.dateLastActivity = dateLastActivity; + } + + public DeviceInfo capabilities(@org.eclipse.jdt.annotation.NonNull ClientCapabilities capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Gets or sets the capabilities. + * + * @return capabilities + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAPABILITIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ClientCapabilities getCapabilities() { + return capabilities; + } + + @JsonProperty(JSON_PROPERTY_CAPABILITIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapabilities(@org.eclipse.jdt.annotation.NonNull ClientCapabilities capabilities) { + this.capabilities = capabilities; + } + + public DeviceInfo iconUrl(@org.eclipse.jdt.annotation.NonNull String iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + /** + * Get iconUrl + * + * @return iconUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ICON_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIconUrl() { + return iconUrl; + } + + @JsonProperty(JSON_PROPERTY_ICON_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIconUrl(@org.eclipse.jdt.annotation.NonNull String iconUrl) { + this.iconUrl = iconUrl; + } + + /** + * Return true if this DeviceInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceInfo deviceInfo = (DeviceInfo) o; + return Objects.equals(this.name, deviceInfo.name) && Objects.equals(this.accessToken, deviceInfo.accessToken) + && Objects.equals(this.id, deviceInfo.id) && Objects.equals(this.lastUserName, deviceInfo.lastUserName) + && Objects.equals(this.appName, deviceInfo.appName) + && Objects.equals(this.appVersion, deviceInfo.appVersion) + && Objects.equals(this.lastUserId, deviceInfo.lastUserId) + && Objects.equals(this.dateLastActivity, deviceInfo.dateLastActivity) + && Objects.equals(this.capabilities, deviceInfo.capabilities) + && Objects.equals(this.iconUrl, deviceInfo.iconUrl); + } + + @Override + public int hashCode() { + return Objects.hash(name, accessToken, id, lastUserName, appName, appVersion, lastUserId, dateLastActivity, + capabilities, iconUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" lastUserName: ").append(toIndentedString(lastUserName)).append("\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); + sb.append(" lastUserId: ").append(toIndentedString(lastUserId)).append("\n"); + sb.append(" dateLastActivity: ").append(toIndentedString(dateLastActivity)).append("\n"); + sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); + sb.append(" iconUrl: ").append(toIndentedString(iconUrl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `AccessToken` to the URL query string + if (getAccessToken() != null) { + joiner.add(String.format("%sAccessToken%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAccessToken())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `LastUserName` to the URL query string + if (getLastUserName() != null) { + joiner.add(String.format("%sLastUserName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastUserName())))); + } + + // add `AppName` to the URL query string + if (getAppName() != null) { + joiner.add(String.format("%sAppName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAppName())))); + } + + // add `AppVersion` to the URL query string + if (getAppVersion() != null) { + joiner.add(String.format("%sAppVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAppVersion())))); + } + + // add `LastUserId` to the URL query string + if (getLastUserId() != null) { + joiner.add(String.format("%sLastUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastUserId())))); + } + + // add `DateLastActivity` to the URL query string + if (getDateLastActivity() != null) { + joiner.add(String.format("%sDateLastActivity%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateLastActivity())))); + } + + // add `Capabilities` to the URL query string + if (getCapabilities() != null) { + joiner.add(getCapabilities().toUrlQueryString(prefix + "Capabilities" + suffix)); + } + + // add `IconUrl` to the URL query string + if (getIconUrl() != null) { + joiner.add(String.format("%sIconUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIconUrl())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DeviceInfo instance; + + public Builder() { + this(new DeviceInfo()); + } + + protected Builder(DeviceInfo instance) { + this.instance = instance; + } + + public DeviceInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public DeviceInfo.Builder accessToken(String accessToken) { + this.instance.accessToken = accessToken; + return this; + } + + public DeviceInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public DeviceInfo.Builder lastUserName(String lastUserName) { + this.instance.lastUserName = lastUserName; + return this; + } + + public DeviceInfo.Builder appName(String appName) { + this.instance.appName = appName; + return this; + } + + public DeviceInfo.Builder appVersion(String appVersion) { + this.instance.appVersion = appVersion; + return this; + } + + public DeviceInfo.Builder lastUserId(UUID lastUserId) { + this.instance.lastUserId = lastUserId; + return this; + } + + public DeviceInfo.Builder dateLastActivity(OffsetDateTime dateLastActivity) { + this.instance.dateLastActivity = dateLastActivity; + return this; + } + + public DeviceInfo.Builder capabilities(ClientCapabilities capabilities) { + this.instance.capabilities = capabilities; + return this; + } + + public DeviceInfo.Builder iconUrl(String iconUrl) { + this.instance.iconUrl = iconUrl; + return this; + } + + /** + * returns a built DeviceInfo instance. + * + * The builder is not reusable. + */ + public DeviceInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DeviceInfo.Builder builder() { + return new DeviceInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DeviceInfo.Builder toBuilder() { + return new DeviceInfo.Builder().name(getName()).accessToken(getAccessToken()).id(getId()) + .lastUserName(getLastUserName()).appName(getAppName()).appVersion(getAppVersion()) + .lastUserId(getLastUserId()).dateLastActivity(getDateLastActivity()).capabilities(getCapabilities()) + .iconUrl(getIconUrl()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceInfoQueryResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceInfoQueryResult.java new file mode 100644 index 0000000000000..bc70453bc6869 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceInfoQueryResult.java @@ -0,0 +1,288 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * DeviceInfoQueryResult + */ +@JsonPropertyOrder({ DeviceInfoQueryResult.JSON_PROPERTY_ITEMS, DeviceInfoQueryResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, + DeviceInfoQueryResult.JSON_PROPERTY_START_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DeviceInfoQueryResult { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items; + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public DeviceInfoQueryResult() { + } + + public DeviceInfoQueryResult items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public DeviceInfoQueryResult addItemsItem(DeviceInfo itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Gets or sets the items. + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public DeviceInfoQueryResult totalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total number of records available. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public DeviceInfoQueryResult startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the index of the first record in Items. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + /** + * Return true if this DeviceInfoQueryResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceInfoQueryResult deviceInfoQueryResult = (DeviceInfoQueryResult) o; + return Objects.equals(this.items, deviceInfoQueryResult.items) + && Objects.equals(this.totalRecordCount, deviceInfoQueryResult.totalRecordCount) + && Objects.equals(this.startIndex, deviceInfoQueryResult.startIndex); + } + + @Override + public int hashCode() { + return Objects.hash(items, totalRecordCount, startIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceInfoQueryResult {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DeviceInfoQueryResult instance; + + public Builder() { + this(new DeviceInfoQueryResult()); + } + + protected Builder(DeviceInfoQueryResult instance) { + this.instance = instance; + } + + public DeviceInfoQueryResult.Builder items(List items) { + this.instance.items = items; + return this; + } + + public DeviceInfoQueryResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public DeviceInfoQueryResult.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + /** + * returns a built DeviceInfoQueryResult instance. + * + * The builder is not reusable. + */ + public DeviceInfoQueryResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DeviceInfoQueryResult.Builder builder() { + return new DeviceInfoQueryResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DeviceInfoQueryResult.Builder toBuilder() { + return new DeviceInfoQueryResult.Builder().items(getItems()).totalRecordCount(getTotalRecordCount()) + .startIndex(getStartIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceOptions.java new file mode 100644 index 0000000000000..3ba208450e064 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceOptions.java @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * An entity representing custom options for a device. + */ +@JsonPropertyOrder({ DeviceOptions.JSON_PROPERTY_ID, DeviceOptions.JSON_PROPERTY_DEVICE_ID, + DeviceOptions.JSON_PROPERTY_CUSTOM_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DeviceOptions { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private Integer id; + + public static final String JSON_PROPERTY_DEVICE_ID = "DeviceId"; + @org.eclipse.jdt.annotation.NonNull + private String deviceId; + + public static final String JSON_PROPERTY_CUSTOM_NAME = "CustomName"; + @org.eclipse.jdt.annotation.NonNull + private String customName; + + public DeviceOptions() { + } + + @JsonCreator + public DeviceOptions(@JsonProperty(JSON_PROPERTY_ID) Integer id) { + this(); + this.id = id; + } + + /** + * Gets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getId() { + return id; + } + + public DeviceOptions deviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Gets the device id. + * + * @return deviceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceId() { + return deviceId; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + } + + public DeviceOptions customName(@org.eclipse.jdt.annotation.NonNull String customName) { + this.customName = customName; + return this; + } + + /** + * Gets or sets the custom name. + * + * @return customName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CUSTOM_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCustomName() { + return customName; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomName(@org.eclipse.jdt.annotation.NonNull String customName) { + this.customName = customName; + } + + /** + * Return true if this DeviceOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceOptions deviceOptions = (DeviceOptions) o; + return Objects.equals(this.id, deviceOptions.id) && Objects.equals(this.deviceId, deviceOptions.deviceId) + && Objects.equals(this.customName, deviceOptions.customName); + } + + @Override + public int hashCode() { + return Objects.hash(id, deviceId, customName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceOptions {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deviceId: ").append(toIndentedString(deviceId)).append("\n"); + sb.append(" customName: ").append(toIndentedString(customName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `DeviceId` to the URL query string + if (getDeviceId() != null) { + joiner.add(String.format("%sDeviceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceId())))); + } + + // add `CustomName` to the URL query string + if (getCustomName() != null) { + joiner.add(String.format("%sCustomName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCustomName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DeviceOptions instance; + + public Builder() { + this(new DeviceOptions()); + } + + protected Builder(DeviceOptions instance) { + this.instance = instance; + } + + public DeviceOptions.Builder id(Integer id) { + this.instance.id = id; + return this; + } + + public DeviceOptions.Builder deviceId(String deviceId) { + this.instance.deviceId = deviceId; + return this; + } + + public DeviceOptions.Builder customName(String customName) { + this.instance.customName = customName; + return this; + } + + /** + * returns a built DeviceOptions instance. + * + * The builder is not reusable. + */ + public DeviceOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DeviceOptions.Builder builder() { + return new DeviceOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DeviceOptions.Builder toBuilder() { + return new DeviceOptions.Builder().id(getId()).deviceId(getDeviceId()).customName(getCustomName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceOptionsDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceOptionsDto.java new file mode 100644 index 0000000000000..97cef12b6c859 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceOptionsDto.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * A dto representing custom options for a device. + */ +@JsonPropertyOrder({ DeviceOptionsDto.JSON_PROPERTY_ID, DeviceOptionsDto.JSON_PROPERTY_DEVICE_ID, + DeviceOptionsDto.JSON_PROPERTY_CUSTOM_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DeviceOptionsDto { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private Integer id; + + public static final String JSON_PROPERTY_DEVICE_ID = "DeviceId"; + @org.eclipse.jdt.annotation.NonNull + private String deviceId; + + public static final String JSON_PROPERTY_CUSTOM_NAME = "CustomName"; + @org.eclipse.jdt.annotation.NonNull + private String customName; + + public DeviceOptionsDto() { + } + + public DeviceOptionsDto id(@org.eclipse.jdt.annotation.NonNull Integer id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull Integer id) { + this.id = id; + } + + public DeviceOptionsDto deviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Gets or sets the device id. + * + * @return deviceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceId() { + return deviceId; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + } + + public DeviceOptionsDto customName(@org.eclipse.jdt.annotation.NonNull String customName) { + this.customName = customName; + return this; + } + + /** + * Gets or sets the custom name. + * + * @return customName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CUSTOM_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCustomName() { + return customName; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomName(@org.eclipse.jdt.annotation.NonNull String customName) { + this.customName = customName; + } + + /** + * Return true if this DeviceOptionsDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceOptionsDto deviceOptionsDto = (DeviceOptionsDto) o; + return Objects.equals(this.id, deviceOptionsDto.id) && Objects.equals(this.deviceId, deviceOptionsDto.deviceId) + && Objects.equals(this.customName, deviceOptionsDto.customName); + } + + @Override + public int hashCode() { + return Objects.hash(id, deviceId, customName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceOptionsDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deviceId: ").append(toIndentedString(deviceId)).append("\n"); + sb.append(" customName: ").append(toIndentedString(customName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `DeviceId` to the URL query string + if (getDeviceId() != null) { + joiner.add(String.format("%sDeviceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceId())))); + } + + // add `CustomName` to the URL query string + if (getCustomName() != null) { + joiner.add(String.format("%sCustomName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCustomName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DeviceOptionsDto instance; + + public Builder() { + this(new DeviceOptionsDto()); + } + + protected Builder(DeviceOptionsDto instance) { + this.instance = instance; + } + + public DeviceOptionsDto.Builder id(Integer id) { + this.instance.id = id; + return this; + } + + public DeviceOptionsDto.Builder deviceId(String deviceId) { + this.instance.deviceId = deviceId; + return this; + } + + public DeviceOptionsDto.Builder customName(String customName) { + this.instance.customName = customName; + return this; + } + + /** + * returns a built DeviceOptionsDto instance. + * + * The builder is not reusable. + */ + public DeviceOptionsDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DeviceOptionsDto.Builder builder() { + return new DeviceOptionsDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DeviceOptionsDto.Builder toBuilder() { + return new DeviceOptionsDto.Builder().id(getId()).deviceId(getDeviceId()).customName(getCustomName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceProfile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceProfile.java new file mode 100644 index 0000000000000..6d62ab3fd0541 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceProfile.java @@ -0,0 +1,1872 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device + * is able to play. <br /> Specifically, it defines the supported <see + * cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles\">containers</see> and + * <see cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles\">codecs</see> (video + * and/or audio, including codec profiles and levels) the device is able to direct play (without transcoding or + * remuxing), as well as which <see + * cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles\">containers/codecs to transcode + * to</see> in case it isn't. + */ +@JsonPropertyOrder({ DeviceProfile.JSON_PROPERTY_NAME, DeviceProfile.JSON_PROPERTY_ID, + DeviceProfile.JSON_PROPERTY_IDENTIFICATION, DeviceProfile.JSON_PROPERTY_FRIENDLY_NAME, + DeviceProfile.JSON_PROPERTY_MANUFACTURER, DeviceProfile.JSON_PROPERTY_MANUFACTURER_URL, + DeviceProfile.JSON_PROPERTY_MODEL_NAME, DeviceProfile.JSON_PROPERTY_MODEL_DESCRIPTION, + DeviceProfile.JSON_PROPERTY_MODEL_NUMBER, DeviceProfile.JSON_PROPERTY_MODEL_URL, + DeviceProfile.JSON_PROPERTY_SERIAL_NUMBER, DeviceProfile.JSON_PROPERTY_ENABLE_ALBUM_ART_IN_DIDL, + DeviceProfile.JSON_PROPERTY_ENABLE_SINGLE_ALBUM_ART_LIMIT, + DeviceProfile.JSON_PROPERTY_ENABLE_SINGLE_SUBTITLE_LIMIT, DeviceProfile.JSON_PROPERTY_SUPPORTED_MEDIA_TYPES, + DeviceProfile.JSON_PROPERTY_USER_ID, DeviceProfile.JSON_PROPERTY_ALBUM_ART_PN, + DeviceProfile.JSON_PROPERTY_MAX_ALBUM_ART_WIDTH, DeviceProfile.JSON_PROPERTY_MAX_ALBUM_ART_HEIGHT, + DeviceProfile.JSON_PROPERTY_MAX_ICON_WIDTH, DeviceProfile.JSON_PROPERTY_MAX_ICON_HEIGHT, + DeviceProfile.JSON_PROPERTY_MAX_STREAMING_BITRATE, DeviceProfile.JSON_PROPERTY_MAX_STATIC_BITRATE, + DeviceProfile.JSON_PROPERTY_MUSIC_STREAMING_TRANSCODING_BITRATE, + DeviceProfile.JSON_PROPERTY_MAX_STATIC_MUSIC_BITRATE, DeviceProfile.JSON_PROPERTY_SONY_AGGREGATION_FLAGS, + DeviceProfile.JSON_PROPERTY_PROTOCOL_INFO, DeviceProfile.JSON_PROPERTY_TIMELINE_OFFSET_SECONDS, + DeviceProfile.JSON_PROPERTY_REQUIRES_PLAIN_VIDEO_ITEMS, DeviceProfile.JSON_PROPERTY_REQUIRES_PLAIN_FOLDERS, + DeviceProfile.JSON_PROPERTY_ENABLE_M_S_MEDIA_RECEIVER_REGISTRAR, + DeviceProfile.JSON_PROPERTY_IGNORE_TRANSCODE_BYTE_RANGE_REQUESTS, + DeviceProfile.JSON_PROPERTY_XML_ROOT_ATTRIBUTES, DeviceProfile.JSON_PROPERTY_DIRECT_PLAY_PROFILES, + DeviceProfile.JSON_PROPERTY_TRANSCODING_PROFILES, DeviceProfile.JSON_PROPERTY_CONTAINER_PROFILES, + DeviceProfile.JSON_PROPERTY_CODEC_PROFILES, DeviceProfile.JSON_PROPERTY_RESPONSE_PROFILES, + DeviceProfile.JSON_PROPERTY_SUBTITLE_PROFILES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DeviceProfile { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_IDENTIFICATION = "Identification"; + @org.eclipse.jdt.annotation.NonNull + private DeviceIdentification identification; + + public static final String JSON_PROPERTY_FRIENDLY_NAME = "FriendlyName"; + @org.eclipse.jdt.annotation.NonNull + private String friendlyName; + + public static final String JSON_PROPERTY_MANUFACTURER = "Manufacturer"; + @org.eclipse.jdt.annotation.NonNull + private String manufacturer; + + public static final String JSON_PROPERTY_MANUFACTURER_URL = "ManufacturerUrl"; + @org.eclipse.jdt.annotation.NonNull + private String manufacturerUrl; + + public static final String JSON_PROPERTY_MODEL_NAME = "ModelName"; + @org.eclipse.jdt.annotation.NonNull + private String modelName; + + public static final String JSON_PROPERTY_MODEL_DESCRIPTION = "ModelDescription"; + @org.eclipse.jdt.annotation.NonNull + private String modelDescription; + + public static final String JSON_PROPERTY_MODEL_NUMBER = "ModelNumber"; + @org.eclipse.jdt.annotation.NonNull + private String modelNumber; + + public static final String JSON_PROPERTY_MODEL_URL = "ModelUrl"; + @org.eclipse.jdt.annotation.NonNull + private String modelUrl; + + public static final String JSON_PROPERTY_SERIAL_NUMBER = "SerialNumber"; + @org.eclipse.jdt.annotation.NonNull + private String serialNumber; + + public static final String JSON_PROPERTY_ENABLE_ALBUM_ART_IN_DIDL = "EnableAlbumArtInDidl"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAlbumArtInDidl = false; + + public static final String JSON_PROPERTY_ENABLE_SINGLE_ALBUM_ART_LIMIT = "EnableSingleAlbumArtLimit"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableSingleAlbumArtLimit = false; + + public static final String JSON_PROPERTY_ENABLE_SINGLE_SUBTITLE_LIMIT = "EnableSingleSubtitleLimit"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableSingleSubtitleLimit = false; + + public static final String JSON_PROPERTY_SUPPORTED_MEDIA_TYPES = "SupportedMediaTypes"; + @org.eclipse.jdt.annotation.NonNull + private String supportedMediaTypes; + + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private String userId; + + public static final String JSON_PROPERTY_ALBUM_ART_PN = "AlbumArtPn"; + @org.eclipse.jdt.annotation.NonNull + private String albumArtPn; + + public static final String JSON_PROPERTY_MAX_ALBUM_ART_WIDTH = "MaxAlbumArtWidth"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxAlbumArtWidth; + + public static final String JSON_PROPERTY_MAX_ALBUM_ART_HEIGHT = "MaxAlbumArtHeight"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxAlbumArtHeight; + + public static final String JSON_PROPERTY_MAX_ICON_WIDTH = "MaxIconWidth"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxIconWidth; + + public static final String JSON_PROPERTY_MAX_ICON_HEIGHT = "MaxIconHeight"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxIconHeight; + + public static final String JSON_PROPERTY_MAX_STREAMING_BITRATE = "MaxStreamingBitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxStreamingBitrate; + + public static final String JSON_PROPERTY_MAX_STATIC_BITRATE = "MaxStaticBitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxStaticBitrate; + + public static final String JSON_PROPERTY_MUSIC_STREAMING_TRANSCODING_BITRATE = "MusicStreamingTranscodingBitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer musicStreamingTranscodingBitrate; + + public static final String JSON_PROPERTY_MAX_STATIC_MUSIC_BITRATE = "MaxStaticMusicBitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxStaticMusicBitrate; + + public static final String JSON_PROPERTY_SONY_AGGREGATION_FLAGS = "SonyAggregationFlags"; + @org.eclipse.jdt.annotation.NonNull + private String sonyAggregationFlags; + + public static final String JSON_PROPERTY_PROTOCOL_INFO = "ProtocolInfo"; + @org.eclipse.jdt.annotation.NonNull + private String protocolInfo; + + public static final String JSON_PROPERTY_TIMELINE_OFFSET_SECONDS = "TimelineOffsetSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer timelineOffsetSeconds = 0; + + public static final String JSON_PROPERTY_REQUIRES_PLAIN_VIDEO_ITEMS = "RequiresPlainVideoItems"; + @org.eclipse.jdt.annotation.NonNull + private Boolean requiresPlainVideoItems = false; + + public static final String JSON_PROPERTY_REQUIRES_PLAIN_FOLDERS = "RequiresPlainFolders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean requiresPlainFolders = false; + + public static final String JSON_PROPERTY_ENABLE_M_S_MEDIA_RECEIVER_REGISTRAR = "EnableMSMediaReceiverRegistrar"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableMSMediaReceiverRegistrar = false; + + public static final String JSON_PROPERTY_IGNORE_TRANSCODE_BYTE_RANGE_REQUESTS = "IgnoreTranscodeByteRangeRequests"; + @org.eclipse.jdt.annotation.NonNull + private Boolean ignoreTranscodeByteRangeRequests = false; + + public static final String JSON_PROPERTY_XML_ROOT_ATTRIBUTES = "XmlRootAttributes"; + @org.eclipse.jdt.annotation.NonNull + private List xmlRootAttributes = new ArrayList<>(); + + public static final String JSON_PROPERTY_DIRECT_PLAY_PROFILES = "DirectPlayProfiles"; + @org.eclipse.jdt.annotation.NonNull + private List directPlayProfiles = new ArrayList<>(); + + public static final String JSON_PROPERTY_TRANSCODING_PROFILES = "TranscodingProfiles"; + @org.eclipse.jdt.annotation.NonNull + private List transcodingProfiles = new ArrayList<>(); + + public static final String JSON_PROPERTY_CONTAINER_PROFILES = "ContainerProfiles"; + @org.eclipse.jdt.annotation.NonNull + private List containerProfiles = new ArrayList<>(); + + public static final String JSON_PROPERTY_CODEC_PROFILES = "CodecProfiles"; + @org.eclipse.jdt.annotation.NonNull + private List codecProfiles = new ArrayList<>(); + + public static final String JSON_PROPERTY_RESPONSE_PROFILES = "ResponseProfiles"; + @org.eclipse.jdt.annotation.NonNull + private List responseProfiles = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUBTITLE_PROFILES = "SubtitleProfiles"; + @org.eclipse.jdt.annotation.NonNull + private List subtitleProfiles = new ArrayList<>(); + + public DeviceProfile() { + } + + public DeviceProfile name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name of this device profile. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public DeviceProfile id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the Id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public DeviceProfile identification(@org.eclipse.jdt.annotation.NonNull DeviceIdentification identification) { + this.identification = identification; + return this; + } + + /** + * Gets or sets the Identification. + * + * @return identification + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IDENTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceIdentification getIdentification() { + return identification; + } + + @JsonProperty(JSON_PROPERTY_IDENTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentification(@org.eclipse.jdt.annotation.NonNull DeviceIdentification identification) { + this.identification = identification; + } + + public DeviceProfile friendlyName(@org.eclipse.jdt.annotation.NonNull String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Gets or sets the friendly name of the device profile, which can be shown to users. + * + * @return friendlyName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FRIENDLY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFriendlyName() { + return friendlyName; + } + + @JsonProperty(JSON_PROPERTY_FRIENDLY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFriendlyName(@org.eclipse.jdt.annotation.NonNull String friendlyName) { + this.friendlyName = friendlyName; + } + + public DeviceProfile manufacturer(@org.eclipse.jdt.annotation.NonNull String manufacturer) { + this.manufacturer = manufacturer; + return this; + } + + /** + * Gets or sets the manufacturer of the device which this profile represents. + * + * @return manufacturer + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MANUFACTURER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getManufacturer() { + return manufacturer; + } + + @JsonProperty(JSON_PROPERTY_MANUFACTURER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setManufacturer(@org.eclipse.jdt.annotation.NonNull String manufacturer) { + this.manufacturer = manufacturer; + } + + public DeviceProfile manufacturerUrl(@org.eclipse.jdt.annotation.NonNull String manufacturerUrl) { + this.manufacturerUrl = manufacturerUrl; + return this; + } + + /** + * Gets or sets an url for the manufacturer of the device which this profile represents. + * + * @return manufacturerUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MANUFACTURER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getManufacturerUrl() { + return manufacturerUrl; + } + + @JsonProperty(JSON_PROPERTY_MANUFACTURER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setManufacturerUrl(@org.eclipse.jdt.annotation.NonNull String manufacturerUrl) { + this.manufacturerUrl = manufacturerUrl; + } + + public DeviceProfile modelName(@org.eclipse.jdt.annotation.NonNull String modelName) { + this.modelName = modelName; + return this; + } + + /** + * Gets or sets the model name of the device which this profile represents. + * + * @return modelName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MODEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getModelName() { + return modelName; + } + + @JsonProperty(JSON_PROPERTY_MODEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setModelName(@org.eclipse.jdt.annotation.NonNull String modelName) { + this.modelName = modelName; + } + + public DeviceProfile modelDescription(@org.eclipse.jdt.annotation.NonNull String modelDescription) { + this.modelDescription = modelDescription; + return this; + } + + /** + * Gets or sets the model description of the device which this profile represents. + * + * @return modelDescription + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MODEL_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getModelDescription() { + return modelDescription; + } + + @JsonProperty(JSON_PROPERTY_MODEL_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setModelDescription(@org.eclipse.jdt.annotation.NonNull String modelDescription) { + this.modelDescription = modelDescription; + } + + public DeviceProfile modelNumber(@org.eclipse.jdt.annotation.NonNull String modelNumber) { + this.modelNumber = modelNumber; + return this; + } + + /** + * Gets or sets the model number of the device which this profile represents. + * + * @return modelNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MODEL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getModelNumber() { + return modelNumber; + } + + @JsonProperty(JSON_PROPERTY_MODEL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setModelNumber(@org.eclipse.jdt.annotation.NonNull String modelNumber) { + this.modelNumber = modelNumber; + } + + public DeviceProfile modelUrl(@org.eclipse.jdt.annotation.NonNull String modelUrl) { + this.modelUrl = modelUrl; + return this; + } + + /** + * Gets or sets the ModelUrl. + * + * @return modelUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MODEL_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getModelUrl() { + return modelUrl; + } + + @JsonProperty(JSON_PROPERTY_MODEL_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setModelUrl(@org.eclipse.jdt.annotation.NonNull String modelUrl) { + this.modelUrl = modelUrl; + } + + public DeviceProfile serialNumber(@org.eclipse.jdt.annotation.NonNull String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Gets or sets the serial number of the device which this profile represents. + * + * @return serialNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIAL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSerialNumber() { + return serialNumber; + } + + @JsonProperty(JSON_PROPERTY_SERIAL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSerialNumber(@org.eclipse.jdt.annotation.NonNull String serialNumber) { + this.serialNumber = serialNumber; + } + + public DeviceProfile enableAlbumArtInDidl(@org.eclipse.jdt.annotation.NonNull Boolean enableAlbumArtInDidl) { + this.enableAlbumArtInDidl = enableAlbumArtInDidl; + return this; + } + + /** + * Gets or sets a value indicating whether EnableAlbumArtInDidl. + * + * @return enableAlbumArtInDidl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_ALBUM_ART_IN_DIDL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAlbumArtInDidl() { + return enableAlbumArtInDidl; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_ALBUM_ART_IN_DIDL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAlbumArtInDidl(@org.eclipse.jdt.annotation.NonNull Boolean enableAlbumArtInDidl) { + this.enableAlbumArtInDidl = enableAlbumArtInDidl; + } + + public DeviceProfile enableSingleAlbumArtLimit( + @org.eclipse.jdt.annotation.NonNull Boolean enableSingleAlbumArtLimit) { + this.enableSingleAlbumArtLimit = enableSingleAlbumArtLimit; + return this; + } + + /** + * Gets or sets a value indicating whether EnableSingleAlbumArtLimit. + * + * @return enableSingleAlbumArtLimit + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_SINGLE_ALBUM_ART_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableSingleAlbumArtLimit() { + return enableSingleAlbumArtLimit; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_SINGLE_ALBUM_ART_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableSingleAlbumArtLimit(@org.eclipse.jdt.annotation.NonNull Boolean enableSingleAlbumArtLimit) { + this.enableSingleAlbumArtLimit = enableSingleAlbumArtLimit; + } + + public DeviceProfile enableSingleSubtitleLimit( + @org.eclipse.jdt.annotation.NonNull Boolean enableSingleSubtitleLimit) { + this.enableSingleSubtitleLimit = enableSingleSubtitleLimit; + return this; + } + + /** + * Gets or sets a value indicating whether EnableSingleSubtitleLimit. + * + * @return enableSingleSubtitleLimit + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_SINGLE_SUBTITLE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableSingleSubtitleLimit() { + return enableSingleSubtitleLimit; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_SINGLE_SUBTITLE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableSingleSubtitleLimit(@org.eclipse.jdt.annotation.NonNull Boolean enableSingleSubtitleLimit) { + this.enableSingleSubtitleLimit = enableSingleSubtitleLimit; + } + + public DeviceProfile supportedMediaTypes(@org.eclipse.jdt.annotation.NonNull String supportedMediaTypes) { + this.supportedMediaTypes = supportedMediaTypes; + return this; + } + + /** + * Gets or sets the SupportedMediaTypes. + * + * @return supportedMediaTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTED_MEDIA_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSupportedMediaTypes() { + return supportedMediaTypes; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTED_MEDIA_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportedMediaTypes(@org.eclipse.jdt.annotation.NonNull String supportedMediaTypes) { + this.supportedMediaTypes = supportedMediaTypes; + } + + public DeviceProfile userId(@org.eclipse.jdt.annotation.NonNull String userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the UserId. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull String userId) { + this.userId = userId; + } + + public DeviceProfile albumArtPn(@org.eclipse.jdt.annotation.NonNull String albumArtPn) { + this.albumArtPn = albumArtPn; + return this; + } + + /** + * Gets or sets the AlbumArtPn. + * + * @return albumArtPn + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ART_PN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlbumArtPn() { + return albumArtPn; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ART_PN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumArtPn(@org.eclipse.jdt.annotation.NonNull String albumArtPn) { + this.albumArtPn = albumArtPn; + } + + public DeviceProfile maxAlbumArtWidth(@org.eclipse.jdt.annotation.NonNull Integer maxAlbumArtWidth) { + this.maxAlbumArtWidth = maxAlbumArtWidth; + return this; + } + + /** + * Gets or sets the MaxAlbumArtWidth. + * + * @return maxAlbumArtWidth + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_ALBUM_ART_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxAlbumArtWidth() { + return maxAlbumArtWidth; + } + + @JsonProperty(JSON_PROPERTY_MAX_ALBUM_ART_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxAlbumArtWidth(@org.eclipse.jdt.annotation.NonNull Integer maxAlbumArtWidth) { + this.maxAlbumArtWidth = maxAlbumArtWidth; + } + + public DeviceProfile maxAlbumArtHeight(@org.eclipse.jdt.annotation.NonNull Integer maxAlbumArtHeight) { + this.maxAlbumArtHeight = maxAlbumArtHeight; + return this; + } + + /** + * Gets or sets the MaxAlbumArtHeight. + * + * @return maxAlbumArtHeight + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_ALBUM_ART_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxAlbumArtHeight() { + return maxAlbumArtHeight; + } + + @JsonProperty(JSON_PROPERTY_MAX_ALBUM_ART_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxAlbumArtHeight(@org.eclipse.jdt.annotation.NonNull Integer maxAlbumArtHeight) { + this.maxAlbumArtHeight = maxAlbumArtHeight; + } + + public DeviceProfile maxIconWidth(@org.eclipse.jdt.annotation.NonNull Integer maxIconWidth) { + this.maxIconWidth = maxIconWidth; + return this; + } + + /** + * Gets or sets the maximum allowed width of embedded icons. + * + * @return maxIconWidth + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_ICON_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxIconWidth() { + return maxIconWidth; + } + + @JsonProperty(JSON_PROPERTY_MAX_ICON_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxIconWidth(@org.eclipse.jdt.annotation.NonNull Integer maxIconWidth) { + this.maxIconWidth = maxIconWidth; + } + + public DeviceProfile maxIconHeight(@org.eclipse.jdt.annotation.NonNull Integer maxIconHeight) { + this.maxIconHeight = maxIconHeight; + return this; + } + + /** + * Gets or sets the maximum allowed height of embedded icons. + * + * @return maxIconHeight + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_ICON_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxIconHeight() { + return maxIconHeight; + } + + @JsonProperty(JSON_PROPERTY_MAX_ICON_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxIconHeight(@org.eclipse.jdt.annotation.NonNull Integer maxIconHeight) { + this.maxIconHeight = maxIconHeight; + } + + public DeviceProfile maxStreamingBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate) { + this.maxStreamingBitrate = maxStreamingBitrate; + return this; + } + + /** + * Gets or sets the maximum allowed bitrate for all streamed content. + * + * @return maxStreamingBitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_STREAMING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxStreamingBitrate() { + return maxStreamingBitrate; + } + + @JsonProperty(JSON_PROPERTY_MAX_STREAMING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxStreamingBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate) { + this.maxStreamingBitrate = maxStreamingBitrate; + } + + public DeviceProfile maxStaticBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStaticBitrate) { + this.maxStaticBitrate = maxStaticBitrate; + return this; + } + + /** + * Gets or sets the maximum allowed bitrate for statically streamed content (= direct played files). + * + * @return maxStaticBitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_STATIC_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxStaticBitrate() { + return maxStaticBitrate; + } + + @JsonProperty(JSON_PROPERTY_MAX_STATIC_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxStaticBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStaticBitrate) { + this.maxStaticBitrate = maxStaticBitrate; + } + + public DeviceProfile musicStreamingTranscodingBitrate( + @org.eclipse.jdt.annotation.NonNull Integer musicStreamingTranscodingBitrate) { + this.musicStreamingTranscodingBitrate = musicStreamingTranscodingBitrate; + return this; + } + + /** + * Gets or sets the maximum allowed bitrate for transcoded music streams. + * + * @return musicStreamingTranscodingBitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MUSIC_STREAMING_TRANSCODING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMusicStreamingTranscodingBitrate() { + return musicStreamingTranscodingBitrate; + } + + @JsonProperty(JSON_PROPERTY_MUSIC_STREAMING_TRANSCODING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMusicStreamingTranscodingBitrate( + @org.eclipse.jdt.annotation.NonNull Integer musicStreamingTranscodingBitrate) { + this.musicStreamingTranscodingBitrate = musicStreamingTranscodingBitrate; + } + + public DeviceProfile maxStaticMusicBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStaticMusicBitrate) { + this.maxStaticMusicBitrate = maxStaticMusicBitrate; + return this; + } + + /** + * Gets or sets the maximum allowed bitrate for statically streamed (= direct played) music files. + * + * @return maxStaticMusicBitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_STATIC_MUSIC_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxStaticMusicBitrate() { + return maxStaticMusicBitrate; + } + + @JsonProperty(JSON_PROPERTY_MAX_STATIC_MUSIC_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxStaticMusicBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStaticMusicBitrate) { + this.maxStaticMusicBitrate = maxStaticMusicBitrate; + } + + public DeviceProfile sonyAggregationFlags(@org.eclipse.jdt.annotation.NonNull String sonyAggregationFlags) { + this.sonyAggregationFlags = sonyAggregationFlags; + return this; + } + + /** + * Gets or sets the content of the aggregationFlags element in the urn:schemas-sonycom:av namespace. + * + * @return sonyAggregationFlags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SONY_AGGREGATION_FLAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSonyAggregationFlags() { + return sonyAggregationFlags; + } + + @JsonProperty(JSON_PROPERTY_SONY_AGGREGATION_FLAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSonyAggregationFlags(@org.eclipse.jdt.annotation.NonNull String sonyAggregationFlags) { + this.sonyAggregationFlags = sonyAggregationFlags; + } + + public DeviceProfile protocolInfo(@org.eclipse.jdt.annotation.NonNull String protocolInfo) { + this.protocolInfo = protocolInfo; + return this; + } + + /** + * Gets or sets the ProtocolInfo. + * + * @return protocolInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROTOCOL_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProtocolInfo() { + return protocolInfo; + } + + @JsonProperty(JSON_PROPERTY_PROTOCOL_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtocolInfo(@org.eclipse.jdt.annotation.NonNull String protocolInfo) { + this.protocolInfo = protocolInfo; + } + + public DeviceProfile timelineOffsetSeconds(@org.eclipse.jdt.annotation.NonNull Integer timelineOffsetSeconds) { + this.timelineOffsetSeconds = timelineOffsetSeconds; + return this; + } + + /** + * Gets or sets the TimelineOffsetSeconds. + * + * @return timelineOffsetSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TIMELINE_OFFSET_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTimelineOffsetSeconds() { + return timelineOffsetSeconds; + } + + @JsonProperty(JSON_PROPERTY_TIMELINE_OFFSET_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimelineOffsetSeconds(@org.eclipse.jdt.annotation.NonNull Integer timelineOffsetSeconds) { + this.timelineOffsetSeconds = timelineOffsetSeconds; + } + + public DeviceProfile requiresPlainVideoItems(@org.eclipse.jdt.annotation.NonNull Boolean requiresPlainVideoItems) { + this.requiresPlainVideoItems = requiresPlainVideoItems; + return this; + } + + /** + * Gets or sets a value indicating whether RequiresPlainVideoItems. + * + * @return requiresPlainVideoItems + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUIRES_PLAIN_VIDEO_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequiresPlainVideoItems() { + return requiresPlainVideoItems; + } + + @JsonProperty(JSON_PROPERTY_REQUIRES_PLAIN_VIDEO_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequiresPlainVideoItems(@org.eclipse.jdt.annotation.NonNull Boolean requiresPlainVideoItems) { + this.requiresPlainVideoItems = requiresPlainVideoItems; + } + + public DeviceProfile requiresPlainFolders(@org.eclipse.jdt.annotation.NonNull Boolean requiresPlainFolders) { + this.requiresPlainFolders = requiresPlainFolders; + return this; + } + + /** + * Gets or sets a value indicating whether RequiresPlainFolders. + * + * @return requiresPlainFolders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUIRES_PLAIN_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequiresPlainFolders() { + return requiresPlainFolders; + } + + @JsonProperty(JSON_PROPERTY_REQUIRES_PLAIN_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequiresPlainFolders(@org.eclipse.jdt.annotation.NonNull Boolean requiresPlainFolders) { + this.requiresPlainFolders = requiresPlainFolders; + } + + public DeviceProfile enableMSMediaReceiverRegistrar( + @org.eclipse.jdt.annotation.NonNull Boolean enableMSMediaReceiverRegistrar) { + this.enableMSMediaReceiverRegistrar = enableMSMediaReceiverRegistrar; + return this; + } + + /** + * Gets or sets a value indicating whether EnableMSMediaReceiverRegistrar. + * + * @return enableMSMediaReceiverRegistrar + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_M_S_MEDIA_RECEIVER_REGISTRAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableMSMediaReceiverRegistrar() { + return enableMSMediaReceiverRegistrar; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_M_S_MEDIA_RECEIVER_REGISTRAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableMSMediaReceiverRegistrar( + @org.eclipse.jdt.annotation.NonNull Boolean enableMSMediaReceiverRegistrar) { + this.enableMSMediaReceiverRegistrar = enableMSMediaReceiverRegistrar; + } + + public DeviceProfile ignoreTranscodeByteRangeRequests( + @org.eclipse.jdt.annotation.NonNull Boolean ignoreTranscodeByteRangeRequests) { + this.ignoreTranscodeByteRangeRequests = ignoreTranscodeByteRangeRequests; + return this; + } + + /** + * Gets or sets a value indicating whether IgnoreTranscodeByteRangeRequests. + * + * @return ignoreTranscodeByteRangeRequests + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IGNORE_TRANSCODE_BYTE_RANGE_REQUESTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIgnoreTranscodeByteRangeRequests() { + return ignoreTranscodeByteRangeRequests; + } + + @JsonProperty(JSON_PROPERTY_IGNORE_TRANSCODE_BYTE_RANGE_REQUESTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIgnoreTranscodeByteRangeRequests( + @org.eclipse.jdt.annotation.NonNull Boolean ignoreTranscodeByteRangeRequests) { + this.ignoreTranscodeByteRangeRequests = ignoreTranscodeByteRangeRequests; + } + + public DeviceProfile xmlRootAttributes(@org.eclipse.jdt.annotation.NonNull List xmlRootAttributes) { + this.xmlRootAttributes = xmlRootAttributes; + return this; + } + + public DeviceProfile addXmlRootAttributesItem(XmlAttribute xmlRootAttributesItem) { + if (this.xmlRootAttributes == null) { + this.xmlRootAttributes = new ArrayList<>(); + } + this.xmlRootAttributes.add(xmlRootAttributesItem); + return this; + } + + /** + * Gets or sets the XmlRootAttributes. + * + * @return xmlRootAttributes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_XML_ROOT_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getXmlRootAttributes() { + return xmlRootAttributes; + } + + @JsonProperty(JSON_PROPERTY_XML_ROOT_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setXmlRootAttributes(@org.eclipse.jdt.annotation.NonNull List xmlRootAttributes) { + this.xmlRootAttributes = xmlRootAttributes; + } + + public DeviceProfile directPlayProfiles( + @org.eclipse.jdt.annotation.NonNull List directPlayProfiles) { + this.directPlayProfiles = directPlayProfiles; + return this; + } + + public DeviceProfile addDirectPlayProfilesItem(DirectPlayProfile directPlayProfilesItem) { + if (this.directPlayProfiles == null) { + this.directPlayProfiles = new ArrayList<>(); + } + this.directPlayProfiles.add(directPlayProfilesItem); + return this; + } + + /** + * Gets or sets the direct play profiles. + * + * @return directPlayProfiles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DIRECT_PLAY_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDirectPlayProfiles() { + return directPlayProfiles; + } + + @JsonProperty(JSON_PROPERTY_DIRECT_PLAY_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDirectPlayProfiles(@org.eclipse.jdt.annotation.NonNull List directPlayProfiles) { + this.directPlayProfiles = directPlayProfiles; + } + + public DeviceProfile transcodingProfiles( + @org.eclipse.jdt.annotation.NonNull List transcodingProfiles) { + this.transcodingProfiles = transcodingProfiles; + return this; + } + + public DeviceProfile addTranscodingProfilesItem(TranscodingProfile transcodingProfilesItem) { + if (this.transcodingProfiles == null) { + this.transcodingProfiles = new ArrayList<>(); + } + this.transcodingProfiles.add(transcodingProfilesItem); + return this; + } + + /** + * Gets or sets the transcoding profiles. + * + * @return transcodingProfiles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODING_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTranscodingProfiles() { + return transcodingProfiles; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODING_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodingProfiles( + @org.eclipse.jdt.annotation.NonNull List transcodingProfiles) { + this.transcodingProfiles = transcodingProfiles; + } + + public DeviceProfile containerProfiles( + @org.eclipse.jdt.annotation.NonNull List containerProfiles) { + this.containerProfiles = containerProfiles; + return this; + } + + public DeviceProfile addContainerProfilesItem(ContainerProfile containerProfilesItem) { + if (this.containerProfiles == null) { + this.containerProfiles = new ArrayList<>(); + } + this.containerProfiles.add(containerProfilesItem); + return this; + } + + /** + * Gets or sets the container profiles. + * + * @return containerProfiles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getContainerProfiles() { + return containerProfiles; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainerProfiles(@org.eclipse.jdt.annotation.NonNull List containerProfiles) { + this.containerProfiles = containerProfiles; + } + + public DeviceProfile codecProfiles(@org.eclipse.jdt.annotation.NonNull List codecProfiles) { + this.codecProfiles = codecProfiles; + return this; + } + + public DeviceProfile addCodecProfilesItem(CodecProfile codecProfilesItem) { + if (this.codecProfiles == null) { + this.codecProfiles = new ArrayList<>(); + } + this.codecProfiles.add(codecProfilesItem); + return this; + } + + /** + * Gets or sets the codec profiles. + * + * @return codecProfiles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODEC_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCodecProfiles() { + return codecProfiles; + } + + @JsonProperty(JSON_PROPERTY_CODEC_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCodecProfiles(@org.eclipse.jdt.annotation.NonNull List codecProfiles) { + this.codecProfiles = codecProfiles; + } + + public DeviceProfile responseProfiles(@org.eclipse.jdt.annotation.NonNull List responseProfiles) { + this.responseProfiles = responseProfiles; + return this; + } + + public DeviceProfile addResponseProfilesItem(ResponseProfile responseProfilesItem) { + if (this.responseProfiles == null) { + this.responseProfiles = new ArrayList<>(); + } + this.responseProfiles.add(responseProfilesItem); + return this; + } + + /** + * Gets or sets the ResponseProfiles. + * + * @return responseProfiles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RESPONSE_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getResponseProfiles() { + return responseProfiles; + } + + @JsonProperty(JSON_PROPERTY_RESPONSE_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponseProfiles(@org.eclipse.jdt.annotation.NonNull List responseProfiles) { + this.responseProfiles = responseProfiles; + } + + public DeviceProfile subtitleProfiles(@org.eclipse.jdt.annotation.NonNull List subtitleProfiles) { + this.subtitleProfiles = subtitleProfiles; + return this; + } + + public DeviceProfile addSubtitleProfilesItem(SubtitleProfile subtitleProfilesItem) { + if (this.subtitleProfiles == null) { + this.subtitleProfiles = new ArrayList<>(); + } + this.subtitleProfiles.add(subtitleProfilesItem); + return this; + } + + /** + * Gets or sets the subtitle profiles. + * + * @return subtitleProfiles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSubtitleProfiles() { + return subtitleProfiles; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleProfiles(@org.eclipse.jdt.annotation.NonNull List subtitleProfiles) { + this.subtitleProfiles = subtitleProfiles; + } + + /** + * Return true if this DeviceProfile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceProfile deviceProfile = (DeviceProfile) o; + return Objects.equals(this.name, deviceProfile.name) && Objects.equals(this.id, deviceProfile.id) + && Objects.equals(this.identification, deviceProfile.identification) + && Objects.equals(this.friendlyName, deviceProfile.friendlyName) + && Objects.equals(this.manufacturer, deviceProfile.manufacturer) + && Objects.equals(this.manufacturerUrl, deviceProfile.manufacturerUrl) + && Objects.equals(this.modelName, deviceProfile.modelName) + && Objects.equals(this.modelDescription, deviceProfile.modelDescription) + && Objects.equals(this.modelNumber, deviceProfile.modelNumber) + && Objects.equals(this.modelUrl, deviceProfile.modelUrl) + && Objects.equals(this.serialNumber, deviceProfile.serialNumber) + && Objects.equals(this.enableAlbumArtInDidl, deviceProfile.enableAlbumArtInDidl) + && Objects.equals(this.enableSingleAlbumArtLimit, deviceProfile.enableSingleAlbumArtLimit) + && Objects.equals(this.enableSingleSubtitleLimit, deviceProfile.enableSingleSubtitleLimit) + && Objects.equals(this.supportedMediaTypes, deviceProfile.supportedMediaTypes) + && Objects.equals(this.userId, deviceProfile.userId) + && Objects.equals(this.albumArtPn, deviceProfile.albumArtPn) + && Objects.equals(this.maxAlbumArtWidth, deviceProfile.maxAlbumArtWidth) + && Objects.equals(this.maxAlbumArtHeight, deviceProfile.maxAlbumArtHeight) + && Objects.equals(this.maxIconWidth, deviceProfile.maxIconWidth) + && Objects.equals(this.maxIconHeight, deviceProfile.maxIconHeight) + && Objects.equals(this.maxStreamingBitrate, deviceProfile.maxStreamingBitrate) + && Objects.equals(this.maxStaticBitrate, deviceProfile.maxStaticBitrate) + && Objects.equals(this.musicStreamingTranscodingBitrate, deviceProfile.musicStreamingTranscodingBitrate) + && Objects.equals(this.maxStaticMusicBitrate, deviceProfile.maxStaticMusicBitrate) + && Objects.equals(this.sonyAggregationFlags, deviceProfile.sonyAggregationFlags) + && Objects.equals(this.protocolInfo, deviceProfile.protocolInfo) + && Objects.equals(this.timelineOffsetSeconds, deviceProfile.timelineOffsetSeconds) + && Objects.equals(this.requiresPlainVideoItems, deviceProfile.requiresPlainVideoItems) + && Objects.equals(this.requiresPlainFolders, deviceProfile.requiresPlainFolders) + && Objects.equals(this.enableMSMediaReceiverRegistrar, deviceProfile.enableMSMediaReceiverRegistrar) + && Objects.equals(this.ignoreTranscodeByteRangeRequests, deviceProfile.ignoreTranscodeByteRangeRequests) + && Objects.equals(this.xmlRootAttributes, deviceProfile.xmlRootAttributes) + && Objects.equals(this.directPlayProfiles, deviceProfile.directPlayProfiles) + && Objects.equals(this.transcodingProfiles, deviceProfile.transcodingProfiles) + && Objects.equals(this.containerProfiles, deviceProfile.containerProfiles) + && Objects.equals(this.codecProfiles, deviceProfile.codecProfiles) + && Objects.equals(this.responseProfiles, deviceProfile.responseProfiles) + && Objects.equals(this.subtitleProfiles, deviceProfile.subtitleProfiles); + } + + @Override + public int hashCode() { + return Objects.hash(name, id, identification, friendlyName, manufacturer, manufacturerUrl, modelName, + modelDescription, modelNumber, modelUrl, serialNumber, enableAlbumArtInDidl, enableSingleAlbumArtLimit, + enableSingleSubtitleLimit, supportedMediaTypes, userId, albumArtPn, maxAlbumArtWidth, maxAlbumArtHeight, + maxIconWidth, maxIconHeight, maxStreamingBitrate, maxStaticBitrate, musicStreamingTranscodingBitrate, + maxStaticMusicBitrate, sonyAggregationFlags, protocolInfo, timelineOffsetSeconds, + requiresPlainVideoItems, requiresPlainFolders, enableMSMediaReceiverRegistrar, + ignoreTranscodeByteRangeRequests, xmlRootAttributes, directPlayProfiles, transcodingProfiles, + containerProfiles, codecProfiles, responseProfiles, subtitleProfiles); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceProfile {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" identification: ").append(toIndentedString(identification)).append("\n"); + sb.append(" friendlyName: ").append(toIndentedString(friendlyName)).append("\n"); + sb.append(" manufacturer: ").append(toIndentedString(manufacturer)).append("\n"); + sb.append(" manufacturerUrl: ").append(toIndentedString(manufacturerUrl)).append("\n"); + sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); + sb.append(" modelDescription: ").append(toIndentedString(modelDescription)).append("\n"); + sb.append(" modelNumber: ").append(toIndentedString(modelNumber)).append("\n"); + sb.append(" modelUrl: ").append(toIndentedString(modelUrl)).append("\n"); + sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); + sb.append(" enableAlbumArtInDidl: ").append(toIndentedString(enableAlbumArtInDidl)).append("\n"); + sb.append(" enableSingleAlbumArtLimit: ").append(toIndentedString(enableSingleAlbumArtLimit)).append("\n"); + sb.append(" enableSingleSubtitleLimit: ").append(toIndentedString(enableSingleSubtitleLimit)).append("\n"); + sb.append(" supportedMediaTypes: ").append(toIndentedString(supportedMediaTypes)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" albumArtPn: ").append(toIndentedString(albumArtPn)).append("\n"); + sb.append(" maxAlbumArtWidth: ").append(toIndentedString(maxAlbumArtWidth)).append("\n"); + sb.append(" maxAlbumArtHeight: ").append(toIndentedString(maxAlbumArtHeight)).append("\n"); + sb.append(" maxIconWidth: ").append(toIndentedString(maxIconWidth)).append("\n"); + sb.append(" maxIconHeight: ").append(toIndentedString(maxIconHeight)).append("\n"); + sb.append(" maxStreamingBitrate: ").append(toIndentedString(maxStreamingBitrate)).append("\n"); + sb.append(" maxStaticBitrate: ").append(toIndentedString(maxStaticBitrate)).append("\n"); + sb.append(" musicStreamingTranscodingBitrate: ").append(toIndentedString(musicStreamingTranscodingBitrate)) + .append("\n"); + sb.append(" maxStaticMusicBitrate: ").append(toIndentedString(maxStaticMusicBitrate)).append("\n"); + sb.append(" sonyAggregationFlags: ").append(toIndentedString(sonyAggregationFlags)).append("\n"); + sb.append(" protocolInfo: ").append(toIndentedString(protocolInfo)).append("\n"); + sb.append(" timelineOffsetSeconds: ").append(toIndentedString(timelineOffsetSeconds)).append("\n"); + sb.append(" requiresPlainVideoItems: ").append(toIndentedString(requiresPlainVideoItems)).append("\n"); + sb.append(" requiresPlainFolders: ").append(toIndentedString(requiresPlainFolders)).append("\n"); + sb.append(" enableMSMediaReceiverRegistrar: ").append(toIndentedString(enableMSMediaReceiverRegistrar)) + .append("\n"); + sb.append(" ignoreTranscodeByteRangeRequests: ").append(toIndentedString(ignoreTranscodeByteRangeRequests)) + .append("\n"); + sb.append(" xmlRootAttributes: ").append(toIndentedString(xmlRootAttributes)).append("\n"); + sb.append(" directPlayProfiles: ").append(toIndentedString(directPlayProfiles)).append("\n"); + sb.append(" transcodingProfiles: ").append(toIndentedString(transcodingProfiles)).append("\n"); + sb.append(" containerProfiles: ").append(toIndentedString(containerProfiles)).append("\n"); + sb.append(" codecProfiles: ").append(toIndentedString(codecProfiles)).append("\n"); + sb.append(" responseProfiles: ").append(toIndentedString(responseProfiles)).append("\n"); + sb.append(" subtitleProfiles: ").append(toIndentedString(subtitleProfiles)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Identification` to the URL query string + if (getIdentification() != null) { + joiner.add(getIdentification().toUrlQueryString(prefix + "Identification" + suffix)); + } + + // add `FriendlyName` to the URL query string + if (getFriendlyName() != null) { + joiner.add(String.format("%sFriendlyName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFriendlyName())))); + } + + // add `Manufacturer` to the URL query string + if (getManufacturer() != null) { + joiner.add(String.format("%sManufacturer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getManufacturer())))); + } + + // add `ManufacturerUrl` to the URL query string + if (getManufacturerUrl() != null) { + joiner.add(String.format("%sManufacturerUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getManufacturerUrl())))); + } + + // add `ModelName` to the URL query string + if (getModelName() != null) { + joiner.add(String.format("%sModelName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getModelName())))); + } + + // add `ModelDescription` to the URL query string + if (getModelDescription() != null) { + joiner.add(String.format("%sModelDescription%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getModelDescription())))); + } + + // add `ModelNumber` to the URL query string + if (getModelNumber() != null) { + joiner.add(String.format("%sModelNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getModelNumber())))); + } + + // add `ModelUrl` to the URL query string + if (getModelUrl() != null) { + joiner.add(String.format("%sModelUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getModelUrl())))); + } + + // add `SerialNumber` to the URL query string + if (getSerialNumber() != null) { + joiner.add(String.format("%sSerialNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSerialNumber())))); + } + + // add `EnableAlbumArtInDidl` to the URL query string + if (getEnableAlbumArtInDidl() != null) { + joiner.add(String.format("%sEnableAlbumArtInDidl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAlbumArtInDidl())))); + } + + // add `EnableSingleAlbumArtLimit` to the URL query string + if (getEnableSingleAlbumArtLimit() != null) { + joiner.add(String.format("%sEnableSingleAlbumArtLimit%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableSingleAlbumArtLimit())))); + } + + // add `EnableSingleSubtitleLimit` to the URL query string + if (getEnableSingleSubtitleLimit() != null) { + joiner.add(String.format("%sEnableSingleSubtitleLimit%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableSingleSubtitleLimit())))); + } + + // add `SupportedMediaTypes` to the URL query string + if (getSupportedMediaTypes() != null) { + joiner.add(String.format("%sSupportedMediaTypes%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportedMediaTypes())))); + } + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `AlbumArtPn` to the URL query string + if (getAlbumArtPn() != null) { + joiner.add(String.format("%sAlbumArtPn%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbumArtPn())))); + } + + // add `MaxAlbumArtWidth` to the URL query string + if (getMaxAlbumArtWidth() != null) { + joiner.add(String.format("%sMaxAlbumArtWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxAlbumArtWidth())))); + } + + // add `MaxAlbumArtHeight` to the URL query string + if (getMaxAlbumArtHeight() != null) { + joiner.add(String.format("%sMaxAlbumArtHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxAlbumArtHeight())))); + } + + // add `MaxIconWidth` to the URL query string + if (getMaxIconWidth() != null) { + joiner.add(String.format("%sMaxIconWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxIconWidth())))); + } + + // add `MaxIconHeight` to the URL query string + if (getMaxIconHeight() != null) { + joiner.add(String.format("%sMaxIconHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxIconHeight())))); + } + + // add `MaxStreamingBitrate` to the URL query string + if (getMaxStreamingBitrate() != null) { + joiner.add(String.format("%sMaxStreamingBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxStreamingBitrate())))); + } + + // add `MaxStaticBitrate` to the URL query string + if (getMaxStaticBitrate() != null) { + joiner.add(String.format("%sMaxStaticBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxStaticBitrate())))); + } + + // add `MusicStreamingTranscodingBitrate` to the URL query string + if (getMusicStreamingTranscodingBitrate() != null) { + joiner.add(String.format("%sMusicStreamingTranscodingBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMusicStreamingTranscodingBitrate())))); + } + + // add `MaxStaticMusicBitrate` to the URL query string + if (getMaxStaticMusicBitrate() != null) { + joiner.add(String.format("%sMaxStaticMusicBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxStaticMusicBitrate())))); + } + + // add `SonyAggregationFlags` to the URL query string + if (getSonyAggregationFlags() != null) { + joiner.add(String.format("%sSonyAggregationFlags%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSonyAggregationFlags())))); + } + + // add `ProtocolInfo` to the URL query string + if (getProtocolInfo() != null) { + joiner.add(String.format("%sProtocolInfo%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProtocolInfo())))); + } + + // add `TimelineOffsetSeconds` to the URL query string + if (getTimelineOffsetSeconds() != null) { + joiner.add(String.format("%sTimelineOffsetSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTimelineOffsetSeconds())))); + } + + // add `RequiresPlainVideoItems` to the URL query string + if (getRequiresPlainVideoItems() != null) { + joiner.add(String.format("%sRequiresPlainVideoItems%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRequiresPlainVideoItems())))); + } + + // add `RequiresPlainFolders` to the URL query string + if (getRequiresPlainFolders() != null) { + joiner.add(String.format("%sRequiresPlainFolders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRequiresPlainFolders())))); + } + + // add `EnableMSMediaReceiverRegistrar` to the URL query string + if (getEnableMSMediaReceiverRegistrar() != null) { + joiner.add(String.format("%sEnableMSMediaReceiverRegistrar%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableMSMediaReceiverRegistrar())))); + } + + // add `IgnoreTranscodeByteRangeRequests` to the URL query string + if (getIgnoreTranscodeByteRangeRequests() != null) { + joiner.add(String.format("%sIgnoreTranscodeByteRangeRequests%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIgnoreTranscodeByteRangeRequests())))); + } + + // add `XmlRootAttributes` to the URL query string + if (getXmlRootAttributes() != null) { + for (int i = 0; i < getXmlRootAttributes().size(); i++) { + if (getXmlRootAttributes().get(i) != null) { + joiner.add(getXmlRootAttributes().get(i).toUrlQueryString(String.format("%sXmlRootAttributes%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `DirectPlayProfiles` to the URL query string + if (getDirectPlayProfiles() != null) { + for (int i = 0; i < getDirectPlayProfiles().size(); i++) { + if (getDirectPlayProfiles().get(i) != null) { + joiner.add(getDirectPlayProfiles().get(i).toUrlQueryString(String.format("%sDirectPlayProfiles%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TranscodingProfiles` to the URL query string + if (getTranscodingProfiles() != null) { + for (int i = 0; i < getTranscodingProfiles().size(); i++) { + if (getTranscodingProfiles().get(i) != null) { + joiner.add(getTranscodingProfiles().get(i).toUrlQueryString(String.format( + "%sTranscodingProfiles%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ContainerProfiles` to the URL query string + if (getContainerProfiles() != null) { + for (int i = 0; i < getContainerProfiles().size(); i++) { + if (getContainerProfiles().get(i) != null) { + joiner.add(getContainerProfiles().get(i).toUrlQueryString(String.format("%sContainerProfiles%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `CodecProfiles` to the URL query string + if (getCodecProfiles() != null) { + for (int i = 0; i < getCodecProfiles().size(); i++) { + if (getCodecProfiles().get(i) != null) { + joiner.add(getCodecProfiles().get(i).toUrlQueryString(String.format("%sCodecProfiles%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ResponseProfiles` to the URL query string + if (getResponseProfiles() != null) { + for (int i = 0; i < getResponseProfiles().size(); i++) { + if (getResponseProfiles().get(i) != null) { + joiner.add(getResponseProfiles().get(i).toUrlQueryString(String.format("%sResponseProfiles%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `SubtitleProfiles` to the URL query string + if (getSubtitleProfiles() != null) { + for (int i = 0; i < getSubtitleProfiles().size(); i++) { + if (getSubtitleProfiles().get(i) != null) { + joiner.add(getSubtitleProfiles().get(i).toUrlQueryString(String.format("%sSubtitleProfiles%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private DeviceProfile instance; + + public Builder() { + this(new DeviceProfile()); + } + + protected Builder(DeviceProfile instance) { + this.instance = instance; + } + + public DeviceProfile.Builder name(String name) { + this.instance.name = name; + return this; + } + + public DeviceProfile.Builder id(String id) { + this.instance.id = id; + return this; + } + + public DeviceProfile.Builder identification(DeviceIdentification identification) { + this.instance.identification = identification; + return this; + } + + public DeviceProfile.Builder friendlyName(String friendlyName) { + this.instance.friendlyName = friendlyName; + return this; + } + + public DeviceProfile.Builder manufacturer(String manufacturer) { + this.instance.manufacturer = manufacturer; + return this; + } + + public DeviceProfile.Builder manufacturerUrl(String manufacturerUrl) { + this.instance.manufacturerUrl = manufacturerUrl; + return this; + } + + public DeviceProfile.Builder modelName(String modelName) { + this.instance.modelName = modelName; + return this; + } + + public DeviceProfile.Builder modelDescription(String modelDescription) { + this.instance.modelDescription = modelDescription; + return this; + } + + public DeviceProfile.Builder modelNumber(String modelNumber) { + this.instance.modelNumber = modelNumber; + return this; + } + + public DeviceProfile.Builder modelUrl(String modelUrl) { + this.instance.modelUrl = modelUrl; + return this; + } + + public DeviceProfile.Builder serialNumber(String serialNumber) { + this.instance.serialNumber = serialNumber; + return this; + } + + public DeviceProfile.Builder enableAlbumArtInDidl(Boolean enableAlbumArtInDidl) { + this.instance.enableAlbumArtInDidl = enableAlbumArtInDidl; + return this; + } + + public DeviceProfile.Builder enableSingleAlbumArtLimit(Boolean enableSingleAlbumArtLimit) { + this.instance.enableSingleAlbumArtLimit = enableSingleAlbumArtLimit; + return this; + } + + public DeviceProfile.Builder enableSingleSubtitleLimit(Boolean enableSingleSubtitleLimit) { + this.instance.enableSingleSubtitleLimit = enableSingleSubtitleLimit; + return this; + } + + public DeviceProfile.Builder supportedMediaTypes(String supportedMediaTypes) { + this.instance.supportedMediaTypes = supportedMediaTypes; + return this; + } + + public DeviceProfile.Builder userId(String userId) { + this.instance.userId = userId; + return this; + } + + public DeviceProfile.Builder albumArtPn(String albumArtPn) { + this.instance.albumArtPn = albumArtPn; + return this; + } + + public DeviceProfile.Builder maxAlbumArtWidth(Integer maxAlbumArtWidth) { + this.instance.maxAlbumArtWidth = maxAlbumArtWidth; + return this; + } + + public DeviceProfile.Builder maxAlbumArtHeight(Integer maxAlbumArtHeight) { + this.instance.maxAlbumArtHeight = maxAlbumArtHeight; + return this; + } + + public DeviceProfile.Builder maxIconWidth(Integer maxIconWidth) { + this.instance.maxIconWidth = maxIconWidth; + return this; + } + + public DeviceProfile.Builder maxIconHeight(Integer maxIconHeight) { + this.instance.maxIconHeight = maxIconHeight; + return this; + } + + public DeviceProfile.Builder maxStreamingBitrate(Integer maxStreamingBitrate) { + this.instance.maxStreamingBitrate = maxStreamingBitrate; + return this; + } + + public DeviceProfile.Builder maxStaticBitrate(Integer maxStaticBitrate) { + this.instance.maxStaticBitrate = maxStaticBitrate; + return this; + } + + public DeviceProfile.Builder musicStreamingTranscodingBitrate(Integer musicStreamingTranscodingBitrate) { + this.instance.musicStreamingTranscodingBitrate = musicStreamingTranscodingBitrate; + return this; + } + + public DeviceProfile.Builder maxStaticMusicBitrate(Integer maxStaticMusicBitrate) { + this.instance.maxStaticMusicBitrate = maxStaticMusicBitrate; + return this; + } + + public DeviceProfile.Builder sonyAggregationFlags(String sonyAggregationFlags) { + this.instance.sonyAggregationFlags = sonyAggregationFlags; + return this; + } + + public DeviceProfile.Builder protocolInfo(String protocolInfo) { + this.instance.protocolInfo = protocolInfo; + return this; + } + + public DeviceProfile.Builder timelineOffsetSeconds(Integer timelineOffsetSeconds) { + this.instance.timelineOffsetSeconds = timelineOffsetSeconds; + return this; + } + + public DeviceProfile.Builder requiresPlainVideoItems(Boolean requiresPlainVideoItems) { + this.instance.requiresPlainVideoItems = requiresPlainVideoItems; + return this; + } + + public DeviceProfile.Builder requiresPlainFolders(Boolean requiresPlainFolders) { + this.instance.requiresPlainFolders = requiresPlainFolders; + return this; + } + + public DeviceProfile.Builder enableMSMediaReceiverRegistrar(Boolean enableMSMediaReceiverRegistrar) { + this.instance.enableMSMediaReceiverRegistrar = enableMSMediaReceiverRegistrar; + return this; + } + + public DeviceProfile.Builder ignoreTranscodeByteRangeRequests(Boolean ignoreTranscodeByteRangeRequests) { + this.instance.ignoreTranscodeByteRangeRequests = ignoreTranscodeByteRangeRequests; + return this; + } + + public DeviceProfile.Builder xmlRootAttributes(List xmlRootAttributes) { + this.instance.xmlRootAttributes = xmlRootAttributes; + return this; + } + + public DeviceProfile.Builder directPlayProfiles(List directPlayProfiles) { + this.instance.directPlayProfiles = directPlayProfiles; + return this; + } + + public DeviceProfile.Builder transcodingProfiles(List transcodingProfiles) { + this.instance.transcodingProfiles = transcodingProfiles; + return this; + } + + public DeviceProfile.Builder containerProfiles(List containerProfiles) { + this.instance.containerProfiles = containerProfiles; + return this; + } + + public DeviceProfile.Builder codecProfiles(List codecProfiles) { + this.instance.codecProfiles = codecProfiles; + return this; + } + + public DeviceProfile.Builder responseProfiles(List responseProfiles) { + this.instance.responseProfiles = responseProfiles; + return this; + } + + public DeviceProfile.Builder subtitleProfiles(List subtitleProfiles) { + this.instance.subtitleProfiles = subtitleProfiles; + return this; + } + + /** + * returns a built DeviceProfile instance. + * + * The builder is not reusable. + */ + public DeviceProfile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DeviceProfile.Builder builder() { + return new DeviceProfile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DeviceProfile.Builder toBuilder() { + return new DeviceProfile.Builder().name(getName()).id(getId()).identification(getIdentification()) + .friendlyName(getFriendlyName()).manufacturer(getManufacturer()).manufacturerUrl(getManufacturerUrl()) + .modelName(getModelName()).modelDescription(getModelDescription()).modelNumber(getModelNumber()) + .modelUrl(getModelUrl()).serialNumber(getSerialNumber()).enableAlbumArtInDidl(getEnableAlbumArtInDidl()) + .enableSingleAlbumArtLimit(getEnableSingleAlbumArtLimit()) + .enableSingleSubtitleLimit(getEnableSingleSubtitleLimit()).supportedMediaTypes(getSupportedMediaTypes()) + .userId(getUserId()).albumArtPn(getAlbumArtPn()).maxAlbumArtWidth(getMaxAlbumArtWidth()) + .maxAlbumArtHeight(getMaxAlbumArtHeight()).maxIconWidth(getMaxIconWidth()) + .maxIconHeight(getMaxIconHeight()).maxStreamingBitrate(getMaxStreamingBitrate()) + .maxStaticBitrate(getMaxStaticBitrate()) + .musicStreamingTranscodingBitrate(getMusicStreamingTranscodingBitrate()) + .maxStaticMusicBitrate(getMaxStaticMusicBitrate()).sonyAggregationFlags(getSonyAggregationFlags()) + .protocolInfo(getProtocolInfo()).timelineOffsetSeconds(getTimelineOffsetSeconds()) + .requiresPlainVideoItems(getRequiresPlainVideoItems()).requiresPlainFolders(getRequiresPlainFolders()) + .enableMSMediaReceiverRegistrar(getEnableMSMediaReceiverRegistrar()) + .ignoreTranscodeByteRangeRequests(getIgnoreTranscodeByteRangeRequests()) + .xmlRootAttributes(getXmlRootAttributes()).directPlayProfiles(getDirectPlayProfiles()) + .transcodingProfiles(getTranscodingProfiles()).containerProfiles(getContainerProfiles()) + .codecProfiles(getCodecProfiles()).responseProfiles(getResponseProfiles()) + .subtitleProfiles(getSubtitleProfiles()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceProfileInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceProfileInfo.java new file mode 100644 index 0000000000000..13e21293f4242 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceProfileInfo.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * DeviceProfileInfo + */ +@JsonPropertyOrder({ DeviceProfileInfo.JSON_PROPERTY_ID, DeviceProfileInfo.JSON_PROPERTY_NAME, + DeviceProfileInfo.JSON_PROPERTY_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DeviceProfileInfo { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private DeviceProfileType type; + + public DeviceProfileInfo() { + } + + public DeviceProfileInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the identifier. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public DeviceProfileInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public DeviceProfileInfo type(@org.eclipse.jdt.annotation.NonNull DeviceProfileType type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceProfileType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull DeviceProfileType type) { + this.type = type; + } + + /** + * Return true if this DeviceProfileInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceProfileInfo deviceProfileInfo = (DeviceProfileInfo) o; + return Objects.equals(this.id, deviceProfileInfo.id) && Objects.equals(this.name, deviceProfileInfo.name) + && Objects.equals(this.type, deviceProfileInfo.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceProfileInfo {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DeviceProfileInfo instance; + + public Builder() { + this(new DeviceProfileInfo()); + } + + protected Builder(DeviceProfileInfo instance) { + this.instance = instance; + } + + public DeviceProfileInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public DeviceProfileInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public DeviceProfileInfo.Builder type(DeviceProfileType type) { + this.instance.type = type; + return this; + } + + /** + * returns a built DeviceProfileInfo instance. + * + * The builder is not reusable. + */ + public DeviceProfileInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DeviceProfileInfo.Builder builder() { + return new DeviceProfileInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DeviceProfileInfo.Builder toBuilder() { + return new DeviceProfileInfo.Builder().id(getId()).name(getName()).type(getType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceProfileType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceProfileType.java new file mode 100644 index 0000000000000..0642b448bab36 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DeviceProfileType.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets DeviceProfileType + */ +public enum DeviceProfileType { + + SYSTEM("System"), + + USER("User"); + + private String value; + + DeviceProfileType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DeviceProfileType fromValue(String value) { + for (DeviceProfileType b : DeviceProfileType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DirectPlayProfile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DirectPlayProfile.java new file mode 100644 index 0000000000000..06a238401bbc8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DirectPlayProfile.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * DirectPlayProfile + */ +@JsonPropertyOrder({ DirectPlayProfile.JSON_PROPERTY_CONTAINER, DirectPlayProfile.JSON_PROPERTY_AUDIO_CODEC, + DirectPlayProfile.JSON_PROPERTY_VIDEO_CODEC, DirectPlayProfile.JSON_PROPERTY_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DirectPlayProfile { + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public static final String JSON_PROPERTY_AUDIO_CODEC = "AudioCodec"; + @org.eclipse.jdt.annotation.NonNull + private String audioCodec; + + public static final String JSON_PROPERTY_VIDEO_CODEC = "VideoCodec"; + @org.eclipse.jdt.annotation.NonNull + private String videoCodec; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private DlnaProfileType type; + + public DirectPlayProfile() { + } + + public DirectPlayProfile container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Get container + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + public DirectPlayProfile audioCodec(@org.eclipse.jdt.annotation.NonNull String audioCodec) { + this.audioCodec = audioCodec; + return this; + } + + /** + * Get audioCodec + * + * @return audioCodec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAudioCodec() { + return audioCodec; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioCodec(@org.eclipse.jdt.annotation.NonNull String audioCodec) { + this.audioCodec = audioCodec; + } + + public DirectPlayProfile videoCodec(@org.eclipse.jdt.annotation.NonNull String videoCodec) { + this.videoCodec = videoCodec; + return this; + } + + /** + * Get videoCodec + * + * @return videoCodec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVideoCodec() { + return videoCodec; + } + + @JsonProperty(JSON_PROPERTY_VIDEO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVideoCodec(@org.eclipse.jdt.annotation.NonNull String videoCodec) { + this.videoCodec = videoCodec; + } + + public DirectPlayProfile type(@org.eclipse.jdt.annotation.NonNull DlnaProfileType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DlnaProfileType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull DlnaProfileType type) { + this.type = type; + } + + /** + * Return true if this DirectPlayProfile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DirectPlayProfile directPlayProfile = (DirectPlayProfile) o; + return Objects.equals(this.container, directPlayProfile.container) + && Objects.equals(this.audioCodec, directPlayProfile.audioCodec) + && Objects.equals(this.videoCodec, directPlayProfile.videoCodec) + && Objects.equals(this.type, directPlayProfile.type); + } + + @Override + public int hashCode() { + return Objects.hash(container, audioCodec, videoCodec, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DirectPlayProfile {\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" audioCodec: ").append(toIndentedString(audioCodec)).append("\n"); + sb.append(" videoCodec: ").append(toIndentedString(videoCodec)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + // add `AudioCodec` to the URL query string + if (getAudioCodec() != null) { + joiner.add(String.format("%sAudioCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioCodec())))); + } + + // add `VideoCodec` to the URL query string + if (getVideoCodec() != null) { + joiner.add(String.format("%sVideoCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoCodec())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DirectPlayProfile instance; + + public Builder() { + this(new DirectPlayProfile()); + } + + protected Builder(DirectPlayProfile instance) { + this.instance = instance; + } + + public DirectPlayProfile.Builder container(String container) { + this.instance.container = container; + return this; + } + + public DirectPlayProfile.Builder audioCodec(String audioCodec) { + this.instance.audioCodec = audioCodec; + return this; + } + + public DirectPlayProfile.Builder videoCodec(String videoCodec) { + this.instance.videoCodec = videoCodec; + return this; + } + + public DirectPlayProfile.Builder type(DlnaProfileType type) { + this.instance.type = type; + return this; + } + + /** + * returns a built DirectPlayProfile instance. + * + * The builder is not reusable. + */ + public DirectPlayProfile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DirectPlayProfile.Builder builder() { + return new DirectPlayProfile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DirectPlayProfile.Builder toBuilder() { + return new DirectPlayProfile.Builder().container(getContainer()).audioCodec(getAudioCodec()) + .videoCodec(getVideoCodec()).type(getType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DisplayPreferencesDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DisplayPreferencesDto.java new file mode 100644 index 0000000000000..2edf8b7cc393e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DisplayPreferencesDto.java @@ -0,0 +1,738 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines the display preferences for any item that supports them (usually Folders). + */ +@JsonPropertyOrder({ DisplayPreferencesDto.JSON_PROPERTY_ID, DisplayPreferencesDto.JSON_PROPERTY_VIEW_TYPE, + DisplayPreferencesDto.JSON_PROPERTY_SORT_BY, DisplayPreferencesDto.JSON_PROPERTY_INDEX_BY, + DisplayPreferencesDto.JSON_PROPERTY_REMEMBER_INDEXING, DisplayPreferencesDto.JSON_PROPERTY_PRIMARY_IMAGE_HEIGHT, + DisplayPreferencesDto.JSON_PROPERTY_PRIMARY_IMAGE_WIDTH, DisplayPreferencesDto.JSON_PROPERTY_CUSTOM_PREFS, + DisplayPreferencesDto.JSON_PROPERTY_SCROLL_DIRECTION, DisplayPreferencesDto.JSON_PROPERTY_SHOW_BACKDROP, + DisplayPreferencesDto.JSON_PROPERTY_REMEMBER_SORTING, DisplayPreferencesDto.JSON_PROPERTY_SORT_ORDER, + DisplayPreferencesDto.JSON_PROPERTY_SHOW_SIDEBAR, DisplayPreferencesDto.JSON_PROPERTY_CLIENT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DisplayPreferencesDto { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_VIEW_TYPE = "ViewType"; + @org.eclipse.jdt.annotation.NonNull + private String viewType; + + public static final String JSON_PROPERTY_SORT_BY = "SortBy"; + @org.eclipse.jdt.annotation.NonNull + private String sortBy; + + public static final String JSON_PROPERTY_INDEX_BY = "IndexBy"; + @org.eclipse.jdt.annotation.NonNull + private String indexBy; + + public static final String JSON_PROPERTY_REMEMBER_INDEXING = "RememberIndexing"; + @org.eclipse.jdt.annotation.NonNull + private Boolean rememberIndexing; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_HEIGHT = "PrimaryImageHeight"; + @org.eclipse.jdt.annotation.NonNull + private Integer primaryImageHeight; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_WIDTH = "PrimaryImageWidth"; + @org.eclipse.jdt.annotation.NonNull + private Integer primaryImageWidth; + + public static final String JSON_PROPERTY_CUSTOM_PREFS = "CustomPrefs"; + @org.eclipse.jdt.annotation.NonNull + private Map customPrefs = new HashMap<>(); + + public static final String JSON_PROPERTY_SCROLL_DIRECTION = "ScrollDirection"; + @org.eclipse.jdt.annotation.NonNull + private ScrollDirection scrollDirection; + + public static final String JSON_PROPERTY_SHOW_BACKDROP = "ShowBackdrop"; + @org.eclipse.jdt.annotation.NonNull + private Boolean showBackdrop; + + public static final String JSON_PROPERTY_REMEMBER_SORTING = "RememberSorting"; + @org.eclipse.jdt.annotation.NonNull + private Boolean rememberSorting; + + public static final String JSON_PROPERTY_SORT_ORDER = "SortOrder"; + @org.eclipse.jdt.annotation.NonNull + private SortOrder sortOrder; + + public static final String JSON_PROPERTY_SHOW_SIDEBAR = "ShowSidebar"; + @org.eclipse.jdt.annotation.NonNull + private Boolean showSidebar; + + public static final String JSON_PROPERTY_CLIENT = "Client"; + @org.eclipse.jdt.annotation.NonNull + private String client; + + public DisplayPreferencesDto() { + } + + public DisplayPreferencesDto id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the user id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public DisplayPreferencesDto viewType(@org.eclipse.jdt.annotation.NonNull String viewType) { + this.viewType = viewType; + return this; + } + + /** + * Gets or sets the type of the view. + * + * @return viewType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIEW_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getViewType() { + return viewType; + } + + @JsonProperty(JSON_PROPERTY_VIEW_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setViewType(@org.eclipse.jdt.annotation.NonNull String viewType) { + this.viewType = viewType; + } + + public DisplayPreferencesDto sortBy(@org.eclipse.jdt.annotation.NonNull String sortBy) { + this.sortBy = sortBy; + return this; + } + + /** + * Gets or sets the sort by. + * + * @return sortBy + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SORT_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSortBy() { + return sortBy; + } + + @JsonProperty(JSON_PROPERTY_SORT_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortBy(@org.eclipse.jdt.annotation.NonNull String sortBy) { + this.sortBy = sortBy; + } + + public DisplayPreferencesDto indexBy(@org.eclipse.jdt.annotation.NonNull String indexBy) { + this.indexBy = indexBy; + return this; + } + + /** + * Gets or sets the index by. + * + * @return indexBy + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIndexBy() { + return indexBy; + } + + @JsonProperty(JSON_PROPERTY_INDEX_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexBy(@org.eclipse.jdt.annotation.NonNull String indexBy) { + this.indexBy = indexBy; + } + + public DisplayPreferencesDto rememberIndexing(@org.eclipse.jdt.annotation.NonNull Boolean rememberIndexing) { + this.rememberIndexing = rememberIndexing; + return this; + } + + /** + * Gets or sets a value indicating whether [remember indexing]. + * + * @return rememberIndexing + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMEMBER_INDEXING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRememberIndexing() { + return rememberIndexing; + } + + @JsonProperty(JSON_PROPERTY_REMEMBER_INDEXING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRememberIndexing(@org.eclipse.jdt.annotation.NonNull Boolean rememberIndexing) { + this.rememberIndexing = rememberIndexing; + } + + public DisplayPreferencesDto primaryImageHeight(@org.eclipse.jdt.annotation.NonNull Integer primaryImageHeight) { + this.primaryImageHeight = primaryImageHeight; + return this; + } + + /** + * Gets or sets the height of the primary image. + * + * @return primaryImageHeight + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrimaryImageHeight() { + return primaryImageHeight; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageHeight(@org.eclipse.jdt.annotation.NonNull Integer primaryImageHeight) { + this.primaryImageHeight = primaryImageHeight; + } + + public DisplayPreferencesDto primaryImageWidth(@org.eclipse.jdt.annotation.NonNull Integer primaryImageWidth) { + this.primaryImageWidth = primaryImageWidth; + return this; + } + + /** + * Gets or sets the width of the primary image. + * + * @return primaryImageWidth + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrimaryImageWidth() { + return primaryImageWidth; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageWidth(@org.eclipse.jdt.annotation.NonNull Integer primaryImageWidth) { + this.primaryImageWidth = primaryImageWidth; + } + + public DisplayPreferencesDto customPrefs(@org.eclipse.jdt.annotation.NonNull Map customPrefs) { + this.customPrefs = customPrefs; + return this; + } + + public DisplayPreferencesDto putCustomPrefsItem(String key, String customPrefsItem) { + if (this.customPrefs == null) { + this.customPrefs = new HashMap<>(); + } + this.customPrefs.put(key, customPrefsItem); + return this; + } + + /** + * Gets or sets the custom prefs. + * + * @return customPrefs + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CUSTOM_PREFS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getCustomPrefs() { + return customPrefs; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_PREFS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomPrefs(@org.eclipse.jdt.annotation.NonNull Map customPrefs) { + this.customPrefs = customPrefs; + } + + public DisplayPreferencesDto scrollDirection(@org.eclipse.jdt.annotation.NonNull ScrollDirection scrollDirection) { + this.scrollDirection = scrollDirection; + return this; + } + + /** + * Gets or sets the scroll direction. + * + * @return scrollDirection + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SCROLL_DIRECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ScrollDirection getScrollDirection() { + return scrollDirection; + } + + @JsonProperty(JSON_PROPERTY_SCROLL_DIRECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScrollDirection(@org.eclipse.jdt.annotation.NonNull ScrollDirection scrollDirection) { + this.scrollDirection = scrollDirection; + } + + public DisplayPreferencesDto showBackdrop(@org.eclipse.jdt.annotation.NonNull Boolean showBackdrop) { + this.showBackdrop = showBackdrop; + return this; + } + + /** + * Gets or sets a value indicating whether to show backdrops on this item. + * + * @return showBackdrop + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SHOW_BACKDROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShowBackdrop() { + return showBackdrop; + } + + @JsonProperty(JSON_PROPERTY_SHOW_BACKDROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowBackdrop(@org.eclipse.jdt.annotation.NonNull Boolean showBackdrop) { + this.showBackdrop = showBackdrop; + } + + public DisplayPreferencesDto rememberSorting(@org.eclipse.jdt.annotation.NonNull Boolean rememberSorting) { + this.rememberSorting = rememberSorting; + return this; + } + + /** + * Gets or sets a value indicating whether [remember sorting]. + * + * @return rememberSorting + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMEMBER_SORTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRememberSorting() { + return rememberSorting; + } + + @JsonProperty(JSON_PROPERTY_REMEMBER_SORTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRememberSorting(@org.eclipse.jdt.annotation.NonNull Boolean rememberSorting) { + this.rememberSorting = rememberSorting; + } + + public DisplayPreferencesDto sortOrder(@org.eclipse.jdt.annotation.NonNull SortOrder sortOrder) { + this.sortOrder = sortOrder; + return this; + } + + /** + * Gets or sets the sort order. + * + * @return sortOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SORT_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SortOrder getSortOrder() { + return sortOrder; + } + + @JsonProperty(JSON_PROPERTY_SORT_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortOrder(@org.eclipse.jdt.annotation.NonNull SortOrder sortOrder) { + this.sortOrder = sortOrder; + } + + public DisplayPreferencesDto showSidebar(@org.eclipse.jdt.annotation.NonNull Boolean showSidebar) { + this.showSidebar = showSidebar; + return this; + } + + /** + * Gets or sets a value indicating whether [show sidebar]. + * + * @return showSidebar + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SHOW_SIDEBAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShowSidebar() { + return showSidebar; + } + + @JsonProperty(JSON_PROPERTY_SHOW_SIDEBAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowSidebar(@org.eclipse.jdt.annotation.NonNull Boolean showSidebar) { + this.showSidebar = showSidebar; + } + + public DisplayPreferencesDto client(@org.eclipse.jdt.annotation.NonNull String client) { + this.client = client; + return this; + } + + /** + * Gets or sets the client. + * + * @return client + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { + return client; + } + + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClient(@org.eclipse.jdt.annotation.NonNull String client) { + this.client = client; + } + + /** + * Return true if this DisplayPreferencesDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DisplayPreferencesDto displayPreferencesDto = (DisplayPreferencesDto) o; + return Objects.equals(this.id, displayPreferencesDto.id) + && Objects.equals(this.viewType, displayPreferencesDto.viewType) + && Objects.equals(this.sortBy, displayPreferencesDto.sortBy) + && Objects.equals(this.indexBy, displayPreferencesDto.indexBy) + && Objects.equals(this.rememberIndexing, displayPreferencesDto.rememberIndexing) + && Objects.equals(this.primaryImageHeight, displayPreferencesDto.primaryImageHeight) + && Objects.equals(this.primaryImageWidth, displayPreferencesDto.primaryImageWidth) + && Objects.equals(this.customPrefs, displayPreferencesDto.customPrefs) + && Objects.equals(this.scrollDirection, displayPreferencesDto.scrollDirection) + && Objects.equals(this.showBackdrop, displayPreferencesDto.showBackdrop) + && Objects.equals(this.rememberSorting, displayPreferencesDto.rememberSorting) + && Objects.equals(this.sortOrder, displayPreferencesDto.sortOrder) + && Objects.equals(this.showSidebar, displayPreferencesDto.showSidebar) + && Objects.equals(this.client, displayPreferencesDto.client); + } + + @Override + public int hashCode() { + return Objects.hash(id, viewType, sortBy, indexBy, rememberIndexing, primaryImageHeight, primaryImageWidth, + customPrefs, scrollDirection, showBackdrop, rememberSorting, sortOrder, showSidebar, client); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DisplayPreferencesDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" viewType: ").append(toIndentedString(viewType)).append("\n"); + sb.append(" sortBy: ").append(toIndentedString(sortBy)).append("\n"); + sb.append(" indexBy: ").append(toIndentedString(indexBy)).append("\n"); + sb.append(" rememberIndexing: ").append(toIndentedString(rememberIndexing)).append("\n"); + sb.append(" primaryImageHeight: ").append(toIndentedString(primaryImageHeight)).append("\n"); + sb.append(" primaryImageWidth: ").append(toIndentedString(primaryImageWidth)).append("\n"); + sb.append(" customPrefs: ").append(toIndentedString(customPrefs)).append("\n"); + sb.append(" scrollDirection: ").append(toIndentedString(scrollDirection)).append("\n"); + sb.append(" showBackdrop: ").append(toIndentedString(showBackdrop)).append("\n"); + sb.append(" rememberSorting: ").append(toIndentedString(rememberSorting)).append("\n"); + sb.append(" sortOrder: ").append(toIndentedString(sortOrder)).append("\n"); + sb.append(" showSidebar: ").append(toIndentedString(showSidebar)).append("\n"); + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `ViewType` to the URL query string + if (getViewType() != null) { + joiner.add(String.format("%sViewType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getViewType())))); + } + + // add `SortBy` to the URL query string + if (getSortBy() != null) { + joiner.add(String.format("%sSortBy%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSortBy())))); + } + + // add `IndexBy` to the URL query string + if (getIndexBy() != null) { + joiner.add(String.format("%sIndexBy%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexBy())))); + } + + // add `RememberIndexing` to the URL query string + if (getRememberIndexing() != null) { + joiner.add(String.format("%sRememberIndexing%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRememberIndexing())))); + } + + // add `PrimaryImageHeight` to the URL query string + if (getPrimaryImageHeight() != null) { + joiner.add(String.format("%sPrimaryImageHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageHeight())))); + } + + // add `PrimaryImageWidth` to the URL query string + if (getPrimaryImageWidth() != null) { + joiner.add(String.format("%sPrimaryImageWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageWidth())))); + } + + // add `CustomPrefs` to the URL query string + if (getCustomPrefs() != null) { + for (String _key : getCustomPrefs().keySet()) { + joiner.add(String.format("%sCustomPrefs%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getCustomPrefs().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getCustomPrefs().get(_key))))); + } + } + + // add `ScrollDirection` to the URL query string + if (getScrollDirection() != null) { + joiner.add(String.format("%sScrollDirection%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getScrollDirection())))); + } + + // add `ShowBackdrop` to the URL query string + if (getShowBackdrop() != null) { + joiner.add(String.format("%sShowBackdrop%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getShowBackdrop())))); + } + + // add `RememberSorting` to the URL query string + if (getRememberSorting() != null) { + joiner.add(String.format("%sRememberSorting%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRememberSorting())))); + } + + // add `SortOrder` to the URL query string + if (getSortOrder() != null) { + joiner.add(String.format("%sSortOrder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSortOrder())))); + } + + // add `ShowSidebar` to the URL query string + if (getShowSidebar() != null) { + joiner.add(String.format("%sShowSidebar%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getShowSidebar())))); + } + + // add `Client` to the URL query string + if (getClient() != null) { + joiner.add(String.format("%sClient%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getClient())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DisplayPreferencesDto instance; + + public Builder() { + this(new DisplayPreferencesDto()); + } + + protected Builder(DisplayPreferencesDto instance) { + this.instance = instance; + } + + public DisplayPreferencesDto.Builder id(String id) { + this.instance.id = id; + return this; + } + + public DisplayPreferencesDto.Builder viewType(String viewType) { + this.instance.viewType = viewType; + return this; + } + + public DisplayPreferencesDto.Builder sortBy(String sortBy) { + this.instance.sortBy = sortBy; + return this; + } + + public DisplayPreferencesDto.Builder indexBy(String indexBy) { + this.instance.indexBy = indexBy; + return this; + } + + public DisplayPreferencesDto.Builder rememberIndexing(Boolean rememberIndexing) { + this.instance.rememberIndexing = rememberIndexing; + return this; + } + + public DisplayPreferencesDto.Builder primaryImageHeight(Integer primaryImageHeight) { + this.instance.primaryImageHeight = primaryImageHeight; + return this; + } + + public DisplayPreferencesDto.Builder primaryImageWidth(Integer primaryImageWidth) { + this.instance.primaryImageWidth = primaryImageWidth; + return this; + } + + public DisplayPreferencesDto.Builder customPrefs(Map customPrefs) { + this.instance.customPrefs = customPrefs; + return this; + } + + public DisplayPreferencesDto.Builder scrollDirection(ScrollDirection scrollDirection) { + this.instance.scrollDirection = scrollDirection; + return this; + } + + public DisplayPreferencesDto.Builder showBackdrop(Boolean showBackdrop) { + this.instance.showBackdrop = showBackdrop; + return this; + } + + public DisplayPreferencesDto.Builder rememberSorting(Boolean rememberSorting) { + this.instance.rememberSorting = rememberSorting; + return this; + } + + public DisplayPreferencesDto.Builder sortOrder(SortOrder sortOrder) { + this.instance.sortOrder = sortOrder; + return this; + } + + public DisplayPreferencesDto.Builder showSidebar(Boolean showSidebar) { + this.instance.showSidebar = showSidebar; + return this; + } + + public DisplayPreferencesDto.Builder client(String client) { + this.instance.client = client; + return this; + } + + /** + * returns a built DisplayPreferencesDto instance. + * + * The builder is not reusable. + */ + public DisplayPreferencesDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DisplayPreferencesDto.Builder builder() { + return new DisplayPreferencesDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DisplayPreferencesDto.Builder toBuilder() { + return new DisplayPreferencesDto.Builder().id(getId()).viewType(getViewType()).sortBy(getSortBy()) + .indexBy(getIndexBy()).rememberIndexing(getRememberIndexing()) + .primaryImageHeight(getPrimaryImageHeight()).primaryImageWidth(getPrimaryImageWidth()) + .customPrefs(getCustomPrefs()).scrollDirection(getScrollDirection()).showBackdrop(getShowBackdrop()) + .rememberSorting(getRememberSorting()).sortOrder(getSortOrder()).showSidebar(getShowSidebar()) + .client(getClient()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DlnaOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DlnaOptions.java new file mode 100644 index 0000000000000..ebc67897ecf59 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DlnaOptions.java @@ -0,0 +1,620 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The DlnaOptions class contains the user definable parameters for the dlna subsystems. + */ +@JsonPropertyOrder({ DlnaOptions.JSON_PROPERTY_ENABLE_PLAY_TO, DlnaOptions.JSON_PROPERTY_ENABLE_SERVER, + DlnaOptions.JSON_PROPERTY_ENABLE_DEBUG_LOG, DlnaOptions.JSON_PROPERTY_ENABLE_PLAY_TO_TRACING, + DlnaOptions.JSON_PROPERTY_CLIENT_DISCOVERY_INTERVAL_SECONDS, + DlnaOptions.JSON_PROPERTY_ALIVE_MESSAGE_INTERVAL_SECONDS, + DlnaOptions.JSON_PROPERTY_BLAST_ALIVE_MESSAGE_INTERVAL_SECONDS, DlnaOptions.JSON_PROPERTY_DEFAULT_USER_ID, + DlnaOptions.JSON_PROPERTY_AUTO_CREATE_PLAY_TO_PROFILES, DlnaOptions.JSON_PROPERTY_BLAST_ALIVE_MESSAGES, + DlnaOptions.JSON_PROPERTY_SEND_ONLY_MATCHED_HOST }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class DlnaOptions { + public static final String JSON_PROPERTY_ENABLE_PLAY_TO = "EnablePlayTo"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enablePlayTo; + + public static final String JSON_PROPERTY_ENABLE_SERVER = "EnableServer"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableServer; + + public static final String JSON_PROPERTY_ENABLE_DEBUG_LOG = "EnableDebugLog"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableDebugLog; + + public static final String JSON_PROPERTY_ENABLE_PLAY_TO_TRACING = "EnablePlayToTracing"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enablePlayToTracing; + + public static final String JSON_PROPERTY_CLIENT_DISCOVERY_INTERVAL_SECONDS = "ClientDiscoveryIntervalSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer clientDiscoveryIntervalSeconds; + + public static final String JSON_PROPERTY_ALIVE_MESSAGE_INTERVAL_SECONDS = "AliveMessageIntervalSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer aliveMessageIntervalSeconds; + + public static final String JSON_PROPERTY_BLAST_ALIVE_MESSAGE_INTERVAL_SECONDS = "BlastAliveMessageIntervalSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer blastAliveMessageIntervalSeconds; + + public static final String JSON_PROPERTY_DEFAULT_USER_ID = "DefaultUserId"; + @org.eclipse.jdt.annotation.NonNull + private String defaultUserId; + + public static final String JSON_PROPERTY_AUTO_CREATE_PLAY_TO_PROFILES = "AutoCreatePlayToProfiles"; + @org.eclipse.jdt.annotation.NonNull + private Boolean autoCreatePlayToProfiles; + + public static final String JSON_PROPERTY_BLAST_ALIVE_MESSAGES = "BlastAliveMessages"; + @org.eclipse.jdt.annotation.NonNull + private Boolean blastAliveMessages; + + public static final String JSON_PROPERTY_SEND_ONLY_MATCHED_HOST = "SendOnlyMatchedHost"; + @org.eclipse.jdt.annotation.NonNull + private Boolean sendOnlyMatchedHost; + + public DlnaOptions() { + } + + public DlnaOptions enablePlayTo(@org.eclipse.jdt.annotation.NonNull Boolean enablePlayTo) { + this.enablePlayTo = enablePlayTo; + return this; + } + + /** + * Gets or sets a value indicating whether gets or sets a value to indicate the status of the dlna playTo subsystem. + * + * @return enablePlayTo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_PLAY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnablePlayTo() { + return enablePlayTo; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_PLAY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnablePlayTo(@org.eclipse.jdt.annotation.NonNull Boolean enablePlayTo) { + this.enablePlayTo = enablePlayTo; + } + + public DlnaOptions enableServer(@org.eclipse.jdt.annotation.NonNull Boolean enableServer) { + this.enableServer = enableServer; + return this; + } + + /** + * Gets or sets a value indicating whether gets or sets a value to indicate the status of the dlna server subsystem. + * + * @return enableServer + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_SERVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableServer() { + return enableServer; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_SERVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableServer(@org.eclipse.jdt.annotation.NonNull Boolean enableServer) { + this.enableServer = enableServer; + } + + public DlnaOptions enableDebugLog(@org.eclipse.jdt.annotation.NonNull Boolean enableDebugLog) { + this.enableDebugLog = enableDebugLog; + return this; + } + + /** + * Gets or sets a value indicating whether detailed dlna server logs are sent to the console/log. If the setting + * \"Emby.Dlna\": \"Debug\" msut be set in logging.default.json for this property to work. + * + * @return enableDebugLog + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_DEBUG_LOG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableDebugLog() { + return enableDebugLog; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_DEBUG_LOG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableDebugLog(@org.eclipse.jdt.annotation.NonNull Boolean enableDebugLog) { + this.enableDebugLog = enableDebugLog; + } + + public DlnaOptions enablePlayToTracing(@org.eclipse.jdt.annotation.NonNull Boolean enablePlayToTracing) { + this.enablePlayToTracing = enablePlayToTracing; + return this; + } + + /** + * Gets or sets a value indicating whether whether detailed playTo debug logs are sent to the console/log. If the + * setting \"Emby.Dlna.PlayTo\": \"Debug\" msut be set in logging.default.json for this property + * to work. + * + * @return enablePlayToTracing + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_PLAY_TO_TRACING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnablePlayToTracing() { + return enablePlayToTracing; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_PLAY_TO_TRACING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnablePlayToTracing(@org.eclipse.jdt.annotation.NonNull Boolean enablePlayToTracing) { + this.enablePlayToTracing = enablePlayToTracing; + } + + public DlnaOptions clientDiscoveryIntervalSeconds( + @org.eclipse.jdt.annotation.NonNull Integer clientDiscoveryIntervalSeconds) { + this.clientDiscoveryIntervalSeconds = clientDiscoveryIntervalSeconds; + return this; + } + + /** + * Gets or sets the ssdp client discovery interval time (in seconds). This is the time after which the server will + * send a ssdp search request. + * + * @return clientDiscoveryIntervalSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CLIENT_DISCOVERY_INTERVAL_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getClientDiscoveryIntervalSeconds() { + return clientDiscoveryIntervalSeconds; + } + + @JsonProperty(JSON_PROPERTY_CLIENT_DISCOVERY_INTERVAL_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientDiscoveryIntervalSeconds( + @org.eclipse.jdt.annotation.NonNull Integer clientDiscoveryIntervalSeconds) { + this.clientDiscoveryIntervalSeconds = clientDiscoveryIntervalSeconds; + } + + public DlnaOptions aliveMessageIntervalSeconds( + @org.eclipse.jdt.annotation.NonNull Integer aliveMessageIntervalSeconds) { + this.aliveMessageIntervalSeconds = aliveMessageIntervalSeconds; + return this; + } + + /** + * Gets or sets the frequency at which ssdp alive notifications are transmitted. + * + * @return aliveMessageIntervalSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALIVE_MESSAGE_INTERVAL_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAliveMessageIntervalSeconds() { + return aliveMessageIntervalSeconds; + } + + @JsonProperty(JSON_PROPERTY_ALIVE_MESSAGE_INTERVAL_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAliveMessageIntervalSeconds( + @org.eclipse.jdt.annotation.NonNull Integer aliveMessageIntervalSeconds) { + this.aliveMessageIntervalSeconds = aliveMessageIntervalSeconds; + } + + public DlnaOptions blastAliveMessageIntervalSeconds( + @org.eclipse.jdt.annotation.NonNull Integer blastAliveMessageIntervalSeconds) { + this.blastAliveMessageIntervalSeconds = blastAliveMessageIntervalSeconds; + return this; + } + + /** + * Gets or sets the frequency at which ssdp alive notifications are transmitted. MIGRATING - TO BE REMOVED ONCE WEB + * HAS BEEN ALTERED. + * + * @return blastAliveMessageIntervalSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BLAST_ALIVE_MESSAGE_INTERVAL_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBlastAliveMessageIntervalSeconds() { + return blastAliveMessageIntervalSeconds; + } + + @JsonProperty(JSON_PROPERTY_BLAST_ALIVE_MESSAGE_INTERVAL_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlastAliveMessageIntervalSeconds( + @org.eclipse.jdt.annotation.NonNull Integer blastAliveMessageIntervalSeconds) { + this.blastAliveMessageIntervalSeconds = blastAliveMessageIntervalSeconds; + } + + public DlnaOptions defaultUserId(@org.eclipse.jdt.annotation.NonNull String defaultUserId) { + this.defaultUserId = defaultUserId; + return this; + } + + /** + * Gets or sets the default user account that the dlna server uses. + * + * @return defaultUserId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEFAULT_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDefaultUserId() { + return defaultUserId; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultUserId(@org.eclipse.jdt.annotation.NonNull String defaultUserId) { + this.defaultUserId = defaultUserId; + } + + public DlnaOptions autoCreatePlayToProfiles(@org.eclipse.jdt.annotation.NonNull Boolean autoCreatePlayToProfiles) { + this.autoCreatePlayToProfiles = autoCreatePlayToProfiles; + return this; + } + + /** + * Gets or sets a value indicating whether playTo device profiles should be created. + * + * @return autoCreatePlayToProfiles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTO_CREATE_PLAY_TO_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAutoCreatePlayToProfiles() { + return autoCreatePlayToProfiles; + } + + @JsonProperty(JSON_PROPERTY_AUTO_CREATE_PLAY_TO_PROFILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAutoCreatePlayToProfiles(@org.eclipse.jdt.annotation.NonNull Boolean autoCreatePlayToProfiles) { + this.autoCreatePlayToProfiles = autoCreatePlayToProfiles; + } + + public DlnaOptions blastAliveMessages(@org.eclipse.jdt.annotation.NonNull Boolean blastAliveMessages) { + this.blastAliveMessages = blastAliveMessages; + return this; + } + + /** + * Gets or sets a value indicating whether to blast alive messages. + * + * @return blastAliveMessages + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BLAST_ALIVE_MESSAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getBlastAliveMessages() { + return blastAliveMessages; + } + + @JsonProperty(JSON_PROPERTY_BLAST_ALIVE_MESSAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlastAliveMessages(@org.eclipse.jdt.annotation.NonNull Boolean blastAliveMessages) { + this.blastAliveMessages = blastAliveMessages; + } + + public DlnaOptions sendOnlyMatchedHost(@org.eclipse.jdt.annotation.NonNull Boolean sendOnlyMatchedHost) { + this.sendOnlyMatchedHost = sendOnlyMatchedHost; + return this; + } + + /** + * gets or sets a value indicating whether to send only matched host. + * + * @return sendOnlyMatchedHost + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEND_ONLY_MATCHED_HOST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSendOnlyMatchedHost() { + return sendOnlyMatchedHost; + } + + @JsonProperty(JSON_PROPERTY_SEND_ONLY_MATCHED_HOST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSendOnlyMatchedHost(@org.eclipse.jdt.annotation.NonNull Boolean sendOnlyMatchedHost) { + this.sendOnlyMatchedHost = sendOnlyMatchedHost; + } + + /** + * Return true if this DlnaOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DlnaOptions dlnaOptions = (DlnaOptions) o; + return Objects.equals(this.enablePlayTo, dlnaOptions.enablePlayTo) + && Objects.equals(this.enableServer, dlnaOptions.enableServer) + && Objects.equals(this.enableDebugLog, dlnaOptions.enableDebugLog) + && Objects.equals(this.enablePlayToTracing, dlnaOptions.enablePlayToTracing) + && Objects.equals(this.clientDiscoveryIntervalSeconds, dlnaOptions.clientDiscoveryIntervalSeconds) + && Objects.equals(this.aliveMessageIntervalSeconds, dlnaOptions.aliveMessageIntervalSeconds) + && Objects.equals(this.blastAliveMessageIntervalSeconds, dlnaOptions.blastAliveMessageIntervalSeconds) + && Objects.equals(this.defaultUserId, dlnaOptions.defaultUserId) + && Objects.equals(this.autoCreatePlayToProfiles, dlnaOptions.autoCreatePlayToProfiles) + && Objects.equals(this.blastAliveMessages, dlnaOptions.blastAliveMessages) + && Objects.equals(this.sendOnlyMatchedHost, dlnaOptions.sendOnlyMatchedHost); + } + + @Override + public int hashCode() { + return Objects.hash(enablePlayTo, enableServer, enableDebugLog, enablePlayToTracing, + clientDiscoveryIntervalSeconds, aliveMessageIntervalSeconds, blastAliveMessageIntervalSeconds, + defaultUserId, autoCreatePlayToProfiles, blastAliveMessages, sendOnlyMatchedHost); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DlnaOptions {\n"); + sb.append(" enablePlayTo: ").append(toIndentedString(enablePlayTo)).append("\n"); + sb.append(" enableServer: ").append(toIndentedString(enableServer)).append("\n"); + sb.append(" enableDebugLog: ").append(toIndentedString(enableDebugLog)).append("\n"); + sb.append(" enablePlayToTracing: ").append(toIndentedString(enablePlayToTracing)).append("\n"); + sb.append(" clientDiscoveryIntervalSeconds: ").append(toIndentedString(clientDiscoveryIntervalSeconds)) + .append("\n"); + sb.append(" aliveMessageIntervalSeconds: ").append(toIndentedString(aliveMessageIntervalSeconds)) + .append("\n"); + sb.append(" blastAliveMessageIntervalSeconds: ").append(toIndentedString(blastAliveMessageIntervalSeconds)) + .append("\n"); + sb.append(" defaultUserId: ").append(toIndentedString(defaultUserId)).append("\n"); + sb.append(" autoCreatePlayToProfiles: ").append(toIndentedString(autoCreatePlayToProfiles)).append("\n"); + sb.append(" blastAliveMessages: ").append(toIndentedString(blastAliveMessages)).append("\n"); + sb.append(" sendOnlyMatchedHost: ").append(toIndentedString(sendOnlyMatchedHost)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `EnablePlayTo` to the URL query string + if (getEnablePlayTo() != null) { + joiner.add(String.format("%sEnablePlayTo%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnablePlayTo())))); + } + + // add `EnableServer` to the URL query string + if (getEnableServer() != null) { + joiner.add(String.format("%sEnableServer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableServer())))); + } + + // add `EnableDebugLog` to the URL query string + if (getEnableDebugLog() != null) { + joiner.add(String.format("%sEnableDebugLog%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableDebugLog())))); + } + + // add `EnablePlayToTracing` to the URL query string + if (getEnablePlayToTracing() != null) { + joiner.add(String.format("%sEnablePlayToTracing%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnablePlayToTracing())))); + } + + // add `ClientDiscoveryIntervalSeconds` to the URL query string + if (getClientDiscoveryIntervalSeconds() != null) { + joiner.add(String.format("%sClientDiscoveryIntervalSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getClientDiscoveryIntervalSeconds())))); + } + + // add `AliveMessageIntervalSeconds` to the URL query string + if (getAliveMessageIntervalSeconds() != null) { + joiner.add(String.format("%sAliveMessageIntervalSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAliveMessageIntervalSeconds())))); + } + + // add `BlastAliveMessageIntervalSeconds` to the URL query string + if (getBlastAliveMessageIntervalSeconds() != null) { + joiner.add(String.format("%sBlastAliveMessageIntervalSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBlastAliveMessageIntervalSeconds())))); + } + + // add `DefaultUserId` to the URL query string + if (getDefaultUserId() != null) { + joiner.add(String.format("%sDefaultUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDefaultUserId())))); + } + + // add `AutoCreatePlayToProfiles` to the URL query string + if (getAutoCreatePlayToProfiles() != null) { + joiner.add(String.format("%sAutoCreatePlayToProfiles%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAutoCreatePlayToProfiles())))); + } + + // add `BlastAliveMessages` to the URL query string + if (getBlastAliveMessages() != null) { + joiner.add(String.format("%sBlastAliveMessages%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBlastAliveMessages())))); + } + + // add `SendOnlyMatchedHost` to the URL query string + if (getSendOnlyMatchedHost() != null) { + joiner.add(String.format("%sSendOnlyMatchedHost%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSendOnlyMatchedHost())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DlnaOptions instance; + + public Builder() { + this(new DlnaOptions()); + } + + protected Builder(DlnaOptions instance) { + this.instance = instance; + } + + public DlnaOptions.Builder enablePlayTo(Boolean enablePlayTo) { + this.instance.enablePlayTo = enablePlayTo; + return this; + } + + public DlnaOptions.Builder enableServer(Boolean enableServer) { + this.instance.enableServer = enableServer; + return this; + } + + public DlnaOptions.Builder enableDebugLog(Boolean enableDebugLog) { + this.instance.enableDebugLog = enableDebugLog; + return this; + } + + public DlnaOptions.Builder enablePlayToTracing(Boolean enablePlayToTracing) { + this.instance.enablePlayToTracing = enablePlayToTracing; + return this; + } + + public DlnaOptions.Builder clientDiscoveryIntervalSeconds(Integer clientDiscoveryIntervalSeconds) { + this.instance.clientDiscoveryIntervalSeconds = clientDiscoveryIntervalSeconds; + return this; + } + + public DlnaOptions.Builder aliveMessageIntervalSeconds(Integer aliveMessageIntervalSeconds) { + this.instance.aliveMessageIntervalSeconds = aliveMessageIntervalSeconds; + return this; + } + + public DlnaOptions.Builder blastAliveMessageIntervalSeconds(Integer blastAliveMessageIntervalSeconds) { + this.instance.blastAliveMessageIntervalSeconds = blastAliveMessageIntervalSeconds; + return this; + } + + public DlnaOptions.Builder defaultUserId(String defaultUserId) { + this.instance.defaultUserId = defaultUserId; + return this; + } + + public DlnaOptions.Builder autoCreatePlayToProfiles(Boolean autoCreatePlayToProfiles) { + this.instance.autoCreatePlayToProfiles = autoCreatePlayToProfiles; + return this; + } + + public DlnaOptions.Builder blastAliveMessages(Boolean blastAliveMessages) { + this.instance.blastAliveMessages = blastAliveMessages; + return this; + } + + public DlnaOptions.Builder sendOnlyMatchedHost(Boolean sendOnlyMatchedHost) { + this.instance.sendOnlyMatchedHost = sendOnlyMatchedHost; + return this; + } + + /** + * returns a built DlnaOptions instance. + * + * The builder is not reusable. + */ + public DlnaOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DlnaOptions.Builder builder() { + return new DlnaOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DlnaOptions.Builder toBuilder() { + return new DlnaOptions.Builder().enablePlayTo(getEnablePlayTo()).enableServer(getEnableServer()) + .enableDebugLog(getEnableDebugLog()).enablePlayToTracing(getEnablePlayToTracing()) + .clientDiscoveryIntervalSeconds(getClientDiscoveryIntervalSeconds()) + .aliveMessageIntervalSeconds(getAliveMessageIntervalSeconds()) + .blastAliveMessageIntervalSeconds(getBlastAliveMessageIntervalSeconds()) + .defaultUserId(getDefaultUserId()).autoCreatePlayToProfiles(getAutoCreatePlayToProfiles()) + .blastAliveMessages(getBlastAliveMessages()).sendOnlyMatchedHost(getSendOnlyMatchedHost()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DlnaProfileType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DlnaProfileType.java new file mode 100644 index 0000000000000..f249a5a0d2c2d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DlnaProfileType.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets DlnaProfileType + */ +public enum DlnaProfileType { + + AUDIO("Audio"), + + VIDEO("Video"), + + PHOTO("Photo"), + + SUBTITLE("Subtitle"); + + private String value; + + DlnaProfileType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DlnaProfileType fromValue(String value) { + for (DlnaProfileType b : DlnaProfileType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DynamicDayOfWeek.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DynamicDayOfWeek.java new file mode 100644 index 0000000000000..81d0e4e9b487b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/DynamicDayOfWeek.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * An enum that represents a day of the week, weekdays, weekends, or all days. + */ +public enum DynamicDayOfWeek { + + SUNDAY("Sunday"), + + MONDAY("Monday"), + + TUESDAY("Tuesday"), + + WEDNESDAY("Wednesday"), + + THURSDAY("Thursday"), + + FRIDAY("Friday"), + + SATURDAY("Saturday"), + + EVERYDAY("Everyday"), + + WEEKDAY("Weekday"), + + WEEKEND("Weekend"); + + private String value; + + DynamicDayOfWeek(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DynamicDayOfWeek fromValue(String value) { + for (DynamicDayOfWeek b : DynamicDayOfWeek.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/EmbeddedSubtitleOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/EmbeddedSubtitleOptions.java new file mode 100644 index 0000000000000..3b18ee5de7458 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/EmbeddedSubtitleOptions.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * An enum representing the options to disable embedded subs. + */ +public enum EmbeddedSubtitleOptions { + + ALLOW_ALL("AllowAll"), + + ALLOW_TEXT("AllowText"), + + ALLOW_IMAGE("AllowImage"), + + ALLOW_NONE("AllowNone"); + + private String value; + + EmbeddedSubtitleOptions(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EmbeddedSubtitleOptions fromValue(String value) { + for (EmbeddedSubtitleOptions b : EmbeddedSubtitleOptions.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/EncodingContext.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/EncodingContext.java new file mode 100644 index 0000000000000..e659759d8e3e6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/EncodingContext.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EncodingContext + */ +public enum EncodingContext { + + STREAMING("Streaming"), + + STATIC("Static"); + + private String value; + + EncodingContext(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EncodingContext fromValue(String value) { + for (EncodingContext b : EncodingContext.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/EncodingOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/EncodingOptions.java new file mode 100644 index 0000000000000..8eb24be1fce13 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/EncodingOptions.java @@ -0,0 +1,1781 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * EncodingOptions + */ +@JsonPropertyOrder({ EncodingOptions.JSON_PROPERTY_ENCODING_THREAD_COUNT, + EncodingOptions.JSON_PROPERTY_TRANSCODING_TEMP_PATH, EncodingOptions.JSON_PROPERTY_FALLBACK_FONT_PATH, + EncodingOptions.JSON_PROPERTY_ENABLE_FALLBACK_FONT, EncodingOptions.JSON_PROPERTY_DOWN_MIX_AUDIO_BOOST, + EncodingOptions.JSON_PROPERTY_MAX_MUXING_QUEUE_SIZE, EncodingOptions.JSON_PROPERTY_ENABLE_THROTTLING, + EncodingOptions.JSON_PROPERTY_THROTTLE_DELAY_SECONDS, EncodingOptions.JSON_PROPERTY_HARDWARE_ACCELERATION_TYPE, + EncodingOptions.JSON_PROPERTY_ENCODER_APP_PATH, EncodingOptions.JSON_PROPERTY_ENCODER_APP_PATH_DISPLAY, + EncodingOptions.JSON_PROPERTY_VAAPI_DEVICE, EncodingOptions.JSON_PROPERTY_ENABLE_TONEMAPPING, + EncodingOptions.JSON_PROPERTY_ENABLE_VPP_TONEMAPPING, EncodingOptions.JSON_PROPERTY_TONEMAPPING_ALGORITHM, + EncodingOptions.JSON_PROPERTY_TONEMAPPING_MODE, EncodingOptions.JSON_PROPERTY_TONEMAPPING_RANGE, + EncodingOptions.JSON_PROPERTY_TONEMAPPING_DESAT, EncodingOptions.JSON_PROPERTY_TONEMAPPING_PEAK, + EncodingOptions.JSON_PROPERTY_TONEMAPPING_PARAM, EncodingOptions.JSON_PROPERTY_VPP_TONEMAPPING_BRIGHTNESS, + EncodingOptions.JSON_PROPERTY_VPP_TONEMAPPING_CONTRAST, EncodingOptions.JSON_PROPERTY_H264_CRF, + EncodingOptions.JSON_PROPERTY_H265_CRF, EncodingOptions.JSON_PROPERTY_ENCODER_PRESET, + EncodingOptions.JSON_PROPERTY_DEINTERLACE_DOUBLE_RATE, EncodingOptions.JSON_PROPERTY_DEINTERLACE_METHOD, + EncodingOptions.JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_HEVC, + EncodingOptions.JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_VP9, + EncodingOptions.JSON_PROPERTY_ENABLE_ENHANCED_NVDEC_DECODER, + EncodingOptions.JSON_PROPERTY_PREFER_SYSTEM_NATIVE_HW_DECODER, + EncodingOptions.JSON_PROPERTY_ENABLE_INTEL_LOW_POWER_H264_HW_ENCODER, + EncodingOptions.JSON_PROPERTY_ENABLE_INTEL_LOW_POWER_HEVC_HW_ENCODER, + EncodingOptions.JSON_PROPERTY_ENABLE_HARDWARE_ENCODING, EncodingOptions.JSON_PROPERTY_ALLOW_HEVC_ENCODING, + EncodingOptions.JSON_PROPERTY_ENABLE_SUBTITLE_EXTRACTION, + EncodingOptions.JSON_PROPERTY_HARDWARE_DECODING_CODECS, + EncodingOptions.JSON_PROPERTY_ALLOW_ON_DEMAND_METADATA_BASED_KEYFRAME_EXTRACTION_FOR_EXTENSIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class EncodingOptions { + public static final String JSON_PROPERTY_ENCODING_THREAD_COUNT = "EncodingThreadCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer encodingThreadCount; + + public static final String JSON_PROPERTY_TRANSCODING_TEMP_PATH = "TranscodingTempPath"; + @org.eclipse.jdt.annotation.NonNull + private String transcodingTempPath; + + public static final String JSON_PROPERTY_FALLBACK_FONT_PATH = "FallbackFontPath"; + @org.eclipse.jdt.annotation.NonNull + private String fallbackFontPath; + + public static final String JSON_PROPERTY_ENABLE_FALLBACK_FONT = "EnableFallbackFont"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableFallbackFont; + + public static final String JSON_PROPERTY_DOWN_MIX_AUDIO_BOOST = "DownMixAudioBoost"; + @org.eclipse.jdt.annotation.NonNull + private Double downMixAudioBoost; + + public static final String JSON_PROPERTY_MAX_MUXING_QUEUE_SIZE = "MaxMuxingQueueSize"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxMuxingQueueSize; + + public static final String JSON_PROPERTY_ENABLE_THROTTLING = "EnableThrottling"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableThrottling; + + public static final String JSON_PROPERTY_THROTTLE_DELAY_SECONDS = "ThrottleDelaySeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer throttleDelaySeconds; + + public static final String JSON_PROPERTY_HARDWARE_ACCELERATION_TYPE = "HardwareAccelerationType"; + @org.eclipse.jdt.annotation.NonNull + private String hardwareAccelerationType; + + public static final String JSON_PROPERTY_ENCODER_APP_PATH = "EncoderAppPath"; + @org.eclipse.jdt.annotation.NonNull + private String encoderAppPath; + + public static final String JSON_PROPERTY_ENCODER_APP_PATH_DISPLAY = "EncoderAppPathDisplay"; + @org.eclipse.jdt.annotation.NonNull + private String encoderAppPathDisplay; + + public static final String JSON_PROPERTY_VAAPI_DEVICE = "VaapiDevice"; + @org.eclipse.jdt.annotation.NonNull + private String vaapiDevice; + + public static final String JSON_PROPERTY_ENABLE_TONEMAPPING = "EnableTonemapping"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableTonemapping; + + public static final String JSON_PROPERTY_ENABLE_VPP_TONEMAPPING = "EnableVppTonemapping"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableVppTonemapping; + + public static final String JSON_PROPERTY_TONEMAPPING_ALGORITHM = "TonemappingAlgorithm"; + @org.eclipse.jdt.annotation.NonNull + private String tonemappingAlgorithm; + + public static final String JSON_PROPERTY_TONEMAPPING_MODE = "TonemappingMode"; + @org.eclipse.jdt.annotation.NonNull + private String tonemappingMode; + + public static final String JSON_PROPERTY_TONEMAPPING_RANGE = "TonemappingRange"; + @org.eclipse.jdt.annotation.NonNull + private String tonemappingRange; + + public static final String JSON_PROPERTY_TONEMAPPING_DESAT = "TonemappingDesat"; + @org.eclipse.jdt.annotation.NonNull + private Double tonemappingDesat; + + public static final String JSON_PROPERTY_TONEMAPPING_PEAK = "TonemappingPeak"; + @org.eclipse.jdt.annotation.NonNull + private Double tonemappingPeak; + + public static final String JSON_PROPERTY_TONEMAPPING_PARAM = "TonemappingParam"; + @org.eclipse.jdt.annotation.NonNull + private Double tonemappingParam; + + public static final String JSON_PROPERTY_VPP_TONEMAPPING_BRIGHTNESS = "VppTonemappingBrightness"; + @org.eclipse.jdt.annotation.NonNull + private Double vppTonemappingBrightness; + + public static final String JSON_PROPERTY_VPP_TONEMAPPING_CONTRAST = "VppTonemappingContrast"; + @org.eclipse.jdt.annotation.NonNull + private Double vppTonemappingContrast; + + public static final String JSON_PROPERTY_H264_CRF = "H264Crf"; + @org.eclipse.jdt.annotation.NonNull + private Integer h264Crf; + + public static final String JSON_PROPERTY_H265_CRF = "H265Crf"; + @org.eclipse.jdt.annotation.NonNull + private Integer h265Crf; + + public static final String JSON_PROPERTY_ENCODER_PRESET = "EncoderPreset"; + @org.eclipse.jdt.annotation.NonNull + private String encoderPreset; + + public static final String JSON_PROPERTY_DEINTERLACE_DOUBLE_RATE = "DeinterlaceDoubleRate"; + @org.eclipse.jdt.annotation.NonNull + private Boolean deinterlaceDoubleRate; + + public static final String JSON_PROPERTY_DEINTERLACE_METHOD = "DeinterlaceMethod"; + @org.eclipse.jdt.annotation.NonNull + private String deinterlaceMethod; + + public static final String JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_HEVC = "EnableDecodingColorDepth10Hevc"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableDecodingColorDepth10Hevc; + + public static final String JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_VP9 = "EnableDecodingColorDepth10Vp9"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableDecodingColorDepth10Vp9; + + public static final String JSON_PROPERTY_ENABLE_ENHANCED_NVDEC_DECODER = "EnableEnhancedNvdecDecoder"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableEnhancedNvdecDecoder; + + public static final String JSON_PROPERTY_PREFER_SYSTEM_NATIVE_HW_DECODER = "PreferSystemNativeHwDecoder"; + @org.eclipse.jdt.annotation.NonNull + private Boolean preferSystemNativeHwDecoder; + + public static final String JSON_PROPERTY_ENABLE_INTEL_LOW_POWER_H264_HW_ENCODER = "EnableIntelLowPowerH264HwEncoder"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableIntelLowPowerH264HwEncoder; + + public static final String JSON_PROPERTY_ENABLE_INTEL_LOW_POWER_HEVC_HW_ENCODER = "EnableIntelLowPowerHevcHwEncoder"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableIntelLowPowerHevcHwEncoder; + + public static final String JSON_PROPERTY_ENABLE_HARDWARE_ENCODING = "EnableHardwareEncoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableHardwareEncoding; + + public static final String JSON_PROPERTY_ALLOW_HEVC_ENCODING = "AllowHevcEncoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean allowHevcEncoding; + + public static final String JSON_PROPERTY_ENABLE_SUBTITLE_EXTRACTION = "EnableSubtitleExtraction"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableSubtitleExtraction; + + public static final String JSON_PROPERTY_HARDWARE_DECODING_CODECS = "HardwareDecodingCodecs"; + @org.eclipse.jdt.annotation.NonNull + private List hardwareDecodingCodecs; + + public static final String JSON_PROPERTY_ALLOW_ON_DEMAND_METADATA_BASED_KEYFRAME_EXTRACTION_FOR_EXTENSIONS = "AllowOnDemandMetadataBasedKeyframeExtractionForExtensions"; + @org.eclipse.jdt.annotation.NonNull + private List allowOnDemandMetadataBasedKeyframeExtractionForExtensions; + + public EncodingOptions() { + } + + public EncodingOptions encodingThreadCount(@org.eclipse.jdt.annotation.NonNull Integer encodingThreadCount) { + this.encodingThreadCount = encodingThreadCount; + return this; + } + + /** + * Get encodingThreadCount + * + * @return encodingThreadCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENCODING_THREAD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getEncodingThreadCount() { + return encodingThreadCount; + } + + @JsonProperty(JSON_PROPERTY_ENCODING_THREAD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncodingThreadCount(@org.eclipse.jdt.annotation.NonNull Integer encodingThreadCount) { + this.encodingThreadCount = encodingThreadCount; + } + + public EncodingOptions transcodingTempPath(@org.eclipse.jdt.annotation.NonNull String transcodingTempPath) { + this.transcodingTempPath = transcodingTempPath; + return this; + } + + /** + * Get transcodingTempPath + * + * @return transcodingTempPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODING_TEMP_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTranscodingTempPath() { + return transcodingTempPath; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODING_TEMP_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodingTempPath(@org.eclipse.jdt.annotation.NonNull String transcodingTempPath) { + this.transcodingTempPath = transcodingTempPath; + } + + public EncodingOptions fallbackFontPath(@org.eclipse.jdt.annotation.NonNull String fallbackFontPath) { + this.fallbackFontPath = fallbackFontPath; + return this; + } + + /** + * Get fallbackFontPath + * + * @return fallbackFontPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FALLBACK_FONT_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFallbackFontPath() { + return fallbackFontPath; + } + + @JsonProperty(JSON_PROPERTY_FALLBACK_FONT_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFallbackFontPath(@org.eclipse.jdt.annotation.NonNull String fallbackFontPath) { + this.fallbackFontPath = fallbackFontPath; + } + + public EncodingOptions enableFallbackFont(@org.eclipse.jdt.annotation.NonNull Boolean enableFallbackFont) { + this.enableFallbackFont = enableFallbackFont; + return this; + } + + /** + * Get enableFallbackFont + * + * @return enableFallbackFont + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_FALLBACK_FONT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableFallbackFont() { + return enableFallbackFont; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_FALLBACK_FONT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableFallbackFont(@org.eclipse.jdt.annotation.NonNull Boolean enableFallbackFont) { + this.enableFallbackFont = enableFallbackFont; + } + + public EncodingOptions downMixAudioBoost(@org.eclipse.jdt.annotation.NonNull Double downMixAudioBoost) { + this.downMixAudioBoost = downMixAudioBoost; + return this; + } + + /** + * Get downMixAudioBoost + * + * @return downMixAudioBoost + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DOWN_MIX_AUDIO_BOOST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDownMixAudioBoost() { + return downMixAudioBoost; + } + + @JsonProperty(JSON_PROPERTY_DOWN_MIX_AUDIO_BOOST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownMixAudioBoost(@org.eclipse.jdt.annotation.NonNull Double downMixAudioBoost) { + this.downMixAudioBoost = downMixAudioBoost; + } + + public EncodingOptions maxMuxingQueueSize(@org.eclipse.jdt.annotation.NonNull Integer maxMuxingQueueSize) { + this.maxMuxingQueueSize = maxMuxingQueueSize; + return this; + } + + /** + * Get maxMuxingQueueSize + * + * @return maxMuxingQueueSize + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_MUXING_QUEUE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxMuxingQueueSize() { + return maxMuxingQueueSize; + } + + @JsonProperty(JSON_PROPERTY_MAX_MUXING_QUEUE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxMuxingQueueSize(@org.eclipse.jdt.annotation.NonNull Integer maxMuxingQueueSize) { + this.maxMuxingQueueSize = maxMuxingQueueSize; + } + + public EncodingOptions enableThrottling(@org.eclipse.jdt.annotation.NonNull Boolean enableThrottling) { + this.enableThrottling = enableThrottling; + return this; + } + + /** + * Get enableThrottling + * + * @return enableThrottling + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_THROTTLING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableThrottling() { + return enableThrottling; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_THROTTLING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableThrottling(@org.eclipse.jdt.annotation.NonNull Boolean enableThrottling) { + this.enableThrottling = enableThrottling; + } + + public EncodingOptions throttleDelaySeconds(@org.eclipse.jdt.annotation.NonNull Integer throttleDelaySeconds) { + this.throttleDelaySeconds = throttleDelaySeconds; + return this; + } + + /** + * Get throttleDelaySeconds + * + * @return throttleDelaySeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THROTTLE_DELAY_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getThrottleDelaySeconds() { + return throttleDelaySeconds; + } + + @JsonProperty(JSON_PROPERTY_THROTTLE_DELAY_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThrottleDelaySeconds(@org.eclipse.jdt.annotation.NonNull Integer throttleDelaySeconds) { + this.throttleDelaySeconds = throttleDelaySeconds; + } + + public EncodingOptions hardwareAccelerationType( + @org.eclipse.jdt.annotation.NonNull String hardwareAccelerationType) { + this.hardwareAccelerationType = hardwareAccelerationType; + return this; + } + + /** + * Get hardwareAccelerationType + * + * @return hardwareAccelerationType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HARDWARE_ACCELERATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHardwareAccelerationType() { + return hardwareAccelerationType; + } + + @JsonProperty(JSON_PROPERTY_HARDWARE_ACCELERATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHardwareAccelerationType(@org.eclipse.jdt.annotation.NonNull String hardwareAccelerationType) { + this.hardwareAccelerationType = hardwareAccelerationType; + } + + public EncodingOptions encoderAppPath(@org.eclipse.jdt.annotation.NonNull String encoderAppPath) { + this.encoderAppPath = encoderAppPath; + return this; + } + + /** + * Gets or sets the FFmpeg path as set by the user via the UI. + * + * @return encoderAppPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENCODER_APP_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEncoderAppPath() { + return encoderAppPath; + } + + @JsonProperty(JSON_PROPERTY_ENCODER_APP_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncoderAppPath(@org.eclipse.jdt.annotation.NonNull String encoderAppPath) { + this.encoderAppPath = encoderAppPath; + } + + public EncodingOptions encoderAppPathDisplay(@org.eclipse.jdt.annotation.NonNull String encoderAppPathDisplay) { + this.encoderAppPathDisplay = encoderAppPathDisplay; + return this; + } + + /** + * Gets or sets the current FFmpeg path being used by the system and displayed on the transcode page. + * + * @return encoderAppPathDisplay + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENCODER_APP_PATH_DISPLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEncoderAppPathDisplay() { + return encoderAppPathDisplay; + } + + @JsonProperty(JSON_PROPERTY_ENCODER_APP_PATH_DISPLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncoderAppPathDisplay(@org.eclipse.jdt.annotation.NonNull String encoderAppPathDisplay) { + this.encoderAppPathDisplay = encoderAppPathDisplay; + } + + public EncodingOptions vaapiDevice(@org.eclipse.jdt.annotation.NonNull String vaapiDevice) { + this.vaapiDevice = vaapiDevice; + return this; + } + + /** + * Get vaapiDevice + * + * @return vaapiDevice + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VAAPI_DEVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVaapiDevice() { + return vaapiDevice; + } + + @JsonProperty(JSON_PROPERTY_VAAPI_DEVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVaapiDevice(@org.eclipse.jdt.annotation.NonNull String vaapiDevice) { + this.vaapiDevice = vaapiDevice; + } + + public EncodingOptions enableTonemapping(@org.eclipse.jdt.annotation.NonNull Boolean enableTonemapping) { + this.enableTonemapping = enableTonemapping; + return this; + } + + /** + * Get enableTonemapping + * + * @return enableTonemapping + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_TONEMAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableTonemapping() { + return enableTonemapping; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_TONEMAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableTonemapping(@org.eclipse.jdt.annotation.NonNull Boolean enableTonemapping) { + this.enableTonemapping = enableTonemapping; + } + + public EncodingOptions enableVppTonemapping(@org.eclipse.jdt.annotation.NonNull Boolean enableVppTonemapping) { + this.enableVppTonemapping = enableVppTonemapping; + return this; + } + + /** + * Get enableVppTonemapping + * + * @return enableVppTonemapping + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_VPP_TONEMAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableVppTonemapping() { + return enableVppTonemapping; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_VPP_TONEMAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableVppTonemapping(@org.eclipse.jdt.annotation.NonNull Boolean enableVppTonemapping) { + this.enableVppTonemapping = enableVppTonemapping; + } + + public EncodingOptions tonemappingAlgorithm(@org.eclipse.jdt.annotation.NonNull String tonemappingAlgorithm) { + this.tonemappingAlgorithm = tonemappingAlgorithm; + return this; + } + + /** + * Get tonemappingAlgorithm + * + * @return tonemappingAlgorithm + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TONEMAPPING_ALGORITHM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTonemappingAlgorithm() { + return tonemappingAlgorithm; + } + + @JsonProperty(JSON_PROPERTY_TONEMAPPING_ALGORITHM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTonemappingAlgorithm(@org.eclipse.jdt.annotation.NonNull String tonemappingAlgorithm) { + this.tonemappingAlgorithm = tonemappingAlgorithm; + } + + public EncodingOptions tonemappingMode(@org.eclipse.jdt.annotation.NonNull String tonemappingMode) { + this.tonemappingMode = tonemappingMode; + return this; + } + + /** + * Get tonemappingMode + * + * @return tonemappingMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TONEMAPPING_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTonemappingMode() { + return tonemappingMode; + } + + @JsonProperty(JSON_PROPERTY_TONEMAPPING_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTonemappingMode(@org.eclipse.jdt.annotation.NonNull String tonemappingMode) { + this.tonemappingMode = tonemappingMode; + } + + public EncodingOptions tonemappingRange(@org.eclipse.jdt.annotation.NonNull String tonemappingRange) { + this.tonemappingRange = tonemappingRange; + return this; + } + + /** + * Get tonemappingRange + * + * @return tonemappingRange + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TONEMAPPING_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTonemappingRange() { + return tonemappingRange; + } + + @JsonProperty(JSON_PROPERTY_TONEMAPPING_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTonemappingRange(@org.eclipse.jdt.annotation.NonNull String tonemappingRange) { + this.tonemappingRange = tonemappingRange; + } + + public EncodingOptions tonemappingDesat(@org.eclipse.jdt.annotation.NonNull Double tonemappingDesat) { + this.tonemappingDesat = tonemappingDesat; + return this; + } + + /** + * Get tonemappingDesat + * + * @return tonemappingDesat + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TONEMAPPING_DESAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTonemappingDesat() { + return tonemappingDesat; + } + + @JsonProperty(JSON_PROPERTY_TONEMAPPING_DESAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTonemappingDesat(@org.eclipse.jdt.annotation.NonNull Double tonemappingDesat) { + this.tonemappingDesat = tonemappingDesat; + } + + public EncodingOptions tonemappingPeak(@org.eclipse.jdt.annotation.NonNull Double tonemappingPeak) { + this.tonemappingPeak = tonemappingPeak; + return this; + } + + /** + * Get tonemappingPeak + * + * @return tonemappingPeak + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TONEMAPPING_PEAK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTonemappingPeak() { + return tonemappingPeak; + } + + @JsonProperty(JSON_PROPERTY_TONEMAPPING_PEAK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTonemappingPeak(@org.eclipse.jdt.annotation.NonNull Double tonemappingPeak) { + this.tonemappingPeak = tonemappingPeak; + } + + public EncodingOptions tonemappingParam(@org.eclipse.jdt.annotation.NonNull Double tonemappingParam) { + this.tonemappingParam = tonemappingParam; + return this; + } + + /** + * Get tonemappingParam + * + * @return tonemappingParam + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TONEMAPPING_PARAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTonemappingParam() { + return tonemappingParam; + } + + @JsonProperty(JSON_PROPERTY_TONEMAPPING_PARAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTonemappingParam(@org.eclipse.jdt.annotation.NonNull Double tonemappingParam) { + this.tonemappingParam = tonemappingParam; + } + + public EncodingOptions vppTonemappingBrightness( + @org.eclipse.jdt.annotation.NonNull Double vppTonemappingBrightness) { + this.vppTonemappingBrightness = vppTonemappingBrightness; + return this; + } + + /** + * Get vppTonemappingBrightness + * + * @return vppTonemappingBrightness + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VPP_TONEMAPPING_BRIGHTNESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getVppTonemappingBrightness() { + return vppTonemappingBrightness; + } + + @JsonProperty(JSON_PROPERTY_VPP_TONEMAPPING_BRIGHTNESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVppTonemappingBrightness(@org.eclipse.jdt.annotation.NonNull Double vppTonemappingBrightness) { + this.vppTonemappingBrightness = vppTonemappingBrightness; + } + + public EncodingOptions vppTonemappingContrast(@org.eclipse.jdt.annotation.NonNull Double vppTonemappingContrast) { + this.vppTonemappingContrast = vppTonemappingContrast; + return this; + } + + /** + * Get vppTonemappingContrast + * + * @return vppTonemappingContrast + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VPP_TONEMAPPING_CONTRAST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getVppTonemappingContrast() { + return vppTonemappingContrast; + } + + @JsonProperty(JSON_PROPERTY_VPP_TONEMAPPING_CONTRAST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVppTonemappingContrast(@org.eclipse.jdt.annotation.NonNull Double vppTonemappingContrast) { + this.vppTonemappingContrast = vppTonemappingContrast; + } + + public EncodingOptions h264Crf(@org.eclipse.jdt.annotation.NonNull Integer h264Crf) { + this.h264Crf = h264Crf; + return this; + } + + /** + * Get h264Crf + * + * @return h264Crf + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_H264_CRF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getH264Crf() { + return h264Crf; + } + + @JsonProperty(JSON_PROPERTY_H264_CRF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setH264Crf(@org.eclipse.jdt.annotation.NonNull Integer h264Crf) { + this.h264Crf = h264Crf; + } + + public EncodingOptions h265Crf(@org.eclipse.jdt.annotation.NonNull Integer h265Crf) { + this.h265Crf = h265Crf; + return this; + } + + /** + * Get h265Crf + * + * @return h265Crf + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_H265_CRF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getH265Crf() { + return h265Crf; + } + + @JsonProperty(JSON_PROPERTY_H265_CRF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setH265Crf(@org.eclipse.jdt.annotation.NonNull Integer h265Crf) { + this.h265Crf = h265Crf; + } + + public EncodingOptions encoderPreset(@org.eclipse.jdt.annotation.NonNull String encoderPreset) { + this.encoderPreset = encoderPreset; + return this; + } + + /** + * Get encoderPreset + * + * @return encoderPreset + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENCODER_PRESET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEncoderPreset() { + return encoderPreset; + } + + @JsonProperty(JSON_PROPERTY_ENCODER_PRESET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncoderPreset(@org.eclipse.jdt.annotation.NonNull String encoderPreset) { + this.encoderPreset = encoderPreset; + } + + public EncodingOptions deinterlaceDoubleRate(@org.eclipse.jdt.annotation.NonNull Boolean deinterlaceDoubleRate) { + this.deinterlaceDoubleRate = deinterlaceDoubleRate; + return this; + } + + /** + * Get deinterlaceDoubleRate + * + * @return deinterlaceDoubleRate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEINTERLACE_DOUBLE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeinterlaceDoubleRate() { + return deinterlaceDoubleRate; + } + + @JsonProperty(JSON_PROPERTY_DEINTERLACE_DOUBLE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeinterlaceDoubleRate(@org.eclipse.jdt.annotation.NonNull Boolean deinterlaceDoubleRate) { + this.deinterlaceDoubleRate = deinterlaceDoubleRate; + } + + public EncodingOptions deinterlaceMethod(@org.eclipse.jdt.annotation.NonNull String deinterlaceMethod) { + this.deinterlaceMethod = deinterlaceMethod; + return this; + } + + /** + * Get deinterlaceMethod + * + * @return deinterlaceMethod + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEINTERLACE_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeinterlaceMethod() { + return deinterlaceMethod; + } + + @JsonProperty(JSON_PROPERTY_DEINTERLACE_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeinterlaceMethod(@org.eclipse.jdt.annotation.NonNull String deinterlaceMethod) { + this.deinterlaceMethod = deinterlaceMethod; + } + + public EncodingOptions enableDecodingColorDepth10Hevc( + @org.eclipse.jdt.annotation.NonNull Boolean enableDecodingColorDepth10Hevc) { + this.enableDecodingColorDepth10Hevc = enableDecodingColorDepth10Hevc; + return this; + } + + /** + * Get enableDecodingColorDepth10Hevc + * + * @return enableDecodingColorDepth10Hevc + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_HEVC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableDecodingColorDepth10Hevc() { + return enableDecodingColorDepth10Hevc; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_HEVC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableDecodingColorDepth10Hevc( + @org.eclipse.jdt.annotation.NonNull Boolean enableDecodingColorDepth10Hevc) { + this.enableDecodingColorDepth10Hevc = enableDecodingColorDepth10Hevc; + } + + public EncodingOptions enableDecodingColorDepth10Vp9( + @org.eclipse.jdt.annotation.NonNull Boolean enableDecodingColorDepth10Vp9) { + this.enableDecodingColorDepth10Vp9 = enableDecodingColorDepth10Vp9; + return this; + } + + /** + * Get enableDecodingColorDepth10Vp9 + * + * @return enableDecodingColorDepth10Vp9 + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_VP9) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableDecodingColorDepth10Vp9() { + return enableDecodingColorDepth10Vp9; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_DECODING_COLOR_DEPTH10_VP9) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableDecodingColorDepth10Vp9( + @org.eclipse.jdt.annotation.NonNull Boolean enableDecodingColorDepth10Vp9) { + this.enableDecodingColorDepth10Vp9 = enableDecodingColorDepth10Vp9; + } + + public EncodingOptions enableEnhancedNvdecDecoder( + @org.eclipse.jdt.annotation.NonNull Boolean enableEnhancedNvdecDecoder) { + this.enableEnhancedNvdecDecoder = enableEnhancedNvdecDecoder; + return this; + } + + /** + * Get enableEnhancedNvdecDecoder + * + * @return enableEnhancedNvdecDecoder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_ENHANCED_NVDEC_DECODER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableEnhancedNvdecDecoder() { + return enableEnhancedNvdecDecoder; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_ENHANCED_NVDEC_DECODER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableEnhancedNvdecDecoder(@org.eclipse.jdt.annotation.NonNull Boolean enableEnhancedNvdecDecoder) { + this.enableEnhancedNvdecDecoder = enableEnhancedNvdecDecoder; + } + + public EncodingOptions preferSystemNativeHwDecoder( + @org.eclipse.jdt.annotation.NonNull Boolean preferSystemNativeHwDecoder) { + this.preferSystemNativeHwDecoder = preferSystemNativeHwDecoder; + return this; + } + + /** + * Get preferSystemNativeHwDecoder + * + * @return preferSystemNativeHwDecoder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREFER_SYSTEM_NATIVE_HW_DECODER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPreferSystemNativeHwDecoder() { + return preferSystemNativeHwDecoder; + } + + @JsonProperty(JSON_PROPERTY_PREFER_SYSTEM_NATIVE_HW_DECODER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreferSystemNativeHwDecoder( + @org.eclipse.jdt.annotation.NonNull Boolean preferSystemNativeHwDecoder) { + this.preferSystemNativeHwDecoder = preferSystemNativeHwDecoder; + } + + public EncodingOptions enableIntelLowPowerH264HwEncoder( + @org.eclipse.jdt.annotation.NonNull Boolean enableIntelLowPowerH264HwEncoder) { + this.enableIntelLowPowerH264HwEncoder = enableIntelLowPowerH264HwEncoder; + return this; + } + + /** + * Get enableIntelLowPowerH264HwEncoder + * + * @return enableIntelLowPowerH264HwEncoder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_INTEL_LOW_POWER_H264_HW_ENCODER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableIntelLowPowerH264HwEncoder() { + return enableIntelLowPowerH264HwEncoder; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_INTEL_LOW_POWER_H264_HW_ENCODER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableIntelLowPowerH264HwEncoder( + @org.eclipse.jdt.annotation.NonNull Boolean enableIntelLowPowerH264HwEncoder) { + this.enableIntelLowPowerH264HwEncoder = enableIntelLowPowerH264HwEncoder; + } + + public EncodingOptions enableIntelLowPowerHevcHwEncoder( + @org.eclipse.jdt.annotation.NonNull Boolean enableIntelLowPowerHevcHwEncoder) { + this.enableIntelLowPowerHevcHwEncoder = enableIntelLowPowerHevcHwEncoder; + return this; + } + + /** + * Get enableIntelLowPowerHevcHwEncoder + * + * @return enableIntelLowPowerHevcHwEncoder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_INTEL_LOW_POWER_HEVC_HW_ENCODER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableIntelLowPowerHevcHwEncoder() { + return enableIntelLowPowerHevcHwEncoder; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_INTEL_LOW_POWER_HEVC_HW_ENCODER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableIntelLowPowerHevcHwEncoder( + @org.eclipse.jdt.annotation.NonNull Boolean enableIntelLowPowerHevcHwEncoder) { + this.enableIntelLowPowerHevcHwEncoder = enableIntelLowPowerHevcHwEncoder; + } + + public EncodingOptions enableHardwareEncoding(@org.eclipse.jdt.annotation.NonNull Boolean enableHardwareEncoding) { + this.enableHardwareEncoding = enableHardwareEncoding; + return this; + } + + /** + * Get enableHardwareEncoding + * + * @return enableHardwareEncoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_HARDWARE_ENCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableHardwareEncoding() { + return enableHardwareEncoding; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_HARDWARE_ENCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableHardwareEncoding(@org.eclipse.jdt.annotation.NonNull Boolean enableHardwareEncoding) { + this.enableHardwareEncoding = enableHardwareEncoding; + } + + public EncodingOptions allowHevcEncoding(@org.eclipse.jdt.annotation.NonNull Boolean allowHevcEncoding) { + this.allowHevcEncoding = allowHevcEncoding; + return this; + } + + /** + * Get allowHevcEncoding + * + * @return allowHevcEncoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_HEVC_ENCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowHevcEncoding() { + return allowHevcEncoding; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_HEVC_ENCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowHevcEncoding(@org.eclipse.jdt.annotation.NonNull Boolean allowHevcEncoding) { + this.allowHevcEncoding = allowHevcEncoding; + } + + public EncodingOptions enableSubtitleExtraction( + @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitleExtraction) { + this.enableSubtitleExtraction = enableSubtitleExtraction; + return this; + } + + /** + * Get enableSubtitleExtraction + * + * @return enableSubtitleExtraction + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_SUBTITLE_EXTRACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableSubtitleExtraction() { + return enableSubtitleExtraction; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_SUBTITLE_EXTRACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableSubtitleExtraction(@org.eclipse.jdt.annotation.NonNull Boolean enableSubtitleExtraction) { + this.enableSubtitleExtraction = enableSubtitleExtraction; + } + + public EncodingOptions hardwareDecodingCodecs( + @org.eclipse.jdt.annotation.NonNull List hardwareDecodingCodecs) { + this.hardwareDecodingCodecs = hardwareDecodingCodecs; + return this; + } + + public EncodingOptions addHardwareDecodingCodecsItem(String hardwareDecodingCodecsItem) { + if (this.hardwareDecodingCodecs == null) { + this.hardwareDecodingCodecs = new ArrayList<>(); + } + this.hardwareDecodingCodecs.add(hardwareDecodingCodecsItem); + return this; + } + + /** + * Get hardwareDecodingCodecs + * + * @return hardwareDecodingCodecs + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HARDWARE_DECODING_CODECS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getHardwareDecodingCodecs() { + return hardwareDecodingCodecs; + } + + @JsonProperty(JSON_PROPERTY_HARDWARE_DECODING_CODECS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHardwareDecodingCodecs(@org.eclipse.jdt.annotation.NonNull List hardwareDecodingCodecs) { + this.hardwareDecodingCodecs = hardwareDecodingCodecs; + } + + public EncodingOptions allowOnDemandMetadataBasedKeyframeExtractionForExtensions( + @org.eclipse.jdt.annotation.NonNull List allowOnDemandMetadataBasedKeyframeExtractionForExtensions) { + this.allowOnDemandMetadataBasedKeyframeExtractionForExtensions = allowOnDemandMetadataBasedKeyframeExtractionForExtensions; + return this; + } + + public EncodingOptions addAllowOnDemandMetadataBasedKeyframeExtractionForExtensionsItem( + String allowOnDemandMetadataBasedKeyframeExtractionForExtensionsItem) { + if (this.allowOnDemandMetadataBasedKeyframeExtractionForExtensions == null) { + this.allowOnDemandMetadataBasedKeyframeExtractionForExtensions = new ArrayList<>(); + } + this.allowOnDemandMetadataBasedKeyframeExtractionForExtensions + .add(allowOnDemandMetadataBasedKeyframeExtractionForExtensionsItem); + return this; + } + + /** + * Get allowOnDemandMetadataBasedKeyframeExtractionForExtensions + * + * @return allowOnDemandMetadataBasedKeyframeExtractionForExtensions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_ON_DEMAND_METADATA_BASED_KEYFRAME_EXTRACTION_FOR_EXTENSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAllowOnDemandMetadataBasedKeyframeExtractionForExtensions() { + return allowOnDemandMetadataBasedKeyframeExtractionForExtensions; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_ON_DEMAND_METADATA_BASED_KEYFRAME_EXTRACTION_FOR_EXTENSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowOnDemandMetadataBasedKeyframeExtractionForExtensions( + @org.eclipse.jdt.annotation.NonNull List allowOnDemandMetadataBasedKeyframeExtractionForExtensions) { + this.allowOnDemandMetadataBasedKeyframeExtractionForExtensions = allowOnDemandMetadataBasedKeyframeExtractionForExtensions; + } + + /** + * Return true if this EncodingOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EncodingOptions encodingOptions = (EncodingOptions) o; + return Objects.equals(this.encodingThreadCount, encodingOptions.encodingThreadCount) + && Objects.equals(this.transcodingTempPath, encodingOptions.transcodingTempPath) + && Objects.equals(this.fallbackFontPath, encodingOptions.fallbackFontPath) + && Objects.equals(this.enableFallbackFont, encodingOptions.enableFallbackFont) + && Objects.equals(this.downMixAudioBoost, encodingOptions.downMixAudioBoost) + && Objects.equals(this.maxMuxingQueueSize, encodingOptions.maxMuxingQueueSize) + && Objects.equals(this.enableThrottling, encodingOptions.enableThrottling) + && Objects.equals(this.throttleDelaySeconds, encodingOptions.throttleDelaySeconds) + && Objects.equals(this.hardwareAccelerationType, encodingOptions.hardwareAccelerationType) + && Objects.equals(this.encoderAppPath, encodingOptions.encoderAppPath) + && Objects.equals(this.encoderAppPathDisplay, encodingOptions.encoderAppPathDisplay) + && Objects.equals(this.vaapiDevice, encodingOptions.vaapiDevice) + && Objects.equals(this.enableTonemapping, encodingOptions.enableTonemapping) + && Objects.equals(this.enableVppTonemapping, encodingOptions.enableVppTonemapping) + && Objects.equals(this.tonemappingAlgorithm, encodingOptions.tonemappingAlgorithm) + && Objects.equals(this.tonemappingMode, encodingOptions.tonemappingMode) + && Objects.equals(this.tonemappingRange, encodingOptions.tonemappingRange) + && Objects.equals(this.tonemappingDesat, encodingOptions.tonemappingDesat) + && Objects.equals(this.tonemappingPeak, encodingOptions.tonemappingPeak) + && Objects.equals(this.tonemappingParam, encodingOptions.tonemappingParam) + && Objects.equals(this.vppTonemappingBrightness, encodingOptions.vppTonemappingBrightness) + && Objects.equals(this.vppTonemappingContrast, encodingOptions.vppTonemappingContrast) + && Objects.equals(this.h264Crf, encodingOptions.h264Crf) + && Objects.equals(this.h265Crf, encodingOptions.h265Crf) + && Objects.equals(this.encoderPreset, encodingOptions.encoderPreset) + && Objects.equals(this.deinterlaceDoubleRate, encodingOptions.deinterlaceDoubleRate) + && Objects.equals(this.deinterlaceMethod, encodingOptions.deinterlaceMethod) + && Objects.equals(this.enableDecodingColorDepth10Hevc, encodingOptions.enableDecodingColorDepth10Hevc) + && Objects.equals(this.enableDecodingColorDepth10Vp9, encodingOptions.enableDecodingColorDepth10Vp9) + && Objects.equals(this.enableEnhancedNvdecDecoder, encodingOptions.enableEnhancedNvdecDecoder) + && Objects.equals(this.preferSystemNativeHwDecoder, encodingOptions.preferSystemNativeHwDecoder) + && Objects.equals(this.enableIntelLowPowerH264HwEncoder, + encodingOptions.enableIntelLowPowerH264HwEncoder) + && Objects.equals(this.enableIntelLowPowerHevcHwEncoder, + encodingOptions.enableIntelLowPowerHevcHwEncoder) + && Objects.equals(this.enableHardwareEncoding, encodingOptions.enableHardwareEncoding) + && Objects.equals(this.allowHevcEncoding, encodingOptions.allowHevcEncoding) + && Objects.equals(this.enableSubtitleExtraction, encodingOptions.enableSubtitleExtraction) + && Objects.equals(this.hardwareDecodingCodecs, encodingOptions.hardwareDecodingCodecs) + && Objects.equals(this.allowOnDemandMetadataBasedKeyframeExtractionForExtensions, + encodingOptions.allowOnDemandMetadataBasedKeyframeExtractionForExtensions); + } + + @Override + public int hashCode() { + return Objects.hash(encodingThreadCount, transcodingTempPath, fallbackFontPath, enableFallbackFont, + downMixAudioBoost, maxMuxingQueueSize, enableThrottling, throttleDelaySeconds, hardwareAccelerationType, + encoderAppPath, encoderAppPathDisplay, vaapiDevice, enableTonemapping, enableVppTonemapping, + tonemappingAlgorithm, tonemappingMode, tonemappingRange, tonemappingDesat, tonemappingPeak, + tonemappingParam, vppTonemappingBrightness, vppTonemappingContrast, h264Crf, h265Crf, encoderPreset, + deinterlaceDoubleRate, deinterlaceMethod, enableDecodingColorDepth10Hevc, enableDecodingColorDepth10Vp9, + enableEnhancedNvdecDecoder, preferSystemNativeHwDecoder, enableIntelLowPowerH264HwEncoder, + enableIntelLowPowerHevcHwEncoder, enableHardwareEncoding, allowHevcEncoding, enableSubtitleExtraction, + hardwareDecodingCodecs, allowOnDemandMetadataBasedKeyframeExtractionForExtensions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EncodingOptions {\n"); + sb.append(" encodingThreadCount: ").append(toIndentedString(encodingThreadCount)).append("\n"); + sb.append(" transcodingTempPath: ").append(toIndentedString(transcodingTempPath)).append("\n"); + sb.append(" fallbackFontPath: ").append(toIndentedString(fallbackFontPath)).append("\n"); + sb.append(" enableFallbackFont: ").append(toIndentedString(enableFallbackFont)).append("\n"); + sb.append(" downMixAudioBoost: ").append(toIndentedString(downMixAudioBoost)).append("\n"); + sb.append(" maxMuxingQueueSize: ").append(toIndentedString(maxMuxingQueueSize)).append("\n"); + sb.append(" enableThrottling: ").append(toIndentedString(enableThrottling)).append("\n"); + sb.append(" throttleDelaySeconds: ").append(toIndentedString(throttleDelaySeconds)).append("\n"); + sb.append(" hardwareAccelerationType: ").append(toIndentedString(hardwareAccelerationType)).append("\n"); + sb.append(" encoderAppPath: ").append(toIndentedString(encoderAppPath)).append("\n"); + sb.append(" encoderAppPathDisplay: ").append(toIndentedString(encoderAppPathDisplay)).append("\n"); + sb.append(" vaapiDevice: ").append(toIndentedString(vaapiDevice)).append("\n"); + sb.append(" enableTonemapping: ").append(toIndentedString(enableTonemapping)).append("\n"); + sb.append(" enableVppTonemapping: ").append(toIndentedString(enableVppTonemapping)).append("\n"); + sb.append(" tonemappingAlgorithm: ").append(toIndentedString(tonemappingAlgorithm)).append("\n"); + sb.append(" tonemappingMode: ").append(toIndentedString(tonemappingMode)).append("\n"); + sb.append(" tonemappingRange: ").append(toIndentedString(tonemappingRange)).append("\n"); + sb.append(" tonemappingDesat: ").append(toIndentedString(tonemappingDesat)).append("\n"); + sb.append(" tonemappingPeak: ").append(toIndentedString(tonemappingPeak)).append("\n"); + sb.append(" tonemappingParam: ").append(toIndentedString(tonemappingParam)).append("\n"); + sb.append(" vppTonemappingBrightness: ").append(toIndentedString(vppTonemappingBrightness)).append("\n"); + sb.append(" vppTonemappingContrast: ").append(toIndentedString(vppTonemappingContrast)).append("\n"); + sb.append(" h264Crf: ").append(toIndentedString(h264Crf)).append("\n"); + sb.append(" h265Crf: ").append(toIndentedString(h265Crf)).append("\n"); + sb.append(" encoderPreset: ").append(toIndentedString(encoderPreset)).append("\n"); + sb.append(" deinterlaceDoubleRate: ").append(toIndentedString(deinterlaceDoubleRate)).append("\n"); + sb.append(" deinterlaceMethod: ").append(toIndentedString(deinterlaceMethod)).append("\n"); + sb.append(" enableDecodingColorDepth10Hevc: ").append(toIndentedString(enableDecodingColorDepth10Hevc)) + .append("\n"); + sb.append(" enableDecodingColorDepth10Vp9: ").append(toIndentedString(enableDecodingColorDepth10Vp9)) + .append("\n"); + sb.append(" enableEnhancedNvdecDecoder: ").append(toIndentedString(enableEnhancedNvdecDecoder)).append("\n"); + sb.append(" preferSystemNativeHwDecoder: ").append(toIndentedString(preferSystemNativeHwDecoder)) + .append("\n"); + sb.append(" enableIntelLowPowerH264HwEncoder: ").append(toIndentedString(enableIntelLowPowerH264HwEncoder)) + .append("\n"); + sb.append(" enableIntelLowPowerHevcHwEncoder: ").append(toIndentedString(enableIntelLowPowerHevcHwEncoder)) + .append("\n"); + sb.append(" enableHardwareEncoding: ").append(toIndentedString(enableHardwareEncoding)).append("\n"); + sb.append(" allowHevcEncoding: ").append(toIndentedString(allowHevcEncoding)).append("\n"); + sb.append(" enableSubtitleExtraction: ").append(toIndentedString(enableSubtitleExtraction)).append("\n"); + sb.append(" hardwareDecodingCodecs: ").append(toIndentedString(hardwareDecodingCodecs)).append("\n"); + sb.append(" allowOnDemandMetadataBasedKeyframeExtractionForExtensions: ") + .append(toIndentedString(allowOnDemandMetadataBasedKeyframeExtractionForExtensions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `EncodingThreadCount` to the URL query string + if (getEncodingThreadCount() != null) { + joiner.add(String.format("%sEncodingThreadCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEncodingThreadCount())))); + } + + // add `TranscodingTempPath` to the URL query string + if (getTranscodingTempPath() != null) { + joiner.add(String.format("%sTranscodingTempPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTranscodingTempPath())))); + } + + // add `FallbackFontPath` to the URL query string + if (getFallbackFontPath() != null) { + joiner.add(String.format("%sFallbackFontPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFallbackFontPath())))); + } + + // add `EnableFallbackFont` to the URL query string + if (getEnableFallbackFont() != null) { + joiner.add(String.format("%sEnableFallbackFont%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableFallbackFont())))); + } + + // add `DownMixAudioBoost` to the URL query string + if (getDownMixAudioBoost() != null) { + joiner.add(String.format("%sDownMixAudioBoost%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDownMixAudioBoost())))); + } + + // add `MaxMuxingQueueSize` to the URL query string + if (getMaxMuxingQueueSize() != null) { + joiner.add(String.format("%sMaxMuxingQueueSize%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxMuxingQueueSize())))); + } + + // add `EnableThrottling` to the URL query string + if (getEnableThrottling() != null) { + joiner.add(String.format("%sEnableThrottling%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableThrottling())))); + } + + // add `ThrottleDelaySeconds` to the URL query string + if (getThrottleDelaySeconds() != null) { + joiner.add(String.format("%sThrottleDelaySeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getThrottleDelaySeconds())))); + } + + // add `HardwareAccelerationType` to the URL query string + if (getHardwareAccelerationType() != null) { + joiner.add(String.format("%sHardwareAccelerationType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHardwareAccelerationType())))); + } + + // add `EncoderAppPath` to the URL query string + if (getEncoderAppPath() != null) { + joiner.add(String.format("%sEncoderAppPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEncoderAppPath())))); + } + + // add `EncoderAppPathDisplay` to the URL query string + if (getEncoderAppPathDisplay() != null) { + joiner.add(String.format("%sEncoderAppPathDisplay%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEncoderAppPathDisplay())))); + } + + // add `VaapiDevice` to the URL query string + if (getVaapiDevice() != null) { + joiner.add(String.format("%sVaapiDevice%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVaapiDevice())))); + } + + // add `EnableTonemapping` to the URL query string + if (getEnableTonemapping() != null) { + joiner.add(String.format("%sEnableTonemapping%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableTonemapping())))); + } + + // add `EnableVppTonemapping` to the URL query string + if (getEnableVppTonemapping() != null) { + joiner.add(String.format("%sEnableVppTonemapping%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableVppTonemapping())))); + } + + // add `TonemappingAlgorithm` to the URL query string + if (getTonemappingAlgorithm() != null) { + joiner.add(String.format("%sTonemappingAlgorithm%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTonemappingAlgorithm())))); + } + + // add `TonemappingMode` to the URL query string + if (getTonemappingMode() != null) { + joiner.add(String.format("%sTonemappingMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTonemappingMode())))); + } + + // add `TonemappingRange` to the URL query string + if (getTonemappingRange() != null) { + joiner.add(String.format("%sTonemappingRange%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTonemappingRange())))); + } + + // add `TonemappingDesat` to the URL query string + if (getTonemappingDesat() != null) { + joiner.add(String.format("%sTonemappingDesat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTonemappingDesat())))); + } + + // add `TonemappingPeak` to the URL query string + if (getTonemappingPeak() != null) { + joiner.add(String.format("%sTonemappingPeak%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTonemappingPeak())))); + } + + // add `TonemappingParam` to the URL query string + if (getTonemappingParam() != null) { + joiner.add(String.format("%sTonemappingParam%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTonemappingParam())))); + } + + // add `VppTonemappingBrightness` to the URL query string + if (getVppTonemappingBrightness() != null) { + joiner.add(String.format("%sVppTonemappingBrightness%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVppTonemappingBrightness())))); + } + + // add `VppTonemappingContrast` to the URL query string + if (getVppTonemappingContrast() != null) { + joiner.add(String.format("%sVppTonemappingContrast%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVppTonemappingContrast())))); + } + + // add `H264Crf` to the URL query string + if (getH264Crf() != null) { + joiner.add(String.format("%sH264Crf%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getH264Crf())))); + } + + // add `H265Crf` to the URL query string + if (getH265Crf() != null) { + joiner.add(String.format("%sH265Crf%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getH265Crf())))); + } + + // add `EncoderPreset` to the URL query string + if (getEncoderPreset() != null) { + joiner.add(String.format("%sEncoderPreset%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEncoderPreset())))); + } + + // add `DeinterlaceDoubleRate` to the URL query string + if (getDeinterlaceDoubleRate() != null) { + joiner.add(String.format("%sDeinterlaceDoubleRate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeinterlaceDoubleRate())))); + } + + // add `DeinterlaceMethod` to the URL query string + if (getDeinterlaceMethod() != null) { + joiner.add(String.format("%sDeinterlaceMethod%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeinterlaceMethod())))); + } + + // add `EnableDecodingColorDepth10Hevc` to the URL query string + if (getEnableDecodingColorDepth10Hevc() != null) { + joiner.add(String.format("%sEnableDecodingColorDepth10Hevc%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableDecodingColorDepth10Hevc())))); + } + + // add `EnableDecodingColorDepth10Vp9` to the URL query string + if (getEnableDecodingColorDepth10Vp9() != null) { + joiner.add(String.format("%sEnableDecodingColorDepth10Vp9%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableDecodingColorDepth10Vp9())))); + } + + // add `EnableEnhancedNvdecDecoder` to the URL query string + if (getEnableEnhancedNvdecDecoder() != null) { + joiner.add(String.format("%sEnableEnhancedNvdecDecoder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableEnhancedNvdecDecoder())))); + } + + // add `PreferSystemNativeHwDecoder` to the URL query string + if (getPreferSystemNativeHwDecoder() != null) { + joiner.add(String.format("%sPreferSystemNativeHwDecoder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreferSystemNativeHwDecoder())))); + } + + // add `EnableIntelLowPowerH264HwEncoder` to the URL query string + if (getEnableIntelLowPowerH264HwEncoder() != null) { + joiner.add(String.format("%sEnableIntelLowPowerH264HwEncoder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableIntelLowPowerH264HwEncoder())))); + } + + // add `EnableIntelLowPowerHevcHwEncoder` to the URL query string + if (getEnableIntelLowPowerHevcHwEncoder() != null) { + joiner.add(String.format("%sEnableIntelLowPowerHevcHwEncoder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableIntelLowPowerHevcHwEncoder())))); + } + + // add `EnableHardwareEncoding` to the URL query string + if (getEnableHardwareEncoding() != null) { + joiner.add(String.format("%sEnableHardwareEncoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableHardwareEncoding())))); + } + + // add `AllowHevcEncoding` to the URL query string + if (getAllowHevcEncoding() != null) { + joiner.add(String.format("%sAllowHevcEncoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAllowHevcEncoding())))); + } + + // add `EnableSubtitleExtraction` to the URL query string + if (getEnableSubtitleExtraction() != null) { + joiner.add(String.format("%sEnableSubtitleExtraction%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableSubtitleExtraction())))); + } + + // add `HardwareDecodingCodecs` to the URL query string + if (getHardwareDecodingCodecs() != null) { + for (int i = 0; i < getHardwareDecodingCodecs().size(); i++) { + joiner.add(String.format("%sHardwareDecodingCodecs%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getHardwareDecodingCodecs().get(i))))); + } + } + + // add `AllowOnDemandMetadataBasedKeyframeExtractionForExtensions` to the URL query string + if (getAllowOnDemandMetadataBasedKeyframeExtractionForExtensions() != null) { + for (int i = 0; i < getAllowOnDemandMetadataBasedKeyframeExtractionForExtensions().size(); i++) { + joiner.add(String.format("%sAllowOnDemandMetadataBasedKeyframeExtractionForExtensions%s%s=%s", prefix, + suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString( + getAllowOnDemandMetadataBasedKeyframeExtractionForExtensions().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private EncodingOptions instance; + + public Builder() { + this(new EncodingOptions()); + } + + protected Builder(EncodingOptions instance) { + this.instance = instance; + } + + public EncodingOptions.Builder encodingThreadCount(Integer encodingThreadCount) { + this.instance.encodingThreadCount = encodingThreadCount; + return this; + } + + public EncodingOptions.Builder transcodingTempPath(String transcodingTempPath) { + this.instance.transcodingTempPath = transcodingTempPath; + return this; + } + + public EncodingOptions.Builder fallbackFontPath(String fallbackFontPath) { + this.instance.fallbackFontPath = fallbackFontPath; + return this; + } + + public EncodingOptions.Builder enableFallbackFont(Boolean enableFallbackFont) { + this.instance.enableFallbackFont = enableFallbackFont; + return this; + } + + public EncodingOptions.Builder downMixAudioBoost(Double downMixAudioBoost) { + this.instance.downMixAudioBoost = downMixAudioBoost; + return this; + } + + public EncodingOptions.Builder maxMuxingQueueSize(Integer maxMuxingQueueSize) { + this.instance.maxMuxingQueueSize = maxMuxingQueueSize; + return this; + } + + public EncodingOptions.Builder enableThrottling(Boolean enableThrottling) { + this.instance.enableThrottling = enableThrottling; + return this; + } + + public EncodingOptions.Builder throttleDelaySeconds(Integer throttleDelaySeconds) { + this.instance.throttleDelaySeconds = throttleDelaySeconds; + return this; + } + + public EncodingOptions.Builder hardwareAccelerationType(String hardwareAccelerationType) { + this.instance.hardwareAccelerationType = hardwareAccelerationType; + return this; + } + + public EncodingOptions.Builder encoderAppPath(String encoderAppPath) { + this.instance.encoderAppPath = encoderAppPath; + return this; + } + + public EncodingOptions.Builder encoderAppPathDisplay(String encoderAppPathDisplay) { + this.instance.encoderAppPathDisplay = encoderAppPathDisplay; + return this; + } + + public EncodingOptions.Builder vaapiDevice(String vaapiDevice) { + this.instance.vaapiDevice = vaapiDevice; + return this; + } + + public EncodingOptions.Builder enableTonemapping(Boolean enableTonemapping) { + this.instance.enableTonemapping = enableTonemapping; + return this; + } + + public EncodingOptions.Builder enableVppTonemapping(Boolean enableVppTonemapping) { + this.instance.enableVppTonemapping = enableVppTonemapping; + return this; + } + + public EncodingOptions.Builder tonemappingAlgorithm(String tonemappingAlgorithm) { + this.instance.tonemappingAlgorithm = tonemappingAlgorithm; + return this; + } + + public EncodingOptions.Builder tonemappingMode(String tonemappingMode) { + this.instance.tonemappingMode = tonemappingMode; + return this; + } + + public EncodingOptions.Builder tonemappingRange(String tonemappingRange) { + this.instance.tonemappingRange = tonemappingRange; + return this; + } + + public EncodingOptions.Builder tonemappingDesat(Double tonemappingDesat) { + this.instance.tonemappingDesat = tonemappingDesat; + return this; + } + + public EncodingOptions.Builder tonemappingPeak(Double tonemappingPeak) { + this.instance.tonemappingPeak = tonemappingPeak; + return this; + } + + public EncodingOptions.Builder tonemappingParam(Double tonemappingParam) { + this.instance.tonemappingParam = tonemappingParam; + return this; + } + + public EncodingOptions.Builder vppTonemappingBrightness(Double vppTonemappingBrightness) { + this.instance.vppTonemappingBrightness = vppTonemappingBrightness; + return this; + } + + public EncodingOptions.Builder vppTonemappingContrast(Double vppTonemappingContrast) { + this.instance.vppTonemappingContrast = vppTonemappingContrast; + return this; + } + + public EncodingOptions.Builder h264Crf(Integer h264Crf) { + this.instance.h264Crf = h264Crf; + return this; + } + + public EncodingOptions.Builder h265Crf(Integer h265Crf) { + this.instance.h265Crf = h265Crf; + return this; + } + + public EncodingOptions.Builder encoderPreset(String encoderPreset) { + this.instance.encoderPreset = encoderPreset; + return this; + } + + public EncodingOptions.Builder deinterlaceDoubleRate(Boolean deinterlaceDoubleRate) { + this.instance.deinterlaceDoubleRate = deinterlaceDoubleRate; + return this; + } + + public EncodingOptions.Builder deinterlaceMethod(String deinterlaceMethod) { + this.instance.deinterlaceMethod = deinterlaceMethod; + return this; + } + + public EncodingOptions.Builder enableDecodingColorDepth10Hevc(Boolean enableDecodingColorDepth10Hevc) { + this.instance.enableDecodingColorDepth10Hevc = enableDecodingColorDepth10Hevc; + return this; + } + + public EncodingOptions.Builder enableDecodingColorDepth10Vp9(Boolean enableDecodingColorDepth10Vp9) { + this.instance.enableDecodingColorDepth10Vp9 = enableDecodingColorDepth10Vp9; + return this; + } + + public EncodingOptions.Builder enableEnhancedNvdecDecoder(Boolean enableEnhancedNvdecDecoder) { + this.instance.enableEnhancedNvdecDecoder = enableEnhancedNvdecDecoder; + return this; + } + + public EncodingOptions.Builder preferSystemNativeHwDecoder(Boolean preferSystemNativeHwDecoder) { + this.instance.preferSystemNativeHwDecoder = preferSystemNativeHwDecoder; + return this; + } + + public EncodingOptions.Builder enableIntelLowPowerH264HwEncoder(Boolean enableIntelLowPowerH264HwEncoder) { + this.instance.enableIntelLowPowerH264HwEncoder = enableIntelLowPowerH264HwEncoder; + return this; + } + + public EncodingOptions.Builder enableIntelLowPowerHevcHwEncoder(Boolean enableIntelLowPowerHevcHwEncoder) { + this.instance.enableIntelLowPowerHevcHwEncoder = enableIntelLowPowerHevcHwEncoder; + return this; + } + + public EncodingOptions.Builder enableHardwareEncoding(Boolean enableHardwareEncoding) { + this.instance.enableHardwareEncoding = enableHardwareEncoding; + return this; + } + + public EncodingOptions.Builder allowHevcEncoding(Boolean allowHevcEncoding) { + this.instance.allowHevcEncoding = allowHevcEncoding; + return this; + } + + public EncodingOptions.Builder enableSubtitleExtraction(Boolean enableSubtitleExtraction) { + this.instance.enableSubtitleExtraction = enableSubtitleExtraction; + return this; + } + + public EncodingOptions.Builder hardwareDecodingCodecs(List hardwareDecodingCodecs) { + this.instance.hardwareDecodingCodecs = hardwareDecodingCodecs; + return this; + } + + public EncodingOptions.Builder allowOnDemandMetadataBasedKeyframeExtractionForExtensions( + List allowOnDemandMetadataBasedKeyframeExtractionForExtensions) { + this.instance.allowOnDemandMetadataBasedKeyframeExtractionForExtensions = allowOnDemandMetadataBasedKeyframeExtractionForExtensions; + return this; + } + + /** + * returns a built EncodingOptions instance. + * + * The builder is not reusable. + */ + public EncodingOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static EncodingOptions.Builder builder() { + return new EncodingOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public EncodingOptions.Builder toBuilder() { + return new EncodingOptions.Builder().encodingThreadCount(getEncodingThreadCount()) + .transcodingTempPath(getTranscodingTempPath()).fallbackFontPath(getFallbackFontPath()) + .enableFallbackFont(getEnableFallbackFont()).downMixAudioBoost(getDownMixAudioBoost()) + .maxMuxingQueueSize(getMaxMuxingQueueSize()).enableThrottling(getEnableThrottling()) + .throttleDelaySeconds(getThrottleDelaySeconds()).hardwareAccelerationType(getHardwareAccelerationType()) + .encoderAppPath(getEncoderAppPath()).encoderAppPathDisplay(getEncoderAppPathDisplay()) + .vaapiDevice(getVaapiDevice()).enableTonemapping(getEnableTonemapping()) + .enableVppTonemapping(getEnableVppTonemapping()).tonemappingAlgorithm(getTonemappingAlgorithm()) + .tonemappingMode(getTonemappingMode()).tonemappingRange(getTonemappingRange()) + .tonemappingDesat(getTonemappingDesat()).tonemappingPeak(getTonemappingPeak()) + .tonemappingParam(getTonemappingParam()).vppTonemappingBrightness(getVppTonemappingBrightness()) + .vppTonemappingContrast(getVppTonemappingContrast()).h264Crf(getH264Crf()).h265Crf(getH265Crf()) + .encoderPreset(getEncoderPreset()).deinterlaceDoubleRate(getDeinterlaceDoubleRate()) + .deinterlaceMethod(getDeinterlaceMethod()) + .enableDecodingColorDepth10Hevc(getEnableDecodingColorDepth10Hevc()) + .enableDecodingColorDepth10Vp9(getEnableDecodingColorDepth10Vp9()) + .enableEnhancedNvdecDecoder(getEnableEnhancedNvdecDecoder()) + .preferSystemNativeHwDecoder(getPreferSystemNativeHwDecoder()) + .enableIntelLowPowerH264HwEncoder(getEnableIntelLowPowerH264HwEncoder()) + .enableIntelLowPowerHevcHwEncoder(getEnableIntelLowPowerHevcHwEncoder()) + .enableHardwareEncoding(getEnableHardwareEncoding()).allowHevcEncoding(getAllowHevcEncoding()) + .enableSubtitleExtraction(getEnableSubtitleExtraction()) + .hardwareDecodingCodecs(getHardwareDecodingCodecs()) + .allowOnDemandMetadataBasedKeyframeExtractionForExtensions( + getAllowOnDemandMetadataBasedKeyframeExtractionForExtensions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/EndPointInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/EndPointInfo.java new file mode 100644 index 0000000000000..9b9b6ddc26e02 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/EndPointInfo.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * EndPointInfo + */ +@JsonPropertyOrder({ EndPointInfo.JSON_PROPERTY_IS_LOCAL, EndPointInfo.JSON_PROPERTY_IS_IN_NETWORK }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class EndPointInfo { + public static final String JSON_PROPERTY_IS_LOCAL = "IsLocal"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isLocal; + + public static final String JSON_PROPERTY_IS_IN_NETWORK = "IsInNetwork"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isInNetwork; + + public EndPointInfo() { + } + + public EndPointInfo isLocal(@org.eclipse.jdt.annotation.NonNull Boolean isLocal) { + this.isLocal = isLocal; + return this; + } + + /** + * Get isLocal + * + * @return isLocal + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_LOCAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsLocal() { + return isLocal; + } + + @JsonProperty(JSON_PROPERTY_IS_LOCAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsLocal(@org.eclipse.jdt.annotation.NonNull Boolean isLocal) { + this.isLocal = isLocal; + } + + public EndPointInfo isInNetwork(@org.eclipse.jdt.annotation.NonNull Boolean isInNetwork) { + this.isInNetwork = isInNetwork; + return this; + } + + /** + * Get isInNetwork + * + * @return isInNetwork + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_IN_NETWORK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsInNetwork() { + return isInNetwork; + } + + @JsonProperty(JSON_PROPERTY_IS_IN_NETWORK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsInNetwork(@org.eclipse.jdt.annotation.NonNull Boolean isInNetwork) { + this.isInNetwork = isInNetwork; + } + + /** + * Return true if this EndPointInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EndPointInfo endPointInfo = (EndPointInfo) o; + return Objects.equals(this.isLocal, endPointInfo.isLocal) + && Objects.equals(this.isInNetwork, endPointInfo.isInNetwork); + } + + @Override + public int hashCode() { + return Objects.hash(isLocal, isInNetwork); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EndPointInfo {\n"); + sb.append(" isLocal: ").append(toIndentedString(isLocal)).append("\n"); + sb.append(" isInNetwork: ").append(toIndentedString(isInNetwork)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `IsLocal` to the URL query string + if (getIsLocal() != null) { + joiner.add(String.format("%sIsLocal%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsLocal())))); + } + + // add `IsInNetwork` to the URL query string + if (getIsInNetwork() != null) { + joiner.add(String.format("%sIsInNetwork%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsInNetwork())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private EndPointInfo instance; + + public Builder() { + this(new EndPointInfo()); + } + + protected Builder(EndPointInfo instance) { + this.instance = instance; + } + + public EndPointInfo.Builder isLocal(Boolean isLocal) { + this.instance.isLocal = isLocal; + return this; + } + + public EndPointInfo.Builder isInNetwork(Boolean isInNetwork) { + this.instance.isInNetwork = isInNetwork; + return this; + } + + /** + * returns a built EndPointInfo instance. + * + * The builder is not reusable. + */ + public EndPointInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static EndPointInfo.Builder builder() { + return new EndPointInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public EndPointInfo.Builder toBuilder() { + return new EndPointInfo.Builder().isLocal(getIsLocal()).isInNetwork(getIsInNetwork()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ExternalIdInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ExternalIdInfo.java new file mode 100644 index 0000000000000..7cbb217ec856e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ExternalIdInfo.java @@ -0,0 +1,315 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Represents the external id information for serialization to the client. + */ +@JsonPropertyOrder({ ExternalIdInfo.JSON_PROPERTY_NAME, ExternalIdInfo.JSON_PROPERTY_KEY, + ExternalIdInfo.JSON_PROPERTY_TYPE, ExternalIdInfo.JSON_PROPERTY_URL_FORMAT_STRING }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ExternalIdInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_KEY = "Key"; + @org.eclipse.jdt.annotation.NonNull + private String key; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private ExternalIdMediaType type; + + public static final String JSON_PROPERTY_URL_FORMAT_STRING = "UrlFormatString"; + @org.eclipse.jdt.annotation.NonNull + private String urlFormatString; + + public ExternalIdInfo() { + } + + public ExternalIdInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the display name of the external id provider (IE: IMDB, MusicBrainz, etc). + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ExternalIdInfo key(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + return this; + } + + /** + * Gets or sets the unique key for this id. This key should be unique across all providers. + * + * @return key + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + } + + public ExternalIdInfo type(@org.eclipse.jdt.annotation.NonNull ExternalIdMediaType type) { + this.type = type; + return this; + } + + /** + * Gets or sets the specific media type for this id. This is used to distinguish between the different external id + * types for providers with multiple ids. A null value indicates there is no specific media type associated with the + * external id, or this is the default id for the external provider so there is no need to specify a type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ExternalIdMediaType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull ExternalIdMediaType type) { + this.type = type; + } + + public ExternalIdInfo urlFormatString(@org.eclipse.jdt.annotation.NonNull String urlFormatString) { + this.urlFormatString = urlFormatString; + return this; + } + + /** + * Gets or sets the URL format string. + * + * @return urlFormatString + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_URL_FORMAT_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrlFormatString() { + return urlFormatString; + } + + @JsonProperty(JSON_PROPERTY_URL_FORMAT_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrlFormatString(@org.eclipse.jdt.annotation.NonNull String urlFormatString) { + this.urlFormatString = urlFormatString; + } + + /** + * Return true if this ExternalIdInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExternalIdInfo externalIdInfo = (ExternalIdInfo) o; + return Objects.equals(this.name, externalIdInfo.name) && Objects.equals(this.key, externalIdInfo.key) + && Objects.equals(this.type, externalIdInfo.type) + && Objects.equals(this.urlFormatString, externalIdInfo.urlFormatString); + } + + @Override + public int hashCode() { + return Objects.hash(name, key, type, urlFormatString); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExternalIdInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" urlFormatString: ").append(toIndentedString(urlFormatString)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Key` to the URL query string + if (getKey() != null) { + joiner.add(String.format("%sKey%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getKey())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `UrlFormatString` to the URL query string + if (getUrlFormatString() != null) { + joiner.add(String.format("%sUrlFormatString%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUrlFormatString())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ExternalIdInfo instance; + + public Builder() { + this(new ExternalIdInfo()); + } + + protected Builder(ExternalIdInfo instance) { + this.instance = instance; + } + + public ExternalIdInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ExternalIdInfo.Builder key(String key) { + this.instance.key = key; + return this; + } + + public ExternalIdInfo.Builder type(ExternalIdMediaType type) { + this.instance.type = type; + return this; + } + + public ExternalIdInfo.Builder urlFormatString(String urlFormatString) { + this.instance.urlFormatString = urlFormatString; + return this; + } + + /** + * returns a built ExternalIdInfo instance. + * + * The builder is not reusable. + */ + public ExternalIdInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ExternalIdInfo.Builder builder() { + return new ExternalIdInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ExternalIdInfo.Builder toBuilder() { + return new ExternalIdInfo.Builder().name(getName()).key(getKey()).type(getType()) + .urlFormatString(getUrlFormatString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ExternalIdMediaType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ExternalIdMediaType.java new file mode 100644 index 0000000000000..03c3910e4de59 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ExternalIdMediaType.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The specific media type of an MediaBrowser.Model.Providers.ExternalIdInfo. + */ +public enum ExternalIdMediaType { + + ALBUM("Album"), + + ALBUM_ARTIST("AlbumArtist"), + + ARTIST("Artist"), + + BOX_SET("BoxSet"), + + EPISODE("Episode"), + + MOVIE("Movie"), + + OTHER_ARTIST("OtherArtist"), + + PERSON("Person"), + + RELEASE_GROUP("ReleaseGroup"), + + SEASON("Season"), + + SERIES("Series"), + + TRACK("Track"); + + private String value; + + ExternalIdMediaType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ExternalIdMediaType fromValue(String value) { + for (ExternalIdMediaType b : ExternalIdMediaType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ExternalUrl.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ExternalUrl.java new file mode 100644 index 0000000000000..180b3e851b33a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ExternalUrl.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ExternalUrl + */ +@JsonPropertyOrder({ ExternalUrl.JSON_PROPERTY_NAME, ExternalUrl.JSON_PROPERTY_URL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ExternalUrl { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_URL = "Url"; + @org.eclipse.jdt.annotation.NonNull + private String url; + + public ExternalUrl() { + } + + public ExternalUrl name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ExternalUrl url(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + return this; + } + + /** + * Gets or sets the type of the item. + * + * @return url + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + } + + /** + * Return true if this ExternalUrl object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExternalUrl externalUrl = (ExternalUrl) o; + return Objects.equals(this.name, externalUrl.name) && Objects.equals(this.url, externalUrl.url); + } + + @Override + public int hashCode() { + return Objects.hash(name, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExternalUrl {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format("%sUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ExternalUrl instance; + + public Builder() { + this(new ExternalUrl()); + } + + protected Builder(ExternalUrl instance) { + this.instance = instance; + } + + public ExternalUrl.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ExternalUrl.Builder url(String url) { + this.instance.url = url; + return this; + } + + /** + * returns a built ExternalUrl instance. + * + * The builder is not reusable. + */ + public ExternalUrl build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ExternalUrl.Builder builder() { + return new ExternalUrl.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ExternalUrl.Builder toBuilder() { + return new ExternalUrl.Builder().name(getName()).url(getUrl()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/FFmpegLocation.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/FFmpegLocation.java new file mode 100644 index 0000000000000..74d7928a9d76f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/FFmpegLocation.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum describing the location of the FFmpeg tool. + */ +public enum FFmpegLocation { + + NOT_FOUND("NotFound"), + + SET_BY_ARGUMENT("SetByArgument"), + + CUSTOM("Custom"), + + SYSTEM("System"); + + private String value; + + FFmpegLocation(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FFmpegLocation fromValue(String value) { + for (FFmpegLocation b : FFmpegLocation.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/FileSystemEntryInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/FileSystemEntryInfo.java new file mode 100644 index 0000000000000..f401355f2aeab --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/FileSystemEntryInfo.java @@ -0,0 +1,273 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class FileSystemEntryInfo. + */ +@JsonPropertyOrder({ FileSystemEntryInfo.JSON_PROPERTY_NAME, FileSystemEntryInfo.JSON_PROPERTY_PATH, + FileSystemEntryInfo.JSON_PROPERTY_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class FileSystemEntryInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private FileSystemEntryType type; + + public FileSystemEntryInfo() { + } + + public FileSystemEntryInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public FileSystemEntryInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public FileSystemEntryInfo type(@org.eclipse.jdt.annotation.NonNull FileSystemEntryType type) { + this.type = type; + return this; + } + + /** + * Gets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FileSystemEntryType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull FileSystemEntryType type) { + this.type = type; + } + + /** + * Return true if this FileSystemEntryInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSystemEntryInfo fileSystemEntryInfo = (FileSystemEntryInfo) o; + return Objects.equals(this.name, fileSystemEntryInfo.name) + && Objects.equals(this.path, fileSystemEntryInfo.path) + && Objects.equals(this.type, fileSystemEntryInfo.type); + } + + @Override + public int hashCode() { + return Objects.hash(name, path, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSystemEntryInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private FileSystemEntryInfo instance; + + public Builder() { + this(new FileSystemEntryInfo()); + } + + protected Builder(FileSystemEntryInfo instance) { + this.instance = instance; + } + + public FileSystemEntryInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public FileSystemEntryInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public FileSystemEntryInfo.Builder type(FileSystemEntryType type) { + this.instance.type = type; + return this; + } + + /** + * returns a built FileSystemEntryInfo instance. + * + * The builder is not reusable. + */ + public FileSystemEntryInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FileSystemEntryInfo.Builder builder() { + return new FileSystemEntryInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FileSystemEntryInfo.Builder toBuilder() { + return new FileSystemEntryInfo.Builder().name(getName()).path(getPath()).type(getType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/FileSystemEntryType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/FileSystemEntryType.java new file mode 100644 index 0000000000000..a8714f721ae09 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/FileSystemEntryType.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum FileSystemEntryType. + */ +public enum FileSystemEntryType { + + FILE("File"), + + DIRECTORY("Directory"), + + NETWORK_COMPUTER("NetworkComputer"), + + NETWORK_SHARE("NetworkShare"); + + private String value; + + FileSystemEntryType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FileSystemEntryType fromValue(String value) { + for (FileSystemEntryType b : FileSystemEntryType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/FontFile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/FontFile.java new file mode 100644 index 0000000000000..6381a2e4b6e1b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/FontFile.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class FontFile. + */ +@JsonPropertyOrder({ FontFile.JSON_PROPERTY_NAME, FontFile.JSON_PROPERTY_SIZE, FontFile.JSON_PROPERTY_DATE_CREATED, + FontFile.JSON_PROPERTY_DATE_MODIFIED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class FontFile { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_SIZE = "Size"; + @org.eclipse.jdt.annotation.NonNull + private Long size; + + public static final String JSON_PROPERTY_DATE_CREATED = "DateCreated"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateCreated; + + public static final String JSON_PROPERTY_DATE_MODIFIED = "DateModified"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateModified; + + public FontFile() { + } + + public FontFile name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public FontFile size(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + return this; + } + + /** + * Gets or sets the size. + * + * @return size + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSize() { + return size; + } + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSize(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + } + + public FontFile dateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + return this; + } + + /** + * Gets or sets the date created. + * + * @return dateCreated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateCreated() { + return dateCreated; + } + + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + } + + public FontFile dateModified(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateModified) { + this.dateModified = dateModified; + return this; + } + + /** + * Gets or sets the date modified. + * + * @return dateModified + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateModified() { + return dateModified; + } + + @JsonProperty(JSON_PROPERTY_DATE_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateModified(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateModified) { + this.dateModified = dateModified; + } + + /** + * Return true if this FontFile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FontFile fontFile = (FontFile) o; + return Objects.equals(this.name, fontFile.name) && Objects.equals(this.size, fontFile.size) + && Objects.equals(this.dateCreated, fontFile.dateCreated) + && Objects.equals(this.dateModified, fontFile.dateModified); + } + + @Override + public int hashCode() { + return Objects.hash(name, size, dateCreated, dateModified); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FontFile {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" dateCreated: ").append(toIndentedString(dateCreated)).append("\n"); + sb.append(" dateModified: ").append(toIndentedString(dateModified)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Size` to the URL query string + if (getSize() != null) { + joiner.add(String.format("%sSize%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSize())))); + } + + // add `DateCreated` to the URL query string + if (getDateCreated() != null) { + joiner.add(String.format("%sDateCreated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateCreated())))); + } + + // add `DateModified` to the URL query string + if (getDateModified() != null) { + joiner.add(String.format("%sDateModified%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateModified())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private FontFile instance; + + public Builder() { + this(new FontFile()); + } + + protected Builder(FontFile instance) { + this.instance = instance; + } + + public FontFile.Builder name(String name) { + this.instance.name = name; + return this; + } + + public FontFile.Builder size(Long size) { + this.instance.size = size; + return this; + } + + public FontFile.Builder dateCreated(OffsetDateTime dateCreated) { + this.instance.dateCreated = dateCreated; + return this; + } + + public FontFile.Builder dateModified(OffsetDateTime dateModified) { + this.instance.dateModified = dateModified; + return this; + } + + /** + * returns a built FontFile instance. + * + * The builder is not reusable. + */ + public FontFile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FontFile.Builder builder() { + return new FontFile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FontFile.Builder toBuilder() { + return new FontFile.Builder().name(getName()).size(getSize()).dateCreated(getDateCreated()) + .dateModified(getDateModified()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ForgotPasswordAction.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ForgotPasswordAction.java new file mode 100644 index 0000000000000..967cf9b4bb426 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ForgotPasswordAction.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ForgotPasswordAction + */ +public enum ForgotPasswordAction { + + CONTACT_ADMIN("ContactAdmin"), + + PIN_CODE("PinCode"), + + IN_NETWORK_REQUIRED("InNetworkRequired"); + + private String value; + + ForgotPasswordAction(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ForgotPasswordAction fromValue(String value) { + for (ForgotPasswordAction b : ForgotPasswordAction.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ForgotPasswordDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ForgotPasswordDto.java new file mode 100644 index 0000000000000..7de279800fda6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ForgotPasswordDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Forgot Password request body DTO. + */ +@JsonPropertyOrder({ ForgotPasswordDto.JSON_PROPERTY_ENTERED_USERNAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ForgotPasswordDto { + public static final String JSON_PROPERTY_ENTERED_USERNAME = "EnteredUsername"; + @org.eclipse.jdt.annotation.Nullable + private String enteredUsername; + + public ForgotPasswordDto() { + } + + public ForgotPasswordDto enteredUsername(@org.eclipse.jdt.annotation.Nullable String enteredUsername) { + this.enteredUsername = enteredUsername; + return this; + } + + /** + * Gets or sets the entered username to have its password reset. + * + * @return enteredUsername + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENTERED_USERNAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEnteredUsername() { + return enteredUsername; + } + + @JsonProperty(JSON_PROPERTY_ENTERED_USERNAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnteredUsername(@org.eclipse.jdt.annotation.Nullable String enteredUsername) { + this.enteredUsername = enteredUsername; + } + + /** + * Return true if this ForgotPasswordDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForgotPasswordDto forgotPasswordDto = (ForgotPasswordDto) o; + return Objects.equals(this.enteredUsername, forgotPasswordDto.enteredUsername); + } + + @Override + public int hashCode() { + return Objects.hash(enteredUsername); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForgotPasswordDto {\n"); + sb.append(" enteredUsername: ").append(toIndentedString(enteredUsername)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `EnteredUsername` to the URL query string + if (getEnteredUsername() != null) { + joiner.add(String.format("%sEnteredUsername%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnteredUsername())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ForgotPasswordDto instance; + + public Builder() { + this(new ForgotPasswordDto()); + } + + protected Builder(ForgotPasswordDto instance) { + this.instance = instance; + } + + public ForgotPasswordDto.Builder enteredUsername(String enteredUsername) { + this.instance.enteredUsername = enteredUsername; + return this; + } + + /** + * returns a built ForgotPasswordDto instance. + * + * The builder is not reusable. + */ + public ForgotPasswordDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ForgotPasswordDto.Builder builder() { + return new ForgotPasswordDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ForgotPasswordDto.Builder toBuilder() { + return new ForgotPasswordDto.Builder().enteredUsername(getEnteredUsername()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ForgotPasswordPinDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ForgotPasswordPinDto.java new file mode 100644 index 0000000000000..b1863e05a12d8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ForgotPasswordPinDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Forgot Password Pin enter request body DTO. + */ +@JsonPropertyOrder({ ForgotPasswordPinDto.JSON_PROPERTY_PIN }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ForgotPasswordPinDto { + public static final String JSON_PROPERTY_PIN = "Pin"; + @org.eclipse.jdt.annotation.Nullable + private String pin; + + public ForgotPasswordPinDto() { + } + + public ForgotPasswordPinDto pin(@org.eclipse.jdt.annotation.Nullable String pin) { + this.pin = pin; + return this; + } + + /** + * Gets or sets the entered pin to have the password reset. + * + * @return pin + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPin() { + return pin; + } + + @JsonProperty(JSON_PROPERTY_PIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPin(@org.eclipse.jdt.annotation.Nullable String pin) { + this.pin = pin; + } + + /** + * Return true if this ForgotPasswordPinDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForgotPasswordPinDto forgotPasswordPinDto = (ForgotPasswordPinDto) o; + return Objects.equals(this.pin, forgotPasswordPinDto.pin); + } + + @Override + public int hashCode() { + return Objects.hash(pin); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForgotPasswordPinDto {\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Pin` to the URL query string + if (getPin() != null) { + joiner.add(String.format("%sPin%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPin())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ForgotPasswordPinDto instance; + + public Builder() { + this(new ForgotPasswordPinDto()); + } + + protected Builder(ForgotPasswordPinDto instance) { + this.instance = instance; + } + + public ForgotPasswordPinDto.Builder pin(String pin) { + this.instance.pin = pin; + return this; + } + + /** + * returns a built ForgotPasswordPinDto instance. + * + * The builder is not reusable. + */ + public ForgotPasswordPinDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ForgotPasswordPinDto.Builder builder() { + return new ForgotPasswordPinDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ForgotPasswordPinDto.Builder toBuilder() { + return new ForgotPasswordPinDto.Builder().pin(getPin()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ForgotPasswordResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ForgotPasswordResult.java new file mode 100644 index 0000000000000..1f60ac098a8ce --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ForgotPasswordResult.java @@ -0,0 +1,276 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ForgotPasswordResult + */ +@JsonPropertyOrder({ ForgotPasswordResult.JSON_PROPERTY_ACTION, ForgotPasswordResult.JSON_PROPERTY_PIN_FILE, + ForgotPasswordResult.JSON_PROPERTY_PIN_EXPIRATION_DATE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ForgotPasswordResult { + public static final String JSON_PROPERTY_ACTION = "Action"; + @org.eclipse.jdt.annotation.NonNull + private ForgotPasswordAction action; + + public static final String JSON_PROPERTY_PIN_FILE = "PinFile"; + @org.eclipse.jdt.annotation.NonNull + private String pinFile; + + public static final String JSON_PROPERTY_PIN_EXPIRATION_DATE = "PinExpirationDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime pinExpirationDate; + + public ForgotPasswordResult() { + } + + public ForgotPasswordResult action(@org.eclipse.jdt.annotation.NonNull ForgotPasswordAction action) { + this.action = action; + return this; + } + + /** + * Gets or sets the action. + * + * @return action + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ForgotPasswordAction getAction() { + return action; + } + + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAction(@org.eclipse.jdt.annotation.NonNull ForgotPasswordAction action) { + this.action = action; + } + + public ForgotPasswordResult pinFile(@org.eclipse.jdt.annotation.NonNull String pinFile) { + this.pinFile = pinFile; + return this; + } + + /** + * Gets or sets the pin file. + * + * @return pinFile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PIN_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPinFile() { + return pinFile; + } + + @JsonProperty(JSON_PROPERTY_PIN_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPinFile(@org.eclipse.jdt.annotation.NonNull String pinFile) { + this.pinFile = pinFile; + } + + public ForgotPasswordResult pinExpirationDate( + @org.eclipse.jdt.annotation.NonNull OffsetDateTime pinExpirationDate) { + this.pinExpirationDate = pinExpirationDate; + return this; + } + + /** + * Gets or sets the pin expiration date. + * + * @return pinExpirationDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PIN_EXPIRATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPinExpirationDate() { + return pinExpirationDate; + } + + @JsonProperty(JSON_PROPERTY_PIN_EXPIRATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPinExpirationDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime pinExpirationDate) { + this.pinExpirationDate = pinExpirationDate; + } + + /** + * Return true if this ForgotPasswordResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForgotPasswordResult forgotPasswordResult = (ForgotPasswordResult) o; + return Objects.equals(this.action, forgotPasswordResult.action) + && Objects.equals(this.pinFile, forgotPasswordResult.pinFile) + && Objects.equals(this.pinExpirationDate, forgotPasswordResult.pinExpirationDate); + } + + @Override + public int hashCode() { + return Objects.hash(action, pinFile, pinExpirationDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForgotPasswordResult {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" pinFile: ").append(toIndentedString(pinFile)).append("\n"); + sb.append(" pinExpirationDate: ").append(toIndentedString(pinExpirationDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Action` to the URL query string + if (getAction() != null) { + joiner.add(String.format("%sAction%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAction())))); + } + + // add `PinFile` to the URL query string + if (getPinFile() != null) { + joiner.add(String.format("%sPinFile%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPinFile())))); + } + + // add `PinExpirationDate` to the URL query string + if (getPinExpirationDate() != null) { + joiner.add(String.format("%sPinExpirationDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPinExpirationDate())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ForgotPasswordResult instance; + + public Builder() { + this(new ForgotPasswordResult()); + } + + protected Builder(ForgotPasswordResult instance) { + this.instance = instance; + } + + public ForgotPasswordResult.Builder action(ForgotPasswordAction action) { + this.instance.action = action; + return this; + } + + public ForgotPasswordResult.Builder pinFile(String pinFile) { + this.instance.pinFile = pinFile; + return this; + } + + public ForgotPasswordResult.Builder pinExpirationDate(OffsetDateTime pinExpirationDate) { + this.instance.pinExpirationDate = pinExpirationDate; + return this; + } + + /** + * returns a built ForgotPasswordResult instance. + * + * The builder is not reusable. + */ + public ForgotPasswordResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ForgotPasswordResult.Builder builder() { + return new ForgotPasswordResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ForgotPasswordResult.Builder toBuilder() { + return new ForgotPasswordResult.Builder().action(getAction()).pinFile(getPinFile()) + .pinExpirationDate(getPinExpirationDate()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GeneralCommand.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GeneralCommand.java new file mode 100644 index 0000000000000..2e0f0dad3d172 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GeneralCommand.java @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * GeneralCommand + */ +@JsonPropertyOrder({ GeneralCommand.JSON_PROPERTY_NAME, GeneralCommand.JSON_PROPERTY_CONTROLLING_USER_ID, + GeneralCommand.JSON_PROPERTY_ARGUMENTS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class GeneralCommand { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private GeneralCommandType name; + + public static final String JSON_PROPERTY_CONTROLLING_USER_ID = "ControllingUserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID controllingUserId; + + public static final String JSON_PROPERTY_ARGUMENTS = "Arguments"; + @org.eclipse.jdt.annotation.NonNull + private Map arguments = new HashMap<>(); + + public GeneralCommand() { + } + + public GeneralCommand name(@org.eclipse.jdt.annotation.NonNull GeneralCommandType name) { + this.name = name; + return this; + } + + /** + * This exists simply to identify a set of known commands. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GeneralCommandType getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull GeneralCommandType name) { + this.name = name; + } + + public GeneralCommand controllingUserId(@org.eclipse.jdt.annotation.NonNull UUID controllingUserId) { + this.controllingUserId = controllingUserId; + return this; + } + + /** + * Get controllingUserId + * + * @return controllingUserId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTROLLING_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getControllingUserId() { + return controllingUserId; + } + + @JsonProperty(JSON_PROPERTY_CONTROLLING_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setControllingUserId(@org.eclipse.jdt.annotation.NonNull UUID controllingUserId) { + this.controllingUserId = controllingUserId; + } + + public GeneralCommand arguments(@org.eclipse.jdt.annotation.NonNull Map arguments) { + this.arguments = arguments; + return this; + } + + public GeneralCommand putArgumentsItem(String key, String argumentsItem) { + if (this.arguments == null) { + this.arguments = new HashMap<>(); + } + this.arguments.put(key, argumentsItem); + return this; + } + + /** + * Get arguments + * + * @return arguments + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARGUMENTS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getArguments() { + return arguments; + } + + @JsonProperty(JSON_PROPERTY_ARGUMENTS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setArguments(@org.eclipse.jdt.annotation.NonNull Map arguments) { + this.arguments = arguments; + } + + /** + * Return true if this GeneralCommand object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneralCommand generalCommand = (GeneralCommand) o; + return Objects.equals(this.name, generalCommand.name) + && Objects.equals(this.controllingUserId, generalCommand.controllingUserId) + && Objects.equals(this.arguments, generalCommand.arguments); + } + + @Override + public int hashCode() { + return Objects.hash(name, controllingUserId, arguments); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneralCommand {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" controllingUserId: ").append(toIndentedString(controllingUserId)).append("\n"); + sb.append(" arguments: ").append(toIndentedString(arguments)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `ControllingUserId` to the URL query string + if (getControllingUserId() != null) { + joiner.add(String.format("%sControllingUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getControllingUserId())))); + } + + // add `Arguments` to the URL query string + if (getArguments() != null) { + for (String _key : getArguments().keySet()) { + joiner.add(String.format("%sArguments%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getArguments().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getArguments().get(_key))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private GeneralCommand instance; + + public Builder() { + this(new GeneralCommand()); + } + + protected Builder(GeneralCommand instance) { + this.instance = instance; + } + + public GeneralCommand.Builder name(GeneralCommandType name) { + this.instance.name = name; + return this; + } + + public GeneralCommand.Builder controllingUserId(UUID controllingUserId) { + this.instance.controllingUserId = controllingUserId; + return this; + } + + public GeneralCommand.Builder arguments(Map arguments) { + this.instance.arguments = arguments; + return this; + } + + /** + * returns a built GeneralCommand instance. + * + * The builder is not reusable. + */ + public GeneralCommand build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static GeneralCommand.Builder builder() { + return new GeneralCommand.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public GeneralCommand.Builder toBuilder() { + return new GeneralCommand.Builder().name(getName()).controllingUserId(getControllingUserId()) + .arguments(getArguments()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GeneralCommandType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GeneralCommandType.java new file mode 100644 index 0000000000000..a7498495ed656 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GeneralCommandType.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * This exists simply to identify a set of known commands. + */ +public enum GeneralCommandType { + + MOVE_UP("MoveUp"), + + MOVE_DOWN("MoveDown"), + + MOVE_LEFT("MoveLeft"), + + MOVE_RIGHT("MoveRight"), + + PAGE_UP("PageUp"), + + PAGE_DOWN("PageDown"), + + PREVIOUS_LETTER("PreviousLetter"), + + NEXT_LETTER("NextLetter"), + + TOGGLE_OSD("ToggleOsd"), + + TOGGLE_CONTEXT_MENU("ToggleContextMenu"), + + SELECT("Select"), + + BACK("Back"), + + TAKE_SCREENSHOT("TakeScreenshot"), + + SEND_KEY("SendKey"), + + SEND_STRING("SendString"), + + GO_HOME("GoHome"), + + GO_TO_SETTINGS("GoToSettings"), + + VOLUME_UP("VolumeUp"), + + VOLUME_DOWN("VolumeDown"), + + MUTE("Mute"), + + UNMUTE("Unmute"), + + TOGGLE_MUTE("ToggleMute"), + + SET_VOLUME("SetVolume"), + + SET_AUDIO_STREAM_INDEX("SetAudioStreamIndex"), + + SET_SUBTITLE_STREAM_INDEX("SetSubtitleStreamIndex"), + + TOGGLE_FULLSCREEN("ToggleFullscreen"), + + DISPLAY_CONTENT("DisplayContent"), + + GO_TO_SEARCH("GoToSearch"), + + DISPLAY_MESSAGE("DisplayMessage"), + + SET_REPEAT_MODE("SetRepeatMode"), + + CHANNEL_UP("ChannelUp"), + + CHANNEL_DOWN("ChannelDown"), + + GUIDE("Guide"), + + TOGGLE_STATS("ToggleStats"), + + PLAY_MEDIA_SOURCE("PlayMediaSource"), + + PLAY_TRAILERS("PlayTrailers"), + + SET_SHUFFLE_QUEUE("SetShuffleQueue"), + + PLAY_STATE("PlayState"), + + PLAY_NEXT("PlayNext"), + + TOGGLE_OSD_MENU("ToggleOsdMenu"), + + PLAY("Play"), + + SET_MAX_STREAMING_BITRATE("SetMaxStreamingBitrate"); + + private String value; + + GeneralCommandType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GeneralCommandType fromValue(String value) { + for (GeneralCommandType b : GeneralCommandType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GetProgramsDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GetProgramsDto.java new file mode 100644 index 0000000000000..6fc89b76f31be --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GetProgramsDto.java @@ -0,0 +1,1350 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Get programs dto. + */ +@JsonPropertyOrder({ GetProgramsDto.JSON_PROPERTY_CHANNEL_IDS, GetProgramsDto.JSON_PROPERTY_USER_ID, + GetProgramsDto.JSON_PROPERTY_MIN_START_DATE, GetProgramsDto.JSON_PROPERTY_HAS_AIRED, + GetProgramsDto.JSON_PROPERTY_IS_AIRING, GetProgramsDto.JSON_PROPERTY_MAX_START_DATE, + GetProgramsDto.JSON_PROPERTY_MIN_END_DATE, GetProgramsDto.JSON_PROPERTY_MAX_END_DATE, + GetProgramsDto.JSON_PROPERTY_IS_MOVIE, GetProgramsDto.JSON_PROPERTY_IS_SERIES, + GetProgramsDto.JSON_PROPERTY_IS_NEWS, GetProgramsDto.JSON_PROPERTY_IS_KIDS, + GetProgramsDto.JSON_PROPERTY_IS_SPORTS, GetProgramsDto.JSON_PROPERTY_START_INDEX, + GetProgramsDto.JSON_PROPERTY_LIMIT, GetProgramsDto.JSON_PROPERTY_SORT_BY, + GetProgramsDto.JSON_PROPERTY_SORT_ORDER, GetProgramsDto.JSON_PROPERTY_GENRES, + GetProgramsDto.JSON_PROPERTY_GENRE_IDS, GetProgramsDto.JSON_PROPERTY_ENABLE_IMAGES, + GetProgramsDto.JSON_PROPERTY_ENABLE_TOTAL_RECORD_COUNT, GetProgramsDto.JSON_PROPERTY_IMAGE_TYPE_LIMIT, + GetProgramsDto.JSON_PROPERTY_ENABLE_IMAGE_TYPES, GetProgramsDto.JSON_PROPERTY_ENABLE_USER_DATA, + GetProgramsDto.JSON_PROPERTY_SERIES_TIMER_ID, GetProgramsDto.JSON_PROPERTY_LIBRARY_SERIES_ID, + GetProgramsDto.JSON_PROPERTY_FIELDS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class GetProgramsDto { + public static final String JSON_PROPERTY_CHANNEL_IDS = "ChannelIds"; + @org.eclipse.jdt.annotation.NonNull + private List channelIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_MIN_START_DATE = "MinStartDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime minStartDate; + + public static final String JSON_PROPERTY_HAS_AIRED = "HasAired"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasAired; + + public static final String JSON_PROPERTY_IS_AIRING = "IsAiring"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAiring; + + public static final String JSON_PROPERTY_MAX_START_DATE = "MaxStartDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime maxStartDate; + + public static final String JSON_PROPERTY_MIN_END_DATE = "MinEndDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime minEndDate; + + public static final String JSON_PROPERTY_MAX_END_DATE = "MaxEndDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime maxEndDate; + + public static final String JSON_PROPERTY_IS_MOVIE = "IsMovie"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isMovie; + + public static final String JSON_PROPERTY_IS_SERIES = "IsSeries"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isSeries; + + public static final String JSON_PROPERTY_IS_NEWS = "IsNews"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isNews; + + public static final String JSON_PROPERTY_IS_KIDS = "IsKids"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isKids; + + public static final String JSON_PROPERTY_IS_SPORTS = "IsSports"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isSports; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public static final String JSON_PROPERTY_LIMIT = "Limit"; + @org.eclipse.jdt.annotation.NonNull + private Integer limit; + + public static final String JSON_PROPERTY_SORT_BY = "SortBy"; + @org.eclipse.jdt.annotation.NonNull + private List sortBy = new ArrayList<>(); + + public static final String JSON_PROPERTY_SORT_ORDER = "SortOrder"; + @org.eclipse.jdt.annotation.NonNull + private List sortOrder = new ArrayList<>(); + + public static final String JSON_PROPERTY_GENRES = "Genres"; + @org.eclipse.jdt.annotation.NonNull + private List genres = new ArrayList<>(); + + public static final String JSON_PROPERTY_GENRE_IDS = "GenreIds"; + @org.eclipse.jdt.annotation.NonNull + private List genreIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_ENABLE_IMAGES = "EnableImages"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableImages; + + public static final String JSON_PROPERTY_ENABLE_TOTAL_RECORD_COUNT = "EnableTotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableTotalRecordCount; + + public static final String JSON_PROPERTY_IMAGE_TYPE_LIMIT = "ImageTypeLimit"; + @org.eclipse.jdt.annotation.NonNull + private Integer imageTypeLimit; + + public static final String JSON_PROPERTY_ENABLE_IMAGE_TYPES = "EnableImageTypes"; + @org.eclipse.jdt.annotation.NonNull + private List enableImageTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_ENABLE_USER_DATA = "EnableUserData"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableUserData; + + public static final String JSON_PROPERTY_SERIES_TIMER_ID = "SeriesTimerId"; + @org.eclipse.jdt.annotation.NonNull + private String seriesTimerId; + + public static final String JSON_PROPERTY_LIBRARY_SERIES_ID = "LibrarySeriesId"; + @org.eclipse.jdt.annotation.NonNull + private UUID librarySeriesId; + + public static final String JSON_PROPERTY_FIELDS = "Fields"; + @org.eclipse.jdt.annotation.NonNull + private List fields = new ArrayList<>(); + + public GetProgramsDto() { + } + + public GetProgramsDto channelIds(@org.eclipse.jdt.annotation.NonNull List channelIds) { + this.channelIds = channelIds; + return this; + } + + public GetProgramsDto addChannelIdsItem(UUID channelIdsItem) { + if (this.channelIds == null) { + this.channelIds = new ArrayList<>(); + } + this.channelIds.add(channelIdsItem); + return this; + } + + /** + * Gets or sets the channels to return guide information for. + * + * @return channelIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getChannelIds() { + return channelIds; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelIds(@org.eclipse.jdt.annotation.NonNull List channelIds) { + this.channelIds = channelIds; + } + + public GetProgramsDto userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets optional. Filter by user id. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public GetProgramsDto minStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime minStartDate) { + this.minStartDate = minStartDate; + return this; + } + + /** + * Gets or sets the minimum premiere start date. Optional. + * + * @return minStartDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIN_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getMinStartDate() { + return minStartDate; + } + + @JsonProperty(JSON_PROPERTY_MIN_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime minStartDate) { + this.minStartDate = minStartDate; + } + + public GetProgramsDto hasAired(@org.eclipse.jdt.annotation.NonNull Boolean hasAired) { + this.hasAired = hasAired; + return this; + } + + /** + * Gets or sets filter by programs that have completed airing, or not. Optional. + * + * @return hasAired + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_AIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasAired() { + return hasAired; + } + + @JsonProperty(JSON_PROPERTY_HAS_AIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasAired(@org.eclipse.jdt.annotation.NonNull Boolean hasAired) { + this.hasAired = hasAired; + } + + public GetProgramsDto isAiring(@org.eclipse.jdt.annotation.NonNull Boolean isAiring) { + this.isAiring = isAiring; + return this; + } + + /** + * Gets or sets filter by programs that are currently airing, or not. Optional. + * + * @return isAiring + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AIRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAiring() { + return isAiring; + } + + @JsonProperty(JSON_PROPERTY_IS_AIRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAiring(@org.eclipse.jdt.annotation.NonNull Boolean isAiring) { + this.isAiring = isAiring; + } + + public GetProgramsDto maxStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime maxStartDate) { + this.maxStartDate = maxStartDate; + return this; + } + + /** + * Gets or sets the maximum premiere start date. Optional. + * + * @return maxStartDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getMaxStartDate() { + return maxStartDate; + } + + @JsonProperty(JSON_PROPERTY_MAX_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime maxStartDate) { + this.maxStartDate = maxStartDate; + } + + public GetProgramsDto minEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime minEndDate) { + this.minEndDate = minEndDate; + return this; + } + + /** + * Gets or sets the minimum premiere end date. Optional. + * + * @return minEndDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIN_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getMinEndDate() { + return minEndDate; + } + + @JsonProperty(JSON_PROPERTY_MIN_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime minEndDate) { + this.minEndDate = minEndDate; + } + + public GetProgramsDto maxEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime maxEndDate) { + this.maxEndDate = maxEndDate; + return this; + } + + /** + * Gets or sets the maximum premiere end date. Optional. + * + * @return maxEndDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getMaxEndDate() { + return maxEndDate; + } + + @JsonProperty(JSON_PROPERTY_MAX_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime maxEndDate) { + this.maxEndDate = maxEndDate; + } + + public GetProgramsDto isMovie(@org.eclipse.jdt.annotation.NonNull Boolean isMovie) { + this.isMovie = isMovie; + return this; + } + + /** + * Gets or sets filter for movies. Optional. + * + * @return isMovie + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_MOVIE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsMovie() { + return isMovie; + } + + @JsonProperty(JSON_PROPERTY_IS_MOVIE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMovie(@org.eclipse.jdt.annotation.NonNull Boolean isMovie) { + this.isMovie = isMovie; + } + + public GetProgramsDto isSeries(@org.eclipse.jdt.annotation.NonNull Boolean isSeries) { + this.isSeries = isSeries; + return this; + } + + /** + * Gets or sets filter for series. Optional. + * + * @return isSeries + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_SERIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsSeries() { + return isSeries; + } + + @JsonProperty(JSON_PROPERTY_IS_SERIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsSeries(@org.eclipse.jdt.annotation.NonNull Boolean isSeries) { + this.isSeries = isSeries; + } + + public GetProgramsDto isNews(@org.eclipse.jdt.annotation.NonNull Boolean isNews) { + this.isNews = isNews; + return this; + } + + /** + * Gets or sets filter for news. Optional. + * + * @return isNews + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_NEWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsNews() { + return isNews; + } + + @JsonProperty(JSON_PROPERTY_IS_NEWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsNews(@org.eclipse.jdt.annotation.NonNull Boolean isNews) { + this.isNews = isNews; + } + + public GetProgramsDto isKids(@org.eclipse.jdt.annotation.NonNull Boolean isKids) { + this.isKids = isKids; + return this; + } + + /** + * Gets or sets filter for kids. Optional. + * + * @return isKids + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_KIDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsKids() { + return isKids; + } + + @JsonProperty(JSON_PROPERTY_IS_KIDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsKids(@org.eclipse.jdt.annotation.NonNull Boolean isKids) { + this.isKids = isKids; + } + + public GetProgramsDto isSports(@org.eclipse.jdt.annotation.NonNull Boolean isSports) { + this.isSports = isSports; + return this; + } + + /** + * Gets or sets filter for sports. Optional. + * + * @return isSports + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_SPORTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsSports() { + return isSports; + } + + @JsonProperty(JSON_PROPERTY_IS_SPORTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsSports(@org.eclipse.jdt.annotation.NonNull Boolean isSports) { + this.isSports = isSports; + } + + public GetProgramsDto startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the record index to start at. All items with a lower index will be dropped from the results. + * Optional. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + public GetProgramsDto limit(@org.eclipse.jdt.annotation.NonNull Integer limit) { + this.limit = limit; + return this; + } + + /** + * Gets or sets the maximum number of records to return. Optional. + * + * @return limit + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLimit() { + return limit; + } + + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLimit(@org.eclipse.jdt.annotation.NonNull Integer limit) { + this.limit = limit; + } + + public GetProgramsDto sortBy(@org.eclipse.jdt.annotation.NonNull List sortBy) { + this.sortBy = sortBy; + return this; + } + + public GetProgramsDto addSortByItem(String sortByItem) { + if (this.sortBy == null) { + this.sortBy = new ArrayList<>(); + } + this.sortBy.add(sortByItem); + return this; + } + + /** + * Gets or sets specify one or more sort orders, comma delimited. Options: Name, StartDate. Optional. + * + * @return sortBy + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SORT_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSortBy() { + return sortBy; + } + + @JsonProperty(JSON_PROPERTY_SORT_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortBy(@org.eclipse.jdt.annotation.NonNull List sortBy) { + this.sortBy = sortBy; + } + + public GetProgramsDto sortOrder(@org.eclipse.jdt.annotation.NonNull List sortOrder) { + this.sortOrder = sortOrder; + return this; + } + + public GetProgramsDto addSortOrderItem(SortOrder sortOrderItem) { + if (this.sortOrder == null) { + this.sortOrder = new ArrayList<>(); + } + this.sortOrder.add(sortOrderItem); + return this; + } + + /** + * Gets or sets sort Order - Ascending,Descending. + * + * @return sortOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SORT_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSortOrder() { + return sortOrder; + } + + @JsonProperty(JSON_PROPERTY_SORT_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortOrder(@org.eclipse.jdt.annotation.NonNull List sortOrder) { + this.sortOrder = sortOrder; + } + + public GetProgramsDto genres(@org.eclipse.jdt.annotation.NonNull List genres) { + this.genres = genres; + return this; + } + + public GetProgramsDto addGenresItem(String genresItem) { + if (this.genres == null) { + this.genres = new ArrayList<>(); + } + this.genres.add(genresItem); + return this; + } + + /** + * Gets or sets the genres to return guide information for. + * + * @return genres + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GENRES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGenres() { + return genres; + } + + @JsonProperty(JSON_PROPERTY_GENRES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGenres(@org.eclipse.jdt.annotation.NonNull List genres) { + this.genres = genres; + } + + public GetProgramsDto genreIds(@org.eclipse.jdt.annotation.NonNull List genreIds) { + this.genreIds = genreIds; + return this; + } + + public GetProgramsDto addGenreIdsItem(UUID genreIdsItem) { + if (this.genreIds == null) { + this.genreIds = new ArrayList<>(); + } + this.genreIds.add(genreIdsItem); + return this; + } + + /** + * Gets or sets the genre ids to return guide information for. + * + * @return genreIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GENRE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGenreIds() { + return genreIds; + } + + @JsonProperty(JSON_PROPERTY_GENRE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGenreIds(@org.eclipse.jdt.annotation.NonNull List genreIds) { + this.genreIds = genreIds; + } + + public GetProgramsDto enableImages(@org.eclipse.jdt.annotation.NonNull Boolean enableImages) { + this.enableImages = enableImages; + return this; + } + + /** + * Gets or sets include image information in output. Optional. + * + * @return enableImages + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_IMAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableImages() { + return enableImages; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_IMAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableImages(@org.eclipse.jdt.annotation.NonNull Boolean enableImages) { + this.enableImages = enableImages; + } + + public GetProgramsDto enableTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) { + this.enableTotalRecordCount = enableTotalRecordCount; + return this; + } + + /** + * Gets or sets a value indicating whether retrieve total record count. + * + * @return enableTotalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableTotalRecordCount() { + return enableTotalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Boolean enableTotalRecordCount) { + this.enableTotalRecordCount = enableTotalRecordCount; + } + + public GetProgramsDto imageTypeLimit(@org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit) { + this.imageTypeLimit = imageTypeLimit; + return this; + } + + /** + * Gets or sets the max number of images to return, per image type. Optional. + * + * @return imageTypeLimit + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_TYPE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getImageTypeLimit() { + return imageTypeLimit; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_TYPE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageTypeLimit(@org.eclipse.jdt.annotation.NonNull Integer imageTypeLimit) { + this.imageTypeLimit = imageTypeLimit; + } + + public GetProgramsDto enableImageTypes(@org.eclipse.jdt.annotation.NonNull List enableImageTypes) { + this.enableImageTypes = enableImageTypes; + return this; + } + + public GetProgramsDto addEnableImageTypesItem(ImageType enableImageTypesItem) { + if (this.enableImageTypes == null) { + this.enableImageTypes = new ArrayList<>(); + } + this.enableImageTypes.add(enableImageTypesItem); + return this; + } + + /** + * Gets or sets the image types to include in the output. Optional. + * + * @return enableImageTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_IMAGE_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnableImageTypes() { + return enableImageTypes; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_IMAGE_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableImageTypes(@org.eclipse.jdt.annotation.NonNull List enableImageTypes) { + this.enableImageTypes = enableImageTypes; + } + + public GetProgramsDto enableUserData(@org.eclipse.jdt.annotation.NonNull Boolean enableUserData) { + this.enableUserData = enableUserData; + return this; + } + + /** + * Gets or sets include user data. Optional. + * + * @return enableUserData + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_USER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableUserData() { + return enableUserData; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_USER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableUserData(@org.eclipse.jdt.annotation.NonNull Boolean enableUserData) { + this.enableUserData = enableUserData; + } + + public GetProgramsDto seriesTimerId(@org.eclipse.jdt.annotation.NonNull String seriesTimerId) { + this.seriesTimerId = seriesTimerId; + return this; + } + + /** + * Gets or sets filter by series timer id. Optional. + * + * @return seriesTimerId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesTimerId() { + return seriesTimerId; + } + + @JsonProperty(JSON_PROPERTY_SERIES_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesTimerId(@org.eclipse.jdt.annotation.NonNull String seriesTimerId) { + this.seriesTimerId = seriesTimerId; + } + + public GetProgramsDto librarySeriesId(@org.eclipse.jdt.annotation.NonNull UUID librarySeriesId) { + this.librarySeriesId = librarySeriesId; + return this; + } + + /** + * Gets or sets filter by library series id. Optional. + * + * @return librarySeriesId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIBRARY_SERIES_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getLibrarySeriesId() { + return librarySeriesId; + } + + @JsonProperty(JSON_PROPERTY_LIBRARY_SERIES_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLibrarySeriesId(@org.eclipse.jdt.annotation.NonNull UUID librarySeriesId) { + this.librarySeriesId = librarySeriesId; + } + + public GetProgramsDto fields(@org.eclipse.jdt.annotation.NonNull List fields) { + this.fields = fields; + return this; + } + + public GetProgramsDto addFieldsItem(ItemFields fieldsItem) { + if (this.fields == null) { + this.fields = new ArrayList<>(); + } + this.fields.add(fieldsItem); + return this; + } + + /** + * Gets or sets specify additional fields of information to return in the output. This allows multiple, comma + * delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, + * ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines. Optional. + * + * @return fields + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFields() { + return fields; + } + + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFields(@org.eclipse.jdt.annotation.NonNull List fields) { + this.fields = fields; + } + + /** + * Return true if this GetProgramsDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetProgramsDto getProgramsDto = (GetProgramsDto) o; + return Objects.equals(this.channelIds, getProgramsDto.channelIds) + && Objects.equals(this.userId, getProgramsDto.userId) + && Objects.equals(this.minStartDate, getProgramsDto.minStartDate) + && Objects.equals(this.hasAired, getProgramsDto.hasAired) + && Objects.equals(this.isAiring, getProgramsDto.isAiring) + && Objects.equals(this.maxStartDate, getProgramsDto.maxStartDate) + && Objects.equals(this.minEndDate, getProgramsDto.minEndDate) + && Objects.equals(this.maxEndDate, getProgramsDto.maxEndDate) + && Objects.equals(this.isMovie, getProgramsDto.isMovie) + && Objects.equals(this.isSeries, getProgramsDto.isSeries) + && Objects.equals(this.isNews, getProgramsDto.isNews) + && Objects.equals(this.isKids, getProgramsDto.isKids) + && Objects.equals(this.isSports, getProgramsDto.isSports) + && Objects.equals(this.startIndex, getProgramsDto.startIndex) + && Objects.equals(this.limit, getProgramsDto.limit) + && Objects.equals(this.sortBy, getProgramsDto.sortBy) + && Objects.equals(this.sortOrder, getProgramsDto.sortOrder) + && Objects.equals(this.genres, getProgramsDto.genres) + && Objects.equals(this.genreIds, getProgramsDto.genreIds) + && Objects.equals(this.enableImages, getProgramsDto.enableImages) + && Objects.equals(this.enableTotalRecordCount, getProgramsDto.enableTotalRecordCount) + && Objects.equals(this.imageTypeLimit, getProgramsDto.imageTypeLimit) + && Objects.equals(this.enableImageTypes, getProgramsDto.enableImageTypes) + && Objects.equals(this.enableUserData, getProgramsDto.enableUserData) + && Objects.equals(this.seriesTimerId, getProgramsDto.seriesTimerId) + && Objects.equals(this.librarySeriesId, getProgramsDto.librarySeriesId) + && Objects.equals(this.fields, getProgramsDto.fields); + } + + @Override + public int hashCode() { + return Objects.hash(channelIds, userId, minStartDate, hasAired, isAiring, maxStartDate, minEndDate, maxEndDate, + isMovie, isSeries, isNews, isKids, isSports, startIndex, limit, sortBy, sortOrder, genres, genreIds, + enableImages, enableTotalRecordCount, imageTypeLimit, enableImageTypes, enableUserData, seriesTimerId, + librarySeriesId, fields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetProgramsDto {\n"); + sb.append(" channelIds: ").append(toIndentedString(channelIds)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" minStartDate: ").append(toIndentedString(minStartDate)).append("\n"); + sb.append(" hasAired: ").append(toIndentedString(hasAired)).append("\n"); + sb.append(" isAiring: ").append(toIndentedString(isAiring)).append("\n"); + sb.append(" maxStartDate: ").append(toIndentedString(maxStartDate)).append("\n"); + sb.append(" minEndDate: ").append(toIndentedString(minEndDate)).append("\n"); + sb.append(" maxEndDate: ").append(toIndentedString(maxEndDate)).append("\n"); + sb.append(" isMovie: ").append(toIndentedString(isMovie)).append("\n"); + sb.append(" isSeries: ").append(toIndentedString(isSeries)).append("\n"); + sb.append(" isNews: ").append(toIndentedString(isNews)).append("\n"); + sb.append(" isKids: ").append(toIndentedString(isKids)).append("\n"); + sb.append(" isSports: ").append(toIndentedString(isSports)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" sortBy: ").append(toIndentedString(sortBy)).append("\n"); + sb.append(" sortOrder: ").append(toIndentedString(sortOrder)).append("\n"); + sb.append(" genres: ").append(toIndentedString(genres)).append("\n"); + sb.append(" genreIds: ").append(toIndentedString(genreIds)).append("\n"); + sb.append(" enableImages: ").append(toIndentedString(enableImages)).append("\n"); + sb.append(" enableTotalRecordCount: ").append(toIndentedString(enableTotalRecordCount)).append("\n"); + sb.append(" imageTypeLimit: ").append(toIndentedString(imageTypeLimit)).append("\n"); + sb.append(" enableImageTypes: ").append(toIndentedString(enableImageTypes)).append("\n"); + sb.append(" enableUserData: ").append(toIndentedString(enableUserData)).append("\n"); + sb.append(" seriesTimerId: ").append(toIndentedString(seriesTimerId)).append("\n"); + sb.append(" librarySeriesId: ").append(toIndentedString(librarySeriesId)).append("\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ChannelIds` to the URL query string + if (getChannelIds() != null) { + for (int i = 0; i < getChannelIds().size(); i++) { + if (getChannelIds().get(i) != null) { + joiner.add(String.format("%sChannelIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getChannelIds().get(i))))); + } + } + } + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `MinStartDate` to the URL query string + if (getMinStartDate() != null) { + joiner.add(String.format("%sMinStartDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMinStartDate())))); + } + + // add `HasAired` to the URL query string + if (getHasAired() != null) { + joiner.add(String.format("%sHasAired%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasAired())))); + } + + // add `IsAiring` to the URL query string + if (getIsAiring() != null) { + joiner.add(String.format("%sIsAiring%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAiring())))); + } + + // add `MaxStartDate` to the URL query string + if (getMaxStartDate() != null) { + joiner.add(String.format("%sMaxStartDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxStartDate())))); + } + + // add `MinEndDate` to the URL query string + if (getMinEndDate() != null) { + joiner.add(String.format("%sMinEndDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMinEndDate())))); + } + + // add `MaxEndDate` to the URL query string + if (getMaxEndDate() != null) { + joiner.add(String.format("%sMaxEndDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxEndDate())))); + } + + // add `IsMovie` to the URL query string + if (getIsMovie() != null) { + joiner.add(String.format("%sIsMovie%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsMovie())))); + } + + // add `IsSeries` to the URL query string + if (getIsSeries() != null) { + joiner.add(String.format("%sIsSeries%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsSeries())))); + } + + // add `IsNews` to the URL query string + if (getIsNews() != null) { + joiner.add(String.format("%sIsNews%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsNews())))); + } + + // add `IsKids` to the URL query string + if (getIsKids() != null) { + joiner.add(String.format("%sIsKids%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsKids())))); + } + + // add `IsSports` to the URL query string + if (getIsSports() != null) { + joiner.add(String.format("%sIsSports%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsSports())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + // add `Limit` to the URL query string + if (getLimit() != null) { + joiner.add(String.format("%sLimit%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLimit())))); + } + + // add `SortBy` to the URL query string + if (getSortBy() != null) { + for (int i = 0; i < getSortBy().size(); i++) { + joiner.add(String.format("%sSortBy%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSortBy().get(i))))); + } + } + + // add `SortOrder` to the URL query string + if (getSortOrder() != null) { + for (int i = 0; i < getSortOrder().size(); i++) { + if (getSortOrder().get(i) != null) { + joiner.add(String.format("%sSortOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSortOrder().get(i))))); + } + } + } + + // add `Genres` to the URL query string + if (getGenres() != null) { + for (int i = 0; i < getGenres().size(); i++) { + joiner.add(String.format("%sGenres%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getGenres().get(i))))); + } + } + + // add `GenreIds` to the URL query string + if (getGenreIds() != null) { + for (int i = 0; i < getGenreIds().size(); i++) { + if (getGenreIds().get(i) != null) { + joiner.add(String.format("%sGenreIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getGenreIds().get(i))))); + } + } + } + + // add `EnableImages` to the URL query string + if (getEnableImages() != null) { + joiner.add(String.format("%sEnableImages%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableImages())))); + } + + // add `EnableTotalRecordCount` to the URL query string + if (getEnableTotalRecordCount() != null) { + joiner.add(String.format("%sEnableTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableTotalRecordCount())))); + } + + // add `ImageTypeLimit` to the URL query string + if (getImageTypeLimit() != null) { + joiner.add(String.format("%sImageTypeLimit%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageTypeLimit())))); + } + + // add `EnableImageTypes` to the URL query string + if (getEnableImageTypes() != null) { + for (int i = 0; i < getEnableImageTypes().size(); i++) { + if (getEnableImageTypes().get(i) != null) { + joiner.add(String.format("%sEnableImageTypes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEnableImageTypes().get(i))))); + } + } + } + + // add `EnableUserData` to the URL query string + if (getEnableUserData() != null) { + joiner.add(String.format("%sEnableUserData%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableUserData())))); + } + + // add `SeriesTimerId` to the URL query string + if (getSeriesTimerId() != null) { + joiner.add(String.format("%sSeriesTimerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesTimerId())))); + } + + // add `LibrarySeriesId` to the URL query string + if (getLibrarySeriesId() != null) { + joiner.add(String.format("%sLibrarySeriesId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLibrarySeriesId())))); + } + + // add `Fields` to the URL query string + if (getFields() != null) { + for (int i = 0; i < getFields().size(); i++) { + if (getFields().get(i) != null) { + joiner.add(String.format("%sFields%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getFields().get(i))))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private GetProgramsDto instance; + + public Builder() { + this(new GetProgramsDto()); + } + + protected Builder(GetProgramsDto instance) { + this.instance = instance; + } + + public GetProgramsDto.Builder channelIds(List channelIds) { + this.instance.channelIds = channelIds; + return this; + } + + public GetProgramsDto.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public GetProgramsDto.Builder minStartDate(OffsetDateTime minStartDate) { + this.instance.minStartDate = minStartDate; + return this; + } + + public GetProgramsDto.Builder hasAired(Boolean hasAired) { + this.instance.hasAired = hasAired; + return this; + } + + public GetProgramsDto.Builder isAiring(Boolean isAiring) { + this.instance.isAiring = isAiring; + return this; + } + + public GetProgramsDto.Builder maxStartDate(OffsetDateTime maxStartDate) { + this.instance.maxStartDate = maxStartDate; + return this; + } + + public GetProgramsDto.Builder minEndDate(OffsetDateTime minEndDate) { + this.instance.minEndDate = minEndDate; + return this; + } + + public GetProgramsDto.Builder maxEndDate(OffsetDateTime maxEndDate) { + this.instance.maxEndDate = maxEndDate; + return this; + } + + public GetProgramsDto.Builder isMovie(Boolean isMovie) { + this.instance.isMovie = isMovie; + return this; + } + + public GetProgramsDto.Builder isSeries(Boolean isSeries) { + this.instance.isSeries = isSeries; + return this; + } + + public GetProgramsDto.Builder isNews(Boolean isNews) { + this.instance.isNews = isNews; + return this; + } + + public GetProgramsDto.Builder isKids(Boolean isKids) { + this.instance.isKids = isKids; + return this; + } + + public GetProgramsDto.Builder isSports(Boolean isSports) { + this.instance.isSports = isSports; + return this; + } + + public GetProgramsDto.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + public GetProgramsDto.Builder limit(Integer limit) { + this.instance.limit = limit; + return this; + } + + public GetProgramsDto.Builder sortBy(List sortBy) { + this.instance.sortBy = sortBy; + return this; + } + + public GetProgramsDto.Builder sortOrder(List sortOrder) { + this.instance.sortOrder = sortOrder; + return this; + } + + public GetProgramsDto.Builder genres(List genres) { + this.instance.genres = genres; + return this; + } + + public GetProgramsDto.Builder genreIds(List genreIds) { + this.instance.genreIds = genreIds; + return this; + } + + public GetProgramsDto.Builder enableImages(Boolean enableImages) { + this.instance.enableImages = enableImages; + return this; + } + + public GetProgramsDto.Builder enableTotalRecordCount(Boolean enableTotalRecordCount) { + this.instance.enableTotalRecordCount = enableTotalRecordCount; + return this; + } + + public GetProgramsDto.Builder imageTypeLimit(Integer imageTypeLimit) { + this.instance.imageTypeLimit = imageTypeLimit; + return this; + } + + public GetProgramsDto.Builder enableImageTypes(List enableImageTypes) { + this.instance.enableImageTypes = enableImageTypes; + return this; + } + + public GetProgramsDto.Builder enableUserData(Boolean enableUserData) { + this.instance.enableUserData = enableUserData; + return this; + } + + public GetProgramsDto.Builder seriesTimerId(String seriesTimerId) { + this.instance.seriesTimerId = seriesTimerId; + return this; + } + + public GetProgramsDto.Builder librarySeriesId(UUID librarySeriesId) { + this.instance.librarySeriesId = librarySeriesId; + return this; + } + + public GetProgramsDto.Builder fields(List fields) { + this.instance.fields = fields; + return this; + } + + /** + * returns a built GetProgramsDto instance. + * + * The builder is not reusable. + */ + public GetProgramsDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static GetProgramsDto.Builder builder() { + return new GetProgramsDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public GetProgramsDto.Builder toBuilder() { + return new GetProgramsDto.Builder().channelIds(getChannelIds()).userId(getUserId()) + .minStartDate(getMinStartDate()).hasAired(getHasAired()).isAiring(getIsAiring()) + .maxStartDate(getMaxStartDate()).minEndDate(getMinEndDate()).maxEndDate(getMaxEndDate()) + .isMovie(getIsMovie()).isSeries(getIsSeries()).isNews(getIsNews()).isKids(getIsKids()) + .isSports(getIsSports()).startIndex(getStartIndex()).limit(getLimit()).sortBy(getSortBy()) + .sortOrder(getSortOrder()).genres(getGenres()).genreIds(getGenreIds()).enableImages(getEnableImages()) + .enableTotalRecordCount(getEnableTotalRecordCount()).imageTypeLimit(getImageTypeLimit()) + .enableImageTypes(getEnableImageTypes()).enableUserData(getEnableUserData()) + .seriesTimerId(getSeriesTimerId()).librarySeriesId(getLibrarySeriesId()).fields(getFields()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupInfoDto.java new file mode 100644 index 0000000000000..9a18fcac4313c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupInfoDto.java @@ -0,0 +1,370 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class GroupInfoDto. + */ +@JsonPropertyOrder({ GroupInfoDto.JSON_PROPERTY_GROUP_ID, GroupInfoDto.JSON_PROPERTY_GROUP_NAME, + GroupInfoDto.JSON_PROPERTY_STATE, GroupInfoDto.JSON_PROPERTY_PARTICIPANTS, + GroupInfoDto.JSON_PROPERTY_LAST_UPDATED_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class GroupInfoDto { + public static final String JSON_PROPERTY_GROUP_ID = "GroupId"; + @org.eclipse.jdt.annotation.NonNull + private UUID groupId; + + public static final String JSON_PROPERTY_GROUP_NAME = "GroupName"; + @org.eclipse.jdt.annotation.NonNull + private String groupName; + + public static final String JSON_PROPERTY_STATE = "State"; + @org.eclipse.jdt.annotation.NonNull + private GroupStateType state; + + public static final String JSON_PROPERTY_PARTICIPANTS = "Participants"; + @org.eclipse.jdt.annotation.NonNull + private List participants = new ArrayList<>(); + + public static final String JSON_PROPERTY_LAST_UPDATED_AT = "LastUpdatedAt"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime lastUpdatedAt; + + public GroupInfoDto() { + } + + public GroupInfoDto groupId(@org.eclipse.jdt.annotation.NonNull UUID groupId) { + this.groupId = groupId; + return this; + } + + /** + * Gets the group identifier. + * + * @return groupId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getGroupId() { + return groupId; + } + + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupId(@org.eclipse.jdt.annotation.NonNull UUID groupId) { + this.groupId = groupId; + } + + public GroupInfoDto groupName(@org.eclipse.jdt.annotation.NonNull String groupName) { + this.groupName = groupName; + return this; + } + + /** + * Gets the group name. + * + * @return groupName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGroupName() { + return groupName; + } + + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupName(@org.eclipse.jdt.annotation.NonNull String groupName) { + this.groupName = groupName; + } + + public GroupInfoDto state(@org.eclipse.jdt.annotation.NonNull GroupStateType state) { + this.state = state; + return this; + } + + /** + * Gets the group state. + * + * @return state + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupStateType getState() { + return state; + } + + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setState(@org.eclipse.jdt.annotation.NonNull GroupStateType state) { + this.state = state; + } + + public GroupInfoDto participants(@org.eclipse.jdt.annotation.NonNull List participants) { + this.participants = participants; + return this; + } + + public GroupInfoDto addParticipantsItem(String participantsItem) { + if (this.participants == null) { + this.participants = new ArrayList<>(); + } + this.participants.add(participantsItem); + return this; + } + + /** + * Gets the participants. + * + * @return participants + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARTICIPANTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getParticipants() { + return participants; + } + + @JsonProperty(JSON_PROPERTY_PARTICIPANTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParticipants(@org.eclipse.jdt.annotation.NonNull List participants) { + this.participants = participants; + } + + public GroupInfoDto lastUpdatedAt(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastUpdatedAt) { + this.lastUpdatedAt = lastUpdatedAt; + return this; + } + + /** + * Gets the date when this DTO has been created. + * + * @return lastUpdatedAt + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastUpdatedAt() { + return lastUpdatedAt; + } + + @JsonProperty(JSON_PROPERTY_LAST_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastUpdatedAt(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastUpdatedAt) { + this.lastUpdatedAt = lastUpdatedAt; + } + + /** + * Return true if this GroupInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupInfoDto groupInfoDto = (GroupInfoDto) o; + return Objects.equals(this.groupId, groupInfoDto.groupId) + && Objects.equals(this.groupName, groupInfoDto.groupName) + && Objects.equals(this.state, groupInfoDto.state) + && Objects.equals(this.participants, groupInfoDto.participants) + && Objects.equals(this.lastUpdatedAt, groupInfoDto.lastUpdatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(groupId, groupName, state, participants, lastUpdatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupInfoDto {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" participants: ").append(toIndentedString(participants)).append("\n"); + sb.append(" lastUpdatedAt: ").append(toIndentedString(lastUpdatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `GroupId` to the URL query string + if (getGroupId() != null) { + joiner.add(String.format("%sGroupId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGroupId())))); + } + + // add `GroupName` to the URL query string + if (getGroupName() != null) { + joiner.add(String.format("%sGroupName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGroupName())))); + } + + // add `State` to the URL query string + if (getState() != null) { + joiner.add(String.format("%sState%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getState())))); + } + + // add `Participants` to the URL query string + if (getParticipants() != null) { + for (int i = 0; i < getParticipants().size(); i++) { + joiner.add(String.format("%sParticipants%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getParticipants().get(i))))); + } + } + + // add `LastUpdatedAt` to the URL query string + if (getLastUpdatedAt() != null) { + joiner.add(String.format("%sLastUpdatedAt%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastUpdatedAt())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private GroupInfoDto instance; + + public Builder() { + this(new GroupInfoDto()); + } + + protected Builder(GroupInfoDto instance) { + this.instance = instance; + } + + public GroupInfoDto.Builder groupId(UUID groupId) { + this.instance.groupId = groupId; + return this; + } + + public GroupInfoDto.Builder groupName(String groupName) { + this.instance.groupName = groupName; + return this; + } + + public GroupInfoDto.Builder state(GroupStateType state) { + this.instance.state = state; + return this; + } + + public GroupInfoDto.Builder participants(List participants) { + this.instance.participants = participants; + return this; + } + + public GroupInfoDto.Builder lastUpdatedAt(OffsetDateTime lastUpdatedAt) { + this.instance.lastUpdatedAt = lastUpdatedAt; + return this; + } + + /** + * returns a built GroupInfoDto instance. + * + * The builder is not reusable. + */ + public GroupInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static GroupInfoDto.Builder builder() { + return new GroupInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public GroupInfoDto.Builder toBuilder() { + return new GroupInfoDto.Builder().groupId(getGroupId()).groupName(getGroupName()).state(getState()) + .participants(getParticipants()).lastUpdatedAt(getLastUpdatedAt()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupQueueMode.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupQueueMode.java new file mode 100644 index 0000000000000..b52bb841b7736 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupQueueMode.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum GroupQueueMode. + */ +public enum GroupQueueMode { + + QUEUE("Queue"), + + QUEUE_NEXT("QueueNext"); + + private String value; + + GroupQueueMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GroupQueueMode fromValue(String value) { + for (GroupQueueMode b : GroupQueueMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupRepeatMode.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupRepeatMode.java new file mode 100644 index 0000000000000..be9ee8dd63f30 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupRepeatMode.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum GroupRepeatMode. + */ +public enum GroupRepeatMode { + + REPEAT_ONE("RepeatOne"), + + REPEAT_ALL("RepeatAll"), + + REPEAT_NONE("RepeatNone"); + + private String value; + + GroupRepeatMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GroupRepeatMode fromValue(String value) { + for (GroupRepeatMode b : GroupRepeatMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupShuffleMode.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupShuffleMode.java new file mode 100644 index 0000000000000..2526fad416e38 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupShuffleMode.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum GroupShuffleMode. + */ +public enum GroupShuffleMode { + + SORTED("Sorted"), + + SHUFFLE("Shuffle"); + + private String value; + + GroupShuffleMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GroupShuffleMode fromValue(String value) { + for (GroupShuffleMode b : GroupShuffleMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupStateType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupStateType.java new file mode 100644 index 0000000000000..5941c0c771113 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupStateType.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum GroupState. + */ +public enum GroupStateType { + + IDLE("Idle"), + + WAITING("Waiting"), + + PAUSED("Paused"), + + PLAYING("Playing"); + + private String value; + + GroupStateType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GroupStateType fromValue(String value) { + for (GroupStateType b : GroupStateType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupUpdateType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupUpdateType.java new file mode 100644 index 0000000000000..3fe7834473dad --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GroupUpdateType.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum GroupUpdateType. + */ +public enum GroupUpdateType { + + USER_JOINED("UserJoined"), + + USER_LEFT("UserLeft"), + + GROUP_JOINED("GroupJoined"), + + GROUP_LEFT("GroupLeft"), + + STATE_UPDATE("StateUpdate"), + + PLAY_QUEUE("PlayQueue"), + + NOT_IN_GROUP("NotInGroup"), + + GROUP_DOES_NOT_EXIST("GroupDoesNotExist"), + + CREATE_GROUP_DENIED("CreateGroupDenied"), + + JOIN_GROUP_DENIED("JoinGroupDenied"), + + LIBRARY_ACCESS_DENIED("LibraryAccessDenied"); + + private String value; + + GroupUpdateType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GroupUpdateType fromValue(String value) { + for (GroupUpdateType b : GroupUpdateType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GuideInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GuideInfo.java new file mode 100644 index 0000000000000..e1164fc3d4911 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/GuideInfo.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * GuideInfo + */ +@JsonPropertyOrder({ GuideInfo.JSON_PROPERTY_START_DATE, GuideInfo.JSON_PROPERTY_END_DATE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class GuideInfo { + public static final String JSON_PROPERTY_START_DATE = "StartDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime startDate; + + public static final String JSON_PROPERTY_END_DATE = "EndDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime endDate; + + public GuideInfo() { + } + + public GuideInfo startDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Gets or sets the start date. + * + * @return startDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartDate() { + return startDate; + } + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + } + + public GuideInfo endDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Gets or sets the end date. + * + * @return endDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndDate() { + return endDate; + } + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + } + + /** + * Return true if this GuideInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GuideInfo guideInfo = (GuideInfo) o; + return Objects.equals(this.startDate, guideInfo.startDate) && Objects.equals(this.endDate, guideInfo.endDate); + } + + @Override + public int hashCode() { + return Objects.hash(startDate, endDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GuideInfo {\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `StartDate` to the URL query string + if (getStartDate() != null) { + joiner.add(String.format("%sStartDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartDate())))); + } + + // add `EndDate` to the URL query string + if (getEndDate() != null) { + joiner.add(String.format("%sEndDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndDate())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private GuideInfo instance; + + public Builder() { + this(new GuideInfo()); + } + + protected Builder(GuideInfo instance) { + this.instance = instance; + } + + public GuideInfo.Builder startDate(OffsetDateTime startDate) { + this.instance.startDate = startDate; + return this; + } + + public GuideInfo.Builder endDate(OffsetDateTime endDate) { + this.instance.endDate = endDate; + return this; + } + + /** + * returns a built GuideInfo instance. + * + * The builder is not reusable. + */ + public GuideInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static GuideInfo.Builder builder() { + return new GuideInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public GuideInfo.Builder toBuilder() { + return new GuideInfo.Builder().startDate(getStartDate()).endDate(getEndDate()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/HardwareEncodingType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/HardwareEncodingType.java new file mode 100644 index 0000000000000..f17d5c1646374 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/HardwareEncodingType.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum HardwareEncodingType. + */ +public enum HardwareEncodingType { + + AMF("AMF"), + + QSV("QSV"), + + NVENC("NVENC"), + + V4_L2_M2_M("V4L2M2M"), + + VAAPI("VAAPI"), + + VIDEO_TOOL_BOX("VideoToolBox"); + + private String value; + + HardwareEncodingType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static HardwareEncodingType fromValue(String value) { + for (HardwareEncodingType b : HardwareEncodingType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/HeaderMatchType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/HeaderMatchType.java new file mode 100644 index 0000000000000..89b73cdea7da9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/HeaderMatchType.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets HeaderMatchType + */ +public enum HeaderMatchType { + + EQUALS("Equals"), + + REGEX("Regex"), + + SUBSTRING("Substring"); + + private String value; + + HeaderMatchType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static HeaderMatchType fromValue(String value) { + for (HeaderMatchType b : HeaderMatchType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/HttpHeaderInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/HttpHeaderInfo.java new file mode 100644 index 0000000000000..d72d49c770b4c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/HttpHeaderInfo.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * HttpHeaderInfo + */ +@JsonPropertyOrder({ HttpHeaderInfo.JSON_PROPERTY_NAME, HttpHeaderInfo.JSON_PROPERTY_VALUE, + HttpHeaderInfo.JSON_PROPERTY_MATCH }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class HttpHeaderInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_VALUE = "Value"; + @org.eclipse.jdt.annotation.NonNull + private String value; + + public static final String JSON_PROPERTY_MATCH = "Match"; + @org.eclipse.jdt.annotation.NonNull + private HeaderMatchType match; + + public HttpHeaderInfo() { + } + + public HttpHeaderInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public HttpHeaderInfo value(@org.eclipse.jdt.annotation.NonNull String value) { + this.value = value; + return this; + } + + /** + * Get value + * + * @return value + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@org.eclipse.jdt.annotation.NonNull String value) { + this.value = value; + } + + public HttpHeaderInfo match(@org.eclipse.jdt.annotation.NonNull HeaderMatchType match) { + this.match = match; + return this; + } + + /** + * Get match + * + * @return match + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public HeaderMatchType getMatch() { + return match; + } + + @JsonProperty(JSON_PROPERTY_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMatch(@org.eclipse.jdt.annotation.NonNull HeaderMatchType match) { + this.match = match; + } + + /** + * Return true if this HttpHeaderInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HttpHeaderInfo httpHeaderInfo = (HttpHeaderInfo) o; + return Objects.equals(this.name, httpHeaderInfo.name) && Objects.equals(this.value, httpHeaderInfo.value) + && Objects.equals(this.match, httpHeaderInfo.match); + } + + @Override + public int hashCode() { + return Objects.hash(name, value, match); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HttpHeaderInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" match: ").append(toIndentedString(match)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Value` to the URL query string + if (getValue() != null) { + joiner.add(String.format("%sValue%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getValue())))); + } + + // add `Match` to the URL query string + if (getMatch() != null) { + joiner.add(String.format("%sMatch%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMatch())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private HttpHeaderInfo instance; + + public Builder() { + this(new HttpHeaderInfo()); + } + + protected Builder(HttpHeaderInfo instance) { + this.instance = instance; + } + + public HttpHeaderInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public HttpHeaderInfo.Builder value(String value) { + this.instance.value = value; + return this; + } + + public HttpHeaderInfo.Builder match(HeaderMatchType match) { + this.instance.match = match; + return this; + } + + /** + * returns a built HttpHeaderInfo instance. + * + * The builder is not reusable. + */ + public HttpHeaderInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static HttpHeaderInfo.Builder builder() { + return new HttpHeaderInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public HttpHeaderInfo.Builder toBuilder() { + return new HttpHeaderInfo.Builder().name(getName()).value(getValue()).match(getMatch()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/IPlugin.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/IPlugin.java new file mode 100644 index 0000000000000..bdfbdf7ea1ca1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/IPlugin.java @@ -0,0 +1,376 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines the MediaBrowser.Common.Plugins.IPlugin. + */ +@JsonPropertyOrder({ IPlugin.JSON_PROPERTY_NAME, IPlugin.JSON_PROPERTY_DESCRIPTION, IPlugin.JSON_PROPERTY_ID, + IPlugin.JSON_PROPERTY_VERSION, IPlugin.JSON_PROPERTY_ASSEMBLY_FILE_PATH, IPlugin.JSON_PROPERTY_CAN_UNINSTALL, + IPlugin.JSON_PROPERTY_DATA_FOLDER_PATH }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class IPlugin { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_DESCRIPTION = "Description"; + @org.eclipse.jdt.annotation.NonNull + private String description; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_VERSION = "Version"; + @org.eclipse.jdt.annotation.NonNull + private String version; + + public static final String JSON_PROPERTY_ASSEMBLY_FILE_PATH = "AssemblyFilePath"; + @org.eclipse.jdt.annotation.NonNull + private String assemblyFilePath; + + public static final String JSON_PROPERTY_CAN_UNINSTALL = "CanUninstall"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canUninstall; + + public static final String JSON_PROPERTY_DATA_FOLDER_PATH = "DataFolderPath"; + @org.eclipse.jdt.annotation.NonNull + private String dataFolderPath; + + public IPlugin() { + } + + @JsonCreator + public IPlugin(@JsonProperty(JSON_PROPERTY_NAME) String name, + @JsonProperty(JSON_PROPERTY_DESCRIPTION) String description, @JsonProperty(JSON_PROPERTY_ID) UUID id, + @JsonProperty(JSON_PROPERTY_VERSION) String version, + @JsonProperty(JSON_PROPERTY_ASSEMBLY_FILE_PATH) String assemblyFilePath, + @JsonProperty(JSON_PROPERTY_CAN_UNINSTALL) Boolean canUninstall, + @JsonProperty(JSON_PROPERTY_DATA_FOLDER_PATH) String dataFolderPath) { + this(); + this.name = name; + this.description = description; + this.id = id; + this.version = version; + this.assemblyFilePath = assemblyFilePath; + this.canUninstall = canUninstall; + this.dataFolderPath = dataFolderPath; + } + + /** + * Gets the name of the plugin. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * Gets the Description. + * + * @return description + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + /** + * Gets the unique id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + /** + * Gets the plugin version. + * + * @return version + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + /** + * Gets the path to the assembly file. + * + * @return assemblyFilePath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ASSEMBLY_FILE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAssemblyFilePath() { + return assemblyFilePath; + } + + /** + * Gets a value indicating whether the plugin can be uninstalled. + * + * @return canUninstall + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_UNINSTALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanUninstall() { + return canUninstall; + } + + /** + * Gets the full path to the data folder, where the plugin can store any miscellaneous files needed. + * + * @return dataFolderPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA_FOLDER_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDataFolderPath() { + return dataFolderPath; + } + + /** + * Return true if this IPlugin object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IPlugin iplugin = (IPlugin) o; + return Objects.equals(this.name, iplugin.name) && Objects.equals(this.description, iplugin.description) + && Objects.equals(this.id, iplugin.id) && Objects.equals(this.version, iplugin.version) + && Objects.equals(this.assemblyFilePath, iplugin.assemblyFilePath) + && Objects.equals(this.canUninstall, iplugin.canUninstall) + && Objects.equals(this.dataFolderPath, iplugin.dataFolderPath); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, id, version, assemblyFilePath, canUninstall, dataFolderPath); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IPlugin {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" assemblyFilePath: ").append(toIndentedString(assemblyFilePath)).append("\n"); + sb.append(" canUninstall: ").append(toIndentedString(canUninstall)).append("\n"); + sb.append(" dataFolderPath: ").append(toIndentedString(dataFolderPath)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sDescription%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format("%sVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `AssemblyFilePath` to the URL query string + if (getAssemblyFilePath() != null) { + joiner.add(String.format("%sAssemblyFilePath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAssemblyFilePath())))); + } + + // add `CanUninstall` to the URL query string + if (getCanUninstall() != null) { + joiner.add(String.format("%sCanUninstall%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanUninstall())))); + } + + // add `DataFolderPath` to the URL query string + if (getDataFolderPath() != null) { + joiner.add(String.format("%sDataFolderPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDataFolderPath())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private IPlugin instance; + + public Builder() { + this(new IPlugin()); + } + + protected Builder(IPlugin instance) { + this.instance = instance; + } + + public IPlugin.Builder name(String name) { + this.instance.name = name; + return this; + } + + public IPlugin.Builder description(String description) { + this.instance.description = description; + return this; + } + + public IPlugin.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public IPlugin.Builder version(String version) { + this.instance.version = version; + return this; + } + + public IPlugin.Builder assemblyFilePath(String assemblyFilePath) { + this.instance.assemblyFilePath = assemblyFilePath; + return this; + } + + public IPlugin.Builder canUninstall(Boolean canUninstall) { + this.instance.canUninstall = canUninstall; + return this; + } + + public IPlugin.Builder dataFolderPath(String dataFolderPath) { + this.instance.dataFolderPath = dataFolderPath; + return this; + } + + /** + * returns a built IPlugin instance. + * + * The builder is not reusable. + */ + public IPlugin build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static IPlugin.Builder builder() { + return new IPlugin.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public IPlugin.Builder toBuilder() { + return new IPlugin.Builder().name(getName()).description(getDescription()).id(getId()).version(getVersion()) + .assemblyFilePath(getAssemblyFilePath()).canUninstall(getCanUninstall()) + .dataFolderPath(getDataFolderPath()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/IgnoreWaitRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/IgnoreWaitRequestDto.java new file mode 100644 index 0000000000000..b2fe056417c11 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/IgnoreWaitRequestDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class IgnoreWaitRequestDto. + */ +@JsonPropertyOrder({ IgnoreWaitRequestDto.JSON_PROPERTY_IGNORE_WAIT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class IgnoreWaitRequestDto { + public static final String JSON_PROPERTY_IGNORE_WAIT = "IgnoreWait"; + @org.eclipse.jdt.annotation.NonNull + private Boolean ignoreWait; + + public IgnoreWaitRequestDto() { + } + + public IgnoreWaitRequestDto ignoreWait(@org.eclipse.jdt.annotation.NonNull Boolean ignoreWait) { + this.ignoreWait = ignoreWait; + return this; + } + + /** + * Gets or sets a value indicating whether the client should be ignored. + * + * @return ignoreWait + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IGNORE_WAIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIgnoreWait() { + return ignoreWait; + } + + @JsonProperty(JSON_PROPERTY_IGNORE_WAIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIgnoreWait(@org.eclipse.jdt.annotation.NonNull Boolean ignoreWait) { + this.ignoreWait = ignoreWait; + } + + /** + * Return true if this IgnoreWaitRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IgnoreWaitRequestDto ignoreWaitRequestDto = (IgnoreWaitRequestDto) o; + return Objects.equals(this.ignoreWait, ignoreWaitRequestDto.ignoreWait); + } + + @Override + public int hashCode() { + return Objects.hash(ignoreWait); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IgnoreWaitRequestDto {\n"); + sb.append(" ignoreWait: ").append(toIndentedString(ignoreWait)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `IgnoreWait` to the URL query string + if (getIgnoreWait() != null) { + joiner.add(String.format("%sIgnoreWait%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIgnoreWait())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private IgnoreWaitRequestDto instance; + + public Builder() { + this(new IgnoreWaitRequestDto()); + } + + protected Builder(IgnoreWaitRequestDto instance) { + this.instance = instance; + } + + public IgnoreWaitRequestDto.Builder ignoreWait(Boolean ignoreWait) { + this.instance.ignoreWait = ignoreWait; + return this; + } + + /** + * returns a built IgnoreWaitRequestDto instance. + * + * The builder is not reusable. + */ + public IgnoreWaitRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static IgnoreWaitRequestDto.Builder builder() { + return new IgnoreWaitRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public IgnoreWaitRequestDto.Builder toBuilder() { + return new IgnoreWaitRequestDto.Builder().ignoreWait(getIgnoreWait()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageByNameInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageByNameInfo.java new file mode 100644 index 0000000000000..09024902a5dbe --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageByNameInfo.java @@ -0,0 +1,354 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ImageByNameInfo + */ +@JsonPropertyOrder({ ImageByNameInfo.JSON_PROPERTY_NAME, ImageByNameInfo.JSON_PROPERTY_THEME, + ImageByNameInfo.JSON_PROPERTY_CONTEXT, ImageByNameInfo.JSON_PROPERTY_FILE_LENGTH, + ImageByNameInfo.JSON_PROPERTY_FORMAT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ImageByNameInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_THEME = "Theme"; + @org.eclipse.jdt.annotation.NonNull + private String theme; + + public static final String JSON_PROPERTY_CONTEXT = "Context"; + @org.eclipse.jdt.annotation.NonNull + private String context; + + public static final String JSON_PROPERTY_FILE_LENGTH = "FileLength"; + @org.eclipse.jdt.annotation.NonNull + private Long fileLength; + + public static final String JSON_PROPERTY_FORMAT = "Format"; + @org.eclipse.jdt.annotation.NonNull + private String format; + + public ImageByNameInfo() { + } + + public ImageByNameInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ImageByNameInfo theme(@org.eclipse.jdt.annotation.NonNull String theme) { + this.theme = theme; + return this; + } + + /** + * Gets or sets the theme. + * + * @return theme + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THEME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTheme() { + return theme; + } + + @JsonProperty(JSON_PROPERTY_THEME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTheme(@org.eclipse.jdt.annotation.NonNull String theme) { + this.theme = theme; + } + + public ImageByNameInfo context(@org.eclipse.jdt.annotation.NonNull String context) { + this.context = context; + return this; + } + + /** + * Gets or sets the context. + * + * @return context + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@org.eclipse.jdt.annotation.NonNull String context) { + this.context = context; + } + + public ImageByNameInfo fileLength(@org.eclipse.jdt.annotation.NonNull Long fileLength) { + this.fileLength = fileLength; + return this; + } + + /** + * Gets or sets the length of the file. + * + * @return fileLength + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FILE_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFileLength() { + return fileLength; + } + + @JsonProperty(JSON_PROPERTY_FILE_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileLength(@org.eclipse.jdt.annotation.NonNull Long fileLength) { + this.fileLength = fileLength; + } + + public ImageByNameInfo format(@org.eclipse.jdt.annotation.NonNull String format) { + this.format = format; + return this; + } + + /** + * Gets or sets the format. + * + * @return format + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFormat() { + return format; + } + + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormat(@org.eclipse.jdt.annotation.NonNull String format) { + this.format = format; + } + + /** + * Return true if this ImageByNameInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageByNameInfo imageByNameInfo = (ImageByNameInfo) o; + return Objects.equals(this.name, imageByNameInfo.name) && Objects.equals(this.theme, imageByNameInfo.theme) + && Objects.equals(this.context, imageByNameInfo.context) + && Objects.equals(this.fileLength, imageByNameInfo.fileLength) + && Objects.equals(this.format, imageByNameInfo.format); + } + + @Override + public int hashCode() { + return Objects.hash(name, theme, context, fileLength, format); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageByNameInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" theme: ").append(toIndentedString(theme)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" fileLength: ").append(toIndentedString(fileLength)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Theme` to the URL query string + if (getTheme() != null) { + joiner.add(String.format("%sTheme%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTheme())))); + } + + // add `Context` to the URL query string + if (getContext() != null) { + joiner.add(String.format("%sContext%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContext())))); + } + + // add `FileLength` to the URL query string + if (getFileLength() != null) { + joiner.add(String.format("%sFileLength%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFileLength())))); + } + + // add `Format` to the URL query string + if (getFormat() != null) { + joiner.add(String.format("%sFormat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFormat())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ImageByNameInfo instance; + + public Builder() { + this(new ImageByNameInfo()); + } + + protected Builder(ImageByNameInfo instance) { + this.instance = instance; + } + + public ImageByNameInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ImageByNameInfo.Builder theme(String theme) { + this.instance.theme = theme; + return this; + } + + public ImageByNameInfo.Builder context(String context) { + this.instance.context = context; + return this; + } + + public ImageByNameInfo.Builder fileLength(Long fileLength) { + this.instance.fileLength = fileLength; + return this; + } + + public ImageByNameInfo.Builder format(String format) { + this.instance.format = format; + return this; + } + + /** + * returns a built ImageByNameInfo instance. + * + * The builder is not reusable. + */ + public ImageByNameInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ImageByNameInfo.Builder builder() { + return new ImageByNameInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ImageByNameInfo.Builder toBuilder() { + return new ImageByNameInfo.Builder().name(getName()).theme(getTheme()).context(getContext()) + .fileLength(getFileLength()).format(getFormat()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageFormat.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageFormat.java new file mode 100644 index 0000000000000..7e2b648f4008d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageFormat.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum ImageOutputFormat. + */ +public enum ImageFormat { + + BMP("Bmp"), + + GIF("Gif"), + + JPG("Jpg"), + + PNG("Png"), + + WEBP("Webp"); + + private String value; + + ImageFormat(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ImageFormat fromValue(String value) { + for (ImageFormat b : ImageFormat.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageInfo.java new file mode 100644 index 0000000000000..f66b0e0cd90c1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageInfo.java @@ -0,0 +1,472 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class ImageInfo. + */ +@JsonPropertyOrder({ ImageInfo.JSON_PROPERTY_IMAGE_TYPE, ImageInfo.JSON_PROPERTY_IMAGE_INDEX, + ImageInfo.JSON_PROPERTY_IMAGE_TAG, ImageInfo.JSON_PROPERTY_PATH, ImageInfo.JSON_PROPERTY_BLUR_HASH, + ImageInfo.JSON_PROPERTY_HEIGHT, ImageInfo.JSON_PROPERTY_WIDTH, ImageInfo.JSON_PROPERTY_SIZE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ImageInfo { + public static final String JSON_PROPERTY_IMAGE_TYPE = "ImageType"; + @org.eclipse.jdt.annotation.NonNull + private ImageType imageType; + + public static final String JSON_PROPERTY_IMAGE_INDEX = "ImageIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer imageIndex; + + public static final String JSON_PROPERTY_IMAGE_TAG = "ImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String imageTag; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_BLUR_HASH = "BlurHash"; + @org.eclipse.jdt.annotation.NonNull + private String blurHash; + + public static final String JSON_PROPERTY_HEIGHT = "Height"; + @org.eclipse.jdt.annotation.NonNull + private Integer height; + + public static final String JSON_PROPERTY_WIDTH = "Width"; + @org.eclipse.jdt.annotation.NonNull + private Integer width; + + public static final String JSON_PROPERTY_SIZE = "Size"; + @org.eclipse.jdt.annotation.NonNull + private Long size; + + public ImageInfo() { + } + + public ImageInfo imageType(@org.eclipse.jdt.annotation.NonNull ImageType imageType) { + this.imageType = imageType; + return this; + } + + /** + * Gets or sets the type of the image. + * + * @return imageType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ImageType getImageType() { + return imageType; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageType(@org.eclipse.jdt.annotation.NonNull ImageType imageType) { + this.imageType = imageType; + } + + public ImageInfo imageIndex(@org.eclipse.jdt.annotation.NonNull Integer imageIndex) { + this.imageIndex = imageIndex; + return this; + } + + /** + * Gets or sets the index of the image. + * + * @return imageIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getImageIndex() { + return imageIndex; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageIndex(@org.eclipse.jdt.annotation.NonNull Integer imageIndex) { + this.imageIndex = imageIndex; + } + + public ImageInfo imageTag(@org.eclipse.jdt.annotation.NonNull String imageTag) { + this.imageTag = imageTag; + return this; + } + + /** + * Gets or sets the image tag. + * + * @return imageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getImageTag() { + return imageTag; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageTag(@org.eclipse.jdt.annotation.NonNull String imageTag) { + this.imageTag = imageTag; + } + + public ImageInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public ImageInfo blurHash(@org.eclipse.jdt.annotation.NonNull String blurHash) { + this.blurHash = blurHash; + return this; + } + + /** + * Gets or sets the blurhash. + * + * @return blurHash + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BLUR_HASH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBlurHash() { + return blurHash; + } + + @JsonProperty(JSON_PROPERTY_BLUR_HASH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlurHash(@org.eclipse.jdt.annotation.NonNull String blurHash) { + this.blurHash = blurHash; + } + + public ImageInfo height(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + return this; + } + + /** + * Gets or sets the height. + * + * @return height + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHeight() { + return height; + } + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + } + + public ImageInfo width(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + return this; + } + + /** + * Gets or sets the width. + * + * @return width + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + } + + public ImageInfo size(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + return this; + } + + /** + * Gets or sets the size. + * + * @return size + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSize() { + return size; + } + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSize(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + } + + /** + * Return true if this ImageInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageInfo imageInfo = (ImageInfo) o; + return Objects.equals(this.imageType, imageInfo.imageType) + && Objects.equals(this.imageIndex, imageInfo.imageIndex) + && Objects.equals(this.imageTag, imageInfo.imageTag) && Objects.equals(this.path, imageInfo.path) + && Objects.equals(this.blurHash, imageInfo.blurHash) && Objects.equals(this.height, imageInfo.height) + && Objects.equals(this.width, imageInfo.width) && Objects.equals(this.size, imageInfo.size); + } + + @Override + public int hashCode() { + return Objects.hash(imageType, imageIndex, imageTag, path, blurHash, height, width, size); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageInfo {\n"); + sb.append(" imageType: ").append(toIndentedString(imageType)).append("\n"); + sb.append(" imageIndex: ").append(toIndentedString(imageIndex)).append("\n"); + sb.append(" imageTag: ").append(toIndentedString(imageTag)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" blurHash: ").append(toIndentedString(blurHash)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ImageType` to the URL query string + if (getImageType() != null) { + joiner.add(String.format("%sImageType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageType())))); + } + + // add `ImageIndex` to the URL query string + if (getImageIndex() != null) { + joiner.add(String.format("%sImageIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageIndex())))); + } + + // add `ImageTag` to the URL query string + if (getImageTag() != null) { + joiner.add(String.format("%sImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageTag())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `BlurHash` to the URL query string + if (getBlurHash() != null) { + joiner.add(String.format("%sBlurHash%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBlurHash())))); + } + + // add `Height` to the URL query string + if (getHeight() != null) { + joiner.add(String.format("%sHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHeight())))); + } + + // add `Width` to the URL query string + if (getWidth() != null) { + joiner.add(String.format("%sWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWidth())))); + } + + // add `Size` to the URL query string + if (getSize() != null) { + joiner.add(String.format("%sSize%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSize())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ImageInfo instance; + + public Builder() { + this(new ImageInfo()); + } + + protected Builder(ImageInfo instance) { + this.instance = instance; + } + + public ImageInfo.Builder imageType(ImageType imageType) { + this.instance.imageType = imageType; + return this; + } + + public ImageInfo.Builder imageIndex(Integer imageIndex) { + this.instance.imageIndex = imageIndex; + return this; + } + + public ImageInfo.Builder imageTag(String imageTag) { + this.instance.imageTag = imageTag; + return this; + } + + public ImageInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public ImageInfo.Builder blurHash(String blurHash) { + this.instance.blurHash = blurHash; + return this; + } + + public ImageInfo.Builder height(Integer height) { + this.instance.height = height; + return this; + } + + public ImageInfo.Builder width(Integer width) { + this.instance.width = width; + return this; + } + + public ImageInfo.Builder size(Long size) { + this.instance.size = size; + return this; + } + + /** + * returns a built ImageInfo instance. + * + * The builder is not reusable. + */ + public ImageInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ImageInfo.Builder builder() { + return new ImageInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ImageInfo.Builder toBuilder() { + return new ImageInfo.Builder().imageType(getImageType()).imageIndex(getImageIndex()).imageTag(getImageTag()) + .path(getPath()).blurHash(getBlurHash()).height(getHeight()).width(getWidth()).size(getSize()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageOption.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageOption.java new file mode 100644 index 0000000000000..acfb3cd973216 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageOption.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ImageOption + */ +@JsonPropertyOrder({ ImageOption.JSON_PROPERTY_TYPE, ImageOption.JSON_PROPERTY_LIMIT, + ImageOption.JSON_PROPERTY_MIN_WIDTH }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ImageOption { + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private ImageType type; + + public static final String JSON_PROPERTY_LIMIT = "Limit"; + @org.eclipse.jdt.annotation.NonNull + private Integer limit; + + public static final String JSON_PROPERTY_MIN_WIDTH = "MinWidth"; + @org.eclipse.jdt.annotation.NonNull + private Integer minWidth; + + public ImageOption() { + } + + public ImageOption type(@org.eclipse.jdt.annotation.NonNull ImageType type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ImageType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull ImageType type) { + this.type = type; + } + + public ImageOption limit(@org.eclipse.jdt.annotation.NonNull Integer limit) { + this.limit = limit; + return this; + } + + /** + * Gets or sets the limit. + * + * @return limit + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLimit() { + return limit; + } + + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLimit(@org.eclipse.jdt.annotation.NonNull Integer limit) { + this.limit = limit; + } + + public ImageOption minWidth(@org.eclipse.jdt.annotation.NonNull Integer minWidth) { + this.minWidth = minWidth; + return this; + } + + /** + * Gets or sets the minimum width. + * + * @return minWidth + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIN_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMinWidth() { + return minWidth; + } + + @JsonProperty(JSON_PROPERTY_MIN_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinWidth(@org.eclipse.jdt.annotation.NonNull Integer minWidth) { + this.minWidth = minWidth; + } + + /** + * Return true if this ImageOption object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageOption imageOption = (ImageOption) o; + return Objects.equals(this.type, imageOption.type) && Objects.equals(this.limit, imageOption.limit) + && Objects.equals(this.minWidth, imageOption.minWidth); + } + + @Override + public int hashCode() { + return Objects.hash(type, limit, minWidth); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageOption {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" minWidth: ").append(toIndentedString(minWidth)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `Limit` to the URL query string + if (getLimit() != null) { + joiner.add(String.format("%sLimit%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLimit())))); + } + + // add `MinWidth` to the URL query string + if (getMinWidth() != null) { + joiner.add(String.format("%sMinWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMinWidth())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ImageOption instance; + + public Builder() { + this(new ImageOption()); + } + + protected Builder(ImageOption instance) { + this.instance = instance; + } + + public ImageOption.Builder type(ImageType type) { + this.instance.type = type; + return this; + } + + public ImageOption.Builder limit(Integer limit) { + this.instance.limit = limit; + return this; + } + + public ImageOption.Builder minWidth(Integer minWidth) { + this.instance.minWidth = minWidth; + return this; + } + + /** + * returns a built ImageOption instance. + * + * The builder is not reusable. + */ + public ImageOption build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ImageOption.Builder builder() { + return new ImageOption.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ImageOption.Builder toBuilder() { + return new ImageOption.Builder().type(getType()).limit(getLimit()).minWidth(getMinWidth()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageOrientation.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageOrientation.java new file mode 100644 index 0000000000000..0c60b7136d4a4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageOrientation.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ImageOrientation + */ +public enum ImageOrientation { + + TOP_LEFT("TopLeft"), + + TOP_RIGHT("TopRight"), + + BOTTOM_RIGHT("BottomRight"), + + BOTTOM_LEFT("BottomLeft"), + + LEFT_TOP("LeftTop"), + + RIGHT_TOP("RightTop"), + + RIGHT_BOTTOM("RightBottom"), + + LEFT_BOTTOM("LeftBottom"); + + private String value; + + ImageOrientation(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ImageOrientation fromValue(String value) { + for (ImageOrientation b : ImageOrientation.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageProviderInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageProviderInfo.java new file mode 100644 index 0000000000000..e3b81508802ae --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageProviderInfo.java @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class ImageProviderInfo. + */ +@JsonPropertyOrder({ ImageProviderInfo.JSON_PROPERTY_NAME, ImageProviderInfo.JSON_PROPERTY_SUPPORTED_IMAGES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ImageProviderInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_SUPPORTED_IMAGES = "SupportedImages"; + @org.eclipse.jdt.annotation.NonNull + private List supportedImages = new ArrayList<>(); + + public ImageProviderInfo() { + } + + public ImageProviderInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ImageProviderInfo supportedImages(@org.eclipse.jdt.annotation.NonNull List supportedImages) { + this.supportedImages = supportedImages; + return this; + } + + public ImageProviderInfo addSupportedImagesItem(ImageType supportedImagesItem) { + if (this.supportedImages == null) { + this.supportedImages = new ArrayList<>(); + } + this.supportedImages.add(supportedImagesItem); + return this; + } + + /** + * Gets the supported image types. + * + * @return supportedImages + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTED_IMAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSupportedImages() { + return supportedImages; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTED_IMAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportedImages(@org.eclipse.jdt.annotation.NonNull List supportedImages) { + this.supportedImages = supportedImages; + } + + /** + * Return true if this ImageProviderInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageProviderInfo imageProviderInfo = (ImageProviderInfo) o; + return Objects.equals(this.name, imageProviderInfo.name) + && Objects.equals(this.supportedImages, imageProviderInfo.supportedImages); + } + + @Override + public int hashCode() { + return Objects.hash(name, supportedImages); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageProviderInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" supportedImages: ").append(toIndentedString(supportedImages)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `SupportedImages` to the URL query string + if (getSupportedImages() != null) { + for (int i = 0; i < getSupportedImages().size(); i++) { + if (getSupportedImages().get(i) != null) { + joiner.add(String.format("%sSupportedImages%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSupportedImages().get(i))))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private ImageProviderInfo instance; + + public Builder() { + this(new ImageProviderInfo()); + } + + protected Builder(ImageProviderInfo instance) { + this.instance = instance; + } + + public ImageProviderInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ImageProviderInfo.Builder supportedImages(List supportedImages) { + this.instance.supportedImages = supportedImages; + return this; + } + + /** + * returns a built ImageProviderInfo instance. + * + * The builder is not reusable. + */ + public ImageProviderInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ImageProviderInfo.Builder builder() { + return new ImageProviderInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ImageProviderInfo.Builder toBuilder() { + return new ImageProviderInfo.Builder().name(getName()).supportedImages(getSupportedImages()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageSavingConvention.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageSavingConvention.java new file mode 100644 index 0000000000000..f1ece9c58c7ed --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageSavingConvention.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ImageSavingConvention + */ +public enum ImageSavingConvention { + + LEGACY("Legacy"), + + COMPATIBLE("Compatible"); + + private String value; + + ImageSavingConvention(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ImageSavingConvention fromValue(String value) { + for (ImageSavingConvention b : ImageSavingConvention.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageType.java new file mode 100644 index 0000000000000..aa46d6e9bd085 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ImageType.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum ImageType. + */ +public enum ImageType { + + PRIMARY("Primary"), + + ART("Art"), + + BACKDROP("Backdrop"), + + BANNER("Banner"), + + LOGO("Logo"), + + THUMB("Thumb"), + + DISC("Disc"), + + BOX("Box"), + + SCREENSHOT("Screenshot"), + + MENU("Menu"), + + CHAPTER("Chapter"), + + BOX_REAR("BoxRear"), + + PROFILE("Profile"); + + private String value; + + ImageType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ImageType fromValue(String value) { + for (ImageType b : ImageType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/InstallationInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/InstallationInfo.java new file mode 100644 index 0000000000000..09988d129456a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/InstallationInfo.java @@ -0,0 +1,436 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class InstallationInfo. + */ +@JsonPropertyOrder({ InstallationInfo.JSON_PROPERTY_GUID, InstallationInfo.JSON_PROPERTY_NAME, + InstallationInfo.JSON_PROPERTY_VERSION, InstallationInfo.JSON_PROPERTY_CHANGELOG, + InstallationInfo.JSON_PROPERTY_SOURCE_URL, InstallationInfo.JSON_PROPERTY_CHECKSUM, + InstallationInfo.JSON_PROPERTY_PACKAGE_INFO }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class InstallationInfo { + public static final String JSON_PROPERTY_GUID = "Guid"; + @org.eclipse.jdt.annotation.NonNull + private UUID guid; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_VERSION = "Version"; + @org.eclipse.jdt.annotation.NonNull + private String version; + + public static final String JSON_PROPERTY_CHANGELOG = "Changelog"; + @org.eclipse.jdt.annotation.NonNull + private String changelog; + + public static final String JSON_PROPERTY_SOURCE_URL = "SourceUrl"; + @org.eclipse.jdt.annotation.NonNull + private String sourceUrl; + + public static final String JSON_PROPERTY_CHECKSUM = "Checksum"; + @org.eclipse.jdt.annotation.NonNull + private String checksum; + + public static final String JSON_PROPERTY_PACKAGE_INFO = "PackageInfo"; + @org.eclipse.jdt.annotation.NonNull + private PackageInfo packageInfo; + + public InstallationInfo() { + } + + public InstallationInfo guid(@org.eclipse.jdt.annotation.NonNull UUID guid) { + this.guid = guid; + return this; + } + + /** + * Gets or sets the Id. + * + * @return guid + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getGuid() { + return guid; + } + + @JsonProperty(JSON_PROPERTY_GUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGuid(@org.eclipse.jdt.annotation.NonNull UUID guid) { + this.guid = guid; + } + + public InstallationInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public InstallationInfo version(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + return this; + } + + /** + * Gets or sets the version. + * + * @return version + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + } + + public InstallationInfo changelog(@org.eclipse.jdt.annotation.NonNull String changelog) { + this.changelog = changelog; + return this; + } + + /** + * Gets or sets the changelog for this version. + * + * @return changelog + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANGELOG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChangelog() { + return changelog; + } + + @JsonProperty(JSON_PROPERTY_CHANGELOG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChangelog(@org.eclipse.jdt.annotation.NonNull String changelog) { + this.changelog = changelog; + } + + public InstallationInfo sourceUrl(@org.eclipse.jdt.annotation.NonNull String sourceUrl) { + this.sourceUrl = sourceUrl; + return this; + } + + /** + * Gets or sets the source URL. + * + * @return sourceUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SOURCE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceUrl() { + return sourceUrl; + } + + @JsonProperty(JSON_PROPERTY_SOURCE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceUrl(@org.eclipse.jdt.annotation.NonNull String sourceUrl) { + this.sourceUrl = sourceUrl; + } + + public InstallationInfo checksum(@org.eclipse.jdt.annotation.NonNull String checksum) { + this.checksum = checksum; + return this; + } + + /** + * Gets or sets a checksum for the binary. + * + * @return checksum + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHECKSUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChecksum() { + return checksum; + } + + @JsonProperty(JSON_PROPERTY_CHECKSUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChecksum(@org.eclipse.jdt.annotation.NonNull String checksum) { + this.checksum = checksum; + } + + public InstallationInfo packageInfo(@org.eclipse.jdt.annotation.NonNull PackageInfo packageInfo) { + this.packageInfo = packageInfo; + return this; + } + + /** + * Gets or sets package information for the installation. + * + * @return packageInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PACKAGE_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PackageInfo getPackageInfo() { + return packageInfo; + } + + @JsonProperty(JSON_PROPERTY_PACKAGE_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPackageInfo(@org.eclipse.jdt.annotation.NonNull PackageInfo packageInfo) { + this.packageInfo = packageInfo; + } + + /** + * Return true if this InstallationInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InstallationInfo installationInfo = (InstallationInfo) o; + return Objects.equals(this.guid, installationInfo.guid) && Objects.equals(this.name, installationInfo.name) + && Objects.equals(this.version, installationInfo.version) + && Objects.equals(this.changelog, installationInfo.changelog) + && Objects.equals(this.sourceUrl, installationInfo.sourceUrl) + && Objects.equals(this.checksum, installationInfo.checksum) + && Objects.equals(this.packageInfo, installationInfo.packageInfo); + } + + @Override + public int hashCode() { + return Objects.hash(guid, name, version, changelog, sourceUrl, checksum, packageInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InstallationInfo {\n"); + sb.append(" guid: ").append(toIndentedString(guid)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" changelog: ").append(toIndentedString(changelog)).append("\n"); + sb.append(" sourceUrl: ").append(toIndentedString(sourceUrl)).append("\n"); + sb.append(" checksum: ").append(toIndentedString(checksum)).append("\n"); + sb.append(" packageInfo: ").append(toIndentedString(packageInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Guid` to the URL query string + if (getGuid() != null) { + joiner.add(String.format("%sGuid%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGuid())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format("%sVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `Changelog` to the URL query string + if (getChangelog() != null) { + joiner.add(String.format("%sChangelog%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChangelog())))); + } + + // add `SourceUrl` to the URL query string + if (getSourceUrl() != null) { + joiner.add(String.format("%sSourceUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSourceUrl())))); + } + + // add `Checksum` to the URL query string + if (getChecksum() != null) { + joiner.add(String.format("%sChecksum%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChecksum())))); + } + + // add `PackageInfo` to the URL query string + if (getPackageInfo() != null) { + joiner.add(getPackageInfo().toUrlQueryString(prefix + "PackageInfo" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private InstallationInfo instance; + + public Builder() { + this(new InstallationInfo()); + } + + protected Builder(InstallationInfo instance) { + this.instance = instance; + } + + public InstallationInfo.Builder guid(UUID guid) { + this.instance.guid = guid; + return this; + } + + public InstallationInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public InstallationInfo.Builder version(String version) { + this.instance.version = version; + return this; + } + + public InstallationInfo.Builder changelog(String changelog) { + this.instance.changelog = changelog; + return this; + } + + public InstallationInfo.Builder sourceUrl(String sourceUrl) { + this.instance.sourceUrl = sourceUrl; + return this; + } + + public InstallationInfo.Builder checksum(String checksum) { + this.instance.checksum = checksum; + return this; + } + + public InstallationInfo.Builder packageInfo(PackageInfo packageInfo) { + this.instance.packageInfo = packageInfo; + return this; + } + + /** + * returns a built InstallationInfo instance. + * + * The builder is not reusable. + */ + public InstallationInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static InstallationInfo.Builder builder() { + return new InstallationInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public InstallationInfo.Builder toBuilder() { + return new InstallationInfo.Builder().guid(getGuid()).name(getName()).version(getVersion()) + .changelog(getChangelog()).sourceUrl(getSourceUrl()).checksum(getChecksum()) + .packageInfo(getPackageInfo()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/IsoType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/IsoType.java new file mode 100644 index 0000000000000..363f072afd869 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/IsoType.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum IsoType. + */ +public enum IsoType { + + DVD("Dvd"), + + BLU_RAY("BluRay"); + + private String value; + + IsoType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static IsoType fromValue(String value) { + for (IsoType b : IsoType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ItemCounts.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ItemCounts.java new file mode 100644 index 0000000000000..0597b1ccae1ec --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ItemCounts.java @@ -0,0 +1,642 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class LibrarySummary. + */ +@JsonPropertyOrder({ ItemCounts.JSON_PROPERTY_MOVIE_COUNT, ItemCounts.JSON_PROPERTY_SERIES_COUNT, + ItemCounts.JSON_PROPERTY_EPISODE_COUNT, ItemCounts.JSON_PROPERTY_ARTIST_COUNT, + ItemCounts.JSON_PROPERTY_PROGRAM_COUNT, ItemCounts.JSON_PROPERTY_TRAILER_COUNT, + ItemCounts.JSON_PROPERTY_SONG_COUNT, ItemCounts.JSON_PROPERTY_ALBUM_COUNT, + ItemCounts.JSON_PROPERTY_MUSIC_VIDEO_COUNT, ItemCounts.JSON_PROPERTY_BOX_SET_COUNT, + ItemCounts.JSON_PROPERTY_BOOK_COUNT, ItemCounts.JSON_PROPERTY_ITEM_COUNT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ItemCounts { + public static final String JSON_PROPERTY_MOVIE_COUNT = "MovieCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer movieCount; + + public static final String JSON_PROPERTY_SERIES_COUNT = "SeriesCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer seriesCount; + + public static final String JSON_PROPERTY_EPISODE_COUNT = "EpisodeCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer episodeCount; + + public static final String JSON_PROPERTY_ARTIST_COUNT = "ArtistCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer artistCount; + + public static final String JSON_PROPERTY_PROGRAM_COUNT = "ProgramCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer programCount; + + public static final String JSON_PROPERTY_TRAILER_COUNT = "TrailerCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer trailerCount; + + public static final String JSON_PROPERTY_SONG_COUNT = "SongCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer songCount; + + public static final String JSON_PROPERTY_ALBUM_COUNT = "AlbumCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer albumCount; + + public static final String JSON_PROPERTY_MUSIC_VIDEO_COUNT = "MusicVideoCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer musicVideoCount; + + public static final String JSON_PROPERTY_BOX_SET_COUNT = "BoxSetCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer boxSetCount; + + public static final String JSON_PROPERTY_BOOK_COUNT = "BookCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer bookCount; + + public static final String JSON_PROPERTY_ITEM_COUNT = "ItemCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer itemCount; + + public ItemCounts() { + } + + public ItemCounts movieCount(@org.eclipse.jdt.annotation.NonNull Integer movieCount) { + this.movieCount = movieCount; + return this; + } + + /** + * Gets or sets the movie count. + * + * @return movieCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MOVIE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMovieCount() { + return movieCount; + } + + @JsonProperty(JSON_PROPERTY_MOVIE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMovieCount(@org.eclipse.jdt.annotation.NonNull Integer movieCount) { + this.movieCount = movieCount; + } + + public ItemCounts seriesCount(@org.eclipse.jdt.annotation.NonNull Integer seriesCount) { + this.seriesCount = seriesCount; + return this; + } + + /** + * Gets or sets the series count. + * + * @return seriesCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSeriesCount() { + return seriesCount; + } + + @JsonProperty(JSON_PROPERTY_SERIES_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesCount(@org.eclipse.jdt.annotation.NonNull Integer seriesCount) { + this.seriesCount = seriesCount; + } + + public ItemCounts episodeCount(@org.eclipse.jdt.annotation.NonNull Integer episodeCount) { + this.episodeCount = episodeCount; + return this; + } + + /** + * Gets or sets the episode count. + * + * @return episodeCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EPISODE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getEpisodeCount() { + return episodeCount; + } + + @JsonProperty(JSON_PROPERTY_EPISODE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEpisodeCount(@org.eclipse.jdt.annotation.NonNull Integer episodeCount) { + this.episodeCount = episodeCount; + } + + public ItemCounts artistCount(@org.eclipse.jdt.annotation.NonNull Integer artistCount) { + this.artistCount = artistCount; + return this; + } + + /** + * Gets or sets the artist count. + * + * @return artistCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTIST_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getArtistCount() { + return artistCount; + } + + @JsonProperty(JSON_PROPERTY_ARTIST_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtistCount(@org.eclipse.jdt.annotation.NonNull Integer artistCount) { + this.artistCount = artistCount; + } + + public ItemCounts programCount(@org.eclipse.jdt.annotation.NonNull Integer programCount) { + this.programCount = programCount; + return this; + } + + /** + * Gets or sets the program count. + * + * @return programCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROGRAM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getProgramCount() { + return programCount; + } + + @JsonProperty(JSON_PROPERTY_PROGRAM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgramCount(@org.eclipse.jdt.annotation.NonNull Integer programCount) { + this.programCount = programCount; + } + + public ItemCounts trailerCount(@org.eclipse.jdt.annotation.NonNull Integer trailerCount) { + this.trailerCount = trailerCount; + return this; + } + + /** + * Gets or sets the trailer count. + * + * @return trailerCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRAILER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTrailerCount() { + return trailerCount; + } + + @JsonProperty(JSON_PROPERTY_TRAILER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrailerCount(@org.eclipse.jdt.annotation.NonNull Integer trailerCount) { + this.trailerCount = trailerCount; + } + + public ItemCounts songCount(@org.eclipse.jdt.annotation.NonNull Integer songCount) { + this.songCount = songCount; + return this; + } + + /** + * Gets or sets the song count. + * + * @return songCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SONG_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSongCount() { + return songCount; + } + + @JsonProperty(JSON_PROPERTY_SONG_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSongCount(@org.eclipse.jdt.annotation.NonNull Integer songCount) { + this.songCount = songCount; + } + + public ItemCounts albumCount(@org.eclipse.jdt.annotation.NonNull Integer albumCount) { + this.albumCount = albumCount; + return this; + } + + /** + * Gets or sets the album count. + * + * @return albumCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAlbumCount() { + return albumCount; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumCount(@org.eclipse.jdt.annotation.NonNull Integer albumCount) { + this.albumCount = albumCount; + } + + public ItemCounts musicVideoCount(@org.eclipse.jdt.annotation.NonNull Integer musicVideoCount) { + this.musicVideoCount = musicVideoCount; + return this; + } + + /** + * Gets or sets the music video count. + * + * @return musicVideoCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MUSIC_VIDEO_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMusicVideoCount() { + return musicVideoCount; + } + + @JsonProperty(JSON_PROPERTY_MUSIC_VIDEO_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMusicVideoCount(@org.eclipse.jdt.annotation.NonNull Integer musicVideoCount) { + this.musicVideoCount = musicVideoCount; + } + + public ItemCounts boxSetCount(@org.eclipse.jdt.annotation.NonNull Integer boxSetCount) { + this.boxSetCount = boxSetCount; + return this; + } + + /** + * Gets or sets the box set count. + * + * @return boxSetCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BOX_SET_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBoxSetCount() { + return boxSetCount; + } + + @JsonProperty(JSON_PROPERTY_BOX_SET_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBoxSetCount(@org.eclipse.jdt.annotation.NonNull Integer boxSetCount) { + this.boxSetCount = boxSetCount; + } + + public ItemCounts bookCount(@org.eclipse.jdt.annotation.NonNull Integer bookCount) { + this.bookCount = bookCount; + return this; + } + + /** + * Gets or sets the book count. + * + * @return bookCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BOOK_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBookCount() { + return bookCount; + } + + @JsonProperty(JSON_PROPERTY_BOOK_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBookCount(@org.eclipse.jdt.annotation.NonNull Integer bookCount) { + this.bookCount = bookCount; + } + + public ItemCounts itemCount(@org.eclipse.jdt.annotation.NonNull Integer itemCount) { + this.itemCount = itemCount; + return this; + } + + /** + * Gets or sets the item count. + * + * @return itemCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getItemCount() { + return itemCount; + } + + @JsonProperty(JSON_PROPERTY_ITEM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemCount(@org.eclipse.jdt.annotation.NonNull Integer itemCount) { + this.itemCount = itemCount; + } + + /** + * Return true if this ItemCounts object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemCounts itemCounts = (ItemCounts) o; + return Objects.equals(this.movieCount, itemCounts.movieCount) + && Objects.equals(this.seriesCount, itemCounts.seriesCount) + && Objects.equals(this.episodeCount, itemCounts.episodeCount) + && Objects.equals(this.artistCount, itemCounts.artistCount) + && Objects.equals(this.programCount, itemCounts.programCount) + && Objects.equals(this.trailerCount, itemCounts.trailerCount) + && Objects.equals(this.songCount, itemCounts.songCount) + && Objects.equals(this.albumCount, itemCounts.albumCount) + && Objects.equals(this.musicVideoCount, itemCounts.musicVideoCount) + && Objects.equals(this.boxSetCount, itemCounts.boxSetCount) + && Objects.equals(this.bookCount, itemCounts.bookCount) + && Objects.equals(this.itemCount, itemCounts.itemCount); + } + + @Override + public int hashCode() { + return Objects.hash(movieCount, seriesCount, episodeCount, artistCount, programCount, trailerCount, songCount, + albumCount, musicVideoCount, boxSetCount, bookCount, itemCount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ItemCounts {\n"); + sb.append(" movieCount: ").append(toIndentedString(movieCount)).append("\n"); + sb.append(" seriesCount: ").append(toIndentedString(seriesCount)).append("\n"); + sb.append(" episodeCount: ").append(toIndentedString(episodeCount)).append("\n"); + sb.append(" artistCount: ").append(toIndentedString(artistCount)).append("\n"); + sb.append(" programCount: ").append(toIndentedString(programCount)).append("\n"); + sb.append(" trailerCount: ").append(toIndentedString(trailerCount)).append("\n"); + sb.append(" songCount: ").append(toIndentedString(songCount)).append("\n"); + sb.append(" albumCount: ").append(toIndentedString(albumCount)).append("\n"); + sb.append(" musicVideoCount: ").append(toIndentedString(musicVideoCount)).append("\n"); + sb.append(" boxSetCount: ").append(toIndentedString(boxSetCount)).append("\n"); + sb.append(" bookCount: ").append(toIndentedString(bookCount)).append("\n"); + sb.append(" itemCount: ").append(toIndentedString(itemCount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MovieCount` to the URL query string + if (getMovieCount() != null) { + joiner.add(String.format("%sMovieCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMovieCount())))); + } + + // add `SeriesCount` to the URL query string + if (getSeriesCount() != null) { + joiner.add(String.format("%sSeriesCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesCount())))); + } + + // add `EpisodeCount` to the URL query string + if (getEpisodeCount() != null) { + joiner.add(String.format("%sEpisodeCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEpisodeCount())))); + } + + // add `ArtistCount` to the URL query string + if (getArtistCount() != null) { + joiner.add(String.format("%sArtistCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getArtistCount())))); + } + + // add `ProgramCount` to the URL query string + if (getProgramCount() != null) { + joiner.add(String.format("%sProgramCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProgramCount())))); + } + + // add `TrailerCount` to the URL query string + if (getTrailerCount() != null) { + joiner.add(String.format("%sTrailerCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTrailerCount())))); + } + + // add `SongCount` to the URL query string + if (getSongCount() != null) { + joiner.add(String.format("%sSongCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSongCount())))); + } + + // add `AlbumCount` to the URL query string + if (getAlbumCount() != null) { + joiner.add(String.format("%sAlbumCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbumCount())))); + } + + // add `MusicVideoCount` to the URL query string + if (getMusicVideoCount() != null) { + joiner.add(String.format("%sMusicVideoCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMusicVideoCount())))); + } + + // add `BoxSetCount` to the URL query string + if (getBoxSetCount() != null) { + joiner.add(String.format("%sBoxSetCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBoxSetCount())))); + } + + // add `BookCount` to the URL query string + if (getBookCount() != null) { + joiner.add(String.format("%sBookCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBookCount())))); + } + + // add `ItemCount` to the URL query string + if (getItemCount() != null) { + joiner.add(String.format("%sItemCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemCount())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ItemCounts instance; + + public Builder() { + this(new ItemCounts()); + } + + protected Builder(ItemCounts instance) { + this.instance = instance; + } + + public ItemCounts.Builder movieCount(Integer movieCount) { + this.instance.movieCount = movieCount; + return this; + } + + public ItemCounts.Builder seriesCount(Integer seriesCount) { + this.instance.seriesCount = seriesCount; + return this; + } + + public ItemCounts.Builder episodeCount(Integer episodeCount) { + this.instance.episodeCount = episodeCount; + return this; + } + + public ItemCounts.Builder artistCount(Integer artistCount) { + this.instance.artistCount = artistCount; + return this; + } + + public ItemCounts.Builder programCount(Integer programCount) { + this.instance.programCount = programCount; + return this; + } + + public ItemCounts.Builder trailerCount(Integer trailerCount) { + this.instance.trailerCount = trailerCount; + return this; + } + + public ItemCounts.Builder songCount(Integer songCount) { + this.instance.songCount = songCount; + return this; + } + + public ItemCounts.Builder albumCount(Integer albumCount) { + this.instance.albumCount = albumCount; + return this; + } + + public ItemCounts.Builder musicVideoCount(Integer musicVideoCount) { + this.instance.musicVideoCount = musicVideoCount; + return this; + } + + public ItemCounts.Builder boxSetCount(Integer boxSetCount) { + this.instance.boxSetCount = boxSetCount; + return this; + } + + public ItemCounts.Builder bookCount(Integer bookCount) { + this.instance.bookCount = bookCount; + return this; + } + + public ItemCounts.Builder itemCount(Integer itemCount) { + this.instance.itemCount = itemCount; + return this; + } + + /** + * returns a built ItemCounts instance. + * + * The builder is not reusable. + */ + public ItemCounts build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ItemCounts.Builder builder() { + return new ItemCounts.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ItemCounts.Builder toBuilder() { + return new ItemCounts.Builder().movieCount(getMovieCount()).seriesCount(getSeriesCount()) + .episodeCount(getEpisodeCount()).artistCount(getArtistCount()).programCount(getProgramCount()) + .trailerCount(getTrailerCount()).songCount(getSongCount()).albumCount(getAlbumCount()) + .musicVideoCount(getMusicVideoCount()).boxSetCount(getBoxSetCount()).bookCount(getBookCount()) + .itemCount(getItemCount()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ItemFields.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ItemFields.java new file mode 100644 index 0000000000000..303846508b3cc --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ItemFields.java @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Used to control the data that gets attached to DtoBaseItems. + */ +public enum ItemFields { + + AIR_TIME("AirTime"), + + CAN_DELETE("CanDelete"), + + CAN_DOWNLOAD("CanDownload"), + + CHANNEL_INFO("ChannelInfo"), + + CHAPTERS("Chapters"), + + CHILD_COUNT("ChildCount"), + + CUMULATIVE_RUN_TIME_TICKS("CumulativeRunTimeTicks"), + + CUSTOM_RATING("CustomRating"), + + DATE_CREATED("DateCreated"), + + DATE_LAST_MEDIA_ADDED("DateLastMediaAdded"), + + DISPLAY_PREFERENCES_ID("DisplayPreferencesId"), + + ETAG("Etag"), + + EXTERNAL_URLS("ExternalUrls"), + + GENRES("Genres"), + + HOME_PAGE_URL("HomePageUrl"), + + ITEM_COUNTS("ItemCounts"), + + MEDIA_SOURCE_COUNT("MediaSourceCount"), + + MEDIA_SOURCES("MediaSources"), + + ORIGINAL_TITLE("OriginalTitle"), + + OVERVIEW("Overview"), + + PARENT_ID("ParentId"), + + PATH("Path"), + + PEOPLE("People"), + + PLAY_ACCESS("PlayAccess"), + + PRODUCTION_LOCATIONS("ProductionLocations"), + + PROVIDER_IDS("ProviderIds"), + + PRIMARY_IMAGE_ASPECT_RATIO("PrimaryImageAspectRatio"), + + RECURSIVE_ITEM_COUNT("RecursiveItemCount"), + + SETTINGS("Settings"), + + SCREENSHOT_IMAGE_TAGS("ScreenshotImageTags"), + + SERIES_PRIMARY_IMAGE("SeriesPrimaryImage"), + + SERIES_STUDIO("SeriesStudio"), + + SORT_NAME("SortName"), + + SPECIAL_EPISODE_NUMBERS("SpecialEpisodeNumbers"), + + STUDIOS("Studios"), + + BASIC_SYNC_INFO("BasicSyncInfo"), + + SYNC_INFO("SyncInfo"), + + TAGLINES("Taglines"), + + TAGS("Tags"), + + REMOTE_TRAILERS("RemoteTrailers"), + + MEDIA_STREAMS("MediaStreams"), + + SEASON_USER_DATA("SeasonUserData"), + + SERVICE_NAME("ServiceName"), + + THEME_SONG_IDS("ThemeSongIds"), + + THEME_VIDEO_IDS("ThemeVideoIds"), + + EXTERNAL_ETAG("ExternalEtag"), + + PRESENTATION_UNIQUE_KEY("PresentationUniqueKey"), + + INHERITED_PARENTAL_RATING_VALUE("InheritedParentalRatingValue"), + + EXTERNAL_SERIES_ID("ExternalSeriesId"), + + SERIES_PRESENTATION_UNIQUE_KEY("SeriesPresentationUniqueKey"), + + DATE_LAST_REFRESHED("DateLastRefreshed"), + + DATE_LAST_SAVED("DateLastSaved"), + + REFRESH_STATE("RefreshState"), + + CHANNEL_IMAGE("ChannelImage"), + + ENABLE_MEDIA_SOURCE_DISPLAY("EnableMediaSourceDisplay"), + + WIDTH("Width"), + + HEIGHT("Height"), + + EXTRA_IDS("ExtraIds"), + + LOCAL_TRAILER_COUNT("LocalTrailerCount"), + + IS_HD("IsHD"), + + SPECIAL_FEATURE_COUNT("SpecialFeatureCount"); + + private String value; + + ItemFields(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ItemFields fromValue(String value) { + for (ItemFields b : ItemFields.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ItemFilter.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ItemFilter.java new file mode 100644 index 0000000000000..bf5bbe99e235a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ItemFilter.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum ItemFilter. + */ +public enum ItemFilter { + + IS_FOLDER("IsFolder"), + + IS_NOT_FOLDER("IsNotFolder"), + + IS_UNPLAYED("IsUnplayed"), + + IS_PLAYED("IsPlayed"), + + IS_FAVORITE("IsFavorite"), + + IS_RESUMABLE("IsResumable"), + + LIKES("Likes"), + + DISLIKES("Dislikes"), + + IS_FAVORITE_OR_LIKES("IsFavoriteOrLikes"); + + private String value; + + ItemFilter(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ItemFilter fromValue(String value) { + for (ItemFilter b : ItemFilter.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/JoinGroupRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/JoinGroupRequestDto.java new file mode 100644 index 0000000000000..b5cf812a819a2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/JoinGroupRequestDto.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class JoinGroupRequestDto. + */ +@JsonPropertyOrder({ JoinGroupRequestDto.JSON_PROPERTY_GROUP_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class JoinGroupRequestDto { + public static final String JSON_PROPERTY_GROUP_ID = "GroupId"; + @org.eclipse.jdt.annotation.NonNull + private UUID groupId; + + public JoinGroupRequestDto() { + } + + public JoinGroupRequestDto groupId(@org.eclipse.jdt.annotation.NonNull UUID groupId) { + this.groupId = groupId; + return this; + } + + /** + * Gets or sets the group identifier. + * + * @return groupId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getGroupId() { + return groupId; + } + + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupId(@org.eclipse.jdt.annotation.NonNull UUID groupId) { + this.groupId = groupId; + } + + /** + * Return true if this JoinGroupRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JoinGroupRequestDto joinGroupRequestDto = (JoinGroupRequestDto) o; + return Objects.equals(this.groupId, joinGroupRequestDto.groupId); + } + + @Override + public int hashCode() { + return Objects.hash(groupId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JoinGroupRequestDto {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `GroupId` to the URL query string + if (getGroupId() != null) { + joiner.add(String.format("%sGroupId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGroupId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private JoinGroupRequestDto instance; + + public Builder() { + this(new JoinGroupRequestDto()); + } + + protected Builder(JoinGroupRequestDto instance) { + this.instance = instance; + } + + public JoinGroupRequestDto.Builder groupId(UUID groupId) { + this.instance.groupId = groupId; + return this; + } + + /** + * returns a built JoinGroupRequestDto instance. + * + * The builder is not reusable. + */ + public JoinGroupRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static JoinGroupRequestDto.Builder builder() { + return new JoinGroupRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public JoinGroupRequestDto.Builder toBuilder() { + return new JoinGroupRequestDto.Builder().groupId(getGroupId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/KeepUntil.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/KeepUntil.java new file mode 100644 index 0000000000000..688211e0ef768 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/KeepUntil.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets KeepUntil + */ +public enum KeepUntil { + + UNTIL_DELETED("UntilDeleted"), + + UNTIL_SPACE_NEEDED("UntilSpaceNeeded"), + + UNTIL_WATCHED("UntilWatched"), + + UNTIL_DATE("UntilDate"); + + private String value; + + KeepUntil(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KeepUntil fromValue(String value) { + for (KeepUntil b : KeepUntil.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryOptionInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryOptionInfoDto.java new file mode 100644 index 0000000000000..3a431b7564ef8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryOptionInfoDto.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Library option info dto. + */ +@JsonPropertyOrder({ LibraryOptionInfoDto.JSON_PROPERTY_NAME, LibraryOptionInfoDto.JSON_PROPERTY_DEFAULT_ENABLED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LibraryOptionInfoDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_DEFAULT_ENABLED = "DefaultEnabled"; + @org.eclipse.jdt.annotation.NonNull + private Boolean defaultEnabled; + + public LibraryOptionInfoDto() { + } + + public LibraryOptionInfoDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public LibraryOptionInfoDto defaultEnabled(@org.eclipse.jdt.annotation.NonNull Boolean defaultEnabled) { + this.defaultEnabled = defaultEnabled; + return this; + } + + /** + * Gets or sets a value indicating whether default enabled. + * + * @return defaultEnabled + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEFAULT_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDefaultEnabled() { + return defaultEnabled; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultEnabled(@org.eclipse.jdt.annotation.NonNull Boolean defaultEnabled) { + this.defaultEnabled = defaultEnabled; + } + + /** + * Return true if this LibraryOptionInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LibraryOptionInfoDto libraryOptionInfoDto = (LibraryOptionInfoDto) o; + return Objects.equals(this.name, libraryOptionInfoDto.name) + && Objects.equals(this.defaultEnabled, libraryOptionInfoDto.defaultEnabled); + } + + @Override + public int hashCode() { + return Objects.hash(name, defaultEnabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LibraryOptionInfoDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" defaultEnabled: ").append(toIndentedString(defaultEnabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `DefaultEnabled` to the URL query string + if (getDefaultEnabled() != null) { + joiner.add(String.format("%sDefaultEnabled%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDefaultEnabled())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private LibraryOptionInfoDto instance; + + public Builder() { + this(new LibraryOptionInfoDto()); + } + + protected Builder(LibraryOptionInfoDto instance) { + this.instance = instance; + } + + public LibraryOptionInfoDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public LibraryOptionInfoDto.Builder defaultEnabled(Boolean defaultEnabled) { + this.instance.defaultEnabled = defaultEnabled; + return this; + } + + /** + * returns a built LibraryOptionInfoDto instance. + * + * The builder is not reusable. + */ + public LibraryOptionInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LibraryOptionInfoDto.Builder builder() { + return new LibraryOptionInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LibraryOptionInfoDto.Builder toBuilder() { + return new LibraryOptionInfoDto.Builder().name(getName()).defaultEnabled(getDefaultEnabled()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryOptions.java new file mode 100644 index 0000000000000..f697b69382234 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryOptions.java @@ -0,0 +1,1414 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * LibraryOptions + */ +@JsonPropertyOrder({ LibraryOptions.JSON_PROPERTY_ENABLE_PHOTOS, LibraryOptions.JSON_PROPERTY_ENABLE_REALTIME_MONITOR, + LibraryOptions.JSON_PROPERTY_ENABLE_CHAPTER_IMAGE_EXTRACTION, + LibraryOptions.JSON_PROPERTY_EXTRACT_CHAPTER_IMAGES_DURING_LIBRARY_SCAN, + LibraryOptions.JSON_PROPERTY_PATH_INFOS, LibraryOptions.JSON_PROPERTY_SAVE_LOCAL_METADATA, + LibraryOptions.JSON_PROPERTY_ENABLE_INTERNET_PROVIDERS, + LibraryOptions.JSON_PROPERTY_ENABLE_AUTOMATIC_SERIES_GROUPING, + LibraryOptions.JSON_PROPERTY_ENABLE_EMBEDDED_TITLES, LibraryOptions.JSON_PROPERTY_ENABLE_EMBEDDED_EPISODE_INFOS, + LibraryOptions.JSON_PROPERTY_AUTOMATIC_REFRESH_INTERVAL_DAYS, + LibraryOptions.JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE, LibraryOptions.JSON_PROPERTY_METADATA_COUNTRY_CODE, + LibraryOptions.JSON_PROPERTY_SEASON_ZERO_DISPLAY_NAME, LibraryOptions.JSON_PROPERTY_METADATA_SAVERS, + LibraryOptions.JSON_PROPERTY_DISABLED_LOCAL_METADATA_READERS, + LibraryOptions.JSON_PROPERTY_LOCAL_METADATA_READER_ORDER, + LibraryOptions.JSON_PROPERTY_DISABLED_SUBTITLE_FETCHERS, LibraryOptions.JSON_PROPERTY_SUBTITLE_FETCHER_ORDER, + LibraryOptions.JSON_PROPERTY_SKIP_SUBTITLES_IF_EMBEDDED_SUBTITLES_PRESENT, + LibraryOptions.JSON_PROPERTY_SKIP_SUBTITLES_IF_AUDIO_TRACK_MATCHES, + LibraryOptions.JSON_PROPERTY_SUBTITLE_DOWNLOAD_LANGUAGES, + LibraryOptions.JSON_PROPERTY_REQUIRE_PERFECT_SUBTITLE_MATCH, + LibraryOptions.JSON_PROPERTY_SAVE_SUBTITLES_WITH_MEDIA, + LibraryOptions.JSON_PROPERTY_AUTOMATICALLY_ADD_TO_COLLECTION, + LibraryOptions.JSON_PROPERTY_ALLOW_EMBEDDED_SUBTITLES, LibraryOptions.JSON_PROPERTY_TYPE_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LibraryOptions { + public static final String JSON_PROPERTY_ENABLE_PHOTOS = "EnablePhotos"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enablePhotos; + + public static final String JSON_PROPERTY_ENABLE_REALTIME_MONITOR = "EnableRealtimeMonitor"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableRealtimeMonitor; + + public static final String JSON_PROPERTY_ENABLE_CHAPTER_IMAGE_EXTRACTION = "EnableChapterImageExtraction"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableChapterImageExtraction; + + public static final String JSON_PROPERTY_EXTRACT_CHAPTER_IMAGES_DURING_LIBRARY_SCAN = "ExtractChapterImagesDuringLibraryScan"; + @org.eclipse.jdt.annotation.NonNull + private Boolean extractChapterImagesDuringLibraryScan; + + public static final String JSON_PROPERTY_PATH_INFOS = "PathInfos"; + @org.eclipse.jdt.annotation.NonNull + private List pathInfos = new ArrayList<>(); + + public static final String JSON_PROPERTY_SAVE_LOCAL_METADATA = "SaveLocalMetadata"; + @org.eclipse.jdt.annotation.NonNull + private Boolean saveLocalMetadata; + + public static final String JSON_PROPERTY_ENABLE_INTERNET_PROVIDERS = "EnableInternetProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableInternetProviders; + + public static final String JSON_PROPERTY_ENABLE_AUTOMATIC_SERIES_GROUPING = "EnableAutomaticSeriesGrouping"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAutomaticSeriesGrouping; + + public static final String JSON_PROPERTY_ENABLE_EMBEDDED_TITLES = "EnableEmbeddedTitles"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableEmbeddedTitles; + + public static final String JSON_PROPERTY_ENABLE_EMBEDDED_EPISODE_INFOS = "EnableEmbeddedEpisodeInfos"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableEmbeddedEpisodeInfos; + + public static final String JSON_PROPERTY_AUTOMATIC_REFRESH_INTERVAL_DAYS = "AutomaticRefreshIntervalDays"; + @org.eclipse.jdt.annotation.NonNull + private Integer automaticRefreshIntervalDays; + + public static final String JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE = "PreferredMetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String preferredMetadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_SEASON_ZERO_DISPLAY_NAME = "SeasonZeroDisplayName"; + @org.eclipse.jdt.annotation.NonNull + private String seasonZeroDisplayName; + + public static final String JSON_PROPERTY_METADATA_SAVERS = "MetadataSavers"; + @org.eclipse.jdt.annotation.NonNull + private List metadataSavers; + + public static final String JSON_PROPERTY_DISABLED_LOCAL_METADATA_READERS = "DisabledLocalMetadataReaders"; + @org.eclipse.jdt.annotation.NonNull + private List disabledLocalMetadataReaders = new ArrayList<>(); + + public static final String JSON_PROPERTY_LOCAL_METADATA_READER_ORDER = "LocalMetadataReaderOrder"; + @org.eclipse.jdt.annotation.NonNull + private List localMetadataReaderOrder; + + public static final String JSON_PROPERTY_DISABLED_SUBTITLE_FETCHERS = "DisabledSubtitleFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List disabledSubtitleFetchers = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUBTITLE_FETCHER_ORDER = "SubtitleFetcherOrder"; + @org.eclipse.jdt.annotation.NonNull + private List subtitleFetcherOrder = new ArrayList<>(); + + public static final String JSON_PROPERTY_SKIP_SUBTITLES_IF_EMBEDDED_SUBTITLES_PRESENT = "SkipSubtitlesIfEmbeddedSubtitlesPresent"; + @org.eclipse.jdt.annotation.NonNull + private Boolean skipSubtitlesIfEmbeddedSubtitlesPresent; + + public static final String JSON_PROPERTY_SKIP_SUBTITLES_IF_AUDIO_TRACK_MATCHES = "SkipSubtitlesIfAudioTrackMatches"; + @org.eclipse.jdt.annotation.NonNull + private Boolean skipSubtitlesIfAudioTrackMatches; + + public static final String JSON_PROPERTY_SUBTITLE_DOWNLOAD_LANGUAGES = "SubtitleDownloadLanguages"; + @org.eclipse.jdt.annotation.NonNull + private List subtitleDownloadLanguages; + + public static final String JSON_PROPERTY_REQUIRE_PERFECT_SUBTITLE_MATCH = "RequirePerfectSubtitleMatch"; + @org.eclipse.jdt.annotation.NonNull + private Boolean requirePerfectSubtitleMatch; + + public static final String JSON_PROPERTY_SAVE_SUBTITLES_WITH_MEDIA = "SaveSubtitlesWithMedia"; + @org.eclipse.jdt.annotation.NonNull + private Boolean saveSubtitlesWithMedia; + + public static final String JSON_PROPERTY_AUTOMATICALLY_ADD_TO_COLLECTION = "AutomaticallyAddToCollection"; + @org.eclipse.jdt.annotation.NonNull + private Boolean automaticallyAddToCollection; + + public static final String JSON_PROPERTY_ALLOW_EMBEDDED_SUBTITLES = "AllowEmbeddedSubtitles"; + @org.eclipse.jdt.annotation.NonNull + private EmbeddedSubtitleOptions allowEmbeddedSubtitles; + + public static final String JSON_PROPERTY_TYPE_OPTIONS = "TypeOptions"; + @org.eclipse.jdt.annotation.NonNull + private List typeOptions = new ArrayList<>(); + + public LibraryOptions() { + } + + public LibraryOptions enablePhotos(@org.eclipse.jdt.annotation.NonNull Boolean enablePhotos) { + this.enablePhotos = enablePhotos; + return this; + } + + /** + * Get enablePhotos + * + * @return enablePhotos + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_PHOTOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnablePhotos() { + return enablePhotos; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_PHOTOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnablePhotos(@org.eclipse.jdt.annotation.NonNull Boolean enablePhotos) { + this.enablePhotos = enablePhotos; + } + + public LibraryOptions enableRealtimeMonitor(@org.eclipse.jdt.annotation.NonNull Boolean enableRealtimeMonitor) { + this.enableRealtimeMonitor = enableRealtimeMonitor; + return this; + } + + /** + * Get enableRealtimeMonitor + * + * @return enableRealtimeMonitor + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_REALTIME_MONITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableRealtimeMonitor() { + return enableRealtimeMonitor; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_REALTIME_MONITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableRealtimeMonitor(@org.eclipse.jdt.annotation.NonNull Boolean enableRealtimeMonitor) { + this.enableRealtimeMonitor = enableRealtimeMonitor; + } + + public LibraryOptions enableChapterImageExtraction( + @org.eclipse.jdt.annotation.NonNull Boolean enableChapterImageExtraction) { + this.enableChapterImageExtraction = enableChapterImageExtraction; + return this; + } + + /** + * Get enableChapterImageExtraction + * + * @return enableChapterImageExtraction + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_CHAPTER_IMAGE_EXTRACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableChapterImageExtraction() { + return enableChapterImageExtraction; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_CHAPTER_IMAGE_EXTRACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableChapterImageExtraction( + @org.eclipse.jdt.annotation.NonNull Boolean enableChapterImageExtraction) { + this.enableChapterImageExtraction = enableChapterImageExtraction; + } + + public LibraryOptions extractChapterImagesDuringLibraryScan( + @org.eclipse.jdt.annotation.NonNull Boolean extractChapterImagesDuringLibraryScan) { + this.extractChapterImagesDuringLibraryScan = extractChapterImagesDuringLibraryScan; + return this; + } + + /** + * Get extractChapterImagesDuringLibraryScan + * + * @return extractChapterImagesDuringLibraryScan + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTRACT_CHAPTER_IMAGES_DURING_LIBRARY_SCAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getExtractChapterImagesDuringLibraryScan() { + return extractChapterImagesDuringLibraryScan; + } + + @JsonProperty(JSON_PROPERTY_EXTRACT_CHAPTER_IMAGES_DURING_LIBRARY_SCAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExtractChapterImagesDuringLibraryScan( + @org.eclipse.jdt.annotation.NonNull Boolean extractChapterImagesDuringLibraryScan) { + this.extractChapterImagesDuringLibraryScan = extractChapterImagesDuringLibraryScan; + } + + public LibraryOptions pathInfos(@org.eclipse.jdt.annotation.NonNull List pathInfos) { + this.pathInfos = pathInfos; + return this; + } + + public LibraryOptions addPathInfosItem(MediaPathInfo pathInfosItem) { + if (this.pathInfos == null) { + this.pathInfos = new ArrayList<>(); + } + this.pathInfos.add(pathInfosItem); + return this; + } + + /** + * Get pathInfos + * + * @return pathInfos + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPathInfos() { + return pathInfos; + } + + @JsonProperty(JSON_PROPERTY_PATH_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPathInfos(@org.eclipse.jdt.annotation.NonNull List pathInfos) { + this.pathInfos = pathInfos; + } + + public LibraryOptions saveLocalMetadata(@org.eclipse.jdt.annotation.NonNull Boolean saveLocalMetadata) { + this.saveLocalMetadata = saveLocalMetadata; + return this; + } + + /** + * Get saveLocalMetadata + * + * @return saveLocalMetadata + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SAVE_LOCAL_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSaveLocalMetadata() { + return saveLocalMetadata; + } + + @JsonProperty(JSON_PROPERTY_SAVE_LOCAL_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaveLocalMetadata(@org.eclipse.jdt.annotation.NonNull Boolean saveLocalMetadata) { + this.saveLocalMetadata = saveLocalMetadata; + } + + public LibraryOptions enableInternetProviders(@org.eclipse.jdt.annotation.NonNull Boolean enableInternetProviders) { + this.enableInternetProviders = enableInternetProviders; + return this; + } + + /** + * Get enableInternetProviders + * + * @return enableInternetProviders + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_INTERNET_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableInternetProviders() { + return enableInternetProviders; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_INTERNET_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableInternetProviders(@org.eclipse.jdt.annotation.NonNull Boolean enableInternetProviders) { + this.enableInternetProviders = enableInternetProviders; + } + + public LibraryOptions enableAutomaticSeriesGrouping( + @org.eclipse.jdt.annotation.NonNull Boolean enableAutomaticSeriesGrouping) { + this.enableAutomaticSeriesGrouping = enableAutomaticSeriesGrouping; + return this; + } + + /** + * Get enableAutomaticSeriesGrouping + * + * @return enableAutomaticSeriesGrouping + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_AUTOMATIC_SERIES_GROUPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAutomaticSeriesGrouping() { + return enableAutomaticSeriesGrouping; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_AUTOMATIC_SERIES_GROUPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAutomaticSeriesGrouping( + @org.eclipse.jdt.annotation.NonNull Boolean enableAutomaticSeriesGrouping) { + this.enableAutomaticSeriesGrouping = enableAutomaticSeriesGrouping; + } + + public LibraryOptions enableEmbeddedTitles(@org.eclipse.jdt.annotation.NonNull Boolean enableEmbeddedTitles) { + this.enableEmbeddedTitles = enableEmbeddedTitles; + return this; + } + + /** + * Get enableEmbeddedTitles + * + * @return enableEmbeddedTitles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_EMBEDDED_TITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableEmbeddedTitles() { + return enableEmbeddedTitles; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_EMBEDDED_TITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableEmbeddedTitles(@org.eclipse.jdt.annotation.NonNull Boolean enableEmbeddedTitles) { + this.enableEmbeddedTitles = enableEmbeddedTitles; + } + + public LibraryOptions enableEmbeddedEpisodeInfos( + @org.eclipse.jdt.annotation.NonNull Boolean enableEmbeddedEpisodeInfos) { + this.enableEmbeddedEpisodeInfos = enableEmbeddedEpisodeInfos; + return this; + } + + /** + * Get enableEmbeddedEpisodeInfos + * + * @return enableEmbeddedEpisodeInfos + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_EMBEDDED_EPISODE_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableEmbeddedEpisodeInfos() { + return enableEmbeddedEpisodeInfos; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_EMBEDDED_EPISODE_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableEmbeddedEpisodeInfos(@org.eclipse.jdt.annotation.NonNull Boolean enableEmbeddedEpisodeInfos) { + this.enableEmbeddedEpisodeInfos = enableEmbeddedEpisodeInfos; + } + + public LibraryOptions automaticRefreshIntervalDays( + @org.eclipse.jdt.annotation.NonNull Integer automaticRefreshIntervalDays) { + this.automaticRefreshIntervalDays = automaticRefreshIntervalDays; + return this; + } + + /** + * Get automaticRefreshIntervalDays + * + * @return automaticRefreshIntervalDays + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTOMATIC_REFRESH_INTERVAL_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAutomaticRefreshIntervalDays() { + return automaticRefreshIntervalDays; + } + + @JsonProperty(JSON_PROPERTY_AUTOMATIC_REFRESH_INTERVAL_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAutomaticRefreshIntervalDays( + @org.eclipse.jdt.annotation.NonNull Integer automaticRefreshIntervalDays) { + this.automaticRefreshIntervalDays = automaticRefreshIntervalDays; + } + + public LibraryOptions preferredMetadataLanguage( + @org.eclipse.jdt.annotation.NonNull String preferredMetadataLanguage) { + this.preferredMetadataLanguage = preferredMetadataLanguage; + return this; + } + + /** + * Gets or sets the preferred metadata language. + * + * @return preferredMetadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPreferredMetadataLanguage() { + return preferredMetadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreferredMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String preferredMetadataLanguage) { + this.preferredMetadataLanguage = preferredMetadataLanguage; + } + + public LibraryOptions metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public LibraryOptions seasonZeroDisplayName(@org.eclipse.jdt.annotation.NonNull String seasonZeroDisplayName) { + this.seasonZeroDisplayName = seasonZeroDisplayName; + return this; + } + + /** + * Get seasonZeroDisplayName + * + * @return seasonZeroDisplayName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEASON_ZERO_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeasonZeroDisplayName() { + return seasonZeroDisplayName; + } + + @JsonProperty(JSON_PROPERTY_SEASON_ZERO_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeasonZeroDisplayName(@org.eclipse.jdt.annotation.NonNull String seasonZeroDisplayName) { + this.seasonZeroDisplayName = seasonZeroDisplayName; + } + + public LibraryOptions metadataSavers(@org.eclipse.jdt.annotation.NonNull List metadataSavers) { + this.metadataSavers = metadataSavers; + return this; + } + + public LibraryOptions addMetadataSaversItem(String metadataSaversItem) { + if (this.metadataSavers == null) { + this.metadataSavers = new ArrayList<>(); + } + this.metadataSavers.add(metadataSaversItem); + return this; + } + + /** + * Get metadataSavers + * + * @return metadataSavers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_SAVERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMetadataSavers() { + return metadataSavers; + } + + @JsonProperty(JSON_PROPERTY_METADATA_SAVERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataSavers(@org.eclipse.jdt.annotation.NonNull List metadataSavers) { + this.metadataSavers = metadataSavers; + } + + public LibraryOptions disabledLocalMetadataReaders( + @org.eclipse.jdt.annotation.NonNull List disabledLocalMetadataReaders) { + this.disabledLocalMetadataReaders = disabledLocalMetadataReaders; + return this; + } + + public LibraryOptions addDisabledLocalMetadataReadersItem(String disabledLocalMetadataReadersItem) { + if (this.disabledLocalMetadataReaders == null) { + this.disabledLocalMetadataReaders = new ArrayList<>(); + } + this.disabledLocalMetadataReaders.add(disabledLocalMetadataReadersItem); + return this; + } + + /** + * Get disabledLocalMetadataReaders + * + * @return disabledLocalMetadataReaders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISABLED_LOCAL_METADATA_READERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisabledLocalMetadataReaders() { + return disabledLocalMetadataReaders; + } + + @JsonProperty(JSON_PROPERTY_DISABLED_LOCAL_METADATA_READERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisabledLocalMetadataReaders( + @org.eclipse.jdt.annotation.NonNull List disabledLocalMetadataReaders) { + this.disabledLocalMetadataReaders = disabledLocalMetadataReaders; + } + + public LibraryOptions localMetadataReaderOrder( + @org.eclipse.jdt.annotation.NonNull List localMetadataReaderOrder) { + this.localMetadataReaderOrder = localMetadataReaderOrder; + return this; + } + + public LibraryOptions addLocalMetadataReaderOrderItem(String localMetadataReaderOrderItem) { + if (this.localMetadataReaderOrder == null) { + this.localMetadataReaderOrder = new ArrayList<>(); + } + this.localMetadataReaderOrder.add(localMetadataReaderOrderItem); + return this; + } + + /** + * Get localMetadataReaderOrder + * + * @return localMetadataReaderOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCAL_METADATA_READER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLocalMetadataReaderOrder() { + return localMetadataReaderOrder; + } + + @JsonProperty(JSON_PROPERTY_LOCAL_METADATA_READER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalMetadataReaderOrder(@org.eclipse.jdt.annotation.NonNull List localMetadataReaderOrder) { + this.localMetadataReaderOrder = localMetadataReaderOrder; + } + + public LibraryOptions disabledSubtitleFetchers( + @org.eclipse.jdt.annotation.NonNull List disabledSubtitleFetchers) { + this.disabledSubtitleFetchers = disabledSubtitleFetchers; + return this; + } + + public LibraryOptions addDisabledSubtitleFetchersItem(String disabledSubtitleFetchersItem) { + if (this.disabledSubtitleFetchers == null) { + this.disabledSubtitleFetchers = new ArrayList<>(); + } + this.disabledSubtitleFetchers.add(disabledSubtitleFetchersItem); + return this; + } + + /** + * Get disabledSubtitleFetchers + * + * @return disabledSubtitleFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISABLED_SUBTITLE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisabledSubtitleFetchers() { + return disabledSubtitleFetchers; + } + + @JsonProperty(JSON_PROPERTY_DISABLED_SUBTITLE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisabledSubtitleFetchers(@org.eclipse.jdt.annotation.NonNull List disabledSubtitleFetchers) { + this.disabledSubtitleFetchers = disabledSubtitleFetchers; + } + + public LibraryOptions subtitleFetcherOrder(@org.eclipse.jdt.annotation.NonNull List subtitleFetcherOrder) { + this.subtitleFetcherOrder = subtitleFetcherOrder; + return this; + } + + public LibraryOptions addSubtitleFetcherOrderItem(String subtitleFetcherOrderItem) { + if (this.subtitleFetcherOrder == null) { + this.subtitleFetcherOrder = new ArrayList<>(); + } + this.subtitleFetcherOrder.add(subtitleFetcherOrderItem); + return this; + } + + /** + * Get subtitleFetcherOrder + * + * @return subtitleFetcherOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSubtitleFetcherOrder() { + return subtitleFetcherOrder; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleFetcherOrder(@org.eclipse.jdt.annotation.NonNull List subtitleFetcherOrder) { + this.subtitleFetcherOrder = subtitleFetcherOrder; + } + + public LibraryOptions skipSubtitlesIfEmbeddedSubtitlesPresent( + @org.eclipse.jdt.annotation.NonNull Boolean skipSubtitlesIfEmbeddedSubtitlesPresent) { + this.skipSubtitlesIfEmbeddedSubtitlesPresent = skipSubtitlesIfEmbeddedSubtitlesPresent; + return this; + } + + /** + * Get skipSubtitlesIfEmbeddedSubtitlesPresent + * + * @return skipSubtitlesIfEmbeddedSubtitlesPresent + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SKIP_SUBTITLES_IF_EMBEDDED_SUBTITLES_PRESENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSkipSubtitlesIfEmbeddedSubtitlesPresent() { + return skipSubtitlesIfEmbeddedSubtitlesPresent; + } + + @JsonProperty(JSON_PROPERTY_SKIP_SUBTITLES_IF_EMBEDDED_SUBTITLES_PRESENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipSubtitlesIfEmbeddedSubtitlesPresent( + @org.eclipse.jdt.annotation.NonNull Boolean skipSubtitlesIfEmbeddedSubtitlesPresent) { + this.skipSubtitlesIfEmbeddedSubtitlesPresent = skipSubtitlesIfEmbeddedSubtitlesPresent; + } + + public LibraryOptions skipSubtitlesIfAudioTrackMatches( + @org.eclipse.jdt.annotation.NonNull Boolean skipSubtitlesIfAudioTrackMatches) { + this.skipSubtitlesIfAudioTrackMatches = skipSubtitlesIfAudioTrackMatches; + return this; + } + + /** + * Get skipSubtitlesIfAudioTrackMatches + * + * @return skipSubtitlesIfAudioTrackMatches + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SKIP_SUBTITLES_IF_AUDIO_TRACK_MATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSkipSubtitlesIfAudioTrackMatches() { + return skipSubtitlesIfAudioTrackMatches; + } + + @JsonProperty(JSON_PROPERTY_SKIP_SUBTITLES_IF_AUDIO_TRACK_MATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipSubtitlesIfAudioTrackMatches( + @org.eclipse.jdt.annotation.NonNull Boolean skipSubtitlesIfAudioTrackMatches) { + this.skipSubtitlesIfAudioTrackMatches = skipSubtitlesIfAudioTrackMatches; + } + + public LibraryOptions subtitleDownloadLanguages( + @org.eclipse.jdt.annotation.NonNull List subtitleDownloadLanguages) { + this.subtitleDownloadLanguages = subtitleDownloadLanguages; + return this; + } + + public LibraryOptions addSubtitleDownloadLanguagesItem(String subtitleDownloadLanguagesItem) { + if (this.subtitleDownloadLanguages == null) { + this.subtitleDownloadLanguages = new ArrayList<>(); + } + this.subtitleDownloadLanguages.add(subtitleDownloadLanguagesItem); + return this; + } + + /** + * Get subtitleDownloadLanguages + * + * @return subtitleDownloadLanguages + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_DOWNLOAD_LANGUAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSubtitleDownloadLanguages() { + return subtitleDownloadLanguages; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_DOWNLOAD_LANGUAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleDownloadLanguages( + @org.eclipse.jdt.annotation.NonNull List subtitleDownloadLanguages) { + this.subtitleDownloadLanguages = subtitleDownloadLanguages; + } + + public LibraryOptions requirePerfectSubtitleMatch( + @org.eclipse.jdt.annotation.NonNull Boolean requirePerfectSubtitleMatch) { + this.requirePerfectSubtitleMatch = requirePerfectSubtitleMatch; + return this; + } + + /** + * Get requirePerfectSubtitleMatch + * + * @return requirePerfectSubtitleMatch + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUIRE_PERFECT_SUBTITLE_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequirePerfectSubtitleMatch() { + return requirePerfectSubtitleMatch; + } + + @JsonProperty(JSON_PROPERTY_REQUIRE_PERFECT_SUBTITLE_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequirePerfectSubtitleMatch( + @org.eclipse.jdt.annotation.NonNull Boolean requirePerfectSubtitleMatch) { + this.requirePerfectSubtitleMatch = requirePerfectSubtitleMatch; + } + + public LibraryOptions saveSubtitlesWithMedia(@org.eclipse.jdt.annotation.NonNull Boolean saveSubtitlesWithMedia) { + this.saveSubtitlesWithMedia = saveSubtitlesWithMedia; + return this; + } + + /** + * Get saveSubtitlesWithMedia + * + * @return saveSubtitlesWithMedia + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SAVE_SUBTITLES_WITH_MEDIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSaveSubtitlesWithMedia() { + return saveSubtitlesWithMedia; + } + + @JsonProperty(JSON_PROPERTY_SAVE_SUBTITLES_WITH_MEDIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaveSubtitlesWithMedia(@org.eclipse.jdt.annotation.NonNull Boolean saveSubtitlesWithMedia) { + this.saveSubtitlesWithMedia = saveSubtitlesWithMedia; + } + + public LibraryOptions automaticallyAddToCollection( + @org.eclipse.jdt.annotation.NonNull Boolean automaticallyAddToCollection) { + this.automaticallyAddToCollection = automaticallyAddToCollection; + return this; + } + + /** + * Get automaticallyAddToCollection + * + * @return automaticallyAddToCollection + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTOMATICALLY_ADD_TO_COLLECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAutomaticallyAddToCollection() { + return automaticallyAddToCollection; + } + + @JsonProperty(JSON_PROPERTY_AUTOMATICALLY_ADD_TO_COLLECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAutomaticallyAddToCollection( + @org.eclipse.jdt.annotation.NonNull Boolean automaticallyAddToCollection) { + this.automaticallyAddToCollection = automaticallyAddToCollection; + } + + public LibraryOptions allowEmbeddedSubtitles( + @org.eclipse.jdt.annotation.NonNull EmbeddedSubtitleOptions allowEmbeddedSubtitles) { + this.allowEmbeddedSubtitles = allowEmbeddedSubtitles; + return this; + } + + /** + * An enum representing the options to disable embedded subs. + * + * @return allowEmbeddedSubtitles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_EMBEDDED_SUBTITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EmbeddedSubtitleOptions getAllowEmbeddedSubtitles() { + return allowEmbeddedSubtitles; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_EMBEDDED_SUBTITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowEmbeddedSubtitles( + @org.eclipse.jdt.annotation.NonNull EmbeddedSubtitleOptions allowEmbeddedSubtitles) { + this.allowEmbeddedSubtitles = allowEmbeddedSubtitles; + } + + public LibraryOptions typeOptions(@org.eclipse.jdt.annotation.NonNull List typeOptions) { + this.typeOptions = typeOptions; + return this; + } + + public LibraryOptions addTypeOptionsItem(TypeOptions typeOptionsItem) { + if (this.typeOptions == null) { + this.typeOptions = new ArrayList<>(); + } + this.typeOptions.add(typeOptionsItem); + return this; + } + + /** + * Get typeOptions + * + * @return typeOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTypeOptions() { + return typeOptions; + } + + @JsonProperty(JSON_PROPERTY_TYPE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTypeOptions(@org.eclipse.jdt.annotation.NonNull List typeOptions) { + this.typeOptions = typeOptions; + } + + /** + * Return true if this LibraryOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LibraryOptions libraryOptions = (LibraryOptions) o; + return Objects.equals(this.enablePhotos, libraryOptions.enablePhotos) + && Objects.equals(this.enableRealtimeMonitor, libraryOptions.enableRealtimeMonitor) + && Objects.equals(this.enableChapterImageExtraction, libraryOptions.enableChapterImageExtraction) + && Objects.equals(this.extractChapterImagesDuringLibraryScan, + libraryOptions.extractChapterImagesDuringLibraryScan) + && Objects.equals(this.pathInfos, libraryOptions.pathInfos) + && Objects.equals(this.saveLocalMetadata, libraryOptions.saveLocalMetadata) + && Objects.equals(this.enableInternetProviders, libraryOptions.enableInternetProviders) + && Objects.equals(this.enableAutomaticSeriesGrouping, libraryOptions.enableAutomaticSeriesGrouping) + && Objects.equals(this.enableEmbeddedTitles, libraryOptions.enableEmbeddedTitles) + && Objects.equals(this.enableEmbeddedEpisodeInfos, libraryOptions.enableEmbeddedEpisodeInfos) + && Objects.equals(this.automaticRefreshIntervalDays, libraryOptions.automaticRefreshIntervalDays) + && Objects.equals(this.preferredMetadataLanguage, libraryOptions.preferredMetadataLanguage) + && Objects.equals(this.metadataCountryCode, libraryOptions.metadataCountryCode) + && Objects.equals(this.seasonZeroDisplayName, libraryOptions.seasonZeroDisplayName) + && Objects.equals(this.metadataSavers, libraryOptions.metadataSavers) + && Objects.equals(this.disabledLocalMetadataReaders, libraryOptions.disabledLocalMetadataReaders) + && Objects.equals(this.localMetadataReaderOrder, libraryOptions.localMetadataReaderOrder) + && Objects.equals(this.disabledSubtitleFetchers, libraryOptions.disabledSubtitleFetchers) + && Objects.equals(this.subtitleFetcherOrder, libraryOptions.subtitleFetcherOrder) + && Objects.equals(this.skipSubtitlesIfEmbeddedSubtitlesPresent, + libraryOptions.skipSubtitlesIfEmbeddedSubtitlesPresent) + && Objects.equals(this.skipSubtitlesIfAudioTrackMatches, + libraryOptions.skipSubtitlesIfAudioTrackMatches) + && Objects.equals(this.subtitleDownloadLanguages, libraryOptions.subtitleDownloadLanguages) + && Objects.equals(this.requirePerfectSubtitleMatch, libraryOptions.requirePerfectSubtitleMatch) + && Objects.equals(this.saveSubtitlesWithMedia, libraryOptions.saveSubtitlesWithMedia) + && Objects.equals(this.automaticallyAddToCollection, libraryOptions.automaticallyAddToCollection) + && Objects.equals(this.allowEmbeddedSubtitles, libraryOptions.allowEmbeddedSubtitles) + && Objects.equals(this.typeOptions, libraryOptions.typeOptions); + } + + @Override + public int hashCode() { + return Objects.hash(enablePhotos, enableRealtimeMonitor, enableChapterImageExtraction, + extractChapterImagesDuringLibraryScan, pathInfos, saveLocalMetadata, enableInternetProviders, + enableAutomaticSeriesGrouping, enableEmbeddedTitles, enableEmbeddedEpisodeInfos, + automaticRefreshIntervalDays, preferredMetadataLanguage, metadataCountryCode, seasonZeroDisplayName, + metadataSavers, disabledLocalMetadataReaders, localMetadataReaderOrder, disabledSubtitleFetchers, + subtitleFetcherOrder, skipSubtitlesIfEmbeddedSubtitlesPresent, skipSubtitlesIfAudioTrackMatches, + subtitleDownloadLanguages, requirePerfectSubtitleMatch, saveSubtitlesWithMedia, + automaticallyAddToCollection, allowEmbeddedSubtitles, typeOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LibraryOptions {\n"); + sb.append(" enablePhotos: ").append(toIndentedString(enablePhotos)).append("\n"); + sb.append(" enableRealtimeMonitor: ").append(toIndentedString(enableRealtimeMonitor)).append("\n"); + sb.append(" enableChapterImageExtraction: ").append(toIndentedString(enableChapterImageExtraction)) + .append("\n"); + sb.append(" extractChapterImagesDuringLibraryScan: ") + .append(toIndentedString(extractChapterImagesDuringLibraryScan)).append("\n"); + sb.append(" pathInfos: ").append(toIndentedString(pathInfos)).append("\n"); + sb.append(" saveLocalMetadata: ").append(toIndentedString(saveLocalMetadata)).append("\n"); + sb.append(" enableInternetProviders: ").append(toIndentedString(enableInternetProviders)).append("\n"); + sb.append(" enableAutomaticSeriesGrouping: ").append(toIndentedString(enableAutomaticSeriesGrouping)) + .append("\n"); + sb.append(" enableEmbeddedTitles: ").append(toIndentedString(enableEmbeddedTitles)).append("\n"); + sb.append(" enableEmbeddedEpisodeInfos: ").append(toIndentedString(enableEmbeddedEpisodeInfos)).append("\n"); + sb.append(" automaticRefreshIntervalDays: ").append(toIndentedString(automaticRefreshIntervalDays)) + .append("\n"); + sb.append(" preferredMetadataLanguage: ").append(toIndentedString(preferredMetadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" seasonZeroDisplayName: ").append(toIndentedString(seasonZeroDisplayName)).append("\n"); + sb.append(" metadataSavers: ").append(toIndentedString(metadataSavers)).append("\n"); + sb.append(" disabledLocalMetadataReaders: ").append(toIndentedString(disabledLocalMetadataReaders)) + .append("\n"); + sb.append(" localMetadataReaderOrder: ").append(toIndentedString(localMetadataReaderOrder)).append("\n"); + sb.append(" disabledSubtitleFetchers: ").append(toIndentedString(disabledSubtitleFetchers)).append("\n"); + sb.append(" subtitleFetcherOrder: ").append(toIndentedString(subtitleFetcherOrder)).append("\n"); + sb.append(" skipSubtitlesIfEmbeddedSubtitlesPresent: ") + .append(toIndentedString(skipSubtitlesIfEmbeddedSubtitlesPresent)).append("\n"); + sb.append(" skipSubtitlesIfAudioTrackMatches: ").append(toIndentedString(skipSubtitlesIfAudioTrackMatches)) + .append("\n"); + sb.append(" subtitleDownloadLanguages: ").append(toIndentedString(subtitleDownloadLanguages)).append("\n"); + sb.append(" requirePerfectSubtitleMatch: ").append(toIndentedString(requirePerfectSubtitleMatch)) + .append("\n"); + sb.append(" saveSubtitlesWithMedia: ").append(toIndentedString(saveSubtitlesWithMedia)).append("\n"); + sb.append(" automaticallyAddToCollection: ").append(toIndentedString(automaticallyAddToCollection)) + .append("\n"); + sb.append(" allowEmbeddedSubtitles: ").append(toIndentedString(allowEmbeddedSubtitles)).append("\n"); + sb.append(" typeOptions: ").append(toIndentedString(typeOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `EnablePhotos` to the URL query string + if (getEnablePhotos() != null) { + joiner.add(String.format("%sEnablePhotos%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnablePhotos())))); + } + + // add `EnableRealtimeMonitor` to the URL query string + if (getEnableRealtimeMonitor() != null) { + joiner.add(String.format("%sEnableRealtimeMonitor%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableRealtimeMonitor())))); + } + + // add `EnableChapterImageExtraction` to the URL query string + if (getEnableChapterImageExtraction() != null) { + joiner.add(String.format("%sEnableChapterImageExtraction%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableChapterImageExtraction())))); + } + + // add `ExtractChapterImagesDuringLibraryScan` to the URL query string + if (getExtractChapterImagesDuringLibraryScan() != null) { + joiner.add(String.format("%sExtractChapterImagesDuringLibraryScan%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExtractChapterImagesDuringLibraryScan())))); + } + + // add `PathInfos` to the URL query string + if (getPathInfos() != null) { + for (int i = 0; i < getPathInfos().size(); i++) { + if (getPathInfos().get(i) != null) { + joiner.add(getPathInfos().get(i).toUrlQueryString(String.format("%sPathInfos%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `SaveLocalMetadata` to the URL query string + if (getSaveLocalMetadata() != null) { + joiner.add(String.format("%sSaveLocalMetadata%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSaveLocalMetadata())))); + } + + // add `EnableInternetProviders` to the URL query string + if (getEnableInternetProviders() != null) { + joiner.add(String.format("%sEnableInternetProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableInternetProviders())))); + } + + // add `EnableAutomaticSeriesGrouping` to the URL query string + if (getEnableAutomaticSeriesGrouping() != null) { + joiner.add(String.format("%sEnableAutomaticSeriesGrouping%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAutomaticSeriesGrouping())))); + } + + // add `EnableEmbeddedTitles` to the URL query string + if (getEnableEmbeddedTitles() != null) { + joiner.add(String.format("%sEnableEmbeddedTitles%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableEmbeddedTitles())))); + } + + // add `EnableEmbeddedEpisodeInfos` to the URL query string + if (getEnableEmbeddedEpisodeInfos() != null) { + joiner.add(String.format("%sEnableEmbeddedEpisodeInfos%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableEmbeddedEpisodeInfos())))); + } + + // add `AutomaticRefreshIntervalDays` to the URL query string + if (getAutomaticRefreshIntervalDays() != null) { + joiner.add(String.format("%sAutomaticRefreshIntervalDays%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAutomaticRefreshIntervalDays())))); + } + + // add `PreferredMetadataLanguage` to the URL query string + if (getPreferredMetadataLanguage() != null) { + joiner.add(String.format("%sPreferredMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreferredMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `SeasonZeroDisplayName` to the URL query string + if (getSeasonZeroDisplayName() != null) { + joiner.add(String.format("%sSeasonZeroDisplayName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeasonZeroDisplayName())))); + } + + // add `MetadataSavers` to the URL query string + if (getMetadataSavers() != null) { + for (int i = 0; i < getMetadataSavers().size(); i++) { + joiner.add(String.format("%sMetadataSavers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMetadataSavers().get(i))))); + } + } + + // add `DisabledLocalMetadataReaders` to the URL query string + if (getDisabledLocalMetadataReaders() != null) { + for (int i = 0; i < getDisabledLocalMetadataReaders().size(); i++) { + joiner.add(String.format("%sDisabledLocalMetadataReaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDisabledLocalMetadataReaders().get(i))))); + } + } + + // add `LocalMetadataReaderOrder` to the URL query string + if (getLocalMetadataReaderOrder() != null) { + for (int i = 0; i < getLocalMetadataReaderOrder().size(); i++) { + joiner.add(String.format("%sLocalMetadataReaderOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLocalMetadataReaderOrder().get(i))))); + } + } + + // add `DisabledSubtitleFetchers` to the URL query string + if (getDisabledSubtitleFetchers() != null) { + for (int i = 0; i < getDisabledSubtitleFetchers().size(); i++) { + joiner.add(String.format("%sDisabledSubtitleFetchers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDisabledSubtitleFetchers().get(i))))); + } + } + + // add `SubtitleFetcherOrder` to the URL query string + if (getSubtitleFetcherOrder() != null) { + for (int i = 0; i < getSubtitleFetcherOrder().size(); i++) { + joiner.add(String.format("%sSubtitleFetcherOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleFetcherOrder().get(i))))); + } + } + + // add `SkipSubtitlesIfEmbeddedSubtitlesPresent` to the URL query string + if (getSkipSubtitlesIfEmbeddedSubtitlesPresent() != null) { + joiner.add(String.format("%sSkipSubtitlesIfEmbeddedSubtitlesPresent%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSkipSubtitlesIfEmbeddedSubtitlesPresent())))); + } + + // add `SkipSubtitlesIfAudioTrackMatches` to the URL query string + if (getSkipSubtitlesIfAudioTrackMatches() != null) { + joiner.add(String.format("%sSkipSubtitlesIfAudioTrackMatches%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSkipSubtitlesIfAudioTrackMatches())))); + } + + // add `SubtitleDownloadLanguages` to the URL query string + if (getSubtitleDownloadLanguages() != null) { + for (int i = 0; i < getSubtitleDownloadLanguages().size(); i++) { + joiner.add(String.format("%sSubtitleDownloadLanguages%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleDownloadLanguages().get(i))))); + } + } + + // add `RequirePerfectSubtitleMatch` to the URL query string + if (getRequirePerfectSubtitleMatch() != null) { + joiner.add(String.format("%sRequirePerfectSubtitleMatch%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRequirePerfectSubtitleMatch())))); + } + + // add `SaveSubtitlesWithMedia` to the URL query string + if (getSaveSubtitlesWithMedia() != null) { + joiner.add(String.format("%sSaveSubtitlesWithMedia%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSaveSubtitlesWithMedia())))); + } + + // add `AutomaticallyAddToCollection` to the URL query string + if (getAutomaticallyAddToCollection() != null) { + joiner.add(String.format("%sAutomaticallyAddToCollection%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAutomaticallyAddToCollection())))); + } + + // add `AllowEmbeddedSubtitles` to the URL query string + if (getAllowEmbeddedSubtitles() != null) { + joiner.add(String.format("%sAllowEmbeddedSubtitles%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAllowEmbeddedSubtitles())))); + } + + // add `TypeOptions` to the URL query string + if (getTypeOptions() != null) { + for (int i = 0; i < getTypeOptions().size(); i++) { + if (getTypeOptions().get(i) != null) { + joiner.add(getTypeOptions().get(i).toUrlQueryString(String.format("%sTypeOptions%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private LibraryOptions instance; + + public Builder() { + this(new LibraryOptions()); + } + + protected Builder(LibraryOptions instance) { + this.instance = instance; + } + + public LibraryOptions.Builder enablePhotos(Boolean enablePhotos) { + this.instance.enablePhotos = enablePhotos; + return this; + } + + public LibraryOptions.Builder enableRealtimeMonitor(Boolean enableRealtimeMonitor) { + this.instance.enableRealtimeMonitor = enableRealtimeMonitor; + return this; + } + + public LibraryOptions.Builder enableChapterImageExtraction(Boolean enableChapterImageExtraction) { + this.instance.enableChapterImageExtraction = enableChapterImageExtraction; + return this; + } + + public LibraryOptions.Builder extractChapterImagesDuringLibraryScan( + Boolean extractChapterImagesDuringLibraryScan) { + this.instance.extractChapterImagesDuringLibraryScan = extractChapterImagesDuringLibraryScan; + return this; + } + + public LibraryOptions.Builder pathInfos(List pathInfos) { + this.instance.pathInfos = pathInfos; + return this; + } + + public LibraryOptions.Builder saveLocalMetadata(Boolean saveLocalMetadata) { + this.instance.saveLocalMetadata = saveLocalMetadata; + return this; + } + + public LibraryOptions.Builder enableInternetProviders(Boolean enableInternetProviders) { + this.instance.enableInternetProviders = enableInternetProviders; + return this; + } + + public LibraryOptions.Builder enableAutomaticSeriesGrouping(Boolean enableAutomaticSeriesGrouping) { + this.instance.enableAutomaticSeriesGrouping = enableAutomaticSeriesGrouping; + return this; + } + + public LibraryOptions.Builder enableEmbeddedTitles(Boolean enableEmbeddedTitles) { + this.instance.enableEmbeddedTitles = enableEmbeddedTitles; + return this; + } + + public LibraryOptions.Builder enableEmbeddedEpisodeInfos(Boolean enableEmbeddedEpisodeInfos) { + this.instance.enableEmbeddedEpisodeInfos = enableEmbeddedEpisodeInfos; + return this; + } + + public LibraryOptions.Builder automaticRefreshIntervalDays(Integer automaticRefreshIntervalDays) { + this.instance.automaticRefreshIntervalDays = automaticRefreshIntervalDays; + return this; + } + + public LibraryOptions.Builder preferredMetadataLanguage(String preferredMetadataLanguage) { + this.instance.preferredMetadataLanguage = preferredMetadataLanguage; + return this; + } + + public LibraryOptions.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public LibraryOptions.Builder seasonZeroDisplayName(String seasonZeroDisplayName) { + this.instance.seasonZeroDisplayName = seasonZeroDisplayName; + return this; + } + + public LibraryOptions.Builder metadataSavers(List metadataSavers) { + this.instance.metadataSavers = metadataSavers; + return this; + } + + public LibraryOptions.Builder disabledLocalMetadataReaders(List disabledLocalMetadataReaders) { + this.instance.disabledLocalMetadataReaders = disabledLocalMetadataReaders; + return this; + } + + public LibraryOptions.Builder localMetadataReaderOrder(List localMetadataReaderOrder) { + this.instance.localMetadataReaderOrder = localMetadataReaderOrder; + return this; + } + + public LibraryOptions.Builder disabledSubtitleFetchers(List disabledSubtitleFetchers) { + this.instance.disabledSubtitleFetchers = disabledSubtitleFetchers; + return this; + } + + public LibraryOptions.Builder subtitleFetcherOrder(List subtitleFetcherOrder) { + this.instance.subtitleFetcherOrder = subtitleFetcherOrder; + return this; + } + + public LibraryOptions.Builder skipSubtitlesIfEmbeddedSubtitlesPresent( + Boolean skipSubtitlesIfEmbeddedSubtitlesPresent) { + this.instance.skipSubtitlesIfEmbeddedSubtitlesPresent = skipSubtitlesIfEmbeddedSubtitlesPresent; + return this; + } + + public LibraryOptions.Builder skipSubtitlesIfAudioTrackMatches(Boolean skipSubtitlesIfAudioTrackMatches) { + this.instance.skipSubtitlesIfAudioTrackMatches = skipSubtitlesIfAudioTrackMatches; + return this; + } + + public LibraryOptions.Builder subtitleDownloadLanguages(List subtitleDownloadLanguages) { + this.instance.subtitleDownloadLanguages = subtitleDownloadLanguages; + return this; + } + + public LibraryOptions.Builder requirePerfectSubtitleMatch(Boolean requirePerfectSubtitleMatch) { + this.instance.requirePerfectSubtitleMatch = requirePerfectSubtitleMatch; + return this; + } + + public LibraryOptions.Builder saveSubtitlesWithMedia(Boolean saveSubtitlesWithMedia) { + this.instance.saveSubtitlesWithMedia = saveSubtitlesWithMedia; + return this; + } + + public LibraryOptions.Builder automaticallyAddToCollection(Boolean automaticallyAddToCollection) { + this.instance.automaticallyAddToCollection = automaticallyAddToCollection; + return this; + } + + public LibraryOptions.Builder allowEmbeddedSubtitles(EmbeddedSubtitleOptions allowEmbeddedSubtitles) { + this.instance.allowEmbeddedSubtitles = allowEmbeddedSubtitles; + return this; + } + + public LibraryOptions.Builder typeOptions(List typeOptions) { + this.instance.typeOptions = typeOptions; + return this; + } + + /** + * returns a built LibraryOptions instance. + * + * The builder is not reusable. + */ + public LibraryOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LibraryOptions.Builder builder() { + return new LibraryOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LibraryOptions.Builder toBuilder() { + return new LibraryOptions.Builder().enablePhotos(getEnablePhotos()) + .enableRealtimeMonitor(getEnableRealtimeMonitor()) + .enableChapterImageExtraction(getEnableChapterImageExtraction()) + .extractChapterImagesDuringLibraryScan(getExtractChapterImagesDuringLibraryScan()) + .pathInfos(getPathInfos()).saveLocalMetadata(getSaveLocalMetadata()) + .enableInternetProviders(getEnableInternetProviders()) + .enableAutomaticSeriesGrouping(getEnableAutomaticSeriesGrouping()) + .enableEmbeddedTitles(getEnableEmbeddedTitles()) + .enableEmbeddedEpisodeInfos(getEnableEmbeddedEpisodeInfos()) + .automaticRefreshIntervalDays(getAutomaticRefreshIntervalDays()) + .preferredMetadataLanguage(getPreferredMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .seasonZeroDisplayName(getSeasonZeroDisplayName()).metadataSavers(getMetadataSavers()) + .disabledLocalMetadataReaders(getDisabledLocalMetadataReaders()) + .localMetadataReaderOrder(getLocalMetadataReaderOrder()) + .disabledSubtitleFetchers(getDisabledSubtitleFetchers()).subtitleFetcherOrder(getSubtitleFetcherOrder()) + .skipSubtitlesIfEmbeddedSubtitlesPresent(getSkipSubtitlesIfEmbeddedSubtitlesPresent()) + .skipSubtitlesIfAudioTrackMatches(getSkipSubtitlesIfAudioTrackMatches()) + .subtitleDownloadLanguages(getSubtitleDownloadLanguages()) + .requirePerfectSubtitleMatch(getRequirePerfectSubtitleMatch()) + .saveSubtitlesWithMedia(getSaveSubtitlesWithMedia()) + .automaticallyAddToCollection(getAutomaticallyAddToCollection()) + .allowEmbeddedSubtitles(getAllowEmbeddedSubtitles()).typeOptions(getTypeOptions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryOptionsResultDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryOptionsResultDto.java new file mode 100644 index 0000000000000..194a1c9dc53ab --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryOptionsResultDto.java @@ -0,0 +1,372 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Library options result dto. + */ +@JsonPropertyOrder({ LibraryOptionsResultDto.JSON_PROPERTY_METADATA_SAVERS, + LibraryOptionsResultDto.JSON_PROPERTY_METADATA_READERS, LibraryOptionsResultDto.JSON_PROPERTY_SUBTITLE_FETCHERS, + LibraryOptionsResultDto.JSON_PROPERTY_TYPE_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LibraryOptionsResultDto { + public static final String JSON_PROPERTY_METADATA_SAVERS = "MetadataSavers"; + @org.eclipse.jdt.annotation.NonNull + private List metadataSavers = new ArrayList<>(); + + public static final String JSON_PROPERTY_METADATA_READERS = "MetadataReaders"; + @org.eclipse.jdt.annotation.NonNull + private List metadataReaders = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUBTITLE_FETCHERS = "SubtitleFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List subtitleFetchers = new ArrayList<>(); + + public static final String JSON_PROPERTY_TYPE_OPTIONS = "TypeOptions"; + @org.eclipse.jdt.annotation.NonNull + private List typeOptions = new ArrayList<>(); + + public LibraryOptionsResultDto() { + } + + public LibraryOptionsResultDto metadataSavers( + @org.eclipse.jdt.annotation.NonNull List metadataSavers) { + this.metadataSavers = metadataSavers; + return this; + } + + public LibraryOptionsResultDto addMetadataSaversItem(LibraryOptionInfoDto metadataSaversItem) { + if (this.metadataSavers == null) { + this.metadataSavers = new ArrayList<>(); + } + this.metadataSavers.add(metadataSaversItem); + return this; + } + + /** + * Gets or sets the metadata savers. + * + * @return metadataSavers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_SAVERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMetadataSavers() { + return metadataSavers; + } + + @JsonProperty(JSON_PROPERTY_METADATA_SAVERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataSavers(@org.eclipse.jdt.annotation.NonNull List metadataSavers) { + this.metadataSavers = metadataSavers; + } + + public LibraryOptionsResultDto metadataReaders( + @org.eclipse.jdt.annotation.NonNull List metadataReaders) { + this.metadataReaders = metadataReaders; + return this; + } + + public LibraryOptionsResultDto addMetadataReadersItem(LibraryOptionInfoDto metadataReadersItem) { + if (this.metadataReaders == null) { + this.metadataReaders = new ArrayList<>(); + } + this.metadataReaders.add(metadataReadersItem); + return this; + } + + /** + * Gets or sets the metadata readers. + * + * @return metadataReaders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_READERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMetadataReaders() { + return metadataReaders; + } + + @JsonProperty(JSON_PROPERTY_METADATA_READERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataReaders(@org.eclipse.jdt.annotation.NonNull List metadataReaders) { + this.metadataReaders = metadataReaders; + } + + public LibraryOptionsResultDto subtitleFetchers( + @org.eclipse.jdt.annotation.NonNull List subtitleFetchers) { + this.subtitleFetchers = subtitleFetchers; + return this; + } + + public LibraryOptionsResultDto addSubtitleFetchersItem(LibraryOptionInfoDto subtitleFetchersItem) { + if (this.subtitleFetchers == null) { + this.subtitleFetchers = new ArrayList<>(); + } + this.subtitleFetchers.add(subtitleFetchersItem); + return this; + } + + /** + * Gets or sets the subtitle fetchers. + * + * @return subtitleFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSubtitleFetchers() { + return subtitleFetchers; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleFetchers(@org.eclipse.jdt.annotation.NonNull List subtitleFetchers) { + this.subtitleFetchers = subtitleFetchers; + } + + public LibraryOptionsResultDto typeOptions( + @org.eclipse.jdt.annotation.NonNull List typeOptions) { + this.typeOptions = typeOptions; + return this; + } + + public LibraryOptionsResultDto addTypeOptionsItem(LibraryTypeOptionsDto typeOptionsItem) { + if (this.typeOptions == null) { + this.typeOptions = new ArrayList<>(); + } + this.typeOptions.add(typeOptionsItem); + return this; + } + + /** + * Gets or sets the type options. + * + * @return typeOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTypeOptions() { + return typeOptions; + } + + @JsonProperty(JSON_PROPERTY_TYPE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTypeOptions(@org.eclipse.jdt.annotation.NonNull List typeOptions) { + this.typeOptions = typeOptions; + } + + /** + * Return true if this LibraryOptionsResultDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LibraryOptionsResultDto libraryOptionsResultDto = (LibraryOptionsResultDto) o; + return Objects.equals(this.metadataSavers, libraryOptionsResultDto.metadataSavers) + && Objects.equals(this.metadataReaders, libraryOptionsResultDto.metadataReaders) + && Objects.equals(this.subtitleFetchers, libraryOptionsResultDto.subtitleFetchers) + && Objects.equals(this.typeOptions, libraryOptionsResultDto.typeOptions); + } + + @Override + public int hashCode() { + return Objects.hash(metadataSavers, metadataReaders, subtitleFetchers, typeOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LibraryOptionsResultDto {\n"); + sb.append(" metadataSavers: ").append(toIndentedString(metadataSavers)).append("\n"); + sb.append(" metadataReaders: ").append(toIndentedString(metadataReaders)).append("\n"); + sb.append(" subtitleFetchers: ").append(toIndentedString(subtitleFetchers)).append("\n"); + sb.append(" typeOptions: ").append(toIndentedString(typeOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MetadataSavers` to the URL query string + if (getMetadataSavers() != null) { + for (int i = 0; i < getMetadataSavers().size(); i++) { + if (getMetadataSavers().get(i) != null) { + joiner.add(getMetadataSavers().get(i).toUrlQueryString(String.format("%sMetadataSavers%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `MetadataReaders` to the URL query string + if (getMetadataReaders() != null) { + for (int i = 0; i < getMetadataReaders().size(); i++) { + if (getMetadataReaders().get(i) != null) { + joiner.add(getMetadataReaders().get(i).toUrlQueryString(String.format("%sMetadataReaders%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `SubtitleFetchers` to the URL query string + if (getSubtitleFetchers() != null) { + for (int i = 0; i < getSubtitleFetchers().size(); i++) { + if (getSubtitleFetchers().get(i) != null) { + joiner.add(getSubtitleFetchers().get(i).toUrlQueryString(String.format("%sSubtitleFetchers%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TypeOptions` to the URL query string + if (getTypeOptions() != null) { + for (int i = 0; i < getTypeOptions().size(); i++) { + if (getTypeOptions().get(i) != null) { + joiner.add(getTypeOptions().get(i).toUrlQueryString(String.format("%sTypeOptions%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private LibraryOptionsResultDto instance; + + public Builder() { + this(new LibraryOptionsResultDto()); + } + + protected Builder(LibraryOptionsResultDto instance) { + this.instance = instance; + } + + public LibraryOptionsResultDto.Builder metadataSavers(List metadataSavers) { + this.instance.metadataSavers = metadataSavers; + return this; + } + + public LibraryOptionsResultDto.Builder metadataReaders(List metadataReaders) { + this.instance.metadataReaders = metadataReaders; + return this; + } + + public LibraryOptionsResultDto.Builder subtitleFetchers(List subtitleFetchers) { + this.instance.subtitleFetchers = subtitleFetchers; + return this; + } + + public LibraryOptionsResultDto.Builder typeOptions(List typeOptions) { + this.instance.typeOptions = typeOptions; + return this; + } + + /** + * returns a built LibraryOptionsResultDto instance. + * + * The builder is not reusable. + */ + public LibraryOptionsResultDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LibraryOptionsResultDto.Builder builder() { + return new LibraryOptionsResultDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LibraryOptionsResultDto.Builder toBuilder() { + return new LibraryOptionsResultDto.Builder().metadataSavers(getMetadataSavers()) + .metadataReaders(getMetadataReaders()).subtitleFetchers(getSubtitleFetchers()) + .typeOptions(getTypeOptions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryTypeOptionsDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryTypeOptionsDto.java new file mode 100644 index 0000000000000..bc9f032d8cab1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryTypeOptionsDto.java @@ -0,0 +1,414 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Library type options dto. + */ +@JsonPropertyOrder({ LibraryTypeOptionsDto.JSON_PROPERTY_TYPE, LibraryTypeOptionsDto.JSON_PROPERTY_METADATA_FETCHERS, + LibraryTypeOptionsDto.JSON_PROPERTY_IMAGE_FETCHERS, LibraryTypeOptionsDto.JSON_PROPERTY_SUPPORTED_IMAGE_TYPES, + LibraryTypeOptionsDto.JSON_PROPERTY_DEFAULT_IMAGE_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LibraryTypeOptionsDto { + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_METADATA_FETCHERS = "MetadataFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List metadataFetchers = new ArrayList<>(); + + public static final String JSON_PROPERTY_IMAGE_FETCHERS = "ImageFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List imageFetchers = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUPPORTED_IMAGE_TYPES = "SupportedImageTypes"; + @org.eclipse.jdt.annotation.NonNull + private List supportedImageTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_DEFAULT_IMAGE_OPTIONS = "DefaultImageOptions"; + @org.eclipse.jdt.annotation.NonNull + private List defaultImageOptions = new ArrayList<>(); + + public LibraryTypeOptionsDto() { + } + + public LibraryTypeOptionsDto type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public LibraryTypeOptionsDto metadataFetchers( + @org.eclipse.jdt.annotation.NonNull List metadataFetchers) { + this.metadataFetchers = metadataFetchers; + return this; + } + + public LibraryTypeOptionsDto addMetadataFetchersItem(LibraryOptionInfoDto metadataFetchersItem) { + if (this.metadataFetchers == null) { + this.metadataFetchers = new ArrayList<>(); + } + this.metadataFetchers.add(metadataFetchersItem); + return this; + } + + /** + * Gets or sets the metadata fetchers. + * + * @return metadataFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMetadataFetchers() { + return metadataFetchers; + } + + @JsonProperty(JSON_PROPERTY_METADATA_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataFetchers(@org.eclipse.jdt.annotation.NonNull List metadataFetchers) { + this.metadataFetchers = metadataFetchers; + } + + public LibraryTypeOptionsDto imageFetchers( + @org.eclipse.jdt.annotation.NonNull List imageFetchers) { + this.imageFetchers = imageFetchers; + return this; + } + + public LibraryTypeOptionsDto addImageFetchersItem(LibraryOptionInfoDto imageFetchersItem) { + if (this.imageFetchers == null) { + this.imageFetchers = new ArrayList<>(); + } + this.imageFetchers.add(imageFetchersItem); + return this; + } + + /** + * Gets or sets the image fetchers. + * + * @return imageFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getImageFetchers() { + return imageFetchers; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageFetchers(@org.eclipse.jdt.annotation.NonNull List imageFetchers) { + this.imageFetchers = imageFetchers; + } + + public LibraryTypeOptionsDto supportedImageTypes( + @org.eclipse.jdt.annotation.NonNull List supportedImageTypes) { + this.supportedImageTypes = supportedImageTypes; + return this; + } + + public LibraryTypeOptionsDto addSupportedImageTypesItem(ImageType supportedImageTypesItem) { + if (this.supportedImageTypes == null) { + this.supportedImageTypes = new ArrayList<>(); + } + this.supportedImageTypes.add(supportedImageTypesItem); + return this; + } + + /** + * Gets or sets the supported image types. + * + * @return supportedImageTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTED_IMAGE_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSupportedImageTypes() { + return supportedImageTypes; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTED_IMAGE_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportedImageTypes(@org.eclipse.jdt.annotation.NonNull List supportedImageTypes) { + this.supportedImageTypes = supportedImageTypes; + } + + public LibraryTypeOptionsDto defaultImageOptions( + @org.eclipse.jdt.annotation.NonNull List defaultImageOptions) { + this.defaultImageOptions = defaultImageOptions; + return this; + } + + public LibraryTypeOptionsDto addDefaultImageOptionsItem(ImageOption defaultImageOptionsItem) { + if (this.defaultImageOptions == null) { + this.defaultImageOptions = new ArrayList<>(); + } + this.defaultImageOptions.add(defaultImageOptionsItem); + return this; + } + + /** + * Gets or sets the default image options. + * + * @return defaultImageOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEFAULT_IMAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDefaultImageOptions() { + return defaultImageOptions; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_IMAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultImageOptions(@org.eclipse.jdt.annotation.NonNull List defaultImageOptions) { + this.defaultImageOptions = defaultImageOptions; + } + + /** + * Return true if this LibraryTypeOptionsDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LibraryTypeOptionsDto libraryTypeOptionsDto = (LibraryTypeOptionsDto) o; + return Objects.equals(this.type, libraryTypeOptionsDto.type) + && Objects.equals(this.metadataFetchers, libraryTypeOptionsDto.metadataFetchers) + && Objects.equals(this.imageFetchers, libraryTypeOptionsDto.imageFetchers) + && Objects.equals(this.supportedImageTypes, libraryTypeOptionsDto.supportedImageTypes) + && Objects.equals(this.defaultImageOptions, libraryTypeOptionsDto.defaultImageOptions); + } + + @Override + public int hashCode() { + return Objects.hash(type, metadataFetchers, imageFetchers, supportedImageTypes, defaultImageOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LibraryTypeOptionsDto {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" metadataFetchers: ").append(toIndentedString(metadataFetchers)).append("\n"); + sb.append(" imageFetchers: ").append(toIndentedString(imageFetchers)).append("\n"); + sb.append(" supportedImageTypes: ").append(toIndentedString(supportedImageTypes)).append("\n"); + sb.append(" defaultImageOptions: ").append(toIndentedString(defaultImageOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `MetadataFetchers` to the URL query string + if (getMetadataFetchers() != null) { + for (int i = 0; i < getMetadataFetchers().size(); i++) { + if (getMetadataFetchers().get(i) != null) { + joiner.add(getMetadataFetchers().get(i).toUrlQueryString(String.format("%sMetadataFetchers%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ImageFetchers` to the URL query string + if (getImageFetchers() != null) { + for (int i = 0; i < getImageFetchers().size(); i++) { + if (getImageFetchers().get(i) != null) { + joiner.add(getImageFetchers().get(i).toUrlQueryString(String.format("%sImageFetchers%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `SupportedImageTypes` to the URL query string + if (getSupportedImageTypes() != null) { + for (int i = 0; i < getSupportedImageTypes().size(); i++) { + if (getSupportedImageTypes().get(i) != null) { + joiner.add(String.format("%sSupportedImageTypes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSupportedImageTypes().get(i))))); + } + } + } + + // add `DefaultImageOptions` to the URL query string + if (getDefaultImageOptions() != null) { + for (int i = 0; i < getDefaultImageOptions().size(); i++) { + if (getDefaultImageOptions().get(i) != null) { + joiner.add(getDefaultImageOptions().get(i).toUrlQueryString(String.format( + "%sDefaultImageOptions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private LibraryTypeOptionsDto instance; + + public Builder() { + this(new LibraryTypeOptionsDto()); + } + + protected Builder(LibraryTypeOptionsDto instance) { + this.instance = instance; + } + + public LibraryTypeOptionsDto.Builder type(String type) { + this.instance.type = type; + return this; + } + + public LibraryTypeOptionsDto.Builder metadataFetchers(List metadataFetchers) { + this.instance.metadataFetchers = metadataFetchers; + return this; + } + + public LibraryTypeOptionsDto.Builder imageFetchers(List imageFetchers) { + this.instance.imageFetchers = imageFetchers; + return this; + } + + public LibraryTypeOptionsDto.Builder supportedImageTypes(List supportedImageTypes) { + this.instance.supportedImageTypes = supportedImageTypes; + return this; + } + + public LibraryTypeOptionsDto.Builder defaultImageOptions(List defaultImageOptions) { + this.instance.defaultImageOptions = defaultImageOptions; + return this; + } + + /** + * returns a built LibraryTypeOptionsDto instance. + * + * The builder is not reusable. + */ + public LibraryTypeOptionsDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LibraryTypeOptionsDto.Builder builder() { + return new LibraryTypeOptionsDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LibraryTypeOptionsDto.Builder toBuilder() { + return new LibraryTypeOptionsDto.Builder().type(getType()).metadataFetchers(getMetadataFetchers()) + .imageFetchers(getImageFetchers()).supportedImageTypes(getSupportedImageTypes()) + .defaultImageOptions(getDefaultImageOptions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryUpdateInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryUpdateInfo.java new file mode 100644 index 0000000000000..4ed28886f0961 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LibraryUpdateInfo.java @@ -0,0 +1,502 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class LibraryUpdateInfo. + */ +@JsonPropertyOrder({ LibraryUpdateInfo.JSON_PROPERTY_FOLDERS_ADDED_TO, + LibraryUpdateInfo.JSON_PROPERTY_FOLDERS_REMOVED_FROM, LibraryUpdateInfo.JSON_PROPERTY_ITEMS_ADDED, + LibraryUpdateInfo.JSON_PROPERTY_ITEMS_REMOVED, LibraryUpdateInfo.JSON_PROPERTY_ITEMS_UPDATED, + LibraryUpdateInfo.JSON_PROPERTY_COLLECTION_FOLDERS, LibraryUpdateInfo.JSON_PROPERTY_IS_EMPTY }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LibraryUpdateInfo { + public static final String JSON_PROPERTY_FOLDERS_ADDED_TO = "FoldersAddedTo"; + @org.eclipse.jdt.annotation.NonNull + private List foldersAddedTo = new ArrayList<>(); + + public static final String JSON_PROPERTY_FOLDERS_REMOVED_FROM = "FoldersRemovedFrom"; + @org.eclipse.jdt.annotation.NonNull + private List foldersRemovedFrom = new ArrayList<>(); + + public static final String JSON_PROPERTY_ITEMS_ADDED = "ItemsAdded"; + @org.eclipse.jdt.annotation.NonNull + private List itemsAdded = new ArrayList<>(); + + public static final String JSON_PROPERTY_ITEMS_REMOVED = "ItemsRemoved"; + @org.eclipse.jdt.annotation.NonNull + private List itemsRemoved = new ArrayList<>(); + + public static final String JSON_PROPERTY_ITEMS_UPDATED = "ItemsUpdated"; + @org.eclipse.jdt.annotation.NonNull + private List itemsUpdated = new ArrayList<>(); + + public static final String JSON_PROPERTY_COLLECTION_FOLDERS = "CollectionFolders"; + @org.eclipse.jdt.annotation.NonNull + private List collectionFolders = new ArrayList<>(); + + public static final String JSON_PROPERTY_IS_EMPTY = "IsEmpty"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isEmpty; + + public LibraryUpdateInfo() { + } + + @JsonCreator + public LibraryUpdateInfo(@JsonProperty(JSON_PROPERTY_IS_EMPTY) Boolean isEmpty) { + this(); + this.isEmpty = isEmpty; + } + + public LibraryUpdateInfo foldersAddedTo(@org.eclipse.jdt.annotation.NonNull List foldersAddedTo) { + this.foldersAddedTo = foldersAddedTo; + return this; + } + + public LibraryUpdateInfo addFoldersAddedToItem(String foldersAddedToItem) { + if (this.foldersAddedTo == null) { + this.foldersAddedTo = new ArrayList<>(); + } + this.foldersAddedTo.add(foldersAddedToItem); + return this; + } + + /** + * Gets or sets the folders added to. + * + * @return foldersAddedTo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FOLDERS_ADDED_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFoldersAddedTo() { + return foldersAddedTo; + } + + @JsonProperty(JSON_PROPERTY_FOLDERS_ADDED_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFoldersAddedTo(@org.eclipse.jdt.annotation.NonNull List foldersAddedTo) { + this.foldersAddedTo = foldersAddedTo; + } + + public LibraryUpdateInfo foldersRemovedFrom(@org.eclipse.jdt.annotation.NonNull List foldersRemovedFrom) { + this.foldersRemovedFrom = foldersRemovedFrom; + return this; + } + + public LibraryUpdateInfo addFoldersRemovedFromItem(String foldersRemovedFromItem) { + if (this.foldersRemovedFrom == null) { + this.foldersRemovedFrom = new ArrayList<>(); + } + this.foldersRemovedFrom.add(foldersRemovedFromItem); + return this; + } + + /** + * Gets or sets the folders removed from. + * + * @return foldersRemovedFrom + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FOLDERS_REMOVED_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFoldersRemovedFrom() { + return foldersRemovedFrom; + } + + @JsonProperty(JSON_PROPERTY_FOLDERS_REMOVED_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFoldersRemovedFrom(@org.eclipse.jdt.annotation.NonNull List foldersRemovedFrom) { + this.foldersRemovedFrom = foldersRemovedFrom; + } + + public LibraryUpdateInfo itemsAdded(@org.eclipse.jdt.annotation.NonNull List itemsAdded) { + this.itemsAdded = itemsAdded; + return this; + } + + public LibraryUpdateInfo addItemsAddedItem(String itemsAddedItem) { + if (this.itemsAdded == null) { + this.itemsAdded = new ArrayList<>(); + } + this.itemsAdded.add(itemsAddedItem); + return this; + } + + /** + * Gets or sets the items added. + * + * @return itemsAdded + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS_ADDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItemsAdded() { + return itemsAdded; + } + + @JsonProperty(JSON_PROPERTY_ITEMS_ADDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemsAdded(@org.eclipse.jdt.annotation.NonNull List itemsAdded) { + this.itemsAdded = itemsAdded; + } + + public LibraryUpdateInfo itemsRemoved(@org.eclipse.jdt.annotation.NonNull List itemsRemoved) { + this.itemsRemoved = itemsRemoved; + return this; + } + + public LibraryUpdateInfo addItemsRemovedItem(String itemsRemovedItem) { + if (this.itemsRemoved == null) { + this.itemsRemoved = new ArrayList<>(); + } + this.itemsRemoved.add(itemsRemovedItem); + return this; + } + + /** + * Gets or sets the items removed. + * + * @return itemsRemoved + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS_REMOVED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItemsRemoved() { + return itemsRemoved; + } + + @JsonProperty(JSON_PROPERTY_ITEMS_REMOVED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemsRemoved(@org.eclipse.jdt.annotation.NonNull List itemsRemoved) { + this.itemsRemoved = itemsRemoved; + } + + public LibraryUpdateInfo itemsUpdated(@org.eclipse.jdt.annotation.NonNull List itemsUpdated) { + this.itemsUpdated = itemsUpdated; + return this; + } + + public LibraryUpdateInfo addItemsUpdatedItem(String itemsUpdatedItem) { + if (this.itemsUpdated == null) { + this.itemsUpdated = new ArrayList<>(); + } + this.itemsUpdated.add(itemsUpdatedItem); + return this; + } + + /** + * Gets or sets the items updated. + * + * @return itemsUpdated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS_UPDATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItemsUpdated() { + return itemsUpdated; + } + + @JsonProperty(JSON_PROPERTY_ITEMS_UPDATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemsUpdated(@org.eclipse.jdt.annotation.NonNull List itemsUpdated) { + this.itemsUpdated = itemsUpdated; + } + + public LibraryUpdateInfo collectionFolders(@org.eclipse.jdt.annotation.NonNull List collectionFolders) { + this.collectionFolders = collectionFolders; + return this; + } + + public LibraryUpdateInfo addCollectionFoldersItem(String collectionFoldersItem) { + if (this.collectionFolders == null) { + this.collectionFolders = new ArrayList<>(); + } + this.collectionFolders.add(collectionFoldersItem); + return this; + } + + /** + * Get collectionFolders + * + * @return collectionFolders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COLLECTION_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCollectionFolders() { + return collectionFolders; + } + + @JsonProperty(JSON_PROPERTY_COLLECTION_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCollectionFolders(@org.eclipse.jdt.annotation.NonNull List collectionFolders) { + this.collectionFolders = collectionFolders; + } + + /** + * Get isEmpty + * + * @return isEmpty + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_EMPTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsEmpty() { + return isEmpty; + } + + /** + * Return true if this LibraryUpdateInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LibraryUpdateInfo libraryUpdateInfo = (LibraryUpdateInfo) o; + return Objects.equals(this.foldersAddedTo, libraryUpdateInfo.foldersAddedTo) + && Objects.equals(this.foldersRemovedFrom, libraryUpdateInfo.foldersRemovedFrom) + && Objects.equals(this.itemsAdded, libraryUpdateInfo.itemsAdded) + && Objects.equals(this.itemsRemoved, libraryUpdateInfo.itemsRemoved) + && Objects.equals(this.itemsUpdated, libraryUpdateInfo.itemsUpdated) + && Objects.equals(this.collectionFolders, libraryUpdateInfo.collectionFolders) + && Objects.equals(this.isEmpty, libraryUpdateInfo.isEmpty); + } + + @Override + public int hashCode() { + return Objects.hash(foldersAddedTo, foldersRemovedFrom, itemsAdded, itemsRemoved, itemsUpdated, + collectionFolders, isEmpty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LibraryUpdateInfo {\n"); + sb.append(" foldersAddedTo: ").append(toIndentedString(foldersAddedTo)).append("\n"); + sb.append(" foldersRemovedFrom: ").append(toIndentedString(foldersRemovedFrom)).append("\n"); + sb.append(" itemsAdded: ").append(toIndentedString(itemsAdded)).append("\n"); + sb.append(" itemsRemoved: ").append(toIndentedString(itemsRemoved)).append("\n"); + sb.append(" itemsUpdated: ").append(toIndentedString(itemsUpdated)).append("\n"); + sb.append(" collectionFolders: ").append(toIndentedString(collectionFolders)).append("\n"); + sb.append(" isEmpty: ").append(toIndentedString(isEmpty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `FoldersAddedTo` to the URL query string + if (getFoldersAddedTo() != null) { + for (int i = 0; i < getFoldersAddedTo().size(); i++) { + joiner.add(String.format("%sFoldersAddedTo%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getFoldersAddedTo().get(i))))); + } + } + + // add `FoldersRemovedFrom` to the URL query string + if (getFoldersRemovedFrom() != null) { + for (int i = 0; i < getFoldersRemovedFrom().size(); i++) { + joiner.add(String.format("%sFoldersRemovedFrom%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getFoldersRemovedFrom().get(i))))); + } + } + + // add `ItemsAdded` to the URL query string + if (getItemsAdded() != null) { + for (int i = 0; i < getItemsAdded().size(); i++) { + joiner.add(String.format("%sItemsAdded%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getItemsAdded().get(i))))); + } + } + + // add `ItemsRemoved` to the URL query string + if (getItemsRemoved() != null) { + for (int i = 0; i < getItemsRemoved().size(); i++) { + joiner.add(String.format("%sItemsRemoved%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getItemsRemoved().get(i))))); + } + } + + // add `ItemsUpdated` to the URL query string + if (getItemsUpdated() != null) { + for (int i = 0; i < getItemsUpdated().size(); i++) { + joiner.add(String.format("%sItemsUpdated%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getItemsUpdated().get(i))))); + } + } + + // add `CollectionFolders` to the URL query string + if (getCollectionFolders() != null) { + for (int i = 0; i < getCollectionFolders().size(); i++) { + joiner.add(String.format("%sCollectionFolders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getCollectionFolders().get(i))))); + } + } + + // add `IsEmpty` to the URL query string + if (getIsEmpty() != null) { + joiner.add(String.format("%sIsEmpty%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsEmpty())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private LibraryUpdateInfo instance; + + public Builder() { + this(new LibraryUpdateInfo()); + } + + protected Builder(LibraryUpdateInfo instance) { + this.instance = instance; + } + + public LibraryUpdateInfo.Builder foldersAddedTo(List foldersAddedTo) { + this.instance.foldersAddedTo = foldersAddedTo; + return this; + } + + public LibraryUpdateInfo.Builder foldersRemovedFrom(List foldersRemovedFrom) { + this.instance.foldersRemovedFrom = foldersRemovedFrom; + return this; + } + + public LibraryUpdateInfo.Builder itemsAdded(List itemsAdded) { + this.instance.itemsAdded = itemsAdded; + return this; + } + + public LibraryUpdateInfo.Builder itemsRemoved(List itemsRemoved) { + this.instance.itemsRemoved = itemsRemoved; + return this; + } + + public LibraryUpdateInfo.Builder itemsUpdated(List itemsUpdated) { + this.instance.itemsUpdated = itemsUpdated; + return this; + } + + public LibraryUpdateInfo.Builder collectionFolders(List collectionFolders) { + this.instance.collectionFolders = collectionFolders; + return this; + } + + public LibraryUpdateInfo.Builder isEmpty(Boolean isEmpty) { + this.instance.isEmpty = isEmpty; + return this; + } + + /** + * returns a built LibraryUpdateInfo instance. + * + * The builder is not reusable. + */ + public LibraryUpdateInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LibraryUpdateInfo.Builder builder() { + return new LibraryUpdateInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LibraryUpdateInfo.Builder toBuilder() { + return new LibraryUpdateInfo.Builder().foldersAddedTo(getFoldersAddedTo()) + .foldersRemovedFrom(getFoldersRemovedFrom()).itemsAdded(getItemsAdded()).itemsRemoved(getItemsRemoved()) + .itemsUpdated(getItemsUpdated()).collectionFolders(getCollectionFolders()).isEmpty(getIsEmpty()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ListingsProviderInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ListingsProviderInfo.java new file mode 100644 index 0000000000000..4dbd68a1c9751 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ListingsProviderInfo.java @@ -0,0 +1,958 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ListingsProviderInfo + */ +@JsonPropertyOrder({ ListingsProviderInfo.JSON_PROPERTY_ID, ListingsProviderInfo.JSON_PROPERTY_TYPE, + ListingsProviderInfo.JSON_PROPERTY_USERNAME, ListingsProviderInfo.JSON_PROPERTY_PASSWORD, + ListingsProviderInfo.JSON_PROPERTY_LISTINGS_ID, ListingsProviderInfo.JSON_PROPERTY_ZIP_CODE, + ListingsProviderInfo.JSON_PROPERTY_COUNTRY, ListingsProviderInfo.JSON_PROPERTY_PATH, + ListingsProviderInfo.JSON_PROPERTY_ENABLED_TUNERS, ListingsProviderInfo.JSON_PROPERTY_ENABLE_ALL_TUNERS, + ListingsProviderInfo.JSON_PROPERTY_NEWS_CATEGORIES, ListingsProviderInfo.JSON_PROPERTY_SPORTS_CATEGORIES, + ListingsProviderInfo.JSON_PROPERTY_KIDS_CATEGORIES, ListingsProviderInfo.JSON_PROPERTY_MOVIE_CATEGORIES, + ListingsProviderInfo.JSON_PROPERTY_CHANNEL_MAPPINGS, ListingsProviderInfo.JSON_PROPERTY_MOVIE_PREFIX, + ListingsProviderInfo.JSON_PROPERTY_PREFERRED_LANGUAGE, ListingsProviderInfo.JSON_PROPERTY_USER_AGENT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ListingsProviderInfo { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_USERNAME = "Username"; + @org.eclipse.jdt.annotation.NonNull + private String username; + + public static final String JSON_PROPERTY_PASSWORD = "Password"; + @org.eclipse.jdt.annotation.NonNull + private String password; + + public static final String JSON_PROPERTY_LISTINGS_ID = "ListingsId"; + @org.eclipse.jdt.annotation.NonNull + private String listingsId; + + public static final String JSON_PROPERTY_ZIP_CODE = "ZipCode"; + @org.eclipse.jdt.annotation.NonNull + private String zipCode; + + public static final String JSON_PROPERTY_COUNTRY = "Country"; + @org.eclipse.jdt.annotation.NonNull + private String country; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_ENABLED_TUNERS = "EnabledTuners"; + @org.eclipse.jdt.annotation.NonNull + private List enabledTuners; + + public static final String JSON_PROPERTY_ENABLE_ALL_TUNERS = "EnableAllTuners"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAllTuners; + + public static final String JSON_PROPERTY_NEWS_CATEGORIES = "NewsCategories"; + @org.eclipse.jdt.annotation.NonNull + private List newsCategories; + + public static final String JSON_PROPERTY_SPORTS_CATEGORIES = "SportsCategories"; + @org.eclipse.jdt.annotation.NonNull + private List sportsCategories; + + public static final String JSON_PROPERTY_KIDS_CATEGORIES = "KidsCategories"; + @org.eclipse.jdt.annotation.NonNull + private List kidsCategories; + + public static final String JSON_PROPERTY_MOVIE_CATEGORIES = "MovieCategories"; + @org.eclipse.jdt.annotation.NonNull + private List movieCategories; + + public static final String JSON_PROPERTY_CHANNEL_MAPPINGS = "ChannelMappings"; + @org.eclipse.jdt.annotation.NonNull + private List channelMappings; + + public static final String JSON_PROPERTY_MOVIE_PREFIX = "MoviePrefix"; + @org.eclipse.jdt.annotation.NonNull + private String moviePrefix; + + public static final String JSON_PROPERTY_PREFERRED_LANGUAGE = "PreferredLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String preferredLanguage; + + public static final String JSON_PROPERTY_USER_AGENT = "UserAgent"; + @org.eclipse.jdt.annotation.NonNull + private String userAgent; + + public ListingsProviderInfo() { + } + + public ListingsProviderInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public ListingsProviderInfo type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public ListingsProviderInfo username(@org.eclipse.jdt.annotation.NonNull String username) { + this.username = username; + return this; + } + + /** + * Get username + * + * @return username + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; + } + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(@org.eclipse.jdt.annotation.NonNull String username) { + this.username = username; + } + + public ListingsProviderInfo password(@org.eclipse.jdt.annotation.NonNull String password) { + this.password = password; + return this; + } + + /** + * Get password + * + * @return password + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(@org.eclipse.jdt.annotation.NonNull String password) { + this.password = password; + } + + public ListingsProviderInfo listingsId(@org.eclipse.jdt.annotation.NonNull String listingsId) { + this.listingsId = listingsId; + return this; + } + + /** + * Get listingsId + * + * @return listingsId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LISTINGS_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getListingsId() { + return listingsId; + } + + @JsonProperty(JSON_PROPERTY_LISTINGS_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setListingsId(@org.eclipse.jdt.annotation.NonNull String listingsId) { + this.listingsId = listingsId; + } + + public ListingsProviderInfo zipCode(@org.eclipse.jdt.annotation.NonNull String zipCode) { + this.zipCode = zipCode; + return this; + } + + /** + * Get zipCode + * + * @return zipCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ZIP_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getZipCode() { + return zipCode; + } + + @JsonProperty(JSON_PROPERTY_ZIP_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setZipCode(@org.eclipse.jdt.annotation.NonNull String zipCode) { + this.zipCode = zipCode; + } + + public ListingsProviderInfo country(@org.eclipse.jdt.annotation.NonNull String country) { + this.country = country; + return this; + } + + /** + * Get country + * + * @return country + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCountry() { + return country; + } + + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCountry(@org.eclipse.jdt.annotation.NonNull String country) { + this.country = country; + } + + public ListingsProviderInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Get path + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public ListingsProviderInfo enabledTuners(@org.eclipse.jdt.annotation.NonNull List enabledTuners) { + this.enabledTuners = enabledTuners; + return this; + } + + public ListingsProviderInfo addEnabledTunersItem(String enabledTunersItem) { + if (this.enabledTuners == null) { + this.enabledTuners = new ArrayList<>(); + } + this.enabledTuners.add(enabledTunersItem); + return this; + } + + /** + * Get enabledTuners + * + * @return enabledTuners + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLED_TUNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnabledTuners() { + return enabledTuners; + } + + @JsonProperty(JSON_PROPERTY_ENABLED_TUNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabledTuners(@org.eclipse.jdt.annotation.NonNull List enabledTuners) { + this.enabledTuners = enabledTuners; + } + + public ListingsProviderInfo enableAllTuners(@org.eclipse.jdt.annotation.NonNull Boolean enableAllTuners) { + this.enableAllTuners = enableAllTuners; + return this; + } + + /** + * Get enableAllTuners + * + * @return enableAllTuners + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_ALL_TUNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAllTuners() { + return enableAllTuners; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_ALL_TUNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAllTuners(@org.eclipse.jdt.annotation.NonNull Boolean enableAllTuners) { + this.enableAllTuners = enableAllTuners; + } + + public ListingsProviderInfo newsCategories(@org.eclipse.jdt.annotation.NonNull List newsCategories) { + this.newsCategories = newsCategories; + return this; + } + + public ListingsProviderInfo addNewsCategoriesItem(String newsCategoriesItem) { + if (this.newsCategories == null) { + this.newsCategories = new ArrayList<>(); + } + this.newsCategories.add(newsCategoriesItem); + return this; + } + + /** + * Get newsCategories + * + * @return newsCategories + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NEWS_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNewsCategories() { + return newsCategories; + } + + @JsonProperty(JSON_PROPERTY_NEWS_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewsCategories(@org.eclipse.jdt.annotation.NonNull List newsCategories) { + this.newsCategories = newsCategories; + } + + public ListingsProviderInfo sportsCategories(@org.eclipse.jdt.annotation.NonNull List sportsCategories) { + this.sportsCategories = sportsCategories; + return this; + } + + public ListingsProviderInfo addSportsCategoriesItem(String sportsCategoriesItem) { + if (this.sportsCategories == null) { + this.sportsCategories = new ArrayList<>(); + } + this.sportsCategories.add(sportsCategoriesItem); + return this; + } + + /** + * Get sportsCategories + * + * @return sportsCategories + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SPORTS_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSportsCategories() { + return sportsCategories; + } + + @JsonProperty(JSON_PROPERTY_SPORTS_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSportsCategories(@org.eclipse.jdt.annotation.NonNull List sportsCategories) { + this.sportsCategories = sportsCategories; + } + + public ListingsProviderInfo kidsCategories(@org.eclipse.jdt.annotation.NonNull List kidsCategories) { + this.kidsCategories = kidsCategories; + return this; + } + + public ListingsProviderInfo addKidsCategoriesItem(String kidsCategoriesItem) { + if (this.kidsCategories == null) { + this.kidsCategories = new ArrayList<>(); + } + this.kidsCategories.add(kidsCategoriesItem); + return this; + } + + /** + * Get kidsCategories + * + * @return kidsCategories + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KIDS_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getKidsCategories() { + return kidsCategories; + } + + @JsonProperty(JSON_PROPERTY_KIDS_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKidsCategories(@org.eclipse.jdt.annotation.NonNull List kidsCategories) { + this.kidsCategories = kidsCategories; + } + + public ListingsProviderInfo movieCategories(@org.eclipse.jdt.annotation.NonNull List movieCategories) { + this.movieCategories = movieCategories; + return this; + } + + public ListingsProviderInfo addMovieCategoriesItem(String movieCategoriesItem) { + if (this.movieCategories == null) { + this.movieCategories = new ArrayList<>(); + } + this.movieCategories.add(movieCategoriesItem); + return this; + } + + /** + * Get movieCategories + * + * @return movieCategories + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MOVIE_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMovieCategories() { + return movieCategories; + } + + @JsonProperty(JSON_PROPERTY_MOVIE_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMovieCategories(@org.eclipse.jdt.annotation.NonNull List movieCategories) { + this.movieCategories = movieCategories; + } + + public ListingsProviderInfo channelMappings( + @org.eclipse.jdt.annotation.NonNull List channelMappings) { + this.channelMappings = channelMappings; + return this; + } + + public ListingsProviderInfo addChannelMappingsItem(NameValuePair channelMappingsItem) { + if (this.channelMappings == null) { + this.channelMappings = new ArrayList<>(); + } + this.channelMappings.add(channelMappingsItem); + return this; + } + + /** + * Get channelMappings + * + * @return channelMappings + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_MAPPINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getChannelMappings() { + return channelMappings; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_MAPPINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelMappings(@org.eclipse.jdt.annotation.NonNull List channelMappings) { + this.channelMappings = channelMappings; + } + + public ListingsProviderInfo moviePrefix(@org.eclipse.jdt.annotation.NonNull String moviePrefix) { + this.moviePrefix = moviePrefix; + return this; + } + + /** + * Get moviePrefix + * + * @return moviePrefix + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MOVIE_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMoviePrefix() { + return moviePrefix; + } + + @JsonProperty(JSON_PROPERTY_MOVIE_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMoviePrefix(@org.eclipse.jdt.annotation.NonNull String moviePrefix) { + this.moviePrefix = moviePrefix; + } + + public ListingsProviderInfo preferredLanguage(@org.eclipse.jdt.annotation.NonNull String preferredLanguage) { + this.preferredLanguage = preferredLanguage; + return this; + } + + /** + * Get preferredLanguage + * + * @return preferredLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREFERRED_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPreferredLanguage() { + return preferredLanguage; + } + + @JsonProperty(JSON_PROPERTY_PREFERRED_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreferredLanguage(@org.eclipse.jdt.annotation.NonNull String preferredLanguage) { + this.preferredLanguage = preferredLanguage; + } + + public ListingsProviderInfo userAgent(@org.eclipse.jdt.annotation.NonNull String userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + * Get userAgent + * + * @return userAgent + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_AGENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserAgent() { + return userAgent; + } + + @JsonProperty(JSON_PROPERTY_USER_AGENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserAgent(@org.eclipse.jdt.annotation.NonNull String userAgent) { + this.userAgent = userAgent; + } + + /** + * Return true if this ListingsProviderInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListingsProviderInfo listingsProviderInfo = (ListingsProviderInfo) o; + return Objects.equals(this.id, listingsProviderInfo.id) && Objects.equals(this.type, listingsProviderInfo.type) + && Objects.equals(this.username, listingsProviderInfo.username) + && Objects.equals(this.password, listingsProviderInfo.password) + && Objects.equals(this.listingsId, listingsProviderInfo.listingsId) + && Objects.equals(this.zipCode, listingsProviderInfo.zipCode) + && Objects.equals(this.country, listingsProviderInfo.country) + && Objects.equals(this.path, listingsProviderInfo.path) + && Objects.equals(this.enabledTuners, listingsProviderInfo.enabledTuners) + && Objects.equals(this.enableAllTuners, listingsProviderInfo.enableAllTuners) + && Objects.equals(this.newsCategories, listingsProviderInfo.newsCategories) + && Objects.equals(this.sportsCategories, listingsProviderInfo.sportsCategories) + && Objects.equals(this.kidsCategories, listingsProviderInfo.kidsCategories) + && Objects.equals(this.movieCategories, listingsProviderInfo.movieCategories) + && Objects.equals(this.channelMappings, listingsProviderInfo.channelMappings) + && Objects.equals(this.moviePrefix, listingsProviderInfo.moviePrefix) + && Objects.equals(this.preferredLanguage, listingsProviderInfo.preferredLanguage) + && Objects.equals(this.userAgent, listingsProviderInfo.userAgent); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, username, password, listingsId, zipCode, country, path, enabledTuners, + enableAllTuners, newsCategories, sportsCategories, kidsCategories, movieCategories, channelMappings, + moviePrefix, preferredLanguage, userAgent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListingsProviderInfo {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" listingsId: ").append(toIndentedString(listingsId)).append("\n"); + sb.append(" zipCode: ").append(toIndentedString(zipCode)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" enabledTuners: ").append(toIndentedString(enabledTuners)).append("\n"); + sb.append(" enableAllTuners: ").append(toIndentedString(enableAllTuners)).append("\n"); + sb.append(" newsCategories: ").append(toIndentedString(newsCategories)).append("\n"); + sb.append(" sportsCategories: ").append(toIndentedString(sportsCategories)).append("\n"); + sb.append(" kidsCategories: ").append(toIndentedString(kidsCategories)).append("\n"); + sb.append(" movieCategories: ").append(toIndentedString(movieCategories)).append("\n"); + sb.append(" channelMappings: ").append(toIndentedString(channelMappings)).append("\n"); + sb.append(" moviePrefix: ").append(toIndentedString(moviePrefix)).append("\n"); + sb.append(" preferredLanguage: ").append(toIndentedString(preferredLanguage)).append("\n"); + sb.append(" userAgent: ").append(toIndentedString(userAgent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `Username` to the URL query string + if (getUsername() != null) { + joiner.add(String.format("%sUsername%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUsername())))); + } + + // add `Password` to the URL query string + if (getPassword() != null) { + joiner.add(String.format("%sPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPassword())))); + } + + // add `ListingsId` to the URL query string + if (getListingsId() != null) { + joiner.add(String.format("%sListingsId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getListingsId())))); + } + + // add `ZipCode` to the URL query string + if (getZipCode() != null) { + joiner.add(String.format("%sZipCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getZipCode())))); + } + + // add `Country` to the URL query string + if (getCountry() != null) { + joiner.add(String.format("%sCountry%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCountry())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `EnabledTuners` to the URL query string + if (getEnabledTuners() != null) { + for (int i = 0; i < getEnabledTuners().size(); i++) { + joiner.add(String.format("%sEnabledTuners%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEnabledTuners().get(i))))); + } + } + + // add `EnableAllTuners` to the URL query string + if (getEnableAllTuners() != null) { + joiner.add(String.format("%sEnableAllTuners%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAllTuners())))); + } + + // add `NewsCategories` to the URL query string + if (getNewsCategories() != null) { + for (int i = 0; i < getNewsCategories().size(); i++) { + joiner.add(String.format("%sNewsCategories%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getNewsCategories().get(i))))); + } + } + + // add `SportsCategories` to the URL query string + if (getSportsCategories() != null) { + for (int i = 0; i < getSportsCategories().size(); i++) { + joiner.add(String.format("%sSportsCategories%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSportsCategories().get(i))))); + } + } + + // add `KidsCategories` to the URL query string + if (getKidsCategories() != null) { + for (int i = 0; i < getKidsCategories().size(); i++) { + joiner.add(String.format("%sKidsCategories%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getKidsCategories().get(i))))); + } + } + + // add `MovieCategories` to the URL query string + if (getMovieCategories() != null) { + for (int i = 0; i < getMovieCategories().size(); i++) { + joiner.add(String.format("%sMovieCategories%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMovieCategories().get(i))))); + } + } + + // add `ChannelMappings` to the URL query string + if (getChannelMappings() != null) { + for (int i = 0; i < getChannelMappings().size(); i++) { + if (getChannelMappings().get(i) != null) { + joiner.add(getChannelMappings().get(i).toUrlQueryString(String.format("%sChannelMappings%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `MoviePrefix` to the URL query string + if (getMoviePrefix() != null) { + joiner.add(String.format("%sMoviePrefix%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMoviePrefix())))); + } + + // add `PreferredLanguage` to the URL query string + if (getPreferredLanguage() != null) { + joiner.add(String.format("%sPreferredLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreferredLanguage())))); + } + + // add `UserAgent` to the URL query string + if (getUserAgent() != null) { + joiner.add(String.format("%sUserAgent%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserAgent())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ListingsProviderInfo instance; + + public Builder() { + this(new ListingsProviderInfo()); + } + + protected Builder(ListingsProviderInfo instance) { + this.instance = instance; + } + + public ListingsProviderInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public ListingsProviderInfo.Builder type(String type) { + this.instance.type = type; + return this; + } + + public ListingsProviderInfo.Builder username(String username) { + this.instance.username = username; + return this; + } + + public ListingsProviderInfo.Builder password(String password) { + this.instance.password = password; + return this; + } + + public ListingsProviderInfo.Builder listingsId(String listingsId) { + this.instance.listingsId = listingsId; + return this; + } + + public ListingsProviderInfo.Builder zipCode(String zipCode) { + this.instance.zipCode = zipCode; + return this; + } + + public ListingsProviderInfo.Builder country(String country) { + this.instance.country = country; + return this; + } + + public ListingsProviderInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public ListingsProviderInfo.Builder enabledTuners(List enabledTuners) { + this.instance.enabledTuners = enabledTuners; + return this; + } + + public ListingsProviderInfo.Builder enableAllTuners(Boolean enableAllTuners) { + this.instance.enableAllTuners = enableAllTuners; + return this; + } + + public ListingsProviderInfo.Builder newsCategories(List newsCategories) { + this.instance.newsCategories = newsCategories; + return this; + } + + public ListingsProviderInfo.Builder sportsCategories(List sportsCategories) { + this.instance.sportsCategories = sportsCategories; + return this; + } + + public ListingsProviderInfo.Builder kidsCategories(List kidsCategories) { + this.instance.kidsCategories = kidsCategories; + return this; + } + + public ListingsProviderInfo.Builder movieCategories(List movieCategories) { + this.instance.movieCategories = movieCategories; + return this; + } + + public ListingsProviderInfo.Builder channelMappings(List channelMappings) { + this.instance.channelMappings = channelMappings; + return this; + } + + public ListingsProviderInfo.Builder moviePrefix(String moviePrefix) { + this.instance.moviePrefix = moviePrefix; + return this; + } + + public ListingsProviderInfo.Builder preferredLanguage(String preferredLanguage) { + this.instance.preferredLanguage = preferredLanguage; + return this; + } + + public ListingsProviderInfo.Builder userAgent(String userAgent) { + this.instance.userAgent = userAgent; + return this; + } + + /** + * returns a built ListingsProviderInfo instance. + * + * The builder is not reusable. + */ + public ListingsProviderInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ListingsProviderInfo.Builder builder() { + return new ListingsProviderInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ListingsProviderInfo.Builder toBuilder() { + return new ListingsProviderInfo.Builder().id(getId()).type(getType()).username(getUsername()) + .password(getPassword()).listingsId(getListingsId()).zipCode(getZipCode()).country(getCountry()) + .path(getPath()).enabledTuners(getEnabledTuners()).enableAllTuners(getEnableAllTuners()) + .newsCategories(getNewsCategories()).sportsCategories(getSportsCategories()) + .kidsCategories(getKidsCategories()).movieCategories(getMovieCategories()) + .channelMappings(getChannelMappings()).moviePrefix(getMoviePrefix()) + .preferredLanguage(getPreferredLanguage()).userAgent(getUserAgent()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveStreamResponse.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveStreamResponse.java new file mode 100644 index 0000000000000..9fd80f6065eec --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveStreamResponse.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * LiveStreamResponse + */ +@JsonPropertyOrder({ LiveStreamResponse.JSON_PROPERTY_MEDIA_SOURCE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LiveStreamResponse { + public static final String JSON_PROPERTY_MEDIA_SOURCE = "MediaSource"; + @org.eclipse.jdt.annotation.NonNull + private MediaSourceInfo mediaSource; + + public LiveStreamResponse() { + } + + public LiveStreamResponse mediaSource(@org.eclipse.jdt.annotation.NonNull MediaSourceInfo mediaSource) { + this.mediaSource = mediaSource; + return this; + } + + /** + * Get mediaSource + * + * @return mediaSource + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaSourceInfo getMediaSource() { + return mediaSource; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSource(@org.eclipse.jdt.annotation.NonNull MediaSourceInfo mediaSource) { + this.mediaSource = mediaSource; + } + + /** + * Return true if this LiveStreamResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LiveStreamResponse liveStreamResponse = (LiveStreamResponse) o; + return Objects.equals(this.mediaSource, liveStreamResponse.mediaSource); + } + + @Override + public int hashCode() { + return Objects.hash(mediaSource); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LiveStreamResponse {\n"); + sb.append(" mediaSource: ").append(toIndentedString(mediaSource)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MediaSource` to the URL query string + if (getMediaSource() != null) { + joiner.add(getMediaSource().toUrlQueryString(prefix + "MediaSource" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private LiveStreamResponse instance; + + public Builder() { + this(new LiveStreamResponse()); + } + + protected Builder(LiveStreamResponse instance) { + this.instance = instance; + } + + public LiveStreamResponse.Builder mediaSource(MediaSourceInfo mediaSource) { + this.instance.mediaSource = mediaSource; + return this; + } + + /** + * returns a built LiveStreamResponse instance. + * + * The builder is not reusable. + */ + public LiveStreamResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LiveStreamResponse.Builder builder() { + return new LiveStreamResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LiveStreamResponse.Builder toBuilder() { + return new LiveStreamResponse.Builder().mediaSource(getMediaSource()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveTvInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveTvInfo.java new file mode 100644 index 0000000000000..b973c0e5d866f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveTvInfo.java @@ -0,0 +1,299 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * LiveTvInfo + */ +@JsonPropertyOrder({ LiveTvInfo.JSON_PROPERTY_SERVICES, LiveTvInfo.JSON_PROPERTY_IS_ENABLED, + LiveTvInfo.JSON_PROPERTY_ENABLED_USERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LiveTvInfo { + public static final String JSON_PROPERTY_SERVICES = "Services"; + @org.eclipse.jdt.annotation.NonNull + private List services = new ArrayList<>(); + + public static final String JSON_PROPERTY_IS_ENABLED = "IsEnabled"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isEnabled; + + public static final String JSON_PROPERTY_ENABLED_USERS = "EnabledUsers"; + @org.eclipse.jdt.annotation.NonNull + private List enabledUsers = new ArrayList<>(); + + public LiveTvInfo() { + } + + public LiveTvInfo services(@org.eclipse.jdt.annotation.NonNull List services) { + this.services = services; + return this; + } + + public LiveTvInfo addServicesItem(LiveTvServiceInfo servicesItem) { + if (this.services == null) { + this.services = new ArrayList<>(); + } + this.services.add(servicesItem); + return this; + } + + /** + * Gets or sets the services. + * + * @return services + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getServices() { + return services; + } + + @JsonProperty(JSON_PROPERTY_SERVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServices(@org.eclipse.jdt.annotation.NonNull List services) { + this.services = services; + } + + public LiveTvInfo isEnabled(@org.eclipse.jdt.annotation.NonNull Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is enabled. + * + * @return isEnabled + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsEnabled() { + return isEnabled; + } + + @JsonProperty(JSON_PROPERTY_IS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsEnabled(@org.eclipse.jdt.annotation.NonNull Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + public LiveTvInfo enabledUsers(@org.eclipse.jdt.annotation.NonNull List enabledUsers) { + this.enabledUsers = enabledUsers; + return this; + } + + public LiveTvInfo addEnabledUsersItem(String enabledUsersItem) { + if (this.enabledUsers == null) { + this.enabledUsers = new ArrayList<>(); + } + this.enabledUsers.add(enabledUsersItem); + return this; + } + + /** + * Gets or sets the enabled users. + * + * @return enabledUsers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLED_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnabledUsers() { + return enabledUsers; + } + + @JsonProperty(JSON_PROPERTY_ENABLED_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabledUsers(@org.eclipse.jdt.annotation.NonNull List enabledUsers) { + this.enabledUsers = enabledUsers; + } + + /** + * Return true if this LiveTvInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LiveTvInfo liveTvInfo = (LiveTvInfo) o; + return Objects.equals(this.services, liveTvInfo.services) + && Objects.equals(this.isEnabled, liveTvInfo.isEnabled) + && Objects.equals(this.enabledUsers, liveTvInfo.enabledUsers); + } + + @Override + public int hashCode() { + return Objects.hash(services, isEnabled, enabledUsers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LiveTvInfo {\n"); + sb.append(" services: ").append(toIndentedString(services)).append("\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" enabledUsers: ").append(toIndentedString(enabledUsers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Services` to the URL query string + if (getServices() != null) { + for (int i = 0; i < getServices().size(); i++) { + if (getServices().get(i) != null) { + joiner.add(getServices().get(i).toUrlQueryString(String.format("%sServices%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `IsEnabled` to the URL query string + if (getIsEnabled() != null) { + joiner.add(String.format("%sIsEnabled%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsEnabled())))); + } + + // add `EnabledUsers` to the URL query string + if (getEnabledUsers() != null) { + for (int i = 0; i < getEnabledUsers().size(); i++) { + joiner.add(String.format("%sEnabledUsers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEnabledUsers().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private LiveTvInfo instance; + + public Builder() { + this(new LiveTvInfo()); + } + + protected Builder(LiveTvInfo instance) { + this.instance = instance; + } + + public LiveTvInfo.Builder services(List services) { + this.instance.services = services; + return this; + } + + public LiveTvInfo.Builder isEnabled(Boolean isEnabled) { + this.instance.isEnabled = isEnabled; + return this; + } + + public LiveTvInfo.Builder enabledUsers(List enabledUsers) { + this.instance.enabledUsers = enabledUsers; + return this; + } + + /** + * returns a built LiveTvInfo instance. + * + * The builder is not reusable. + */ + public LiveTvInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LiveTvInfo.Builder builder() { + return new LiveTvInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LiveTvInfo.Builder toBuilder() { + return new LiveTvInfo.Builder().services(getServices()).isEnabled(getIsEnabled()) + .enabledUsers(getEnabledUsers()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveTvOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveTvOptions.java new file mode 100644 index 0000000000000..3ac2e0f776fb1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveTvOptions.java @@ -0,0 +1,737 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * LiveTvOptions + */ +@JsonPropertyOrder({ LiveTvOptions.JSON_PROPERTY_GUIDE_DAYS, LiveTvOptions.JSON_PROPERTY_RECORDING_PATH, + LiveTvOptions.JSON_PROPERTY_MOVIE_RECORDING_PATH, LiveTvOptions.JSON_PROPERTY_SERIES_RECORDING_PATH, + LiveTvOptions.JSON_PROPERTY_ENABLE_RECORDING_SUBFOLDERS, + LiveTvOptions.JSON_PROPERTY_ENABLE_ORIGINAL_AUDIO_WITH_ENCODED_RECORDINGS, + LiveTvOptions.JSON_PROPERTY_TUNER_HOSTS, LiveTvOptions.JSON_PROPERTY_LISTING_PROVIDERS, + LiveTvOptions.JSON_PROPERTY_PRE_PADDING_SECONDS, LiveTvOptions.JSON_PROPERTY_POST_PADDING_SECONDS, + LiveTvOptions.JSON_PROPERTY_MEDIA_LOCATIONS_CREATED, LiveTvOptions.JSON_PROPERTY_RECORDING_POST_PROCESSOR, + LiveTvOptions.JSON_PROPERTY_RECORDING_POST_PROCESSOR_ARGUMENTS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LiveTvOptions { + public static final String JSON_PROPERTY_GUIDE_DAYS = "GuideDays"; + @org.eclipse.jdt.annotation.NonNull + private Integer guideDays; + + public static final String JSON_PROPERTY_RECORDING_PATH = "RecordingPath"; + @org.eclipse.jdt.annotation.NonNull + private String recordingPath; + + public static final String JSON_PROPERTY_MOVIE_RECORDING_PATH = "MovieRecordingPath"; + @org.eclipse.jdt.annotation.NonNull + private String movieRecordingPath; + + public static final String JSON_PROPERTY_SERIES_RECORDING_PATH = "SeriesRecordingPath"; + @org.eclipse.jdt.annotation.NonNull + private String seriesRecordingPath; + + public static final String JSON_PROPERTY_ENABLE_RECORDING_SUBFOLDERS = "EnableRecordingSubfolders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableRecordingSubfolders; + + public static final String JSON_PROPERTY_ENABLE_ORIGINAL_AUDIO_WITH_ENCODED_RECORDINGS = "EnableOriginalAudioWithEncodedRecordings"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableOriginalAudioWithEncodedRecordings; + + public static final String JSON_PROPERTY_TUNER_HOSTS = "TunerHosts"; + @org.eclipse.jdt.annotation.NonNull + private List tunerHosts; + + public static final String JSON_PROPERTY_LISTING_PROVIDERS = "ListingProviders"; + @org.eclipse.jdt.annotation.NonNull + private List listingProviders; + + public static final String JSON_PROPERTY_PRE_PADDING_SECONDS = "PrePaddingSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer prePaddingSeconds; + + public static final String JSON_PROPERTY_POST_PADDING_SECONDS = "PostPaddingSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer postPaddingSeconds; + + public static final String JSON_PROPERTY_MEDIA_LOCATIONS_CREATED = "MediaLocationsCreated"; + @org.eclipse.jdt.annotation.NonNull + private List mediaLocationsCreated; + + public static final String JSON_PROPERTY_RECORDING_POST_PROCESSOR = "RecordingPostProcessor"; + @org.eclipse.jdt.annotation.NonNull + private String recordingPostProcessor; + + public static final String JSON_PROPERTY_RECORDING_POST_PROCESSOR_ARGUMENTS = "RecordingPostProcessorArguments"; + @org.eclipse.jdt.annotation.NonNull + private String recordingPostProcessorArguments; + + public LiveTvOptions() { + } + + public LiveTvOptions guideDays(@org.eclipse.jdt.annotation.NonNull Integer guideDays) { + this.guideDays = guideDays; + return this; + } + + /** + * Get guideDays + * + * @return guideDays + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GUIDE_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getGuideDays() { + return guideDays; + } + + @JsonProperty(JSON_PROPERTY_GUIDE_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGuideDays(@org.eclipse.jdt.annotation.NonNull Integer guideDays) { + this.guideDays = guideDays; + } + + public LiveTvOptions recordingPath(@org.eclipse.jdt.annotation.NonNull String recordingPath) { + this.recordingPath = recordingPath; + return this; + } + + /** + * Get recordingPath + * + * @return recordingPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RECORDING_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRecordingPath() { + return recordingPath; + } + + @JsonProperty(JSON_PROPERTY_RECORDING_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecordingPath(@org.eclipse.jdt.annotation.NonNull String recordingPath) { + this.recordingPath = recordingPath; + } + + public LiveTvOptions movieRecordingPath(@org.eclipse.jdt.annotation.NonNull String movieRecordingPath) { + this.movieRecordingPath = movieRecordingPath; + return this; + } + + /** + * Get movieRecordingPath + * + * @return movieRecordingPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MOVIE_RECORDING_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMovieRecordingPath() { + return movieRecordingPath; + } + + @JsonProperty(JSON_PROPERTY_MOVIE_RECORDING_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMovieRecordingPath(@org.eclipse.jdt.annotation.NonNull String movieRecordingPath) { + this.movieRecordingPath = movieRecordingPath; + } + + public LiveTvOptions seriesRecordingPath(@org.eclipse.jdt.annotation.NonNull String seriesRecordingPath) { + this.seriesRecordingPath = seriesRecordingPath; + return this; + } + + /** + * Get seriesRecordingPath + * + * @return seriesRecordingPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_RECORDING_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesRecordingPath() { + return seriesRecordingPath; + } + + @JsonProperty(JSON_PROPERTY_SERIES_RECORDING_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesRecordingPath(@org.eclipse.jdt.annotation.NonNull String seriesRecordingPath) { + this.seriesRecordingPath = seriesRecordingPath; + } + + public LiveTvOptions enableRecordingSubfolders( + @org.eclipse.jdt.annotation.NonNull Boolean enableRecordingSubfolders) { + this.enableRecordingSubfolders = enableRecordingSubfolders; + return this; + } + + /** + * Get enableRecordingSubfolders + * + * @return enableRecordingSubfolders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_RECORDING_SUBFOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableRecordingSubfolders() { + return enableRecordingSubfolders; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_RECORDING_SUBFOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableRecordingSubfolders(@org.eclipse.jdt.annotation.NonNull Boolean enableRecordingSubfolders) { + this.enableRecordingSubfolders = enableRecordingSubfolders; + } + + public LiveTvOptions enableOriginalAudioWithEncodedRecordings( + @org.eclipse.jdt.annotation.NonNull Boolean enableOriginalAudioWithEncodedRecordings) { + this.enableOriginalAudioWithEncodedRecordings = enableOriginalAudioWithEncodedRecordings; + return this; + } + + /** + * Get enableOriginalAudioWithEncodedRecordings + * + * @return enableOriginalAudioWithEncodedRecordings + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_ORIGINAL_AUDIO_WITH_ENCODED_RECORDINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableOriginalAudioWithEncodedRecordings() { + return enableOriginalAudioWithEncodedRecordings; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_ORIGINAL_AUDIO_WITH_ENCODED_RECORDINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableOriginalAudioWithEncodedRecordings( + @org.eclipse.jdt.annotation.NonNull Boolean enableOriginalAudioWithEncodedRecordings) { + this.enableOriginalAudioWithEncodedRecordings = enableOriginalAudioWithEncodedRecordings; + } + + public LiveTvOptions tunerHosts(@org.eclipse.jdt.annotation.NonNull List tunerHosts) { + this.tunerHosts = tunerHosts; + return this; + } + + public LiveTvOptions addTunerHostsItem(TunerHostInfo tunerHostsItem) { + if (this.tunerHosts == null) { + this.tunerHosts = new ArrayList<>(); + } + this.tunerHosts.add(tunerHostsItem); + return this; + } + + /** + * Get tunerHosts + * + * @return tunerHosts + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TUNER_HOSTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTunerHosts() { + return tunerHosts; + } + + @JsonProperty(JSON_PROPERTY_TUNER_HOSTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTunerHosts(@org.eclipse.jdt.annotation.NonNull List tunerHosts) { + this.tunerHosts = tunerHosts; + } + + public LiveTvOptions listingProviders( + @org.eclipse.jdt.annotation.NonNull List listingProviders) { + this.listingProviders = listingProviders; + return this; + } + + public LiveTvOptions addListingProvidersItem(ListingsProviderInfo listingProvidersItem) { + if (this.listingProviders == null) { + this.listingProviders = new ArrayList<>(); + } + this.listingProviders.add(listingProvidersItem); + return this; + } + + /** + * Get listingProviders + * + * @return listingProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LISTING_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getListingProviders() { + return listingProviders; + } + + @JsonProperty(JSON_PROPERTY_LISTING_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setListingProviders(@org.eclipse.jdt.annotation.NonNull List listingProviders) { + this.listingProviders = listingProviders; + } + + public LiveTvOptions prePaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer prePaddingSeconds) { + this.prePaddingSeconds = prePaddingSeconds; + return this; + } + + /** + * Get prePaddingSeconds + * + * @return prePaddingSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRE_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrePaddingSeconds() { + return prePaddingSeconds; + } + + @JsonProperty(JSON_PROPERTY_PRE_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrePaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer prePaddingSeconds) { + this.prePaddingSeconds = prePaddingSeconds; + } + + public LiveTvOptions postPaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer postPaddingSeconds) { + this.postPaddingSeconds = postPaddingSeconds; + return this; + } + + /** + * Get postPaddingSeconds + * + * @return postPaddingSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POST_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPostPaddingSeconds() { + return postPaddingSeconds; + } + + @JsonProperty(JSON_PROPERTY_POST_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPostPaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer postPaddingSeconds) { + this.postPaddingSeconds = postPaddingSeconds; + } + + public LiveTvOptions mediaLocationsCreated(@org.eclipse.jdt.annotation.NonNull List mediaLocationsCreated) { + this.mediaLocationsCreated = mediaLocationsCreated; + return this; + } + + public LiveTvOptions addMediaLocationsCreatedItem(String mediaLocationsCreatedItem) { + if (this.mediaLocationsCreated == null) { + this.mediaLocationsCreated = new ArrayList<>(); + } + this.mediaLocationsCreated.add(mediaLocationsCreatedItem); + return this; + } + + /** + * Get mediaLocationsCreated + * + * @return mediaLocationsCreated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_LOCATIONS_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMediaLocationsCreated() { + return mediaLocationsCreated; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_LOCATIONS_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaLocationsCreated(@org.eclipse.jdt.annotation.NonNull List mediaLocationsCreated) { + this.mediaLocationsCreated = mediaLocationsCreated; + } + + public LiveTvOptions recordingPostProcessor(@org.eclipse.jdt.annotation.NonNull String recordingPostProcessor) { + this.recordingPostProcessor = recordingPostProcessor; + return this; + } + + /** + * Get recordingPostProcessor + * + * @return recordingPostProcessor + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RECORDING_POST_PROCESSOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRecordingPostProcessor() { + return recordingPostProcessor; + } + + @JsonProperty(JSON_PROPERTY_RECORDING_POST_PROCESSOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecordingPostProcessor(@org.eclipse.jdt.annotation.NonNull String recordingPostProcessor) { + this.recordingPostProcessor = recordingPostProcessor; + } + + public LiveTvOptions recordingPostProcessorArguments( + @org.eclipse.jdt.annotation.NonNull String recordingPostProcessorArguments) { + this.recordingPostProcessorArguments = recordingPostProcessorArguments; + return this; + } + + /** + * Get recordingPostProcessorArguments + * + * @return recordingPostProcessorArguments + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RECORDING_POST_PROCESSOR_ARGUMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRecordingPostProcessorArguments() { + return recordingPostProcessorArguments; + } + + @JsonProperty(JSON_PROPERTY_RECORDING_POST_PROCESSOR_ARGUMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecordingPostProcessorArguments( + @org.eclipse.jdt.annotation.NonNull String recordingPostProcessorArguments) { + this.recordingPostProcessorArguments = recordingPostProcessorArguments; + } + + /** + * Return true if this LiveTvOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LiveTvOptions liveTvOptions = (LiveTvOptions) o; + return Objects.equals(this.guideDays, liveTvOptions.guideDays) + && Objects.equals(this.recordingPath, liveTvOptions.recordingPath) + && Objects.equals(this.movieRecordingPath, liveTvOptions.movieRecordingPath) + && Objects.equals(this.seriesRecordingPath, liveTvOptions.seriesRecordingPath) + && Objects.equals(this.enableRecordingSubfolders, liveTvOptions.enableRecordingSubfolders) + && Objects.equals(this.enableOriginalAudioWithEncodedRecordings, + liveTvOptions.enableOriginalAudioWithEncodedRecordings) + && Objects.equals(this.tunerHosts, liveTvOptions.tunerHosts) + && Objects.equals(this.listingProviders, liveTvOptions.listingProviders) + && Objects.equals(this.prePaddingSeconds, liveTvOptions.prePaddingSeconds) + && Objects.equals(this.postPaddingSeconds, liveTvOptions.postPaddingSeconds) + && Objects.equals(this.mediaLocationsCreated, liveTvOptions.mediaLocationsCreated) + && Objects.equals(this.recordingPostProcessor, liveTvOptions.recordingPostProcessor) + && Objects.equals(this.recordingPostProcessorArguments, liveTvOptions.recordingPostProcessorArguments); + } + + @Override + public int hashCode() { + return Objects.hash(guideDays, recordingPath, movieRecordingPath, seriesRecordingPath, + enableRecordingSubfolders, enableOriginalAudioWithEncodedRecordings, tunerHosts, listingProviders, + prePaddingSeconds, postPaddingSeconds, mediaLocationsCreated, recordingPostProcessor, + recordingPostProcessorArguments); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LiveTvOptions {\n"); + sb.append(" guideDays: ").append(toIndentedString(guideDays)).append("\n"); + sb.append(" recordingPath: ").append(toIndentedString(recordingPath)).append("\n"); + sb.append(" movieRecordingPath: ").append(toIndentedString(movieRecordingPath)).append("\n"); + sb.append(" seriesRecordingPath: ").append(toIndentedString(seriesRecordingPath)).append("\n"); + sb.append(" enableRecordingSubfolders: ").append(toIndentedString(enableRecordingSubfolders)).append("\n"); + sb.append(" enableOriginalAudioWithEncodedRecordings: ") + .append(toIndentedString(enableOriginalAudioWithEncodedRecordings)).append("\n"); + sb.append(" tunerHosts: ").append(toIndentedString(tunerHosts)).append("\n"); + sb.append(" listingProviders: ").append(toIndentedString(listingProviders)).append("\n"); + sb.append(" prePaddingSeconds: ").append(toIndentedString(prePaddingSeconds)).append("\n"); + sb.append(" postPaddingSeconds: ").append(toIndentedString(postPaddingSeconds)).append("\n"); + sb.append(" mediaLocationsCreated: ").append(toIndentedString(mediaLocationsCreated)).append("\n"); + sb.append(" recordingPostProcessor: ").append(toIndentedString(recordingPostProcessor)).append("\n"); + sb.append(" recordingPostProcessorArguments: ").append(toIndentedString(recordingPostProcessorArguments)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `GuideDays` to the URL query string + if (getGuideDays() != null) { + joiner.add(String.format("%sGuideDays%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGuideDays())))); + } + + // add `RecordingPath` to the URL query string + if (getRecordingPath() != null) { + joiner.add(String.format("%sRecordingPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRecordingPath())))); + } + + // add `MovieRecordingPath` to the URL query string + if (getMovieRecordingPath() != null) { + joiner.add(String.format("%sMovieRecordingPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMovieRecordingPath())))); + } + + // add `SeriesRecordingPath` to the URL query string + if (getSeriesRecordingPath() != null) { + joiner.add(String.format("%sSeriesRecordingPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesRecordingPath())))); + } + + // add `EnableRecordingSubfolders` to the URL query string + if (getEnableRecordingSubfolders() != null) { + joiner.add(String.format("%sEnableRecordingSubfolders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableRecordingSubfolders())))); + } + + // add `EnableOriginalAudioWithEncodedRecordings` to the URL query string + if (getEnableOriginalAudioWithEncodedRecordings() != null) { + joiner.add(String.format("%sEnableOriginalAudioWithEncodedRecordings%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableOriginalAudioWithEncodedRecordings())))); + } + + // add `TunerHosts` to the URL query string + if (getTunerHosts() != null) { + for (int i = 0; i < getTunerHosts().size(); i++) { + if (getTunerHosts().get(i) != null) { + joiner.add(getTunerHosts().get(i).toUrlQueryString(String.format("%sTunerHosts%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ListingProviders` to the URL query string + if (getListingProviders() != null) { + for (int i = 0; i < getListingProviders().size(); i++) { + if (getListingProviders().get(i) != null) { + joiner.add(getListingProviders().get(i).toUrlQueryString(String.format("%sListingProviders%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `PrePaddingSeconds` to the URL query string + if (getPrePaddingSeconds() != null) { + joiner.add(String.format("%sPrePaddingSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrePaddingSeconds())))); + } + + // add `PostPaddingSeconds` to the URL query string + if (getPostPaddingSeconds() != null) { + joiner.add(String.format("%sPostPaddingSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPostPaddingSeconds())))); + } + + // add `MediaLocationsCreated` to the URL query string + if (getMediaLocationsCreated() != null) { + for (int i = 0; i < getMediaLocationsCreated().size(); i++) { + joiner.add(String.format("%sMediaLocationsCreated%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMediaLocationsCreated().get(i))))); + } + } + + // add `RecordingPostProcessor` to the URL query string + if (getRecordingPostProcessor() != null) { + joiner.add(String.format("%sRecordingPostProcessor%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRecordingPostProcessor())))); + } + + // add `RecordingPostProcessorArguments` to the URL query string + if (getRecordingPostProcessorArguments() != null) { + joiner.add(String.format("%sRecordingPostProcessorArguments%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRecordingPostProcessorArguments())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private LiveTvOptions instance; + + public Builder() { + this(new LiveTvOptions()); + } + + protected Builder(LiveTvOptions instance) { + this.instance = instance; + } + + public LiveTvOptions.Builder guideDays(Integer guideDays) { + this.instance.guideDays = guideDays; + return this; + } + + public LiveTvOptions.Builder recordingPath(String recordingPath) { + this.instance.recordingPath = recordingPath; + return this; + } + + public LiveTvOptions.Builder movieRecordingPath(String movieRecordingPath) { + this.instance.movieRecordingPath = movieRecordingPath; + return this; + } + + public LiveTvOptions.Builder seriesRecordingPath(String seriesRecordingPath) { + this.instance.seriesRecordingPath = seriesRecordingPath; + return this; + } + + public LiveTvOptions.Builder enableRecordingSubfolders(Boolean enableRecordingSubfolders) { + this.instance.enableRecordingSubfolders = enableRecordingSubfolders; + return this; + } + + public LiveTvOptions.Builder enableOriginalAudioWithEncodedRecordings( + Boolean enableOriginalAudioWithEncodedRecordings) { + this.instance.enableOriginalAudioWithEncodedRecordings = enableOriginalAudioWithEncodedRecordings; + return this; + } + + public LiveTvOptions.Builder tunerHosts(List tunerHosts) { + this.instance.tunerHosts = tunerHosts; + return this; + } + + public LiveTvOptions.Builder listingProviders(List listingProviders) { + this.instance.listingProviders = listingProviders; + return this; + } + + public LiveTvOptions.Builder prePaddingSeconds(Integer prePaddingSeconds) { + this.instance.prePaddingSeconds = prePaddingSeconds; + return this; + } + + public LiveTvOptions.Builder postPaddingSeconds(Integer postPaddingSeconds) { + this.instance.postPaddingSeconds = postPaddingSeconds; + return this; + } + + public LiveTvOptions.Builder mediaLocationsCreated(List mediaLocationsCreated) { + this.instance.mediaLocationsCreated = mediaLocationsCreated; + return this; + } + + public LiveTvOptions.Builder recordingPostProcessor(String recordingPostProcessor) { + this.instance.recordingPostProcessor = recordingPostProcessor; + return this; + } + + public LiveTvOptions.Builder recordingPostProcessorArguments(String recordingPostProcessorArguments) { + this.instance.recordingPostProcessorArguments = recordingPostProcessorArguments; + return this; + } + + /** + * returns a built LiveTvOptions instance. + * + * The builder is not reusable. + */ + public LiveTvOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LiveTvOptions.Builder builder() { + return new LiveTvOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LiveTvOptions.Builder toBuilder() { + return new LiveTvOptions.Builder().guideDays(getGuideDays()).recordingPath(getRecordingPath()) + .movieRecordingPath(getMovieRecordingPath()).seriesRecordingPath(getSeriesRecordingPath()) + .enableRecordingSubfolders(getEnableRecordingSubfolders()) + .enableOriginalAudioWithEncodedRecordings(getEnableOriginalAudioWithEncodedRecordings()) + .tunerHosts(getTunerHosts()).listingProviders(getListingProviders()) + .prePaddingSeconds(getPrePaddingSeconds()).postPaddingSeconds(getPostPaddingSeconds()) + .mediaLocationsCreated(getMediaLocationsCreated()).recordingPostProcessor(getRecordingPostProcessor()) + .recordingPostProcessorArguments(getRecordingPostProcessorArguments()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveTvServiceInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveTvServiceInfo.java new file mode 100644 index 0000000000000..7d25a941837d4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveTvServiceInfo.java @@ -0,0 +1,490 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class ServiceInfo. + */ +@JsonPropertyOrder({ LiveTvServiceInfo.JSON_PROPERTY_NAME, LiveTvServiceInfo.JSON_PROPERTY_HOME_PAGE_URL, + LiveTvServiceInfo.JSON_PROPERTY_STATUS, LiveTvServiceInfo.JSON_PROPERTY_STATUS_MESSAGE, + LiveTvServiceInfo.JSON_PROPERTY_VERSION, LiveTvServiceInfo.JSON_PROPERTY_HAS_UPDATE_AVAILABLE, + LiveTvServiceInfo.JSON_PROPERTY_IS_VISIBLE, LiveTvServiceInfo.JSON_PROPERTY_TUNERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LiveTvServiceInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_HOME_PAGE_URL = "HomePageUrl"; + @org.eclipse.jdt.annotation.NonNull + private String homePageUrl; + + public static final String JSON_PROPERTY_STATUS = "Status"; + @org.eclipse.jdt.annotation.NonNull + private LiveTvServiceStatus status; + + public static final String JSON_PROPERTY_STATUS_MESSAGE = "StatusMessage"; + @org.eclipse.jdt.annotation.NonNull + private String statusMessage; + + public static final String JSON_PROPERTY_VERSION = "Version"; + @org.eclipse.jdt.annotation.NonNull + private String version; + + public static final String JSON_PROPERTY_HAS_UPDATE_AVAILABLE = "HasUpdateAvailable"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasUpdateAvailable; + + public static final String JSON_PROPERTY_IS_VISIBLE = "IsVisible"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isVisible; + + public static final String JSON_PROPERTY_TUNERS = "Tuners"; + @org.eclipse.jdt.annotation.NonNull + private List tuners; + + public LiveTvServiceInfo() { + } + + public LiveTvServiceInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public LiveTvServiceInfo homePageUrl(@org.eclipse.jdt.annotation.NonNull String homePageUrl) { + this.homePageUrl = homePageUrl; + return this; + } + + /** + * Gets or sets the home page URL. + * + * @return homePageUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HOME_PAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHomePageUrl() { + return homePageUrl; + } + + @JsonProperty(JSON_PROPERTY_HOME_PAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHomePageUrl(@org.eclipse.jdt.annotation.NonNull String homePageUrl) { + this.homePageUrl = homePageUrl; + } + + public LiveTvServiceInfo status(@org.eclipse.jdt.annotation.NonNull LiveTvServiceStatus status) { + this.status = status; + return this; + } + + /** + * Gets or sets the status. + * + * @return status + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LiveTvServiceStatus getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@org.eclipse.jdt.annotation.NonNull LiveTvServiceStatus status) { + this.status = status; + } + + public LiveTvServiceInfo statusMessage(@org.eclipse.jdt.annotation.NonNull String statusMessage) { + this.statusMessage = statusMessage; + return this; + } + + /** + * Gets or sets the status message. + * + * @return statusMessage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATUS_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatusMessage() { + return statusMessage; + } + + @JsonProperty(JSON_PROPERTY_STATUS_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatusMessage(@org.eclipse.jdt.annotation.NonNull String statusMessage) { + this.statusMessage = statusMessage; + } + + public LiveTvServiceInfo version(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + return this; + } + + /** + * Gets or sets the version. + * + * @return version + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + } + + public LiveTvServiceInfo hasUpdateAvailable(@org.eclipse.jdt.annotation.NonNull Boolean hasUpdateAvailable) { + this.hasUpdateAvailable = hasUpdateAvailable; + return this; + } + + /** + * Gets or sets a value indicating whether this instance has update available. + * + * @return hasUpdateAvailable + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_UPDATE_AVAILABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasUpdateAvailable() { + return hasUpdateAvailable; + } + + @JsonProperty(JSON_PROPERTY_HAS_UPDATE_AVAILABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasUpdateAvailable(@org.eclipse.jdt.annotation.NonNull Boolean hasUpdateAvailable) { + this.hasUpdateAvailable = hasUpdateAvailable; + } + + public LiveTvServiceInfo isVisible(@org.eclipse.jdt.annotation.NonNull Boolean isVisible) { + this.isVisible = isVisible; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is visible. + * + * @return isVisible + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_VISIBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsVisible() { + return isVisible; + } + + @JsonProperty(JSON_PROPERTY_IS_VISIBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsVisible(@org.eclipse.jdt.annotation.NonNull Boolean isVisible) { + this.isVisible = isVisible; + } + + public LiveTvServiceInfo tuners(@org.eclipse.jdt.annotation.NonNull List tuners) { + this.tuners = tuners; + return this; + } + + public LiveTvServiceInfo addTunersItem(String tunersItem) { + if (this.tuners == null) { + this.tuners = new ArrayList<>(); + } + this.tuners.add(tunersItem); + return this; + } + + /** + * Get tuners + * + * @return tuners + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TUNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTuners() { + return tuners; + } + + @JsonProperty(JSON_PROPERTY_TUNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTuners(@org.eclipse.jdt.annotation.NonNull List tuners) { + this.tuners = tuners; + } + + /** + * Return true if this LiveTvServiceInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LiveTvServiceInfo liveTvServiceInfo = (LiveTvServiceInfo) o; + return Objects.equals(this.name, liveTvServiceInfo.name) + && Objects.equals(this.homePageUrl, liveTvServiceInfo.homePageUrl) + && Objects.equals(this.status, liveTvServiceInfo.status) + && Objects.equals(this.statusMessage, liveTvServiceInfo.statusMessage) + && Objects.equals(this.version, liveTvServiceInfo.version) + && Objects.equals(this.hasUpdateAvailable, liveTvServiceInfo.hasUpdateAvailable) + && Objects.equals(this.isVisible, liveTvServiceInfo.isVisible) + && Objects.equals(this.tuners, liveTvServiceInfo.tuners); + } + + @Override + public int hashCode() { + return Objects.hash(name, homePageUrl, status, statusMessage, version, hasUpdateAvailable, isVisible, tuners); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LiveTvServiceInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" homePageUrl: ").append(toIndentedString(homePageUrl)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" statusMessage: ").append(toIndentedString(statusMessage)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" hasUpdateAvailable: ").append(toIndentedString(hasUpdateAvailable)).append("\n"); + sb.append(" isVisible: ").append(toIndentedString(isVisible)).append("\n"); + sb.append(" tuners: ").append(toIndentedString(tuners)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `HomePageUrl` to the URL query string + if (getHomePageUrl() != null) { + joiner.add(String.format("%sHomePageUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHomePageUrl())))); + } + + // add `Status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sStatus%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `StatusMessage` to the URL query string + if (getStatusMessage() != null) { + joiner.add(String.format("%sStatusMessage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStatusMessage())))); + } + + // add `Version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format("%sVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `HasUpdateAvailable` to the URL query string + if (getHasUpdateAvailable() != null) { + joiner.add(String.format("%sHasUpdateAvailable%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasUpdateAvailable())))); + } + + // add `IsVisible` to the URL query string + if (getIsVisible() != null) { + joiner.add(String.format("%sIsVisible%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsVisible())))); + } + + // add `Tuners` to the URL query string + if (getTuners() != null) { + for (int i = 0; i < getTuners().size(); i++) { + joiner.add(String.format("%sTuners%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getTuners().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private LiveTvServiceInfo instance; + + public Builder() { + this(new LiveTvServiceInfo()); + } + + protected Builder(LiveTvServiceInfo instance) { + this.instance = instance; + } + + public LiveTvServiceInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public LiveTvServiceInfo.Builder homePageUrl(String homePageUrl) { + this.instance.homePageUrl = homePageUrl; + return this; + } + + public LiveTvServiceInfo.Builder status(LiveTvServiceStatus status) { + this.instance.status = status; + return this; + } + + public LiveTvServiceInfo.Builder statusMessage(String statusMessage) { + this.instance.statusMessage = statusMessage; + return this; + } + + public LiveTvServiceInfo.Builder version(String version) { + this.instance.version = version; + return this; + } + + public LiveTvServiceInfo.Builder hasUpdateAvailable(Boolean hasUpdateAvailable) { + this.instance.hasUpdateAvailable = hasUpdateAvailable; + return this; + } + + public LiveTvServiceInfo.Builder isVisible(Boolean isVisible) { + this.instance.isVisible = isVisible; + return this; + } + + public LiveTvServiceInfo.Builder tuners(List tuners) { + this.instance.tuners = tuners; + return this; + } + + /** + * returns a built LiveTvServiceInfo instance. + * + * The builder is not reusable. + */ + public LiveTvServiceInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LiveTvServiceInfo.Builder builder() { + return new LiveTvServiceInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LiveTvServiceInfo.Builder toBuilder() { + return new LiveTvServiceInfo.Builder().name(getName()).homePageUrl(getHomePageUrl()).status(getStatus()) + .statusMessage(getStatusMessage()).version(getVersion()).hasUpdateAvailable(getHasUpdateAvailable()) + .isVisible(getIsVisible()).tuners(getTuners()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveTvServiceStatus.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveTvServiceStatus.java new file mode 100644 index 0000000000000..0c75897935266 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LiveTvServiceStatus.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets LiveTvServiceStatus + */ +public enum LiveTvServiceStatus { + + OK("Ok"), + + UNAVAILABLE("Unavailable"); + + private String value; + + LiveTvServiceStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LiveTvServiceStatus fromValue(String value) { + for (LiveTvServiceStatus b : LiveTvServiceStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LocalizationOption.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LocalizationOption.java new file mode 100644 index 0000000000000..10dfeab9d6c9b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LocalizationOption.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * LocalizationOption + */ +@JsonPropertyOrder({ LocalizationOption.JSON_PROPERTY_NAME, LocalizationOption.JSON_PROPERTY_VALUE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LocalizationOption { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_VALUE = "Value"; + @org.eclipse.jdt.annotation.NonNull + private String value; + + public LocalizationOption() { + } + + public LocalizationOption name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public LocalizationOption value(@org.eclipse.jdt.annotation.NonNull String value) { + this.value = value; + return this; + } + + /** + * Get value + * + * @return value + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@org.eclipse.jdt.annotation.NonNull String value) { + this.value = value; + } + + /** + * Return true if this LocalizationOption object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LocalizationOption localizationOption = (LocalizationOption) o; + return Objects.equals(this.name, localizationOption.name) + && Objects.equals(this.value, localizationOption.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LocalizationOption {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Value` to the URL query string + if (getValue() != null) { + joiner.add(String.format("%sValue%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getValue())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private LocalizationOption instance; + + public Builder() { + this(new LocalizationOption()); + } + + protected Builder(LocalizationOption instance) { + this.instance = instance; + } + + public LocalizationOption.Builder name(String name) { + this.instance.name = name; + return this; + } + + public LocalizationOption.Builder value(String value) { + this.instance.value = value; + return this; + } + + /** + * returns a built LocalizationOption instance. + * + * The builder is not reusable. + */ + public LocalizationOption build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LocalizationOption.Builder builder() { + return new LocalizationOption.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LocalizationOption.Builder toBuilder() { + return new LocalizationOption.Builder().name(getName()).value(getValue()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LocationType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LocationType.java new file mode 100644 index 0000000000000..b63d24eef007d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LocationType.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum LocationType. + */ +public enum LocationType { + + FILE_SYSTEM("FileSystem"), + + REMOTE("Remote"), + + VIRTUAL("Virtual"), + + OFFLINE("Offline"); + + private String value; + + LocationType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LocationType fromValue(String value) { + for (LocationType b : LocationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LogFile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LogFile.java new file mode 100644 index 0000000000000..ee2ecdcb2bb4d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LogFile.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * LogFile + */ +@JsonPropertyOrder({ LogFile.JSON_PROPERTY_DATE_CREATED, LogFile.JSON_PROPERTY_DATE_MODIFIED, + LogFile.JSON_PROPERTY_SIZE, LogFile.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class LogFile { + public static final String JSON_PROPERTY_DATE_CREATED = "DateCreated"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateCreated; + + public static final String JSON_PROPERTY_DATE_MODIFIED = "DateModified"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateModified; + + public static final String JSON_PROPERTY_SIZE = "Size"; + @org.eclipse.jdt.annotation.NonNull + private Long size; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public LogFile() { + } + + public LogFile dateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + return this; + } + + /** + * Gets or sets the date created. + * + * @return dateCreated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateCreated() { + return dateCreated; + } + + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + } + + public LogFile dateModified(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateModified) { + this.dateModified = dateModified; + return this; + } + + /** + * Gets or sets the date modified. + * + * @return dateModified + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateModified() { + return dateModified; + } + + @JsonProperty(JSON_PROPERTY_DATE_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateModified(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateModified) { + this.dateModified = dateModified; + } + + public LogFile size(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + return this; + } + + /** + * Gets or sets the size. + * + * @return size + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSize() { + return size; + } + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSize(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + } + + public LogFile name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + /** + * Return true if this LogFile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogFile logFile = (LogFile) o; + return Objects.equals(this.dateCreated, logFile.dateCreated) + && Objects.equals(this.dateModified, logFile.dateModified) && Objects.equals(this.size, logFile.size) + && Objects.equals(this.name, logFile.name); + } + + @Override + public int hashCode() { + return Objects.hash(dateCreated, dateModified, size, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogFile {\n"); + sb.append(" dateCreated: ").append(toIndentedString(dateCreated)).append("\n"); + sb.append(" dateModified: ").append(toIndentedString(dateModified)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `DateCreated` to the URL query string + if (getDateCreated() != null) { + joiner.add(String.format("%sDateCreated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateCreated())))); + } + + // add `DateModified` to the URL query string + if (getDateModified() != null) { + joiner.add(String.format("%sDateModified%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateModified())))); + } + + // add `Size` to the URL query string + if (getSize() != null) { + joiner.add(String.format("%sSize%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSize())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private LogFile instance; + + public Builder() { + this(new LogFile()); + } + + protected Builder(LogFile instance) { + this.instance = instance; + } + + public LogFile.Builder dateCreated(OffsetDateTime dateCreated) { + this.instance.dateCreated = dateCreated; + return this; + } + + public LogFile.Builder dateModified(OffsetDateTime dateModified) { + this.instance.dateModified = dateModified; + return this; + } + + public LogFile.Builder size(Long size) { + this.instance.size = size; + return this; + } + + public LogFile.Builder name(String name) { + this.instance.name = name; + return this; + } + + /** + * returns a built LogFile instance. + * + * The builder is not reusable. + */ + public LogFile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static LogFile.Builder builder() { + return new LogFile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public LogFile.Builder toBuilder() { + return new LogFile.Builder().dateCreated(getDateCreated()).dateModified(getDateModified()).size(getSize()) + .name(getName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LogLevel.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LogLevel.java new file mode 100644 index 0000000000000..0a78ba5e4a2a1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/LogLevel.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets LogLevel + */ +public enum LogLevel { + + TRACE("Trace"), + + DEBUG("Debug"), + + INFORMATION("Information"), + + WARNING("Warning"), + + ERROR("Error"), + + CRITICAL("Critical"), + + NONE("None"); + + private String value; + + LogLevel(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LogLevel fromValue(String value) { + for (LogLevel b : LogLevel.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaAttachment.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaAttachment.java new file mode 100644 index 0000000000000..b5d2244e278bd --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaAttachment.java @@ -0,0 +1,436 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class MediaAttachment. + */ +@JsonPropertyOrder({ MediaAttachment.JSON_PROPERTY_CODEC, MediaAttachment.JSON_PROPERTY_CODEC_TAG, + MediaAttachment.JSON_PROPERTY_COMMENT, MediaAttachment.JSON_PROPERTY_INDEX, + MediaAttachment.JSON_PROPERTY_FILE_NAME, MediaAttachment.JSON_PROPERTY_MIME_TYPE, + MediaAttachment.JSON_PROPERTY_DELIVERY_URL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaAttachment { + public static final String JSON_PROPERTY_CODEC = "Codec"; + @org.eclipse.jdt.annotation.NonNull + private String codec; + + public static final String JSON_PROPERTY_CODEC_TAG = "CodecTag"; + @org.eclipse.jdt.annotation.NonNull + private String codecTag; + + public static final String JSON_PROPERTY_COMMENT = "Comment"; + @org.eclipse.jdt.annotation.NonNull + private String comment; + + public static final String JSON_PROPERTY_INDEX = "Index"; + @org.eclipse.jdt.annotation.NonNull + private Integer index; + + public static final String JSON_PROPERTY_FILE_NAME = "FileName"; + @org.eclipse.jdt.annotation.NonNull + private String fileName; + + public static final String JSON_PROPERTY_MIME_TYPE = "MimeType"; + @org.eclipse.jdt.annotation.NonNull + private String mimeType; + + public static final String JSON_PROPERTY_DELIVERY_URL = "DeliveryUrl"; + @org.eclipse.jdt.annotation.NonNull + private String deliveryUrl; + + public MediaAttachment() { + } + + public MediaAttachment codec(@org.eclipse.jdt.annotation.NonNull String codec) { + this.codec = codec; + return this; + } + + /** + * Gets or sets the codec. + * + * @return codec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCodec() { + return codec; + } + + @JsonProperty(JSON_PROPERTY_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCodec(@org.eclipse.jdt.annotation.NonNull String codec) { + this.codec = codec; + } + + public MediaAttachment codecTag(@org.eclipse.jdt.annotation.NonNull String codecTag) { + this.codecTag = codecTag; + return this; + } + + /** + * Gets or sets the codec tag. + * + * @return codecTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODEC_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCodecTag() { + return codecTag; + } + + @JsonProperty(JSON_PROPERTY_CODEC_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCodecTag(@org.eclipse.jdt.annotation.NonNull String codecTag) { + this.codecTag = codecTag; + } + + public MediaAttachment comment(@org.eclipse.jdt.annotation.NonNull String comment) { + this.comment = comment; + return this; + } + + /** + * Gets or sets the comment. + * + * @return comment + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getComment() { + return comment; + } + + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComment(@org.eclipse.jdt.annotation.NonNull String comment) { + this.comment = comment; + } + + public MediaAttachment index(@org.eclipse.jdt.annotation.NonNull Integer index) { + this.index = index; + return this; + } + + /** + * Gets or sets the index. + * + * @return index + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndex() { + return index; + } + + @JsonProperty(JSON_PROPERTY_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndex(@org.eclipse.jdt.annotation.NonNull Integer index) { + this.index = index; + } + + public MediaAttachment fileName(@org.eclipse.jdt.annotation.NonNull String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Gets or sets the filename. + * + * @return fileName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FILE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFileName() { + return fileName; + } + + @JsonProperty(JSON_PROPERTY_FILE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileName(@org.eclipse.jdt.annotation.NonNull String fileName) { + this.fileName = fileName; + } + + public MediaAttachment mimeType(@org.eclipse.jdt.annotation.NonNull String mimeType) { + this.mimeType = mimeType; + return this; + } + + /** + * Gets or sets the MIME type. + * + * @return mimeType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIME_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMimeType() { + return mimeType; + } + + @JsonProperty(JSON_PROPERTY_MIME_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMimeType(@org.eclipse.jdt.annotation.NonNull String mimeType) { + this.mimeType = mimeType; + } + + public MediaAttachment deliveryUrl(@org.eclipse.jdt.annotation.NonNull String deliveryUrl) { + this.deliveryUrl = deliveryUrl; + return this; + } + + /** + * Gets or sets the delivery URL. + * + * @return deliveryUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DELIVERY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeliveryUrl() { + return deliveryUrl; + } + + @JsonProperty(JSON_PROPERTY_DELIVERY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeliveryUrl(@org.eclipse.jdt.annotation.NonNull String deliveryUrl) { + this.deliveryUrl = deliveryUrl; + } + + /** + * Return true if this MediaAttachment object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaAttachment mediaAttachment = (MediaAttachment) o; + return Objects.equals(this.codec, mediaAttachment.codec) + && Objects.equals(this.codecTag, mediaAttachment.codecTag) + && Objects.equals(this.comment, mediaAttachment.comment) + && Objects.equals(this.index, mediaAttachment.index) + && Objects.equals(this.fileName, mediaAttachment.fileName) + && Objects.equals(this.mimeType, mediaAttachment.mimeType) + && Objects.equals(this.deliveryUrl, mediaAttachment.deliveryUrl); + } + + @Override + public int hashCode() { + return Objects.hash(codec, codecTag, comment, index, fileName, mimeType, deliveryUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaAttachment {\n"); + sb.append(" codec: ").append(toIndentedString(codec)).append("\n"); + sb.append(" codecTag: ").append(toIndentedString(codecTag)).append("\n"); + sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" fileName: ").append(toIndentedString(fileName)).append("\n"); + sb.append(" mimeType: ").append(toIndentedString(mimeType)).append("\n"); + sb.append(" deliveryUrl: ").append(toIndentedString(deliveryUrl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Codec` to the URL query string + if (getCodec() != null) { + joiner.add(String.format("%sCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCodec())))); + } + + // add `CodecTag` to the URL query string + if (getCodecTag() != null) { + joiner.add(String.format("%sCodecTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCodecTag())))); + } + + // add `Comment` to the URL query string + if (getComment() != null) { + joiner.add(String.format("%sComment%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getComment())))); + } + + // add `Index` to the URL query string + if (getIndex() != null) { + joiner.add(String.format("%sIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndex())))); + } + + // add `FileName` to the URL query string + if (getFileName() != null) { + joiner.add(String.format("%sFileName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFileName())))); + } + + // add `MimeType` to the URL query string + if (getMimeType() != null) { + joiner.add(String.format("%sMimeType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMimeType())))); + } + + // add `DeliveryUrl` to the URL query string + if (getDeliveryUrl() != null) { + joiner.add(String.format("%sDeliveryUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeliveryUrl())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaAttachment instance; + + public Builder() { + this(new MediaAttachment()); + } + + protected Builder(MediaAttachment instance) { + this.instance = instance; + } + + public MediaAttachment.Builder codec(String codec) { + this.instance.codec = codec; + return this; + } + + public MediaAttachment.Builder codecTag(String codecTag) { + this.instance.codecTag = codecTag; + return this; + } + + public MediaAttachment.Builder comment(String comment) { + this.instance.comment = comment; + return this; + } + + public MediaAttachment.Builder index(Integer index) { + this.instance.index = index; + return this; + } + + public MediaAttachment.Builder fileName(String fileName) { + this.instance.fileName = fileName; + return this; + } + + public MediaAttachment.Builder mimeType(String mimeType) { + this.instance.mimeType = mimeType; + return this; + } + + public MediaAttachment.Builder deliveryUrl(String deliveryUrl) { + this.instance.deliveryUrl = deliveryUrl; + return this; + } + + /** + * returns a built MediaAttachment instance. + * + * The builder is not reusable. + */ + public MediaAttachment build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaAttachment.Builder builder() { + return new MediaAttachment.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaAttachment.Builder toBuilder() { + return new MediaAttachment.Builder().codec(getCodec()).codecTag(getCodecTag()).comment(getComment()) + .index(getIndex()).fileName(getFileName()).mimeType(getMimeType()).deliveryUrl(getDeliveryUrl()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaEncoderPathDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaEncoderPathDto.java new file mode 100644 index 0000000000000..86a51caa419ac --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaEncoderPathDto.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Media Encoder Path Dto. + */ +@JsonPropertyOrder({ MediaEncoderPathDto.JSON_PROPERTY_PATH, MediaEncoderPathDto.JSON_PROPERTY_PATH_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaEncoderPathDto { + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_PATH_TYPE = "PathType"; + @org.eclipse.jdt.annotation.NonNull + private String pathType; + + public MediaEncoderPathDto() { + } + + public MediaEncoderPathDto path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets media encoder path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public MediaEncoderPathDto pathType(@org.eclipse.jdt.annotation.NonNull String pathType) { + this.pathType = pathType; + return this; + } + + /** + * Gets or sets media encoder path type. + * + * @return pathType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPathType() { + return pathType; + } + + @JsonProperty(JSON_PROPERTY_PATH_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPathType(@org.eclipse.jdt.annotation.NonNull String pathType) { + this.pathType = pathType; + } + + /** + * Return true if this MediaEncoderPathDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaEncoderPathDto mediaEncoderPathDto = (MediaEncoderPathDto) o; + return Objects.equals(this.path, mediaEncoderPathDto.path) + && Objects.equals(this.pathType, mediaEncoderPathDto.pathType); + } + + @Override + public int hashCode() { + return Objects.hash(path, pathType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaEncoderPathDto {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" pathType: ").append(toIndentedString(pathType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `PathType` to the URL query string + if (getPathType() != null) { + joiner.add(String.format("%sPathType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPathType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaEncoderPathDto instance; + + public Builder() { + this(new MediaEncoderPathDto()); + } + + protected Builder(MediaEncoderPathDto instance) { + this.instance = instance; + } + + public MediaEncoderPathDto.Builder path(String path) { + this.instance.path = path; + return this; + } + + public MediaEncoderPathDto.Builder pathType(String pathType) { + this.instance.pathType = pathType; + return this; + } + + /** + * returns a built MediaEncoderPathDto instance. + * + * The builder is not reusable. + */ + public MediaEncoderPathDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaEncoderPathDto.Builder builder() { + return new MediaEncoderPathDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaEncoderPathDto.Builder toBuilder() { + return new MediaEncoderPathDto.Builder().path(getPath()).pathType(getPathType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaPathDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaPathDto.java new file mode 100644 index 0000000000000..285520d511405 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaPathDto.java @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Media Path dto. + */ +@JsonPropertyOrder({ MediaPathDto.JSON_PROPERTY_NAME, MediaPathDto.JSON_PROPERTY_PATH, + MediaPathDto.JSON_PROPERTY_PATH_INFO }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaPathDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_PATH_INFO = "PathInfo"; + @org.eclipse.jdt.annotation.NonNull + private MediaPathInfo pathInfo; + + public MediaPathDto() { + } + + public MediaPathDto name(@org.eclipse.jdt.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name of the library. + * + * @return name + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@org.eclipse.jdt.annotation.Nullable String name) { + this.name = name; + } + + public MediaPathDto path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path to add. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public MediaPathDto pathInfo(@org.eclipse.jdt.annotation.NonNull MediaPathInfo pathInfo) { + this.pathInfo = pathInfo; + return this; + } + + /** + * Gets or sets the path info. + * + * @return pathInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaPathInfo getPathInfo() { + return pathInfo; + } + + @JsonProperty(JSON_PROPERTY_PATH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPathInfo(@org.eclipse.jdt.annotation.NonNull MediaPathInfo pathInfo) { + this.pathInfo = pathInfo; + } + + /** + * Return true if this MediaPathDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaPathDto mediaPathDto = (MediaPathDto) o; + return Objects.equals(this.name, mediaPathDto.name) && Objects.equals(this.path, mediaPathDto.path) + && Objects.equals(this.pathInfo, mediaPathDto.pathInfo); + } + + @Override + public int hashCode() { + return Objects.hash(name, path, pathInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaPathDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" pathInfo: ").append(toIndentedString(pathInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `PathInfo` to the URL query string + if (getPathInfo() != null) { + joiner.add(getPathInfo().toUrlQueryString(prefix + "PathInfo" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaPathDto instance; + + public Builder() { + this(new MediaPathDto()); + } + + protected Builder(MediaPathDto instance) { + this.instance = instance; + } + + public MediaPathDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public MediaPathDto.Builder path(String path) { + this.instance.path = path; + return this; + } + + public MediaPathDto.Builder pathInfo(MediaPathInfo pathInfo) { + this.instance.pathInfo = pathInfo; + return this; + } + + /** + * returns a built MediaPathDto instance. + * + * The builder is not reusable. + */ + public MediaPathDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaPathDto.Builder builder() { + return new MediaPathDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaPathDto.Builder toBuilder() { + return new MediaPathDto.Builder().name(getName()).path(getPath()).pathInfo(getPathInfo()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaPathInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaPathInfo.java new file mode 100644 index 0000000000000..522369032fb8d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaPathInfo.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MediaPathInfo + */ +@JsonPropertyOrder({ MediaPathInfo.JSON_PROPERTY_PATH, MediaPathInfo.JSON_PROPERTY_NETWORK_PATH }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaPathInfo { + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_NETWORK_PATH = "NetworkPath"; + @org.eclipse.jdt.annotation.NonNull + private String networkPath; + + public MediaPathInfo() { + } + + public MediaPathInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Get path + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public MediaPathInfo networkPath(@org.eclipse.jdt.annotation.NonNull String networkPath) { + this.networkPath = networkPath; + return this; + } + + /** + * Get networkPath + * + * @return networkPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NETWORK_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNetworkPath() { + return networkPath; + } + + @JsonProperty(JSON_PROPERTY_NETWORK_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNetworkPath(@org.eclipse.jdt.annotation.NonNull String networkPath) { + this.networkPath = networkPath; + } + + /** + * Return true if this MediaPathInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaPathInfo mediaPathInfo = (MediaPathInfo) o; + return Objects.equals(this.path, mediaPathInfo.path) + && Objects.equals(this.networkPath, mediaPathInfo.networkPath); + } + + @Override + public int hashCode() { + return Objects.hash(path, networkPath); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaPathInfo {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" networkPath: ").append(toIndentedString(networkPath)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `NetworkPath` to the URL query string + if (getNetworkPath() != null) { + joiner.add(String.format("%sNetworkPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getNetworkPath())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaPathInfo instance; + + public Builder() { + this(new MediaPathInfo()); + } + + protected Builder(MediaPathInfo instance) { + this.instance = instance; + } + + public MediaPathInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public MediaPathInfo.Builder networkPath(String networkPath) { + this.instance.networkPath = networkPath; + return this; + } + + /** + * returns a built MediaPathInfo instance. + * + * The builder is not reusable. + */ + public MediaPathInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaPathInfo.Builder builder() { + return new MediaPathInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaPathInfo.Builder toBuilder() { + return new MediaPathInfo.Builder().path(getPath()).networkPath(getNetworkPath()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaProtocol.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaProtocol.java new file mode 100644 index 0000000000000..e60d2d8014a03 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaProtocol.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets MediaProtocol + */ +public enum MediaProtocol { + + FILE("File"), + + HTTP("Http"), + + RTMP("Rtmp"), + + RTSP("Rtsp"), + + UDP("Udp"), + + RTP("Rtp"), + + FTP("Ftp"); + + private String value; + + MediaProtocol(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MediaProtocol fromValue(String value) { + for (MediaProtocol b : MediaProtocol.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaSourceInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaSourceInfo.java new file mode 100644 index 0000000000000..ccf6b1bb3e38f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaSourceInfo.java @@ -0,0 +1,1929 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MediaSourceInfo + */ +@JsonPropertyOrder({ MediaSourceInfo.JSON_PROPERTY_PROTOCOL, MediaSourceInfo.JSON_PROPERTY_ID, + MediaSourceInfo.JSON_PROPERTY_PATH, MediaSourceInfo.JSON_PROPERTY_ENCODER_PATH, + MediaSourceInfo.JSON_PROPERTY_ENCODER_PROTOCOL, MediaSourceInfo.JSON_PROPERTY_TYPE, + MediaSourceInfo.JSON_PROPERTY_CONTAINER, MediaSourceInfo.JSON_PROPERTY_SIZE, MediaSourceInfo.JSON_PROPERTY_NAME, + MediaSourceInfo.JSON_PROPERTY_IS_REMOTE, MediaSourceInfo.JSON_PROPERTY_ETAG, + MediaSourceInfo.JSON_PROPERTY_RUN_TIME_TICKS, MediaSourceInfo.JSON_PROPERTY_READ_AT_NATIVE_FRAMERATE, + MediaSourceInfo.JSON_PROPERTY_IGNORE_DTS, MediaSourceInfo.JSON_PROPERTY_IGNORE_INDEX, + MediaSourceInfo.JSON_PROPERTY_GEN_PTS_INPUT, MediaSourceInfo.JSON_PROPERTY_SUPPORTS_TRANSCODING, + MediaSourceInfo.JSON_PROPERTY_SUPPORTS_DIRECT_STREAM, MediaSourceInfo.JSON_PROPERTY_SUPPORTS_DIRECT_PLAY, + MediaSourceInfo.JSON_PROPERTY_IS_INFINITE_STREAM, MediaSourceInfo.JSON_PROPERTY_REQUIRES_OPENING, + MediaSourceInfo.JSON_PROPERTY_OPEN_TOKEN, MediaSourceInfo.JSON_PROPERTY_REQUIRES_CLOSING, + MediaSourceInfo.JSON_PROPERTY_LIVE_STREAM_ID, MediaSourceInfo.JSON_PROPERTY_BUFFER_MS, + MediaSourceInfo.JSON_PROPERTY_REQUIRES_LOOPING, MediaSourceInfo.JSON_PROPERTY_SUPPORTS_PROBING, + MediaSourceInfo.JSON_PROPERTY_VIDEO_TYPE, MediaSourceInfo.JSON_PROPERTY_ISO_TYPE, + MediaSourceInfo.JSON_PROPERTY_VIDEO3_D_FORMAT, MediaSourceInfo.JSON_PROPERTY_MEDIA_STREAMS, + MediaSourceInfo.JSON_PROPERTY_MEDIA_ATTACHMENTS, MediaSourceInfo.JSON_PROPERTY_FORMATS, + MediaSourceInfo.JSON_PROPERTY_BITRATE, MediaSourceInfo.JSON_PROPERTY_TIMESTAMP, + MediaSourceInfo.JSON_PROPERTY_REQUIRED_HTTP_HEADERS, MediaSourceInfo.JSON_PROPERTY_TRANSCODING_URL, + MediaSourceInfo.JSON_PROPERTY_TRANSCODING_SUB_PROTOCOL, MediaSourceInfo.JSON_PROPERTY_TRANSCODING_CONTAINER, + MediaSourceInfo.JSON_PROPERTY_ANALYZE_DURATION_MS, MediaSourceInfo.JSON_PROPERTY_DEFAULT_AUDIO_STREAM_INDEX, + MediaSourceInfo.JSON_PROPERTY_DEFAULT_SUBTITLE_STREAM_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaSourceInfo { + public static final String JSON_PROPERTY_PROTOCOL = "Protocol"; + @org.eclipse.jdt.annotation.NonNull + private MediaProtocol protocol; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_ENCODER_PATH = "EncoderPath"; + @org.eclipse.jdt.annotation.NonNull + private String encoderPath; + + public static final String JSON_PROPERTY_ENCODER_PROTOCOL = "EncoderProtocol"; + @org.eclipse.jdt.annotation.NonNull + private MediaProtocol encoderProtocol; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private MediaSourceType type; + + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public static final String JSON_PROPERTY_SIZE = "Size"; + @org.eclipse.jdt.annotation.NonNull + private Long size; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_IS_REMOTE = "IsRemote"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isRemote; + + public static final String JSON_PROPERTY_ETAG = "ETag"; + @org.eclipse.jdt.annotation.NonNull + private String etag; + + public static final String JSON_PROPERTY_RUN_TIME_TICKS = "RunTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long runTimeTicks; + + public static final String JSON_PROPERTY_READ_AT_NATIVE_FRAMERATE = "ReadAtNativeFramerate"; + @org.eclipse.jdt.annotation.NonNull + private Boolean readAtNativeFramerate; + + public static final String JSON_PROPERTY_IGNORE_DTS = "IgnoreDts"; + @org.eclipse.jdt.annotation.NonNull + private Boolean ignoreDts; + + public static final String JSON_PROPERTY_IGNORE_INDEX = "IgnoreIndex"; + @org.eclipse.jdt.annotation.NonNull + private Boolean ignoreIndex; + + public static final String JSON_PROPERTY_GEN_PTS_INPUT = "GenPtsInput"; + @org.eclipse.jdt.annotation.NonNull + private Boolean genPtsInput; + + public static final String JSON_PROPERTY_SUPPORTS_TRANSCODING = "SupportsTranscoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsTranscoding; + + public static final String JSON_PROPERTY_SUPPORTS_DIRECT_STREAM = "SupportsDirectStream"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsDirectStream; + + public static final String JSON_PROPERTY_SUPPORTS_DIRECT_PLAY = "SupportsDirectPlay"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsDirectPlay; + + public static final String JSON_PROPERTY_IS_INFINITE_STREAM = "IsInfiniteStream"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isInfiniteStream; + + public static final String JSON_PROPERTY_REQUIRES_OPENING = "RequiresOpening"; + @org.eclipse.jdt.annotation.NonNull + private Boolean requiresOpening; + + public static final String JSON_PROPERTY_OPEN_TOKEN = "OpenToken"; + @org.eclipse.jdt.annotation.NonNull + private String openToken; + + public static final String JSON_PROPERTY_REQUIRES_CLOSING = "RequiresClosing"; + @org.eclipse.jdt.annotation.NonNull + private Boolean requiresClosing; + + public static final String JSON_PROPERTY_LIVE_STREAM_ID = "LiveStreamId"; + @org.eclipse.jdt.annotation.NonNull + private String liveStreamId; + + public static final String JSON_PROPERTY_BUFFER_MS = "BufferMs"; + @org.eclipse.jdt.annotation.NonNull + private Integer bufferMs; + + public static final String JSON_PROPERTY_REQUIRES_LOOPING = "RequiresLooping"; + @org.eclipse.jdt.annotation.NonNull + private Boolean requiresLooping; + + public static final String JSON_PROPERTY_SUPPORTS_PROBING = "SupportsProbing"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsProbing; + + public static final String JSON_PROPERTY_VIDEO_TYPE = "VideoType"; + @org.eclipse.jdt.annotation.NonNull + private VideoType videoType; + + public static final String JSON_PROPERTY_ISO_TYPE = "IsoType"; + @org.eclipse.jdt.annotation.NonNull + private IsoType isoType; + + public static final String JSON_PROPERTY_VIDEO3_D_FORMAT = "Video3DFormat"; + @org.eclipse.jdt.annotation.NonNull + private Video3DFormat video3DFormat; + + public static final String JSON_PROPERTY_MEDIA_STREAMS = "MediaStreams"; + @org.eclipse.jdt.annotation.NonNull + private List mediaStreams; + + public static final String JSON_PROPERTY_MEDIA_ATTACHMENTS = "MediaAttachments"; + @org.eclipse.jdt.annotation.NonNull + private List mediaAttachments; + + public static final String JSON_PROPERTY_FORMATS = "Formats"; + @org.eclipse.jdt.annotation.NonNull + private List formats; + + public static final String JSON_PROPERTY_BITRATE = "Bitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer bitrate; + + public static final String JSON_PROPERTY_TIMESTAMP = "Timestamp"; + @org.eclipse.jdt.annotation.NonNull + private TransportStreamTimestamp timestamp; + + public static final String JSON_PROPERTY_REQUIRED_HTTP_HEADERS = "RequiredHttpHeaders"; + @org.eclipse.jdt.annotation.NonNull + private Map requiredHttpHeaders; + + public static final String JSON_PROPERTY_TRANSCODING_URL = "TranscodingUrl"; + @org.eclipse.jdt.annotation.NonNull + private String transcodingUrl; + + public static final String JSON_PROPERTY_TRANSCODING_SUB_PROTOCOL = "TranscodingSubProtocol"; + @org.eclipse.jdt.annotation.NonNull + private String transcodingSubProtocol; + + public static final String JSON_PROPERTY_TRANSCODING_CONTAINER = "TranscodingContainer"; + @org.eclipse.jdt.annotation.NonNull + private String transcodingContainer; + + public static final String JSON_PROPERTY_ANALYZE_DURATION_MS = "AnalyzeDurationMs"; + @org.eclipse.jdt.annotation.NonNull + private Integer analyzeDurationMs; + + public static final String JSON_PROPERTY_DEFAULT_AUDIO_STREAM_INDEX = "DefaultAudioStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer defaultAudioStreamIndex; + + public static final String JSON_PROPERTY_DEFAULT_SUBTITLE_STREAM_INDEX = "DefaultSubtitleStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer defaultSubtitleStreamIndex; + + public MediaSourceInfo() { + } + + public MediaSourceInfo protocol(@org.eclipse.jdt.annotation.NonNull MediaProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * + * @return protocol + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaProtocol getProtocol() { + return protocol; + } + + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtocol(@org.eclipse.jdt.annotation.NonNull MediaProtocol protocol) { + this.protocol = protocol; + } + + public MediaSourceInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public MediaSourceInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Get path + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public MediaSourceInfo encoderPath(@org.eclipse.jdt.annotation.NonNull String encoderPath) { + this.encoderPath = encoderPath; + return this; + } + + /** + * Get encoderPath + * + * @return encoderPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENCODER_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEncoderPath() { + return encoderPath; + } + + @JsonProperty(JSON_PROPERTY_ENCODER_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncoderPath(@org.eclipse.jdt.annotation.NonNull String encoderPath) { + this.encoderPath = encoderPath; + } + + public MediaSourceInfo encoderProtocol(@org.eclipse.jdt.annotation.NonNull MediaProtocol encoderProtocol) { + this.encoderProtocol = encoderProtocol; + return this; + } + + /** + * Get encoderProtocol + * + * @return encoderProtocol + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENCODER_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaProtocol getEncoderProtocol() { + return encoderProtocol; + } + + @JsonProperty(JSON_PROPERTY_ENCODER_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncoderProtocol(@org.eclipse.jdt.annotation.NonNull MediaProtocol encoderProtocol) { + this.encoderProtocol = encoderProtocol; + } + + public MediaSourceInfo type(@org.eclipse.jdt.annotation.NonNull MediaSourceType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaSourceType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull MediaSourceType type) { + this.type = type; + } + + public MediaSourceInfo container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Get container + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + public MediaSourceInfo size(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + return this; + } + + /** + * Get size + * + * @return size + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSize() { + return size; + } + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSize(@org.eclipse.jdt.annotation.NonNull Long size) { + this.size = size; + } + + public MediaSourceInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public MediaSourceInfo isRemote(@org.eclipse.jdt.annotation.NonNull Boolean isRemote) { + this.isRemote = isRemote; + return this; + } + + /** + * Gets or sets a value indicating whether the media is remote. Differentiate internet url vs local network. + * + * @return isRemote + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_REMOTE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsRemote() { + return isRemote; + } + + @JsonProperty(JSON_PROPERTY_IS_REMOTE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsRemote(@org.eclipse.jdt.annotation.NonNull Boolean isRemote) { + this.isRemote = isRemote; + } + + public MediaSourceInfo etag(@org.eclipse.jdt.annotation.NonNull String etag) { + this.etag = etag; + return this; + } + + /** + * Get etag + * + * @return etag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ETAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEtag() { + return etag; + } + + @JsonProperty(JSON_PROPERTY_ETAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEtag(@org.eclipse.jdt.annotation.NonNull String etag) { + this.etag = etag; + } + + public MediaSourceInfo runTimeTicks(@org.eclipse.jdt.annotation.NonNull Long runTimeTicks) { + this.runTimeTicks = runTimeTicks; + return this; + } + + /** + * Get runTimeTicks + * + * @return runTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getRunTimeTicks() { + return runTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRunTimeTicks(@org.eclipse.jdt.annotation.NonNull Long runTimeTicks) { + this.runTimeTicks = runTimeTicks; + } + + public MediaSourceInfo readAtNativeFramerate(@org.eclipse.jdt.annotation.NonNull Boolean readAtNativeFramerate) { + this.readAtNativeFramerate = readAtNativeFramerate; + return this; + } + + /** + * Get readAtNativeFramerate + * + * @return readAtNativeFramerate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_READ_AT_NATIVE_FRAMERATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getReadAtNativeFramerate() { + return readAtNativeFramerate; + } + + @JsonProperty(JSON_PROPERTY_READ_AT_NATIVE_FRAMERATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReadAtNativeFramerate(@org.eclipse.jdt.annotation.NonNull Boolean readAtNativeFramerate) { + this.readAtNativeFramerate = readAtNativeFramerate; + } + + public MediaSourceInfo ignoreDts(@org.eclipse.jdt.annotation.NonNull Boolean ignoreDts) { + this.ignoreDts = ignoreDts; + return this; + } + + /** + * Get ignoreDts + * + * @return ignoreDts + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IGNORE_DTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIgnoreDts() { + return ignoreDts; + } + + @JsonProperty(JSON_PROPERTY_IGNORE_DTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIgnoreDts(@org.eclipse.jdt.annotation.NonNull Boolean ignoreDts) { + this.ignoreDts = ignoreDts; + } + + public MediaSourceInfo ignoreIndex(@org.eclipse.jdt.annotation.NonNull Boolean ignoreIndex) { + this.ignoreIndex = ignoreIndex; + return this; + } + + /** + * Get ignoreIndex + * + * @return ignoreIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IGNORE_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIgnoreIndex() { + return ignoreIndex; + } + + @JsonProperty(JSON_PROPERTY_IGNORE_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIgnoreIndex(@org.eclipse.jdt.annotation.NonNull Boolean ignoreIndex) { + this.ignoreIndex = ignoreIndex; + } + + public MediaSourceInfo genPtsInput(@org.eclipse.jdt.annotation.NonNull Boolean genPtsInput) { + this.genPtsInput = genPtsInput; + return this; + } + + /** + * Get genPtsInput + * + * @return genPtsInput + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GEN_PTS_INPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getGenPtsInput() { + return genPtsInput; + } + + @JsonProperty(JSON_PROPERTY_GEN_PTS_INPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGenPtsInput(@org.eclipse.jdt.annotation.NonNull Boolean genPtsInput) { + this.genPtsInput = genPtsInput; + } + + public MediaSourceInfo supportsTranscoding(@org.eclipse.jdt.annotation.NonNull Boolean supportsTranscoding) { + this.supportsTranscoding = supportsTranscoding; + return this; + } + + /** + * Get supportsTranscoding + * + * @return supportsTranscoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsTranscoding() { + return supportsTranscoding; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsTranscoding(@org.eclipse.jdt.annotation.NonNull Boolean supportsTranscoding) { + this.supportsTranscoding = supportsTranscoding; + } + + public MediaSourceInfo supportsDirectStream(@org.eclipse.jdt.annotation.NonNull Boolean supportsDirectStream) { + this.supportsDirectStream = supportsDirectStream; + return this; + } + + /** + * Get supportsDirectStream + * + * @return supportsDirectStream + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_DIRECT_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsDirectStream() { + return supportsDirectStream; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_DIRECT_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsDirectStream(@org.eclipse.jdt.annotation.NonNull Boolean supportsDirectStream) { + this.supportsDirectStream = supportsDirectStream; + } + + public MediaSourceInfo supportsDirectPlay(@org.eclipse.jdt.annotation.NonNull Boolean supportsDirectPlay) { + this.supportsDirectPlay = supportsDirectPlay; + return this; + } + + /** + * Get supportsDirectPlay + * + * @return supportsDirectPlay + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_DIRECT_PLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsDirectPlay() { + return supportsDirectPlay; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_DIRECT_PLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsDirectPlay(@org.eclipse.jdt.annotation.NonNull Boolean supportsDirectPlay) { + this.supportsDirectPlay = supportsDirectPlay; + } + + public MediaSourceInfo isInfiniteStream(@org.eclipse.jdt.annotation.NonNull Boolean isInfiniteStream) { + this.isInfiniteStream = isInfiniteStream; + return this; + } + + /** + * Get isInfiniteStream + * + * @return isInfiniteStream + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_INFINITE_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsInfiniteStream() { + return isInfiniteStream; + } + + @JsonProperty(JSON_PROPERTY_IS_INFINITE_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsInfiniteStream(@org.eclipse.jdt.annotation.NonNull Boolean isInfiniteStream) { + this.isInfiniteStream = isInfiniteStream; + } + + public MediaSourceInfo requiresOpening(@org.eclipse.jdt.annotation.NonNull Boolean requiresOpening) { + this.requiresOpening = requiresOpening; + return this; + } + + /** + * Get requiresOpening + * + * @return requiresOpening + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUIRES_OPENING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequiresOpening() { + return requiresOpening; + } + + @JsonProperty(JSON_PROPERTY_REQUIRES_OPENING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequiresOpening(@org.eclipse.jdt.annotation.NonNull Boolean requiresOpening) { + this.requiresOpening = requiresOpening; + } + + public MediaSourceInfo openToken(@org.eclipse.jdt.annotation.NonNull String openToken) { + this.openToken = openToken; + return this; + } + + /** + * Get openToken + * + * @return openToken + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OPEN_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOpenToken() { + return openToken; + } + + @JsonProperty(JSON_PROPERTY_OPEN_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpenToken(@org.eclipse.jdt.annotation.NonNull String openToken) { + this.openToken = openToken; + } + + public MediaSourceInfo requiresClosing(@org.eclipse.jdt.annotation.NonNull Boolean requiresClosing) { + this.requiresClosing = requiresClosing; + return this; + } + + /** + * Get requiresClosing + * + * @return requiresClosing + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUIRES_CLOSING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequiresClosing() { + return requiresClosing; + } + + @JsonProperty(JSON_PROPERTY_REQUIRES_CLOSING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequiresClosing(@org.eclipse.jdt.annotation.NonNull Boolean requiresClosing) { + this.requiresClosing = requiresClosing; + } + + public MediaSourceInfo liveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + return this; + } + + /** + * Get liveStreamId + * + * @return liveStreamId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLiveStreamId() { + return liveStreamId; + } + + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLiveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + } + + public MediaSourceInfo bufferMs(@org.eclipse.jdt.annotation.NonNull Integer bufferMs) { + this.bufferMs = bufferMs; + return this; + } + + /** + * Get bufferMs + * + * @return bufferMs + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BUFFER_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBufferMs() { + return bufferMs; + } + + @JsonProperty(JSON_PROPERTY_BUFFER_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBufferMs(@org.eclipse.jdt.annotation.NonNull Integer bufferMs) { + this.bufferMs = bufferMs; + } + + public MediaSourceInfo requiresLooping(@org.eclipse.jdt.annotation.NonNull Boolean requiresLooping) { + this.requiresLooping = requiresLooping; + return this; + } + + /** + * Get requiresLooping + * + * @return requiresLooping + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUIRES_LOOPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequiresLooping() { + return requiresLooping; + } + + @JsonProperty(JSON_PROPERTY_REQUIRES_LOOPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequiresLooping(@org.eclipse.jdt.annotation.NonNull Boolean requiresLooping) { + this.requiresLooping = requiresLooping; + } + + public MediaSourceInfo supportsProbing(@org.eclipse.jdt.annotation.NonNull Boolean supportsProbing) { + this.supportsProbing = supportsProbing; + return this; + } + + /** + * Get supportsProbing + * + * @return supportsProbing + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_PROBING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsProbing() { + return supportsProbing; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_PROBING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsProbing(@org.eclipse.jdt.annotation.NonNull Boolean supportsProbing) { + this.supportsProbing = supportsProbing; + } + + public MediaSourceInfo videoType(@org.eclipse.jdt.annotation.NonNull VideoType videoType) { + this.videoType = videoType; + return this; + } + + /** + * Get videoType + * + * @return videoType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public VideoType getVideoType() { + return videoType; + } + + @JsonProperty(JSON_PROPERTY_VIDEO_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVideoType(@org.eclipse.jdt.annotation.NonNull VideoType videoType) { + this.videoType = videoType; + } + + public MediaSourceInfo isoType(@org.eclipse.jdt.annotation.NonNull IsoType isoType) { + this.isoType = isoType; + return this; + } + + /** + * Get isoType + * + * @return isoType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ISO_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IsoType getIsoType() { + return isoType; + } + + @JsonProperty(JSON_PROPERTY_ISO_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsoType(@org.eclipse.jdt.annotation.NonNull IsoType isoType) { + this.isoType = isoType; + } + + public MediaSourceInfo video3DFormat(@org.eclipse.jdt.annotation.NonNull Video3DFormat video3DFormat) { + this.video3DFormat = video3DFormat; + return this; + } + + /** + * Get video3DFormat + * + * @return video3DFormat + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO3_D_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Video3DFormat getVideo3DFormat() { + return video3DFormat; + } + + @JsonProperty(JSON_PROPERTY_VIDEO3_D_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVideo3DFormat(@org.eclipse.jdt.annotation.NonNull Video3DFormat video3DFormat) { + this.video3DFormat = video3DFormat; + } + + public MediaSourceInfo mediaStreams(@org.eclipse.jdt.annotation.NonNull List mediaStreams) { + this.mediaStreams = mediaStreams; + return this; + } + + public MediaSourceInfo addMediaStreamsItem(MediaStream mediaStreamsItem) { + if (this.mediaStreams == null) { + this.mediaStreams = new ArrayList<>(); + } + this.mediaStreams.add(mediaStreamsItem); + return this; + } + + /** + * Get mediaStreams + * + * @return mediaStreams + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_STREAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMediaStreams() { + return mediaStreams; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_STREAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaStreams(@org.eclipse.jdt.annotation.NonNull List mediaStreams) { + this.mediaStreams = mediaStreams; + } + + public MediaSourceInfo mediaAttachments( + @org.eclipse.jdt.annotation.NonNull List mediaAttachments) { + this.mediaAttachments = mediaAttachments; + return this; + } + + public MediaSourceInfo addMediaAttachmentsItem(MediaAttachment mediaAttachmentsItem) { + if (this.mediaAttachments == null) { + this.mediaAttachments = new ArrayList<>(); + } + this.mediaAttachments.add(mediaAttachmentsItem); + return this; + } + + /** + * Get mediaAttachments + * + * @return mediaAttachments + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMediaAttachments() { + return mediaAttachments; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaAttachments(@org.eclipse.jdt.annotation.NonNull List mediaAttachments) { + this.mediaAttachments = mediaAttachments; + } + + public MediaSourceInfo formats(@org.eclipse.jdt.annotation.NonNull List formats) { + this.formats = formats; + return this; + } + + public MediaSourceInfo addFormatsItem(String formatsItem) { + if (this.formats == null) { + this.formats = new ArrayList<>(); + } + this.formats.add(formatsItem); + return this; + } + + /** + * Get formats + * + * @return formats + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FORMATS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormats() { + return formats; + } + + @JsonProperty(JSON_PROPERTY_FORMATS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormats(@org.eclipse.jdt.annotation.NonNull List formats) { + this.formats = formats; + } + + public MediaSourceInfo bitrate(@org.eclipse.jdt.annotation.NonNull Integer bitrate) { + this.bitrate = bitrate; + return this; + } + + /** + * Get bitrate + * + * @return bitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBitrate() { + return bitrate; + } + + @JsonProperty(JSON_PROPERTY_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBitrate(@org.eclipse.jdt.annotation.NonNull Integer bitrate) { + this.bitrate = bitrate; + } + + public MediaSourceInfo timestamp(@org.eclipse.jdt.annotation.NonNull TransportStreamTimestamp timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * + * @return timestamp + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransportStreamTimestamp getTimestamp() { + return timestamp; + } + + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimestamp(@org.eclipse.jdt.annotation.NonNull TransportStreamTimestamp timestamp) { + this.timestamp = timestamp; + } + + public MediaSourceInfo requiredHttpHeaders( + @org.eclipse.jdt.annotation.NonNull Map requiredHttpHeaders) { + this.requiredHttpHeaders = requiredHttpHeaders; + return this; + } + + public MediaSourceInfo putRequiredHttpHeadersItem(String key, String requiredHttpHeadersItem) { + if (this.requiredHttpHeaders == null) { + this.requiredHttpHeaders = new HashMap<>(); + } + this.requiredHttpHeaders.put(key, requiredHttpHeadersItem); + return this; + } + + /** + * Get requiredHttpHeaders + * + * @return requiredHttpHeaders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUIRED_HTTP_HEADERS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getRequiredHttpHeaders() { + return requiredHttpHeaders; + } + + @JsonProperty(JSON_PROPERTY_REQUIRED_HTTP_HEADERS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setRequiredHttpHeaders(@org.eclipse.jdt.annotation.NonNull Map requiredHttpHeaders) { + this.requiredHttpHeaders = requiredHttpHeaders; + } + + public MediaSourceInfo transcodingUrl(@org.eclipse.jdt.annotation.NonNull String transcodingUrl) { + this.transcodingUrl = transcodingUrl; + return this; + } + + /** + * Get transcodingUrl + * + * @return transcodingUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODING_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTranscodingUrl() { + return transcodingUrl; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODING_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodingUrl(@org.eclipse.jdt.annotation.NonNull String transcodingUrl) { + this.transcodingUrl = transcodingUrl; + } + + public MediaSourceInfo transcodingSubProtocol(@org.eclipse.jdt.annotation.NonNull String transcodingSubProtocol) { + this.transcodingSubProtocol = transcodingSubProtocol; + return this; + } + + /** + * Get transcodingSubProtocol + * + * @return transcodingSubProtocol + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODING_SUB_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTranscodingSubProtocol() { + return transcodingSubProtocol; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODING_SUB_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodingSubProtocol(@org.eclipse.jdt.annotation.NonNull String transcodingSubProtocol) { + this.transcodingSubProtocol = transcodingSubProtocol; + } + + public MediaSourceInfo transcodingContainer(@org.eclipse.jdt.annotation.NonNull String transcodingContainer) { + this.transcodingContainer = transcodingContainer; + return this; + } + + /** + * Get transcodingContainer + * + * @return transcodingContainer + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODING_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTranscodingContainer() { + return transcodingContainer; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODING_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodingContainer(@org.eclipse.jdt.annotation.NonNull String transcodingContainer) { + this.transcodingContainer = transcodingContainer; + } + + public MediaSourceInfo analyzeDurationMs(@org.eclipse.jdt.annotation.NonNull Integer analyzeDurationMs) { + this.analyzeDurationMs = analyzeDurationMs; + return this; + } + + /** + * Get analyzeDurationMs + * + * @return analyzeDurationMs + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ANALYZE_DURATION_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAnalyzeDurationMs() { + return analyzeDurationMs; + } + + @JsonProperty(JSON_PROPERTY_ANALYZE_DURATION_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAnalyzeDurationMs(@org.eclipse.jdt.annotation.NonNull Integer analyzeDurationMs) { + this.analyzeDurationMs = analyzeDurationMs; + } + + public MediaSourceInfo defaultAudioStreamIndex( + @org.eclipse.jdt.annotation.NonNull Integer defaultAudioStreamIndex) { + this.defaultAudioStreamIndex = defaultAudioStreamIndex; + return this; + } + + /** + * Get defaultAudioStreamIndex + * + * @return defaultAudioStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEFAULT_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDefaultAudioStreamIndex() { + return defaultAudioStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultAudioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer defaultAudioStreamIndex) { + this.defaultAudioStreamIndex = defaultAudioStreamIndex; + } + + public MediaSourceInfo defaultSubtitleStreamIndex( + @org.eclipse.jdt.annotation.NonNull Integer defaultSubtitleStreamIndex) { + this.defaultSubtitleStreamIndex = defaultSubtitleStreamIndex; + return this; + } + + /** + * Get defaultSubtitleStreamIndex + * + * @return defaultSubtitleStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEFAULT_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDefaultSubtitleStreamIndex() { + return defaultSubtitleStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultSubtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer defaultSubtitleStreamIndex) { + this.defaultSubtitleStreamIndex = defaultSubtitleStreamIndex; + } + + /** + * Return true if this MediaSourceInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaSourceInfo mediaSourceInfo = (MediaSourceInfo) o; + return Objects.equals(this.protocol, mediaSourceInfo.protocol) && Objects.equals(this.id, mediaSourceInfo.id) + && Objects.equals(this.path, mediaSourceInfo.path) + && Objects.equals(this.encoderPath, mediaSourceInfo.encoderPath) + && Objects.equals(this.encoderProtocol, mediaSourceInfo.encoderProtocol) + && Objects.equals(this.type, mediaSourceInfo.type) + && Objects.equals(this.container, mediaSourceInfo.container) + && Objects.equals(this.size, mediaSourceInfo.size) && Objects.equals(this.name, mediaSourceInfo.name) + && Objects.equals(this.isRemote, mediaSourceInfo.isRemote) + && Objects.equals(this.etag, mediaSourceInfo.etag) + && Objects.equals(this.runTimeTicks, mediaSourceInfo.runTimeTicks) + && Objects.equals(this.readAtNativeFramerate, mediaSourceInfo.readAtNativeFramerate) + && Objects.equals(this.ignoreDts, mediaSourceInfo.ignoreDts) + && Objects.equals(this.ignoreIndex, mediaSourceInfo.ignoreIndex) + && Objects.equals(this.genPtsInput, mediaSourceInfo.genPtsInput) + && Objects.equals(this.supportsTranscoding, mediaSourceInfo.supportsTranscoding) + && Objects.equals(this.supportsDirectStream, mediaSourceInfo.supportsDirectStream) + && Objects.equals(this.supportsDirectPlay, mediaSourceInfo.supportsDirectPlay) + && Objects.equals(this.isInfiniteStream, mediaSourceInfo.isInfiniteStream) + && Objects.equals(this.requiresOpening, mediaSourceInfo.requiresOpening) + && Objects.equals(this.openToken, mediaSourceInfo.openToken) + && Objects.equals(this.requiresClosing, mediaSourceInfo.requiresClosing) + && Objects.equals(this.liveStreamId, mediaSourceInfo.liveStreamId) + && Objects.equals(this.bufferMs, mediaSourceInfo.bufferMs) + && Objects.equals(this.requiresLooping, mediaSourceInfo.requiresLooping) + && Objects.equals(this.supportsProbing, mediaSourceInfo.supportsProbing) + && Objects.equals(this.videoType, mediaSourceInfo.videoType) + && Objects.equals(this.isoType, mediaSourceInfo.isoType) + && Objects.equals(this.video3DFormat, mediaSourceInfo.video3DFormat) + && Objects.equals(this.mediaStreams, mediaSourceInfo.mediaStreams) + && Objects.equals(this.mediaAttachments, mediaSourceInfo.mediaAttachments) + && Objects.equals(this.formats, mediaSourceInfo.formats) + && Objects.equals(this.bitrate, mediaSourceInfo.bitrate) + && Objects.equals(this.timestamp, mediaSourceInfo.timestamp) + && Objects.equals(this.requiredHttpHeaders, mediaSourceInfo.requiredHttpHeaders) + && Objects.equals(this.transcodingUrl, mediaSourceInfo.transcodingUrl) + && Objects.equals(this.transcodingSubProtocol, mediaSourceInfo.transcodingSubProtocol) + && Objects.equals(this.transcodingContainer, mediaSourceInfo.transcodingContainer) + && Objects.equals(this.analyzeDurationMs, mediaSourceInfo.analyzeDurationMs) + && Objects.equals(this.defaultAudioStreamIndex, mediaSourceInfo.defaultAudioStreamIndex) + && Objects.equals(this.defaultSubtitleStreamIndex, mediaSourceInfo.defaultSubtitleStreamIndex); + } + + @Override + public int hashCode() { + return Objects.hash(protocol, id, path, encoderPath, encoderProtocol, type, container, size, name, isRemote, + etag, runTimeTicks, readAtNativeFramerate, ignoreDts, ignoreIndex, genPtsInput, supportsTranscoding, + supportsDirectStream, supportsDirectPlay, isInfiniteStream, requiresOpening, openToken, requiresClosing, + liveStreamId, bufferMs, requiresLooping, supportsProbing, videoType, isoType, video3DFormat, + mediaStreams, mediaAttachments, formats, bitrate, timestamp, requiredHttpHeaders, transcodingUrl, + transcodingSubProtocol, transcodingContainer, analyzeDurationMs, defaultAudioStreamIndex, + defaultSubtitleStreamIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaSourceInfo {\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" encoderPath: ").append(toIndentedString(encoderPath)).append("\n"); + sb.append(" encoderProtocol: ").append(toIndentedString(encoderProtocol)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" isRemote: ").append(toIndentedString(isRemote)).append("\n"); + sb.append(" etag: ").append(toIndentedString(etag)).append("\n"); + sb.append(" runTimeTicks: ").append(toIndentedString(runTimeTicks)).append("\n"); + sb.append(" readAtNativeFramerate: ").append(toIndentedString(readAtNativeFramerate)).append("\n"); + sb.append(" ignoreDts: ").append(toIndentedString(ignoreDts)).append("\n"); + sb.append(" ignoreIndex: ").append(toIndentedString(ignoreIndex)).append("\n"); + sb.append(" genPtsInput: ").append(toIndentedString(genPtsInput)).append("\n"); + sb.append(" supportsTranscoding: ").append(toIndentedString(supportsTranscoding)).append("\n"); + sb.append(" supportsDirectStream: ").append(toIndentedString(supportsDirectStream)).append("\n"); + sb.append(" supportsDirectPlay: ").append(toIndentedString(supportsDirectPlay)).append("\n"); + sb.append(" isInfiniteStream: ").append(toIndentedString(isInfiniteStream)).append("\n"); + sb.append(" requiresOpening: ").append(toIndentedString(requiresOpening)).append("\n"); + sb.append(" openToken: ").append(toIndentedString(openToken)).append("\n"); + sb.append(" requiresClosing: ").append(toIndentedString(requiresClosing)).append("\n"); + sb.append(" liveStreamId: ").append(toIndentedString(liveStreamId)).append("\n"); + sb.append(" bufferMs: ").append(toIndentedString(bufferMs)).append("\n"); + sb.append(" requiresLooping: ").append(toIndentedString(requiresLooping)).append("\n"); + sb.append(" supportsProbing: ").append(toIndentedString(supportsProbing)).append("\n"); + sb.append(" videoType: ").append(toIndentedString(videoType)).append("\n"); + sb.append(" isoType: ").append(toIndentedString(isoType)).append("\n"); + sb.append(" video3DFormat: ").append(toIndentedString(video3DFormat)).append("\n"); + sb.append(" mediaStreams: ").append(toIndentedString(mediaStreams)).append("\n"); + sb.append(" mediaAttachments: ").append(toIndentedString(mediaAttachments)).append("\n"); + sb.append(" formats: ").append(toIndentedString(formats)).append("\n"); + sb.append(" bitrate: ").append(toIndentedString(bitrate)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" requiredHttpHeaders: ").append(toIndentedString(requiredHttpHeaders)).append("\n"); + sb.append(" transcodingUrl: ").append(toIndentedString(transcodingUrl)).append("\n"); + sb.append(" transcodingSubProtocol: ").append(toIndentedString(transcodingSubProtocol)).append("\n"); + sb.append(" transcodingContainer: ").append(toIndentedString(transcodingContainer)).append("\n"); + sb.append(" analyzeDurationMs: ").append(toIndentedString(analyzeDurationMs)).append("\n"); + sb.append(" defaultAudioStreamIndex: ").append(toIndentedString(defaultAudioStreamIndex)).append("\n"); + sb.append(" defaultSubtitleStreamIndex: ").append(toIndentedString(defaultSubtitleStreamIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Protocol` to the URL query string + if (getProtocol() != null) { + joiner.add(String.format("%sProtocol%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProtocol())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `EncoderPath` to the URL query string + if (getEncoderPath() != null) { + joiner.add(String.format("%sEncoderPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEncoderPath())))); + } + + // add `EncoderProtocol` to the URL query string + if (getEncoderProtocol() != null) { + joiner.add(String.format("%sEncoderProtocol%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEncoderProtocol())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + // add `Size` to the URL query string + if (getSize() != null) { + joiner.add(String.format("%sSize%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSize())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `IsRemote` to the URL query string + if (getIsRemote() != null) { + joiner.add(String.format("%sIsRemote%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsRemote())))); + } + + // add `ETag` to the URL query string + if (getEtag() != null) { + joiner.add(String.format("%sETag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEtag())))); + } + + // add `RunTimeTicks` to the URL query string + if (getRunTimeTicks() != null) { + joiner.add(String.format("%sRunTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRunTimeTicks())))); + } + + // add `ReadAtNativeFramerate` to the URL query string + if (getReadAtNativeFramerate() != null) { + joiner.add(String.format("%sReadAtNativeFramerate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getReadAtNativeFramerate())))); + } + + // add `IgnoreDts` to the URL query string + if (getIgnoreDts() != null) { + joiner.add(String.format("%sIgnoreDts%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIgnoreDts())))); + } + + // add `IgnoreIndex` to the URL query string + if (getIgnoreIndex() != null) { + joiner.add(String.format("%sIgnoreIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIgnoreIndex())))); + } + + // add `GenPtsInput` to the URL query string + if (getGenPtsInput() != null) { + joiner.add(String.format("%sGenPtsInput%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGenPtsInput())))); + } + + // add `SupportsTranscoding` to the URL query string + if (getSupportsTranscoding() != null) { + joiner.add(String.format("%sSupportsTranscoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsTranscoding())))); + } + + // add `SupportsDirectStream` to the URL query string + if (getSupportsDirectStream() != null) { + joiner.add(String.format("%sSupportsDirectStream%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsDirectStream())))); + } + + // add `SupportsDirectPlay` to the URL query string + if (getSupportsDirectPlay() != null) { + joiner.add(String.format("%sSupportsDirectPlay%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsDirectPlay())))); + } + + // add `IsInfiniteStream` to the URL query string + if (getIsInfiniteStream() != null) { + joiner.add(String.format("%sIsInfiniteStream%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsInfiniteStream())))); + } + + // add `RequiresOpening` to the URL query string + if (getRequiresOpening() != null) { + joiner.add(String.format("%sRequiresOpening%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRequiresOpening())))); + } + + // add `OpenToken` to the URL query string + if (getOpenToken() != null) { + joiner.add(String.format("%sOpenToken%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOpenToken())))); + } + + // add `RequiresClosing` to the URL query string + if (getRequiresClosing() != null) { + joiner.add(String.format("%sRequiresClosing%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRequiresClosing())))); + } + + // add `LiveStreamId` to the URL query string + if (getLiveStreamId() != null) { + joiner.add(String.format("%sLiveStreamId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLiveStreamId())))); + } + + // add `BufferMs` to the URL query string + if (getBufferMs() != null) { + joiner.add(String.format("%sBufferMs%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBufferMs())))); + } + + // add `RequiresLooping` to the URL query string + if (getRequiresLooping() != null) { + joiner.add(String.format("%sRequiresLooping%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRequiresLooping())))); + } + + // add `SupportsProbing` to the URL query string + if (getSupportsProbing() != null) { + joiner.add(String.format("%sSupportsProbing%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsProbing())))); + } + + // add `VideoType` to the URL query string + if (getVideoType() != null) { + joiner.add(String.format("%sVideoType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoType())))); + } + + // add `IsoType` to the URL query string + if (getIsoType() != null) { + joiner.add(String.format("%sIsoType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsoType())))); + } + + // add `Video3DFormat` to the URL query string + if (getVideo3DFormat() != null) { + joiner.add(String.format("%sVideo3DFormat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideo3DFormat())))); + } + + // add `MediaStreams` to the URL query string + if (getMediaStreams() != null) { + for (int i = 0; i < getMediaStreams().size(); i++) { + if (getMediaStreams().get(i) != null) { + joiner.add(getMediaStreams().get(i).toUrlQueryString(String.format("%sMediaStreams%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `MediaAttachments` to the URL query string + if (getMediaAttachments() != null) { + for (int i = 0; i < getMediaAttachments().size(); i++) { + if (getMediaAttachments().get(i) != null) { + joiner.add(getMediaAttachments().get(i).toUrlQueryString(String.format("%sMediaAttachments%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Formats` to the URL query string + if (getFormats() != null) { + for (int i = 0; i < getFormats().size(); i++) { + joiner.add(String.format("%sFormats%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getFormats().get(i))))); + } + } + + // add `Bitrate` to the URL query string + if (getBitrate() != null) { + joiner.add(String.format("%sBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBitrate())))); + } + + // add `Timestamp` to the URL query string + if (getTimestamp() != null) { + joiner.add(String.format("%sTimestamp%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTimestamp())))); + } + + // add `RequiredHttpHeaders` to the URL query string + if (getRequiredHttpHeaders() != null) { + for (String _key : getRequiredHttpHeaders().keySet()) { + joiner.add(String.format("%sRequiredHttpHeaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getRequiredHttpHeaders().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getRequiredHttpHeaders().get(_key))))); + } + } + + // add `TranscodingUrl` to the URL query string + if (getTranscodingUrl() != null) { + joiner.add(String.format("%sTranscodingUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTranscodingUrl())))); + } + + // add `TranscodingSubProtocol` to the URL query string + if (getTranscodingSubProtocol() != null) { + joiner.add(String.format("%sTranscodingSubProtocol%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTranscodingSubProtocol())))); + } + + // add `TranscodingContainer` to the URL query string + if (getTranscodingContainer() != null) { + joiner.add(String.format("%sTranscodingContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTranscodingContainer())))); + } + + // add `AnalyzeDurationMs` to the URL query string + if (getAnalyzeDurationMs() != null) { + joiner.add(String.format("%sAnalyzeDurationMs%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAnalyzeDurationMs())))); + } + + // add `DefaultAudioStreamIndex` to the URL query string + if (getDefaultAudioStreamIndex() != null) { + joiner.add(String.format("%sDefaultAudioStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDefaultAudioStreamIndex())))); + } + + // add `DefaultSubtitleStreamIndex` to the URL query string + if (getDefaultSubtitleStreamIndex() != null) { + joiner.add(String.format("%sDefaultSubtitleStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDefaultSubtitleStreamIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaSourceInfo instance; + + public Builder() { + this(new MediaSourceInfo()); + } + + protected Builder(MediaSourceInfo instance) { + this.instance = instance; + } + + public MediaSourceInfo.Builder protocol(MediaProtocol protocol) { + this.instance.protocol = protocol; + return this; + } + + public MediaSourceInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public MediaSourceInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public MediaSourceInfo.Builder encoderPath(String encoderPath) { + this.instance.encoderPath = encoderPath; + return this; + } + + public MediaSourceInfo.Builder encoderProtocol(MediaProtocol encoderProtocol) { + this.instance.encoderProtocol = encoderProtocol; + return this; + } + + public MediaSourceInfo.Builder type(MediaSourceType type) { + this.instance.type = type; + return this; + } + + public MediaSourceInfo.Builder container(String container) { + this.instance.container = container; + return this; + } + + public MediaSourceInfo.Builder size(Long size) { + this.instance.size = size; + return this; + } + + public MediaSourceInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public MediaSourceInfo.Builder isRemote(Boolean isRemote) { + this.instance.isRemote = isRemote; + return this; + } + + public MediaSourceInfo.Builder etag(String etag) { + this.instance.etag = etag; + return this; + } + + public MediaSourceInfo.Builder runTimeTicks(Long runTimeTicks) { + this.instance.runTimeTicks = runTimeTicks; + return this; + } + + public MediaSourceInfo.Builder readAtNativeFramerate(Boolean readAtNativeFramerate) { + this.instance.readAtNativeFramerate = readAtNativeFramerate; + return this; + } + + public MediaSourceInfo.Builder ignoreDts(Boolean ignoreDts) { + this.instance.ignoreDts = ignoreDts; + return this; + } + + public MediaSourceInfo.Builder ignoreIndex(Boolean ignoreIndex) { + this.instance.ignoreIndex = ignoreIndex; + return this; + } + + public MediaSourceInfo.Builder genPtsInput(Boolean genPtsInput) { + this.instance.genPtsInput = genPtsInput; + return this; + } + + public MediaSourceInfo.Builder supportsTranscoding(Boolean supportsTranscoding) { + this.instance.supportsTranscoding = supportsTranscoding; + return this; + } + + public MediaSourceInfo.Builder supportsDirectStream(Boolean supportsDirectStream) { + this.instance.supportsDirectStream = supportsDirectStream; + return this; + } + + public MediaSourceInfo.Builder supportsDirectPlay(Boolean supportsDirectPlay) { + this.instance.supportsDirectPlay = supportsDirectPlay; + return this; + } + + public MediaSourceInfo.Builder isInfiniteStream(Boolean isInfiniteStream) { + this.instance.isInfiniteStream = isInfiniteStream; + return this; + } + + public MediaSourceInfo.Builder requiresOpening(Boolean requiresOpening) { + this.instance.requiresOpening = requiresOpening; + return this; + } + + public MediaSourceInfo.Builder openToken(String openToken) { + this.instance.openToken = openToken; + return this; + } + + public MediaSourceInfo.Builder requiresClosing(Boolean requiresClosing) { + this.instance.requiresClosing = requiresClosing; + return this; + } + + public MediaSourceInfo.Builder liveStreamId(String liveStreamId) { + this.instance.liveStreamId = liveStreamId; + return this; + } + + public MediaSourceInfo.Builder bufferMs(Integer bufferMs) { + this.instance.bufferMs = bufferMs; + return this; + } + + public MediaSourceInfo.Builder requiresLooping(Boolean requiresLooping) { + this.instance.requiresLooping = requiresLooping; + return this; + } + + public MediaSourceInfo.Builder supportsProbing(Boolean supportsProbing) { + this.instance.supportsProbing = supportsProbing; + return this; + } + + public MediaSourceInfo.Builder videoType(VideoType videoType) { + this.instance.videoType = videoType; + return this; + } + + public MediaSourceInfo.Builder isoType(IsoType isoType) { + this.instance.isoType = isoType; + return this; + } + + public MediaSourceInfo.Builder video3DFormat(Video3DFormat video3DFormat) { + this.instance.video3DFormat = video3DFormat; + return this; + } + + public MediaSourceInfo.Builder mediaStreams(List mediaStreams) { + this.instance.mediaStreams = mediaStreams; + return this; + } + + public MediaSourceInfo.Builder mediaAttachments(List mediaAttachments) { + this.instance.mediaAttachments = mediaAttachments; + return this; + } + + public MediaSourceInfo.Builder formats(List formats) { + this.instance.formats = formats; + return this; + } + + public MediaSourceInfo.Builder bitrate(Integer bitrate) { + this.instance.bitrate = bitrate; + return this; + } + + public MediaSourceInfo.Builder timestamp(TransportStreamTimestamp timestamp) { + this.instance.timestamp = timestamp; + return this; + } + + public MediaSourceInfo.Builder requiredHttpHeaders(Map requiredHttpHeaders) { + this.instance.requiredHttpHeaders = requiredHttpHeaders; + return this; + } + + public MediaSourceInfo.Builder transcodingUrl(String transcodingUrl) { + this.instance.transcodingUrl = transcodingUrl; + return this; + } + + public MediaSourceInfo.Builder transcodingSubProtocol(String transcodingSubProtocol) { + this.instance.transcodingSubProtocol = transcodingSubProtocol; + return this; + } + + public MediaSourceInfo.Builder transcodingContainer(String transcodingContainer) { + this.instance.transcodingContainer = transcodingContainer; + return this; + } + + public MediaSourceInfo.Builder analyzeDurationMs(Integer analyzeDurationMs) { + this.instance.analyzeDurationMs = analyzeDurationMs; + return this; + } + + public MediaSourceInfo.Builder defaultAudioStreamIndex(Integer defaultAudioStreamIndex) { + this.instance.defaultAudioStreamIndex = defaultAudioStreamIndex; + return this; + } + + public MediaSourceInfo.Builder defaultSubtitleStreamIndex(Integer defaultSubtitleStreamIndex) { + this.instance.defaultSubtitleStreamIndex = defaultSubtitleStreamIndex; + return this; + } + + /** + * returns a built MediaSourceInfo instance. + * + * The builder is not reusable. + */ + public MediaSourceInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaSourceInfo.Builder builder() { + return new MediaSourceInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaSourceInfo.Builder toBuilder() { + return new MediaSourceInfo.Builder().protocol(getProtocol()).id(getId()).path(getPath()) + .encoderPath(getEncoderPath()).encoderProtocol(getEncoderProtocol()).type(getType()) + .container(getContainer()).size(getSize()).name(getName()).isRemote(getIsRemote()).etag(getEtag()) + .runTimeTicks(getRunTimeTicks()).readAtNativeFramerate(getReadAtNativeFramerate()) + .ignoreDts(getIgnoreDts()).ignoreIndex(getIgnoreIndex()).genPtsInput(getGenPtsInput()) + .supportsTranscoding(getSupportsTranscoding()).supportsDirectStream(getSupportsDirectStream()) + .supportsDirectPlay(getSupportsDirectPlay()).isInfiniteStream(getIsInfiniteStream()) + .requiresOpening(getRequiresOpening()).openToken(getOpenToken()).requiresClosing(getRequiresClosing()) + .liveStreamId(getLiveStreamId()).bufferMs(getBufferMs()).requiresLooping(getRequiresLooping()) + .supportsProbing(getSupportsProbing()).videoType(getVideoType()).isoType(getIsoType()) + .video3DFormat(getVideo3DFormat()).mediaStreams(getMediaStreams()) + .mediaAttachments(getMediaAttachments()).formats(getFormats()).bitrate(getBitrate()) + .timestamp(getTimestamp()).requiredHttpHeaders(getRequiredHttpHeaders()) + .transcodingUrl(getTranscodingUrl()).transcodingSubProtocol(getTranscodingSubProtocol()) + .transcodingContainer(getTranscodingContainer()).analyzeDurationMs(getAnalyzeDurationMs()) + .defaultAudioStreamIndex(getDefaultAudioStreamIndex()) + .defaultSubtitleStreamIndex(getDefaultSubtitleStreamIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaSourceType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaSourceType.java new file mode 100644 index 0000000000000..7fefe4343f173 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaSourceType.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets MediaSourceType + */ +public enum MediaSourceType { + + DEFAULT("Default"), + + GROUPING("Grouping"), + + PLACEHOLDER("Placeholder"); + + private String value; + + MediaSourceType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MediaSourceType fromValue(String value) { + for (MediaSourceType b : MediaSourceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaStream.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaStream.java new file mode 100644 index 0000000000000..ff6d69df043b3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaStream.java @@ -0,0 +1,2481 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class MediaStream. + */ +@JsonPropertyOrder({ MediaStream.JSON_PROPERTY_CODEC, MediaStream.JSON_PROPERTY_CODEC_TAG, + MediaStream.JSON_PROPERTY_LANGUAGE, MediaStream.JSON_PROPERTY_COLOR_RANGE, + MediaStream.JSON_PROPERTY_COLOR_SPACE, MediaStream.JSON_PROPERTY_COLOR_TRANSFER, + MediaStream.JSON_PROPERTY_COLOR_PRIMARIES, MediaStream.JSON_PROPERTY_DV_VERSION_MAJOR, + MediaStream.JSON_PROPERTY_DV_VERSION_MINOR, MediaStream.JSON_PROPERTY_DV_PROFILE, + MediaStream.JSON_PROPERTY_DV_LEVEL, MediaStream.JSON_PROPERTY_RPU_PRESENT_FLAG, + MediaStream.JSON_PROPERTY_EL_PRESENT_FLAG, MediaStream.JSON_PROPERTY_BL_PRESENT_FLAG, + MediaStream.JSON_PROPERTY_DV_BL_SIGNAL_COMPATIBILITY_ID, MediaStream.JSON_PROPERTY_COMMENT, + MediaStream.JSON_PROPERTY_TIME_BASE, MediaStream.JSON_PROPERTY_CODEC_TIME_BASE, MediaStream.JSON_PROPERTY_TITLE, + MediaStream.JSON_PROPERTY_VIDEO_RANGE, MediaStream.JSON_PROPERTY_VIDEO_RANGE_TYPE, + MediaStream.JSON_PROPERTY_VIDEO_DO_VI_TITLE, MediaStream.JSON_PROPERTY_LOCALIZED_UNDEFINED, + MediaStream.JSON_PROPERTY_LOCALIZED_DEFAULT, MediaStream.JSON_PROPERTY_LOCALIZED_FORCED, + MediaStream.JSON_PROPERTY_LOCALIZED_EXTERNAL, MediaStream.JSON_PROPERTY_DISPLAY_TITLE, + MediaStream.JSON_PROPERTY_NAL_LENGTH_SIZE, MediaStream.JSON_PROPERTY_IS_INTERLACED, + MediaStream.JSON_PROPERTY_IS_A_V_C, MediaStream.JSON_PROPERTY_CHANNEL_LAYOUT, + MediaStream.JSON_PROPERTY_BIT_RATE, MediaStream.JSON_PROPERTY_BIT_DEPTH, MediaStream.JSON_PROPERTY_REF_FRAMES, + MediaStream.JSON_PROPERTY_PACKET_LENGTH, MediaStream.JSON_PROPERTY_CHANNELS, + MediaStream.JSON_PROPERTY_SAMPLE_RATE, MediaStream.JSON_PROPERTY_IS_DEFAULT, + MediaStream.JSON_PROPERTY_IS_FORCED, MediaStream.JSON_PROPERTY_HEIGHT, MediaStream.JSON_PROPERTY_WIDTH, + MediaStream.JSON_PROPERTY_AVERAGE_FRAME_RATE, MediaStream.JSON_PROPERTY_REAL_FRAME_RATE, + MediaStream.JSON_PROPERTY_PROFILE, MediaStream.JSON_PROPERTY_TYPE, MediaStream.JSON_PROPERTY_ASPECT_RATIO, + MediaStream.JSON_PROPERTY_INDEX, MediaStream.JSON_PROPERTY_SCORE, MediaStream.JSON_PROPERTY_IS_EXTERNAL, + MediaStream.JSON_PROPERTY_DELIVERY_METHOD, MediaStream.JSON_PROPERTY_DELIVERY_URL, + MediaStream.JSON_PROPERTY_IS_EXTERNAL_URL, MediaStream.JSON_PROPERTY_IS_TEXT_SUBTITLE_STREAM, + MediaStream.JSON_PROPERTY_SUPPORTS_EXTERNAL_STREAM, MediaStream.JSON_PROPERTY_PATH, + MediaStream.JSON_PROPERTY_PIXEL_FORMAT, MediaStream.JSON_PROPERTY_LEVEL, + MediaStream.JSON_PROPERTY_IS_ANAMORPHIC }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaStream { + public static final String JSON_PROPERTY_CODEC = "Codec"; + @org.eclipse.jdt.annotation.NonNull + private String codec; + + public static final String JSON_PROPERTY_CODEC_TAG = "CodecTag"; + @org.eclipse.jdt.annotation.NonNull + private String codecTag; + + public static final String JSON_PROPERTY_LANGUAGE = "Language"; + @org.eclipse.jdt.annotation.NonNull + private String language; + + public static final String JSON_PROPERTY_COLOR_RANGE = "ColorRange"; + @org.eclipse.jdt.annotation.NonNull + private String colorRange; + + public static final String JSON_PROPERTY_COLOR_SPACE = "ColorSpace"; + @org.eclipse.jdt.annotation.NonNull + private String colorSpace; + + public static final String JSON_PROPERTY_COLOR_TRANSFER = "ColorTransfer"; + @org.eclipse.jdt.annotation.NonNull + private String colorTransfer; + + public static final String JSON_PROPERTY_COLOR_PRIMARIES = "ColorPrimaries"; + @org.eclipse.jdt.annotation.NonNull + private String colorPrimaries; + + public static final String JSON_PROPERTY_DV_VERSION_MAJOR = "DvVersionMajor"; + @org.eclipse.jdt.annotation.NonNull + private Integer dvVersionMajor; + + public static final String JSON_PROPERTY_DV_VERSION_MINOR = "DvVersionMinor"; + @org.eclipse.jdt.annotation.NonNull + private Integer dvVersionMinor; + + public static final String JSON_PROPERTY_DV_PROFILE = "DvProfile"; + @org.eclipse.jdt.annotation.NonNull + private Integer dvProfile; + + public static final String JSON_PROPERTY_DV_LEVEL = "DvLevel"; + @org.eclipse.jdt.annotation.NonNull + private Integer dvLevel; + + public static final String JSON_PROPERTY_RPU_PRESENT_FLAG = "RpuPresentFlag"; + @org.eclipse.jdt.annotation.NonNull + private Integer rpuPresentFlag; + + public static final String JSON_PROPERTY_EL_PRESENT_FLAG = "ElPresentFlag"; + @org.eclipse.jdt.annotation.NonNull + private Integer elPresentFlag; + + public static final String JSON_PROPERTY_BL_PRESENT_FLAG = "BlPresentFlag"; + @org.eclipse.jdt.annotation.NonNull + private Integer blPresentFlag; + + public static final String JSON_PROPERTY_DV_BL_SIGNAL_COMPATIBILITY_ID = "DvBlSignalCompatibilityId"; + @org.eclipse.jdt.annotation.NonNull + private Integer dvBlSignalCompatibilityId; + + public static final String JSON_PROPERTY_COMMENT = "Comment"; + @org.eclipse.jdt.annotation.NonNull + private String comment; + + public static final String JSON_PROPERTY_TIME_BASE = "TimeBase"; + @org.eclipse.jdt.annotation.NonNull + private String timeBase; + + public static final String JSON_PROPERTY_CODEC_TIME_BASE = "CodecTimeBase"; + @org.eclipse.jdt.annotation.NonNull + private String codecTimeBase; + + public static final String JSON_PROPERTY_TITLE = "Title"; + @org.eclipse.jdt.annotation.NonNull + private String title; + + public static final String JSON_PROPERTY_VIDEO_RANGE = "VideoRange"; + @org.eclipse.jdt.annotation.NonNull + private String videoRange; + + public static final String JSON_PROPERTY_VIDEO_RANGE_TYPE = "VideoRangeType"; + @org.eclipse.jdt.annotation.NonNull + private String videoRangeType; + + public static final String JSON_PROPERTY_VIDEO_DO_VI_TITLE = "VideoDoViTitle"; + @org.eclipse.jdt.annotation.NonNull + private String videoDoViTitle; + + public static final String JSON_PROPERTY_LOCALIZED_UNDEFINED = "LocalizedUndefined"; + @org.eclipse.jdt.annotation.NonNull + private String localizedUndefined; + + public static final String JSON_PROPERTY_LOCALIZED_DEFAULT = "LocalizedDefault"; + @org.eclipse.jdt.annotation.NonNull + private String localizedDefault; + + public static final String JSON_PROPERTY_LOCALIZED_FORCED = "LocalizedForced"; + @org.eclipse.jdt.annotation.NonNull + private String localizedForced; + + public static final String JSON_PROPERTY_LOCALIZED_EXTERNAL = "LocalizedExternal"; + @org.eclipse.jdt.annotation.NonNull + private String localizedExternal; + + public static final String JSON_PROPERTY_DISPLAY_TITLE = "DisplayTitle"; + @org.eclipse.jdt.annotation.NonNull + private String displayTitle; + + public static final String JSON_PROPERTY_NAL_LENGTH_SIZE = "NalLengthSize"; + @org.eclipse.jdt.annotation.NonNull + private String nalLengthSize; + + public static final String JSON_PROPERTY_IS_INTERLACED = "IsInterlaced"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isInterlaced; + + public static final String JSON_PROPERTY_IS_A_V_C = "IsAVC"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAVC; + + public static final String JSON_PROPERTY_CHANNEL_LAYOUT = "ChannelLayout"; + @org.eclipse.jdt.annotation.NonNull + private String channelLayout; + + public static final String JSON_PROPERTY_BIT_RATE = "BitRate"; + @org.eclipse.jdt.annotation.NonNull + private Integer bitRate; + + public static final String JSON_PROPERTY_BIT_DEPTH = "BitDepth"; + @org.eclipse.jdt.annotation.NonNull + private Integer bitDepth; + + public static final String JSON_PROPERTY_REF_FRAMES = "RefFrames"; + @org.eclipse.jdt.annotation.NonNull + private Integer refFrames; + + public static final String JSON_PROPERTY_PACKET_LENGTH = "PacketLength"; + @org.eclipse.jdt.annotation.NonNull + private Integer packetLength; + + public static final String JSON_PROPERTY_CHANNELS = "Channels"; + @org.eclipse.jdt.annotation.NonNull + private Integer channels; + + public static final String JSON_PROPERTY_SAMPLE_RATE = "SampleRate"; + @org.eclipse.jdt.annotation.NonNull + private Integer sampleRate; + + public static final String JSON_PROPERTY_IS_DEFAULT = "IsDefault"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isDefault; + + public static final String JSON_PROPERTY_IS_FORCED = "IsForced"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isForced; + + public static final String JSON_PROPERTY_HEIGHT = "Height"; + @org.eclipse.jdt.annotation.NonNull + private Integer height; + + public static final String JSON_PROPERTY_WIDTH = "Width"; + @org.eclipse.jdt.annotation.NonNull + private Integer width; + + public static final String JSON_PROPERTY_AVERAGE_FRAME_RATE = "AverageFrameRate"; + @org.eclipse.jdt.annotation.NonNull + private Float averageFrameRate; + + public static final String JSON_PROPERTY_REAL_FRAME_RATE = "RealFrameRate"; + @org.eclipse.jdt.annotation.NonNull + private Float realFrameRate; + + public static final String JSON_PROPERTY_PROFILE = "Profile"; + @org.eclipse.jdt.annotation.NonNull + private String profile; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private MediaStreamType type; + + public static final String JSON_PROPERTY_ASPECT_RATIO = "AspectRatio"; + @org.eclipse.jdt.annotation.NonNull + private String aspectRatio; + + public static final String JSON_PROPERTY_INDEX = "Index"; + @org.eclipse.jdt.annotation.NonNull + private Integer index; + + public static final String JSON_PROPERTY_SCORE = "Score"; + @org.eclipse.jdt.annotation.NonNull + private Integer score; + + public static final String JSON_PROPERTY_IS_EXTERNAL = "IsExternal"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isExternal; + + public static final String JSON_PROPERTY_DELIVERY_METHOD = "DeliveryMethod"; + @org.eclipse.jdt.annotation.NonNull + private SubtitleDeliveryMethod deliveryMethod; + + public static final String JSON_PROPERTY_DELIVERY_URL = "DeliveryUrl"; + @org.eclipse.jdt.annotation.NonNull + private String deliveryUrl; + + public static final String JSON_PROPERTY_IS_EXTERNAL_URL = "IsExternalUrl"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isExternalUrl; + + public static final String JSON_PROPERTY_IS_TEXT_SUBTITLE_STREAM = "IsTextSubtitleStream"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isTextSubtitleStream; + + public static final String JSON_PROPERTY_SUPPORTS_EXTERNAL_STREAM = "SupportsExternalStream"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsExternalStream; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_PIXEL_FORMAT = "PixelFormat"; + @org.eclipse.jdt.annotation.NonNull + private String pixelFormat; + + public static final String JSON_PROPERTY_LEVEL = "Level"; + @org.eclipse.jdt.annotation.NonNull + private Double level; + + public static final String JSON_PROPERTY_IS_ANAMORPHIC = "IsAnamorphic"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAnamorphic; + + public MediaStream() { + } + + @JsonCreator + public MediaStream(@JsonProperty(JSON_PROPERTY_VIDEO_RANGE) String videoRange, + @JsonProperty(JSON_PROPERTY_VIDEO_RANGE_TYPE) String videoRangeType, + @JsonProperty(JSON_PROPERTY_VIDEO_DO_VI_TITLE) String videoDoViTitle, + @JsonProperty(JSON_PROPERTY_DISPLAY_TITLE) String displayTitle, + @JsonProperty(JSON_PROPERTY_IS_TEXT_SUBTITLE_STREAM) Boolean isTextSubtitleStream) { + this(); + this.videoRange = videoRange; + this.videoRangeType = videoRangeType; + this.videoDoViTitle = videoDoViTitle; + this.displayTitle = displayTitle; + this.isTextSubtitleStream = isTextSubtitleStream; + } + + public MediaStream codec(@org.eclipse.jdt.annotation.NonNull String codec) { + this.codec = codec; + return this; + } + + /** + * Gets or sets the codec. + * + * @return codec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCodec() { + return codec; + } + + @JsonProperty(JSON_PROPERTY_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCodec(@org.eclipse.jdt.annotation.NonNull String codec) { + this.codec = codec; + } + + public MediaStream codecTag(@org.eclipse.jdt.annotation.NonNull String codecTag) { + this.codecTag = codecTag; + return this; + } + + /** + * Gets or sets the codec tag. + * + * @return codecTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODEC_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCodecTag() { + return codecTag; + } + + @JsonProperty(JSON_PROPERTY_CODEC_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCodecTag(@org.eclipse.jdt.annotation.NonNull String codecTag) { + this.codecTag = codecTag; + } + + public MediaStream language(@org.eclipse.jdt.annotation.NonNull String language) { + this.language = language; + return this; + } + + /** + * Gets or sets the language. + * + * @return language + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLanguage() { + return language; + } + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLanguage(@org.eclipse.jdt.annotation.NonNull String language) { + this.language = language; + } + + public MediaStream colorRange(@org.eclipse.jdt.annotation.NonNull String colorRange) { + this.colorRange = colorRange; + return this; + } + + /** + * Gets or sets the color range. + * + * @return colorRange + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COLOR_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColorRange() { + return colorRange; + } + + @JsonProperty(JSON_PROPERTY_COLOR_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColorRange(@org.eclipse.jdt.annotation.NonNull String colorRange) { + this.colorRange = colorRange; + } + + public MediaStream colorSpace(@org.eclipse.jdt.annotation.NonNull String colorSpace) { + this.colorSpace = colorSpace; + return this; + } + + /** + * Gets or sets the color space. + * + * @return colorSpace + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COLOR_SPACE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColorSpace() { + return colorSpace; + } + + @JsonProperty(JSON_PROPERTY_COLOR_SPACE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColorSpace(@org.eclipse.jdt.annotation.NonNull String colorSpace) { + this.colorSpace = colorSpace; + } + + public MediaStream colorTransfer(@org.eclipse.jdt.annotation.NonNull String colorTransfer) { + this.colorTransfer = colorTransfer; + return this; + } + + /** + * Gets or sets the color transfer. + * + * @return colorTransfer + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COLOR_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColorTransfer() { + return colorTransfer; + } + + @JsonProperty(JSON_PROPERTY_COLOR_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColorTransfer(@org.eclipse.jdt.annotation.NonNull String colorTransfer) { + this.colorTransfer = colorTransfer; + } + + public MediaStream colorPrimaries(@org.eclipse.jdt.annotation.NonNull String colorPrimaries) { + this.colorPrimaries = colorPrimaries; + return this; + } + + /** + * Gets or sets the color primaries. + * + * @return colorPrimaries + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COLOR_PRIMARIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColorPrimaries() { + return colorPrimaries; + } + + @JsonProperty(JSON_PROPERTY_COLOR_PRIMARIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColorPrimaries(@org.eclipse.jdt.annotation.NonNull String colorPrimaries) { + this.colorPrimaries = colorPrimaries; + } + + public MediaStream dvVersionMajor(@org.eclipse.jdt.annotation.NonNull Integer dvVersionMajor) { + this.dvVersionMajor = dvVersionMajor; + return this; + } + + /** + * Gets or sets the Dolby Vision version major. + * + * @return dvVersionMajor + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DV_VERSION_MAJOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDvVersionMajor() { + return dvVersionMajor; + } + + @JsonProperty(JSON_PROPERTY_DV_VERSION_MAJOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDvVersionMajor(@org.eclipse.jdt.annotation.NonNull Integer dvVersionMajor) { + this.dvVersionMajor = dvVersionMajor; + } + + public MediaStream dvVersionMinor(@org.eclipse.jdt.annotation.NonNull Integer dvVersionMinor) { + this.dvVersionMinor = dvVersionMinor; + return this; + } + + /** + * Gets or sets the Dolby Vision version minor. + * + * @return dvVersionMinor + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DV_VERSION_MINOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDvVersionMinor() { + return dvVersionMinor; + } + + @JsonProperty(JSON_PROPERTY_DV_VERSION_MINOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDvVersionMinor(@org.eclipse.jdt.annotation.NonNull Integer dvVersionMinor) { + this.dvVersionMinor = dvVersionMinor; + } + + public MediaStream dvProfile(@org.eclipse.jdt.annotation.NonNull Integer dvProfile) { + this.dvProfile = dvProfile; + return this; + } + + /** + * Gets or sets the Dolby Vision profile. + * + * @return dvProfile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DV_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDvProfile() { + return dvProfile; + } + + @JsonProperty(JSON_PROPERTY_DV_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDvProfile(@org.eclipse.jdt.annotation.NonNull Integer dvProfile) { + this.dvProfile = dvProfile; + } + + public MediaStream dvLevel(@org.eclipse.jdt.annotation.NonNull Integer dvLevel) { + this.dvLevel = dvLevel; + return this; + } + + /** + * Gets or sets the Dolby Vision level. + * + * @return dvLevel + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DV_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDvLevel() { + return dvLevel; + } + + @JsonProperty(JSON_PROPERTY_DV_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDvLevel(@org.eclipse.jdt.annotation.NonNull Integer dvLevel) { + this.dvLevel = dvLevel; + } + + public MediaStream rpuPresentFlag(@org.eclipse.jdt.annotation.NonNull Integer rpuPresentFlag) { + this.rpuPresentFlag = rpuPresentFlag; + return this; + } + + /** + * Gets or sets the Dolby Vision rpu present flag. + * + * @return rpuPresentFlag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RPU_PRESENT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRpuPresentFlag() { + return rpuPresentFlag; + } + + @JsonProperty(JSON_PROPERTY_RPU_PRESENT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRpuPresentFlag(@org.eclipse.jdt.annotation.NonNull Integer rpuPresentFlag) { + this.rpuPresentFlag = rpuPresentFlag; + } + + public MediaStream elPresentFlag(@org.eclipse.jdt.annotation.NonNull Integer elPresentFlag) { + this.elPresentFlag = elPresentFlag; + return this; + } + + /** + * Gets or sets the Dolby Vision el present flag. + * + * @return elPresentFlag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EL_PRESENT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getElPresentFlag() { + return elPresentFlag; + } + + @JsonProperty(JSON_PROPERTY_EL_PRESENT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setElPresentFlag(@org.eclipse.jdt.annotation.NonNull Integer elPresentFlag) { + this.elPresentFlag = elPresentFlag; + } + + public MediaStream blPresentFlag(@org.eclipse.jdt.annotation.NonNull Integer blPresentFlag) { + this.blPresentFlag = blPresentFlag; + return this; + } + + /** + * Gets or sets the Dolby Vision bl present flag. + * + * @return blPresentFlag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BL_PRESENT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBlPresentFlag() { + return blPresentFlag; + } + + @JsonProperty(JSON_PROPERTY_BL_PRESENT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlPresentFlag(@org.eclipse.jdt.annotation.NonNull Integer blPresentFlag) { + this.blPresentFlag = blPresentFlag; + } + + public MediaStream dvBlSignalCompatibilityId( + @org.eclipse.jdt.annotation.NonNull Integer dvBlSignalCompatibilityId) { + this.dvBlSignalCompatibilityId = dvBlSignalCompatibilityId; + return this; + } + + /** + * Gets or sets the Dolby Vision bl signal compatibility id. + * + * @return dvBlSignalCompatibilityId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DV_BL_SIGNAL_COMPATIBILITY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDvBlSignalCompatibilityId() { + return dvBlSignalCompatibilityId; + } + + @JsonProperty(JSON_PROPERTY_DV_BL_SIGNAL_COMPATIBILITY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDvBlSignalCompatibilityId(@org.eclipse.jdt.annotation.NonNull Integer dvBlSignalCompatibilityId) { + this.dvBlSignalCompatibilityId = dvBlSignalCompatibilityId; + } + + public MediaStream comment(@org.eclipse.jdt.annotation.NonNull String comment) { + this.comment = comment; + return this; + } + + /** + * Gets or sets the comment. + * + * @return comment + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getComment() { + return comment; + } + + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComment(@org.eclipse.jdt.annotation.NonNull String comment) { + this.comment = comment; + } + + public MediaStream timeBase(@org.eclipse.jdt.annotation.NonNull String timeBase) { + this.timeBase = timeBase; + return this; + } + + /** + * Gets or sets the time base. + * + * @return timeBase + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TIME_BASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTimeBase() { + return timeBase; + } + + @JsonProperty(JSON_PROPERTY_TIME_BASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimeBase(@org.eclipse.jdt.annotation.NonNull String timeBase) { + this.timeBase = timeBase; + } + + public MediaStream codecTimeBase(@org.eclipse.jdt.annotation.NonNull String codecTimeBase) { + this.codecTimeBase = codecTimeBase; + return this; + } + + /** + * Gets or sets the codec time base. + * + * @return codecTimeBase + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODEC_TIME_BASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCodecTimeBase() { + return codecTimeBase; + } + + @JsonProperty(JSON_PROPERTY_CODEC_TIME_BASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCodecTimeBase(@org.eclipse.jdt.annotation.NonNull String codecTimeBase) { + this.codecTimeBase = codecTimeBase; + } + + public MediaStream title(@org.eclipse.jdt.annotation.NonNull String title) { + this.title = title; + return this; + } + + /** + * Gets or sets the title. + * + * @return title + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@org.eclipse.jdt.annotation.NonNull String title) { + this.title = title; + } + + /** + * Gets the video range. + * + * @return videoRange + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVideoRange() { + return videoRange; + } + + /** + * Gets the video range type. + * + * @return videoRangeType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_RANGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVideoRangeType() { + return videoRangeType; + } + + /** + * Gets the video dovi title. + * + * @return videoDoViTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_DO_VI_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVideoDoViTitle() { + return videoDoViTitle; + } + + public MediaStream localizedUndefined(@org.eclipse.jdt.annotation.NonNull String localizedUndefined) { + this.localizedUndefined = localizedUndefined; + return this; + } + + /** + * Get localizedUndefined + * + * @return localizedUndefined + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCALIZED_UNDEFINED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocalizedUndefined() { + return localizedUndefined; + } + + @JsonProperty(JSON_PROPERTY_LOCALIZED_UNDEFINED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalizedUndefined(@org.eclipse.jdt.annotation.NonNull String localizedUndefined) { + this.localizedUndefined = localizedUndefined; + } + + public MediaStream localizedDefault(@org.eclipse.jdt.annotation.NonNull String localizedDefault) { + this.localizedDefault = localizedDefault; + return this; + } + + /** + * Get localizedDefault + * + * @return localizedDefault + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCALIZED_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocalizedDefault() { + return localizedDefault; + } + + @JsonProperty(JSON_PROPERTY_LOCALIZED_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalizedDefault(@org.eclipse.jdt.annotation.NonNull String localizedDefault) { + this.localizedDefault = localizedDefault; + } + + public MediaStream localizedForced(@org.eclipse.jdt.annotation.NonNull String localizedForced) { + this.localizedForced = localizedForced; + return this; + } + + /** + * Get localizedForced + * + * @return localizedForced + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCALIZED_FORCED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocalizedForced() { + return localizedForced; + } + + @JsonProperty(JSON_PROPERTY_LOCALIZED_FORCED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalizedForced(@org.eclipse.jdt.annotation.NonNull String localizedForced) { + this.localizedForced = localizedForced; + } + + public MediaStream localizedExternal(@org.eclipse.jdt.annotation.NonNull String localizedExternal) { + this.localizedExternal = localizedExternal; + return this; + } + + /** + * Get localizedExternal + * + * @return localizedExternal + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCALIZED_EXTERNAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocalizedExternal() { + return localizedExternal; + } + + @JsonProperty(JSON_PROPERTY_LOCALIZED_EXTERNAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalizedExternal(@org.eclipse.jdt.annotation.NonNull String localizedExternal) { + this.localizedExternal = localizedExternal; + } + + /** + * Get displayTitle + * + * @return displayTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayTitle() { + return displayTitle; + } + + public MediaStream nalLengthSize(@org.eclipse.jdt.annotation.NonNull String nalLengthSize) { + this.nalLengthSize = nalLengthSize; + return this; + } + + /** + * Get nalLengthSize + * + * @return nalLengthSize + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAL_LENGTH_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNalLengthSize() { + return nalLengthSize; + } + + @JsonProperty(JSON_PROPERTY_NAL_LENGTH_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNalLengthSize(@org.eclipse.jdt.annotation.NonNull String nalLengthSize) { + this.nalLengthSize = nalLengthSize; + } + + public MediaStream isInterlaced(@org.eclipse.jdt.annotation.NonNull Boolean isInterlaced) { + this.isInterlaced = isInterlaced; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is interlaced. + * + * @return isInterlaced + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_INTERLACED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsInterlaced() { + return isInterlaced; + } + + @JsonProperty(JSON_PROPERTY_IS_INTERLACED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsInterlaced(@org.eclipse.jdt.annotation.NonNull Boolean isInterlaced) { + this.isInterlaced = isInterlaced; + } + + public MediaStream isAVC(@org.eclipse.jdt.annotation.NonNull Boolean isAVC) { + this.isAVC = isAVC; + return this; + } + + /** + * Get isAVC + * + * @return isAVC + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_A_V_C) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAVC() { + return isAVC; + } + + @JsonProperty(JSON_PROPERTY_IS_A_V_C) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAVC(@org.eclipse.jdt.annotation.NonNull Boolean isAVC) { + this.isAVC = isAVC; + } + + public MediaStream channelLayout(@org.eclipse.jdt.annotation.NonNull String channelLayout) { + this.channelLayout = channelLayout; + return this; + } + + /** + * Gets or sets the channel layout. + * + * @return channelLayout + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_LAYOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelLayout() { + return channelLayout; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_LAYOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelLayout(@org.eclipse.jdt.annotation.NonNull String channelLayout) { + this.channelLayout = channelLayout; + } + + public MediaStream bitRate(@org.eclipse.jdt.annotation.NonNull Integer bitRate) { + this.bitRate = bitRate; + return this; + } + + /** + * Gets or sets the bit rate. + * + * @return bitRate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BIT_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBitRate() { + return bitRate; + } + + @JsonProperty(JSON_PROPERTY_BIT_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBitRate(@org.eclipse.jdt.annotation.NonNull Integer bitRate) { + this.bitRate = bitRate; + } + + public MediaStream bitDepth(@org.eclipse.jdt.annotation.NonNull Integer bitDepth) { + this.bitDepth = bitDepth; + return this; + } + + /** + * Gets or sets the bit depth. + * + * @return bitDepth + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BIT_DEPTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBitDepth() { + return bitDepth; + } + + @JsonProperty(JSON_PROPERTY_BIT_DEPTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBitDepth(@org.eclipse.jdt.annotation.NonNull Integer bitDepth) { + this.bitDepth = bitDepth; + } + + public MediaStream refFrames(@org.eclipse.jdt.annotation.NonNull Integer refFrames) { + this.refFrames = refFrames; + return this; + } + + /** + * Gets or sets the reference frames. + * + * @return refFrames + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REF_FRAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRefFrames() { + return refFrames; + } + + @JsonProperty(JSON_PROPERTY_REF_FRAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRefFrames(@org.eclipse.jdt.annotation.NonNull Integer refFrames) { + this.refFrames = refFrames; + } + + public MediaStream packetLength(@org.eclipse.jdt.annotation.NonNull Integer packetLength) { + this.packetLength = packetLength; + return this; + } + + /** + * Gets or sets the length of the packet. + * + * @return packetLength + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PACKET_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPacketLength() { + return packetLength; + } + + @JsonProperty(JSON_PROPERTY_PACKET_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPacketLength(@org.eclipse.jdt.annotation.NonNull Integer packetLength) { + this.packetLength = packetLength; + } + + public MediaStream channels(@org.eclipse.jdt.annotation.NonNull Integer channels) { + this.channels = channels; + return this; + } + + /** + * Gets or sets the channels. + * + * @return channels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getChannels() { + return channels; + } + + @JsonProperty(JSON_PROPERTY_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannels(@org.eclipse.jdt.annotation.NonNull Integer channels) { + this.channels = channels; + } + + public MediaStream sampleRate(@org.eclipse.jdt.annotation.NonNull Integer sampleRate) { + this.sampleRate = sampleRate; + return this; + } + + /** + * Gets or sets the sample rate. + * + * @return sampleRate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SAMPLE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSampleRate() { + return sampleRate; + } + + @JsonProperty(JSON_PROPERTY_SAMPLE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSampleRate(@org.eclipse.jdt.annotation.NonNull Integer sampleRate) { + this.sampleRate = sampleRate; + } + + public MediaStream isDefault(@org.eclipse.jdt.annotation.NonNull Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is default. + * + * @return isDefault + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsDefault() { + return isDefault; + } + + @JsonProperty(JSON_PROPERTY_IS_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDefault(@org.eclipse.jdt.annotation.NonNull Boolean isDefault) { + this.isDefault = isDefault; + } + + public MediaStream isForced(@org.eclipse.jdt.annotation.NonNull Boolean isForced) { + this.isForced = isForced; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is forced. + * + * @return isForced + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_FORCED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsForced() { + return isForced; + } + + @JsonProperty(JSON_PROPERTY_IS_FORCED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsForced(@org.eclipse.jdt.annotation.NonNull Boolean isForced) { + this.isForced = isForced; + } + + public MediaStream height(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + return this; + } + + /** + * Gets or sets the height. + * + * @return height + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHeight() { + return height; + } + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + } + + public MediaStream width(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + return this; + } + + /** + * Gets or sets the width. + * + * @return width + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + } + + public MediaStream averageFrameRate(@org.eclipse.jdt.annotation.NonNull Float averageFrameRate) { + this.averageFrameRate = averageFrameRate; + return this; + } + + /** + * Gets or sets the average frame rate. + * + * @return averageFrameRate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AVERAGE_FRAME_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getAverageFrameRate() { + return averageFrameRate; + } + + @JsonProperty(JSON_PROPERTY_AVERAGE_FRAME_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAverageFrameRate(@org.eclipse.jdt.annotation.NonNull Float averageFrameRate) { + this.averageFrameRate = averageFrameRate; + } + + public MediaStream realFrameRate(@org.eclipse.jdt.annotation.NonNull Float realFrameRate) { + this.realFrameRate = realFrameRate; + return this; + } + + /** + * Gets or sets the real frame rate. + * + * @return realFrameRate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REAL_FRAME_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getRealFrameRate() { + return realFrameRate; + } + + @JsonProperty(JSON_PROPERTY_REAL_FRAME_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRealFrameRate(@org.eclipse.jdt.annotation.NonNull Float realFrameRate) { + this.realFrameRate = realFrameRate; + } + + public MediaStream profile(@org.eclipse.jdt.annotation.NonNull String profile) { + this.profile = profile; + return this; + } + + /** + * Gets or sets the profile. + * + * @return profile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProfile() { + return profile; + } + + @JsonProperty(JSON_PROPERTY_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProfile(@org.eclipse.jdt.annotation.NonNull String profile) { + this.profile = profile; + } + + public MediaStream type(@org.eclipse.jdt.annotation.NonNull MediaStreamType type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MediaStreamType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull MediaStreamType type) { + this.type = type; + } + + public MediaStream aspectRatio(@org.eclipse.jdt.annotation.NonNull String aspectRatio) { + this.aspectRatio = aspectRatio; + return this; + } + + /** + * Gets or sets the aspect ratio. + * + * @return aspectRatio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAspectRatio() { + return aspectRatio; + } + + @JsonProperty(JSON_PROPERTY_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAspectRatio(@org.eclipse.jdt.annotation.NonNull String aspectRatio) { + this.aspectRatio = aspectRatio; + } + + public MediaStream index(@org.eclipse.jdt.annotation.NonNull Integer index) { + this.index = index; + return this; + } + + /** + * Gets or sets the index. + * + * @return index + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndex() { + return index; + } + + @JsonProperty(JSON_PROPERTY_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndex(@org.eclipse.jdt.annotation.NonNull Integer index) { + this.index = index; + } + + public MediaStream score(@org.eclipse.jdt.annotation.NonNull Integer score) { + this.score = score; + return this; + } + + /** + * Gets or sets the score. + * + * @return score + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SCORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getScore() { + return score; + } + + @JsonProperty(JSON_PROPERTY_SCORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScore(@org.eclipse.jdt.annotation.NonNull Integer score) { + this.score = score; + } + + public MediaStream isExternal(@org.eclipse.jdt.annotation.NonNull Boolean isExternal) { + this.isExternal = isExternal; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is external. + * + * @return isExternal + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_EXTERNAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsExternal() { + return isExternal; + } + + @JsonProperty(JSON_PROPERTY_IS_EXTERNAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsExternal(@org.eclipse.jdt.annotation.NonNull Boolean isExternal) { + this.isExternal = isExternal; + } + + public MediaStream deliveryMethod(@org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod deliveryMethod) { + this.deliveryMethod = deliveryMethod; + return this; + } + + /** + * Gets or sets the method. + * + * @return deliveryMethod + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DELIVERY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubtitleDeliveryMethod getDeliveryMethod() { + return deliveryMethod; + } + + @JsonProperty(JSON_PROPERTY_DELIVERY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeliveryMethod(@org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod deliveryMethod) { + this.deliveryMethod = deliveryMethod; + } + + public MediaStream deliveryUrl(@org.eclipse.jdt.annotation.NonNull String deliveryUrl) { + this.deliveryUrl = deliveryUrl; + return this; + } + + /** + * Gets or sets the delivery URL. + * + * @return deliveryUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DELIVERY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeliveryUrl() { + return deliveryUrl; + } + + @JsonProperty(JSON_PROPERTY_DELIVERY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeliveryUrl(@org.eclipse.jdt.annotation.NonNull String deliveryUrl) { + this.deliveryUrl = deliveryUrl; + } + + public MediaStream isExternalUrl(@org.eclipse.jdt.annotation.NonNull Boolean isExternalUrl) { + this.isExternalUrl = isExternalUrl; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is external URL. + * + * @return isExternalUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_EXTERNAL_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsExternalUrl() { + return isExternalUrl; + } + + @JsonProperty(JSON_PROPERTY_IS_EXTERNAL_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsExternalUrl(@org.eclipse.jdt.annotation.NonNull Boolean isExternalUrl) { + this.isExternalUrl = isExternalUrl; + } + + /** + * Get isTextSubtitleStream + * + * @return isTextSubtitleStream + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_TEXT_SUBTITLE_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsTextSubtitleStream() { + return isTextSubtitleStream; + } + + public MediaStream supportsExternalStream(@org.eclipse.jdt.annotation.NonNull Boolean supportsExternalStream) { + this.supportsExternalStream = supportsExternalStream; + return this; + } + + /** + * Gets or sets a value indicating whether [supports external stream]. + * + * @return supportsExternalStream + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_EXTERNAL_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsExternalStream() { + return supportsExternalStream; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_EXTERNAL_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsExternalStream(@org.eclipse.jdt.annotation.NonNull Boolean supportsExternalStream) { + this.supportsExternalStream = supportsExternalStream; + } + + public MediaStream path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the filename. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public MediaStream pixelFormat(@org.eclipse.jdt.annotation.NonNull String pixelFormat) { + this.pixelFormat = pixelFormat; + return this; + } + + /** + * Gets or sets the pixel format. + * + * @return pixelFormat + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PIXEL_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPixelFormat() { + return pixelFormat; + } + + @JsonProperty(JSON_PROPERTY_PIXEL_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPixelFormat(@org.eclipse.jdt.annotation.NonNull String pixelFormat) { + this.pixelFormat = pixelFormat; + } + + public MediaStream level(@org.eclipse.jdt.annotation.NonNull Double level) { + this.level = level; + return this; + } + + /** + * Gets or sets the level. + * + * @return level + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getLevel() { + return level; + } + + @JsonProperty(JSON_PROPERTY_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLevel(@org.eclipse.jdt.annotation.NonNull Double level) { + this.level = level; + } + + public MediaStream isAnamorphic(@org.eclipse.jdt.annotation.NonNull Boolean isAnamorphic) { + this.isAnamorphic = isAnamorphic; + return this; + } + + /** + * Gets or sets whether this instance is anamorphic. + * + * @return isAnamorphic + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_ANAMORPHIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAnamorphic() { + return isAnamorphic; + } + + @JsonProperty(JSON_PROPERTY_IS_ANAMORPHIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAnamorphic(@org.eclipse.jdt.annotation.NonNull Boolean isAnamorphic) { + this.isAnamorphic = isAnamorphic; + } + + /** + * Return true if this MediaStream object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaStream mediaStream = (MediaStream) o; + return Objects.equals(this.codec, mediaStream.codec) && Objects.equals(this.codecTag, mediaStream.codecTag) + && Objects.equals(this.language, mediaStream.language) + && Objects.equals(this.colorRange, mediaStream.colorRange) + && Objects.equals(this.colorSpace, mediaStream.colorSpace) + && Objects.equals(this.colorTransfer, mediaStream.colorTransfer) + && Objects.equals(this.colorPrimaries, mediaStream.colorPrimaries) + && Objects.equals(this.dvVersionMajor, mediaStream.dvVersionMajor) + && Objects.equals(this.dvVersionMinor, mediaStream.dvVersionMinor) + && Objects.equals(this.dvProfile, mediaStream.dvProfile) + && Objects.equals(this.dvLevel, mediaStream.dvLevel) + && Objects.equals(this.rpuPresentFlag, mediaStream.rpuPresentFlag) + && Objects.equals(this.elPresentFlag, mediaStream.elPresentFlag) + && Objects.equals(this.blPresentFlag, mediaStream.blPresentFlag) + && Objects.equals(this.dvBlSignalCompatibilityId, mediaStream.dvBlSignalCompatibilityId) + && Objects.equals(this.comment, mediaStream.comment) + && Objects.equals(this.timeBase, mediaStream.timeBase) + && Objects.equals(this.codecTimeBase, mediaStream.codecTimeBase) + && Objects.equals(this.title, mediaStream.title) + && Objects.equals(this.videoRange, mediaStream.videoRange) + && Objects.equals(this.videoRangeType, mediaStream.videoRangeType) + && Objects.equals(this.videoDoViTitle, mediaStream.videoDoViTitle) + && Objects.equals(this.localizedUndefined, mediaStream.localizedUndefined) + && Objects.equals(this.localizedDefault, mediaStream.localizedDefault) + && Objects.equals(this.localizedForced, mediaStream.localizedForced) + && Objects.equals(this.localizedExternal, mediaStream.localizedExternal) + && Objects.equals(this.displayTitle, mediaStream.displayTitle) + && Objects.equals(this.nalLengthSize, mediaStream.nalLengthSize) + && Objects.equals(this.isInterlaced, mediaStream.isInterlaced) + && Objects.equals(this.isAVC, mediaStream.isAVC) + && Objects.equals(this.channelLayout, mediaStream.channelLayout) + && Objects.equals(this.bitRate, mediaStream.bitRate) + && Objects.equals(this.bitDepth, mediaStream.bitDepth) + && Objects.equals(this.refFrames, mediaStream.refFrames) + && Objects.equals(this.packetLength, mediaStream.packetLength) + && Objects.equals(this.channels, mediaStream.channels) + && Objects.equals(this.sampleRate, mediaStream.sampleRate) + && Objects.equals(this.isDefault, mediaStream.isDefault) + && Objects.equals(this.isForced, mediaStream.isForced) + && Objects.equals(this.height, mediaStream.height) && Objects.equals(this.width, mediaStream.width) + && Objects.equals(this.averageFrameRate, mediaStream.averageFrameRate) + && Objects.equals(this.realFrameRate, mediaStream.realFrameRate) + && Objects.equals(this.profile, mediaStream.profile) && Objects.equals(this.type, mediaStream.type) + && Objects.equals(this.aspectRatio, mediaStream.aspectRatio) + && Objects.equals(this.index, mediaStream.index) && Objects.equals(this.score, mediaStream.score) + && Objects.equals(this.isExternal, mediaStream.isExternal) + && Objects.equals(this.deliveryMethod, mediaStream.deliveryMethod) + && Objects.equals(this.deliveryUrl, mediaStream.deliveryUrl) + && Objects.equals(this.isExternalUrl, mediaStream.isExternalUrl) + && Objects.equals(this.isTextSubtitleStream, mediaStream.isTextSubtitleStream) + && Objects.equals(this.supportsExternalStream, mediaStream.supportsExternalStream) + && Objects.equals(this.path, mediaStream.path) + && Objects.equals(this.pixelFormat, mediaStream.pixelFormat) + && Objects.equals(this.level, mediaStream.level) + && Objects.equals(this.isAnamorphic, mediaStream.isAnamorphic); + } + + @Override + public int hashCode() { + return Objects.hash(codec, codecTag, language, colorRange, colorSpace, colorTransfer, colorPrimaries, + dvVersionMajor, dvVersionMinor, dvProfile, dvLevel, rpuPresentFlag, elPresentFlag, blPresentFlag, + dvBlSignalCompatibilityId, comment, timeBase, codecTimeBase, title, videoRange, videoRangeType, + videoDoViTitle, localizedUndefined, localizedDefault, localizedForced, localizedExternal, displayTitle, + nalLengthSize, isInterlaced, isAVC, channelLayout, bitRate, bitDepth, refFrames, packetLength, channels, + sampleRate, isDefault, isForced, height, width, averageFrameRate, realFrameRate, profile, type, + aspectRatio, index, score, isExternal, deliveryMethod, deliveryUrl, isExternalUrl, isTextSubtitleStream, + supportsExternalStream, path, pixelFormat, level, isAnamorphic); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaStream {\n"); + sb.append(" codec: ").append(toIndentedString(codec)).append("\n"); + sb.append(" codecTag: ").append(toIndentedString(codecTag)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" colorRange: ").append(toIndentedString(colorRange)).append("\n"); + sb.append(" colorSpace: ").append(toIndentedString(colorSpace)).append("\n"); + sb.append(" colorTransfer: ").append(toIndentedString(colorTransfer)).append("\n"); + sb.append(" colorPrimaries: ").append(toIndentedString(colorPrimaries)).append("\n"); + sb.append(" dvVersionMajor: ").append(toIndentedString(dvVersionMajor)).append("\n"); + sb.append(" dvVersionMinor: ").append(toIndentedString(dvVersionMinor)).append("\n"); + sb.append(" dvProfile: ").append(toIndentedString(dvProfile)).append("\n"); + sb.append(" dvLevel: ").append(toIndentedString(dvLevel)).append("\n"); + sb.append(" rpuPresentFlag: ").append(toIndentedString(rpuPresentFlag)).append("\n"); + sb.append(" elPresentFlag: ").append(toIndentedString(elPresentFlag)).append("\n"); + sb.append(" blPresentFlag: ").append(toIndentedString(blPresentFlag)).append("\n"); + sb.append(" dvBlSignalCompatibilityId: ").append(toIndentedString(dvBlSignalCompatibilityId)).append("\n"); + sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); + sb.append(" timeBase: ").append(toIndentedString(timeBase)).append("\n"); + sb.append(" codecTimeBase: ").append(toIndentedString(codecTimeBase)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" videoRange: ").append(toIndentedString(videoRange)).append("\n"); + sb.append(" videoRangeType: ").append(toIndentedString(videoRangeType)).append("\n"); + sb.append(" videoDoViTitle: ").append(toIndentedString(videoDoViTitle)).append("\n"); + sb.append(" localizedUndefined: ").append(toIndentedString(localizedUndefined)).append("\n"); + sb.append(" localizedDefault: ").append(toIndentedString(localizedDefault)).append("\n"); + sb.append(" localizedForced: ").append(toIndentedString(localizedForced)).append("\n"); + sb.append(" localizedExternal: ").append(toIndentedString(localizedExternal)).append("\n"); + sb.append(" displayTitle: ").append(toIndentedString(displayTitle)).append("\n"); + sb.append(" nalLengthSize: ").append(toIndentedString(nalLengthSize)).append("\n"); + sb.append(" isInterlaced: ").append(toIndentedString(isInterlaced)).append("\n"); + sb.append(" isAVC: ").append(toIndentedString(isAVC)).append("\n"); + sb.append(" channelLayout: ").append(toIndentedString(channelLayout)).append("\n"); + sb.append(" bitRate: ").append(toIndentedString(bitRate)).append("\n"); + sb.append(" bitDepth: ").append(toIndentedString(bitDepth)).append("\n"); + sb.append(" refFrames: ").append(toIndentedString(refFrames)).append("\n"); + sb.append(" packetLength: ").append(toIndentedString(packetLength)).append("\n"); + sb.append(" channels: ").append(toIndentedString(channels)).append("\n"); + sb.append(" sampleRate: ").append(toIndentedString(sampleRate)).append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" isForced: ").append(toIndentedString(isForced)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" averageFrameRate: ").append(toIndentedString(averageFrameRate)).append("\n"); + sb.append(" realFrameRate: ").append(toIndentedString(realFrameRate)).append("\n"); + sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" aspectRatio: ").append(toIndentedString(aspectRatio)).append("\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).append("\n"); + sb.append(" isExternal: ").append(toIndentedString(isExternal)).append("\n"); + sb.append(" deliveryMethod: ").append(toIndentedString(deliveryMethod)).append("\n"); + sb.append(" deliveryUrl: ").append(toIndentedString(deliveryUrl)).append("\n"); + sb.append(" isExternalUrl: ").append(toIndentedString(isExternalUrl)).append("\n"); + sb.append(" isTextSubtitleStream: ").append(toIndentedString(isTextSubtitleStream)).append("\n"); + sb.append(" supportsExternalStream: ").append(toIndentedString(supportsExternalStream)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" pixelFormat: ").append(toIndentedString(pixelFormat)).append("\n"); + sb.append(" level: ").append(toIndentedString(level)).append("\n"); + sb.append(" isAnamorphic: ").append(toIndentedString(isAnamorphic)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Codec` to the URL query string + if (getCodec() != null) { + joiner.add(String.format("%sCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCodec())))); + } + + // add `CodecTag` to the URL query string + if (getCodecTag() != null) { + joiner.add(String.format("%sCodecTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCodecTag())))); + } + + // add `Language` to the URL query string + if (getLanguage() != null) { + joiner.add(String.format("%sLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLanguage())))); + } + + // add `ColorRange` to the URL query string + if (getColorRange() != null) { + joiner.add(String.format("%sColorRange%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getColorRange())))); + } + + // add `ColorSpace` to the URL query string + if (getColorSpace() != null) { + joiner.add(String.format("%sColorSpace%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getColorSpace())))); + } + + // add `ColorTransfer` to the URL query string + if (getColorTransfer() != null) { + joiner.add(String.format("%sColorTransfer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getColorTransfer())))); + } + + // add `ColorPrimaries` to the URL query string + if (getColorPrimaries() != null) { + joiner.add(String.format("%sColorPrimaries%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getColorPrimaries())))); + } + + // add `DvVersionMajor` to the URL query string + if (getDvVersionMajor() != null) { + joiner.add(String.format("%sDvVersionMajor%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDvVersionMajor())))); + } + + // add `DvVersionMinor` to the URL query string + if (getDvVersionMinor() != null) { + joiner.add(String.format("%sDvVersionMinor%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDvVersionMinor())))); + } + + // add `DvProfile` to the URL query string + if (getDvProfile() != null) { + joiner.add(String.format("%sDvProfile%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDvProfile())))); + } + + // add `DvLevel` to the URL query string + if (getDvLevel() != null) { + joiner.add(String.format("%sDvLevel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDvLevel())))); + } + + // add `RpuPresentFlag` to the URL query string + if (getRpuPresentFlag() != null) { + joiner.add(String.format("%sRpuPresentFlag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRpuPresentFlag())))); + } + + // add `ElPresentFlag` to the URL query string + if (getElPresentFlag() != null) { + joiner.add(String.format("%sElPresentFlag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getElPresentFlag())))); + } + + // add `BlPresentFlag` to the URL query string + if (getBlPresentFlag() != null) { + joiner.add(String.format("%sBlPresentFlag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBlPresentFlag())))); + } + + // add `DvBlSignalCompatibilityId` to the URL query string + if (getDvBlSignalCompatibilityId() != null) { + joiner.add(String.format("%sDvBlSignalCompatibilityId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDvBlSignalCompatibilityId())))); + } + + // add `Comment` to the URL query string + if (getComment() != null) { + joiner.add(String.format("%sComment%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getComment())))); + } + + // add `TimeBase` to the URL query string + if (getTimeBase() != null) { + joiner.add(String.format("%sTimeBase%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTimeBase())))); + } + + // add `CodecTimeBase` to the URL query string + if (getCodecTimeBase() != null) { + joiner.add(String.format("%sCodecTimeBase%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCodecTimeBase())))); + } + + // add `Title` to the URL query string + if (getTitle() != null) { + joiner.add(String.format("%sTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTitle())))); + } + + // add `VideoRange` to the URL query string + if (getVideoRange() != null) { + joiner.add(String.format("%sVideoRange%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoRange())))); + } + + // add `VideoRangeType` to the URL query string + if (getVideoRangeType() != null) { + joiner.add(String.format("%sVideoRangeType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoRangeType())))); + } + + // add `VideoDoViTitle` to the URL query string + if (getVideoDoViTitle() != null) { + joiner.add(String.format("%sVideoDoViTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoDoViTitle())))); + } + + // add `LocalizedUndefined` to the URL query string + if (getLocalizedUndefined() != null) { + joiner.add(String.format("%sLocalizedUndefined%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocalizedUndefined())))); + } + + // add `LocalizedDefault` to the URL query string + if (getLocalizedDefault() != null) { + joiner.add(String.format("%sLocalizedDefault%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocalizedDefault())))); + } + + // add `LocalizedForced` to the URL query string + if (getLocalizedForced() != null) { + joiner.add(String.format("%sLocalizedForced%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocalizedForced())))); + } + + // add `LocalizedExternal` to the URL query string + if (getLocalizedExternal() != null) { + joiner.add(String.format("%sLocalizedExternal%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocalizedExternal())))); + } + + // add `DisplayTitle` to the URL query string + if (getDisplayTitle() != null) { + joiner.add(String.format("%sDisplayTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplayTitle())))); + } + + // add `NalLengthSize` to the URL query string + if (getNalLengthSize() != null) { + joiner.add(String.format("%sNalLengthSize%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getNalLengthSize())))); + } + + // add `IsInterlaced` to the URL query string + if (getIsInterlaced() != null) { + joiner.add(String.format("%sIsInterlaced%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsInterlaced())))); + } + + // add `IsAVC` to the URL query string + if (getIsAVC() != null) { + joiner.add(String.format("%sIsAVC%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAVC())))); + } + + // add `ChannelLayout` to the URL query string + if (getChannelLayout() != null) { + joiner.add(String.format("%sChannelLayout%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelLayout())))); + } + + // add `BitRate` to the URL query string + if (getBitRate() != null) { + joiner.add(String.format("%sBitRate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBitRate())))); + } + + // add `BitDepth` to the URL query string + if (getBitDepth() != null) { + joiner.add(String.format("%sBitDepth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBitDepth())))); + } + + // add `RefFrames` to the URL query string + if (getRefFrames() != null) { + joiner.add(String.format("%sRefFrames%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRefFrames())))); + } + + // add `PacketLength` to the URL query string + if (getPacketLength() != null) { + joiner.add(String.format("%sPacketLength%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPacketLength())))); + } + + // add `Channels` to the URL query string + if (getChannels() != null) { + joiner.add(String.format("%sChannels%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannels())))); + } + + // add `SampleRate` to the URL query string + if (getSampleRate() != null) { + joiner.add(String.format("%sSampleRate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSampleRate())))); + } + + // add `IsDefault` to the URL query string + if (getIsDefault() != null) { + joiner.add(String.format("%sIsDefault%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsDefault())))); + } + + // add `IsForced` to the URL query string + if (getIsForced() != null) { + joiner.add(String.format("%sIsForced%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsForced())))); + } + + // add `Height` to the URL query string + if (getHeight() != null) { + joiner.add(String.format("%sHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHeight())))); + } + + // add `Width` to the URL query string + if (getWidth() != null) { + joiner.add(String.format("%sWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWidth())))); + } + + // add `AverageFrameRate` to the URL query string + if (getAverageFrameRate() != null) { + joiner.add(String.format("%sAverageFrameRate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAverageFrameRate())))); + } + + // add `RealFrameRate` to the URL query string + if (getRealFrameRate() != null) { + joiner.add(String.format("%sRealFrameRate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRealFrameRate())))); + } + + // add `Profile` to the URL query string + if (getProfile() != null) { + joiner.add(String.format("%sProfile%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProfile())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `AspectRatio` to the URL query string + if (getAspectRatio() != null) { + joiner.add(String.format("%sAspectRatio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAspectRatio())))); + } + + // add `Index` to the URL query string + if (getIndex() != null) { + joiner.add(String.format("%sIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndex())))); + } + + // add `Score` to the URL query string + if (getScore() != null) { + joiner.add(String.format("%sScore%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getScore())))); + } + + // add `IsExternal` to the URL query string + if (getIsExternal() != null) { + joiner.add(String.format("%sIsExternal%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsExternal())))); + } + + // add `DeliveryMethod` to the URL query string + if (getDeliveryMethod() != null) { + joiner.add(String.format("%sDeliveryMethod%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeliveryMethod())))); + } + + // add `DeliveryUrl` to the URL query string + if (getDeliveryUrl() != null) { + joiner.add(String.format("%sDeliveryUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeliveryUrl())))); + } + + // add `IsExternalUrl` to the URL query string + if (getIsExternalUrl() != null) { + joiner.add(String.format("%sIsExternalUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsExternalUrl())))); + } + + // add `IsTextSubtitleStream` to the URL query string + if (getIsTextSubtitleStream() != null) { + joiner.add(String.format("%sIsTextSubtitleStream%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsTextSubtitleStream())))); + } + + // add `SupportsExternalStream` to the URL query string + if (getSupportsExternalStream() != null) { + joiner.add(String.format("%sSupportsExternalStream%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsExternalStream())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `PixelFormat` to the URL query string + if (getPixelFormat() != null) { + joiner.add(String.format("%sPixelFormat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPixelFormat())))); + } + + // add `Level` to the URL query string + if (getLevel() != null) { + joiner.add(String.format("%sLevel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLevel())))); + } + + // add `IsAnamorphic` to the URL query string + if (getIsAnamorphic() != null) { + joiner.add(String.format("%sIsAnamorphic%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAnamorphic())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaStream instance; + + public Builder() { + this(new MediaStream()); + } + + protected Builder(MediaStream instance) { + this.instance = instance; + } + + public MediaStream.Builder codec(String codec) { + this.instance.codec = codec; + return this; + } + + public MediaStream.Builder codecTag(String codecTag) { + this.instance.codecTag = codecTag; + return this; + } + + public MediaStream.Builder language(String language) { + this.instance.language = language; + return this; + } + + public MediaStream.Builder colorRange(String colorRange) { + this.instance.colorRange = colorRange; + return this; + } + + public MediaStream.Builder colorSpace(String colorSpace) { + this.instance.colorSpace = colorSpace; + return this; + } + + public MediaStream.Builder colorTransfer(String colorTransfer) { + this.instance.colorTransfer = colorTransfer; + return this; + } + + public MediaStream.Builder colorPrimaries(String colorPrimaries) { + this.instance.colorPrimaries = colorPrimaries; + return this; + } + + public MediaStream.Builder dvVersionMajor(Integer dvVersionMajor) { + this.instance.dvVersionMajor = dvVersionMajor; + return this; + } + + public MediaStream.Builder dvVersionMinor(Integer dvVersionMinor) { + this.instance.dvVersionMinor = dvVersionMinor; + return this; + } + + public MediaStream.Builder dvProfile(Integer dvProfile) { + this.instance.dvProfile = dvProfile; + return this; + } + + public MediaStream.Builder dvLevel(Integer dvLevel) { + this.instance.dvLevel = dvLevel; + return this; + } + + public MediaStream.Builder rpuPresentFlag(Integer rpuPresentFlag) { + this.instance.rpuPresentFlag = rpuPresentFlag; + return this; + } + + public MediaStream.Builder elPresentFlag(Integer elPresentFlag) { + this.instance.elPresentFlag = elPresentFlag; + return this; + } + + public MediaStream.Builder blPresentFlag(Integer blPresentFlag) { + this.instance.blPresentFlag = blPresentFlag; + return this; + } + + public MediaStream.Builder dvBlSignalCompatibilityId(Integer dvBlSignalCompatibilityId) { + this.instance.dvBlSignalCompatibilityId = dvBlSignalCompatibilityId; + return this; + } + + public MediaStream.Builder comment(String comment) { + this.instance.comment = comment; + return this; + } + + public MediaStream.Builder timeBase(String timeBase) { + this.instance.timeBase = timeBase; + return this; + } + + public MediaStream.Builder codecTimeBase(String codecTimeBase) { + this.instance.codecTimeBase = codecTimeBase; + return this; + } + + public MediaStream.Builder title(String title) { + this.instance.title = title; + return this; + } + + public MediaStream.Builder videoRange(String videoRange) { + this.instance.videoRange = videoRange; + return this; + } + + public MediaStream.Builder videoRangeType(String videoRangeType) { + this.instance.videoRangeType = videoRangeType; + return this; + } + + public MediaStream.Builder videoDoViTitle(String videoDoViTitle) { + this.instance.videoDoViTitle = videoDoViTitle; + return this; + } + + public MediaStream.Builder localizedUndefined(String localizedUndefined) { + this.instance.localizedUndefined = localizedUndefined; + return this; + } + + public MediaStream.Builder localizedDefault(String localizedDefault) { + this.instance.localizedDefault = localizedDefault; + return this; + } + + public MediaStream.Builder localizedForced(String localizedForced) { + this.instance.localizedForced = localizedForced; + return this; + } + + public MediaStream.Builder localizedExternal(String localizedExternal) { + this.instance.localizedExternal = localizedExternal; + return this; + } + + public MediaStream.Builder displayTitle(String displayTitle) { + this.instance.displayTitle = displayTitle; + return this; + } + + public MediaStream.Builder nalLengthSize(String nalLengthSize) { + this.instance.nalLengthSize = nalLengthSize; + return this; + } + + public MediaStream.Builder isInterlaced(Boolean isInterlaced) { + this.instance.isInterlaced = isInterlaced; + return this; + } + + public MediaStream.Builder isAVC(Boolean isAVC) { + this.instance.isAVC = isAVC; + return this; + } + + public MediaStream.Builder channelLayout(String channelLayout) { + this.instance.channelLayout = channelLayout; + return this; + } + + public MediaStream.Builder bitRate(Integer bitRate) { + this.instance.bitRate = bitRate; + return this; + } + + public MediaStream.Builder bitDepth(Integer bitDepth) { + this.instance.bitDepth = bitDepth; + return this; + } + + public MediaStream.Builder refFrames(Integer refFrames) { + this.instance.refFrames = refFrames; + return this; + } + + public MediaStream.Builder packetLength(Integer packetLength) { + this.instance.packetLength = packetLength; + return this; + } + + public MediaStream.Builder channels(Integer channels) { + this.instance.channels = channels; + return this; + } + + public MediaStream.Builder sampleRate(Integer sampleRate) { + this.instance.sampleRate = sampleRate; + return this; + } + + public MediaStream.Builder isDefault(Boolean isDefault) { + this.instance.isDefault = isDefault; + return this; + } + + public MediaStream.Builder isForced(Boolean isForced) { + this.instance.isForced = isForced; + return this; + } + + public MediaStream.Builder height(Integer height) { + this.instance.height = height; + return this; + } + + public MediaStream.Builder width(Integer width) { + this.instance.width = width; + return this; + } + + public MediaStream.Builder averageFrameRate(Float averageFrameRate) { + this.instance.averageFrameRate = averageFrameRate; + return this; + } + + public MediaStream.Builder realFrameRate(Float realFrameRate) { + this.instance.realFrameRate = realFrameRate; + return this; + } + + public MediaStream.Builder profile(String profile) { + this.instance.profile = profile; + return this; + } + + public MediaStream.Builder type(MediaStreamType type) { + this.instance.type = type; + return this; + } + + public MediaStream.Builder aspectRatio(String aspectRatio) { + this.instance.aspectRatio = aspectRatio; + return this; + } + + public MediaStream.Builder index(Integer index) { + this.instance.index = index; + return this; + } + + public MediaStream.Builder score(Integer score) { + this.instance.score = score; + return this; + } + + public MediaStream.Builder isExternal(Boolean isExternal) { + this.instance.isExternal = isExternal; + return this; + } + + public MediaStream.Builder deliveryMethod(SubtitleDeliveryMethod deliveryMethod) { + this.instance.deliveryMethod = deliveryMethod; + return this; + } + + public MediaStream.Builder deliveryUrl(String deliveryUrl) { + this.instance.deliveryUrl = deliveryUrl; + return this; + } + + public MediaStream.Builder isExternalUrl(Boolean isExternalUrl) { + this.instance.isExternalUrl = isExternalUrl; + return this; + } + + public MediaStream.Builder isTextSubtitleStream(Boolean isTextSubtitleStream) { + this.instance.isTextSubtitleStream = isTextSubtitleStream; + return this; + } + + public MediaStream.Builder supportsExternalStream(Boolean supportsExternalStream) { + this.instance.supportsExternalStream = supportsExternalStream; + return this; + } + + public MediaStream.Builder path(String path) { + this.instance.path = path; + return this; + } + + public MediaStream.Builder pixelFormat(String pixelFormat) { + this.instance.pixelFormat = pixelFormat; + return this; + } + + public MediaStream.Builder level(Double level) { + this.instance.level = level; + return this; + } + + public MediaStream.Builder isAnamorphic(Boolean isAnamorphic) { + this.instance.isAnamorphic = isAnamorphic; + return this; + } + + /** + * returns a built MediaStream instance. + * + * The builder is not reusable. + */ + public MediaStream build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaStream.Builder builder() { + return new MediaStream.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaStream.Builder toBuilder() { + return new MediaStream.Builder().codec(getCodec()).codecTag(getCodecTag()).language(getLanguage()) + .colorRange(getColorRange()).colorSpace(getColorSpace()).colorTransfer(getColorTransfer()) + .colorPrimaries(getColorPrimaries()).dvVersionMajor(getDvVersionMajor()) + .dvVersionMinor(getDvVersionMinor()).dvProfile(getDvProfile()).dvLevel(getDvLevel()) + .rpuPresentFlag(getRpuPresentFlag()).elPresentFlag(getElPresentFlag()).blPresentFlag(getBlPresentFlag()) + .dvBlSignalCompatibilityId(getDvBlSignalCompatibilityId()).comment(getComment()).timeBase(getTimeBase()) + .codecTimeBase(getCodecTimeBase()).title(getTitle()).videoRange(getVideoRange()) + .videoRangeType(getVideoRangeType()).videoDoViTitle(getVideoDoViTitle()) + .localizedUndefined(getLocalizedUndefined()).localizedDefault(getLocalizedDefault()) + .localizedForced(getLocalizedForced()).localizedExternal(getLocalizedExternal()) + .displayTitle(getDisplayTitle()).nalLengthSize(getNalLengthSize()).isInterlaced(getIsInterlaced()) + .isAVC(getIsAVC()).channelLayout(getChannelLayout()).bitRate(getBitRate()).bitDepth(getBitDepth()) + .refFrames(getRefFrames()).packetLength(getPacketLength()).channels(getChannels()) + .sampleRate(getSampleRate()).isDefault(getIsDefault()).isForced(getIsForced()).height(getHeight()) + .width(getWidth()).averageFrameRate(getAverageFrameRate()).realFrameRate(getRealFrameRate()) + .profile(getProfile()).type(getType()).aspectRatio(getAspectRatio()).index(getIndex()).score(getScore()) + .isExternal(getIsExternal()).deliveryMethod(getDeliveryMethod()).deliveryUrl(getDeliveryUrl()) + .isExternalUrl(getIsExternalUrl()).isTextSubtitleStream(getIsTextSubtitleStream()) + .supportsExternalStream(getSupportsExternalStream()).path(getPath()).pixelFormat(getPixelFormat()) + .level(getLevel()).isAnamorphic(getIsAnamorphic()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaStreamType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaStreamType.java new file mode 100644 index 0000000000000..c5dbb91b53b01 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaStreamType.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum MediaStreamType. + */ +public enum MediaStreamType { + + AUDIO("Audio"), + + VIDEO("Video"), + + SUBTITLE("Subtitle"), + + EMBEDDED_IMAGE("EmbeddedImage"), + + DATA("Data"); + + private String value; + + MediaStreamType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MediaStreamType fromValue(String value) { + for (MediaStreamType b : MediaStreamType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaUpdateInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaUpdateInfoDto.java new file mode 100644 index 0000000000000..dc59118ed9e7e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaUpdateInfoDto.java @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Media Update Info Dto. + */ +@JsonPropertyOrder({ MediaUpdateInfoDto.JSON_PROPERTY_UPDATES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaUpdateInfoDto { + public static final String JSON_PROPERTY_UPDATES = "Updates"; + @org.eclipse.jdt.annotation.NonNull + private List updates = new ArrayList<>(); + + public MediaUpdateInfoDto() { + } + + public MediaUpdateInfoDto updates(@org.eclipse.jdt.annotation.NonNull List updates) { + this.updates = updates; + return this; + } + + public MediaUpdateInfoDto addUpdatesItem(MediaUpdateInfoPathDto updatesItem) { + if (this.updates == null) { + this.updates = new ArrayList<>(); + } + this.updates.add(updatesItem); + return this; + } + + /** + * Gets or sets the list of updates. + * + * @return updates + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_UPDATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getUpdates() { + return updates; + } + + @JsonProperty(JSON_PROPERTY_UPDATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdates(@org.eclipse.jdt.annotation.NonNull List updates) { + this.updates = updates; + } + + /** + * Return true if this MediaUpdateInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaUpdateInfoDto mediaUpdateInfoDto = (MediaUpdateInfoDto) o; + return Objects.equals(this.updates, mediaUpdateInfoDto.updates); + } + + @Override + public int hashCode() { + return Objects.hash(updates); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaUpdateInfoDto {\n"); + sb.append(" updates: ").append(toIndentedString(updates)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Updates` to the URL query string + if (getUpdates() != null) { + for (int i = 0; i < getUpdates().size(); i++) { + if (getUpdates().get(i) != null) { + joiner.add(getUpdates().get(i).toUrlQueryString(String.format("%sUpdates%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaUpdateInfoDto instance; + + public Builder() { + this(new MediaUpdateInfoDto()); + } + + protected Builder(MediaUpdateInfoDto instance) { + this.instance = instance; + } + + public MediaUpdateInfoDto.Builder updates(List updates) { + this.instance.updates = updates; + return this; + } + + /** + * returns a built MediaUpdateInfoDto instance. + * + * The builder is not reusable. + */ + public MediaUpdateInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaUpdateInfoDto.Builder builder() { + return new MediaUpdateInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaUpdateInfoDto.Builder toBuilder() { + return new MediaUpdateInfoDto.Builder().updates(getUpdates()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaUpdateInfoPathDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaUpdateInfoPathDto.java new file mode 100644 index 0000000000000..0dbe68c57cf3f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaUpdateInfoPathDto.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The media update info path. + */ +@JsonPropertyOrder({ MediaUpdateInfoPathDto.JSON_PROPERTY_PATH, MediaUpdateInfoPathDto.JSON_PROPERTY_UPDATE_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaUpdateInfoPathDto { + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_UPDATE_TYPE = "UpdateType"; + @org.eclipse.jdt.annotation.NonNull + private String updateType; + + public MediaUpdateInfoPathDto() { + } + + public MediaUpdateInfoPathDto path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets media path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public MediaUpdateInfoPathDto updateType(@org.eclipse.jdt.annotation.NonNull String updateType) { + this.updateType = updateType; + return this; + } + + /** + * Gets or sets media update type. Created, Modified, Deleted. + * + * @return updateType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_UPDATE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdateType() { + return updateType; + } + + @JsonProperty(JSON_PROPERTY_UPDATE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdateType(@org.eclipse.jdt.annotation.NonNull String updateType) { + this.updateType = updateType; + } + + /** + * Return true if this MediaUpdateInfoPathDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaUpdateInfoPathDto mediaUpdateInfoPathDto = (MediaUpdateInfoPathDto) o; + return Objects.equals(this.path, mediaUpdateInfoPathDto.path) + && Objects.equals(this.updateType, mediaUpdateInfoPathDto.updateType); + } + + @Override + public int hashCode() { + return Objects.hash(path, updateType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaUpdateInfoPathDto {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" updateType: ").append(toIndentedString(updateType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `UpdateType` to the URL query string + if (getUpdateType() != null) { + joiner.add(String.format("%sUpdateType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUpdateType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaUpdateInfoPathDto instance; + + public Builder() { + this(new MediaUpdateInfoPathDto()); + } + + protected Builder(MediaUpdateInfoPathDto instance) { + this.instance = instance; + } + + public MediaUpdateInfoPathDto.Builder path(String path) { + this.instance.path = path; + return this; + } + + public MediaUpdateInfoPathDto.Builder updateType(String updateType) { + this.instance.updateType = updateType; + return this; + } + + /** + * returns a built MediaUpdateInfoPathDto instance. + * + * The builder is not reusable. + */ + public MediaUpdateInfoPathDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaUpdateInfoPathDto.Builder builder() { + return new MediaUpdateInfoPathDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaUpdateInfoPathDto.Builder toBuilder() { + return new MediaUpdateInfoPathDto.Builder().path(getPath()).updateType(getUpdateType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaUrl.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaUrl.java new file mode 100644 index 0000000000000..0877bdc93ac37 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MediaUrl.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MediaUrl + */ +@JsonPropertyOrder({ MediaUrl.JSON_PROPERTY_URL, MediaUrl.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MediaUrl { + public static final String JSON_PROPERTY_URL = "Url"; + @org.eclipse.jdt.annotation.NonNull + private String url; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public MediaUrl() { + } + + public MediaUrl url(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + return this; + } + + /** + * Get url + * + * @return url + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + } + + public MediaUrl name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + /** + * Return true if this MediaUrl object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaUrl mediaUrl = (MediaUrl) o; + return Objects.equals(this.url, mediaUrl.url) && Objects.equals(this.name, mediaUrl.name); + } + + @Override + public int hashCode() { + return Objects.hash(url, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MediaUrl {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format("%sUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MediaUrl instance; + + public Builder() { + this(new MediaUrl()); + } + + protected Builder(MediaUrl instance) { + this.instance = instance; + } + + public MediaUrl.Builder url(String url) { + this.instance.url = url; + return this; + } + + public MediaUrl.Builder name(String name) { + this.instance.name = name; + return this; + } + + /** + * returns a built MediaUrl instance. + * + * The builder is not reusable. + */ + public MediaUrl build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MediaUrl.Builder builder() { + return new MediaUrl.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MediaUrl.Builder toBuilder() { + return new MediaUrl.Builder().url(getUrl()).name(getName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MessageCommand.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MessageCommand.java new file mode 100644 index 0000000000000..4944f869f497e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MessageCommand.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MessageCommand + */ +@JsonPropertyOrder({ MessageCommand.JSON_PROPERTY_HEADER, MessageCommand.JSON_PROPERTY_TEXT, + MessageCommand.JSON_PROPERTY_TIMEOUT_MS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MessageCommand { + public static final String JSON_PROPERTY_HEADER = "Header"; + @org.eclipse.jdt.annotation.NonNull + private String header; + + public static final String JSON_PROPERTY_TEXT = "Text"; + @org.eclipse.jdt.annotation.Nullable + private String text; + + public static final String JSON_PROPERTY_TIMEOUT_MS = "TimeoutMs"; + @org.eclipse.jdt.annotation.NonNull + private Long timeoutMs; + + public MessageCommand() { + } + + public MessageCommand header(@org.eclipse.jdt.annotation.NonNull String header) { + this.header = header; + return this; + } + + /** + * Get header + * + * @return header + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHeader() { + return header; + } + + @JsonProperty(JSON_PROPERTY_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeader(@org.eclipse.jdt.annotation.NonNull String header) { + this.header = header; + } + + public MessageCommand text(@org.eclipse.jdt.annotation.Nullable String text) { + this.text = text; + return this; + } + + /** + * Get text + * + * @return text + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getText() { + return text; + } + + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setText(@org.eclipse.jdt.annotation.Nullable String text) { + this.text = text; + } + + public MessageCommand timeoutMs(@org.eclipse.jdt.annotation.NonNull Long timeoutMs) { + this.timeoutMs = timeoutMs; + return this; + } + + /** + * Get timeoutMs + * + * @return timeoutMs + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTimeoutMs() { + return timeoutMs; + } + + @JsonProperty(JSON_PROPERTY_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimeoutMs(@org.eclipse.jdt.annotation.NonNull Long timeoutMs) { + this.timeoutMs = timeoutMs; + } + + /** + * Return true if this MessageCommand object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessageCommand messageCommand = (MessageCommand) o; + return Objects.equals(this.header, messageCommand.header) && Objects.equals(this.text, messageCommand.text) + && Objects.equals(this.timeoutMs, messageCommand.timeoutMs); + } + + @Override + public int hashCode() { + return Objects.hash(header, text, timeoutMs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessageCommand {\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Header` to the URL query string + if (getHeader() != null) { + joiner.add(String.format("%sHeader%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHeader())))); + } + + // add `Text` to the URL query string + if (getText() != null) { + joiner.add(String.format("%sText%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getText())))); + } + + // add `TimeoutMs` to the URL query string + if (getTimeoutMs() != null) { + joiner.add(String.format("%sTimeoutMs%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTimeoutMs())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MessageCommand instance; + + public Builder() { + this(new MessageCommand()); + } + + protected Builder(MessageCommand instance) { + this.instance = instance; + } + + public MessageCommand.Builder header(String header) { + this.instance.header = header; + return this; + } + + public MessageCommand.Builder text(String text) { + this.instance.text = text; + return this; + } + + public MessageCommand.Builder timeoutMs(Long timeoutMs) { + this.instance.timeoutMs = timeoutMs; + return this; + } + + /** + * returns a built MessageCommand instance. + * + * The builder is not reusable. + */ + public MessageCommand build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MessageCommand.Builder builder() { + return new MessageCommand.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessageCommand.Builder toBuilder() { + return new MessageCommand.Builder().header(getHeader()).text(getText()).timeoutMs(getTimeoutMs()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataConfiguration.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataConfiguration.java new file mode 100644 index 0000000000000..43ae4690161c4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataConfiguration.java @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MetadataConfiguration + */ +@JsonPropertyOrder({ MetadataConfiguration.JSON_PROPERTY_USE_FILE_CREATION_TIME_FOR_DATE_ADDED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MetadataConfiguration { + public static final String JSON_PROPERTY_USE_FILE_CREATION_TIME_FOR_DATE_ADDED = "UseFileCreationTimeForDateAdded"; + @org.eclipse.jdt.annotation.NonNull + private Boolean useFileCreationTimeForDateAdded; + + public MetadataConfiguration() { + } + + public MetadataConfiguration useFileCreationTimeForDateAdded( + @org.eclipse.jdt.annotation.NonNull Boolean useFileCreationTimeForDateAdded) { + this.useFileCreationTimeForDateAdded = useFileCreationTimeForDateAdded; + return this; + } + + /** + * Get useFileCreationTimeForDateAdded + * + * @return useFileCreationTimeForDateAdded + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USE_FILE_CREATION_TIME_FOR_DATE_ADDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUseFileCreationTimeForDateAdded() { + return useFileCreationTimeForDateAdded; + } + + @JsonProperty(JSON_PROPERTY_USE_FILE_CREATION_TIME_FOR_DATE_ADDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseFileCreationTimeForDateAdded( + @org.eclipse.jdt.annotation.NonNull Boolean useFileCreationTimeForDateAdded) { + this.useFileCreationTimeForDateAdded = useFileCreationTimeForDateAdded; + } + + /** + * Return true if this MetadataConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetadataConfiguration metadataConfiguration = (MetadataConfiguration) o; + return Objects.equals(this.useFileCreationTimeForDateAdded, + metadataConfiguration.useFileCreationTimeForDateAdded); + } + + @Override + public int hashCode() { + return Objects.hash(useFileCreationTimeForDateAdded); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MetadataConfiguration {\n"); + sb.append(" useFileCreationTimeForDateAdded: ").append(toIndentedString(useFileCreationTimeForDateAdded)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `UseFileCreationTimeForDateAdded` to the URL query string + if (getUseFileCreationTimeForDateAdded() != null) { + joiner.add(String.format("%sUseFileCreationTimeForDateAdded%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUseFileCreationTimeForDateAdded())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MetadataConfiguration instance; + + public Builder() { + this(new MetadataConfiguration()); + } + + protected Builder(MetadataConfiguration instance) { + this.instance = instance; + } + + public MetadataConfiguration.Builder useFileCreationTimeForDateAdded(Boolean useFileCreationTimeForDateAdded) { + this.instance.useFileCreationTimeForDateAdded = useFileCreationTimeForDateAdded; + return this; + } + + /** + * returns a built MetadataConfiguration instance. + * + * The builder is not reusable. + */ + public MetadataConfiguration build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MetadataConfiguration.Builder builder() { + return new MetadataConfiguration.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MetadataConfiguration.Builder toBuilder() { + return new MetadataConfiguration.Builder() + .useFileCreationTimeForDateAdded(getUseFileCreationTimeForDateAdded()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataEditorInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataEditorInfo.java new file mode 100644 index 0000000000000..85513825597d0 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataEditorInfo.java @@ -0,0 +1,467 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MetadataEditorInfo + */ +@JsonPropertyOrder({ MetadataEditorInfo.JSON_PROPERTY_PARENTAL_RATING_OPTIONS, + MetadataEditorInfo.JSON_PROPERTY_COUNTRIES, MetadataEditorInfo.JSON_PROPERTY_CULTURES, + MetadataEditorInfo.JSON_PROPERTY_EXTERNAL_ID_INFOS, MetadataEditorInfo.JSON_PROPERTY_CONTENT_TYPE, + MetadataEditorInfo.JSON_PROPERTY_CONTENT_TYPE_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MetadataEditorInfo { + public static final String JSON_PROPERTY_PARENTAL_RATING_OPTIONS = "ParentalRatingOptions"; + @org.eclipse.jdt.annotation.NonNull + private List parentalRatingOptions = new ArrayList<>(); + + public static final String JSON_PROPERTY_COUNTRIES = "Countries"; + @org.eclipse.jdt.annotation.NonNull + private List countries = new ArrayList<>(); + + public static final String JSON_PROPERTY_CULTURES = "Cultures"; + @org.eclipse.jdt.annotation.NonNull + private List cultures = new ArrayList<>(); + + public static final String JSON_PROPERTY_EXTERNAL_ID_INFOS = "ExternalIdInfos"; + @org.eclipse.jdt.annotation.NonNull + private List externalIdInfos = new ArrayList<>(); + + public static final String JSON_PROPERTY_CONTENT_TYPE = "ContentType"; + @org.eclipse.jdt.annotation.NonNull + private String contentType; + + public static final String JSON_PROPERTY_CONTENT_TYPE_OPTIONS = "ContentTypeOptions"; + @org.eclipse.jdt.annotation.NonNull + private List contentTypeOptions = new ArrayList<>(); + + public MetadataEditorInfo() { + } + + public MetadataEditorInfo parentalRatingOptions( + @org.eclipse.jdt.annotation.NonNull List parentalRatingOptions) { + this.parentalRatingOptions = parentalRatingOptions; + return this; + } + + public MetadataEditorInfo addParentalRatingOptionsItem(ParentalRating parentalRatingOptionsItem) { + if (this.parentalRatingOptions == null) { + this.parentalRatingOptions = new ArrayList<>(); + } + this.parentalRatingOptions.add(parentalRatingOptionsItem); + return this; + } + + /** + * Get parentalRatingOptions + * + * @return parentalRatingOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENTAL_RATING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getParentalRatingOptions() { + return parentalRatingOptions; + } + + @JsonProperty(JSON_PROPERTY_PARENTAL_RATING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentalRatingOptions( + @org.eclipse.jdt.annotation.NonNull List parentalRatingOptions) { + this.parentalRatingOptions = parentalRatingOptions; + } + + public MetadataEditorInfo countries(@org.eclipse.jdt.annotation.NonNull List countries) { + this.countries = countries; + return this; + } + + public MetadataEditorInfo addCountriesItem(CountryInfo countriesItem) { + if (this.countries == null) { + this.countries = new ArrayList<>(); + } + this.countries.add(countriesItem); + return this; + } + + /** + * Get countries + * + * @return countries + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COUNTRIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCountries() { + return countries; + } + + @JsonProperty(JSON_PROPERTY_COUNTRIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCountries(@org.eclipse.jdt.annotation.NonNull List countries) { + this.countries = countries; + } + + public MetadataEditorInfo cultures(@org.eclipse.jdt.annotation.NonNull List cultures) { + this.cultures = cultures; + return this; + } + + public MetadataEditorInfo addCulturesItem(CultureDto culturesItem) { + if (this.cultures == null) { + this.cultures = new ArrayList<>(); + } + this.cultures.add(culturesItem); + return this; + } + + /** + * Get cultures + * + * @return cultures + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CULTURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCultures() { + return cultures; + } + + @JsonProperty(JSON_PROPERTY_CULTURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCultures(@org.eclipse.jdt.annotation.NonNull List cultures) { + this.cultures = cultures; + } + + public MetadataEditorInfo externalIdInfos( + @org.eclipse.jdt.annotation.NonNull List externalIdInfos) { + this.externalIdInfos = externalIdInfos; + return this; + } + + public MetadataEditorInfo addExternalIdInfosItem(ExternalIdInfo externalIdInfosItem) { + if (this.externalIdInfos == null) { + this.externalIdInfos = new ArrayList<>(); + } + this.externalIdInfos.add(externalIdInfosItem); + return this; + } + + /** + * Get externalIdInfos + * + * @return externalIdInfos + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getExternalIdInfos() { + return externalIdInfos; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID_INFOS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalIdInfos(@org.eclipse.jdt.annotation.NonNull List externalIdInfos) { + this.externalIdInfos = externalIdInfos; + } + + public MetadataEditorInfo contentType(@org.eclipse.jdt.annotation.NonNull String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get contentType + * + * @return contentType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContentType() { + return contentType; + } + + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentType(@org.eclipse.jdt.annotation.NonNull String contentType) { + this.contentType = contentType; + } + + public MetadataEditorInfo contentTypeOptions( + @org.eclipse.jdt.annotation.NonNull List contentTypeOptions) { + this.contentTypeOptions = contentTypeOptions; + return this; + } + + public MetadataEditorInfo addContentTypeOptionsItem(NameValuePair contentTypeOptionsItem) { + if (this.contentTypeOptions == null) { + this.contentTypeOptions = new ArrayList<>(); + } + this.contentTypeOptions.add(contentTypeOptionsItem); + return this; + } + + /** + * Get contentTypeOptions + * + * @return contentTypeOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getContentTypeOptions() { + return contentTypeOptions; + } + + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentTypeOptions(@org.eclipse.jdt.annotation.NonNull List contentTypeOptions) { + this.contentTypeOptions = contentTypeOptions; + } + + /** + * Return true if this MetadataEditorInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetadataEditorInfo metadataEditorInfo = (MetadataEditorInfo) o; + return Objects.equals(this.parentalRatingOptions, metadataEditorInfo.parentalRatingOptions) + && Objects.equals(this.countries, metadataEditorInfo.countries) + && Objects.equals(this.cultures, metadataEditorInfo.cultures) + && Objects.equals(this.externalIdInfos, metadataEditorInfo.externalIdInfos) + && Objects.equals(this.contentType, metadataEditorInfo.contentType) + && Objects.equals(this.contentTypeOptions, metadataEditorInfo.contentTypeOptions); + } + + @Override + public int hashCode() { + return Objects.hash(parentalRatingOptions, countries, cultures, externalIdInfos, contentType, + contentTypeOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MetadataEditorInfo {\n"); + sb.append(" parentalRatingOptions: ").append(toIndentedString(parentalRatingOptions)).append("\n"); + sb.append(" countries: ").append(toIndentedString(countries)).append("\n"); + sb.append(" cultures: ").append(toIndentedString(cultures)).append("\n"); + sb.append(" externalIdInfos: ").append(toIndentedString(externalIdInfos)).append("\n"); + sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n"); + sb.append(" contentTypeOptions: ").append(toIndentedString(contentTypeOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ParentalRatingOptions` to the URL query string + if (getParentalRatingOptions() != null) { + for (int i = 0; i < getParentalRatingOptions().size(); i++) { + if (getParentalRatingOptions().get(i) != null) { + joiner.add(getParentalRatingOptions().get(i).toUrlQueryString(String.format( + "%sParentalRatingOptions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Countries` to the URL query string + if (getCountries() != null) { + for (int i = 0; i < getCountries().size(); i++) { + if (getCountries().get(i) != null) { + joiner.add(getCountries().get(i).toUrlQueryString(String.format("%sCountries%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Cultures` to the URL query string + if (getCultures() != null) { + for (int i = 0; i < getCultures().size(); i++) { + if (getCultures().get(i) != null) { + joiner.add(getCultures().get(i).toUrlQueryString(String.format("%sCultures%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ExternalIdInfos` to the URL query string + if (getExternalIdInfos() != null) { + for (int i = 0; i < getExternalIdInfos().size(); i++) { + if (getExternalIdInfos().get(i) != null) { + joiner.add(getExternalIdInfos().get(i).toUrlQueryString(String.format("%sExternalIdInfos%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `ContentType` to the URL query string + if (getContentType() != null) { + joiner.add(String.format("%sContentType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContentType())))); + } + + // add `ContentTypeOptions` to the URL query string + if (getContentTypeOptions() != null) { + for (int i = 0; i < getContentTypeOptions().size(); i++) { + if (getContentTypeOptions().get(i) != null) { + joiner.add(getContentTypeOptions().get(i).toUrlQueryString(String.format("%sContentTypeOptions%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private MetadataEditorInfo instance; + + public Builder() { + this(new MetadataEditorInfo()); + } + + protected Builder(MetadataEditorInfo instance) { + this.instance = instance; + } + + public MetadataEditorInfo.Builder parentalRatingOptions(List parentalRatingOptions) { + this.instance.parentalRatingOptions = parentalRatingOptions; + return this; + } + + public MetadataEditorInfo.Builder countries(List countries) { + this.instance.countries = countries; + return this; + } + + public MetadataEditorInfo.Builder cultures(List cultures) { + this.instance.cultures = cultures; + return this; + } + + public MetadataEditorInfo.Builder externalIdInfos(List externalIdInfos) { + this.instance.externalIdInfos = externalIdInfos; + return this; + } + + public MetadataEditorInfo.Builder contentType(String contentType) { + this.instance.contentType = contentType; + return this; + } + + public MetadataEditorInfo.Builder contentTypeOptions(List contentTypeOptions) { + this.instance.contentTypeOptions = contentTypeOptions; + return this; + } + + /** + * returns a built MetadataEditorInfo instance. + * + * The builder is not reusable. + */ + public MetadataEditorInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MetadataEditorInfo.Builder builder() { + return new MetadataEditorInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MetadataEditorInfo.Builder toBuilder() { + return new MetadataEditorInfo.Builder().parentalRatingOptions(getParentalRatingOptions()) + .countries(getCountries()).cultures(getCultures()).externalIdInfos(getExternalIdInfos()) + .contentType(getContentType()).contentTypeOptions(getContentTypeOptions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataField.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataField.java new file mode 100644 index 0000000000000..20ef9b708b481 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataField.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum MetadataFields. + */ +public enum MetadataField { + + CAST("Cast"), + + GENRES("Genres"), + + PRODUCTION_LOCATIONS("ProductionLocations"), + + STUDIOS("Studios"), + + TAGS("Tags"), + + NAME("Name"), + + OVERVIEW("Overview"), + + RUNTIME("Runtime"), + + OFFICIAL_RATING("OfficialRating"); + + private String value; + + MetadataField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MetadataField fromValue(String value) { + for (MetadataField b : MetadataField.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataOptions.java new file mode 100644 index 0000000000000..24f557eb9112c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataOptions.java @@ -0,0 +1,511 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class MetadataOptions. + */ +@JsonPropertyOrder({ MetadataOptions.JSON_PROPERTY_ITEM_TYPE, MetadataOptions.JSON_PROPERTY_DISABLED_METADATA_SAVERS, + MetadataOptions.JSON_PROPERTY_LOCAL_METADATA_READER_ORDER, + MetadataOptions.JSON_PROPERTY_DISABLED_METADATA_FETCHERS, MetadataOptions.JSON_PROPERTY_METADATA_FETCHER_ORDER, + MetadataOptions.JSON_PROPERTY_DISABLED_IMAGE_FETCHERS, MetadataOptions.JSON_PROPERTY_IMAGE_FETCHER_ORDER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MetadataOptions { + public static final String JSON_PROPERTY_ITEM_TYPE = "ItemType"; + @org.eclipse.jdt.annotation.NonNull + private String itemType; + + public static final String JSON_PROPERTY_DISABLED_METADATA_SAVERS = "DisabledMetadataSavers"; + @org.eclipse.jdt.annotation.NonNull + private List disabledMetadataSavers; + + public static final String JSON_PROPERTY_LOCAL_METADATA_READER_ORDER = "LocalMetadataReaderOrder"; + @org.eclipse.jdt.annotation.NonNull + private List localMetadataReaderOrder; + + public static final String JSON_PROPERTY_DISABLED_METADATA_FETCHERS = "DisabledMetadataFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List disabledMetadataFetchers; + + public static final String JSON_PROPERTY_METADATA_FETCHER_ORDER = "MetadataFetcherOrder"; + @org.eclipse.jdt.annotation.NonNull + private List metadataFetcherOrder; + + public static final String JSON_PROPERTY_DISABLED_IMAGE_FETCHERS = "DisabledImageFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List disabledImageFetchers; + + public static final String JSON_PROPERTY_IMAGE_FETCHER_ORDER = "ImageFetcherOrder"; + @org.eclipse.jdt.annotation.NonNull + private List imageFetcherOrder; + + public MetadataOptions() { + } + + public MetadataOptions itemType(@org.eclipse.jdt.annotation.NonNull String itemType) { + this.itemType = itemType; + return this; + } + + /** + * Get itemType + * + * @return itemType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getItemType() { + return itemType; + } + + @JsonProperty(JSON_PROPERTY_ITEM_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemType(@org.eclipse.jdt.annotation.NonNull String itemType) { + this.itemType = itemType; + } + + public MetadataOptions disabledMetadataSavers( + @org.eclipse.jdt.annotation.NonNull List disabledMetadataSavers) { + this.disabledMetadataSavers = disabledMetadataSavers; + return this; + } + + public MetadataOptions addDisabledMetadataSaversItem(String disabledMetadataSaversItem) { + if (this.disabledMetadataSavers == null) { + this.disabledMetadataSavers = new ArrayList<>(); + } + this.disabledMetadataSavers.add(disabledMetadataSaversItem); + return this; + } + + /** + * Get disabledMetadataSavers + * + * @return disabledMetadataSavers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISABLED_METADATA_SAVERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisabledMetadataSavers() { + return disabledMetadataSavers; + } + + @JsonProperty(JSON_PROPERTY_DISABLED_METADATA_SAVERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisabledMetadataSavers(@org.eclipse.jdt.annotation.NonNull List disabledMetadataSavers) { + this.disabledMetadataSavers = disabledMetadataSavers; + } + + public MetadataOptions localMetadataReaderOrder( + @org.eclipse.jdt.annotation.NonNull List localMetadataReaderOrder) { + this.localMetadataReaderOrder = localMetadataReaderOrder; + return this; + } + + public MetadataOptions addLocalMetadataReaderOrderItem(String localMetadataReaderOrderItem) { + if (this.localMetadataReaderOrder == null) { + this.localMetadataReaderOrder = new ArrayList<>(); + } + this.localMetadataReaderOrder.add(localMetadataReaderOrderItem); + return this; + } + + /** + * Get localMetadataReaderOrder + * + * @return localMetadataReaderOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCAL_METADATA_READER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLocalMetadataReaderOrder() { + return localMetadataReaderOrder; + } + + @JsonProperty(JSON_PROPERTY_LOCAL_METADATA_READER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalMetadataReaderOrder(@org.eclipse.jdt.annotation.NonNull List localMetadataReaderOrder) { + this.localMetadataReaderOrder = localMetadataReaderOrder; + } + + public MetadataOptions disabledMetadataFetchers( + @org.eclipse.jdt.annotation.NonNull List disabledMetadataFetchers) { + this.disabledMetadataFetchers = disabledMetadataFetchers; + return this; + } + + public MetadataOptions addDisabledMetadataFetchersItem(String disabledMetadataFetchersItem) { + if (this.disabledMetadataFetchers == null) { + this.disabledMetadataFetchers = new ArrayList<>(); + } + this.disabledMetadataFetchers.add(disabledMetadataFetchersItem); + return this; + } + + /** + * Get disabledMetadataFetchers + * + * @return disabledMetadataFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISABLED_METADATA_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisabledMetadataFetchers() { + return disabledMetadataFetchers; + } + + @JsonProperty(JSON_PROPERTY_DISABLED_METADATA_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisabledMetadataFetchers(@org.eclipse.jdt.annotation.NonNull List disabledMetadataFetchers) { + this.disabledMetadataFetchers = disabledMetadataFetchers; + } + + public MetadataOptions metadataFetcherOrder(@org.eclipse.jdt.annotation.NonNull List metadataFetcherOrder) { + this.metadataFetcherOrder = metadataFetcherOrder; + return this; + } + + public MetadataOptions addMetadataFetcherOrderItem(String metadataFetcherOrderItem) { + if (this.metadataFetcherOrder == null) { + this.metadataFetcherOrder = new ArrayList<>(); + } + this.metadataFetcherOrder.add(metadataFetcherOrderItem); + return this; + } + + /** + * Get metadataFetcherOrder + * + * @return metadataFetcherOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMetadataFetcherOrder() { + return metadataFetcherOrder; + } + + @JsonProperty(JSON_PROPERTY_METADATA_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataFetcherOrder(@org.eclipse.jdt.annotation.NonNull List metadataFetcherOrder) { + this.metadataFetcherOrder = metadataFetcherOrder; + } + + public MetadataOptions disabledImageFetchers( + @org.eclipse.jdt.annotation.NonNull List disabledImageFetchers) { + this.disabledImageFetchers = disabledImageFetchers; + return this; + } + + public MetadataOptions addDisabledImageFetchersItem(String disabledImageFetchersItem) { + if (this.disabledImageFetchers == null) { + this.disabledImageFetchers = new ArrayList<>(); + } + this.disabledImageFetchers.add(disabledImageFetchersItem); + return this; + } + + /** + * Get disabledImageFetchers + * + * @return disabledImageFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISABLED_IMAGE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisabledImageFetchers() { + return disabledImageFetchers; + } + + @JsonProperty(JSON_PROPERTY_DISABLED_IMAGE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisabledImageFetchers(@org.eclipse.jdt.annotation.NonNull List disabledImageFetchers) { + this.disabledImageFetchers = disabledImageFetchers; + } + + public MetadataOptions imageFetcherOrder(@org.eclipse.jdt.annotation.NonNull List imageFetcherOrder) { + this.imageFetcherOrder = imageFetcherOrder; + return this; + } + + public MetadataOptions addImageFetcherOrderItem(String imageFetcherOrderItem) { + if (this.imageFetcherOrder == null) { + this.imageFetcherOrder = new ArrayList<>(); + } + this.imageFetcherOrder.add(imageFetcherOrderItem); + return this; + } + + /** + * Get imageFetcherOrder + * + * @return imageFetcherOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getImageFetcherOrder() { + return imageFetcherOrder; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageFetcherOrder(@org.eclipse.jdt.annotation.NonNull List imageFetcherOrder) { + this.imageFetcherOrder = imageFetcherOrder; + } + + /** + * Return true if this MetadataOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetadataOptions metadataOptions = (MetadataOptions) o; + return Objects.equals(this.itemType, metadataOptions.itemType) + && Objects.equals(this.disabledMetadataSavers, metadataOptions.disabledMetadataSavers) + && Objects.equals(this.localMetadataReaderOrder, metadataOptions.localMetadataReaderOrder) + && Objects.equals(this.disabledMetadataFetchers, metadataOptions.disabledMetadataFetchers) + && Objects.equals(this.metadataFetcherOrder, metadataOptions.metadataFetcherOrder) + && Objects.equals(this.disabledImageFetchers, metadataOptions.disabledImageFetchers) + && Objects.equals(this.imageFetcherOrder, metadataOptions.imageFetcherOrder); + } + + @Override + public int hashCode() { + return Objects.hash(itemType, disabledMetadataSavers, localMetadataReaderOrder, disabledMetadataFetchers, + metadataFetcherOrder, disabledImageFetchers, imageFetcherOrder); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MetadataOptions {\n"); + sb.append(" itemType: ").append(toIndentedString(itemType)).append("\n"); + sb.append(" disabledMetadataSavers: ").append(toIndentedString(disabledMetadataSavers)).append("\n"); + sb.append(" localMetadataReaderOrder: ").append(toIndentedString(localMetadataReaderOrder)).append("\n"); + sb.append(" disabledMetadataFetchers: ").append(toIndentedString(disabledMetadataFetchers)).append("\n"); + sb.append(" metadataFetcherOrder: ").append(toIndentedString(metadataFetcherOrder)).append("\n"); + sb.append(" disabledImageFetchers: ").append(toIndentedString(disabledImageFetchers)).append("\n"); + sb.append(" imageFetcherOrder: ").append(toIndentedString(imageFetcherOrder)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ItemType` to the URL query string + if (getItemType() != null) { + joiner.add(String.format("%sItemType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemType())))); + } + + // add `DisabledMetadataSavers` to the URL query string + if (getDisabledMetadataSavers() != null) { + for (int i = 0; i < getDisabledMetadataSavers().size(); i++) { + joiner.add(String.format("%sDisabledMetadataSavers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDisabledMetadataSavers().get(i))))); + } + } + + // add `LocalMetadataReaderOrder` to the URL query string + if (getLocalMetadataReaderOrder() != null) { + for (int i = 0; i < getLocalMetadataReaderOrder().size(); i++) { + joiner.add(String.format("%sLocalMetadataReaderOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLocalMetadataReaderOrder().get(i))))); + } + } + + // add `DisabledMetadataFetchers` to the URL query string + if (getDisabledMetadataFetchers() != null) { + for (int i = 0; i < getDisabledMetadataFetchers().size(); i++) { + joiner.add(String.format("%sDisabledMetadataFetchers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDisabledMetadataFetchers().get(i))))); + } + } + + // add `MetadataFetcherOrder` to the URL query string + if (getMetadataFetcherOrder() != null) { + for (int i = 0; i < getMetadataFetcherOrder().size(); i++) { + joiner.add(String.format("%sMetadataFetcherOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMetadataFetcherOrder().get(i))))); + } + } + + // add `DisabledImageFetchers` to the URL query string + if (getDisabledImageFetchers() != null) { + for (int i = 0; i < getDisabledImageFetchers().size(); i++) { + joiner.add(String.format("%sDisabledImageFetchers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDisabledImageFetchers().get(i))))); + } + } + + // add `ImageFetcherOrder` to the URL query string + if (getImageFetcherOrder() != null) { + for (int i = 0; i < getImageFetcherOrder().size(); i++) { + joiner.add(String.format("%sImageFetcherOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getImageFetcherOrder().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private MetadataOptions instance; + + public Builder() { + this(new MetadataOptions()); + } + + protected Builder(MetadataOptions instance) { + this.instance = instance; + } + + public MetadataOptions.Builder itemType(String itemType) { + this.instance.itemType = itemType; + return this; + } + + public MetadataOptions.Builder disabledMetadataSavers(List disabledMetadataSavers) { + this.instance.disabledMetadataSavers = disabledMetadataSavers; + return this; + } + + public MetadataOptions.Builder localMetadataReaderOrder(List localMetadataReaderOrder) { + this.instance.localMetadataReaderOrder = localMetadataReaderOrder; + return this; + } + + public MetadataOptions.Builder disabledMetadataFetchers(List disabledMetadataFetchers) { + this.instance.disabledMetadataFetchers = disabledMetadataFetchers; + return this; + } + + public MetadataOptions.Builder metadataFetcherOrder(List metadataFetcherOrder) { + this.instance.metadataFetcherOrder = metadataFetcherOrder; + return this; + } + + public MetadataOptions.Builder disabledImageFetchers(List disabledImageFetchers) { + this.instance.disabledImageFetchers = disabledImageFetchers; + return this; + } + + public MetadataOptions.Builder imageFetcherOrder(List imageFetcherOrder) { + this.instance.imageFetcherOrder = imageFetcherOrder; + return this; + } + + /** + * returns a built MetadataOptions instance. + * + * The builder is not reusable. + */ + public MetadataOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MetadataOptions.Builder builder() { + return new MetadataOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MetadataOptions.Builder toBuilder() { + return new MetadataOptions.Builder().itemType(getItemType()).disabledMetadataSavers(getDisabledMetadataSavers()) + .localMetadataReaderOrder(getLocalMetadataReaderOrder()) + .disabledMetadataFetchers(getDisabledMetadataFetchers()).metadataFetcherOrder(getMetadataFetcherOrder()) + .disabledImageFetchers(getDisabledImageFetchers()).imageFetcherOrder(getImageFetcherOrder()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataRefreshMode.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataRefreshMode.java new file mode 100644 index 0000000000000..78cdf51e54673 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MetadataRefreshMode.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets MetadataRefreshMode + */ +public enum MetadataRefreshMode { + + NONE("None"), + + VALIDATION_ONLY("ValidationOnly"), + + DEFAULT("Default"), + + FULL_REFRESH("FullRefresh"); + + private String value; + + MetadataRefreshMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MetadataRefreshMode fromValue(String value) { + for (MetadataRefreshMode b : MetadataRefreshMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MovePlaylistItemRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MovePlaylistItemRequestDto.java new file mode 100644 index 0000000000000..d3c22bcdf43dd --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MovePlaylistItemRequestDto.java @@ -0,0 +1,234 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class MovePlaylistItemRequestDto. + */ +@JsonPropertyOrder({ MovePlaylistItemRequestDto.JSON_PROPERTY_PLAYLIST_ITEM_ID, + MovePlaylistItemRequestDto.JSON_PROPERTY_NEW_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MovePlaylistItemRequestDto { + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID playlistItemId; + + public static final String JSON_PROPERTY_NEW_INDEX = "NewIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer newIndex; + + public MovePlaylistItemRequestDto() { + } + + public MovePlaylistItemRequestDto playlistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets or sets the playlist identifier of the item. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + } + + public MovePlaylistItemRequestDto newIndex(@org.eclipse.jdt.annotation.NonNull Integer newIndex) { + this.newIndex = newIndex; + return this; + } + + /** + * Gets or sets the new position. + * + * @return newIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NEW_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNewIndex() { + return newIndex; + } + + @JsonProperty(JSON_PROPERTY_NEW_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewIndex(@org.eclipse.jdt.annotation.NonNull Integer newIndex) { + this.newIndex = newIndex; + } + + /** + * Return true if this MovePlaylistItemRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MovePlaylistItemRequestDto movePlaylistItemRequestDto = (MovePlaylistItemRequestDto) o; + return Objects.equals(this.playlistItemId, movePlaylistItemRequestDto.playlistItemId) + && Objects.equals(this.newIndex, movePlaylistItemRequestDto.newIndex); + } + + @Override + public int hashCode() { + return Objects.hash(playlistItemId, newIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MovePlaylistItemRequestDto {\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append(" newIndex: ").append(toIndentedString(newIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + // add `NewIndex` to the URL query string + if (getNewIndex() != null) { + joiner.add(String.format("%sNewIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getNewIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MovePlaylistItemRequestDto instance; + + public Builder() { + this(new MovePlaylistItemRequestDto()); + } + + protected Builder(MovePlaylistItemRequestDto instance) { + this.instance = instance; + } + + public MovePlaylistItemRequestDto.Builder playlistItemId(UUID playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + public MovePlaylistItemRequestDto.Builder newIndex(Integer newIndex) { + this.instance.newIndex = newIndex; + return this; + } + + /** + * returns a built MovePlaylistItemRequestDto instance. + * + * The builder is not reusable. + */ + public MovePlaylistItemRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MovePlaylistItemRequestDto.Builder builder() { + return new MovePlaylistItemRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MovePlaylistItemRequestDto.Builder toBuilder() { + return new MovePlaylistItemRequestDto.Builder().playlistItemId(getPlaylistItemId()).newIndex(getNewIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MovieInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MovieInfo.java new file mode 100644 index 0000000000000..7bc889c3247ae --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MovieInfo.java @@ -0,0 +1,614 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MovieInfo + */ +@JsonPropertyOrder({ MovieInfo.JSON_PROPERTY_NAME, MovieInfo.JSON_PROPERTY_ORIGINAL_TITLE, MovieInfo.JSON_PROPERTY_PATH, + MovieInfo.JSON_PROPERTY_METADATA_LANGUAGE, MovieInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, + MovieInfo.JSON_PROPERTY_PROVIDER_IDS, MovieInfo.JSON_PROPERTY_YEAR, MovieInfo.JSON_PROPERTY_INDEX_NUMBER, + MovieInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, MovieInfo.JSON_PROPERTY_PREMIERE_DATE, + MovieInfo.JSON_PROPERTY_IS_AUTOMATED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MovieInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public MovieInfo() { + } + + public MovieInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public MovieInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public MovieInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public MovieInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public MovieInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public MovieInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public MovieInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public MovieInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public MovieInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public MovieInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public MovieInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public MovieInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + /** + * Return true if this MovieInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MovieInfo movieInfo = (MovieInfo) o; + return Objects.equals(this.name, movieInfo.name) && Objects.equals(this.originalTitle, movieInfo.originalTitle) + && Objects.equals(this.path, movieInfo.path) + && Objects.equals(this.metadataLanguage, movieInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, movieInfo.metadataCountryCode) + && Objects.equals(this.providerIds, movieInfo.providerIds) && Objects.equals(this.year, movieInfo.year) + && Objects.equals(this.indexNumber, movieInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, movieInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, movieInfo.premiereDate) + && Objects.equals(this.isAutomated, movieInfo.isAutomated); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MovieInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MovieInfo instance; + + public Builder() { + this(new MovieInfo()); + } + + protected Builder(MovieInfo instance) { + this.instance = instance; + } + + public MovieInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public MovieInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public MovieInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public MovieInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public MovieInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public MovieInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public MovieInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public MovieInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public MovieInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public MovieInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public MovieInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + /** + * returns a built MovieInfo instance. + * + * The builder is not reusable. + */ + public MovieInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MovieInfo.Builder builder() { + return new MovieInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MovieInfo.Builder toBuilder() { + return new MovieInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()) + .isAutomated(getIsAutomated()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MovieInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MovieInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..7f0961b1d910e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MovieInfoRemoteSearchQuery.java @@ -0,0 +1,317 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MovieInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ MovieInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + MovieInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, MovieInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + MovieInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MovieInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private MovieInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public MovieInfoRemoteSearchQuery() { + } + + public MovieInfoRemoteSearchQuery searchInfo(@org.eclipse.jdt.annotation.NonNull MovieInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MovieInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull MovieInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public MovieInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public MovieInfoRemoteSearchQuery searchProviderName( + @org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public MovieInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this MovieInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MovieInfoRemoteSearchQuery movieInfoRemoteSearchQuery = (MovieInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, movieInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, movieInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, movieInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, movieInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MovieInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MovieInfoRemoteSearchQuery instance; + + public Builder() { + this(new MovieInfoRemoteSearchQuery()); + } + + protected Builder(MovieInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public MovieInfoRemoteSearchQuery.Builder searchInfo(MovieInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public MovieInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public MovieInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public MovieInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built MovieInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public MovieInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MovieInfoRemoteSearchQuery.Builder builder() { + return new MovieInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MovieInfoRemoteSearchQuery.Builder toBuilder() { + return new MovieInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MusicVideoInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MusicVideoInfo.java new file mode 100644 index 0000000000000..55cc9bc767b55 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MusicVideoInfo.java @@ -0,0 +1,670 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MusicVideoInfo + */ +@JsonPropertyOrder({ MusicVideoInfo.JSON_PROPERTY_NAME, MusicVideoInfo.JSON_PROPERTY_ORIGINAL_TITLE, + MusicVideoInfo.JSON_PROPERTY_PATH, MusicVideoInfo.JSON_PROPERTY_METADATA_LANGUAGE, + MusicVideoInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, MusicVideoInfo.JSON_PROPERTY_PROVIDER_IDS, + MusicVideoInfo.JSON_PROPERTY_YEAR, MusicVideoInfo.JSON_PROPERTY_INDEX_NUMBER, + MusicVideoInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, MusicVideoInfo.JSON_PROPERTY_PREMIERE_DATE, + MusicVideoInfo.JSON_PROPERTY_IS_AUTOMATED, MusicVideoInfo.JSON_PROPERTY_ARTISTS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MusicVideoInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public static final String JSON_PROPERTY_ARTISTS = "Artists"; + @org.eclipse.jdt.annotation.NonNull + private List artists; + + public MusicVideoInfo() { + } + + public MusicVideoInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public MusicVideoInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public MusicVideoInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public MusicVideoInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public MusicVideoInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public MusicVideoInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public MusicVideoInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public MusicVideoInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public MusicVideoInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public MusicVideoInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public MusicVideoInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public MusicVideoInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + public MusicVideoInfo artists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + return this; + } + + public MusicVideoInfo addArtistsItem(String artistsItem) { + if (this.artists == null) { + this.artists = new ArrayList<>(); + } + this.artists.add(artistsItem); + return this; + } + + /** + * Get artists + * + * @return artists + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArtists() { + return artists; + } + + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + } + + /** + * Return true if this MusicVideoInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MusicVideoInfo musicVideoInfo = (MusicVideoInfo) o; + return Objects.equals(this.name, musicVideoInfo.name) + && Objects.equals(this.originalTitle, musicVideoInfo.originalTitle) + && Objects.equals(this.path, musicVideoInfo.path) + && Objects.equals(this.metadataLanguage, musicVideoInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, musicVideoInfo.metadataCountryCode) + && Objects.equals(this.providerIds, musicVideoInfo.providerIds) + && Objects.equals(this.year, musicVideoInfo.year) + && Objects.equals(this.indexNumber, musicVideoInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, musicVideoInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, musicVideoInfo.premiereDate) + && Objects.equals(this.isAutomated, musicVideoInfo.isAutomated) + && Objects.equals(this.artists, musicVideoInfo.artists); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated, artists); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MusicVideoInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append(" artists: ").append(toIndentedString(artists)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + // add `Artists` to the URL query string + if (getArtists() != null) { + for (int i = 0; i < getArtists().size(); i++) { + joiner.add(String.format("%sArtists%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArtists().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private MusicVideoInfo instance; + + public Builder() { + this(new MusicVideoInfo()); + } + + protected Builder(MusicVideoInfo instance) { + this.instance = instance; + } + + public MusicVideoInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public MusicVideoInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public MusicVideoInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public MusicVideoInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public MusicVideoInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public MusicVideoInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public MusicVideoInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public MusicVideoInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public MusicVideoInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public MusicVideoInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public MusicVideoInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + public MusicVideoInfo.Builder artists(List artists) { + this.instance.artists = artists; + return this; + } + + /** + * returns a built MusicVideoInfo instance. + * + * The builder is not reusable. + */ + public MusicVideoInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MusicVideoInfo.Builder builder() { + return new MusicVideoInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MusicVideoInfo.Builder toBuilder() { + return new MusicVideoInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()).isAutomated(getIsAutomated()) + .artists(getArtists()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MusicVideoInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MusicVideoInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..f5ef7a368bbde --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/MusicVideoInfoRemoteSearchQuery.java @@ -0,0 +1,319 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MusicVideoInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ MusicVideoInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + MusicVideoInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, + MusicVideoInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + MusicVideoInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class MusicVideoInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private MusicVideoInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public MusicVideoInfoRemoteSearchQuery() { + } + + public MusicVideoInfoRemoteSearchQuery searchInfo(@org.eclipse.jdt.annotation.NonNull MusicVideoInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MusicVideoInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull MusicVideoInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public MusicVideoInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public MusicVideoInfoRemoteSearchQuery searchProviderName( + @org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public MusicVideoInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this MusicVideoInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MusicVideoInfoRemoteSearchQuery musicVideoInfoRemoteSearchQuery = (MusicVideoInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, musicVideoInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, musicVideoInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, musicVideoInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, + musicVideoInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MusicVideoInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private MusicVideoInfoRemoteSearchQuery instance; + + public Builder() { + this(new MusicVideoInfoRemoteSearchQuery()); + } + + protected Builder(MusicVideoInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public MusicVideoInfoRemoteSearchQuery.Builder searchInfo(MusicVideoInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public MusicVideoInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public MusicVideoInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public MusicVideoInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built MusicVideoInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public MusicVideoInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MusicVideoInfoRemoteSearchQuery.Builder builder() { + return new MusicVideoInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MusicVideoInfoRemoteSearchQuery.Builder toBuilder() { + return new MusicVideoInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NameGuidPair.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NameGuidPair.java new file mode 100644 index 0000000000000..33fa22949c7ee --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NameGuidPair.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * NameGuidPair + */ +@JsonPropertyOrder({ NameGuidPair.JSON_PROPERTY_NAME, NameGuidPair.JSON_PROPERTY_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NameGuidPair { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public NameGuidPair() { + } + + public NameGuidPair name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public NameGuidPair id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + /** + * Return true if this NameGuidPair object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NameGuidPair nameGuidPair = (NameGuidPair) o; + return Objects.equals(this.name, nameGuidPair.name) && Objects.equals(this.id, nameGuidPair.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NameGuidPair {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NameGuidPair instance; + + public Builder() { + this(new NameGuidPair()); + } + + protected Builder(NameGuidPair instance) { + this.instance = instance; + } + + public NameGuidPair.Builder name(String name) { + this.instance.name = name; + return this; + } + + public NameGuidPair.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + /** + * returns a built NameGuidPair instance. + * + * The builder is not reusable. + */ + public NameGuidPair build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NameGuidPair.Builder builder() { + return new NameGuidPair.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NameGuidPair.Builder toBuilder() { + return new NameGuidPair.Builder().name(getName()).id(getId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NameIdPair.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NameIdPair.java new file mode 100644 index 0000000000000..92716aaa674a5 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NameIdPair.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * NameIdPair + */ +@JsonPropertyOrder({ NameIdPair.JSON_PROPERTY_NAME, NameIdPair.JSON_PROPERTY_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NameIdPair { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public NameIdPair() { + } + + public NameIdPair name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public NameIdPair id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the identifier. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + /** + * Return true if this NameIdPair object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NameIdPair nameIdPair = (NameIdPair) o; + return Objects.equals(this.name, nameIdPair.name) && Objects.equals(this.id, nameIdPair.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NameIdPair {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NameIdPair instance; + + public Builder() { + this(new NameIdPair()); + } + + protected Builder(NameIdPair instance) { + this.instance = instance; + } + + public NameIdPair.Builder name(String name) { + this.instance.name = name; + return this; + } + + public NameIdPair.Builder id(String id) { + this.instance.id = id; + return this; + } + + /** + * returns a built NameIdPair instance. + * + * The builder is not reusable. + */ + public NameIdPair build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NameIdPair.Builder builder() { + return new NameIdPair.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NameIdPair.Builder toBuilder() { + return new NameIdPair.Builder().name(getName()).id(getId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NameValuePair.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NameValuePair.java new file mode 100644 index 0000000000000..6822ba5d25e8f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NameValuePair.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * NameValuePair + */ +@JsonPropertyOrder({ NameValuePair.JSON_PROPERTY_NAME, NameValuePair.JSON_PROPERTY_VALUE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NameValuePair { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_VALUE = "Value"; + @org.eclipse.jdt.annotation.NonNull + private String value; + + public NameValuePair() { + } + + public NameValuePair name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public NameValuePair value(@org.eclipse.jdt.annotation.NonNull String value) { + this.value = value; + return this; + } + + /** + * Gets or sets the value. + * + * @return value + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@org.eclipse.jdt.annotation.NonNull String value) { + this.value = value; + } + + /** + * Return true if this NameValuePair object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NameValuePair nameValuePair = (NameValuePair) o; + return Objects.equals(this.name, nameValuePair.name) && Objects.equals(this.value, nameValuePair.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NameValuePair {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Value` to the URL query string + if (getValue() != null) { + joiner.add(String.format("%sValue%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getValue())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NameValuePair instance; + + public Builder() { + this(new NameValuePair()); + } + + protected Builder(NameValuePair instance) { + this.instance = instance; + } + + public NameValuePair.Builder name(String name) { + this.instance.name = name; + return this; + } + + public NameValuePair.Builder value(String value) { + this.instance.value = value; + return this; + } + + /** + * returns a built NameValuePair instance. + * + * The builder is not reusable. + */ + public NameValuePair build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NameValuePair.Builder builder() { + return new NameValuePair.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NameValuePair.Builder toBuilder() { + return new NameValuePair.Builder().name(getName()).value(getValue()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NetworkConfiguration.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NetworkConfiguration.java new file mode 100644 index 0000000000000..45dc8ae33b1ae --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NetworkConfiguration.java @@ -0,0 +1,1637 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines the Jellyfin.Networking.Configuration.NetworkConfiguration. + */ +@JsonPropertyOrder({ NetworkConfiguration.JSON_PROPERTY_REQUIRE_HTTPS, + NetworkConfiguration.JSON_PROPERTY_CERTIFICATE_PATH, NetworkConfiguration.JSON_PROPERTY_CERTIFICATE_PASSWORD, + NetworkConfiguration.JSON_PROPERTY_BASE_URL, NetworkConfiguration.JSON_PROPERTY_PUBLIC_HTTPS_PORT, + NetworkConfiguration.JSON_PROPERTY_HTTP_SERVER_PORT_NUMBER, + NetworkConfiguration.JSON_PROPERTY_HTTPS_PORT_NUMBER, NetworkConfiguration.JSON_PROPERTY_ENABLE_HTTPS, + NetworkConfiguration.JSON_PROPERTY_PUBLIC_PORT, NetworkConfiguration.JSON_PROPERTY_UPN_P_CREATE_HTTP_PORT_MAP, + NetworkConfiguration.JSON_PROPERTY_UD_P_PORT_RANGE, NetworkConfiguration.JSON_PROPERTY_ENABLE_I_P_V6, + NetworkConfiguration.JSON_PROPERTY_ENABLE_I_P_V4, NetworkConfiguration.JSON_PROPERTY_ENABLE_S_S_D_P_TRACING, + NetworkConfiguration.JSON_PROPERTY_SS_D_P_TRACING_FILTER, NetworkConfiguration.JSON_PROPERTY_UD_P_SEND_COUNT, + NetworkConfiguration.JSON_PROPERTY_UD_P_SEND_DELAY, + NetworkConfiguration.JSON_PROPERTY_IGNORE_VIRTUAL_INTERFACES, + NetworkConfiguration.JSON_PROPERTY_VIRTUAL_INTERFACE_NAMES, + NetworkConfiguration.JSON_PROPERTY_GATEWAY_MONITOR_PERIOD, + NetworkConfiguration.JSON_PROPERTY_ENABLE_MULTI_SOCKET_BINDING, + NetworkConfiguration.JSON_PROPERTY_TRUST_ALL_I_P6_INTERFACES, + NetworkConfiguration.JSON_PROPERTY_HD_HOMERUN_PORT_RANGE, + NetworkConfiguration.JSON_PROPERTY_PUBLISHED_SERVER_URI_BY_SUBNET, + NetworkConfiguration.JSON_PROPERTY_AUTO_DISCOVERY_TRACING, NetworkConfiguration.JSON_PROPERTY_AUTO_DISCOVERY, + NetworkConfiguration.JSON_PROPERTY_REMOTE_I_P_FILTER, + NetworkConfiguration.JSON_PROPERTY_IS_REMOTE_I_P_FILTER_BLACKLIST, + NetworkConfiguration.JSON_PROPERTY_ENABLE_U_PN_P, NetworkConfiguration.JSON_PROPERTY_ENABLE_REMOTE_ACCESS, + NetworkConfiguration.JSON_PROPERTY_LOCAL_NETWORK_SUBNETS, + NetworkConfiguration.JSON_PROPERTY_LOCAL_NETWORK_ADDRESSES, NetworkConfiguration.JSON_PROPERTY_KNOWN_PROXIES, + NetworkConfiguration.JSON_PROPERTY_ENABLE_PUBLISHED_SERVER_URI_BY_REQUEST }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NetworkConfiguration { + public static final String JSON_PROPERTY_REQUIRE_HTTPS = "RequireHttps"; + @org.eclipse.jdt.annotation.NonNull + private Boolean requireHttps; + + public static final String JSON_PROPERTY_CERTIFICATE_PATH = "CertificatePath"; + @org.eclipse.jdt.annotation.NonNull + private String certificatePath; + + public static final String JSON_PROPERTY_CERTIFICATE_PASSWORD = "CertificatePassword"; + @org.eclipse.jdt.annotation.NonNull + private String certificatePassword; + + public static final String JSON_PROPERTY_BASE_URL = "BaseUrl"; + @org.eclipse.jdt.annotation.NonNull + private String baseUrl; + + public static final String JSON_PROPERTY_PUBLIC_HTTPS_PORT = "PublicHttpsPort"; + @org.eclipse.jdt.annotation.NonNull + private Integer publicHttpsPort; + + public static final String JSON_PROPERTY_HTTP_SERVER_PORT_NUMBER = "HttpServerPortNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer httpServerPortNumber; + + public static final String JSON_PROPERTY_HTTPS_PORT_NUMBER = "HttpsPortNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer httpsPortNumber; + + public static final String JSON_PROPERTY_ENABLE_HTTPS = "EnableHttps"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableHttps; + + public static final String JSON_PROPERTY_PUBLIC_PORT = "PublicPort"; + @org.eclipse.jdt.annotation.NonNull + private Integer publicPort; + + public static final String JSON_PROPERTY_UPN_P_CREATE_HTTP_PORT_MAP = "UPnPCreateHttpPortMap"; + @org.eclipse.jdt.annotation.NonNull + private Boolean upnPCreateHttpPortMap; + + public static final String JSON_PROPERTY_UD_P_PORT_RANGE = "UDPPortRange"; + @org.eclipse.jdt.annotation.NonNull + private String udPPortRange; + + public static final String JSON_PROPERTY_ENABLE_I_P_V6 = "EnableIPV6"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableIPV6; + + public static final String JSON_PROPERTY_ENABLE_I_P_V4 = "EnableIPV4"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableIPV4; + + public static final String JSON_PROPERTY_ENABLE_S_S_D_P_TRACING = "EnableSSDPTracing"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableSSDPTracing; + + public static final String JSON_PROPERTY_SS_D_P_TRACING_FILTER = "SSDPTracingFilter"; + @org.eclipse.jdt.annotation.NonNull + private String ssDPTracingFilter; + + public static final String JSON_PROPERTY_UD_P_SEND_COUNT = "UDPSendCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer udPSendCount; + + public static final String JSON_PROPERTY_UD_P_SEND_DELAY = "UDPSendDelay"; + @org.eclipse.jdt.annotation.NonNull + private Integer udPSendDelay; + + public static final String JSON_PROPERTY_IGNORE_VIRTUAL_INTERFACES = "IgnoreVirtualInterfaces"; + @org.eclipse.jdt.annotation.NonNull + private Boolean ignoreVirtualInterfaces; + + public static final String JSON_PROPERTY_VIRTUAL_INTERFACE_NAMES = "VirtualInterfaceNames"; + @org.eclipse.jdt.annotation.NonNull + private String virtualInterfaceNames; + + public static final String JSON_PROPERTY_GATEWAY_MONITOR_PERIOD = "GatewayMonitorPeriod"; + @org.eclipse.jdt.annotation.NonNull + private Integer gatewayMonitorPeriod; + + public static final String JSON_PROPERTY_ENABLE_MULTI_SOCKET_BINDING = "EnableMultiSocketBinding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableMultiSocketBinding; + + public static final String JSON_PROPERTY_TRUST_ALL_I_P6_INTERFACES = "TrustAllIP6Interfaces"; + @org.eclipse.jdt.annotation.NonNull + private Boolean trustAllIP6Interfaces; + + public static final String JSON_PROPERTY_HD_HOMERUN_PORT_RANGE = "HDHomerunPortRange"; + @org.eclipse.jdt.annotation.NonNull + private String hdHomerunPortRange; + + public static final String JSON_PROPERTY_PUBLISHED_SERVER_URI_BY_SUBNET = "PublishedServerUriBySubnet"; + @org.eclipse.jdt.annotation.NonNull + private List publishedServerUriBySubnet = new ArrayList<>(); + + public static final String JSON_PROPERTY_AUTO_DISCOVERY_TRACING = "AutoDiscoveryTracing"; + @org.eclipse.jdt.annotation.NonNull + private Boolean autoDiscoveryTracing; + + public static final String JSON_PROPERTY_AUTO_DISCOVERY = "AutoDiscovery"; + @org.eclipse.jdt.annotation.NonNull + private Boolean autoDiscovery; + + public static final String JSON_PROPERTY_REMOTE_I_P_FILTER = "RemoteIPFilter"; + @org.eclipse.jdt.annotation.NonNull + private List remoteIPFilter = new ArrayList<>(); + + public static final String JSON_PROPERTY_IS_REMOTE_I_P_FILTER_BLACKLIST = "IsRemoteIPFilterBlacklist"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isRemoteIPFilterBlacklist; + + public static final String JSON_PROPERTY_ENABLE_U_PN_P = "EnableUPnP"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableUPnP; + + public static final String JSON_PROPERTY_ENABLE_REMOTE_ACCESS = "EnableRemoteAccess"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableRemoteAccess; + + public static final String JSON_PROPERTY_LOCAL_NETWORK_SUBNETS = "LocalNetworkSubnets"; + @org.eclipse.jdt.annotation.NonNull + private List localNetworkSubnets = new ArrayList<>(); + + public static final String JSON_PROPERTY_LOCAL_NETWORK_ADDRESSES = "LocalNetworkAddresses"; + @org.eclipse.jdt.annotation.NonNull + private List localNetworkAddresses = new ArrayList<>(); + + public static final String JSON_PROPERTY_KNOWN_PROXIES = "KnownProxies"; + @org.eclipse.jdt.annotation.NonNull + private List knownProxies = new ArrayList<>(); + + public static final String JSON_PROPERTY_ENABLE_PUBLISHED_SERVER_URI_BY_REQUEST = "EnablePublishedServerUriByRequest"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enablePublishedServerUriByRequest; + + public NetworkConfiguration() { + } + + @JsonCreator + public NetworkConfiguration( + @JsonProperty(JSON_PROPERTY_ENABLE_MULTI_SOCKET_BINDING) Boolean enableMultiSocketBinding) { + this(); + this.enableMultiSocketBinding = enableMultiSocketBinding; + } + + public NetworkConfiguration requireHttps(@org.eclipse.jdt.annotation.NonNull Boolean requireHttps) { + this.requireHttps = requireHttps; + return this; + } + + /** + * Gets or sets a value indicating whether the server should force connections over HTTPS. + * + * @return requireHttps + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUIRE_HTTPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequireHttps() { + return requireHttps; + } + + @JsonProperty(JSON_PROPERTY_REQUIRE_HTTPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequireHttps(@org.eclipse.jdt.annotation.NonNull Boolean requireHttps) { + this.requireHttps = requireHttps; + } + + public NetworkConfiguration certificatePath(@org.eclipse.jdt.annotation.NonNull String certificatePath) { + this.certificatePath = certificatePath; + return this; + } + + /** + * Gets or sets the filesystem path of an X.509 certificate to use for SSL. + * + * @return certificatePath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CERTIFICATE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCertificatePath() { + return certificatePath; + } + + @JsonProperty(JSON_PROPERTY_CERTIFICATE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCertificatePath(@org.eclipse.jdt.annotation.NonNull String certificatePath) { + this.certificatePath = certificatePath; + } + + public NetworkConfiguration certificatePassword(@org.eclipse.jdt.annotation.NonNull String certificatePassword) { + this.certificatePassword = certificatePassword; + return this; + } + + /** + * Gets or sets the password required to access the X.509 certificate data in the file specified by + * Jellyfin.Networking.Configuration.NetworkConfiguration.CertificatePath. + * + * @return certificatePassword + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CERTIFICATE_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCertificatePassword() { + return certificatePassword; + } + + @JsonProperty(JSON_PROPERTY_CERTIFICATE_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCertificatePassword(@org.eclipse.jdt.annotation.NonNull String certificatePassword) { + this.certificatePassword = certificatePassword; + } + + public NetworkConfiguration baseUrl(@org.eclipse.jdt.annotation.NonNull String baseUrl) { + this.baseUrl = baseUrl; + return this; + } + + /** + * Gets or sets a value used to specify the URL prefix that your Jellyfin instance can be accessed at. + * + * @return baseUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BASE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaseUrl() { + return baseUrl; + } + + @JsonProperty(JSON_PROPERTY_BASE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBaseUrl(@org.eclipse.jdt.annotation.NonNull String baseUrl) { + this.baseUrl = baseUrl; + } + + public NetworkConfiguration publicHttpsPort(@org.eclipse.jdt.annotation.NonNull Integer publicHttpsPort) { + this.publicHttpsPort = publicHttpsPort; + return this; + } + + /** + * Gets or sets the public HTTPS port. + * + * @return publicHttpsPort + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PUBLIC_HTTPS_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPublicHttpsPort() { + return publicHttpsPort; + } + + @JsonProperty(JSON_PROPERTY_PUBLIC_HTTPS_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPublicHttpsPort(@org.eclipse.jdt.annotation.NonNull Integer publicHttpsPort) { + this.publicHttpsPort = publicHttpsPort; + } + + public NetworkConfiguration httpServerPortNumber(@org.eclipse.jdt.annotation.NonNull Integer httpServerPortNumber) { + this.httpServerPortNumber = httpServerPortNumber; + return this; + } + + /** + * Gets or sets the HTTP server port number. + * + * @return httpServerPortNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HTTP_SERVER_PORT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHttpServerPortNumber() { + return httpServerPortNumber; + } + + @JsonProperty(JSON_PROPERTY_HTTP_SERVER_PORT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHttpServerPortNumber(@org.eclipse.jdt.annotation.NonNull Integer httpServerPortNumber) { + this.httpServerPortNumber = httpServerPortNumber; + } + + public NetworkConfiguration httpsPortNumber(@org.eclipse.jdt.annotation.NonNull Integer httpsPortNumber) { + this.httpsPortNumber = httpsPortNumber; + return this; + } + + /** + * Gets or sets the HTTPS server port number. + * + * @return httpsPortNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HTTPS_PORT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHttpsPortNumber() { + return httpsPortNumber; + } + + @JsonProperty(JSON_PROPERTY_HTTPS_PORT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHttpsPortNumber(@org.eclipse.jdt.annotation.NonNull Integer httpsPortNumber) { + this.httpsPortNumber = httpsPortNumber; + } + + public NetworkConfiguration enableHttps(@org.eclipse.jdt.annotation.NonNull Boolean enableHttps) { + this.enableHttps = enableHttps; + return this; + } + + /** + * Gets or sets a value indicating whether to use HTTPS. + * + * @return enableHttps + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_HTTPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableHttps() { + return enableHttps; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_HTTPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableHttps(@org.eclipse.jdt.annotation.NonNull Boolean enableHttps) { + this.enableHttps = enableHttps; + } + + public NetworkConfiguration publicPort(@org.eclipse.jdt.annotation.NonNull Integer publicPort) { + this.publicPort = publicPort; + return this; + } + + /** + * Gets or sets the public mapped port. + * + * @return publicPort + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PUBLIC_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPublicPort() { + return publicPort; + } + + @JsonProperty(JSON_PROPERTY_PUBLIC_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPublicPort(@org.eclipse.jdt.annotation.NonNull Integer publicPort) { + this.publicPort = publicPort; + } + + public NetworkConfiguration upnPCreateHttpPortMap( + @org.eclipse.jdt.annotation.NonNull Boolean upnPCreateHttpPortMap) { + this.upnPCreateHttpPortMap = upnPCreateHttpPortMap; + return this; + } + + /** + * Gets or sets a value indicating whether the http port should be mapped as part of UPnP automatic port forwarding. + * + * @return upnPCreateHttpPortMap + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_UPN_P_CREATE_HTTP_PORT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUpnPCreateHttpPortMap() { + return upnPCreateHttpPortMap; + } + + @JsonProperty(JSON_PROPERTY_UPN_P_CREATE_HTTP_PORT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpnPCreateHttpPortMap(@org.eclipse.jdt.annotation.NonNull Boolean upnPCreateHttpPortMap) { + this.upnPCreateHttpPortMap = upnPCreateHttpPortMap; + } + + public NetworkConfiguration udPPortRange(@org.eclipse.jdt.annotation.NonNull String udPPortRange) { + this.udPPortRange = udPPortRange; + return this; + } + + /** + * Gets or sets the UDPPortRange. + * + * @return udPPortRange + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_UD_P_PORT_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUdPPortRange() { + return udPPortRange; + } + + @JsonProperty(JSON_PROPERTY_UD_P_PORT_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUdPPortRange(@org.eclipse.jdt.annotation.NonNull String udPPortRange) { + this.udPPortRange = udPPortRange; + } + + public NetworkConfiguration enableIPV6(@org.eclipse.jdt.annotation.NonNull Boolean enableIPV6) { + this.enableIPV6 = enableIPV6; + return this; + } + + /** + * Gets or sets a value indicating whether gets or sets IPV6 capability. + * + * @return enableIPV6 + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_I_P_V6) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableIPV6() { + return enableIPV6; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_I_P_V6) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableIPV6(@org.eclipse.jdt.annotation.NonNull Boolean enableIPV6) { + this.enableIPV6 = enableIPV6; + } + + public NetworkConfiguration enableIPV4(@org.eclipse.jdt.annotation.NonNull Boolean enableIPV4) { + this.enableIPV4 = enableIPV4; + return this; + } + + /** + * Gets or sets a value indicating whether gets or sets IPV4 capability. + * + * @return enableIPV4 + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_I_P_V4) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableIPV4() { + return enableIPV4; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_I_P_V4) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableIPV4(@org.eclipse.jdt.annotation.NonNull Boolean enableIPV4) { + this.enableIPV4 = enableIPV4; + } + + public NetworkConfiguration enableSSDPTracing(@org.eclipse.jdt.annotation.NonNull Boolean enableSSDPTracing) { + this.enableSSDPTracing = enableSSDPTracing; + return this; + } + + /** + * Gets or sets a value indicating whether detailed SSDP logs are sent to the console/log. \"Emby.Dlna\": + * \"Debug\" must be set in logging.default.json for this property to have any effect. + * + * @return enableSSDPTracing + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_S_S_D_P_TRACING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableSSDPTracing() { + return enableSSDPTracing; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_S_S_D_P_TRACING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableSSDPTracing(@org.eclipse.jdt.annotation.NonNull Boolean enableSSDPTracing) { + this.enableSSDPTracing = enableSSDPTracing; + } + + public NetworkConfiguration ssDPTracingFilter(@org.eclipse.jdt.annotation.NonNull String ssDPTracingFilter) { + this.ssDPTracingFilter = ssDPTracingFilter; + return this; + } + + /** + * Gets or sets the SSDPTracingFilter Gets or sets a value indicating whether an IP address is to be used to filter + * the detailed ssdp logs that are being sent to the console/log. If the setting \"Emby.Dlna\": + * \"Debug\" msut be set in logging.default.json for this property to work. + * + * @return ssDPTracingFilter + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SS_D_P_TRACING_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSsDPTracingFilter() { + return ssDPTracingFilter; + } + + @JsonProperty(JSON_PROPERTY_SS_D_P_TRACING_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSsDPTracingFilter(@org.eclipse.jdt.annotation.NonNull String ssDPTracingFilter) { + this.ssDPTracingFilter = ssDPTracingFilter; + } + + public NetworkConfiguration udPSendCount(@org.eclipse.jdt.annotation.NonNull Integer udPSendCount) { + this.udPSendCount = udPSendCount; + return this; + } + + /** + * Gets or sets the number of times SSDP UDP messages are sent. + * + * @return udPSendCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_UD_P_SEND_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUdPSendCount() { + return udPSendCount; + } + + @JsonProperty(JSON_PROPERTY_UD_P_SEND_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUdPSendCount(@org.eclipse.jdt.annotation.NonNull Integer udPSendCount) { + this.udPSendCount = udPSendCount; + } + + public NetworkConfiguration udPSendDelay(@org.eclipse.jdt.annotation.NonNull Integer udPSendDelay) { + this.udPSendDelay = udPSendDelay; + return this; + } + + /** + * Gets or sets the delay between each groups of SSDP messages (in ms). + * + * @return udPSendDelay + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_UD_P_SEND_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUdPSendDelay() { + return udPSendDelay; + } + + @JsonProperty(JSON_PROPERTY_UD_P_SEND_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUdPSendDelay(@org.eclipse.jdt.annotation.NonNull Integer udPSendDelay) { + this.udPSendDelay = udPSendDelay; + } + + public NetworkConfiguration ignoreVirtualInterfaces( + @org.eclipse.jdt.annotation.NonNull Boolean ignoreVirtualInterfaces) { + this.ignoreVirtualInterfaces = ignoreVirtualInterfaces; + return this; + } + + /** + * Gets or sets a value indicating whether address names that match + * Jellyfin.Networking.Configuration.NetworkConfiguration.VirtualInterfaceNames should be Ignore for the purposes of + * binding. + * + * @return ignoreVirtualInterfaces + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IGNORE_VIRTUAL_INTERFACES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIgnoreVirtualInterfaces() { + return ignoreVirtualInterfaces; + } + + @JsonProperty(JSON_PROPERTY_IGNORE_VIRTUAL_INTERFACES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIgnoreVirtualInterfaces(@org.eclipse.jdt.annotation.NonNull Boolean ignoreVirtualInterfaces) { + this.ignoreVirtualInterfaces = ignoreVirtualInterfaces; + } + + public NetworkConfiguration virtualInterfaceNames( + @org.eclipse.jdt.annotation.NonNull String virtualInterfaceNames) { + this.virtualInterfaceNames = virtualInterfaceNames; + return this; + } + + /** + * Gets or sets a value indicating the interfaces that should be ignored. The list can be comma separated. + * <seealso + * cref=\"P:Jellyfin.Networking.Configuration.NetworkConfiguration.IgnoreVirtualInterfaces\" />. + * + * @return virtualInterfaceNames + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIRTUAL_INTERFACE_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVirtualInterfaceNames() { + return virtualInterfaceNames; + } + + @JsonProperty(JSON_PROPERTY_VIRTUAL_INTERFACE_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVirtualInterfaceNames(@org.eclipse.jdt.annotation.NonNull String virtualInterfaceNames) { + this.virtualInterfaceNames = virtualInterfaceNames; + } + + public NetworkConfiguration gatewayMonitorPeriod(@org.eclipse.jdt.annotation.NonNull Integer gatewayMonitorPeriod) { + this.gatewayMonitorPeriod = gatewayMonitorPeriod; + return this; + } + + /** + * Gets or sets the time (in seconds) between the pings of SSDP gateway monitor. + * + * @return gatewayMonitorPeriod + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GATEWAY_MONITOR_PERIOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getGatewayMonitorPeriod() { + return gatewayMonitorPeriod; + } + + @JsonProperty(JSON_PROPERTY_GATEWAY_MONITOR_PERIOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGatewayMonitorPeriod(@org.eclipse.jdt.annotation.NonNull Integer gatewayMonitorPeriod) { + this.gatewayMonitorPeriod = gatewayMonitorPeriod; + } + + /** + * Gets a value indicating whether multi-socket binding is available. + * + * @return enableMultiSocketBinding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_MULTI_SOCKET_BINDING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableMultiSocketBinding() { + return enableMultiSocketBinding; + } + + public NetworkConfiguration trustAllIP6Interfaces( + @org.eclipse.jdt.annotation.NonNull Boolean trustAllIP6Interfaces) { + this.trustAllIP6Interfaces = trustAllIP6Interfaces; + return this; + } + + /** + * Gets or sets a value indicating whether all IPv6 interfaces should be treated as on the internal network. + * Depending on the address range implemented ULA ranges might not be used. + * + * @return trustAllIP6Interfaces + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRUST_ALL_I_P6_INTERFACES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTrustAllIP6Interfaces() { + return trustAllIP6Interfaces; + } + + @JsonProperty(JSON_PROPERTY_TRUST_ALL_I_P6_INTERFACES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrustAllIP6Interfaces(@org.eclipse.jdt.annotation.NonNull Boolean trustAllIP6Interfaces) { + this.trustAllIP6Interfaces = trustAllIP6Interfaces; + } + + public NetworkConfiguration hdHomerunPortRange(@org.eclipse.jdt.annotation.NonNull String hdHomerunPortRange) { + this.hdHomerunPortRange = hdHomerunPortRange; + return this; + } + + /** + * Gets or sets the ports that HDHomerun uses. + * + * @return hdHomerunPortRange + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HD_HOMERUN_PORT_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHdHomerunPortRange() { + return hdHomerunPortRange; + } + + @JsonProperty(JSON_PROPERTY_HD_HOMERUN_PORT_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHdHomerunPortRange(@org.eclipse.jdt.annotation.NonNull String hdHomerunPortRange) { + this.hdHomerunPortRange = hdHomerunPortRange; + } + + public NetworkConfiguration publishedServerUriBySubnet( + @org.eclipse.jdt.annotation.NonNull List publishedServerUriBySubnet) { + this.publishedServerUriBySubnet = publishedServerUriBySubnet; + return this; + } + + public NetworkConfiguration addPublishedServerUriBySubnetItem(String publishedServerUriBySubnetItem) { + if (this.publishedServerUriBySubnet == null) { + this.publishedServerUriBySubnet = new ArrayList<>(); + } + this.publishedServerUriBySubnet.add(publishedServerUriBySubnetItem); + return this; + } + + /** + * Gets or sets the PublishedServerUriBySubnet Gets or sets PublishedServerUri to advertise for specific subnets. + * + * @return publishedServerUriBySubnet + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PUBLISHED_SERVER_URI_BY_SUBNET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPublishedServerUriBySubnet() { + return publishedServerUriBySubnet; + } + + @JsonProperty(JSON_PROPERTY_PUBLISHED_SERVER_URI_BY_SUBNET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPublishedServerUriBySubnet( + @org.eclipse.jdt.annotation.NonNull List publishedServerUriBySubnet) { + this.publishedServerUriBySubnet = publishedServerUriBySubnet; + } + + public NetworkConfiguration autoDiscoveryTracing(@org.eclipse.jdt.annotation.NonNull Boolean autoDiscoveryTracing) { + this.autoDiscoveryTracing = autoDiscoveryTracing; + return this; + } + + /** + * Gets or sets a value indicating whether Autodiscovery tracing is enabled. + * + * @return autoDiscoveryTracing + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTO_DISCOVERY_TRACING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAutoDiscoveryTracing() { + return autoDiscoveryTracing; + } + + @JsonProperty(JSON_PROPERTY_AUTO_DISCOVERY_TRACING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAutoDiscoveryTracing(@org.eclipse.jdt.annotation.NonNull Boolean autoDiscoveryTracing) { + this.autoDiscoveryTracing = autoDiscoveryTracing; + } + + public NetworkConfiguration autoDiscovery(@org.eclipse.jdt.annotation.NonNull Boolean autoDiscovery) { + this.autoDiscovery = autoDiscovery; + return this; + } + + /** + * Gets or sets a value indicating whether Autodiscovery is enabled. + * + * @return autoDiscovery + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTO_DISCOVERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAutoDiscovery() { + return autoDiscovery; + } + + @JsonProperty(JSON_PROPERTY_AUTO_DISCOVERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAutoDiscovery(@org.eclipse.jdt.annotation.NonNull Boolean autoDiscovery) { + this.autoDiscovery = autoDiscovery; + } + + public NetworkConfiguration remoteIPFilter(@org.eclipse.jdt.annotation.NonNull List remoteIPFilter) { + this.remoteIPFilter = remoteIPFilter; + return this; + } + + public NetworkConfiguration addRemoteIPFilterItem(String remoteIPFilterItem) { + if (this.remoteIPFilter == null) { + this.remoteIPFilter = new ArrayList<>(); + } + this.remoteIPFilter.add(remoteIPFilterItem); + return this; + } + + /** + * Gets or sets the filter for remote IP connectivity. Used in conjuntion with <seealso + * cref=\"P:Jellyfin.Networking.Configuration.NetworkConfiguration.IsRemoteIPFilterBlacklist\" />. + * + * @return remoteIPFilter + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMOTE_I_P_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRemoteIPFilter() { + return remoteIPFilter; + } + + @JsonProperty(JSON_PROPERTY_REMOTE_I_P_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemoteIPFilter(@org.eclipse.jdt.annotation.NonNull List remoteIPFilter) { + this.remoteIPFilter = remoteIPFilter; + } + + public NetworkConfiguration isRemoteIPFilterBlacklist( + @org.eclipse.jdt.annotation.NonNull Boolean isRemoteIPFilterBlacklist) { + this.isRemoteIPFilterBlacklist = isRemoteIPFilterBlacklist; + return this; + } + + /** + * Gets or sets a value indicating whether <seealso + * cref=\"P:Jellyfin.Networking.Configuration.NetworkConfiguration.RemoteIPFilter\" /> contains a + * blacklist or a whitelist. Default is a whitelist. + * + * @return isRemoteIPFilterBlacklist + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_REMOTE_I_P_FILTER_BLACKLIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsRemoteIPFilterBlacklist() { + return isRemoteIPFilterBlacklist; + } + + @JsonProperty(JSON_PROPERTY_IS_REMOTE_I_P_FILTER_BLACKLIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsRemoteIPFilterBlacklist(@org.eclipse.jdt.annotation.NonNull Boolean isRemoteIPFilterBlacklist) { + this.isRemoteIPFilterBlacklist = isRemoteIPFilterBlacklist; + } + + public NetworkConfiguration enableUPnP(@org.eclipse.jdt.annotation.NonNull Boolean enableUPnP) { + this.enableUPnP = enableUPnP; + return this; + } + + /** + * Gets or sets a value indicating whether to enable automatic port forwarding. + * + * @return enableUPnP + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_U_PN_P) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableUPnP() { + return enableUPnP; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_U_PN_P) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableUPnP(@org.eclipse.jdt.annotation.NonNull Boolean enableUPnP) { + this.enableUPnP = enableUPnP; + } + + public NetworkConfiguration enableRemoteAccess(@org.eclipse.jdt.annotation.NonNull Boolean enableRemoteAccess) { + this.enableRemoteAccess = enableRemoteAccess; + return this; + } + + /** + * Gets or sets a value indicating whether access outside of the LAN is permitted. + * + * @return enableRemoteAccess + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_REMOTE_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableRemoteAccess() { + return enableRemoteAccess; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_REMOTE_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableRemoteAccess(@org.eclipse.jdt.annotation.NonNull Boolean enableRemoteAccess) { + this.enableRemoteAccess = enableRemoteAccess; + } + + public NetworkConfiguration localNetworkSubnets( + @org.eclipse.jdt.annotation.NonNull List localNetworkSubnets) { + this.localNetworkSubnets = localNetworkSubnets; + return this; + } + + public NetworkConfiguration addLocalNetworkSubnetsItem(String localNetworkSubnetsItem) { + if (this.localNetworkSubnets == null) { + this.localNetworkSubnets = new ArrayList<>(); + } + this.localNetworkSubnets.add(localNetworkSubnetsItem); + return this; + } + + /** + * Gets or sets the subnets that are deemed to make up the LAN. + * + * @return localNetworkSubnets + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCAL_NETWORK_SUBNETS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLocalNetworkSubnets() { + return localNetworkSubnets; + } + + @JsonProperty(JSON_PROPERTY_LOCAL_NETWORK_SUBNETS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalNetworkSubnets(@org.eclipse.jdt.annotation.NonNull List localNetworkSubnets) { + this.localNetworkSubnets = localNetworkSubnets; + } + + public NetworkConfiguration localNetworkAddresses( + @org.eclipse.jdt.annotation.NonNull List localNetworkAddresses) { + this.localNetworkAddresses = localNetworkAddresses; + return this; + } + + public NetworkConfiguration addLocalNetworkAddressesItem(String localNetworkAddressesItem) { + if (this.localNetworkAddresses == null) { + this.localNetworkAddresses = new ArrayList<>(); + } + this.localNetworkAddresses.add(localNetworkAddressesItem); + return this; + } + + /** + * Gets or sets the interface addresses which Jellyfin will bind to. If empty, all interfaces will be used. + * + * @return localNetworkAddresses + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCAL_NETWORK_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLocalNetworkAddresses() { + return localNetworkAddresses; + } + + @JsonProperty(JSON_PROPERTY_LOCAL_NETWORK_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalNetworkAddresses(@org.eclipse.jdt.annotation.NonNull List localNetworkAddresses) { + this.localNetworkAddresses = localNetworkAddresses; + } + + public NetworkConfiguration knownProxies(@org.eclipse.jdt.annotation.NonNull List knownProxies) { + this.knownProxies = knownProxies; + return this; + } + + public NetworkConfiguration addKnownProxiesItem(String knownProxiesItem) { + if (this.knownProxies == null) { + this.knownProxies = new ArrayList<>(); + } + this.knownProxies.add(knownProxiesItem); + return this; + } + + /** + * Gets or sets the known proxies. If the proxy is a network, it's added to the KnownNetworks. + * + * @return knownProxies + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KNOWN_PROXIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getKnownProxies() { + return knownProxies; + } + + @JsonProperty(JSON_PROPERTY_KNOWN_PROXIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKnownProxies(@org.eclipse.jdt.annotation.NonNull List knownProxies) { + this.knownProxies = knownProxies; + } + + public NetworkConfiguration enablePublishedServerUriByRequest( + @org.eclipse.jdt.annotation.NonNull Boolean enablePublishedServerUriByRequest) { + this.enablePublishedServerUriByRequest = enablePublishedServerUriByRequest; + return this; + } + + /** + * Gets or sets a value indicating whether the published server uri is based on information in HTTP requests. + * + * @return enablePublishedServerUriByRequest + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_PUBLISHED_SERVER_URI_BY_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnablePublishedServerUriByRequest() { + return enablePublishedServerUriByRequest; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_PUBLISHED_SERVER_URI_BY_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnablePublishedServerUriByRequest( + @org.eclipse.jdt.annotation.NonNull Boolean enablePublishedServerUriByRequest) { + this.enablePublishedServerUriByRequest = enablePublishedServerUriByRequest; + } + + /** + * Return true if this NetworkConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NetworkConfiguration networkConfiguration = (NetworkConfiguration) o; + return Objects.equals(this.requireHttps, networkConfiguration.requireHttps) + && Objects.equals(this.certificatePath, networkConfiguration.certificatePath) + && Objects.equals(this.certificatePassword, networkConfiguration.certificatePassword) + && Objects.equals(this.baseUrl, networkConfiguration.baseUrl) + && Objects.equals(this.publicHttpsPort, networkConfiguration.publicHttpsPort) + && Objects.equals(this.httpServerPortNumber, networkConfiguration.httpServerPortNumber) + && Objects.equals(this.httpsPortNumber, networkConfiguration.httpsPortNumber) + && Objects.equals(this.enableHttps, networkConfiguration.enableHttps) + && Objects.equals(this.publicPort, networkConfiguration.publicPort) + && Objects.equals(this.upnPCreateHttpPortMap, networkConfiguration.upnPCreateHttpPortMap) + && Objects.equals(this.udPPortRange, networkConfiguration.udPPortRange) + && Objects.equals(this.enableIPV6, networkConfiguration.enableIPV6) + && Objects.equals(this.enableIPV4, networkConfiguration.enableIPV4) + && Objects.equals(this.enableSSDPTracing, networkConfiguration.enableSSDPTracing) + && Objects.equals(this.ssDPTracingFilter, networkConfiguration.ssDPTracingFilter) + && Objects.equals(this.udPSendCount, networkConfiguration.udPSendCount) + && Objects.equals(this.udPSendDelay, networkConfiguration.udPSendDelay) + && Objects.equals(this.ignoreVirtualInterfaces, networkConfiguration.ignoreVirtualInterfaces) + && Objects.equals(this.virtualInterfaceNames, networkConfiguration.virtualInterfaceNames) + && Objects.equals(this.gatewayMonitorPeriod, networkConfiguration.gatewayMonitorPeriod) + && Objects.equals(this.enableMultiSocketBinding, networkConfiguration.enableMultiSocketBinding) + && Objects.equals(this.trustAllIP6Interfaces, networkConfiguration.trustAllIP6Interfaces) + && Objects.equals(this.hdHomerunPortRange, networkConfiguration.hdHomerunPortRange) + && Objects.equals(this.publishedServerUriBySubnet, networkConfiguration.publishedServerUriBySubnet) + && Objects.equals(this.autoDiscoveryTracing, networkConfiguration.autoDiscoveryTracing) + && Objects.equals(this.autoDiscovery, networkConfiguration.autoDiscovery) + && Objects.equals(this.remoteIPFilter, networkConfiguration.remoteIPFilter) + && Objects.equals(this.isRemoteIPFilterBlacklist, networkConfiguration.isRemoteIPFilterBlacklist) + && Objects.equals(this.enableUPnP, networkConfiguration.enableUPnP) + && Objects.equals(this.enableRemoteAccess, networkConfiguration.enableRemoteAccess) + && Objects.equals(this.localNetworkSubnets, networkConfiguration.localNetworkSubnets) + && Objects.equals(this.localNetworkAddresses, networkConfiguration.localNetworkAddresses) + && Objects.equals(this.knownProxies, networkConfiguration.knownProxies) && Objects.equals( + this.enablePublishedServerUriByRequest, networkConfiguration.enablePublishedServerUriByRequest); + } + + @Override + public int hashCode() { + return Objects.hash(requireHttps, certificatePath, certificatePassword, baseUrl, publicHttpsPort, + httpServerPortNumber, httpsPortNumber, enableHttps, publicPort, upnPCreateHttpPortMap, udPPortRange, + enableIPV6, enableIPV4, enableSSDPTracing, ssDPTracingFilter, udPSendCount, udPSendDelay, + ignoreVirtualInterfaces, virtualInterfaceNames, gatewayMonitorPeriod, enableMultiSocketBinding, + trustAllIP6Interfaces, hdHomerunPortRange, publishedServerUriBySubnet, autoDiscoveryTracing, + autoDiscovery, remoteIPFilter, isRemoteIPFilterBlacklist, enableUPnP, enableRemoteAccess, + localNetworkSubnets, localNetworkAddresses, knownProxies, enablePublishedServerUriByRequest); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NetworkConfiguration {\n"); + sb.append(" requireHttps: ").append(toIndentedString(requireHttps)).append("\n"); + sb.append(" certificatePath: ").append(toIndentedString(certificatePath)).append("\n"); + sb.append(" certificatePassword: ").append(toIndentedString(certificatePassword)).append("\n"); + sb.append(" baseUrl: ").append(toIndentedString(baseUrl)).append("\n"); + sb.append(" publicHttpsPort: ").append(toIndentedString(publicHttpsPort)).append("\n"); + sb.append(" httpServerPortNumber: ").append(toIndentedString(httpServerPortNumber)).append("\n"); + sb.append(" httpsPortNumber: ").append(toIndentedString(httpsPortNumber)).append("\n"); + sb.append(" enableHttps: ").append(toIndentedString(enableHttps)).append("\n"); + sb.append(" publicPort: ").append(toIndentedString(publicPort)).append("\n"); + sb.append(" upnPCreateHttpPortMap: ").append(toIndentedString(upnPCreateHttpPortMap)).append("\n"); + sb.append(" udPPortRange: ").append(toIndentedString(udPPortRange)).append("\n"); + sb.append(" enableIPV6: ").append(toIndentedString(enableIPV6)).append("\n"); + sb.append(" enableIPV4: ").append(toIndentedString(enableIPV4)).append("\n"); + sb.append(" enableSSDPTracing: ").append(toIndentedString(enableSSDPTracing)).append("\n"); + sb.append(" ssDPTracingFilter: ").append(toIndentedString(ssDPTracingFilter)).append("\n"); + sb.append(" udPSendCount: ").append(toIndentedString(udPSendCount)).append("\n"); + sb.append(" udPSendDelay: ").append(toIndentedString(udPSendDelay)).append("\n"); + sb.append(" ignoreVirtualInterfaces: ").append(toIndentedString(ignoreVirtualInterfaces)).append("\n"); + sb.append(" virtualInterfaceNames: ").append(toIndentedString(virtualInterfaceNames)).append("\n"); + sb.append(" gatewayMonitorPeriod: ").append(toIndentedString(gatewayMonitorPeriod)).append("\n"); + sb.append(" enableMultiSocketBinding: ").append(toIndentedString(enableMultiSocketBinding)).append("\n"); + sb.append(" trustAllIP6Interfaces: ").append(toIndentedString(trustAllIP6Interfaces)).append("\n"); + sb.append(" hdHomerunPortRange: ").append(toIndentedString(hdHomerunPortRange)).append("\n"); + sb.append(" publishedServerUriBySubnet: ").append(toIndentedString(publishedServerUriBySubnet)).append("\n"); + sb.append(" autoDiscoveryTracing: ").append(toIndentedString(autoDiscoveryTracing)).append("\n"); + sb.append(" autoDiscovery: ").append(toIndentedString(autoDiscovery)).append("\n"); + sb.append(" remoteIPFilter: ").append(toIndentedString(remoteIPFilter)).append("\n"); + sb.append(" isRemoteIPFilterBlacklist: ").append(toIndentedString(isRemoteIPFilterBlacklist)).append("\n"); + sb.append(" enableUPnP: ").append(toIndentedString(enableUPnP)).append("\n"); + sb.append(" enableRemoteAccess: ").append(toIndentedString(enableRemoteAccess)).append("\n"); + sb.append(" localNetworkSubnets: ").append(toIndentedString(localNetworkSubnets)).append("\n"); + sb.append(" localNetworkAddresses: ").append(toIndentedString(localNetworkAddresses)).append("\n"); + sb.append(" knownProxies: ").append(toIndentedString(knownProxies)).append("\n"); + sb.append(" enablePublishedServerUriByRequest: ").append(toIndentedString(enablePublishedServerUriByRequest)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `RequireHttps` to the URL query string + if (getRequireHttps() != null) { + joiner.add(String.format("%sRequireHttps%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRequireHttps())))); + } + + // add `CertificatePath` to the URL query string + if (getCertificatePath() != null) { + joiner.add(String.format("%sCertificatePath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCertificatePath())))); + } + + // add `CertificatePassword` to the URL query string + if (getCertificatePassword() != null) { + joiner.add(String.format("%sCertificatePassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCertificatePassword())))); + } + + // add `BaseUrl` to the URL query string + if (getBaseUrl() != null) { + joiner.add(String.format("%sBaseUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBaseUrl())))); + } + + // add `PublicHttpsPort` to the URL query string + if (getPublicHttpsPort() != null) { + joiner.add(String.format("%sPublicHttpsPort%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPublicHttpsPort())))); + } + + // add `HttpServerPortNumber` to the URL query string + if (getHttpServerPortNumber() != null) { + joiner.add(String.format("%sHttpServerPortNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHttpServerPortNumber())))); + } + + // add `HttpsPortNumber` to the URL query string + if (getHttpsPortNumber() != null) { + joiner.add(String.format("%sHttpsPortNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHttpsPortNumber())))); + } + + // add `EnableHttps` to the URL query string + if (getEnableHttps() != null) { + joiner.add(String.format("%sEnableHttps%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableHttps())))); + } + + // add `PublicPort` to the URL query string + if (getPublicPort() != null) { + joiner.add(String.format("%sPublicPort%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPublicPort())))); + } + + // add `UPnPCreateHttpPortMap` to the URL query string + if (getUpnPCreateHttpPortMap() != null) { + joiner.add(String.format("%sUPnPCreateHttpPortMap%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUpnPCreateHttpPortMap())))); + } + + // add `UDPPortRange` to the URL query string + if (getUdPPortRange() != null) { + joiner.add(String.format("%sUDPPortRange%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUdPPortRange())))); + } + + // add `EnableIPV6` to the URL query string + if (getEnableIPV6() != null) { + joiner.add(String.format("%sEnableIPV6%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableIPV6())))); + } + + // add `EnableIPV4` to the URL query string + if (getEnableIPV4() != null) { + joiner.add(String.format("%sEnableIPV4%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableIPV4())))); + } + + // add `EnableSSDPTracing` to the URL query string + if (getEnableSSDPTracing() != null) { + joiner.add(String.format("%sEnableSSDPTracing%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableSSDPTracing())))); + } + + // add `SSDPTracingFilter` to the URL query string + if (getSsDPTracingFilter() != null) { + joiner.add(String.format("%sSSDPTracingFilter%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSsDPTracingFilter())))); + } + + // add `UDPSendCount` to the URL query string + if (getUdPSendCount() != null) { + joiner.add(String.format("%sUDPSendCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUdPSendCount())))); + } + + // add `UDPSendDelay` to the URL query string + if (getUdPSendDelay() != null) { + joiner.add(String.format("%sUDPSendDelay%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUdPSendDelay())))); + } + + // add `IgnoreVirtualInterfaces` to the URL query string + if (getIgnoreVirtualInterfaces() != null) { + joiner.add(String.format("%sIgnoreVirtualInterfaces%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIgnoreVirtualInterfaces())))); + } + + // add `VirtualInterfaceNames` to the URL query string + if (getVirtualInterfaceNames() != null) { + joiner.add(String.format("%sVirtualInterfaceNames%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVirtualInterfaceNames())))); + } + + // add `GatewayMonitorPeriod` to the URL query string + if (getGatewayMonitorPeriod() != null) { + joiner.add(String.format("%sGatewayMonitorPeriod%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGatewayMonitorPeriod())))); + } + + // add `EnableMultiSocketBinding` to the URL query string + if (getEnableMultiSocketBinding() != null) { + joiner.add(String.format("%sEnableMultiSocketBinding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableMultiSocketBinding())))); + } + + // add `TrustAllIP6Interfaces` to the URL query string + if (getTrustAllIP6Interfaces() != null) { + joiner.add(String.format("%sTrustAllIP6Interfaces%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTrustAllIP6Interfaces())))); + } + + // add `HDHomerunPortRange` to the URL query string + if (getHdHomerunPortRange() != null) { + joiner.add(String.format("%sHDHomerunPortRange%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHdHomerunPortRange())))); + } + + // add `PublishedServerUriBySubnet` to the URL query string + if (getPublishedServerUriBySubnet() != null) { + for (int i = 0; i < getPublishedServerUriBySubnet().size(); i++) { + joiner.add(String.format("%sPublishedServerUriBySubnet%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getPublishedServerUriBySubnet().get(i))))); + } + } + + // add `AutoDiscoveryTracing` to the URL query string + if (getAutoDiscoveryTracing() != null) { + joiner.add(String.format("%sAutoDiscoveryTracing%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAutoDiscoveryTracing())))); + } + + // add `AutoDiscovery` to the URL query string + if (getAutoDiscovery() != null) { + joiner.add(String.format("%sAutoDiscovery%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAutoDiscovery())))); + } + + // add `RemoteIPFilter` to the URL query string + if (getRemoteIPFilter() != null) { + for (int i = 0; i < getRemoteIPFilter().size(); i++) { + joiner.add(String.format("%sRemoteIPFilter%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getRemoteIPFilter().get(i))))); + } + } + + // add `IsRemoteIPFilterBlacklist` to the URL query string + if (getIsRemoteIPFilterBlacklist() != null) { + joiner.add(String.format("%sIsRemoteIPFilterBlacklist%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsRemoteIPFilterBlacklist())))); + } + + // add `EnableUPnP` to the URL query string + if (getEnableUPnP() != null) { + joiner.add(String.format("%sEnableUPnP%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableUPnP())))); + } + + // add `EnableRemoteAccess` to the URL query string + if (getEnableRemoteAccess() != null) { + joiner.add(String.format("%sEnableRemoteAccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableRemoteAccess())))); + } + + // add `LocalNetworkSubnets` to the URL query string + if (getLocalNetworkSubnets() != null) { + for (int i = 0; i < getLocalNetworkSubnets().size(); i++) { + joiner.add(String.format("%sLocalNetworkSubnets%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLocalNetworkSubnets().get(i))))); + } + } + + // add `LocalNetworkAddresses` to the URL query string + if (getLocalNetworkAddresses() != null) { + for (int i = 0; i < getLocalNetworkAddresses().size(); i++) { + joiner.add(String.format("%sLocalNetworkAddresses%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLocalNetworkAddresses().get(i))))); + } + } + + // add `KnownProxies` to the URL query string + if (getKnownProxies() != null) { + for (int i = 0; i < getKnownProxies().size(); i++) { + joiner.add(String.format("%sKnownProxies%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getKnownProxies().get(i))))); + } + } + + // add `EnablePublishedServerUriByRequest` to the URL query string + if (getEnablePublishedServerUriByRequest() != null) { + joiner.add(String.format("%sEnablePublishedServerUriByRequest%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnablePublishedServerUriByRequest())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NetworkConfiguration instance; + + public Builder() { + this(new NetworkConfiguration()); + } + + protected Builder(NetworkConfiguration instance) { + this.instance = instance; + } + + public NetworkConfiguration.Builder requireHttps(Boolean requireHttps) { + this.instance.requireHttps = requireHttps; + return this; + } + + public NetworkConfiguration.Builder certificatePath(String certificatePath) { + this.instance.certificatePath = certificatePath; + return this; + } + + public NetworkConfiguration.Builder certificatePassword(String certificatePassword) { + this.instance.certificatePassword = certificatePassword; + return this; + } + + public NetworkConfiguration.Builder baseUrl(String baseUrl) { + this.instance.baseUrl = baseUrl; + return this; + } + + public NetworkConfiguration.Builder publicHttpsPort(Integer publicHttpsPort) { + this.instance.publicHttpsPort = publicHttpsPort; + return this; + } + + public NetworkConfiguration.Builder httpServerPortNumber(Integer httpServerPortNumber) { + this.instance.httpServerPortNumber = httpServerPortNumber; + return this; + } + + public NetworkConfiguration.Builder httpsPortNumber(Integer httpsPortNumber) { + this.instance.httpsPortNumber = httpsPortNumber; + return this; + } + + public NetworkConfiguration.Builder enableHttps(Boolean enableHttps) { + this.instance.enableHttps = enableHttps; + return this; + } + + public NetworkConfiguration.Builder publicPort(Integer publicPort) { + this.instance.publicPort = publicPort; + return this; + } + + public NetworkConfiguration.Builder upnPCreateHttpPortMap(Boolean upnPCreateHttpPortMap) { + this.instance.upnPCreateHttpPortMap = upnPCreateHttpPortMap; + return this; + } + + public NetworkConfiguration.Builder udPPortRange(String udPPortRange) { + this.instance.udPPortRange = udPPortRange; + return this; + } + + public NetworkConfiguration.Builder enableIPV6(Boolean enableIPV6) { + this.instance.enableIPV6 = enableIPV6; + return this; + } + + public NetworkConfiguration.Builder enableIPV4(Boolean enableIPV4) { + this.instance.enableIPV4 = enableIPV4; + return this; + } + + public NetworkConfiguration.Builder enableSSDPTracing(Boolean enableSSDPTracing) { + this.instance.enableSSDPTracing = enableSSDPTracing; + return this; + } + + public NetworkConfiguration.Builder ssDPTracingFilter(String ssDPTracingFilter) { + this.instance.ssDPTracingFilter = ssDPTracingFilter; + return this; + } + + public NetworkConfiguration.Builder udPSendCount(Integer udPSendCount) { + this.instance.udPSendCount = udPSendCount; + return this; + } + + public NetworkConfiguration.Builder udPSendDelay(Integer udPSendDelay) { + this.instance.udPSendDelay = udPSendDelay; + return this; + } + + public NetworkConfiguration.Builder ignoreVirtualInterfaces(Boolean ignoreVirtualInterfaces) { + this.instance.ignoreVirtualInterfaces = ignoreVirtualInterfaces; + return this; + } + + public NetworkConfiguration.Builder virtualInterfaceNames(String virtualInterfaceNames) { + this.instance.virtualInterfaceNames = virtualInterfaceNames; + return this; + } + + public NetworkConfiguration.Builder gatewayMonitorPeriod(Integer gatewayMonitorPeriod) { + this.instance.gatewayMonitorPeriod = gatewayMonitorPeriod; + return this; + } + + public NetworkConfiguration.Builder enableMultiSocketBinding(Boolean enableMultiSocketBinding) { + this.instance.enableMultiSocketBinding = enableMultiSocketBinding; + return this; + } + + public NetworkConfiguration.Builder trustAllIP6Interfaces(Boolean trustAllIP6Interfaces) { + this.instance.trustAllIP6Interfaces = trustAllIP6Interfaces; + return this; + } + + public NetworkConfiguration.Builder hdHomerunPortRange(String hdHomerunPortRange) { + this.instance.hdHomerunPortRange = hdHomerunPortRange; + return this; + } + + public NetworkConfiguration.Builder publishedServerUriBySubnet(List publishedServerUriBySubnet) { + this.instance.publishedServerUriBySubnet = publishedServerUriBySubnet; + return this; + } + + public NetworkConfiguration.Builder autoDiscoveryTracing(Boolean autoDiscoveryTracing) { + this.instance.autoDiscoveryTracing = autoDiscoveryTracing; + return this; + } + + public NetworkConfiguration.Builder autoDiscovery(Boolean autoDiscovery) { + this.instance.autoDiscovery = autoDiscovery; + return this; + } + + public NetworkConfiguration.Builder remoteIPFilter(List remoteIPFilter) { + this.instance.remoteIPFilter = remoteIPFilter; + return this; + } + + public NetworkConfiguration.Builder isRemoteIPFilterBlacklist(Boolean isRemoteIPFilterBlacklist) { + this.instance.isRemoteIPFilterBlacklist = isRemoteIPFilterBlacklist; + return this; + } + + public NetworkConfiguration.Builder enableUPnP(Boolean enableUPnP) { + this.instance.enableUPnP = enableUPnP; + return this; + } + + public NetworkConfiguration.Builder enableRemoteAccess(Boolean enableRemoteAccess) { + this.instance.enableRemoteAccess = enableRemoteAccess; + return this; + } + + public NetworkConfiguration.Builder localNetworkSubnets(List localNetworkSubnets) { + this.instance.localNetworkSubnets = localNetworkSubnets; + return this; + } + + public NetworkConfiguration.Builder localNetworkAddresses(List localNetworkAddresses) { + this.instance.localNetworkAddresses = localNetworkAddresses; + return this; + } + + public NetworkConfiguration.Builder knownProxies(List knownProxies) { + this.instance.knownProxies = knownProxies; + return this; + } + + public NetworkConfiguration.Builder enablePublishedServerUriByRequest( + Boolean enablePublishedServerUriByRequest) { + this.instance.enablePublishedServerUriByRequest = enablePublishedServerUriByRequest; + return this; + } + + /** + * returns a built NetworkConfiguration instance. + * + * The builder is not reusable. + */ + public NetworkConfiguration build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NetworkConfiguration.Builder builder() { + return new NetworkConfiguration.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NetworkConfiguration.Builder toBuilder() { + return new NetworkConfiguration.Builder().requireHttps(getRequireHttps()).certificatePath(getCertificatePath()) + .certificatePassword(getCertificatePassword()).baseUrl(getBaseUrl()) + .publicHttpsPort(getPublicHttpsPort()).httpServerPortNumber(getHttpServerPortNumber()) + .httpsPortNumber(getHttpsPortNumber()).enableHttps(getEnableHttps()).publicPort(getPublicPort()) + .upnPCreateHttpPortMap(getUpnPCreateHttpPortMap()).udPPortRange(getUdPPortRange()) + .enableIPV6(getEnableIPV6()).enableIPV4(getEnableIPV4()).enableSSDPTracing(getEnableSSDPTracing()) + .ssDPTracingFilter(getSsDPTracingFilter()).udPSendCount(getUdPSendCount()) + .udPSendDelay(getUdPSendDelay()).ignoreVirtualInterfaces(getIgnoreVirtualInterfaces()) + .virtualInterfaceNames(getVirtualInterfaceNames()).gatewayMonitorPeriod(getGatewayMonitorPeriod()) + .enableMultiSocketBinding(getEnableMultiSocketBinding()) + .trustAllIP6Interfaces(getTrustAllIP6Interfaces()).hdHomerunPortRange(getHdHomerunPortRange()) + .publishedServerUriBySubnet(getPublishedServerUriBySubnet()) + .autoDiscoveryTracing(getAutoDiscoveryTracing()).autoDiscovery(getAutoDiscovery()) + .remoteIPFilter(getRemoteIPFilter()).isRemoteIPFilterBlacklist(getIsRemoteIPFilterBlacklist()) + .enableUPnP(getEnableUPnP()).enableRemoteAccess(getEnableRemoteAccess()) + .localNetworkSubnets(getLocalNetworkSubnets()).localNetworkAddresses(getLocalNetworkAddresses()) + .knownProxies(getKnownProxies()) + .enablePublishedServerUriByRequest(getEnablePublishedServerUriByRequest()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NewGroupRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NewGroupRequestDto.java new file mode 100644 index 0000000000000..7e7405adffeb6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NewGroupRequestDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class NewGroupRequestDto. + */ +@JsonPropertyOrder({ NewGroupRequestDto.JSON_PROPERTY_GROUP_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NewGroupRequestDto { + public static final String JSON_PROPERTY_GROUP_NAME = "GroupName"; + @org.eclipse.jdt.annotation.NonNull + private String groupName; + + public NewGroupRequestDto() { + } + + public NewGroupRequestDto groupName(@org.eclipse.jdt.annotation.NonNull String groupName) { + this.groupName = groupName; + return this; + } + + /** + * Gets or sets the group name. + * + * @return groupName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGroupName() { + return groupName; + } + + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupName(@org.eclipse.jdt.annotation.NonNull String groupName) { + this.groupName = groupName; + } + + /** + * Return true if this NewGroupRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewGroupRequestDto newGroupRequestDto = (NewGroupRequestDto) o; + return Objects.equals(this.groupName, newGroupRequestDto.groupName); + } + + @Override + public int hashCode() { + return Objects.hash(groupName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewGroupRequestDto {\n"); + sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `GroupName` to the URL query string + if (getGroupName() != null) { + joiner.add(String.format("%sGroupName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGroupName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NewGroupRequestDto instance; + + public Builder() { + this(new NewGroupRequestDto()); + } + + protected Builder(NewGroupRequestDto instance) { + this.instance = instance; + } + + public NewGroupRequestDto.Builder groupName(String groupName) { + this.instance.groupName = groupName; + return this; + } + + /** + * returns a built NewGroupRequestDto instance. + * + * The builder is not reusable. + */ + public NewGroupRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NewGroupRequestDto.Builder builder() { + return new NewGroupRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NewGroupRequestDto.Builder toBuilder() { + return new NewGroupRequestDto.Builder().groupName(getGroupName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NextItemRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NextItemRequestDto.java new file mode 100644 index 0000000000000..a934a1f66b7b1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NextItemRequestDto.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class NextItemRequestDto. + */ +@JsonPropertyOrder({ NextItemRequestDto.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NextItemRequestDto { + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID playlistItemId; + + public NextItemRequestDto() { + } + + public NextItemRequestDto playlistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets or sets the playing item identifier. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + } + + /** + * Return true if this NextItemRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NextItemRequestDto nextItemRequestDto = (NextItemRequestDto) o; + return Objects.equals(this.playlistItemId, nextItemRequestDto.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NextItemRequestDto {\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NextItemRequestDto instance; + + public Builder() { + this(new NextItemRequestDto()); + } + + protected Builder(NextItemRequestDto instance) { + this.instance = instance; + } + + public NextItemRequestDto.Builder playlistItemId(UUID playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built NextItemRequestDto instance. + * + * The builder is not reusable. + */ + public NextItemRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NextItemRequestDto.Builder builder() { + return new NextItemRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NextItemRequestDto.Builder toBuilder() { + return new NextItemRequestDto.Builder().playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationDto.java new file mode 100644 index 0000000000000..fc756650d5fa7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationDto.java @@ -0,0 +1,475 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The notification DTO. + */ +@JsonPropertyOrder({ NotificationDto.JSON_PROPERTY_ID, NotificationDto.JSON_PROPERTY_USER_ID, + NotificationDto.JSON_PROPERTY_DATE, NotificationDto.JSON_PROPERTY_IS_READ, NotificationDto.JSON_PROPERTY_NAME, + NotificationDto.JSON_PROPERTY_DESCRIPTION, NotificationDto.JSON_PROPERTY_URL, + NotificationDto.JSON_PROPERTY_LEVEL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NotificationDto { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private String userId; + + public static final String JSON_PROPERTY_DATE = "Date"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime date; + + public static final String JSON_PROPERTY_IS_READ = "IsRead"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isRead; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_DESCRIPTION = "Description"; + @org.eclipse.jdt.annotation.NonNull + private String description; + + public static final String JSON_PROPERTY_URL = "Url"; + @org.eclipse.jdt.annotation.NonNull + private String url; + + public static final String JSON_PROPERTY_LEVEL = "Level"; + @org.eclipse.jdt.annotation.NonNull + private NotificationLevel level; + + public NotificationDto() { + } + + public NotificationDto id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the notification ID. Defaults to an empty string. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public NotificationDto userId(@org.eclipse.jdt.annotation.NonNull String userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the notification's user ID. Defaults to an empty string. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull String userId) { + this.userId = userId; + } + + public NotificationDto date(@org.eclipse.jdt.annotation.NonNull OffsetDateTime date) { + this.date = date; + return this; + } + + /** + * Gets or sets the notification date. + * + * @return date + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDate() { + return date; + } + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime date) { + this.date = date; + } + + public NotificationDto isRead(@org.eclipse.jdt.annotation.NonNull Boolean isRead) { + this.isRead = isRead; + return this; + } + + /** + * Gets or sets a value indicating whether the notification has been read. Defaults to false. + * + * @return isRead + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_READ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsRead() { + return isRead; + } + + @JsonProperty(JSON_PROPERTY_IS_READ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsRead(@org.eclipse.jdt.annotation.NonNull Boolean isRead) { + this.isRead = isRead; + } + + public NotificationDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the notification's name. Defaults to an empty string. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public NotificationDto description(@org.eclipse.jdt.annotation.NonNull String description) { + this.description = description; + return this; + } + + /** + * Gets or sets the notification's description. Defaults to an empty string. + * + * @return description + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@org.eclipse.jdt.annotation.NonNull String description) { + this.description = description; + } + + public NotificationDto url(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + return this; + } + + /** + * Gets or sets the notification's URL. Defaults to an empty string. + * + * @return url + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + } + + public NotificationDto level(@org.eclipse.jdt.annotation.NonNull NotificationLevel level) { + this.level = level; + return this; + } + + /** + * Gets or sets the notification level. + * + * @return level + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public NotificationLevel getLevel() { + return level; + } + + @JsonProperty(JSON_PROPERTY_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLevel(@org.eclipse.jdt.annotation.NonNull NotificationLevel level) { + this.level = level; + } + + /** + * Return true if this NotificationDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotificationDto notificationDto = (NotificationDto) o; + return Objects.equals(this.id, notificationDto.id) && Objects.equals(this.userId, notificationDto.userId) + && Objects.equals(this.date, notificationDto.date) + && Objects.equals(this.isRead, notificationDto.isRead) + && Objects.equals(this.name, notificationDto.name) + && Objects.equals(this.description, notificationDto.description) + && Objects.equals(this.url, notificationDto.url) && Objects.equals(this.level, notificationDto.level); + } + + @Override + public int hashCode() { + return Objects.hash(id, userId, date, isRead, name, description, url, level); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotificationDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" isRead: ").append(toIndentedString(isRead)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" level: ").append(toIndentedString(level)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `Date` to the URL query string + if (getDate() != null) { + joiner.add(String.format("%sDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDate())))); + } + + // add `IsRead` to the URL query string + if (getIsRead() != null) { + joiner.add(String.format("%sIsRead%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsRead())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sDescription%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `Url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format("%sUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + // add `Level` to the URL query string + if (getLevel() != null) { + joiner.add(String.format("%sLevel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLevel())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NotificationDto instance; + + public Builder() { + this(new NotificationDto()); + } + + protected Builder(NotificationDto instance) { + this.instance = instance; + } + + public NotificationDto.Builder id(String id) { + this.instance.id = id; + return this; + } + + public NotificationDto.Builder userId(String userId) { + this.instance.userId = userId; + return this; + } + + public NotificationDto.Builder date(OffsetDateTime date) { + this.instance.date = date; + return this; + } + + public NotificationDto.Builder isRead(Boolean isRead) { + this.instance.isRead = isRead; + return this; + } + + public NotificationDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public NotificationDto.Builder description(String description) { + this.instance.description = description; + return this; + } + + public NotificationDto.Builder url(String url) { + this.instance.url = url; + return this; + } + + public NotificationDto.Builder level(NotificationLevel level) { + this.instance.level = level; + return this; + } + + /** + * returns a built NotificationDto instance. + * + * The builder is not reusable. + */ + public NotificationDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NotificationDto.Builder builder() { + return new NotificationDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NotificationDto.Builder toBuilder() { + return new NotificationDto.Builder().id(getId()).userId(getUserId()).date(getDate()).isRead(getIsRead()) + .name(getName()).description(getDescription()).url(getUrl()).level(getLevel()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationLevel.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationLevel.java new file mode 100644 index 0000000000000..b2bea433921cb --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationLevel.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets NotificationLevel + */ +public enum NotificationLevel { + + NORMAL("Normal"), + + WARNING("Warning"), + + ERROR("Error"); + + private String value; + + NotificationLevel(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static NotificationLevel fromValue(String value) { + for (NotificationLevel b : NotificationLevel.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationOption.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationOption.java new file mode 100644 index 0000000000000..e962871024266 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationOption.java @@ -0,0 +1,432 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * NotificationOption + */ +@JsonPropertyOrder({ NotificationOption.JSON_PROPERTY_TYPE, NotificationOption.JSON_PROPERTY_DISABLED_MONITOR_USERS, + NotificationOption.JSON_PROPERTY_SEND_TO_USERS, NotificationOption.JSON_PROPERTY_ENABLED, + NotificationOption.JSON_PROPERTY_DISABLED_SERVICES, NotificationOption.JSON_PROPERTY_SEND_TO_USER_MODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NotificationOption { + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_DISABLED_MONITOR_USERS = "DisabledMonitorUsers"; + @org.eclipse.jdt.annotation.NonNull + private List disabledMonitorUsers = new ArrayList<>(); + + public static final String JSON_PROPERTY_SEND_TO_USERS = "SendToUsers"; + @org.eclipse.jdt.annotation.NonNull + private List sendToUsers = new ArrayList<>(); + + public static final String JSON_PROPERTY_ENABLED = "Enabled"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enabled; + + public static final String JSON_PROPERTY_DISABLED_SERVICES = "DisabledServices"; + @org.eclipse.jdt.annotation.NonNull + private List disabledServices = new ArrayList<>(); + + public static final String JSON_PROPERTY_SEND_TO_USER_MODE = "SendToUserMode"; + @org.eclipse.jdt.annotation.NonNull + private SendToUserType sendToUserMode; + + public NotificationOption() { + } + + public NotificationOption type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public NotificationOption disabledMonitorUsers( + @org.eclipse.jdt.annotation.NonNull List disabledMonitorUsers) { + this.disabledMonitorUsers = disabledMonitorUsers; + return this; + } + + public NotificationOption addDisabledMonitorUsersItem(String disabledMonitorUsersItem) { + if (this.disabledMonitorUsers == null) { + this.disabledMonitorUsers = new ArrayList<>(); + } + this.disabledMonitorUsers.add(disabledMonitorUsersItem); + return this; + } + + /** + * Gets or sets user Ids to not monitor (it's opt out). + * + * @return disabledMonitorUsers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISABLED_MONITOR_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisabledMonitorUsers() { + return disabledMonitorUsers; + } + + @JsonProperty(JSON_PROPERTY_DISABLED_MONITOR_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisabledMonitorUsers(@org.eclipse.jdt.annotation.NonNull List disabledMonitorUsers) { + this.disabledMonitorUsers = disabledMonitorUsers; + } + + public NotificationOption sendToUsers(@org.eclipse.jdt.annotation.NonNull List sendToUsers) { + this.sendToUsers = sendToUsers; + return this; + } + + public NotificationOption addSendToUsersItem(String sendToUsersItem) { + if (this.sendToUsers == null) { + this.sendToUsers = new ArrayList<>(); + } + this.sendToUsers.add(sendToUsersItem); + return this; + } + + /** + * Gets or sets user Ids to send to (if SendToUserMode == Custom). + * + * @return sendToUsers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEND_TO_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSendToUsers() { + return sendToUsers; + } + + @JsonProperty(JSON_PROPERTY_SEND_TO_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSendToUsers(@org.eclipse.jdt.annotation.NonNull List sendToUsers) { + this.sendToUsers = sendToUsers; + } + + public NotificationOption enabled(@org.eclipse.jdt.annotation.NonNull Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Gets or sets a value indicating whether this MediaBrowser.Model.Notifications.NotificationOption is enabled. + * + * @return enabled + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabled(@org.eclipse.jdt.annotation.NonNull Boolean enabled) { + this.enabled = enabled; + } + + public NotificationOption disabledServices(@org.eclipse.jdt.annotation.NonNull List disabledServices) { + this.disabledServices = disabledServices; + return this; + } + + public NotificationOption addDisabledServicesItem(String disabledServicesItem) { + if (this.disabledServices == null) { + this.disabledServices = new ArrayList<>(); + } + this.disabledServices.add(disabledServicesItem); + return this; + } + + /** + * Gets or sets the disabled services. + * + * @return disabledServices + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISABLED_SERVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisabledServices() { + return disabledServices; + } + + @JsonProperty(JSON_PROPERTY_DISABLED_SERVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisabledServices(@org.eclipse.jdt.annotation.NonNull List disabledServices) { + this.disabledServices = disabledServices; + } + + public NotificationOption sendToUserMode(@org.eclipse.jdt.annotation.NonNull SendToUserType sendToUserMode) { + this.sendToUserMode = sendToUserMode; + return this; + } + + /** + * Gets or sets the send to user mode. + * + * @return sendToUserMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEND_TO_USER_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SendToUserType getSendToUserMode() { + return sendToUserMode; + } + + @JsonProperty(JSON_PROPERTY_SEND_TO_USER_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSendToUserMode(@org.eclipse.jdt.annotation.NonNull SendToUserType sendToUserMode) { + this.sendToUserMode = sendToUserMode; + } + + /** + * Return true if this NotificationOption object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotificationOption notificationOption = (NotificationOption) o; + return Objects.equals(this.type, notificationOption.type) + && Objects.equals(this.disabledMonitorUsers, notificationOption.disabledMonitorUsers) + && Objects.equals(this.sendToUsers, notificationOption.sendToUsers) + && Objects.equals(this.enabled, notificationOption.enabled) + && Objects.equals(this.disabledServices, notificationOption.disabledServices) + && Objects.equals(this.sendToUserMode, notificationOption.sendToUserMode); + } + + @Override + public int hashCode() { + return Objects.hash(type, disabledMonitorUsers, sendToUsers, enabled, disabledServices, sendToUserMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotificationOption {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" disabledMonitorUsers: ").append(toIndentedString(disabledMonitorUsers)).append("\n"); + sb.append(" sendToUsers: ").append(toIndentedString(sendToUsers)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" disabledServices: ").append(toIndentedString(disabledServices)).append("\n"); + sb.append(" sendToUserMode: ").append(toIndentedString(sendToUserMode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `DisabledMonitorUsers` to the URL query string + if (getDisabledMonitorUsers() != null) { + for (int i = 0; i < getDisabledMonitorUsers().size(); i++) { + joiner.add(String.format("%sDisabledMonitorUsers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDisabledMonitorUsers().get(i))))); + } + } + + // add `SendToUsers` to the URL query string + if (getSendToUsers() != null) { + for (int i = 0; i < getSendToUsers().size(); i++) { + joiner.add(String.format("%sSendToUsers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSendToUsers().get(i))))); + } + } + + // add `Enabled` to the URL query string + if (getEnabled() != null) { + joiner.add(String.format("%sEnabled%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnabled())))); + } + + // add `DisabledServices` to the URL query string + if (getDisabledServices() != null) { + for (int i = 0; i < getDisabledServices().size(); i++) { + joiner.add(String.format("%sDisabledServices%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDisabledServices().get(i))))); + } + } + + // add `SendToUserMode` to the URL query string + if (getSendToUserMode() != null) { + joiner.add(String.format("%sSendToUserMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSendToUserMode())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NotificationOption instance; + + public Builder() { + this(new NotificationOption()); + } + + protected Builder(NotificationOption instance) { + this.instance = instance; + } + + public NotificationOption.Builder type(String type) { + this.instance.type = type; + return this; + } + + public NotificationOption.Builder disabledMonitorUsers(List disabledMonitorUsers) { + this.instance.disabledMonitorUsers = disabledMonitorUsers; + return this; + } + + public NotificationOption.Builder sendToUsers(List sendToUsers) { + this.instance.sendToUsers = sendToUsers; + return this; + } + + public NotificationOption.Builder enabled(Boolean enabled) { + this.instance.enabled = enabled; + return this; + } + + public NotificationOption.Builder disabledServices(List disabledServices) { + this.instance.disabledServices = disabledServices; + return this; + } + + public NotificationOption.Builder sendToUserMode(SendToUserType sendToUserMode) { + this.instance.sendToUserMode = sendToUserMode; + return this; + } + + /** + * returns a built NotificationOption instance. + * + * The builder is not reusable. + */ + public NotificationOption build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NotificationOption.Builder builder() { + return new NotificationOption.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NotificationOption.Builder toBuilder() { + return new NotificationOption.Builder().type(getType()).disabledMonitorUsers(getDisabledMonitorUsers()) + .sendToUsers(getSendToUsers()).enabled(getEnabled()).disabledServices(getDisabledServices()) + .sendToUserMode(getSendToUserMode()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationOptions.java new file mode 100644 index 0000000000000..71ad08cea0389 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationOptions.java @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * NotificationOptions + */ +@JsonPropertyOrder({ NotificationOptions.JSON_PROPERTY_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NotificationOptions { + public static final String JSON_PROPERTY_OPTIONS = "Options"; + @org.eclipse.jdt.annotation.NonNull + private List options; + + public NotificationOptions() { + } + + public NotificationOptions options(@org.eclipse.jdt.annotation.NonNull List options) { + this.options = options; + return this; + } + + public NotificationOptions addOptionsItem(NotificationOption optionsItem) { + if (this.options == null) { + this.options = new ArrayList<>(); + } + this.options.add(optionsItem); + return this; + } + + /** + * Get options + * + * @return options + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getOptions() { + return options; + } + + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOptions(@org.eclipse.jdt.annotation.NonNull List options) { + this.options = options; + } + + /** + * Return true if this NotificationOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotificationOptions notificationOptions = (NotificationOptions) o; + return Objects.equals(this.options, notificationOptions.options); + } + + @Override + public int hashCode() { + return Objects.hash(options); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotificationOptions {\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Options` to the URL query string + if (getOptions() != null) { + for (int i = 0; i < getOptions().size(); i++) { + if (getOptions().get(i) != null) { + joiner.add(getOptions().get(i).toUrlQueryString(String.format("%sOptions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private NotificationOptions instance; + + public Builder() { + this(new NotificationOptions()); + } + + protected Builder(NotificationOptions instance) { + this.instance = instance; + } + + public NotificationOptions.Builder options(List options) { + this.instance.options = options; + return this; + } + + /** + * returns a built NotificationOptions instance. + * + * The builder is not reusable. + */ + public NotificationOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NotificationOptions.Builder builder() { + return new NotificationOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NotificationOptions.Builder toBuilder() { + return new NotificationOptions.Builder().options(getOptions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationResultDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationResultDto.java new file mode 100644 index 0000000000000..4f35372ff1d25 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationResultDto.java @@ -0,0 +1,250 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * A list of notifications with the total record count for pagination. + */ +@JsonPropertyOrder({ NotificationResultDto.JSON_PROPERTY_NOTIFICATIONS, + NotificationResultDto.JSON_PROPERTY_TOTAL_RECORD_COUNT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NotificationResultDto { + public static final String JSON_PROPERTY_NOTIFICATIONS = "Notifications"; + @org.eclipse.jdt.annotation.NonNull + private List notifications = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public NotificationResultDto() { + } + + public NotificationResultDto notifications( + @org.eclipse.jdt.annotation.NonNull List notifications) { + this.notifications = notifications; + return this; + } + + public NotificationResultDto addNotificationsItem(NotificationDto notificationsItem) { + if (this.notifications == null) { + this.notifications = new ArrayList<>(); + } + this.notifications.add(notificationsItem); + return this; + } + + /** + * Gets or sets the current page of notifications. + * + * @return notifications + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NOTIFICATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNotifications() { + return notifications; + } + + @JsonProperty(JSON_PROPERTY_NOTIFICATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNotifications(@org.eclipse.jdt.annotation.NonNull List notifications) { + this.notifications = notifications; + } + + public NotificationResultDto totalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total number of notifications. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + /** + * Return true if this NotificationResultDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotificationResultDto notificationResultDto = (NotificationResultDto) o; + return Objects.equals(this.notifications, notificationResultDto.notifications) + && Objects.equals(this.totalRecordCount, notificationResultDto.totalRecordCount); + } + + @Override + public int hashCode() { + return Objects.hash(notifications, totalRecordCount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotificationResultDto {\n"); + sb.append(" notifications: ").append(toIndentedString(notifications)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Notifications` to the URL query string + if (getNotifications() != null) { + for (int i = 0; i < getNotifications().size(); i++) { + if (getNotifications().get(i) != null) { + joiner.add(getNotifications().get(i).toUrlQueryString(String.format("%sNotifications%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NotificationResultDto instance; + + public Builder() { + this(new NotificationResultDto()); + } + + protected Builder(NotificationResultDto instance) { + this.instance = instance; + } + + public NotificationResultDto.Builder notifications(List notifications) { + this.instance.notifications = notifications; + return this; + } + + public NotificationResultDto.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + /** + * returns a built NotificationResultDto instance. + * + * The builder is not reusable. + */ + public NotificationResultDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NotificationResultDto.Builder builder() { + return new NotificationResultDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NotificationResultDto.Builder toBuilder() { + return new NotificationResultDto.Builder().notifications(getNotifications()) + .totalRecordCount(getTotalRecordCount()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationTypeInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationTypeInfo.java new file mode 100644 index 0000000000000..4f8f4a679b6a2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationTypeInfo.java @@ -0,0 +1,355 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * NotificationTypeInfo + */ +@JsonPropertyOrder({ NotificationTypeInfo.JSON_PROPERTY_TYPE, NotificationTypeInfo.JSON_PROPERTY_NAME, + NotificationTypeInfo.JSON_PROPERTY_ENABLED, NotificationTypeInfo.JSON_PROPERTY_CATEGORY, + NotificationTypeInfo.JSON_PROPERTY_IS_BASED_ON_USER_EVENT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NotificationTypeInfo { + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ENABLED = "Enabled"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enabled; + + public static final String JSON_PROPERTY_CATEGORY = "Category"; + @org.eclipse.jdt.annotation.NonNull + private String category; + + public static final String JSON_PROPERTY_IS_BASED_ON_USER_EVENT = "IsBasedOnUserEvent"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isBasedOnUserEvent; + + public NotificationTypeInfo() { + } + + public NotificationTypeInfo type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public NotificationTypeInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public NotificationTypeInfo enabled(@org.eclipse.jdt.annotation.NonNull Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabled(@org.eclipse.jdt.annotation.NonNull Boolean enabled) { + this.enabled = enabled; + } + + public NotificationTypeInfo category(@org.eclipse.jdt.annotation.NonNull String category) { + this.category = category; + return this; + } + + /** + * Get category + * + * @return category + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCategory() { + return category; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(@org.eclipse.jdt.annotation.NonNull String category) { + this.category = category; + } + + public NotificationTypeInfo isBasedOnUserEvent(@org.eclipse.jdt.annotation.NonNull Boolean isBasedOnUserEvent) { + this.isBasedOnUserEvent = isBasedOnUserEvent; + return this; + } + + /** + * Get isBasedOnUserEvent + * + * @return isBasedOnUserEvent + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_BASED_ON_USER_EVENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsBasedOnUserEvent() { + return isBasedOnUserEvent; + } + + @JsonProperty(JSON_PROPERTY_IS_BASED_ON_USER_EVENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsBasedOnUserEvent(@org.eclipse.jdt.annotation.NonNull Boolean isBasedOnUserEvent) { + this.isBasedOnUserEvent = isBasedOnUserEvent; + } + + /** + * Return true if this NotificationTypeInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotificationTypeInfo notificationTypeInfo = (NotificationTypeInfo) o; + return Objects.equals(this.type, notificationTypeInfo.type) + && Objects.equals(this.name, notificationTypeInfo.name) + && Objects.equals(this.enabled, notificationTypeInfo.enabled) + && Objects.equals(this.category, notificationTypeInfo.category) + && Objects.equals(this.isBasedOnUserEvent, notificationTypeInfo.isBasedOnUserEvent); + } + + @Override + public int hashCode() { + return Objects.hash(type, name, enabled, category, isBasedOnUserEvent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotificationTypeInfo {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" isBasedOnUserEvent: ").append(toIndentedString(isBasedOnUserEvent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Enabled` to the URL query string + if (getEnabled() != null) { + joiner.add(String.format("%sEnabled%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnabled())))); + } + + // add `Category` to the URL query string + if (getCategory() != null) { + joiner.add(String.format("%sCategory%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCategory())))); + } + + // add `IsBasedOnUserEvent` to the URL query string + if (getIsBasedOnUserEvent() != null) { + joiner.add(String.format("%sIsBasedOnUserEvent%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsBasedOnUserEvent())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NotificationTypeInfo instance; + + public Builder() { + this(new NotificationTypeInfo()); + } + + protected Builder(NotificationTypeInfo instance) { + this.instance = instance; + } + + public NotificationTypeInfo.Builder type(String type) { + this.instance.type = type; + return this; + } + + public NotificationTypeInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public NotificationTypeInfo.Builder enabled(Boolean enabled) { + this.instance.enabled = enabled; + return this; + } + + public NotificationTypeInfo.Builder category(String category) { + this.instance.category = category; + return this; + } + + public NotificationTypeInfo.Builder isBasedOnUserEvent(Boolean isBasedOnUserEvent) { + this.instance.isBasedOnUserEvent = isBasedOnUserEvent; + return this; + } + + /** + * returns a built NotificationTypeInfo instance. + * + * The builder is not reusable. + */ + public NotificationTypeInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NotificationTypeInfo.Builder builder() { + return new NotificationTypeInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NotificationTypeInfo.Builder toBuilder() { + return new NotificationTypeInfo.Builder().type(getType()).name(getName()).enabled(getEnabled()) + .category(getCategory()).isBasedOnUserEvent(getIsBasedOnUserEvent()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationsSummaryDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationsSummaryDto.java new file mode 100644 index 0000000000000..9d6a7441c0c5c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/NotificationsSummaryDto.java @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The notification summary DTO. + */ +@JsonPropertyOrder({ NotificationsSummaryDto.JSON_PROPERTY_UNREAD_COUNT, + NotificationsSummaryDto.JSON_PROPERTY_MAX_UNREAD_NOTIFICATION_LEVEL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class NotificationsSummaryDto { + public static final String JSON_PROPERTY_UNREAD_COUNT = "UnreadCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer unreadCount; + + public static final String JSON_PROPERTY_MAX_UNREAD_NOTIFICATION_LEVEL = "MaxUnreadNotificationLevel"; + @org.eclipse.jdt.annotation.NonNull + private NotificationLevel maxUnreadNotificationLevel; + + public NotificationsSummaryDto() { + } + + public NotificationsSummaryDto unreadCount(@org.eclipse.jdt.annotation.NonNull Integer unreadCount) { + this.unreadCount = unreadCount; + return this; + } + + /** + * Gets or sets the number of unread notifications. + * + * @return unreadCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_UNREAD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUnreadCount() { + return unreadCount; + } + + @JsonProperty(JSON_PROPERTY_UNREAD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnreadCount(@org.eclipse.jdt.annotation.NonNull Integer unreadCount) { + this.unreadCount = unreadCount; + } + + public NotificationsSummaryDto maxUnreadNotificationLevel( + @org.eclipse.jdt.annotation.NonNull NotificationLevel maxUnreadNotificationLevel) { + this.maxUnreadNotificationLevel = maxUnreadNotificationLevel; + return this; + } + + /** + * Gets or sets the maximum unread notification level. + * + * @return maxUnreadNotificationLevel + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_UNREAD_NOTIFICATION_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public NotificationLevel getMaxUnreadNotificationLevel() { + return maxUnreadNotificationLevel; + } + + @JsonProperty(JSON_PROPERTY_MAX_UNREAD_NOTIFICATION_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxUnreadNotificationLevel( + @org.eclipse.jdt.annotation.NonNull NotificationLevel maxUnreadNotificationLevel) { + this.maxUnreadNotificationLevel = maxUnreadNotificationLevel; + } + + /** + * Return true if this NotificationsSummaryDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotificationsSummaryDto notificationsSummaryDto = (NotificationsSummaryDto) o; + return Objects.equals(this.unreadCount, notificationsSummaryDto.unreadCount) + && Objects.equals(this.maxUnreadNotificationLevel, notificationsSummaryDto.maxUnreadNotificationLevel); + } + + @Override + public int hashCode() { + return Objects.hash(unreadCount, maxUnreadNotificationLevel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotificationsSummaryDto {\n"); + sb.append(" unreadCount: ").append(toIndentedString(unreadCount)).append("\n"); + sb.append(" maxUnreadNotificationLevel: ").append(toIndentedString(maxUnreadNotificationLevel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `UnreadCount` to the URL query string + if (getUnreadCount() != null) { + joiner.add(String.format("%sUnreadCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUnreadCount())))); + } + + // add `MaxUnreadNotificationLevel` to the URL query string + if (getMaxUnreadNotificationLevel() != null) { + joiner.add(String.format("%sMaxUnreadNotificationLevel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxUnreadNotificationLevel())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NotificationsSummaryDto instance; + + public Builder() { + this(new NotificationsSummaryDto()); + } + + protected Builder(NotificationsSummaryDto instance) { + this.instance = instance; + } + + public NotificationsSummaryDto.Builder unreadCount(Integer unreadCount) { + this.instance.unreadCount = unreadCount; + return this; + } + + public NotificationsSummaryDto.Builder maxUnreadNotificationLevel( + NotificationLevel maxUnreadNotificationLevel) { + this.instance.maxUnreadNotificationLevel = maxUnreadNotificationLevel; + return this; + } + + /** + * returns a built NotificationsSummaryDto instance. + * + * The builder is not reusable. + */ + public NotificationsSummaryDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NotificationsSummaryDto.Builder builder() { + return new NotificationsSummaryDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NotificationsSummaryDto.Builder toBuilder() { + return new NotificationsSummaryDto.Builder().unreadCount(getUnreadCount()) + .maxUnreadNotificationLevel(getMaxUnreadNotificationLevel()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ObjectGroupUpdate.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ObjectGroupUpdate.java new file mode 100644 index 0000000000000..349a250008f83 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ObjectGroupUpdate.java @@ -0,0 +1,274 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class GroupUpdate. + */ +@JsonPropertyOrder({ ObjectGroupUpdate.JSON_PROPERTY_GROUP_ID, ObjectGroupUpdate.JSON_PROPERTY_TYPE, + ObjectGroupUpdate.JSON_PROPERTY_DATA }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ObjectGroupUpdate { + public static final String JSON_PROPERTY_GROUP_ID = "GroupId"; + @org.eclipse.jdt.annotation.NonNull + private UUID groupId; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private GroupUpdateType type; + + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.NonNull + private Object data = null; + + public ObjectGroupUpdate() { + } + + public ObjectGroupUpdate groupId(@org.eclipse.jdt.annotation.NonNull UUID groupId) { + this.groupId = groupId; + return this; + } + + /** + * Gets the group identifier. + * + * @return groupId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getGroupId() { + return groupId; + } + + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupId(@org.eclipse.jdt.annotation.NonNull UUID groupId) { + this.groupId = groupId; + } + + public ObjectGroupUpdate type(@org.eclipse.jdt.annotation.NonNull GroupUpdateType type) { + this.type = type; + return this; + } + + /** + * Gets the update type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupUpdateType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull GroupUpdateType type) { + this.type = type; + } + + public ObjectGroupUpdate data(@org.eclipse.jdt.annotation.NonNull Object data) { + this.data = data; + return this; + } + + /** + * Gets the update data. + * + * @return data + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@org.eclipse.jdt.annotation.NonNull Object data) { + this.data = data; + } + + /** + * Return true if this ObjectGroupUpdate object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectGroupUpdate objectGroupUpdate = (ObjectGroupUpdate) o; + return Objects.equals(this.groupId, objectGroupUpdate.groupId) + && Objects.equals(this.type, objectGroupUpdate.type) + && Objects.equals(this.data, objectGroupUpdate.data); + } + + @Override + public int hashCode() { + return Objects.hash(groupId, type, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectGroupUpdate {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `GroupId` to the URL query string + if (getGroupId() != null) { + joiner.add(String.format("%sGroupId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGroupId())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(String.format("%sData%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getData())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ObjectGroupUpdate instance; + + public Builder() { + this(new ObjectGroupUpdate()); + } + + protected Builder(ObjectGroupUpdate instance) { + this.instance = instance; + } + + public ObjectGroupUpdate.Builder groupId(UUID groupId) { + this.instance.groupId = groupId; + return this; + } + + public ObjectGroupUpdate.Builder type(GroupUpdateType type) { + this.instance.type = type; + return this; + } + + public ObjectGroupUpdate.Builder data(Object data) { + this.instance.data = data; + return this; + } + + /** + * returns a built ObjectGroupUpdate instance. + * + * The builder is not reusable. + */ + public ObjectGroupUpdate build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ObjectGroupUpdate.Builder builder() { + return new ObjectGroupUpdate.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ObjectGroupUpdate.Builder toBuilder() { + return new ObjectGroupUpdate.Builder().groupId(getGroupId()).type(getType()).data(getData()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/OpenLiveStreamDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/OpenLiveStreamDto.java new file mode 100644 index 0000000000000..37ddad94b1a5b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/OpenLiveStreamDto.java @@ -0,0 +1,708 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Open live stream dto. + */ +@JsonPropertyOrder({ OpenLiveStreamDto.JSON_PROPERTY_OPEN_TOKEN, OpenLiveStreamDto.JSON_PROPERTY_USER_ID, + OpenLiveStreamDto.JSON_PROPERTY_PLAY_SESSION_ID, OpenLiveStreamDto.JSON_PROPERTY_MAX_STREAMING_BITRATE, + OpenLiveStreamDto.JSON_PROPERTY_START_TIME_TICKS, OpenLiveStreamDto.JSON_PROPERTY_AUDIO_STREAM_INDEX, + OpenLiveStreamDto.JSON_PROPERTY_SUBTITLE_STREAM_INDEX, OpenLiveStreamDto.JSON_PROPERTY_MAX_AUDIO_CHANNELS, + OpenLiveStreamDto.JSON_PROPERTY_ITEM_ID, OpenLiveStreamDto.JSON_PROPERTY_ENABLE_DIRECT_PLAY, + OpenLiveStreamDto.JSON_PROPERTY_ENABLE_DIRECT_STREAM, OpenLiveStreamDto.JSON_PROPERTY_DEVICE_PROFILE, + OpenLiveStreamDto.JSON_PROPERTY_DIRECT_PLAY_PROTOCOLS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class OpenLiveStreamDto { + public static final String JSON_PROPERTY_OPEN_TOKEN = "OpenToken"; + @org.eclipse.jdt.annotation.NonNull + private String openToken; + + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_PLAY_SESSION_ID = "PlaySessionId"; + @org.eclipse.jdt.annotation.NonNull + private String playSessionId; + + public static final String JSON_PROPERTY_MAX_STREAMING_BITRATE = "MaxStreamingBitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxStreamingBitrate; + + public static final String JSON_PROPERTY_START_TIME_TICKS = "StartTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long startTimeTicks; + + public static final String JSON_PROPERTY_AUDIO_STREAM_INDEX = "AudioStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer audioStreamIndex; + + public static final String JSON_PROPERTY_SUBTITLE_STREAM_INDEX = "SubtitleStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer subtitleStreamIndex; + + public static final String JSON_PROPERTY_MAX_AUDIO_CHANNELS = "MaxAudioChannels"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxAudioChannels; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_ENABLE_DIRECT_PLAY = "EnableDirectPlay"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableDirectPlay; + + public static final String JSON_PROPERTY_ENABLE_DIRECT_STREAM = "EnableDirectStream"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableDirectStream; + + public static final String JSON_PROPERTY_DEVICE_PROFILE = "DeviceProfile"; + @org.eclipse.jdt.annotation.NonNull + private DeviceProfile deviceProfile; + + public static final String JSON_PROPERTY_DIRECT_PLAY_PROTOCOLS = "DirectPlayProtocols"; + @org.eclipse.jdt.annotation.NonNull + private List directPlayProtocols = new ArrayList<>(); + + public OpenLiveStreamDto() { + } + + public OpenLiveStreamDto openToken(@org.eclipse.jdt.annotation.NonNull String openToken) { + this.openToken = openToken; + return this; + } + + /** + * Gets or sets the open token. + * + * @return openToken + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OPEN_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOpenToken() { + return openToken; + } + + @JsonProperty(JSON_PROPERTY_OPEN_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpenToken(@org.eclipse.jdt.annotation.NonNull String openToken) { + this.openToken = openToken; + } + + public OpenLiveStreamDto userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the user id. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public OpenLiveStreamDto playSessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + return this; + } + + /** + * Gets or sets the play session id. + * + * @return playSessionId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaySessionId() { + return playSessionId; + } + + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaySessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + } + + public OpenLiveStreamDto maxStreamingBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate) { + this.maxStreamingBitrate = maxStreamingBitrate; + return this; + } + + /** + * Gets or sets the max streaming bitrate. + * + * @return maxStreamingBitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_STREAMING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxStreamingBitrate() { + return maxStreamingBitrate; + } + + @JsonProperty(JSON_PROPERTY_MAX_STREAMING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxStreamingBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate) { + this.maxStreamingBitrate = maxStreamingBitrate; + } + + public OpenLiveStreamDto startTimeTicks(@org.eclipse.jdt.annotation.NonNull Long startTimeTicks) { + this.startTimeTicks = startTimeTicks; + return this; + } + + /** + * Gets or sets the start time in ticks. + * + * @return startTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartTimeTicks() { + return startTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_START_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartTimeTicks(@org.eclipse.jdt.annotation.NonNull Long startTimeTicks) { + this.startTimeTicks = startTimeTicks; + } + + public OpenLiveStreamDto audioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + return this; + } + + /** + * Gets or sets the audio stream index. + * + * @return audioStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAudioStreamIndex() { + return audioStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + } + + public OpenLiveStreamDto subtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + /** + * Gets or sets the subtitle stream index. + * + * @return subtitleStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSubtitleStreamIndex() { + return subtitleStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + } + + public OpenLiveStreamDto maxAudioChannels(@org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels) { + this.maxAudioChannels = maxAudioChannels; + return this; + } + + /** + * Gets or sets the max audio channels. + * + * @return maxAudioChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_AUDIO_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxAudioChannels() { + return maxAudioChannels; + } + + @JsonProperty(JSON_PROPERTY_MAX_AUDIO_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxAudioChannels(@org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels) { + this.maxAudioChannels = maxAudioChannels; + } + + public OpenLiveStreamDto itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item id. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public OpenLiveStreamDto enableDirectPlay(@org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay) { + this.enableDirectPlay = enableDirectPlay; + return this; + } + + /** + * Gets or sets a value indicating whether to enable direct play. + * + * @return enableDirectPlay + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_DIRECT_PLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableDirectPlay() { + return enableDirectPlay; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_DIRECT_PLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableDirectPlay(@org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay) { + this.enableDirectPlay = enableDirectPlay; + } + + public OpenLiveStreamDto enableDirectStream(@org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream) { + this.enableDirectStream = enableDirectStream; + return this; + } + + /** + * Gets or sets a value indicating whether to enale direct stream. + * + * @return enableDirectStream + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_DIRECT_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableDirectStream() { + return enableDirectStream; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_DIRECT_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableDirectStream(@org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream) { + this.enableDirectStream = enableDirectStream; + } + + public OpenLiveStreamDto deviceProfile(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) { + this.deviceProfile = deviceProfile; + return this; + } + + /** + * A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain + * device is able to play. <br /> Specifically, it defines the supported <see + * cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles\">containers</see> and + * <see cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles\">codecs</see> + * (video and/or audio, including codec profiles and levels) the device is able to direct play (without transcoding + * or remuxing), as well as which <see + * cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles\">containers/codecs to + * transcode to</see> in case it isn't. + * + * @return deviceProfile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceProfile getDeviceProfile() { + return deviceProfile; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceProfile(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) { + this.deviceProfile = deviceProfile; + } + + public OpenLiveStreamDto directPlayProtocols( + @org.eclipse.jdt.annotation.NonNull List directPlayProtocols) { + this.directPlayProtocols = directPlayProtocols; + return this; + } + + public OpenLiveStreamDto addDirectPlayProtocolsItem(MediaProtocol directPlayProtocolsItem) { + if (this.directPlayProtocols == null) { + this.directPlayProtocols = new ArrayList<>(); + } + this.directPlayProtocols.add(directPlayProtocolsItem); + return this; + } + + /** + * Gets or sets the device play protocols. + * + * @return directPlayProtocols + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DIRECT_PLAY_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDirectPlayProtocols() { + return directPlayProtocols; + } + + @JsonProperty(JSON_PROPERTY_DIRECT_PLAY_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDirectPlayProtocols(@org.eclipse.jdt.annotation.NonNull List directPlayProtocols) { + this.directPlayProtocols = directPlayProtocols; + } + + /** + * Return true if this OpenLiveStreamDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenLiveStreamDto openLiveStreamDto = (OpenLiveStreamDto) o; + return Objects.equals(this.openToken, openLiveStreamDto.openToken) + && Objects.equals(this.userId, openLiveStreamDto.userId) + && Objects.equals(this.playSessionId, openLiveStreamDto.playSessionId) + && Objects.equals(this.maxStreamingBitrate, openLiveStreamDto.maxStreamingBitrate) + && Objects.equals(this.startTimeTicks, openLiveStreamDto.startTimeTicks) + && Objects.equals(this.audioStreamIndex, openLiveStreamDto.audioStreamIndex) + && Objects.equals(this.subtitleStreamIndex, openLiveStreamDto.subtitleStreamIndex) + && Objects.equals(this.maxAudioChannels, openLiveStreamDto.maxAudioChannels) + && Objects.equals(this.itemId, openLiveStreamDto.itemId) + && Objects.equals(this.enableDirectPlay, openLiveStreamDto.enableDirectPlay) + && Objects.equals(this.enableDirectStream, openLiveStreamDto.enableDirectStream) + && Objects.equals(this.deviceProfile, openLiveStreamDto.deviceProfile) + && Objects.equals(this.directPlayProtocols, openLiveStreamDto.directPlayProtocols); + } + + @Override + public int hashCode() { + return Objects.hash(openToken, userId, playSessionId, maxStreamingBitrate, startTimeTicks, audioStreamIndex, + subtitleStreamIndex, maxAudioChannels, itemId, enableDirectPlay, enableDirectStream, deviceProfile, + directPlayProtocols); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenLiveStreamDto {\n"); + sb.append(" openToken: ").append(toIndentedString(openToken)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" playSessionId: ").append(toIndentedString(playSessionId)).append("\n"); + sb.append(" maxStreamingBitrate: ").append(toIndentedString(maxStreamingBitrate)).append("\n"); + sb.append(" startTimeTicks: ").append(toIndentedString(startTimeTicks)).append("\n"); + sb.append(" audioStreamIndex: ").append(toIndentedString(audioStreamIndex)).append("\n"); + sb.append(" subtitleStreamIndex: ").append(toIndentedString(subtitleStreamIndex)).append("\n"); + sb.append(" maxAudioChannels: ").append(toIndentedString(maxAudioChannels)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" enableDirectPlay: ").append(toIndentedString(enableDirectPlay)).append("\n"); + sb.append(" enableDirectStream: ").append(toIndentedString(enableDirectStream)).append("\n"); + sb.append(" deviceProfile: ").append(toIndentedString(deviceProfile)).append("\n"); + sb.append(" directPlayProtocols: ").append(toIndentedString(directPlayProtocols)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `OpenToken` to the URL query string + if (getOpenToken() != null) { + joiner.add(String.format("%sOpenToken%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOpenToken())))); + } + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `PlaySessionId` to the URL query string + if (getPlaySessionId() != null) { + joiner.add(String.format("%sPlaySessionId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaySessionId())))); + } + + // add `MaxStreamingBitrate` to the URL query string + if (getMaxStreamingBitrate() != null) { + joiner.add(String.format("%sMaxStreamingBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxStreamingBitrate())))); + } + + // add `StartTimeTicks` to the URL query string + if (getStartTimeTicks() != null) { + joiner.add(String.format("%sStartTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartTimeTicks())))); + } + + // add `AudioStreamIndex` to the URL query string + if (getAudioStreamIndex() != null) { + joiner.add(String.format("%sAudioStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioStreamIndex())))); + } + + // add `SubtitleStreamIndex` to the URL query string + if (getSubtitleStreamIndex() != null) { + joiner.add(String.format("%sSubtitleStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleStreamIndex())))); + } + + // add `MaxAudioChannels` to the URL query string + if (getMaxAudioChannels() != null) { + joiner.add(String.format("%sMaxAudioChannels%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxAudioChannels())))); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `EnableDirectPlay` to the URL query string + if (getEnableDirectPlay() != null) { + joiner.add(String.format("%sEnableDirectPlay%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableDirectPlay())))); + } + + // add `EnableDirectStream` to the URL query string + if (getEnableDirectStream() != null) { + joiner.add(String.format("%sEnableDirectStream%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableDirectStream())))); + } + + // add `DeviceProfile` to the URL query string + if (getDeviceProfile() != null) { + joiner.add(getDeviceProfile().toUrlQueryString(prefix + "DeviceProfile" + suffix)); + } + + // add `DirectPlayProtocols` to the URL query string + if (getDirectPlayProtocols() != null) { + for (int i = 0; i < getDirectPlayProtocols().size(); i++) { + if (getDirectPlayProtocols().get(i) != null) { + joiner.add(String.format("%sDirectPlayProtocols%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDirectPlayProtocols().get(i))))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private OpenLiveStreamDto instance; + + public Builder() { + this(new OpenLiveStreamDto()); + } + + protected Builder(OpenLiveStreamDto instance) { + this.instance = instance; + } + + public OpenLiveStreamDto.Builder openToken(String openToken) { + this.instance.openToken = openToken; + return this; + } + + public OpenLiveStreamDto.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public OpenLiveStreamDto.Builder playSessionId(String playSessionId) { + this.instance.playSessionId = playSessionId; + return this; + } + + public OpenLiveStreamDto.Builder maxStreamingBitrate(Integer maxStreamingBitrate) { + this.instance.maxStreamingBitrate = maxStreamingBitrate; + return this; + } + + public OpenLiveStreamDto.Builder startTimeTicks(Long startTimeTicks) { + this.instance.startTimeTicks = startTimeTicks; + return this; + } + + public OpenLiveStreamDto.Builder audioStreamIndex(Integer audioStreamIndex) { + this.instance.audioStreamIndex = audioStreamIndex; + return this; + } + + public OpenLiveStreamDto.Builder subtitleStreamIndex(Integer subtitleStreamIndex) { + this.instance.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + public OpenLiveStreamDto.Builder maxAudioChannels(Integer maxAudioChannels) { + this.instance.maxAudioChannels = maxAudioChannels; + return this; + } + + public OpenLiveStreamDto.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public OpenLiveStreamDto.Builder enableDirectPlay(Boolean enableDirectPlay) { + this.instance.enableDirectPlay = enableDirectPlay; + return this; + } + + public OpenLiveStreamDto.Builder enableDirectStream(Boolean enableDirectStream) { + this.instance.enableDirectStream = enableDirectStream; + return this; + } + + public OpenLiveStreamDto.Builder deviceProfile(DeviceProfile deviceProfile) { + this.instance.deviceProfile = deviceProfile; + return this; + } + + public OpenLiveStreamDto.Builder directPlayProtocols(List directPlayProtocols) { + this.instance.directPlayProtocols = directPlayProtocols; + return this; + } + + /** + * returns a built OpenLiveStreamDto instance. + * + * The builder is not reusable. + */ + public OpenLiveStreamDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static OpenLiveStreamDto.Builder builder() { + return new OpenLiveStreamDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public OpenLiveStreamDto.Builder toBuilder() { + return new OpenLiveStreamDto.Builder().openToken(getOpenToken()).userId(getUserId()) + .playSessionId(getPlaySessionId()).maxStreamingBitrate(getMaxStreamingBitrate()) + .startTimeTicks(getStartTimeTicks()).audioStreamIndex(getAudioStreamIndex()) + .subtitleStreamIndex(getSubtitleStreamIndex()).maxAudioChannels(getMaxAudioChannels()) + .itemId(getItemId()).enableDirectPlay(getEnableDirectPlay()).enableDirectStream(getEnableDirectStream()) + .deviceProfile(getDeviceProfile()).directPlayProtocols(getDirectPlayProtocols()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PackageInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PackageInfo.java new file mode 100644 index 0000000000000..5254561a7269a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PackageInfo.java @@ -0,0 +1,489 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PackageInfo. + */ +@JsonPropertyOrder({ PackageInfo.JSON_PROPERTY_NAME, PackageInfo.JSON_PROPERTY_DESCRIPTION, + PackageInfo.JSON_PROPERTY_OVERVIEW, PackageInfo.JSON_PROPERTY_OWNER, PackageInfo.JSON_PROPERTY_CATEGORY, + PackageInfo.JSON_PROPERTY_GUID, PackageInfo.JSON_PROPERTY_VERSIONS, PackageInfo.JSON_PROPERTY_IMAGE_URL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PackageInfo { + public static final String JSON_PROPERTY_NAME = "name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + @org.eclipse.jdt.annotation.NonNull + private String description; + + public static final String JSON_PROPERTY_OVERVIEW = "overview"; + @org.eclipse.jdt.annotation.NonNull + private String overview; + + public static final String JSON_PROPERTY_OWNER = "owner"; + @org.eclipse.jdt.annotation.NonNull + private String owner; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + @org.eclipse.jdt.annotation.NonNull + private String category; + + public static final String JSON_PROPERTY_GUID = "guid"; + @org.eclipse.jdt.annotation.NonNull + private UUID guid; + + public static final String JSON_PROPERTY_VERSIONS = "versions"; + @org.eclipse.jdt.annotation.NonNull + private List versions = new ArrayList<>(); + + public static final String JSON_PROPERTY_IMAGE_URL = "imageUrl"; + @org.eclipse.jdt.annotation.NonNull + private String imageUrl; + + public PackageInfo() { + } + + public PackageInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public PackageInfo description(@org.eclipse.jdt.annotation.NonNull String description) { + this.description = description; + return this; + } + + /** + * Gets or sets a long description of the plugin containing features or helpful explanations. + * + * @return description + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@org.eclipse.jdt.annotation.NonNull String description) { + this.description = description; + } + + public PackageInfo overview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + return this; + } + + /** + * Gets or sets a short overview of what the plugin does. + * + * @return overview + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOverview() { + return overview; + } + + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOverview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + } + + public PackageInfo owner(@org.eclipse.jdt.annotation.NonNull String owner) { + this.owner = owner; + return this; + } + + /** + * Gets or sets the owner. + * + * @return owner + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OWNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOwner() { + return owner; + } + + @JsonProperty(JSON_PROPERTY_OWNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOwner(@org.eclipse.jdt.annotation.NonNull String owner) { + this.owner = owner; + } + + public PackageInfo category(@org.eclipse.jdt.annotation.NonNull String category) { + this.category = category; + return this; + } + + /** + * Gets or sets the category. + * + * @return category + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCategory() { + return category; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(@org.eclipse.jdt.annotation.NonNull String category) { + this.category = category; + } + + public PackageInfo guid(@org.eclipse.jdt.annotation.NonNull UUID guid) { + this.guid = guid; + return this; + } + + /** + * Gets or sets the guid of the assembly associated with this plugin. This is used to identify the proper item for + * automatic updates. + * + * @return guid + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getGuid() { + return guid; + } + + @JsonProperty(JSON_PROPERTY_GUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGuid(@org.eclipse.jdt.annotation.NonNull UUID guid) { + this.guid = guid; + } + + public PackageInfo versions(@org.eclipse.jdt.annotation.NonNull List versions) { + this.versions = versions; + return this; + } + + public PackageInfo addVersionsItem(VersionInfo versionsItem) { + if (this.versions == null) { + this.versions = new ArrayList<>(); + } + this.versions.add(versionsItem); + return this; + } + + /** + * Gets or sets the versions. + * + * @return versions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getVersions() { + return versions; + } + + @JsonProperty(JSON_PROPERTY_VERSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersions(@org.eclipse.jdt.annotation.NonNull List versions) { + this.versions = versions; + } + + public PackageInfo imageUrl(@org.eclipse.jdt.annotation.NonNull String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Gets or sets the image url for the package. + * + * @return imageUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getImageUrl() { + return imageUrl; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageUrl(@org.eclipse.jdt.annotation.NonNull String imageUrl) { + this.imageUrl = imageUrl; + } + + /** + * Return true if this PackageInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PackageInfo packageInfo = (PackageInfo) o; + return Objects.equals(this.name, packageInfo.name) && Objects.equals(this.description, packageInfo.description) + && Objects.equals(this.overview, packageInfo.overview) && Objects.equals(this.owner, packageInfo.owner) + && Objects.equals(this.category, packageInfo.category) && Objects.equals(this.guid, packageInfo.guid) + && Objects.equals(this.versions, packageInfo.versions) + && Objects.equals(this.imageUrl, packageInfo.imageUrl); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, overview, owner, category, guid, versions, imageUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PackageInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" overview: ").append(toIndentedString(overview)).append("\n"); + sb.append(" owner: ").append(toIndentedString(owner)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" guid: ").append(toIndentedString(guid)).append("\n"); + sb.append(" versions: ").append(toIndentedString(versions)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sname%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sdescription%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `overview` to the URL query string + if (getOverview() != null) { + joiner.add(String.format("%soverview%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOverview())))); + } + + // add `owner` to the URL query string + if (getOwner() != null) { + joiner.add(String.format("%sowner%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOwner())))); + } + + // add `category` to the URL query string + if (getCategory() != null) { + joiner.add(String.format("%scategory%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCategory())))); + } + + // add `guid` to the URL query string + if (getGuid() != null) { + joiner.add(String.format("%sguid%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGuid())))); + } + + // add `versions` to the URL query string + if (getVersions() != null) { + for (int i = 0; i < getVersions().size(); i++) { + if (getVersions().get(i) != null) { + joiner.add(getVersions().get(i).toUrlQueryString(String.format("%sversions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `imageUrl` to the URL query string + if (getImageUrl() != null) { + joiner.add(String.format("%simageUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageUrl())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PackageInfo instance; + + public Builder() { + this(new PackageInfo()); + } + + protected Builder(PackageInfo instance) { + this.instance = instance; + } + + public PackageInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public PackageInfo.Builder description(String description) { + this.instance.description = description; + return this; + } + + public PackageInfo.Builder overview(String overview) { + this.instance.overview = overview; + return this; + } + + public PackageInfo.Builder owner(String owner) { + this.instance.owner = owner; + return this; + } + + public PackageInfo.Builder category(String category) { + this.instance.category = category; + return this; + } + + public PackageInfo.Builder guid(UUID guid) { + this.instance.guid = guid; + return this; + } + + public PackageInfo.Builder versions(List versions) { + this.instance.versions = versions; + return this; + } + + public PackageInfo.Builder imageUrl(String imageUrl) { + this.instance.imageUrl = imageUrl; + return this; + } + + /** + * returns a built PackageInfo instance. + * + * The builder is not reusable. + */ + public PackageInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PackageInfo.Builder builder() { + return new PackageInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PackageInfo.Builder toBuilder() { + return new PackageInfo.Builder().name(getName()).description(getDescription()).overview(getOverview()) + .owner(getOwner()).category(getCategory()).guid(getGuid()).versions(getVersions()) + .imageUrl(getImageUrl()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ParentalRating.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ParentalRating.java new file mode 100644 index 0000000000000..476bfa3d7d7b8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ParentalRating.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class ParentalRating. + */ +@JsonPropertyOrder({ ParentalRating.JSON_PROPERTY_NAME, ParentalRating.JSON_PROPERTY_VALUE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ParentalRating { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_VALUE = "Value"; + @org.eclipse.jdt.annotation.NonNull + private Integer value; + + public ParentalRating() { + } + + public ParentalRating name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ParentalRating value(@org.eclipse.jdt.annotation.NonNull Integer value) { + this.value = value; + return this; + } + + /** + * Gets or sets the value. + * + * @return value + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@org.eclipse.jdt.annotation.NonNull Integer value) { + this.value = value; + } + + /** + * Return true if this ParentalRating object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ParentalRating parentalRating = (ParentalRating) o; + return Objects.equals(this.name, parentalRating.name) && Objects.equals(this.value, parentalRating.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentalRating {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Value` to the URL query string + if (getValue() != null) { + joiner.add(String.format("%sValue%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getValue())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ParentalRating instance; + + public Builder() { + this(new ParentalRating()); + } + + protected Builder(ParentalRating instance) { + this.instance = instance; + } + + public ParentalRating.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ParentalRating.Builder value(Integer value) { + this.instance.value = value; + return this; + } + + /** + * returns a built ParentalRating instance. + * + * The builder is not reusable. + */ + public ParentalRating build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ParentalRating.Builder builder() { + return new ParentalRating.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ParentalRating.Builder toBuilder() { + return new ParentalRating.Builder().name(getName()).value(getValue()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PathSubstitution.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PathSubstitution.java new file mode 100644 index 0000000000000..9b24e060a4f63 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PathSubstitution.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines the MediaBrowser.Model.Configuration.PathSubstitution. + */ +@JsonPropertyOrder({ PathSubstitution.JSON_PROPERTY_FROM, PathSubstitution.JSON_PROPERTY_TO }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PathSubstitution { + public static final String JSON_PROPERTY_FROM = "From"; + @org.eclipse.jdt.annotation.NonNull + private String from; + + public static final String JSON_PROPERTY_TO = "To"; + @org.eclipse.jdt.annotation.NonNull + private String to; + + public PathSubstitution() { + } + + public PathSubstitution from(@org.eclipse.jdt.annotation.NonNull String from) { + this.from = from; + return this; + } + + /** + * Gets or sets the value to substitute. + * + * @return from + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFrom() { + return from; + } + + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFrom(@org.eclipse.jdt.annotation.NonNull String from) { + this.from = from; + } + + public PathSubstitution to(@org.eclipse.jdt.annotation.NonNull String to) { + this.to = to; + return this; + } + + /** + * Gets or sets the value to substitution with. + * + * @return to + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTo() { + return to; + } + + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTo(@org.eclipse.jdt.annotation.NonNull String to) { + this.to = to; + } + + /** + * Return true if this PathSubstitution object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PathSubstitution pathSubstitution = (PathSubstitution) o; + return Objects.equals(this.from, pathSubstitution.from) && Objects.equals(this.to, pathSubstitution.to); + } + + @Override + public int hashCode() { + return Objects.hash(from, to); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PathSubstitution {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `From` to the URL query string + if (getFrom() != null) { + joiner.add(String.format("%sFrom%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFrom())))); + } + + // add `To` to the URL query string + if (getTo() != null) { + joiner.add( + String.format("%sTo%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTo())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PathSubstitution instance; + + public Builder() { + this(new PathSubstitution()); + } + + protected Builder(PathSubstitution instance) { + this.instance = instance; + } + + public PathSubstitution.Builder from(String from) { + this.instance.from = from; + return this; + } + + public PathSubstitution.Builder to(String to) { + this.instance.to = to; + return this; + } + + /** + * returns a built PathSubstitution instance. + * + * The builder is not reusable. + */ + public PathSubstitution build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PathSubstitution.Builder builder() { + return new PathSubstitution.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PathSubstitution.Builder toBuilder() { + return new PathSubstitution.Builder().from(getFrom()).to(getTo()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PersonLookupInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PersonLookupInfo.java new file mode 100644 index 0000000000000..52bd3cc9828cf --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PersonLookupInfo.java @@ -0,0 +1,617 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * PersonLookupInfo + */ +@JsonPropertyOrder({ PersonLookupInfo.JSON_PROPERTY_NAME, PersonLookupInfo.JSON_PROPERTY_ORIGINAL_TITLE, + PersonLookupInfo.JSON_PROPERTY_PATH, PersonLookupInfo.JSON_PROPERTY_METADATA_LANGUAGE, + PersonLookupInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, PersonLookupInfo.JSON_PROPERTY_PROVIDER_IDS, + PersonLookupInfo.JSON_PROPERTY_YEAR, PersonLookupInfo.JSON_PROPERTY_INDEX_NUMBER, + PersonLookupInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, PersonLookupInfo.JSON_PROPERTY_PREMIERE_DATE, + PersonLookupInfo.JSON_PROPERTY_IS_AUTOMATED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PersonLookupInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public PersonLookupInfo() { + } + + public PersonLookupInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public PersonLookupInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public PersonLookupInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public PersonLookupInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public PersonLookupInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public PersonLookupInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public PersonLookupInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public PersonLookupInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public PersonLookupInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public PersonLookupInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public PersonLookupInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public PersonLookupInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + /** + * Return true if this PersonLookupInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonLookupInfo personLookupInfo = (PersonLookupInfo) o; + return Objects.equals(this.name, personLookupInfo.name) + && Objects.equals(this.originalTitle, personLookupInfo.originalTitle) + && Objects.equals(this.path, personLookupInfo.path) + && Objects.equals(this.metadataLanguage, personLookupInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, personLookupInfo.metadataCountryCode) + && Objects.equals(this.providerIds, personLookupInfo.providerIds) + && Objects.equals(this.year, personLookupInfo.year) + && Objects.equals(this.indexNumber, personLookupInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, personLookupInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, personLookupInfo.premiereDate) + && Objects.equals(this.isAutomated, personLookupInfo.isAutomated); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonLookupInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PersonLookupInfo instance; + + public Builder() { + this(new PersonLookupInfo()); + } + + protected Builder(PersonLookupInfo instance) { + this.instance = instance; + } + + public PersonLookupInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public PersonLookupInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public PersonLookupInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public PersonLookupInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public PersonLookupInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public PersonLookupInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public PersonLookupInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public PersonLookupInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public PersonLookupInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public PersonLookupInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public PersonLookupInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + /** + * returns a built PersonLookupInfo instance. + * + * The builder is not reusable. + */ + public PersonLookupInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PersonLookupInfo.Builder builder() { + return new PersonLookupInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PersonLookupInfo.Builder toBuilder() { + return new PersonLookupInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()) + .isAutomated(getIsAutomated()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PersonLookupInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PersonLookupInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..f273b2d217a41 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PersonLookupInfoRemoteSearchQuery.java @@ -0,0 +1,320 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * PersonLookupInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ PersonLookupInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + PersonLookupInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, + PersonLookupInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + PersonLookupInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PersonLookupInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private PersonLookupInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public PersonLookupInfoRemoteSearchQuery() { + } + + public PersonLookupInfoRemoteSearchQuery searchInfo( + @org.eclipse.jdt.annotation.NonNull PersonLookupInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PersonLookupInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull PersonLookupInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public PersonLookupInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public PersonLookupInfoRemoteSearchQuery searchProviderName( + @org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public PersonLookupInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this PersonLookupInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonLookupInfoRemoteSearchQuery personLookupInfoRemoteSearchQuery = (PersonLookupInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, personLookupInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, personLookupInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, personLookupInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, + personLookupInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonLookupInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PersonLookupInfoRemoteSearchQuery instance; + + public Builder() { + this(new PersonLookupInfoRemoteSearchQuery()); + } + + protected Builder(PersonLookupInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public PersonLookupInfoRemoteSearchQuery.Builder searchInfo(PersonLookupInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public PersonLookupInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public PersonLookupInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public PersonLookupInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built PersonLookupInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public PersonLookupInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PersonLookupInfoRemoteSearchQuery.Builder builder() { + return new PersonLookupInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PersonLookupInfoRemoteSearchQuery.Builder toBuilder() { + return new PersonLookupInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PinRedeemResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PinRedeemResult.java new file mode 100644 index 0000000000000..7965c6c04e6c2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PinRedeemResult.java @@ -0,0 +1,245 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * PinRedeemResult + */ +@JsonPropertyOrder({ PinRedeemResult.JSON_PROPERTY_SUCCESS, PinRedeemResult.JSON_PROPERTY_USERS_RESET }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PinRedeemResult { + public static final String JSON_PROPERTY_SUCCESS = "Success"; + @org.eclipse.jdt.annotation.NonNull + private Boolean success; + + public static final String JSON_PROPERTY_USERS_RESET = "UsersReset"; + @org.eclipse.jdt.annotation.NonNull + private List usersReset = new ArrayList<>(); + + public PinRedeemResult() { + } + + public PinRedeemResult success(@org.eclipse.jdt.annotation.NonNull Boolean success) { + this.success = success; + return this; + } + + /** + * Gets or sets a value indicating whether this MediaBrowser.Model.Users.PinRedeemResult is success. + * + * @return success + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUCCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSuccess() { + return success; + } + + @JsonProperty(JSON_PROPERTY_SUCCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSuccess(@org.eclipse.jdt.annotation.NonNull Boolean success) { + this.success = success; + } + + public PinRedeemResult usersReset(@org.eclipse.jdt.annotation.NonNull List usersReset) { + this.usersReset = usersReset; + return this; + } + + public PinRedeemResult addUsersResetItem(String usersResetItem) { + if (this.usersReset == null) { + this.usersReset = new ArrayList<>(); + } + this.usersReset.add(usersResetItem); + return this; + } + + /** + * Gets or sets the users reset. + * + * @return usersReset + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USERS_RESET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getUsersReset() { + return usersReset; + } + + @JsonProperty(JSON_PROPERTY_USERS_RESET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsersReset(@org.eclipse.jdt.annotation.NonNull List usersReset) { + this.usersReset = usersReset; + } + + /** + * Return true if this PinRedeemResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PinRedeemResult pinRedeemResult = (PinRedeemResult) o; + return Objects.equals(this.success, pinRedeemResult.success) + && Objects.equals(this.usersReset, pinRedeemResult.usersReset); + } + + @Override + public int hashCode() { + return Objects.hash(success, usersReset); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PinRedeemResult {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" usersReset: ").append(toIndentedString(usersReset)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Success` to the URL query string + if (getSuccess() != null) { + joiner.add(String.format("%sSuccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSuccess())))); + } + + // add `UsersReset` to the URL query string + if (getUsersReset() != null) { + for (int i = 0; i < getUsersReset().size(); i++) { + joiner.add(String.format("%sUsersReset%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getUsersReset().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private PinRedeemResult instance; + + public Builder() { + this(new PinRedeemResult()); + } + + protected Builder(PinRedeemResult instance) { + this.instance = instance; + } + + public PinRedeemResult.Builder success(Boolean success) { + this.instance.success = success; + return this; + } + + public PinRedeemResult.Builder usersReset(List usersReset) { + this.instance.usersReset = usersReset; + return this; + } + + /** + * returns a built PinRedeemResult instance. + * + * The builder is not reusable. + */ + public PinRedeemResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PinRedeemResult.Builder builder() { + return new PinRedeemResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PinRedeemResult.Builder toBuilder() { + return new PinRedeemResult.Builder().success(getSuccess()).usersReset(getUsersReset()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PingRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PingRequestDto.java new file mode 100644 index 0000000000000..08aaaff5f5139 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PingRequestDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PingRequestDto. + */ +@JsonPropertyOrder({ PingRequestDto.JSON_PROPERTY_PING }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PingRequestDto { + public static final String JSON_PROPERTY_PING = "Ping"; + @org.eclipse.jdt.annotation.NonNull + private Long ping; + + public PingRequestDto() { + } + + public PingRequestDto ping(@org.eclipse.jdt.annotation.NonNull Long ping) { + this.ping = ping; + return this; + } + + /** + * Gets or sets the ping time. + * + * @return ping + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPing() { + return ping; + } + + @JsonProperty(JSON_PROPERTY_PING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPing(@org.eclipse.jdt.annotation.NonNull Long ping) { + this.ping = ping; + } + + /** + * Return true if this PingRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PingRequestDto pingRequestDto = (PingRequestDto) o; + return Objects.equals(this.ping, pingRequestDto.ping); + } + + @Override + public int hashCode() { + return Objects.hash(ping); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PingRequestDto {\n"); + sb.append(" ping: ").append(toIndentedString(ping)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Ping` to the URL query string + if (getPing() != null) { + joiner.add(String.format("%sPing%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPing())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PingRequestDto instance; + + public Builder() { + this(new PingRequestDto()); + } + + protected Builder(PingRequestDto instance) { + this.instance = instance; + } + + public PingRequestDto.Builder ping(Long ping) { + this.instance.ping = ping; + return this; + } + + /** + * returns a built PingRequestDto instance. + * + * The builder is not reusable. + */ + public PingRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PingRequestDto.Builder builder() { + return new PingRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PingRequestDto.Builder toBuilder() { + return new PingRequestDto.Builder().ping(getPing()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayAccess.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayAccess.java new file mode 100644 index 0000000000000..a13bd7a7eee75 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayAccess.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets PlayAccess + */ +public enum PlayAccess { + + FULL("Full"), + + NONE("None"); + + private String value; + + PlayAccess(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PlayAccess fromValue(String value) { + for (PlayAccess b : PlayAccess.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayCommand.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayCommand.java new file mode 100644 index 0000000000000..e7f73bfa8d854 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayCommand.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum PlayCommand. + */ +public enum PlayCommand { + + PLAY_NOW("PlayNow"), + + PLAY_NEXT("PlayNext"), + + PLAY_LAST("PlayLast"), + + PLAY_INSTANT_MIX("PlayInstantMix"), + + PLAY_SHUFFLE("PlayShuffle"); + + private String value; + + PlayCommand(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PlayCommand fromValue(String value) { + for (PlayCommand b : PlayCommand.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayMethod.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayMethod.java new file mode 100644 index 0000000000000..49823de7e7ffa --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayMethod.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets PlayMethod + */ +public enum PlayMethod { + + TRANSCODE("Transcode"), + + DIRECT_STREAM("DirectStream"), + + DIRECT_PLAY("DirectPlay"); + + private String value; + + PlayMethod(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PlayMethod fromValue(String value) { + for (PlayMethod b : PlayMethod.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayRequest.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayRequest.java new file mode 100644 index 0000000000000..a2bacca9b2698 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayRequest.java @@ -0,0 +1,495 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PlayRequest. + */ +@JsonPropertyOrder({ PlayRequest.JSON_PROPERTY_ITEM_IDS, PlayRequest.JSON_PROPERTY_START_POSITION_TICKS, + PlayRequest.JSON_PROPERTY_PLAY_COMMAND, PlayRequest.JSON_PROPERTY_CONTROLLING_USER_ID, + PlayRequest.JSON_PROPERTY_SUBTITLE_STREAM_INDEX, PlayRequest.JSON_PROPERTY_AUDIO_STREAM_INDEX, + PlayRequest.JSON_PROPERTY_MEDIA_SOURCE_ID, PlayRequest.JSON_PROPERTY_START_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlayRequest { + public static final String JSON_PROPERTY_ITEM_IDS = "ItemIds"; + @org.eclipse.jdt.annotation.NonNull + private List itemIds; + + public static final String JSON_PROPERTY_START_POSITION_TICKS = "StartPositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long startPositionTicks; + + public static final String JSON_PROPERTY_PLAY_COMMAND = "PlayCommand"; + @org.eclipse.jdt.annotation.NonNull + private PlayCommand playCommand; + + public static final String JSON_PROPERTY_CONTROLLING_USER_ID = "ControllingUserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID controllingUserId; + + public static final String JSON_PROPERTY_SUBTITLE_STREAM_INDEX = "SubtitleStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer subtitleStreamIndex; + + public static final String JSON_PROPERTY_AUDIO_STREAM_INDEX = "AudioStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer audioStreamIndex; + + public static final String JSON_PROPERTY_MEDIA_SOURCE_ID = "MediaSourceId"; + @org.eclipse.jdt.annotation.NonNull + private String mediaSourceId; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public PlayRequest() { + } + + public PlayRequest itemIds(@org.eclipse.jdt.annotation.NonNull List itemIds) { + this.itemIds = itemIds; + return this; + } + + public PlayRequest addItemIdsItem(UUID itemIdsItem) { + if (this.itemIds == null) { + this.itemIds = new ArrayList<>(); + } + this.itemIds.add(itemIdsItem); + return this; + } + + /** + * Gets or sets the item ids. + * + * @return itemIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItemIds() { + return itemIds; + } + + @JsonProperty(JSON_PROPERTY_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemIds(@org.eclipse.jdt.annotation.NonNull List itemIds) { + this.itemIds = itemIds; + } + + public PlayRequest startPositionTicks(@org.eclipse.jdt.annotation.NonNull Long startPositionTicks) { + this.startPositionTicks = startPositionTicks; + return this; + } + + /** + * Gets or sets the start position ticks that the first item should be played at. + * + * @return startPositionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartPositionTicks() { + return startPositionTicks; + } + + @JsonProperty(JSON_PROPERTY_START_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartPositionTicks(@org.eclipse.jdt.annotation.NonNull Long startPositionTicks) { + this.startPositionTicks = startPositionTicks; + } + + public PlayRequest playCommand(@org.eclipse.jdt.annotation.NonNull PlayCommand playCommand) { + this.playCommand = playCommand; + return this; + } + + /** + * Gets or sets the play command. + * + * @return playCommand + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlayCommand getPlayCommand() { + return playCommand; + } + + @JsonProperty(JSON_PROPERTY_PLAY_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayCommand(@org.eclipse.jdt.annotation.NonNull PlayCommand playCommand) { + this.playCommand = playCommand; + } + + public PlayRequest controllingUserId(@org.eclipse.jdt.annotation.NonNull UUID controllingUserId) { + this.controllingUserId = controllingUserId; + return this; + } + + /** + * Gets or sets the controlling user identifier. + * + * @return controllingUserId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTROLLING_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getControllingUserId() { + return controllingUserId; + } + + @JsonProperty(JSON_PROPERTY_CONTROLLING_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setControllingUserId(@org.eclipse.jdt.annotation.NonNull UUID controllingUserId) { + this.controllingUserId = controllingUserId; + } + + public PlayRequest subtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + /** + * Get subtitleStreamIndex + * + * @return subtitleStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSubtitleStreamIndex() { + return subtitleStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + } + + public PlayRequest audioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + return this; + } + + /** + * Get audioStreamIndex + * + * @return audioStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAudioStreamIndex() { + return audioStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + } + + public PlayRequest mediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + return this; + } + + /** + * Get mediaSourceId + * + * @return mediaSourceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMediaSourceId() { + return mediaSourceId; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + } + + public PlayRequest startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Get startIndex + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + /** + * Return true if this PlayRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlayRequest playRequest = (PlayRequest) o; + return Objects.equals(this.itemIds, playRequest.itemIds) + && Objects.equals(this.startPositionTicks, playRequest.startPositionTicks) + && Objects.equals(this.playCommand, playRequest.playCommand) + && Objects.equals(this.controllingUserId, playRequest.controllingUserId) + && Objects.equals(this.subtitleStreamIndex, playRequest.subtitleStreamIndex) + && Objects.equals(this.audioStreamIndex, playRequest.audioStreamIndex) + && Objects.equals(this.mediaSourceId, playRequest.mediaSourceId) + && Objects.equals(this.startIndex, playRequest.startIndex); + } + + @Override + public int hashCode() { + return Objects.hash(itemIds, startPositionTicks, playCommand, controllingUserId, subtitleStreamIndex, + audioStreamIndex, mediaSourceId, startIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlayRequest {\n"); + sb.append(" itemIds: ").append(toIndentedString(itemIds)).append("\n"); + sb.append(" startPositionTicks: ").append(toIndentedString(startPositionTicks)).append("\n"); + sb.append(" playCommand: ").append(toIndentedString(playCommand)).append("\n"); + sb.append(" controllingUserId: ").append(toIndentedString(controllingUserId)).append("\n"); + sb.append(" subtitleStreamIndex: ").append(toIndentedString(subtitleStreamIndex)).append("\n"); + sb.append(" audioStreamIndex: ").append(toIndentedString(audioStreamIndex)).append("\n"); + sb.append(" mediaSourceId: ").append(toIndentedString(mediaSourceId)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ItemIds` to the URL query string + if (getItemIds() != null) { + for (int i = 0; i < getItemIds().size(); i++) { + if (getItemIds().get(i) != null) { + joiner.add(String.format("%sItemIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getItemIds().get(i))))); + } + } + } + + // add `StartPositionTicks` to the URL query string + if (getStartPositionTicks() != null) { + joiner.add(String.format("%sStartPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartPositionTicks())))); + } + + // add `PlayCommand` to the URL query string + if (getPlayCommand() != null) { + joiner.add(String.format("%sPlayCommand%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayCommand())))); + } + + // add `ControllingUserId` to the URL query string + if (getControllingUserId() != null) { + joiner.add(String.format("%sControllingUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getControllingUserId())))); + } + + // add `SubtitleStreamIndex` to the URL query string + if (getSubtitleStreamIndex() != null) { + joiner.add(String.format("%sSubtitleStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleStreamIndex())))); + } + + // add `AudioStreamIndex` to the URL query string + if (getAudioStreamIndex() != null) { + joiner.add(String.format("%sAudioStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioStreamIndex())))); + } + + // add `MediaSourceId` to the URL query string + if (getMediaSourceId() != null) { + joiner.add(String.format("%sMediaSourceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaSourceId())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlayRequest instance; + + public Builder() { + this(new PlayRequest()); + } + + protected Builder(PlayRequest instance) { + this.instance = instance; + } + + public PlayRequest.Builder itemIds(List itemIds) { + this.instance.itemIds = itemIds; + return this; + } + + public PlayRequest.Builder startPositionTicks(Long startPositionTicks) { + this.instance.startPositionTicks = startPositionTicks; + return this; + } + + public PlayRequest.Builder playCommand(PlayCommand playCommand) { + this.instance.playCommand = playCommand; + return this; + } + + public PlayRequest.Builder controllingUserId(UUID controllingUserId) { + this.instance.controllingUserId = controllingUserId; + return this; + } + + public PlayRequest.Builder subtitleStreamIndex(Integer subtitleStreamIndex) { + this.instance.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + public PlayRequest.Builder audioStreamIndex(Integer audioStreamIndex) { + this.instance.audioStreamIndex = audioStreamIndex; + return this; + } + + public PlayRequest.Builder mediaSourceId(String mediaSourceId) { + this.instance.mediaSourceId = mediaSourceId; + return this; + } + + public PlayRequest.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + /** + * returns a built PlayRequest instance. + * + * The builder is not reusable. + */ + public PlayRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlayRequest.Builder builder() { + return new PlayRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlayRequest.Builder toBuilder() { + return new PlayRequest.Builder().itemIds(getItemIds()).startPositionTicks(getStartPositionTicks()) + .playCommand(getPlayCommand()).controllingUserId(getControllingUserId()) + .subtitleStreamIndex(getSubtitleStreamIndex()).audioStreamIndex(getAudioStreamIndex()) + .mediaSourceId(getMediaSourceId()).startIndex(getStartIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayRequestDto.java new file mode 100644 index 0000000000000..6c22d71b3473b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayRequestDto.java @@ -0,0 +1,290 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PlayRequestDto. + */ +@JsonPropertyOrder({ PlayRequestDto.JSON_PROPERTY_PLAYING_QUEUE, PlayRequestDto.JSON_PROPERTY_PLAYING_ITEM_POSITION, + PlayRequestDto.JSON_PROPERTY_START_POSITION_TICKS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlayRequestDto { + public static final String JSON_PROPERTY_PLAYING_QUEUE = "PlayingQueue"; + @org.eclipse.jdt.annotation.NonNull + private List playingQueue = new ArrayList<>(); + + public static final String JSON_PROPERTY_PLAYING_ITEM_POSITION = "PlayingItemPosition"; + @org.eclipse.jdt.annotation.NonNull + private Integer playingItemPosition; + + public static final String JSON_PROPERTY_START_POSITION_TICKS = "StartPositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long startPositionTicks; + + public PlayRequestDto() { + } + + public PlayRequestDto playingQueue(@org.eclipse.jdt.annotation.NonNull List playingQueue) { + this.playingQueue = playingQueue; + return this; + } + + public PlayRequestDto addPlayingQueueItem(UUID playingQueueItem) { + if (this.playingQueue == null) { + this.playingQueue = new ArrayList<>(); + } + this.playingQueue.add(playingQueueItem); + return this; + } + + /** + * Gets or sets the playing queue. + * + * @return playingQueue + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPlayingQueue() { + return playingQueue; + } + + @JsonProperty(JSON_PROPERTY_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayingQueue(@org.eclipse.jdt.annotation.NonNull List playingQueue) { + this.playingQueue = playingQueue; + } + + public PlayRequestDto playingItemPosition(@org.eclipse.jdt.annotation.NonNull Integer playingItemPosition) { + this.playingItemPosition = playingItemPosition; + return this; + } + + /** + * Gets or sets the position of the playing item in the queue. + * + * @return playingItemPosition + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYING_ITEM_POSITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPlayingItemPosition() { + return playingItemPosition; + } + + @JsonProperty(JSON_PROPERTY_PLAYING_ITEM_POSITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayingItemPosition(@org.eclipse.jdt.annotation.NonNull Integer playingItemPosition) { + this.playingItemPosition = playingItemPosition; + } + + public PlayRequestDto startPositionTicks(@org.eclipse.jdt.annotation.NonNull Long startPositionTicks) { + this.startPositionTicks = startPositionTicks; + return this; + } + + /** + * Gets or sets the start position ticks. + * + * @return startPositionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartPositionTicks() { + return startPositionTicks; + } + + @JsonProperty(JSON_PROPERTY_START_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartPositionTicks(@org.eclipse.jdt.annotation.NonNull Long startPositionTicks) { + this.startPositionTicks = startPositionTicks; + } + + /** + * Return true if this PlayRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlayRequestDto playRequestDto = (PlayRequestDto) o; + return Objects.equals(this.playingQueue, playRequestDto.playingQueue) + && Objects.equals(this.playingItemPosition, playRequestDto.playingItemPosition) + && Objects.equals(this.startPositionTicks, playRequestDto.startPositionTicks); + } + + @Override + public int hashCode() { + return Objects.hash(playingQueue, playingItemPosition, startPositionTicks); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlayRequestDto {\n"); + sb.append(" playingQueue: ").append(toIndentedString(playingQueue)).append("\n"); + sb.append(" playingItemPosition: ").append(toIndentedString(playingItemPosition)).append("\n"); + sb.append(" startPositionTicks: ").append(toIndentedString(startPositionTicks)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlayingQueue` to the URL query string + if (getPlayingQueue() != null) { + for (int i = 0; i < getPlayingQueue().size(); i++) { + if (getPlayingQueue().get(i) != null) { + joiner.add(String.format("%sPlayingQueue%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getPlayingQueue().get(i))))); + } + } + } + + // add `PlayingItemPosition` to the URL query string + if (getPlayingItemPosition() != null) { + joiner.add(String.format("%sPlayingItemPosition%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayingItemPosition())))); + } + + // add `StartPositionTicks` to the URL query string + if (getStartPositionTicks() != null) { + joiner.add(String.format("%sStartPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartPositionTicks())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlayRequestDto instance; + + public Builder() { + this(new PlayRequestDto()); + } + + protected Builder(PlayRequestDto instance) { + this.instance = instance; + } + + public PlayRequestDto.Builder playingQueue(List playingQueue) { + this.instance.playingQueue = playingQueue; + return this; + } + + public PlayRequestDto.Builder playingItemPosition(Integer playingItemPosition) { + this.instance.playingItemPosition = playingItemPosition; + return this; + } + + public PlayRequestDto.Builder startPositionTicks(Long startPositionTicks) { + this.instance.startPositionTicks = startPositionTicks; + return this; + } + + /** + * returns a built PlayRequestDto instance. + * + * The builder is not reusable. + */ + public PlayRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlayRequestDto.Builder builder() { + return new PlayRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlayRequestDto.Builder toBuilder() { + return new PlayRequestDto.Builder().playingQueue(getPlayingQueue()) + .playingItemPosition(getPlayingItemPosition()).startPositionTicks(getStartPositionTicks()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackErrorCode.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackErrorCode.java new file mode 100644 index 0000000000000..392f1bed77841 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackErrorCode.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets PlaybackErrorCode + */ +public enum PlaybackErrorCode { + + NOT_ALLOWED("NotAllowed"), + + NO_COMPATIBLE_STREAM("NoCompatibleStream"), + + RATE_LIMIT_EXCEEDED("RateLimitExceeded"); + + private String value; + + PlaybackErrorCode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PlaybackErrorCode fromValue(String value) { + for (PlaybackErrorCode b : PlaybackErrorCode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackInfoDto.java new file mode 100644 index 0000000000000..a7ad847da8cb7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackInfoDto.java @@ -0,0 +1,774 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Plabyback info dto. + */ +@JsonPropertyOrder({ PlaybackInfoDto.JSON_PROPERTY_USER_ID, PlaybackInfoDto.JSON_PROPERTY_MAX_STREAMING_BITRATE, + PlaybackInfoDto.JSON_PROPERTY_START_TIME_TICKS, PlaybackInfoDto.JSON_PROPERTY_AUDIO_STREAM_INDEX, + PlaybackInfoDto.JSON_PROPERTY_SUBTITLE_STREAM_INDEX, PlaybackInfoDto.JSON_PROPERTY_MAX_AUDIO_CHANNELS, + PlaybackInfoDto.JSON_PROPERTY_MEDIA_SOURCE_ID, PlaybackInfoDto.JSON_PROPERTY_LIVE_STREAM_ID, + PlaybackInfoDto.JSON_PROPERTY_DEVICE_PROFILE, PlaybackInfoDto.JSON_PROPERTY_ENABLE_DIRECT_PLAY, + PlaybackInfoDto.JSON_PROPERTY_ENABLE_DIRECT_STREAM, PlaybackInfoDto.JSON_PROPERTY_ENABLE_TRANSCODING, + PlaybackInfoDto.JSON_PROPERTY_ALLOW_VIDEO_STREAM_COPY, PlaybackInfoDto.JSON_PROPERTY_ALLOW_AUDIO_STREAM_COPY, + PlaybackInfoDto.JSON_PROPERTY_AUTO_OPEN_LIVE_STREAM }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaybackInfoDto { + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_MAX_STREAMING_BITRATE = "MaxStreamingBitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxStreamingBitrate; + + public static final String JSON_PROPERTY_START_TIME_TICKS = "StartTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long startTimeTicks; + + public static final String JSON_PROPERTY_AUDIO_STREAM_INDEX = "AudioStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer audioStreamIndex; + + public static final String JSON_PROPERTY_SUBTITLE_STREAM_INDEX = "SubtitleStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer subtitleStreamIndex; + + public static final String JSON_PROPERTY_MAX_AUDIO_CHANNELS = "MaxAudioChannels"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxAudioChannels; + + public static final String JSON_PROPERTY_MEDIA_SOURCE_ID = "MediaSourceId"; + @org.eclipse.jdt.annotation.NonNull + private String mediaSourceId; + + public static final String JSON_PROPERTY_LIVE_STREAM_ID = "LiveStreamId"; + @org.eclipse.jdt.annotation.NonNull + private String liveStreamId; + + public static final String JSON_PROPERTY_DEVICE_PROFILE = "DeviceProfile"; + @org.eclipse.jdt.annotation.NonNull + private DeviceProfile deviceProfile; + + public static final String JSON_PROPERTY_ENABLE_DIRECT_PLAY = "EnableDirectPlay"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableDirectPlay; + + public static final String JSON_PROPERTY_ENABLE_DIRECT_STREAM = "EnableDirectStream"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableDirectStream; + + public static final String JSON_PROPERTY_ENABLE_TRANSCODING = "EnableTranscoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableTranscoding; + + public static final String JSON_PROPERTY_ALLOW_VIDEO_STREAM_COPY = "AllowVideoStreamCopy"; + @org.eclipse.jdt.annotation.NonNull + private Boolean allowVideoStreamCopy; + + public static final String JSON_PROPERTY_ALLOW_AUDIO_STREAM_COPY = "AllowAudioStreamCopy"; + @org.eclipse.jdt.annotation.NonNull + private Boolean allowAudioStreamCopy; + + public static final String JSON_PROPERTY_AUTO_OPEN_LIVE_STREAM = "AutoOpenLiveStream"; + @org.eclipse.jdt.annotation.NonNull + private Boolean autoOpenLiveStream; + + public PlaybackInfoDto() { + } + + public PlaybackInfoDto userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the playback userId. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public PlaybackInfoDto maxStreamingBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate) { + this.maxStreamingBitrate = maxStreamingBitrate; + return this; + } + + /** + * Gets or sets the max streaming bitrate. + * + * @return maxStreamingBitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_STREAMING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxStreamingBitrate() { + return maxStreamingBitrate; + } + + @JsonProperty(JSON_PROPERTY_MAX_STREAMING_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxStreamingBitrate(@org.eclipse.jdt.annotation.NonNull Integer maxStreamingBitrate) { + this.maxStreamingBitrate = maxStreamingBitrate; + } + + public PlaybackInfoDto startTimeTicks(@org.eclipse.jdt.annotation.NonNull Long startTimeTicks) { + this.startTimeTicks = startTimeTicks; + return this; + } + + /** + * Gets or sets the start time in ticks. + * + * @return startTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartTimeTicks() { + return startTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_START_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartTimeTicks(@org.eclipse.jdt.annotation.NonNull Long startTimeTicks) { + this.startTimeTicks = startTimeTicks; + } + + public PlaybackInfoDto audioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + return this; + } + + /** + * Gets or sets the audio stream index. + * + * @return audioStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAudioStreamIndex() { + return audioStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + } + + public PlaybackInfoDto subtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + /** + * Gets or sets the subtitle stream index. + * + * @return subtitleStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSubtitleStreamIndex() { + return subtitleStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + } + + public PlaybackInfoDto maxAudioChannels(@org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels) { + this.maxAudioChannels = maxAudioChannels; + return this; + } + + /** + * Gets or sets the max audio channels. + * + * @return maxAudioChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_AUDIO_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxAudioChannels() { + return maxAudioChannels; + } + + @JsonProperty(JSON_PROPERTY_MAX_AUDIO_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxAudioChannels(@org.eclipse.jdt.annotation.NonNull Integer maxAudioChannels) { + this.maxAudioChannels = maxAudioChannels; + } + + public PlaybackInfoDto mediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + return this; + } + + /** + * Gets or sets the media source id. + * + * @return mediaSourceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMediaSourceId() { + return mediaSourceId; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + } + + public PlaybackInfoDto liveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + return this; + } + + /** + * Gets or sets the live stream id. + * + * @return liveStreamId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLiveStreamId() { + return liveStreamId; + } + + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLiveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + } + + public PlaybackInfoDto deviceProfile(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) { + this.deviceProfile = deviceProfile; + return this; + } + + /** + * A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain + * device is able to play. <br /> Specifically, it defines the supported <see + * cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles\">containers</see> and + * <see cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles\">codecs</see> + * (video and/or audio, including codec profiles and levels) the device is able to direct play (without transcoding + * or remuxing), as well as which <see + * cref=\"P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles\">containers/codecs to + * transcode to</see> in case it isn't. + * + * @return deviceProfile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceProfile getDeviceProfile() { + return deviceProfile; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceProfile(@org.eclipse.jdt.annotation.NonNull DeviceProfile deviceProfile) { + this.deviceProfile = deviceProfile; + } + + public PlaybackInfoDto enableDirectPlay(@org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay) { + this.enableDirectPlay = enableDirectPlay; + return this; + } + + /** + * Gets or sets a value indicating whether to enable direct play. + * + * @return enableDirectPlay + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_DIRECT_PLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableDirectPlay() { + return enableDirectPlay; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_DIRECT_PLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableDirectPlay(@org.eclipse.jdt.annotation.NonNull Boolean enableDirectPlay) { + this.enableDirectPlay = enableDirectPlay; + } + + public PlaybackInfoDto enableDirectStream(@org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream) { + this.enableDirectStream = enableDirectStream; + return this; + } + + /** + * Gets or sets a value indicating whether to enable direct stream. + * + * @return enableDirectStream + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_DIRECT_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableDirectStream() { + return enableDirectStream; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_DIRECT_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableDirectStream(@org.eclipse.jdt.annotation.NonNull Boolean enableDirectStream) { + this.enableDirectStream = enableDirectStream; + } + + public PlaybackInfoDto enableTranscoding(@org.eclipse.jdt.annotation.NonNull Boolean enableTranscoding) { + this.enableTranscoding = enableTranscoding; + return this; + } + + /** + * Gets or sets a value indicating whether to enable transcoding. + * + * @return enableTranscoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableTranscoding() { + return enableTranscoding; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableTranscoding(@org.eclipse.jdt.annotation.NonNull Boolean enableTranscoding) { + this.enableTranscoding = enableTranscoding; + } + + public PlaybackInfoDto allowVideoStreamCopy(@org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy) { + this.allowVideoStreamCopy = allowVideoStreamCopy; + return this; + } + + /** + * Gets or sets a value indicating whether to enable video stream copy. + * + * @return allowVideoStreamCopy + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_VIDEO_STREAM_COPY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowVideoStreamCopy() { + return allowVideoStreamCopy; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_VIDEO_STREAM_COPY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowVideoStreamCopy(@org.eclipse.jdt.annotation.NonNull Boolean allowVideoStreamCopy) { + this.allowVideoStreamCopy = allowVideoStreamCopy; + } + + public PlaybackInfoDto allowAudioStreamCopy(@org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy) { + this.allowAudioStreamCopy = allowAudioStreamCopy; + return this; + } + + /** + * Gets or sets a value indicating whether to allow audio stream copy. + * + * @return allowAudioStreamCopy + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_AUDIO_STREAM_COPY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowAudioStreamCopy() { + return allowAudioStreamCopy; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_AUDIO_STREAM_COPY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowAudioStreamCopy(@org.eclipse.jdt.annotation.NonNull Boolean allowAudioStreamCopy) { + this.allowAudioStreamCopy = allowAudioStreamCopy; + } + + public PlaybackInfoDto autoOpenLiveStream(@org.eclipse.jdt.annotation.NonNull Boolean autoOpenLiveStream) { + this.autoOpenLiveStream = autoOpenLiveStream; + return this; + } + + /** + * Gets or sets a value indicating whether to auto open the live stream. + * + * @return autoOpenLiveStream + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTO_OPEN_LIVE_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAutoOpenLiveStream() { + return autoOpenLiveStream; + } + + @JsonProperty(JSON_PROPERTY_AUTO_OPEN_LIVE_STREAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAutoOpenLiveStream(@org.eclipse.jdt.annotation.NonNull Boolean autoOpenLiveStream) { + this.autoOpenLiveStream = autoOpenLiveStream; + } + + /** + * Return true if this PlaybackInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaybackInfoDto playbackInfoDto = (PlaybackInfoDto) o; + return Objects.equals(this.userId, playbackInfoDto.userId) + && Objects.equals(this.maxStreamingBitrate, playbackInfoDto.maxStreamingBitrate) + && Objects.equals(this.startTimeTicks, playbackInfoDto.startTimeTicks) + && Objects.equals(this.audioStreamIndex, playbackInfoDto.audioStreamIndex) + && Objects.equals(this.subtitleStreamIndex, playbackInfoDto.subtitleStreamIndex) + && Objects.equals(this.maxAudioChannels, playbackInfoDto.maxAudioChannels) + && Objects.equals(this.mediaSourceId, playbackInfoDto.mediaSourceId) + && Objects.equals(this.liveStreamId, playbackInfoDto.liveStreamId) + && Objects.equals(this.deviceProfile, playbackInfoDto.deviceProfile) + && Objects.equals(this.enableDirectPlay, playbackInfoDto.enableDirectPlay) + && Objects.equals(this.enableDirectStream, playbackInfoDto.enableDirectStream) + && Objects.equals(this.enableTranscoding, playbackInfoDto.enableTranscoding) + && Objects.equals(this.allowVideoStreamCopy, playbackInfoDto.allowVideoStreamCopy) + && Objects.equals(this.allowAudioStreamCopy, playbackInfoDto.allowAudioStreamCopy) + && Objects.equals(this.autoOpenLiveStream, playbackInfoDto.autoOpenLiveStream); + } + + @Override + public int hashCode() { + return Objects.hash(userId, maxStreamingBitrate, startTimeTicks, audioStreamIndex, subtitleStreamIndex, + maxAudioChannels, mediaSourceId, liveStreamId, deviceProfile, enableDirectPlay, enableDirectStream, + enableTranscoding, allowVideoStreamCopy, allowAudioStreamCopy, autoOpenLiveStream); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaybackInfoDto {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" maxStreamingBitrate: ").append(toIndentedString(maxStreamingBitrate)).append("\n"); + sb.append(" startTimeTicks: ").append(toIndentedString(startTimeTicks)).append("\n"); + sb.append(" audioStreamIndex: ").append(toIndentedString(audioStreamIndex)).append("\n"); + sb.append(" subtitleStreamIndex: ").append(toIndentedString(subtitleStreamIndex)).append("\n"); + sb.append(" maxAudioChannels: ").append(toIndentedString(maxAudioChannels)).append("\n"); + sb.append(" mediaSourceId: ").append(toIndentedString(mediaSourceId)).append("\n"); + sb.append(" liveStreamId: ").append(toIndentedString(liveStreamId)).append("\n"); + sb.append(" deviceProfile: ").append(toIndentedString(deviceProfile)).append("\n"); + sb.append(" enableDirectPlay: ").append(toIndentedString(enableDirectPlay)).append("\n"); + sb.append(" enableDirectStream: ").append(toIndentedString(enableDirectStream)).append("\n"); + sb.append(" enableTranscoding: ").append(toIndentedString(enableTranscoding)).append("\n"); + sb.append(" allowVideoStreamCopy: ").append(toIndentedString(allowVideoStreamCopy)).append("\n"); + sb.append(" allowAudioStreamCopy: ").append(toIndentedString(allowAudioStreamCopy)).append("\n"); + sb.append(" autoOpenLiveStream: ").append(toIndentedString(autoOpenLiveStream)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `MaxStreamingBitrate` to the URL query string + if (getMaxStreamingBitrate() != null) { + joiner.add(String.format("%sMaxStreamingBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxStreamingBitrate())))); + } + + // add `StartTimeTicks` to the URL query string + if (getStartTimeTicks() != null) { + joiner.add(String.format("%sStartTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartTimeTicks())))); + } + + // add `AudioStreamIndex` to the URL query string + if (getAudioStreamIndex() != null) { + joiner.add(String.format("%sAudioStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioStreamIndex())))); + } + + // add `SubtitleStreamIndex` to the URL query string + if (getSubtitleStreamIndex() != null) { + joiner.add(String.format("%sSubtitleStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleStreamIndex())))); + } + + // add `MaxAudioChannels` to the URL query string + if (getMaxAudioChannels() != null) { + joiner.add(String.format("%sMaxAudioChannels%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxAudioChannels())))); + } + + // add `MediaSourceId` to the URL query string + if (getMediaSourceId() != null) { + joiner.add(String.format("%sMediaSourceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaSourceId())))); + } + + // add `LiveStreamId` to the URL query string + if (getLiveStreamId() != null) { + joiner.add(String.format("%sLiveStreamId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLiveStreamId())))); + } + + // add `DeviceProfile` to the URL query string + if (getDeviceProfile() != null) { + joiner.add(getDeviceProfile().toUrlQueryString(prefix + "DeviceProfile" + suffix)); + } + + // add `EnableDirectPlay` to the URL query string + if (getEnableDirectPlay() != null) { + joiner.add(String.format("%sEnableDirectPlay%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableDirectPlay())))); + } + + // add `EnableDirectStream` to the URL query string + if (getEnableDirectStream() != null) { + joiner.add(String.format("%sEnableDirectStream%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableDirectStream())))); + } + + // add `EnableTranscoding` to the URL query string + if (getEnableTranscoding() != null) { + joiner.add(String.format("%sEnableTranscoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableTranscoding())))); + } + + // add `AllowVideoStreamCopy` to the URL query string + if (getAllowVideoStreamCopy() != null) { + joiner.add(String.format("%sAllowVideoStreamCopy%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAllowVideoStreamCopy())))); + } + + // add `AllowAudioStreamCopy` to the URL query string + if (getAllowAudioStreamCopy() != null) { + joiner.add(String.format("%sAllowAudioStreamCopy%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAllowAudioStreamCopy())))); + } + + // add `AutoOpenLiveStream` to the URL query string + if (getAutoOpenLiveStream() != null) { + joiner.add(String.format("%sAutoOpenLiveStream%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAutoOpenLiveStream())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaybackInfoDto instance; + + public Builder() { + this(new PlaybackInfoDto()); + } + + protected Builder(PlaybackInfoDto instance) { + this.instance = instance; + } + + public PlaybackInfoDto.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public PlaybackInfoDto.Builder maxStreamingBitrate(Integer maxStreamingBitrate) { + this.instance.maxStreamingBitrate = maxStreamingBitrate; + return this; + } + + public PlaybackInfoDto.Builder startTimeTicks(Long startTimeTicks) { + this.instance.startTimeTicks = startTimeTicks; + return this; + } + + public PlaybackInfoDto.Builder audioStreamIndex(Integer audioStreamIndex) { + this.instance.audioStreamIndex = audioStreamIndex; + return this; + } + + public PlaybackInfoDto.Builder subtitleStreamIndex(Integer subtitleStreamIndex) { + this.instance.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + public PlaybackInfoDto.Builder maxAudioChannels(Integer maxAudioChannels) { + this.instance.maxAudioChannels = maxAudioChannels; + return this; + } + + public PlaybackInfoDto.Builder mediaSourceId(String mediaSourceId) { + this.instance.mediaSourceId = mediaSourceId; + return this; + } + + public PlaybackInfoDto.Builder liveStreamId(String liveStreamId) { + this.instance.liveStreamId = liveStreamId; + return this; + } + + public PlaybackInfoDto.Builder deviceProfile(DeviceProfile deviceProfile) { + this.instance.deviceProfile = deviceProfile; + return this; + } + + public PlaybackInfoDto.Builder enableDirectPlay(Boolean enableDirectPlay) { + this.instance.enableDirectPlay = enableDirectPlay; + return this; + } + + public PlaybackInfoDto.Builder enableDirectStream(Boolean enableDirectStream) { + this.instance.enableDirectStream = enableDirectStream; + return this; + } + + public PlaybackInfoDto.Builder enableTranscoding(Boolean enableTranscoding) { + this.instance.enableTranscoding = enableTranscoding; + return this; + } + + public PlaybackInfoDto.Builder allowVideoStreamCopy(Boolean allowVideoStreamCopy) { + this.instance.allowVideoStreamCopy = allowVideoStreamCopy; + return this; + } + + public PlaybackInfoDto.Builder allowAudioStreamCopy(Boolean allowAudioStreamCopy) { + this.instance.allowAudioStreamCopy = allowAudioStreamCopy; + return this; + } + + public PlaybackInfoDto.Builder autoOpenLiveStream(Boolean autoOpenLiveStream) { + this.instance.autoOpenLiveStream = autoOpenLiveStream; + return this; + } + + /** + * returns a built PlaybackInfoDto instance. + * + * The builder is not reusable. + */ + public PlaybackInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaybackInfoDto.Builder builder() { + return new PlaybackInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaybackInfoDto.Builder toBuilder() { + return new PlaybackInfoDto.Builder().userId(getUserId()).maxStreamingBitrate(getMaxStreamingBitrate()) + .startTimeTicks(getStartTimeTicks()).audioStreamIndex(getAudioStreamIndex()) + .subtitleStreamIndex(getSubtitleStreamIndex()).maxAudioChannels(getMaxAudioChannels()) + .mediaSourceId(getMediaSourceId()).liveStreamId(getLiveStreamId()).deviceProfile(getDeviceProfile()) + .enableDirectPlay(getEnableDirectPlay()).enableDirectStream(getEnableDirectStream()) + .enableTranscoding(getEnableTranscoding()).allowVideoStreamCopy(getAllowVideoStreamCopy()) + .allowAudioStreamCopy(getAllowAudioStreamCopy()).autoOpenLiveStream(getAutoOpenLiveStream()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackInfoResponse.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackInfoResponse.java new file mode 100644 index 0000000000000..00b31211fc156 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackInfoResponse.java @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PlaybackInfoResponse. + */ +@JsonPropertyOrder({ PlaybackInfoResponse.JSON_PROPERTY_MEDIA_SOURCES, + PlaybackInfoResponse.JSON_PROPERTY_PLAY_SESSION_ID, PlaybackInfoResponse.JSON_PROPERTY_ERROR_CODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaybackInfoResponse { + public static final String JSON_PROPERTY_MEDIA_SOURCES = "MediaSources"; + @org.eclipse.jdt.annotation.NonNull + private List mediaSources = new ArrayList<>(); + + public static final String JSON_PROPERTY_PLAY_SESSION_ID = "PlaySessionId"; + @org.eclipse.jdt.annotation.NonNull + private String playSessionId; + + public static final String JSON_PROPERTY_ERROR_CODE = "ErrorCode"; + @org.eclipse.jdt.annotation.NonNull + private PlaybackErrorCode errorCode; + + public PlaybackInfoResponse() { + } + + public PlaybackInfoResponse mediaSources(@org.eclipse.jdt.annotation.NonNull List mediaSources) { + this.mediaSources = mediaSources; + return this; + } + + public PlaybackInfoResponse addMediaSourcesItem(MediaSourceInfo mediaSourcesItem) { + if (this.mediaSources == null) { + this.mediaSources = new ArrayList<>(); + } + this.mediaSources.add(mediaSourcesItem); + return this; + } + + /** + * Gets or sets the media sources. + * + * @return mediaSources + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMediaSources() { + return mediaSources; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSources(@org.eclipse.jdt.annotation.NonNull List mediaSources) { + this.mediaSources = mediaSources; + } + + public PlaybackInfoResponse playSessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + return this; + } + + /** + * Gets or sets the play session identifier. + * + * @return playSessionId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaySessionId() { + return playSessionId; + } + + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaySessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + } + + public PlaybackInfoResponse errorCode(@org.eclipse.jdt.annotation.NonNull PlaybackErrorCode errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Gets or sets the error code. + * + * @return errorCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ERROR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlaybackErrorCode getErrorCode() { + return errorCode; + } + + @JsonProperty(JSON_PROPERTY_ERROR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorCode(@org.eclipse.jdt.annotation.NonNull PlaybackErrorCode errorCode) { + this.errorCode = errorCode; + } + + /** + * Return true if this PlaybackInfoResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaybackInfoResponse playbackInfoResponse = (PlaybackInfoResponse) o; + return Objects.equals(this.mediaSources, playbackInfoResponse.mediaSources) + && Objects.equals(this.playSessionId, playbackInfoResponse.playSessionId) + && Objects.equals(this.errorCode, playbackInfoResponse.errorCode); + } + + @Override + public int hashCode() { + return Objects.hash(mediaSources, playSessionId, errorCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaybackInfoResponse {\n"); + sb.append(" mediaSources: ").append(toIndentedString(mediaSources)).append("\n"); + sb.append(" playSessionId: ").append(toIndentedString(playSessionId)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MediaSources` to the URL query string + if (getMediaSources() != null) { + for (int i = 0; i < getMediaSources().size(); i++) { + if (getMediaSources().get(i) != null) { + joiner.add(getMediaSources().get(i).toUrlQueryString(String.format("%sMediaSources%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `PlaySessionId` to the URL query string + if (getPlaySessionId() != null) { + joiner.add(String.format("%sPlaySessionId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaySessionId())))); + } + + // add `ErrorCode` to the URL query string + if (getErrorCode() != null) { + joiner.add(String.format("%sErrorCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getErrorCode())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaybackInfoResponse instance; + + public Builder() { + this(new PlaybackInfoResponse()); + } + + protected Builder(PlaybackInfoResponse instance) { + this.instance = instance; + } + + public PlaybackInfoResponse.Builder mediaSources(List mediaSources) { + this.instance.mediaSources = mediaSources; + return this; + } + + public PlaybackInfoResponse.Builder playSessionId(String playSessionId) { + this.instance.playSessionId = playSessionId; + return this; + } + + public PlaybackInfoResponse.Builder errorCode(PlaybackErrorCode errorCode) { + this.instance.errorCode = errorCode; + return this; + } + + /** + * returns a built PlaybackInfoResponse instance. + * + * The builder is not reusable. + */ + public PlaybackInfoResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaybackInfoResponse.Builder builder() { + return new PlaybackInfoResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaybackInfoResponse.Builder toBuilder() { + return new PlaybackInfoResponse.Builder().mediaSources(getMediaSources()).playSessionId(getPlaySessionId()) + .errorCode(getErrorCode()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackProgressInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackProgressInfo.java new file mode 100644 index 0000000000000..254483c669e18 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackProgressInfo.java @@ -0,0 +1,985 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PlaybackProgressInfo. + */ +@JsonPropertyOrder({ PlaybackProgressInfo.JSON_PROPERTY_CAN_SEEK, PlaybackProgressInfo.JSON_PROPERTY_ITEM, + PlaybackProgressInfo.JSON_PROPERTY_ITEM_ID, PlaybackProgressInfo.JSON_PROPERTY_SESSION_ID, + PlaybackProgressInfo.JSON_PROPERTY_MEDIA_SOURCE_ID, PlaybackProgressInfo.JSON_PROPERTY_AUDIO_STREAM_INDEX, + PlaybackProgressInfo.JSON_PROPERTY_SUBTITLE_STREAM_INDEX, PlaybackProgressInfo.JSON_PROPERTY_IS_PAUSED, + PlaybackProgressInfo.JSON_PROPERTY_IS_MUTED, PlaybackProgressInfo.JSON_PROPERTY_POSITION_TICKS, + PlaybackProgressInfo.JSON_PROPERTY_PLAYBACK_START_TIME_TICKS, PlaybackProgressInfo.JSON_PROPERTY_VOLUME_LEVEL, + PlaybackProgressInfo.JSON_PROPERTY_BRIGHTNESS, PlaybackProgressInfo.JSON_PROPERTY_ASPECT_RATIO, + PlaybackProgressInfo.JSON_PROPERTY_PLAY_METHOD, PlaybackProgressInfo.JSON_PROPERTY_LIVE_STREAM_ID, + PlaybackProgressInfo.JSON_PROPERTY_PLAY_SESSION_ID, PlaybackProgressInfo.JSON_PROPERTY_REPEAT_MODE, + PlaybackProgressInfo.JSON_PROPERTY_NOW_PLAYING_QUEUE, PlaybackProgressInfo.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaybackProgressInfo { + public static final String JSON_PROPERTY_CAN_SEEK = "CanSeek"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canSeek; + + public static final String JSON_PROPERTY_ITEM = "Item"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemDto item; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SESSION_ID = "SessionId"; + @org.eclipse.jdt.annotation.NonNull + private String sessionId; + + public static final String JSON_PROPERTY_MEDIA_SOURCE_ID = "MediaSourceId"; + @org.eclipse.jdt.annotation.NonNull + private String mediaSourceId; + + public static final String JSON_PROPERTY_AUDIO_STREAM_INDEX = "AudioStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer audioStreamIndex; + + public static final String JSON_PROPERTY_SUBTITLE_STREAM_INDEX = "SubtitleStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer subtitleStreamIndex; + + public static final String JSON_PROPERTY_IS_PAUSED = "IsPaused"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPaused; + + public static final String JSON_PROPERTY_IS_MUTED = "IsMuted"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isMuted; + + public static final String JSON_PROPERTY_POSITION_TICKS = "PositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long positionTicks; + + public static final String JSON_PROPERTY_PLAYBACK_START_TIME_TICKS = "PlaybackStartTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long playbackStartTimeTicks; + + public static final String JSON_PROPERTY_VOLUME_LEVEL = "VolumeLevel"; + @org.eclipse.jdt.annotation.NonNull + private Integer volumeLevel; + + public static final String JSON_PROPERTY_BRIGHTNESS = "Brightness"; + @org.eclipse.jdt.annotation.NonNull + private Integer brightness; + + public static final String JSON_PROPERTY_ASPECT_RATIO = "AspectRatio"; + @org.eclipse.jdt.annotation.NonNull + private String aspectRatio; + + public static final String JSON_PROPERTY_PLAY_METHOD = "PlayMethod"; + @org.eclipse.jdt.annotation.NonNull + private PlayMethod playMethod; + + public static final String JSON_PROPERTY_LIVE_STREAM_ID = "LiveStreamId"; + @org.eclipse.jdt.annotation.NonNull + private String liveStreamId; + + public static final String JSON_PROPERTY_PLAY_SESSION_ID = "PlaySessionId"; + @org.eclipse.jdt.annotation.NonNull + private String playSessionId; + + public static final String JSON_PROPERTY_REPEAT_MODE = "RepeatMode"; + @org.eclipse.jdt.annotation.NonNull + private RepeatMode repeatMode; + + public static final String JSON_PROPERTY_NOW_PLAYING_QUEUE = "NowPlayingQueue"; + @org.eclipse.jdt.annotation.NonNull + private List nowPlayingQueue; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private String playlistItemId; + + public PlaybackProgressInfo() { + } + + public PlaybackProgressInfo canSeek(@org.eclipse.jdt.annotation.NonNull Boolean canSeek) { + this.canSeek = canSeek; + return this; + } + + /** + * Gets or sets a value indicating whether this instance can seek. + * + * @return canSeek + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_SEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanSeek() { + return canSeek; + } + + @JsonProperty(JSON_PROPERTY_CAN_SEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanSeek(@org.eclipse.jdt.annotation.NonNull Boolean canSeek) { + this.canSeek = canSeek; + } + + public PlaybackProgressInfo item(@org.eclipse.jdt.annotation.NonNull BaseItemDto item) { + this.item = item; + return this; + } + + /** + * Gets or sets the item. + * + * @return item + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemDto getItem() { + return item; + } + + @JsonProperty(JSON_PROPERTY_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItem(@org.eclipse.jdt.annotation.NonNull BaseItemDto item) { + this.item = item; + } + + public PlaybackProgressInfo itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item identifier. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public PlaybackProgressInfo sessionId(@org.eclipse.jdt.annotation.NonNull String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Gets or sets the session id. + * + * @return sessionId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSessionId() { + return sessionId; + } + + @JsonProperty(JSON_PROPERTY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSessionId(@org.eclipse.jdt.annotation.NonNull String sessionId) { + this.sessionId = sessionId; + } + + public PlaybackProgressInfo mediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + return this; + } + + /** + * Gets or sets the media version identifier. + * + * @return mediaSourceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMediaSourceId() { + return mediaSourceId; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + } + + public PlaybackProgressInfo audioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + return this; + } + + /** + * Gets or sets the index of the audio stream. + * + * @return audioStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAudioStreamIndex() { + return audioStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + } + + public PlaybackProgressInfo subtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + /** + * Gets or sets the index of the subtitle stream. + * + * @return subtitleStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSubtitleStreamIndex() { + return subtitleStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + } + + public PlaybackProgressInfo isPaused(@org.eclipse.jdt.annotation.NonNull Boolean isPaused) { + this.isPaused = isPaused; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is paused. + * + * @return isPaused + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PAUSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPaused() { + return isPaused; + } + + @JsonProperty(JSON_PROPERTY_IS_PAUSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPaused(@org.eclipse.jdt.annotation.NonNull Boolean isPaused) { + this.isPaused = isPaused; + } + + public PlaybackProgressInfo isMuted(@org.eclipse.jdt.annotation.NonNull Boolean isMuted) { + this.isMuted = isMuted; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is muted. + * + * @return isMuted + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_MUTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsMuted() { + return isMuted; + } + + @JsonProperty(JSON_PROPERTY_IS_MUTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMuted(@org.eclipse.jdt.annotation.NonNull Boolean isMuted) { + this.isMuted = isMuted; + } + + public PlaybackProgressInfo positionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + return this; + } + + /** + * Gets or sets the position ticks. + * + * @return positionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPositionTicks() { + return positionTicks; + } + + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPositionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + } + + public PlaybackProgressInfo playbackStartTimeTicks( + @org.eclipse.jdt.annotation.NonNull Long playbackStartTimeTicks) { + this.playbackStartTimeTicks = playbackStartTimeTicks; + return this; + } + + /** + * Get playbackStartTimeTicks + * + * @return playbackStartTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYBACK_START_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPlaybackStartTimeTicks() { + return playbackStartTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_PLAYBACK_START_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaybackStartTimeTicks(@org.eclipse.jdt.annotation.NonNull Long playbackStartTimeTicks) { + this.playbackStartTimeTicks = playbackStartTimeTicks; + } + + public PlaybackProgressInfo volumeLevel(@org.eclipse.jdt.annotation.NonNull Integer volumeLevel) { + this.volumeLevel = volumeLevel; + return this; + } + + /** + * Gets or sets the volume level. + * + * @return volumeLevel + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VOLUME_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getVolumeLevel() { + return volumeLevel; + } + + @JsonProperty(JSON_PROPERTY_VOLUME_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVolumeLevel(@org.eclipse.jdt.annotation.NonNull Integer volumeLevel) { + this.volumeLevel = volumeLevel; + } + + public PlaybackProgressInfo brightness(@org.eclipse.jdt.annotation.NonNull Integer brightness) { + this.brightness = brightness; + return this; + } + + /** + * Get brightness + * + * @return brightness + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BRIGHTNESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBrightness() { + return brightness; + } + + @JsonProperty(JSON_PROPERTY_BRIGHTNESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBrightness(@org.eclipse.jdt.annotation.NonNull Integer brightness) { + this.brightness = brightness; + } + + public PlaybackProgressInfo aspectRatio(@org.eclipse.jdt.annotation.NonNull String aspectRatio) { + this.aspectRatio = aspectRatio; + return this; + } + + /** + * Get aspectRatio + * + * @return aspectRatio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAspectRatio() { + return aspectRatio; + } + + @JsonProperty(JSON_PROPERTY_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAspectRatio(@org.eclipse.jdt.annotation.NonNull String aspectRatio) { + this.aspectRatio = aspectRatio; + } + + public PlaybackProgressInfo playMethod(@org.eclipse.jdt.annotation.NonNull PlayMethod playMethod) { + this.playMethod = playMethod; + return this; + } + + /** + * Gets or sets the play method. + * + * @return playMethod + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlayMethod getPlayMethod() { + return playMethod; + } + + @JsonProperty(JSON_PROPERTY_PLAY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayMethod(@org.eclipse.jdt.annotation.NonNull PlayMethod playMethod) { + this.playMethod = playMethod; + } + + public PlaybackProgressInfo liveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + return this; + } + + /** + * Gets or sets the live stream identifier. + * + * @return liveStreamId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLiveStreamId() { + return liveStreamId; + } + + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLiveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + } + + public PlaybackProgressInfo playSessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + return this; + } + + /** + * Gets or sets the play session identifier. + * + * @return playSessionId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaySessionId() { + return playSessionId; + } + + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaySessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + } + + public PlaybackProgressInfo repeatMode(@org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode) { + this.repeatMode = repeatMode; + return this; + } + + /** + * Gets or sets the repeat mode. + * + * @return repeatMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REPEAT_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RepeatMode getRepeatMode() { + return repeatMode; + } + + @JsonProperty(JSON_PROPERTY_REPEAT_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepeatMode(@org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode) { + this.repeatMode = repeatMode; + } + + public PlaybackProgressInfo nowPlayingQueue(@org.eclipse.jdt.annotation.NonNull List nowPlayingQueue) { + this.nowPlayingQueue = nowPlayingQueue; + return this; + } + + public PlaybackProgressInfo addNowPlayingQueueItem(QueueItem nowPlayingQueueItem) { + if (this.nowPlayingQueue == null) { + this.nowPlayingQueue = new ArrayList<>(); + } + this.nowPlayingQueue.add(nowPlayingQueueItem); + return this; + } + + /** + * Get nowPlayingQueue + * + * @return nowPlayingQueue + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNowPlayingQueue() { + return nowPlayingQueue; + } + + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNowPlayingQueue(@org.eclipse.jdt.annotation.NonNull List nowPlayingQueue) { + this.nowPlayingQueue = nowPlayingQueue; + } + + public PlaybackProgressInfo playlistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Get playlistItemId + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + } + + /** + * Return true if this PlaybackProgressInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaybackProgressInfo playbackProgressInfo = (PlaybackProgressInfo) o; + return Objects.equals(this.canSeek, playbackProgressInfo.canSeek) + && Objects.equals(this.item, playbackProgressInfo.item) + && Objects.equals(this.itemId, playbackProgressInfo.itemId) + && Objects.equals(this.sessionId, playbackProgressInfo.sessionId) + && Objects.equals(this.mediaSourceId, playbackProgressInfo.mediaSourceId) + && Objects.equals(this.audioStreamIndex, playbackProgressInfo.audioStreamIndex) + && Objects.equals(this.subtitleStreamIndex, playbackProgressInfo.subtitleStreamIndex) + && Objects.equals(this.isPaused, playbackProgressInfo.isPaused) + && Objects.equals(this.isMuted, playbackProgressInfo.isMuted) + && Objects.equals(this.positionTicks, playbackProgressInfo.positionTicks) + && Objects.equals(this.playbackStartTimeTicks, playbackProgressInfo.playbackStartTimeTicks) + && Objects.equals(this.volumeLevel, playbackProgressInfo.volumeLevel) + && Objects.equals(this.brightness, playbackProgressInfo.brightness) + && Objects.equals(this.aspectRatio, playbackProgressInfo.aspectRatio) + && Objects.equals(this.playMethod, playbackProgressInfo.playMethod) + && Objects.equals(this.liveStreamId, playbackProgressInfo.liveStreamId) + && Objects.equals(this.playSessionId, playbackProgressInfo.playSessionId) + && Objects.equals(this.repeatMode, playbackProgressInfo.repeatMode) + && Objects.equals(this.nowPlayingQueue, playbackProgressInfo.nowPlayingQueue) + && Objects.equals(this.playlistItemId, playbackProgressInfo.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(canSeek, item, itemId, sessionId, mediaSourceId, audioStreamIndex, subtitleStreamIndex, + isPaused, isMuted, positionTicks, playbackStartTimeTicks, volumeLevel, brightness, aspectRatio, + playMethod, liveStreamId, playSessionId, repeatMode, nowPlayingQueue, playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaybackProgressInfo {\n"); + sb.append(" canSeek: ").append(toIndentedString(canSeek)).append("\n"); + sb.append(" item: ").append(toIndentedString(item)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" sessionId: ").append(toIndentedString(sessionId)).append("\n"); + sb.append(" mediaSourceId: ").append(toIndentedString(mediaSourceId)).append("\n"); + sb.append(" audioStreamIndex: ").append(toIndentedString(audioStreamIndex)).append("\n"); + sb.append(" subtitleStreamIndex: ").append(toIndentedString(subtitleStreamIndex)).append("\n"); + sb.append(" isPaused: ").append(toIndentedString(isPaused)).append("\n"); + sb.append(" isMuted: ").append(toIndentedString(isMuted)).append("\n"); + sb.append(" positionTicks: ").append(toIndentedString(positionTicks)).append("\n"); + sb.append(" playbackStartTimeTicks: ").append(toIndentedString(playbackStartTimeTicks)).append("\n"); + sb.append(" volumeLevel: ").append(toIndentedString(volumeLevel)).append("\n"); + sb.append(" brightness: ").append(toIndentedString(brightness)).append("\n"); + sb.append(" aspectRatio: ").append(toIndentedString(aspectRatio)).append("\n"); + sb.append(" playMethod: ").append(toIndentedString(playMethod)).append("\n"); + sb.append(" liveStreamId: ").append(toIndentedString(liveStreamId)).append("\n"); + sb.append(" playSessionId: ").append(toIndentedString(playSessionId)).append("\n"); + sb.append(" repeatMode: ").append(toIndentedString(repeatMode)).append("\n"); + sb.append(" nowPlayingQueue: ").append(toIndentedString(nowPlayingQueue)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `CanSeek` to the URL query string + if (getCanSeek() != null) { + joiner.add(String.format("%sCanSeek%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanSeek())))); + } + + // add `Item` to the URL query string + if (getItem() != null) { + joiner.add(getItem().toUrlQueryString(prefix + "Item" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SessionId` to the URL query string + if (getSessionId() != null) { + joiner.add(String.format("%sSessionId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSessionId())))); + } + + // add `MediaSourceId` to the URL query string + if (getMediaSourceId() != null) { + joiner.add(String.format("%sMediaSourceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaSourceId())))); + } + + // add `AudioStreamIndex` to the URL query string + if (getAudioStreamIndex() != null) { + joiner.add(String.format("%sAudioStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioStreamIndex())))); + } + + // add `SubtitleStreamIndex` to the URL query string + if (getSubtitleStreamIndex() != null) { + joiner.add(String.format("%sSubtitleStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleStreamIndex())))); + } + + // add `IsPaused` to the URL query string + if (getIsPaused() != null) { + joiner.add(String.format("%sIsPaused%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPaused())))); + } + + // add `IsMuted` to the URL query string + if (getIsMuted() != null) { + joiner.add(String.format("%sIsMuted%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsMuted())))); + } + + // add `PositionTicks` to the URL query string + if (getPositionTicks() != null) { + joiner.add(String.format("%sPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPositionTicks())))); + } + + // add `PlaybackStartTimeTicks` to the URL query string + if (getPlaybackStartTimeTicks() != null) { + joiner.add(String.format("%sPlaybackStartTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaybackStartTimeTicks())))); + } + + // add `VolumeLevel` to the URL query string + if (getVolumeLevel() != null) { + joiner.add(String.format("%sVolumeLevel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVolumeLevel())))); + } + + // add `Brightness` to the URL query string + if (getBrightness() != null) { + joiner.add(String.format("%sBrightness%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBrightness())))); + } + + // add `AspectRatio` to the URL query string + if (getAspectRatio() != null) { + joiner.add(String.format("%sAspectRatio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAspectRatio())))); + } + + // add `PlayMethod` to the URL query string + if (getPlayMethod() != null) { + joiner.add(String.format("%sPlayMethod%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayMethod())))); + } + + // add `LiveStreamId` to the URL query string + if (getLiveStreamId() != null) { + joiner.add(String.format("%sLiveStreamId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLiveStreamId())))); + } + + // add `PlaySessionId` to the URL query string + if (getPlaySessionId() != null) { + joiner.add(String.format("%sPlaySessionId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaySessionId())))); + } + + // add `RepeatMode` to the URL query string + if (getRepeatMode() != null) { + joiner.add(String.format("%sRepeatMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRepeatMode())))); + } + + // add `NowPlayingQueue` to the URL query string + if (getNowPlayingQueue() != null) { + for (int i = 0; i < getNowPlayingQueue().size(); i++) { + if (getNowPlayingQueue().get(i) != null) { + joiner.add(getNowPlayingQueue().get(i).toUrlQueryString(String.format("%sNowPlayingQueue%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaybackProgressInfo instance; + + public Builder() { + this(new PlaybackProgressInfo()); + } + + protected Builder(PlaybackProgressInfo instance) { + this.instance = instance; + } + + public PlaybackProgressInfo.Builder canSeek(Boolean canSeek) { + this.instance.canSeek = canSeek; + return this; + } + + public PlaybackProgressInfo.Builder item(BaseItemDto item) { + this.instance.item = item; + return this; + } + + public PlaybackProgressInfo.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public PlaybackProgressInfo.Builder sessionId(String sessionId) { + this.instance.sessionId = sessionId; + return this; + } + + public PlaybackProgressInfo.Builder mediaSourceId(String mediaSourceId) { + this.instance.mediaSourceId = mediaSourceId; + return this; + } + + public PlaybackProgressInfo.Builder audioStreamIndex(Integer audioStreamIndex) { + this.instance.audioStreamIndex = audioStreamIndex; + return this; + } + + public PlaybackProgressInfo.Builder subtitleStreamIndex(Integer subtitleStreamIndex) { + this.instance.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + public PlaybackProgressInfo.Builder isPaused(Boolean isPaused) { + this.instance.isPaused = isPaused; + return this; + } + + public PlaybackProgressInfo.Builder isMuted(Boolean isMuted) { + this.instance.isMuted = isMuted; + return this; + } + + public PlaybackProgressInfo.Builder positionTicks(Long positionTicks) { + this.instance.positionTicks = positionTicks; + return this; + } + + public PlaybackProgressInfo.Builder playbackStartTimeTicks(Long playbackStartTimeTicks) { + this.instance.playbackStartTimeTicks = playbackStartTimeTicks; + return this; + } + + public PlaybackProgressInfo.Builder volumeLevel(Integer volumeLevel) { + this.instance.volumeLevel = volumeLevel; + return this; + } + + public PlaybackProgressInfo.Builder brightness(Integer brightness) { + this.instance.brightness = brightness; + return this; + } + + public PlaybackProgressInfo.Builder aspectRatio(String aspectRatio) { + this.instance.aspectRatio = aspectRatio; + return this; + } + + public PlaybackProgressInfo.Builder playMethod(PlayMethod playMethod) { + this.instance.playMethod = playMethod; + return this; + } + + public PlaybackProgressInfo.Builder liveStreamId(String liveStreamId) { + this.instance.liveStreamId = liveStreamId; + return this; + } + + public PlaybackProgressInfo.Builder playSessionId(String playSessionId) { + this.instance.playSessionId = playSessionId; + return this; + } + + public PlaybackProgressInfo.Builder repeatMode(RepeatMode repeatMode) { + this.instance.repeatMode = repeatMode; + return this; + } + + public PlaybackProgressInfo.Builder nowPlayingQueue(List nowPlayingQueue) { + this.instance.nowPlayingQueue = nowPlayingQueue; + return this; + } + + public PlaybackProgressInfo.Builder playlistItemId(String playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built PlaybackProgressInfo instance. + * + * The builder is not reusable. + */ + public PlaybackProgressInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaybackProgressInfo.Builder builder() { + return new PlaybackProgressInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaybackProgressInfo.Builder toBuilder() { + return new PlaybackProgressInfo.Builder().canSeek(getCanSeek()).item(getItem()).itemId(getItemId()) + .sessionId(getSessionId()).mediaSourceId(getMediaSourceId()).audioStreamIndex(getAudioStreamIndex()) + .subtitleStreamIndex(getSubtitleStreamIndex()).isPaused(getIsPaused()).isMuted(getIsMuted()) + .positionTicks(getPositionTicks()).playbackStartTimeTicks(getPlaybackStartTimeTicks()) + .volumeLevel(getVolumeLevel()).brightness(getBrightness()).aspectRatio(getAspectRatio()) + .playMethod(getPlayMethod()).liveStreamId(getLiveStreamId()).playSessionId(getPlaySessionId()) + .repeatMode(getRepeatMode()).nowPlayingQueue(getNowPlayingQueue()).playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackStartInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackStartInfo.java new file mode 100644 index 0000000000000..1ec2bb51c05b8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackStartInfo.java @@ -0,0 +1,984 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PlaybackStartInfo. + */ +@JsonPropertyOrder({ PlaybackStartInfo.JSON_PROPERTY_CAN_SEEK, PlaybackStartInfo.JSON_PROPERTY_ITEM, + PlaybackStartInfo.JSON_PROPERTY_ITEM_ID, PlaybackStartInfo.JSON_PROPERTY_SESSION_ID, + PlaybackStartInfo.JSON_PROPERTY_MEDIA_SOURCE_ID, PlaybackStartInfo.JSON_PROPERTY_AUDIO_STREAM_INDEX, + PlaybackStartInfo.JSON_PROPERTY_SUBTITLE_STREAM_INDEX, PlaybackStartInfo.JSON_PROPERTY_IS_PAUSED, + PlaybackStartInfo.JSON_PROPERTY_IS_MUTED, PlaybackStartInfo.JSON_PROPERTY_POSITION_TICKS, + PlaybackStartInfo.JSON_PROPERTY_PLAYBACK_START_TIME_TICKS, PlaybackStartInfo.JSON_PROPERTY_VOLUME_LEVEL, + PlaybackStartInfo.JSON_PROPERTY_BRIGHTNESS, PlaybackStartInfo.JSON_PROPERTY_ASPECT_RATIO, + PlaybackStartInfo.JSON_PROPERTY_PLAY_METHOD, PlaybackStartInfo.JSON_PROPERTY_LIVE_STREAM_ID, + PlaybackStartInfo.JSON_PROPERTY_PLAY_SESSION_ID, PlaybackStartInfo.JSON_PROPERTY_REPEAT_MODE, + PlaybackStartInfo.JSON_PROPERTY_NOW_PLAYING_QUEUE, PlaybackStartInfo.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaybackStartInfo { + public static final String JSON_PROPERTY_CAN_SEEK = "CanSeek"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canSeek; + + public static final String JSON_PROPERTY_ITEM = "Item"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemDto item; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SESSION_ID = "SessionId"; + @org.eclipse.jdt.annotation.NonNull + private String sessionId; + + public static final String JSON_PROPERTY_MEDIA_SOURCE_ID = "MediaSourceId"; + @org.eclipse.jdt.annotation.NonNull + private String mediaSourceId; + + public static final String JSON_PROPERTY_AUDIO_STREAM_INDEX = "AudioStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer audioStreamIndex; + + public static final String JSON_PROPERTY_SUBTITLE_STREAM_INDEX = "SubtitleStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer subtitleStreamIndex; + + public static final String JSON_PROPERTY_IS_PAUSED = "IsPaused"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPaused; + + public static final String JSON_PROPERTY_IS_MUTED = "IsMuted"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isMuted; + + public static final String JSON_PROPERTY_POSITION_TICKS = "PositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long positionTicks; + + public static final String JSON_PROPERTY_PLAYBACK_START_TIME_TICKS = "PlaybackStartTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long playbackStartTimeTicks; + + public static final String JSON_PROPERTY_VOLUME_LEVEL = "VolumeLevel"; + @org.eclipse.jdt.annotation.NonNull + private Integer volumeLevel; + + public static final String JSON_PROPERTY_BRIGHTNESS = "Brightness"; + @org.eclipse.jdt.annotation.NonNull + private Integer brightness; + + public static final String JSON_PROPERTY_ASPECT_RATIO = "AspectRatio"; + @org.eclipse.jdt.annotation.NonNull + private String aspectRatio; + + public static final String JSON_PROPERTY_PLAY_METHOD = "PlayMethod"; + @org.eclipse.jdt.annotation.NonNull + private PlayMethod playMethod; + + public static final String JSON_PROPERTY_LIVE_STREAM_ID = "LiveStreamId"; + @org.eclipse.jdt.annotation.NonNull + private String liveStreamId; + + public static final String JSON_PROPERTY_PLAY_SESSION_ID = "PlaySessionId"; + @org.eclipse.jdt.annotation.NonNull + private String playSessionId; + + public static final String JSON_PROPERTY_REPEAT_MODE = "RepeatMode"; + @org.eclipse.jdt.annotation.NonNull + private RepeatMode repeatMode; + + public static final String JSON_PROPERTY_NOW_PLAYING_QUEUE = "NowPlayingQueue"; + @org.eclipse.jdt.annotation.NonNull + private List nowPlayingQueue; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private String playlistItemId; + + public PlaybackStartInfo() { + } + + public PlaybackStartInfo canSeek(@org.eclipse.jdt.annotation.NonNull Boolean canSeek) { + this.canSeek = canSeek; + return this; + } + + /** + * Gets or sets a value indicating whether this instance can seek. + * + * @return canSeek + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_SEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanSeek() { + return canSeek; + } + + @JsonProperty(JSON_PROPERTY_CAN_SEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanSeek(@org.eclipse.jdt.annotation.NonNull Boolean canSeek) { + this.canSeek = canSeek; + } + + public PlaybackStartInfo item(@org.eclipse.jdt.annotation.NonNull BaseItemDto item) { + this.item = item; + return this; + } + + /** + * Gets or sets the item. + * + * @return item + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemDto getItem() { + return item; + } + + @JsonProperty(JSON_PROPERTY_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItem(@org.eclipse.jdt.annotation.NonNull BaseItemDto item) { + this.item = item; + } + + public PlaybackStartInfo itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item identifier. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public PlaybackStartInfo sessionId(@org.eclipse.jdt.annotation.NonNull String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Gets or sets the session id. + * + * @return sessionId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSessionId() { + return sessionId; + } + + @JsonProperty(JSON_PROPERTY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSessionId(@org.eclipse.jdt.annotation.NonNull String sessionId) { + this.sessionId = sessionId; + } + + public PlaybackStartInfo mediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + return this; + } + + /** + * Gets or sets the media version identifier. + * + * @return mediaSourceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMediaSourceId() { + return mediaSourceId; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + } + + public PlaybackStartInfo audioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + return this; + } + + /** + * Gets or sets the index of the audio stream. + * + * @return audioStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAudioStreamIndex() { + return audioStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + } + + public PlaybackStartInfo subtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + /** + * Gets or sets the index of the subtitle stream. + * + * @return subtitleStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSubtitleStreamIndex() { + return subtitleStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + } + + public PlaybackStartInfo isPaused(@org.eclipse.jdt.annotation.NonNull Boolean isPaused) { + this.isPaused = isPaused; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is paused. + * + * @return isPaused + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PAUSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPaused() { + return isPaused; + } + + @JsonProperty(JSON_PROPERTY_IS_PAUSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPaused(@org.eclipse.jdt.annotation.NonNull Boolean isPaused) { + this.isPaused = isPaused; + } + + public PlaybackStartInfo isMuted(@org.eclipse.jdt.annotation.NonNull Boolean isMuted) { + this.isMuted = isMuted; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is muted. + * + * @return isMuted + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_MUTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsMuted() { + return isMuted; + } + + @JsonProperty(JSON_PROPERTY_IS_MUTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMuted(@org.eclipse.jdt.annotation.NonNull Boolean isMuted) { + this.isMuted = isMuted; + } + + public PlaybackStartInfo positionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + return this; + } + + /** + * Gets or sets the position ticks. + * + * @return positionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPositionTicks() { + return positionTicks; + } + + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPositionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + } + + public PlaybackStartInfo playbackStartTimeTicks(@org.eclipse.jdt.annotation.NonNull Long playbackStartTimeTicks) { + this.playbackStartTimeTicks = playbackStartTimeTicks; + return this; + } + + /** + * Get playbackStartTimeTicks + * + * @return playbackStartTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYBACK_START_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPlaybackStartTimeTicks() { + return playbackStartTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_PLAYBACK_START_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaybackStartTimeTicks(@org.eclipse.jdt.annotation.NonNull Long playbackStartTimeTicks) { + this.playbackStartTimeTicks = playbackStartTimeTicks; + } + + public PlaybackStartInfo volumeLevel(@org.eclipse.jdt.annotation.NonNull Integer volumeLevel) { + this.volumeLevel = volumeLevel; + return this; + } + + /** + * Gets or sets the volume level. + * + * @return volumeLevel + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VOLUME_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getVolumeLevel() { + return volumeLevel; + } + + @JsonProperty(JSON_PROPERTY_VOLUME_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVolumeLevel(@org.eclipse.jdt.annotation.NonNull Integer volumeLevel) { + this.volumeLevel = volumeLevel; + } + + public PlaybackStartInfo brightness(@org.eclipse.jdt.annotation.NonNull Integer brightness) { + this.brightness = brightness; + return this; + } + + /** + * Get brightness + * + * @return brightness + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BRIGHTNESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBrightness() { + return brightness; + } + + @JsonProperty(JSON_PROPERTY_BRIGHTNESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBrightness(@org.eclipse.jdt.annotation.NonNull Integer brightness) { + this.brightness = brightness; + } + + public PlaybackStartInfo aspectRatio(@org.eclipse.jdt.annotation.NonNull String aspectRatio) { + this.aspectRatio = aspectRatio; + return this; + } + + /** + * Get aspectRatio + * + * @return aspectRatio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAspectRatio() { + return aspectRatio; + } + + @JsonProperty(JSON_PROPERTY_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAspectRatio(@org.eclipse.jdt.annotation.NonNull String aspectRatio) { + this.aspectRatio = aspectRatio; + } + + public PlaybackStartInfo playMethod(@org.eclipse.jdt.annotation.NonNull PlayMethod playMethod) { + this.playMethod = playMethod; + return this; + } + + /** + * Gets or sets the play method. + * + * @return playMethod + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlayMethod getPlayMethod() { + return playMethod; + } + + @JsonProperty(JSON_PROPERTY_PLAY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayMethod(@org.eclipse.jdt.annotation.NonNull PlayMethod playMethod) { + this.playMethod = playMethod; + } + + public PlaybackStartInfo liveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + return this; + } + + /** + * Gets or sets the live stream identifier. + * + * @return liveStreamId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLiveStreamId() { + return liveStreamId; + } + + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLiveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + } + + public PlaybackStartInfo playSessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + return this; + } + + /** + * Gets or sets the play session identifier. + * + * @return playSessionId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaySessionId() { + return playSessionId; + } + + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaySessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + } + + public PlaybackStartInfo repeatMode(@org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode) { + this.repeatMode = repeatMode; + return this; + } + + /** + * Gets or sets the repeat mode. + * + * @return repeatMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REPEAT_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RepeatMode getRepeatMode() { + return repeatMode; + } + + @JsonProperty(JSON_PROPERTY_REPEAT_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepeatMode(@org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode) { + this.repeatMode = repeatMode; + } + + public PlaybackStartInfo nowPlayingQueue(@org.eclipse.jdt.annotation.NonNull List nowPlayingQueue) { + this.nowPlayingQueue = nowPlayingQueue; + return this; + } + + public PlaybackStartInfo addNowPlayingQueueItem(QueueItem nowPlayingQueueItem) { + if (this.nowPlayingQueue == null) { + this.nowPlayingQueue = new ArrayList<>(); + } + this.nowPlayingQueue.add(nowPlayingQueueItem); + return this; + } + + /** + * Get nowPlayingQueue + * + * @return nowPlayingQueue + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNowPlayingQueue() { + return nowPlayingQueue; + } + + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNowPlayingQueue(@org.eclipse.jdt.annotation.NonNull List nowPlayingQueue) { + this.nowPlayingQueue = nowPlayingQueue; + } + + public PlaybackStartInfo playlistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Get playlistItemId + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + } + + /** + * Return true if this PlaybackStartInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaybackStartInfo playbackStartInfo = (PlaybackStartInfo) o; + return Objects.equals(this.canSeek, playbackStartInfo.canSeek) + && Objects.equals(this.item, playbackStartInfo.item) + && Objects.equals(this.itemId, playbackStartInfo.itemId) + && Objects.equals(this.sessionId, playbackStartInfo.sessionId) + && Objects.equals(this.mediaSourceId, playbackStartInfo.mediaSourceId) + && Objects.equals(this.audioStreamIndex, playbackStartInfo.audioStreamIndex) + && Objects.equals(this.subtitleStreamIndex, playbackStartInfo.subtitleStreamIndex) + && Objects.equals(this.isPaused, playbackStartInfo.isPaused) + && Objects.equals(this.isMuted, playbackStartInfo.isMuted) + && Objects.equals(this.positionTicks, playbackStartInfo.positionTicks) + && Objects.equals(this.playbackStartTimeTicks, playbackStartInfo.playbackStartTimeTicks) + && Objects.equals(this.volumeLevel, playbackStartInfo.volumeLevel) + && Objects.equals(this.brightness, playbackStartInfo.brightness) + && Objects.equals(this.aspectRatio, playbackStartInfo.aspectRatio) + && Objects.equals(this.playMethod, playbackStartInfo.playMethod) + && Objects.equals(this.liveStreamId, playbackStartInfo.liveStreamId) + && Objects.equals(this.playSessionId, playbackStartInfo.playSessionId) + && Objects.equals(this.repeatMode, playbackStartInfo.repeatMode) + && Objects.equals(this.nowPlayingQueue, playbackStartInfo.nowPlayingQueue) + && Objects.equals(this.playlistItemId, playbackStartInfo.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(canSeek, item, itemId, sessionId, mediaSourceId, audioStreamIndex, subtitleStreamIndex, + isPaused, isMuted, positionTicks, playbackStartTimeTicks, volumeLevel, brightness, aspectRatio, + playMethod, liveStreamId, playSessionId, repeatMode, nowPlayingQueue, playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaybackStartInfo {\n"); + sb.append(" canSeek: ").append(toIndentedString(canSeek)).append("\n"); + sb.append(" item: ").append(toIndentedString(item)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" sessionId: ").append(toIndentedString(sessionId)).append("\n"); + sb.append(" mediaSourceId: ").append(toIndentedString(mediaSourceId)).append("\n"); + sb.append(" audioStreamIndex: ").append(toIndentedString(audioStreamIndex)).append("\n"); + sb.append(" subtitleStreamIndex: ").append(toIndentedString(subtitleStreamIndex)).append("\n"); + sb.append(" isPaused: ").append(toIndentedString(isPaused)).append("\n"); + sb.append(" isMuted: ").append(toIndentedString(isMuted)).append("\n"); + sb.append(" positionTicks: ").append(toIndentedString(positionTicks)).append("\n"); + sb.append(" playbackStartTimeTicks: ").append(toIndentedString(playbackStartTimeTicks)).append("\n"); + sb.append(" volumeLevel: ").append(toIndentedString(volumeLevel)).append("\n"); + sb.append(" brightness: ").append(toIndentedString(brightness)).append("\n"); + sb.append(" aspectRatio: ").append(toIndentedString(aspectRatio)).append("\n"); + sb.append(" playMethod: ").append(toIndentedString(playMethod)).append("\n"); + sb.append(" liveStreamId: ").append(toIndentedString(liveStreamId)).append("\n"); + sb.append(" playSessionId: ").append(toIndentedString(playSessionId)).append("\n"); + sb.append(" repeatMode: ").append(toIndentedString(repeatMode)).append("\n"); + sb.append(" nowPlayingQueue: ").append(toIndentedString(nowPlayingQueue)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `CanSeek` to the URL query string + if (getCanSeek() != null) { + joiner.add(String.format("%sCanSeek%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanSeek())))); + } + + // add `Item` to the URL query string + if (getItem() != null) { + joiner.add(getItem().toUrlQueryString(prefix + "Item" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SessionId` to the URL query string + if (getSessionId() != null) { + joiner.add(String.format("%sSessionId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSessionId())))); + } + + // add `MediaSourceId` to the URL query string + if (getMediaSourceId() != null) { + joiner.add(String.format("%sMediaSourceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaSourceId())))); + } + + // add `AudioStreamIndex` to the URL query string + if (getAudioStreamIndex() != null) { + joiner.add(String.format("%sAudioStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioStreamIndex())))); + } + + // add `SubtitleStreamIndex` to the URL query string + if (getSubtitleStreamIndex() != null) { + joiner.add(String.format("%sSubtitleStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleStreamIndex())))); + } + + // add `IsPaused` to the URL query string + if (getIsPaused() != null) { + joiner.add(String.format("%sIsPaused%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPaused())))); + } + + // add `IsMuted` to the URL query string + if (getIsMuted() != null) { + joiner.add(String.format("%sIsMuted%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsMuted())))); + } + + // add `PositionTicks` to the URL query string + if (getPositionTicks() != null) { + joiner.add(String.format("%sPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPositionTicks())))); + } + + // add `PlaybackStartTimeTicks` to the URL query string + if (getPlaybackStartTimeTicks() != null) { + joiner.add(String.format("%sPlaybackStartTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaybackStartTimeTicks())))); + } + + // add `VolumeLevel` to the URL query string + if (getVolumeLevel() != null) { + joiner.add(String.format("%sVolumeLevel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVolumeLevel())))); + } + + // add `Brightness` to the URL query string + if (getBrightness() != null) { + joiner.add(String.format("%sBrightness%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBrightness())))); + } + + // add `AspectRatio` to the URL query string + if (getAspectRatio() != null) { + joiner.add(String.format("%sAspectRatio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAspectRatio())))); + } + + // add `PlayMethod` to the URL query string + if (getPlayMethod() != null) { + joiner.add(String.format("%sPlayMethod%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayMethod())))); + } + + // add `LiveStreamId` to the URL query string + if (getLiveStreamId() != null) { + joiner.add(String.format("%sLiveStreamId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLiveStreamId())))); + } + + // add `PlaySessionId` to the URL query string + if (getPlaySessionId() != null) { + joiner.add(String.format("%sPlaySessionId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaySessionId())))); + } + + // add `RepeatMode` to the URL query string + if (getRepeatMode() != null) { + joiner.add(String.format("%sRepeatMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRepeatMode())))); + } + + // add `NowPlayingQueue` to the URL query string + if (getNowPlayingQueue() != null) { + for (int i = 0; i < getNowPlayingQueue().size(); i++) { + if (getNowPlayingQueue().get(i) != null) { + joiner.add(getNowPlayingQueue().get(i).toUrlQueryString(String.format("%sNowPlayingQueue%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaybackStartInfo instance; + + public Builder() { + this(new PlaybackStartInfo()); + } + + protected Builder(PlaybackStartInfo instance) { + this.instance = instance; + } + + public PlaybackStartInfo.Builder canSeek(Boolean canSeek) { + this.instance.canSeek = canSeek; + return this; + } + + public PlaybackStartInfo.Builder item(BaseItemDto item) { + this.instance.item = item; + return this; + } + + public PlaybackStartInfo.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public PlaybackStartInfo.Builder sessionId(String sessionId) { + this.instance.sessionId = sessionId; + return this; + } + + public PlaybackStartInfo.Builder mediaSourceId(String mediaSourceId) { + this.instance.mediaSourceId = mediaSourceId; + return this; + } + + public PlaybackStartInfo.Builder audioStreamIndex(Integer audioStreamIndex) { + this.instance.audioStreamIndex = audioStreamIndex; + return this; + } + + public PlaybackStartInfo.Builder subtitleStreamIndex(Integer subtitleStreamIndex) { + this.instance.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + public PlaybackStartInfo.Builder isPaused(Boolean isPaused) { + this.instance.isPaused = isPaused; + return this; + } + + public PlaybackStartInfo.Builder isMuted(Boolean isMuted) { + this.instance.isMuted = isMuted; + return this; + } + + public PlaybackStartInfo.Builder positionTicks(Long positionTicks) { + this.instance.positionTicks = positionTicks; + return this; + } + + public PlaybackStartInfo.Builder playbackStartTimeTicks(Long playbackStartTimeTicks) { + this.instance.playbackStartTimeTicks = playbackStartTimeTicks; + return this; + } + + public PlaybackStartInfo.Builder volumeLevel(Integer volumeLevel) { + this.instance.volumeLevel = volumeLevel; + return this; + } + + public PlaybackStartInfo.Builder brightness(Integer brightness) { + this.instance.brightness = brightness; + return this; + } + + public PlaybackStartInfo.Builder aspectRatio(String aspectRatio) { + this.instance.aspectRatio = aspectRatio; + return this; + } + + public PlaybackStartInfo.Builder playMethod(PlayMethod playMethod) { + this.instance.playMethod = playMethod; + return this; + } + + public PlaybackStartInfo.Builder liveStreamId(String liveStreamId) { + this.instance.liveStreamId = liveStreamId; + return this; + } + + public PlaybackStartInfo.Builder playSessionId(String playSessionId) { + this.instance.playSessionId = playSessionId; + return this; + } + + public PlaybackStartInfo.Builder repeatMode(RepeatMode repeatMode) { + this.instance.repeatMode = repeatMode; + return this; + } + + public PlaybackStartInfo.Builder nowPlayingQueue(List nowPlayingQueue) { + this.instance.nowPlayingQueue = nowPlayingQueue; + return this; + } + + public PlaybackStartInfo.Builder playlistItemId(String playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built PlaybackStartInfo instance. + * + * The builder is not reusable. + */ + public PlaybackStartInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaybackStartInfo.Builder builder() { + return new PlaybackStartInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaybackStartInfo.Builder toBuilder() { + return new PlaybackStartInfo.Builder().canSeek(getCanSeek()).item(getItem()).itemId(getItemId()) + .sessionId(getSessionId()).mediaSourceId(getMediaSourceId()).audioStreamIndex(getAudioStreamIndex()) + .subtitleStreamIndex(getSubtitleStreamIndex()).isPaused(getIsPaused()).isMuted(getIsMuted()) + .positionTicks(getPositionTicks()).playbackStartTimeTicks(getPlaybackStartTimeTicks()) + .volumeLevel(getVolumeLevel()).brightness(getBrightness()).aspectRatio(getAspectRatio()) + .playMethod(getPlayMethod()).liveStreamId(getLiveStreamId()).playSessionId(getPlaySessionId()) + .repeatMode(getRepeatMode()).nowPlayingQueue(getNowPlayingQueue()).playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackStopInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackStopInfo.java new file mode 100644 index 0000000000000..d7f4809149b8b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaybackStopInfo.java @@ -0,0 +1,615 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PlaybackStopInfo. + */ +@JsonPropertyOrder({ PlaybackStopInfo.JSON_PROPERTY_ITEM, PlaybackStopInfo.JSON_PROPERTY_ITEM_ID, + PlaybackStopInfo.JSON_PROPERTY_SESSION_ID, PlaybackStopInfo.JSON_PROPERTY_MEDIA_SOURCE_ID, + PlaybackStopInfo.JSON_PROPERTY_POSITION_TICKS, PlaybackStopInfo.JSON_PROPERTY_LIVE_STREAM_ID, + PlaybackStopInfo.JSON_PROPERTY_PLAY_SESSION_ID, PlaybackStopInfo.JSON_PROPERTY_FAILED, + PlaybackStopInfo.JSON_PROPERTY_NEXT_MEDIA_TYPE, PlaybackStopInfo.JSON_PROPERTY_PLAYLIST_ITEM_ID, + PlaybackStopInfo.JSON_PROPERTY_NOW_PLAYING_QUEUE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaybackStopInfo { + public static final String JSON_PROPERTY_ITEM = "Item"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemDto item; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SESSION_ID = "SessionId"; + @org.eclipse.jdt.annotation.NonNull + private String sessionId; + + public static final String JSON_PROPERTY_MEDIA_SOURCE_ID = "MediaSourceId"; + @org.eclipse.jdt.annotation.NonNull + private String mediaSourceId; + + public static final String JSON_PROPERTY_POSITION_TICKS = "PositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long positionTicks; + + public static final String JSON_PROPERTY_LIVE_STREAM_ID = "LiveStreamId"; + @org.eclipse.jdt.annotation.NonNull + private String liveStreamId; + + public static final String JSON_PROPERTY_PLAY_SESSION_ID = "PlaySessionId"; + @org.eclipse.jdt.annotation.NonNull + private String playSessionId; + + public static final String JSON_PROPERTY_FAILED = "Failed"; + @org.eclipse.jdt.annotation.NonNull + private Boolean failed; + + public static final String JSON_PROPERTY_NEXT_MEDIA_TYPE = "NextMediaType"; + @org.eclipse.jdt.annotation.NonNull + private String nextMediaType; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private String playlistItemId; + + public static final String JSON_PROPERTY_NOW_PLAYING_QUEUE = "NowPlayingQueue"; + @org.eclipse.jdt.annotation.NonNull + private List nowPlayingQueue; + + public PlaybackStopInfo() { + } + + public PlaybackStopInfo item(@org.eclipse.jdt.annotation.NonNull BaseItemDto item) { + this.item = item; + return this; + } + + /** + * Gets or sets the item. + * + * @return item + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemDto getItem() { + return item; + } + + @JsonProperty(JSON_PROPERTY_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItem(@org.eclipse.jdt.annotation.NonNull BaseItemDto item) { + this.item = item; + } + + public PlaybackStopInfo itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item identifier. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public PlaybackStopInfo sessionId(@org.eclipse.jdt.annotation.NonNull String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Gets or sets the session id. + * + * @return sessionId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSessionId() { + return sessionId; + } + + @JsonProperty(JSON_PROPERTY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSessionId(@org.eclipse.jdt.annotation.NonNull String sessionId) { + this.sessionId = sessionId; + } + + public PlaybackStopInfo mediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + return this; + } + + /** + * Gets or sets the media version identifier. + * + * @return mediaSourceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMediaSourceId() { + return mediaSourceId; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + } + + public PlaybackStopInfo positionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + return this; + } + + /** + * Gets or sets the position ticks. + * + * @return positionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPositionTicks() { + return positionTicks; + } + + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPositionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + } + + public PlaybackStopInfo liveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + return this; + } + + /** + * Gets or sets the live stream identifier. + * + * @return liveStreamId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLiveStreamId() { + return liveStreamId; + } + + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLiveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + } + + public PlaybackStopInfo playSessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + return this; + } + + /** + * Gets or sets the play session identifier. + * + * @return playSessionId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaySessionId() { + return playSessionId; + } + + @JsonProperty(JSON_PROPERTY_PLAY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaySessionId(@org.eclipse.jdt.annotation.NonNull String playSessionId) { + this.playSessionId = playSessionId; + } + + public PlaybackStopInfo failed(@org.eclipse.jdt.annotation.NonNull Boolean failed) { + this.failed = failed; + return this; + } + + /** + * Gets or sets a value indicating whether this MediaBrowser.Model.Session.PlaybackStopInfo is failed. + * + * @return failed + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FAILED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getFailed() { + return failed; + } + + @JsonProperty(JSON_PROPERTY_FAILED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFailed(@org.eclipse.jdt.annotation.NonNull Boolean failed) { + this.failed = failed; + } + + public PlaybackStopInfo nextMediaType(@org.eclipse.jdt.annotation.NonNull String nextMediaType) { + this.nextMediaType = nextMediaType; + return this; + } + + /** + * Get nextMediaType + * + * @return nextMediaType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NEXT_MEDIA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNextMediaType() { + return nextMediaType; + } + + @JsonProperty(JSON_PROPERTY_NEXT_MEDIA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNextMediaType(@org.eclipse.jdt.annotation.NonNull String nextMediaType) { + this.nextMediaType = nextMediaType; + } + + public PlaybackStopInfo playlistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Get playlistItemId + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + } + + public PlaybackStopInfo nowPlayingQueue(@org.eclipse.jdt.annotation.NonNull List nowPlayingQueue) { + this.nowPlayingQueue = nowPlayingQueue; + return this; + } + + public PlaybackStopInfo addNowPlayingQueueItem(QueueItem nowPlayingQueueItem) { + if (this.nowPlayingQueue == null) { + this.nowPlayingQueue = new ArrayList<>(); + } + this.nowPlayingQueue.add(nowPlayingQueueItem); + return this; + } + + /** + * Get nowPlayingQueue + * + * @return nowPlayingQueue + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNowPlayingQueue() { + return nowPlayingQueue; + } + + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNowPlayingQueue(@org.eclipse.jdt.annotation.NonNull List nowPlayingQueue) { + this.nowPlayingQueue = nowPlayingQueue; + } + + /** + * Return true if this PlaybackStopInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaybackStopInfo playbackStopInfo = (PlaybackStopInfo) o; + return Objects.equals(this.item, playbackStopInfo.item) && Objects.equals(this.itemId, playbackStopInfo.itemId) + && Objects.equals(this.sessionId, playbackStopInfo.sessionId) + && Objects.equals(this.mediaSourceId, playbackStopInfo.mediaSourceId) + && Objects.equals(this.positionTicks, playbackStopInfo.positionTicks) + && Objects.equals(this.liveStreamId, playbackStopInfo.liveStreamId) + && Objects.equals(this.playSessionId, playbackStopInfo.playSessionId) + && Objects.equals(this.failed, playbackStopInfo.failed) + && Objects.equals(this.nextMediaType, playbackStopInfo.nextMediaType) + && Objects.equals(this.playlistItemId, playbackStopInfo.playlistItemId) + && Objects.equals(this.nowPlayingQueue, playbackStopInfo.nowPlayingQueue); + } + + @Override + public int hashCode() { + return Objects.hash(item, itemId, sessionId, mediaSourceId, positionTicks, liveStreamId, playSessionId, failed, + nextMediaType, playlistItemId, nowPlayingQueue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaybackStopInfo {\n"); + sb.append(" item: ").append(toIndentedString(item)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" sessionId: ").append(toIndentedString(sessionId)).append("\n"); + sb.append(" mediaSourceId: ").append(toIndentedString(mediaSourceId)).append("\n"); + sb.append(" positionTicks: ").append(toIndentedString(positionTicks)).append("\n"); + sb.append(" liveStreamId: ").append(toIndentedString(liveStreamId)).append("\n"); + sb.append(" playSessionId: ").append(toIndentedString(playSessionId)).append("\n"); + sb.append(" failed: ").append(toIndentedString(failed)).append("\n"); + sb.append(" nextMediaType: ").append(toIndentedString(nextMediaType)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append(" nowPlayingQueue: ").append(toIndentedString(nowPlayingQueue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Item` to the URL query string + if (getItem() != null) { + joiner.add(getItem().toUrlQueryString(prefix + "Item" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SessionId` to the URL query string + if (getSessionId() != null) { + joiner.add(String.format("%sSessionId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSessionId())))); + } + + // add `MediaSourceId` to the URL query string + if (getMediaSourceId() != null) { + joiner.add(String.format("%sMediaSourceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaSourceId())))); + } + + // add `PositionTicks` to the URL query string + if (getPositionTicks() != null) { + joiner.add(String.format("%sPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPositionTicks())))); + } + + // add `LiveStreamId` to the URL query string + if (getLiveStreamId() != null) { + joiner.add(String.format("%sLiveStreamId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLiveStreamId())))); + } + + // add `PlaySessionId` to the URL query string + if (getPlaySessionId() != null) { + joiner.add(String.format("%sPlaySessionId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaySessionId())))); + } + + // add `Failed` to the URL query string + if (getFailed() != null) { + joiner.add(String.format("%sFailed%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFailed())))); + } + + // add `NextMediaType` to the URL query string + if (getNextMediaType() != null) { + joiner.add(String.format("%sNextMediaType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getNextMediaType())))); + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + // add `NowPlayingQueue` to the URL query string + if (getNowPlayingQueue() != null) { + for (int i = 0; i < getNowPlayingQueue().size(); i++) { + if (getNowPlayingQueue().get(i) != null) { + joiner.add(getNowPlayingQueue().get(i).toUrlQueryString(String.format("%sNowPlayingQueue%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaybackStopInfo instance; + + public Builder() { + this(new PlaybackStopInfo()); + } + + protected Builder(PlaybackStopInfo instance) { + this.instance = instance; + } + + public PlaybackStopInfo.Builder item(BaseItemDto item) { + this.instance.item = item; + return this; + } + + public PlaybackStopInfo.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public PlaybackStopInfo.Builder sessionId(String sessionId) { + this.instance.sessionId = sessionId; + return this; + } + + public PlaybackStopInfo.Builder mediaSourceId(String mediaSourceId) { + this.instance.mediaSourceId = mediaSourceId; + return this; + } + + public PlaybackStopInfo.Builder positionTicks(Long positionTicks) { + this.instance.positionTicks = positionTicks; + return this; + } + + public PlaybackStopInfo.Builder liveStreamId(String liveStreamId) { + this.instance.liveStreamId = liveStreamId; + return this; + } + + public PlaybackStopInfo.Builder playSessionId(String playSessionId) { + this.instance.playSessionId = playSessionId; + return this; + } + + public PlaybackStopInfo.Builder failed(Boolean failed) { + this.instance.failed = failed; + return this; + } + + public PlaybackStopInfo.Builder nextMediaType(String nextMediaType) { + this.instance.nextMediaType = nextMediaType; + return this; + } + + public PlaybackStopInfo.Builder playlistItemId(String playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + public PlaybackStopInfo.Builder nowPlayingQueue(List nowPlayingQueue) { + this.instance.nowPlayingQueue = nowPlayingQueue; + return this; + } + + /** + * returns a built PlaybackStopInfo instance. + * + * The builder is not reusable. + */ + public PlaybackStopInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaybackStopInfo.Builder builder() { + return new PlaybackStopInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaybackStopInfo.Builder toBuilder() { + return new PlaybackStopInfo.Builder().item(getItem()).itemId(getItemId()).sessionId(getSessionId()) + .mediaSourceId(getMediaSourceId()).positionTicks(getPositionTicks()).liveStreamId(getLiveStreamId()) + .playSessionId(getPlaySessionId()).failed(getFailed()).nextMediaType(getNextMediaType()) + .playlistItemId(getPlaylistItemId()).nowPlayingQueue(getNowPlayingQueue()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayerStateInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayerStateInfo.java new file mode 100644 index 0000000000000..f896af7e8fa47 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlayerStateInfo.java @@ -0,0 +1,602 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * PlayerStateInfo + */ +@JsonPropertyOrder({ PlayerStateInfo.JSON_PROPERTY_POSITION_TICKS, PlayerStateInfo.JSON_PROPERTY_CAN_SEEK, + PlayerStateInfo.JSON_PROPERTY_IS_PAUSED, PlayerStateInfo.JSON_PROPERTY_IS_MUTED, + PlayerStateInfo.JSON_PROPERTY_VOLUME_LEVEL, PlayerStateInfo.JSON_PROPERTY_AUDIO_STREAM_INDEX, + PlayerStateInfo.JSON_PROPERTY_SUBTITLE_STREAM_INDEX, PlayerStateInfo.JSON_PROPERTY_MEDIA_SOURCE_ID, + PlayerStateInfo.JSON_PROPERTY_PLAY_METHOD, PlayerStateInfo.JSON_PROPERTY_REPEAT_MODE, + PlayerStateInfo.JSON_PROPERTY_LIVE_STREAM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlayerStateInfo { + public static final String JSON_PROPERTY_POSITION_TICKS = "PositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long positionTicks; + + public static final String JSON_PROPERTY_CAN_SEEK = "CanSeek"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canSeek; + + public static final String JSON_PROPERTY_IS_PAUSED = "IsPaused"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPaused; + + public static final String JSON_PROPERTY_IS_MUTED = "IsMuted"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isMuted; + + public static final String JSON_PROPERTY_VOLUME_LEVEL = "VolumeLevel"; + @org.eclipse.jdt.annotation.NonNull + private Integer volumeLevel; + + public static final String JSON_PROPERTY_AUDIO_STREAM_INDEX = "AudioStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer audioStreamIndex; + + public static final String JSON_PROPERTY_SUBTITLE_STREAM_INDEX = "SubtitleStreamIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer subtitleStreamIndex; + + public static final String JSON_PROPERTY_MEDIA_SOURCE_ID = "MediaSourceId"; + @org.eclipse.jdt.annotation.NonNull + private String mediaSourceId; + + public static final String JSON_PROPERTY_PLAY_METHOD = "PlayMethod"; + @org.eclipse.jdt.annotation.NonNull + private PlayMethod playMethod; + + public static final String JSON_PROPERTY_REPEAT_MODE = "RepeatMode"; + @org.eclipse.jdt.annotation.NonNull + private RepeatMode repeatMode; + + public static final String JSON_PROPERTY_LIVE_STREAM_ID = "LiveStreamId"; + @org.eclipse.jdt.annotation.NonNull + private String liveStreamId; + + public PlayerStateInfo() { + } + + public PlayerStateInfo positionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + return this; + } + + /** + * Gets or sets the now playing position ticks. + * + * @return positionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPositionTicks() { + return positionTicks; + } + + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPositionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + } + + public PlayerStateInfo canSeek(@org.eclipse.jdt.annotation.NonNull Boolean canSeek) { + this.canSeek = canSeek; + return this; + } + + /** + * Gets or sets a value indicating whether this instance can seek. + * + * @return canSeek + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_SEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanSeek() { + return canSeek; + } + + @JsonProperty(JSON_PROPERTY_CAN_SEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanSeek(@org.eclipse.jdt.annotation.NonNull Boolean canSeek) { + this.canSeek = canSeek; + } + + public PlayerStateInfo isPaused(@org.eclipse.jdt.annotation.NonNull Boolean isPaused) { + this.isPaused = isPaused; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is paused. + * + * @return isPaused + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PAUSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPaused() { + return isPaused; + } + + @JsonProperty(JSON_PROPERTY_IS_PAUSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPaused(@org.eclipse.jdt.annotation.NonNull Boolean isPaused) { + this.isPaused = isPaused; + } + + public PlayerStateInfo isMuted(@org.eclipse.jdt.annotation.NonNull Boolean isMuted) { + this.isMuted = isMuted; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is muted. + * + * @return isMuted + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_MUTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsMuted() { + return isMuted; + } + + @JsonProperty(JSON_PROPERTY_IS_MUTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMuted(@org.eclipse.jdt.annotation.NonNull Boolean isMuted) { + this.isMuted = isMuted; + } + + public PlayerStateInfo volumeLevel(@org.eclipse.jdt.annotation.NonNull Integer volumeLevel) { + this.volumeLevel = volumeLevel; + return this; + } + + /** + * Gets or sets the volume level. + * + * @return volumeLevel + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VOLUME_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getVolumeLevel() { + return volumeLevel; + } + + @JsonProperty(JSON_PROPERTY_VOLUME_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVolumeLevel(@org.eclipse.jdt.annotation.NonNull Integer volumeLevel) { + this.volumeLevel = volumeLevel; + } + + public PlayerStateInfo audioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + return this; + } + + /** + * Gets or sets the index of the now playing audio stream. + * + * @return audioStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAudioStreamIndex() { + return audioStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer audioStreamIndex) { + this.audioStreamIndex = audioStreamIndex; + } + + public PlayerStateInfo subtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + /** + * Gets or sets the index of the now playing subtitle stream. + * + * @return subtitleStreamIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSubtitleStreamIndex() { + return subtitleStreamIndex; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_STREAM_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleStreamIndex(@org.eclipse.jdt.annotation.NonNull Integer subtitleStreamIndex) { + this.subtitleStreamIndex = subtitleStreamIndex; + } + + public PlayerStateInfo mediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + return this; + } + + /** + * Gets or sets the now playing media version identifier. + * + * @return mediaSourceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMediaSourceId() { + return mediaSourceId; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaSourceId(@org.eclipse.jdt.annotation.NonNull String mediaSourceId) { + this.mediaSourceId = mediaSourceId; + } + + public PlayerStateInfo playMethod(@org.eclipse.jdt.annotation.NonNull PlayMethod playMethod) { + this.playMethod = playMethod; + return this; + } + + /** + * Gets or sets the play method. + * + * @return playMethod + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlayMethod getPlayMethod() { + return playMethod; + } + + @JsonProperty(JSON_PROPERTY_PLAY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayMethod(@org.eclipse.jdt.annotation.NonNull PlayMethod playMethod) { + this.playMethod = playMethod; + } + + public PlayerStateInfo repeatMode(@org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode) { + this.repeatMode = repeatMode; + return this; + } + + /** + * Gets or sets the repeat mode. + * + * @return repeatMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REPEAT_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RepeatMode getRepeatMode() { + return repeatMode; + } + + @JsonProperty(JSON_PROPERTY_REPEAT_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepeatMode(@org.eclipse.jdt.annotation.NonNull RepeatMode repeatMode) { + this.repeatMode = repeatMode; + } + + public PlayerStateInfo liveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + return this; + } + + /** + * Gets or sets the now playing live stream identifier. + * + * @return liveStreamId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLiveStreamId() { + return liveStreamId; + } + + @JsonProperty(JSON_PROPERTY_LIVE_STREAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLiveStreamId(@org.eclipse.jdt.annotation.NonNull String liveStreamId) { + this.liveStreamId = liveStreamId; + } + + /** + * Return true if this PlayerStateInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlayerStateInfo playerStateInfo = (PlayerStateInfo) o; + return Objects.equals(this.positionTicks, playerStateInfo.positionTicks) + && Objects.equals(this.canSeek, playerStateInfo.canSeek) + && Objects.equals(this.isPaused, playerStateInfo.isPaused) + && Objects.equals(this.isMuted, playerStateInfo.isMuted) + && Objects.equals(this.volumeLevel, playerStateInfo.volumeLevel) + && Objects.equals(this.audioStreamIndex, playerStateInfo.audioStreamIndex) + && Objects.equals(this.subtitleStreamIndex, playerStateInfo.subtitleStreamIndex) + && Objects.equals(this.mediaSourceId, playerStateInfo.mediaSourceId) + && Objects.equals(this.playMethod, playerStateInfo.playMethod) + && Objects.equals(this.repeatMode, playerStateInfo.repeatMode) + && Objects.equals(this.liveStreamId, playerStateInfo.liveStreamId); + } + + @Override + public int hashCode() { + return Objects.hash(positionTicks, canSeek, isPaused, isMuted, volumeLevel, audioStreamIndex, + subtitleStreamIndex, mediaSourceId, playMethod, repeatMode, liveStreamId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlayerStateInfo {\n"); + sb.append(" positionTicks: ").append(toIndentedString(positionTicks)).append("\n"); + sb.append(" canSeek: ").append(toIndentedString(canSeek)).append("\n"); + sb.append(" isPaused: ").append(toIndentedString(isPaused)).append("\n"); + sb.append(" isMuted: ").append(toIndentedString(isMuted)).append("\n"); + sb.append(" volumeLevel: ").append(toIndentedString(volumeLevel)).append("\n"); + sb.append(" audioStreamIndex: ").append(toIndentedString(audioStreamIndex)).append("\n"); + sb.append(" subtitleStreamIndex: ").append(toIndentedString(subtitleStreamIndex)).append("\n"); + sb.append(" mediaSourceId: ").append(toIndentedString(mediaSourceId)).append("\n"); + sb.append(" playMethod: ").append(toIndentedString(playMethod)).append("\n"); + sb.append(" repeatMode: ").append(toIndentedString(repeatMode)).append("\n"); + sb.append(" liveStreamId: ").append(toIndentedString(liveStreamId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PositionTicks` to the URL query string + if (getPositionTicks() != null) { + joiner.add(String.format("%sPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPositionTicks())))); + } + + // add `CanSeek` to the URL query string + if (getCanSeek() != null) { + joiner.add(String.format("%sCanSeek%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanSeek())))); + } + + // add `IsPaused` to the URL query string + if (getIsPaused() != null) { + joiner.add(String.format("%sIsPaused%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPaused())))); + } + + // add `IsMuted` to the URL query string + if (getIsMuted() != null) { + joiner.add(String.format("%sIsMuted%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsMuted())))); + } + + // add `VolumeLevel` to the URL query string + if (getVolumeLevel() != null) { + joiner.add(String.format("%sVolumeLevel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVolumeLevel())))); + } + + // add `AudioStreamIndex` to the URL query string + if (getAudioStreamIndex() != null) { + joiner.add(String.format("%sAudioStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioStreamIndex())))); + } + + // add `SubtitleStreamIndex` to the URL query string + if (getSubtitleStreamIndex() != null) { + joiner.add(String.format("%sSubtitleStreamIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleStreamIndex())))); + } + + // add `MediaSourceId` to the URL query string + if (getMediaSourceId() != null) { + joiner.add(String.format("%sMediaSourceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaSourceId())))); + } + + // add `PlayMethod` to the URL query string + if (getPlayMethod() != null) { + joiner.add(String.format("%sPlayMethod%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayMethod())))); + } + + // add `RepeatMode` to the URL query string + if (getRepeatMode() != null) { + joiner.add(String.format("%sRepeatMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRepeatMode())))); + } + + // add `LiveStreamId` to the URL query string + if (getLiveStreamId() != null) { + joiner.add(String.format("%sLiveStreamId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLiveStreamId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlayerStateInfo instance; + + public Builder() { + this(new PlayerStateInfo()); + } + + protected Builder(PlayerStateInfo instance) { + this.instance = instance; + } + + public PlayerStateInfo.Builder positionTicks(Long positionTicks) { + this.instance.positionTicks = positionTicks; + return this; + } + + public PlayerStateInfo.Builder canSeek(Boolean canSeek) { + this.instance.canSeek = canSeek; + return this; + } + + public PlayerStateInfo.Builder isPaused(Boolean isPaused) { + this.instance.isPaused = isPaused; + return this; + } + + public PlayerStateInfo.Builder isMuted(Boolean isMuted) { + this.instance.isMuted = isMuted; + return this; + } + + public PlayerStateInfo.Builder volumeLevel(Integer volumeLevel) { + this.instance.volumeLevel = volumeLevel; + return this; + } + + public PlayerStateInfo.Builder audioStreamIndex(Integer audioStreamIndex) { + this.instance.audioStreamIndex = audioStreamIndex; + return this; + } + + public PlayerStateInfo.Builder subtitleStreamIndex(Integer subtitleStreamIndex) { + this.instance.subtitleStreamIndex = subtitleStreamIndex; + return this; + } + + public PlayerStateInfo.Builder mediaSourceId(String mediaSourceId) { + this.instance.mediaSourceId = mediaSourceId; + return this; + } + + public PlayerStateInfo.Builder playMethod(PlayMethod playMethod) { + this.instance.playMethod = playMethod; + return this; + } + + public PlayerStateInfo.Builder repeatMode(RepeatMode repeatMode) { + this.instance.repeatMode = repeatMode; + return this; + } + + public PlayerStateInfo.Builder liveStreamId(String liveStreamId) { + this.instance.liveStreamId = liveStreamId; + return this; + } + + /** + * returns a built PlayerStateInfo instance. + * + * The builder is not reusable. + */ + public PlayerStateInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlayerStateInfo.Builder builder() { + return new PlayerStateInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlayerStateInfo.Builder toBuilder() { + return new PlayerStateInfo.Builder().positionTicks(getPositionTicks()).canSeek(getCanSeek()) + .isPaused(getIsPaused()).isMuted(getIsMuted()).volumeLevel(getVolumeLevel()) + .audioStreamIndex(getAudioStreamIndex()).subtitleStreamIndex(getSubtitleStreamIndex()) + .mediaSourceId(getMediaSourceId()).playMethod(getPlayMethod()).repeatMode(getRepeatMode()) + .liveStreamId(getLiveStreamId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaylistCreationResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaylistCreationResult.java new file mode 100644 index 0000000000000..034af3c3e3dd4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaylistCreationResult.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * PlaylistCreationResult + */ +@JsonPropertyOrder({ PlaylistCreationResult.JSON_PROPERTY_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaylistCreationResult { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public PlaylistCreationResult() { + } + + public PlaylistCreationResult id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + /** + * Return true if this PlaylistCreationResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaylistCreationResult playlistCreationResult = (PlaylistCreationResult) o; + return Objects.equals(this.id, playlistCreationResult.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaylistCreationResult {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaylistCreationResult instance; + + public Builder() { + this(new PlaylistCreationResult()); + } + + protected Builder(PlaylistCreationResult instance) { + this.instance = instance; + } + + public PlaylistCreationResult.Builder id(String id) { + this.instance.id = id; + return this; + } + + /** + * returns a built PlaylistCreationResult instance. + * + * The builder is not reusable. + */ + public PlaylistCreationResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaylistCreationResult.Builder builder() { + return new PlaylistCreationResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaylistCreationResult.Builder toBuilder() { + return new PlaylistCreationResult.Builder().id(getId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaystateCommand.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaystateCommand.java new file mode 100644 index 0000000000000..2f0ef6556c414 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaystateCommand.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum PlaystateCommand. + */ +public enum PlaystateCommand { + + STOP("Stop"), + + PAUSE("Pause"), + + UNPAUSE("Unpause"), + + NEXT_TRACK("NextTrack"), + + PREVIOUS_TRACK("PreviousTrack"), + + SEEK("Seek"), + + REWIND("Rewind"), + + FAST_FORWARD("FastForward"), + + PLAY_PAUSE("PlayPause"); + + private String value; + + PlaystateCommand(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PlaystateCommand fromValue(String value) { + for (PlaystateCommand b : PlaystateCommand.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaystateRequest.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaystateRequest.java new file mode 100644 index 0000000000000..98084e0376575 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PlaystateRequest.java @@ -0,0 +1,274 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * PlaystateRequest + */ +@JsonPropertyOrder({ PlaystateRequest.JSON_PROPERTY_COMMAND, PlaystateRequest.JSON_PROPERTY_SEEK_POSITION_TICKS, + PlaystateRequest.JSON_PROPERTY_CONTROLLING_USER_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PlaystateRequest { + public static final String JSON_PROPERTY_COMMAND = "Command"; + @org.eclipse.jdt.annotation.NonNull + private PlaystateCommand command; + + public static final String JSON_PROPERTY_SEEK_POSITION_TICKS = "SeekPositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long seekPositionTicks; + + public static final String JSON_PROPERTY_CONTROLLING_USER_ID = "ControllingUserId"; + @org.eclipse.jdt.annotation.NonNull + private String controllingUserId; + + public PlaystateRequest() { + } + + public PlaystateRequest command(@org.eclipse.jdt.annotation.NonNull PlaystateCommand command) { + this.command = command; + return this; + } + + /** + * Enum PlaystateCommand. + * + * @return command + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlaystateCommand getCommand() { + return command; + } + + @JsonProperty(JSON_PROPERTY_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCommand(@org.eclipse.jdt.annotation.NonNull PlaystateCommand command) { + this.command = command; + } + + public PlaystateRequest seekPositionTicks(@org.eclipse.jdt.annotation.NonNull Long seekPositionTicks) { + this.seekPositionTicks = seekPositionTicks; + return this; + } + + /** + * Get seekPositionTicks + * + * @return seekPositionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEEK_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSeekPositionTicks() { + return seekPositionTicks; + } + + @JsonProperty(JSON_PROPERTY_SEEK_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeekPositionTicks(@org.eclipse.jdt.annotation.NonNull Long seekPositionTicks) { + this.seekPositionTicks = seekPositionTicks; + } + + public PlaystateRequest controllingUserId(@org.eclipse.jdt.annotation.NonNull String controllingUserId) { + this.controllingUserId = controllingUserId; + return this; + } + + /** + * Gets or sets the controlling user identifier. + * + * @return controllingUserId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTROLLING_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getControllingUserId() { + return controllingUserId; + } + + @JsonProperty(JSON_PROPERTY_CONTROLLING_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setControllingUserId(@org.eclipse.jdt.annotation.NonNull String controllingUserId) { + this.controllingUserId = controllingUserId; + } + + /** + * Return true if this PlaystateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaystateRequest playstateRequest = (PlaystateRequest) o; + return Objects.equals(this.command, playstateRequest.command) + && Objects.equals(this.seekPositionTicks, playstateRequest.seekPositionTicks) + && Objects.equals(this.controllingUserId, playstateRequest.controllingUserId); + } + + @Override + public int hashCode() { + return Objects.hash(command, seekPositionTicks, controllingUserId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaystateRequest {\n"); + sb.append(" command: ").append(toIndentedString(command)).append("\n"); + sb.append(" seekPositionTicks: ").append(toIndentedString(seekPositionTicks)).append("\n"); + sb.append(" controllingUserId: ").append(toIndentedString(controllingUserId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Command` to the URL query string + if (getCommand() != null) { + joiner.add(String.format("%sCommand%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCommand())))); + } + + // add `SeekPositionTicks` to the URL query string + if (getSeekPositionTicks() != null) { + joiner.add(String.format("%sSeekPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeekPositionTicks())))); + } + + // add `ControllingUserId` to the URL query string + if (getControllingUserId() != null) { + joiner.add(String.format("%sControllingUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getControllingUserId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PlaystateRequest instance; + + public Builder() { + this(new PlaystateRequest()); + } + + protected Builder(PlaystateRequest instance) { + this.instance = instance; + } + + public PlaystateRequest.Builder command(PlaystateCommand command) { + this.instance.command = command; + return this; + } + + public PlaystateRequest.Builder seekPositionTicks(Long seekPositionTicks) { + this.instance.seekPositionTicks = seekPositionTicks; + return this; + } + + public PlaystateRequest.Builder controllingUserId(String controllingUserId) { + this.instance.controllingUserId = controllingUserId; + return this; + } + + /** + * returns a built PlaystateRequest instance. + * + * The builder is not reusable. + */ + public PlaystateRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PlaystateRequest.Builder builder() { + return new PlaystateRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PlaystateRequest.Builder toBuilder() { + return new PlaystateRequest.Builder().command(getCommand()).seekPositionTicks(getSeekPositionTicks()) + .controllingUserId(getControllingUserId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PluginInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PluginInfo.java new file mode 100644 index 0000000000000..98717578b2c61 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PluginInfo.java @@ -0,0 +1,475 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * This is a serializable stub class that is used by the api to provide information about installed plugins. + */ +@JsonPropertyOrder({ PluginInfo.JSON_PROPERTY_NAME, PluginInfo.JSON_PROPERTY_VERSION, + PluginInfo.JSON_PROPERTY_CONFIGURATION_FILE_NAME, PluginInfo.JSON_PROPERTY_DESCRIPTION, + PluginInfo.JSON_PROPERTY_ID, PluginInfo.JSON_PROPERTY_CAN_UNINSTALL, PluginInfo.JSON_PROPERTY_HAS_IMAGE, + PluginInfo.JSON_PROPERTY_STATUS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PluginInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_VERSION = "Version"; + @org.eclipse.jdt.annotation.NonNull + private String version; + + public static final String JSON_PROPERTY_CONFIGURATION_FILE_NAME = "ConfigurationFileName"; + @org.eclipse.jdt.annotation.NonNull + private String configurationFileName; + + public static final String JSON_PROPERTY_DESCRIPTION = "Description"; + @org.eclipse.jdt.annotation.NonNull + private String description; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_CAN_UNINSTALL = "CanUninstall"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canUninstall; + + public static final String JSON_PROPERTY_HAS_IMAGE = "HasImage"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasImage; + + public static final String JSON_PROPERTY_STATUS = "Status"; + @org.eclipse.jdt.annotation.NonNull + private PluginStatus status; + + public PluginInfo() { + } + + public PluginInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public PluginInfo version(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + return this; + } + + /** + * Gets or sets the version. + * + * @return version + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + } + + public PluginInfo configurationFileName(@org.eclipse.jdt.annotation.NonNull String configurationFileName) { + this.configurationFileName = configurationFileName; + return this; + } + + /** + * Gets or sets the name of the configuration file. + * + * @return configurationFileName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONFIGURATION_FILE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getConfigurationFileName() { + return configurationFileName; + } + + @JsonProperty(JSON_PROPERTY_CONFIGURATION_FILE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfigurationFileName(@org.eclipse.jdt.annotation.NonNull String configurationFileName) { + this.configurationFileName = configurationFileName; + } + + public PluginInfo description(@org.eclipse.jdt.annotation.NonNull String description) { + this.description = description; + return this; + } + + /** + * Gets or sets the description. + * + * @return description + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@org.eclipse.jdt.annotation.NonNull String description) { + this.description = description; + } + + public PluginInfo id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Gets or sets the unique id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public PluginInfo canUninstall(@org.eclipse.jdt.annotation.NonNull Boolean canUninstall) { + this.canUninstall = canUninstall; + return this; + } + + /** + * Gets or sets a value indicating whether the plugin can be uninstalled. + * + * @return canUninstall + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_UNINSTALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanUninstall() { + return canUninstall; + } + + @JsonProperty(JSON_PROPERTY_CAN_UNINSTALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanUninstall(@org.eclipse.jdt.annotation.NonNull Boolean canUninstall) { + this.canUninstall = canUninstall; + } + + public PluginInfo hasImage(@org.eclipse.jdt.annotation.NonNull Boolean hasImage) { + this.hasImage = hasImage; + return this; + } + + /** + * Gets or sets a value indicating whether this plugin has a valid image. + * + * @return hasImage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_IMAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasImage() { + return hasImage; + } + + @JsonProperty(JSON_PROPERTY_HAS_IMAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasImage(@org.eclipse.jdt.annotation.NonNull Boolean hasImage) { + this.hasImage = hasImage; + } + + public PluginInfo status(@org.eclipse.jdt.annotation.NonNull PluginStatus status) { + this.status = status; + return this; + } + + /** + * Gets or sets a value indicating the status of the plugin. + * + * @return status + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PluginStatus getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@org.eclipse.jdt.annotation.NonNull PluginStatus status) { + this.status = status; + } + + /** + * Return true if this PluginInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PluginInfo pluginInfo = (PluginInfo) o; + return Objects.equals(this.name, pluginInfo.name) && Objects.equals(this.version, pluginInfo.version) + && Objects.equals(this.configurationFileName, pluginInfo.configurationFileName) + && Objects.equals(this.description, pluginInfo.description) && Objects.equals(this.id, pluginInfo.id) + && Objects.equals(this.canUninstall, pluginInfo.canUninstall) + && Objects.equals(this.hasImage, pluginInfo.hasImage) && Objects.equals(this.status, pluginInfo.status); + } + + @Override + public int hashCode() { + return Objects.hash(name, version, configurationFileName, description, id, canUninstall, hasImage, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PluginInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" configurationFileName: ").append(toIndentedString(configurationFileName)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" canUninstall: ").append(toIndentedString(canUninstall)).append("\n"); + sb.append(" hasImage: ").append(toIndentedString(hasImage)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format("%sVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `ConfigurationFileName` to the URL query string + if (getConfigurationFileName() != null) { + joiner.add(String.format("%sConfigurationFileName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getConfigurationFileName())))); + } + + // add `Description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sDescription%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `CanUninstall` to the URL query string + if (getCanUninstall() != null) { + joiner.add(String.format("%sCanUninstall%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanUninstall())))); + } + + // add `HasImage` to the URL query string + if (getHasImage() != null) { + joiner.add(String.format("%sHasImage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasImage())))); + } + + // add `Status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sStatus%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PluginInfo instance; + + public Builder() { + this(new PluginInfo()); + } + + protected Builder(PluginInfo instance) { + this.instance = instance; + } + + public PluginInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public PluginInfo.Builder version(String version) { + this.instance.version = version; + return this; + } + + public PluginInfo.Builder configurationFileName(String configurationFileName) { + this.instance.configurationFileName = configurationFileName; + return this; + } + + public PluginInfo.Builder description(String description) { + this.instance.description = description; + return this; + } + + public PluginInfo.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public PluginInfo.Builder canUninstall(Boolean canUninstall) { + this.instance.canUninstall = canUninstall; + return this; + } + + public PluginInfo.Builder hasImage(Boolean hasImage) { + this.instance.hasImage = hasImage; + return this; + } + + public PluginInfo.Builder status(PluginStatus status) { + this.instance.status = status; + return this; + } + + /** + * returns a built PluginInfo instance. + * + * The builder is not reusable. + */ + public PluginInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PluginInfo.Builder builder() { + return new PluginInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PluginInfo.Builder toBuilder() { + return new PluginInfo.Builder().name(getName()).version(getVersion()) + .configurationFileName(getConfigurationFileName()).description(getDescription()).id(getId()) + .canUninstall(getCanUninstall()).hasImage(getHasImage()).status(getStatus()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PluginStatus.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PluginStatus.java new file mode 100644 index 0000000000000..ecc03a2e7bc3e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PluginStatus.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Plugin load status. + */ +public enum PluginStatus { + + ACTIVE("Active"), + + RESTART("Restart"), + + DELETED("Deleted"), + + SUPERCEDED("Superceded"), + + MALFUNCTIONED("Malfunctioned"), + + NOT_SUPPORTED("NotSupported"), + + DISABLED("Disabled"); + + private String value; + + PluginStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PluginStatus fromValue(String value) { + for (PluginStatus b : PluginStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PreviousItemRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PreviousItemRequestDto.java new file mode 100644 index 0000000000000..dd1720d3a4a78 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PreviousItemRequestDto.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class PreviousItemRequestDto. + */ +@JsonPropertyOrder({ PreviousItemRequestDto.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PreviousItemRequestDto { + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID playlistItemId; + + public PreviousItemRequestDto() { + } + + public PreviousItemRequestDto playlistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets or sets the playing item identifier. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + } + + /** + * Return true if this PreviousItemRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PreviousItemRequestDto previousItemRequestDto = (PreviousItemRequestDto) o; + return Objects.equals(this.playlistItemId, previousItemRequestDto.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PreviousItemRequestDto {\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PreviousItemRequestDto instance; + + public Builder() { + this(new PreviousItemRequestDto()); + } + + protected Builder(PreviousItemRequestDto instance) { + this.instance = instance; + } + + public PreviousItemRequestDto.Builder playlistItemId(UUID playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built PreviousItemRequestDto instance. + * + * The builder is not reusable. + */ + public PreviousItemRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PreviousItemRequestDto.Builder builder() { + return new PreviousItemRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PreviousItemRequestDto.Builder toBuilder() { + return new PreviousItemRequestDto.Builder().playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProblemDetails.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProblemDetails.java new file mode 100644 index 0000000000000..7078e17cc0937 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProblemDetails.java @@ -0,0 +1,407 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ProblemDetails + */ +@JsonPropertyOrder({ ProblemDetails.JSON_PROPERTY_TYPE, ProblemDetails.JSON_PROPERTY_TITLE, + ProblemDetails.JSON_PROPERTY_STATUS, ProblemDetails.JSON_PROPERTY_DETAIL, + ProblemDetails.JSON_PROPERTY_INSTANCE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ProblemDetails { + public static final String JSON_PROPERTY_TYPE = "type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_TITLE = "title"; + @org.eclipse.jdt.annotation.NonNull + private String title; + + public static final String JSON_PROPERTY_STATUS = "status"; + @org.eclipse.jdt.annotation.NonNull + private Integer status; + + public static final String JSON_PROPERTY_DETAIL = "detail"; + @org.eclipse.jdt.annotation.NonNull + private String detail; + + public static final String JSON_PROPERTY_INSTANCE = "instance"; + @org.eclipse.jdt.annotation.NonNull + private String instance; + + public ProblemDetails() { + } + + public ProblemDetails type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public ProblemDetails title(@org.eclipse.jdt.annotation.NonNull String title) { + this.title = title; + return this; + } + + /** + * Get title + * + * @return title + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@org.eclipse.jdt.annotation.NonNull String title) { + this.title = title; + } + + public ProblemDetails status(@org.eclipse.jdt.annotation.NonNull Integer status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@org.eclipse.jdt.annotation.NonNull Integer status) { + this.status = status; + } + + public ProblemDetails detail(@org.eclipse.jdt.annotation.NonNull String detail) { + this.detail = detail; + return this; + } + + /** + * Get detail + * + * @return detail + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDetail() { + return detail; + } + + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDetail(@org.eclipse.jdt.annotation.NonNull String detail) { + this.detail = detail; + } + + public ProblemDetails instance(@org.eclipse.jdt.annotation.NonNull String instance) { + this.instance = instance; + return this; + } + + /** + * Get instance + * + * @return instance + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INSTANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstance() { + return instance; + } + + @JsonProperty(JSON_PROPERTY_INSTANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstance(@org.eclipse.jdt.annotation.NonNull String instance) { + this.instance = instance; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public ProblemDetails putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this ProblemDetails object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProblemDetails problemDetails = (ProblemDetails) o; + return Objects.equals(this.type, problemDetails.type) && Objects.equals(this.title, problemDetails.title) + && Objects.equals(this.status, problemDetails.status) + && Objects.equals(this.detail, problemDetails.detail) + && Objects.equals(this.instance, problemDetails.instance) + && Objects.equals(this.additionalProperties, problemDetails.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, title, status, detail, instance, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProblemDetails {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%stype%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `title` to the URL query string + if (getTitle() != null) { + joiner.add(String.format("%stitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTitle())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `detail` to the URL query string + if (getDetail() != null) { + joiner.add(String.format("%sdetail%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDetail())))); + } + + // add `instance` to the URL query string + if (getInstance() != null) { + joiner.add(String.format("%sinstance%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getInstance())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ProblemDetails instance; + + public Builder() { + this(new ProblemDetails()); + } + + protected Builder(ProblemDetails instance) { + this.instance = instance; + } + + public ProblemDetails.Builder type(String type) { + this.instance.type = type; + return this; + } + + public ProblemDetails.Builder title(String title) { + this.instance.title = title; + return this; + } + + public ProblemDetails.Builder status(Integer status) { + this.instance.status = status; + return this; + } + + public ProblemDetails.Builder detail(String detail) { + this.instance.detail = detail; + return this; + } + + public ProblemDetails.Builder instance(String instance) { + this.instance.instance = instance; + return this; + } + + /** + * returns a built ProblemDetails instance. + * + * The builder is not reusable. + */ + public ProblemDetails build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ProblemDetails.Builder builder() { + return new ProblemDetails.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ProblemDetails.Builder toBuilder() { + return new ProblemDetails.Builder().type(getType()).title(getTitle()).status(getStatus()).detail(getDetail()) + .instance(getInstance()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProfileCondition.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProfileCondition.java new file mode 100644 index 0000000000000..f266349924ca6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProfileCondition.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ProfileCondition + */ +@JsonPropertyOrder({ ProfileCondition.JSON_PROPERTY_CONDITION, ProfileCondition.JSON_PROPERTY_PROPERTY, + ProfileCondition.JSON_PROPERTY_VALUE, ProfileCondition.JSON_PROPERTY_IS_REQUIRED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ProfileCondition { + public static final String JSON_PROPERTY_CONDITION = "Condition"; + @org.eclipse.jdt.annotation.NonNull + private ProfileConditionType condition; + + public static final String JSON_PROPERTY_PROPERTY = "Property"; + @org.eclipse.jdt.annotation.NonNull + private ProfileConditionValue property; + + public static final String JSON_PROPERTY_VALUE = "Value"; + @org.eclipse.jdt.annotation.NonNull + private String value; + + public static final String JSON_PROPERTY_IS_REQUIRED = "IsRequired"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isRequired; + + public ProfileCondition() { + } + + public ProfileCondition condition(@org.eclipse.jdt.annotation.NonNull ProfileConditionType condition) { + this.condition = condition; + return this; + } + + /** + * Get condition + * + * @return condition + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONDITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProfileConditionType getCondition() { + return condition; + } + + @JsonProperty(JSON_PROPERTY_CONDITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCondition(@org.eclipse.jdt.annotation.NonNull ProfileConditionType condition) { + this.condition = condition; + } + + public ProfileCondition property(@org.eclipse.jdt.annotation.NonNull ProfileConditionValue property) { + this.property = property; + return this; + } + + /** + * Get property + * + * @return property + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProfileConditionValue getProperty() { + return property; + } + + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperty(@org.eclipse.jdt.annotation.NonNull ProfileConditionValue property) { + this.property = property; + } + + public ProfileCondition value(@org.eclipse.jdt.annotation.NonNull String value) { + this.value = value; + return this; + } + + /** + * Get value + * + * @return value + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@org.eclipse.jdt.annotation.NonNull String value) { + this.value = value; + } + + public ProfileCondition isRequired(@org.eclipse.jdt.annotation.NonNull Boolean isRequired) { + this.isRequired = isRequired; + return this; + } + + /** + * Get isRequired + * + * @return isRequired + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsRequired() { + return isRequired; + } + + @JsonProperty(JSON_PROPERTY_IS_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsRequired(@org.eclipse.jdt.annotation.NonNull Boolean isRequired) { + this.isRequired = isRequired; + } + + /** + * Return true if this ProfileCondition object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileCondition profileCondition = (ProfileCondition) o; + return Objects.equals(this.condition, profileCondition.condition) + && Objects.equals(this.property, profileCondition.property) + && Objects.equals(this.value, profileCondition.value) + && Objects.equals(this.isRequired, profileCondition.isRequired); + } + + @Override + public int hashCode() { + return Objects.hash(condition, property, value, isRequired); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileCondition {\n"); + sb.append(" condition: ").append(toIndentedString(condition)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" isRequired: ").append(toIndentedString(isRequired)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Condition` to the URL query string + if (getCondition() != null) { + joiner.add(String.format("%sCondition%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCondition())))); + } + + // add `Property` to the URL query string + if (getProperty() != null) { + joiner.add(String.format("%sProperty%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProperty())))); + } + + // add `Value` to the URL query string + if (getValue() != null) { + joiner.add(String.format("%sValue%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getValue())))); + } + + // add `IsRequired` to the URL query string + if (getIsRequired() != null) { + joiner.add(String.format("%sIsRequired%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsRequired())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ProfileCondition instance; + + public Builder() { + this(new ProfileCondition()); + } + + protected Builder(ProfileCondition instance) { + this.instance = instance; + } + + public ProfileCondition.Builder condition(ProfileConditionType condition) { + this.instance.condition = condition; + return this; + } + + public ProfileCondition.Builder property(ProfileConditionValue property) { + this.instance.property = property; + return this; + } + + public ProfileCondition.Builder value(String value) { + this.instance.value = value; + return this; + } + + public ProfileCondition.Builder isRequired(Boolean isRequired) { + this.instance.isRequired = isRequired; + return this; + } + + /** + * returns a built ProfileCondition instance. + * + * The builder is not reusable. + */ + public ProfileCondition build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ProfileCondition.Builder builder() { + return new ProfileCondition.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ProfileCondition.Builder toBuilder() { + return new ProfileCondition.Builder().condition(getCondition()).property(getProperty()).value(getValue()) + .isRequired(getIsRequired()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProfileConditionType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProfileConditionType.java new file mode 100644 index 0000000000000..ad64d2975f67e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProfileConditionType.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ProfileConditionType + */ +public enum ProfileConditionType { + + EQUALS("Equals"), + + NOT_EQUALS("NotEquals"), + + LESS_THAN_EQUAL("LessThanEqual"), + + GREATER_THAN_EQUAL("GreaterThanEqual"), + + EQUALS_ANY("EqualsAny"); + + private String value; + + ProfileConditionType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ProfileConditionType fromValue(String value) { + for (ProfileConditionType b : ProfileConditionType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProfileConditionValue.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProfileConditionValue.java new file mode 100644 index 0000000000000..c22cddb807c76 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProfileConditionValue.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ProfileConditionValue + */ +public enum ProfileConditionValue { + + AUDIO_CHANNELS("AudioChannels"), + + AUDIO_BITRATE("AudioBitrate"), + + AUDIO_PROFILE("AudioProfile"), + + WIDTH("Width"), + + HEIGHT("Height"), + + HAS64_BIT_OFFSETS("Has64BitOffsets"), + + PACKET_LENGTH("PacketLength"), + + VIDEO_BIT_DEPTH("VideoBitDepth"), + + VIDEO_BITRATE("VideoBitrate"), + + VIDEO_FRAMERATE("VideoFramerate"), + + VIDEO_LEVEL("VideoLevel"), + + VIDEO_PROFILE("VideoProfile"), + + VIDEO_TIMESTAMP("VideoTimestamp"), + + IS_ANAMORPHIC("IsAnamorphic"), + + REF_FRAMES("RefFrames"), + + NUM_AUDIO_STREAMS("NumAudioStreams"), + + NUM_VIDEO_STREAMS("NumVideoStreams"), + + IS_SECONDARY_AUDIO("IsSecondaryAudio"), + + VIDEO_CODEC_TAG("VideoCodecTag"), + + IS_AVC("IsAvc"), + + IS_INTERLACED("IsInterlaced"), + + AUDIO_SAMPLE_RATE("AudioSampleRate"), + + AUDIO_BIT_DEPTH("AudioBitDepth"), + + VIDEO_RANGE_TYPE("VideoRangeType"); + + private String value; + + ProfileConditionValue(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ProfileConditionValue fromValue(String value) { + for (ProfileConditionValue b : ProfileConditionValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProgramAudio.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProgramAudio.java new file mode 100644 index 0000000000000..b27d7ec147638 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ProgramAudio.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ProgramAudio + */ +public enum ProgramAudio { + + MONO("Mono"), + + STEREO("Stereo"), + + DOLBY("Dolby"), + + DOLBY_DIGITAL("DolbyDigital"), + + THX("Thx"), + + ATMOS("Atmos"); + + private String value; + + ProgramAudio(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ProgramAudio fromValue(String value) { + for (ProgramAudio b : ProgramAudio.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PublicSystemInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PublicSystemInfo.java new file mode 100644 index 0000000000000..225669dc09b4f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/PublicSystemInfo.java @@ -0,0 +1,438 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * PublicSystemInfo + */ +@JsonPropertyOrder({ PublicSystemInfo.JSON_PROPERTY_LOCAL_ADDRESS, PublicSystemInfo.JSON_PROPERTY_SERVER_NAME, + PublicSystemInfo.JSON_PROPERTY_VERSION, PublicSystemInfo.JSON_PROPERTY_PRODUCT_NAME, + PublicSystemInfo.JSON_PROPERTY_OPERATING_SYSTEM, PublicSystemInfo.JSON_PROPERTY_ID, + PublicSystemInfo.JSON_PROPERTY_STARTUP_WIZARD_COMPLETED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class PublicSystemInfo { + public static final String JSON_PROPERTY_LOCAL_ADDRESS = "LocalAddress"; + @org.eclipse.jdt.annotation.NonNull + private String localAddress; + + public static final String JSON_PROPERTY_SERVER_NAME = "ServerName"; + @org.eclipse.jdt.annotation.NonNull + private String serverName; + + public static final String JSON_PROPERTY_VERSION = "Version"; + @org.eclipse.jdt.annotation.NonNull + private String version; + + public static final String JSON_PROPERTY_PRODUCT_NAME = "ProductName"; + @org.eclipse.jdt.annotation.NonNull + private String productName; + + public static final String JSON_PROPERTY_OPERATING_SYSTEM = "OperatingSystem"; + @org.eclipse.jdt.annotation.NonNull + private String operatingSystem; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_STARTUP_WIZARD_COMPLETED = "StartupWizardCompleted"; + @org.eclipse.jdt.annotation.NonNull + private Boolean startupWizardCompleted; + + public PublicSystemInfo() { + } + + public PublicSystemInfo localAddress(@org.eclipse.jdt.annotation.NonNull String localAddress) { + this.localAddress = localAddress; + return this; + } + + /** + * Gets or sets the local address. + * + * @return localAddress + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCAL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocalAddress() { + return localAddress; + } + + @JsonProperty(JSON_PROPERTY_LOCAL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalAddress(@org.eclipse.jdt.annotation.NonNull String localAddress) { + this.localAddress = localAddress; + } + + public PublicSystemInfo serverName(@org.eclipse.jdt.annotation.NonNull String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Gets or sets the name of the server. + * + * @return serverName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerName() { + return serverName; + } + + @JsonProperty(JSON_PROPERTY_SERVER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerName(@org.eclipse.jdt.annotation.NonNull String serverName) { + this.serverName = serverName; + } + + public PublicSystemInfo version(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + return this; + } + + /** + * Gets or sets the server version. + * + * @return version + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + } + + public PublicSystemInfo productName(@org.eclipse.jdt.annotation.NonNull String productName) { + this.productName = productName; + return this; + } + + /** + * Gets or sets the product name. This is the AssemblyProduct name. + * + * @return productName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRODUCT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProductName() { + return productName; + } + + @JsonProperty(JSON_PROPERTY_PRODUCT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProductName(@org.eclipse.jdt.annotation.NonNull String productName) { + this.productName = productName; + } + + public PublicSystemInfo operatingSystem(@org.eclipse.jdt.annotation.NonNull String operatingSystem) { + this.operatingSystem = operatingSystem; + return this; + } + + /** + * Gets or sets the operating system. + * + * @return operatingSystem + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OPERATING_SYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOperatingSystem() { + return operatingSystem; + } + + @JsonProperty(JSON_PROPERTY_OPERATING_SYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOperatingSystem(@org.eclipse.jdt.annotation.NonNull String operatingSystem) { + this.operatingSystem = operatingSystem; + } + + public PublicSystemInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public PublicSystemInfo startupWizardCompleted(@org.eclipse.jdt.annotation.NonNull Boolean startupWizardCompleted) { + this.startupWizardCompleted = startupWizardCompleted; + return this; + } + + /** + * Gets or sets a value indicating whether the startup wizard is completed. + * + * @return startupWizardCompleted + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STARTUP_WIZARD_COMPLETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStartupWizardCompleted() { + return startupWizardCompleted; + } + + @JsonProperty(JSON_PROPERTY_STARTUP_WIZARD_COMPLETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartupWizardCompleted(@org.eclipse.jdt.annotation.NonNull Boolean startupWizardCompleted) { + this.startupWizardCompleted = startupWizardCompleted; + } + + /** + * Return true if this PublicSystemInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicSystemInfo publicSystemInfo = (PublicSystemInfo) o; + return Objects.equals(this.localAddress, publicSystemInfo.localAddress) + && Objects.equals(this.serverName, publicSystemInfo.serverName) + && Objects.equals(this.version, publicSystemInfo.version) + && Objects.equals(this.productName, publicSystemInfo.productName) + && Objects.equals(this.operatingSystem, publicSystemInfo.operatingSystem) + && Objects.equals(this.id, publicSystemInfo.id) + && Objects.equals(this.startupWizardCompleted, publicSystemInfo.startupWizardCompleted); + } + + @Override + public int hashCode() { + return Objects.hash(localAddress, serverName, version, productName, operatingSystem, id, + startupWizardCompleted); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicSystemInfo {\n"); + sb.append(" localAddress: ").append(toIndentedString(localAddress)).append("\n"); + sb.append(" serverName: ").append(toIndentedString(serverName)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" productName: ").append(toIndentedString(productName)).append("\n"); + sb.append(" operatingSystem: ").append(toIndentedString(operatingSystem)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" startupWizardCompleted: ").append(toIndentedString(startupWizardCompleted)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `LocalAddress` to the URL query string + if (getLocalAddress() != null) { + joiner.add(String.format("%sLocalAddress%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocalAddress())))); + } + + // add `ServerName` to the URL query string + if (getServerName() != null) { + joiner.add(String.format("%sServerName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerName())))); + } + + // add `Version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format("%sVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `ProductName` to the URL query string + if (getProductName() != null) { + joiner.add(String.format("%sProductName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProductName())))); + } + + // add `OperatingSystem` to the URL query string + if (getOperatingSystem() != null) { + joiner.add(String.format("%sOperatingSystem%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOperatingSystem())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `StartupWizardCompleted` to the URL query string + if (getStartupWizardCompleted() != null) { + joiner.add(String.format("%sStartupWizardCompleted%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartupWizardCompleted())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private PublicSystemInfo instance; + + public Builder() { + this(new PublicSystemInfo()); + } + + protected Builder(PublicSystemInfo instance) { + this.instance = instance; + } + + public PublicSystemInfo.Builder localAddress(String localAddress) { + this.instance.localAddress = localAddress; + return this; + } + + public PublicSystemInfo.Builder serverName(String serverName) { + this.instance.serverName = serverName; + return this; + } + + public PublicSystemInfo.Builder version(String version) { + this.instance.version = version; + return this; + } + + public PublicSystemInfo.Builder productName(String productName) { + this.instance.productName = productName; + return this; + } + + public PublicSystemInfo.Builder operatingSystem(String operatingSystem) { + this.instance.operatingSystem = operatingSystem; + return this; + } + + public PublicSystemInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public PublicSystemInfo.Builder startupWizardCompleted(Boolean startupWizardCompleted) { + this.instance.startupWizardCompleted = startupWizardCompleted; + return this; + } + + /** + * returns a built PublicSystemInfo instance. + * + * The builder is not reusable. + */ + public PublicSystemInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static PublicSystemInfo.Builder builder() { + return new PublicSystemInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PublicSystemInfo.Builder toBuilder() { + return new PublicSystemInfo.Builder().localAddress(getLocalAddress()).serverName(getServerName()) + .version(getVersion()).productName(getProductName()).operatingSystem(getOperatingSystem()).id(getId()) + .startupWizardCompleted(getStartupWizardCompleted()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QueryFilters.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QueryFilters.java new file mode 100644 index 0000000000000..38afc76cbb07d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QueryFilters.java @@ -0,0 +1,256 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * QueryFilters + */ +@JsonPropertyOrder({ QueryFilters.JSON_PROPERTY_GENRES, QueryFilters.JSON_PROPERTY_TAGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class QueryFilters { + public static final String JSON_PROPERTY_GENRES = "Genres"; + @org.eclipse.jdt.annotation.NonNull + private List genres; + + public static final String JSON_PROPERTY_TAGS = "Tags"; + @org.eclipse.jdt.annotation.NonNull + private List tags; + + public QueryFilters() { + } + + public QueryFilters genres(@org.eclipse.jdt.annotation.NonNull List genres) { + this.genres = genres; + return this; + } + + public QueryFilters addGenresItem(NameGuidPair genresItem) { + if (this.genres == null) { + this.genres = new ArrayList<>(); + } + this.genres.add(genresItem); + return this; + } + + /** + * Get genres + * + * @return genres + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GENRES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGenres() { + return genres; + } + + @JsonProperty(JSON_PROPERTY_GENRES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGenres(@org.eclipse.jdt.annotation.NonNull List genres) { + this.genres = genres; + } + + public QueryFilters tags(@org.eclipse.jdt.annotation.NonNull List tags) { + this.tags = tags; + return this; + } + + public QueryFilters addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * + * @return tags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(@org.eclipse.jdt.annotation.NonNull List tags) { + this.tags = tags; + } + + /** + * Return true if this QueryFilters object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryFilters queryFilters = (QueryFilters) o; + return Objects.equals(this.genres, queryFilters.genres) && Objects.equals(this.tags, queryFilters.tags); + } + + @Override + public int hashCode() { + return Objects.hash(genres, tags); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryFilters {\n"); + sb.append(" genres: ").append(toIndentedString(genres)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Genres` to the URL query string + if (getGenres() != null) { + for (int i = 0; i < getGenres().size(); i++) { + if (getGenres().get(i) != null) { + joiner.add(getGenres().get(i).toUrlQueryString(String.format("%sGenres%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Tags` to the URL query string + if (getTags() != null) { + for (int i = 0; i < getTags().size(); i++) { + joiner.add(String.format("%sTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getTags().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private QueryFilters instance; + + public Builder() { + this(new QueryFilters()); + } + + protected Builder(QueryFilters instance) { + this.instance = instance; + } + + public QueryFilters.Builder genres(List genres) { + this.instance.genres = genres; + return this; + } + + public QueryFilters.Builder tags(List tags) { + this.instance.tags = tags; + return this; + } + + /** + * returns a built QueryFilters instance. + * + * The builder is not reusable. + */ + public QueryFilters build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static QueryFilters.Builder builder() { + return new QueryFilters.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public QueryFilters.Builder toBuilder() { + return new QueryFilters.Builder().genres(getGenres()).tags(getTags()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QueryFiltersLegacy.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QueryFiltersLegacy.java new file mode 100644 index 0000000000000..046f2d6b83c05 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QueryFiltersLegacy.java @@ -0,0 +1,360 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * QueryFiltersLegacy + */ +@JsonPropertyOrder({ QueryFiltersLegacy.JSON_PROPERTY_GENRES, QueryFiltersLegacy.JSON_PROPERTY_TAGS, + QueryFiltersLegacy.JSON_PROPERTY_OFFICIAL_RATINGS, QueryFiltersLegacy.JSON_PROPERTY_YEARS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class QueryFiltersLegacy { + public static final String JSON_PROPERTY_GENRES = "Genres"; + @org.eclipse.jdt.annotation.NonNull + private List genres; + + public static final String JSON_PROPERTY_TAGS = "Tags"; + @org.eclipse.jdt.annotation.NonNull + private List tags; + + public static final String JSON_PROPERTY_OFFICIAL_RATINGS = "OfficialRatings"; + @org.eclipse.jdt.annotation.NonNull + private List officialRatings; + + public static final String JSON_PROPERTY_YEARS = "Years"; + @org.eclipse.jdt.annotation.NonNull + private List years; + + public QueryFiltersLegacy() { + } + + public QueryFiltersLegacy genres(@org.eclipse.jdt.annotation.NonNull List genres) { + this.genres = genres; + return this; + } + + public QueryFiltersLegacy addGenresItem(String genresItem) { + if (this.genres == null) { + this.genres = new ArrayList<>(); + } + this.genres.add(genresItem); + return this; + } + + /** + * Get genres + * + * @return genres + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GENRES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGenres() { + return genres; + } + + @JsonProperty(JSON_PROPERTY_GENRES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGenres(@org.eclipse.jdt.annotation.NonNull List genres) { + this.genres = genres; + } + + public QueryFiltersLegacy tags(@org.eclipse.jdt.annotation.NonNull List tags) { + this.tags = tags; + return this; + } + + public QueryFiltersLegacy addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * + * @return tags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(@org.eclipse.jdt.annotation.NonNull List tags) { + this.tags = tags; + } + + public QueryFiltersLegacy officialRatings(@org.eclipse.jdt.annotation.NonNull List officialRatings) { + this.officialRatings = officialRatings; + return this; + } + + public QueryFiltersLegacy addOfficialRatingsItem(String officialRatingsItem) { + if (this.officialRatings == null) { + this.officialRatings = new ArrayList<>(); + } + this.officialRatings.add(officialRatingsItem); + return this; + } + + /** + * Get officialRatings + * + * @return officialRatings + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OFFICIAL_RATINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getOfficialRatings() { + return officialRatings; + } + + @JsonProperty(JSON_PROPERTY_OFFICIAL_RATINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOfficialRatings(@org.eclipse.jdt.annotation.NonNull List officialRatings) { + this.officialRatings = officialRatings; + } + + public QueryFiltersLegacy years(@org.eclipse.jdt.annotation.NonNull List years) { + this.years = years; + return this; + } + + public QueryFiltersLegacy addYearsItem(Integer yearsItem) { + if (this.years == null) { + this.years = new ArrayList<>(); + } + this.years.add(yearsItem); + return this; + } + + /** + * Get years + * + * @return years + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEARS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getYears() { + return years; + } + + @JsonProperty(JSON_PROPERTY_YEARS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYears(@org.eclipse.jdt.annotation.NonNull List years) { + this.years = years; + } + + /** + * Return true if this QueryFiltersLegacy object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryFiltersLegacy queryFiltersLegacy = (QueryFiltersLegacy) o; + return Objects.equals(this.genres, queryFiltersLegacy.genres) + && Objects.equals(this.tags, queryFiltersLegacy.tags) + && Objects.equals(this.officialRatings, queryFiltersLegacy.officialRatings) + && Objects.equals(this.years, queryFiltersLegacy.years); + } + + @Override + public int hashCode() { + return Objects.hash(genres, tags, officialRatings, years); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryFiltersLegacy {\n"); + sb.append(" genres: ").append(toIndentedString(genres)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" officialRatings: ").append(toIndentedString(officialRatings)).append("\n"); + sb.append(" years: ").append(toIndentedString(years)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Genres` to the URL query string + if (getGenres() != null) { + for (int i = 0; i < getGenres().size(); i++) { + joiner.add(String.format("%sGenres%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getGenres().get(i))))); + } + } + + // add `Tags` to the URL query string + if (getTags() != null) { + for (int i = 0; i < getTags().size(); i++) { + joiner.add(String.format("%sTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getTags().get(i))))); + } + } + + // add `OfficialRatings` to the URL query string + if (getOfficialRatings() != null) { + for (int i = 0; i < getOfficialRatings().size(); i++) { + joiner.add(String.format("%sOfficialRatings%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getOfficialRatings().get(i))))); + } + } + + // add `Years` to the URL query string + if (getYears() != null) { + for (int i = 0; i < getYears().size(); i++) { + joiner.add(String.format("%sYears%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getYears().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private QueryFiltersLegacy instance; + + public Builder() { + this(new QueryFiltersLegacy()); + } + + protected Builder(QueryFiltersLegacy instance) { + this.instance = instance; + } + + public QueryFiltersLegacy.Builder genres(List genres) { + this.instance.genres = genres; + return this; + } + + public QueryFiltersLegacy.Builder tags(List tags) { + this.instance.tags = tags; + return this; + } + + public QueryFiltersLegacy.Builder officialRatings(List officialRatings) { + this.instance.officialRatings = officialRatings; + return this; + } + + public QueryFiltersLegacy.Builder years(List years) { + this.instance.years = years; + return this; + } + + /** + * returns a built QueryFiltersLegacy instance. + * + * The builder is not reusable. + */ + public QueryFiltersLegacy build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static QueryFiltersLegacy.Builder builder() { + return new QueryFiltersLegacy.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public QueryFiltersLegacy.Builder toBuilder() { + return new QueryFiltersLegacy.Builder().genres(getGenres()).tags(getTags()) + .officialRatings(getOfficialRatings()).years(getYears()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QueueItem.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QueueItem.java new file mode 100644 index 0000000000000..493e938c3839d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QueueItem.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * QueueItem + */ +@JsonPropertyOrder({ QueueItem.JSON_PROPERTY_ID, QueueItem.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class QueueItem { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private String playlistItemId; + + public QueueItem() { + } + + public QueueItem id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public QueueItem playlistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Get playlistItemId + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + } + + /** + * Return true if this QueueItem object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueueItem queueItem = (QueueItem) o; + return Objects.equals(this.id, queueItem.id) && Objects.equals(this.playlistItemId, queueItem.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(id, playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueueItem {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private QueueItem instance; + + public Builder() { + this(new QueueItem()); + } + + protected Builder(QueueItem instance) { + this.instance = instance; + } + + public QueueItem.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public QueueItem.Builder playlistItemId(String playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built QueueItem instance. + * + * The builder is not reusable. + */ + public QueueItem build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static QueueItem.Builder builder() { + return new QueueItem.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public QueueItem.Builder toBuilder() { + return new QueueItem.Builder().id(getId()).playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QueueRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QueueRequestDto.java new file mode 100644 index 0000000000000..0d7ed37b70b0e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QueueRequestDto.java @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class QueueRequestDto. + */ +@JsonPropertyOrder({ QueueRequestDto.JSON_PROPERTY_ITEM_IDS, QueueRequestDto.JSON_PROPERTY_MODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class QueueRequestDto { + public static final String JSON_PROPERTY_ITEM_IDS = "ItemIds"; + @org.eclipse.jdt.annotation.NonNull + private List itemIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_MODE = "Mode"; + @org.eclipse.jdt.annotation.NonNull + private GroupQueueMode mode; + + public QueueRequestDto() { + } + + public QueueRequestDto itemIds(@org.eclipse.jdt.annotation.NonNull List itemIds) { + this.itemIds = itemIds; + return this; + } + + public QueueRequestDto addItemIdsItem(UUID itemIdsItem) { + if (this.itemIds == null) { + this.itemIds = new ArrayList<>(); + } + this.itemIds.add(itemIdsItem); + return this; + } + + /** + * Gets or sets the items to enqueue. + * + * @return itemIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItemIds() { + return itemIds; + } + + @JsonProperty(JSON_PROPERTY_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemIds(@org.eclipse.jdt.annotation.NonNull List itemIds) { + this.itemIds = itemIds; + } + + public QueueRequestDto mode(@org.eclipse.jdt.annotation.NonNull GroupQueueMode mode) { + this.mode = mode; + return this; + } + + /** + * Enum GroupQueueMode. + * + * @return mode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupQueueMode getMode() { + return mode; + } + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(@org.eclipse.jdt.annotation.NonNull GroupQueueMode mode) { + this.mode = mode; + } + + /** + * Return true if this QueueRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueueRequestDto queueRequestDto = (QueueRequestDto) o; + return Objects.equals(this.itemIds, queueRequestDto.itemIds) && Objects.equals(this.mode, queueRequestDto.mode); + } + + @Override + public int hashCode() { + return Objects.hash(itemIds, mode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueueRequestDto {\n"); + sb.append(" itemIds: ").append(toIndentedString(itemIds)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ItemIds` to the URL query string + if (getItemIds() != null) { + for (int i = 0; i < getItemIds().size(); i++) { + if (getItemIds().get(i) != null) { + joiner.add(String.format("%sItemIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getItemIds().get(i))))); + } + } + } + + // add `Mode` to the URL query string + if (getMode() != null) { + joiner.add(String.format("%sMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMode())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private QueueRequestDto instance; + + public Builder() { + this(new QueueRequestDto()); + } + + protected Builder(QueueRequestDto instance) { + this.instance = instance; + } + + public QueueRequestDto.Builder itemIds(List itemIds) { + this.instance.itemIds = itemIds; + return this; + } + + public QueueRequestDto.Builder mode(GroupQueueMode mode) { + this.instance.mode = mode; + return this; + } + + /** + * returns a built QueueRequestDto instance. + * + * The builder is not reusable. + */ + public QueueRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static QueueRequestDto.Builder builder() { + return new QueueRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public QueueRequestDto.Builder toBuilder() { + return new QueueRequestDto.Builder().itemIds(getItemIds()).mode(getMode()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QuickConnectDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QuickConnectDto.java new file mode 100644 index 0000000000000..7a72c4089c1e4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QuickConnectDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The quick connect request body. + */ +@JsonPropertyOrder({ QuickConnectDto.JSON_PROPERTY_SECRET }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class QuickConnectDto { + public static final String JSON_PROPERTY_SECRET = "Secret"; + @org.eclipse.jdt.annotation.Nullable + private String secret; + + public QuickConnectDto() { + } + + public QuickConnectDto secret(@org.eclipse.jdt.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * Gets or sets the quick connect secret. + * + * @return secret + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSecret() { + return secret; + } + + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSecret(@org.eclipse.jdt.annotation.Nullable String secret) { + this.secret = secret; + } + + /** + * Return true if this QuickConnectDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuickConnectDto quickConnectDto = (QuickConnectDto) o; + return Objects.equals(this.secret, quickConnectDto.secret); + } + + @Override + public int hashCode() { + return Objects.hash(secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuickConnectDto {\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Secret` to the URL query string + if (getSecret() != null) { + joiner.add(String.format("%sSecret%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSecret())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private QuickConnectDto instance; + + public Builder() { + this(new QuickConnectDto()); + } + + protected Builder(QuickConnectDto instance) { + this.instance = instance; + } + + public QuickConnectDto.Builder secret(String secret) { + this.instance.secret = secret; + return this; + } + + /** + * returns a built QuickConnectDto instance. + * + * The builder is not reusable. + */ + public QuickConnectDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static QuickConnectDto.Builder builder() { + return new QuickConnectDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public QuickConnectDto.Builder toBuilder() { + return new QuickConnectDto.Builder().secret(getSecret()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QuickConnectResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QuickConnectResult.java new file mode 100644 index 0000000000000..f737ae1bdddbf --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/QuickConnectResult.java @@ -0,0 +1,478 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Stores the state of an quick connect request. + */ +@JsonPropertyOrder({ QuickConnectResult.JSON_PROPERTY_AUTHENTICATED, QuickConnectResult.JSON_PROPERTY_SECRET, + QuickConnectResult.JSON_PROPERTY_CODE, QuickConnectResult.JSON_PROPERTY_DEVICE_ID, + QuickConnectResult.JSON_PROPERTY_DEVICE_NAME, QuickConnectResult.JSON_PROPERTY_APP_NAME, + QuickConnectResult.JSON_PROPERTY_APP_VERSION, QuickConnectResult.JSON_PROPERTY_DATE_ADDED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class QuickConnectResult { + public static final String JSON_PROPERTY_AUTHENTICATED = "Authenticated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean authenticated; + + public static final String JSON_PROPERTY_SECRET = "Secret"; + @org.eclipse.jdt.annotation.NonNull + private String secret; + + public static final String JSON_PROPERTY_CODE = "Code"; + @org.eclipse.jdt.annotation.NonNull + private String code; + + public static final String JSON_PROPERTY_DEVICE_ID = "DeviceId"; + @org.eclipse.jdt.annotation.NonNull + private String deviceId; + + public static final String JSON_PROPERTY_DEVICE_NAME = "DeviceName"; + @org.eclipse.jdt.annotation.NonNull + private String deviceName; + + public static final String JSON_PROPERTY_APP_NAME = "AppName"; + @org.eclipse.jdt.annotation.NonNull + private String appName; + + public static final String JSON_PROPERTY_APP_VERSION = "AppVersion"; + @org.eclipse.jdt.annotation.NonNull + private String appVersion; + + public static final String JSON_PROPERTY_DATE_ADDED = "DateAdded"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateAdded; + + public QuickConnectResult() { + } + + public QuickConnectResult authenticated(@org.eclipse.jdt.annotation.NonNull Boolean authenticated) { + this.authenticated = authenticated; + return this; + } + + /** + * Gets or sets a value indicating whether this request is authorized. + * + * @return authenticated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTHENTICATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAuthenticated() { + return authenticated; + } + + @JsonProperty(JSON_PROPERTY_AUTHENTICATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthenticated(@org.eclipse.jdt.annotation.NonNull Boolean authenticated) { + this.authenticated = authenticated; + } + + public QuickConnectResult secret(@org.eclipse.jdt.annotation.NonNull String secret) { + this.secret = secret; + return this; + } + + /** + * Gets the secret value used to uniquely identify this request. Can be used to retrieve authentication information. + * + * @return secret + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecret() { + return secret; + } + + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(@org.eclipse.jdt.annotation.NonNull String secret) { + this.secret = secret; + } + + public QuickConnectResult code(@org.eclipse.jdt.annotation.NonNull String code) { + this.code = code; + return this; + } + + /** + * Gets the user facing code used so the user can quickly differentiate this request from others. + * + * @return code + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCode() { + return code; + } + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCode(@org.eclipse.jdt.annotation.NonNull String code) { + this.code = code; + } + + public QuickConnectResult deviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Gets the requesting device id. + * + * @return deviceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceId() { + return deviceId; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + } + + public QuickConnectResult deviceName(@org.eclipse.jdt.annotation.NonNull String deviceName) { + this.deviceName = deviceName; + return this; + } + + /** + * Gets the requesting device name. + * + * @return deviceName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceName() { + return deviceName; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceName(@org.eclipse.jdt.annotation.NonNull String deviceName) { + this.deviceName = deviceName; + } + + public QuickConnectResult appName(@org.eclipse.jdt.annotation.NonNull String appName) { + this.appName = appName; + return this; + } + + /** + * Gets the requesting app name. + * + * @return appName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppName() { + return appName; + } + + @JsonProperty(JSON_PROPERTY_APP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppName(@org.eclipse.jdt.annotation.NonNull String appName) { + this.appName = appName; + } + + public QuickConnectResult appVersion(@org.eclipse.jdt.annotation.NonNull String appVersion) { + this.appVersion = appVersion; + return this; + } + + /** + * Gets the requesting app version. + * + * @return appVersion + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APP_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppVersion() { + return appVersion; + } + + @JsonProperty(JSON_PROPERTY_APP_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppVersion(@org.eclipse.jdt.annotation.NonNull String appVersion) { + this.appVersion = appVersion; + } + + public QuickConnectResult dateAdded(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateAdded) { + this.dateAdded = dateAdded; + return this; + } + + /** + * Gets or sets the DateTime that this request was created. + * + * @return dateAdded + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_ADDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateAdded() { + return dateAdded; + } + + @JsonProperty(JSON_PROPERTY_DATE_ADDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateAdded(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateAdded) { + this.dateAdded = dateAdded; + } + + /** + * Return true if this QuickConnectResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuickConnectResult quickConnectResult = (QuickConnectResult) o; + return Objects.equals(this.authenticated, quickConnectResult.authenticated) + && Objects.equals(this.secret, quickConnectResult.secret) + && Objects.equals(this.code, quickConnectResult.code) + && Objects.equals(this.deviceId, quickConnectResult.deviceId) + && Objects.equals(this.deviceName, quickConnectResult.deviceName) + && Objects.equals(this.appName, quickConnectResult.appName) + && Objects.equals(this.appVersion, quickConnectResult.appVersion) + && Objects.equals(this.dateAdded, quickConnectResult.dateAdded); + } + + @Override + public int hashCode() { + return Objects.hash(authenticated, secret, code, deviceId, deviceName, appName, appVersion, dateAdded); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuickConnectResult {\n"); + sb.append(" authenticated: ").append(toIndentedString(authenticated)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" deviceId: ").append(toIndentedString(deviceId)).append("\n"); + sb.append(" deviceName: ").append(toIndentedString(deviceName)).append("\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); + sb.append(" dateAdded: ").append(toIndentedString(dateAdded)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Authenticated` to the URL query string + if (getAuthenticated() != null) { + joiner.add(String.format("%sAuthenticated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAuthenticated())))); + } + + // add `Secret` to the URL query string + if (getSecret() != null) { + joiner.add(String.format("%sSecret%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSecret())))); + } + + // add `Code` to the URL query string + if (getCode() != null) { + joiner.add(String.format("%sCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCode())))); + } + + // add `DeviceId` to the URL query string + if (getDeviceId() != null) { + joiner.add(String.format("%sDeviceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceId())))); + } + + // add `DeviceName` to the URL query string + if (getDeviceName() != null) { + joiner.add(String.format("%sDeviceName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceName())))); + } + + // add `AppName` to the URL query string + if (getAppName() != null) { + joiner.add(String.format("%sAppName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAppName())))); + } + + // add `AppVersion` to the URL query string + if (getAppVersion() != null) { + joiner.add(String.format("%sAppVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAppVersion())))); + } + + // add `DateAdded` to the URL query string + if (getDateAdded() != null) { + joiner.add(String.format("%sDateAdded%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateAdded())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private QuickConnectResult instance; + + public Builder() { + this(new QuickConnectResult()); + } + + protected Builder(QuickConnectResult instance) { + this.instance = instance; + } + + public QuickConnectResult.Builder authenticated(Boolean authenticated) { + this.instance.authenticated = authenticated; + return this; + } + + public QuickConnectResult.Builder secret(String secret) { + this.instance.secret = secret; + return this; + } + + public QuickConnectResult.Builder code(String code) { + this.instance.code = code; + return this; + } + + public QuickConnectResult.Builder deviceId(String deviceId) { + this.instance.deviceId = deviceId; + return this; + } + + public QuickConnectResult.Builder deviceName(String deviceName) { + this.instance.deviceName = deviceName; + return this; + } + + public QuickConnectResult.Builder appName(String appName) { + this.instance.appName = appName; + return this; + } + + public QuickConnectResult.Builder appVersion(String appVersion) { + this.instance.appVersion = appVersion; + return this; + } + + public QuickConnectResult.Builder dateAdded(OffsetDateTime dateAdded) { + this.instance.dateAdded = dateAdded; + return this; + } + + /** + * returns a built QuickConnectResult instance. + * + * The builder is not reusable. + */ + public QuickConnectResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static QuickConnectResult.Builder builder() { + return new QuickConnectResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public QuickConnectResult.Builder toBuilder() { + return new QuickConnectResult.Builder().authenticated(getAuthenticated()).secret(getSecret()).code(getCode()) + .deviceId(getDeviceId()).deviceName(getDeviceName()).appName(getAppName()).appVersion(getAppVersion()) + .dateAdded(getDateAdded()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RatingType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RatingType.java new file mode 100644 index 0000000000000..c56d53b8ea586 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RatingType.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets RatingType + */ +public enum RatingType { + + SCORE("Score"), + + LIKES("Likes"); + + private String value; + + RatingType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static RatingType fromValue(String value) { + for (RatingType b : RatingType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ReadyRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ReadyRequestDto.java new file mode 100644 index 0000000000000..9d86366439ed8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ReadyRequestDto.java @@ -0,0 +1,316 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class ReadyRequest. + */ +@JsonPropertyOrder({ ReadyRequestDto.JSON_PROPERTY_WHEN, ReadyRequestDto.JSON_PROPERTY_POSITION_TICKS, + ReadyRequestDto.JSON_PROPERTY_IS_PLAYING, ReadyRequestDto.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ReadyRequestDto { + public static final String JSON_PROPERTY_WHEN = "When"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime when; + + public static final String JSON_PROPERTY_POSITION_TICKS = "PositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long positionTicks; + + public static final String JSON_PROPERTY_IS_PLAYING = "IsPlaying"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPlaying; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID playlistItemId; + + public ReadyRequestDto() { + } + + public ReadyRequestDto when(@org.eclipse.jdt.annotation.NonNull OffsetDateTime when) { + this.when = when; + return this; + } + + /** + * Gets or sets when the request has been made by the client. + * + * @return when + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WHEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getWhen() { + return when; + } + + @JsonProperty(JSON_PROPERTY_WHEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhen(@org.eclipse.jdt.annotation.NonNull OffsetDateTime when) { + this.when = when; + } + + public ReadyRequestDto positionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + return this; + } + + /** + * Gets or sets the position ticks. + * + * @return positionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPositionTicks() { + return positionTicks; + } + + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPositionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + } + + public ReadyRequestDto isPlaying(@org.eclipse.jdt.annotation.NonNull Boolean isPlaying) { + this.isPlaying = isPlaying; + return this; + } + + /** + * Gets or sets a value indicating whether the client playback is unpaused. + * + * @return isPlaying + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PLAYING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPlaying() { + return isPlaying; + } + + @JsonProperty(JSON_PROPERTY_IS_PLAYING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPlaying(@org.eclipse.jdt.annotation.NonNull Boolean isPlaying) { + this.isPlaying = isPlaying; + } + + public ReadyRequestDto playlistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets or sets the playlist item identifier of the playing item. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + } + + /** + * Return true if this ReadyRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadyRequestDto readyRequestDto = (ReadyRequestDto) o; + return Objects.equals(this.when, readyRequestDto.when) + && Objects.equals(this.positionTicks, readyRequestDto.positionTicks) + && Objects.equals(this.isPlaying, readyRequestDto.isPlaying) + && Objects.equals(this.playlistItemId, readyRequestDto.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(when, positionTicks, isPlaying, playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadyRequestDto {\n"); + sb.append(" when: ").append(toIndentedString(when)).append("\n"); + sb.append(" positionTicks: ").append(toIndentedString(positionTicks)).append("\n"); + sb.append(" isPlaying: ").append(toIndentedString(isPlaying)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `When` to the URL query string + if (getWhen() != null) { + joiner.add(String.format("%sWhen%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWhen())))); + } + + // add `PositionTicks` to the URL query string + if (getPositionTicks() != null) { + joiner.add(String.format("%sPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPositionTicks())))); + } + + // add `IsPlaying` to the URL query string + if (getIsPlaying() != null) { + joiner.add(String.format("%sIsPlaying%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPlaying())))); + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ReadyRequestDto instance; + + public Builder() { + this(new ReadyRequestDto()); + } + + protected Builder(ReadyRequestDto instance) { + this.instance = instance; + } + + public ReadyRequestDto.Builder when(OffsetDateTime when) { + this.instance.when = when; + return this; + } + + public ReadyRequestDto.Builder positionTicks(Long positionTicks) { + this.instance.positionTicks = positionTicks; + return this; + } + + public ReadyRequestDto.Builder isPlaying(Boolean isPlaying) { + this.instance.isPlaying = isPlaying; + return this; + } + + public ReadyRequestDto.Builder playlistItemId(UUID playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built ReadyRequestDto instance. + * + * The builder is not reusable. + */ + public ReadyRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ReadyRequestDto.Builder builder() { + return new ReadyRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ReadyRequestDto.Builder toBuilder() { + return new ReadyRequestDto.Builder().when(getWhen()).positionTicks(getPositionTicks()).isPlaying(getIsPlaying()) + .playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RecommendationDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RecommendationDto.java new file mode 100644 index 0000000000000..18e83ba3b2495 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RecommendationDto.java @@ -0,0 +1,330 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * RecommendationDto + */ +@JsonPropertyOrder({ RecommendationDto.JSON_PROPERTY_ITEMS, RecommendationDto.JSON_PROPERTY_RECOMMENDATION_TYPE, + RecommendationDto.JSON_PROPERTY_BASELINE_ITEM_NAME, RecommendationDto.JSON_PROPERTY_CATEGORY_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RecommendationDto { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items; + + public static final String JSON_PROPERTY_RECOMMENDATION_TYPE = "RecommendationType"; + @org.eclipse.jdt.annotation.NonNull + private RecommendationType recommendationType; + + public static final String JSON_PROPERTY_BASELINE_ITEM_NAME = "BaselineItemName"; + @org.eclipse.jdt.annotation.NonNull + private String baselineItemName; + + public static final String JSON_PROPERTY_CATEGORY_ID = "CategoryId"; + @org.eclipse.jdt.annotation.NonNull + private UUID categoryId; + + public RecommendationDto() { + } + + public RecommendationDto items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public RecommendationDto addItemsItem(BaseItemDto itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Get items + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public RecommendationDto recommendationType( + @org.eclipse.jdt.annotation.NonNull RecommendationType recommendationType) { + this.recommendationType = recommendationType; + return this; + } + + /** + * Get recommendationType + * + * @return recommendationType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RECOMMENDATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RecommendationType getRecommendationType() { + return recommendationType; + } + + @JsonProperty(JSON_PROPERTY_RECOMMENDATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecommendationType(@org.eclipse.jdt.annotation.NonNull RecommendationType recommendationType) { + this.recommendationType = recommendationType; + } + + public RecommendationDto baselineItemName(@org.eclipse.jdt.annotation.NonNull String baselineItemName) { + this.baselineItemName = baselineItemName; + return this; + } + + /** + * Get baselineItemName + * + * @return baselineItemName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BASELINE_ITEM_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaselineItemName() { + return baselineItemName; + } + + @JsonProperty(JSON_PROPERTY_BASELINE_ITEM_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBaselineItemName(@org.eclipse.jdt.annotation.NonNull String baselineItemName) { + this.baselineItemName = baselineItemName; + } + + public RecommendationDto categoryId(@org.eclipse.jdt.annotation.NonNull UUID categoryId) { + this.categoryId = categoryId; + return this; + } + + /** + * Get categoryId + * + * @return categoryId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CATEGORY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getCategoryId() { + return categoryId; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategoryId(@org.eclipse.jdt.annotation.NonNull UUID categoryId) { + this.categoryId = categoryId; + } + + /** + * Return true if this RecommendationDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecommendationDto recommendationDto = (RecommendationDto) o; + return Objects.equals(this.items, recommendationDto.items) + && Objects.equals(this.recommendationType, recommendationDto.recommendationType) + && Objects.equals(this.baselineItemName, recommendationDto.baselineItemName) + && Objects.equals(this.categoryId, recommendationDto.categoryId); + } + + @Override + public int hashCode() { + return Objects.hash(items, recommendationType, baselineItemName, categoryId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecommendationDto {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" recommendationType: ").append(toIndentedString(recommendationType)).append("\n"); + sb.append(" baselineItemName: ").append(toIndentedString(baselineItemName)).append("\n"); + sb.append(" categoryId: ").append(toIndentedString(categoryId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `RecommendationType` to the URL query string + if (getRecommendationType() != null) { + joiner.add(String.format("%sRecommendationType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRecommendationType())))); + } + + // add `BaselineItemName` to the URL query string + if (getBaselineItemName() != null) { + joiner.add(String.format("%sBaselineItemName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBaselineItemName())))); + } + + // add `CategoryId` to the URL query string + if (getCategoryId() != null) { + joiner.add(String.format("%sCategoryId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCategoryId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private RecommendationDto instance; + + public Builder() { + this(new RecommendationDto()); + } + + protected Builder(RecommendationDto instance) { + this.instance = instance; + } + + public RecommendationDto.Builder items(List items) { + this.instance.items = items; + return this; + } + + public RecommendationDto.Builder recommendationType(RecommendationType recommendationType) { + this.instance.recommendationType = recommendationType; + return this; + } + + public RecommendationDto.Builder baselineItemName(String baselineItemName) { + this.instance.baselineItemName = baselineItemName; + return this; + } + + public RecommendationDto.Builder categoryId(UUID categoryId) { + this.instance.categoryId = categoryId; + return this; + } + + /** + * returns a built RecommendationDto instance. + * + * The builder is not reusable. + */ + public RecommendationDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RecommendationDto.Builder builder() { + return new RecommendationDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RecommendationDto.Builder toBuilder() { + return new RecommendationDto.Builder().items(getItems()).recommendationType(getRecommendationType()) + .baselineItemName(getBaselineItemName()).categoryId(getCategoryId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RecommendationType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RecommendationType.java new file mode 100644 index 0000000000000..624eba52ac0d9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RecommendationType.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets RecommendationType + */ +public enum RecommendationType { + + SIMILAR_TO_RECENTLY_PLAYED("SimilarToRecentlyPlayed"), + + SIMILAR_TO_LIKED_ITEM("SimilarToLikedItem"), + + HAS_DIRECTOR_FROM_RECENTLY_PLAYED("HasDirectorFromRecentlyPlayed"), + + HAS_ACTOR_FROM_RECENTLY_PLAYED("HasActorFromRecentlyPlayed"), + + HAS_LIKED_DIRECTOR("HasLikedDirector"), + + HAS_LIKED_ACTOR("HasLikedActor"); + + private String value; + + RecommendationType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static RecommendationType fromValue(String value) { + for (RecommendationType b : RecommendationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RecordingStatus.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RecordingStatus.java new file mode 100644 index 0000000000000..a9d4e70a08b75 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RecordingStatus.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets RecordingStatus + */ +public enum RecordingStatus { + + NEW("New"), + + IN_PROGRESS("InProgress"), + + COMPLETED("Completed"), + + CANCELLED("Cancelled"), + + CONFLICTED_OK("ConflictedOk"), + + CONFLICTED_NOT_OK("ConflictedNotOk"), + + ERROR("Error"); + + private String value; + + RecordingStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static RecordingStatus fromValue(String value) { + for (RecordingStatus b : RecordingStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoteImageInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoteImageInfo.java new file mode 100644 index 0000000000000..8e688ecbc0630 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoteImageInfo.java @@ -0,0 +1,560 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class RemoteImageInfo. + */ +@JsonPropertyOrder({ RemoteImageInfo.JSON_PROPERTY_PROVIDER_NAME, RemoteImageInfo.JSON_PROPERTY_URL, + RemoteImageInfo.JSON_PROPERTY_THUMBNAIL_URL, RemoteImageInfo.JSON_PROPERTY_HEIGHT, + RemoteImageInfo.JSON_PROPERTY_WIDTH, RemoteImageInfo.JSON_PROPERTY_COMMUNITY_RATING, + RemoteImageInfo.JSON_PROPERTY_VOTE_COUNT, RemoteImageInfo.JSON_PROPERTY_LANGUAGE, + RemoteImageInfo.JSON_PROPERTY_TYPE, RemoteImageInfo.JSON_PROPERTY_RATING_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RemoteImageInfo { + public static final String JSON_PROPERTY_PROVIDER_NAME = "ProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String providerName; + + public static final String JSON_PROPERTY_URL = "Url"; + @org.eclipse.jdt.annotation.NonNull + private String url; + + public static final String JSON_PROPERTY_THUMBNAIL_URL = "ThumbnailUrl"; + @org.eclipse.jdt.annotation.NonNull + private String thumbnailUrl; + + public static final String JSON_PROPERTY_HEIGHT = "Height"; + @org.eclipse.jdt.annotation.NonNull + private Integer height; + + public static final String JSON_PROPERTY_WIDTH = "Width"; + @org.eclipse.jdt.annotation.NonNull + private Integer width; + + public static final String JSON_PROPERTY_COMMUNITY_RATING = "CommunityRating"; + @org.eclipse.jdt.annotation.NonNull + private Double communityRating; + + public static final String JSON_PROPERTY_VOTE_COUNT = "VoteCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer voteCount; + + public static final String JSON_PROPERTY_LANGUAGE = "Language"; + @org.eclipse.jdt.annotation.NonNull + private String language; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private ImageType type; + + public static final String JSON_PROPERTY_RATING_TYPE = "RatingType"; + @org.eclipse.jdt.annotation.NonNull + private RatingType ratingType; + + public RemoteImageInfo() { + } + + public RemoteImageInfo providerName(@org.eclipse.jdt.annotation.NonNull String providerName) { + this.providerName = providerName; + return this; + } + + /** + * Gets or sets the name of the provider. + * + * @return providerName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProviderName() { + return providerName; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderName(@org.eclipse.jdt.annotation.NonNull String providerName) { + this.providerName = providerName; + } + + public RemoteImageInfo url(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + return this; + } + + /** + * Gets or sets the URL. + * + * @return url + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + } + + public RemoteImageInfo thumbnailUrl(@org.eclipse.jdt.annotation.NonNull String thumbnailUrl) { + this.thumbnailUrl = thumbnailUrl; + return this; + } + + /** + * Gets or sets a url used for previewing a smaller version. + * + * @return thumbnailUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THUMBNAIL_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getThumbnailUrl() { + return thumbnailUrl; + } + + @JsonProperty(JSON_PROPERTY_THUMBNAIL_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThumbnailUrl(@org.eclipse.jdt.annotation.NonNull String thumbnailUrl) { + this.thumbnailUrl = thumbnailUrl; + } + + public RemoteImageInfo height(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + return this; + } + + /** + * Gets or sets the height. + * + * @return height + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHeight() { + return height; + } + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + } + + public RemoteImageInfo width(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + return this; + } + + /** + * Gets or sets the width. + * + * @return width + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + } + + public RemoteImageInfo communityRating(@org.eclipse.jdt.annotation.NonNull Double communityRating) { + this.communityRating = communityRating; + return this; + } + + /** + * Gets or sets the community rating. + * + * @return communityRating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMMUNITY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getCommunityRating() { + return communityRating; + } + + @JsonProperty(JSON_PROPERTY_COMMUNITY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCommunityRating(@org.eclipse.jdt.annotation.NonNull Double communityRating) { + this.communityRating = communityRating; + } + + public RemoteImageInfo voteCount(@org.eclipse.jdt.annotation.NonNull Integer voteCount) { + this.voteCount = voteCount; + return this; + } + + /** + * Gets or sets the vote count. + * + * @return voteCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VOTE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getVoteCount() { + return voteCount; + } + + @JsonProperty(JSON_PROPERTY_VOTE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVoteCount(@org.eclipse.jdt.annotation.NonNull Integer voteCount) { + this.voteCount = voteCount; + } + + public RemoteImageInfo language(@org.eclipse.jdt.annotation.NonNull String language) { + this.language = language; + return this; + } + + /** + * Gets or sets the language. + * + * @return language + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLanguage() { + return language; + } + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLanguage(@org.eclipse.jdt.annotation.NonNull String language) { + this.language = language; + } + + public RemoteImageInfo type(@org.eclipse.jdt.annotation.NonNull ImageType type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ImageType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull ImageType type) { + this.type = type; + } + + public RemoteImageInfo ratingType(@org.eclipse.jdt.annotation.NonNull RatingType ratingType) { + this.ratingType = ratingType; + return this; + } + + /** + * Gets or sets the type of the rating. + * + * @return ratingType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RATING_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RatingType getRatingType() { + return ratingType; + } + + @JsonProperty(JSON_PROPERTY_RATING_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRatingType(@org.eclipse.jdt.annotation.NonNull RatingType ratingType) { + this.ratingType = ratingType; + } + + /** + * Return true if this RemoteImageInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoteImageInfo remoteImageInfo = (RemoteImageInfo) o; + return Objects.equals(this.providerName, remoteImageInfo.providerName) + && Objects.equals(this.url, remoteImageInfo.url) + && Objects.equals(this.thumbnailUrl, remoteImageInfo.thumbnailUrl) + && Objects.equals(this.height, remoteImageInfo.height) + && Objects.equals(this.width, remoteImageInfo.width) + && Objects.equals(this.communityRating, remoteImageInfo.communityRating) + && Objects.equals(this.voteCount, remoteImageInfo.voteCount) + && Objects.equals(this.language, remoteImageInfo.language) + && Objects.equals(this.type, remoteImageInfo.type) + && Objects.equals(this.ratingType, remoteImageInfo.ratingType); + } + + @Override + public int hashCode() { + return Objects.hash(providerName, url, thumbnailUrl, height, width, communityRating, voteCount, language, type, + ratingType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoteImageInfo {\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" thumbnailUrl: ").append(toIndentedString(thumbnailUrl)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" communityRating: ").append(toIndentedString(communityRating)).append("\n"); + sb.append(" voteCount: ").append(toIndentedString(voteCount)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ratingType: ").append(toIndentedString(ratingType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ProviderName` to the URL query string + if (getProviderName() != null) { + joiner.add(String.format("%sProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProviderName())))); + } + + // add `Url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format("%sUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + // add `ThumbnailUrl` to the URL query string + if (getThumbnailUrl() != null) { + joiner.add(String.format("%sThumbnailUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getThumbnailUrl())))); + } + + // add `Height` to the URL query string + if (getHeight() != null) { + joiner.add(String.format("%sHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHeight())))); + } + + // add `Width` to the URL query string + if (getWidth() != null) { + joiner.add(String.format("%sWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWidth())))); + } + + // add `CommunityRating` to the URL query string + if (getCommunityRating() != null) { + joiner.add(String.format("%sCommunityRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCommunityRating())))); + } + + // add `VoteCount` to the URL query string + if (getVoteCount() != null) { + joiner.add(String.format("%sVoteCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVoteCount())))); + } + + // add `Language` to the URL query string + if (getLanguage() != null) { + joiner.add(String.format("%sLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLanguage())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `RatingType` to the URL query string + if (getRatingType() != null) { + joiner.add(String.format("%sRatingType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRatingType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private RemoteImageInfo instance; + + public Builder() { + this(new RemoteImageInfo()); + } + + protected Builder(RemoteImageInfo instance) { + this.instance = instance; + } + + public RemoteImageInfo.Builder providerName(String providerName) { + this.instance.providerName = providerName; + return this; + } + + public RemoteImageInfo.Builder url(String url) { + this.instance.url = url; + return this; + } + + public RemoteImageInfo.Builder thumbnailUrl(String thumbnailUrl) { + this.instance.thumbnailUrl = thumbnailUrl; + return this; + } + + public RemoteImageInfo.Builder height(Integer height) { + this.instance.height = height; + return this; + } + + public RemoteImageInfo.Builder width(Integer width) { + this.instance.width = width; + return this; + } + + public RemoteImageInfo.Builder communityRating(Double communityRating) { + this.instance.communityRating = communityRating; + return this; + } + + public RemoteImageInfo.Builder voteCount(Integer voteCount) { + this.instance.voteCount = voteCount; + return this; + } + + public RemoteImageInfo.Builder language(String language) { + this.instance.language = language; + return this; + } + + public RemoteImageInfo.Builder type(ImageType type) { + this.instance.type = type; + return this; + } + + public RemoteImageInfo.Builder ratingType(RatingType ratingType) { + this.instance.ratingType = ratingType; + return this; + } + + /** + * returns a built RemoteImageInfo instance. + * + * The builder is not reusable. + */ + public RemoteImageInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RemoteImageInfo.Builder builder() { + return new RemoteImageInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RemoteImageInfo.Builder toBuilder() { + return new RemoteImageInfo.Builder().providerName(getProviderName()).url(getUrl()) + .thumbnailUrl(getThumbnailUrl()).height(getHeight()).width(getWidth()) + .communityRating(getCommunityRating()).voteCount(getVoteCount()).language(getLanguage()).type(getType()) + .ratingType(getRatingType()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoteImageResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoteImageResult.java new file mode 100644 index 0000000000000..5f77405cdf914 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoteImageResult.java @@ -0,0 +1,299 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class RemoteImageResult. + */ +@JsonPropertyOrder({ RemoteImageResult.JSON_PROPERTY_IMAGES, RemoteImageResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, + RemoteImageResult.JSON_PROPERTY_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RemoteImageResult { + public static final String JSON_PROPERTY_IMAGES = "Images"; + @org.eclipse.jdt.annotation.NonNull + private List images; + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_PROVIDERS = "Providers"; + @org.eclipse.jdt.annotation.NonNull + private List providers; + + public RemoteImageResult() { + } + + public RemoteImageResult images(@org.eclipse.jdt.annotation.NonNull List images) { + this.images = images; + return this; + } + + public RemoteImageResult addImagesItem(RemoteImageInfo imagesItem) { + if (this.images == null) { + this.images = new ArrayList<>(); + } + this.images.add(imagesItem); + return this; + } + + /** + * Gets or sets the images. + * + * @return images + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getImages() { + return images; + } + + @JsonProperty(JSON_PROPERTY_IMAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImages(@org.eclipse.jdt.annotation.NonNull List images) { + this.images = images; + } + + public RemoteImageResult totalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total record count. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public RemoteImageResult providers(@org.eclipse.jdt.annotation.NonNull List providers) { + this.providers = providers; + return this; + } + + public RemoteImageResult addProvidersItem(String providersItem) { + if (this.providers == null) { + this.providers = new ArrayList<>(); + } + this.providers.add(providersItem); + return this; + } + + /** + * Gets or sets the providers. + * + * @return providers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getProviders() { + return providers; + } + + @JsonProperty(JSON_PROPERTY_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviders(@org.eclipse.jdt.annotation.NonNull List providers) { + this.providers = providers; + } + + /** + * Return true if this RemoteImageResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoteImageResult remoteImageResult = (RemoteImageResult) o; + return Objects.equals(this.images, remoteImageResult.images) + && Objects.equals(this.totalRecordCount, remoteImageResult.totalRecordCount) + && Objects.equals(this.providers, remoteImageResult.providers); + } + + @Override + public int hashCode() { + return Objects.hash(images, totalRecordCount, providers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoteImageResult {\n"); + sb.append(" images: ").append(toIndentedString(images)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" providers: ").append(toIndentedString(providers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Images` to the URL query string + if (getImages() != null) { + for (int i = 0; i < getImages().size(); i++) { + if (getImages().get(i) != null) { + joiner.add(getImages().get(i).toUrlQueryString(String.format("%sImages%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `Providers` to the URL query string + if (getProviders() != null) { + for (int i = 0; i < getProviders().size(); i++) { + joiner.add(String.format("%sProviders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getProviders().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private RemoteImageResult instance; + + public Builder() { + this(new RemoteImageResult()); + } + + protected Builder(RemoteImageResult instance) { + this.instance = instance; + } + + public RemoteImageResult.Builder images(List images) { + this.instance.images = images; + return this; + } + + public RemoteImageResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public RemoteImageResult.Builder providers(List providers) { + this.instance.providers = providers; + return this; + } + + /** + * returns a built RemoteImageResult instance. + * + * The builder is not reusable. + */ + public RemoteImageResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RemoteImageResult.Builder builder() { + return new RemoteImageResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RemoteImageResult.Builder toBuilder() { + return new RemoteImageResult.Builder().images(getImages()).totalRecordCount(getTotalRecordCount()) + .providers(getProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoteSearchResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoteSearchResult.java new file mode 100644 index 0000000000000..d25e104162d1d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoteSearchResult.java @@ -0,0 +1,670 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * RemoteSearchResult + */ +@JsonPropertyOrder({ RemoteSearchResult.JSON_PROPERTY_NAME, RemoteSearchResult.JSON_PROPERTY_PROVIDER_IDS, + RemoteSearchResult.JSON_PROPERTY_PRODUCTION_YEAR, RemoteSearchResult.JSON_PROPERTY_INDEX_NUMBER, + RemoteSearchResult.JSON_PROPERTY_INDEX_NUMBER_END, RemoteSearchResult.JSON_PROPERTY_PARENT_INDEX_NUMBER, + RemoteSearchResult.JSON_PROPERTY_PREMIERE_DATE, RemoteSearchResult.JSON_PROPERTY_IMAGE_URL, + RemoteSearchResult.JSON_PROPERTY_SEARCH_PROVIDER_NAME, RemoteSearchResult.JSON_PROPERTY_OVERVIEW, + RemoteSearchResult.JSON_PROPERTY_ALBUM_ARTIST, RemoteSearchResult.JSON_PROPERTY_ARTISTS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RemoteSearchResult { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_PRODUCTION_YEAR = "ProductionYear"; + @org.eclipse.jdt.annotation.NonNull + private Integer productionYear; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_INDEX_NUMBER_END = "IndexNumberEnd"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumberEnd; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IMAGE_URL = "ImageUrl"; + @org.eclipse.jdt.annotation.NonNull + private String imageUrl; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_OVERVIEW = "Overview"; + @org.eclipse.jdt.annotation.NonNull + private String overview; + + public static final String JSON_PROPERTY_ALBUM_ARTIST = "AlbumArtist"; + @org.eclipse.jdt.annotation.NonNull + private RemoteSearchResult albumArtist; + + public static final String JSON_PROPERTY_ARTISTS = "Artists"; + @org.eclipse.jdt.annotation.NonNull + private List artists; + + public RemoteSearchResult() { + } + + public RemoteSearchResult name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public RemoteSearchResult providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public RemoteSearchResult putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public RemoteSearchResult productionYear(@org.eclipse.jdt.annotation.NonNull Integer productionYear) { + this.productionYear = productionYear; + return this; + } + + /** + * Gets or sets the year. + * + * @return productionYear + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRODUCTION_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getProductionYear() { + return productionYear; + } + + @JsonProperty(JSON_PROPERTY_PRODUCTION_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProductionYear(@org.eclipse.jdt.annotation.NonNull Integer productionYear) { + this.productionYear = productionYear; + } + + public RemoteSearchResult indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public RemoteSearchResult indexNumberEnd(@org.eclipse.jdt.annotation.NonNull Integer indexNumberEnd) { + this.indexNumberEnd = indexNumberEnd; + return this; + } + + /** + * Get indexNumberEnd + * + * @return indexNumberEnd + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER_END) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumberEnd() { + return indexNumberEnd; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER_END) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumberEnd(@org.eclipse.jdt.annotation.NonNull Integer indexNumberEnd) { + this.indexNumberEnd = indexNumberEnd; + } + + public RemoteSearchResult parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public RemoteSearchResult premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public RemoteSearchResult imageUrl(@org.eclipse.jdt.annotation.NonNull String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * + * @return imageUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getImageUrl() { + return imageUrl; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageUrl(@org.eclipse.jdt.annotation.NonNull String imageUrl) { + this.imageUrl = imageUrl; + } + + public RemoteSearchResult searchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Get searchProviderName + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public RemoteSearchResult overview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + return this; + } + + /** + * Get overview + * + * @return overview + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOverview() { + return overview; + } + + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOverview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + } + + public RemoteSearchResult albumArtist(@org.eclipse.jdt.annotation.NonNull RemoteSearchResult albumArtist) { + this.albumArtist = albumArtist; + return this; + } + + /** + * Get albumArtist + * + * @return albumArtist + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ARTIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RemoteSearchResult getAlbumArtist() { + return albumArtist; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ARTIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumArtist(@org.eclipse.jdt.annotation.NonNull RemoteSearchResult albumArtist) { + this.albumArtist = albumArtist; + } + + public RemoteSearchResult artists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + return this; + } + + public RemoteSearchResult addArtistsItem(RemoteSearchResult artistsItem) { + if (this.artists == null) { + this.artists = new ArrayList<>(); + } + this.artists.add(artistsItem); + return this; + } + + /** + * Get artists + * + * @return artists + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArtists() { + return artists; + } + + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + } + + /** + * Return true if this RemoteSearchResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoteSearchResult remoteSearchResult = (RemoteSearchResult) o; + return Objects.equals(this.name, remoteSearchResult.name) + && Objects.equals(this.providerIds, remoteSearchResult.providerIds) + && Objects.equals(this.productionYear, remoteSearchResult.productionYear) + && Objects.equals(this.indexNumber, remoteSearchResult.indexNumber) + && Objects.equals(this.indexNumberEnd, remoteSearchResult.indexNumberEnd) + && Objects.equals(this.parentIndexNumber, remoteSearchResult.parentIndexNumber) + && Objects.equals(this.premiereDate, remoteSearchResult.premiereDate) + && Objects.equals(this.imageUrl, remoteSearchResult.imageUrl) + && Objects.equals(this.searchProviderName, remoteSearchResult.searchProviderName) + && Objects.equals(this.overview, remoteSearchResult.overview) + && Objects.equals(this.albumArtist, remoteSearchResult.albumArtist) + && Objects.equals(this.artists, remoteSearchResult.artists); + } + + @Override + public int hashCode() { + return Objects.hash(name, providerIds, productionYear, indexNumber, indexNumberEnd, parentIndexNumber, + premiereDate, imageUrl, searchProviderName, overview, albumArtist, artists); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoteSearchResult {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" productionYear: ").append(toIndentedString(productionYear)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" indexNumberEnd: ").append(toIndentedString(indexNumberEnd)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" overview: ").append(toIndentedString(overview)).append("\n"); + sb.append(" albumArtist: ").append(toIndentedString(albumArtist)).append("\n"); + sb.append(" artists: ").append(toIndentedString(artists)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `ProductionYear` to the URL query string + if (getProductionYear() != null) { + joiner.add(String.format("%sProductionYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProductionYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `IndexNumberEnd` to the URL query string + if (getIndexNumberEnd() != null) { + joiner.add(String.format("%sIndexNumberEnd%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumberEnd())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `ImageUrl` to the URL query string + if (getImageUrl() != null) { + joiner.add(String.format("%sImageUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageUrl())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `Overview` to the URL query string + if (getOverview() != null) { + joiner.add(String.format("%sOverview%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOverview())))); + } + + // add `AlbumArtist` to the URL query string + if (getAlbumArtist() != null) { + joiner.add(getAlbumArtist().toUrlQueryString(prefix + "AlbumArtist" + suffix)); + } + + // add `Artists` to the URL query string + if (getArtists() != null) { + for (int i = 0; i < getArtists().size(); i++) { + if (getArtists().get(i) != null) { + joiner.add(getArtists().get(i).toUrlQueryString(String.format("%sArtists%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private RemoteSearchResult instance; + + public Builder() { + this(new RemoteSearchResult()); + } + + protected Builder(RemoteSearchResult instance) { + this.instance = instance; + } + + public RemoteSearchResult.Builder name(String name) { + this.instance.name = name; + return this; + } + + public RemoteSearchResult.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public RemoteSearchResult.Builder productionYear(Integer productionYear) { + this.instance.productionYear = productionYear; + return this; + } + + public RemoteSearchResult.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public RemoteSearchResult.Builder indexNumberEnd(Integer indexNumberEnd) { + this.instance.indexNumberEnd = indexNumberEnd; + return this; + } + + public RemoteSearchResult.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public RemoteSearchResult.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public RemoteSearchResult.Builder imageUrl(String imageUrl) { + this.instance.imageUrl = imageUrl; + return this; + } + + public RemoteSearchResult.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public RemoteSearchResult.Builder overview(String overview) { + this.instance.overview = overview; + return this; + } + + public RemoteSearchResult.Builder albumArtist(RemoteSearchResult albumArtist) { + this.instance.albumArtist = albumArtist; + return this; + } + + public RemoteSearchResult.Builder artists(List artists) { + this.instance.artists = artists; + return this; + } + + /** + * returns a built RemoteSearchResult instance. + * + * The builder is not reusable. + */ + public RemoteSearchResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RemoteSearchResult.Builder builder() { + return new RemoteSearchResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RemoteSearchResult.Builder toBuilder() { + return new RemoteSearchResult.Builder().name(getName()).providerIds(getProviderIds()) + .productionYear(getProductionYear()).indexNumber(getIndexNumber()).indexNumberEnd(getIndexNumberEnd()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()).imageUrl(getImageUrl()) + .searchProviderName(getSearchProviderName()).overview(getOverview()).albumArtist(getAlbumArtist()) + .artists(getArtists()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoteSubtitleInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoteSubtitleInfo.java new file mode 100644 index 0000000000000..e1dcb5564371c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoteSubtitleInfo.java @@ -0,0 +1,603 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * RemoteSubtitleInfo + */ +@JsonPropertyOrder({ RemoteSubtitleInfo.JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME, + RemoteSubtitleInfo.JSON_PROPERTY_ID, RemoteSubtitleInfo.JSON_PROPERTY_PROVIDER_NAME, + RemoteSubtitleInfo.JSON_PROPERTY_NAME, RemoteSubtitleInfo.JSON_PROPERTY_FORMAT, + RemoteSubtitleInfo.JSON_PROPERTY_AUTHOR, RemoteSubtitleInfo.JSON_PROPERTY_COMMENT, + RemoteSubtitleInfo.JSON_PROPERTY_DATE_CREATED, RemoteSubtitleInfo.JSON_PROPERTY_COMMUNITY_RATING, + RemoteSubtitleInfo.JSON_PROPERTY_DOWNLOAD_COUNT, RemoteSubtitleInfo.JSON_PROPERTY_IS_HASH_MATCH }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RemoteSubtitleInfo { + public static final String JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME = "ThreeLetterISOLanguageName"; + @org.eclipse.jdt.annotation.NonNull + private String threeLetterISOLanguageName; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_PROVIDER_NAME = "ProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String providerName; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_FORMAT = "Format"; + @org.eclipse.jdt.annotation.NonNull + private String format; + + public static final String JSON_PROPERTY_AUTHOR = "Author"; + @org.eclipse.jdt.annotation.NonNull + private String author; + + public static final String JSON_PROPERTY_COMMENT = "Comment"; + @org.eclipse.jdt.annotation.NonNull + private String comment; + + public static final String JSON_PROPERTY_DATE_CREATED = "DateCreated"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime dateCreated; + + public static final String JSON_PROPERTY_COMMUNITY_RATING = "CommunityRating"; + @org.eclipse.jdt.annotation.NonNull + private Float communityRating; + + public static final String JSON_PROPERTY_DOWNLOAD_COUNT = "DownloadCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer downloadCount; + + public static final String JSON_PROPERTY_IS_HASH_MATCH = "IsHashMatch"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isHashMatch; + + public RemoteSubtitleInfo() { + } + + public RemoteSubtitleInfo threeLetterISOLanguageName( + @org.eclipse.jdt.annotation.NonNull String threeLetterISOLanguageName) { + this.threeLetterISOLanguageName = threeLetterISOLanguageName; + return this; + } + + /** + * Get threeLetterISOLanguageName + * + * @return threeLetterISOLanguageName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getThreeLetterISOLanguageName() { + return threeLetterISOLanguageName; + } + + @JsonProperty(JSON_PROPERTY_THREE_LETTER_I_S_O_LANGUAGE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThreeLetterISOLanguageName(@org.eclipse.jdt.annotation.NonNull String threeLetterISOLanguageName) { + this.threeLetterISOLanguageName = threeLetterISOLanguageName; + } + + public RemoteSubtitleInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public RemoteSubtitleInfo providerName(@org.eclipse.jdt.annotation.NonNull String providerName) { + this.providerName = providerName; + return this; + } + + /** + * Get providerName + * + * @return providerName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProviderName() { + return providerName; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderName(@org.eclipse.jdt.annotation.NonNull String providerName) { + this.providerName = providerName; + } + + public RemoteSubtitleInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public RemoteSubtitleInfo format(@org.eclipse.jdt.annotation.NonNull String format) { + this.format = format; + return this; + } + + /** + * Get format + * + * @return format + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFormat() { + return format; + } + + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormat(@org.eclipse.jdt.annotation.NonNull String format) { + this.format = format; + } + + public RemoteSubtitleInfo author(@org.eclipse.jdt.annotation.NonNull String author) { + this.author = author; + return this; + } + + /** + * Get author + * + * @return author + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTHOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthor() { + return author; + } + + @JsonProperty(JSON_PROPERTY_AUTHOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthor(@org.eclipse.jdt.annotation.NonNull String author) { + this.author = author; + } + + public RemoteSubtitleInfo comment(@org.eclipse.jdt.annotation.NonNull String comment) { + this.comment = comment; + return this; + } + + /** + * Get comment + * + * @return comment + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getComment() { + return comment; + } + + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComment(@org.eclipse.jdt.annotation.NonNull String comment) { + this.comment = comment; + } + + public RemoteSubtitleInfo dateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + return this; + } + + /** + * Get dateCreated + * + * @return dateCreated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateCreated() { + return dateCreated; + } + + @JsonProperty(JSON_PROPERTY_DATE_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateCreated(@org.eclipse.jdt.annotation.NonNull OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + } + + public RemoteSubtitleInfo communityRating(@org.eclipse.jdt.annotation.NonNull Float communityRating) { + this.communityRating = communityRating; + return this; + } + + /** + * Get communityRating + * + * @return communityRating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMMUNITY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getCommunityRating() { + return communityRating; + } + + @JsonProperty(JSON_PROPERTY_COMMUNITY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCommunityRating(@org.eclipse.jdt.annotation.NonNull Float communityRating) { + this.communityRating = communityRating; + } + + public RemoteSubtitleInfo downloadCount(@org.eclipse.jdt.annotation.NonNull Integer downloadCount) { + this.downloadCount = downloadCount; + return this; + } + + /** + * Get downloadCount + * + * @return downloadCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DOWNLOAD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDownloadCount() { + return downloadCount; + } + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadCount(@org.eclipse.jdt.annotation.NonNull Integer downloadCount) { + this.downloadCount = downloadCount; + } + + public RemoteSubtitleInfo isHashMatch(@org.eclipse.jdt.annotation.NonNull Boolean isHashMatch) { + this.isHashMatch = isHashMatch; + return this; + } + + /** + * Get isHashMatch + * + * @return isHashMatch + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_HASH_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsHashMatch() { + return isHashMatch; + } + + @JsonProperty(JSON_PROPERTY_IS_HASH_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsHashMatch(@org.eclipse.jdt.annotation.NonNull Boolean isHashMatch) { + this.isHashMatch = isHashMatch; + } + + /** + * Return true if this RemoteSubtitleInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoteSubtitleInfo remoteSubtitleInfo = (RemoteSubtitleInfo) o; + return Objects.equals(this.threeLetterISOLanguageName, remoteSubtitleInfo.threeLetterISOLanguageName) + && Objects.equals(this.id, remoteSubtitleInfo.id) + && Objects.equals(this.providerName, remoteSubtitleInfo.providerName) + && Objects.equals(this.name, remoteSubtitleInfo.name) + && Objects.equals(this.format, remoteSubtitleInfo.format) + && Objects.equals(this.author, remoteSubtitleInfo.author) + && Objects.equals(this.comment, remoteSubtitleInfo.comment) + && Objects.equals(this.dateCreated, remoteSubtitleInfo.dateCreated) + && Objects.equals(this.communityRating, remoteSubtitleInfo.communityRating) + && Objects.equals(this.downloadCount, remoteSubtitleInfo.downloadCount) + && Objects.equals(this.isHashMatch, remoteSubtitleInfo.isHashMatch); + } + + @Override + public int hashCode() { + return Objects.hash(threeLetterISOLanguageName, id, providerName, name, format, author, comment, dateCreated, + communityRating, downloadCount, isHashMatch); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoteSubtitleInfo {\n"); + sb.append(" threeLetterISOLanguageName: ").append(toIndentedString(threeLetterISOLanguageName)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" author: ").append(toIndentedString(author)).append("\n"); + sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); + sb.append(" dateCreated: ").append(toIndentedString(dateCreated)).append("\n"); + sb.append(" communityRating: ").append(toIndentedString(communityRating)).append("\n"); + sb.append(" downloadCount: ").append(toIndentedString(downloadCount)).append("\n"); + sb.append(" isHashMatch: ").append(toIndentedString(isHashMatch)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ThreeLetterISOLanguageName` to the URL query string + if (getThreeLetterISOLanguageName() != null) { + joiner.add(String.format("%sThreeLetterISOLanguageName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getThreeLetterISOLanguageName())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `ProviderName` to the URL query string + if (getProviderName() != null) { + joiner.add(String.format("%sProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProviderName())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Format` to the URL query string + if (getFormat() != null) { + joiner.add(String.format("%sFormat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFormat())))); + } + + // add `Author` to the URL query string + if (getAuthor() != null) { + joiner.add(String.format("%sAuthor%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAuthor())))); + } + + // add `Comment` to the URL query string + if (getComment() != null) { + joiner.add(String.format("%sComment%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getComment())))); + } + + // add `DateCreated` to the URL query string + if (getDateCreated() != null) { + joiner.add(String.format("%sDateCreated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDateCreated())))); + } + + // add `CommunityRating` to the URL query string + if (getCommunityRating() != null) { + joiner.add(String.format("%sCommunityRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCommunityRating())))); + } + + // add `DownloadCount` to the URL query string + if (getDownloadCount() != null) { + joiner.add(String.format("%sDownloadCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDownloadCount())))); + } + + // add `IsHashMatch` to the URL query string + if (getIsHashMatch() != null) { + joiner.add(String.format("%sIsHashMatch%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsHashMatch())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private RemoteSubtitleInfo instance; + + public Builder() { + this(new RemoteSubtitleInfo()); + } + + protected Builder(RemoteSubtitleInfo instance) { + this.instance = instance; + } + + public RemoteSubtitleInfo.Builder threeLetterISOLanguageName(String threeLetterISOLanguageName) { + this.instance.threeLetterISOLanguageName = threeLetterISOLanguageName; + return this; + } + + public RemoteSubtitleInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public RemoteSubtitleInfo.Builder providerName(String providerName) { + this.instance.providerName = providerName; + return this; + } + + public RemoteSubtitleInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public RemoteSubtitleInfo.Builder format(String format) { + this.instance.format = format; + return this; + } + + public RemoteSubtitleInfo.Builder author(String author) { + this.instance.author = author; + return this; + } + + public RemoteSubtitleInfo.Builder comment(String comment) { + this.instance.comment = comment; + return this; + } + + public RemoteSubtitleInfo.Builder dateCreated(OffsetDateTime dateCreated) { + this.instance.dateCreated = dateCreated; + return this; + } + + public RemoteSubtitleInfo.Builder communityRating(Float communityRating) { + this.instance.communityRating = communityRating; + return this; + } + + public RemoteSubtitleInfo.Builder downloadCount(Integer downloadCount) { + this.instance.downloadCount = downloadCount; + return this; + } + + public RemoteSubtitleInfo.Builder isHashMatch(Boolean isHashMatch) { + this.instance.isHashMatch = isHashMatch; + return this; + } + + /** + * returns a built RemoteSubtitleInfo instance. + * + * The builder is not reusable. + */ + public RemoteSubtitleInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RemoteSubtitleInfo.Builder builder() { + return new RemoteSubtitleInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RemoteSubtitleInfo.Builder toBuilder() { + return new RemoteSubtitleInfo.Builder().threeLetterISOLanguageName(getThreeLetterISOLanguageName()).id(getId()) + .providerName(getProviderName()).name(getName()).format(getFormat()).author(getAuthor()) + .comment(getComment()).dateCreated(getDateCreated()).communityRating(getCommunityRating()) + .downloadCount(getDownloadCount()).isHashMatch(getIsHashMatch()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoveFromPlaylistRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoveFromPlaylistRequestDto.java new file mode 100644 index 0000000000000..e833047722d45 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RemoveFromPlaylistRequestDto.java @@ -0,0 +1,293 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class RemoveFromPlaylistRequestDto. + */ +@JsonPropertyOrder({ RemoveFromPlaylistRequestDto.JSON_PROPERTY_PLAYLIST_ITEM_IDS, + RemoveFromPlaylistRequestDto.JSON_PROPERTY_CLEAR_PLAYLIST, + RemoveFromPlaylistRequestDto.JSON_PROPERTY_CLEAR_PLAYING_ITEM }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RemoveFromPlaylistRequestDto { + public static final String JSON_PROPERTY_PLAYLIST_ITEM_IDS = "PlaylistItemIds"; + @org.eclipse.jdt.annotation.NonNull + private List playlistItemIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_CLEAR_PLAYLIST = "ClearPlaylist"; + @org.eclipse.jdt.annotation.NonNull + private Boolean clearPlaylist; + + public static final String JSON_PROPERTY_CLEAR_PLAYING_ITEM = "ClearPlayingItem"; + @org.eclipse.jdt.annotation.NonNull + private Boolean clearPlayingItem; + + public RemoveFromPlaylistRequestDto() { + } + + public RemoveFromPlaylistRequestDto playlistItemIds( + @org.eclipse.jdt.annotation.NonNull List playlistItemIds) { + this.playlistItemIds = playlistItemIds; + return this; + } + + public RemoveFromPlaylistRequestDto addPlaylistItemIdsItem(UUID playlistItemIdsItem) { + if (this.playlistItemIds == null) { + this.playlistItemIds = new ArrayList<>(); + } + this.playlistItemIds.add(playlistItemIdsItem); + return this; + } + + /** + * Gets or sets the playlist identifiers ot the items. Ignored when clearing the playlist. + * + * @return playlistItemIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPlaylistItemIds() { + return playlistItemIds; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemIds(@org.eclipse.jdt.annotation.NonNull List playlistItemIds) { + this.playlistItemIds = playlistItemIds; + } + + public RemoveFromPlaylistRequestDto clearPlaylist(@org.eclipse.jdt.annotation.NonNull Boolean clearPlaylist) { + this.clearPlaylist = clearPlaylist; + return this; + } + + /** + * Gets or sets a value indicating whether the entire playlist should be cleared. + * + * @return clearPlaylist + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CLEAR_PLAYLIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getClearPlaylist() { + return clearPlaylist; + } + + @JsonProperty(JSON_PROPERTY_CLEAR_PLAYLIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClearPlaylist(@org.eclipse.jdt.annotation.NonNull Boolean clearPlaylist) { + this.clearPlaylist = clearPlaylist; + } + + public RemoveFromPlaylistRequestDto clearPlayingItem(@org.eclipse.jdt.annotation.NonNull Boolean clearPlayingItem) { + this.clearPlayingItem = clearPlayingItem; + return this; + } + + /** + * Gets or sets a value indicating whether the playing item should be removed as well. Used only when clearing the + * playlist. + * + * @return clearPlayingItem + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CLEAR_PLAYING_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getClearPlayingItem() { + return clearPlayingItem; + } + + @JsonProperty(JSON_PROPERTY_CLEAR_PLAYING_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClearPlayingItem(@org.eclipse.jdt.annotation.NonNull Boolean clearPlayingItem) { + this.clearPlayingItem = clearPlayingItem; + } + + /** + * Return true if this RemoveFromPlaylistRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveFromPlaylistRequestDto removeFromPlaylistRequestDto = (RemoveFromPlaylistRequestDto) o; + return Objects.equals(this.playlistItemIds, removeFromPlaylistRequestDto.playlistItemIds) + && Objects.equals(this.clearPlaylist, removeFromPlaylistRequestDto.clearPlaylist) + && Objects.equals(this.clearPlayingItem, removeFromPlaylistRequestDto.clearPlayingItem); + } + + @Override + public int hashCode() { + return Objects.hash(playlistItemIds, clearPlaylist, clearPlayingItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveFromPlaylistRequestDto {\n"); + sb.append(" playlistItemIds: ").append(toIndentedString(playlistItemIds)).append("\n"); + sb.append(" clearPlaylist: ").append(toIndentedString(clearPlaylist)).append("\n"); + sb.append(" clearPlayingItem: ").append(toIndentedString(clearPlayingItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlaylistItemIds` to the URL query string + if (getPlaylistItemIds() != null) { + for (int i = 0; i < getPlaylistItemIds().size(); i++) { + if (getPlaylistItemIds().get(i) != null) { + joiner.add(String.format("%sPlaylistItemIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemIds().get(i))))); + } + } + } + + // add `ClearPlaylist` to the URL query string + if (getClearPlaylist() != null) { + joiner.add(String.format("%sClearPlaylist%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getClearPlaylist())))); + } + + // add `ClearPlayingItem` to the URL query string + if (getClearPlayingItem() != null) { + joiner.add(String.format("%sClearPlayingItem%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getClearPlayingItem())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private RemoveFromPlaylistRequestDto instance; + + public Builder() { + this(new RemoveFromPlaylistRequestDto()); + } + + protected Builder(RemoveFromPlaylistRequestDto instance) { + this.instance = instance; + } + + public RemoveFromPlaylistRequestDto.Builder playlistItemIds(List playlistItemIds) { + this.instance.playlistItemIds = playlistItemIds; + return this; + } + + public RemoveFromPlaylistRequestDto.Builder clearPlaylist(Boolean clearPlaylist) { + this.instance.clearPlaylist = clearPlaylist; + return this; + } + + public RemoveFromPlaylistRequestDto.Builder clearPlayingItem(Boolean clearPlayingItem) { + this.instance.clearPlayingItem = clearPlayingItem; + return this; + } + + /** + * returns a built RemoveFromPlaylistRequestDto instance. + * + * The builder is not reusable. + */ + public RemoveFromPlaylistRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RemoveFromPlaylistRequestDto.Builder builder() { + return new RemoveFromPlaylistRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RemoveFromPlaylistRequestDto.Builder toBuilder() { + return new RemoveFromPlaylistRequestDto.Builder().playlistItemIds(getPlaylistItemIds()) + .clearPlaylist(getClearPlaylist()).clearPlayingItem(getClearPlayingItem()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RepeatMode.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RepeatMode.java new file mode 100644 index 0000000000000..51d8ef0494ea4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RepeatMode.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets RepeatMode + */ +public enum RepeatMode { + + REPEAT_NONE("RepeatNone"), + + REPEAT_ALL("RepeatAll"), + + REPEAT_ONE("RepeatOne"); + + private String value; + + RepeatMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static RepeatMode fromValue(String value) { + for (RepeatMode b : RepeatMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RepositoryInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RepositoryInfo.java new file mode 100644 index 0000000000000..ddd72743a7178 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/RepositoryInfo.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class RepositoryInfo. + */ +@JsonPropertyOrder({ RepositoryInfo.JSON_PROPERTY_NAME, RepositoryInfo.JSON_PROPERTY_URL, + RepositoryInfo.JSON_PROPERTY_ENABLED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class RepositoryInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_URL = "Url"; + @org.eclipse.jdt.annotation.NonNull + private String url; + + public static final String JSON_PROPERTY_ENABLED = "Enabled"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enabled; + + public RepositoryInfo() { + } + + public RepositoryInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public RepositoryInfo url(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + return this; + } + + /** + * Gets or sets the URL. + * + * @return url + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + } + + public RepositoryInfo enabled(@org.eclipse.jdt.annotation.NonNull Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Gets or sets a value indicating whether the repository is enabled. + * + * @return enabled + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabled(@org.eclipse.jdt.annotation.NonNull Boolean enabled) { + this.enabled = enabled; + } + + /** + * Return true if this RepositoryInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepositoryInfo repositoryInfo = (RepositoryInfo) o; + return Objects.equals(this.name, repositoryInfo.name) && Objects.equals(this.url, repositoryInfo.url) + && Objects.equals(this.enabled, repositoryInfo.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(name, url, enabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepositoryInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format("%sUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + // add `Enabled` to the URL query string + if (getEnabled() != null) { + joiner.add(String.format("%sEnabled%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnabled())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private RepositoryInfo instance; + + public Builder() { + this(new RepositoryInfo()); + } + + protected Builder(RepositoryInfo instance) { + this.instance = instance; + } + + public RepositoryInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public RepositoryInfo.Builder url(String url) { + this.instance.url = url; + return this; + } + + public RepositoryInfo.Builder enabled(Boolean enabled) { + this.instance.enabled = enabled; + return this; + } + + /** + * returns a built RepositoryInfo instance. + * + * The builder is not reusable. + */ + public RepositoryInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RepositoryInfo.Builder builder() { + return new RepositoryInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RepositoryInfo.Builder toBuilder() { + return new RepositoryInfo.Builder().name(getName()).url(getUrl()).enabled(getEnabled()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ResponseProfile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ResponseProfile.java new file mode 100644 index 0000000000000..18654577eb397 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ResponseProfile.java @@ -0,0 +1,450 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ResponseProfile + */ +@JsonPropertyOrder({ ResponseProfile.JSON_PROPERTY_CONTAINER, ResponseProfile.JSON_PROPERTY_AUDIO_CODEC, + ResponseProfile.JSON_PROPERTY_VIDEO_CODEC, ResponseProfile.JSON_PROPERTY_TYPE, + ResponseProfile.JSON_PROPERTY_ORG_PN, ResponseProfile.JSON_PROPERTY_MIME_TYPE, + ResponseProfile.JSON_PROPERTY_CONDITIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ResponseProfile { + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public static final String JSON_PROPERTY_AUDIO_CODEC = "AudioCodec"; + @org.eclipse.jdt.annotation.NonNull + private String audioCodec; + + public static final String JSON_PROPERTY_VIDEO_CODEC = "VideoCodec"; + @org.eclipse.jdt.annotation.NonNull + private String videoCodec; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private DlnaProfileType type; + + public static final String JSON_PROPERTY_ORG_PN = "OrgPn"; + @org.eclipse.jdt.annotation.NonNull + private String orgPn; + + public static final String JSON_PROPERTY_MIME_TYPE = "MimeType"; + @org.eclipse.jdt.annotation.NonNull + private String mimeType; + + public static final String JSON_PROPERTY_CONDITIONS = "Conditions"; + @org.eclipse.jdt.annotation.NonNull + private List conditions; + + public ResponseProfile() { + } + + public ResponseProfile container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Get container + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + public ResponseProfile audioCodec(@org.eclipse.jdt.annotation.NonNull String audioCodec) { + this.audioCodec = audioCodec; + return this; + } + + /** + * Get audioCodec + * + * @return audioCodec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAudioCodec() { + return audioCodec; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioCodec(@org.eclipse.jdt.annotation.NonNull String audioCodec) { + this.audioCodec = audioCodec; + } + + public ResponseProfile videoCodec(@org.eclipse.jdt.annotation.NonNull String videoCodec) { + this.videoCodec = videoCodec; + return this; + } + + /** + * Get videoCodec + * + * @return videoCodec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVideoCodec() { + return videoCodec; + } + + @JsonProperty(JSON_PROPERTY_VIDEO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVideoCodec(@org.eclipse.jdt.annotation.NonNull String videoCodec) { + this.videoCodec = videoCodec; + } + + public ResponseProfile type(@org.eclipse.jdt.annotation.NonNull DlnaProfileType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DlnaProfileType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull DlnaProfileType type) { + this.type = type; + } + + public ResponseProfile orgPn(@org.eclipse.jdt.annotation.NonNull String orgPn) { + this.orgPn = orgPn; + return this; + } + + /** + * Get orgPn + * + * @return orgPn + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORG_PN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOrgPn() { + return orgPn; + } + + @JsonProperty(JSON_PROPERTY_ORG_PN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrgPn(@org.eclipse.jdt.annotation.NonNull String orgPn) { + this.orgPn = orgPn; + } + + public ResponseProfile mimeType(@org.eclipse.jdt.annotation.NonNull String mimeType) { + this.mimeType = mimeType; + return this; + } + + /** + * Get mimeType + * + * @return mimeType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIME_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMimeType() { + return mimeType; + } + + @JsonProperty(JSON_PROPERTY_MIME_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMimeType(@org.eclipse.jdt.annotation.NonNull String mimeType) { + this.mimeType = mimeType; + } + + public ResponseProfile conditions(@org.eclipse.jdt.annotation.NonNull List conditions) { + this.conditions = conditions; + return this; + } + + public ResponseProfile addConditionsItem(ProfileCondition conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * Get conditions + * + * @return conditions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getConditions() { + return conditions; + } + + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConditions(@org.eclipse.jdt.annotation.NonNull List conditions) { + this.conditions = conditions; + } + + /** + * Return true if this ResponseProfile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseProfile responseProfile = (ResponseProfile) o; + return Objects.equals(this.container, responseProfile.container) + && Objects.equals(this.audioCodec, responseProfile.audioCodec) + && Objects.equals(this.videoCodec, responseProfile.videoCodec) + && Objects.equals(this.type, responseProfile.type) && Objects.equals(this.orgPn, responseProfile.orgPn) + && Objects.equals(this.mimeType, responseProfile.mimeType) + && Objects.equals(this.conditions, responseProfile.conditions); + } + + @Override + public int hashCode() { + return Objects.hash(container, audioCodec, videoCodec, type, orgPn, mimeType, conditions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseProfile {\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" audioCodec: ").append(toIndentedString(audioCodec)).append("\n"); + sb.append(" videoCodec: ").append(toIndentedString(videoCodec)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" orgPn: ").append(toIndentedString(orgPn)).append("\n"); + sb.append(" mimeType: ").append(toIndentedString(mimeType)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + // add `AudioCodec` to the URL query string + if (getAudioCodec() != null) { + joiner.add(String.format("%sAudioCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioCodec())))); + } + + // add `VideoCodec` to the URL query string + if (getVideoCodec() != null) { + joiner.add(String.format("%sVideoCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoCodec())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `OrgPn` to the URL query string + if (getOrgPn() != null) { + joiner.add(String.format("%sOrgPn%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOrgPn())))); + } + + // add `MimeType` to the URL query string + if (getMimeType() != null) { + joiner.add(String.format("%sMimeType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMimeType())))); + } + + // add `Conditions` to the URL query string + if (getConditions() != null) { + for (int i = 0; i < getConditions().size(); i++) { + if (getConditions().get(i) != null) { + joiner.add(getConditions().get(i).toUrlQueryString(String.format("%sConditions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private ResponseProfile instance; + + public Builder() { + this(new ResponseProfile()); + } + + protected Builder(ResponseProfile instance) { + this.instance = instance; + } + + public ResponseProfile.Builder container(String container) { + this.instance.container = container; + return this; + } + + public ResponseProfile.Builder audioCodec(String audioCodec) { + this.instance.audioCodec = audioCodec; + return this; + } + + public ResponseProfile.Builder videoCodec(String videoCodec) { + this.instance.videoCodec = videoCodec; + return this; + } + + public ResponseProfile.Builder type(DlnaProfileType type) { + this.instance.type = type; + return this; + } + + public ResponseProfile.Builder orgPn(String orgPn) { + this.instance.orgPn = orgPn; + return this; + } + + public ResponseProfile.Builder mimeType(String mimeType) { + this.instance.mimeType = mimeType; + return this; + } + + public ResponseProfile.Builder conditions(List conditions) { + this.instance.conditions = conditions; + return this; + } + + /** + * returns a built ResponseProfile instance. + * + * The builder is not reusable. + */ + public ResponseProfile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ResponseProfile.Builder builder() { + return new ResponseProfile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ResponseProfile.Builder toBuilder() { + return new ResponseProfile.Builder().container(getContainer()).audioCodec(getAudioCodec()) + .videoCodec(getVideoCodec()).type(getType()).orgPn(getOrgPn()).mimeType(getMimeType()) + .conditions(getConditions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ScrollDirection.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ScrollDirection.java new file mode 100644 index 0000000000000..ac4c61c6ea07c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ScrollDirection.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * An enum representing the axis that should be scrolled. + */ +public enum ScrollDirection { + + HORIZONTAL("Horizontal"), + + VERTICAL("Vertical"); + + private String value; + + ScrollDirection(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ScrollDirection fromValue(String value) { + for (ScrollDirection b : ScrollDirection.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SearchHint.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SearchHint.java new file mode 100644 index 0000000000000..674395f9b2458 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SearchHint.java @@ -0,0 +1,1347 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SearchHintResult. + */ +@JsonPropertyOrder({ SearchHint.JSON_PROPERTY_ITEM_ID, SearchHint.JSON_PROPERTY_ID, SearchHint.JSON_PROPERTY_NAME, + SearchHint.JSON_PROPERTY_MATCHED_TERM, SearchHint.JSON_PROPERTY_INDEX_NUMBER, + SearchHint.JSON_PROPERTY_PRODUCTION_YEAR, SearchHint.JSON_PROPERTY_PARENT_INDEX_NUMBER, + SearchHint.JSON_PROPERTY_PRIMARY_IMAGE_TAG, SearchHint.JSON_PROPERTY_THUMB_IMAGE_TAG, + SearchHint.JSON_PROPERTY_THUMB_IMAGE_ITEM_ID, SearchHint.JSON_PROPERTY_BACKDROP_IMAGE_TAG, + SearchHint.JSON_PROPERTY_BACKDROP_IMAGE_ITEM_ID, SearchHint.JSON_PROPERTY_TYPE, + SearchHint.JSON_PROPERTY_IS_FOLDER, SearchHint.JSON_PROPERTY_RUN_TIME_TICKS, + SearchHint.JSON_PROPERTY_MEDIA_TYPE, SearchHint.JSON_PROPERTY_START_DATE, SearchHint.JSON_PROPERTY_END_DATE, + SearchHint.JSON_PROPERTY_SERIES, SearchHint.JSON_PROPERTY_STATUS, SearchHint.JSON_PROPERTY_ALBUM, + SearchHint.JSON_PROPERTY_ALBUM_ID, SearchHint.JSON_PROPERTY_ALBUM_ARTIST, SearchHint.JSON_PROPERTY_ARTISTS, + SearchHint.JSON_PROPERTY_SONG_COUNT, SearchHint.JSON_PROPERTY_EPISODE_COUNT, + SearchHint.JSON_PROPERTY_CHANNEL_ID, SearchHint.JSON_PROPERTY_CHANNEL_NAME, + SearchHint.JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SearchHint { + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_MATCHED_TERM = "MatchedTerm"; + @org.eclipse.jdt.annotation.NonNull + private String matchedTerm; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PRODUCTION_YEAR = "ProductionYear"; + @org.eclipse.jdt.annotation.NonNull + private Integer productionYear; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_TAG = "PrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String primaryImageTag; + + public static final String JSON_PROPERTY_THUMB_IMAGE_TAG = "ThumbImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String thumbImageTag; + + public static final String JSON_PROPERTY_THUMB_IMAGE_ITEM_ID = "ThumbImageItemId"; + @org.eclipse.jdt.annotation.NonNull + private String thumbImageItemId; + + public static final String JSON_PROPERTY_BACKDROP_IMAGE_TAG = "BackdropImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String backdropImageTag; + + public static final String JSON_PROPERTY_BACKDROP_IMAGE_ITEM_ID = "BackdropImageItemId"; + @org.eclipse.jdt.annotation.NonNull + private String backdropImageItemId; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_IS_FOLDER = "IsFolder"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isFolder; + + public static final String JSON_PROPERTY_RUN_TIME_TICKS = "RunTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long runTimeTicks; + + public static final String JSON_PROPERTY_MEDIA_TYPE = "MediaType"; + @org.eclipse.jdt.annotation.NonNull + private String mediaType; + + public static final String JSON_PROPERTY_START_DATE = "StartDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime startDate; + + public static final String JSON_PROPERTY_END_DATE = "EndDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime endDate; + + public static final String JSON_PROPERTY_SERIES = "Series"; + @org.eclipse.jdt.annotation.NonNull + private String series; + + public static final String JSON_PROPERTY_STATUS = "Status"; + @org.eclipse.jdt.annotation.NonNull + private String status; + + public static final String JSON_PROPERTY_ALBUM = "Album"; + @org.eclipse.jdt.annotation.NonNull + private String album; + + public static final String JSON_PROPERTY_ALBUM_ID = "AlbumId"; + @org.eclipse.jdt.annotation.NonNull + private UUID albumId; + + public static final String JSON_PROPERTY_ALBUM_ARTIST = "AlbumArtist"; + @org.eclipse.jdt.annotation.NonNull + private String albumArtist; + + public static final String JSON_PROPERTY_ARTISTS = "Artists"; + @org.eclipse.jdt.annotation.NonNull + private List artists; + + public static final String JSON_PROPERTY_SONG_COUNT = "SongCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer songCount; + + public static final String JSON_PROPERTY_EPISODE_COUNT = "EpisodeCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer episodeCount; + + public static final String JSON_PROPERTY_CHANNEL_ID = "ChannelId"; + @org.eclipse.jdt.annotation.NonNull + private UUID channelId; + + public static final String JSON_PROPERTY_CHANNEL_NAME = "ChannelName"; + @org.eclipse.jdt.annotation.NonNull + private String channelName; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO = "PrimaryImageAspectRatio"; + @org.eclipse.jdt.annotation.NonNull + private Double primaryImageAspectRatio; + + public SearchHint() { + } + + public SearchHint itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item id. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public SearchHint id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public SearchHint name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public SearchHint matchedTerm(@org.eclipse.jdt.annotation.NonNull String matchedTerm) { + this.matchedTerm = matchedTerm; + return this; + } + + /** + * Gets or sets the matched term. + * + * @return matchedTerm + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MATCHED_TERM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMatchedTerm() { + return matchedTerm; + } + + @JsonProperty(JSON_PROPERTY_MATCHED_TERM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMatchedTerm(@org.eclipse.jdt.annotation.NonNull String matchedTerm) { + this.matchedTerm = matchedTerm; + } + + public SearchHint indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Gets or sets the index number. + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public SearchHint productionYear(@org.eclipse.jdt.annotation.NonNull Integer productionYear) { + this.productionYear = productionYear; + return this; + } + + /** + * Gets or sets the production year. + * + * @return productionYear + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRODUCTION_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getProductionYear() { + return productionYear; + } + + @JsonProperty(JSON_PROPERTY_PRODUCTION_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProductionYear(@org.eclipse.jdt.annotation.NonNull Integer productionYear) { + this.productionYear = productionYear; + } + + public SearchHint parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Gets or sets the parent index number. + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public SearchHint primaryImageTag(@org.eclipse.jdt.annotation.NonNull String primaryImageTag) { + this.primaryImageTag = primaryImageTag; + return this; + } + + /** + * Gets or sets the image tag. + * + * @return primaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryImageTag() { + return primaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String primaryImageTag) { + this.primaryImageTag = primaryImageTag; + } + + public SearchHint thumbImageTag(@org.eclipse.jdt.annotation.NonNull String thumbImageTag) { + this.thumbImageTag = thumbImageTag; + return this; + } + + /** + * Gets or sets the thumb image tag. + * + * @return thumbImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THUMB_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getThumbImageTag() { + return thumbImageTag; + } + + @JsonProperty(JSON_PROPERTY_THUMB_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThumbImageTag(@org.eclipse.jdt.annotation.NonNull String thumbImageTag) { + this.thumbImageTag = thumbImageTag; + } + + public SearchHint thumbImageItemId(@org.eclipse.jdt.annotation.NonNull String thumbImageItemId) { + this.thumbImageItemId = thumbImageItemId; + return this; + } + + /** + * Gets or sets the thumb image item identifier. + * + * @return thumbImageItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_THUMB_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getThumbImageItemId() { + return thumbImageItemId; + } + + @JsonProperty(JSON_PROPERTY_THUMB_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThumbImageItemId(@org.eclipse.jdt.annotation.NonNull String thumbImageItemId) { + this.thumbImageItemId = thumbImageItemId; + } + + public SearchHint backdropImageTag(@org.eclipse.jdt.annotation.NonNull String backdropImageTag) { + this.backdropImageTag = backdropImageTag; + return this; + } + + /** + * Gets or sets the backdrop image tag. + * + * @return backdropImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BACKDROP_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBackdropImageTag() { + return backdropImageTag; + } + + @JsonProperty(JSON_PROPERTY_BACKDROP_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBackdropImageTag(@org.eclipse.jdt.annotation.NonNull String backdropImageTag) { + this.backdropImageTag = backdropImageTag; + } + + public SearchHint backdropImageItemId(@org.eclipse.jdt.annotation.NonNull String backdropImageItemId) { + this.backdropImageItemId = backdropImageItemId; + return this; + } + + /** + * Gets or sets the backdrop image item identifier. + * + * @return backdropImageItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BACKDROP_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBackdropImageItemId() { + return backdropImageItemId; + } + + @JsonProperty(JSON_PROPERTY_BACKDROP_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBackdropImageItemId(@org.eclipse.jdt.annotation.NonNull String backdropImageItemId) { + this.backdropImageItemId = backdropImageItemId; + } + + public SearchHint type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public SearchHint isFolder(@org.eclipse.jdt.annotation.NonNull Boolean isFolder) { + this.isFolder = isFolder; + return this; + } + + /** + * Get isFolder + * + * @return isFolder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_FOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsFolder() { + return isFolder; + } + + @JsonProperty(JSON_PROPERTY_IS_FOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsFolder(@org.eclipse.jdt.annotation.NonNull Boolean isFolder) { + this.isFolder = isFolder; + } + + public SearchHint runTimeTicks(@org.eclipse.jdt.annotation.NonNull Long runTimeTicks) { + this.runTimeTicks = runTimeTicks; + return this; + } + + /** + * Gets or sets the run time ticks. + * + * @return runTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getRunTimeTicks() { + return runTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRunTimeTicks(@org.eclipse.jdt.annotation.NonNull Long runTimeTicks) { + this.runTimeTicks = runTimeTicks; + } + + public SearchHint mediaType(@org.eclipse.jdt.annotation.NonNull String mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Gets or sets the type of the media. + * + * @return mediaType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MEDIA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMediaType() { + return mediaType; + } + + @JsonProperty(JSON_PROPERTY_MEDIA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaType(@org.eclipse.jdt.annotation.NonNull String mediaType) { + this.mediaType = mediaType; + } + + public SearchHint startDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get startDate + * + * @return startDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartDate() { + return startDate; + } + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + } + + public SearchHint endDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get endDate + * + * @return endDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndDate() { + return endDate; + } + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + } + + public SearchHint series(@org.eclipse.jdt.annotation.NonNull String series) { + this.series = series; + return this; + } + + /** + * Gets or sets the series. + * + * @return series + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeries() { + return series; + } + + @JsonProperty(JSON_PROPERTY_SERIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeries(@org.eclipse.jdt.annotation.NonNull String series) { + this.series = series; + } + + public SearchHint status(@org.eclipse.jdt.annotation.NonNull String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@org.eclipse.jdt.annotation.NonNull String status) { + this.status = status; + } + + public SearchHint album(@org.eclipse.jdt.annotation.NonNull String album) { + this.album = album; + return this; + } + + /** + * Gets or sets the album. + * + * @return album + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlbum() { + return album; + } + + @JsonProperty(JSON_PROPERTY_ALBUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbum(@org.eclipse.jdt.annotation.NonNull String album) { + this.album = album; + } + + public SearchHint albumId(@org.eclipse.jdt.annotation.NonNull UUID albumId) { + this.albumId = albumId; + return this; + } + + /** + * Get albumId + * + * @return albumId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getAlbumId() { + return albumId; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumId(@org.eclipse.jdt.annotation.NonNull UUID albumId) { + this.albumId = albumId; + } + + public SearchHint albumArtist(@org.eclipse.jdt.annotation.NonNull String albumArtist) { + this.albumArtist = albumArtist; + return this; + } + + /** + * Gets or sets the album artist. + * + * @return albumArtist + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ARTIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlbumArtist() { + return albumArtist; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ARTIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumArtist(@org.eclipse.jdt.annotation.NonNull String albumArtist) { + this.albumArtist = albumArtist; + } + + public SearchHint artists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + return this; + } + + public SearchHint addArtistsItem(String artistsItem) { + if (this.artists == null) { + this.artists = new ArrayList<>(); + } + this.artists.add(artistsItem); + return this; + } + + /** + * Gets or sets the artists. + * + * @return artists + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArtists() { + return artists; + } + + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + } + + public SearchHint songCount(@org.eclipse.jdt.annotation.NonNull Integer songCount) { + this.songCount = songCount; + return this; + } + + /** + * Gets or sets the song count. + * + * @return songCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SONG_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSongCount() { + return songCount; + } + + @JsonProperty(JSON_PROPERTY_SONG_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSongCount(@org.eclipse.jdt.annotation.NonNull Integer songCount) { + this.songCount = songCount; + } + + public SearchHint episodeCount(@org.eclipse.jdt.annotation.NonNull Integer episodeCount) { + this.episodeCount = episodeCount; + return this; + } + + /** + * Gets or sets the episode count. + * + * @return episodeCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EPISODE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getEpisodeCount() { + return episodeCount; + } + + @JsonProperty(JSON_PROPERTY_EPISODE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEpisodeCount(@org.eclipse.jdt.annotation.NonNull Integer episodeCount) { + this.episodeCount = episodeCount; + } + + public SearchHint channelId(@org.eclipse.jdt.annotation.NonNull UUID channelId) { + this.channelId = channelId; + return this; + } + + /** + * Gets or sets the channel identifier. + * + * @return channelId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getChannelId() { + return channelId; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelId(@org.eclipse.jdt.annotation.NonNull UUID channelId) { + this.channelId = channelId; + } + + public SearchHint channelName(@org.eclipse.jdt.annotation.NonNull String channelName) { + this.channelName = channelName; + return this; + } + + /** + * Gets or sets the name of the channel. + * + * @return channelName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelName() { + return channelName; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelName(@org.eclipse.jdt.annotation.NonNull String channelName) { + this.channelName = channelName; + } + + public SearchHint primaryImageAspectRatio(@org.eclipse.jdt.annotation.NonNull Double primaryImageAspectRatio) { + this.primaryImageAspectRatio = primaryImageAspectRatio; + return this; + } + + /** + * Gets or sets the primary image aspect ratio. + * + * @return primaryImageAspectRatio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getPrimaryImageAspectRatio() { + return primaryImageAspectRatio; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageAspectRatio(@org.eclipse.jdt.annotation.NonNull Double primaryImageAspectRatio) { + this.primaryImageAspectRatio = primaryImageAspectRatio; + } + + /** + * Return true if this SearchHint object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SearchHint searchHint = (SearchHint) o; + return Objects.equals(this.itemId, searchHint.itemId) && Objects.equals(this.id, searchHint.id) + && Objects.equals(this.name, searchHint.name) + && Objects.equals(this.matchedTerm, searchHint.matchedTerm) + && Objects.equals(this.indexNumber, searchHint.indexNumber) + && Objects.equals(this.productionYear, searchHint.productionYear) + && Objects.equals(this.parentIndexNumber, searchHint.parentIndexNumber) + && Objects.equals(this.primaryImageTag, searchHint.primaryImageTag) + && Objects.equals(this.thumbImageTag, searchHint.thumbImageTag) + && Objects.equals(this.thumbImageItemId, searchHint.thumbImageItemId) + && Objects.equals(this.backdropImageTag, searchHint.backdropImageTag) + && Objects.equals(this.backdropImageItemId, searchHint.backdropImageItemId) + && Objects.equals(this.type, searchHint.type) && Objects.equals(this.isFolder, searchHint.isFolder) + && Objects.equals(this.runTimeTicks, searchHint.runTimeTicks) + && Objects.equals(this.mediaType, searchHint.mediaType) + && Objects.equals(this.startDate, searchHint.startDate) + && Objects.equals(this.endDate, searchHint.endDate) && Objects.equals(this.series, searchHint.series) + && Objects.equals(this.status, searchHint.status) && Objects.equals(this.album, searchHint.album) + && Objects.equals(this.albumId, searchHint.albumId) + && Objects.equals(this.albumArtist, searchHint.albumArtist) + && Objects.equals(this.artists, searchHint.artists) + && Objects.equals(this.songCount, searchHint.songCount) + && Objects.equals(this.episodeCount, searchHint.episodeCount) + && Objects.equals(this.channelId, searchHint.channelId) + && Objects.equals(this.channelName, searchHint.channelName) + && Objects.equals(this.primaryImageAspectRatio, searchHint.primaryImageAspectRatio); + } + + @Override + public int hashCode() { + return Objects.hash(itemId, id, name, matchedTerm, indexNumber, productionYear, parentIndexNumber, + primaryImageTag, thumbImageTag, thumbImageItemId, backdropImageTag, backdropImageItemId, type, isFolder, + runTimeTicks, mediaType, startDate, endDate, series, status, album, albumId, albumArtist, artists, + songCount, episodeCount, channelId, channelName, primaryImageAspectRatio); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SearchHint {\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" matchedTerm: ").append(toIndentedString(matchedTerm)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" productionYear: ").append(toIndentedString(productionYear)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" primaryImageTag: ").append(toIndentedString(primaryImageTag)).append("\n"); + sb.append(" thumbImageTag: ").append(toIndentedString(thumbImageTag)).append("\n"); + sb.append(" thumbImageItemId: ").append(toIndentedString(thumbImageItemId)).append("\n"); + sb.append(" backdropImageTag: ").append(toIndentedString(backdropImageTag)).append("\n"); + sb.append(" backdropImageItemId: ").append(toIndentedString(backdropImageItemId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" isFolder: ").append(toIndentedString(isFolder)).append("\n"); + sb.append(" runTimeTicks: ").append(toIndentedString(runTimeTicks)).append("\n"); + sb.append(" mediaType: ").append(toIndentedString(mediaType)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" series: ").append(toIndentedString(series)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" album: ").append(toIndentedString(album)).append("\n"); + sb.append(" albumId: ").append(toIndentedString(albumId)).append("\n"); + sb.append(" albumArtist: ").append(toIndentedString(albumArtist)).append("\n"); + sb.append(" artists: ").append(toIndentedString(artists)).append("\n"); + sb.append(" songCount: ").append(toIndentedString(songCount)).append("\n"); + sb.append(" episodeCount: ").append(toIndentedString(episodeCount)).append("\n"); + sb.append(" channelId: ").append(toIndentedString(channelId)).append("\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" primaryImageAspectRatio: ").append(toIndentedString(primaryImageAspectRatio)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `MatchedTerm` to the URL query string + if (getMatchedTerm() != null) { + joiner.add(String.format("%sMatchedTerm%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMatchedTerm())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ProductionYear` to the URL query string + if (getProductionYear() != null) { + joiner.add(String.format("%sProductionYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProductionYear())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PrimaryImageTag` to the URL query string + if (getPrimaryImageTag() != null) { + joiner.add(String.format("%sPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageTag())))); + } + + // add `ThumbImageTag` to the URL query string + if (getThumbImageTag() != null) { + joiner.add(String.format("%sThumbImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getThumbImageTag())))); + } + + // add `ThumbImageItemId` to the URL query string + if (getThumbImageItemId() != null) { + joiner.add(String.format("%sThumbImageItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getThumbImageItemId())))); + } + + // add `BackdropImageTag` to the URL query string + if (getBackdropImageTag() != null) { + joiner.add(String.format("%sBackdropImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBackdropImageTag())))); + } + + // add `BackdropImageItemId` to the URL query string + if (getBackdropImageItemId() != null) { + joiner.add(String.format("%sBackdropImageItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBackdropImageItemId())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `IsFolder` to the URL query string + if (getIsFolder() != null) { + joiner.add(String.format("%sIsFolder%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsFolder())))); + } + + // add `RunTimeTicks` to the URL query string + if (getRunTimeTicks() != null) { + joiner.add(String.format("%sRunTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRunTimeTicks())))); + } + + // add `MediaType` to the URL query string + if (getMediaType() != null) { + joiner.add(String.format("%sMediaType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMediaType())))); + } + + // add `StartDate` to the URL query string + if (getStartDate() != null) { + joiner.add(String.format("%sStartDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartDate())))); + } + + // add `EndDate` to the URL query string + if (getEndDate() != null) { + joiner.add(String.format("%sEndDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndDate())))); + } + + // add `Series` to the URL query string + if (getSeries() != null) { + joiner.add(String.format("%sSeries%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeries())))); + } + + // add `Status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sStatus%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `Album` to the URL query string + if (getAlbum() != null) { + joiner.add(String.format("%sAlbum%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbum())))); + } + + // add `AlbumId` to the URL query string + if (getAlbumId() != null) { + joiner.add(String.format("%sAlbumId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbumId())))); + } + + // add `AlbumArtist` to the URL query string + if (getAlbumArtist() != null) { + joiner.add(String.format("%sAlbumArtist%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbumArtist())))); + } + + // add `Artists` to the URL query string + if (getArtists() != null) { + for (int i = 0; i < getArtists().size(); i++) { + joiner.add(String.format("%sArtists%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArtists().get(i))))); + } + } + + // add `SongCount` to the URL query string + if (getSongCount() != null) { + joiner.add(String.format("%sSongCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSongCount())))); + } + + // add `EpisodeCount` to the URL query string + if (getEpisodeCount() != null) { + joiner.add(String.format("%sEpisodeCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEpisodeCount())))); + } + + // add `ChannelId` to the URL query string + if (getChannelId() != null) { + joiner.add(String.format("%sChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelId())))); + } + + // add `ChannelName` to the URL query string + if (getChannelName() != null) { + joiner.add(String.format("%sChannelName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelName())))); + } + + // add `PrimaryImageAspectRatio` to the URL query string + if (getPrimaryImageAspectRatio() != null) { + joiner.add(String.format("%sPrimaryImageAspectRatio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageAspectRatio())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SearchHint instance; + + public Builder() { + this(new SearchHint()); + } + + protected Builder(SearchHint instance) { + this.instance = instance; + } + + public SearchHint.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public SearchHint.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public SearchHint.Builder name(String name) { + this.instance.name = name; + return this; + } + + public SearchHint.Builder matchedTerm(String matchedTerm) { + this.instance.matchedTerm = matchedTerm; + return this; + } + + public SearchHint.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public SearchHint.Builder productionYear(Integer productionYear) { + this.instance.productionYear = productionYear; + return this; + } + + public SearchHint.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public SearchHint.Builder primaryImageTag(String primaryImageTag) { + this.instance.primaryImageTag = primaryImageTag; + return this; + } + + public SearchHint.Builder thumbImageTag(String thumbImageTag) { + this.instance.thumbImageTag = thumbImageTag; + return this; + } + + public SearchHint.Builder thumbImageItemId(String thumbImageItemId) { + this.instance.thumbImageItemId = thumbImageItemId; + return this; + } + + public SearchHint.Builder backdropImageTag(String backdropImageTag) { + this.instance.backdropImageTag = backdropImageTag; + return this; + } + + public SearchHint.Builder backdropImageItemId(String backdropImageItemId) { + this.instance.backdropImageItemId = backdropImageItemId; + return this; + } + + public SearchHint.Builder type(String type) { + this.instance.type = type; + return this; + } + + public SearchHint.Builder isFolder(Boolean isFolder) { + this.instance.isFolder = isFolder; + return this; + } + + public SearchHint.Builder runTimeTicks(Long runTimeTicks) { + this.instance.runTimeTicks = runTimeTicks; + return this; + } + + public SearchHint.Builder mediaType(String mediaType) { + this.instance.mediaType = mediaType; + return this; + } + + public SearchHint.Builder startDate(OffsetDateTime startDate) { + this.instance.startDate = startDate; + return this; + } + + public SearchHint.Builder endDate(OffsetDateTime endDate) { + this.instance.endDate = endDate; + return this; + } + + public SearchHint.Builder series(String series) { + this.instance.series = series; + return this; + } + + public SearchHint.Builder status(String status) { + this.instance.status = status; + return this; + } + + public SearchHint.Builder album(String album) { + this.instance.album = album; + return this; + } + + public SearchHint.Builder albumId(UUID albumId) { + this.instance.albumId = albumId; + return this; + } + + public SearchHint.Builder albumArtist(String albumArtist) { + this.instance.albumArtist = albumArtist; + return this; + } + + public SearchHint.Builder artists(List artists) { + this.instance.artists = artists; + return this; + } + + public SearchHint.Builder songCount(Integer songCount) { + this.instance.songCount = songCount; + return this; + } + + public SearchHint.Builder episodeCount(Integer episodeCount) { + this.instance.episodeCount = episodeCount; + return this; + } + + public SearchHint.Builder channelId(UUID channelId) { + this.instance.channelId = channelId; + return this; + } + + public SearchHint.Builder channelName(String channelName) { + this.instance.channelName = channelName; + return this; + } + + public SearchHint.Builder primaryImageAspectRatio(Double primaryImageAspectRatio) { + this.instance.primaryImageAspectRatio = primaryImageAspectRatio; + return this; + } + + /** + * returns a built SearchHint instance. + * + * The builder is not reusable. + */ + public SearchHint build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SearchHint.Builder builder() { + return new SearchHint.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SearchHint.Builder toBuilder() { + return new SearchHint.Builder().itemId(getItemId()).id(getId()).name(getName()).matchedTerm(getMatchedTerm()) + .indexNumber(getIndexNumber()).productionYear(getProductionYear()) + .parentIndexNumber(getParentIndexNumber()).primaryImageTag(getPrimaryImageTag()) + .thumbImageTag(getThumbImageTag()).thumbImageItemId(getThumbImageItemId()) + .backdropImageTag(getBackdropImageTag()).backdropImageItemId(getBackdropImageItemId()).type(getType()) + .isFolder(getIsFolder()).runTimeTicks(getRunTimeTicks()).mediaType(getMediaType()) + .startDate(getStartDate()).endDate(getEndDate()).series(getSeries()).status(getStatus()) + .album(getAlbum()).albumId(getAlbumId()).albumArtist(getAlbumArtist()).artists(getArtists()) + .songCount(getSongCount()).episodeCount(getEpisodeCount()).channelId(getChannelId()) + .channelName(getChannelName()).primaryImageAspectRatio(getPrimaryImageAspectRatio()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SearchHintResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SearchHintResult.java new file mode 100644 index 0000000000000..a0f4c42f40283 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SearchHintResult.java @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SearchHintResult. + */ +@JsonPropertyOrder({ SearchHintResult.JSON_PROPERTY_SEARCH_HINTS, SearchHintResult.JSON_PROPERTY_TOTAL_RECORD_COUNT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SearchHintResult { + public static final String JSON_PROPERTY_SEARCH_HINTS = "SearchHints"; + @org.eclipse.jdt.annotation.NonNull + private List searchHints = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public SearchHintResult() { + } + + public SearchHintResult searchHints(@org.eclipse.jdt.annotation.NonNull List searchHints) { + this.searchHints = searchHints; + return this; + } + + public SearchHintResult addSearchHintsItem(SearchHint searchHintsItem) { + if (this.searchHints == null) { + this.searchHints = new ArrayList<>(); + } + this.searchHints.add(searchHintsItem); + return this; + } + + /** + * Gets the search hints. + * + * @return searchHints + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_HINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSearchHints() { + return searchHints; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_HINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchHints(@org.eclipse.jdt.annotation.NonNull List searchHints) { + this.searchHints = searchHints; + } + + public SearchHintResult totalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets the total record count. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + /** + * Return true if this SearchHintResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SearchHintResult searchHintResult = (SearchHintResult) o; + return Objects.equals(this.searchHints, searchHintResult.searchHints) + && Objects.equals(this.totalRecordCount, searchHintResult.totalRecordCount); + } + + @Override + public int hashCode() { + return Objects.hash(searchHints, totalRecordCount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SearchHintResult {\n"); + sb.append(" searchHints: ").append(toIndentedString(searchHints)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchHints` to the URL query string + if (getSearchHints() != null) { + for (int i = 0; i < getSearchHints().size(); i++) { + if (getSearchHints().get(i) != null) { + joiner.add(getSearchHints().get(i).toUrlQueryString(String.format("%sSearchHints%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SearchHintResult instance; + + public Builder() { + this(new SearchHintResult()); + } + + protected Builder(SearchHintResult instance) { + this.instance = instance; + } + + public SearchHintResult.Builder searchHints(List searchHints) { + this.instance.searchHints = searchHints; + return this; + } + + public SearchHintResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + /** + * returns a built SearchHintResult instance. + * + * The builder is not reusable. + */ + public SearchHintResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SearchHintResult.Builder builder() { + return new SearchHintResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SearchHintResult.Builder toBuilder() { + return new SearchHintResult.Builder().searchHints(getSearchHints()).totalRecordCount(getTotalRecordCount()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeekRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeekRequestDto.java new file mode 100644 index 0000000000000..79da7ea6a84f0 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeekRequestDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SeekRequestDto. + */ +@JsonPropertyOrder({ SeekRequestDto.JSON_PROPERTY_POSITION_TICKS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SeekRequestDto { + public static final String JSON_PROPERTY_POSITION_TICKS = "PositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long positionTicks; + + public SeekRequestDto() { + } + + public SeekRequestDto positionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + return this; + } + + /** + * Gets or sets the position ticks. + * + * @return positionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPositionTicks() { + return positionTicks; + } + + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPositionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + } + + /** + * Return true if this SeekRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SeekRequestDto seekRequestDto = (SeekRequestDto) o; + return Objects.equals(this.positionTicks, seekRequestDto.positionTicks); + } + + @Override + public int hashCode() { + return Objects.hash(positionTicks); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SeekRequestDto {\n"); + sb.append(" positionTicks: ").append(toIndentedString(positionTicks)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PositionTicks` to the URL query string + if (getPositionTicks() != null) { + joiner.add(String.format("%sPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPositionTicks())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SeekRequestDto instance; + + public Builder() { + this(new SeekRequestDto()); + } + + protected Builder(SeekRequestDto instance) { + this.instance = instance; + } + + public SeekRequestDto.Builder positionTicks(Long positionTicks) { + this.instance.positionTicks = positionTicks; + return this; + } + + /** + * returns a built SeekRequestDto instance. + * + * The builder is not reusable. + */ + public SeekRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SeekRequestDto.Builder builder() { + return new SeekRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SeekRequestDto.Builder toBuilder() { + return new SeekRequestDto.Builder().positionTicks(getPositionTicks()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SendCommand.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SendCommand.java new file mode 100644 index 0000000000000..81499a696bea1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SendCommand.java @@ -0,0 +1,397 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SendCommand. + */ +@JsonPropertyOrder({ SendCommand.JSON_PROPERTY_GROUP_ID, SendCommand.JSON_PROPERTY_PLAYLIST_ITEM_ID, + SendCommand.JSON_PROPERTY_WHEN, SendCommand.JSON_PROPERTY_POSITION_TICKS, SendCommand.JSON_PROPERTY_COMMAND, + SendCommand.JSON_PROPERTY_EMITTED_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SendCommand { + public static final String JSON_PROPERTY_GROUP_ID = "GroupId"; + @org.eclipse.jdt.annotation.NonNull + private UUID groupId; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID playlistItemId; + + public static final String JSON_PROPERTY_WHEN = "When"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime when; + + public static final String JSON_PROPERTY_POSITION_TICKS = "PositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long positionTicks; + + public static final String JSON_PROPERTY_COMMAND = "Command"; + @org.eclipse.jdt.annotation.NonNull + private SendCommandType command; + + public static final String JSON_PROPERTY_EMITTED_AT = "EmittedAt"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime emittedAt; + + public SendCommand() { + } + + public SendCommand groupId(@org.eclipse.jdt.annotation.NonNull UUID groupId) { + this.groupId = groupId; + return this; + } + + /** + * Gets the group identifier. + * + * @return groupId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getGroupId() { + return groupId; + } + + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupId(@org.eclipse.jdt.annotation.NonNull UUID groupId) { + this.groupId = groupId; + } + + public SendCommand playlistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets the playlist identifier of the playing item. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + } + + public SendCommand when(@org.eclipse.jdt.annotation.NonNull OffsetDateTime when) { + this.when = when; + return this; + } + + /** + * Gets or sets the UTC time when to execute the command. + * + * @return when + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WHEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getWhen() { + return when; + } + + @JsonProperty(JSON_PROPERTY_WHEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhen(@org.eclipse.jdt.annotation.NonNull OffsetDateTime when) { + this.when = when; + } + + public SendCommand positionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + return this; + } + + /** + * Gets the position ticks. + * + * @return positionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPositionTicks() { + return positionTicks; + } + + @JsonProperty(JSON_PROPERTY_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPositionTicks(@org.eclipse.jdt.annotation.NonNull Long positionTicks) { + this.positionTicks = positionTicks; + } + + public SendCommand command(@org.eclipse.jdt.annotation.NonNull SendCommandType command) { + this.command = command; + return this; + } + + /** + * Gets the command. + * + * @return command + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SendCommandType getCommand() { + return command; + } + + @JsonProperty(JSON_PROPERTY_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCommand(@org.eclipse.jdt.annotation.NonNull SendCommandType command) { + this.command = command; + } + + public SendCommand emittedAt(@org.eclipse.jdt.annotation.NonNull OffsetDateTime emittedAt) { + this.emittedAt = emittedAt; + return this; + } + + /** + * Gets the UTC time when this command has been emitted. + * + * @return emittedAt + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EMITTED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEmittedAt() { + return emittedAt; + } + + @JsonProperty(JSON_PROPERTY_EMITTED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmittedAt(@org.eclipse.jdt.annotation.NonNull OffsetDateTime emittedAt) { + this.emittedAt = emittedAt; + } + + /** + * Return true if this SendCommand object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendCommand sendCommand = (SendCommand) o; + return Objects.equals(this.groupId, sendCommand.groupId) + && Objects.equals(this.playlistItemId, sendCommand.playlistItemId) + && Objects.equals(this.when, sendCommand.when) + && Objects.equals(this.positionTicks, sendCommand.positionTicks) + && Objects.equals(this.command, sendCommand.command) + && Objects.equals(this.emittedAt, sendCommand.emittedAt); + } + + @Override + public int hashCode() { + return Objects.hash(groupId, playlistItemId, when, positionTicks, command, emittedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendCommand {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append(" when: ").append(toIndentedString(when)).append("\n"); + sb.append(" positionTicks: ").append(toIndentedString(positionTicks)).append("\n"); + sb.append(" command: ").append(toIndentedString(command)).append("\n"); + sb.append(" emittedAt: ").append(toIndentedString(emittedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `GroupId` to the URL query string + if (getGroupId() != null) { + joiner.add(String.format("%sGroupId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getGroupId())))); + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + // add `When` to the URL query string + if (getWhen() != null) { + joiner.add(String.format("%sWhen%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWhen())))); + } + + // add `PositionTicks` to the URL query string + if (getPositionTicks() != null) { + joiner.add(String.format("%sPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPositionTicks())))); + } + + // add `Command` to the URL query string + if (getCommand() != null) { + joiner.add(String.format("%sCommand%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCommand())))); + } + + // add `EmittedAt` to the URL query string + if (getEmittedAt() != null) { + joiner.add(String.format("%sEmittedAt%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEmittedAt())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SendCommand instance; + + public Builder() { + this(new SendCommand()); + } + + protected Builder(SendCommand instance) { + this.instance = instance; + } + + public SendCommand.Builder groupId(UUID groupId) { + this.instance.groupId = groupId; + return this; + } + + public SendCommand.Builder playlistItemId(UUID playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + public SendCommand.Builder when(OffsetDateTime when) { + this.instance.when = when; + return this; + } + + public SendCommand.Builder positionTicks(Long positionTicks) { + this.instance.positionTicks = positionTicks; + return this; + } + + public SendCommand.Builder command(SendCommandType command) { + this.instance.command = command; + return this; + } + + public SendCommand.Builder emittedAt(OffsetDateTime emittedAt) { + this.instance.emittedAt = emittedAt; + return this; + } + + /** + * returns a built SendCommand instance. + * + * The builder is not reusable. + */ + public SendCommand build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SendCommand.Builder builder() { + return new SendCommand.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SendCommand.Builder toBuilder() { + return new SendCommand.Builder().groupId(getGroupId()).playlistItemId(getPlaylistItemId()).when(getWhen()) + .positionTicks(getPositionTicks()).command(getCommand()).emittedAt(getEmittedAt()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SendCommandType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SendCommandType.java new file mode 100644 index 0000000000000..72c6f9e0dc470 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SendCommandType.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum SendCommandType. + */ +public enum SendCommandType { + + UNPAUSE("Unpause"), + + PAUSE("Pause"), + + STOP("Stop"), + + SEEK("Seek"); + + private String value; + + SendCommandType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SendCommandType fromValue(String value) { + for (SendCommandType b : SendCommandType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SendToUserType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SendToUserType.java new file mode 100644 index 0000000000000..58018f40d8699 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SendToUserType.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets SendToUserType + */ +public enum SendToUserType { + + ALL("All"), + + ADMINS("Admins"), + + CUSTOM("Custom"); + + private String value; + + SendToUserType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SendToUserType fromValue(String value) { + for (SendToUserType b : SendToUserType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesInfo.java new file mode 100644 index 0000000000000..e1a13512f3aa1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesInfo.java @@ -0,0 +1,617 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * SeriesInfo + */ +@JsonPropertyOrder({ SeriesInfo.JSON_PROPERTY_NAME, SeriesInfo.JSON_PROPERTY_ORIGINAL_TITLE, + SeriesInfo.JSON_PROPERTY_PATH, SeriesInfo.JSON_PROPERTY_METADATA_LANGUAGE, + SeriesInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, SeriesInfo.JSON_PROPERTY_PROVIDER_IDS, + SeriesInfo.JSON_PROPERTY_YEAR, SeriesInfo.JSON_PROPERTY_INDEX_NUMBER, + SeriesInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, SeriesInfo.JSON_PROPERTY_PREMIERE_DATE, + SeriesInfo.JSON_PROPERTY_IS_AUTOMATED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SeriesInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public SeriesInfo() { + } + + public SeriesInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public SeriesInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public SeriesInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public SeriesInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public SeriesInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public SeriesInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public SeriesInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public SeriesInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public SeriesInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public SeriesInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public SeriesInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public SeriesInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + /** + * Return true if this SeriesInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SeriesInfo seriesInfo = (SeriesInfo) o; + return Objects.equals(this.name, seriesInfo.name) + && Objects.equals(this.originalTitle, seriesInfo.originalTitle) + && Objects.equals(this.path, seriesInfo.path) + && Objects.equals(this.metadataLanguage, seriesInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, seriesInfo.metadataCountryCode) + && Objects.equals(this.providerIds, seriesInfo.providerIds) + && Objects.equals(this.year, seriesInfo.year) + && Objects.equals(this.indexNumber, seriesInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, seriesInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, seriesInfo.premiereDate) + && Objects.equals(this.isAutomated, seriesInfo.isAutomated); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SeriesInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SeriesInfo instance; + + public Builder() { + this(new SeriesInfo()); + } + + protected Builder(SeriesInfo instance) { + this.instance = instance; + } + + public SeriesInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public SeriesInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public SeriesInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public SeriesInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public SeriesInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public SeriesInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public SeriesInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public SeriesInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public SeriesInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public SeriesInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public SeriesInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + /** + * returns a built SeriesInfo instance. + * + * The builder is not reusable. + */ + public SeriesInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SeriesInfo.Builder builder() { + return new SeriesInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SeriesInfo.Builder toBuilder() { + return new SeriesInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()) + .isAutomated(getIsAutomated()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..23b78aeba80bc --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesInfoRemoteSearchQuery.java @@ -0,0 +1,318 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * SeriesInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ SeriesInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + SeriesInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, + SeriesInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + SeriesInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SeriesInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private SeriesInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public SeriesInfoRemoteSearchQuery() { + } + + public SeriesInfoRemoteSearchQuery searchInfo(@org.eclipse.jdt.annotation.NonNull SeriesInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SeriesInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull SeriesInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public SeriesInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public SeriesInfoRemoteSearchQuery searchProviderName( + @org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public SeriesInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this SeriesInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SeriesInfoRemoteSearchQuery seriesInfoRemoteSearchQuery = (SeriesInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, seriesInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, seriesInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, seriesInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, seriesInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SeriesInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SeriesInfoRemoteSearchQuery instance; + + public Builder() { + this(new SeriesInfoRemoteSearchQuery()); + } + + protected Builder(SeriesInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public SeriesInfoRemoteSearchQuery.Builder searchInfo(SeriesInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public SeriesInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public SeriesInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public SeriesInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built SeriesInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public SeriesInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SeriesInfoRemoteSearchQuery.Builder builder() { + return new SeriesInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SeriesInfoRemoteSearchQuery.Builder toBuilder() { + return new SeriesInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesStatus.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesStatus.java new file mode 100644 index 0000000000000..63dbbc0569ada --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesStatus.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum SeriesStatus. + */ +public enum SeriesStatus { + + CONTINUING("Continuing"), + + ENDED("Ended"); + + private String value; + + SeriesStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SeriesStatus fromValue(String value) { + for (SeriesStatus b : SeriesStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesTimerInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesTimerInfoDto.java new file mode 100644 index 0000000000000..99835db9f5274 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesTimerInfoDto.java @@ -0,0 +1,1634 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SeriesTimerInfoDto. + */ +@JsonPropertyOrder({ SeriesTimerInfoDto.JSON_PROPERTY_ID, SeriesTimerInfoDto.JSON_PROPERTY_TYPE, + SeriesTimerInfoDto.JSON_PROPERTY_SERVER_ID, SeriesTimerInfoDto.JSON_PROPERTY_EXTERNAL_ID, + SeriesTimerInfoDto.JSON_PROPERTY_CHANNEL_ID, SeriesTimerInfoDto.JSON_PROPERTY_EXTERNAL_CHANNEL_ID, + SeriesTimerInfoDto.JSON_PROPERTY_CHANNEL_NAME, SeriesTimerInfoDto.JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG, + SeriesTimerInfoDto.JSON_PROPERTY_PROGRAM_ID, SeriesTimerInfoDto.JSON_PROPERTY_EXTERNAL_PROGRAM_ID, + SeriesTimerInfoDto.JSON_PROPERTY_NAME, SeriesTimerInfoDto.JSON_PROPERTY_OVERVIEW, + SeriesTimerInfoDto.JSON_PROPERTY_START_DATE, SeriesTimerInfoDto.JSON_PROPERTY_END_DATE, + SeriesTimerInfoDto.JSON_PROPERTY_SERVICE_NAME, SeriesTimerInfoDto.JSON_PROPERTY_PRIORITY, + SeriesTimerInfoDto.JSON_PROPERTY_PRE_PADDING_SECONDS, SeriesTimerInfoDto.JSON_PROPERTY_POST_PADDING_SECONDS, + SeriesTimerInfoDto.JSON_PROPERTY_IS_PRE_PADDING_REQUIRED, + SeriesTimerInfoDto.JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID, + SeriesTimerInfoDto.JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS, + SeriesTimerInfoDto.JSON_PROPERTY_IS_POST_PADDING_REQUIRED, SeriesTimerInfoDto.JSON_PROPERTY_KEEP_UNTIL, + SeriesTimerInfoDto.JSON_PROPERTY_RECORD_ANY_TIME, SeriesTimerInfoDto.JSON_PROPERTY_SKIP_EPISODES_IN_LIBRARY, + SeriesTimerInfoDto.JSON_PROPERTY_RECORD_ANY_CHANNEL, SeriesTimerInfoDto.JSON_PROPERTY_KEEP_UP_TO, + SeriesTimerInfoDto.JSON_PROPERTY_RECORD_NEW_ONLY, SeriesTimerInfoDto.JSON_PROPERTY_DAYS, + SeriesTimerInfoDto.JSON_PROPERTY_DAY_PATTERN, SeriesTimerInfoDto.JSON_PROPERTY_IMAGE_TAGS, + SeriesTimerInfoDto.JSON_PROPERTY_PARENT_THUMB_ITEM_ID, SeriesTimerInfoDto.JSON_PROPERTY_PARENT_THUMB_IMAGE_TAG, + SeriesTimerInfoDto.JSON_PROPERTY_PARENT_PRIMARY_IMAGE_ITEM_ID, + SeriesTimerInfoDto.JSON_PROPERTY_PARENT_PRIMARY_IMAGE_TAG }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SeriesTimerInfoDto { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_SERVER_ID = "ServerId"; + @org.eclipse.jdt.annotation.NonNull + private String serverId; + + public static final String JSON_PROPERTY_EXTERNAL_ID = "ExternalId"; + @org.eclipse.jdt.annotation.NonNull + private String externalId; + + public static final String JSON_PROPERTY_CHANNEL_ID = "ChannelId"; + @org.eclipse.jdt.annotation.NonNull + private UUID channelId; + + public static final String JSON_PROPERTY_EXTERNAL_CHANNEL_ID = "ExternalChannelId"; + @org.eclipse.jdt.annotation.NonNull + private String externalChannelId; + + public static final String JSON_PROPERTY_CHANNEL_NAME = "ChannelName"; + @org.eclipse.jdt.annotation.NonNull + private String channelName; + + public static final String JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG = "ChannelPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String channelPrimaryImageTag; + + public static final String JSON_PROPERTY_PROGRAM_ID = "ProgramId"; + @org.eclipse.jdt.annotation.NonNull + private String programId; + + public static final String JSON_PROPERTY_EXTERNAL_PROGRAM_ID = "ExternalProgramId"; + @org.eclipse.jdt.annotation.NonNull + private String externalProgramId; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_OVERVIEW = "Overview"; + @org.eclipse.jdt.annotation.NonNull + private String overview; + + public static final String JSON_PROPERTY_START_DATE = "StartDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime startDate; + + public static final String JSON_PROPERTY_END_DATE = "EndDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime endDate; + + public static final String JSON_PROPERTY_SERVICE_NAME = "ServiceName"; + @org.eclipse.jdt.annotation.NonNull + private String serviceName; + + public static final String JSON_PROPERTY_PRIORITY = "Priority"; + @org.eclipse.jdt.annotation.NonNull + private Integer priority; + + public static final String JSON_PROPERTY_PRE_PADDING_SECONDS = "PrePaddingSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer prePaddingSeconds; + + public static final String JSON_PROPERTY_POST_PADDING_SECONDS = "PostPaddingSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer postPaddingSeconds; + + public static final String JSON_PROPERTY_IS_PRE_PADDING_REQUIRED = "IsPrePaddingRequired"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPrePaddingRequired; + + public static final String JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID = "ParentBackdropItemId"; + @org.eclipse.jdt.annotation.NonNull + private String parentBackdropItemId; + + public static final String JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS = "ParentBackdropImageTags"; + @org.eclipse.jdt.annotation.NonNull + private List parentBackdropImageTags; + + public static final String JSON_PROPERTY_IS_POST_PADDING_REQUIRED = "IsPostPaddingRequired"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPostPaddingRequired; + + public static final String JSON_PROPERTY_KEEP_UNTIL = "KeepUntil"; + @org.eclipse.jdt.annotation.NonNull + private KeepUntil keepUntil; + + public static final String JSON_PROPERTY_RECORD_ANY_TIME = "RecordAnyTime"; + @org.eclipse.jdt.annotation.NonNull + private Boolean recordAnyTime; + + public static final String JSON_PROPERTY_SKIP_EPISODES_IN_LIBRARY = "SkipEpisodesInLibrary"; + @org.eclipse.jdt.annotation.NonNull + private Boolean skipEpisodesInLibrary; + + public static final String JSON_PROPERTY_RECORD_ANY_CHANNEL = "RecordAnyChannel"; + @org.eclipse.jdt.annotation.NonNull + private Boolean recordAnyChannel; + + public static final String JSON_PROPERTY_KEEP_UP_TO = "KeepUpTo"; + @org.eclipse.jdt.annotation.NonNull + private Integer keepUpTo; + + public static final String JSON_PROPERTY_RECORD_NEW_ONLY = "RecordNewOnly"; + @org.eclipse.jdt.annotation.NonNull + private Boolean recordNewOnly; + + public static final String JSON_PROPERTY_DAYS = "Days"; + @org.eclipse.jdt.annotation.NonNull + private List days; + + public static final String JSON_PROPERTY_DAY_PATTERN = "DayPattern"; + @org.eclipse.jdt.annotation.NonNull + private DayPattern dayPattern; + + public static final String JSON_PROPERTY_IMAGE_TAGS = "ImageTags"; + @org.eclipse.jdt.annotation.NonNull + private Map imageTags; + + public static final String JSON_PROPERTY_PARENT_THUMB_ITEM_ID = "ParentThumbItemId"; + @org.eclipse.jdt.annotation.NonNull + private String parentThumbItemId; + + public static final String JSON_PROPERTY_PARENT_THUMB_IMAGE_TAG = "ParentThumbImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String parentThumbImageTag; + + public static final String JSON_PROPERTY_PARENT_PRIMARY_IMAGE_ITEM_ID = "ParentPrimaryImageItemId"; + @org.eclipse.jdt.annotation.NonNull + private String parentPrimaryImageItemId; + + public static final String JSON_PROPERTY_PARENT_PRIMARY_IMAGE_TAG = "ParentPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String parentPrimaryImageTag; + + public SeriesTimerInfoDto() { + } + + public SeriesTimerInfoDto id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the Id of the recording. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public SeriesTimerInfoDto type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public SeriesTimerInfoDto serverId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + return this; + } + + /** + * Gets or sets the server identifier. + * + * @return serverId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerId() { + return serverId; + } + + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + } + + public SeriesTimerInfoDto externalId(@org.eclipse.jdt.annotation.NonNull String externalId) { + this.externalId = externalId; + return this; + } + + /** + * Gets or sets the external identifier. + * + * @return externalId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExternalId() { + return externalId; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalId(@org.eclipse.jdt.annotation.NonNull String externalId) { + this.externalId = externalId; + } + + public SeriesTimerInfoDto channelId(@org.eclipse.jdt.annotation.NonNull UUID channelId) { + this.channelId = channelId; + return this; + } + + /** + * Gets or sets the channel id of the recording. + * + * @return channelId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getChannelId() { + return channelId; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelId(@org.eclipse.jdt.annotation.NonNull UUID channelId) { + this.channelId = channelId; + } + + public SeriesTimerInfoDto externalChannelId(@org.eclipse.jdt.annotation.NonNull String externalChannelId) { + this.externalChannelId = externalChannelId; + return this; + } + + /** + * Gets or sets the external channel identifier. + * + * @return externalChannelId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExternalChannelId() { + return externalChannelId; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalChannelId(@org.eclipse.jdt.annotation.NonNull String externalChannelId) { + this.externalChannelId = externalChannelId; + } + + public SeriesTimerInfoDto channelName(@org.eclipse.jdt.annotation.NonNull String channelName) { + this.channelName = channelName; + return this; + } + + /** + * Gets or sets the channel name of the recording. + * + * @return channelName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelName() { + return channelName; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelName(@org.eclipse.jdt.annotation.NonNull String channelName) { + this.channelName = channelName; + } + + public SeriesTimerInfoDto channelPrimaryImageTag( + @org.eclipse.jdt.annotation.NonNull String channelPrimaryImageTag) { + this.channelPrimaryImageTag = channelPrimaryImageTag; + return this; + } + + /** + * Get channelPrimaryImageTag + * + * @return channelPrimaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelPrimaryImageTag() { + return channelPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String channelPrimaryImageTag) { + this.channelPrimaryImageTag = channelPrimaryImageTag; + } + + public SeriesTimerInfoDto programId(@org.eclipse.jdt.annotation.NonNull String programId) { + this.programId = programId; + return this; + } + + /** + * Gets or sets the program identifier. + * + * @return programId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProgramId() { + return programId; + } + + @JsonProperty(JSON_PROPERTY_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgramId(@org.eclipse.jdt.annotation.NonNull String programId) { + this.programId = programId; + } + + public SeriesTimerInfoDto externalProgramId(@org.eclipse.jdt.annotation.NonNull String externalProgramId) { + this.externalProgramId = externalProgramId; + return this; + } + + /** + * Gets or sets the external program identifier. + * + * @return externalProgramId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExternalProgramId() { + return externalProgramId; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalProgramId(@org.eclipse.jdt.annotation.NonNull String externalProgramId) { + this.externalProgramId = externalProgramId; + } + + public SeriesTimerInfoDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name of the recording. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public SeriesTimerInfoDto overview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + return this; + } + + /** + * Gets or sets the description of the recording. + * + * @return overview + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOverview() { + return overview; + } + + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOverview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + } + + public SeriesTimerInfoDto startDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Gets or sets the start date of the recording, in UTC. + * + * @return startDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartDate() { + return startDate; + } + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + } + + public SeriesTimerInfoDto endDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Gets or sets the end date of the recording, in UTC. + * + * @return endDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndDate() { + return endDate; + } + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + } + + public SeriesTimerInfoDto serviceName(@org.eclipse.jdt.annotation.NonNull String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Gets or sets the name of the service. + * + * @return serviceName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServiceName() { + return serviceName; + } + + @JsonProperty(JSON_PROPERTY_SERVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServiceName(@org.eclipse.jdt.annotation.NonNull String serviceName) { + this.serviceName = serviceName; + } + + public SeriesTimerInfoDto priority(@org.eclipse.jdt.annotation.NonNull Integer priority) { + this.priority = priority; + return this; + } + + /** + * Gets or sets the priority. + * + * @return priority + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPriority() { + return priority; + } + + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPriority(@org.eclipse.jdt.annotation.NonNull Integer priority) { + this.priority = priority; + } + + public SeriesTimerInfoDto prePaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer prePaddingSeconds) { + this.prePaddingSeconds = prePaddingSeconds; + return this; + } + + /** + * Gets or sets the pre padding seconds. + * + * @return prePaddingSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRE_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrePaddingSeconds() { + return prePaddingSeconds; + } + + @JsonProperty(JSON_PROPERTY_PRE_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrePaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer prePaddingSeconds) { + this.prePaddingSeconds = prePaddingSeconds; + } + + public SeriesTimerInfoDto postPaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer postPaddingSeconds) { + this.postPaddingSeconds = postPaddingSeconds; + return this; + } + + /** + * Gets or sets the post padding seconds. + * + * @return postPaddingSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POST_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPostPaddingSeconds() { + return postPaddingSeconds; + } + + @JsonProperty(JSON_PROPERTY_POST_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPostPaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer postPaddingSeconds) { + this.postPaddingSeconds = postPaddingSeconds; + } + + public SeriesTimerInfoDto isPrePaddingRequired(@org.eclipse.jdt.annotation.NonNull Boolean isPrePaddingRequired) { + this.isPrePaddingRequired = isPrePaddingRequired; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is pre padding required. + * + * @return isPrePaddingRequired + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PRE_PADDING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPrePaddingRequired() { + return isPrePaddingRequired; + } + + @JsonProperty(JSON_PROPERTY_IS_PRE_PADDING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPrePaddingRequired(@org.eclipse.jdt.annotation.NonNull Boolean isPrePaddingRequired) { + this.isPrePaddingRequired = isPrePaddingRequired; + } + + public SeriesTimerInfoDto parentBackdropItemId(@org.eclipse.jdt.annotation.NonNull String parentBackdropItemId) { + this.parentBackdropItemId = parentBackdropItemId; + return this; + } + + /** + * Gets or sets the Id of the Parent that has a backdrop if the item does not have one. + * + * @return parentBackdropItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentBackdropItemId() { + return parentBackdropItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentBackdropItemId(@org.eclipse.jdt.annotation.NonNull String parentBackdropItemId) { + this.parentBackdropItemId = parentBackdropItemId; + } + + public SeriesTimerInfoDto parentBackdropImageTags( + @org.eclipse.jdt.annotation.NonNull List parentBackdropImageTags) { + this.parentBackdropImageTags = parentBackdropImageTags; + return this; + } + + public SeriesTimerInfoDto addParentBackdropImageTagsItem(String parentBackdropImageTagsItem) { + if (this.parentBackdropImageTags == null) { + this.parentBackdropImageTags = new ArrayList<>(); + } + this.parentBackdropImageTags.add(parentBackdropImageTagsItem); + return this; + } + + /** + * Gets or sets the parent backdrop image tags. + * + * @return parentBackdropImageTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getParentBackdropImageTags() { + return parentBackdropImageTags; + } + + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentBackdropImageTags(@org.eclipse.jdt.annotation.NonNull List parentBackdropImageTags) { + this.parentBackdropImageTags = parentBackdropImageTags; + } + + public SeriesTimerInfoDto isPostPaddingRequired(@org.eclipse.jdt.annotation.NonNull Boolean isPostPaddingRequired) { + this.isPostPaddingRequired = isPostPaddingRequired; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is post padding required. + * + * @return isPostPaddingRequired + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_POST_PADDING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPostPaddingRequired() { + return isPostPaddingRequired; + } + + @JsonProperty(JSON_PROPERTY_IS_POST_PADDING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPostPaddingRequired(@org.eclipse.jdt.annotation.NonNull Boolean isPostPaddingRequired) { + this.isPostPaddingRequired = isPostPaddingRequired; + } + + public SeriesTimerInfoDto keepUntil(@org.eclipse.jdt.annotation.NonNull KeepUntil keepUntil) { + this.keepUntil = keepUntil; + return this; + } + + /** + * Get keepUntil + * + * @return keepUntil + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KEEP_UNTIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public KeepUntil getKeepUntil() { + return keepUntil; + } + + @JsonProperty(JSON_PROPERTY_KEEP_UNTIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKeepUntil(@org.eclipse.jdt.annotation.NonNull KeepUntil keepUntil) { + this.keepUntil = keepUntil; + } + + public SeriesTimerInfoDto recordAnyTime(@org.eclipse.jdt.annotation.NonNull Boolean recordAnyTime) { + this.recordAnyTime = recordAnyTime; + return this; + } + + /** + * Gets or sets a value indicating whether [record any time]. + * + * @return recordAnyTime + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RECORD_ANY_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRecordAnyTime() { + return recordAnyTime; + } + + @JsonProperty(JSON_PROPERTY_RECORD_ANY_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecordAnyTime(@org.eclipse.jdt.annotation.NonNull Boolean recordAnyTime) { + this.recordAnyTime = recordAnyTime; + } + + public SeriesTimerInfoDto skipEpisodesInLibrary(@org.eclipse.jdt.annotation.NonNull Boolean skipEpisodesInLibrary) { + this.skipEpisodesInLibrary = skipEpisodesInLibrary; + return this; + } + + /** + * Get skipEpisodesInLibrary + * + * @return skipEpisodesInLibrary + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SKIP_EPISODES_IN_LIBRARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSkipEpisodesInLibrary() { + return skipEpisodesInLibrary; + } + + @JsonProperty(JSON_PROPERTY_SKIP_EPISODES_IN_LIBRARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipEpisodesInLibrary(@org.eclipse.jdt.annotation.NonNull Boolean skipEpisodesInLibrary) { + this.skipEpisodesInLibrary = skipEpisodesInLibrary; + } + + public SeriesTimerInfoDto recordAnyChannel(@org.eclipse.jdt.annotation.NonNull Boolean recordAnyChannel) { + this.recordAnyChannel = recordAnyChannel; + return this; + } + + /** + * Gets or sets a value indicating whether [record any channel]. + * + * @return recordAnyChannel + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RECORD_ANY_CHANNEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRecordAnyChannel() { + return recordAnyChannel; + } + + @JsonProperty(JSON_PROPERTY_RECORD_ANY_CHANNEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecordAnyChannel(@org.eclipse.jdt.annotation.NonNull Boolean recordAnyChannel) { + this.recordAnyChannel = recordAnyChannel; + } + + public SeriesTimerInfoDto keepUpTo(@org.eclipse.jdt.annotation.NonNull Integer keepUpTo) { + this.keepUpTo = keepUpTo; + return this; + } + + /** + * Get keepUpTo + * + * @return keepUpTo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KEEP_UP_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getKeepUpTo() { + return keepUpTo; + } + + @JsonProperty(JSON_PROPERTY_KEEP_UP_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKeepUpTo(@org.eclipse.jdt.annotation.NonNull Integer keepUpTo) { + this.keepUpTo = keepUpTo; + } + + public SeriesTimerInfoDto recordNewOnly(@org.eclipse.jdt.annotation.NonNull Boolean recordNewOnly) { + this.recordNewOnly = recordNewOnly; + return this; + } + + /** + * Gets or sets a value indicating whether [record new only]. + * + * @return recordNewOnly + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RECORD_NEW_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRecordNewOnly() { + return recordNewOnly; + } + + @JsonProperty(JSON_PROPERTY_RECORD_NEW_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecordNewOnly(@org.eclipse.jdt.annotation.NonNull Boolean recordNewOnly) { + this.recordNewOnly = recordNewOnly; + } + + public SeriesTimerInfoDto days(@org.eclipse.jdt.annotation.NonNull List days) { + this.days = days; + return this; + } + + public SeriesTimerInfoDto addDaysItem(DayOfWeek daysItem) { + if (this.days == null) { + this.days = new ArrayList<>(); + } + this.days.add(daysItem); + return this; + } + + /** + * Gets or sets the days. + * + * @return days + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDays() { + return days; + } + + @JsonProperty(JSON_PROPERTY_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDays(@org.eclipse.jdt.annotation.NonNull List days) { + this.days = days; + } + + public SeriesTimerInfoDto dayPattern(@org.eclipse.jdt.annotation.NonNull DayPattern dayPattern) { + this.dayPattern = dayPattern; + return this; + } + + /** + * Gets or sets the day pattern. + * + * @return dayPattern + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DAY_PATTERN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DayPattern getDayPattern() { + return dayPattern; + } + + @JsonProperty(JSON_PROPERTY_DAY_PATTERN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDayPattern(@org.eclipse.jdt.annotation.NonNull DayPattern dayPattern) { + this.dayPattern = dayPattern; + } + + public SeriesTimerInfoDto imageTags(@org.eclipse.jdt.annotation.NonNull Map imageTags) { + this.imageTags = imageTags; + return this; + } + + public SeriesTimerInfoDto putImageTagsItem(String key, String imageTagsItem) { + if (this.imageTags == null) { + this.imageTags = new HashMap<>(); + } + this.imageTags.put(key, imageTagsItem); + return this; + } + + /** + * Gets or sets the image tags. + * + * @return imageTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getImageTags() { + return imageTags; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageTags(@org.eclipse.jdt.annotation.NonNull Map imageTags) { + this.imageTags = imageTags; + } + + public SeriesTimerInfoDto parentThumbItemId(@org.eclipse.jdt.annotation.NonNull String parentThumbItemId) { + this.parentThumbItemId = parentThumbItemId; + return this; + } + + /** + * Gets or sets the parent thumb item id. + * + * @return parentThumbItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_THUMB_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentThumbItemId() { + return parentThumbItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_THUMB_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentThumbItemId(@org.eclipse.jdt.annotation.NonNull String parentThumbItemId) { + this.parentThumbItemId = parentThumbItemId; + } + + public SeriesTimerInfoDto parentThumbImageTag(@org.eclipse.jdt.annotation.NonNull String parentThumbImageTag) { + this.parentThumbImageTag = parentThumbImageTag; + return this; + } + + /** + * Gets or sets the parent thumb image tag. + * + * @return parentThumbImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_THUMB_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentThumbImageTag() { + return parentThumbImageTag; + } + + @JsonProperty(JSON_PROPERTY_PARENT_THUMB_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentThumbImageTag(@org.eclipse.jdt.annotation.NonNull String parentThumbImageTag) { + this.parentThumbImageTag = parentThumbImageTag; + } + + public SeriesTimerInfoDto parentPrimaryImageItemId( + @org.eclipse.jdt.annotation.NonNull String parentPrimaryImageItemId) { + this.parentPrimaryImageItemId = parentPrimaryImageItemId; + return this; + } + + /** + * Gets or sets the parent primary image item identifier. + * + * @return parentPrimaryImageItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_PRIMARY_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentPrimaryImageItemId() { + return parentPrimaryImageItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_PRIMARY_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentPrimaryImageItemId(@org.eclipse.jdt.annotation.NonNull String parentPrimaryImageItemId) { + this.parentPrimaryImageItemId = parentPrimaryImageItemId; + } + + public SeriesTimerInfoDto parentPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String parentPrimaryImageTag) { + this.parentPrimaryImageTag = parentPrimaryImageTag; + return this; + } + + /** + * Gets or sets the parent primary image tag. + * + * @return parentPrimaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentPrimaryImageTag() { + return parentPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_PARENT_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String parentPrimaryImageTag) { + this.parentPrimaryImageTag = parentPrimaryImageTag; + } + + /** + * Return true if this SeriesTimerInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SeriesTimerInfoDto seriesTimerInfoDto = (SeriesTimerInfoDto) o; + return Objects.equals(this.id, seriesTimerInfoDto.id) && Objects.equals(this.type, seriesTimerInfoDto.type) + && Objects.equals(this.serverId, seriesTimerInfoDto.serverId) + && Objects.equals(this.externalId, seriesTimerInfoDto.externalId) + && Objects.equals(this.channelId, seriesTimerInfoDto.channelId) + && Objects.equals(this.externalChannelId, seriesTimerInfoDto.externalChannelId) + && Objects.equals(this.channelName, seriesTimerInfoDto.channelName) + && Objects.equals(this.channelPrimaryImageTag, seriesTimerInfoDto.channelPrimaryImageTag) + && Objects.equals(this.programId, seriesTimerInfoDto.programId) + && Objects.equals(this.externalProgramId, seriesTimerInfoDto.externalProgramId) + && Objects.equals(this.name, seriesTimerInfoDto.name) + && Objects.equals(this.overview, seriesTimerInfoDto.overview) + && Objects.equals(this.startDate, seriesTimerInfoDto.startDate) + && Objects.equals(this.endDate, seriesTimerInfoDto.endDate) + && Objects.equals(this.serviceName, seriesTimerInfoDto.serviceName) + && Objects.equals(this.priority, seriesTimerInfoDto.priority) + && Objects.equals(this.prePaddingSeconds, seriesTimerInfoDto.prePaddingSeconds) + && Objects.equals(this.postPaddingSeconds, seriesTimerInfoDto.postPaddingSeconds) + && Objects.equals(this.isPrePaddingRequired, seriesTimerInfoDto.isPrePaddingRequired) + && Objects.equals(this.parentBackdropItemId, seriesTimerInfoDto.parentBackdropItemId) + && Objects.equals(this.parentBackdropImageTags, seriesTimerInfoDto.parentBackdropImageTags) + && Objects.equals(this.isPostPaddingRequired, seriesTimerInfoDto.isPostPaddingRequired) + && Objects.equals(this.keepUntil, seriesTimerInfoDto.keepUntil) + && Objects.equals(this.recordAnyTime, seriesTimerInfoDto.recordAnyTime) + && Objects.equals(this.skipEpisodesInLibrary, seriesTimerInfoDto.skipEpisodesInLibrary) + && Objects.equals(this.recordAnyChannel, seriesTimerInfoDto.recordAnyChannel) + && Objects.equals(this.keepUpTo, seriesTimerInfoDto.keepUpTo) + && Objects.equals(this.recordNewOnly, seriesTimerInfoDto.recordNewOnly) + && Objects.equals(this.days, seriesTimerInfoDto.days) + && Objects.equals(this.dayPattern, seriesTimerInfoDto.dayPattern) + && Objects.equals(this.imageTags, seriesTimerInfoDto.imageTags) + && Objects.equals(this.parentThumbItemId, seriesTimerInfoDto.parentThumbItemId) + && Objects.equals(this.parentThumbImageTag, seriesTimerInfoDto.parentThumbImageTag) + && Objects.equals(this.parentPrimaryImageItemId, seriesTimerInfoDto.parentPrimaryImageItemId) + && Objects.equals(this.parentPrimaryImageTag, seriesTimerInfoDto.parentPrimaryImageTag); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, serverId, externalId, channelId, externalChannelId, channelName, + channelPrimaryImageTag, programId, externalProgramId, name, overview, startDate, endDate, serviceName, + priority, prePaddingSeconds, postPaddingSeconds, isPrePaddingRequired, parentBackdropItemId, + parentBackdropImageTags, isPostPaddingRequired, keepUntil, recordAnyTime, skipEpisodesInLibrary, + recordAnyChannel, keepUpTo, recordNewOnly, days, dayPattern, imageTags, parentThumbItemId, + parentThumbImageTag, parentPrimaryImageItemId, parentPrimaryImageTag); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SeriesTimerInfoDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n"); + sb.append(" channelId: ").append(toIndentedString(channelId)).append("\n"); + sb.append(" externalChannelId: ").append(toIndentedString(externalChannelId)).append("\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" channelPrimaryImageTag: ").append(toIndentedString(channelPrimaryImageTag)).append("\n"); + sb.append(" programId: ").append(toIndentedString(programId)).append("\n"); + sb.append(" externalProgramId: ").append(toIndentedString(externalProgramId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" overview: ").append(toIndentedString(overview)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" serviceName: ").append(toIndentedString(serviceName)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" prePaddingSeconds: ").append(toIndentedString(prePaddingSeconds)).append("\n"); + sb.append(" postPaddingSeconds: ").append(toIndentedString(postPaddingSeconds)).append("\n"); + sb.append(" isPrePaddingRequired: ").append(toIndentedString(isPrePaddingRequired)).append("\n"); + sb.append(" parentBackdropItemId: ").append(toIndentedString(parentBackdropItemId)).append("\n"); + sb.append(" parentBackdropImageTags: ").append(toIndentedString(parentBackdropImageTags)).append("\n"); + sb.append(" isPostPaddingRequired: ").append(toIndentedString(isPostPaddingRequired)).append("\n"); + sb.append(" keepUntil: ").append(toIndentedString(keepUntil)).append("\n"); + sb.append(" recordAnyTime: ").append(toIndentedString(recordAnyTime)).append("\n"); + sb.append(" skipEpisodesInLibrary: ").append(toIndentedString(skipEpisodesInLibrary)).append("\n"); + sb.append(" recordAnyChannel: ").append(toIndentedString(recordAnyChannel)).append("\n"); + sb.append(" keepUpTo: ").append(toIndentedString(keepUpTo)).append("\n"); + sb.append(" recordNewOnly: ").append(toIndentedString(recordNewOnly)).append("\n"); + sb.append(" days: ").append(toIndentedString(days)).append("\n"); + sb.append(" dayPattern: ").append(toIndentedString(dayPattern)).append("\n"); + sb.append(" imageTags: ").append(toIndentedString(imageTags)).append("\n"); + sb.append(" parentThumbItemId: ").append(toIndentedString(parentThumbItemId)).append("\n"); + sb.append(" parentThumbImageTag: ").append(toIndentedString(parentThumbImageTag)).append("\n"); + sb.append(" parentPrimaryImageItemId: ").append(toIndentedString(parentPrimaryImageItemId)).append("\n"); + sb.append(" parentPrimaryImageTag: ").append(toIndentedString(parentPrimaryImageTag)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `ServerId` to the URL query string + if (getServerId() != null) { + joiner.add(String.format("%sServerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerId())))); + } + + // add `ExternalId` to the URL query string + if (getExternalId() != null) { + joiner.add(String.format("%sExternalId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExternalId())))); + } + + // add `ChannelId` to the URL query string + if (getChannelId() != null) { + joiner.add(String.format("%sChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelId())))); + } + + // add `ExternalChannelId` to the URL query string + if (getExternalChannelId() != null) { + joiner.add(String.format("%sExternalChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExternalChannelId())))); + } + + // add `ChannelName` to the URL query string + if (getChannelName() != null) { + joiner.add(String.format("%sChannelName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelName())))); + } + + // add `ChannelPrimaryImageTag` to the URL query string + if (getChannelPrimaryImageTag() != null) { + joiner.add(String.format("%sChannelPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelPrimaryImageTag())))); + } + + // add `ProgramId` to the URL query string + if (getProgramId() != null) { + joiner.add(String.format("%sProgramId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProgramId())))); + } + + // add `ExternalProgramId` to the URL query string + if (getExternalProgramId() != null) { + joiner.add(String.format("%sExternalProgramId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExternalProgramId())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Overview` to the URL query string + if (getOverview() != null) { + joiner.add(String.format("%sOverview%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOverview())))); + } + + // add `StartDate` to the URL query string + if (getStartDate() != null) { + joiner.add(String.format("%sStartDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartDate())))); + } + + // add `EndDate` to the URL query string + if (getEndDate() != null) { + joiner.add(String.format("%sEndDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndDate())))); + } + + // add `ServiceName` to the URL query string + if (getServiceName() != null) { + joiner.add(String.format("%sServiceName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServiceName())))); + } + + // add `Priority` to the URL query string + if (getPriority() != null) { + joiner.add(String.format("%sPriority%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPriority())))); + } + + // add `PrePaddingSeconds` to the URL query string + if (getPrePaddingSeconds() != null) { + joiner.add(String.format("%sPrePaddingSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrePaddingSeconds())))); + } + + // add `PostPaddingSeconds` to the URL query string + if (getPostPaddingSeconds() != null) { + joiner.add(String.format("%sPostPaddingSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPostPaddingSeconds())))); + } + + // add `IsPrePaddingRequired` to the URL query string + if (getIsPrePaddingRequired() != null) { + joiner.add(String.format("%sIsPrePaddingRequired%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPrePaddingRequired())))); + } + + // add `ParentBackdropItemId` to the URL query string + if (getParentBackdropItemId() != null) { + joiner.add(String.format("%sParentBackdropItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentBackdropItemId())))); + } + + // add `ParentBackdropImageTags` to the URL query string + if (getParentBackdropImageTags() != null) { + for (int i = 0; i < getParentBackdropImageTags().size(); i++) { + joiner.add(String.format("%sParentBackdropImageTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getParentBackdropImageTags().get(i))))); + } + } + + // add `IsPostPaddingRequired` to the URL query string + if (getIsPostPaddingRequired() != null) { + joiner.add(String.format("%sIsPostPaddingRequired%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPostPaddingRequired())))); + } + + // add `KeepUntil` to the URL query string + if (getKeepUntil() != null) { + joiner.add(String.format("%sKeepUntil%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getKeepUntil())))); + } + + // add `RecordAnyTime` to the URL query string + if (getRecordAnyTime() != null) { + joiner.add(String.format("%sRecordAnyTime%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRecordAnyTime())))); + } + + // add `SkipEpisodesInLibrary` to the URL query string + if (getSkipEpisodesInLibrary() != null) { + joiner.add(String.format("%sSkipEpisodesInLibrary%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSkipEpisodesInLibrary())))); + } + + // add `RecordAnyChannel` to the URL query string + if (getRecordAnyChannel() != null) { + joiner.add(String.format("%sRecordAnyChannel%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRecordAnyChannel())))); + } + + // add `KeepUpTo` to the URL query string + if (getKeepUpTo() != null) { + joiner.add(String.format("%sKeepUpTo%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getKeepUpTo())))); + } + + // add `RecordNewOnly` to the URL query string + if (getRecordNewOnly() != null) { + joiner.add(String.format("%sRecordNewOnly%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRecordNewOnly())))); + } + + // add `Days` to the URL query string + if (getDays() != null) { + for (int i = 0; i < getDays().size(); i++) { + if (getDays().get(i) != null) { + joiner.add(String.format("%sDays%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDays().get(i))))); + } + } + } + + // add `DayPattern` to the URL query string + if (getDayPattern() != null) { + joiner.add(String.format("%sDayPattern%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDayPattern())))); + } + + // add `ImageTags` to the URL query string + if (getImageTags() != null) { + for (String _key : getImageTags().keySet()) { + joiner.add(String.format("%sImageTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getImageTags().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getImageTags().get(_key))))); + } + } + + // add `ParentThumbItemId` to the URL query string + if (getParentThumbItemId() != null) { + joiner.add(String.format("%sParentThumbItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentThumbItemId())))); + } + + // add `ParentThumbImageTag` to the URL query string + if (getParentThumbImageTag() != null) { + joiner.add(String.format("%sParentThumbImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentThumbImageTag())))); + } + + // add `ParentPrimaryImageItemId` to the URL query string + if (getParentPrimaryImageItemId() != null) { + joiner.add(String.format("%sParentPrimaryImageItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentPrimaryImageItemId())))); + } + + // add `ParentPrimaryImageTag` to the URL query string + if (getParentPrimaryImageTag() != null) { + joiner.add(String.format("%sParentPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentPrimaryImageTag())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SeriesTimerInfoDto instance; + + public Builder() { + this(new SeriesTimerInfoDto()); + } + + protected Builder(SeriesTimerInfoDto instance) { + this.instance = instance; + } + + public SeriesTimerInfoDto.Builder id(String id) { + this.instance.id = id; + return this; + } + + public SeriesTimerInfoDto.Builder type(String type) { + this.instance.type = type; + return this; + } + + public SeriesTimerInfoDto.Builder serverId(String serverId) { + this.instance.serverId = serverId; + return this; + } + + public SeriesTimerInfoDto.Builder externalId(String externalId) { + this.instance.externalId = externalId; + return this; + } + + public SeriesTimerInfoDto.Builder channelId(UUID channelId) { + this.instance.channelId = channelId; + return this; + } + + public SeriesTimerInfoDto.Builder externalChannelId(String externalChannelId) { + this.instance.externalChannelId = externalChannelId; + return this; + } + + public SeriesTimerInfoDto.Builder channelName(String channelName) { + this.instance.channelName = channelName; + return this; + } + + public SeriesTimerInfoDto.Builder channelPrimaryImageTag(String channelPrimaryImageTag) { + this.instance.channelPrimaryImageTag = channelPrimaryImageTag; + return this; + } + + public SeriesTimerInfoDto.Builder programId(String programId) { + this.instance.programId = programId; + return this; + } + + public SeriesTimerInfoDto.Builder externalProgramId(String externalProgramId) { + this.instance.externalProgramId = externalProgramId; + return this; + } + + public SeriesTimerInfoDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public SeriesTimerInfoDto.Builder overview(String overview) { + this.instance.overview = overview; + return this; + } + + public SeriesTimerInfoDto.Builder startDate(OffsetDateTime startDate) { + this.instance.startDate = startDate; + return this; + } + + public SeriesTimerInfoDto.Builder endDate(OffsetDateTime endDate) { + this.instance.endDate = endDate; + return this; + } + + public SeriesTimerInfoDto.Builder serviceName(String serviceName) { + this.instance.serviceName = serviceName; + return this; + } + + public SeriesTimerInfoDto.Builder priority(Integer priority) { + this.instance.priority = priority; + return this; + } + + public SeriesTimerInfoDto.Builder prePaddingSeconds(Integer prePaddingSeconds) { + this.instance.prePaddingSeconds = prePaddingSeconds; + return this; + } + + public SeriesTimerInfoDto.Builder postPaddingSeconds(Integer postPaddingSeconds) { + this.instance.postPaddingSeconds = postPaddingSeconds; + return this; + } + + public SeriesTimerInfoDto.Builder isPrePaddingRequired(Boolean isPrePaddingRequired) { + this.instance.isPrePaddingRequired = isPrePaddingRequired; + return this; + } + + public SeriesTimerInfoDto.Builder parentBackdropItemId(String parentBackdropItemId) { + this.instance.parentBackdropItemId = parentBackdropItemId; + return this; + } + + public SeriesTimerInfoDto.Builder parentBackdropImageTags(List parentBackdropImageTags) { + this.instance.parentBackdropImageTags = parentBackdropImageTags; + return this; + } + + public SeriesTimerInfoDto.Builder isPostPaddingRequired(Boolean isPostPaddingRequired) { + this.instance.isPostPaddingRequired = isPostPaddingRequired; + return this; + } + + public SeriesTimerInfoDto.Builder keepUntil(KeepUntil keepUntil) { + this.instance.keepUntil = keepUntil; + return this; + } + + public SeriesTimerInfoDto.Builder recordAnyTime(Boolean recordAnyTime) { + this.instance.recordAnyTime = recordAnyTime; + return this; + } + + public SeriesTimerInfoDto.Builder skipEpisodesInLibrary(Boolean skipEpisodesInLibrary) { + this.instance.skipEpisodesInLibrary = skipEpisodesInLibrary; + return this; + } + + public SeriesTimerInfoDto.Builder recordAnyChannel(Boolean recordAnyChannel) { + this.instance.recordAnyChannel = recordAnyChannel; + return this; + } + + public SeriesTimerInfoDto.Builder keepUpTo(Integer keepUpTo) { + this.instance.keepUpTo = keepUpTo; + return this; + } + + public SeriesTimerInfoDto.Builder recordNewOnly(Boolean recordNewOnly) { + this.instance.recordNewOnly = recordNewOnly; + return this; + } + + public SeriesTimerInfoDto.Builder days(List days) { + this.instance.days = days; + return this; + } + + public SeriesTimerInfoDto.Builder dayPattern(DayPattern dayPattern) { + this.instance.dayPattern = dayPattern; + return this; + } + + public SeriesTimerInfoDto.Builder imageTags(Map imageTags) { + this.instance.imageTags = imageTags; + return this; + } + + public SeriesTimerInfoDto.Builder parentThumbItemId(String parentThumbItemId) { + this.instance.parentThumbItemId = parentThumbItemId; + return this; + } + + public SeriesTimerInfoDto.Builder parentThumbImageTag(String parentThumbImageTag) { + this.instance.parentThumbImageTag = parentThumbImageTag; + return this; + } + + public SeriesTimerInfoDto.Builder parentPrimaryImageItemId(String parentPrimaryImageItemId) { + this.instance.parentPrimaryImageItemId = parentPrimaryImageItemId; + return this; + } + + public SeriesTimerInfoDto.Builder parentPrimaryImageTag(String parentPrimaryImageTag) { + this.instance.parentPrimaryImageTag = parentPrimaryImageTag; + return this; + } + + /** + * returns a built SeriesTimerInfoDto instance. + * + * The builder is not reusable. + */ + public SeriesTimerInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SeriesTimerInfoDto.Builder builder() { + return new SeriesTimerInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SeriesTimerInfoDto.Builder toBuilder() { + return new SeriesTimerInfoDto.Builder().id(getId()).type(getType()).serverId(getServerId()) + .externalId(getExternalId()).channelId(getChannelId()).externalChannelId(getExternalChannelId()) + .channelName(getChannelName()).channelPrimaryImageTag(getChannelPrimaryImageTag()) + .programId(getProgramId()).externalProgramId(getExternalProgramId()).name(getName()) + .overview(getOverview()).startDate(getStartDate()).endDate(getEndDate()).serviceName(getServiceName()) + .priority(getPriority()).prePaddingSeconds(getPrePaddingSeconds()) + .postPaddingSeconds(getPostPaddingSeconds()).isPrePaddingRequired(getIsPrePaddingRequired()) + .parentBackdropItemId(getParentBackdropItemId()).parentBackdropImageTags(getParentBackdropImageTags()) + .isPostPaddingRequired(getIsPostPaddingRequired()).keepUntil(getKeepUntil()) + .recordAnyTime(getRecordAnyTime()).skipEpisodesInLibrary(getSkipEpisodesInLibrary()) + .recordAnyChannel(getRecordAnyChannel()).keepUpTo(getKeepUpTo()).recordNewOnly(getRecordNewOnly()) + .days(getDays()).dayPattern(getDayPattern()).imageTags(getImageTags()) + .parentThumbItemId(getParentThumbItemId()).parentThumbImageTag(getParentThumbImageTag()) + .parentPrimaryImageItemId(getParentPrimaryImageItemId()) + .parentPrimaryImageTag(getParentPrimaryImageTag()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesTimerInfoDtoQueryResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesTimerInfoDtoQueryResult.java new file mode 100644 index 0000000000000..084b049d63be4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SeriesTimerInfoDtoQueryResult.java @@ -0,0 +1,290 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * SeriesTimerInfoDtoQueryResult + */ +@JsonPropertyOrder({ SeriesTimerInfoDtoQueryResult.JSON_PROPERTY_ITEMS, + SeriesTimerInfoDtoQueryResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, + SeriesTimerInfoDtoQueryResult.JSON_PROPERTY_START_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SeriesTimerInfoDtoQueryResult { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items; + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public SeriesTimerInfoDtoQueryResult() { + } + + public SeriesTimerInfoDtoQueryResult items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public SeriesTimerInfoDtoQueryResult addItemsItem(SeriesTimerInfoDto itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Gets or sets the items. + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public SeriesTimerInfoDtoQueryResult totalRecordCount( + @org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total number of records available. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public SeriesTimerInfoDtoQueryResult startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the index of the first record in Items. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + /** + * Return true if this SeriesTimerInfoDtoQueryResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SeriesTimerInfoDtoQueryResult seriesTimerInfoDtoQueryResult = (SeriesTimerInfoDtoQueryResult) o; + return Objects.equals(this.items, seriesTimerInfoDtoQueryResult.items) + && Objects.equals(this.totalRecordCount, seriesTimerInfoDtoQueryResult.totalRecordCount) + && Objects.equals(this.startIndex, seriesTimerInfoDtoQueryResult.startIndex); + } + + @Override + public int hashCode() { + return Objects.hash(items, totalRecordCount, startIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SeriesTimerInfoDtoQueryResult {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SeriesTimerInfoDtoQueryResult instance; + + public Builder() { + this(new SeriesTimerInfoDtoQueryResult()); + } + + protected Builder(SeriesTimerInfoDtoQueryResult instance) { + this.instance = instance; + } + + public SeriesTimerInfoDtoQueryResult.Builder items(List items) { + this.instance.items = items; + return this; + } + + public SeriesTimerInfoDtoQueryResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public SeriesTimerInfoDtoQueryResult.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + /** + * returns a built SeriesTimerInfoDtoQueryResult instance. + * + * The builder is not reusable. + */ + public SeriesTimerInfoDtoQueryResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SeriesTimerInfoDtoQueryResult.Builder builder() { + return new SeriesTimerInfoDtoQueryResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SeriesTimerInfoDtoQueryResult.Builder toBuilder() { + return new SeriesTimerInfoDtoQueryResult.Builder().items(getItems()).totalRecordCount(getTotalRecordCount()) + .startIndex(getStartIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ServerConfiguration.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ServerConfiguration.java new file mode 100644 index 0000000000000..35e2f86394c10 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ServerConfiguration.java @@ -0,0 +1,2306 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Represents the server configuration. + */ +@JsonPropertyOrder({ ServerConfiguration.JSON_PROPERTY_LOG_FILE_RETENTION_DAYS, + ServerConfiguration.JSON_PROPERTY_IS_STARTUP_WIZARD_COMPLETED, ServerConfiguration.JSON_PROPERTY_CACHE_PATH, + ServerConfiguration.JSON_PROPERTY_PREVIOUS_VERSION, ServerConfiguration.JSON_PROPERTY_PREVIOUS_VERSION_STR, + ServerConfiguration.JSON_PROPERTY_ENABLE_METRICS, + ServerConfiguration.JSON_PROPERTY_ENABLE_NORMALIZED_ITEM_BY_NAME_IDS, + ServerConfiguration.JSON_PROPERTY_IS_PORT_AUTHORIZED, ServerConfiguration.JSON_PROPERTY_QUICK_CONNECT_AVAILABLE, + ServerConfiguration.JSON_PROPERTY_ENABLE_CASE_SENSITIVE_ITEM_IDS, + ServerConfiguration.JSON_PROPERTY_DISABLE_LIVE_TV_CHANNEL_USER_DATA_NAME, + ServerConfiguration.JSON_PROPERTY_METADATA_PATH, ServerConfiguration.JSON_PROPERTY_METADATA_NETWORK_PATH, + ServerConfiguration.JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE, + ServerConfiguration.JSON_PROPERTY_METADATA_COUNTRY_CODE, + ServerConfiguration.JSON_PROPERTY_SORT_REPLACE_CHARACTERS, + ServerConfiguration.JSON_PROPERTY_SORT_REMOVE_CHARACTERS, ServerConfiguration.JSON_PROPERTY_SORT_REMOVE_WORDS, + ServerConfiguration.JSON_PROPERTY_MIN_RESUME_PCT, ServerConfiguration.JSON_PROPERTY_MAX_RESUME_PCT, + ServerConfiguration.JSON_PROPERTY_MIN_RESUME_DURATION_SECONDS, + ServerConfiguration.JSON_PROPERTY_MIN_AUDIOBOOK_RESUME, ServerConfiguration.JSON_PROPERTY_MAX_AUDIOBOOK_RESUME, + ServerConfiguration.JSON_PROPERTY_LIBRARY_MONITOR_DELAY, + ServerConfiguration.JSON_PROPERTY_IMAGE_SAVING_CONVENTION, ServerConfiguration.JSON_PROPERTY_METADATA_OPTIONS, + ServerConfiguration.JSON_PROPERTY_SKIP_DESERIALIZATION_FOR_BASIC_TYPES, + ServerConfiguration.JSON_PROPERTY_SERVER_NAME, ServerConfiguration.JSON_PROPERTY_UI_CULTURE, + ServerConfiguration.JSON_PROPERTY_SAVE_METADATA_HIDDEN, ServerConfiguration.JSON_PROPERTY_CONTENT_TYPES, + ServerConfiguration.JSON_PROPERTY_REMOTE_CLIENT_BITRATE_LIMIT, + ServerConfiguration.JSON_PROPERTY_ENABLE_FOLDER_VIEW, + ServerConfiguration.JSON_PROPERTY_ENABLE_GROUPING_INTO_COLLECTIONS, + ServerConfiguration.JSON_PROPERTY_DISPLAY_SPECIALS_WITHIN_SEASONS, + ServerConfiguration.JSON_PROPERTY_CODECS_USED, ServerConfiguration.JSON_PROPERTY_PLUGIN_REPOSITORIES, + ServerConfiguration.JSON_PROPERTY_ENABLE_EXTERNAL_CONTENT_IN_SUGGESTIONS, + ServerConfiguration.JSON_PROPERTY_IMAGE_EXTRACTION_TIMEOUT_MS, + ServerConfiguration.JSON_PROPERTY_PATH_SUBSTITUTIONS, + ServerConfiguration.JSON_PROPERTY_ENABLE_SLOW_RESPONSE_WARNING, + ServerConfiguration.JSON_PROPERTY_SLOW_RESPONSE_THRESHOLD_MS, ServerConfiguration.JSON_PROPERTY_CORS_HOSTS, + ServerConfiguration.JSON_PROPERTY_ACTIVITY_LOG_RETENTION_DAYS, + ServerConfiguration.JSON_PROPERTY_LIBRARY_SCAN_FANOUT_CONCURRENCY, + ServerConfiguration.JSON_PROPERTY_LIBRARY_METADATA_REFRESH_CONCURRENCY, + ServerConfiguration.JSON_PROPERTY_REMOVE_OLD_PLUGINS, + ServerConfiguration.JSON_PROPERTY_ALLOW_CLIENT_LOG_UPLOAD }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ServerConfiguration { + public static final String JSON_PROPERTY_LOG_FILE_RETENTION_DAYS = "LogFileRetentionDays"; + @org.eclipse.jdt.annotation.NonNull + private Integer logFileRetentionDays; + + public static final String JSON_PROPERTY_IS_STARTUP_WIZARD_COMPLETED = "IsStartupWizardCompleted"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isStartupWizardCompleted; + + public static final String JSON_PROPERTY_CACHE_PATH = "CachePath"; + @org.eclipse.jdt.annotation.NonNull + private String cachePath; + + public static final String JSON_PROPERTY_PREVIOUS_VERSION = "PreviousVersion"; + @org.eclipse.jdt.annotation.NonNull + private String previousVersion; + + public static final String JSON_PROPERTY_PREVIOUS_VERSION_STR = "PreviousVersionStr"; + @org.eclipse.jdt.annotation.NonNull + private String previousVersionStr; + + public static final String JSON_PROPERTY_ENABLE_METRICS = "EnableMetrics"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableMetrics; + + public static final String JSON_PROPERTY_ENABLE_NORMALIZED_ITEM_BY_NAME_IDS = "EnableNormalizedItemByNameIds"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableNormalizedItemByNameIds; + + public static final String JSON_PROPERTY_IS_PORT_AUTHORIZED = "IsPortAuthorized"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPortAuthorized; + + public static final String JSON_PROPERTY_QUICK_CONNECT_AVAILABLE = "QuickConnectAvailable"; + @org.eclipse.jdt.annotation.NonNull + private Boolean quickConnectAvailable; + + public static final String JSON_PROPERTY_ENABLE_CASE_SENSITIVE_ITEM_IDS = "EnableCaseSensitiveItemIds"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableCaseSensitiveItemIds; + + public static final String JSON_PROPERTY_DISABLE_LIVE_TV_CHANNEL_USER_DATA_NAME = "DisableLiveTvChannelUserDataName"; + @org.eclipse.jdt.annotation.NonNull + private Boolean disableLiveTvChannelUserDataName; + + public static final String JSON_PROPERTY_METADATA_PATH = "MetadataPath"; + @org.eclipse.jdt.annotation.NonNull + private String metadataPath; + + public static final String JSON_PROPERTY_METADATA_NETWORK_PATH = "MetadataNetworkPath"; + @org.eclipse.jdt.annotation.NonNull + private String metadataNetworkPath; + + public static final String JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE = "PreferredMetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String preferredMetadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_SORT_REPLACE_CHARACTERS = "SortReplaceCharacters"; + @org.eclipse.jdt.annotation.NonNull + private List sortReplaceCharacters = new ArrayList<>(); + + public static final String JSON_PROPERTY_SORT_REMOVE_CHARACTERS = "SortRemoveCharacters"; + @org.eclipse.jdt.annotation.NonNull + private List sortRemoveCharacters = new ArrayList<>(); + + public static final String JSON_PROPERTY_SORT_REMOVE_WORDS = "SortRemoveWords"; + @org.eclipse.jdt.annotation.NonNull + private List sortRemoveWords = new ArrayList<>(); + + public static final String JSON_PROPERTY_MIN_RESUME_PCT = "MinResumePct"; + @org.eclipse.jdt.annotation.NonNull + private Integer minResumePct; + + public static final String JSON_PROPERTY_MAX_RESUME_PCT = "MaxResumePct"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxResumePct; + + public static final String JSON_PROPERTY_MIN_RESUME_DURATION_SECONDS = "MinResumeDurationSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer minResumeDurationSeconds; + + public static final String JSON_PROPERTY_MIN_AUDIOBOOK_RESUME = "MinAudiobookResume"; + @org.eclipse.jdt.annotation.NonNull + private Integer minAudiobookResume; + + public static final String JSON_PROPERTY_MAX_AUDIOBOOK_RESUME = "MaxAudiobookResume"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxAudiobookResume; + + public static final String JSON_PROPERTY_LIBRARY_MONITOR_DELAY = "LibraryMonitorDelay"; + @org.eclipse.jdt.annotation.NonNull + private Integer libraryMonitorDelay; + + public static final String JSON_PROPERTY_IMAGE_SAVING_CONVENTION = "ImageSavingConvention"; + @org.eclipse.jdt.annotation.NonNull + private ImageSavingConvention imageSavingConvention; + + public static final String JSON_PROPERTY_METADATA_OPTIONS = "MetadataOptions"; + @org.eclipse.jdt.annotation.NonNull + private List metadataOptions = new ArrayList<>(); + + public static final String JSON_PROPERTY_SKIP_DESERIALIZATION_FOR_BASIC_TYPES = "SkipDeserializationForBasicTypes"; + @org.eclipse.jdt.annotation.NonNull + private Boolean skipDeserializationForBasicTypes; + + public static final String JSON_PROPERTY_SERVER_NAME = "ServerName"; + @org.eclipse.jdt.annotation.NonNull + private String serverName; + + public static final String JSON_PROPERTY_UI_CULTURE = "UICulture"; + @org.eclipse.jdt.annotation.NonNull + private String uiCulture; + + public static final String JSON_PROPERTY_SAVE_METADATA_HIDDEN = "SaveMetadataHidden"; + @org.eclipse.jdt.annotation.NonNull + private Boolean saveMetadataHidden; + + public static final String JSON_PROPERTY_CONTENT_TYPES = "ContentTypes"; + @org.eclipse.jdt.annotation.NonNull + private List contentTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_REMOTE_CLIENT_BITRATE_LIMIT = "RemoteClientBitrateLimit"; + @org.eclipse.jdt.annotation.NonNull + private Integer remoteClientBitrateLimit; + + public static final String JSON_PROPERTY_ENABLE_FOLDER_VIEW = "EnableFolderView"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableFolderView; + + public static final String JSON_PROPERTY_ENABLE_GROUPING_INTO_COLLECTIONS = "EnableGroupingIntoCollections"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableGroupingIntoCollections; + + public static final String JSON_PROPERTY_DISPLAY_SPECIALS_WITHIN_SEASONS = "DisplaySpecialsWithinSeasons"; + @org.eclipse.jdt.annotation.NonNull + private Boolean displaySpecialsWithinSeasons; + + public static final String JSON_PROPERTY_CODECS_USED = "CodecsUsed"; + @org.eclipse.jdt.annotation.NonNull + private List codecsUsed = new ArrayList<>(); + + public static final String JSON_PROPERTY_PLUGIN_REPOSITORIES = "PluginRepositories"; + @org.eclipse.jdt.annotation.NonNull + private List pluginRepositories = new ArrayList<>(); + + public static final String JSON_PROPERTY_ENABLE_EXTERNAL_CONTENT_IN_SUGGESTIONS = "EnableExternalContentInSuggestions"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableExternalContentInSuggestions; + + public static final String JSON_PROPERTY_IMAGE_EXTRACTION_TIMEOUT_MS = "ImageExtractionTimeoutMs"; + @org.eclipse.jdt.annotation.NonNull + private Integer imageExtractionTimeoutMs; + + public static final String JSON_PROPERTY_PATH_SUBSTITUTIONS = "PathSubstitutions"; + @org.eclipse.jdt.annotation.NonNull + private List pathSubstitutions = new ArrayList<>(); + + public static final String JSON_PROPERTY_ENABLE_SLOW_RESPONSE_WARNING = "EnableSlowResponseWarning"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableSlowResponseWarning; + + public static final String JSON_PROPERTY_SLOW_RESPONSE_THRESHOLD_MS = "SlowResponseThresholdMs"; + @org.eclipse.jdt.annotation.NonNull + private Long slowResponseThresholdMs; + + public static final String JSON_PROPERTY_CORS_HOSTS = "CorsHosts"; + @org.eclipse.jdt.annotation.NonNull + private List corsHosts = new ArrayList<>(); + + public static final String JSON_PROPERTY_ACTIVITY_LOG_RETENTION_DAYS = "ActivityLogRetentionDays"; + @org.eclipse.jdt.annotation.NonNull + private Integer activityLogRetentionDays; + + public static final String JSON_PROPERTY_LIBRARY_SCAN_FANOUT_CONCURRENCY = "LibraryScanFanoutConcurrency"; + @org.eclipse.jdt.annotation.NonNull + private Integer libraryScanFanoutConcurrency; + + public static final String JSON_PROPERTY_LIBRARY_METADATA_REFRESH_CONCURRENCY = "LibraryMetadataRefreshConcurrency"; + @org.eclipse.jdt.annotation.NonNull + private Integer libraryMetadataRefreshConcurrency; + + public static final String JSON_PROPERTY_REMOVE_OLD_PLUGINS = "RemoveOldPlugins"; + @org.eclipse.jdt.annotation.NonNull + private Boolean removeOldPlugins; + + public static final String JSON_PROPERTY_ALLOW_CLIENT_LOG_UPLOAD = "AllowClientLogUpload"; + @org.eclipse.jdt.annotation.NonNull + private Boolean allowClientLogUpload; + + public ServerConfiguration() { + } + + public ServerConfiguration logFileRetentionDays(@org.eclipse.jdt.annotation.NonNull Integer logFileRetentionDays) { + this.logFileRetentionDays = logFileRetentionDays; + return this; + } + + /** + * Gets or sets the number of days we should retain log files. + * + * @return logFileRetentionDays + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOG_FILE_RETENTION_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLogFileRetentionDays() { + return logFileRetentionDays; + } + + @JsonProperty(JSON_PROPERTY_LOG_FILE_RETENTION_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogFileRetentionDays(@org.eclipse.jdt.annotation.NonNull Integer logFileRetentionDays) { + this.logFileRetentionDays = logFileRetentionDays; + } + + public ServerConfiguration isStartupWizardCompleted( + @org.eclipse.jdt.annotation.NonNull Boolean isStartupWizardCompleted) { + this.isStartupWizardCompleted = isStartupWizardCompleted; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is first run. + * + * @return isStartupWizardCompleted + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_STARTUP_WIZARD_COMPLETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsStartupWizardCompleted() { + return isStartupWizardCompleted; + } + + @JsonProperty(JSON_PROPERTY_IS_STARTUP_WIZARD_COMPLETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsStartupWizardCompleted(@org.eclipse.jdt.annotation.NonNull Boolean isStartupWizardCompleted) { + this.isStartupWizardCompleted = isStartupWizardCompleted; + } + + public ServerConfiguration cachePath(@org.eclipse.jdt.annotation.NonNull String cachePath) { + this.cachePath = cachePath; + return this; + } + + /** + * Gets or sets the cache path. + * + * @return cachePath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CACHE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCachePath() { + return cachePath; + } + + @JsonProperty(JSON_PROPERTY_CACHE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCachePath(@org.eclipse.jdt.annotation.NonNull String cachePath) { + this.cachePath = cachePath; + } + + public ServerConfiguration previousVersion(@org.eclipse.jdt.annotation.NonNull String previousVersion) { + this.previousVersion = previousVersion; + return this; + } + + /** + * Gets or sets the last known version that was ran using the configuration. + * + * @return previousVersion + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREVIOUS_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPreviousVersion() { + return previousVersion; + } + + @JsonProperty(JSON_PROPERTY_PREVIOUS_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreviousVersion(@org.eclipse.jdt.annotation.NonNull String previousVersion) { + this.previousVersion = previousVersion; + } + + public ServerConfiguration previousVersionStr(@org.eclipse.jdt.annotation.NonNull String previousVersionStr) { + this.previousVersionStr = previousVersionStr; + return this; + } + + /** + * Gets or sets the stringified PreviousVersion to be stored/loaded, because System.Version itself isn't + * xml-serializable. + * + * @return previousVersionStr + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREVIOUS_VERSION_STR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPreviousVersionStr() { + return previousVersionStr; + } + + @JsonProperty(JSON_PROPERTY_PREVIOUS_VERSION_STR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreviousVersionStr(@org.eclipse.jdt.annotation.NonNull String previousVersionStr) { + this.previousVersionStr = previousVersionStr; + } + + public ServerConfiguration enableMetrics(@org.eclipse.jdt.annotation.NonNull Boolean enableMetrics) { + this.enableMetrics = enableMetrics; + return this; + } + + /** + * Gets or sets a value indicating whether to enable prometheus metrics exporting. + * + * @return enableMetrics + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_METRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableMetrics() { + return enableMetrics; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_METRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableMetrics(@org.eclipse.jdt.annotation.NonNull Boolean enableMetrics) { + this.enableMetrics = enableMetrics; + } + + public ServerConfiguration enableNormalizedItemByNameIds( + @org.eclipse.jdt.annotation.NonNull Boolean enableNormalizedItemByNameIds) { + this.enableNormalizedItemByNameIds = enableNormalizedItemByNameIds; + return this; + } + + /** + * Get enableNormalizedItemByNameIds + * + * @return enableNormalizedItemByNameIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_NORMALIZED_ITEM_BY_NAME_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableNormalizedItemByNameIds() { + return enableNormalizedItemByNameIds; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_NORMALIZED_ITEM_BY_NAME_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableNormalizedItemByNameIds( + @org.eclipse.jdt.annotation.NonNull Boolean enableNormalizedItemByNameIds) { + this.enableNormalizedItemByNameIds = enableNormalizedItemByNameIds; + } + + public ServerConfiguration isPortAuthorized(@org.eclipse.jdt.annotation.NonNull Boolean isPortAuthorized) { + this.isPortAuthorized = isPortAuthorized; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is port authorized. + * + * @return isPortAuthorized + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PORT_AUTHORIZED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPortAuthorized() { + return isPortAuthorized; + } + + @JsonProperty(JSON_PROPERTY_IS_PORT_AUTHORIZED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPortAuthorized(@org.eclipse.jdt.annotation.NonNull Boolean isPortAuthorized) { + this.isPortAuthorized = isPortAuthorized; + } + + public ServerConfiguration quickConnectAvailable( + @org.eclipse.jdt.annotation.NonNull Boolean quickConnectAvailable) { + this.quickConnectAvailable = quickConnectAvailable; + return this; + } + + /** + * Gets or sets a value indicating whether quick connect is available for use on this server. + * + * @return quickConnectAvailable + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_QUICK_CONNECT_AVAILABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getQuickConnectAvailable() { + return quickConnectAvailable; + } + + @JsonProperty(JSON_PROPERTY_QUICK_CONNECT_AVAILABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuickConnectAvailable(@org.eclipse.jdt.annotation.NonNull Boolean quickConnectAvailable) { + this.quickConnectAvailable = quickConnectAvailable; + } + + public ServerConfiguration enableCaseSensitiveItemIds( + @org.eclipse.jdt.annotation.NonNull Boolean enableCaseSensitiveItemIds) { + this.enableCaseSensitiveItemIds = enableCaseSensitiveItemIds; + return this; + } + + /** + * Gets or sets a value indicating whether [enable case sensitive item ids]. + * + * @return enableCaseSensitiveItemIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_CASE_SENSITIVE_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableCaseSensitiveItemIds() { + return enableCaseSensitiveItemIds; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_CASE_SENSITIVE_ITEM_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableCaseSensitiveItemIds(@org.eclipse.jdt.annotation.NonNull Boolean enableCaseSensitiveItemIds) { + this.enableCaseSensitiveItemIds = enableCaseSensitiveItemIds; + } + + public ServerConfiguration disableLiveTvChannelUserDataName( + @org.eclipse.jdt.annotation.NonNull Boolean disableLiveTvChannelUserDataName) { + this.disableLiveTvChannelUserDataName = disableLiveTvChannelUserDataName; + return this; + } + + /** + * Get disableLiveTvChannelUserDataName + * + * @return disableLiveTvChannelUserDataName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISABLE_LIVE_TV_CHANNEL_USER_DATA_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDisableLiveTvChannelUserDataName() { + return disableLiveTvChannelUserDataName; + } + + @JsonProperty(JSON_PROPERTY_DISABLE_LIVE_TV_CHANNEL_USER_DATA_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisableLiveTvChannelUserDataName( + @org.eclipse.jdt.annotation.NonNull Boolean disableLiveTvChannelUserDataName) { + this.disableLiveTvChannelUserDataName = disableLiveTvChannelUserDataName; + } + + public ServerConfiguration metadataPath(@org.eclipse.jdt.annotation.NonNull String metadataPath) { + this.metadataPath = metadataPath; + return this; + } + + /** + * Gets or sets the metadata path. + * + * @return metadataPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataPath() { + return metadataPath; + } + + @JsonProperty(JSON_PROPERTY_METADATA_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataPath(@org.eclipse.jdt.annotation.NonNull String metadataPath) { + this.metadataPath = metadataPath; + } + + public ServerConfiguration metadataNetworkPath(@org.eclipse.jdt.annotation.NonNull String metadataNetworkPath) { + this.metadataNetworkPath = metadataNetworkPath; + return this; + } + + /** + * Get metadataNetworkPath + * + * @return metadataNetworkPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_NETWORK_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataNetworkPath() { + return metadataNetworkPath; + } + + @JsonProperty(JSON_PROPERTY_METADATA_NETWORK_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataNetworkPath(@org.eclipse.jdt.annotation.NonNull String metadataNetworkPath) { + this.metadataNetworkPath = metadataNetworkPath; + } + + public ServerConfiguration preferredMetadataLanguage( + @org.eclipse.jdt.annotation.NonNull String preferredMetadataLanguage) { + this.preferredMetadataLanguage = preferredMetadataLanguage; + return this; + } + + /** + * Gets or sets the preferred metadata language. + * + * @return preferredMetadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPreferredMetadataLanguage() { + return preferredMetadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreferredMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String preferredMetadataLanguage) { + this.preferredMetadataLanguage = preferredMetadataLanguage; + } + + public ServerConfiguration metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public ServerConfiguration sortReplaceCharacters( + @org.eclipse.jdt.annotation.NonNull List sortReplaceCharacters) { + this.sortReplaceCharacters = sortReplaceCharacters; + return this; + } + + public ServerConfiguration addSortReplaceCharactersItem(String sortReplaceCharactersItem) { + if (this.sortReplaceCharacters == null) { + this.sortReplaceCharacters = new ArrayList<>(); + } + this.sortReplaceCharacters.add(sortReplaceCharactersItem); + return this; + } + + /** + * Gets or sets characters to be replaced with a ' ' in strings to create a sort name. + * + * @return sortReplaceCharacters + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SORT_REPLACE_CHARACTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSortReplaceCharacters() { + return sortReplaceCharacters; + } + + @JsonProperty(JSON_PROPERTY_SORT_REPLACE_CHARACTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortReplaceCharacters(@org.eclipse.jdt.annotation.NonNull List sortReplaceCharacters) { + this.sortReplaceCharacters = sortReplaceCharacters; + } + + public ServerConfiguration sortRemoveCharacters( + @org.eclipse.jdt.annotation.NonNull List sortRemoveCharacters) { + this.sortRemoveCharacters = sortRemoveCharacters; + return this; + } + + public ServerConfiguration addSortRemoveCharactersItem(String sortRemoveCharactersItem) { + if (this.sortRemoveCharacters == null) { + this.sortRemoveCharacters = new ArrayList<>(); + } + this.sortRemoveCharacters.add(sortRemoveCharactersItem); + return this; + } + + /** + * Gets or sets characters to be removed from strings to create a sort name. + * + * @return sortRemoveCharacters + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SORT_REMOVE_CHARACTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSortRemoveCharacters() { + return sortRemoveCharacters; + } + + @JsonProperty(JSON_PROPERTY_SORT_REMOVE_CHARACTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortRemoveCharacters(@org.eclipse.jdt.annotation.NonNull List sortRemoveCharacters) { + this.sortRemoveCharacters = sortRemoveCharacters; + } + + public ServerConfiguration sortRemoveWords(@org.eclipse.jdt.annotation.NonNull List sortRemoveWords) { + this.sortRemoveWords = sortRemoveWords; + return this; + } + + public ServerConfiguration addSortRemoveWordsItem(String sortRemoveWordsItem) { + if (this.sortRemoveWords == null) { + this.sortRemoveWords = new ArrayList<>(); + } + this.sortRemoveWords.add(sortRemoveWordsItem); + return this; + } + + /** + * Gets or sets words to be removed from strings to create a sort name. + * + * @return sortRemoveWords + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SORT_REMOVE_WORDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSortRemoveWords() { + return sortRemoveWords; + } + + @JsonProperty(JSON_PROPERTY_SORT_REMOVE_WORDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortRemoveWords(@org.eclipse.jdt.annotation.NonNull List sortRemoveWords) { + this.sortRemoveWords = sortRemoveWords; + } + + public ServerConfiguration minResumePct(@org.eclipse.jdt.annotation.NonNull Integer minResumePct) { + this.minResumePct = minResumePct; + return this; + } + + /** + * Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated. + * + * @return minResumePct + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIN_RESUME_PCT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMinResumePct() { + return minResumePct; + } + + @JsonProperty(JSON_PROPERTY_MIN_RESUME_PCT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinResumePct(@org.eclipse.jdt.annotation.NonNull Integer minResumePct) { + this.minResumePct = minResumePct; + } + + public ServerConfiguration maxResumePct(@org.eclipse.jdt.annotation.NonNull Integer maxResumePct) { + this.maxResumePct = maxResumePct; + return this; + } + + /** + * Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this + * percentage is crossed playstate will be reset to the beginning and the item will be marked watched. + * + * @return maxResumePct + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_RESUME_PCT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxResumePct() { + return maxResumePct; + } + + @JsonProperty(JSON_PROPERTY_MAX_RESUME_PCT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxResumePct(@org.eclipse.jdt.annotation.NonNull Integer maxResumePct) { + this.maxResumePct = maxResumePct; + } + + public ServerConfiguration minResumeDurationSeconds( + @org.eclipse.jdt.annotation.NonNull Integer minResumeDurationSeconds) { + this.minResumeDurationSeconds = minResumeDurationSeconds; + return this; + } + + /** + * Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates.. + * + * @return minResumeDurationSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIN_RESUME_DURATION_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMinResumeDurationSeconds() { + return minResumeDurationSeconds; + } + + @JsonProperty(JSON_PROPERTY_MIN_RESUME_DURATION_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinResumeDurationSeconds(@org.eclipse.jdt.annotation.NonNull Integer minResumeDurationSeconds) { + this.minResumeDurationSeconds = minResumeDurationSeconds; + } + + public ServerConfiguration minAudiobookResume(@org.eclipse.jdt.annotation.NonNull Integer minAudiobookResume) { + this.minAudiobookResume = minAudiobookResume; + return this; + } + + /** + * Gets or sets the minimum minutes of a book that must be played in order for playstate to be updated. + * + * @return minAudiobookResume + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIN_AUDIOBOOK_RESUME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMinAudiobookResume() { + return minAudiobookResume; + } + + @JsonProperty(JSON_PROPERTY_MIN_AUDIOBOOK_RESUME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinAudiobookResume(@org.eclipse.jdt.annotation.NonNull Integer minAudiobookResume) { + this.minAudiobookResume = minAudiobookResume; + } + + public ServerConfiguration maxAudiobookResume(@org.eclipse.jdt.annotation.NonNull Integer maxAudiobookResume) { + this.maxAudiobookResume = maxAudiobookResume; + return this; + } + + /** + * Gets or sets the remaining minutes of a book that can be played while still saving playstate. If this percentage + * is crossed playstate will be reset to the beginning and the item will be marked watched. + * + * @return maxAudiobookResume + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_AUDIOBOOK_RESUME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxAudiobookResume() { + return maxAudiobookResume; + } + + @JsonProperty(JSON_PROPERTY_MAX_AUDIOBOOK_RESUME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxAudiobookResume(@org.eclipse.jdt.annotation.NonNull Integer maxAudiobookResume) { + this.maxAudiobookResume = maxAudiobookResume; + } + + public ServerConfiguration libraryMonitorDelay(@org.eclipse.jdt.annotation.NonNull Integer libraryMonitorDelay) { + this.libraryMonitorDelay = libraryMonitorDelay; + return this; + } + + /** + * Gets or sets the delay in seconds that we will wait after a file system change to try and discover what has been + * added/removed Some delay is necessary with some items because their creation is not atomic. It involves the + * creation of several different directories and files. + * + * @return libraryMonitorDelay + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIBRARY_MONITOR_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLibraryMonitorDelay() { + return libraryMonitorDelay; + } + + @JsonProperty(JSON_PROPERTY_LIBRARY_MONITOR_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLibraryMonitorDelay(@org.eclipse.jdt.annotation.NonNull Integer libraryMonitorDelay) { + this.libraryMonitorDelay = libraryMonitorDelay; + } + + public ServerConfiguration imageSavingConvention( + @org.eclipse.jdt.annotation.NonNull ImageSavingConvention imageSavingConvention) { + this.imageSavingConvention = imageSavingConvention; + return this; + } + + /** + * Gets or sets the image saving convention. + * + * @return imageSavingConvention + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_SAVING_CONVENTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ImageSavingConvention getImageSavingConvention() { + return imageSavingConvention; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_SAVING_CONVENTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageSavingConvention( + @org.eclipse.jdt.annotation.NonNull ImageSavingConvention imageSavingConvention) { + this.imageSavingConvention = imageSavingConvention; + } + + public ServerConfiguration metadataOptions( + @org.eclipse.jdt.annotation.NonNull List metadataOptions) { + this.metadataOptions = metadataOptions; + return this; + } + + public ServerConfiguration addMetadataOptionsItem(MetadataOptions metadataOptionsItem) { + if (this.metadataOptions == null) { + this.metadataOptions = new ArrayList<>(); + } + this.metadataOptions.add(metadataOptionsItem); + return this; + } + + /** + * Get metadataOptions + * + * @return metadataOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMetadataOptions() { + return metadataOptions; + } + + @JsonProperty(JSON_PROPERTY_METADATA_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataOptions(@org.eclipse.jdt.annotation.NonNull List metadataOptions) { + this.metadataOptions = metadataOptions; + } + + public ServerConfiguration skipDeserializationForBasicTypes( + @org.eclipse.jdt.annotation.NonNull Boolean skipDeserializationForBasicTypes) { + this.skipDeserializationForBasicTypes = skipDeserializationForBasicTypes; + return this; + } + + /** + * Get skipDeserializationForBasicTypes + * + * @return skipDeserializationForBasicTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SKIP_DESERIALIZATION_FOR_BASIC_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSkipDeserializationForBasicTypes() { + return skipDeserializationForBasicTypes; + } + + @JsonProperty(JSON_PROPERTY_SKIP_DESERIALIZATION_FOR_BASIC_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipDeserializationForBasicTypes( + @org.eclipse.jdt.annotation.NonNull Boolean skipDeserializationForBasicTypes) { + this.skipDeserializationForBasicTypes = skipDeserializationForBasicTypes; + } + + public ServerConfiguration serverName(@org.eclipse.jdt.annotation.NonNull String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get serverName + * + * @return serverName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerName() { + return serverName; + } + + @JsonProperty(JSON_PROPERTY_SERVER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerName(@org.eclipse.jdt.annotation.NonNull String serverName) { + this.serverName = serverName; + } + + public ServerConfiguration uiCulture(@org.eclipse.jdt.annotation.NonNull String uiCulture) { + this.uiCulture = uiCulture; + return this; + } + + /** + * Get uiCulture + * + * @return uiCulture + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_UI_CULTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUiCulture() { + return uiCulture; + } + + @JsonProperty(JSON_PROPERTY_UI_CULTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUiCulture(@org.eclipse.jdt.annotation.NonNull String uiCulture) { + this.uiCulture = uiCulture; + } + + public ServerConfiguration saveMetadataHidden(@org.eclipse.jdt.annotation.NonNull Boolean saveMetadataHidden) { + this.saveMetadataHidden = saveMetadataHidden; + return this; + } + + /** + * Get saveMetadataHidden + * + * @return saveMetadataHidden + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SAVE_METADATA_HIDDEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSaveMetadataHidden() { + return saveMetadataHidden; + } + + @JsonProperty(JSON_PROPERTY_SAVE_METADATA_HIDDEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaveMetadataHidden(@org.eclipse.jdt.annotation.NonNull Boolean saveMetadataHidden) { + this.saveMetadataHidden = saveMetadataHidden; + } + + public ServerConfiguration contentTypes(@org.eclipse.jdt.annotation.NonNull List contentTypes) { + this.contentTypes = contentTypes; + return this; + } + + public ServerConfiguration addContentTypesItem(NameValuePair contentTypesItem) { + if (this.contentTypes == null) { + this.contentTypes = new ArrayList<>(); + } + this.contentTypes.add(contentTypesItem); + return this; + } + + /** + * Get contentTypes + * + * @return contentTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTENT_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getContentTypes() { + return contentTypes; + } + + @JsonProperty(JSON_PROPERTY_CONTENT_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentTypes(@org.eclipse.jdt.annotation.NonNull List contentTypes) { + this.contentTypes = contentTypes; + } + + public ServerConfiguration remoteClientBitrateLimit( + @org.eclipse.jdt.annotation.NonNull Integer remoteClientBitrateLimit) { + this.remoteClientBitrateLimit = remoteClientBitrateLimit; + return this; + } + + /** + * Get remoteClientBitrateLimit + * + * @return remoteClientBitrateLimit + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMOTE_CLIENT_BITRATE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRemoteClientBitrateLimit() { + return remoteClientBitrateLimit; + } + + @JsonProperty(JSON_PROPERTY_REMOTE_CLIENT_BITRATE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemoteClientBitrateLimit(@org.eclipse.jdt.annotation.NonNull Integer remoteClientBitrateLimit) { + this.remoteClientBitrateLimit = remoteClientBitrateLimit; + } + + public ServerConfiguration enableFolderView(@org.eclipse.jdt.annotation.NonNull Boolean enableFolderView) { + this.enableFolderView = enableFolderView; + return this; + } + + /** + * Get enableFolderView + * + * @return enableFolderView + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_FOLDER_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableFolderView() { + return enableFolderView; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_FOLDER_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableFolderView(@org.eclipse.jdt.annotation.NonNull Boolean enableFolderView) { + this.enableFolderView = enableFolderView; + } + + public ServerConfiguration enableGroupingIntoCollections( + @org.eclipse.jdt.annotation.NonNull Boolean enableGroupingIntoCollections) { + this.enableGroupingIntoCollections = enableGroupingIntoCollections; + return this; + } + + /** + * Get enableGroupingIntoCollections + * + * @return enableGroupingIntoCollections + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_GROUPING_INTO_COLLECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableGroupingIntoCollections() { + return enableGroupingIntoCollections; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_GROUPING_INTO_COLLECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableGroupingIntoCollections( + @org.eclipse.jdt.annotation.NonNull Boolean enableGroupingIntoCollections) { + this.enableGroupingIntoCollections = enableGroupingIntoCollections; + } + + public ServerConfiguration displaySpecialsWithinSeasons( + @org.eclipse.jdt.annotation.NonNull Boolean displaySpecialsWithinSeasons) { + this.displaySpecialsWithinSeasons = displaySpecialsWithinSeasons; + return this; + } + + /** + * Get displaySpecialsWithinSeasons + * + * @return displaySpecialsWithinSeasons + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_SPECIALS_WITHIN_SEASONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDisplaySpecialsWithinSeasons() { + return displaySpecialsWithinSeasons; + } + + @JsonProperty(JSON_PROPERTY_DISPLAY_SPECIALS_WITHIN_SEASONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplaySpecialsWithinSeasons( + @org.eclipse.jdt.annotation.NonNull Boolean displaySpecialsWithinSeasons) { + this.displaySpecialsWithinSeasons = displaySpecialsWithinSeasons; + } + + public ServerConfiguration codecsUsed(@org.eclipse.jdt.annotation.NonNull List codecsUsed) { + this.codecsUsed = codecsUsed; + return this; + } + + public ServerConfiguration addCodecsUsedItem(String codecsUsedItem) { + if (this.codecsUsed == null) { + this.codecsUsed = new ArrayList<>(); + } + this.codecsUsed.add(codecsUsedItem); + return this; + } + + /** + * Get codecsUsed + * + * @return codecsUsed + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CODECS_USED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCodecsUsed() { + return codecsUsed; + } + + @JsonProperty(JSON_PROPERTY_CODECS_USED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCodecsUsed(@org.eclipse.jdt.annotation.NonNull List codecsUsed) { + this.codecsUsed = codecsUsed; + } + + public ServerConfiguration pluginRepositories( + @org.eclipse.jdt.annotation.NonNull List pluginRepositories) { + this.pluginRepositories = pluginRepositories; + return this; + } + + public ServerConfiguration addPluginRepositoriesItem(RepositoryInfo pluginRepositoriesItem) { + if (this.pluginRepositories == null) { + this.pluginRepositories = new ArrayList<>(); + } + this.pluginRepositories.add(pluginRepositoriesItem); + return this; + } + + /** + * Get pluginRepositories + * + * @return pluginRepositories + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLUGIN_REPOSITORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPluginRepositories() { + return pluginRepositories; + } + + @JsonProperty(JSON_PROPERTY_PLUGIN_REPOSITORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPluginRepositories(@org.eclipse.jdt.annotation.NonNull List pluginRepositories) { + this.pluginRepositories = pluginRepositories; + } + + public ServerConfiguration enableExternalContentInSuggestions( + @org.eclipse.jdt.annotation.NonNull Boolean enableExternalContentInSuggestions) { + this.enableExternalContentInSuggestions = enableExternalContentInSuggestions; + return this; + } + + /** + * Get enableExternalContentInSuggestions + * + * @return enableExternalContentInSuggestions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_EXTERNAL_CONTENT_IN_SUGGESTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableExternalContentInSuggestions() { + return enableExternalContentInSuggestions; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_EXTERNAL_CONTENT_IN_SUGGESTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableExternalContentInSuggestions( + @org.eclipse.jdt.annotation.NonNull Boolean enableExternalContentInSuggestions) { + this.enableExternalContentInSuggestions = enableExternalContentInSuggestions; + } + + public ServerConfiguration imageExtractionTimeoutMs( + @org.eclipse.jdt.annotation.NonNull Integer imageExtractionTimeoutMs) { + this.imageExtractionTimeoutMs = imageExtractionTimeoutMs; + return this; + } + + /** + * Get imageExtractionTimeoutMs + * + * @return imageExtractionTimeoutMs + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_EXTRACTION_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getImageExtractionTimeoutMs() { + return imageExtractionTimeoutMs; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_EXTRACTION_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageExtractionTimeoutMs(@org.eclipse.jdt.annotation.NonNull Integer imageExtractionTimeoutMs) { + this.imageExtractionTimeoutMs = imageExtractionTimeoutMs; + } + + public ServerConfiguration pathSubstitutions( + @org.eclipse.jdt.annotation.NonNull List pathSubstitutions) { + this.pathSubstitutions = pathSubstitutions; + return this; + } + + public ServerConfiguration addPathSubstitutionsItem(PathSubstitution pathSubstitutionsItem) { + if (this.pathSubstitutions == null) { + this.pathSubstitutions = new ArrayList<>(); + } + this.pathSubstitutions.add(pathSubstitutionsItem); + return this; + } + + /** + * Get pathSubstitutions + * + * @return pathSubstitutions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH_SUBSTITUTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPathSubstitutions() { + return pathSubstitutions; + } + + @JsonProperty(JSON_PROPERTY_PATH_SUBSTITUTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPathSubstitutions(@org.eclipse.jdt.annotation.NonNull List pathSubstitutions) { + this.pathSubstitutions = pathSubstitutions; + } + + public ServerConfiguration enableSlowResponseWarning( + @org.eclipse.jdt.annotation.NonNull Boolean enableSlowResponseWarning) { + this.enableSlowResponseWarning = enableSlowResponseWarning; + return this; + } + + /** + * Gets or sets a value indicating whether slow server responses should be logged as a warning. + * + * @return enableSlowResponseWarning + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_SLOW_RESPONSE_WARNING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableSlowResponseWarning() { + return enableSlowResponseWarning; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_SLOW_RESPONSE_WARNING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableSlowResponseWarning(@org.eclipse.jdt.annotation.NonNull Boolean enableSlowResponseWarning) { + this.enableSlowResponseWarning = enableSlowResponseWarning; + } + + public ServerConfiguration slowResponseThresholdMs( + @org.eclipse.jdt.annotation.NonNull Long slowResponseThresholdMs) { + this.slowResponseThresholdMs = slowResponseThresholdMs; + return this; + } + + /** + * Gets or sets the threshold for the slow response time warning in ms. + * + * @return slowResponseThresholdMs + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SLOW_RESPONSE_THRESHOLD_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSlowResponseThresholdMs() { + return slowResponseThresholdMs; + } + + @JsonProperty(JSON_PROPERTY_SLOW_RESPONSE_THRESHOLD_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSlowResponseThresholdMs(@org.eclipse.jdt.annotation.NonNull Long slowResponseThresholdMs) { + this.slowResponseThresholdMs = slowResponseThresholdMs; + } + + public ServerConfiguration corsHosts(@org.eclipse.jdt.annotation.NonNull List corsHosts) { + this.corsHosts = corsHosts; + return this; + } + + public ServerConfiguration addCorsHostsItem(String corsHostsItem) { + if (this.corsHosts == null) { + this.corsHosts = new ArrayList<>(); + } + this.corsHosts.add(corsHostsItem); + return this; + } + + /** + * Gets or sets the cors hosts. + * + * @return corsHosts + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CORS_HOSTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCorsHosts() { + return corsHosts; + } + + @JsonProperty(JSON_PROPERTY_CORS_HOSTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCorsHosts(@org.eclipse.jdt.annotation.NonNull List corsHosts) { + this.corsHosts = corsHosts; + } + + public ServerConfiguration activityLogRetentionDays( + @org.eclipse.jdt.annotation.NonNull Integer activityLogRetentionDays) { + this.activityLogRetentionDays = activityLogRetentionDays; + return this; + } + + /** + * Gets or sets the number of days we should retain activity logs. + * + * @return activityLogRetentionDays + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ACTIVITY_LOG_RETENTION_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getActivityLogRetentionDays() { + return activityLogRetentionDays; + } + + @JsonProperty(JSON_PROPERTY_ACTIVITY_LOG_RETENTION_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setActivityLogRetentionDays(@org.eclipse.jdt.annotation.NonNull Integer activityLogRetentionDays) { + this.activityLogRetentionDays = activityLogRetentionDays; + } + + public ServerConfiguration libraryScanFanoutConcurrency( + @org.eclipse.jdt.annotation.NonNull Integer libraryScanFanoutConcurrency) { + this.libraryScanFanoutConcurrency = libraryScanFanoutConcurrency; + return this; + } + + /** + * Gets or sets the how the library scan fans out. + * + * @return libraryScanFanoutConcurrency + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIBRARY_SCAN_FANOUT_CONCURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLibraryScanFanoutConcurrency() { + return libraryScanFanoutConcurrency; + } + + @JsonProperty(JSON_PROPERTY_LIBRARY_SCAN_FANOUT_CONCURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLibraryScanFanoutConcurrency( + @org.eclipse.jdt.annotation.NonNull Integer libraryScanFanoutConcurrency) { + this.libraryScanFanoutConcurrency = libraryScanFanoutConcurrency; + } + + public ServerConfiguration libraryMetadataRefreshConcurrency( + @org.eclipse.jdt.annotation.NonNull Integer libraryMetadataRefreshConcurrency) { + this.libraryMetadataRefreshConcurrency = libraryMetadataRefreshConcurrency; + return this; + } + + /** + * Gets or sets the how many metadata refreshes can run concurrently. + * + * @return libraryMetadataRefreshConcurrency + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIBRARY_METADATA_REFRESH_CONCURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLibraryMetadataRefreshConcurrency() { + return libraryMetadataRefreshConcurrency; + } + + @JsonProperty(JSON_PROPERTY_LIBRARY_METADATA_REFRESH_CONCURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLibraryMetadataRefreshConcurrency( + @org.eclipse.jdt.annotation.NonNull Integer libraryMetadataRefreshConcurrency) { + this.libraryMetadataRefreshConcurrency = libraryMetadataRefreshConcurrency; + } + + public ServerConfiguration removeOldPlugins(@org.eclipse.jdt.annotation.NonNull Boolean removeOldPlugins) { + this.removeOldPlugins = removeOldPlugins; + return this; + } + + /** + * Gets or sets a value indicating whether older plugins should automatically be deleted from the plugin folder. + * + * @return removeOldPlugins + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMOVE_OLD_PLUGINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRemoveOldPlugins() { + return removeOldPlugins; + } + + @JsonProperty(JSON_PROPERTY_REMOVE_OLD_PLUGINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemoveOldPlugins(@org.eclipse.jdt.annotation.NonNull Boolean removeOldPlugins) { + this.removeOldPlugins = removeOldPlugins; + } + + public ServerConfiguration allowClientLogUpload(@org.eclipse.jdt.annotation.NonNull Boolean allowClientLogUpload) { + this.allowClientLogUpload = allowClientLogUpload; + return this; + } + + /** + * Gets or sets a value indicating whether clients should be allowed to upload logs. + * + * @return allowClientLogUpload + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_CLIENT_LOG_UPLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowClientLogUpload() { + return allowClientLogUpload; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_CLIENT_LOG_UPLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowClientLogUpload(@org.eclipse.jdt.annotation.NonNull Boolean allowClientLogUpload) { + this.allowClientLogUpload = allowClientLogUpload; + } + + /** + * Return true if this ServerConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServerConfiguration serverConfiguration = (ServerConfiguration) o; + return Objects.equals(this.logFileRetentionDays, serverConfiguration.logFileRetentionDays) + && Objects.equals(this.isStartupWizardCompleted, serverConfiguration.isStartupWizardCompleted) + && Objects.equals(this.cachePath, serverConfiguration.cachePath) + && Objects.equals(this.previousVersion, serverConfiguration.previousVersion) + && Objects.equals(this.previousVersionStr, serverConfiguration.previousVersionStr) + && Objects.equals(this.enableMetrics, serverConfiguration.enableMetrics) + && Objects.equals(this.enableNormalizedItemByNameIds, serverConfiguration.enableNormalizedItemByNameIds) + && Objects.equals(this.isPortAuthorized, serverConfiguration.isPortAuthorized) + && Objects.equals(this.quickConnectAvailable, serverConfiguration.quickConnectAvailable) + && Objects.equals(this.enableCaseSensitiveItemIds, serverConfiguration.enableCaseSensitiveItemIds) + && Objects.equals(this.disableLiveTvChannelUserDataName, + serverConfiguration.disableLiveTvChannelUserDataName) + && Objects.equals(this.metadataPath, serverConfiguration.metadataPath) + && Objects.equals(this.metadataNetworkPath, serverConfiguration.metadataNetworkPath) + && Objects.equals(this.preferredMetadataLanguage, serverConfiguration.preferredMetadataLanguage) + && Objects.equals(this.metadataCountryCode, serverConfiguration.metadataCountryCode) + && Objects.equals(this.sortReplaceCharacters, serverConfiguration.sortReplaceCharacters) + && Objects.equals(this.sortRemoveCharacters, serverConfiguration.sortRemoveCharacters) + && Objects.equals(this.sortRemoveWords, serverConfiguration.sortRemoveWords) + && Objects.equals(this.minResumePct, serverConfiguration.minResumePct) + && Objects.equals(this.maxResumePct, serverConfiguration.maxResumePct) + && Objects.equals(this.minResumeDurationSeconds, serverConfiguration.minResumeDurationSeconds) + && Objects.equals(this.minAudiobookResume, serverConfiguration.minAudiobookResume) + && Objects.equals(this.maxAudiobookResume, serverConfiguration.maxAudiobookResume) + && Objects.equals(this.libraryMonitorDelay, serverConfiguration.libraryMonitorDelay) + && Objects.equals(this.imageSavingConvention, serverConfiguration.imageSavingConvention) + && Objects.equals(this.metadataOptions, serverConfiguration.metadataOptions) + && Objects.equals(this.skipDeserializationForBasicTypes, + serverConfiguration.skipDeserializationForBasicTypes) + && Objects.equals(this.serverName, serverConfiguration.serverName) + && Objects.equals(this.uiCulture, serverConfiguration.uiCulture) + && Objects.equals(this.saveMetadataHidden, serverConfiguration.saveMetadataHidden) + && Objects.equals(this.contentTypes, serverConfiguration.contentTypes) + && Objects.equals(this.remoteClientBitrateLimit, serverConfiguration.remoteClientBitrateLimit) + && Objects.equals(this.enableFolderView, serverConfiguration.enableFolderView) + && Objects.equals(this.enableGroupingIntoCollections, serverConfiguration.enableGroupingIntoCollections) + && Objects.equals(this.displaySpecialsWithinSeasons, serverConfiguration.displaySpecialsWithinSeasons) + && Objects.equals(this.codecsUsed, serverConfiguration.codecsUsed) + && Objects.equals(this.pluginRepositories, serverConfiguration.pluginRepositories) + && Objects.equals(this.enableExternalContentInSuggestions, + serverConfiguration.enableExternalContentInSuggestions) + && Objects.equals(this.imageExtractionTimeoutMs, serverConfiguration.imageExtractionTimeoutMs) + && Objects.equals(this.pathSubstitutions, serverConfiguration.pathSubstitutions) + && Objects.equals(this.enableSlowResponseWarning, serverConfiguration.enableSlowResponseWarning) + && Objects.equals(this.slowResponseThresholdMs, serverConfiguration.slowResponseThresholdMs) + && Objects.equals(this.corsHosts, serverConfiguration.corsHosts) + && Objects.equals(this.activityLogRetentionDays, serverConfiguration.activityLogRetentionDays) + && Objects.equals(this.libraryScanFanoutConcurrency, serverConfiguration.libraryScanFanoutConcurrency) + && Objects.equals(this.libraryMetadataRefreshConcurrency, + serverConfiguration.libraryMetadataRefreshConcurrency) + && Objects.equals(this.removeOldPlugins, serverConfiguration.removeOldPlugins) + && Objects.equals(this.allowClientLogUpload, serverConfiguration.allowClientLogUpload); + } + + @Override + public int hashCode() { + return Objects.hash(logFileRetentionDays, isStartupWizardCompleted, cachePath, previousVersion, + previousVersionStr, enableMetrics, enableNormalizedItemByNameIds, isPortAuthorized, + quickConnectAvailable, enableCaseSensitiveItemIds, disableLiveTvChannelUserDataName, metadataPath, + metadataNetworkPath, preferredMetadataLanguage, metadataCountryCode, sortReplaceCharacters, + sortRemoveCharacters, sortRemoveWords, minResumePct, maxResumePct, minResumeDurationSeconds, + minAudiobookResume, maxAudiobookResume, libraryMonitorDelay, imageSavingConvention, metadataOptions, + skipDeserializationForBasicTypes, serverName, uiCulture, saveMetadataHidden, contentTypes, + remoteClientBitrateLimit, enableFolderView, enableGroupingIntoCollections, displaySpecialsWithinSeasons, + codecsUsed, pluginRepositories, enableExternalContentInSuggestions, imageExtractionTimeoutMs, + pathSubstitutions, enableSlowResponseWarning, slowResponseThresholdMs, corsHosts, + activityLogRetentionDays, libraryScanFanoutConcurrency, libraryMetadataRefreshConcurrency, + removeOldPlugins, allowClientLogUpload); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServerConfiguration {\n"); + sb.append(" logFileRetentionDays: ").append(toIndentedString(logFileRetentionDays)).append("\n"); + sb.append(" isStartupWizardCompleted: ").append(toIndentedString(isStartupWizardCompleted)).append("\n"); + sb.append(" cachePath: ").append(toIndentedString(cachePath)).append("\n"); + sb.append(" previousVersion: ").append(toIndentedString(previousVersion)).append("\n"); + sb.append(" previousVersionStr: ").append(toIndentedString(previousVersionStr)).append("\n"); + sb.append(" enableMetrics: ").append(toIndentedString(enableMetrics)).append("\n"); + sb.append(" enableNormalizedItemByNameIds: ").append(toIndentedString(enableNormalizedItemByNameIds)) + .append("\n"); + sb.append(" isPortAuthorized: ").append(toIndentedString(isPortAuthorized)).append("\n"); + sb.append(" quickConnectAvailable: ").append(toIndentedString(quickConnectAvailable)).append("\n"); + sb.append(" enableCaseSensitiveItemIds: ").append(toIndentedString(enableCaseSensitiveItemIds)).append("\n"); + sb.append(" disableLiveTvChannelUserDataName: ").append(toIndentedString(disableLiveTvChannelUserDataName)) + .append("\n"); + sb.append(" metadataPath: ").append(toIndentedString(metadataPath)).append("\n"); + sb.append(" metadataNetworkPath: ").append(toIndentedString(metadataNetworkPath)).append("\n"); + sb.append(" preferredMetadataLanguage: ").append(toIndentedString(preferredMetadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" sortReplaceCharacters: ").append(toIndentedString(sortReplaceCharacters)).append("\n"); + sb.append(" sortRemoveCharacters: ").append(toIndentedString(sortRemoveCharacters)).append("\n"); + sb.append(" sortRemoveWords: ").append(toIndentedString(sortRemoveWords)).append("\n"); + sb.append(" minResumePct: ").append(toIndentedString(minResumePct)).append("\n"); + sb.append(" maxResumePct: ").append(toIndentedString(maxResumePct)).append("\n"); + sb.append(" minResumeDurationSeconds: ").append(toIndentedString(minResumeDurationSeconds)).append("\n"); + sb.append(" minAudiobookResume: ").append(toIndentedString(minAudiobookResume)).append("\n"); + sb.append(" maxAudiobookResume: ").append(toIndentedString(maxAudiobookResume)).append("\n"); + sb.append(" libraryMonitorDelay: ").append(toIndentedString(libraryMonitorDelay)).append("\n"); + sb.append(" imageSavingConvention: ").append(toIndentedString(imageSavingConvention)).append("\n"); + sb.append(" metadataOptions: ").append(toIndentedString(metadataOptions)).append("\n"); + sb.append(" skipDeserializationForBasicTypes: ").append(toIndentedString(skipDeserializationForBasicTypes)) + .append("\n"); + sb.append(" serverName: ").append(toIndentedString(serverName)).append("\n"); + sb.append(" uiCulture: ").append(toIndentedString(uiCulture)).append("\n"); + sb.append(" saveMetadataHidden: ").append(toIndentedString(saveMetadataHidden)).append("\n"); + sb.append(" contentTypes: ").append(toIndentedString(contentTypes)).append("\n"); + sb.append(" remoteClientBitrateLimit: ").append(toIndentedString(remoteClientBitrateLimit)).append("\n"); + sb.append(" enableFolderView: ").append(toIndentedString(enableFolderView)).append("\n"); + sb.append(" enableGroupingIntoCollections: ").append(toIndentedString(enableGroupingIntoCollections)) + .append("\n"); + sb.append(" displaySpecialsWithinSeasons: ").append(toIndentedString(displaySpecialsWithinSeasons)) + .append("\n"); + sb.append(" codecsUsed: ").append(toIndentedString(codecsUsed)).append("\n"); + sb.append(" pluginRepositories: ").append(toIndentedString(pluginRepositories)).append("\n"); + sb.append(" enableExternalContentInSuggestions: ") + .append(toIndentedString(enableExternalContentInSuggestions)).append("\n"); + sb.append(" imageExtractionTimeoutMs: ").append(toIndentedString(imageExtractionTimeoutMs)).append("\n"); + sb.append(" pathSubstitutions: ").append(toIndentedString(pathSubstitutions)).append("\n"); + sb.append(" enableSlowResponseWarning: ").append(toIndentedString(enableSlowResponseWarning)).append("\n"); + sb.append(" slowResponseThresholdMs: ").append(toIndentedString(slowResponseThresholdMs)).append("\n"); + sb.append(" corsHosts: ").append(toIndentedString(corsHosts)).append("\n"); + sb.append(" activityLogRetentionDays: ").append(toIndentedString(activityLogRetentionDays)).append("\n"); + sb.append(" libraryScanFanoutConcurrency: ").append(toIndentedString(libraryScanFanoutConcurrency)) + .append("\n"); + sb.append(" libraryMetadataRefreshConcurrency: ").append(toIndentedString(libraryMetadataRefreshConcurrency)) + .append("\n"); + sb.append(" removeOldPlugins: ").append(toIndentedString(removeOldPlugins)).append("\n"); + sb.append(" allowClientLogUpload: ").append(toIndentedString(allowClientLogUpload)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `LogFileRetentionDays` to the URL query string + if (getLogFileRetentionDays() != null) { + joiner.add(String.format("%sLogFileRetentionDays%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLogFileRetentionDays())))); + } + + // add `IsStartupWizardCompleted` to the URL query string + if (getIsStartupWizardCompleted() != null) { + joiner.add(String.format("%sIsStartupWizardCompleted%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsStartupWizardCompleted())))); + } + + // add `CachePath` to the URL query string + if (getCachePath() != null) { + joiner.add(String.format("%sCachePath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCachePath())))); + } + + // add `PreviousVersion` to the URL query string + if (getPreviousVersion() != null) { + joiner.add(String.format("%sPreviousVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreviousVersion())))); + } + + // add `PreviousVersionStr` to the URL query string + if (getPreviousVersionStr() != null) { + joiner.add(String.format("%sPreviousVersionStr%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreviousVersionStr())))); + } + + // add `EnableMetrics` to the URL query string + if (getEnableMetrics() != null) { + joiner.add(String.format("%sEnableMetrics%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableMetrics())))); + } + + // add `EnableNormalizedItemByNameIds` to the URL query string + if (getEnableNormalizedItemByNameIds() != null) { + joiner.add(String.format("%sEnableNormalizedItemByNameIds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableNormalizedItemByNameIds())))); + } + + // add `IsPortAuthorized` to the URL query string + if (getIsPortAuthorized() != null) { + joiner.add(String.format("%sIsPortAuthorized%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPortAuthorized())))); + } + + // add `QuickConnectAvailable` to the URL query string + if (getQuickConnectAvailable() != null) { + joiner.add(String.format("%sQuickConnectAvailable%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getQuickConnectAvailable())))); + } + + // add `EnableCaseSensitiveItemIds` to the URL query string + if (getEnableCaseSensitiveItemIds() != null) { + joiner.add(String.format("%sEnableCaseSensitiveItemIds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableCaseSensitiveItemIds())))); + } + + // add `DisableLiveTvChannelUserDataName` to the URL query string + if (getDisableLiveTvChannelUserDataName() != null) { + joiner.add(String.format("%sDisableLiveTvChannelUserDataName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisableLiveTvChannelUserDataName())))); + } + + // add `MetadataPath` to the URL query string + if (getMetadataPath() != null) { + joiner.add(String.format("%sMetadataPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataPath())))); + } + + // add `MetadataNetworkPath` to the URL query string + if (getMetadataNetworkPath() != null) { + joiner.add(String.format("%sMetadataNetworkPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataNetworkPath())))); + } + + // add `PreferredMetadataLanguage` to the URL query string + if (getPreferredMetadataLanguage() != null) { + joiner.add(String.format("%sPreferredMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreferredMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `SortReplaceCharacters` to the URL query string + if (getSortReplaceCharacters() != null) { + for (int i = 0; i < getSortReplaceCharacters().size(); i++) { + joiner.add(String.format("%sSortReplaceCharacters%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSortReplaceCharacters().get(i))))); + } + } + + // add `SortRemoveCharacters` to the URL query string + if (getSortRemoveCharacters() != null) { + for (int i = 0; i < getSortRemoveCharacters().size(); i++) { + joiner.add(String.format("%sSortRemoveCharacters%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSortRemoveCharacters().get(i))))); + } + } + + // add `SortRemoveWords` to the URL query string + if (getSortRemoveWords() != null) { + for (int i = 0; i < getSortRemoveWords().size(); i++) { + joiner.add(String.format("%sSortRemoveWords%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSortRemoveWords().get(i))))); + } + } + + // add `MinResumePct` to the URL query string + if (getMinResumePct() != null) { + joiner.add(String.format("%sMinResumePct%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMinResumePct())))); + } + + // add `MaxResumePct` to the URL query string + if (getMaxResumePct() != null) { + joiner.add(String.format("%sMaxResumePct%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxResumePct())))); + } + + // add `MinResumeDurationSeconds` to the URL query string + if (getMinResumeDurationSeconds() != null) { + joiner.add(String.format("%sMinResumeDurationSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMinResumeDurationSeconds())))); + } + + // add `MinAudiobookResume` to the URL query string + if (getMinAudiobookResume() != null) { + joiner.add(String.format("%sMinAudiobookResume%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMinAudiobookResume())))); + } + + // add `MaxAudiobookResume` to the URL query string + if (getMaxAudiobookResume() != null) { + joiner.add(String.format("%sMaxAudiobookResume%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxAudiobookResume())))); + } + + // add `LibraryMonitorDelay` to the URL query string + if (getLibraryMonitorDelay() != null) { + joiner.add(String.format("%sLibraryMonitorDelay%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLibraryMonitorDelay())))); + } + + // add `ImageSavingConvention` to the URL query string + if (getImageSavingConvention() != null) { + joiner.add(String.format("%sImageSavingConvention%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageSavingConvention())))); + } + + // add `MetadataOptions` to the URL query string + if (getMetadataOptions() != null) { + for (int i = 0; i < getMetadataOptions().size(); i++) { + if (getMetadataOptions().get(i) != null) { + joiner.add(getMetadataOptions().get(i).toUrlQueryString(String.format("%sMetadataOptions%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `SkipDeserializationForBasicTypes` to the URL query string + if (getSkipDeserializationForBasicTypes() != null) { + joiner.add(String.format("%sSkipDeserializationForBasicTypes%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSkipDeserializationForBasicTypes())))); + } + + // add `ServerName` to the URL query string + if (getServerName() != null) { + joiner.add(String.format("%sServerName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerName())))); + } + + // add `UICulture` to the URL query string + if (getUiCulture() != null) { + joiner.add(String.format("%sUICulture%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUiCulture())))); + } + + // add `SaveMetadataHidden` to the URL query string + if (getSaveMetadataHidden() != null) { + joiner.add(String.format("%sSaveMetadataHidden%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSaveMetadataHidden())))); + } + + // add `ContentTypes` to the URL query string + if (getContentTypes() != null) { + for (int i = 0; i < getContentTypes().size(); i++) { + if (getContentTypes().get(i) != null) { + joiner.add(getContentTypes().get(i).toUrlQueryString(String.format("%sContentTypes%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `RemoteClientBitrateLimit` to the URL query string + if (getRemoteClientBitrateLimit() != null) { + joiner.add(String.format("%sRemoteClientBitrateLimit%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRemoteClientBitrateLimit())))); + } + + // add `EnableFolderView` to the URL query string + if (getEnableFolderView() != null) { + joiner.add(String.format("%sEnableFolderView%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableFolderView())))); + } + + // add `EnableGroupingIntoCollections` to the URL query string + if (getEnableGroupingIntoCollections() != null) { + joiner.add(String.format("%sEnableGroupingIntoCollections%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableGroupingIntoCollections())))); + } + + // add `DisplaySpecialsWithinSeasons` to the URL query string + if (getDisplaySpecialsWithinSeasons() != null) { + joiner.add(String.format("%sDisplaySpecialsWithinSeasons%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplaySpecialsWithinSeasons())))); + } + + // add `CodecsUsed` to the URL query string + if (getCodecsUsed() != null) { + for (int i = 0; i < getCodecsUsed().size(); i++) { + joiner.add(String.format("%sCodecsUsed%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getCodecsUsed().get(i))))); + } + } + + // add `PluginRepositories` to the URL query string + if (getPluginRepositories() != null) { + for (int i = 0; i < getPluginRepositories().size(); i++) { + if (getPluginRepositories().get(i) != null) { + joiner.add(getPluginRepositories().get(i).toUrlQueryString(String.format("%sPluginRepositories%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `EnableExternalContentInSuggestions` to the URL query string + if (getEnableExternalContentInSuggestions() != null) { + joiner.add(String.format("%sEnableExternalContentInSuggestions%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableExternalContentInSuggestions())))); + } + + // add `ImageExtractionTimeoutMs` to the URL query string + if (getImageExtractionTimeoutMs() != null) { + joiner.add(String.format("%sImageExtractionTimeoutMs%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImageExtractionTimeoutMs())))); + } + + // add `PathSubstitutions` to the URL query string + if (getPathSubstitutions() != null) { + for (int i = 0; i < getPathSubstitutions().size(); i++) { + if (getPathSubstitutions().get(i) != null) { + joiner.add(getPathSubstitutions().get(i).toUrlQueryString(String.format("%sPathSubstitutions%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `EnableSlowResponseWarning` to the URL query string + if (getEnableSlowResponseWarning() != null) { + joiner.add(String.format("%sEnableSlowResponseWarning%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableSlowResponseWarning())))); + } + + // add `SlowResponseThresholdMs` to the URL query string + if (getSlowResponseThresholdMs() != null) { + joiner.add(String.format("%sSlowResponseThresholdMs%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSlowResponseThresholdMs())))); + } + + // add `CorsHosts` to the URL query string + if (getCorsHosts() != null) { + for (int i = 0; i < getCorsHosts().size(); i++) { + joiner.add(String.format("%sCorsHosts%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getCorsHosts().get(i))))); + } + } + + // add `ActivityLogRetentionDays` to the URL query string + if (getActivityLogRetentionDays() != null) { + joiner.add(String.format("%sActivityLogRetentionDays%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getActivityLogRetentionDays())))); + } + + // add `LibraryScanFanoutConcurrency` to the URL query string + if (getLibraryScanFanoutConcurrency() != null) { + joiner.add(String.format("%sLibraryScanFanoutConcurrency%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLibraryScanFanoutConcurrency())))); + } + + // add `LibraryMetadataRefreshConcurrency` to the URL query string + if (getLibraryMetadataRefreshConcurrency() != null) { + joiner.add(String.format("%sLibraryMetadataRefreshConcurrency%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLibraryMetadataRefreshConcurrency())))); + } + + // add `RemoveOldPlugins` to the URL query string + if (getRemoveOldPlugins() != null) { + joiner.add(String.format("%sRemoveOldPlugins%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRemoveOldPlugins())))); + } + + // add `AllowClientLogUpload` to the URL query string + if (getAllowClientLogUpload() != null) { + joiner.add(String.format("%sAllowClientLogUpload%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAllowClientLogUpload())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ServerConfiguration instance; + + public Builder() { + this(new ServerConfiguration()); + } + + protected Builder(ServerConfiguration instance) { + this.instance = instance; + } + + public ServerConfiguration.Builder logFileRetentionDays(Integer logFileRetentionDays) { + this.instance.logFileRetentionDays = logFileRetentionDays; + return this; + } + + public ServerConfiguration.Builder isStartupWizardCompleted(Boolean isStartupWizardCompleted) { + this.instance.isStartupWizardCompleted = isStartupWizardCompleted; + return this; + } + + public ServerConfiguration.Builder cachePath(String cachePath) { + this.instance.cachePath = cachePath; + return this; + } + + public ServerConfiguration.Builder previousVersion(String previousVersion) { + this.instance.previousVersion = previousVersion; + return this; + } + + public ServerConfiguration.Builder previousVersionStr(String previousVersionStr) { + this.instance.previousVersionStr = previousVersionStr; + return this; + } + + public ServerConfiguration.Builder enableMetrics(Boolean enableMetrics) { + this.instance.enableMetrics = enableMetrics; + return this; + } + + public ServerConfiguration.Builder enableNormalizedItemByNameIds(Boolean enableNormalizedItemByNameIds) { + this.instance.enableNormalizedItemByNameIds = enableNormalizedItemByNameIds; + return this; + } + + public ServerConfiguration.Builder isPortAuthorized(Boolean isPortAuthorized) { + this.instance.isPortAuthorized = isPortAuthorized; + return this; + } + + public ServerConfiguration.Builder quickConnectAvailable(Boolean quickConnectAvailable) { + this.instance.quickConnectAvailable = quickConnectAvailable; + return this; + } + + public ServerConfiguration.Builder enableCaseSensitiveItemIds(Boolean enableCaseSensitiveItemIds) { + this.instance.enableCaseSensitiveItemIds = enableCaseSensitiveItemIds; + return this; + } + + public ServerConfiguration.Builder disableLiveTvChannelUserDataName(Boolean disableLiveTvChannelUserDataName) { + this.instance.disableLiveTvChannelUserDataName = disableLiveTvChannelUserDataName; + return this; + } + + public ServerConfiguration.Builder metadataPath(String metadataPath) { + this.instance.metadataPath = metadataPath; + return this; + } + + public ServerConfiguration.Builder metadataNetworkPath(String metadataNetworkPath) { + this.instance.metadataNetworkPath = metadataNetworkPath; + return this; + } + + public ServerConfiguration.Builder preferredMetadataLanguage(String preferredMetadataLanguage) { + this.instance.preferredMetadataLanguage = preferredMetadataLanguage; + return this; + } + + public ServerConfiguration.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public ServerConfiguration.Builder sortReplaceCharacters(List sortReplaceCharacters) { + this.instance.sortReplaceCharacters = sortReplaceCharacters; + return this; + } + + public ServerConfiguration.Builder sortRemoveCharacters(List sortRemoveCharacters) { + this.instance.sortRemoveCharacters = sortRemoveCharacters; + return this; + } + + public ServerConfiguration.Builder sortRemoveWords(List sortRemoveWords) { + this.instance.sortRemoveWords = sortRemoveWords; + return this; + } + + public ServerConfiguration.Builder minResumePct(Integer minResumePct) { + this.instance.minResumePct = minResumePct; + return this; + } + + public ServerConfiguration.Builder maxResumePct(Integer maxResumePct) { + this.instance.maxResumePct = maxResumePct; + return this; + } + + public ServerConfiguration.Builder minResumeDurationSeconds(Integer minResumeDurationSeconds) { + this.instance.minResumeDurationSeconds = minResumeDurationSeconds; + return this; + } + + public ServerConfiguration.Builder minAudiobookResume(Integer minAudiobookResume) { + this.instance.minAudiobookResume = minAudiobookResume; + return this; + } + + public ServerConfiguration.Builder maxAudiobookResume(Integer maxAudiobookResume) { + this.instance.maxAudiobookResume = maxAudiobookResume; + return this; + } + + public ServerConfiguration.Builder libraryMonitorDelay(Integer libraryMonitorDelay) { + this.instance.libraryMonitorDelay = libraryMonitorDelay; + return this; + } + + public ServerConfiguration.Builder imageSavingConvention(ImageSavingConvention imageSavingConvention) { + this.instance.imageSavingConvention = imageSavingConvention; + return this; + } + + public ServerConfiguration.Builder metadataOptions(List metadataOptions) { + this.instance.metadataOptions = metadataOptions; + return this; + } + + public ServerConfiguration.Builder skipDeserializationForBasicTypes(Boolean skipDeserializationForBasicTypes) { + this.instance.skipDeserializationForBasicTypes = skipDeserializationForBasicTypes; + return this; + } + + public ServerConfiguration.Builder serverName(String serverName) { + this.instance.serverName = serverName; + return this; + } + + public ServerConfiguration.Builder uiCulture(String uiCulture) { + this.instance.uiCulture = uiCulture; + return this; + } + + public ServerConfiguration.Builder saveMetadataHidden(Boolean saveMetadataHidden) { + this.instance.saveMetadataHidden = saveMetadataHidden; + return this; + } + + public ServerConfiguration.Builder contentTypes(List contentTypes) { + this.instance.contentTypes = contentTypes; + return this; + } + + public ServerConfiguration.Builder remoteClientBitrateLimit(Integer remoteClientBitrateLimit) { + this.instance.remoteClientBitrateLimit = remoteClientBitrateLimit; + return this; + } + + public ServerConfiguration.Builder enableFolderView(Boolean enableFolderView) { + this.instance.enableFolderView = enableFolderView; + return this; + } + + public ServerConfiguration.Builder enableGroupingIntoCollections(Boolean enableGroupingIntoCollections) { + this.instance.enableGroupingIntoCollections = enableGroupingIntoCollections; + return this; + } + + public ServerConfiguration.Builder displaySpecialsWithinSeasons(Boolean displaySpecialsWithinSeasons) { + this.instance.displaySpecialsWithinSeasons = displaySpecialsWithinSeasons; + return this; + } + + public ServerConfiguration.Builder codecsUsed(List codecsUsed) { + this.instance.codecsUsed = codecsUsed; + return this; + } + + public ServerConfiguration.Builder pluginRepositories(List pluginRepositories) { + this.instance.pluginRepositories = pluginRepositories; + return this; + } + + public ServerConfiguration.Builder enableExternalContentInSuggestions( + Boolean enableExternalContentInSuggestions) { + this.instance.enableExternalContentInSuggestions = enableExternalContentInSuggestions; + return this; + } + + public ServerConfiguration.Builder imageExtractionTimeoutMs(Integer imageExtractionTimeoutMs) { + this.instance.imageExtractionTimeoutMs = imageExtractionTimeoutMs; + return this; + } + + public ServerConfiguration.Builder pathSubstitutions(List pathSubstitutions) { + this.instance.pathSubstitutions = pathSubstitutions; + return this; + } + + public ServerConfiguration.Builder enableSlowResponseWarning(Boolean enableSlowResponseWarning) { + this.instance.enableSlowResponseWarning = enableSlowResponseWarning; + return this; + } + + public ServerConfiguration.Builder slowResponseThresholdMs(Long slowResponseThresholdMs) { + this.instance.slowResponseThresholdMs = slowResponseThresholdMs; + return this; + } + + public ServerConfiguration.Builder corsHosts(List corsHosts) { + this.instance.corsHosts = corsHosts; + return this; + } + + public ServerConfiguration.Builder activityLogRetentionDays(Integer activityLogRetentionDays) { + this.instance.activityLogRetentionDays = activityLogRetentionDays; + return this; + } + + public ServerConfiguration.Builder libraryScanFanoutConcurrency(Integer libraryScanFanoutConcurrency) { + this.instance.libraryScanFanoutConcurrency = libraryScanFanoutConcurrency; + return this; + } + + public ServerConfiguration.Builder libraryMetadataRefreshConcurrency( + Integer libraryMetadataRefreshConcurrency) { + this.instance.libraryMetadataRefreshConcurrency = libraryMetadataRefreshConcurrency; + return this; + } + + public ServerConfiguration.Builder removeOldPlugins(Boolean removeOldPlugins) { + this.instance.removeOldPlugins = removeOldPlugins; + return this; + } + + public ServerConfiguration.Builder allowClientLogUpload(Boolean allowClientLogUpload) { + this.instance.allowClientLogUpload = allowClientLogUpload; + return this; + } + + /** + * returns a built ServerConfiguration instance. + * + * The builder is not reusable. + */ + public ServerConfiguration build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ServerConfiguration.Builder builder() { + return new ServerConfiguration.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ServerConfiguration.Builder toBuilder() { + return new ServerConfiguration.Builder().logFileRetentionDays(getLogFileRetentionDays()) + .isStartupWizardCompleted(getIsStartupWizardCompleted()).cachePath(getCachePath()) + .previousVersion(getPreviousVersion()).previousVersionStr(getPreviousVersionStr()) + .enableMetrics(getEnableMetrics()).enableNormalizedItemByNameIds(getEnableNormalizedItemByNameIds()) + .isPortAuthorized(getIsPortAuthorized()).quickConnectAvailable(getQuickConnectAvailable()) + .enableCaseSensitiveItemIds(getEnableCaseSensitiveItemIds()) + .disableLiveTvChannelUserDataName(getDisableLiveTvChannelUserDataName()).metadataPath(getMetadataPath()) + .metadataNetworkPath(getMetadataNetworkPath()).preferredMetadataLanguage(getPreferredMetadataLanguage()) + .metadataCountryCode(getMetadataCountryCode()).sortReplaceCharacters(getSortReplaceCharacters()) + .sortRemoveCharacters(getSortRemoveCharacters()).sortRemoveWords(getSortRemoveWords()) + .minResumePct(getMinResumePct()).maxResumePct(getMaxResumePct()) + .minResumeDurationSeconds(getMinResumeDurationSeconds()).minAudiobookResume(getMinAudiobookResume()) + .maxAudiobookResume(getMaxAudiobookResume()).libraryMonitorDelay(getLibraryMonitorDelay()) + .imageSavingConvention(getImageSavingConvention()).metadataOptions(getMetadataOptions()) + .skipDeserializationForBasicTypes(getSkipDeserializationForBasicTypes()).serverName(getServerName()) + .uiCulture(getUiCulture()).saveMetadataHidden(getSaveMetadataHidden()).contentTypes(getContentTypes()) + .remoteClientBitrateLimit(getRemoteClientBitrateLimit()).enableFolderView(getEnableFolderView()) + .enableGroupingIntoCollections(getEnableGroupingIntoCollections()) + .displaySpecialsWithinSeasons(getDisplaySpecialsWithinSeasons()).codecsUsed(getCodecsUsed()) + .pluginRepositories(getPluginRepositories()) + .enableExternalContentInSuggestions(getEnableExternalContentInSuggestions()) + .imageExtractionTimeoutMs(getImageExtractionTimeoutMs()).pathSubstitutions(getPathSubstitutions()) + .enableSlowResponseWarning(getEnableSlowResponseWarning()) + .slowResponseThresholdMs(getSlowResponseThresholdMs()).corsHosts(getCorsHosts()) + .activityLogRetentionDays(getActivityLogRetentionDays()) + .libraryScanFanoutConcurrency(getLibraryScanFanoutConcurrency()) + .libraryMetadataRefreshConcurrency(getLibraryMetadataRefreshConcurrency()) + .removeOldPlugins(getRemoveOldPlugins()).allowClientLogUpload(getAllowClientLogUpload()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ServerDiscoveryInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ServerDiscoveryInfo.java new file mode 100644 index 0000000000000..ac6a4616e8b42 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ServerDiscoveryInfo.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The server discovery info model. + */ +@JsonPropertyOrder({ ServerDiscoveryInfo.JSON_PROPERTY_ADDRESS, ServerDiscoveryInfo.JSON_PROPERTY_ID, + ServerDiscoveryInfo.JSON_PROPERTY_NAME, ServerDiscoveryInfo.JSON_PROPERTY_ENDPOINT_ADDRESS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ServerDiscoveryInfo { + public static final String JSON_PROPERTY_ADDRESS = "Address"; + @org.eclipse.jdt.annotation.NonNull + private String address; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ENDPOINT_ADDRESS = "EndpointAddress"; + @org.eclipse.jdt.annotation.NonNull + private String endpointAddress; + + public ServerDiscoveryInfo() { + } + + public ServerDiscoveryInfo address(@org.eclipse.jdt.annotation.NonNull String address) { + this.address = address; + return this; + } + + /** + * Gets the address. + * + * @return address + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAddress() { + return address; + } + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAddress(@org.eclipse.jdt.annotation.NonNull String address) { + this.address = address; + } + + public ServerDiscoveryInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets the server identifier. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public ServerDiscoveryInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public ServerDiscoveryInfo endpointAddress(@org.eclipse.jdt.annotation.NonNull String endpointAddress) { + this.endpointAddress = endpointAddress; + return this; + } + + /** + * Gets the endpoint address. + * + * @return endpointAddress + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENDPOINT_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEndpointAddress() { + return endpointAddress; + } + + @JsonProperty(JSON_PROPERTY_ENDPOINT_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpointAddress(@org.eclipse.jdt.annotation.NonNull String endpointAddress) { + this.endpointAddress = endpointAddress; + } + + /** + * Return true if this ServerDiscoveryInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServerDiscoveryInfo serverDiscoveryInfo = (ServerDiscoveryInfo) o; + return Objects.equals(this.address, serverDiscoveryInfo.address) + && Objects.equals(this.id, serverDiscoveryInfo.id) + && Objects.equals(this.name, serverDiscoveryInfo.name) + && Objects.equals(this.endpointAddress, serverDiscoveryInfo.endpointAddress); + } + + @Override + public int hashCode() { + return Objects.hash(address, id, name, endpointAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServerDiscoveryInfo {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" endpointAddress: ").append(toIndentedString(endpointAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Address` to the URL query string + if (getAddress() != null) { + joiner.add(String.format("%sAddress%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAddress())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `EndpointAddress` to the URL query string + if (getEndpointAddress() != null) { + joiner.add(String.format("%sEndpointAddress%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndpointAddress())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ServerDiscoveryInfo instance; + + public Builder() { + this(new ServerDiscoveryInfo()); + } + + protected Builder(ServerDiscoveryInfo instance) { + this.instance = instance; + } + + public ServerDiscoveryInfo.Builder address(String address) { + this.instance.address = address; + return this; + } + + public ServerDiscoveryInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public ServerDiscoveryInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public ServerDiscoveryInfo.Builder endpointAddress(String endpointAddress) { + this.instance.endpointAddress = endpointAddress; + return this; + } + + /** + * returns a built ServerDiscoveryInfo instance. + * + * The builder is not reusable. + */ + public ServerDiscoveryInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ServerDiscoveryInfo.Builder builder() { + return new ServerDiscoveryInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ServerDiscoveryInfo.Builder toBuilder() { + return new ServerDiscoveryInfo.Builder().address(getAddress()).id(getId()).name(getName()) + .endpointAddress(getEndpointAddress()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SessionInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SessionInfo.java new file mode 100644 index 0000000000000..86060d0fbaa14 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SessionInfo.java @@ -0,0 +1,1348 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SessionInfo. + */ +@JsonPropertyOrder({ SessionInfo.JSON_PROPERTY_PLAY_STATE, SessionInfo.JSON_PROPERTY_ADDITIONAL_USERS, + SessionInfo.JSON_PROPERTY_CAPABILITIES, SessionInfo.JSON_PROPERTY_REMOTE_END_POINT, + SessionInfo.JSON_PROPERTY_PLAYABLE_MEDIA_TYPES, SessionInfo.JSON_PROPERTY_ID, SessionInfo.JSON_PROPERTY_USER_ID, + SessionInfo.JSON_PROPERTY_USER_NAME, SessionInfo.JSON_PROPERTY_CLIENT, + SessionInfo.JSON_PROPERTY_LAST_ACTIVITY_DATE, SessionInfo.JSON_PROPERTY_LAST_PLAYBACK_CHECK_IN, + SessionInfo.JSON_PROPERTY_DEVICE_NAME, SessionInfo.JSON_PROPERTY_DEVICE_TYPE, + SessionInfo.JSON_PROPERTY_NOW_PLAYING_ITEM, SessionInfo.JSON_PROPERTY_FULL_NOW_PLAYING_ITEM, + SessionInfo.JSON_PROPERTY_NOW_VIEWING_ITEM, SessionInfo.JSON_PROPERTY_DEVICE_ID, + SessionInfo.JSON_PROPERTY_APPLICATION_VERSION, SessionInfo.JSON_PROPERTY_TRANSCODING_INFO, + SessionInfo.JSON_PROPERTY_IS_ACTIVE, SessionInfo.JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL, + SessionInfo.JSON_PROPERTY_SUPPORTS_REMOTE_CONTROL, SessionInfo.JSON_PROPERTY_NOW_PLAYING_QUEUE, + SessionInfo.JSON_PROPERTY_NOW_PLAYING_QUEUE_FULL_ITEMS, SessionInfo.JSON_PROPERTY_HAS_CUSTOM_DEVICE_NAME, + SessionInfo.JSON_PROPERTY_PLAYLIST_ITEM_ID, SessionInfo.JSON_PROPERTY_SERVER_ID, + SessionInfo.JSON_PROPERTY_USER_PRIMARY_IMAGE_TAG, SessionInfo.JSON_PROPERTY_SUPPORTED_COMMANDS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SessionInfo { + public static final String JSON_PROPERTY_PLAY_STATE = "PlayState"; + @org.eclipse.jdt.annotation.NonNull + private PlayerStateInfo playState; + + public static final String JSON_PROPERTY_ADDITIONAL_USERS = "AdditionalUsers"; + @org.eclipse.jdt.annotation.NonNull + private List additionalUsers; + + public static final String JSON_PROPERTY_CAPABILITIES = "Capabilities"; + @org.eclipse.jdt.annotation.NonNull + private ClientCapabilities capabilities; + + public static final String JSON_PROPERTY_REMOTE_END_POINT = "RemoteEndPoint"; + @org.eclipse.jdt.annotation.NonNull + private String remoteEndPoint; + + public static final String JSON_PROPERTY_PLAYABLE_MEDIA_TYPES = "PlayableMediaTypes"; + @org.eclipse.jdt.annotation.NonNull + private List playableMediaTypes; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_USER_NAME = "UserName"; + @org.eclipse.jdt.annotation.NonNull + private String userName; + + public static final String JSON_PROPERTY_CLIENT = "Client"; + @org.eclipse.jdt.annotation.NonNull + private String client; + + public static final String JSON_PROPERTY_LAST_ACTIVITY_DATE = "LastActivityDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime lastActivityDate; + + public static final String JSON_PROPERTY_LAST_PLAYBACK_CHECK_IN = "LastPlaybackCheckIn"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime lastPlaybackCheckIn; + + public static final String JSON_PROPERTY_DEVICE_NAME = "DeviceName"; + @org.eclipse.jdt.annotation.NonNull + private String deviceName; + + public static final String JSON_PROPERTY_DEVICE_TYPE = "DeviceType"; + @org.eclipse.jdt.annotation.NonNull + private String deviceType; + + public static final String JSON_PROPERTY_NOW_PLAYING_ITEM = "NowPlayingItem"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemDto nowPlayingItem; + + public static final String JSON_PROPERTY_FULL_NOW_PLAYING_ITEM = "FullNowPlayingItem"; + @org.eclipse.jdt.annotation.NonNull + private BaseItem fullNowPlayingItem; + + public static final String JSON_PROPERTY_NOW_VIEWING_ITEM = "NowViewingItem"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemDto nowViewingItem; + + public static final String JSON_PROPERTY_DEVICE_ID = "DeviceId"; + @org.eclipse.jdt.annotation.NonNull + private String deviceId; + + public static final String JSON_PROPERTY_APPLICATION_VERSION = "ApplicationVersion"; + @org.eclipse.jdt.annotation.NonNull + private String applicationVersion; + + public static final String JSON_PROPERTY_TRANSCODING_INFO = "TranscodingInfo"; + @org.eclipse.jdt.annotation.NonNull + private TranscodingInfo transcodingInfo; + + public static final String JSON_PROPERTY_IS_ACTIVE = "IsActive"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isActive; + + public static final String JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL = "SupportsMediaControl"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsMediaControl; + + public static final String JSON_PROPERTY_SUPPORTS_REMOTE_CONTROL = "SupportsRemoteControl"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsRemoteControl; + + public static final String JSON_PROPERTY_NOW_PLAYING_QUEUE = "NowPlayingQueue"; + @org.eclipse.jdt.annotation.NonNull + private List nowPlayingQueue; + + public static final String JSON_PROPERTY_NOW_PLAYING_QUEUE_FULL_ITEMS = "NowPlayingQueueFullItems"; + @org.eclipse.jdt.annotation.NonNull + private List nowPlayingQueueFullItems; + + public static final String JSON_PROPERTY_HAS_CUSTOM_DEVICE_NAME = "HasCustomDeviceName"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasCustomDeviceName; + + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private String playlistItemId; + + public static final String JSON_PROPERTY_SERVER_ID = "ServerId"; + @org.eclipse.jdt.annotation.NonNull + private String serverId; + + public static final String JSON_PROPERTY_USER_PRIMARY_IMAGE_TAG = "UserPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String userPrimaryImageTag; + + public static final String JSON_PROPERTY_SUPPORTED_COMMANDS = "SupportedCommands"; + @org.eclipse.jdt.annotation.NonNull + private List supportedCommands; + + public SessionInfo() { + } + + @JsonCreator + public SessionInfo(@JsonProperty(JSON_PROPERTY_PLAYABLE_MEDIA_TYPES) List playableMediaTypes, + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) Boolean isActive, + @JsonProperty(JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL) Boolean supportsMediaControl, + @JsonProperty(JSON_PROPERTY_SUPPORTS_REMOTE_CONTROL) Boolean supportsRemoteControl, + @JsonProperty(JSON_PROPERTY_SUPPORTED_COMMANDS) List supportedCommands) { + this(); + this.playableMediaTypes = playableMediaTypes; + this.isActive = isActive; + this.supportsMediaControl = supportsMediaControl; + this.supportsRemoteControl = supportsRemoteControl; + this.supportedCommands = supportedCommands; + } + + public SessionInfo playState(@org.eclipse.jdt.annotation.NonNull PlayerStateInfo playState) { + this.playState = playState; + return this; + } + + /** + * Get playState + * + * @return playState + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PlayerStateInfo getPlayState() { + return playState; + } + + @JsonProperty(JSON_PROPERTY_PLAY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayState(@org.eclipse.jdt.annotation.NonNull PlayerStateInfo playState) { + this.playState = playState; + } + + public SessionInfo additionalUsers(@org.eclipse.jdt.annotation.NonNull List additionalUsers) { + this.additionalUsers = additionalUsers; + return this; + } + + public SessionInfo addAdditionalUsersItem(SessionUserInfo additionalUsersItem) { + if (this.additionalUsers == null) { + this.additionalUsers = new ArrayList<>(); + } + this.additionalUsers.add(additionalUsersItem); + return this; + } + + /** + * Get additionalUsers + * + * @return additionalUsers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ADDITIONAL_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAdditionalUsers() { + return additionalUsers; + } + + @JsonProperty(JSON_PROPERTY_ADDITIONAL_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdditionalUsers(@org.eclipse.jdt.annotation.NonNull List additionalUsers) { + this.additionalUsers = additionalUsers; + } + + public SessionInfo capabilities(@org.eclipse.jdt.annotation.NonNull ClientCapabilities capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Get capabilities + * + * @return capabilities + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAPABILITIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ClientCapabilities getCapabilities() { + return capabilities; + } + + @JsonProperty(JSON_PROPERTY_CAPABILITIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapabilities(@org.eclipse.jdt.annotation.NonNull ClientCapabilities capabilities) { + this.capabilities = capabilities; + } + + public SessionInfo remoteEndPoint(@org.eclipse.jdt.annotation.NonNull String remoteEndPoint) { + this.remoteEndPoint = remoteEndPoint; + return this; + } + + /** + * Gets or sets the remote end point. + * + * @return remoteEndPoint + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMOTE_END_POINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRemoteEndPoint() { + return remoteEndPoint; + } + + @JsonProperty(JSON_PROPERTY_REMOTE_END_POINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemoteEndPoint(@org.eclipse.jdt.annotation.NonNull String remoteEndPoint) { + this.remoteEndPoint = remoteEndPoint; + } + + /** + * Gets the playable media types. + * + * @return playableMediaTypes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYABLE_MEDIA_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPlayableMediaTypes() { + return playableMediaTypes; + } + + public SessionInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public SessionInfo userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the user id. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public SessionInfo userName(@org.eclipse.jdt.annotation.NonNull String userName) { + this.userName = userName; + return this; + } + + /** + * Gets or sets the username. + * + * @return userName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserName() { + return userName; + } + + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserName(@org.eclipse.jdt.annotation.NonNull String userName) { + this.userName = userName; + } + + public SessionInfo client(@org.eclipse.jdt.annotation.NonNull String client) { + this.client = client; + return this; + } + + /** + * Gets or sets the type of the client. + * + * @return client + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { + return client; + } + + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClient(@org.eclipse.jdt.annotation.NonNull String client) { + this.client = client; + } + + public SessionInfo lastActivityDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastActivityDate) { + this.lastActivityDate = lastActivityDate; + return this; + } + + /** + * Gets or sets the last activity date. + * + * @return lastActivityDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_ACTIVITY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastActivityDate() { + return lastActivityDate; + } + + @JsonProperty(JSON_PROPERTY_LAST_ACTIVITY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastActivityDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastActivityDate) { + this.lastActivityDate = lastActivityDate; + } + + public SessionInfo lastPlaybackCheckIn(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastPlaybackCheckIn) { + this.lastPlaybackCheckIn = lastPlaybackCheckIn; + return this; + } + + /** + * Gets or sets the last playback check in. + * + * @return lastPlaybackCheckIn + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_PLAYBACK_CHECK_IN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastPlaybackCheckIn() { + return lastPlaybackCheckIn; + } + + @JsonProperty(JSON_PROPERTY_LAST_PLAYBACK_CHECK_IN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastPlaybackCheckIn(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastPlaybackCheckIn) { + this.lastPlaybackCheckIn = lastPlaybackCheckIn; + } + + public SessionInfo deviceName(@org.eclipse.jdt.annotation.NonNull String deviceName) { + this.deviceName = deviceName; + return this; + } + + /** + * Gets or sets the name of the device. + * + * @return deviceName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceName() { + return deviceName; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceName(@org.eclipse.jdt.annotation.NonNull String deviceName) { + this.deviceName = deviceName; + } + + public SessionInfo deviceType(@org.eclipse.jdt.annotation.NonNull String deviceType) { + this.deviceType = deviceType; + return this; + } + + /** + * Gets or sets the type of the device. + * + * @return deviceType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceType() { + return deviceType; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceType(@org.eclipse.jdt.annotation.NonNull String deviceType) { + this.deviceType = deviceType; + } + + public SessionInfo nowPlayingItem(@org.eclipse.jdt.annotation.NonNull BaseItemDto nowPlayingItem) { + this.nowPlayingItem = nowPlayingItem; + return this; + } + + /** + * Gets or sets the now playing item. + * + * @return nowPlayingItem + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemDto getNowPlayingItem() { + return nowPlayingItem; + } + + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNowPlayingItem(@org.eclipse.jdt.annotation.NonNull BaseItemDto nowPlayingItem) { + this.nowPlayingItem = nowPlayingItem; + } + + public SessionInfo fullNowPlayingItem(@org.eclipse.jdt.annotation.NonNull BaseItem fullNowPlayingItem) { + this.fullNowPlayingItem = fullNowPlayingItem; + return this; + } + + /** + * Class BaseItem. + * + * @return fullNowPlayingItem + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FULL_NOW_PLAYING_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItem getFullNowPlayingItem() { + return fullNowPlayingItem; + } + + @JsonProperty(JSON_PROPERTY_FULL_NOW_PLAYING_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFullNowPlayingItem(@org.eclipse.jdt.annotation.NonNull BaseItem fullNowPlayingItem) { + this.fullNowPlayingItem = fullNowPlayingItem; + } + + public SessionInfo nowViewingItem(@org.eclipse.jdt.annotation.NonNull BaseItemDto nowViewingItem) { + this.nowViewingItem = nowViewingItem; + return this; + } + + /** + * This is strictly used as a data transfer object from the api layer. This holds information about a BaseItem in a + * format that is convenient for the client. + * + * @return nowViewingItem + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NOW_VIEWING_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemDto getNowViewingItem() { + return nowViewingItem; + } + + @JsonProperty(JSON_PROPERTY_NOW_VIEWING_ITEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNowViewingItem(@org.eclipse.jdt.annotation.NonNull BaseItemDto nowViewingItem) { + this.nowViewingItem = nowViewingItem; + } + + public SessionInfo deviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Gets or sets the device id. + * + * @return deviceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceId() { + return deviceId; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + } + + public SessionInfo applicationVersion(@org.eclipse.jdt.annotation.NonNull String applicationVersion) { + this.applicationVersion = applicationVersion; + return this; + } + + /** + * Gets or sets the application version. + * + * @return applicationVersion + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_APPLICATION_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getApplicationVersion() { + return applicationVersion; + } + + @JsonProperty(JSON_PROPERTY_APPLICATION_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApplicationVersion(@org.eclipse.jdt.annotation.NonNull String applicationVersion) { + this.applicationVersion = applicationVersion; + } + + public SessionInfo transcodingInfo(@org.eclipse.jdt.annotation.NonNull TranscodingInfo transcodingInfo) { + this.transcodingInfo = transcodingInfo; + return this; + } + + /** + * Get transcodingInfo + * + * @return transcodingInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODING_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TranscodingInfo getTranscodingInfo() { + return transcodingInfo; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODING_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodingInfo(@org.eclipse.jdt.annotation.NonNull TranscodingInfo transcodingInfo) { + this.transcodingInfo = transcodingInfo; + } + + /** + * Gets a value indicating whether this instance is active. + * + * @return isActive + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsActive() { + return isActive; + } + + /** + * Get supportsMediaControl + * + * @return supportsMediaControl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_MEDIA_CONTROL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsMediaControl() { + return supportsMediaControl; + } + + /** + * Get supportsRemoteControl + * + * @return supportsRemoteControl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_REMOTE_CONTROL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsRemoteControl() { + return supportsRemoteControl; + } + + public SessionInfo nowPlayingQueue(@org.eclipse.jdt.annotation.NonNull List nowPlayingQueue) { + this.nowPlayingQueue = nowPlayingQueue; + return this; + } + + public SessionInfo addNowPlayingQueueItem(QueueItem nowPlayingQueueItem) { + if (this.nowPlayingQueue == null) { + this.nowPlayingQueue = new ArrayList<>(); + } + this.nowPlayingQueue.add(nowPlayingQueueItem); + return this; + } + + /** + * Get nowPlayingQueue + * + * @return nowPlayingQueue + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNowPlayingQueue() { + return nowPlayingQueue; + } + + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNowPlayingQueue(@org.eclipse.jdt.annotation.NonNull List nowPlayingQueue) { + this.nowPlayingQueue = nowPlayingQueue; + } + + public SessionInfo nowPlayingQueueFullItems( + @org.eclipse.jdt.annotation.NonNull List nowPlayingQueueFullItems) { + this.nowPlayingQueueFullItems = nowPlayingQueueFullItems; + return this; + } + + public SessionInfo addNowPlayingQueueFullItemsItem(BaseItemDto nowPlayingQueueFullItemsItem) { + if (this.nowPlayingQueueFullItems == null) { + this.nowPlayingQueueFullItems = new ArrayList<>(); + } + this.nowPlayingQueueFullItems.add(nowPlayingQueueFullItemsItem); + return this; + } + + /** + * Get nowPlayingQueueFullItems + * + * @return nowPlayingQueueFullItems + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE_FULL_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNowPlayingQueueFullItems() { + return nowPlayingQueueFullItems; + } + + @JsonProperty(JSON_PROPERTY_NOW_PLAYING_QUEUE_FULL_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNowPlayingQueueFullItems( + @org.eclipse.jdt.annotation.NonNull List nowPlayingQueueFullItems) { + this.nowPlayingQueueFullItems = nowPlayingQueueFullItems; + } + + public SessionInfo hasCustomDeviceName(@org.eclipse.jdt.annotation.NonNull Boolean hasCustomDeviceName) { + this.hasCustomDeviceName = hasCustomDeviceName; + return this; + } + + /** + * Get hasCustomDeviceName + * + * @return hasCustomDeviceName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_CUSTOM_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasCustomDeviceName() { + return hasCustomDeviceName; + } + + @JsonProperty(JSON_PROPERTY_HAS_CUSTOM_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasCustomDeviceName(@org.eclipse.jdt.annotation.NonNull Boolean hasCustomDeviceName) { + this.hasCustomDeviceName = hasCustomDeviceName; + } + + public SessionInfo playlistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Get playlistItemId + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull String playlistItemId) { + this.playlistItemId = playlistItemId; + } + + public SessionInfo serverId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + return this; + } + + /** + * Get serverId + * + * @return serverId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerId() { + return serverId; + } + + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + } + + public SessionInfo userPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String userPrimaryImageTag) { + this.userPrimaryImageTag = userPrimaryImageTag; + return this; + } + + /** + * Get userPrimaryImageTag + * + * @return userPrimaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserPrimaryImageTag() { + return userPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_USER_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String userPrimaryImageTag) { + this.userPrimaryImageTag = userPrimaryImageTag; + } + + /** + * Gets the supported commands. + * + * @return supportedCommands + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTED_COMMANDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSupportedCommands() { + return supportedCommands; + } + + /** + * Return true if this SessionInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionInfo sessionInfo = (SessionInfo) o; + return Objects.equals(this.playState, sessionInfo.playState) + && Objects.equals(this.additionalUsers, sessionInfo.additionalUsers) + && Objects.equals(this.capabilities, sessionInfo.capabilities) + && Objects.equals(this.remoteEndPoint, sessionInfo.remoteEndPoint) + && Objects.equals(this.playableMediaTypes, sessionInfo.playableMediaTypes) + && Objects.equals(this.id, sessionInfo.id) && Objects.equals(this.userId, sessionInfo.userId) + && Objects.equals(this.userName, sessionInfo.userName) + && Objects.equals(this.client, sessionInfo.client) + && Objects.equals(this.lastActivityDate, sessionInfo.lastActivityDate) + && Objects.equals(this.lastPlaybackCheckIn, sessionInfo.lastPlaybackCheckIn) + && Objects.equals(this.deviceName, sessionInfo.deviceName) + && Objects.equals(this.deviceType, sessionInfo.deviceType) + && Objects.equals(this.nowPlayingItem, sessionInfo.nowPlayingItem) + && Objects.equals(this.fullNowPlayingItem, sessionInfo.fullNowPlayingItem) + && Objects.equals(this.nowViewingItem, sessionInfo.nowViewingItem) + && Objects.equals(this.deviceId, sessionInfo.deviceId) + && Objects.equals(this.applicationVersion, sessionInfo.applicationVersion) + && Objects.equals(this.transcodingInfo, sessionInfo.transcodingInfo) + && Objects.equals(this.isActive, sessionInfo.isActive) + && Objects.equals(this.supportsMediaControl, sessionInfo.supportsMediaControl) + && Objects.equals(this.supportsRemoteControl, sessionInfo.supportsRemoteControl) + && Objects.equals(this.nowPlayingQueue, sessionInfo.nowPlayingQueue) + && Objects.equals(this.nowPlayingQueueFullItems, sessionInfo.nowPlayingQueueFullItems) + && Objects.equals(this.hasCustomDeviceName, sessionInfo.hasCustomDeviceName) + && Objects.equals(this.playlistItemId, sessionInfo.playlistItemId) + && Objects.equals(this.serverId, sessionInfo.serverId) + && Objects.equals(this.userPrimaryImageTag, sessionInfo.userPrimaryImageTag) + && Objects.equals(this.supportedCommands, sessionInfo.supportedCommands); + } + + @Override + public int hashCode() { + return Objects.hash(playState, additionalUsers, capabilities, remoteEndPoint, playableMediaTypes, id, userId, + userName, client, lastActivityDate, lastPlaybackCheckIn, deviceName, deviceType, nowPlayingItem, + fullNowPlayingItem, nowViewingItem, deviceId, applicationVersion, transcodingInfo, isActive, + supportsMediaControl, supportsRemoteControl, nowPlayingQueue, nowPlayingQueueFullItems, + hasCustomDeviceName, playlistItemId, serverId, userPrimaryImageTag, supportedCommands); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionInfo {\n"); + sb.append(" playState: ").append(toIndentedString(playState)).append("\n"); + sb.append(" additionalUsers: ").append(toIndentedString(additionalUsers)).append("\n"); + sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); + sb.append(" remoteEndPoint: ").append(toIndentedString(remoteEndPoint)).append("\n"); + sb.append(" playableMediaTypes: ").append(toIndentedString(playableMediaTypes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append(" lastActivityDate: ").append(toIndentedString(lastActivityDate)).append("\n"); + sb.append(" lastPlaybackCheckIn: ").append(toIndentedString(lastPlaybackCheckIn)).append("\n"); + sb.append(" deviceName: ").append(toIndentedString(deviceName)).append("\n"); + sb.append(" deviceType: ").append(toIndentedString(deviceType)).append("\n"); + sb.append(" nowPlayingItem: ").append(toIndentedString(nowPlayingItem)).append("\n"); + sb.append(" fullNowPlayingItem: ").append(toIndentedString(fullNowPlayingItem)).append("\n"); + sb.append(" nowViewingItem: ").append(toIndentedString(nowViewingItem)).append("\n"); + sb.append(" deviceId: ").append(toIndentedString(deviceId)).append("\n"); + sb.append(" applicationVersion: ").append(toIndentedString(applicationVersion)).append("\n"); + sb.append(" transcodingInfo: ").append(toIndentedString(transcodingInfo)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" supportsMediaControl: ").append(toIndentedString(supportsMediaControl)).append("\n"); + sb.append(" supportsRemoteControl: ").append(toIndentedString(supportsRemoteControl)).append("\n"); + sb.append(" nowPlayingQueue: ").append(toIndentedString(nowPlayingQueue)).append("\n"); + sb.append(" nowPlayingQueueFullItems: ").append(toIndentedString(nowPlayingQueueFullItems)).append("\n"); + sb.append(" hasCustomDeviceName: ").append(toIndentedString(hasCustomDeviceName)).append("\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append(" userPrimaryImageTag: ").append(toIndentedString(userPrimaryImageTag)).append("\n"); + sb.append(" supportedCommands: ").append(toIndentedString(supportedCommands)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlayState` to the URL query string + if (getPlayState() != null) { + joiner.add(getPlayState().toUrlQueryString(prefix + "PlayState" + suffix)); + } + + // add `AdditionalUsers` to the URL query string + if (getAdditionalUsers() != null) { + for (int i = 0; i < getAdditionalUsers().size(); i++) { + if (getAdditionalUsers().get(i) != null) { + joiner.add(getAdditionalUsers().get(i).toUrlQueryString(String.format("%sAdditionalUsers%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Capabilities` to the URL query string + if (getCapabilities() != null) { + joiner.add(getCapabilities().toUrlQueryString(prefix + "Capabilities" + suffix)); + } + + // add `RemoteEndPoint` to the URL query string + if (getRemoteEndPoint() != null) { + joiner.add(String.format("%sRemoteEndPoint%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRemoteEndPoint())))); + } + + // add `PlayableMediaTypes` to the URL query string + if (getPlayableMediaTypes() != null) { + for (int i = 0; i < getPlayableMediaTypes().size(); i++) { + joiner.add(String.format("%sPlayableMediaTypes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getPlayableMediaTypes().get(i))))); + } + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `UserName` to the URL query string + if (getUserName() != null) { + joiner.add(String.format("%sUserName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserName())))); + } + + // add `Client` to the URL query string + if (getClient() != null) { + joiner.add(String.format("%sClient%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getClient())))); + } + + // add `LastActivityDate` to the URL query string + if (getLastActivityDate() != null) { + joiner.add(String.format("%sLastActivityDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastActivityDate())))); + } + + // add `LastPlaybackCheckIn` to the URL query string + if (getLastPlaybackCheckIn() != null) { + joiner.add(String.format("%sLastPlaybackCheckIn%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastPlaybackCheckIn())))); + } + + // add `DeviceName` to the URL query string + if (getDeviceName() != null) { + joiner.add(String.format("%sDeviceName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceName())))); + } + + // add `DeviceType` to the URL query string + if (getDeviceType() != null) { + joiner.add(String.format("%sDeviceType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceType())))); + } + + // add `NowPlayingItem` to the URL query string + if (getNowPlayingItem() != null) { + joiner.add(getNowPlayingItem().toUrlQueryString(prefix + "NowPlayingItem" + suffix)); + } + + // add `FullNowPlayingItem` to the URL query string + if (getFullNowPlayingItem() != null) { + joiner.add(getFullNowPlayingItem().toUrlQueryString(prefix + "FullNowPlayingItem" + suffix)); + } + + // add `NowViewingItem` to the URL query string + if (getNowViewingItem() != null) { + joiner.add(getNowViewingItem().toUrlQueryString(prefix + "NowViewingItem" + suffix)); + } + + // add `DeviceId` to the URL query string + if (getDeviceId() != null) { + joiner.add(String.format("%sDeviceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceId())))); + } + + // add `ApplicationVersion` to the URL query string + if (getApplicationVersion() != null) { + joiner.add(String.format("%sApplicationVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getApplicationVersion())))); + } + + // add `TranscodingInfo` to the URL query string + if (getTranscodingInfo() != null) { + joiner.add(getTranscodingInfo().toUrlQueryString(prefix + "TranscodingInfo" + suffix)); + } + + // add `IsActive` to the URL query string + if (getIsActive() != null) { + joiner.add(String.format("%sIsActive%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsActive())))); + } + + // add `SupportsMediaControl` to the URL query string + if (getSupportsMediaControl() != null) { + joiner.add(String.format("%sSupportsMediaControl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsMediaControl())))); + } + + // add `SupportsRemoteControl` to the URL query string + if (getSupportsRemoteControl() != null) { + joiner.add(String.format("%sSupportsRemoteControl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsRemoteControl())))); + } + + // add `NowPlayingQueue` to the URL query string + if (getNowPlayingQueue() != null) { + for (int i = 0; i < getNowPlayingQueue().size(); i++) { + if (getNowPlayingQueue().get(i) != null) { + joiner.add(getNowPlayingQueue().get(i).toUrlQueryString(String.format("%sNowPlayingQueue%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `NowPlayingQueueFullItems` to the URL query string + if (getNowPlayingQueueFullItems() != null) { + for (int i = 0; i < getNowPlayingQueueFullItems().size(); i++) { + if (getNowPlayingQueueFullItems().get(i) != null) { + joiner.add(getNowPlayingQueueFullItems().get(i).toUrlQueryString(String.format( + "%sNowPlayingQueueFullItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `HasCustomDeviceName` to the URL query string + if (getHasCustomDeviceName() != null) { + joiner.add(String.format("%sHasCustomDeviceName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasCustomDeviceName())))); + } + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + // add `ServerId` to the URL query string + if (getServerId() != null) { + joiner.add(String.format("%sServerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerId())))); + } + + // add `UserPrimaryImageTag` to the URL query string + if (getUserPrimaryImageTag() != null) { + joiner.add(String.format("%sUserPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserPrimaryImageTag())))); + } + + // add `SupportedCommands` to the URL query string + if (getSupportedCommands() != null) { + for (int i = 0; i < getSupportedCommands().size(); i++) { + if (getSupportedCommands().get(i) != null) { + joiner.add(String.format("%sSupportedCommands%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSupportedCommands().get(i))))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private SessionInfo instance; + + public Builder() { + this(new SessionInfo()); + } + + protected Builder(SessionInfo instance) { + this.instance = instance; + } + + public SessionInfo.Builder playState(PlayerStateInfo playState) { + this.instance.playState = playState; + return this; + } + + public SessionInfo.Builder additionalUsers(List additionalUsers) { + this.instance.additionalUsers = additionalUsers; + return this; + } + + public SessionInfo.Builder capabilities(ClientCapabilities capabilities) { + this.instance.capabilities = capabilities; + return this; + } + + public SessionInfo.Builder remoteEndPoint(String remoteEndPoint) { + this.instance.remoteEndPoint = remoteEndPoint; + return this; + } + + public SessionInfo.Builder playableMediaTypes(List playableMediaTypes) { + this.instance.playableMediaTypes = playableMediaTypes; + return this; + } + + public SessionInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public SessionInfo.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public SessionInfo.Builder userName(String userName) { + this.instance.userName = userName; + return this; + } + + public SessionInfo.Builder client(String client) { + this.instance.client = client; + return this; + } + + public SessionInfo.Builder lastActivityDate(OffsetDateTime lastActivityDate) { + this.instance.lastActivityDate = lastActivityDate; + return this; + } + + public SessionInfo.Builder lastPlaybackCheckIn(OffsetDateTime lastPlaybackCheckIn) { + this.instance.lastPlaybackCheckIn = lastPlaybackCheckIn; + return this; + } + + public SessionInfo.Builder deviceName(String deviceName) { + this.instance.deviceName = deviceName; + return this; + } + + public SessionInfo.Builder deviceType(String deviceType) { + this.instance.deviceType = deviceType; + return this; + } + + public SessionInfo.Builder nowPlayingItem(BaseItemDto nowPlayingItem) { + this.instance.nowPlayingItem = nowPlayingItem; + return this; + } + + public SessionInfo.Builder fullNowPlayingItem(BaseItem fullNowPlayingItem) { + this.instance.fullNowPlayingItem = fullNowPlayingItem; + return this; + } + + public SessionInfo.Builder nowViewingItem(BaseItemDto nowViewingItem) { + this.instance.nowViewingItem = nowViewingItem; + return this; + } + + public SessionInfo.Builder deviceId(String deviceId) { + this.instance.deviceId = deviceId; + return this; + } + + public SessionInfo.Builder applicationVersion(String applicationVersion) { + this.instance.applicationVersion = applicationVersion; + return this; + } + + public SessionInfo.Builder transcodingInfo(TranscodingInfo transcodingInfo) { + this.instance.transcodingInfo = transcodingInfo; + return this; + } + + public SessionInfo.Builder isActive(Boolean isActive) { + this.instance.isActive = isActive; + return this; + } + + public SessionInfo.Builder supportsMediaControl(Boolean supportsMediaControl) { + this.instance.supportsMediaControl = supportsMediaControl; + return this; + } + + public SessionInfo.Builder supportsRemoteControl(Boolean supportsRemoteControl) { + this.instance.supportsRemoteControl = supportsRemoteControl; + return this; + } + + public SessionInfo.Builder nowPlayingQueue(List nowPlayingQueue) { + this.instance.nowPlayingQueue = nowPlayingQueue; + return this; + } + + public SessionInfo.Builder nowPlayingQueueFullItems(List nowPlayingQueueFullItems) { + this.instance.nowPlayingQueueFullItems = nowPlayingQueueFullItems; + return this; + } + + public SessionInfo.Builder hasCustomDeviceName(Boolean hasCustomDeviceName) { + this.instance.hasCustomDeviceName = hasCustomDeviceName; + return this; + } + + public SessionInfo.Builder playlistItemId(String playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + public SessionInfo.Builder serverId(String serverId) { + this.instance.serverId = serverId; + return this; + } + + public SessionInfo.Builder userPrimaryImageTag(String userPrimaryImageTag) { + this.instance.userPrimaryImageTag = userPrimaryImageTag; + return this; + } + + public SessionInfo.Builder supportedCommands(List supportedCommands) { + this.instance.supportedCommands = supportedCommands; + return this; + } + + /** + * returns a built SessionInfo instance. + * + * The builder is not reusable. + */ + public SessionInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SessionInfo.Builder builder() { + return new SessionInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SessionInfo.Builder toBuilder() { + return new SessionInfo.Builder().playState(getPlayState()).additionalUsers(getAdditionalUsers()) + .capabilities(getCapabilities()).remoteEndPoint(getRemoteEndPoint()) + .playableMediaTypes(getPlayableMediaTypes()).id(getId()).userId(getUserId()).userName(getUserName()) + .client(getClient()).lastActivityDate(getLastActivityDate()) + .lastPlaybackCheckIn(getLastPlaybackCheckIn()).deviceName(getDeviceName()).deviceType(getDeviceType()) + .nowPlayingItem(getNowPlayingItem()).fullNowPlayingItem(getFullNowPlayingItem()) + .nowViewingItem(getNowViewingItem()).deviceId(getDeviceId()).applicationVersion(getApplicationVersion()) + .transcodingInfo(getTranscodingInfo()).isActive(getIsActive()) + .supportsMediaControl(getSupportsMediaControl()).supportsRemoteControl(getSupportsRemoteControl()) + .nowPlayingQueue(getNowPlayingQueue()).nowPlayingQueueFullItems(getNowPlayingQueueFullItems()) + .hasCustomDeviceName(getHasCustomDeviceName()).playlistItemId(getPlaylistItemId()) + .serverId(getServerId()).userPrimaryImageTag(getUserPrimaryImageTag()) + .supportedCommands(getSupportedCommands()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SessionMessageType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SessionMessageType.java new file mode 100644 index 0000000000000..144db69eced59 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SessionMessageType.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The different kinds of messages that are used in the WebSocket api. + */ +public enum SessionMessageType { + + FORCE_KEEP_ALIVE("ForceKeepAlive"), + + GENERAL_COMMAND("GeneralCommand"), + + USER_DATA_CHANGED("UserDataChanged"), + + SESSIONS("Sessions"), + + PLAY("Play"), + + SYNC_PLAY_COMMAND("SyncPlayCommand"), + + SYNC_PLAY_GROUP_UPDATE("SyncPlayGroupUpdate"), + + PLAYSTATE("Playstate"), + + RESTART_REQUIRED("RestartRequired"), + + SERVER_SHUTTING_DOWN("ServerShuttingDown"), + + SERVER_RESTARTING("ServerRestarting"), + + LIBRARY_CHANGED("LibraryChanged"), + + USER_DELETED("UserDeleted"), + + USER_UPDATED("UserUpdated"), + + SERIES_TIMER_CREATED("SeriesTimerCreated"), + + TIMER_CREATED("TimerCreated"), + + SERIES_TIMER_CANCELLED("SeriesTimerCancelled"), + + TIMER_CANCELLED("TimerCancelled"), + + REFRESH_PROGRESS("RefreshProgress"), + + SCHEDULED_TASK_ENDED("ScheduledTaskEnded"), + + PACKAGE_INSTALLATION_CANCELLED("PackageInstallationCancelled"), + + PACKAGE_INSTALLATION_FAILED("PackageInstallationFailed"), + + PACKAGE_INSTALLATION_COMPLETED("PackageInstallationCompleted"), + + PACKAGE_INSTALLING("PackageInstalling"), + + PACKAGE_UNINSTALLED("PackageUninstalled"), + + ACTIVITY_LOG_ENTRY("ActivityLogEntry"), + + SCHEDULED_TASKS_INFO("ScheduledTasksInfo"), + + ACTIVITY_LOG_ENTRY_START("ActivityLogEntryStart"), + + ACTIVITY_LOG_ENTRY_STOP("ActivityLogEntryStop"), + + SESSIONS_START("SessionsStart"), + + SESSIONS_STOP("SessionsStop"), + + SCHEDULED_TASKS_INFO_START("ScheduledTasksInfoStart"), + + SCHEDULED_TASKS_INFO_STOP("ScheduledTasksInfoStop"), + + KEEP_ALIVE("KeepAlive"); + + private String value; + + SessionMessageType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SessionMessageType fromValue(String value) { + for (SessionMessageType b : SessionMessageType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SessionUserInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SessionUserInfo.java new file mode 100644 index 0000000000000..ccd20076dfebf --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SessionUserInfo.java @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SessionUserInfo. + */ +@JsonPropertyOrder({ SessionUserInfo.JSON_PROPERTY_USER_ID, SessionUserInfo.JSON_PROPERTY_USER_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SessionUserInfo { + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private UUID userId; + + public static final String JSON_PROPERTY_USER_NAME = "UserName"; + @org.eclipse.jdt.annotation.NonNull + private String userName; + + public SessionUserInfo() { + } + + public SessionUserInfo userId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + return this; + } + + /** + * Gets or sets the user identifier. + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull UUID userId) { + this.userId = userId; + } + + public SessionUserInfo userName(@org.eclipse.jdt.annotation.NonNull String userName) { + this.userName = userName; + return this; + } + + /** + * Gets or sets the name of the user. + * + * @return userName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserName() { + return userName; + } + + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserName(@org.eclipse.jdt.annotation.NonNull String userName) { + this.userName = userName; + } + + /** + * Return true if this SessionUserInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionUserInfo sessionUserInfo = (SessionUserInfo) o; + return Objects.equals(this.userId, sessionUserInfo.userId) + && Objects.equals(this.userName, sessionUserInfo.userName); + } + + @Override + public int hashCode() { + return Objects.hash(userId, userName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionUserInfo {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `UserName` to the URL query string + if (getUserName() != null) { + joiner.add(String.format("%sUserName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SessionUserInfo instance; + + public Builder() { + this(new SessionUserInfo()); + } + + protected Builder(SessionUserInfo instance) { + this.instance = instance; + } + + public SessionUserInfo.Builder userId(UUID userId) { + this.instance.userId = userId; + return this; + } + + public SessionUserInfo.Builder userName(String userName) { + this.instance.userName = userName; + return this; + } + + /** + * returns a built SessionUserInfo instance. + * + * The builder is not reusable. + */ + public SessionUserInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SessionUserInfo.Builder builder() { + return new SessionUserInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SessionUserInfo.Builder toBuilder() { + return new SessionUserInfo.Builder().userId(getUserId()).userName(getUserName()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SetChannelMappingDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SetChannelMappingDto.java new file mode 100644 index 0000000000000..f6a97acb79cbb --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SetChannelMappingDto.java @@ -0,0 +1,274 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Set channel mapping dto. + */ +@JsonPropertyOrder({ SetChannelMappingDto.JSON_PROPERTY_PROVIDER_ID, + SetChannelMappingDto.JSON_PROPERTY_TUNER_CHANNEL_ID, SetChannelMappingDto.JSON_PROPERTY_PROVIDER_CHANNEL_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SetChannelMappingDto { + public static final String JSON_PROPERTY_PROVIDER_ID = "ProviderId"; + @org.eclipse.jdt.annotation.Nullable + private String providerId; + + public static final String JSON_PROPERTY_TUNER_CHANNEL_ID = "TunerChannelId"; + @org.eclipse.jdt.annotation.Nullable + private String tunerChannelId; + + public static final String JSON_PROPERTY_PROVIDER_CHANNEL_ID = "ProviderChannelId"; + @org.eclipse.jdt.annotation.Nullable + private String providerChannelId; + + public SetChannelMappingDto() { + } + + public SetChannelMappingDto providerId(@org.eclipse.jdt.annotation.Nullable String providerId) { + this.providerId = providerId; + return this; + } + + /** + * Gets or sets the provider id. + * + * @return providerId + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProviderId() { + return providerId; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProviderId(@org.eclipse.jdt.annotation.Nullable String providerId) { + this.providerId = providerId; + } + + public SetChannelMappingDto tunerChannelId(@org.eclipse.jdt.annotation.Nullable String tunerChannelId) { + this.tunerChannelId = tunerChannelId; + return this; + } + + /** + * Gets or sets the tuner channel id. + * + * @return tunerChannelId + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TUNER_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTunerChannelId() { + return tunerChannelId; + } + + @JsonProperty(JSON_PROPERTY_TUNER_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTunerChannelId(@org.eclipse.jdt.annotation.Nullable String tunerChannelId) { + this.tunerChannelId = tunerChannelId; + } + + public SetChannelMappingDto providerChannelId(@org.eclipse.jdt.annotation.Nullable String providerChannelId) { + this.providerChannelId = providerChannelId; + return this; + } + + /** + * Gets or sets the provider channel id. + * + * @return providerChannelId + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROVIDER_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProviderChannelId() { + return providerChannelId; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProviderChannelId(@org.eclipse.jdt.annotation.Nullable String providerChannelId) { + this.providerChannelId = providerChannelId; + } + + /** + * Return true if this SetChannelMappingDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetChannelMappingDto setChannelMappingDto = (SetChannelMappingDto) o; + return Objects.equals(this.providerId, setChannelMappingDto.providerId) + && Objects.equals(this.tunerChannelId, setChannelMappingDto.tunerChannelId) + && Objects.equals(this.providerChannelId, setChannelMappingDto.providerChannelId); + } + + @Override + public int hashCode() { + return Objects.hash(providerId, tunerChannelId, providerChannelId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetChannelMappingDto {\n"); + sb.append(" providerId: ").append(toIndentedString(providerId)).append("\n"); + sb.append(" tunerChannelId: ").append(toIndentedString(tunerChannelId)).append("\n"); + sb.append(" providerChannelId: ").append(toIndentedString(providerChannelId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ProviderId` to the URL query string + if (getProviderId() != null) { + joiner.add(String.format("%sProviderId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProviderId())))); + } + + // add `TunerChannelId` to the URL query string + if (getTunerChannelId() != null) { + joiner.add(String.format("%sTunerChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTunerChannelId())))); + } + + // add `ProviderChannelId` to the URL query string + if (getProviderChannelId() != null) { + joiner.add(String.format("%sProviderChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProviderChannelId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SetChannelMappingDto instance; + + public Builder() { + this(new SetChannelMappingDto()); + } + + protected Builder(SetChannelMappingDto instance) { + this.instance = instance; + } + + public SetChannelMappingDto.Builder providerId(String providerId) { + this.instance.providerId = providerId; + return this; + } + + public SetChannelMappingDto.Builder tunerChannelId(String tunerChannelId) { + this.instance.tunerChannelId = tunerChannelId; + return this; + } + + public SetChannelMappingDto.Builder providerChannelId(String providerChannelId) { + this.instance.providerChannelId = providerChannelId; + return this; + } + + /** + * returns a built SetChannelMappingDto instance. + * + * The builder is not reusable. + */ + public SetChannelMappingDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SetChannelMappingDto.Builder builder() { + return new SetChannelMappingDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SetChannelMappingDto.Builder toBuilder() { + return new SetChannelMappingDto.Builder().providerId(getProviderId()).tunerChannelId(getTunerChannelId()) + .providerChannelId(getProviderChannelId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SetPlaylistItemRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SetPlaylistItemRequestDto.java new file mode 100644 index 0000000000000..7db530ae65daf --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SetPlaylistItemRequestDto.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SetPlaylistItemRequestDto. + */ +@JsonPropertyOrder({ SetPlaylistItemRequestDto.JSON_PROPERTY_PLAYLIST_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SetPlaylistItemRequestDto { + public static final String JSON_PROPERTY_PLAYLIST_ITEM_ID = "PlaylistItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID playlistItemId; + + public SetPlaylistItemRequestDto() { + } + + public SetPlaylistItemRequestDto playlistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + return this; + } + + /** + * Gets or sets the playlist identifier of the playing item. + * + * @return playlistItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getPlaylistItemId() { + return playlistItemId; + } + + @JsonProperty(JSON_PROPERTY_PLAYLIST_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaylistItemId(@org.eclipse.jdt.annotation.NonNull UUID playlistItemId) { + this.playlistItemId = playlistItemId; + } + + /** + * Return true if this SetPlaylistItemRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetPlaylistItemRequestDto setPlaylistItemRequestDto = (SetPlaylistItemRequestDto) o; + return Objects.equals(this.playlistItemId, setPlaylistItemRequestDto.playlistItemId); + } + + @Override + public int hashCode() { + return Objects.hash(playlistItemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetPlaylistItemRequestDto {\n"); + sb.append(" playlistItemId: ").append(toIndentedString(playlistItemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `PlaylistItemId` to the URL query string + if (getPlaylistItemId() != null) { + joiner.add(String.format("%sPlaylistItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaylistItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SetPlaylistItemRequestDto instance; + + public Builder() { + this(new SetPlaylistItemRequestDto()); + } + + protected Builder(SetPlaylistItemRequestDto instance) { + this.instance = instance; + } + + public SetPlaylistItemRequestDto.Builder playlistItemId(UUID playlistItemId) { + this.instance.playlistItemId = playlistItemId; + return this; + } + + /** + * returns a built SetPlaylistItemRequestDto instance. + * + * The builder is not reusable. + */ + public SetPlaylistItemRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SetPlaylistItemRequestDto.Builder builder() { + return new SetPlaylistItemRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SetPlaylistItemRequestDto.Builder toBuilder() { + return new SetPlaylistItemRequestDto.Builder().playlistItemId(getPlaylistItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SetRepeatModeRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SetRepeatModeRequestDto.java new file mode 100644 index 0000000000000..8821ace9488d2 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SetRepeatModeRequestDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SetRepeatModeRequestDto. + */ +@JsonPropertyOrder({ SetRepeatModeRequestDto.JSON_PROPERTY_MODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SetRepeatModeRequestDto { + public static final String JSON_PROPERTY_MODE = "Mode"; + @org.eclipse.jdt.annotation.NonNull + private GroupRepeatMode mode; + + public SetRepeatModeRequestDto() { + } + + public SetRepeatModeRequestDto mode(@org.eclipse.jdt.annotation.NonNull GroupRepeatMode mode) { + this.mode = mode; + return this; + } + + /** + * Enum GroupRepeatMode. + * + * @return mode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupRepeatMode getMode() { + return mode; + } + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(@org.eclipse.jdt.annotation.NonNull GroupRepeatMode mode) { + this.mode = mode; + } + + /** + * Return true if this SetRepeatModeRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetRepeatModeRequestDto setRepeatModeRequestDto = (SetRepeatModeRequestDto) o; + return Objects.equals(this.mode, setRepeatModeRequestDto.mode); + } + + @Override + public int hashCode() { + return Objects.hash(mode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetRepeatModeRequestDto {\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Mode` to the URL query string + if (getMode() != null) { + joiner.add(String.format("%sMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMode())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SetRepeatModeRequestDto instance; + + public Builder() { + this(new SetRepeatModeRequestDto()); + } + + protected Builder(SetRepeatModeRequestDto instance) { + this.instance = instance; + } + + public SetRepeatModeRequestDto.Builder mode(GroupRepeatMode mode) { + this.instance.mode = mode; + return this; + } + + /** + * returns a built SetRepeatModeRequestDto instance. + * + * The builder is not reusable. + */ + public SetRepeatModeRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SetRepeatModeRequestDto.Builder builder() { + return new SetRepeatModeRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SetRepeatModeRequestDto.Builder toBuilder() { + return new SetRepeatModeRequestDto.Builder().mode(getMode()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SetShuffleModeRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SetShuffleModeRequestDto.java new file mode 100644 index 0000000000000..784e3c81f0362 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SetShuffleModeRequestDto.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SetShuffleModeRequestDto. + */ +@JsonPropertyOrder({ SetShuffleModeRequestDto.JSON_PROPERTY_MODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SetShuffleModeRequestDto { + public static final String JSON_PROPERTY_MODE = "Mode"; + @org.eclipse.jdt.annotation.NonNull + private GroupShuffleMode mode; + + public SetShuffleModeRequestDto() { + } + + public SetShuffleModeRequestDto mode(@org.eclipse.jdt.annotation.NonNull GroupShuffleMode mode) { + this.mode = mode; + return this; + } + + /** + * Enum GroupShuffleMode. + * + * @return mode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GroupShuffleMode getMode() { + return mode; + } + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(@org.eclipse.jdt.annotation.NonNull GroupShuffleMode mode) { + this.mode = mode; + } + + /** + * Return true if this SetShuffleModeRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetShuffleModeRequestDto setShuffleModeRequestDto = (SetShuffleModeRequestDto) o; + return Objects.equals(this.mode, setShuffleModeRequestDto.mode); + } + + @Override + public int hashCode() { + return Objects.hash(mode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetShuffleModeRequestDto {\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Mode` to the URL query string + if (getMode() != null) { + joiner.add(String.format("%sMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMode())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SetShuffleModeRequestDto instance; + + public Builder() { + this(new SetShuffleModeRequestDto()); + } + + protected Builder(SetShuffleModeRequestDto instance) { + this.instance = instance; + } + + public SetShuffleModeRequestDto.Builder mode(GroupShuffleMode mode) { + this.instance.mode = mode; + return this; + } + + /** + * returns a built SetShuffleModeRequestDto instance. + * + * The builder is not reusable. + */ + public SetShuffleModeRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SetShuffleModeRequestDto.Builder builder() { + return new SetShuffleModeRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SetShuffleModeRequestDto.Builder toBuilder() { + return new SetShuffleModeRequestDto.Builder().mode(getMode()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SongInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SongInfo.java new file mode 100644 index 0000000000000..fca260cd447d6 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SongInfo.java @@ -0,0 +1,758 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * SongInfo + */ +@JsonPropertyOrder({ SongInfo.JSON_PROPERTY_NAME, SongInfo.JSON_PROPERTY_ORIGINAL_TITLE, SongInfo.JSON_PROPERTY_PATH, + SongInfo.JSON_PROPERTY_METADATA_LANGUAGE, SongInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, + SongInfo.JSON_PROPERTY_PROVIDER_IDS, SongInfo.JSON_PROPERTY_YEAR, SongInfo.JSON_PROPERTY_INDEX_NUMBER, + SongInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, SongInfo.JSON_PROPERTY_PREMIERE_DATE, + SongInfo.JSON_PROPERTY_IS_AUTOMATED, SongInfo.JSON_PROPERTY_ALBUM_ARTISTS, SongInfo.JSON_PROPERTY_ALBUM, + SongInfo.JSON_PROPERTY_ARTISTS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SongInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public static final String JSON_PROPERTY_ALBUM_ARTISTS = "AlbumArtists"; + @org.eclipse.jdt.annotation.NonNull + private List albumArtists; + + public static final String JSON_PROPERTY_ALBUM = "Album"; + @org.eclipse.jdt.annotation.NonNull + private String album; + + public static final String JSON_PROPERTY_ARTISTS = "Artists"; + @org.eclipse.jdt.annotation.NonNull + private List artists; + + public SongInfo() { + } + + public SongInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public SongInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public SongInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public SongInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public SongInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public SongInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public SongInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public SongInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public SongInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public SongInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public SongInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public SongInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + public SongInfo albumArtists(@org.eclipse.jdt.annotation.NonNull List albumArtists) { + this.albumArtists = albumArtists; + return this; + } + + public SongInfo addAlbumArtistsItem(String albumArtistsItem) { + if (this.albumArtists == null) { + this.albumArtists = new ArrayList<>(); + } + this.albumArtists.add(albumArtistsItem); + return this; + } + + /** + * Get albumArtists + * + * @return albumArtists + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAlbumArtists() { + return albumArtists; + } + + @JsonProperty(JSON_PROPERTY_ALBUM_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbumArtists(@org.eclipse.jdt.annotation.NonNull List albumArtists) { + this.albumArtists = albumArtists; + } + + public SongInfo album(@org.eclipse.jdt.annotation.NonNull String album) { + this.album = album; + return this; + } + + /** + * Get album + * + * @return album + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALBUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlbum() { + return album; + } + + @JsonProperty(JSON_PROPERTY_ALBUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlbum(@org.eclipse.jdt.annotation.NonNull String album) { + this.album = album; + } + + public SongInfo artists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + return this; + } + + public SongInfo addArtistsItem(String artistsItem) { + if (this.artists == null) { + this.artists = new ArrayList<>(); + } + this.artists.add(artistsItem); + return this; + } + + /** + * Get artists + * + * @return artists + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArtists() { + return artists; + } + + @JsonProperty(JSON_PROPERTY_ARTISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArtists(@org.eclipse.jdt.annotation.NonNull List artists) { + this.artists = artists; + } + + /** + * Return true if this SongInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SongInfo songInfo = (SongInfo) o; + return Objects.equals(this.name, songInfo.name) && Objects.equals(this.originalTitle, songInfo.originalTitle) + && Objects.equals(this.path, songInfo.path) + && Objects.equals(this.metadataLanguage, songInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, songInfo.metadataCountryCode) + && Objects.equals(this.providerIds, songInfo.providerIds) && Objects.equals(this.year, songInfo.year) + && Objects.equals(this.indexNumber, songInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, songInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, songInfo.premiereDate) + && Objects.equals(this.isAutomated, songInfo.isAutomated) + && Objects.equals(this.albumArtists, songInfo.albumArtists) + && Objects.equals(this.album, songInfo.album) && Objects.equals(this.artists, songInfo.artists); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated, albumArtists, album, artists); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SongInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append(" albumArtists: ").append(toIndentedString(albumArtists)).append("\n"); + sb.append(" album: ").append(toIndentedString(album)).append("\n"); + sb.append(" artists: ").append(toIndentedString(artists)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + // add `AlbumArtists` to the URL query string + if (getAlbumArtists() != null) { + for (int i = 0; i < getAlbumArtists().size(); i++) { + joiner.add(String.format("%sAlbumArtists%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getAlbumArtists().get(i))))); + } + } + + // add `Album` to the URL query string + if (getAlbum() != null) { + joiner.add(String.format("%sAlbum%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAlbum())))); + } + + // add `Artists` to the URL query string + if (getArtists() != null) { + for (int i = 0; i < getArtists().size(); i++) { + joiner.add(String.format("%sArtists%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArtists().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private SongInfo instance; + + public Builder() { + this(new SongInfo()); + } + + protected Builder(SongInfo instance) { + this.instance = instance; + } + + public SongInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public SongInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public SongInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public SongInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public SongInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public SongInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public SongInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public SongInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public SongInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public SongInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public SongInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + public SongInfo.Builder albumArtists(List albumArtists) { + this.instance.albumArtists = albumArtists; + return this; + } + + public SongInfo.Builder album(String album) { + this.instance.album = album; + return this; + } + + public SongInfo.Builder artists(List artists) { + this.instance.artists = artists; + return this; + } + + /** + * returns a built SongInfo instance. + * + * The builder is not reusable. + */ + public SongInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SongInfo.Builder builder() { + return new SongInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SongInfo.Builder toBuilder() { + return new SongInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()).isAutomated(getIsAutomated()) + .albumArtists(getAlbumArtists()).album(getAlbum()).artists(getArtists()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SortOrder.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SortOrder.java new file mode 100644 index 0000000000000..f222ca91022e3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SortOrder.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * An enum representing the sorting order. + */ +public enum SortOrder { + + ASCENDING("Ascending"), + + DESCENDING("Descending"); + + private String value; + + SortOrder(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SortOrder fromValue(String value) { + for (SortOrder b : SortOrder.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SpecialViewOptionDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SpecialViewOptionDto.java new file mode 100644 index 0000000000000..5d7bb23b3becd --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SpecialViewOptionDto.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Special view option dto. + */ +@JsonPropertyOrder({ SpecialViewOptionDto.JSON_PROPERTY_NAME, SpecialViewOptionDto.JSON_PROPERTY_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SpecialViewOptionDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public SpecialViewOptionDto() { + } + + public SpecialViewOptionDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets view option name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public SpecialViewOptionDto id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets view option id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + /** + * Return true if this SpecialViewOptionDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialViewOptionDto specialViewOptionDto = (SpecialViewOptionDto) o; + return Objects.equals(this.name, specialViewOptionDto.name) && Objects.equals(this.id, specialViewOptionDto.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialViewOptionDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SpecialViewOptionDto instance; + + public Builder() { + this(new SpecialViewOptionDto()); + } + + protected Builder(SpecialViewOptionDto instance) { + this.instance = instance; + } + + public SpecialViewOptionDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public SpecialViewOptionDto.Builder id(String id) { + this.instance.id = id; + return this; + } + + /** + * returns a built SpecialViewOptionDto instance. + * + * The builder is not reusable. + */ + public SpecialViewOptionDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SpecialViewOptionDto.Builder builder() { + return new SpecialViewOptionDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SpecialViewOptionDto.Builder toBuilder() { + return new SpecialViewOptionDto.Builder().name(getName()).id(getId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/StartupConfigurationDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/StartupConfigurationDto.java new file mode 100644 index 0000000000000..07f5a0343428f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/StartupConfigurationDto.java @@ -0,0 +1,277 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The startup configuration DTO. + */ +@JsonPropertyOrder({ StartupConfigurationDto.JSON_PROPERTY_UI_CULTURE, + StartupConfigurationDto.JSON_PROPERTY_METADATA_COUNTRY_CODE, + StartupConfigurationDto.JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class StartupConfigurationDto { + public static final String JSON_PROPERTY_UI_CULTURE = "UICulture"; + @org.eclipse.jdt.annotation.NonNull + private String uiCulture; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE = "PreferredMetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String preferredMetadataLanguage; + + public StartupConfigurationDto() { + } + + public StartupConfigurationDto uiCulture(@org.eclipse.jdt.annotation.NonNull String uiCulture) { + this.uiCulture = uiCulture; + return this; + } + + /** + * Gets or sets UI language culture. + * + * @return uiCulture + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_UI_CULTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUiCulture() { + return uiCulture; + } + + @JsonProperty(JSON_PROPERTY_UI_CULTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUiCulture(@org.eclipse.jdt.annotation.NonNull String uiCulture) { + this.uiCulture = uiCulture; + } + + public StartupConfigurationDto metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public StartupConfigurationDto preferredMetadataLanguage( + @org.eclipse.jdt.annotation.NonNull String preferredMetadataLanguage) { + this.preferredMetadataLanguage = preferredMetadataLanguage; + return this; + } + + /** + * Gets or sets the preferred language for the metadata. + * + * @return preferredMetadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPreferredMetadataLanguage() { + return preferredMetadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_PREFERRED_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreferredMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String preferredMetadataLanguage) { + this.preferredMetadataLanguage = preferredMetadataLanguage; + } + + /** + * Return true if this StartupConfigurationDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartupConfigurationDto startupConfigurationDto = (StartupConfigurationDto) o; + return Objects.equals(this.uiCulture, startupConfigurationDto.uiCulture) + && Objects.equals(this.metadataCountryCode, startupConfigurationDto.metadataCountryCode) + && Objects.equals(this.preferredMetadataLanguage, startupConfigurationDto.preferredMetadataLanguage); + } + + @Override + public int hashCode() { + return Objects.hash(uiCulture, metadataCountryCode, preferredMetadataLanguage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StartupConfigurationDto {\n"); + sb.append(" uiCulture: ").append(toIndentedString(uiCulture)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" preferredMetadataLanguage: ").append(toIndentedString(preferredMetadataLanguage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `UICulture` to the URL query string + if (getUiCulture() != null) { + joiner.add(String.format("%sUICulture%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUiCulture())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `PreferredMetadataLanguage` to the URL query string + if (getPreferredMetadataLanguage() != null) { + joiner.add(String.format("%sPreferredMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPreferredMetadataLanguage())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private StartupConfigurationDto instance; + + public Builder() { + this(new StartupConfigurationDto()); + } + + protected Builder(StartupConfigurationDto instance) { + this.instance = instance; + } + + public StartupConfigurationDto.Builder uiCulture(String uiCulture) { + this.instance.uiCulture = uiCulture; + return this; + } + + public StartupConfigurationDto.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public StartupConfigurationDto.Builder preferredMetadataLanguage(String preferredMetadataLanguage) { + this.instance.preferredMetadataLanguage = preferredMetadataLanguage; + return this; + } + + /** + * returns a built StartupConfigurationDto instance. + * + * The builder is not reusable. + */ + public StartupConfigurationDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static StartupConfigurationDto.Builder builder() { + return new StartupConfigurationDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public StartupConfigurationDto.Builder toBuilder() { + return new StartupConfigurationDto.Builder().uiCulture(getUiCulture()) + .metadataCountryCode(getMetadataCountryCode()) + .preferredMetadataLanguage(getPreferredMetadataLanguage()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/StartupRemoteAccessDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/StartupRemoteAccessDto.java new file mode 100644 index 0000000000000..e47ba4a08c06b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/StartupRemoteAccessDto.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Startup remote access dto. + */ +@JsonPropertyOrder({ StartupRemoteAccessDto.JSON_PROPERTY_ENABLE_REMOTE_ACCESS, + StartupRemoteAccessDto.JSON_PROPERTY_ENABLE_AUTOMATIC_PORT_MAPPING }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class StartupRemoteAccessDto { + public static final String JSON_PROPERTY_ENABLE_REMOTE_ACCESS = "EnableRemoteAccess"; + @org.eclipse.jdt.annotation.Nullable + private Boolean enableRemoteAccess; + + public static final String JSON_PROPERTY_ENABLE_AUTOMATIC_PORT_MAPPING = "EnableAutomaticPortMapping"; + @org.eclipse.jdt.annotation.Nullable + private Boolean enableAutomaticPortMapping; + + public StartupRemoteAccessDto() { + } + + public StartupRemoteAccessDto enableRemoteAccess(@org.eclipse.jdt.annotation.Nullable Boolean enableRemoteAccess) { + this.enableRemoteAccess = enableRemoteAccess; + return this; + } + + /** + * Gets or sets a value indicating whether enable remote access. + * + * @return enableRemoteAccess + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLE_REMOTE_ACCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getEnableRemoteAccess() { + return enableRemoteAccess; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_REMOTE_ACCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnableRemoteAccess(@org.eclipse.jdt.annotation.Nullable Boolean enableRemoteAccess) { + this.enableRemoteAccess = enableRemoteAccess; + } + + public StartupRemoteAccessDto enableAutomaticPortMapping( + @org.eclipse.jdt.annotation.Nullable Boolean enableAutomaticPortMapping) { + this.enableAutomaticPortMapping = enableAutomaticPortMapping; + return this; + } + + /** + * Gets or sets a value indicating whether enable automatic port mapping. + * + * @return enableAutomaticPortMapping + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLE_AUTOMATIC_PORT_MAPPING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getEnableAutomaticPortMapping() { + return enableAutomaticPortMapping; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_AUTOMATIC_PORT_MAPPING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnableAutomaticPortMapping(@org.eclipse.jdt.annotation.Nullable Boolean enableAutomaticPortMapping) { + this.enableAutomaticPortMapping = enableAutomaticPortMapping; + } + + /** + * Return true if this StartupRemoteAccessDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartupRemoteAccessDto startupRemoteAccessDto = (StartupRemoteAccessDto) o; + return Objects.equals(this.enableRemoteAccess, startupRemoteAccessDto.enableRemoteAccess) + && Objects.equals(this.enableAutomaticPortMapping, startupRemoteAccessDto.enableAutomaticPortMapping); + } + + @Override + public int hashCode() { + return Objects.hash(enableRemoteAccess, enableAutomaticPortMapping); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StartupRemoteAccessDto {\n"); + sb.append(" enableRemoteAccess: ").append(toIndentedString(enableRemoteAccess)).append("\n"); + sb.append(" enableAutomaticPortMapping: ").append(toIndentedString(enableAutomaticPortMapping)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `EnableRemoteAccess` to the URL query string + if (getEnableRemoteAccess() != null) { + joiner.add(String.format("%sEnableRemoteAccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableRemoteAccess())))); + } + + // add `EnableAutomaticPortMapping` to the URL query string + if (getEnableAutomaticPortMapping() != null) { + joiner.add(String.format("%sEnableAutomaticPortMapping%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAutomaticPortMapping())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private StartupRemoteAccessDto instance; + + public Builder() { + this(new StartupRemoteAccessDto()); + } + + protected Builder(StartupRemoteAccessDto instance) { + this.instance = instance; + } + + public StartupRemoteAccessDto.Builder enableRemoteAccess(Boolean enableRemoteAccess) { + this.instance.enableRemoteAccess = enableRemoteAccess; + return this; + } + + public StartupRemoteAccessDto.Builder enableAutomaticPortMapping(Boolean enableAutomaticPortMapping) { + this.instance.enableAutomaticPortMapping = enableAutomaticPortMapping; + return this; + } + + /** + * returns a built StartupRemoteAccessDto instance. + * + * The builder is not reusable. + */ + public StartupRemoteAccessDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static StartupRemoteAccessDto.Builder builder() { + return new StartupRemoteAccessDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public StartupRemoteAccessDto.Builder toBuilder() { + return new StartupRemoteAccessDto.Builder().enableRemoteAccess(getEnableRemoteAccess()) + .enableAutomaticPortMapping(getEnableAutomaticPortMapping()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/StartupUserDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/StartupUserDto.java new file mode 100644 index 0000000000000..ad25684ce8806 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/StartupUserDto.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The startup user DTO. + */ +@JsonPropertyOrder({ StartupUserDto.JSON_PROPERTY_NAME, StartupUserDto.JSON_PROPERTY_PASSWORD }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class StartupUserDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_PASSWORD = "Password"; + @org.eclipse.jdt.annotation.NonNull + private String password; + + public StartupUserDto() { + } + + public StartupUserDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the username. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public StartupUserDto password(@org.eclipse.jdt.annotation.NonNull String password) { + this.password = password; + return this; + } + + /** + * Gets or sets the user's password. + * + * @return password + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(@org.eclipse.jdt.annotation.NonNull String password) { + this.password = password; + } + + /** + * Return true if this StartupUserDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartupUserDto startupUserDto = (StartupUserDto) o; + return Objects.equals(this.name, startupUserDto.name) && Objects.equals(this.password, startupUserDto.password); + } + + @Override + public int hashCode() { + return Objects.hash(name, password); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StartupUserDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Password` to the URL query string + if (getPassword() != null) { + joiner.add(String.format("%sPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPassword())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private StartupUserDto instance; + + public Builder() { + this(new StartupUserDto()); + } + + protected Builder(StartupUserDto instance) { + this.instance = instance; + } + + public StartupUserDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public StartupUserDto.Builder password(String password) { + this.instance.password = password; + return this; + } + + /** + * returns a built StartupUserDto instance. + * + * The builder is not reusable. + */ + public StartupUserDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static StartupUserDto.Builder builder() { + return new StartupUserDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public StartupUserDto.Builder toBuilder() { + return new StartupUserDto.Builder().name(getName()).password(getPassword()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SubtitleDeliveryMethod.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SubtitleDeliveryMethod.java new file mode 100644 index 0000000000000..88bb698e2d447 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SubtitleDeliveryMethod.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Delivery method to use during playback of a specific subtitle format. + */ +public enum SubtitleDeliveryMethod { + + ENCODE("Encode"), + + EMBED("Embed"), + + EXTERNAL("External"), + + HLS("Hls"), + + DROP("Drop"); + + private String value; + + SubtitleDeliveryMethod(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SubtitleDeliveryMethod fromValue(String value) { + for (SubtitleDeliveryMethod b : SubtitleDeliveryMethod.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SubtitleOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SubtitleOptions.java new file mode 100644 index 0000000000000..675ff9da5fbab --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SubtitleOptions.java @@ -0,0 +1,546 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * SubtitleOptions + */ +@JsonPropertyOrder({ SubtitleOptions.JSON_PROPERTY_SKIP_IF_EMBEDDED_SUBTITLES_PRESENT, + SubtitleOptions.JSON_PROPERTY_SKIP_IF_AUDIO_TRACK_MATCHES, SubtitleOptions.JSON_PROPERTY_DOWNLOAD_LANGUAGES, + SubtitleOptions.JSON_PROPERTY_DOWNLOAD_MOVIE_SUBTITLES, + SubtitleOptions.JSON_PROPERTY_DOWNLOAD_EPISODE_SUBTITLES, SubtitleOptions.JSON_PROPERTY_OPEN_SUBTITLES_USERNAME, + SubtitleOptions.JSON_PROPERTY_OPEN_SUBTITLES_PASSWORD_HASH, + SubtitleOptions.JSON_PROPERTY_IS_OPEN_SUBTITLE_VIP_ACCOUNT, + SubtitleOptions.JSON_PROPERTY_REQUIRE_PERFECT_MATCH }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SubtitleOptions { + public static final String JSON_PROPERTY_SKIP_IF_EMBEDDED_SUBTITLES_PRESENT = "SkipIfEmbeddedSubtitlesPresent"; + @org.eclipse.jdt.annotation.NonNull + private Boolean skipIfEmbeddedSubtitlesPresent; + + public static final String JSON_PROPERTY_SKIP_IF_AUDIO_TRACK_MATCHES = "SkipIfAudioTrackMatches"; + @org.eclipse.jdt.annotation.NonNull + private Boolean skipIfAudioTrackMatches; + + public static final String JSON_PROPERTY_DOWNLOAD_LANGUAGES = "DownloadLanguages"; + @org.eclipse.jdt.annotation.NonNull + private List downloadLanguages; + + public static final String JSON_PROPERTY_DOWNLOAD_MOVIE_SUBTITLES = "DownloadMovieSubtitles"; + @org.eclipse.jdt.annotation.NonNull + private Boolean downloadMovieSubtitles; + + public static final String JSON_PROPERTY_DOWNLOAD_EPISODE_SUBTITLES = "DownloadEpisodeSubtitles"; + @org.eclipse.jdt.annotation.NonNull + private Boolean downloadEpisodeSubtitles; + + public static final String JSON_PROPERTY_OPEN_SUBTITLES_USERNAME = "OpenSubtitlesUsername"; + @org.eclipse.jdt.annotation.NonNull + private String openSubtitlesUsername; + + public static final String JSON_PROPERTY_OPEN_SUBTITLES_PASSWORD_HASH = "OpenSubtitlesPasswordHash"; + @org.eclipse.jdt.annotation.NonNull + private String openSubtitlesPasswordHash; + + public static final String JSON_PROPERTY_IS_OPEN_SUBTITLE_VIP_ACCOUNT = "IsOpenSubtitleVipAccount"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isOpenSubtitleVipAccount; + + public static final String JSON_PROPERTY_REQUIRE_PERFECT_MATCH = "RequirePerfectMatch"; + @org.eclipse.jdt.annotation.NonNull + private Boolean requirePerfectMatch; + + public SubtitleOptions() { + } + + public SubtitleOptions skipIfEmbeddedSubtitlesPresent( + @org.eclipse.jdt.annotation.NonNull Boolean skipIfEmbeddedSubtitlesPresent) { + this.skipIfEmbeddedSubtitlesPresent = skipIfEmbeddedSubtitlesPresent; + return this; + } + + /** + * Get skipIfEmbeddedSubtitlesPresent + * + * @return skipIfEmbeddedSubtitlesPresent + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SKIP_IF_EMBEDDED_SUBTITLES_PRESENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSkipIfEmbeddedSubtitlesPresent() { + return skipIfEmbeddedSubtitlesPresent; + } + + @JsonProperty(JSON_PROPERTY_SKIP_IF_EMBEDDED_SUBTITLES_PRESENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipIfEmbeddedSubtitlesPresent( + @org.eclipse.jdt.annotation.NonNull Boolean skipIfEmbeddedSubtitlesPresent) { + this.skipIfEmbeddedSubtitlesPresent = skipIfEmbeddedSubtitlesPresent; + } + + public SubtitleOptions skipIfAudioTrackMatches( + @org.eclipse.jdt.annotation.NonNull Boolean skipIfAudioTrackMatches) { + this.skipIfAudioTrackMatches = skipIfAudioTrackMatches; + return this; + } + + /** + * Get skipIfAudioTrackMatches + * + * @return skipIfAudioTrackMatches + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SKIP_IF_AUDIO_TRACK_MATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSkipIfAudioTrackMatches() { + return skipIfAudioTrackMatches; + } + + @JsonProperty(JSON_PROPERTY_SKIP_IF_AUDIO_TRACK_MATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipIfAudioTrackMatches(@org.eclipse.jdt.annotation.NonNull Boolean skipIfAudioTrackMatches) { + this.skipIfAudioTrackMatches = skipIfAudioTrackMatches; + } + + public SubtitleOptions downloadLanguages(@org.eclipse.jdt.annotation.NonNull List downloadLanguages) { + this.downloadLanguages = downloadLanguages; + return this; + } + + public SubtitleOptions addDownloadLanguagesItem(String downloadLanguagesItem) { + if (this.downloadLanguages == null) { + this.downloadLanguages = new ArrayList<>(); + } + this.downloadLanguages.add(downloadLanguagesItem); + return this; + } + + /** + * Get downloadLanguages + * + * @return downloadLanguages + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DOWNLOAD_LANGUAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDownloadLanguages() { + return downloadLanguages; + } + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_LANGUAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadLanguages(@org.eclipse.jdt.annotation.NonNull List downloadLanguages) { + this.downloadLanguages = downloadLanguages; + } + + public SubtitleOptions downloadMovieSubtitles(@org.eclipse.jdt.annotation.NonNull Boolean downloadMovieSubtitles) { + this.downloadMovieSubtitles = downloadMovieSubtitles; + return this; + } + + /** + * Get downloadMovieSubtitles + * + * @return downloadMovieSubtitles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DOWNLOAD_MOVIE_SUBTITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDownloadMovieSubtitles() { + return downloadMovieSubtitles; + } + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_MOVIE_SUBTITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadMovieSubtitles(@org.eclipse.jdt.annotation.NonNull Boolean downloadMovieSubtitles) { + this.downloadMovieSubtitles = downloadMovieSubtitles; + } + + public SubtitleOptions downloadEpisodeSubtitles( + @org.eclipse.jdt.annotation.NonNull Boolean downloadEpisodeSubtitles) { + this.downloadEpisodeSubtitles = downloadEpisodeSubtitles; + return this; + } + + /** + * Get downloadEpisodeSubtitles + * + * @return downloadEpisodeSubtitles + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DOWNLOAD_EPISODE_SUBTITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDownloadEpisodeSubtitles() { + return downloadEpisodeSubtitles; + } + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_EPISODE_SUBTITLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadEpisodeSubtitles(@org.eclipse.jdt.annotation.NonNull Boolean downloadEpisodeSubtitles) { + this.downloadEpisodeSubtitles = downloadEpisodeSubtitles; + } + + public SubtitleOptions openSubtitlesUsername(@org.eclipse.jdt.annotation.NonNull String openSubtitlesUsername) { + this.openSubtitlesUsername = openSubtitlesUsername; + return this; + } + + /** + * Get openSubtitlesUsername + * + * @return openSubtitlesUsername + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OPEN_SUBTITLES_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOpenSubtitlesUsername() { + return openSubtitlesUsername; + } + + @JsonProperty(JSON_PROPERTY_OPEN_SUBTITLES_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpenSubtitlesUsername(@org.eclipse.jdt.annotation.NonNull String openSubtitlesUsername) { + this.openSubtitlesUsername = openSubtitlesUsername; + } + + public SubtitleOptions openSubtitlesPasswordHash( + @org.eclipse.jdt.annotation.NonNull String openSubtitlesPasswordHash) { + this.openSubtitlesPasswordHash = openSubtitlesPasswordHash; + return this; + } + + /** + * Get openSubtitlesPasswordHash + * + * @return openSubtitlesPasswordHash + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OPEN_SUBTITLES_PASSWORD_HASH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOpenSubtitlesPasswordHash() { + return openSubtitlesPasswordHash; + } + + @JsonProperty(JSON_PROPERTY_OPEN_SUBTITLES_PASSWORD_HASH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpenSubtitlesPasswordHash(@org.eclipse.jdt.annotation.NonNull String openSubtitlesPasswordHash) { + this.openSubtitlesPasswordHash = openSubtitlesPasswordHash; + } + + public SubtitleOptions isOpenSubtitleVipAccount( + @org.eclipse.jdt.annotation.NonNull Boolean isOpenSubtitleVipAccount) { + this.isOpenSubtitleVipAccount = isOpenSubtitleVipAccount; + return this; + } + + /** + * Get isOpenSubtitleVipAccount + * + * @return isOpenSubtitleVipAccount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_OPEN_SUBTITLE_VIP_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsOpenSubtitleVipAccount() { + return isOpenSubtitleVipAccount; + } + + @JsonProperty(JSON_PROPERTY_IS_OPEN_SUBTITLE_VIP_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsOpenSubtitleVipAccount(@org.eclipse.jdt.annotation.NonNull Boolean isOpenSubtitleVipAccount) { + this.isOpenSubtitleVipAccount = isOpenSubtitleVipAccount; + } + + public SubtitleOptions requirePerfectMatch(@org.eclipse.jdt.annotation.NonNull Boolean requirePerfectMatch) { + this.requirePerfectMatch = requirePerfectMatch; + return this; + } + + /** + * Get requirePerfectMatch + * + * @return requirePerfectMatch + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUIRE_PERFECT_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequirePerfectMatch() { + return requirePerfectMatch; + } + + @JsonProperty(JSON_PROPERTY_REQUIRE_PERFECT_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequirePerfectMatch(@org.eclipse.jdt.annotation.NonNull Boolean requirePerfectMatch) { + this.requirePerfectMatch = requirePerfectMatch; + } + + /** + * Return true if this SubtitleOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubtitleOptions subtitleOptions = (SubtitleOptions) o; + return Objects.equals(this.skipIfEmbeddedSubtitlesPresent, subtitleOptions.skipIfEmbeddedSubtitlesPresent) + && Objects.equals(this.skipIfAudioTrackMatches, subtitleOptions.skipIfAudioTrackMatches) + && Objects.equals(this.downloadLanguages, subtitleOptions.downloadLanguages) + && Objects.equals(this.downloadMovieSubtitles, subtitleOptions.downloadMovieSubtitles) + && Objects.equals(this.downloadEpisodeSubtitles, subtitleOptions.downloadEpisodeSubtitles) + && Objects.equals(this.openSubtitlesUsername, subtitleOptions.openSubtitlesUsername) + && Objects.equals(this.openSubtitlesPasswordHash, subtitleOptions.openSubtitlesPasswordHash) + && Objects.equals(this.isOpenSubtitleVipAccount, subtitleOptions.isOpenSubtitleVipAccount) + && Objects.equals(this.requirePerfectMatch, subtitleOptions.requirePerfectMatch); + } + + @Override + public int hashCode() { + return Objects.hash(skipIfEmbeddedSubtitlesPresent, skipIfAudioTrackMatches, downloadLanguages, + downloadMovieSubtitles, downloadEpisodeSubtitles, openSubtitlesUsername, openSubtitlesPasswordHash, + isOpenSubtitleVipAccount, requirePerfectMatch); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubtitleOptions {\n"); + sb.append(" skipIfEmbeddedSubtitlesPresent: ").append(toIndentedString(skipIfEmbeddedSubtitlesPresent)) + .append("\n"); + sb.append(" skipIfAudioTrackMatches: ").append(toIndentedString(skipIfAudioTrackMatches)).append("\n"); + sb.append(" downloadLanguages: ").append(toIndentedString(downloadLanguages)).append("\n"); + sb.append(" downloadMovieSubtitles: ").append(toIndentedString(downloadMovieSubtitles)).append("\n"); + sb.append(" downloadEpisodeSubtitles: ").append(toIndentedString(downloadEpisodeSubtitles)).append("\n"); + sb.append(" openSubtitlesUsername: ").append(toIndentedString(openSubtitlesUsername)).append("\n"); + sb.append(" openSubtitlesPasswordHash: ").append(toIndentedString(openSubtitlesPasswordHash)).append("\n"); + sb.append(" isOpenSubtitleVipAccount: ").append(toIndentedString(isOpenSubtitleVipAccount)).append("\n"); + sb.append(" requirePerfectMatch: ").append(toIndentedString(requirePerfectMatch)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SkipIfEmbeddedSubtitlesPresent` to the URL query string + if (getSkipIfEmbeddedSubtitlesPresent() != null) { + joiner.add(String.format("%sSkipIfEmbeddedSubtitlesPresent%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSkipIfEmbeddedSubtitlesPresent())))); + } + + // add `SkipIfAudioTrackMatches` to the URL query string + if (getSkipIfAudioTrackMatches() != null) { + joiner.add(String.format("%sSkipIfAudioTrackMatches%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSkipIfAudioTrackMatches())))); + } + + // add `DownloadLanguages` to the URL query string + if (getDownloadLanguages() != null) { + for (int i = 0; i < getDownloadLanguages().size(); i++) { + joiner.add(String.format("%sDownloadLanguages%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getDownloadLanguages().get(i))))); + } + } + + // add `DownloadMovieSubtitles` to the URL query string + if (getDownloadMovieSubtitles() != null) { + joiner.add(String.format("%sDownloadMovieSubtitles%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDownloadMovieSubtitles())))); + } + + // add `DownloadEpisodeSubtitles` to the URL query string + if (getDownloadEpisodeSubtitles() != null) { + joiner.add(String.format("%sDownloadEpisodeSubtitles%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDownloadEpisodeSubtitles())))); + } + + // add `OpenSubtitlesUsername` to the URL query string + if (getOpenSubtitlesUsername() != null) { + joiner.add(String.format("%sOpenSubtitlesUsername%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOpenSubtitlesUsername())))); + } + + // add `OpenSubtitlesPasswordHash` to the URL query string + if (getOpenSubtitlesPasswordHash() != null) { + joiner.add(String.format("%sOpenSubtitlesPasswordHash%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOpenSubtitlesPasswordHash())))); + } + + // add `IsOpenSubtitleVipAccount` to the URL query string + if (getIsOpenSubtitleVipAccount() != null) { + joiner.add(String.format("%sIsOpenSubtitleVipAccount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsOpenSubtitleVipAccount())))); + } + + // add `RequirePerfectMatch` to the URL query string + if (getRequirePerfectMatch() != null) { + joiner.add(String.format("%sRequirePerfectMatch%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRequirePerfectMatch())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SubtitleOptions instance; + + public Builder() { + this(new SubtitleOptions()); + } + + protected Builder(SubtitleOptions instance) { + this.instance = instance; + } + + public SubtitleOptions.Builder skipIfEmbeddedSubtitlesPresent(Boolean skipIfEmbeddedSubtitlesPresent) { + this.instance.skipIfEmbeddedSubtitlesPresent = skipIfEmbeddedSubtitlesPresent; + return this; + } + + public SubtitleOptions.Builder skipIfAudioTrackMatches(Boolean skipIfAudioTrackMatches) { + this.instance.skipIfAudioTrackMatches = skipIfAudioTrackMatches; + return this; + } + + public SubtitleOptions.Builder downloadLanguages(List downloadLanguages) { + this.instance.downloadLanguages = downloadLanguages; + return this; + } + + public SubtitleOptions.Builder downloadMovieSubtitles(Boolean downloadMovieSubtitles) { + this.instance.downloadMovieSubtitles = downloadMovieSubtitles; + return this; + } + + public SubtitleOptions.Builder downloadEpisodeSubtitles(Boolean downloadEpisodeSubtitles) { + this.instance.downloadEpisodeSubtitles = downloadEpisodeSubtitles; + return this; + } + + public SubtitleOptions.Builder openSubtitlesUsername(String openSubtitlesUsername) { + this.instance.openSubtitlesUsername = openSubtitlesUsername; + return this; + } + + public SubtitleOptions.Builder openSubtitlesPasswordHash(String openSubtitlesPasswordHash) { + this.instance.openSubtitlesPasswordHash = openSubtitlesPasswordHash; + return this; + } + + public SubtitleOptions.Builder isOpenSubtitleVipAccount(Boolean isOpenSubtitleVipAccount) { + this.instance.isOpenSubtitleVipAccount = isOpenSubtitleVipAccount; + return this; + } + + public SubtitleOptions.Builder requirePerfectMatch(Boolean requirePerfectMatch) { + this.instance.requirePerfectMatch = requirePerfectMatch; + return this; + } + + /** + * returns a built SubtitleOptions instance. + * + * The builder is not reusable. + */ + public SubtitleOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SubtitleOptions.Builder builder() { + return new SubtitleOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SubtitleOptions.Builder toBuilder() { + return new SubtitleOptions.Builder().skipIfEmbeddedSubtitlesPresent(getSkipIfEmbeddedSubtitlesPresent()) + .skipIfAudioTrackMatches(getSkipIfAudioTrackMatches()).downloadLanguages(getDownloadLanguages()) + .downloadMovieSubtitles(getDownloadMovieSubtitles()) + .downloadEpisodeSubtitles(getDownloadEpisodeSubtitles()) + .openSubtitlesUsername(getOpenSubtitlesUsername()) + .openSubtitlesPasswordHash(getOpenSubtitlesPasswordHash()) + .isOpenSubtitleVipAccount(getIsOpenSubtitleVipAccount()).requirePerfectMatch(getRequirePerfectMatch()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SubtitlePlaybackMode.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SubtitlePlaybackMode.java new file mode 100644 index 0000000000000..a01b15438113a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SubtitlePlaybackMode.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * An enum representing a subtitle playback mode. + */ +public enum SubtitlePlaybackMode { + + DEFAULT("Default"), + + ALWAYS("Always"), + + ONLY_FORCED("OnlyForced"), + + NONE("None"), + + SMART("Smart"); + + private String value; + + SubtitlePlaybackMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SubtitlePlaybackMode fromValue(String value) { + for (SubtitlePlaybackMode b : SubtitlePlaybackMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SubtitleProfile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SubtitleProfile.java new file mode 100644 index 0000000000000..788a7d55156ff --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SubtitleProfile.java @@ -0,0 +1,355 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * SubtitleProfile + */ +@JsonPropertyOrder({ SubtitleProfile.JSON_PROPERTY_FORMAT, SubtitleProfile.JSON_PROPERTY_METHOD, + SubtitleProfile.JSON_PROPERTY_DIDL_MODE, SubtitleProfile.JSON_PROPERTY_LANGUAGE, + SubtitleProfile.JSON_PROPERTY_CONTAINER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SubtitleProfile { + public static final String JSON_PROPERTY_FORMAT = "Format"; + @org.eclipse.jdt.annotation.NonNull + private String format; + + public static final String JSON_PROPERTY_METHOD = "Method"; + @org.eclipse.jdt.annotation.NonNull + private SubtitleDeliveryMethod method; + + public static final String JSON_PROPERTY_DIDL_MODE = "DidlMode"; + @org.eclipse.jdt.annotation.NonNull + private String didlMode; + + public static final String JSON_PROPERTY_LANGUAGE = "Language"; + @org.eclipse.jdt.annotation.NonNull + private String language; + + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public SubtitleProfile() { + } + + public SubtitleProfile format(@org.eclipse.jdt.annotation.NonNull String format) { + this.format = format; + return this; + } + + /** + * Get format + * + * @return format + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFormat() { + return format; + } + + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormat(@org.eclipse.jdt.annotation.NonNull String format) { + this.format = format; + } + + public SubtitleProfile method(@org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod method) { + this.method = method; + return this; + } + + /** + * Delivery method to use during playback of a specific subtitle format. + * + * @return method + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubtitleDeliveryMethod getMethod() { + return method; + } + + @JsonProperty(JSON_PROPERTY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMethod(@org.eclipse.jdt.annotation.NonNull SubtitleDeliveryMethod method) { + this.method = method; + } + + public SubtitleProfile didlMode(@org.eclipse.jdt.annotation.NonNull String didlMode) { + this.didlMode = didlMode; + return this; + } + + /** + * Get didlMode + * + * @return didlMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DIDL_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDidlMode() { + return didlMode; + } + + @JsonProperty(JSON_PROPERTY_DIDL_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDidlMode(@org.eclipse.jdt.annotation.NonNull String didlMode) { + this.didlMode = didlMode; + } + + public SubtitleProfile language(@org.eclipse.jdt.annotation.NonNull String language) { + this.language = language; + return this; + } + + /** + * Get language + * + * @return language + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLanguage() { + return language; + } + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLanguage(@org.eclipse.jdt.annotation.NonNull String language) { + this.language = language; + } + + public SubtitleProfile container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Get container + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + /** + * Return true if this SubtitleProfile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubtitleProfile subtitleProfile = (SubtitleProfile) o; + return Objects.equals(this.format, subtitleProfile.format) + && Objects.equals(this.method, subtitleProfile.method) + && Objects.equals(this.didlMode, subtitleProfile.didlMode) + && Objects.equals(this.language, subtitleProfile.language) + && Objects.equals(this.container, subtitleProfile.container); + } + + @Override + public int hashCode() { + return Objects.hash(format, method, didlMode, language, container); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubtitleProfile {\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" didlMode: ").append(toIndentedString(didlMode)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Format` to the URL query string + if (getFormat() != null) { + joiner.add(String.format("%sFormat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFormat())))); + } + + // add `Method` to the URL query string + if (getMethod() != null) { + joiner.add(String.format("%sMethod%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMethod())))); + } + + // add `DidlMode` to the URL query string + if (getDidlMode() != null) { + joiner.add(String.format("%sDidlMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDidlMode())))); + } + + // add `Language` to the URL query string + if (getLanguage() != null) { + joiner.add(String.format("%sLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLanguage())))); + } + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SubtitleProfile instance; + + public Builder() { + this(new SubtitleProfile()); + } + + protected Builder(SubtitleProfile instance) { + this.instance = instance; + } + + public SubtitleProfile.Builder format(String format) { + this.instance.format = format; + return this; + } + + public SubtitleProfile.Builder method(SubtitleDeliveryMethod method) { + this.instance.method = method; + return this; + } + + public SubtitleProfile.Builder didlMode(String didlMode) { + this.instance.didlMode = didlMode; + return this; + } + + public SubtitleProfile.Builder language(String language) { + this.instance.language = language; + return this; + } + + public SubtitleProfile.Builder container(String container) { + this.instance.container = container; + return this; + } + + /** + * returns a built SubtitleProfile instance. + * + * The builder is not reusable. + */ + public SubtitleProfile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SubtitleProfile.Builder builder() { + return new SubtitleProfile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SubtitleProfile.Builder toBuilder() { + return new SubtitleProfile.Builder().format(getFormat()).method(getMethod()).didlMode(getDidlMode()) + .language(getLanguage()).container(getContainer()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SyncPlayUserAccessType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SyncPlayUserAccessType.java new file mode 100644 index 0000000000000..cca0bcec938c3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SyncPlayUserAccessType.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum SyncPlayUserAccessType. + */ +public enum SyncPlayUserAccessType { + + CREATE_AND_JOIN_GROUPS("CreateAndJoinGroups"), + + JOIN_GROUPS("JoinGroups"), + + NONE("None"); + + private String value; + + SyncPlayUserAccessType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SyncPlayUserAccessType fromValue(String value) { + for (SyncPlayUserAccessType b : SyncPlayUserAccessType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SystemInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SystemInfo.java new file mode 100644 index 0000000000000..bdf021ed1e3af --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/SystemInfo.java @@ -0,0 +1,1241 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class SystemInfo. + */ +@JsonPropertyOrder({ SystemInfo.JSON_PROPERTY_LOCAL_ADDRESS, SystemInfo.JSON_PROPERTY_SERVER_NAME, + SystemInfo.JSON_PROPERTY_VERSION, SystemInfo.JSON_PROPERTY_PRODUCT_NAME, + SystemInfo.JSON_PROPERTY_OPERATING_SYSTEM, SystemInfo.JSON_PROPERTY_ID, + SystemInfo.JSON_PROPERTY_STARTUP_WIZARD_COMPLETED, SystemInfo.JSON_PROPERTY_OPERATING_SYSTEM_DISPLAY_NAME, + SystemInfo.JSON_PROPERTY_PACKAGE_NAME, SystemInfo.JSON_PROPERTY_HAS_PENDING_RESTART, + SystemInfo.JSON_PROPERTY_IS_SHUTTING_DOWN, SystemInfo.JSON_PROPERTY_SUPPORTS_LIBRARY_MONITOR, + SystemInfo.JSON_PROPERTY_WEB_SOCKET_PORT_NUMBER, SystemInfo.JSON_PROPERTY_COMPLETED_INSTALLATIONS, + SystemInfo.JSON_PROPERTY_CAN_SELF_RESTART, SystemInfo.JSON_PROPERTY_CAN_LAUNCH_WEB_BROWSER, + SystemInfo.JSON_PROPERTY_PROGRAM_DATA_PATH, SystemInfo.JSON_PROPERTY_WEB_PATH, + SystemInfo.JSON_PROPERTY_ITEMS_BY_NAME_PATH, SystemInfo.JSON_PROPERTY_CACHE_PATH, + SystemInfo.JSON_PROPERTY_LOG_PATH, SystemInfo.JSON_PROPERTY_INTERNAL_METADATA_PATH, + SystemInfo.JSON_PROPERTY_TRANSCODING_TEMP_PATH, SystemInfo.JSON_PROPERTY_HAS_UPDATE_AVAILABLE, + SystemInfo.JSON_PROPERTY_ENCODER_LOCATION, SystemInfo.JSON_PROPERTY_SYSTEM_ARCHITECTURE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class SystemInfo { + public static final String JSON_PROPERTY_LOCAL_ADDRESS = "LocalAddress"; + @org.eclipse.jdt.annotation.NonNull + private String localAddress; + + public static final String JSON_PROPERTY_SERVER_NAME = "ServerName"; + @org.eclipse.jdt.annotation.NonNull + private String serverName; + + public static final String JSON_PROPERTY_VERSION = "Version"; + @org.eclipse.jdt.annotation.NonNull + private String version; + + public static final String JSON_PROPERTY_PRODUCT_NAME = "ProductName"; + @org.eclipse.jdt.annotation.NonNull + private String productName; + + public static final String JSON_PROPERTY_OPERATING_SYSTEM = "OperatingSystem"; + @org.eclipse.jdt.annotation.NonNull + private String operatingSystem; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_STARTUP_WIZARD_COMPLETED = "StartupWizardCompleted"; + @org.eclipse.jdt.annotation.NonNull + private Boolean startupWizardCompleted; + + public static final String JSON_PROPERTY_OPERATING_SYSTEM_DISPLAY_NAME = "OperatingSystemDisplayName"; + @org.eclipse.jdt.annotation.NonNull + private String operatingSystemDisplayName; + + public static final String JSON_PROPERTY_PACKAGE_NAME = "PackageName"; + @org.eclipse.jdt.annotation.NonNull + private String packageName; + + public static final String JSON_PROPERTY_HAS_PENDING_RESTART = "HasPendingRestart"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasPendingRestart; + + public static final String JSON_PROPERTY_IS_SHUTTING_DOWN = "IsShuttingDown"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isShuttingDown; + + public static final String JSON_PROPERTY_SUPPORTS_LIBRARY_MONITOR = "SupportsLibraryMonitor"; + @org.eclipse.jdt.annotation.NonNull + private Boolean supportsLibraryMonitor; + + public static final String JSON_PROPERTY_WEB_SOCKET_PORT_NUMBER = "WebSocketPortNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer webSocketPortNumber; + + public static final String JSON_PROPERTY_COMPLETED_INSTALLATIONS = "CompletedInstallations"; + @org.eclipse.jdt.annotation.NonNull + private List completedInstallations; + + public static final String JSON_PROPERTY_CAN_SELF_RESTART = "CanSelfRestart"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canSelfRestart; + + public static final String JSON_PROPERTY_CAN_LAUNCH_WEB_BROWSER = "CanLaunchWebBrowser"; + @org.eclipse.jdt.annotation.NonNull + private Boolean canLaunchWebBrowser; + + public static final String JSON_PROPERTY_PROGRAM_DATA_PATH = "ProgramDataPath"; + @org.eclipse.jdt.annotation.NonNull + private String programDataPath; + + public static final String JSON_PROPERTY_WEB_PATH = "WebPath"; + @org.eclipse.jdt.annotation.NonNull + private String webPath; + + public static final String JSON_PROPERTY_ITEMS_BY_NAME_PATH = "ItemsByNamePath"; + @org.eclipse.jdt.annotation.NonNull + private String itemsByNamePath; + + public static final String JSON_PROPERTY_CACHE_PATH = "CachePath"; + @org.eclipse.jdt.annotation.NonNull + private String cachePath; + + public static final String JSON_PROPERTY_LOG_PATH = "LogPath"; + @org.eclipse.jdt.annotation.NonNull + private String logPath; + + public static final String JSON_PROPERTY_INTERNAL_METADATA_PATH = "InternalMetadataPath"; + @org.eclipse.jdt.annotation.NonNull + private String internalMetadataPath; + + public static final String JSON_PROPERTY_TRANSCODING_TEMP_PATH = "TranscodingTempPath"; + @org.eclipse.jdt.annotation.NonNull + private String transcodingTempPath; + + public static final String JSON_PROPERTY_HAS_UPDATE_AVAILABLE = "HasUpdateAvailable"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasUpdateAvailable; + + public static final String JSON_PROPERTY_ENCODER_LOCATION = "EncoderLocation"; + @org.eclipse.jdt.annotation.NonNull + private FFmpegLocation encoderLocation; + + public static final String JSON_PROPERTY_SYSTEM_ARCHITECTURE = "SystemArchitecture"; + @org.eclipse.jdt.annotation.NonNull + private Architecture systemArchitecture; + + public SystemInfo() { + } + + public SystemInfo localAddress(@org.eclipse.jdt.annotation.NonNull String localAddress) { + this.localAddress = localAddress; + return this; + } + + /** + * Gets or sets the local address. + * + * @return localAddress + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCAL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocalAddress() { + return localAddress; + } + + @JsonProperty(JSON_PROPERTY_LOCAL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocalAddress(@org.eclipse.jdt.annotation.NonNull String localAddress) { + this.localAddress = localAddress; + } + + public SystemInfo serverName(@org.eclipse.jdt.annotation.NonNull String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Gets or sets the name of the server. + * + * @return serverName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerName() { + return serverName; + } + + @JsonProperty(JSON_PROPERTY_SERVER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerName(@org.eclipse.jdt.annotation.NonNull String serverName) { + this.serverName = serverName; + } + + public SystemInfo version(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + return this; + } + + /** + * Gets or sets the server version. + * + * @return version + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + } + + public SystemInfo productName(@org.eclipse.jdt.annotation.NonNull String productName) { + this.productName = productName; + return this; + } + + /** + * Gets or sets the product name. This is the AssemblyProduct name. + * + * @return productName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRODUCT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProductName() { + return productName; + } + + @JsonProperty(JSON_PROPERTY_PRODUCT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProductName(@org.eclipse.jdt.annotation.NonNull String productName) { + this.productName = productName; + } + + public SystemInfo operatingSystem(@org.eclipse.jdt.annotation.NonNull String operatingSystem) { + this.operatingSystem = operatingSystem; + return this; + } + + /** + * Gets or sets the operating system. + * + * @return operatingSystem + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OPERATING_SYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOperatingSystem() { + return operatingSystem; + } + + @JsonProperty(JSON_PROPERTY_OPERATING_SYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOperatingSystem(@org.eclipse.jdt.annotation.NonNull String operatingSystem) { + this.operatingSystem = operatingSystem; + } + + public SystemInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public SystemInfo startupWizardCompleted(@org.eclipse.jdt.annotation.NonNull Boolean startupWizardCompleted) { + this.startupWizardCompleted = startupWizardCompleted; + return this; + } + + /** + * Gets or sets a value indicating whether the startup wizard is completed. + * + * @return startupWizardCompleted + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STARTUP_WIZARD_COMPLETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStartupWizardCompleted() { + return startupWizardCompleted; + } + + @JsonProperty(JSON_PROPERTY_STARTUP_WIZARD_COMPLETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartupWizardCompleted(@org.eclipse.jdt.annotation.NonNull Boolean startupWizardCompleted) { + this.startupWizardCompleted = startupWizardCompleted; + } + + public SystemInfo operatingSystemDisplayName( + @org.eclipse.jdt.annotation.NonNull String operatingSystemDisplayName) { + this.operatingSystemDisplayName = operatingSystemDisplayName; + return this; + } + + /** + * Gets or sets the display name of the operating system. + * + * @return operatingSystemDisplayName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OPERATING_SYSTEM_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOperatingSystemDisplayName() { + return operatingSystemDisplayName; + } + + @JsonProperty(JSON_PROPERTY_OPERATING_SYSTEM_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOperatingSystemDisplayName(@org.eclipse.jdt.annotation.NonNull String operatingSystemDisplayName) { + this.operatingSystemDisplayName = operatingSystemDisplayName; + } + + public SystemInfo packageName(@org.eclipse.jdt.annotation.NonNull String packageName) { + this.packageName = packageName; + return this; + } + + /** + * Gets or sets the package name. + * + * @return packageName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PACKAGE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPackageName() { + return packageName; + } + + @JsonProperty(JSON_PROPERTY_PACKAGE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPackageName(@org.eclipse.jdt.annotation.NonNull String packageName) { + this.packageName = packageName; + } + + public SystemInfo hasPendingRestart(@org.eclipse.jdt.annotation.NonNull Boolean hasPendingRestart) { + this.hasPendingRestart = hasPendingRestart; + return this; + } + + /** + * Gets or sets a value indicating whether this instance has pending restart. + * + * @return hasPendingRestart + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_PENDING_RESTART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasPendingRestart() { + return hasPendingRestart; + } + + @JsonProperty(JSON_PROPERTY_HAS_PENDING_RESTART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasPendingRestart(@org.eclipse.jdt.annotation.NonNull Boolean hasPendingRestart) { + this.hasPendingRestart = hasPendingRestart; + } + + public SystemInfo isShuttingDown(@org.eclipse.jdt.annotation.NonNull Boolean isShuttingDown) { + this.isShuttingDown = isShuttingDown; + return this; + } + + /** + * Get isShuttingDown + * + * @return isShuttingDown + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_SHUTTING_DOWN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsShuttingDown() { + return isShuttingDown; + } + + @JsonProperty(JSON_PROPERTY_IS_SHUTTING_DOWN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsShuttingDown(@org.eclipse.jdt.annotation.NonNull Boolean isShuttingDown) { + this.isShuttingDown = isShuttingDown; + } + + public SystemInfo supportsLibraryMonitor(@org.eclipse.jdt.annotation.NonNull Boolean supportsLibraryMonitor) { + this.supportsLibraryMonitor = supportsLibraryMonitor; + return this; + } + + /** + * Gets or sets a value indicating whether [supports library monitor]. + * + * @return supportsLibraryMonitor + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUPPORTS_LIBRARY_MONITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSupportsLibraryMonitor() { + return supportsLibraryMonitor; + } + + @JsonProperty(JSON_PROPERTY_SUPPORTS_LIBRARY_MONITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportsLibraryMonitor(@org.eclipse.jdt.annotation.NonNull Boolean supportsLibraryMonitor) { + this.supportsLibraryMonitor = supportsLibraryMonitor; + } + + public SystemInfo webSocketPortNumber(@org.eclipse.jdt.annotation.NonNull Integer webSocketPortNumber) { + this.webSocketPortNumber = webSocketPortNumber; + return this; + } + + /** + * Gets or sets the web socket port number. + * + * @return webSocketPortNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WEB_SOCKET_PORT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWebSocketPortNumber() { + return webSocketPortNumber; + } + + @JsonProperty(JSON_PROPERTY_WEB_SOCKET_PORT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWebSocketPortNumber(@org.eclipse.jdt.annotation.NonNull Integer webSocketPortNumber) { + this.webSocketPortNumber = webSocketPortNumber; + } + + public SystemInfo completedInstallations( + @org.eclipse.jdt.annotation.NonNull List completedInstallations) { + this.completedInstallations = completedInstallations; + return this; + } + + public SystemInfo addCompletedInstallationsItem(InstallationInfo completedInstallationsItem) { + if (this.completedInstallations == null) { + this.completedInstallations = new ArrayList<>(); + } + this.completedInstallations.add(completedInstallationsItem); + return this; + } + + /** + * Gets or sets the completed installations. + * + * @return completedInstallations + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMPLETED_INSTALLATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCompletedInstallations() { + return completedInstallations; + } + + @JsonProperty(JSON_PROPERTY_COMPLETED_INSTALLATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompletedInstallations( + @org.eclipse.jdt.annotation.NonNull List completedInstallations) { + this.completedInstallations = completedInstallations; + } + + public SystemInfo canSelfRestart(@org.eclipse.jdt.annotation.NonNull Boolean canSelfRestart) { + this.canSelfRestart = canSelfRestart; + return this; + } + + /** + * Gets or sets a value indicating whether this instance can self restart. + * + * @return canSelfRestart + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_SELF_RESTART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanSelfRestart() { + return canSelfRestart; + } + + @JsonProperty(JSON_PROPERTY_CAN_SELF_RESTART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanSelfRestart(@org.eclipse.jdt.annotation.NonNull Boolean canSelfRestart) { + this.canSelfRestart = canSelfRestart; + } + + public SystemInfo canLaunchWebBrowser(@org.eclipse.jdt.annotation.NonNull Boolean canLaunchWebBrowser) { + this.canLaunchWebBrowser = canLaunchWebBrowser; + return this; + } + + /** + * Get canLaunchWebBrowser + * + * @return canLaunchWebBrowser + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CAN_LAUNCH_WEB_BROWSER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanLaunchWebBrowser() { + return canLaunchWebBrowser; + } + + @JsonProperty(JSON_PROPERTY_CAN_LAUNCH_WEB_BROWSER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanLaunchWebBrowser(@org.eclipse.jdt.annotation.NonNull Boolean canLaunchWebBrowser) { + this.canLaunchWebBrowser = canLaunchWebBrowser; + } + + public SystemInfo programDataPath(@org.eclipse.jdt.annotation.NonNull String programDataPath) { + this.programDataPath = programDataPath; + return this; + } + + /** + * Gets or sets the program data path. + * + * @return programDataPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROGRAM_DATA_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProgramDataPath() { + return programDataPath; + } + + @JsonProperty(JSON_PROPERTY_PROGRAM_DATA_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgramDataPath(@org.eclipse.jdt.annotation.NonNull String programDataPath) { + this.programDataPath = programDataPath; + } + + public SystemInfo webPath(@org.eclipse.jdt.annotation.NonNull String webPath) { + this.webPath = webPath; + return this; + } + + /** + * Gets or sets the web UI resources path. + * + * @return webPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WEB_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWebPath() { + return webPath; + } + + @JsonProperty(JSON_PROPERTY_WEB_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWebPath(@org.eclipse.jdt.annotation.NonNull String webPath) { + this.webPath = webPath; + } + + public SystemInfo itemsByNamePath(@org.eclipse.jdt.annotation.NonNull String itemsByNamePath) { + this.itemsByNamePath = itemsByNamePath; + return this; + } + + /** + * Gets or sets the items by name path. + * + * @return itemsByNamePath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS_BY_NAME_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getItemsByNamePath() { + return itemsByNamePath; + } + + @JsonProperty(JSON_PROPERTY_ITEMS_BY_NAME_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemsByNamePath(@org.eclipse.jdt.annotation.NonNull String itemsByNamePath) { + this.itemsByNamePath = itemsByNamePath; + } + + public SystemInfo cachePath(@org.eclipse.jdt.annotation.NonNull String cachePath) { + this.cachePath = cachePath; + return this; + } + + /** + * Gets or sets the cache path. + * + * @return cachePath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CACHE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCachePath() { + return cachePath; + } + + @JsonProperty(JSON_PROPERTY_CACHE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCachePath(@org.eclipse.jdt.annotation.NonNull String cachePath) { + this.cachePath = cachePath; + } + + public SystemInfo logPath(@org.eclipse.jdt.annotation.NonNull String logPath) { + this.logPath = logPath; + return this; + } + + /** + * Gets or sets the log path. + * + * @return logPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOG_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLogPath() { + return logPath; + } + + @JsonProperty(JSON_PROPERTY_LOG_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogPath(@org.eclipse.jdt.annotation.NonNull String logPath) { + this.logPath = logPath; + } + + public SystemInfo internalMetadataPath(@org.eclipse.jdt.annotation.NonNull String internalMetadataPath) { + this.internalMetadataPath = internalMetadataPath; + return this; + } + + /** + * Gets or sets the internal metadata path. + * + * @return internalMetadataPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INTERNAL_METADATA_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInternalMetadataPath() { + return internalMetadataPath; + } + + @JsonProperty(JSON_PROPERTY_INTERNAL_METADATA_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInternalMetadataPath(@org.eclipse.jdt.annotation.NonNull String internalMetadataPath) { + this.internalMetadataPath = internalMetadataPath; + } + + public SystemInfo transcodingTempPath(@org.eclipse.jdt.annotation.NonNull String transcodingTempPath) { + this.transcodingTempPath = transcodingTempPath; + return this; + } + + /** + * Gets or sets the transcode path. + * + * @return transcodingTempPath + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODING_TEMP_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTranscodingTempPath() { + return transcodingTempPath; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODING_TEMP_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodingTempPath(@org.eclipse.jdt.annotation.NonNull String transcodingTempPath) { + this.transcodingTempPath = transcodingTempPath; + } + + public SystemInfo hasUpdateAvailable(@org.eclipse.jdt.annotation.NonNull Boolean hasUpdateAvailable) { + this.hasUpdateAvailable = hasUpdateAvailable; + return this; + } + + /** + * Gets or sets a value indicating whether this instance has update available. + * + * @return hasUpdateAvailable + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_UPDATE_AVAILABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasUpdateAvailable() { + return hasUpdateAvailable; + } + + @JsonProperty(JSON_PROPERTY_HAS_UPDATE_AVAILABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasUpdateAvailable(@org.eclipse.jdt.annotation.NonNull Boolean hasUpdateAvailable) { + this.hasUpdateAvailable = hasUpdateAvailable; + } + + public SystemInfo encoderLocation(@org.eclipse.jdt.annotation.NonNull FFmpegLocation encoderLocation) { + this.encoderLocation = encoderLocation; + return this; + } + + /** + * Enum describing the location of the FFmpeg tool. + * + * @return encoderLocation + * @deprecated + */ + @Deprecated + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENCODER_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FFmpegLocation getEncoderLocation() { + return encoderLocation; + } + + @JsonProperty(JSON_PROPERTY_ENCODER_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncoderLocation(@org.eclipse.jdt.annotation.NonNull FFmpegLocation encoderLocation) { + this.encoderLocation = encoderLocation; + } + + public SystemInfo systemArchitecture(@org.eclipse.jdt.annotation.NonNull Architecture systemArchitecture) { + this.systemArchitecture = systemArchitecture; + return this; + } + + /** + * Get systemArchitecture + * + * @return systemArchitecture + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SYSTEM_ARCHITECTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Architecture getSystemArchitecture() { + return systemArchitecture; + } + + @JsonProperty(JSON_PROPERTY_SYSTEM_ARCHITECTURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSystemArchitecture(@org.eclipse.jdt.annotation.NonNull Architecture systemArchitecture) { + this.systemArchitecture = systemArchitecture; + } + + /** + * Return true if this SystemInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SystemInfo systemInfo = (SystemInfo) o; + return Objects.equals(this.localAddress, systemInfo.localAddress) + && Objects.equals(this.serverName, systemInfo.serverName) + && Objects.equals(this.version, systemInfo.version) + && Objects.equals(this.productName, systemInfo.productName) + && Objects.equals(this.operatingSystem, systemInfo.operatingSystem) + && Objects.equals(this.id, systemInfo.id) + && Objects.equals(this.startupWizardCompleted, systemInfo.startupWizardCompleted) + && Objects.equals(this.operatingSystemDisplayName, systemInfo.operatingSystemDisplayName) + && Objects.equals(this.packageName, systemInfo.packageName) + && Objects.equals(this.hasPendingRestart, systemInfo.hasPendingRestart) + && Objects.equals(this.isShuttingDown, systemInfo.isShuttingDown) + && Objects.equals(this.supportsLibraryMonitor, systemInfo.supportsLibraryMonitor) + && Objects.equals(this.webSocketPortNumber, systemInfo.webSocketPortNumber) + && Objects.equals(this.completedInstallations, systemInfo.completedInstallations) + && Objects.equals(this.canSelfRestart, systemInfo.canSelfRestart) + && Objects.equals(this.canLaunchWebBrowser, systemInfo.canLaunchWebBrowser) + && Objects.equals(this.programDataPath, systemInfo.programDataPath) + && Objects.equals(this.webPath, systemInfo.webPath) + && Objects.equals(this.itemsByNamePath, systemInfo.itemsByNamePath) + && Objects.equals(this.cachePath, systemInfo.cachePath) + && Objects.equals(this.logPath, systemInfo.logPath) + && Objects.equals(this.internalMetadataPath, systemInfo.internalMetadataPath) + && Objects.equals(this.transcodingTempPath, systemInfo.transcodingTempPath) + && Objects.equals(this.hasUpdateAvailable, systemInfo.hasUpdateAvailable) + && Objects.equals(this.encoderLocation, systemInfo.encoderLocation) + && Objects.equals(this.systemArchitecture, systemInfo.systemArchitecture); + } + + @Override + public int hashCode() { + return Objects.hash(localAddress, serverName, version, productName, operatingSystem, id, startupWizardCompleted, + operatingSystemDisplayName, packageName, hasPendingRestart, isShuttingDown, supportsLibraryMonitor, + webSocketPortNumber, completedInstallations, canSelfRestart, canLaunchWebBrowser, programDataPath, + webPath, itemsByNamePath, cachePath, logPath, internalMetadataPath, transcodingTempPath, + hasUpdateAvailable, encoderLocation, systemArchitecture); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SystemInfo {\n"); + sb.append(" localAddress: ").append(toIndentedString(localAddress)).append("\n"); + sb.append(" serverName: ").append(toIndentedString(serverName)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" productName: ").append(toIndentedString(productName)).append("\n"); + sb.append(" operatingSystem: ").append(toIndentedString(operatingSystem)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" startupWizardCompleted: ").append(toIndentedString(startupWizardCompleted)).append("\n"); + sb.append(" operatingSystemDisplayName: ").append(toIndentedString(operatingSystemDisplayName)).append("\n"); + sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); + sb.append(" hasPendingRestart: ").append(toIndentedString(hasPendingRestart)).append("\n"); + sb.append(" isShuttingDown: ").append(toIndentedString(isShuttingDown)).append("\n"); + sb.append(" supportsLibraryMonitor: ").append(toIndentedString(supportsLibraryMonitor)).append("\n"); + sb.append(" webSocketPortNumber: ").append(toIndentedString(webSocketPortNumber)).append("\n"); + sb.append(" completedInstallations: ").append(toIndentedString(completedInstallations)).append("\n"); + sb.append(" canSelfRestart: ").append(toIndentedString(canSelfRestart)).append("\n"); + sb.append(" canLaunchWebBrowser: ").append(toIndentedString(canLaunchWebBrowser)).append("\n"); + sb.append(" programDataPath: ").append(toIndentedString(programDataPath)).append("\n"); + sb.append(" webPath: ").append(toIndentedString(webPath)).append("\n"); + sb.append(" itemsByNamePath: ").append(toIndentedString(itemsByNamePath)).append("\n"); + sb.append(" cachePath: ").append(toIndentedString(cachePath)).append("\n"); + sb.append(" logPath: ").append(toIndentedString(logPath)).append("\n"); + sb.append(" internalMetadataPath: ").append(toIndentedString(internalMetadataPath)).append("\n"); + sb.append(" transcodingTempPath: ").append(toIndentedString(transcodingTempPath)).append("\n"); + sb.append(" hasUpdateAvailable: ").append(toIndentedString(hasUpdateAvailable)).append("\n"); + sb.append(" encoderLocation: ").append(toIndentedString(encoderLocation)).append("\n"); + sb.append(" systemArchitecture: ").append(toIndentedString(systemArchitecture)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `LocalAddress` to the URL query string + if (getLocalAddress() != null) { + joiner.add(String.format("%sLocalAddress%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLocalAddress())))); + } + + // add `ServerName` to the URL query string + if (getServerName() != null) { + joiner.add(String.format("%sServerName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerName())))); + } + + // add `Version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format("%sVersion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `ProductName` to the URL query string + if (getProductName() != null) { + joiner.add(String.format("%sProductName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProductName())))); + } + + // add `OperatingSystem` to the URL query string + if (getOperatingSystem() != null) { + joiner.add(String.format("%sOperatingSystem%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOperatingSystem())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `StartupWizardCompleted` to the URL query string + if (getStartupWizardCompleted() != null) { + joiner.add(String.format("%sStartupWizardCompleted%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartupWizardCompleted())))); + } + + // add `OperatingSystemDisplayName` to the URL query string + if (getOperatingSystemDisplayName() != null) { + joiner.add(String.format("%sOperatingSystemDisplayName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOperatingSystemDisplayName())))); + } + + // add `PackageName` to the URL query string + if (getPackageName() != null) { + joiner.add(String.format("%sPackageName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPackageName())))); + } + + // add `HasPendingRestart` to the URL query string + if (getHasPendingRestart() != null) { + joiner.add(String.format("%sHasPendingRestart%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasPendingRestart())))); + } + + // add `IsShuttingDown` to the URL query string + if (getIsShuttingDown() != null) { + joiner.add(String.format("%sIsShuttingDown%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsShuttingDown())))); + } + + // add `SupportsLibraryMonitor` to the URL query string + if (getSupportsLibraryMonitor() != null) { + joiner.add(String.format("%sSupportsLibraryMonitor%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSupportsLibraryMonitor())))); + } + + // add `WebSocketPortNumber` to the URL query string + if (getWebSocketPortNumber() != null) { + joiner.add(String.format("%sWebSocketPortNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWebSocketPortNumber())))); + } + + // add `CompletedInstallations` to the URL query string + if (getCompletedInstallations() != null) { + for (int i = 0; i < getCompletedInstallations().size(); i++) { + if (getCompletedInstallations().get(i) != null) { + joiner.add(getCompletedInstallations().get(i).toUrlQueryString(String.format( + "%sCompletedInstallations%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `CanSelfRestart` to the URL query string + if (getCanSelfRestart() != null) { + joiner.add(String.format("%sCanSelfRestart%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanSelfRestart())))); + } + + // add `CanLaunchWebBrowser` to the URL query string + if (getCanLaunchWebBrowser() != null) { + joiner.add(String.format("%sCanLaunchWebBrowser%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCanLaunchWebBrowser())))); + } + + // add `ProgramDataPath` to the URL query string + if (getProgramDataPath() != null) { + joiner.add(String.format("%sProgramDataPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProgramDataPath())))); + } + + // add `WebPath` to the URL query string + if (getWebPath() != null) { + joiner.add(String.format("%sWebPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWebPath())))); + } + + // add `ItemsByNamePath` to the URL query string + if (getItemsByNamePath() != null) { + joiner.add(String.format("%sItemsByNamePath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemsByNamePath())))); + } + + // add `CachePath` to the URL query string + if (getCachePath() != null) { + joiner.add(String.format("%sCachePath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCachePath())))); + } + + // add `LogPath` to the URL query string + if (getLogPath() != null) { + joiner.add(String.format("%sLogPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLogPath())))); + } + + // add `InternalMetadataPath` to the URL query string + if (getInternalMetadataPath() != null) { + joiner.add(String.format("%sInternalMetadataPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getInternalMetadataPath())))); + } + + // add `TranscodingTempPath` to the URL query string + if (getTranscodingTempPath() != null) { + joiner.add(String.format("%sTranscodingTempPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTranscodingTempPath())))); + } + + // add `HasUpdateAvailable` to the URL query string + if (getHasUpdateAvailable() != null) { + joiner.add(String.format("%sHasUpdateAvailable%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasUpdateAvailable())))); + } + + // add `EncoderLocation` to the URL query string + if (getEncoderLocation() != null) { + joiner.add(String.format("%sEncoderLocation%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEncoderLocation())))); + } + + // add `SystemArchitecture` to the URL query string + if (getSystemArchitecture() != null) { + joiner.add(String.format("%sSystemArchitecture%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSystemArchitecture())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SystemInfo instance; + + public Builder() { + this(new SystemInfo()); + } + + protected Builder(SystemInfo instance) { + this.instance = instance; + } + + public SystemInfo.Builder localAddress(String localAddress) { + this.instance.localAddress = localAddress; + return this; + } + + public SystemInfo.Builder serverName(String serverName) { + this.instance.serverName = serverName; + return this; + } + + public SystemInfo.Builder version(String version) { + this.instance.version = version; + return this; + } + + public SystemInfo.Builder productName(String productName) { + this.instance.productName = productName; + return this; + } + + public SystemInfo.Builder operatingSystem(String operatingSystem) { + this.instance.operatingSystem = operatingSystem; + return this; + } + + public SystemInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public SystemInfo.Builder startupWizardCompleted(Boolean startupWizardCompleted) { + this.instance.startupWizardCompleted = startupWizardCompleted; + return this; + } + + public SystemInfo.Builder operatingSystemDisplayName(String operatingSystemDisplayName) { + this.instance.operatingSystemDisplayName = operatingSystemDisplayName; + return this; + } + + public SystemInfo.Builder packageName(String packageName) { + this.instance.packageName = packageName; + return this; + } + + public SystemInfo.Builder hasPendingRestart(Boolean hasPendingRestart) { + this.instance.hasPendingRestart = hasPendingRestart; + return this; + } + + public SystemInfo.Builder isShuttingDown(Boolean isShuttingDown) { + this.instance.isShuttingDown = isShuttingDown; + return this; + } + + public SystemInfo.Builder supportsLibraryMonitor(Boolean supportsLibraryMonitor) { + this.instance.supportsLibraryMonitor = supportsLibraryMonitor; + return this; + } + + public SystemInfo.Builder webSocketPortNumber(Integer webSocketPortNumber) { + this.instance.webSocketPortNumber = webSocketPortNumber; + return this; + } + + public SystemInfo.Builder completedInstallations(List completedInstallations) { + this.instance.completedInstallations = completedInstallations; + return this; + } + + public SystemInfo.Builder canSelfRestart(Boolean canSelfRestart) { + this.instance.canSelfRestart = canSelfRestart; + return this; + } + + public SystemInfo.Builder canLaunchWebBrowser(Boolean canLaunchWebBrowser) { + this.instance.canLaunchWebBrowser = canLaunchWebBrowser; + return this; + } + + public SystemInfo.Builder programDataPath(String programDataPath) { + this.instance.programDataPath = programDataPath; + return this; + } + + public SystemInfo.Builder webPath(String webPath) { + this.instance.webPath = webPath; + return this; + } + + public SystemInfo.Builder itemsByNamePath(String itemsByNamePath) { + this.instance.itemsByNamePath = itemsByNamePath; + return this; + } + + public SystemInfo.Builder cachePath(String cachePath) { + this.instance.cachePath = cachePath; + return this; + } + + public SystemInfo.Builder logPath(String logPath) { + this.instance.logPath = logPath; + return this; + } + + public SystemInfo.Builder internalMetadataPath(String internalMetadataPath) { + this.instance.internalMetadataPath = internalMetadataPath; + return this; + } + + public SystemInfo.Builder transcodingTempPath(String transcodingTempPath) { + this.instance.transcodingTempPath = transcodingTempPath; + return this; + } + + public SystemInfo.Builder hasUpdateAvailable(Boolean hasUpdateAvailable) { + this.instance.hasUpdateAvailable = hasUpdateAvailable; + return this; + } + + public SystemInfo.Builder encoderLocation(FFmpegLocation encoderLocation) { + this.instance.encoderLocation = encoderLocation; + return this; + } + + public SystemInfo.Builder systemArchitecture(Architecture systemArchitecture) { + this.instance.systemArchitecture = systemArchitecture; + return this; + } + + /** + * returns a built SystemInfo instance. + * + * The builder is not reusable. + */ + public SystemInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SystemInfo.Builder builder() { + return new SystemInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SystemInfo.Builder toBuilder() { + return new SystemInfo.Builder().localAddress(getLocalAddress()).serverName(getServerName()) + .version(getVersion()).productName(getProductName()).operatingSystem(getOperatingSystem()).id(getId()) + .startupWizardCompleted(getStartupWizardCompleted()) + .operatingSystemDisplayName(getOperatingSystemDisplayName()).packageName(getPackageName()) + .hasPendingRestart(getHasPendingRestart()).isShuttingDown(getIsShuttingDown()) + .supportsLibraryMonitor(getSupportsLibraryMonitor()).webSocketPortNumber(getWebSocketPortNumber()) + .completedInstallations(getCompletedInstallations()).canSelfRestart(getCanSelfRestart()) + .canLaunchWebBrowser(getCanLaunchWebBrowser()).programDataPath(getProgramDataPath()) + .webPath(getWebPath()).itemsByNamePath(getItemsByNamePath()).cachePath(getCachePath()) + .logPath(getLogPath()).internalMetadataPath(getInternalMetadataPath()) + .transcodingTempPath(getTranscodingTempPath()).hasUpdateAvailable(getHasUpdateAvailable()) + .encoderLocation(getEncoderLocation()).systemArchitecture(getSystemArchitecture()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskCompletionStatus.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskCompletionStatus.java new file mode 100644 index 0000000000000..3d3dd7683a319 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskCompletionStatus.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum TaskCompletionStatus. + */ +public enum TaskCompletionStatus { + + COMPLETED("Completed"), + + FAILED("Failed"), + + CANCELLED("Cancelled"), + + ABORTED("Aborted"); + + private String value; + + TaskCompletionStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TaskCompletionStatus fromValue(String value) { + for (TaskCompletionStatus b : TaskCompletionStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskInfo.java new file mode 100644 index 0000000000000..1bca47c8d4685 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskInfo.java @@ -0,0 +1,571 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class TaskInfo. + */ +@JsonPropertyOrder({ TaskInfo.JSON_PROPERTY_NAME, TaskInfo.JSON_PROPERTY_STATE, + TaskInfo.JSON_PROPERTY_CURRENT_PROGRESS_PERCENTAGE, TaskInfo.JSON_PROPERTY_ID, + TaskInfo.JSON_PROPERTY_LAST_EXECUTION_RESULT, TaskInfo.JSON_PROPERTY_TRIGGERS, + TaskInfo.JSON_PROPERTY_DESCRIPTION, TaskInfo.JSON_PROPERTY_CATEGORY, TaskInfo.JSON_PROPERTY_IS_HIDDEN, + TaskInfo.JSON_PROPERTY_KEY }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TaskInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_STATE = "State"; + @org.eclipse.jdt.annotation.NonNull + private TaskState state; + + public static final String JSON_PROPERTY_CURRENT_PROGRESS_PERCENTAGE = "CurrentProgressPercentage"; + @org.eclipse.jdt.annotation.NonNull + private Double currentProgressPercentage; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_LAST_EXECUTION_RESULT = "LastExecutionResult"; + @org.eclipse.jdt.annotation.NonNull + private TaskResult lastExecutionResult; + + public static final String JSON_PROPERTY_TRIGGERS = "Triggers"; + @org.eclipse.jdt.annotation.NonNull + private List triggers; + + public static final String JSON_PROPERTY_DESCRIPTION = "Description"; + @org.eclipse.jdt.annotation.NonNull + private String description; + + public static final String JSON_PROPERTY_CATEGORY = "Category"; + @org.eclipse.jdt.annotation.NonNull + private String category; + + public static final String JSON_PROPERTY_IS_HIDDEN = "IsHidden"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isHidden; + + public static final String JSON_PROPERTY_KEY = "Key"; + @org.eclipse.jdt.annotation.NonNull + private String key; + + public TaskInfo() { + } + + public TaskInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public TaskInfo state(@org.eclipse.jdt.annotation.NonNull TaskState state) { + this.state = state; + return this; + } + + /** + * Gets or sets the state of the task. + * + * @return state + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TaskState getState() { + return state; + } + + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setState(@org.eclipse.jdt.annotation.NonNull TaskState state) { + this.state = state; + } + + public TaskInfo currentProgressPercentage(@org.eclipse.jdt.annotation.NonNull Double currentProgressPercentage) { + this.currentProgressPercentage = currentProgressPercentage; + return this; + } + + /** + * Gets or sets the progress. + * + * @return currentProgressPercentage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CURRENT_PROGRESS_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getCurrentProgressPercentage() { + return currentProgressPercentage; + } + + @JsonProperty(JSON_PROPERTY_CURRENT_PROGRESS_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrentProgressPercentage(@org.eclipse.jdt.annotation.NonNull Double currentProgressPercentage) { + this.currentProgressPercentage = currentProgressPercentage; + } + + public TaskInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public TaskInfo lastExecutionResult(@org.eclipse.jdt.annotation.NonNull TaskResult lastExecutionResult) { + this.lastExecutionResult = lastExecutionResult; + return this; + } + + /** + * Gets or sets the last execution result. + * + * @return lastExecutionResult + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_EXECUTION_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TaskResult getLastExecutionResult() { + return lastExecutionResult; + } + + @JsonProperty(JSON_PROPERTY_LAST_EXECUTION_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastExecutionResult(@org.eclipse.jdt.annotation.NonNull TaskResult lastExecutionResult) { + this.lastExecutionResult = lastExecutionResult; + } + + public TaskInfo triggers(@org.eclipse.jdt.annotation.NonNull List triggers) { + this.triggers = triggers; + return this; + } + + public TaskInfo addTriggersItem(TaskTriggerInfo triggersItem) { + if (this.triggers == null) { + this.triggers = new ArrayList<>(); + } + this.triggers.add(triggersItem); + return this; + } + + /** + * Gets or sets the triggers. + * + * @return triggers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRIGGERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTriggers() { + return triggers; + } + + @JsonProperty(JSON_PROPERTY_TRIGGERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTriggers(@org.eclipse.jdt.annotation.NonNull List triggers) { + this.triggers = triggers; + } + + public TaskInfo description(@org.eclipse.jdt.annotation.NonNull String description) { + this.description = description; + return this; + } + + /** + * Gets or sets the description. + * + * @return description + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@org.eclipse.jdt.annotation.NonNull String description) { + this.description = description; + } + + public TaskInfo category(@org.eclipse.jdt.annotation.NonNull String category) { + this.category = category; + return this; + } + + /** + * Gets or sets the category. + * + * @return category + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCategory() { + return category; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(@org.eclipse.jdt.annotation.NonNull String category) { + this.category = category; + } + + public TaskInfo isHidden(@org.eclipse.jdt.annotation.NonNull Boolean isHidden) { + this.isHidden = isHidden; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is hidden. + * + * @return isHidden + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_HIDDEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsHidden() { + return isHidden; + } + + @JsonProperty(JSON_PROPERTY_IS_HIDDEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsHidden(@org.eclipse.jdt.annotation.NonNull Boolean isHidden) { + this.isHidden = isHidden; + } + + public TaskInfo key(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + return this; + } + + /** + * Gets or sets the key. + * + * @return key + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + } + + /** + * Return true if this TaskInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TaskInfo taskInfo = (TaskInfo) o; + return Objects.equals(this.name, taskInfo.name) && Objects.equals(this.state, taskInfo.state) + && Objects.equals(this.currentProgressPercentage, taskInfo.currentProgressPercentage) + && Objects.equals(this.id, taskInfo.id) + && Objects.equals(this.lastExecutionResult, taskInfo.lastExecutionResult) + && Objects.equals(this.triggers, taskInfo.triggers) + && Objects.equals(this.description, taskInfo.description) + && Objects.equals(this.category, taskInfo.category) && Objects.equals(this.isHidden, taskInfo.isHidden) + && Objects.equals(this.key, taskInfo.key); + } + + @Override + public int hashCode() { + return Objects.hash(name, state, currentProgressPercentage, id, lastExecutionResult, triggers, description, + category, isHidden, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TaskInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" currentProgressPercentage: ").append(toIndentedString(currentProgressPercentage)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" lastExecutionResult: ").append(toIndentedString(lastExecutionResult)).append("\n"); + sb.append(" triggers: ").append(toIndentedString(triggers)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" isHidden: ").append(toIndentedString(isHidden)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `State` to the URL query string + if (getState() != null) { + joiner.add(String.format("%sState%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getState())))); + } + + // add `CurrentProgressPercentage` to the URL query string + if (getCurrentProgressPercentage() != null) { + joiner.add(String.format("%sCurrentProgressPercentage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCurrentProgressPercentage())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `LastExecutionResult` to the URL query string + if (getLastExecutionResult() != null) { + joiner.add(getLastExecutionResult().toUrlQueryString(prefix + "LastExecutionResult" + suffix)); + } + + // add `Triggers` to the URL query string + if (getTriggers() != null) { + for (int i = 0; i < getTriggers().size(); i++) { + if (getTriggers().get(i) != null) { + joiner.add(getTriggers().get(i).toUrlQueryString(String.format("%sTriggers%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sDescription%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDescription())))); + } + + // add `Category` to the URL query string + if (getCategory() != null) { + joiner.add(String.format("%sCategory%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCategory())))); + } + + // add `IsHidden` to the URL query string + if (getIsHidden() != null) { + joiner.add(String.format("%sIsHidden%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsHidden())))); + } + + // add `Key` to the URL query string + if (getKey() != null) { + joiner.add(String.format("%sKey%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getKey())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TaskInfo instance; + + public Builder() { + this(new TaskInfo()); + } + + protected Builder(TaskInfo instance) { + this.instance = instance; + } + + public TaskInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public TaskInfo.Builder state(TaskState state) { + this.instance.state = state; + return this; + } + + public TaskInfo.Builder currentProgressPercentage(Double currentProgressPercentage) { + this.instance.currentProgressPercentage = currentProgressPercentage; + return this; + } + + public TaskInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public TaskInfo.Builder lastExecutionResult(TaskResult lastExecutionResult) { + this.instance.lastExecutionResult = lastExecutionResult; + return this; + } + + public TaskInfo.Builder triggers(List triggers) { + this.instance.triggers = triggers; + return this; + } + + public TaskInfo.Builder description(String description) { + this.instance.description = description; + return this; + } + + public TaskInfo.Builder category(String category) { + this.instance.category = category; + return this; + } + + public TaskInfo.Builder isHidden(Boolean isHidden) { + this.instance.isHidden = isHidden; + return this; + } + + public TaskInfo.Builder key(String key) { + this.instance.key = key; + return this; + } + + /** + * returns a built TaskInfo instance. + * + * The builder is not reusable. + */ + public TaskInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TaskInfo.Builder builder() { + return new TaskInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TaskInfo.Builder toBuilder() { + return new TaskInfo.Builder().name(getName()).state(getState()) + .currentProgressPercentage(getCurrentProgressPercentage()).id(getId()) + .lastExecutionResult(getLastExecutionResult()).triggers(getTriggers()).description(getDescription()) + .category(getCategory()).isHidden(getIsHidden()).key(getKey()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskResult.java new file mode 100644 index 0000000000000..b3f006143f728 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskResult.java @@ -0,0 +1,476 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class TaskExecutionInfo. + */ +@JsonPropertyOrder({ TaskResult.JSON_PROPERTY_START_TIME_UTC, TaskResult.JSON_PROPERTY_END_TIME_UTC, + TaskResult.JSON_PROPERTY_STATUS, TaskResult.JSON_PROPERTY_NAME, TaskResult.JSON_PROPERTY_KEY, + TaskResult.JSON_PROPERTY_ID, TaskResult.JSON_PROPERTY_ERROR_MESSAGE, + TaskResult.JSON_PROPERTY_LONG_ERROR_MESSAGE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TaskResult { + public static final String JSON_PROPERTY_START_TIME_UTC = "StartTimeUtc"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime startTimeUtc; + + public static final String JSON_PROPERTY_END_TIME_UTC = "EndTimeUtc"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime endTimeUtc; + + public static final String JSON_PROPERTY_STATUS = "Status"; + @org.eclipse.jdt.annotation.NonNull + private TaskCompletionStatus status; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_KEY = "Key"; + @org.eclipse.jdt.annotation.NonNull + private String key; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_ERROR_MESSAGE = "ErrorMessage"; + @org.eclipse.jdt.annotation.NonNull + private String errorMessage; + + public static final String JSON_PROPERTY_LONG_ERROR_MESSAGE = "LongErrorMessage"; + @org.eclipse.jdt.annotation.NonNull + private String longErrorMessage; + + public TaskResult() { + } + + public TaskResult startTimeUtc(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startTimeUtc) { + this.startTimeUtc = startTimeUtc; + return this; + } + + /** + * Gets or sets the start time UTC. + * + * @return startTimeUtc + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_TIME_UTC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartTimeUtc() { + return startTimeUtc; + } + + @JsonProperty(JSON_PROPERTY_START_TIME_UTC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartTimeUtc(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startTimeUtc) { + this.startTimeUtc = startTimeUtc; + } + + public TaskResult endTimeUtc(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endTimeUtc) { + this.endTimeUtc = endTimeUtc; + return this; + } + + /** + * Gets or sets the end time UTC. + * + * @return endTimeUtc + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_END_TIME_UTC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndTimeUtc() { + return endTimeUtc; + } + + @JsonProperty(JSON_PROPERTY_END_TIME_UTC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndTimeUtc(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endTimeUtc) { + this.endTimeUtc = endTimeUtc; + } + + public TaskResult status(@org.eclipse.jdt.annotation.NonNull TaskCompletionStatus status) { + this.status = status; + return this; + } + + /** + * Gets or sets the status. + * + * @return status + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TaskCompletionStatus getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@org.eclipse.jdt.annotation.NonNull TaskCompletionStatus status) { + this.status = status; + } + + public TaskResult name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public TaskResult key(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + return this; + } + + /** + * Gets or sets the key. + * + * @return key + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + } + + public TaskResult id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public TaskResult errorMessage(@org.eclipse.jdt.annotation.NonNull String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Gets or sets the error message. + * + * @return errorMessage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ERROR_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getErrorMessage() { + return errorMessage; + } + + @JsonProperty(JSON_PROPERTY_ERROR_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorMessage(@org.eclipse.jdt.annotation.NonNull String errorMessage) { + this.errorMessage = errorMessage; + } + + public TaskResult longErrorMessage(@org.eclipse.jdt.annotation.NonNull String longErrorMessage) { + this.longErrorMessage = longErrorMessage; + return this; + } + + /** + * Gets or sets the long error message. + * + * @return longErrorMessage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LONG_ERROR_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLongErrorMessage() { + return longErrorMessage; + } + + @JsonProperty(JSON_PROPERTY_LONG_ERROR_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLongErrorMessage(@org.eclipse.jdt.annotation.NonNull String longErrorMessage) { + this.longErrorMessage = longErrorMessage; + } + + /** + * Return true if this TaskResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TaskResult taskResult = (TaskResult) o; + return Objects.equals(this.startTimeUtc, taskResult.startTimeUtc) + && Objects.equals(this.endTimeUtc, taskResult.endTimeUtc) + && Objects.equals(this.status, taskResult.status) && Objects.equals(this.name, taskResult.name) + && Objects.equals(this.key, taskResult.key) && Objects.equals(this.id, taskResult.id) + && Objects.equals(this.errorMessage, taskResult.errorMessage) + && Objects.equals(this.longErrorMessage, taskResult.longErrorMessage); + } + + @Override + public int hashCode() { + return Objects.hash(startTimeUtc, endTimeUtc, status, name, key, id, errorMessage, longErrorMessage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TaskResult {\n"); + sb.append(" startTimeUtc: ").append(toIndentedString(startTimeUtc)).append("\n"); + sb.append(" endTimeUtc: ").append(toIndentedString(endTimeUtc)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" longErrorMessage: ").append(toIndentedString(longErrorMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `StartTimeUtc` to the URL query string + if (getStartTimeUtc() != null) { + joiner.add(String.format("%sStartTimeUtc%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartTimeUtc())))); + } + + // add `EndTimeUtc` to the URL query string + if (getEndTimeUtc() != null) { + joiner.add(String.format("%sEndTimeUtc%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndTimeUtc())))); + } + + // add `Status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sStatus%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Key` to the URL query string + if (getKey() != null) { + joiner.add(String.format("%sKey%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getKey())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `ErrorMessage` to the URL query string + if (getErrorMessage() != null) { + joiner.add(String.format("%sErrorMessage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getErrorMessage())))); + } + + // add `LongErrorMessage` to the URL query string + if (getLongErrorMessage() != null) { + joiner.add(String.format("%sLongErrorMessage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLongErrorMessage())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TaskResult instance; + + public Builder() { + this(new TaskResult()); + } + + protected Builder(TaskResult instance) { + this.instance = instance; + } + + public TaskResult.Builder startTimeUtc(OffsetDateTime startTimeUtc) { + this.instance.startTimeUtc = startTimeUtc; + return this; + } + + public TaskResult.Builder endTimeUtc(OffsetDateTime endTimeUtc) { + this.instance.endTimeUtc = endTimeUtc; + return this; + } + + public TaskResult.Builder status(TaskCompletionStatus status) { + this.instance.status = status; + return this; + } + + public TaskResult.Builder name(String name) { + this.instance.name = name; + return this; + } + + public TaskResult.Builder key(String key) { + this.instance.key = key; + return this; + } + + public TaskResult.Builder id(String id) { + this.instance.id = id; + return this; + } + + public TaskResult.Builder errorMessage(String errorMessage) { + this.instance.errorMessage = errorMessage; + return this; + } + + public TaskResult.Builder longErrorMessage(String longErrorMessage) { + this.instance.longErrorMessage = longErrorMessage; + return this; + } + + /** + * returns a built TaskResult instance. + * + * The builder is not reusable. + */ + public TaskResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TaskResult.Builder builder() { + return new TaskResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TaskResult.Builder toBuilder() { + return new TaskResult.Builder().startTimeUtc(getStartTimeUtc()).endTimeUtc(getEndTimeUtc()).status(getStatus()) + .name(getName()).key(getKey()).id(getId()).errorMessage(getErrorMessage()) + .longErrorMessage(getLongErrorMessage()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskState.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskState.java new file mode 100644 index 0000000000000..ccef818a3e8a5 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskState.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum TaskState. + */ +public enum TaskState { + + IDLE("Idle"), + + CANCELLING("Cancelling"), + + RUNNING("Running"); + + private String value; + + TaskState(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TaskState fromValue(String value) { + for (TaskState b : TaskState.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskTriggerInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskTriggerInfo.java new file mode 100644 index 0000000000000..03e9b6d60ced7 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TaskTriggerInfo.java @@ -0,0 +1,355 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class TaskTriggerInfo. + */ +@JsonPropertyOrder({ TaskTriggerInfo.JSON_PROPERTY_TYPE, TaskTriggerInfo.JSON_PROPERTY_TIME_OF_DAY_TICKS, + TaskTriggerInfo.JSON_PROPERTY_INTERVAL_TICKS, TaskTriggerInfo.JSON_PROPERTY_DAY_OF_WEEK, + TaskTriggerInfo.JSON_PROPERTY_MAX_RUNTIME_TICKS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TaskTriggerInfo { + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_TIME_OF_DAY_TICKS = "TimeOfDayTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long timeOfDayTicks; + + public static final String JSON_PROPERTY_INTERVAL_TICKS = "IntervalTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long intervalTicks; + + public static final String JSON_PROPERTY_DAY_OF_WEEK = "DayOfWeek"; + @org.eclipse.jdt.annotation.NonNull + private DayOfWeek dayOfWeek; + + public static final String JSON_PROPERTY_MAX_RUNTIME_TICKS = "MaxRuntimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long maxRuntimeTicks; + + public TaskTriggerInfo() { + } + + public TaskTriggerInfo type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Gets or sets the type. + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public TaskTriggerInfo timeOfDayTicks(@org.eclipse.jdt.annotation.NonNull Long timeOfDayTicks) { + this.timeOfDayTicks = timeOfDayTicks; + return this; + } + + /** + * Gets or sets the time of day. + * + * @return timeOfDayTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TIME_OF_DAY_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTimeOfDayTicks() { + return timeOfDayTicks; + } + + @JsonProperty(JSON_PROPERTY_TIME_OF_DAY_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimeOfDayTicks(@org.eclipse.jdt.annotation.NonNull Long timeOfDayTicks) { + this.timeOfDayTicks = timeOfDayTicks; + } + + public TaskTriggerInfo intervalTicks(@org.eclipse.jdt.annotation.NonNull Long intervalTicks) { + this.intervalTicks = intervalTicks; + return this; + } + + /** + * Gets or sets the interval. + * + * @return intervalTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INTERVAL_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getIntervalTicks() { + return intervalTicks; + } + + @JsonProperty(JSON_PROPERTY_INTERVAL_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIntervalTicks(@org.eclipse.jdt.annotation.NonNull Long intervalTicks) { + this.intervalTicks = intervalTicks; + } + + public TaskTriggerInfo dayOfWeek(@org.eclipse.jdt.annotation.NonNull DayOfWeek dayOfWeek) { + this.dayOfWeek = dayOfWeek; + return this; + } + + /** + * Gets or sets the day of week. + * + * @return dayOfWeek + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DAY_OF_WEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DayOfWeek getDayOfWeek() { + return dayOfWeek; + } + + @JsonProperty(JSON_PROPERTY_DAY_OF_WEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDayOfWeek(@org.eclipse.jdt.annotation.NonNull DayOfWeek dayOfWeek) { + this.dayOfWeek = dayOfWeek; + } + + public TaskTriggerInfo maxRuntimeTicks(@org.eclipse.jdt.annotation.NonNull Long maxRuntimeTicks) { + this.maxRuntimeTicks = maxRuntimeTicks; + return this; + } + + /** + * Gets or sets the maximum runtime ticks. + * + * @return maxRuntimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_RUNTIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getMaxRuntimeTicks() { + return maxRuntimeTicks; + } + + @JsonProperty(JSON_PROPERTY_MAX_RUNTIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxRuntimeTicks(@org.eclipse.jdt.annotation.NonNull Long maxRuntimeTicks) { + this.maxRuntimeTicks = maxRuntimeTicks; + } + + /** + * Return true if this TaskTriggerInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TaskTriggerInfo taskTriggerInfo = (TaskTriggerInfo) o; + return Objects.equals(this.type, taskTriggerInfo.type) + && Objects.equals(this.timeOfDayTicks, taskTriggerInfo.timeOfDayTicks) + && Objects.equals(this.intervalTicks, taskTriggerInfo.intervalTicks) + && Objects.equals(this.dayOfWeek, taskTriggerInfo.dayOfWeek) + && Objects.equals(this.maxRuntimeTicks, taskTriggerInfo.maxRuntimeTicks); + } + + @Override + public int hashCode() { + return Objects.hash(type, timeOfDayTicks, intervalTicks, dayOfWeek, maxRuntimeTicks); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TaskTriggerInfo {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" timeOfDayTicks: ").append(toIndentedString(timeOfDayTicks)).append("\n"); + sb.append(" intervalTicks: ").append(toIndentedString(intervalTicks)).append("\n"); + sb.append(" dayOfWeek: ").append(toIndentedString(dayOfWeek)).append("\n"); + sb.append(" maxRuntimeTicks: ").append(toIndentedString(maxRuntimeTicks)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `TimeOfDayTicks` to the URL query string + if (getTimeOfDayTicks() != null) { + joiner.add(String.format("%sTimeOfDayTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTimeOfDayTicks())))); + } + + // add `IntervalTicks` to the URL query string + if (getIntervalTicks() != null) { + joiner.add(String.format("%sIntervalTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIntervalTicks())))); + } + + // add `DayOfWeek` to the URL query string + if (getDayOfWeek() != null) { + joiner.add(String.format("%sDayOfWeek%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDayOfWeek())))); + } + + // add `MaxRuntimeTicks` to the URL query string + if (getMaxRuntimeTicks() != null) { + joiner.add(String.format("%sMaxRuntimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxRuntimeTicks())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TaskTriggerInfo instance; + + public Builder() { + this(new TaskTriggerInfo()); + } + + protected Builder(TaskTriggerInfo instance) { + this.instance = instance; + } + + public TaskTriggerInfo.Builder type(String type) { + this.instance.type = type; + return this; + } + + public TaskTriggerInfo.Builder timeOfDayTicks(Long timeOfDayTicks) { + this.instance.timeOfDayTicks = timeOfDayTicks; + return this; + } + + public TaskTriggerInfo.Builder intervalTicks(Long intervalTicks) { + this.instance.intervalTicks = intervalTicks; + return this; + } + + public TaskTriggerInfo.Builder dayOfWeek(DayOfWeek dayOfWeek) { + this.instance.dayOfWeek = dayOfWeek; + return this; + } + + public TaskTriggerInfo.Builder maxRuntimeTicks(Long maxRuntimeTicks) { + this.instance.maxRuntimeTicks = maxRuntimeTicks; + return this; + } + + /** + * returns a built TaskTriggerInfo instance. + * + * The builder is not reusable. + */ + public TaskTriggerInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TaskTriggerInfo.Builder builder() { + return new TaskTriggerInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TaskTriggerInfo.Builder toBuilder() { + return new TaskTriggerInfo.Builder().type(getType()).timeOfDayTicks(getTimeOfDayTicks()) + .intervalTicks(getIntervalTicks()).dayOfWeek(getDayOfWeek()).maxRuntimeTicks(getMaxRuntimeTicks()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ThemeMediaResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ThemeMediaResult.java new file mode 100644 index 0000000000000..49f10aedc5b9a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ThemeMediaResult.java @@ -0,0 +1,329 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class ThemeMediaResult. + */ +@JsonPropertyOrder({ ThemeMediaResult.JSON_PROPERTY_ITEMS, ThemeMediaResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, + ThemeMediaResult.JSON_PROPERTY_START_INDEX, ThemeMediaResult.JSON_PROPERTY_OWNER_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ThemeMediaResult { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items; + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public static final String JSON_PROPERTY_OWNER_ID = "OwnerId"; + @org.eclipse.jdt.annotation.NonNull + private UUID ownerId; + + public ThemeMediaResult() { + } + + public ThemeMediaResult items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public ThemeMediaResult addItemsItem(BaseItemDto itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Gets or sets the items. + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public ThemeMediaResult totalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total number of records available. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public ThemeMediaResult startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the index of the first record in Items. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + public ThemeMediaResult ownerId(@org.eclipse.jdt.annotation.NonNull UUID ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Gets or sets the owner id. + * + * @return ownerId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OWNER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getOwnerId() { + return ownerId; + } + + @JsonProperty(JSON_PROPERTY_OWNER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOwnerId(@org.eclipse.jdt.annotation.NonNull UUID ownerId) { + this.ownerId = ownerId; + } + + /** + * Return true if this ThemeMediaResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ThemeMediaResult themeMediaResult = (ThemeMediaResult) o; + return Objects.equals(this.items, themeMediaResult.items) + && Objects.equals(this.totalRecordCount, themeMediaResult.totalRecordCount) + && Objects.equals(this.startIndex, themeMediaResult.startIndex) + && Objects.equals(this.ownerId, themeMediaResult.ownerId); + } + + @Override + public int hashCode() { + return Objects.hash(items, totalRecordCount, startIndex, ownerId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ThemeMediaResult {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + // add `OwnerId` to the URL query string + if (getOwnerId() != null) { + joiner.add(String.format("%sOwnerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOwnerId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ThemeMediaResult instance; + + public Builder() { + this(new ThemeMediaResult()); + } + + protected Builder(ThemeMediaResult instance) { + this.instance = instance; + } + + public ThemeMediaResult.Builder items(List items) { + this.instance.items = items; + return this; + } + + public ThemeMediaResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public ThemeMediaResult.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + public ThemeMediaResult.Builder ownerId(UUID ownerId) { + this.instance.ownerId = ownerId; + return this; + } + + /** + * returns a built ThemeMediaResult instance. + * + * The builder is not reusable. + */ + public ThemeMediaResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ThemeMediaResult.Builder builder() { + return new ThemeMediaResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ThemeMediaResult.Builder toBuilder() { + return new ThemeMediaResult.Builder().items(getItems()).totalRecordCount(getTotalRecordCount()) + .startIndex(getStartIndex()).ownerId(getOwnerId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TimerEventInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TimerEventInfo.java new file mode 100644 index 0000000000000..c8086985bc5c9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TimerEventInfo.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TimerEventInfo + */ +@JsonPropertyOrder({ TimerEventInfo.JSON_PROPERTY_ID, TimerEventInfo.JSON_PROPERTY_PROGRAM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TimerEventInfo { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_PROGRAM_ID = "ProgramId"; + @org.eclipse.jdt.annotation.NonNull + private UUID programId; + + public TimerEventInfo() { + } + + public TimerEventInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public TimerEventInfo programId(@org.eclipse.jdt.annotation.NonNull UUID programId) { + this.programId = programId; + return this; + } + + /** + * Get programId + * + * @return programId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getProgramId() { + return programId; + } + + @JsonProperty(JSON_PROPERTY_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgramId(@org.eclipse.jdt.annotation.NonNull UUID programId) { + this.programId = programId; + } + + /** + * Return true if this TimerEventInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimerEventInfo timerEventInfo = (TimerEventInfo) o; + return Objects.equals(this.id, timerEventInfo.id) && Objects.equals(this.programId, timerEventInfo.programId); + } + + @Override + public int hashCode() { + return Objects.hash(id, programId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimerEventInfo {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" programId: ").append(toIndentedString(programId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `ProgramId` to the URL query string + if (getProgramId() != null) { + joiner.add(String.format("%sProgramId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProgramId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TimerEventInfo instance; + + public Builder() { + this(new TimerEventInfo()); + } + + protected Builder(TimerEventInfo instance) { + this.instance = instance; + } + + public TimerEventInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public TimerEventInfo.Builder programId(UUID programId) { + this.instance.programId = programId; + return this; + } + + /** + * returns a built TimerEventInfo instance. + * + * The builder is not reusable. + */ + public TimerEventInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TimerEventInfo.Builder builder() { + return new TimerEventInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TimerEventInfo.Builder toBuilder() { + return new TimerEventInfo.Builder().id(getId()).programId(getProgramId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TimerInfoDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TimerInfoDto.java new file mode 100644 index 0000000000000..165ddb071e013 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TimerInfoDto.java @@ -0,0 +1,1312 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TimerInfoDto + */ +@JsonPropertyOrder({ TimerInfoDto.JSON_PROPERTY_ID, TimerInfoDto.JSON_PROPERTY_TYPE, + TimerInfoDto.JSON_PROPERTY_SERVER_ID, TimerInfoDto.JSON_PROPERTY_EXTERNAL_ID, + TimerInfoDto.JSON_PROPERTY_CHANNEL_ID, TimerInfoDto.JSON_PROPERTY_EXTERNAL_CHANNEL_ID, + TimerInfoDto.JSON_PROPERTY_CHANNEL_NAME, TimerInfoDto.JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG, + TimerInfoDto.JSON_PROPERTY_PROGRAM_ID, TimerInfoDto.JSON_PROPERTY_EXTERNAL_PROGRAM_ID, + TimerInfoDto.JSON_PROPERTY_NAME, TimerInfoDto.JSON_PROPERTY_OVERVIEW, TimerInfoDto.JSON_PROPERTY_START_DATE, + TimerInfoDto.JSON_PROPERTY_END_DATE, TimerInfoDto.JSON_PROPERTY_SERVICE_NAME, + TimerInfoDto.JSON_PROPERTY_PRIORITY, TimerInfoDto.JSON_PROPERTY_PRE_PADDING_SECONDS, + TimerInfoDto.JSON_PROPERTY_POST_PADDING_SECONDS, TimerInfoDto.JSON_PROPERTY_IS_PRE_PADDING_REQUIRED, + TimerInfoDto.JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID, TimerInfoDto.JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS, + TimerInfoDto.JSON_PROPERTY_IS_POST_PADDING_REQUIRED, TimerInfoDto.JSON_PROPERTY_KEEP_UNTIL, + TimerInfoDto.JSON_PROPERTY_STATUS, TimerInfoDto.JSON_PROPERTY_SERIES_TIMER_ID, + TimerInfoDto.JSON_PROPERTY_EXTERNAL_SERIES_TIMER_ID, TimerInfoDto.JSON_PROPERTY_RUN_TIME_TICKS, + TimerInfoDto.JSON_PROPERTY_PROGRAM_INFO }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TimerInfoDto { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_SERVER_ID = "ServerId"; + @org.eclipse.jdt.annotation.NonNull + private String serverId; + + public static final String JSON_PROPERTY_EXTERNAL_ID = "ExternalId"; + @org.eclipse.jdt.annotation.NonNull + private String externalId; + + public static final String JSON_PROPERTY_CHANNEL_ID = "ChannelId"; + @org.eclipse.jdt.annotation.NonNull + private UUID channelId; + + public static final String JSON_PROPERTY_EXTERNAL_CHANNEL_ID = "ExternalChannelId"; + @org.eclipse.jdt.annotation.NonNull + private String externalChannelId; + + public static final String JSON_PROPERTY_CHANNEL_NAME = "ChannelName"; + @org.eclipse.jdt.annotation.NonNull + private String channelName; + + public static final String JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG = "ChannelPrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String channelPrimaryImageTag; + + public static final String JSON_PROPERTY_PROGRAM_ID = "ProgramId"; + @org.eclipse.jdt.annotation.NonNull + private String programId; + + public static final String JSON_PROPERTY_EXTERNAL_PROGRAM_ID = "ExternalProgramId"; + @org.eclipse.jdt.annotation.NonNull + private String externalProgramId; + + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_OVERVIEW = "Overview"; + @org.eclipse.jdt.annotation.NonNull + private String overview; + + public static final String JSON_PROPERTY_START_DATE = "StartDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime startDate; + + public static final String JSON_PROPERTY_END_DATE = "EndDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime endDate; + + public static final String JSON_PROPERTY_SERVICE_NAME = "ServiceName"; + @org.eclipse.jdt.annotation.NonNull + private String serviceName; + + public static final String JSON_PROPERTY_PRIORITY = "Priority"; + @org.eclipse.jdt.annotation.NonNull + private Integer priority; + + public static final String JSON_PROPERTY_PRE_PADDING_SECONDS = "PrePaddingSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer prePaddingSeconds; + + public static final String JSON_PROPERTY_POST_PADDING_SECONDS = "PostPaddingSeconds"; + @org.eclipse.jdt.annotation.NonNull + private Integer postPaddingSeconds; + + public static final String JSON_PROPERTY_IS_PRE_PADDING_REQUIRED = "IsPrePaddingRequired"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPrePaddingRequired; + + public static final String JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID = "ParentBackdropItemId"; + @org.eclipse.jdt.annotation.NonNull + private String parentBackdropItemId; + + public static final String JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS = "ParentBackdropImageTags"; + @org.eclipse.jdt.annotation.NonNull + private List parentBackdropImageTags; + + public static final String JSON_PROPERTY_IS_POST_PADDING_REQUIRED = "IsPostPaddingRequired"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isPostPaddingRequired; + + public static final String JSON_PROPERTY_KEEP_UNTIL = "KeepUntil"; + @org.eclipse.jdt.annotation.NonNull + private KeepUntil keepUntil; + + public static final String JSON_PROPERTY_STATUS = "Status"; + @org.eclipse.jdt.annotation.NonNull + private RecordingStatus status; + + public static final String JSON_PROPERTY_SERIES_TIMER_ID = "SeriesTimerId"; + @org.eclipse.jdt.annotation.NonNull + private String seriesTimerId; + + public static final String JSON_PROPERTY_EXTERNAL_SERIES_TIMER_ID = "ExternalSeriesTimerId"; + @org.eclipse.jdt.annotation.NonNull + private String externalSeriesTimerId; + + public static final String JSON_PROPERTY_RUN_TIME_TICKS = "RunTimeTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long runTimeTicks; + + public static final String JSON_PROPERTY_PROGRAM_INFO = "ProgramInfo"; + @org.eclipse.jdt.annotation.NonNull + private BaseItemDto programInfo; + + public TimerInfoDto() { + } + + public TimerInfoDto id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Gets or sets the Id of the recording. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public TimerInfoDto type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public TimerInfoDto serverId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + return this; + } + + /** + * Gets or sets the server identifier. + * + * @return serverId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerId() { + return serverId; + } + + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + } + + public TimerInfoDto externalId(@org.eclipse.jdt.annotation.NonNull String externalId) { + this.externalId = externalId; + return this; + } + + /** + * Gets or sets the external identifier. + * + * @return externalId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExternalId() { + return externalId; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalId(@org.eclipse.jdt.annotation.NonNull String externalId) { + this.externalId = externalId; + } + + public TimerInfoDto channelId(@org.eclipse.jdt.annotation.NonNull UUID channelId) { + this.channelId = channelId; + return this; + } + + /** + * Gets or sets the channel id of the recording. + * + * @return channelId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getChannelId() { + return channelId; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelId(@org.eclipse.jdt.annotation.NonNull UUID channelId) { + this.channelId = channelId; + } + + public TimerInfoDto externalChannelId(@org.eclipse.jdt.annotation.NonNull String externalChannelId) { + this.externalChannelId = externalChannelId; + return this; + } + + /** + * Gets or sets the external channel identifier. + * + * @return externalChannelId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExternalChannelId() { + return externalChannelId; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalChannelId(@org.eclipse.jdt.annotation.NonNull String externalChannelId) { + this.externalChannelId = externalChannelId; + } + + public TimerInfoDto channelName(@org.eclipse.jdt.annotation.NonNull String channelName) { + this.channelName = channelName; + return this; + } + + /** + * Gets or sets the channel name of the recording. + * + * @return channelName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelName() { + return channelName; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelName(@org.eclipse.jdt.annotation.NonNull String channelName) { + this.channelName = channelName; + } + + public TimerInfoDto channelPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String channelPrimaryImageTag) { + this.channelPrimaryImageTag = channelPrimaryImageTag; + return this; + } + + /** + * Get channelPrimaryImageTag + * + * @return channelPrimaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelPrimaryImageTag() { + return channelPrimaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_CHANNEL_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChannelPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String channelPrimaryImageTag) { + this.channelPrimaryImageTag = channelPrimaryImageTag; + } + + public TimerInfoDto programId(@org.eclipse.jdt.annotation.NonNull String programId) { + this.programId = programId; + return this; + } + + /** + * Gets or sets the program identifier. + * + * @return programId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProgramId() { + return programId; + } + + @JsonProperty(JSON_PROPERTY_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgramId(@org.eclipse.jdt.annotation.NonNull String programId) { + this.programId = programId; + } + + public TimerInfoDto externalProgramId(@org.eclipse.jdt.annotation.NonNull String externalProgramId) { + this.externalProgramId = externalProgramId; + return this; + } + + /** + * Gets or sets the external program identifier. + * + * @return externalProgramId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExternalProgramId() { + return externalProgramId; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_PROGRAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalProgramId(@org.eclipse.jdt.annotation.NonNull String externalProgramId) { + this.externalProgramId = externalProgramId; + } + + public TimerInfoDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name of the recording. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public TimerInfoDto overview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + return this; + } + + /** + * Gets or sets the description of the recording. + * + * @return overview + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOverview() { + return overview; + } + + @JsonProperty(JSON_PROPERTY_OVERVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOverview(@org.eclipse.jdt.annotation.NonNull String overview) { + this.overview = overview; + } + + public TimerInfoDto startDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Gets or sets the start date of the recording, in UTC. + * + * @return startDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartDate() { + return startDate; + } + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime startDate) { + this.startDate = startDate; + } + + public TimerInfoDto endDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Gets or sets the end date of the recording, in UTC. + * + * @return endDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndDate() { + return endDate; + } + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime endDate) { + this.endDate = endDate; + } + + public TimerInfoDto serviceName(@org.eclipse.jdt.annotation.NonNull String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Gets or sets the name of the service. + * + * @return serviceName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServiceName() { + return serviceName; + } + + @JsonProperty(JSON_PROPERTY_SERVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServiceName(@org.eclipse.jdt.annotation.NonNull String serviceName) { + this.serviceName = serviceName; + } + + public TimerInfoDto priority(@org.eclipse.jdt.annotation.NonNull Integer priority) { + this.priority = priority; + return this; + } + + /** + * Gets or sets the priority. + * + * @return priority + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPriority() { + return priority; + } + + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPriority(@org.eclipse.jdt.annotation.NonNull Integer priority) { + this.priority = priority; + } + + public TimerInfoDto prePaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer prePaddingSeconds) { + this.prePaddingSeconds = prePaddingSeconds; + return this; + } + + /** + * Gets or sets the pre padding seconds. + * + * @return prePaddingSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRE_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrePaddingSeconds() { + return prePaddingSeconds; + } + + @JsonProperty(JSON_PROPERTY_PRE_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrePaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer prePaddingSeconds) { + this.prePaddingSeconds = prePaddingSeconds; + } + + public TimerInfoDto postPaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer postPaddingSeconds) { + this.postPaddingSeconds = postPaddingSeconds; + return this; + } + + /** + * Gets or sets the post padding seconds. + * + * @return postPaddingSeconds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POST_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPostPaddingSeconds() { + return postPaddingSeconds; + } + + @JsonProperty(JSON_PROPERTY_POST_PADDING_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPostPaddingSeconds(@org.eclipse.jdt.annotation.NonNull Integer postPaddingSeconds) { + this.postPaddingSeconds = postPaddingSeconds; + } + + public TimerInfoDto isPrePaddingRequired(@org.eclipse.jdt.annotation.NonNull Boolean isPrePaddingRequired) { + this.isPrePaddingRequired = isPrePaddingRequired; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is pre padding required. + * + * @return isPrePaddingRequired + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_PRE_PADDING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPrePaddingRequired() { + return isPrePaddingRequired; + } + + @JsonProperty(JSON_PROPERTY_IS_PRE_PADDING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPrePaddingRequired(@org.eclipse.jdt.annotation.NonNull Boolean isPrePaddingRequired) { + this.isPrePaddingRequired = isPrePaddingRequired; + } + + public TimerInfoDto parentBackdropItemId(@org.eclipse.jdt.annotation.NonNull String parentBackdropItemId) { + this.parentBackdropItemId = parentBackdropItemId; + return this; + } + + /** + * Gets or sets the Id of the Parent that has a backdrop if the item does not have one. + * + * @return parentBackdropItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getParentBackdropItemId() { + return parentBackdropItemId; + } + + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentBackdropItemId(@org.eclipse.jdt.annotation.NonNull String parentBackdropItemId) { + this.parentBackdropItemId = parentBackdropItemId; + } + + public TimerInfoDto parentBackdropImageTags( + @org.eclipse.jdt.annotation.NonNull List parentBackdropImageTags) { + this.parentBackdropImageTags = parentBackdropImageTags; + return this; + } + + public TimerInfoDto addParentBackdropImageTagsItem(String parentBackdropImageTagsItem) { + if (this.parentBackdropImageTags == null) { + this.parentBackdropImageTags = new ArrayList<>(); + } + this.parentBackdropImageTags.add(parentBackdropImageTagsItem); + return this; + } + + /** + * Gets or sets the parent backdrop image tags. + * + * @return parentBackdropImageTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getParentBackdropImageTags() { + return parentBackdropImageTags; + } + + @JsonProperty(JSON_PROPERTY_PARENT_BACKDROP_IMAGE_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentBackdropImageTags(@org.eclipse.jdt.annotation.NonNull List parentBackdropImageTags) { + this.parentBackdropImageTags = parentBackdropImageTags; + } + + public TimerInfoDto isPostPaddingRequired(@org.eclipse.jdt.annotation.NonNull Boolean isPostPaddingRequired) { + this.isPostPaddingRequired = isPostPaddingRequired; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is post padding required. + * + * @return isPostPaddingRequired + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_POST_PADDING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPostPaddingRequired() { + return isPostPaddingRequired; + } + + @JsonProperty(JSON_PROPERTY_IS_POST_PADDING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPostPaddingRequired(@org.eclipse.jdt.annotation.NonNull Boolean isPostPaddingRequired) { + this.isPostPaddingRequired = isPostPaddingRequired; + } + + public TimerInfoDto keepUntil(@org.eclipse.jdt.annotation.NonNull KeepUntil keepUntil) { + this.keepUntil = keepUntil; + return this; + } + + /** + * Get keepUntil + * + * @return keepUntil + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KEEP_UNTIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public KeepUntil getKeepUntil() { + return keepUntil; + } + + @JsonProperty(JSON_PROPERTY_KEEP_UNTIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKeepUntil(@org.eclipse.jdt.annotation.NonNull KeepUntil keepUntil) { + this.keepUntil = keepUntil; + } + + public TimerInfoDto status(@org.eclipse.jdt.annotation.NonNull RecordingStatus status) { + this.status = status; + return this; + } + + /** + * Gets or sets the status. + * + * @return status + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RecordingStatus getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@org.eclipse.jdt.annotation.NonNull RecordingStatus status) { + this.status = status; + } + + public TimerInfoDto seriesTimerId(@org.eclipse.jdt.annotation.NonNull String seriesTimerId) { + this.seriesTimerId = seriesTimerId; + return this; + } + + /** + * Gets or sets the series timer identifier. + * + * @return seriesTimerId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERIES_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeriesTimerId() { + return seriesTimerId; + } + + @JsonProperty(JSON_PROPERTY_SERIES_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeriesTimerId(@org.eclipse.jdt.annotation.NonNull String seriesTimerId) { + this.seriesTimerId = seriesTimerId; + } + + public TimerInfoDto externalSeriesTimerId(@org.eclipse.jdt.annotation.NonNull String externalSeriesTimerId) { + this.externalSeriesTimerId = externalSeriesTimerId; + return this; + } + + /** + * Gets or sets the external series timer identifier. + * + * @return externalSeriesTimerId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_EXTERNAL_SERIES_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExternalSeriesTimerId() { + return externalSeriesTimerId; + } + + @JsonProperty(JSON_PROPERTY_EXTERNAL_SERIES_TIMER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalSeriesTimerId(@org.eclipse.jdt.annotation.NonNull String externalSeriesTimerId) { + this.externalSeriesTimerId = externalSeriesTimerId; + } + + public TimerInfoDto runTimeTicks(@org.eclipse.jdt.annotation.NonNull Long runTimeTicks) { + this.runTimeTicks = runTimeTicks; + return this; + } + + /** + * Gets or sets the run time ticks. + * + * @return runTimeTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getRunTimeTicks() { + return runTimeTicks; + } + + @JsonProperty(JSON_PROPERTY_RUN_TIME_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRunTimeTicks(@org.eclipse.jdt.annotation.NonNull Long runTimeTicks) { + this.runTimeTicks = runTimeTicks; + } + + public TimerInfoDto programInfo(@org.eclipse.jdt.annotation.NonNull BaseItemDto programInfo) { + this.programInfo = programInfo; + return this; + } + + /** + * Gets or sets the program information. + * + * @return programInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROGRAM_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BaseItemDto getProgramInfo() { + return programInfo; + } + + @JsonProperty(JSON_PROPERTY_PROGRAM_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgramInfo(@org.eclipse.jdt.annotation.NonNull BaseItemDto programInfo) { + this.programInfo = programInfo; + } + + /** + * Return true if this TimerInfoDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimerInfoDto timerInfoDto = (TimerInfoDto) o; + return Objects.equals(this.id, timerInfoDto.id) && Objects.equals(this.type, timerInfoDto.type) + && Objects.equals(this.serverId, timerInfoDto.serverId) + && Objects.equals(this.externalId, timerInfoDto.externalId) + && Objects.equals(this.channelId, timerInfoDto.channelId) + && Objects.equals(this.externalChannelId, timerInfoDto.externalChannelId) + && Objects.equals(this.channelName, timerInfoDto.channelName) + && Objects.equals(this.channelPrimaryImageTag, timerInfoDto.channelPrimaryImageTag) + && Objects.equals(this.programId, timerInfoDto.programId) + && Objects.equals(this.externalProgramId, timerInfoDto.externalProgramId) + && Objects.equals(this.name, timerInfoDto.name) && Objects.equals(this.overview, timerInfoDto.overview) + && Objects.equals(this.startDate, timerInfoDto.startDate) + && Objects.equals(this.endDate, timerInfoDto.endDate) + && Objects.equals(this.serviceName, timerInfoDto.serviceName) + && Objects.equals(this.priority, timerInfoDto.priority) + && Objects.equals(this.prePaddingSeconds, timerInfoDto.prePaddingSeconds) + && Objects.equals(this.postPaddingSeconds, timerInfoDto.postPaddingSeconds) + && Objects.equals(this.isPrePaddingRequired, timerInfoDto.isPrePaddingRequired) + && Objects.equals(this.parentBackdropItemId, timerInfoDto.parentBackdropItemId) + && Objects.equals(this.parentBackdropImageTags, timerInfoDto.parentBackdropImageTags) + && Objects.equals(this.isPostPaddingRequired, timerInfoDto.isPostPaddingRequired) + && Objects.equals(this.keepUntil, timerInfoDto.keepUntil) + && Objects.equals(this.status, timerInfoDto.status) + && Objects.equals(this.seriesTimerId, timerInfoDto.seriesTimerId) + && Objects.equals(this.externalSeriesTimerId, timerInfoDto.externalSeriesTimerId) + && Objects.equals(this.runTimeTicks, timerInfoDto.runTimeTicks) + && Objects.equals(this.programInfo, timerInfoDto.programInfo); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, serverId, externalId, channelId, externalChannelId, channelName, + channelPrimaryImageTag, programId, externalProgramId, name, overview, startDate, endDate, serviceName, + priority, prePaddingSeconds, postPaddingSeconds, isPrePaddingRequired, parentBackdropItemId, + parentBackdropImageTags, isPostPaddingRequired, keepUntil, status, seriesTimerId, externalSeriesTimerId, + runTimeTicks, programInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimerInfoDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n"); + sb.append(" channelId: ").append(toIndentedString(channelId)).append("\n"); + sb.append(" externalChannelId: ").append(toIndentedString(externalChannelId)).append("\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" channelPrimaryImageTag: ").append(toIndentedString(channelPrimaryImageTag)).append("\n"); + sb.append(" programId: ").append(toIndentedString(programId)).append("\n"); + sb.append(" externalProgramId: ").append(toIndentedString(externalProgramId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" overview: ").append(toIndentedString(overview)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" serviceName: ").append(toIndentedString(serviceName)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" prePaddingSeconds: ").append(toIndentedString(prePaddingSeconds)).append("\n"); + sb.append(" postPaddingSeconds: ").append(toIndentedString(postPaddingSeconds)).append("\n"); + sb.append(" isPrePaddingRequired: ").append(toIndentedString(isPrePaddingRequired)).append("\n"); + sb.append(" parentBackdropItemId: ").append(toIndentedString(parentBackdropItemId)).append("\n"); + sb.append(" parentBackdropImageTags: ").append(toIndentedString(parentBackdropImageTags)).append("\n"); + sb.append(" isPostPaddingRequired: ").append(toIndentedString(isPostPaddingRequired)).append("\n"); + sb.append(" keepUntil: ").append(toIndentedString(keepUntil)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" seriesTimerId: ").append(toIndentedString(seriesTimerId)).append("\n"); + sb.append(" externalSeriesTimerId: ").append(toIndentedString(externalSeriesTimerId)).append("\n"); + sb.append(" runTimeTicks: ").append(toIndentedString(runTimeTicks)).append("\n"); + sb.append(" programInfo: ").append(toIndentedString(programInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `ServerId` to the URL query string + if (getServerId() != null) { + joiner.add(String.format("%sServerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerId())))); + } + + // add `ExternalId` to the URL query string + if (getExternalId() != null) { + joiner.add(String.format("%sExternalId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExternalId())))); + } + + // add `ChannelId` to the URL query string + if (getChannelId() != null) { + joiner.add(String.format("%sChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelId())))); + } + + // add `ExternalChannelId` to the URL query string + if (getExternalChannelId() != null) { + joiner.add(String.format("%sExternalChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExternalChannelId())))); + } + + // add `ChannelName` to the URL query string + if (getChannelName() != null) { + joiner.add(String.format("%sChannelName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelName())))); + } + + // add `ChannelPrimaryImageTag` to the URL query string + if (getChannelPrimaryImageTag() != null) { + joiner.add(String.format("%sChannelPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChannelPrimaryImageTag())))); + } + + // add `ProgramId` to the URL query string + if (getProgramId() != null) { + joiner.add(String.format("%sProgramId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProgramId())))); + } + + // add `ExternalProgramId` to the URL query string + if (getExternalProgramId() != null) { + joiner.add(String.format("%sExternalProgramId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExternalProgramId())))); + } + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Overview` to the URL query string + if (getOverview() != null) { + joiner.add(String.format("%sOverview%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOverview())))); + } + + // add `StartDate` to the URL query string + if (getStartDate() != null) { + joiner.add(String.format("%sStartDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartDate())))); + } + + // add `EndDate` to the URL query string + if (getEndDate() != null) { + joiner.add(String.format("%sEndDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEndDate())))); + } + + // add `ServiceName` to the URL query string + if (getServiceName() != null) { + joiner.add(String.format("%sServiceName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServiceName())))); + } + + // add `Priority` to the URL query string + if (getPriority() != null) { + joiner.add(String.format("%sPriority%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPriority())))); + } + + // add `PrePaddingSeconds` to the URL query string + if (getPrePaddingSeconds() != null) { + joiner.add(String.format("%sPrePaddingSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrePaddingSeconds())))); + } + + // add `PostPaddingSeconds` to the URL query string + if (getPostPaddingSeconds() != null) { + joiner.add(String.format("%sPostPaddingSeconds%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPostPaddingSeconds())))); + } + + // add `IsPrePaddingRequired` to the URL query string + if (getIsPrePaddingRequired() != null) { + joiner.add(String.format("%sIsPrePaddingRequired%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPrePaddingRequired())))); + } + + // add `ParentBackdropItemId` to the URL query string + if (getParentBackdropItemId() != null) { + joiner.add(String.format("%sParentBackdropItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentBackdropItemId())))); + } + + // add `ParentBackdropImageTags` to the URL query string + if (getParentBackdropImageTags() != null) { + for (int i = 0; i < getParentBackdropImageTags().size(); i++) { + joiner.add(String.format("%sParentBackdropImageTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getParentBackdropImageTags().get(i))))); + } + } + + // add `IsPostPaddingRequired` to the URL query string + if (getIsPostPaddingRequired() != null) { + joiner.add(String.format("%sIsPostPaddingRequired%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsPostPaddingRequired())))); + } + + // add `KeepUntil` to the URL query string + if (getKeepUntil() != null) { + joiner.add(String.format("%sKeepUntil%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getKeepUntil())))); + } + + // add `Status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sStatus%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `SeriesTimerId` to the URL query string + if (getSeriesTimerId() != null) { + joiner.add(String.format("%sSeriesTimerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSeriesTimerId())))); + } + + // add `ExternalSeriesTimerId` to the URL query string + if (getExternalSeriesTimerId() != null) { + joiner.add(String.format("%sExternalSeriesTimerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getExternalSeriesTimerId())))); + } + + // add `RunTimeTicks` to the URL query string + if (getRunTimeTicks() != null) { + joiner.add(String.format("%sRunTimeTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRunTimeTicks())))); + } + + // add `ProgramInfo` to the URL query string + if (getProgramInfo() != null) { + joiner.add(getProgramInfo().toUrlQueryString(prefix + "ProgramInfo" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private TimerInfoDto instance; + + public Builder() { + this(new TimerInfoDto()); + } + + protected Builder(TimerInfoDto instance) { + this.instance = instance; + } + + public TimerInfoDto.Builder id(String id) { + this.instance.id = id; + return this; + } + + public TimerInfoDto.Builder type(String type) { + this.instance.type = type; + return this; + } + + public TimerInfoDto.Builder serverId(String serverId) { + this.instance.serverId = serverId; + return this; + } + + public TimerInfoDto.Builder externalId(String externalId) { + this.instance.externalId = externalId; + return this; + } + + public TimerInfoDto.Builder channelId(UUID channelId) { + this.instance.channelId = channelId; + return this; + } + + public TimerInfoDto.Builder externalChannelId(String externalChannelId) { + this.instance.externalChannelId = externalChannelId; + return this; + } + + public TimerInfoDto.Builder channelName(String channelName) { + this.instance.channelName = channelName; + return this; + } + + public TimerInfoDto.Builder channelPrimaryImageTag(String channelPrimaryImageTag) { + this.instance.channelPrimaryImageTag = channelPrimaryImageTag; + return this; + } + + public TimerInfoDto.Builder programId(String programId) { + this.instance.programId = programId; + return this; + } + + public TimerInfoDto.Builder externalProgramId(String externalProgramId) { + this.instance.externalProgramId = externalProgramId; + return this; + } + + public TimerInfoDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public TimerInfoDto.Builder overview(String overview) { + this.instance.overview = overview; + return this; + } + + public TimerInfoDto.Builder startDate(OffsetDateTime startDate) { + this.instance.startDate = startDate; + return this; + } + + public TimerInfoDto.Builder endDate(OffsetDateTime endDate) { + this.instance.endDate = endDate; + return this; + } + + public TimerInfoDto.Builder serviceName(String serviceName) { + this.instance.serviceName = serviceName; + return this; + } + + public TimerInfoDto.Builder priority(Integer priority) { + this.instance.priority = priority; + return this; + } + + public TimerInfoDto.Builder prePaddingSeconds(Integer prePaddingSeconds) { + this.instance.prePaddingSeconds = prePaddingSeconds; + return this; + } + + public TimerInfoDto.Builder postPaddingSeconds(Integer postPaddingSeconds) { + this.instance.postPaddingSeconds = postPaddingSeconds; + return this; + } + + public TimerInfoDto.Builder isPrePaddingRequired(Boolean isPrePaddingRequired) { + this.instance.isPrePaddingRequired = isPrePaddingRequired; + return this; + } + + public TimerInfoDto.Builder parentBackdropItemId(String parentBackdropItemId) { + this.instance.parentBackdropItemId = parentBackdropItemId; + return this; + } + + public TimerInfoDto.Builder parentBackdropImageTags(List parentBackdropImageTags) { + this.instance.parentBackdropImageTags = parentBackdropImageTags; + return this; + } + + public TimerInfoDto.Builder isPostPaddingRequired(Boolean isPostPaddingRequired) { + this.instance.isPostPaddingRequired = isPostPaddingRequired; + return this; + } + + public TimerInfoDto.Builder keepUntil(KeepUntil keepUntil) { + this.instance.keepUntil = keepUntil; + return this; + } + + public TimerInfoDto.Builder status(RecordingStatus status) { + this.instance.status = status; + return this; + } + + public TimerInfoDto.Builder seriesTimerId(String seriesTimerId) { + this.instance.seriesTimerId = seriesTimerId; + return this; + } + + public TimerInfoDto.Builder externalSeriesTimerId(String externalSeriesTimerId) { + this.instance.externalSeriesTimerId = externalSeriesTimerId; + return this; + } + + public TimerInfoDto.Builder runTimeTicks(Long runTimeTicks) { + this.instance.runTimeTicks = runTimeTicks; + return this; + } + + public TimerInfoDto.Builder programInfo(BaseItemDto programInfo) { + this.instance.programInfo = programInfo; + return this; + } + + /** + * returns a built TimerInfoDto instance. + * + * The builder is not reusable. + */ + public TimerInfoDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TimerInfoDto.Builder builder() { + return new TimerInfoDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TimerInfoDto.Builder toBuilder() { + return new TimerInfoDto.Builder().id(getId()).type(getType()).serverId(getServerId()) + .externalId(getExternalId()).channelId(getChannelId()).externalChannelId(getExternalChannelId()) + .channelName(getChannelName()).channelPrimaryImageTag(getChannelPrimaryImageTag()) + .programId(getProgramId()).externalProgramId(getExternalProgramId()).name(getName()) + .overview(getOverview()).startDate(getStartDate()).endDate(getEndDate()).serviceName(getServiceName()) + .priority(getPriority()).prePaddingSeconds(getPrePaddingSeconds()) + .postPaddingSeconds(getPostPaddingSeconds()).isPrePaddingRequired(getIsPrePaddingRequired()) + .parentBackdropItemId(getParentBackdropItemId()).parentBackdropImageTags(getParentBackdropImageTags()) + .isPostPaddingRequired(getIsPostPaddingRequired()).keepUntil(getKeepUntil()).status(getStatus()) + .seriesTimerId(getSeriesTimerId()).externalSeriesTimerId(getExternalSeriesTimerId()) + .runTimeTicks(getRunTimeTicks()).programInfo(getProgramInfo()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TimerInfoDtoQueryResult.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TimerInfoDtoQueryResult.java new file mode 100644 index 0000000000000..5c17d113c0f37 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TimerInfoDtoQueryResult.java @@ -0,0 +1,288 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TimerInfoDtoQueryResult + */ +@JsonPropertyOrder({ TimerInfoDtoQueryResult.JSON_PROPERTY_ITEMS, + TimerInfoDtoQueryResult.JSON_PROPERTY_TOTAL_RECORD_COUNT, TimerInfoDtoQueryResult.JSON_PROPERTY_START_INDEX }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TimerInfoDtoQueryResult { + public static final String JSON_PROPERTY_ITEMS = "Items"; + @org.eclipse.jdt.annotation.NonNull + private List items; + + public static final String JSON_PROPERTY_TOTAL_RECORD_COUNT = "TotalRecordCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer totalRecordCount; + + public static final String JSON_PROPERTY_START_INDEX = "StartIndex"; + @org.eclipse.jdt.annotation.NonNull + private Integer startIndex; + + public TimerInfoDtoQueryResult() { + } + + public TimerInfoDtoQueryResult items(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + return this; + } + + public TimerInfoDtoQueryResult addItemsItem(TimerInfoDto itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Gets or sets the items. + * + * @return items + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItems() { + return items; + } + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(@org.eclipse.jdt.annotation.NonNull List items) { + this.items = items; + } + + public TimerInfoDtoQueryResult totalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Gets or sets the total number of records available. + * + * @return totalRecordCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_RECORD_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRecordCount(@org.eclipse.jdt.annotation.NonNull Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + public TimerInfoDtoQueryResult startIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Gets or sets the index of the first record in Items. + * + * @return startIndex + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartIndex() { + return startIndex; + } + + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartIndex(@org.eclipse.jdt.annotation.NonNull Integer startIndex) { + this.startIndex = startIndex; + } + + /** + * Return true if this TimerInfoDtoQueryResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimerInfoDtoQueryResult timerInfoDtoQueryResult = (TimerInfoDtoQueryResult) o; + return Objects.equals(this.items, timerInfoDtoQueryResult.items) + && Objects.equals(this.totalRecordCount, timerInfoDtoQueryResult.totalRecordCount) + && Objects.equals(this.startIndex, timerInfoDtoQueryResult.startIndex); + } + + @Override + public int hashCode() { + return Objects.hash(items, totalRecordCount, startIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimerInfoDtoQueryResult {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sItems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `TotalRecordCount` to the URL query string + if (getTotalRecordCount() != null) { + joiner.add(String.format("%sTotalRecordCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTotalRecordCount())))); + } + + // add `StartIndex` to the URL query string + if (getStartIndex() != null) { + joiner.add(String.format("%sStartIndex%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getStartIndex())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TimerInfoDtoQueryResult instance; + + public Builder() { + this(new TimerInfoDtoQueryResult()); + } + + protected Builder(TimerInfoDtoQueryResult instance) { + this.instance = instance; + } + + public TimerInfoDtoQueryResult.Builder items(List items) { + this.instance.items = items; + return this; + } + + public TimerInfoDtoQueryResult.Builder totalRecordCount(Integer totalRecordCount) { + this.instance.totalRecordCount = totalRecordCount; + return this; + } + + public TimerInfoDtoQueryResult.Builder startIndex(Integer startIndex) { + this.instance.startIndex = startIndex; + return this; + } + + /** + * returns a built TimerInfoDtoQueryResult instance. + * + * The builder is not reusable. + */ + public TimerInfoDtoQueryResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TimerInfoDtoQueryResult.Builder builder() { + return new TimerInfoDtoQueryResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TimerInfoDtoQueryResult.Builder toBuilder() { + return new TimerInfoDtoQueryResult.Builder().items(getItems()).totalRecordCount(getTotalRecordCount()) + .startIndex(getStartIndex()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TrailerInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TrailerInfo.java new file mode 100644 index 0000000000000..ae40bfefe05c3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TrailerInfo.java @@ -0,0 +1,617 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TrailerInfo + */ +@JsonPropertyOrder({ TrailerInfo.JSON_PROPERTY_NAME, TrailerInfo.JSON_PROPERTY_ORIGINAL_TITLE, + TrailerInfo.JSON_PROPERTY_PATH, TrailerInfo.JSON_PROPERTY_METADATA_LANGUAGE, + TrailerInfo.JSON_PROPERTY_METADATA_COUNTRY_CODE, TrailerInfo.JSON_PROPERTY_PROVIDER_IDS, + TrailerInfo.JSON_PROPERTY_YEAR, TrailerInfo.JSON_PROPERTY_INDEX_NUMBER, + TrailerInfo.JSON_PROPERTY_PARENT_INDEX_NUMBER, TrailerInfo.JSON_PROPERTY_PREMIERE_DATE, + TrailerInfo.JSON_PROPERTY_IS_AUTOMATED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TrailerInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "OriginalTitle"; + @org.eclipse.jdt.annotation.NonNull + private String originalTitle; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_METADATA_LANGUAGE = "MetadataLanguage"; + @org.eclipse.jdt.annotation.NonNull + private String metadataLanguage; + + public static final String JSON_PROPERTY_METADATA_COUNTRY_CODE = "MetadataCountryCode"; + @org.eclipse.jdt.annotation.NonNull + private String metadataCountryCode; + + public static final String JSON_PROPERTY_PROVIDER_IDS = "ProviderIds"; + @org.eclipse.jdt.annotation.NonNull + private Map providerIds; + + public static final String JSON_PROPERTY_YEAR = "Year"; + @org.eclipse.jdt.annotation.NonNull + private Integer year; + + public static final String JSON_PROPERTY_INDEX_NUMBER = "IndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer indexNumber; + + public static final String JSON_PROPERTY_PARENT_INDEX_NUMBER = "ParentIndexNumber"; + @org.eclipse.jdt.annotation.NonNull + private Integer parentIndexNumber; + + public static final String JSON_PROPERTY_PREMIERE_DATE = "PremiereDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime premiereDate; + + public static final String JSON_PROPERTY_IS_AUTOMATED = "IsAutomated"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAutomated; + + public TrailerInfo() { + } + + public TrailerInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public TrailerInfo originalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Gets or sets the original title. + * + * @return originalTitle + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@org.eclipse.jdt.annotation.NonNull String originalTitle) { + this.originalTitle = originalTitle; + } + + public TrailerInfo path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public TrailerInfo metadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + return this; + } + + /** + * Gets or sets the metadata language. + * + * @return metadataLanguage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataLanguage() { + return metadataLanguage; + } + + @JsonProperty(JSON_PROPERTY_METADATA_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataLanguage(@org.eclipse.jdt.annotation.NonNull String metadataLanguage) { + this.metadataLanguage = metadataLanguage; + } + + public TrailerInfo metadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + return this; + } + + /** + * Gets or sets the metadata country code. + * + * @return metadataCountryCode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetadataCountryCode() { + return metadataCountryCode; + } + + @JsonProperty(JSON_PROPERTY_METADATA_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataCountryCode(@org.eclipse.jdt.annotation.NonNull String metadataCountryCode) { + this.metadataCountryCode = metadataCountryCode; + } + + public TrailerInfo providerIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + return this; + } + + public TrailerInfo putProviderIdsItem(String key, String providerIdsItem) { + if (this.providerIds == null) { + this.providerIds = new HashMap<>(); + } + this.providerIds.put(key, providerIdsItem); + return this; + } + + /** + * Gets or sets the provider ids. + * + * @return providerIds + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getProviderIds() { + return providerIds; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_IDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderIds(@org.eclipse.jdt.annotation.NonNull Map providerIds) { + this.providerIds = providerIds; + } + + public TrailerInfo year(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + return this; + } + + /** + * Gets or sets the year. + * + * @return year + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getYear() { + return year; + } + + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(@org.eclipse.jdt.annotation.NonNull Integer year) { + this.year = year; + } + + public TrailerInfo indexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + return this; + } + + /** + * Get indexNumber + * + * @return indexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndexNumber() { + return indexNumber; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer indexNumber) { + this.indexNumber = indexNumber; + } + + public TrailerInfo parentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + return this; + } + + /** + * Get parentIndexNumber + * + * @return parentIndexNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getParentIndexNumber() { + return parentIndexNumber; + } + + @JsonProperty(JSON_PROPERTY_PARENT_INDEX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentIndexNumber(@org.eclipse.jdt.annotation.NonNull Integer parentIndexNumber) { + this.parentIndexNumber = parentIndexNumber; + } + + public TrailerInfo premiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + return this; + } + + /** + * Get premiereDate + * + * @return premiereDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getPremiereDate() { + return premiereDate; + } + + @JsonProperty(JSON_PROPERTY_PREMIERE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPremiereDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime premiereDate) { + this.premiereDate = premiereDate; + } + + public TrailerInfo isAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + return this; + } + + /** + * Get isAutomated + * + * @return isAutomated + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAutomated() { + return isAutomated; + } + + @JsonProperty(JSON_PROPERTY_IS_AUTOMATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAutomated(@org.eclipse.jdt.annotation.NonNull Boolean isAutomated) { + this.isAutomated = isAutomated; + } + + /** + * Return true if this TrailerInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrailerInfo trailerInfo = (TrailerInfo) o; + return Objects.equals(this.name, trailerInfo.name) + && Objects.equals(this.originalTitle, trailerInfo.originalTitle) + && Objects.equals(this.path, trailerInfo.path) + && Objects.equals(this.metadataLanguage, trailerInfo.metadataLanguage) + && Objects.equals(this.metadataCountryCode, trailerInfo.metadataCountryCode) + && Objects.equals(this.providerIds, trailerInfo.providerIds) + && Objects.equals(this.year, trailerInfo.year) + && Objects.equals(this.indexNumber, trailerInfo.indexNumber) + && Objects.equals(this.parentIndexNumber, trailerInfo.parentIndexNumber) + && Objects.equals(this.premiereDate, trailerInfo.premiereDate) + && Objects.equals(this.isAutomated, trailerInfo.isAutomated); + } + + @Override + public int hashCode() { + return Objects.hash(name, originalTitle, path, metadataLanguage, metadataCountryCode, providerIds, year, + indexNumber, parentIndexNumber, premiereDate, isAutomated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrailerInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" metadataLanguage: ").append(toIndentedString(metadataLanguage)).append("\n"); + sb.append(" metadataCountryCode: ").append(toIndentedString(metadataCountryCode)).append("\n"); + sb.append(" providerIds: ").append(toIndentedString(providerIds)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" indexNumber: ").append(toIndentedString(indexNumber)).append("\n"); + sb.append(" parentIndexNumber: ").append(toIndentedString(parentIndexNumber)).append("\n"); + sb.append(" premiereDate: ").append(toIndentedString(premiereDate)).append("\n"); + sb.append(" isAutomated: ").append(toIndentedString(isAutomated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `OriginalTitle` to the URL query string + if (getOriginalTitle() != null) { + joiner.add(String.format("%sOriginalTitle%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getOriginalTitle())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `MetadataLanguage` to the URL query string + if (getMetadataLanguage() != null) { + joiner.add(String.format("%sMetadataLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataLanguage())))); + } + + // add `MetadataCountryCode` to the URL query string + if (getMetadataCountryCode() != null) { + joiner.add(String.format("%sMetadataCountryCode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMetadataCountryCode())))); + } + + // add `ProviderIds` to the URL query string + if (getProviderIds() != null) { + for (String _key : getProviderIds().keySet()) { + joiner.add(String.format("%sProviderIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProviderIds().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProviderIds().get(_key))))); + } + } + + // add `Year` to the URL query string + if (getYear() != null) { + joiner.add(String.format("%sYear%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getYear())))); + } + + // add `IndexNumber` to the URL query string + if (getIndexNumber() != null) { + joiner.add(String.format("%sIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIndexNumber())))); + } + + // add `ParentIndexNumber` to the URL query string + if (getParentIndexNumber() != null) { + joiner.add(String.format("%sParentIndexNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getParentIndexNumber())))); + } + + // add `PremiereDate` to the URL query string + if (getPremiereDate() != null) { + joiner.add(String.format("%sPremiereDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPremiereDate())))); + } + + // add `IsAutomated` to the URL query string + if (getIsAutomated() != null) { + joiner.add(String.format("%sIsAutomated%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAutomated())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TrailerInfo instance; + + public Builder() { + this(new TrailerInfo()); + } + + protected Builder(TrailerInfo instance) { + this.instance = instance; + } + + public TrailerInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public TrailerInfo.Builder originalTitle(String originalTitle) { + this.instance.originalTitle = originalTitle; + return this; + } + + public TrailerInfo.Builder path(String path) { + this.instance.path = path; + return this; + } + + public TrailerInfo.Builder metadataLanguage(String metadataLanguage) { + this.instance.metadataLanguage = metadataLanguage; + return this; + } + + public TrailerInfo.Builder metadataCountryCode(String metadataCountryCode) { + this.instance.metadataCountryCode = metadataCountryCode; + return this; + } + + public TrailerInfo.Builder providerIds(Map providerIds) { + this.instance.providerIds = providerIds; + return this; + } + + public TrailerInfo.Builder year(Integer year) { + this.instance.year = year; + return this; + } + + public TrailerInfo.Builder indexNumber(Integer indexNumber) { + this.instance.indexNumber = indexNumber; + return this; + } + + public TrailerInfo.Builder parentIndexNumber(Integer parentIndexNumber) { + this.instance.parentIndexNumber = parentIndexNumber; + return this; + } + + public TrailerInfo.Builder premiereDate(OffsetDateTime premiereDate) { + this.instance.premiereDate = premiereDate; + return this; + } + + public TrailerInfo.Builder isAutomated(Boolean isAutomated) { + this.instance.isAutomated = isAutomated; + return this; + } + + /** + * returns a built TrailerInfo instance. + * + * The builder is not reusable. + */ + public TrailerInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TrailerInfo.Builder builder() { + return new TrailerInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TrailerInfo.Builder toBuilder() { + return new TrailerInfo.Builder().name(getName()).originalTitle(getOriginalTitle()).path(getPath()) + .metadataLanguage(getMetadataLanguage()).metadataCountryCode(getMetadataCountryCode()) + .providerIds(getProviderIds()).year(getYear()).indexNumber(getIndexNumber()) + .parentIndexNumber(getParentIndexNumber()).premiereDate(getPremiereDate()) + .isAutomated(getIsAutomated()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TrailerInfoRemoteSearchQuery.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TrailerInfoRemoteSearchQuery.java new file mode 100644 index 0000000000000..aeb7cbd7b18f0 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TrailerInfoRemoteSearchQuery.java @@ -0,0 +1,318 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TrailerInfoRemoteSearchQuery + */ +@JsonPropertyOrder({ TrailerInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_INFO, + TrailerInfoRemoteSearchQuery.JSON_PROPERTY_ITEM_ID, + TrailerInfoRemoteSearchQuery.JSON_PROPERTY_SEARCH_PROVIDER_NAME, + TrailerInfoRemoteSearchQuery.JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TrailerInfoRemoteSearchQuery { + public static final String JSON_PROPERTY_SEARCH_INFO = "SearchInfo"; + @org.eclipse.jdt.annotation.NonNull + private TrailerInfo searchInfo; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private UUID itemId; + + public static final String JSON_PROPERTY_SEARCH_PROVIDER_NAME = "SearchProviderName"; + @org.eclipse.jdt.annotation.NonNull + private String searchProviderName; + + public static final String JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS = "IncludeDisabledProviders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean includeDisabledProviders; + + public TrailerInfoRemoteSearchQuery() { + } + + public TrailerInfoRemoteSearchQuery searchInfo(@org.eclipse.jdt.annotation.NonNull TrailerInfo searchInfo) { + this.searchInfo = searchInfo; + return this; + } + + /** + * Get searchInfo + * + * @return searchInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TrailerInfo getSearchInfo() { + return searchInfo; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchInfo(@org.eclipse.jdt.annotation.NonNull TrailerInfo searchInfo) { + this.searchInfo = searchInfo; + } + + public TrailerInfoRemoteSearchQuery itemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get itemId + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull UUID itemId) { + this.itemId = itemId; + } + + public TrailerInfoRemoteSearchQuery searchProviderName( + @org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + return this; + } + + /** + * Gets or sets the provider name to search within if set. + * + * @return searchProviderName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearchProviderName() { + return searchProviderName; + } + + @JsonProperty(JSON_PROPERTY_SEARCH_PROVIDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSearchProviderName(@org.eclipse.jdt.annotation.NonNull String searchProviderName) { + this.searchProviderName = searchProviderName; + } + + public TrailerInfoRemoteSearchQuery includeDisabledProviders( + @org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * Gets or sets a value indicating whether disabled providers should be included. + * + * @return includeDisabledProviders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeDisabledProviders() { + return includeDisabledProviders; + } + + @JsonProperty(JSON_PROPERTY_INCLUDE_DISABLED_PROVIDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeDisabledProviders(@org.eclipse.jdt.annotation.NonNull Boolean includeDisabledProviders) { + this.includeDisabledProviders = includeDisabledProviders; + } + + /** + * Return true if this TrailerInfoRemoteSearchQuery object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrailerInfoRemoteSearchQuery trailerInfoRemoteSearchQuery = (TrailerInfoRemoteSearchQuery) o; + return Objects.equals(this.searchInfo, trailerInfoRemoteSearchQuery.searchInfo) + && Objects.equals(this.itemId, trailerInfoRemoteSearchQuery.itemId) + && Objects.equals(this.searchProviderName, trailerInfoRemoteSearchQuery.searchProviderName) + && Objects.equals(this.includeDisabledProviders, trailerInfoRemoteSearchQuery.includeDisabledProviders); + } + + @Override + public int hashCode() { + return Objects.hash(searchInfo, itemId, searchProviderName, includeDisabledProviders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrailerInfoRemoteSearchQuery {\n"); + sb.append(" searchInfo: ").append(toIndentedString(searchInfo)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" searchProviderName: ").append(toIndentedString(searchProviderName)).append("\n"); + sb.append(" includeDisabledProviders: ").append(toIndentedString(includeDisabledProviders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `SearchInfo` to the URL query string + if (getSearchInfo() != null) { + joiner.add(getSearchInfo().toUrlQueryString(prefix + "SearchInfo" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `SearchProviderName` to the URL query string + if (getSearchProviderName() != null) { + joiner.add(String.format("%sSearchProviderName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSearchProviderName())))); + } + + // add `IncludeDisabledProviders` to the URL query string + if (getIncludeDisabledProviders() != null) { + joiner.add(String.format("%sIncludeDisabledProviders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIncludeDisabledProviders())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TrailerInfoRemoteSearchQuery instance; + + public Builder() { + this(new TrailerInfoRemoteSearchQuery()); + } + + protected Builder(TrailerInfoRemoteSearchQuery instance) { + this.instance = instance; + } + + public TrailerInfoRemoteSearchQuery.Builder searchInfo(TrailerInfo searchInfo) { + this.instance.searchInfo = searchInfo; + return this; + } + + public TrailerInfoRemoteSearchQuery.Builder itemId(UUID itemId) { + this.instance.itemId = itemId; + return this; + } + + public TrailerInfoRemoteSearchQuery.Builder searchProviderName(String searchProviderName) { + this.instance.searchProviderName = searchProviderName; + return this; + } + + public TrailerInfoRemoteSearchQuery.Builder includeDisabledProviders(Boolean includeDisabledProviders) { + this.instance.includeDisabledProviders = includeDisabledProviders; + return this; + } + + /** + * returns a built TrailerInfoRemoteSearchQuery instance. + * + * The builder is not reusable. + */ + public TrailerInfoRemoteSearchQuery build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TrailerInfoRemoteSearchQuery.Builder builder() { + return new TrailerInfoRemoteSearchQuery.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TrailerInfoRemoteSearchQuery.Builder toBuilder() { + return new TrailerInfoRemoteSearchQuery.Builder().searchInfo(getSearchInfo()).itemId(getItemId()) + .searchProviderName(getSearchProviderName()).includeDisabledProviders(getIncludeDisabledProviders()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TranscodeReason.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TranscodeReason.java new file mode 100644 index 0000000000000..84a843cef43a5 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TranscodeReason.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets TranscodeReason + */ +public enum TranscodeReason { + + CONTAINER_NOT_SUPPORTED("ContainerNotSupported"), + + VIDEO_CODEC_NOT_SUPPORTED("VideoCodecNotSupported"), + + AUDIO_CODEC_NOT_SUPPORTED("AudioCodecNotSupported"), + + SUBTITLE_CODEC_NOT_SUPPORTED("SubtitleCodecNotSupported"), + + AUDIO_IS_EXTERNAL("AudioIsExternal"), + + SECONDARY_AUDIO_NOT_SUPPORTED("SecondaryAudioNotSupported"), + + VIDEO_PROFILE_NOT_SUPPORTED("VideoProfileNotSupported"), + + VIDEO_LEVEL_NOT_SUPPORTED("VideoLevelNotSupported"), + + VIDEO_RESOLUTION_NOT_SUPPORTED("VideoResolutionNotSupported"), + + VIDEO_BIT_DEPTH_NOT_SUPPORTED("VideoBitDepthNotSupported"), + + VIDEO_FRAMERATE_NOT_SUPPORTED("VideoFramerateNotSupported"), + + REF_FRAMES_NOT_SUPPORTED("RefFramesNotSupported"), + + ANAMORPHIC_VIDEO_NOT_SUPPORTED("AnamorphicVideoNotSupported"), + + INTERLACED_VIDEO_NOT_SUPPORTED("InterlacedVideoNotSupported"), + + AUDIO_CHANNELS_NOT_SUPPORTED("AudioChannelsNotSupported"), + + AUDIO_PROFILE_NOT_SUPPORTED("AudioProfileNotSupported"), + + AUDIO_SAMPLE_RATE_NOT_SUPPORTED("AudioSampleRateNotSupported"), + + AUDIO_BIT_DEPTH_NOT_SUPPORTED("AudioBitDepthNotSupported"), + + CONTAINER_BITRATE_EXCEEDS_LIMIT("ContainerBitrateExceedsLimit"), + + VIDEO_BITRATE_NOT_SUPPORTED("VideoBitrateNotSupported"), + + AUDIO_BITRATE_NOT_SUPPORTED("AudioBitrateNotSupported"), + + UNKNOWN_VIDEO_STREAM_INFO("UnknownVideoStreamInfo"), + + UNKNOWN_AUDIO_STREAM_INFO("UnknownAudioStreamInfo"), + + DIRECT_PLAY_ERROR("DirectPlayError"), + + VIDEO_RANGE_TYPE_NOT_SUPPORTED("VideoRangeTypeNotSupported"); + + private String value; + + TranscodeReason(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TranscodeReason fromValue(String value) { + for (TranscodeReason b : TranscodeReason.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TranscodeSeekInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TranscodeSeekInfo.java new file mode 100644 index 0000000000000..ccbc8d268ae6e --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TranscodeSeekInfo.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets TranscodeSeekInfo + */ +public enum TranscodeSeekInfo { + + AUTO("Auto"), + + BYTES("Bytes"); + + private String value; + + TranscodeSeekInfo(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TranscodeSeekInfo fromValue(String value) { + for (TranscodeSeekInfo b : TranscodeSeekInfo.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TranscodingInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TranscodingInfo.java new file mode 100644 index 0000000000000..f3f3b9931dd03 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TranscodingInfo.java @@ -0,0 +1,701 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TranscodingInfo + */ +@JsonPropertyOrder({ TranscodingInfo.JSON_PROPERTY_AUDIO_CODEC, TranscodingInfo.JSON_PROPERTY_VIDEO_CODEC, + TranscodingInfo.JSON_PROPERTY_CONTAINER, TranscodingInfo.JSON_PROPERTY_IS_VIDEO_DIRECT, + TranscodingInfo.JSON_PROPERTY_IS_AUDIO_DIRECT, TranscodingInfo.JSON_PROPERTY_BITRATE, + TranscodingInfo.JSON_PROPERTY_FRAMERATE, TranscodingInfo.JSON_PROPERTY_COMPLETION_PERCENTAGE, + TranscodingInfo.JSON_PROPERTY_WIDTH, TranscodingInfo.JSON_PROPERTY_HEIGHT, + TranscodingInfo.JSON_PROPERTY_AUDIO_CHANNELS, TranscodingInfo.JSON_PROPERTY_HARDWARE_ACCELERATION_TYPE, + TranscodingInfo.JSON_PROPERTY_TRANSCODE_REASONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TranscodingInfo { + public static final String JSON_PROPERTY_AUDIO_CODEC = "AudioCodec"; + @org.eclipse.jdt.annotation.NonNull + private String audioCodec; + + public static final String JSON_PROPERTY_VIDEO_CODEC = "VideoCodec"; + @org.eclipse.jdt.annotation.NonNull + private String videoCodec; + + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public static final String JSON_PROPERTY_IS_VIDEO_DIRECT = "IsVideoDirect"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isVideoDirect; + + public static final String JSON_PROPERTY_IS_AUDIO_DIRECT = "IsAudioDirect"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAudioDirect; + + public static final String JSON_PROPERTY_BITRATE = "Bitrate"; + @org.eclipse.jdt.annotation.NonNull + private Integer bitrate; + + public static final String JSON_PROPERTY_FRAMERATE = "Framerate"; + @org.eclipse.jdt.annotation.NonNull + private Float framerate; + + public static final String JSON_PROPERTY_COMPLETION_PERCENTAGE = "CompletionPercentage"; + @org.eclipse.jdt.annotation.NonNull + private Double completionPercentage; + + public static final String JSON_PROPERTY_WIDTH = "Width"; + @org.eclipse.jdt.annotation.NonNull + private Integer width; + + public static final String JSON_PROPERTY_HEIGHT = "Height"; + @org.eclipse.jdt.annotation.NonNull + private Integer height; + + public static final String JSON_PROPERTY_AUDIO_CHANNELS = "AudioChannels"; + @org.eclipse.jdt.annotation.NonNull + private Integer audioChannels; + + public static final String JSON_PROPERTY_HARDWARE_ACCELERATION_TYPE = "HardwareAccelerationType"; + @org.eclipse.jdt.annotation.NonNull + private HardwareEncodingType hardwareAccelerationType; + + public static final String JSON_PROPERTY_TRANSCODE_REASONS = "TranscodeReasons"; + @org.eclipse.jdt.annotation.NonNull + private List transcodeReasons = new ArrayList<>(); + + public TranscodingInfo() { + } + + public TranscodingInfo audioCodec(@org.eclipse.jdt.annotation.NonNull String audioCodec) { + this.audioCodec = audioCodec; + return this; + } + + /** + * Get audioCodec + * + * @return audioCodec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAudioCodec() { + return audioCodec; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioCodec(@org.eclipse.jdt.annotation.NonNull String audioCodec) { + this.audioCodec = audioCodec; + } + + public TranscodingInfo videoCodec(@org.eclipse.jdt.annotation.NonNull String videoCodec) { + this.videoCodec = videoCodec; + return this; + } + + /** + * Get videoCodec + * + * @return videoCodec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVideoCodec() { + return videoCodec; + } + + @JsonProperty(JSON_PROPERTY_VIDEO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVideoCodec(@org.eclipse.jdt.annotation.NonNull String videoCodec) { + this.videoCodec = videoCodec; + } + + public TranscodingInfo container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Get container + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + public TranscodingInfo isVideoDirect(@org.eclipse.jdt.annotation.NonNull Boolean isVideoDirect) { + this.isVideoDirect = isVideoDirect; + return this; + } + + /** + * Get isVideoDirect + * + * @return isVideoDirect + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_VIDEO_DIRECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsVideoDirect() { + return isVideoDirect; + } + + @JsonProperty(JSON_PROPERTY_IS_VIDEO_DIRECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsVideoDirect(@org.eclipse.jdt.annotation.NonNull Boolean isVideoDirect) { + this.isVideoDirect = isVideoDirect; + } + + public TranscodingInfo isAudioDirect(@org.eclipse.jdt.annotation.NonNull Boolean isAudioDirect) { + this.isAudioDirect = isAudioDirect; + return this; + } + + /** + * Get isAudioDirect + * + * @return isAudioDirect + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_AUDIO_DIRECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAudioDirect() { + return isAudioDirect; + } + + @JsonProperty(JSON_PROPERTY_IS_AUDIO_DIRECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAudioDirect(@org.eclipse.jdt.annotation.NonNull Boolean isAudioDirect) { + this.isAudioDirect = isAudioDirect; + } + + public TranscodingInfo bitrate(@org.eclipse.jdt.annotation.NonNull Integer bitrate) { + this.bitrate = bitrate; + return this; + } + + /** + * Get bitrate + * + * @return bitrate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBitrate() { + return bitrate; + } + + @JsonProperty(JSON_PROPERTY_BITRATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBitrate(@org.eclipse.jdt.annotation.NonNull Integer bitrate) { + this.bitrate = bitrate; + } + + public TranscodingInfo framerate(@org.eclipse.jdt.annotation.NonNull Float framerate) { + this.framerate = framerate; + return this; + } + + /** + * Get framerate + * + * @return framerate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FRAMERATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFramerate() { + return framerate; + } + + @JsonProperty(JSON_PROPERTY_FRAMERATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFramerate(@org.eclipse.jdt.annotation.NonNull Float framerate) { + this.framerate = framerate; + } + + public TranscodingInfo completionPercentage(@org.eclipse.jdt.annotation.NonNull Double completionPercentage) { + this.completionPercentage = completionPercentage; + return this; + } + + /** + * Get completionPercentage + * + * @return completionPercentage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COMPLETION_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getCompletionPercentage() { + return completionPercentage; + } + + @JsonProperty(JSON_PROPERTY_COMPLETION_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompletionPercentage(@org.eclipse.jdt.annotation.NonNull Double completionPercentage) { + this.completionPercentage = completionPercentage; + } + + public TranscodingInfo width(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + return this; + } + + /** + * Get width + * + * @return width + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@org.eclipse.jdt.annotation.NonNull Integer width) { + this.width = width; + } + + public TranscodingInfo height(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + return this; + } + + /** + * Get height + * + * @return height + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHeight() { + return height; + } + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@org.eclipse.jdt.annotation.NonNull Integer height) { + this.height = height; + } + + public TranscodingInfo audioChannels(@org.eclipse.jdt.annotation.NonNull Integer audioChannels) { + this.audioChannels = audioChannels; + return this; + } + + /** + * Get audioChannels + * + * @return audioChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAudioChannels() { + return audioChannels; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioChannels(@org.eclipse.jdt.annotation.NonNull Integer audioChannels) { + this.audioChannels = audioChannels; + } + + public TranscodingInfo hardwareAccelerationType( + @org.eclipse.jdt.annotation.NonNull HardwareEncodingType hardwareAccelerationType) { + this.hardwareAccelerationType = hardwareAccelerationType; + return this; + } + + /** + * Get hardwareAccelerationType + * + * @return hardwareAccelerationType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HARDWARE_ACCELERATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public HardwareEncodingType getHardwareAccelerationType() { + return hardwareAccelerationType; + } + + @JsonProperty(JSON_PROPERTY_HARDWARE_ACCELERATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHardwareAccelerationType( + @org.eclipse.jdt.annotation.NonNull HardwareEncodingType hardwareAccelerationType) { + this.hardwareAccelerationType = hardwareAccelerationType; + } + + public TranscodingInfo transcodeReasons( + @org.eclipse.jdt.annotation.NonNull List transcodeReasons) { + this.transcodeReasons = transcodeReasons; + return this; + } + + public TranscodingInfo addTranscodeReasonsItem(TranscodeReason transcodeReasonsItem) { + if (this.transcodeReasons == null) { + this.transcodeReasons = new ArrayList<>(); + } + this.transcodeReasons.add(transcodeReasonsItem); + return this; + } + + /** + * Get transcodeReasons + * + * @return transcodeReasons + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODE_REASONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTranscodeReasons() { + return transcodeReasons; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODE_REASONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodeReasons(@org.eclipse.jdt.annotation.NonNull List transcodeReasons) { + this.transcodeReasons = transcodeReasons; + } + + /** + * Return true if this TranscodingInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TranscodingInfo transcodingInfo = (TranscodingInfo) o; + return Objects.equals(this.audioCodec, transcodingInfo.audioCodec) + && Objects.equals(this.videoCodec, transcodingInfo.videoCodec) + && Objects.equals(this.container, transcodingInfo.container) + && Objects.equals(this.isVideoDirect, transcodingInfo.isVideoDirect) + && Objects.equals(this.isAudioDirect, transcodingInfo.isAudioDirect) + && Objects.equals(this.bitrate, transcodingInfo.bitrate) + && Objects.equals(this.framerate, transcodingInfo.framerate) + && Objects.equals(this.completionPercentage, transcodingInfo.completionPercentage) + && Objects.equals(this.width, transcodingInfo.width) + && Objects.equals(this.height, transcodingInfo.height) + && Objects.equals(this.audioChannels, transcodingInfo.audioChannels) + && Objects.equals(this.hardwareAccelerationType, transcodingInfo.hardwareAccelerationType) + && Objects.equals(this.transcodeReasons, transcodingInfo.transcodeReasons); + } + + @Override + public int hashCode() { + return Objects.hash(audioCodec, videoCodec, container, isVideoDirect, isAudioDirect, bitrate, framerate, + completionPercentage, width, height, audioChannels, hardwareAccelerationType, transcodeReasons); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TranscodingInfo {\n"); + sb.append(" audioCodec: ").append(toIndentedString(audioCodec)).append("\n"); + sb.append(" videoCodec: ").append(toIndentedString(videoCodec)).append("\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" isVideoDirect: ").append(toIndentedString(isVideoDirect)).append("\n"); + sb.append(" isAudioDirect: ").append(toIndentedString(isAudioDirect)).append("\n"); + sb.append(" bitrate: ").append(toIndentedString(bitrate)).append("\n"); + sb.append(" framerate: ").append(toIndentedString(framerate)).append("\n"); + sb.append(" completionPercentage: ").append(toIndentedString(completionPercentage)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" audioChannels: ").append(toIndentedString(audioChannels)).append("\n"); + sb.append(" hardwareAccelerationType: ").append(toIndentedString(hardwareAccelerationType)).append("\n"); + sb.append(" transcodeReasons: ").append(toIndentedString(transcodeReasons)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `AudioCodec` to the URL query string + if (getAudioCodec() != null) { + joiner.add(String.format("%sAudioCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioCodec())))); + } + + // add `VideoCodec` to the URL query string + if (getVideoCodec() != null) { + joiner.add(String.format("%sVideoCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoCodec())))); + } + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + // add `IsVideoDirect` to the URL query string + if (getIsVideoDirect() != null) { + joiner.add(String.format("%sIsVideoDirect%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsVideoDirect())))); + } + + // add `IsAudioDirect` to the URL query string + if (getIsAudioDirect() != null) { + joiner.add(String.format("%sIsAudioDirect%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAudioDirect())))); + } + + // add `Bitrate` to the URL query string + if (getBitrate() != null) { + joiner.add(String.format("%sBitrate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBitrate())))); + } + + // add `Framerate` to the URL query string + if (getFramerate() != null) { + joiner.add(String.format("%sFramerate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFramerate())))); + } + + // add `CompletionPercentage` to the URL query string + if (getCompletionPercentage() != null) { + joiner.add(String.format("%sCompletionPercentage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCompletionPercentage())))); + } + + // add `Width` to the URL query string + if (getWidth() != null) { + joiner.add(String.format("%sWidth%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWidth())))); + } + + // add `Height` to the URL query string + if (getHeight() != null) { + joiner.add(String.format("%sHeight%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHeight())))); + } + + // add `AudioChannels` to the URL query string + if (getAudioChannels() != null) { + joiner.add(String.format("%sAudioChannels%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioChannels())))); + } + + // add `HardwareAccelerationType` to the URL query string + if (getHardwareAccelerationType() != null) { + joiner.add(String.format("%sHardwareAccelerationType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHardwareAccelerationType())))); + } + + // add `TranscodeReasons` to the URL query string + if (getTranscodeReasons() != null) { + for (int i = 0; i < getTranscodeReasons().size(); i++) { + if (getTranscodeReasons().get(i) != null) { + joiner.add(String.format("%sTranscodeReasons%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getTranscodeReasons().get(i))))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private TranscodingInfo instance; + + public Builder() { + this(new TranscodingInfo()); + } + + protected Builder(TranscodingInfo instance) { + this.instance = instance; + } + + public TranscodingInfo.Builder audioCodec(String audioCodec) { + this.instance.audioCodec = audioCodec; + return this; + } + + public TranscodingInfo.Builder videoCodec(String videoCodec) { + this.instance.videoCodec = videoCodec; + return this; + } + + public TranscodingInfo.Builder container(String container) { + this.instance.container = container; + return this; + } + + public TranscodingInfo.Builder isVideoDirect(Boolean isVideoDirect) { + this.instance.isVideoDirect = isVideoDirect; + return this; + } + + public TranscodingInfo.Builder isAudioDirect(Boolean isAudioDirect) { + this.instance.isAudioDirect = isAudioDirect; + return this; + } + + public TranscodingInfo.Builder bitrate(Integer bitrate) { + this.instance.bitrate = bitrate; + return this; + } + + public TranscodingInfo.Builder framerate(Float framerate) { + this.instance.framerate = framerate; + return this; + } + + public TranscodingInfo.Builder completionPercentage(Double completionPercentage) { + this.instance.completionPercentage = completionPercentage; + return this; + } + + public TranscodingInfo.Builder width(Integer width) { + this.instance.width = width; + return this; + } + + public TranscodingInfo.Builder height(Integer height) { + this.instance.height = height; + return this; + } + + public TranscodingInfo.Builder audioChannels(Integer audioChannels) { + this.instance.audioChannels = audioChannels; + return this; + } + + public TranscodingInfo.Builder hardwareAccelerationType(HardwareEncodingType hardwareAccelerationType) { + this.instance.hardwareAccelerationType = hardwareAccelerationType; + return this; + } + + public TranscodingInfo.Builder transcodeReasons(List transcodeReasons) { + this.instance.transcodeReasons = transcodeReasons; + return this; + } + + /** + * returns a built TranscodingInfo instance. + * + * The builder is not reusable. + */ + public TranscodingInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TranscodingInfo.Builder builder() { + return new TranscodingInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TranscodingInfo.Builder toBuilder() { + return new TranscodingInfo.Builder().audioCodec(getAudioCodec()).videoCodec(getVideoCodec()) + .container(getContainer()).isVideoDirect(getIsVideoDirect()).isAudioDirect(getIsAudioDirect()) + .bitrate(getBitrate()).framerate(getFramerate()).completionPercentage(getCompletionPercentage()) + .width(getWidth()).height(getHeight()).audioChannels(getAudioChannels()) + .hardwareAccelerationType(getHardwareAccelerationType()).transcodeReasons(getTranscodeReasons()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TranscodingProfile.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TranscodingProfile.java new file mode 100644 index 0000000000000..7f2aea5ffa901 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TranscodingProfile.java @@ -0,0 +1,824 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TranscodingProfile + */ +@JsonPropertyOrder({ TranscodingProfile.JSON_PROPERTY_CONTAINER, TranscodingProfile.JSON_PROPERTY_TYPE, + TranscodingProfile.JSON_PROPERTY_VIDEO_CODEC, TranscodingProfile.JSON_PROPERTY_AUDIO_CODEC, + TranscodingProfile.JSON_PROPERTY_PROTOCOL, TranscodingProfile.JSON_PROPERTY_ESTIMATE_CONTENT_LENGTH, + TranscodingProfile.JSON_PROPERTY_ENABLE_MPEGTS_M2_TS_MODE, TranscodingProfile.JSON_PROPERTY_TRANSCODE_SEEK_INFO, + TranscodingProfile.JSON_PROPERTY_COPY_TIMESTAMPS, TranscodingProfile.JSON_PROPERTY_CONTEXT, + TranscodingProfile.JSON_PROPERTY_ENABLE_SUBTITLES_IN_MANIFEST, + TranscodingProfile.JSON_PROPERTY_MAX_AUDIO_CHANNELS, TranscodingProfile.JSON_PROPERTY_MIN_SEGMENTS, + TranscodingProfile.JSON_PROPERTY_SEGMENT_LENGTH, TranscodingProfile.JSON_PROPERTY_BREAK_ON_NON_KEY_FRAMES, + TranscodingProfile.JSON_PROPERTY_CONDITIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TranscodingProfile { + public static final String JSON_PROPERTY_CONTAINER = "Container"; + @org.eclipse.jdt.annotation.NonNull + private String container; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private DlnaProfileType type; + + public static final String JSON_PROPERTY_VIDEO_CODEC = "VideoCodec"; + @org.eclipse.jdt.annotation.NonNull + private String videoCodec; + + public static final String JSON_PROPERTY_AUDIO_CODEC = "AudioCodec"; + @org.eclipse.jdt.annotation.NonNull + private String audioCodec; + + public static final String JSON_PROPERTY_PROTOCOL = "Protocol"; + @org.eclipse.jdt.annotation.NonNull + private String protocol; + + public static final String JSON_PROPERTY_ESTIMATE_CONTENT_LENGTH = "EstimateContentLength"; + @org.eclipse.jdt.annotation.NonNull + private Boolean estimateContentLength = false; + + public static final String JSON_PROPERTY_ENABLE_MPEGTS_M2_TS_MODE = "EnableMpegtsM2TsMode"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableMpegtsM2TsMode = false; + + public static final String JSON_PROPERTY_TRANSCODE_SEEK_INFO = "TranscodeSeekInfo"; + @org.eclipse.jdt.annotation.NonNull + private TranscodeSeekInfo transcodeSeekInfo = TranscodeSeekInfo.AUTO; + + public static final String JSON_PROPERTY_COPY_TIMESTAMPS = "CopyTimestamps"; + @org.eclipse.jdt.annotation.NonNull + private Boolean copyTimestamps = false; + + public static final String JSON_PROPERTY_CONTEXT = "Context"; + @org.eclipse.jdt.annotation.NonNull + private EncodingContext context = EncodingContext.STREAMING; + + public static final String JSON_PROPERTY_ENABLE_SUBTITLES_IN_MANIFEST = "EnableSubtitlesInManifest"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableSubtitlesInManifest = false; + + public static final String JSON_PROPERTY_MAX_AUDIO_CHANNELS = "MaxAudioChannels"; + @org.eclipse.jdt.annotation.NonNull + private String maxAudioChannels; + + public static final String JSON_PROPERTY_MIN_SEGMENTS = "MinSegments"; + @org.eclipse.jdt.annotation.NonNull + private Integer minSegments = 0; + + public static final String JSON_PROPERTY_SEGMENT_LENGTH = "SegmentLength"; + @org.eclipse.jdt.annotation.NonNull + private Integer segmentLength = 0; + + public static final String JSON_PROPERTY_BREAK_ON_NON_KEY_FRAMES = "BreakOnNonKeyFrames"; + @org.eclipse.jdt.annotation.NonNull + private Boolean breakOnNonKeyFrames = false; + + public static final String JSON_PROPERTY_CONDITIONS = "Conditions"; + @org.eclipse.jdt.annotation.NonNull + private List conditions = new ArrayList<>(); + + public TranscodingProfile() { + } + + public TranscodingProfile container(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + return this; + } + + /** + * Get container + * + * @return container + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContainer() { + return container; + } + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(@org.eclipse.jdt.annotation.NonNull String container) { + this.container = container; + } + + public TranscodingProfile type(@org.eclipse.jdt.annotation.NonNull DlnaProfileType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DlnaProfileType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull DlnaProfileType type) { + this.type = type; + } + + public TranscodingProfile videoCodec(@org.eclipse.jdt.annotation.NonNull String videoCodec) { + this.videoCodec = videoCodec; + return this; + } + + /** + * Get videoCodec + * + * @return videoCodec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VIDEO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVideoCodec() { + return videoCodec; + } + + @JsonProperty(JSON_PROPERTY_VIDEO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVideoCodec(@org.eclipse.jdt.annotation.NonNull String videoCodec) { + this.videoCodec = videoCodec; + } + + public TranscodingProfile audioCodec(@org.eclipse.jdt.annotation.NonNull String audioCodec) { + this.audioCodec = audioCodec; + return this; + } + + /** + * Get audioCodec + * + * @return audioCodec + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAudioCodec() { + return audioCodec; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_CODEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioCodec(@org.eclipse.jdt.annotation.NonNull String audioCodec) { + this.audioCodec = audioCodec; + } + + public TranscodingProfile protocol(@org.eclipse.jdt.annotation.NonNull String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * + * @return protocol + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProtocol() { + return protocol; + } + + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtocol(@org.eclipse.jdt.annotation.NonNull String protocol) { + this.protocol = protocol; + } + + public TranscodingProfile estimateContentLength(@org.eclipse.jdt.annotation.NonNull Boolean estimateContentLength) { + this.estimateContentLength = estimateContentLength; + return this; + } + + /** + * Get estimateContentLength + * + * @return estimateContentLength + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ESTIMATE_CONTENT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEstimateContentLength() { + return estimateContentLength; + } + + @JsonProperty(JSON_PROPERTY_ESTIMATE_CONTENT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEstimateContentLength(@org.eclipse.jdt.annotation.NonNull Boolean estimateContentLength) { + this.estimateContentLength = estimateContentLength; + } + + public TranscodingProfile enableMpegtsM2TsMode(@org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode) { + this.enableMpegtsM2TsMode = enableMpegtsM2TsMode; + return this; + } + + /** + * Get enableMpegtsM2TsMode + * + * @return enableMpegtsM2TsMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_MPEGTS_M2_TS_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableMpegtsM2TsMode() { + return enableMpegtsM2TsMode; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_MPEGTS_M2_TS_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableMpegtsM2TsMode(@org.eclipse.jdt.annotation.NonNull Boolean enableMpegtsM2TsMode) { + this.enableMpegtsM2TsMode = enableMpegtsM2TsMode; + } + + public TranscodingProfile transcodeSeekInfo( + @org.eclipse.jdt.annotation.NonNull TranscodeSeekInfo transcodeSeekInfo) { + this.transcodeSeekInfo = transcodeSeekInfo; + return this; + } + + /** + * Get transcodeSeekInfo + * + * @return transcodeSeekInfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TRANSCODE_SEEK_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TranscodeSeekInfo getTranscodeSeekInfo() { + return transcodeSeekInfo; + } + + @JsonProperty(JSON_PROPERTY_TRANSCODE_SEEK_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTranscodeSeekInfo(@org.eclipse.jdt.annotation.NonNull TranscodeSeekInfo transcodeSeekInfo) { + this.transcodeSeekInfo = transcodeSeekInfo; + } + + public TranscodingProfile copyTimestamps(@org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps) { + this.copyTimestamps = copyTimestamps; + return this; + } + + /** + * Get copyTimestamps + * + * @return copyTimestamps + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COPY_TIMESTAMPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCopyTimestamps() { + return copyTimestamps; + } + + @JsonProperty(JSON_PROPERTY_COPY_TIMESTAMPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCopyTimestamps(@org.eclipse.jdt.annotation.NonNull Boolean copyTimestamps) { + this.copyTimestamps = copyTimestamps; + } + + public TranscodingProfile context(@org.eclipse.jdt.annotation.NonNull EncodingContext context) { + this.context = context; + return this; + } + + /** + * Get context + * + * @return context + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EncodingContext getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@org.eclipse.jdt.annotation.NonNull EncodingContext context) { + this.context = context; + } + + public TranscodingProfile enableSubtitlesInManifest( + @org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest) { + this.enableSubtitlesInManifest = enableSubtitlesInManifest; + return this; + } + + /** + * Get enableSubtitlesInManifest + * + * @return enableSubtitlesInManifest + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_SUBTITLES_IN_MANIFEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableSubtitlesInManifest() { + return enableSubtitlesInManifest; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_SUBTITLES_IN_MANIFEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableSubtitlesInManifest(@org.eclipse.jdt.annotation.NonNull Boolean enableSubtitlesInManifest) { + this.enableSubtitlesInManifest = enableSubtitlesInManifest; + } + + public TranscodingProfile maxAudioChannels(@org.eclipse.jdt.annotation.NonNull String maxAudioChannels) { + this.maxAudioChannels = maxAudioChannels; + return this; + } + + /** + * Get maxAudioChannels + * + * @return maxAudioChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_AUDIO_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMaxAudioChannels() { + return maxAudioChannels; + } + + @JsonProperty(JSON_PROPERTY_MAX_AUDIO_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxAudioChannels(@org.eclipse.jdt.annotation.NonNull String maxAudioChannels) { + this.maxAudioChannels = maxAudioChannels; + } + + public TranscodingProfile minSegments(@org.eclipse.jdt.annotation.NonNull Integer minSegments) { + this.minSegments = minSegments; + return this; + } + + /** + * Get minSegments + * + * @return minSegments + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MIN_SEGMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMinSegments() { + return minSegments; + } + + @JsonProperty(JSON_PROPERTY_MIN_SEGMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinSegments(@org.eclipse.jdt.annotation.NonNull Integer minSegments) { + this.minSegments = minSegments; + } + + public TranscodingProfile segmentLength(@org.eclipse.jdt.annotation.NonNull Integer segmentLength) { + this.segmentLength = segmentLength; + return this; + } + + /** + * Get segmentLength + * + * @return segmentLength + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SEGMENT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSegmentLength() { + return segmentLength; + } + + @JsonProperty(JSON_PROPERTY_SEGMENT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSegmentLength(@org.eclipse.jdt.annotation.NonNull Integer segmentLength) { + this.segmentLength = segmentLength; + } + + public TranscodingProfile breakOnNonKeyFrames(@org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames) { + this.breakOnNonKeyFrames = breakOnNonKeyFrames; + return this; + } + + /** + * Get breakOnNonKeyFrames + * + * @return breakOnNonKeyFrames + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BREAK_ON_NON_KEY_FRAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getBreakOnNonKeyFrames() { + return breakOnNonKeyFrames; + } + + @JsonProperty(JSON_PROPERTY_BREAK_ON_NON_KEY_FRAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBreakOnNonKeyFrames(@org.eclipse.jdt.annotation.NonNull Boolean breakOnNonKeyFrames) { + this.breakOnNonKeyFrames = breakOnNonKeyFrames; + } + + public TranscodingProfile conditions(@org.eclipse.jdt.annotation.NonNull List conditions) { + this.conditions = conditions; + return this; + } + + public TranscodingProfile addConditionsItem(ProfileCondition conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * Get conditions + * + * @return conditions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getConditions() { + return conditions; + } + + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConditions(@org.eclipse.jdt.annotation.NonNull List conditions) { + this.conditions = conditions; + } + + /** + * Return true if this TranscodingProfile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TranscodingProfile transcodingProfile = (TranscodingProfile) o; + return Objects.equals(this.container, transcodingProfile.container) + && Objects.equals(this.type, transcodingProfile.type) + && Objects.equals(this.videoCodec, transcodingProfile.videoCodec) + && Objects.equals(this.audioCodec, transcodingProfile.audioCodec) + && Objects.equals(this.protocol, transcodingProfile.protocol) + && Objects.equals(this.estimateContentLength, transcodingProfile.estimateContentLength) + && Objects.equals(this.enableMpegtsM2TsMode, transcodingProfile.enableMpegtsM2TsMode) + && Objects.equals(this.transcodeSeekInfo, transcodingProfile.transcodeSeekInfo) + && Objects.equals(this.copyTimestamps, transcodingProfile.copyTimestamps) + && Objects.equals(this.context, transcodingProfile.context) + && Objects.equals(this.enableSubtitlesInManifest, transcodingProfile.enableSubtitlesInManifest) + && Objects.equals(this.maxAudioChannels, transcodingProfile.maxAudioChannels) + && Objects.equals(this.minSegments, transcodingProfile.minSegments) + && Objects.equals(this.segmentLength, transcodingProfile.segmentLength) + && Objects.equals(this.breakOnNonKeyFrames, transcodingProfile.breakOnNonKeyFrames) + && Objects.equals(this.conditions, transcodingProfile.conditions); + } + + @Override + public int hashCode() { + return Objects.hash(container, type, videoCodec, audioCodec, protocol, estimateContentLength, + enableMpegtsM2TsMode, transcodeSeekInfo, copyTimestamps, context, enableSubtitlesInManifest, + maxAudioChannels, minSegments, segmentLength, breakOnNonKeyFrames, conditions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TranscodingProfile {\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" videoCodec: ").append(toIndentedString(videoCodec)).append("\n"); + sb.append(" audioCodec: ").append(toIndentedString(audioCodec)).append("\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append(" estimateContentLength: ").append(toIndentedString(estimateContentLength)).append("\n"); + sb.append(" enableMpegtsM2TsMode: ").append(toIndentedString(enableMpegtsM2TsMode)).append("\n"); + sb.append(" transcodeSeekInfo: ").append(toIndentedString(transcodeSeekInfo)).append("\n"); + sb.append(" copyTimestamps: ").append(toIndentedString(copyTimestamps)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" enableSubtitlesInManifest: ").append(toIndentedString(enableSubtitlesInManifest)).append("\n"); + sb.append(" maxAudioChannels: ").append(toIndentedString(maxAudioChannels)).append("\n"); + sb.append(" minSegments: ").append(toIndentedString(minSegments)).append("\n"); + sb.append(" segmentLength: ").append(toIndentedString(segmentLength)).append("\n"); + sb.append(" breakOnNonKeyFrames: ").append(toIndentedString(breakOnNonKeyFrames)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Container` to the URL query string + if (getContainer() != null) { + joiner.add(String.format("%sContainer%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContainer())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `VideoCodec` to the URL query string + if (getVideoCodec() != null) { + joiner.add(String.format("%sVideoCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVideoCodec())))); + } + + // add `AudioCodec` to the URL query string + if (getAudioCodec() != null) { + joiner.add(String.format("%sAudioCodec%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioCodec())))); + } + + // add `Protocol` to the URL query string + if (getProtocol() != null) { + joiner.add(String.format("%sProtocol%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProtocol())))); + } + + // add `EstimateContentLength` to the URL query string + if (getEstimateContentLength() != null) { + joiner.add(String.format("%sEstimateContentLength%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEstimateContentLength())))); + } + + // add `EnableMpegtsM2TsMode` to the URL query string + if (getEnableMpegtsM2TsMode() != null) { + joiner.add(String.format("%sEnableMpegtsM2TsMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableMpegtsM2TsMode())))); + } + + // add `TranscodeSeekInfo` to the URL query string + if (getTranscodeSeekInfo() != null) { + joiner.add(String.format("%sTranscodeSeekInfo%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTranscodeSeekInfo())))); + } + + // add `CopyTimestamps` to the URL query string + if (getCopyTimestamps() != null) { + joiner.add(String.format("%sCopyTimestamps%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCopyTimestamps())))); + } + + // add `Context` to the URL query string + if (getContext() != null) { + joiner.add(String.format("%sContext%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getContext())))); + } + + // add `EnableSubtitlesInManifest` to the URL query string + if (getEnableSubtitlesInManifest() != null) { + joiner.add(String.format("%sEnableSubtitlesInManifest%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableSubtitlesInManifest())))); + } + + // add `MaxAudioChannels` to the URL query string + if (getMaxAudioChannels() != null) { + joiner.add(String.format("%sMaxAudioChannels%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxAudioChannels())))); + } + + // add `MinSegments` to the URL query string + if (getMinSegments() != null) { + joiner.add(String.format("%sMinSegments%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMinSegments())))); + } + + // add `SegmentLength` to the URL query string + if (getSegmentLength() != null) { + joiner.add(String.format("%sSegmentLength%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSegmentLength())))); + } + + // add `BreakOnNonKeyFrames` to the URL query string + if (getBreakOnNonKeyFrames() != null) { + joiner.add(String.format("%sBreakOnNonKeyFrames%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBreakOnNonKeyFrames())))); + } + + // add `Conditions` to the URL query string + if (getConditions() != null) { + for (int i = 0; i < getConditions().size(); i++) { + if (getConditions().get(i) != null) { + joiner.add(getConditions().get(i).toUrlQueryString(String.format("%sConditions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private TranscodingProfile instance; + + public Builder() { + this(new TranscodingProfile()); + } + + protected Builder(TranscodingProfile instance) { + this.instance = instance; + } + + public TranscodingProfile.Builder container(String container) { + this.instance.container = container; + return this; + } + + public TranscodingProfile.Builder type(DlnaProfileType type) { + this.instance.type = type; + return this; + } + + public TranscodingProfile.Builder videoCodec(String videoCodec) { + this.instance.videoCodec = videoCodec; + return this; + } + + public TranscodingProfile.Builder audioCodec(String audioCodec) { + this.instance.audioCodec = audioCodec; + return this; + } + + public TranscodingProfile.Builder protocol(String protocol) { + this.instance.protocol = protocol; + return this; + } + + public TranscodingProfile.Builder estimateContentLength(Boolean estimateContentLength) { + this.instance.estimateContentLength = estimateContentLength; + return this; + } + + public TranscodingProfile.Builder enableMpegtsM2TsMode(Boolean enableMpegtsM2TsMode) { + this.instance.enableMpegtsM2TsMode = enableMpegtsM2TsMode; + return this; + } + + public TranscodingProfile.Builder transcodeSeekInfo(TranscodeSeekInfo transcodeSeekInfo) { + this.instance.transcodeSeekInfo = transcodeSeekInfo; + return this; + } + + public TranscodingProfile.Builder copyTimestamps(Boolean copyTimestamps) { + this.instance.copyTimestamps = copyTimestamps; + return this; + } + + public TranscodingProfile.Builder context(EncodingContext context) { + this.instance.context = context; + return this; + } + + public TranscodingProfile.Builder enableSubtitlesInManifest(Boolean enableSubtitlesInManifest) { + this.instance.enableSubtitlesInManifest = enableSubtitlesInManifest; + return this; + } + + public TranscodingProfile.Builder maxAudioChannels(String maxAudioChannels) { + this.instance.maxAudioChannels = maxAudioChannels; + return this; + } + + public TranscodingProfile.Builder minSegments(Integer minSegments) { + this.instance.minSegments = minSegments; + return this; + } + + public TranscodingProfile.Builder segmentLength(Integer segmentLength) { + this.instance.segmentLength = segmentLength; + return this; + } + + public TranscodingProfile.Builder breakOnNonKeyFrames(Boolean breakOnNonKeyFrames) { + this.instance.breakOnNonKeyFrames = breakOnNonKeyFrames; + return this; + } + + public TranscodingProfile.Builder conditions(List conditions) { + this.instance.conditions = conditions; + return this; + } + + /** + * returns a built TranscodingProfile instance. + * + * The builder is not reusable. + */ + public TranscodingProfile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TranscodingProfile.Builder builder() { + return new TranscodingProfile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TranscodingProfile.Builder toBuilder() { + return new TranscodingProfile.Builder().container(getContainer()).type(getType()).videoCodec(getVideoCodec()) + .audioCodec(getAudioCodec()).protocol(getProtocol()).estimateContentLength(getEstimateContentLength()) + .enableMpegtsM2TsMode(getEnableMpegtsM2TsMode()).transcodeSeekInfo(getTranscodeSeekInfo()) + .copyTimestamps(getCopyTimestamps()).context(getContext()) + .enableSubtitlesInManifest(getEnableSubtitlesInManifest()).maxAudioChannels(getMaxAudioChannels()) + .minSegments(getMinSegments()).segmentLength(getSegmentLength()) + .breakOnNonKeyFrames(getBreakOnNonKeyFrames()).conditions(getConditions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TransportStreamTimestamp.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TransportStreamTimestamp.java new file mode 100644 index 0000000000000..44141bc2b27c9 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TransportStreamTimestamp.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets TransportStreamTimestamp + */ +public enum TransportStreamTimestamp { + + NONE("None"), + + ZERO("Zero"), + + VALID("Valid"); + + private String value; + + TransportStreamTimestamp(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TransportStreamTimestamp fromValue(String value) { + for (TransportStreamTimestamp b : TransportStreamTimestamp.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TunerChannelMapping.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TunerChannelMapping.java new file mode 100644 index 0000000000000..d9324d8ece7ce --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TunerChannelMapping.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TunerChannelMapping + */ +@JsonPropertyOrder({ TunerChannelMapping.JSON_PROPERTY_NAME, TunerChannelMapping.JSON_PROPERTY_PROVIDER_CHANNEL_NAME, + TunerChannelMapping.JSON_PROPERTY_PROVIDER_CHANNEL_ID, TunerChannelMapping.JSON_PROPERTY_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TunerChannelMapping { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_PROVIDER_CHANNEL_NAME = "ProviderChannelName"; + @org.eclipse.jdt.annotation.NonNull + private String providerChannelName; + + public static final String JSON_PROPERTY_PROVIDER_CHANNEL_ID = "ProviderChannelId"; + @org.eclipse.jdt.annotation.NonNull + private String providerChannelId; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public TunerChannelMapping() { + } + + public TunerChannelMapping name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public TunerChannelMapping providerChannelName(@org.eclipse.jdt.annotation.NonNull String providerChannelName) { + this.providerChannelName = providerChannelName; + return this; + } + + /** + * Get providerChannelName + * + * @return providerChannelName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProviderChannelName() { + return providerChannelName; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderChannelName(@org.eclipse.jdt.annotation.NonNull String providerChannelName) { + this.providerChannelName = providerChannelName; + } + + public TunerChannelMapping providerChannelId(@org.eclipse.jdt.annotation.NonNull String providerChannelId) { + this.providerChannelId = providerChannelId; + return this; + } + + /** + * Get providerChannelId + * + * @return providerChannelId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PROVIDER_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProviderChannelId() { + return providerChannelId; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderChannelId(@org.eclipse.jdt.annotation.NonNull String providerChannelId) { + this.providerChannelId = providerChannelId; + } + + public TunerChannelMapping id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + /** + * Return true if this TunerChannelMapping object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TunerChannelMapping tunerChannelMapping = (TunerChannelMapping) o; + return Objects.equals(this.name, tunerChannelMapping.name) + && Objects.equals(this.providerChannelName, tunerChannelMapping.providerChannelName) + && Objects.equals(this.providerChannelId, tunerChannelMapping.providerChannelId) + && Objects.equals(this.id, tunerChannelMapping.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, providerChannelName, providerChannelId, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TunerChannelMapping {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" providerChannelName: ").append(toIndentedString(providerChannelName)).append("\n"); + sb.append(" providerChannelId: ").append(toIndentedString(providerChannelId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `ProviderChannelName` to the URL query string + if (getProviderChannelName() != null) { + joiner.add(String.format("%sProviderChannelName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProviderChannelName())))); + } + + // add `ProviderChannelId` to the URL query string + if (getProviderChannelId() != null) { + joiner.add(String.format("%sProviderChannelId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getProviderChannelId())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TunerChannelMapping instance; + + public Builder() { + this(new TunerChannelMapping()); + } + + protected Builder(TunerChannelMapping instance) { + this.instance = instance; + } + + public TunerChannelMapping.Builder name(String name) { + this.instance.name = name; + return this; + } + + public TunerChannelMapping.Builder providerChannelName(String providerChannelName) { + this.instance.providerChannelName = providerChannelName; + return this; + } + + public TunerChannelMapping.Builder providerChannelId(String providerChannelId) { + this.instance.providerChannelId = providerChannelId; + return this; + } + + public TunerChannelMapping.Builder id(String id) { + this.instance.id = id; + return this; + } + + /** + * returns a built TunerChannelMapping instance. + * + * The builder is not reusable. + */ + public TunerChannelMapping build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TunerChannelMapping.Builder builder() { + return new TunerChannelMapping.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TunerChannelMapping.Builder toBuilder() { + return new TunerChannelMapping.Builder().name(getName()).providerChannelName(getProviderChannelName()) + .providerChannelId(getProviderChannelId()).id(getId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TunerHostInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TunerHostInfo.java new file mode 100644 index 0000000000000..0f5c515521f76 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TunerHostInfo.java @@ -0,0 +1,599 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TunerHostInfo + */ +@JsonPropertyOrder({ TunerHostInfo.JSON_PROPERTY_ID, TunerHostInfo.JSON_PROPERTY_URL, TunerHostInfo.JSON_PROPERTY_TYPE, + TunerHostInfo.JSON_PROPERTY_DEVICE_ID, TunerHostInfo.JSON_PROPERTY_FRIENDLY_NAME, + TunerHostInfo.JSON_PROPERTY_IMPORT_FAVORITES_ONLY, TunerHostInfo.JSON_PROPERTY_ALLOW_H_W_TRANSCODING, + TunerHostInfo.JSON_PROPERTY_ENABLE_STREAM_LOOPING, TunerHostInfo.JSON_PROPERTY_SOURCE, + TunerHostInfo.JSON_PROPERTY_TUNER_COUNT, TunerHostInfo.JSON_PROPERTY_USER_AGENT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TunerHostInfo { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private String id; + + public static final String JSON_PROPERTY_URL = "Url"; + @org.eclipse.jdt.annotation.NonNull + private String url; + + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_DEVICE_ID = "DeviceId"; + @org.eclipse.jdt.annotation.NonNull + private String deviceId; + + public static final String JSON_PROPERTY_FRIENDLY_NAME = "FriendlyName"; + @org.eclipse.jdt.annotation.NonNull + private String friendlyName; + + public static final String JSON_PROPERTY_IMPORT_FAVORITES_ONLY = "ImportFavoritesOnly"; + @org.eclipse.jdt.annotation.NonNull + private Boolean importFavoritesOnly; + + public static final String JSON_PROPERTY_ALLOW_H_W_TRANSCODING = "AllowHWTranscoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean allowHWTranscoding; + + public static final String JSON_PROPERTY_ENABLE_STREAM_LOOPING = "EnableStreamLooping"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableStreamLooping; + + public static final String JSON_PROPERTY_SOURCE = "Source"; + @org.eclipse.jdt.annotation.NonNull + private String source; + + public static final String JSON_PROPERTY_TUNER_COUNT = "TunerCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer tunerCount; + + public static final String JSON_PROPERTY_USER_AGENT = "UserAgent"; + @org.eclipse.jdt.annotation.NonNull + private String userAgent; + + public TunerHostInfo() { + } + + public TunerHostInfo id(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull String id) { + this.id = id; + } + + public TunerHostInfo url(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + return this; + } + + /** + * Get url + * + * @return url + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@org.eclipse.jdt.annotation.NonNull String url) { + this.url = url; + } + + public TunerHostInfo type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public TunerHostInfo deviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Get deviceId + * + * @return deviceId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceId() { + return deviceId; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceId(@org.eclipse.jdt.annotation.NonNull String deviceId) { + this.deviceId = deviceId; + } + + public TunerHostInfo friendlyName(@org.eclipse.jdt.annotation.NonNull String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get friendlyName + * + * @return friendlyName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FRIENDLY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFriendlyName() { + return friendlyName; + } + + @JsonProperty(JSON_PROPERTY_FRIENDLY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFriendlyName(@org.eclipse.jdt.annotation.NonNull String friendlyName) { + this.friendlyName = friendlyName; + } + + public TunerHostInfo importFavoritesOnly(@org.eclipse.jdt.annotation.NonNull Boolean importFavoritesOnly) { + this.importFavoritesOnly = importFavoritesOnly; + return this; + } + + /** + * Get importFavoritesOnly + * + * @return importFavoritesOnly + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMPORT_FAVORITES_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getImportFavoritesOnly() { + return importFavoritesOnly; + } + + @JsonProperty(JSON_PROPERTY_IMPORT_FAVORITES_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImportFavoritesOnly(@org.eclipse.jdt.annotation.NonNull Boolean importFavoritesOnly) { + this.importFavoritesOnly = importFavoritesOnly; + } + + public TunerHostInfo allowHWTranscoding(@org.eclipse.jdt.annotation.NonNull Boolean allowHWTranscoding) { + this.allowHWTranscoding = allowHWTranscoding; + return this; + } + + /** + * Get allowHWTranscoding + * + * @return allowHWTranscoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ALLOW_H_W_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowHWTranscoding() { + return allowHWTranscoding; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_H_W_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowHWTranscoding(@org.eclipse.jdt.annotation.NonNull Boolean allowHWTranscoding) { + this.allowHWTranscoding = allowHWTranscoding; + } + + public TunerHostInfo enableStreamLooping(@org.eclipse.jdt.annotation.NonNull Boolean enableStreamLooping) { + this.enableStreamLooping = enableStreamLooping; + return this; + } + + /** + * Get enableStreamLooping + * + * @return enableStreamLooping + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_STREAM_LOOPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableStreamLooping() { + return enableStreamLooping; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_STREAM_LOOPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableStreamLooping(@org.eclipse.jdt.annotation.NonNull Boolean enableStreamLooping) { + this.enableStreamLooping = enableStreamLooping; + } + + public TunerHostInfo source(@org.eclipse.jdt.annotation.NonNull String source) { + this.source = source; + return this; + } + + /** + * Get source + * + * @return source + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSource() { + return source; + } + + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSource(@org.eclipse.jdt.annotation.NonNull String source) { + this.source = source; + } + + public TunerHostInfo tunerCount(@org.eclipse.jdt.annotation.NonNull Integer tunerCount) { + this.tunerCount = tunerCount; + return this; + } + + /** + * Get tunerCount + * + * @return tunerCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TUNER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTunerCount() { + return tunerCount; + } + + @JsonProperty(JSON_PROPERTY_TUNER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTunerCount(@org.eclipse.jdt.annotation.NonNull Integer tunerCount) { + this.tunerCount = tunerCount; + } + + public TunerHostInfo userAgent(@org.eclipse.jdt.annotation.NonNull String userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + * Get userAgent + * + * @return userAgent + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_AGENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserAgent() { + return userAgent; + } + + @JsonProperty(JSON_PROPERTY_USER_AGENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserAgent(@org.eclipse.jdt.annotation.NonNull String userAgent) { + this.userAgent = userAgent; + } + + /** + * Return true if this TunerHostInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TunerHostInfo tunerHostInfo = (TunerHostInfo) o; + return Objects.equals(this.id, tunerHostInfo.id) && Objects.equals(this.url, tunerHostInfo.url) + && Objects.equals(this.type, tunerHostInfo.type) + && Objects.equals(this.deviceId, tunerHostInfo.deviceId) + && Objects.equals(this.friendlyName, tunerHostInfo.friendlyName) + && Objects.equals(this.importFavoritesOnly, tunerHostInfo.importFavoritesOnly) + && Objects.equals(this.allowHWTranscoding, tunerHostInfo.allowHWTranscoding) + && Objects.equals(this.enableStreamLooping, tunerHostInfo.enableStreamLooping) + && Objects.equals(this.source, tunerHostInfo.source) + && Objects.equals(this.tunerCount, tunerHostInfo.tunerCount) + && Objects.equals(this.userAgent, tunerHostInfo.userAgent); + } + + @Override + public int hashCode() { + return Objects.hash(id, url, type, deviceId, friendlyName, importFavoritesOnly, allowHWTranscoding, + enableStreamLooping, source, tunerCount, userAgent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TunerHostInfo {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" deviceId: ").append(toIndentedString(deviceId)).append("\n"); + sb.append(" friendlyName: ").append(toIndentedString(friendlyName)).append("\n"); + sb.append(" importFavoritesOnly: ").append(toIndentedString(importFavoritesOnly)).append("\n"); + sb.append(" allowHWTranscoding: ").append(toIndentedString(allowHWTranscoding)).append("\n"); + sb.append(" enableStreamLooping: ").append(toIndentedString(enableStreamLooping)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" tunerCount: ").append(toIndentedString(tunerCount)).append("\n"); + sb.append(" userAgent: ").append(toIndentedString(userAgent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `Url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format("%sUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUrl())))); + } + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `DeviceId` to the URL query string + if (getDeviceId() != null) { + joiner.add(String.format("%sDeviceId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDeviceId())))); + } + + // add `FriendlyName` to the URL query string + if (getFriendlyName() != null) { + joiner.add(String.format("%sFriendlyName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFriendlyName())))); + } + + // add `ImportFavoritesOnly` to the URL query string + if (getImportFavoritesOnly() != null) { + joiner.add(String.format("%sImportFavoritesOnly%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getImportFavoritesOnly())))); + } + + // add `AllowHWTranscoding` to the URL query string + if (getAllowHWTranscoding() != null) { + joiner.add(String.format("%sAllowHWTranscoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAllowHWTranscoding())))); + } + + // add `EnableStreamLooping` to the URL query string + if (getEnableStreamLooping() != null) { + joiner.add(String.format("%sEnableStreamLooping%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableStreamLooping())))); + } + + // add `Source` to the URL query string + if (getSource() != null) { + joiner.add(String.format("%sSource%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSource())))); + } + + // add `TunerCount` to the URL query string + if (getTunerCount() != null) { + joiner.add(String.format("%sTunerCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTunerCount())))); + } + + // add `UserAgent` to the URL query string + if (getUserAgent() != null) { + joiner.add(String.format("%sUserAgent%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserAgent())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TunerHostInfo instance; + + public Builder() { + this(new TunerHostInfo()); + } + + protected Builder(TunerHostInfo instance) { + this.instance = instance; + } + + public TunerHostInfo.Builder id(String id) { + this.instance.id = id; + return this; + } + + public TunerHostInfo.Builder url(String url) { + this.instance.url = url; + return this; + } + + public TunerHostInfo.Builder type(String type) { + this.instance.type = type; + return this; + } + + public TunerHostInfo.Builder deviceId(String deviceId) { + this.instance.deviceId = deviceId; + return this; + } + + public TunerHostInfo.Builder friendlyName(String friendlyName) { + this.instance.friendlyName = friendlyName; + return this; + } + + public TunerHostInfo.Builder importFavoritesOnly(Boolean importFavoritesOnly) { + this.instance.importFavoritesOnly = importFavoritesOnly; + return this; + } + + public TunerHostInfo.Builder allowHWTranscoding(Boolean allowHWTranscoding) { + this.instance.allowHWTranscoding = allowHWTranscoding; + return this; + } + + public TunerHostInfo.Builder enableStreamLooping(Boolean enableStreamLooping) { + this.instance.enableStreamLooping = enableStreamLooping; + return this; + } + + public TunerHostInfo.Builder source(String source) { + this.instance.source = source; + return this; + } + + public TunerHostInfo.Builder tunerCount(Integer tunerCount) { + this.instance.tunerCount = tunerCount; + return this; + } + + public TunerHostInfo.Builder userAgent(String userAgent) { + this.instance.userAgent = userAgent; + return this; + } + + /** + * returns a built TunerHostInfo instance. + * + * The builder is not reusable. + */ + public TunerHostInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TunerHostInfo.Builder builder() { + return new TunerHostInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TunerHostInfo.Builder toBuilder() { + return new TunerHostInfo.Builder().id(getId()).url(getUrl()).type(getType()).deviceId(getDeviceId()) + .friendlyName(getFriendlyName()).importFavoritesOnly(getImportFavoritesOnly()) + .allowHWTranscoding(getAllowHWTranscoding()).enableStreamLooping(getEnableStreamLooping()) + .source(getSource()).tunerCount(getTunerCount()).userAgent(getUserAgent()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TypeOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TypeOptions.java new file mode 100644 index 0000000000000..ad8bc2090de68 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/TypeOptions.java @@ -0,0 +1,456 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TypeOptions + */ +@JsonPropertyOrder({ TypeOptions.JSON_PROPERTY_TYPE, TypeOptions.JSON_PROPERTY_METADATA_FETCHERS, + TypeOptions.JSON_PROPERTY_METADATA_FETCHER_ORDER, TypeOptions.JSON_PROPERTY_IMAGE_FETCHERS, + TypeOptions.JSON_PROPERTY_IMAGE_FETCHER_ORDER, TypeOptions.JSON_PROPERTY_IMAGE_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class TypeOptions { + public static final String JSON_PROPERTY_TYPE = "Type"; + @org.eclipse.jdt.annotation.NonNull + private String type; + + public static final String JSON_PROPERTY_METADATA_FETCHERS = "MetadataFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List metadataFetchers; + + public static final String JSON_PROPERTY_METADATA_FETCHER_ORDER = "MetadataFetcherOrder"; + @org.eclipse.jdt.annotation.NonNull + private List metadataFetcherOrder; + + public static final String JSON_PROPERTY_IMAGE_FETCHERS = "ImageFetchers"; + @org.eclipse.jdt.annotation.NonNull + private List imageFetchers; + + public static final String JSON_PROPERTY_IMAGE_FETCHER_ORDER = "ImageFetcherOrder"; + @org.eclipse.jdt.annotation.NonNull + private List imageFetcherOrder; + + public static final String JSON_PROPERTY_IMAGE_OPTIONS = "ImageOptions"; + @org.eclipse.jdt.annotation.NonNull + private List imageOptions; + + public TypeOptions() { + } + + public TypeOptions type(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@org.eclipse.jdt.annotation.NonNull String type) { + this.type = type; + } + + public TypeOptions metadataFetchers(@org.eclipse.jdt.annotation.NonNull List metadataFetchers) { + this.metadataFetchers = metadataFetchers; + return this; + } + + public TypeOptions addMetadataFetchersItem(String metadataFetchersItem) { + if (this.metadataFetchers == null) { + this.metadataFetchers = new ArrayList<>(); + } + this.metadataFetchers.add(metadataFetchersItem); + return this; + } + + /** + * Get metadataFetchers + * + * @return metadataFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMetadataFetchers() { + return metadataFetchers; + } + + @JsonProperty(JSON_PROPERTY_METADATA_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataFetchers(@org.eclipse.jdt.annotation.NonNull List metadataFetchers) { + this.metadataFetchers = metadataFetchers; + } + + public TypeOptions metadataFetcherOrder(@org.eclipse.jdt.annotation.NonNull List metadataFetcherOrder) { + this.metadataFetcherOrder = metadataFetcherOrder; + return this; + } + + public TypeOptions addMetadataFetcherOrderItem(String metadataFetcherOrderItem) { + if (this.metadataFetcherOrder == null) { + this.metadataFetcherOrder = new ArrayList<>(); + } + this.metadataFetcherOrder.add(metadataFetcherOrderItem); + return this; + } + + /** + * Get metadataFetcherOrder + * + * @return metadataFetcherOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_METADATA_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMetadataFetcherOrder() { + return metadataFetcherOrder; + } + + @JsonProperty(JSON_PROPERTY_METADATA_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadataFetcherOrder(@org.eclipse.jdt.annotation.NonNull List metadataFetcherOrder) { + this.metadataFetcherOrder = metadataFetcherOrder; + } + + public TypeOptions imageFetchers(@org.eclipse.jdt.annotation.NonNull List imageFetchers) { + this.imageFetchers = imageFetchers; + return this; + } + + public TypeOptions addImageFetchersItem(String imageFetchersItem) { + if (this.imageFetchers == null) { + this.imageFetchers = new ArrayList<>(); + } + this.imageFetchers.add(imageFetchersItem); + return this; + } + + /** + * Get imageFetchers + * + * @return imageFetchers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getImageFetchers() { + return imageFetchers; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_FETCHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageFetchers(@org.eclipse.jdt.annotation.NonNull List imageFetchers) { + this.imageFetchers = imageFetchers; + } + + public TypeOptions imageFetcherOrder(@org.eclipse.jdt.annotation.NonNull List imageFetcherOrder) { + this.imageFetcherOrder = imageFetcherOrder; + return this; + } + + public TypeOptions addImageFetcherOrderItem(String imageFetcherOrderItem) { + if (this.imageFetcherOrder == null) { + this.imageFetcherOrder = new ArrayList<>(); + } + this.imageFetcherOrder.add(imageFetcherOrderItem); + return this; + } + + /** + * Get imageFetcherOrder + * + * @return imageFetcherOrder + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getImageFetcherOrder() { + return imageFetcherOrder; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_FETCHER_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageFetcherOrder(@org.eclipse.jdt.annotation.NonNull List imageFetcherOrder) { + this.imageFetcherOrder = imageFetcherOrder; + } + + public TypeOptions imageOptions(@org.eclipse.jdt.annotation.NonNull List imageOptions) { + this.imageOptions = imageOptions; + return this; + } + + public TypeOptions addImageOptionsItem(ImageOption imageOptionsItem) { + if (this.imageOptions == null) { + this.imageOptions = new ArrayList<>(); + } + this.imageOptions.add(imageOptionsItem); + return this; + } + + /** + * Get imageOptions + * + * @return imageOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IMAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getImageOptions() { + return imageOptions; + } + + @JsonProperty(JSON_PROPERTY_IMAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageOptions(@org.eclipse.jdt.annotation.NonNull List imageOptions) { + this.imageOptions = imageOptions; + } + + /** + * Return true if this TypeOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeOptions typeOptions = (TypeOptions) o; + return Objects.equals(this.type, typeOptions.type) + && Objects.equals(this.metadataFetchers, typeOptions.metadataFetchers) + && Objects.equals(this.metadataFetcherOrder, typeOptions.metadataFetcherOrder) + && Objects.equals(this.imageFetchers, typeOptions.imageFetchers) + && Objects.equals(this.imageFetcherOrder, typeOptions.imageFetcherOrder) + && Objects.equals(this.imageOptions, typeOptions.imageOptions); + } + + @Override + public int hashCode() { + return Objects.hash(type, metadataFetchers, metadataFetcherOrder, imageFetchers, imageFetcherOrder, + imageOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeOptions {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" metadataFetchers: ").append(toIndentedString(metadataFetchers)).append("\n"); + sb.append(" metadataFetcherOrder: ").append(toIndentedString(metadataFetcherOrder)).append("\n"); + sb.append(" imageFetchers: ").append(toIndentedString(imageFetchers)).append("\n"); + sb.append(" imageFetcherOrder: ").append(toIndentedString(imageFetcherOrder)).append("\n"); + sb.append(" imageOptions: ").append(toIndentedString(imageOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%sType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `MetadataFetchers` to the URL query string + if (getMetadataFetchers() != null) { + for (int i = 0; i < getMetadataFetchers().size(); i++) { + joiner.add(String.format("%sMetadataFetchers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMetadataFetchers().get(i))))); + } + } + + // add `MetadataFetcherOrder` to the URL query string + if (getMetadataFetcherOrder() != null) { + for (int i = 0; i < getMetadataFetcherOrder().size(); i++) { + joiner.add(String.format("%sMetadataFetcherOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMetadataFetcherOrder().get(i))))); + } + } + + // add `ImageFetchers` to the URL query string + if (getImageFetchers() != null) { + for (int i = 0; i < getImageFetchers().size(); i++) { + joiner.add(String.format("%sImageFetchers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getImageFetchers().get(i))))); + } + } + + // add `ImageFetcherOrder` to the URL query string + if (getImageFetcherOrder() != null) { + for (int i = 0; i < getImageFetcherOrder().size(); i++) { + joiner.add(String.format("%sImageFetcherOrder%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getImageFetcherOrder().get(i))))); + } + } + + // add `ImageOptions` to the URL query string + if (getImageOptions() != null) { + for (int i = 0; i < getImageOptions().size(); i++) { + if (getImageOptions().get(i) != null) { + joiner.add(getImageOptions().get(i).toUrlQueryString(String.format("%sImageOptions%s%s", prefix, + suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private TypeOptions instance; + + public Builder() { + this(new TypeOptions()); + } + + protected Builder(TypeOptions instance) { + this.instance = instance; + } + + public TypeOptions.Builder type(String type) { + this.instance.type = type; + return this; + } + + public TypeOptions.Builder metadataFetchers(List metadataFetchers) { + this.instance.metadataFetchers = metadataFetchers; + return this; + } + + public TypeOptions.Builder metadataFetcherOrder(List metadataFetcherOrder) { + this.instance.metadataFetcherOrder = metadataFetcherOrder; + return this; + } + + public TypeOptions.Builder imageFetchers(List imageFetchers) { + this.instance.imageFetchers = imageFetchers; + return this; + } + + public TypeOptions.Builder imageFetcherOrder(List imageFetcherOrder) { + this.instance.imageFetcherOrder = imageFetcherOrder; + return this; + } + + public TypeOptions.Builder imageOptions(List imageOptions) { + this.instance.imageOptions = imageOptions; + return this; + } + + /** + * returns a built TypeOptions instance. + * + * The builder is not reusable. + */ + public TypeOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TypeOptions.Builder builder() { + return new TypeOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TypeOptions.Builder toBuilder() { + return new TypeOptions.Builder().type(getType()).metadataFetchers(getMetadataFetchers()) + .metadataFetcherOrder(getMetadataFetcherOrder()).imageFetchers(getImageFetchers()) + .imageFetcherOrder(getImageFetcherOrder()).imageOptions(getImageOptions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UnratedItem.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UnratedItem.java new file mode 100644 index 0000000000000..df100ca3923ab --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UnratedItem.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * An enum representing an unrated item. + */ +public enum UnratedItem { + + MOVIE("Movie"), + + TRAILER("Trailer"), + + SERIES("Series"), + + MUSIC("Music"), + + BOOK("Book"), + + LIVE_TV_CHANNEL("LiveTvChannel"), + + LIVE_TV_PROGRAM("LiveTvProgram"), + + CHANNEL_CONTENT("ChannelContent"), + + OTHER("Other"); + + private String value; + + UnratedItem(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static UnratedItem fromValue(String value) { + for (UnratedItem b : UnratedItem.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UpdateLibraryOptionsDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UpdateLibraryOptionsDto.java new file mode 100644 index 0000000000000..2bb8bf6a89dca --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UpdateLibraryOptionsDto.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Update library options dto. + */ +@JsonPropertyOrder({ UpdateLibraryOptionsDto.JSON_PROPERTY_ID, UpdateLibraryOptionsDto.JSON_PROPERTY_LIBRARY_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UpdateLibraryOptionsDto { + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_LIBRARY_OPTIONS = "LibraryOptions"; + @org.eclipse.jdt.annotation.NonNull + private LibraryOptions libraryOptions; + + public UpdateLibraryOptionsDto() { + } + + public UpdateLibraryOptionsDto id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Gets or sets the library item id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public UpdateLibraryOptionsDto libraryOptions(@org.eclipse.jdt.annotation.NonNull LibraryOptions libraryOptions) { + this.libraryOptions = libraryOptions; + return this; + } + + /** + * Gets or sets library options. + * + * @return libraryOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIBRARY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LibraryOptions getLibraryOptions() { + return libraryOptions; + } + + @JsonProperty(JSON_PROPERTY_LIBRARY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLibraryOptions(@org.eclipse.jdt.annotation.NonNull LibraryOptions libraryOptions) { + this.libraryOptions = libraryOptions; + } + + /** + * Return true if this UpdateLibraryOptionsDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateLibraryOptionsDto updateLibraryOptionsDto = (UpdateLibraryOptionsDto) o; + return Objects.equals(this.id, updateLibraryOptionsDto.id) + && Objects.equals(this.libraryOptions, updateLibraryOptionsDto.libraryOptions); + } + + @Override + public int hashCode() { + return Objects.hash(id, libraryOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateLibraryOptionsDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" libraryOptions: ").append(toIndentedString(libraryOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `LibraryOptions` to the URL query string + if (getLibraryOptions() != null) { + joiner.add(getLibraryOptions().toUrlQueryString(prefix + "LibraryOptions" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private UpdateLibraryOptionsDto instance; + + public Builder() { + this(new UpdateLibraryOptionsDto()); + } + + protected Builder(UpdateLibraryOptionsDto instance) { + this.instance = instance; + } + + public UpdateLibraryOptionsDto.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public UpdateLibraryOptionsDto.Builder libraryOptions(LibraryOptions libraryOptions) { + this.instance.libraryOptions = libraryOptions; + return this; + } + + /** + * returns a built UpdateLibraryOptionsDto instance. + * + * The builder is not reusable. + */ + public UpdateLibraryOptionsDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UpdateLibraryOptionsDto.Builder builder() { + return new UpdateLibraryOptionsDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UpdateLibraryOptionsDto.Builder toBuilder() { + return new UpdateLibraryOptionsDto.Builder().id(getId()).libraryOptions(getLibraryOptions()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UpdateMediaPathRequestDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UpdateMediaPathRequestDto.java new file mode 100644 index 0000000000000..0b0df82d760f1 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UpdateMediaPathRequestDto.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Update library options dto. + */ +@JsonPropertyOrder({ UpdateMediaPathRequestDto.JSON_PROPERTY_NAME, UpdateMediaPathRequestDto.JSON_PROPERTY_PATH_INFO }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UpdateMediaPathRequestDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_PATH_INFO = "PathInfo"; + @org.eclipse.jdt.annotation.Nullable + private MediaPathInfo pathInfo; + + public UpdateMediaPathRequestDto() { + } + + public UpdateMediaPathRequestDto name(@org.eclipse.jdt.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the library name. + * + * @return name + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@org.eclipse.jdt.annotation.Nullable String name) { + this.name = name; + } + + public UpdateMediaPathRequestDto pathInfo(@org.eclipse.jdt.annotation.Nullable MediaPathInfo pathInfo) { + this.pathInfo = pathInfo; + return this; + } + + /** + * Gets or sets library folder path information. + * + * @return pathInfo + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATH_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MediaPathInfo getPathInfo() { + return pathInfo; + } + + @JsonProperty(JSON_PROPERTY_PATH_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPathInfo(@org.eclipse.jdt.annotation.Nullable MediaPathInfo pathInfo) { + this.pathInfo = pathInfo; + } + + /** + * Return true if this UpdateMediaPathRequestDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateMediaPathRequestDto updateMediaPathRequestDto = (UpdateMediaPathRequestDto) o; + return Objects.equals(this.name, updateMediaPathRequestDto.name) + && Objects.equals(this.pathInfo, updateMediaPathRequestDto.pathInfo); + } + + @Override + public int hashCode() { + return Objects.hash(name, pathInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateMediaPathRequestDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" pathInfo: ").append(toIndentedString(pathInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `PathInfo` to the URL query string + if (getPathInfo() != null) { + joiner.add(getPathInfo().toUrlQueryString(prefix + "PathInfo" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private UpdateMediaPathRequestDto instance; + + public Builder() { + this(new UpdateMediaPathRequestDto()); + } + + protected Builder(UpdateMediaPathRequestDto instance) { + this.instance = instance; + } + + public UpdateMediaPathRequestDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public UpdateMediaPathRequestDto.Builder pathInfo(MediaPathInfo pathInfo) { + this.instance.pathInfo = pathInfo; + return this; + } + + /** + * returns a built UpdateMediaPathRequestDto instance. + * + * The builder is not reusable. + */ + public UpdateMediaPathRequestDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UpdateMediaPathRequestDto.Builder builder() { + return new UpdateMediaPathRequestDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UpdateMediaPathRequestDto.Builder toBuilder() { + return new UpdateMediaPathRequestDto.Builder().name(getName()).pathInfo(getPathInfo()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UpdateUserEasyPassword.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UpdateUserEasyPassword.java new file mode 100644 index 0000000000000..af0bd42fdb582 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UpdateUserEasyPassword.java @@ -0,0 +1,274 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The update user easy password request body. + */ +@JsonPropertyOrder({ UpdateUserEasyPassword.JSON_PROPERTY_NEW_PASSWORD, UpdateUserEasyPassword.JSON_PROPERTY_NEW_PW, + UpdateUserEasyPassword.JSON_PROPERTY_RESET_PASSWORD }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UpdateUserEasyPassword { + public static final String JSON_PROPERTY_NEW_PASSWORD = "NewPassword"; + @org.eclipse.jdt.annotation.NonNull + private String newPassword; + + public static final String JSON_PROPERTY_NEW_PW = "NewPw"; + @org.eclipse.jdt.annotation.NonNull + private String newPw; + + public static final String JSON_PROPERTY_RESET_PASSWORD = "ResetPassword"; + @org.eclipse.jdt.annotation.NonNull + private Boolean resetPassword; + + public UpdateUserEasyPassword() { + } + + public UpdateUserEasyPassword newPassword(@org.eclipse.jdt.annotation.NonNull String newPassword) { + this.newPassword = newPassword; + return this; + } + + /** + * Gets or sets the new sha1-hashed password. + * + * @return newPassword + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NEW_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNewPassword() { + return newPassword; + } + + @JsonProperty(JSON_PROPERTY_NEW_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewPassword(@org.eclipse.jdt.annotation.NonNull String newPassword) { + this.newPassword = newPassword; + } + + public UpdateUserEasyPassword newPw(@org.eclipse.jdt.annotation.NonNull String newPw) { + this.newPw = newPw; + return this; + } + + /** + * Gets or sets the new password. + * + * @return newPw + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NEW_PW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNewPw() { + return newPw; + } + + @JsonProperty(JSON_PROPERTY_NEW_PW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewPw(@org.eclipse.jdt.annotation.NonNull String newPw) { + this.newPw = newPw; + } + + public UpdateUserEasyPassword resetPassword(@org.eclipse.jdt.annotation.NonNull Boolean resetPassword) { + this.resetPassword = resetPassword; + return this; + } + + /** + * Gets or sets a value indicating whether to reset the password. + * + * @return resetPassword + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RESET_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getResetPassword() { + return resetPassword; + } + + @JsonProperty(JSON_PROPERTY_RESET_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResetPassword(@org.eclipse.jdt.annotation.NonNull Boolean resetPassword) { + this.resetPassword = resetPassword; + } + + /** + * Return true if this UpdateUserEasyPassword object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserEasyPassword updateUserEasyPassword = (UpdateUserEasyPassword) o; + return Objects.equals(this.newPassword, updateUserEasyPassword.newPassword) + && Objects.equals(this.newPw, updateUserEasyPassword.newPw) + && Objects.equals(this.resetPassword, updateUserEasyPassword.resetPassword); + } + + @Override + public int hashCode() { + return Objects.hash(newPassword, newPw, resetPassword); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateUserEasyPassword {\n"); + sb.append(" newPassword: ").append(toIndentedString(newPassword)).append("\n"); + sb.append(" newPw: ").append(toIndentedString(newPw)).append("\n"); + sb.append(" resetPassword: ").append(toIndentedString(resetPassword)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `NewPassword` to the URL query string + if (getNewPassword() != null) { + joiner.add(String.format("%sNewPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getNewPassword())))); + } + + // add `NewPw` to the URL query string + if (getNewPw() != null) { + joiner.add(String.format("%sNewPw%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getNewPw())))); + } + + // add `ResetPassword` to the URL query string + if (getResetPassword() != null) { + joiner.add(String.format("%sResetPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getResetPassword())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UpdateUserEasyPassword instance; + + public Builder() { + this(new UpdateUserEasyPassword()); + } + + protected Builder(UpdateUserEasyPassword instance) { + this.instance = instance; + } + + public UpdateUserEasyPassword.Builder newPassword(String newPassword) { + this.instance.newPassword = newPassword; + return this; + } + + public UpdateUserEasyPassword.Builder newPw(String newPw) { + this.instance.newPw = newPw; + return this; + } + + public UpdateUserEasyPassword.Builder resetPassword(Boolean resetPassword) { + this.instance.resetPassword = resetPassword; + return this; + } + + /** + * returns a built UpdateUserEasyPassword instance. + * + * The builder is not reusable. + */ + public UpdateUserEasyPassword build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UpdateUserEasyPassword.Builder builder() { + return new UpdateUserEasyPassword.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UpdateUserEasyPassword.Builder toBuilder() { + return new UpdateUserEasyPassword.Builder().newPassword(getNewPassword()).newPw(getNewPw()) + .resetPassword(getResetPassword()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UpdateUserPassword.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UpdateUserPassword.java new file mode 100644 index 0000000000000..ebdc085de1bdd --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UpdateUserPassword.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The update user password request body. + */ +@JsonPropertyOrder({ UpdateUserPassword.JSON_PROPERTY_CURRENT_PASSWORD, UpdateUserPassword.JSON_PROPERTY_CURRENT_PW, + UpdateUserPassword.JSON_PROPERTY_NEW_PW, UpdateUserPassword.JSON_PROPERTY_RESET_PASSWORD }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UpdateUserPassword { + public static final String JSON_PROPERTY_CURRENT_PASSWORD = "CurrentPassword"; + @org.eclipse.jdt.annotation.NonNull + private String currentPassword; + + public static final String JSON_PROPERTY_CURRENT_PW = "CurrentPw"; + @org.eclipse.jdt.annotation.NonNull + private String currentPw; + + public static final String JSON_PROPERTY_NEW_PW = "NewPw"; + @org.eclipse.jdt.annotation.NonNull + private String newPw; + + public static final String JSON_PROPERTY_RESET_PASSWORD = "ResetPassword"; + @org.eclipse.jdt.annotation.NonNull + private Boolean resetPassword; + + public UpdateUserPassword() { + } + + public UpdateUserPassword currentPassword(@org.eclipse.jdt.annotation.NonNull String currentPassword) { + this.currentPassword = currentPassword; + return this; + } + + /** + * Gets or sets the current sha1-hashed password. + * + * @return currentPassword + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CURRENT_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrentPassword() { + return currentPassword; + } + + @JsonProperty(JSON_PROPERTY_CURRENT_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrentPassword(@org.eclipse.jdt.annotation.NonNull String currentPassword) { + this.currentPassword = currentPassword; + } + + public UpdateUserPassword currentPw(@org.eclipse.jdt.annotation.NonNull String currentPw) { + this.currentPw = currentPw; + return this; + } + + /** + * Gets or sets the current plain text password. + * + * @return currentPw + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CURRENT_PW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrentPw() { + return currentPw; + } + + @JsonProperty(JSON_PROPERTY_CURRENT_PW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrentPw(@org.eclipse.jdt.annotation.NonNull String currentPw) { + this.currentPw = currentPw; + } + + public UpdateUserPassword newPw(@org.eclipse.jdt.annotation.NonNull String newPw) { + this.newPw = newPw; + return this; + } + + /** + * Gets or sets the new plain text password. + * + * @return newPw + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NEW_PW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNewPw() { + return newPw; + } + + @JsonProperty(JSON_PROPERTY_NEW_PW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewPw(@org.eclipse.jdt.annotation.NonNull String newPw) { + this.newPw = newPw; + } + + public UpdateUserPassword resetPassword(@org.eclipse.jdt.annotation.NonNull Boolean resetPassword) { + this.resetPassword = resetPassword; + return this; + } + + /** + * Gets or sets a value indicating whether to reset the password. + * + * @return resetPassword + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RESET_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getResetPassword() { + return resetPassword; + } + + @JsonProperty(JSON_PROPERTY_RESET_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResetPassword(@org.eclipse.jdt.annotation.NonNull Boolean resetPassword) { + this.resetPassword = resetPassword; + } + + /** + * Return true if this UpdateUserPassword object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserPassword updateUserPassword = (UpdateUserPassword) o; + return Objects.equals(this.currentPassword, updateUserPassword.currentPassword) + && Objects.equals(this.currentPw, updateUserPassword.currentPw) + && Objects.equals(this.newPw, updateUserPassword.newPw) + && Objects.equals(this.resetPassword, updateUserPassword.resetPassword); + } + + @Override + public int hashCode() { + return Objects.hash(currentPassword, currentPw, newPw, resetPassword); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateUserPassword {\n"); + sb.append(" currentPassword: ").append(toIndentedString(currentPassword)).append("\n"); + sb.append(" currentPw: ").append(toIndentedString(currentPw)).append("\n"); + sb.append(" newPw: ").append(toIndentedString(newPw)).append("\n"); + sb.append(" resetPassword: ").append(toIndentedString(resetPassword)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `CurrentPassword` to the URL query string + if (getCurrentPassword() != null) { + joiner.add(String.format("%sCurrentPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCurrentPassword())))); + } + + // add `CurrentPw` to the URL query string + if (getCurrentPw() != null) { + joiner.add(String.format("%sCurrentPw%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCurrentPw())))); + } + + // add `NewPw` to the URL query string + if (getNewPw() != null) { + joiner.add(String.format("%sNewPw%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getNewPw())))); + } + + // add `ResetPassword` to the URL query string + if (getResetPassword() != null) { + joiner.add(String.format("%sResetPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getResetPassword())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UpdateUserPassword instance; + + public Builder() { + this(new UpdateUserPassword()); + } + + protected Builder(UpdateUserPassword instance) { + this.instance = instance; + } + + public UpdateUserPassword.Builder currentPassword(String currentPassword) { + this.instance.currentPassword = currentPassword; + return this; + } + + public UpdateUserPassword.Builder currentPw(String currentPw) { + this.instance.currentPw = currentPw; + return this; + } + + public UpdateUserPassword.Builder newPw(String newPw) { + this.instance.newPw = newPw; + return this; + } + + public UpdateUserPassword.Builder resetPassword(Boolean resetPassword) { + this.instance.resetPassword = resetPassword; + return this; + } + + /** + * returns a built UpdateUserPassword instance. + * + * The builder is not reusable. + */ + public UpdateUserPassword build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UpdateUserPassword.Builder builder() { + return new UpdateUserPassword.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UpdateUserPassword.Builder toBuilder() { + return new UpdateUserPassword.Builder().currentPassword(getCurrentPassword()).currentPw(getCurrentPw()) + .newPw(getNewPw()).resetPassword(getResetPassword()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UploadSubtitleDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UploadSubtitleDto.java new file mode 100644 index 0000000000000..25b4efb892723 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UploadSubtitleDto.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Upload subtitles dto. + */ +@JsonPropertyOrder({ UploadSubtitleDto.JSON_PROPERTY_LANGUAGE, UploadSubtitleDto.JSON_PROPERTY_FORMAT, + UploadSubtitleDto.JSON_PROPERTY_IS_FORCED, UploadSubtitleDto.JSON_PROPERTY_DATA }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UploadSubtitleDto { + public static final String JSON_PROPERTY_LANGUAGE = "Language"; + @org.eclipse.jdt.annotation.Nullable + private String language; + + public static final String JSON_PROPERTY_FORMAT = "Format"; + @org.eclipse.jdt.annotation.Nullable + private String format; + + public static final String JSON_PROPERTY_IS_FORCED = "IsForced"; + @org.eclipse.jdt.annotation.Nullable + private Boolean isForced; + + public static final String JSON_PROPERTY_DATA = "Data"; + @org.eclipse.jdt.annotation.Nullable + private String data; + + public UploadSubtitleDto() { + } + + public UploadSubtitleDto language(@org.eclipse.jdt.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * Gets or sets the subtitle language. + * + * @return language + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getLanguage() { + return language; + } + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLanguage(@org.eclipse.jdt.annotation.Nullable String language) { + this.language = language; + } + + public UploadSubtitleDto format(@org.eclipse.jdt.annotation.Nullable String format) { + this.format = format; + return this; + } + + /** + * Gets or sets the subtitle format. + * + * @return format + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFormat() { + return format; + } + + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFormat(@org.eclipse.jdt.annotation.Nullable String format) { + this.format = format; + } + + public UploadSubtitleDto isForced(@org.eclipse.jdt.annotation.Nullable Boolean isForced) { + this.isForced = isForced; + return this; + } + + /** + * Gets or sets a value indicating whether the subtitle is forced. + * + * @return isForced + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_FORCED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsForced() { + return isForced; + } + + @JsonProperty(JSON_PROPERTY_IS_FORCED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsForced(@org.eclipse.jdt.annotation.Nullable Boolean isForced) { + this.isForced = isForced; + } + + public UploadSubtitleDto data(@org.eclipse.jdt.annotation.Nullable String data) { + this.data = data; + return this; + } + + /** + * Gets or sets the subtitle data. + * + * @return data + */ + @org.eclipse.jdt.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setData(@org.eclipse.jdt.annotation.Nullable String data) { + this.data = data; + } + + /** + * Return true if this UploadSubtitleDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UploadSubtitleDto uploadSubtitleDto = (UploadSubtitleDto) o; + return Objects.equals(this.language, uploadSubtitleDto.language) + && Objects.equals(this.format, uploadSubtitleDto.format) + && Objects.equals(this.isForced, uploadSubtitleDto.isForced) + && Objects.equals(this.data, uploadSubtitleDto.data); + } + + @Override + public int hashCode() { + return Objects.hash(language, format, isForced, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UploadSubtitleDto {\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" isForced: ").append(toIndentedString(isForced)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Language` to the URL query string + if (getLanguage() != null) { + joiner.add(String.format("%sLanguage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLanguage())))); + } + + // add `Format` to the URL query string + if (getFormat() != null) { + joiner.add(String.format("%sFormat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getFormat())))); + } + + // add `IsForced` to the URL query string + if (getIsForced() != null) { + joiner.add(String.format("%sIsForced%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsForced())))); + } + + // add `Data` to the URL query string + if (getData() != null) { + joiner.add(String.format("%sData%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getData())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UploadSubtitleDto instance; + + public Builder() { + this(new UploadSubtitleDto()); + } + + protected Builder(UploadSubtitleDto instance) { + this.instance = instance; + } + + public UploadSubtitleDto.Builder language(String language) { + this.instance.language = language; + return this; + } + + public UploadSubtitleDto.Builder format(String format) { + this.instance.format = format; + return this; + } + + public UploadSubtitleDto.Builder isForced(Boolean isForced) { + this.instance.isForced = isForced; + return this; + } + + public UploadSubtitleDto.Builder data(String data) { + this.instance.data = data; + return this; + } + + /** + * returns a built UploadSubtitleDto instance. + * + * The builder is not reusable. + */ + public UploadSubtitleDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UploadSubtitleDto.Builder builder() { + return new UploadSubtitleDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UploadSubtitleDto.Builder toBuilder() { + return new UploadSubtitleDto.Builder().language(getLanguage()).format(getFormat()).isForced(getIsForced()) + .data(getData()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UserConfiguration.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UserConfiguration.java new file mode 100644 index 0000000000000..1095161acdc2c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UserConfiguration.java @@ -0,0 +1,827 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class UserConfiguration. + */ +@JsonPropertyOrder({ UserConfiguration.JSON_PROPERTY_AUDIO_LANGUAGE_PREFERENCE, + UserConfiguration.JSON_PROPERTY_PLAY_DEFAULT_AUDIO_TRACK, + UserConfiguration.JSON_PROPERTY_SUBTITLE_LANGUAGE_PREFERENCE, + UserConfiguration.JSON_PROPERTY_DISPLAY_MISSING_EPISODES, UserConfiguration.JSON_PROPERTY_GROUPED_FOLDERS, + UserConfiguration.JSON_PROPERTY_SUBTITLE_MODE, UserConfiguration.JSON_PROPERTY_DISPLAY_COLLECTIONS_VIEW, + UserConfiguration.JSON_PROPERTY_ENABLE_LOCAL_PASSWORD, UserConfiguration.JSON_PROPERTY_ORDERED_VIEWS, + UserConfiguration.JSON_PROPERTY_LATEST_ITEMS_EXCLUDES, UserConfiguration.JSON_PROPERTY_MY_MEDIA_EXCLUDES, + UserConfiguration.JSON_PROPERTY_HIDE_PLAYED_IN_LATEST, + UserConfiguration.JSON_PROPERTY_REMEMBER_AUDIO_SELECTIONS, + UserConfiguration.JSON_PROPERTY_REMEMBER_SUBTITLE_SELECTIONS, + UserConfiguration.JSON_PROPERTY_ENABLE_NEXT_EPISODE_AUTO_PLAY }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserConfiguration { + public static final String JSON_PROPERTY_AUDIO_LANGUAGE_PREFERENCE = "AudioLanguagePreference"; + @org.eclipse.jdt.annotation.NonNull + private String audioLanguagePreference; + + public static final String JSON_PROPERTY_PLAY_DEFAULT_AUDIO_TRACK = "PlayDefaultAudioTrack"; + @org.eclipse.jdt.annotation.NonNull + private Boolean playDefaultAudioTrack; + + public static final String JSON_PROPERTY_SUBTITLE_LANGUAGE_PREFERENCE = "SubtitleLanguagePreference"; + @org.eclipse.jdt.annotation.NonNull + private String subtitleLanguagePreference; + + public static final String JSON_PROPERTY_DISPLAY_MISSING_EPISODES = "DisplayMissingEpisodes"; + @org.eclipse.jdt.annotation.NonNull + private Boolean displayMissingEpisodes; + + public static final String JSON_PROPERTY_GROUPED_FOLDERS = "GroupedFolders"; + @org.eclipse.jdt.annotation.NonNull + private List groupedFolders = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUBTITLE_MODE = "SubtitleMode"; + @org.eclipse.jdt.annotation.NonNull + private SubtitlePlaybackMode subtitleMode; + + public static final String JSON_PROPERTY_DISPLAY_COLLECTIONS_VIEW = "DisplayCollectionsView"; + @org.eclipse.jdt.annotation.NonNull + private Boolean displayCollectionsView; + + public static final String JSON_PROPERTY_ENABLE_LOCAL_PASSWORD = "EnableLocalPassword"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableLocalPassword; + + public static final String JSON_PROPERTY_ORDERED_VIEWS = "OrderedViews"; + @org.eclipse.jdt.annotation.NonNull + private List orderedViews = new ArrayList<>(); + + public static final String JSON_PROPERTY_LATEST_ITEMS_EXCLUDES = "LatestItemsExcludes"; + @org.eclipse.jdt.annotation.NonNull + private List latestItemsExcludes = new ArrayList<>(); + + public static final String JSON_PROPERTY_MY_MEDIA_EXCLUDES = "MyMediaExcludes"; + @org.eclipse.jdt.annotation.NonNull + private List myMediaExcludes = new ArrayList<>(); + + public static final String JSON_PROPERTY_HIDE_PLAYED_IN_LATEST = "HidePlayedInLatest"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hidePlayedInLatest; + + public static final String JSON_PROPERTY_REMEMBER_AUDIO_SELECTIONS = "RememberAudioSelections"; + @org.eclipse.jdt.annotation.NonNull + private Boolean rememberAudioSelections; + + public static final String JSON_PROPERTY_REMEMBER_SUBTITLE_SELECTIONS = "RememberSubtitleSelections"; + @org.eclipse.jdt.annotation.NonNull + private Boolean rememberSubtitleSelections; + + public static final String JSON_PROPERTY_ENABLE_NEXT_EPISODE_AUTO_PLAY = "EnableNextEpisodeAutoPlay"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableNextEpisodeAutoPlay; + + public UserConfiguration() { + } + + public UserConfiguration audioLanguagePreference( + @org.eclipse.jdt.annotation.NonNull String audioLanguagePreference) { + this.audioLanguagePreference = audioLanguagePreference; + return this; + } + + /** + * Gets or sets the audio language preference. + * + * @return audioLanguagePreference + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUDIO_LANGUAGE_PREFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAudioLanguagePreference() { + return audioLanguagePreference; + } + + @JsonProperty(JSON_PROPERTY_AUDIO_LANGUAGE_PREFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioLanguagePreference(@org.eclipse.jdt.annotation.NonNull String audioLanguagePreference) { + this.audioLanguagePreference = audioLanguagePreference; + } + + public UserConfiguration playDefaultAudioTrack(@org.eclipse.jdt.annotation.NonNull Boolean playDefaultAudioTrack) { + this.playDefaultAudioTrack = playDefaultAudioTrack; + return this; + } + + /** + * Gets or sets a value indicating whether [play default audio track]. + * + * @return playDefaultAudioTrack + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_DEFAULT_AUDIO_TRACK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPlayDefaultAudioTrack() { + return playDefaultAudioTrack; + } + + @JsonProperty(JSON_PROPERTY_PLAY_DEFAULT_AUDIO_TRACK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayDefaultAudioTrack(@org.eclipse.jdt.annotation.NonNull Boolean playDefaultAudioTrack) { + this.playDefaultAudioTrack = playDefaultAudioTrack; + } + + public UserConfiguration subtitleLanguagePreference( + @org.eclipse.jdt.annotation.NonNull String subtitleLanguagePreference) { + this.subtitleLanguagePreference = subtitleLanguagePreference; + return this; + } + + /** + * Gets or sets the subtitle language preference. + * + * @return subtitleLanguagePreference + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_LANGUAGE_PREFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubtitleLanguagePreference() { + return subtitleLanguagePreference; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_LANGUAGE_PREFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleLanguagePreference(@org.eclipse.jdt.annotation.NonNull String subtitleLanguagePreference) { + this.subtitleLanguagePreference = subtitleLanguagePreference; + } + + public UserConfiguration displayMissingEpisodes( + @org.eclipse.jdt.annotation.NonNull Boolean displayMissingEpisodes) { + this.displayMissingEpisodes = displayMissingEpisodes; + return this; + } + + /** + * Get displayMissingEpisodes + * + * @return displayMissingEpisodes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_MISSING_EPISODES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDisplayMissingEpisodes() { + return displayMissingEpisodes; + } + + @JsonProperty(JSON_PROPERTY_DISPLAY_MISSING_EPISODES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayMissingEpisodes(@org.eclipse.jdt.annotation.NonNull Boolean displayMissingEpisodes) { + this.displayMissingEpisodes = displayMissingEpisodes; + } + + public UserConfiguration groupedFolders(@org.eclipse.jdt.annotation.NonNull List groupedFolders) { + this.groupedFolders = groupedFolders; + return this; + } + + public UserConfiguration addGroupedFoldersItem(String groupedFoldersItem) { + if (this.groupedFolders == null) { + this.groupedFolders = new ArrayList<>(); + } + this.groupedFolders.add(groupedFoldersItem); + return this; + } + + /** + * Get groupedFolders + * + * @return groupedFolders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_GROUPED_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGroupedFolders() { + return groupedFolders; + } + + @JsonProperty(JSON_PROPERTY_GROUPED_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupedFolders(@org.eclipse.jdt.annotation.NonNull List groupedFolders) { + this.groupedFolders = groupedFolders; + } + + public UserConfiguration subtitleMode(@org.eclipse.jdt.annotation.NonNull SubtitlePlaybackMode subtitleMode) { + this.subtitleMode = subtitleMode; + return this; + } + + /** + * An enum representing a subtitle playback mode. + * + * @return subtitleMode + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SUBTITLE_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubtitlePlaybackMode getSubtitleMode() { + return subtitleMode; + } + + @JsonProperty(JSON_PROPERTY_SUBTITLE_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtitleMode(@org.eclipse.jdt.annotation.NonNull SubtitlePlaybackMode subtitleMode) { + this.subtitleMode = subtitleMode; + } + + public UserConfiguration displayCollectionsView( + @org.eclipse.jdt.annotation.NonNull Boolean displayCollectionsView) { + this.displayCollectionsView = displayCollectionsView; + return this; + } + + /** + * Get displayCollectionsView + * + * @return displayCollectionsView + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_DISPLAY_COLLECTIONS_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDisplayCollectionsView() { + return displayCollectionsView; + } + + @JsonProperty(JSON_PROPERTY_DISPLAY_COLLECTIONS_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayCollectionsView(@org.eclipse.jdt.annotation.NonNull Boolean displayCollectionsView) { + this.displayCollectionsView = displayCollectionsView; + } + + public UserConfiguration enableLocalPassword(@org.eclipse.jdt.annotation.NonNull Boolean enableLocalPassword) { + this.enableLocalPassword = enableLocalPassword; + return this; + } + + /** + * Get enableLocalPassword + * + * @return enableLocalPassword + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_LOCAL_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableLocalPassword() { + return enableLocalPassword; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_LOCAL_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableLocalPassword(@org.eclipse.jdt.annotation.NonNull Boolean enableLocalPassword) { + this.enableLocalPassword = enableLocalPassword; + } + + public UserConfiguration orderedViews(@org.eclipse.jdt.annotation.NonNull List orderedViews) { + this.orderedViews = orderedViews; + return this; + } + + public UserConfiguration addOrderedViewsItem(String orderedViewsItem) { + if (this.orderedViews == null) { + this.orderedViews = new ArrayList<>(); + } + this.orderedViews.add(orderedViewsItem); + return this; + } + + /** + * Get orderedViews + * + * @return orderedViews + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ORDERED_VIEWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getOrderedViews() { + return orderedViews; + } + + @JsonProperty(JSON_PROPERTY_ORDERED_VIEWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrderedViews(@org.eclipse.jdt.annotation.NonNull List orderedViews) { + this.orderedViews = orderedViews; + } + + public UserConfiguration latestItemsExcludes(@org.eclipse.jdt.annotation.NonNull List latestItemsExcludes) { + this.latestItemsExcludes = latestItemsExcludes; + return this; + } + + public UserConfiguration addLatestItemsExcludesItem(String latestItemsExcludesItem) { + if (this.latestItemsExcludes == null) { + this.latestItemsExcludes = new ArrayList<>(); + } + this.latestItemsExcludes.add(latestItemsExcludesItem); + return this; + } + + /** + * Get latestItemsExcludes + * + * @return latestItemsExcludes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LATEST_ITEMS_EXCLUDES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLatestItemsExcludes() { + return latestItemsExcludes; + } + + @JsonProperty(JSON_PROPERTY_LATEST_ITEMS_EXCLUDES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLatestItemsExcludes(@org.eclipse.jdt.annotation.NonNull List latestItemsExcludes) { + this.latestItemsExcludes = latestItemsExcludes; + } + + public UserConfiguration myMediaExcludes(@org.eclipse.jdt.annotation.NonNull List myMediaExcludes) { + this.myMediaExcludes = myMediaExcludes; + return this; + } + + public UserConfiguration addMyMediaExcludesItem(String myMediaExcludesItem) { + if (this.myMediaExcludes == null) { + this.myMediaExcludes = new ArrayList<>(); + } + this.myMediaExcludes.add(myMediaExcludesItem); + return this; + } + + /** + * Get myMediaExcludes + * + * @return myMediaExcludes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MY_MEDIA_EXCLUDES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMyMediaExcludes() { + return myMediaExcludes; + } + + @JsonProperty(JSON_PROPERTY_MY_MEDIA_EXCLUDES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyMediaExcludes(@org.eclipse.jdt.annotation.NonNull List myMediaExcludes) { + this.myMediaExcludes = myMediaExcludes; + } + + public UserConfiguration hidePlayedInLatest(@org.eclipse.jdt.annotation.NonNull Boolean hidePlayedInLatest) { + this.hidePlayedInLatest = hidePlayedInLatest; + return this; + } + + /** + * Get hidePlayedInLatest + * + * @return hidePlayedInLatest + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HIDE_PLAYED_IN_LATEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHidePlayedInLatest() { + return hidePlayedInLatest; + } + + @JsonProperty(JSON_PROPERTY_HIDE_PLAYED_IN_LATEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHidePlayedInLatest(@org.eclipse.jdt.annotation.NonNull Boolean hidePlayedInLatest) { + this.hidePlayedInLatest = hidePlayedInLatest; + } + + public UserConfiguration rememberAudioSelections( + @org.eclipse.jdt.annotation.NonNull Boolean rememberAudioSelections) { + this.rememberAudioSelections = rememberAudioSelections; + return this; + } + + /** + * Get rememberAudioSelections + * + * @return rememberAudioSelections + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMEMBER_AUDIO_SELECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRememberAudioSelections() { + return rememberAudioSelections; + } + + @JsonProperty(JSON_PROPERTY_REMEMBER_AUDIO_SELECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRememberAudioSelections(@org.eclipse.jdt.annotation.NonNull Boolean rememberAudioSelections) { + this.rememberAudioSelections = rememberAudioSelections; + } + + public UserConfiguration rememberSubtitleSelections( + @org.eclipse.jdt.annotation.NonNull Boolean rememberSubtitleSelections) { + this.rememberSubtitleSelections = rememberSubtitleSelections; + return this; + } + + /** + * Get rememberSubtitleSelections + * + * @return rememberSubtitleSelections + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMEMBER_SUBTITLE_SELECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRememberSubtitleSelections() { + return rememberSubtitleSelections; + } + + @JsonProperty(JSON_PROPERTY_REMEMBER_SUBTITLE_SELECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRememberSubtitleSelections(@org.eclipse.jdt.annotation.NonNull Boolean rememberSubtitleSelections) { + this.rememberSubtitleSelections = rememberSubtitleSelections; + } + + public UserConfiguration enableNextEpisodeAutoPlay( + @org.eclipse.jdt.annotation.NonNull Boolean enableNextEpisodeAutoPlay) { + this.enableNextEpisodeAutoPlay = enableNextEpisodeAutoPlay; + return this; + } + + /** + * Get enableNextEpisodeAutoPlay + * + * @return enableNextEpisodeAutoPlay + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_NEXT_EPISODE_AUTO_PLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableNextEpisodeAutoPlay() { + return enableNextEpisodeAutoPlay; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_NEXT_EPISODE_AUTO_PLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableNextEpisodeAutoPlay(@org.eclipse.jdt.annotation.NonNull Boolean enableNextEpisodeAutoPlay) { + this.enableNextEpisodeAutoPlay = enableNextEpisodeAutoPlay; + } + + /** + * Return true if this UserConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserConfiguration userConfiguration = (UserConfiguration) o; + return Objects.equals(this.audioLanguagePreference, userConfiguration.audioLanguagePreference) + && Objects.equals(this.playDefaultAudioTrack, userConfiguration.playDefaultAudioTrack) + && Objects.equals(this.subtitleLanguagePreference, userConfiguration.subtitleLanguagePreference) + && Objects.equals(this.displayMissingEpisodes, userConfiguration.displayMissingEpisodes) + && Objects.equals(this.groupedFolders, userConfiguration.groupedFolders) + && Objects.equals(this.subtitleMode, userConfiguration.subtitleMode) + && Objects.equals(this.displayCollectionsView, userConfiguration.displayCollectionsView) + && Objects.equals(this.enableLocalPassword, userConfiguration.enableLocalPassword) + && Objects.equals(this.orderedViews, userConfiguration.orderedViews) + && Objects.equals(this.latestItemsExcludes, userConfiguration.latestItemsExcludes) + && Objects.equals(this.myMediaExcludes, userConfiguration.myMediaExcludes) + && Objects.equals(this.hidePlayedInLatest, userConfiguration.hidePlayedInLatest) + && Objects.equals(this.rememberAudioSelections, userConfiguration.rememberAudioSelections) + && Objects.equals(this.rememberSubtitleSelections, userConfiguration.rememberSubtitleSelections) + && Objects.equals(this.enableNextEpisodeAutoPlay, userConfiguration.enableNextEpisodeAutoPlay); + } + + @Override + public int hashCode() { + return Objects.hash(audioLanguagePreference, playDefaultAudioTrack, subtitleLanguagePreference, + displayMissingEpisodes, groupedFolders, subtitleMode, displayCollectionsView, enableLocalPassword, + orderedViews, latestItemsExcludes, myMediaExcludes, hidePlayedInLatest, rememberAudioSelections, + rememberSubtitleSelections, enableNextEpisodeAutoPlay); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserConfiguration {\n"); + sb.append(" audioLanguagePreference: ").append(toIndentedString(audioLanguagePreference)).append("\n"); + sb.append(" playDefaultAudioTrack: ").append(toIndentedString(playDefaultAudioTrack)).append("\n"); + sb.append(" subtitleLanguagePreference: ").append(toIndentedString(subtitleLanguagePreference)).append("\n"); + sb.append(" displayMissingEpisodes: ").append(toIndentedString(displayMissingEpisodes)).append("\n"); + sb.append(" groupedFolders: ").append(toIndentedString(groupedFolders)).append("\n"); + sb.append(" subtitleMode: ").append(toIndentedString(subtitleMode)).append("\n"); + sb.append(" displayCollectionsView: ").append(toIndentedString(displayCollectionsView)).append("\n"); + sb.append(" enableLocalPassword: ").append(toIndentedString(enableLocalPassword)).append("\n"); + sb.append(" orderedViews: ").append(toIndentedString(orderedViews)).append("\n"); + sb.append(" latestItemsExcludes: ").append(toIndentedString(latestItemsExcludes)).append("\n"); + sb.append(" myMediaExcludes: ").append(toIndentedString(myMediaExcludes)).append("\n"); + sb.append(" hidePlayedInLatest: ").append(toIndentedString(hidePlayedInLatest)).append("\n"); + sb.append(" rememberAudioSelections: ").append(toIndentedString(rememberAudioSelections)).append("\n"); + sb.append(" rememberSubtitleSelections: ").append(toIndentedString(rememberSubtitleSelections)).append("\n"); + sb.append(" enableNextEpisodeAutoPlay: ").append(toIndentedString(enableNextEpisodeAutoPlay)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `AudioLanguagePreference` to the URL query string + if (getAudioLanguagePreference() != null) { + joiner.add(String.format("%sAudioLanguagePreference%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAudioLanguagePreference())))); + } + + // add `PlayDefaultAudioTrack` to the URL query string + if (getPlayDefaultAudioTrack() != null) { + joiner.add(String.format("%sPlayDefaultAudioTrack%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayDefaultAudioTrack())))); + } + + // add `SubtitleLanguagePreference` to the URL query string + if (getSubtitleLanguagePreference() != null) { + joiner.add(String.format("%sSubtitleLanguagePreference%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleLanguagePreference())))); + } + + // add `DisplayMissingEpisodes` to the URL query string + if (getDisplayMissingEpisodes() != null) { + joiner.add(String.format("%sDisplayMissingEpisodes%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplayMissingEpisodes())))); + } + + // add `GroupedFolders` to the URL query string + if (getGroupedFolders() != null) { + for (int i = 0; i < getGroupedFolders().size(); i++) { + joiner.add(String.format("%sGroupedFolders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getGroupedFolders().get(i))))); + } + } + + // add `SubtitleMode` to the URL query string + if (getSubtitleMode() != null) { + joiner.add(String.format("%sSubtitleMode%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSubtitleMode())))); + } + + // add `DisplayCollectionsView` to the URL query string + if (getDisplayCollectionsView() != null) { + joiner.add(String.format("%sDisplayCollectionsView%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getDisplayCollectionsView())))); + } + + // add `EnableLocalPassword` to the URL query string + if (getEnableLocalPassword() != null) { + joiner.add(String.format("%sEnableLocalPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableLocalPassword())))); + } + + // add `OrderedViews` to the URL query string + if (getOrderedViews() != null) { + for (int i = 0; i < getOrderedViews().size(); i++) { + joiner.add(String.format("%sOrderedViews%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getOrderedViews().get(i))))); + } + } + + // add `LatestItemsExcludes` to the URL query string + if (getLatestItemsExcludes() != null) { + for (int i = 0; i < getLatestItemsExcludes().size(); i++) { + joiner.add(String.format("%sLatestItemsExcludes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLatestItemsExcludes().get(i))))); + } + } + + // add `MyMediaExcludes` to the URL query string + if (getMyMediaExcludes() != null) { + for (int i = 0; i < getMyMediaExcludes().size(); i++) { + joiner.add(String.format("%sMyMediaExcludes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMyMediaExcludes().get(i))))); + } + } + + // add `HidePlayedInLatest` to the URL query string + if (getHidePlayedInLatest() != null) { + joiner.add(String.format("%sHidePlayedInLatest%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHidePlayedInLatest())))); + } + + // add `RememberAudioSelections` to the URL query string + if (getRememberAudioSelections() != null) { + joiner.add(String.format("%sRememberAudioSelections%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRememberAudioSelections())))); + } + + // add `RememberSubtitleSelections` to the URL query string + if (getRememberSubtitleSelections() != null) { + joiner.add(String.format("%sRememberSubtitleSelections%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRememberSubtitleSelections())))); + } + + // add `EnableNextEpisodeAutoPlay` to the URL query string + if (getEnableNextEpisodeAutoPlay() != null) { + joiner.add(String.format("%sEnableNextEpisodeAutoPlay%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableNextEpisodeAutoPlay())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UserConfiguration instance; + + public Builder() { + this(new UserConfiguration()); + } + + protected Builder(UserConfiguration instance) { + this.instance = instance; + } + + public UserConfiguration.Builder audioLanguagePreference(String audioLanguagePreference) { + this.instance.audioLanguagePreference = audioLanguagePreference; + return this; + } + + public UserConfiguration.Builder playDefaultAudioTrack(Boolean playDefaultAudioTrack) { + this.instance.playDefaultAudioTrack = playDefaultAudioTrack; + return this; + } + + public UserConfiguration.Builder subtitleLanguagePreference(String subtitleLanguagePreference) { + this.instance.subtitleLanguagePreference = subtitleLanguagePreference; + return this; + } + + public UserConfiguration.Builder displayMissingEpisodes(Boolean displayMissingEpisodes) { + this.instance.displayMissingEpisodes = displayMissingEpisodes; + return this; + } + + public UserConfiguration.Builder groupedFolders(List groupedFolders) { + this.instance.groupedFolders = groupedFolders; + return this; + } + + public UserConfiguration.Builder subtitleMode(SubtitlePlaybackMode subtitleMode) { + this.instance.subtitleMode = subtitleMode; + return this; + } + + public UserConfiguration.Builder displayCollectionsView(Boolean displayCollectionsView) { + this.instance.displayCollectionsView = displayCollectionsView; + return this; + } + + public UserConfiguration.Builder enableLocalPassword(Boolean enableLocalPassword) { + this.instance.enableLocalPassword = enableLocalPassword; + return this; + } + + public UserConfiguration.Builder orderedViews(List orderedViews) { + this.instance.orderedViews = orderedViews; + return this; + } + + public UserConfiguration.Builder latestItemsExcludes(List latestItemsExcludes) { + this.instance.latestItemsExcludes = latestItemsExcludes; + return this; + } + + public UserConfiguration.Builder myMediaExcludes(List myMediaExcludes) { + this.instance.myMediaExcludes = myMediaExcludes; + return this; + } + + public UserConfiguration.Builder hidePlayedInLatest(Boolean hidePlayedInLatest) { + this.instance.hidePlayedInLatest = hidePlayedInLatest; + return this; + } + + public UserConfiguration.Builder rememberAudioSelections(Boolean rememberAudioSelections) { + this.instance.rememberAudioSelections = rememberAudioSelections; + return this; + } + + public UserConfiguration.Builder rememberSubtitleSelections(Boolean rememberSubtitleSelections) { + this.instance.rememberSubtitleSelections = rememberSubtitleSelections; + return this; + } + + public UserConfiguration.Builder enableNextEpisodeAutoPlay(Boolean enableNextEpisodeAutoPlay) { + this.instance.enableNextEpisodeAutoPlay = enableNextEpisodeAutoPlay; + return this; + } + + /** + * returns a built UserConfiguration instance. + * + * The builder is not reusable. + */ + public UserConfiguration build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UserConfiguration.Builder builder() { + return new UserConfiguration.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UserConfiguration.Builder toBuilder() { + return new UserConfiguration.Builder().audioLanguagePreference(getAudioLanguagePreference()) + .playDefaultAudioTrack(getPlayDefaultAudioTrack()) + .subtitleLanguagePreference(getSubtitleLanguagePreference()) + .displayMissingEpisodes(getDisplayMissingEpisodes()).groupedFolders(getGroupedFolders()) + .subtitleMode(getSubtitleMode()).displayCollectionsView(getDisplayCollectionsView()) + .enableLocalPassword(getEnableLocalPassword()).orderedViews(getOrderedViews()) + .latestItemsExcludes(getLatestItemsExcludes()).myMediaExcludes(getMyMediaExcludes()) + .hidePlayedInLatest(getHidePlayedInLatest()).rememberAudioSelections(getRememberAudioSelections()) + .rememberSubtitleSelections(getRememberSubtitleSelections()) + .enableNextEpisodeAutoPlay(getEnableNextEpisodeAutoPlay()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UserDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UserDto.java new file mode 100644 index 0000000000000..38d7d409ca0dd --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UserDto.java @@ -0,0 +1,723 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class UserDto. + */ +@JsonPropertyOrder({ UserDto.JSON_PROPERTY_NAME, UserDto.JSON_PROPERTY_SERVER_ID, UserDto.JSON_PROPERTY_SERVER_NAME, + UserDto.JSON_PROPERTY_ID, UserDto.JSON_PROPERTY_PRIMARY_IMAGE_TAG, UserDto.JSON_PROPERTY_HAS_PASSWORD, + UserDto.JSON_PROPERTY_HAS_CONFIGURED_PASSWORD, UserDto.JSON_PROPERTY_HAS_CONFIGURED_EASY_PASSWORD, + UserDto.JSON_PROPERTY_ENABLE_AUTO_LOGIN, UserDto.JSON_PROPERTY_LAST_LOGIN_DATE, + UserDto.JSON_PROPERTY_LAST_ACTIVITY_DATE, UserDto.JSON_PROPERTY_CONFIGURATION, UserDto.JSON_PROPERTY_POLICY, + UserDto.JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserDto { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_SERVER_ID = "ServerId"; + @org.eclipse.jdt.annotation.NonNull + private String serverId; + + public static final String JSON_PROPERTY_SERVER_NAME = "ServerName"; + @org.eclipse.jdt.annotation.NonNull + private String serverName; + + public static final String JSON_PROPERTY_ID = "Id"; + @org.eclipse.jdt.annotation.NonNull + private UUID id; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_TAG = "PrimaryImageTag"; + @org.eclipse.jdt.annotation.NonNull + private String primaryImageTag; + + public static final String JSON_PROPERTY_HAS_PASSWORD = "HasPassword"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasPassword; + + public static final String JSON_PROPERTY_HAS_CONFIGURED_PASSWORD = "HasConfiguredPassword"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasConfiguredPassword; + + public static final String JSON_PROPERTY_HAS_CONFIGURED_EASY_PASSWORD = "HasConfiguredEasyPassword"; + @org.eclipse.jdt.annotation.NonNull + private Boolean hasConfiguredEasyPassword; + + public static final String JSON_PROPERTY_ENABLE_AUTO_LOGIN = "EnableAutoLogin"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAutoLogin; + + public static final String JSON_PROPERTY_LAST_LOGIN_DATE = "LastLoginDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime lastLoginDate; + + public static final String JSON_PROPERTY_LAST_ACTIVITY_DATE = "LastActivityDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime lastActivityDate; + + public static final String JSON_PROPERTY_CONFIGURATION = "Configuration"; + @org.eclipse.jdt.annotation.NonNull + private UserConfiguration _configuration; + + public static final String JSON_PROPERTY_POLICY = "Policy"; + @org.eclipse.jdt.annotation.NonNull + private UserPolicy policy; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO = "PrimaryImageAspectRatio"; + @org.eclipse.jdt.annotation.NonNull + private Double primaryImageAspectRatio; + + public UserDto() { + } + + public UserDto name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public UserDto serverId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + return this; + } + + /** + * Gets or sets the server identifier. + * + * @return serverId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerId() { + return serverId; + } + + @JsonProperty(JSON_PROPERTY_SERVER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerId(@org.eclipse.jdt.annotation.NonNull String serverId) { + this.serverId = serverId; + } + + public UserDto serverName(@org.eclipse.jdt.annotation.NonNull String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Gets or sets the name of the server. This is not used by the server and is for client-side usage only. + * + * @return serverName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SERVER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServerName() { + return serverName; + } + + @JsonProperty(JSON_PROPERTY_SERVER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerName(@org.eclipse.jdt.annotation.NonNull String serverName) { + this.serverName = serverName; + } + + public UserDto id(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + return this; + } + + /** + * Gets or sets the id. + * + * @return id + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@org.eclipse.jdt.annotation.NonNull UUID id) { + this.id = id; + } + + public UserDto primaryImageTag(@org.eclipse.jdt.annotation.NonNull String primaryImageTag) { + this.primaryImageTag = primaryImageTag; + return this; + } + + /** + * Gets or sets the primary image tag. + * + * @return primaryImageTag + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryImageTag() { + return primaryImageTag; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageTag(@org.eclipse.jdt.annotation.NonNull String primaryImageTag) { + this.primaryImageTag = primaryImageTag; + } + + public UserDto hasPassword(@org.eclipse.jdt.annotation.NonNull Boolean hasPassword) { + this.hasPassword = hasPassword; + return this; + } + + /** + * Gets or sets a value indicating whether this instance has password. + * + * @return hasPassword + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasPassword() { + return hasPassword; + } + + @JsonProperty(JSON_PROPERTY_HAS_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasPassword(@org.eclipse.jdt.annotation.NonNull Boolean hasPassword) { + this.hasPassword = hasPassword; + } + + public UserDto hasConfiguredPassword(@org.eclipse.jdt.annotation.NonNull Boolean hasConfiguredPassword) { + this.hasConfiguredPassword = hasConfiguredPassword; + return this; + } + + /** + * Gets or sets a value indicating whether this instance has configured password. + * + * @return hasConfiguredPassword + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_CONFIGURED_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasConfiguredPassword() { + return hasConfiguredPassword; + } + + @JsonProperty(JSON_PROPERTY_HAS_CONFIGURED_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasConfiguredPassword(@org.eclipse.jdt.annotation.NonNull Boolean hasConfiguredPassword) { + this.hasConfiguredPassword = hasConfiguredPassword; + } + + public UserDto hasConfiguredEasyPassword(@org.eclipse.jdt.annotation.NonNull Boolean hasConfiguredEasyPassword) { + this.hasConfiguredEasyPassword = hasConfiguredEasyPassword; + return this; + } + + /** + * Gets or sets a value indicating whether this instance has configured easy password. + * + * @return hasConfiguredEasyPassword + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_HAS_CONFIGURED_EASY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasConfiguredEasyPassword() { + return hasConfiguredEasyPassword; + } + + @JsonProperty(JSON_PROPERTY_HAS_CONFIGURED_EASY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasConfiguredEasyPassword(@org.eclipse.jdt.annotation.NonNull Boolean hasConfiguredEasyPassword) { + this.hasConfiguredEasyPassword = hasConfiguredEasyPassword; + } + + public UserDto enableAutoLogin(@org.eclipse.jdt.annotation.NonNull Boolean enableAutoLogin) { + this.enableAutoLogin = enableAutoLogin; + return this; + } + + /** + * Gets or sets whether async login is enabled or not. + * + * @return enableAutoLogin + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_AUTO_LOGIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAutoLogin() { + return enableAutoLogin; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_AUTO_LOGIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAutoLogin(@org.eclipse.jdt.annotation.NonNull Boolean enableAutoLogin) { + this.enableAutoLogin = enableAutoLogin; + } + + public UserDto lastLoginDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + return this; + } + + /** + * Gets or sets the last login date. + * + * @return lastLoginDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_LOGIN_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastLoginDate() { + return lastLoginDate; + } + + @JsonProperty(JSON_PROPERTY_LAST_LOGIN_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastLoginDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + } + + public UserDto lastActivityDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastActivityDate) { + this.lastActivityDate = lastActivityDate; + return this; + } + + /** + * Gets or sets the last activity date. + * + * @return lastActivityDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_ACTIVITY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastActivityDate() { + return lastActivityDate; + } + + @JsonProperty(JSON_PROPERTY_LAST_ACTIVITY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastActivityDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastActivityDate) { + this.lastActivityDate = lastActivityDate; + } + + public UserDto _configuration(@org.eclipse.jdt.annotation.NonNull UserConfiguration _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * Gets or sets the configuration. + * + * @return _configuration + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserConfiguration getConfiguration() { + return _configuration; + } + + @JsonProperty(JSON_PROPERTY_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfiguration(@org.eclipse.jdt.annotation.NonNull UserConfiguration _configuration) { + this._configuration = _configuration; + } + + public UserDto policy(@org.eclipse.jdt.annotation.NonNull UserPolicy policy) { + this.policy = policy; + return this; + } + + /** + * Gets or sets the policy. + * + * @return policy + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_POLICY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserPolicy getPolicy() { + return policy; + } + + @JsonProperty(JSON_PROPERTY_POLICY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPolicy(@org.eclipse.jdt.annotation.NonNull UserPolicy policy) { + this.policy = policy; + } + + public UserDto primaryImageAspectRatio(@org.eclipse.jdt.annotation.NonNull Double primaryImageAspectRatio) { + this.primaryImageAspectRatio = primaryImageAspectRatio; + return this; + } + + /** + * Gets or sets the primary image aspect ratio. + * + * @return primaryImageAspectRatio + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getPrimaryImageAspectRatio() { + return primaryImageAspectRatio; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_ASPECT_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageAspectRatio(@org.eclipse.jdt.annotation.NonNull Double primaryImageAspectRatio) { + this.primaryImageAspectRatio = primaryImageAspectRatio; + } + + /** + * Return true if this UserDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserDto userDto = (UserDto) o; + return Objects.equals(this.name, userDto.name) && Objects.equals(this.serverId, userDto.serverId) + && Objects.equals(this.serverName, userDto.serverName) && Objects.equals(this.id, userDto.id) + && Objects.equals(this.primaryImageTag, userDto.primaryImageTag) + && Objects.equals(this.hasPassword, userDto.hasPassword) + && Objects.equals(this.hasConfiguredPassword, userDto.hasConfiguredPassword) + && Objects.equals(this.hasConfiguredEasyPassword, userDto.hasConfiguredEasyPassword) + && Objects.equals(this.enableAutoLogin, userDto.enableAutoLogin) + && Objects.equals(this.lastLoginDate, userDto.lastLoginDate) + && Objects.equals(this.lastActivityDate, userDto.lastActivityDate) + && Objects.equals(this._configuration, userDto._configuration) + && Objects.equals(this.policy, userDto.policy) + && Objects.equals(this.primaryImageAspectRatio, userDto.primaryImageAspectRatio); + } + + @Override + public int hashCode() { + return Objects.hash(name, serverId, serverName, id, primaryImageTag, hasPassword, hasConfiguredPassword, + hasConfiguredEasyPassword, enableAutoLogin, lastLoginDate, lastActivityDate, _configuration, policy, + primaryImageAspectRatio); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append(" serverName: ").append(toIndentedString(serverName)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" primaryImageTag: ").append(toIndentedString(primaryImageTag)).append("\n"); + sb.append(" hasPassword: ").append(toIndentedString(hasPassword)).append("\n"); + sb.append(" hasConfiguredPassword: ").append(toIndentedString(hasConfiguredPassword)).append("\n"); + sb.append(" hasConfiguredEasyPassword: ").append(toIndentedString(hasConfiguredEasyPassword)).append("\n"); + sb.append(" enableAutoLogin: ").append(toIndentedString(enableAutoLogin)).append("\n"); + sb.append(" lastLoginDate: ").append(toIndentedString(lastLoginDate)).append("\n"); + sb.append(" lastActivityDate: ").append(toIndentedString(lastActivityDate)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + sb.append(" policy: ").append(toIndentedString(policy)).append("\n"); + sb.append(" primaryImageAspectRatio: ").append(toIndentedString(primaryImageAspectRatio)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `ServerId` to the URL query string + if (getServerId() != null) { + joiner.add(String.format("%sServerId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerId())))); + } + + // add `ServerName` to the URL query string + if (getServerName() != null) { + joiner.add(String.format("%sServerName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getServerName())))); + } + + // add `Id` to the URL query string + if (getId() != null) { + joiner.add( + String.format("%sId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `PrimaryImageTag` to the URL query string + if (getPrimaryImageTag() != null) { + joiner.add(String.format("%sPrimaryImageTag%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageTag())))); + } + + // add `HasPassword` to the URL query string + if (getHasPassword() != null) { + joiner.add(String.format("%sHasPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasPassword())))); + } + + // add `HasConfiguredPassword` to the URL query string + if (getHasConfiguredPassword() != null) { + joiner.add(String.format("%sHasConfiguredPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasConfiguredPassword())))); + } + + // add `HasConfiguredEasyPassword` to the URL query string + if (getHasConfiguredEasyPassword() != null) { + joiner.add(String.format("%sHasConfiguredEasyPassword%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getHasConfiguredEasyPassword())))); + } + + // add `EnableAutoLogin` to the URL query string + if (getEnableAutoLogin() != null) { + joiner.add(String.format("%sEnableAutoLogin%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAutoLogin())))); + } + + // add `LastLoginDate` to the URL query string + if (getLastLoginDate() != null) { + joiner.add(String.format("%sLastLoginDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastLoginDate())))); + } + + // add `LastActivityDate` to the URL query string + if (getLastActivityDate() != null) { + joiner.add(String.format("%sLastActivityDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastActivityDate())))); + } + + // add `Configuration` to the URL query string + if (getConfiguration() != null) { + joiner.add(getConfiguration().toUrlQueryString(prefix + "Configuration" + suffix)); + } + + // add `Policy` to the URL query string + if (getPolicy() != null) { + joiner.add(getPolicy().toUrlQueryString(prefix + "Policy" + suffix)); + } + + // add `PrimaryImageAspectRatio` to the URL query string + if (getPrimaryImageAspectRatio() != null) { + joiner.add(String.format("%sPrimaryImageAspectRatio%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageAspectRatio())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UserDto instance; + + public Builder() { + this(new UserDto()); + } + + protected Builder(UserDto instance) { + this.instance = instance; + } + + public UserDto.Builder name(String name) { + this.instance.name = name; + return this; + } + + public UserDto.Builder serverId(String serverId) { + this.instance.serverId = serverId; + return this; + } + + public UserDto.Builder serverName(String serverName) { + this.instance.serverName = serverName; + return this; + } + + public UserDto.Builder id(UUID id) { + this.instance.id = id; + return this; + } + + public UserDto.Builder primaryImageTag(String primaryImageTag) { + this.instance.primaryImageTag = primaryImageTag; + return this; + } + + public UserDto.Builder hasPassword(Boolean hasPassword) { + this.instance.hasPassword = hasPassword; + return this; + } + + public UserDto.Builder hasConfiguredPassword(Boolean hasConfiguredPassword) { + this.instance.hasConfiguredPassword = hasConfiguredPassword; + return this; + } + + public UserDto.Builder hasConfiguredEasyPassword(Boolean hasConfiguredEasyPassword) { + this.instance.hasConfiguredEasyPassword = hasConfiguredEasyPassword; + return this; + } + + public UserDto.Builder enableAutoLogin(Boolean enableAutoLogin) { + this.instance.enableAutoLogin = enableAutoLogin; + return this; + } + + public UserDto.Builder lastLoginDate(OffsetDateTime lastLoginDate) { + this.instance.lastLoginDate = lastLoginDate; + return this; + } + + public UserDto.Builder lastActivityDate(OffsetDateTime lastActivityDate) { + this.instance.lastActivityDate = lastActivityDate; + return this; + } + + public UserDto.Builder _configuration(UserConfiguration _configuration) { + this.instance._configuration = _configuration; + return this; + } + + public UserDto.Builder policy(UserPolicy policy) { + this.instance.policy = policy; + return this; + } + + public UserDto.Builder primaryImageAspectRatio(Double primaryImageAspectRatio) { + this.instance.primaryImageAspectRatio = primaryImageAspectRatio; + return this; + } + + /** + * returns a built UserDto instance. + * + * The builder is not reusable. + */ + public UserDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UserDto.Builder builder() { + return new UserDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UserDto.Builder toBuilder() { + return new UserDto.Builder().name(getName()).serverId(getServerId()).serverName(getServerName()).id(getId()) + .primaryImageTag(getPrimaryImageTag()).hasPassword(getHasPassword()) + .hasConfiguredPassword(getHasConfiguredPassword()) + .hasConfiguredEasyPassword(getHasConfiguredEasyPassword()).enableAutoLogin(getEnableAutoLogin()) + .lastLoginDate(getLastLoginDate()).lastActivityDate(getLastActivityDate()) + ._configuration(getConfiguration()).policy(getPolicy()) + .primaryImageAspectRatio(getPrimaryImageAspectRatio()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UserItemDataDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UserItemDataDto.java new file mode 100644 index 0000000000000..f9c60e9b0c9ad --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UserItemDataDto.java @@ -0,0 +1,601 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class UserItemDataDto. + */ +@JsonPropertyOrder({ UserItemDataDto.JSON_PROPERTY_RATING, UserItemDataDto.JSON_PROPERTY_PLAYED_PERCENTAGE, + UserItemDataDto.JSON_PROPERTY_UNPLAYED_ITEM_COUNT, UserItemDataDto.JSON_PROPERTY_PLAYBACK_POSITION_TICKS, + UserItemDataDto.JSON_PROPERTY_PLAY_COUNT, UserItemDataDto.JSON_PROPERTY_IS_FAVORITE, + UserItemDataDto.JSON_PROPERTY_LIKES, UserItemDataDto.JSON_PROPERTY_LAST_PLAYED_DATE, + UserItemDataDto.JSON_PROPERTY_PLAYED, UserItemDataDto.JSON_PROPERTY_KEY, + UserItemDataDto.JSON_PROPERTY_ITEM_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserItemDataDto { + public static final String JSON_PROPERTY_RATING = "Rating"; + @org.eclipse.jdt.annotation.NonNull + private Double rating; + + public static final String JSON_PROPERTY_PLAYED_PERCENTAGE = "PlayedPercentage"; + @org.eclipse.jdt.annotation.NonNull + private Double playedPercentage; + + public static final String JSON_PROPERTY_UNPLAYED_ITEM_COUNT = "UnplayedItemCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer unplayedItemCount; + + public static final String JSON_PROPERTY_PLAYBACK_POSITION_TICKS = "PlaybackPositionTicks"; + @org.eclipse.jdt.annotation.NonNull + private Long playbackPositionTicks; + + public static final String JSON_PROPERTY_PLAY_COUNT = "PlayCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer playCount; + + public static final String JSON_PROPERTY_IS_FAVORITE = "IsFavorite"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isFavorite; + + public static final String JSON_PROPERTY_LIKES = "Likes"; + @org.eclipse.jdt.annotation.NonNull + private Boolean likes; + + public static final String JSON_PROPERTY_LAST_PLAYED_DATE = "LastPlayedDate"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime lastPlayedDate; + + public static final String JSON_PROPERTY_PLAYED = "Played"; + @org.eclipse.jdt.annotation.NonNull + private Boolean played; + + public static final String JSON_PROPERTY_KEY = "Key"; + @org.eclipse.jdt.annotation.NonNull + private String key; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private String itemId; + + public UserItemDataDto() { + } + + public UserItemDataDto rating(@org.eclipse.jdt.annotation.NonNull Double rating) { + this.rating = rating; + return this; + } + + /** + * Gets or sets the rating. + * + * @return rating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getRating() { + return rating; + } + + @JsonProperty(JSON_PROPERTY_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRating(@org.eclipse.jdt.annotation.NonNull Double rating) { + this.rating = rating; + } + + public UserItemDataDto playedPercentage(@org.eclipse.jdt.annotation.NonNull Double playedPercentage) { + this.playedPercentage = playedPercentage; + return this; + } + + /** + * Gets or sets the played percentage. + * + * @return playedPercentage + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYED_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getPlayedPercentage() { + return playedPercentage; + } + + @JsonProperty(JSON_PROPERTY_PLAYED_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayedPercentage(@org.eclipse.jdt.annotation.NonNull Double playedPercentage) { + this.playedPercentage = playedPercentage; + } + + public UserItemDataDto unplayedItemCount(@org.eclipse.jdt.annotation.NonNull Integer unplayedItemCount) { + this.unplayedItemCount = unplayedItemCount; + return this; + } + + /** + * Gets or sets the unplayed item count. + * + * @return unplayedItemCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_UNPLAYED_ITEM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUnplayedItemCount() { + return unplayedItemCount; + } + + @JsonProperty(JSON_PROPERTY_UNPLAYED_ITEM_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnplayedItemCount(@org.eclipse.jdt.annotation.NonNull Integer unplayedItemCount) { + this.unplayedItemCount = unplayedItemCount; + } + + public UserItemDataDto playbackPositionTicks(@org.eclipse.jdt.annotation.NonNull Long playbackPositionTicks) { + this.playbackPositionTicks = playbackPositionTicks; + return this; + } + + /** + * Gets or sets the playback position ticks. + * + * @return playbackPositionTicks + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYBACK_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPlaybackPositionTicks() { + return playbackPositionTicks; + } + + @JsonProperty(JSON_PROPERTY_PLAYBACK_POSITION_TICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaybackPositionTicks(@org.eclipse.jdt.annotation.NonNull Long playbackPositionTicks) { + this.playbackPositionTicks = playbackPositionTicks; + } + + public UserItemDataDto playCount(@org.eclipse.jdt.annotation.NonNull Integer playCount) { + this.playCount = playCount; + return this; + } + + /** + * Gets or sets the play count. + * + * @return playCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPlayCount() { + return playCount; + } + + @JsonProperty(JSON_PROPERTY_PLAY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayCount(@org.eclipse.jdt.annotation.NonNull Integer playCount) { + this.playCount = playCount; + } + + public UserItemDataDto isFavorite(@org.eclipse.jdt.annotation.NonNull Boolean isFavorite) { + this.isFavorite = isFavorite; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is favorite. + * + * @return isFavorite + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_FAVORITE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsFavorite() { + return isFavorite; + } + + @JsonProperty(JSON_PROPERTY_IS_FAVORITE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsFavorite(@org.eclipse.jdt.annotation.NonNull Boolean isFavorite) { + this.isFavorite = isFavorite; + } + + public UserItemDataDto likes(@org.eclipse.jdt.annotation.NonNull Boolean likes) { + this.likes = likes; + return this; + } + + /** + * Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is likes. + * + * @return likes + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIKES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getLikes() { + return likes; + } + + @JsonProperty(JSON_PROPERTY_LIKES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLikes(@org.eclipse.jdt.annotation.NonNull Boolean likes) { + this.likes = likes; + } + + public UserItemDataDto lastPlayedDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastPlayedDate) { + this.lastPlayedDate = lastPlayedDate; + return this; + } + + /** + * Gets or sets the last played date. + * + * @return lastPlayedDate + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LAST_PLAYED_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastPlayedDate() { + return lastPlayedDate; + } + + @JsonProperty(JSON_PROPERTY_LAST_PLAYED_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastPlayedDate(@org.eclipse.jdt.annotation.NonNull OffsetDateTime lastPlayedDate) { + this.lastPlayedDate = lastPlayedDate; + } + + public UserItemDataDto played(@org.eclipse.jdt.annotation.NonNull Boolean played) { + this.played = played; + return this; + } + + /** + * Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played. + * + * @return played + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PLAYED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPlayed() { + return played; + } + + @JsonProperty(JSON_PROPERTY_PLAYED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlayed(@org.eclipse.jdt.annotation.NonNull Boolean played) { + this.played = played; + } + + public UserItemDataDto key(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + return this; + } + + /** + * Gets or sets the key. + * + * @return key + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(@org.eclipse.jdt.annotation.NonNull String key) { + this.key = key; + } + + public UserItemDataDto itemId(@org.eclipse.jdt.annotation.NonNull String itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item identifier. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull String itemId) { + this.itemId = itemId; + } + + /** + * Return true if this UserItemDataDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserItemDataDto userItemDataDto = (UserItemDataDto) o; + return Objects.equals(this.rating, userItemDataDto.rating) + && Objects.equals(this.playedPercentage, userItemDataDto.playedPercentage) + && Objects.equals(this.unplayedItemCount, userItemDataDto.unplayedItemCount) + && Objects.equals(this.playbackPositionTicks, userItemDataDto.playbackPositionTicks) + && Objects.equals(this.playCount, userItemDataDto.playCount) + && Objects.equals(this.isFavorite, userItemDataDto.isFavorite) + && Objects.equals(this.likes, userItemDataDto.likes) + && Objects.equals(this.lastPlayedDate, userItemDataDto.lastPlayedDate) + && Objects.equals(this.played, userItemDataDto.played) && Objects.equals(this.key, userItemDataDto.key) + && Objects.equals(this.itemId, userItemDataDto.itemId); + } + + @Override + public int hashCode() { + return Objects.hash(rating, playedPercentage, unplayedItemCount, playbackPositionTicks, playCount, isFavorite, + likes, lastPlayedDate, played, key, itemId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserItemDataDto {\n"); + sb.append(" rating: ").append(toIndentedString(rating)).append("\n"); + sb.append(" playedPercentage: ").append(toIndentedString(playedPercentage)).append("\n"); + sb.append(" unplayedItemCount: ").append(toIndentedString(unplayedItemCount)).append("\n"); + sb.append(" playbackPositionTicks: ").append(toIndentedString(playbackPositionTicks)).append("\n"); + sb.append(" playCount: ").append(toIndentedString(playCount)).append("\n"); + sb.append(" isFavorite: ").append(toIndentedString(isFavorite)).append("\n"); + sb.append(" likes: ").append(toIndentedString(likes)).append("\n"); + sb.append(" lastPlayedDate: ").append(toIndentedString(lastPlayedDate)).append("\n"); + sb.append(" played: ").append(toIndentedString(played)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Rating` to the URL query string + if (getRating() != null) { + joiner.add(String.format("%sRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRating())))); + } + + // add `PlayedPercentage` to the URL query string + if (getPlayedPercentage() != null) { + joiner.add(String.format("%sPlayedPercentage%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayedPercentage())))); + } + + // add `UnplayedItemCount` to the URL query string + if (getUnplayedItemCount() != null) { + joiner.add(String.format("%sUnplayedItemCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUnplayedItemCount())))); + } + + // add `PlaybackPositionTicks` to the URL query string + if (getPlaybackPositionTicks() != null) { + joiner.add(String.format("%sPlaybackPositionTicks%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlaybackPositionTicks())))); + } + + // add `PlayCount` to the URL query string + if (getPlayCount() != null) { + joiner.add(String.format("%sPlayCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayCount())))); + } + + // add `IsFavorite` to the URL query string + if (getIsFavorite() != null) { + joiner.add(String.format("%sIsFavorite%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsFavorite())))); + } + + // add `Likes` to the URL query string + if (getLikes() != null) { + joiner.add(String.format("%sLikes%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLikes())))); + } + + // add `LastPlayedDate` to the URL query string + if (getLastPlayedDate() != null) { + joiner.add(String.format("%sLastPlayedDate%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLastPlayedDate())))); + } + + // add `Played` to the URL query string + if (getPlayed() != null) { + joiner.add(String.format("%sPlayed%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPlayed())))); + } + + // add `Key` to the URL query string + if (getKey() != null) { + joiner.add(String.format("%sKey%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getKey())))); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UserItemDataDto instance; + + public Builder() { + this(new UserItemDataDto()); + } + + protected Builder(UserItemDataDto instance) { + this.instance = instance; + } + + public UserItemDataDto.Builder rating(Double rating) { + this.instance.rating = rating; + return this; + } + + public UserItemDataDto.Builder playedPercentage(Double playedPercentage) { + this.instance.playedPercentage = playedPercentage; + return this; + } + + public UserItemDataDto.Builder unplayedItemCount(Integer unplayedItemCount) { + this.instance.unplayedItemCount = unplayedItemCount; + return this; + } + + public UserItemDataDto.Builder playbackPositionTicks(Long playbackPositionTicks) { + this.instance.playbackPositionTicks = playbackPositionTicks; + return this; + } + + public UserItemDataDto.Builder playCount(Integer playCount) { + this.instance.playCount = playCount; + return this; + } + + public UserItemDataDto.Builder isFavorite(Boolean isFavorite) { + this.instance.isFavorite = isFavorite; + return this; + } + + public UserItemDataDto.Builder likes(Boolean likes) { + this.instance.likes = likes; + return this; + } + + public UserItemDataDto.Builder lastPlayedDate(OffsetDateTime lastPlayedDate) { + this.instance.lastPlayedDate = lastPlayedDate; + return this; + } + + public UserItemDataDto.Builder played(Boolean played) { + this.instance.played = played; + return this; + } + + public UserItemDataDto.Builder key(String key) { + this.instance.key = key; + return this; + } + + public UserItemDataDto.Builder itemId(String itemId) { + this.instance.itemId = itemId; + return this; + } + + /** + * returns a built UserItemDataDto instance. + * + * The builder is not reusable. + */ + public UserItemDataDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UserItemDataDto.Builder builder() { + return new UserItemDataDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UserItemDataDto.Builder toBuilder() { + return new UserItemDataDto.Builder().rating(getRating()).playedPercentage(getPlayedPercentage()) + .unplayedItemCount(getUnplayedItemCount()).playbackPositionTicks(getPlaybackPositionTicks()) + .playCount(getPlayCount()).isFavorite(getIsFavorite()).likes(getLikes()) + .lastPlayedDate(getLastPlayedDate()).played(getPlayed()).key(getKey()).itemId(getItemId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UserPolicy.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UserPolicy.java new file mode 100644 index 0000000000000..593ef141143c3 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UserPolicy.java @@ -0,0 +1,1896 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * UserPolicy + */ +@JsonPropertyOrder({ UserPolicy.JSON_PROPERTY_IS_ADMINISTRATOR, UserPolicy.JSON_PROPERTY_IS_HIDDEN, + UserPolicy.JSON_PROPERTY_IS_DISABLED, UserPolicy.JSON_PROPERTY_MAX_PARENTAL_RATING, + UserPolicy.JSON_PROPERTY_BLOCKED_TAGS, UserPolicy.JSON_PROPERTY_ENABLE_USER_PREFERENCE_ACCESS, + UserPolicy.JSON_PROPERTY_ACCESS_SCHEDULES, UserPolicy.JSON_PROPERTY_BLOCK_UNRATED_ITEMS, + UserPolicy.JSON_PROPERTY_ENABLE_REMOTE_CONTROL_OF_OTHER_USERS, + UserPolicy.JSON_PROPERTY_ENABLE_SHARED_DEVICE_CONTROL, UserPolicy.JSON_PROPERTY_ENABLE_REMOTE_ACCESS, + UserPolicy.JSON_PROPERTY_ENABLE_LIVE_TV_MANAGEMENT, UserPolicy.JSON_PROPERTY_ENABLE_LIVE_TV_ACCESS, + UserPolicy.JSON_PROPERTY_ENABLE_MEDIA_PLAYBACK, UserPolicy.JSON_PROPERTY_ENABLE_AUDIO_PLAYBACK_TRANSCODING, + UserPolicy.JSON_PROPERTY_ENABLE_VIDEO_PLAYBACK_TRANSCODING, UserPolicy.JSON_PROPERTY_ENABLE_PLAYBACK_REMUXING, + UserPolicy.JSON_PROPERTY_FORCE_REMOTE_SOURCE_TRANSCODING, UserPolicy.JSON_PROPERTY_ENABLE_CONTENT_DELETION, + UserPolicy.JSON_PROPERTY_ENABLE_CONTENT_DELETION_FROM_FOLDERS, + UserPolicy.JSON_PROPERTY_ENABLE_CONTENT_DOWNLOADING, UserPolicy.JSON_PROPERTY_ENABLE_SYNC_TRANSCODING, + UserPolicy.JSON_PROPERTY_ENABLE_MEDIA_CONVERSION, UserPolicy.JSON_PROPERTY_ENABLED_DEVICES, + UserPolicy.JSON_PROPERTY_ENABLE_ALL_DEVICES, UserPolicy.JSON_PROPERTY_ENABLED_CHANNELS, + UserPolicy.JSON_PROPERTY_ENABLE_ALL_CHANNELS, UserPolicy.JSON_PROPERTY_ENABLED_FOLDERS, + UserPolicy.JSON_PROPERTY_ENABLE_ALL_FOLDERS, UserPolicy.JSON_PROPERTY_INVALID_LOGIN_ATTEMPT_COUNT, + UserPolicy.JSON_PROPERTY_LOGIN_ATTEMPTS_BEFORE_LOCKOUT, UserPolicy.JSON_PROPERTY_MAX_ACTIVE_SESSIONS, + UserPolicy.JSON_PROPERTY_ENABLE_PUBLIC_SHARING, UserPolicy.JSON_PROPERTY_BLOCKED_MEDIA_FOLDERS, + UserPolicy.JSON_PROPERTY_BLOCKED_CHANNELS, UserPolicy.JSON_PROPERTY_REMOTE_CLIENT_BITRATE_LIMIT, + UserPolicy.JSON_PROPERTY_AUTHENTICATION_PROVIDER_ID, UserPolicy.JSON_PROPERTY_PASSWORD_RESET_PROVIDER_ID, + UserPolicy.JSON_PROPERTY_SYNC_PLAY_ACCESS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UserPolicy { + public static final String JSON_PROPERTY_IS_ADMINISTRATOR = "IsAdministrator"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isAdministrator; + + public static final String JSON_PROPERTY_IS_HIDDEN = "IsHidden"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isHidden; + + public static final String JSON_PROPERTY_IS_DISABLED = "IsDisabled"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isDisabled; + + public static final String JSON_PROPERTY_MAX_PARENTAL_RATING = "MaxParentalRating"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxParentalRating; + + public static final String JSON_PROPERTY_BLOCKED_TAGS = "BlockedTags"; + @org.eclipse.jdt.annotation.NonNull + private List blockedTags; + + public static final String JSON_PROPERTY_ENABLE_USER_PREFERENCE_ACCESS = "EnableUserPreferenceAccess"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableUserPreferenceAccess; + + public static final String JSON_PROPERTY_ACCESS_SCHEDULES = "AccessSchedules"; + @org.eclipse.jdt.annotation.NonNull + private List accessSchedules; + + public static final String JSON_PROPERTY_BLOCK_UNRATED_ITEMS = "BlockUnratedItems"; + @org.eclipse.jdt.annotation.NonNull + private List blockUnratedItems; + + public static final String JSON_PROPERTY_ENABLE_REMOTE_CONTROL_OF_OTHER_USERS = "EnableRemoteControlOfOtherUsers"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableRemoteControlOfOtherUsers; + + public static final String JSON_PROPERTY_ENABLE_SHARED_DEVICE_CONTROL = "EnableSharedDeviceControl"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableSharedDeviceControl; + + public static final String JSON_PROPERTY_ENABLE_REMOTE_ACCESS = "EnableRemoteAccess"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableRemoteAccess; + + public static final String JSON_PROPERTY_ENABLE_LIVE_TV_MANAGEMENT = "EnableLiveTvManagement"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableLiveTvManagement; + + public static final String JSON_PROPERTY_ENABLE_LIVE_TV_ACCESS = "EnableLiveTvAccess"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableLiveTvAccess; + + public static final String JSON_PROPERTY_ENABLE_MEDIA_PLAYBACK = "EnableMediaPlayback"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableMediaPlayback; + + public static final String JSON_PROPERTY_ENABLE_AUDIO_PLAYBACK_TRANSCODING = "EnableAudioPlaybackTranscoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAudioPlaybackTranscoding; + + public static final String JSON_PROPERTY_ENABLE_VIDEO_PLAYBACK_TRANSCODING = "EnableVideoPlaybackTranscoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableVideoPlaybackTranscoding; + + public static final String JSON_PROPERTY_ENABLE_PLAYBACK_REMUXING = "EnablePlaybackRemuxing"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enablePlaybackRemuxing; + + public static final String JSON_PROPERTY_FORCE_REMOTE_SOURCE_TRANSCODING = "ForceRemoteSourceTranscoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean forceRemoteSourceTranscoding; + + public static final String JSON_PROPERTY_ENABLE_CONTENT_DELETION = "EnableContentDeletion"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableContentDeletion; + + public static final String JSON_PROPERTY_ENABLE_CONTENT_DELETION_FROM_FOLDERS = "EnableContentDeletionFromFolders"; + @org.eclipse.jdt.annotation.NonNull + private List enableContentDeletionFromFolders; + + public static final String JSON_PROPERTY_ENABLE_CONTENT_DOWNLOADING = "EnableContentDownloading"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableContentDownloading; + + public static final String JSON_PROPERTY_ENABLE_SYNC_TRANSCODING = "EnableSyncTranscoding"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableSyncTranscoding; + + public static final String JSON_PROPERTY_ENABLE_MEDIA_CONVERSION = "EnableMediaConversion"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableMediaConversion; + + public static final String JSON_PROPERTY_ENABLED_DEVICES = "EnabledDevices"; + @org.eclipse.jdt.annotation.NonNull + private List enabledDevices; + + public static final String JSON_PROPERTY_ENABLE_ALL_DEVICES = "EnableAllDevices"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAllDevices; + + public static final String JSON_PROPERTY_ENABLED_CHANNELS = "EnabledChannels"; + @org.eclipse.jdt.annotation.NonNull + private List enabledChannels; + + public static final String JSON_PROPERTY_ENABLE_ALL_CHANNELS = "EnableAllChannels"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAllChannels; + + public static final String JSON_PROPERTY_ENABLED_FOLDERS = "EnabledFolders"; + @org.eclipse.jdt.annotation.NonNull + private List enabledFolders; + + public static final String JSON_PROPERTY_ENABLE_ALL_FOLDERS = "EnableAllFolders"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableAllFolders; + + public static final String JSON_PROPERTY_INVALID_LOGIN_ATTEMPT_COUNT = "InvalidLoginAttemptCount"; + @org.eclipse.jdt.annotation.NonNull + private Integer invalidLoginAttemptCount; + + public static final String JSON_PROPERTY_LOGIN_ATTEMPTS_BEFORE_LOCKOUT = "LoginAttemptsBeforeLockout"; + @org.eclipse.jdt.annotation.NonNull + private Integer loginAttemptsBeforeLockout; + + public static final String JSON_PROPERTY_MAX_ACTIVE_SESSIONS = "MaxActiveSessions"; + @org.eclipse.jdt.annotation.NonNull + private Integer maxActiveSessions; + + public static final String JSON_PROPERTY_ENABLE_PUBLIC_SHARING = "EnablePublicSharing"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enablePublicSharing; + + public static final String JSON_PROPERTY_BLOCKED_MEDIA_FOLDERS = "BlockedMediaFolders"; + @org.eclipse.jdt.annotation.NonNull + private List blockedMediaFolders; + + public static final String JSON_PROPERTY_BLOCKED_CHANNELS = "BlockedChannels"; + @org.eclipse.jdt.annotation.NonNull + private List blockedChannels; + + public static final String JSON_PROPERTY_REMOTE_CLIENT_BITRATE_LIMIT = "RemoteClientBitrateLimit"; + @org.eclipse.jdt.annotation.NonNull + private Integer remoteClientBitrateLimit; + + public static final String JSON_PROPERTY_AUTHENTICATION_PROVIDER_ID = "AuthenticationProviderId"; + @org.eclipse.jdt.annotation.NonNull + private String authenticationProviderId; + + public static final String JSON_PROPERTY_PASSWORD_RESET_PROVIDER_ID = "PasswordResetProviderId"; + @org.eclipse.jdt.annotation.NonNull + private String passwordResetProviderId; + + public static final String JSON_PROPERTY_SYNC_PLAY_ACCESS = "SyncPlayAccess"; + @org.eclipse.jdt.annotation.NonNull + private SyncPlayUserAccessType syncPlayAccess; + + public UserPolicy() { + } + + public UserPolicy isAdministrator(@org.eclipse.jdt.annotation.NonNull Boolean isAdministrator) { + this.isAdministrator = isAdministrator; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is administrator. + * + * @return isAdministrator + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_ADMINISTRATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAdministrator() { + return isAdministrator; + } + + @JsonProperty(JSON_PROPERTY_IS_ADMINISTRATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAdministrator(@org.eclipse.jdt.annotation.NonNull Boolean isAdministrator) { + this.isAdministrator = isAdministrator; + } + + public UserPolicy isHidden(@org.eclipse.jdt.annotation.NonNull Boolean isHidden) { + this.isHidden = isHidden; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is hidden. + * + * @return isHidden + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_HIDDEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsHidden() { + return isHidden; + } + + @JsonProperty(JSON_PROPERTY_IS_HIDDEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsHidden(@org.eclipse.jdt.annotation.NonNull Boolean isHidden) { + this.isHidden = isHidden; + } + + public UserPolicy isDisabled(@org.eclipse.jdt.annotation.NonNull Boolean isDisabled) { + this.isDisabled = isDisabled; + return this; + } + + /** + * Gets or sets a value indicating whether this instance is disabled. + * + * @return isDisabled + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_DISABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsDisabled() { + return isDisabled; + } + + @JsonProperty(JSON_PROPERTY_IS_DISABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDisabled(@org.eclipse.jdt.annotation.NonNull Boolean isDisabled) { + this.isDisabled = isDisabled; + } + + public UserPolicy maxParentalRating(@org.eclipse.jdt.annotation.NonNull Integer maxParentalRating) { + this.maxParentalRating = maxParentalRating; + return this; + } + + /** + * Gets or sets the max parental rating. + * + * @return maxParentalRating + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_PARENTAL_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxParentalRating() { + return maxParentalRating; + } + + @JsonProperty(JSON_PROPERTY_MAX_PARENTAL_RATING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxParentalRating(@org.eclipse.jdt.annotation.NonNull Integer maxParentalRating) { + this.maxParentalRating = maxParentalRating; + } + + public UserPolicy blockedTags(@org.eclipse.jdt.annotation.NonNull List blockedTags) { + this.blockedTags = blockedTags; + return this; + } + + public UserPolicy addBlockedTagsItem(String blockedTagsItem) { + if (this.blockedTags == null) { + this.blockedTags = new ArrayList<>(); + } + this.blockedTags.add(blockedTagsItem); + return this; + } + + /** + * Get blockedTags + * + * @return blockedTags + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BLOCKED_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBlockedTags() { + return blockedTags; + } + + @JsonProperty(JSON_PROPERTY_BLOCKED_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlockedTags(@org.eclipse.jdt.annotation.NonNull List blockedTags) { + this.blockedTags = blockedTags; + } + + public UserPolicy enableUserPreferenceAccess( + @org.eclipse.jdt.annotation.NonNull Boolean enableUserPreferenceAccess) { + this.enableUserPreferenceAccess = enableUserPreferenceAccess; + return this; + } + + /** + * Get enableUserPreferenceAccess + * + * @return enableUserPreferenceAccess + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_USER_PREFERENCE_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableUserPreferenceAccess() { + return enableUserPreferenceAccess; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_USER_PREFERENCE_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableUserPreferenceAccess(@org.eclipse.jdt.annotation.NonNull Boolean enableUserPreferenceAccess) { + this.enableUserPreferenceAccess = enableUserPreferenceAccess; + } + + public UserPolicy accessSchedules(@org.eclipse.jdt.annotation.NonNull List accessSchedules) { + this.accessSchedules = accessSchedules; + return this; + } + + public UserPolicy addAccessSchedulesItem(AccessSchedule accessSchedulesItem) { + if (this.accessSchedules == null) { + this.accessSchedules = new ArrayList<>(); + } + this.accessSchedules.add(accessSchedulesItem); + return this; + } + + /** + * Get accessSchedules + * + * @return accessSchedules + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ACCESS_SCHEDULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAccessSchedules() { + return accessSchedules; + } + + @JsonProperty(JSON_PROPERTY_ACCESS_SCHEDULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessSchedules(@org.eclipse.jdt.annotation.NonNull List accessSchedules) { + this.accessSchedules = accessSchedules; + } + + public UserPolicy blockUnratedItems(@org.eclipse.jdt.annotation.NonNull List blockUnratedItems) { + this.blockUnratedItems = blockUnratedItems; + return this; + } + + public UserPolicy addBlockUnratedItemsItem(UnratedItem blockUnratedItemsItem) { + if (this.blockUnratedItems == null) { + this.blockUnratedItems = new ArrayList<>(); + } + this.blockUnratedItems.add(blockUnratedItemsItem); + return this; + } + + /** + * Get blockUnratedItems + * + * @return blockUnratedItems + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BLOCK_UNRATED_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBlockUnratedItems() { + return blockUnratedItems; + } + + @JsonProperty(JSON_PROPERTY_BLOCK_UNRATED_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlockUnratedItems(@org.eclipse.jdt.annotation.NonNull List blockUnratedItems) { + this.blockUnratedItems = blockUnratedItems; + } + + public UserPolicy enableRemoteControlOfOtherUsers( + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteControlOfOtherUsers) { + this.enableRemoteControlOfOtherUsers = enableRemoteControlOfOtherUsers; + return this; + } + + /** + * Get enableRemoteControlOfOtherUsers + * + * @return enableRemoteControlOfOtherUsers + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_REMOTE_CONTROL_OF_OTHER_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableRemoteControlOfOtherUsers() { + return enableRemoteControlOfOtherUsers; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_REMOTE_CONTROL_OF_OTHER_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableRemoteControlOfOtherUsers( + @org.eclipse.jdt.annotation.NonNull Boolean enableRemoteControlOfOtherUsers) { + this.enableRemoteControlOfOtherUsers = enableRemoteControlOfOtherUsers; + } + + public UserPolicy enableSharedDeviceControl(@org.eclipse.jdt.annotation.NonNull Boolean enableSharedDeviceControl) { + this.enableSharedDeviceControl = enableSharedDeviceControl; + return this; + } + + /** + * Get enableSharedDeviceControl + * + * @return enableSharedDeviceControl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_SHARED_DEVICE_CONTROL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableSharedDeviceControl() { + return enableSharedDeviceControl; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_SHARED_DEVICE_CONTROL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableSharedDeviceControl(@org.eclipse.jdt.annotation.NonNull Boolean enableSharedDeviceControl) { + this.enableSharedDeviceControl = enableSharedDeviceControl; + } + + public UserPolicy enableRemoteAccess(@org.eclipse.jdt.annotation.NonNull Boolean enableRemoteAccess) { + this.enableRemoteAccess = enableRemoteAccess; + return this; + } + + /** + * Get enableRemoteAccess + * + * @return enableRemoteAccess + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_REMOTE_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableRemoteAccess() { + return enableRemoteAccess; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_REMOTE_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableRemoteAccess(@org.eclipse.jdt.annotation.NonNull Boolean enableRemoteAccess) { + this.enableRemoteAccess = enableRemoteAccess; + } + + public UserPolicy enableLiveTvManagement(@org.eclipse.jdt.annotation.NonNull Boolean enableLiveTvManagement) { + this.enableLiveTvManagement = enableLiveTvManagement; + return this; + } + + /** + * Get enableLiveTvManagement + * + * @return enableLiveTvManagement + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_LIVE_TV_MANAGEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableLiveTvManagement() { + return enableLiveTvManagement; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_LIVE_TV_MANAGEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableLiveTvManagement(@org.eclipse.jdt.annotation.NonNull Boolean enableLiveTvManagement) { + this.enableLiveTvManagement = enableLiveTvManagement; + } + + public UserPolicy enableLiveTvAccess(@org.eclipse.jdt.annotation.NonNull Boolean enableLiveTvAccess) { + this.enableLiveTvAccess = enableLiveTvAccess; + return this; + } + + /** + * Get enableLiveTvAccess + * + * @return enableLiveTvAccess + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_LIVE_TV_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableLiveTvAccess() { + return enableLiveTvAccess; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_LIVE_TV_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableLiveTvAccess(@org.eclipse.jdt.annotation.NonNull Boolean enableLiveTvAccess) { + this.enableLiveTvAccess = enableLiveTvAccess; + } + + public UserPolicy enableMediaPlayback(@org.eclipse.jdt.annotation.NonNull Boolean enableMediaPlayback) { + this.enableMediaPlayback = enableMediaPlayback; + return this; + } + + /** + * Get enableMediaPlayback + * + * @return enableMediaPlayback + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_MEDIA_PLAYBACK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableMediaPlayback() { + return enableMediaPlayback; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_MEDIA_PLAYBACK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableMediaPlayback(@org.eclipse.jdt.annotation.NonNull Boolean enableMediaPlayback) { + this.enableMediaPlayback = enableMediaPlayback; + } + + public UserPolicy enableAudioPlaybackTranscoding( + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioPlaybackTranscoding) { + this.enableAudioPlaybackTranscoding = enableAudioPlaybackTranscoding; + return this; + } + + /** + * Get enableAudioPlaybackTranscoding + * + * @return enableAudioPlaybackTranscoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_AUDIO_PLAYBACK_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAudioPlaybackTranscoding() { + return enableAudioPlaybackTranscoding; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_AUDIO_PLAYBACK_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAudioPlaybackTranscoding( + @org.eclipse.jdt.annotation.NonNull Boolean enableAudioPlaybackTranscoding) { + this.enableAudioPlaybackTranscoding = enableAudioPlaybackTranscoding; + } + + public UserPolicy enableVideoPlaybackTranscoding( + @org.eclipse.jdt.annotation.NonNull Boolean enableVideoPlaybackTranscoding) { + this.enableVideoPlaybackTranscoding = enableVideoPlaybackTranscoding; + return this; + } + + /** + * Get enableVideoPlaybackTranscoding + * + * @return enableVideoPlaybackTranscoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_VIDEO_PLAYBACK_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableVideoPlaybackTranscoding() { + return enableVideoPlaybackTranscoding; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_VIDEO_PLAYBACK_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableVideoPlaybackTranscoding( + @org.eclipse.jdt.annotation.NonNull Boolean enableVideoPlaybackTranscoding) { + this.enableVideoPlaybackTranscoding = enableVideoPlaybackTranscoding; + } + + public UserPolicy enablePlaybackRemuxing(@org.eclipse.jdt.annotation.NonNull Boolean enablePlaybackRemuxing) { + this.enablePlaybackRemuxing = enablePlaybackRemuxing; + return this; + } + + /** + * Get enablePlaybackRemuxing + * + * @return enablePlaybackRemuxing + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_PLAYBACK_REMUXING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnablePlaybackRemuxing() { + return enablePlaybackRemuxing; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_PLAYBACK_REMUXING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnablePlaybackRemuxing(@org.eclipse.jdt.annotation.NonNull Boolean enablePlaybackRemuxing) { + this.enablePlaybackRemuxing = enablePlaybackRemuxing; + } + + public UserPolicy forceRemoteSourceTranscoding( + @org.eclipse.jdt.annotation.NonNull Boolean forceRemoteSourceTranscoding) { + this.forceRemoteSourceTranscoding = forceRemoteSourceTranscoding; + return this; + } + + /** + * Get forceRemoteSourceTranscoding + * + * @return forceRemoteSourceTranscoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_FORCE_REMOTE_SOURCE_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForceRemoteSourceTranscoding() { + return forceRemoteSourceTranscoding; + } + + @JsonProperty(JSON_PROPERTY_FORCE_REMOTE_SOURCE_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceRemoteSourceTranscoding( + @org.eclipse.jdt.annotation.NonNull Boolean forceRemoteSourceTranscoding) { + this.forceRemoteSourceTranscoding = forceRemoteSourceTranscoding; + } + + public UserPolicy enableContentDeletion(@org.eclipse.jdt.annotation.NonNull Boolean enableContentDeletion) { + this.enableContentDeletion = enableContentDeletion; + return this; + } + + /** + * Get enableContentDeletion + * + * @return enableContentDeletion + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_CONTENT_DELETION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableContentDeletion() { + return enableContentDeletion; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_CONTENT_DELETION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableContentDeletion(@org.eclipse.jdt.annotation.NonNull Boolean enableContentDeletion) { + this.enableContentDeletion = enableContentDeletion; + } + + public UserPolicy enableContentDeletionFromFolders( + @org.eclipse.jdt.annotation.NonNull List enableContentDeletionFromFolders) { + this.enableContentDeletionFromFolders = enableContentDeletionFromFolders; + return this; + } + + public UserPolicy addEnableContentDeletionFromFoldersItem(String enableContentDeletionFromFoldersItem) { + if (this.enableContentDeletionFromFolders == null) { + this.enableContentDeletionFromFolders = new ArrayList<>(); + } + this.enableContentDeletionFromFolders.add(enableContentDeletionFromFoldersItem); + return this; + } + + /** + * Get enableContentDeletionFromFolders + * + * @return enableContentDeletionFromFolders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_CONTENT_DELETION_FROM_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnableContentDeletionFromFolders() { + return enableContentDeletionFromFolders; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_CONTENT_DELETION_FROM_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableContentDeletionFromFolders( + @org.eclipse.jdt.annotation.NonNull List enableContentDeletionFromFolders) { + this.enableContentDeletionFromFolders = enableContentDeletionFromFolders; + } + + public UserPolicy enableContentDownloading(@org.eclipse.jdt.annotation.NonNull Boolean enableContentDownloading) { + this.enableContentDownloading = enableContentDownloading; + return this; + } + + /** + * Get enableContentDownloading + * + * @return enableContentDownloading + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_CONTENT_DOWNLOADING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableContentDownloading() { + return enableContentDownloading; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_CONTENT_DOWNLOADING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableContentDownloading(@org.eclipse.jdt.annotation.NonNull Boolean enableContentDownloading) { + this.enableContentDownloading = enableContentDownloading; + } + + public UserPolicy enableSyncTranscoding(@org.eclipse.jdt.annotation.NonNull Boolean enableSyncTranscoding) { + this.enableSyncTranscoding = enableSyncTranscoding; + return this; + } + + /** + * Gets or sets a value indicating whether [enable synchronize]. + * + * @return enableSyncTranscoding + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_SYNC_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableSyncTranscoding() { + return enableSyncTranscoding; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_SYNC_TRANSCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableSyncTranscoding(@org.eclipse.jdt.annotation.NonNull Boolean enableSyncTranscoding) { + this.enableSyncTranscoding = enableSyncTranscoding; + } + + public UserPolicy enableMediaConversion(@org.eclipse.jdt.annotation.NonNull Boolean enableMediaConversion) { + this.enableMediaConversion = enableMediaConversion; + return this; + } + + /** + * Get enableMediaConversion + * + * @return enableMediaConversion + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_MEDIA_CONVERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableMediaConversion() { + return enableMediaConversion; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_MEDIA_CONVERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableMediaConversion(@org.eclipse.jdt.annotation.NonNull Boolean enableMediaConversion) { + this.enableMediaConversion = enableMediaConversion; + } + + public UserPolicy enabledDevices(@org.eclipse.jdt.annotation.NonNull List enabledDevices) { + this.enabledDevices = enabledDevices; + return this; + } + + public UserPolicy addEnabledDevicesItem(String enabledDevicesItem) { + if (this.enabledDevices == null) { + this.enabledDevices = new ArrayList<>(); + } + this.enabledDevices.add(enabledDevicesItem); + return this; + } + + /** + * Get enabledDevices + * + * @return enabledDevices + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLED_DEVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnabledDevices() { + return enabledDevices; + } + + @JsonProperty(JSON_PROPERTY_ENABLED_DEVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabledDevices(@org.eclipse.jdt.annotation.NonNull List enabledDevices) { + this.enabledDevices = enabledDevices; + } + + public UserPolicy enableAllDevices(@org.eclipse.jdt.annotation.NonNull Boolean enableAllDevices) { + this.enableAllDevices = enableAllDevices; + return this; + } + + /** + * Get enableAllDevices + * + * @return enableAllDevices + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_ALL_DEVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAllDevices() { + return enableAllDevices; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_ALL_DEVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAllDevices(@org.eclipse.jdt.annotation.NonNull Boolean enableAllDevices) { + this.enableAllDevices = enableAllDevices; + } + + public UserPolicy enabledChannels(@org.eclipse.jdt.annotation.NonNull List enabledChannels) { + this.enabledChannels = enabledChannels; + return this; + } + + public UserPolicy addEnabledChannelsItem(UUID enabledChannelsItem) { + if (this.enabledChannels == null) { + this.enabledChannels = new ArrayList<>(); + } + this.enabledChannels.add(enabledChannelsItem); + return this; + } + + /** + * Get enabledChannels + * + * @return enabledChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLED_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnabledChannels() { + return enabledChannels; + } + + @JsonProperty(JSON_PROPERTY_ENABLED_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabledChannels(@org.eclipse.jdt.annotation.NonNull List enabledChannels) { + this.enabledChannels = enabledChannels; + } + + public UserPolicy enableAllChannels(@org.eclipse.jdt.annotation.NonNull Boolean enableAllChannels) { + this.enableAllChannels = enableAllChannels; + return this; + } + + /** + * Get enableAllChannels + * + * @return enableAllChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_ALL_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAllChannels() { + return enableAllChannels; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_ALL_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAllChannels(@org.eclipse.jdt.annotation.NonNull Boolean enableAllChannels) { + this.enableAllChannels = enableAllChannels; + } + + public UserPolicy enabledFolders(@org.eclipse.jdt.annotation.NonNull List enabledFolders) { + this.enabledFolders = enabledFolders; + return this; + } + + public UserPolicy addEnabledFoldersItem(UUID enabledFoldersItem) { + if (this.enabledFolders == null) { + this.enabledFolders = new ArrayList<>(); + } + this.enabledFolders.add(enabledFoldersItem); + return this; + } + + /** + * Get enabledFolders + * + * @return enabledFolders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLED_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnabledFolders() { + return enabledFolders; + } + + @JsonProperty(JSON_PROPERTY_ENABLED_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabledFolders(@org.eclipse.jdt.annotation.NonNull List enabledFolders) { + this.enabledFolders = enabledFolders; + } + + public UserPolicy enableAllFolders(@org.eclipse.jdt.annotation.NonNull Boolean enableAllFolders) { + this.enableAllFolders = enableAllFolders; + return this; + } + + /** + * Get enableAllFolders + * + * @return enableAllFolders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_ALL_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableAllFolders() { + return enableAllFolders; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_ALL_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableAllFolders(@org.eclipse.jdt.annotation.NonNull Boolean enableAllFolders) { + this.enableAllFolders = enableAllFolders; + } + + public UserPolicy invalidLoginAttemptCount(@org.eclipse.jdt.annotation.NonNull Integer invalidLoginAttemptCount) { + this.invalidLoginAttemptCount = invalidLoginAttemptCount; + return this; + } + + /** + * Get invalidLoginAttemptCount + * + * @return invalidLoginAttemptCount + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_INVALID_LOGIN_ATTEMPT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInvalidLoginAttemptCount() { + return invalidLoginAttemptCount; + } + + @JsonProperty(JSON_PROPERTY_INVALID_LOGIN_ATTEMPT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInvalidLoginAttemptCount(@org.eclipse.jdt.annotation.NonNull Integer invalidLoginAttemptCount) { + this.invalidLoginAttemptCount = invalidLoginAttemptCount; + } + + public UserPolicy loginAttemptsBeforeLockout( + @org.eclipse.jdt.annotation.NonNull Integer loginAttemptsBeforeLockout) { + this.loginAttemptsBeforeLockout = loginAttemptsBeforeLockout; + return this; + } + + /** + * Get loginAttemptsBeforeLockout + * + * @return loginAttemptsBeforeLockout + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOGIN_ATTEMPTS_BEFORE_LOCKOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLoginAttemptsBeforeLockout() { + return loginAttemptsBeforeLockout; + } + + @JsonProperty(JSON_PROPERTY_LOGIN_ATTEMPTS_BEFORE_LOCKOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoginAttemptsBeforeLockout(@org.eclipse.jdt.annotation.NonNull Integer loginAttemptsBeforeLockout) { + this.loginAttemptsBeforeLockout = loginAttemptsBeforeLockout; + } + + public UserPolicy maxActiveSessions(@org.eclipse.jdt.annotation.NonNull Integer maxActiveSessions) { + this.maxActiveSessions = maxActiveSessions; + return this; + } + + /** + * Get maxActiveSessions + * + * @return maxActiveSessions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAX_ACTIVE_SESSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxActiveSessions() { + return maxActiveSessions; + } + + @JsonProperty(JSON_PROPERTY_MAX_ACTIVE_SESSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxActiveSessions(@org.eclipse.jdt.annotation.NonNull Integer maxActiveSessions) { + this.maxActiveSessions = maxActiveSessions; + } + + public UserPolicy enablePublicSharing(@org.eclipse.jdt.annotation.NonNull Boolean enablePublicSharing) { + this.enablePublicSharing = enablePublicSharing; + return this; + } + + /** + * Get enablePublicSharing + * + * @return enablePublicSharing + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_PUBLIC_SHARING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnablePublicSharing() { + return enablePublicSharing; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_PUBLIC_SHARING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnablePublicSharing(@org.eclipse.jdt.annotation.NonNull Boolean enablePublicSharing) { + this.enablePublicSharing = enablePublicSharing; + } + + public UserPolicy blockedMediaFolders(@org.eclipse.jdt.annotation.NonNull List blockedMediaFolders) { + this.blockedMediaFolders = blockedMediaFolders; + return this; + } + + public UserPolicy addBlockedMediaFoldersItem(UUID blockedMediaFoldersItem) { + if (this.blockedMediaFolders == null) { + this.blockedMediaFolders = new ArrayList<>(); + } + this.blockedMediaFolders.add(blockedMediaFoldersItem); + return this; + } + + /** + * Get blockedMediaFolders + * + * @return blockedMediaFolders + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BLOCKED_MEDIA_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBlockedMediaFolders() { + return blockedMediaFolders; + } + + @JsonProperty(JSON_PROPERTY_BLOCKED_MEDIA_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlockedMediaFolders(@org.eclipse.jdt.annotation.NonNull List blockedMediaFolders) { + this.blockedMediaFolders = blockedMediaFolders; + } + + public UserPolicy blockedChannels(@org.eclipse.jdt.annotation.NonNull List blockedChannels) { + this.blockedChannels = blockedChannels; + return this; + } + + public UserPolicy addBlockedChannelsItem(UUID blockedChannelsItem) { + if (this.blockedChannels == null) { + this.blockedChannels = new ArrayList<>(); + } + this.blockedChannels.add(blockedChannelsItem); + return this; + } + + /** + * Get blockedChannels + * + * @return blockedChannels + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_BLOCKED_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBlockedChannels() { + return blockedChannels; + } + + @JsonProperty(JSON_PROPERTY_BLOCKED_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlockedChannels(@org.eclipse.jdt.annotation.NonNull List blockedChannels) { + this.blockedChannels = blockedChannels; + } + + public UserPolicy remoteClientBitrateLimit(@org.eclipse.jdt.annotation.NonNull Integer remoteClientBitrateLimit) { + this.remoteClientBitrateLimit = remoteClientBitrateLimit; + return this; + } + + /** + * Get remoteClientBitrateLimit + * + * @return remoteClientBitrateLimit + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REMOTE_CLIENT_BITRATE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRemoteClientBitrateLimit() { + return remoteClientBitrateLimit; + } + + @JsonProperty(JSON_PROPERTY_REMOTE_CLIENT_BITRATE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemoteClientBitrateLimit(@org.eclipse.jdt.annotation.NonNull Integer remoteClientBitrateLimit) { + this.remoteClientBitrateLimit = remoteClientBitrateLimit; + } + + public UserPolicy authenticationProviderId(@org.eclipse.jdt.annotation.NonNull String authenticationProviderId) { + this.authenticationProviderId = authenticationProviderId; + return this; + } + + /** + * Get authenticationProviderId + * + * @return authenticationProviderId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_AUTHENTICATION_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthenticationProviderId() { + return authenticationProviderId; + } + + @JsonProperty(JSON_PROPERTY_AUTHENTICATION_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthenticationProviderId(@org.eclipse.jdt.annotation.NonNull String authenticationProviderId) { + this.authenticationProviderId = authenticationProviderId; + } + + public UserPolicy passwordResetProviderId(@org.eclipse.jdt.annotation.NonNull String passwordResetProviderId) { + this.passwordResetProviderId = passwordResetProviderId; + return this; + } + + /** + * Get passwordResetProviderId + * + * @return passwordResetProviderId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PASSWORD_RESET_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPasswordResetProviderId() { + return passwordResetProviderId; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD_RESET_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPasswordResetProviderId(@org.eclipse.jdt.annotation.NonNull String passwordResetProviderId) { + this.passwordResetProviderId = passwordResetProviderId; + } + + public UserPolicy syncPlayAccess(@org.eclipse.jdt.annotation.NonNull SyncPlayUserAccessType syncPlayAccess) { + this.syncPlayAccess = syncPlayAccess; + return this; + } + + /** + * Gets or sets a value indicating what SyncPlay features the user can access. + * + * @return syncPlayAccess + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SYNC_PLAY_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyncPlayUserAccessType getSyncPlayAccess() { + return syncPlayAccess; + } + + @JsonProperty(JSON_PROPERTY_SYNC_PLAY_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSyncPlayAccess(@org.eclipse.jdt.annotation.NonNull SyncPlayUserAccessType syncPlayAccess) { + this.syncPlayAccess = syncPlayAccess; + } + + /** + * Return true if this UserPolicy object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserPolicy userPolicy = (UserPolicy) o; + return Objects.equals(this.isAdministrator, userPolicy.isAdministrator) + && Objects.equals(this.isHidden, userPolicy.isHidden) + && Objects.equals(this.isDisabled, userPolicy.isDisabled) + && Objects.equals(this.maxParentalRating, userPolicy.maxParentalRating) + && Objects.equals(this.blockedTags, userPolicy.blockedTags) + && Objects.equals(this.enableUserPreferenceAccess, userPolicy.enableUserPreferenceAccess) + && Objects.equals(this.accessSchedules, userPolicy.accessSchedules) + && Objects.equals(this.blockUnratedItems, userPolicy.blockUnratedItems) + && Objects.equals(this.enableRemoteControlOfOtherUsers, userPolicy.enableRemoteControlOfOtherUsers) + && Objects.equals(this.enableSharedDeviceControl, userPolicy.enableSharedDeviceControl) + && Objects.equals(this.enableRemoteAccess, userPolicy.enableRemoteAccess) + && Objects.equals(this.enableLiveTvManagement, userPolicy.enableLiveTvManagement) + && Objects.equals(this.enableLiveTvAccess, userPolicy.enableLiveTvAccess) + && Objects.equals(this.enableMediaPlayback, userPolicy.enableMediaPlayback) + && Objects.equals(this.enableAudioPlaybackTranscoding, userPolicy.enableAudioPlaybackTranscoding) + && Objects.equals(this.enableVideoPlaybackTranscoding, userPolicy.enableVideoPlaybackTranscoding) + && Objects.equals(this.enablePlaybackRemuxing, userPolicy.enablePlaybackRemuxing) + && Objects.equals(this.forceRemoteSourceTranscoding, userPolicy.forceRemoteSourceTranscoding) + && Objects.equals(this.enableContentDeletion, userPolicy.enableContentDeletion) + && Objects.equals(this.enableContentDeletionFromFolders, userPolicy.enableContentDeletionFromFolders) + && Objects.equals(this.enableContentDownloading, userPolicy.enableContentDownloading) + && Objects.equals(this.enableSyncTranscoding, userPolicy.enableSyncTranscoding) + && Objects.equals(this.enableMediaConversion, userPolicy.enableMediaConversion) + && Objects.equals(this.enabledDevices, userPolicy.enabledDevices) + && Objects.equals(this.enableAllDevices, userPolicy.enableAllDevices) + && Objects.equals(this.enabledChannels, userPolicy.enabledChannels) + && Objects.equals(this.enableAllChannels, userPolicy.enableAllChannels) + && Objects.equals(this.enabledFolders, userPolicy.enabledFolders) + && Objects.equals(this.enableAllFolders, userPolicy.enableAllFolders) + && Objects.equals(this.invalidLoginAttemptCount, userPolicy.invalidLoginAttemptCount) + && Objects.equals(this.loginAttemptsBeforeLockout, userPolicy.loginAttemptsBeforeLockout) + && Objects.equals(this.maxActiveSessions, userPolicy.maxActiveSessions) + && Objects.equals(this.enablePublicSharing, userPolicy.enablePublicSharing) + && Objects.equals(this.blockedMediaFolders, userPolicy.blockedMediaFolders) + && Objects.equals(this.blockedChannels, userPolicy.blockedChannels) + && Objects.equals(this.remoteClientBitrateLimit, userPolicy.remoteClientBitrateLimit) + && Objects.equals(this.authenticationProviderId, userPolicy.authenticationProviderId) + && Objects.equals(this.passwordResetProviderId, userPolicy.passwordResetProviderId) + && Objects.equals(this.syncPlayAccess, userPolicy.syncPlayAccess); + } + + @Override + public int hashCode() { + return Objects.hash(isAdministrator, isHidden, isDisabled, maxParentalRating, blockedTags, + enableUserPreferenceAccess, accessSchedules, blockUnratedItems, enableRemoteControlOfOtherUsers, + enableSharedDeviceControl, enableRemoteAccess, enableLiveTvManagement, enableLiveTvAccess, + enableMediaPlayback, enableAudioPlaybackTranscoding, enableVideoPlaybackTranscoding, + enablePlaybackRemuxing, forceRemoteSourceTranscoding, enableContentDeletion, + enableContentDeletionFromFolders, enableContentDownloading, enableSyncTranscoding, + enableMediaConversion, enabledDevices, enableAllDevices, enabledChannels, enableAllChannels, + enabledFolders, enableAllFolders, invalidLoginAttemptCount, loginAttemptsBeforeLockout, + maxActiveSessions, enablePublicSharing, blockedMediaFolders, blockedChannels, remoteClientBitrateLimit, + authenticationProviderId, passwordResetProviderId, syncPlayAccess); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserPolicy {\n"); + sb.append(" isAdministrator: ").append(toIndentedString(isAdministrator)).append("\n"); + sb.append(" isHidden: ").append(toIndentedString(isHidden)).append("\n"); + sb.append(" isDisabled: ").append(toIndentedString(isDisabled)).append("\n"); + sb.append(" maxParentalRating: ").append(toIndentedString(maxParentalRating)).append("\n"); + sb.append(" blockedTags: ").append(toIndentedString(blockedTags)).append("\n"); + sb.append(" enableUserPreferenceAccess: ").append(toIndentedString(enableUserPreferenceAccess)).append("\n"); + sb.append(" accessSchedules: ").append(toIndentedString(accessSchedules)).append("\n"); + sb.append(" blockUnratedItems: ").append(toIndentedString(blockUnratedItems)).append("\n"); + sb.append(" enableRemoteControlOfOtherUsers: ").append(toIndentedString(enableRemoteControlOfOtherUsers)) + .append("\n"); + sb.append(" enableSharedDeviceControl: ").append(toIndentedString(enableSharedDeviceControl)).append("\n"); + sb.append(" enableRemoteAccess: ").append(toIndentedString(enableRemoteAccess)).append("\n"); + sb.append(" enableLiveTvManagement: ").append(toIndentedString(enableLiveTvManagement)).append("\n"); + sb.append(" enableLiveTvAccess: ").append(toIndentedString(enableLiveTvAccess)).append("\n"); + sb.append(" enableMediaPlayback: ").append(toIndentedString(enableMediaPlayback)).append("\n"); + sb.append(" enableAudioPlaybackTranscoding: ").append(toIndentedString(enableAudioPlaybackTranscoding)) + .append("\n"); + sb.append(" enableVideoPlaybackTranscoding: ").append(toIndentedString(enableVideoPlaybackTranscoding)) + .append("\n"); + sb.append(" enablePlaybackRemuxing: ").append(toIndentedString(enablePlaybackRemuxing)).append("\n"); + sb.append(" forceRemoteSourceTranscoding: ").append(toIndentedString(forceRemoteSourceTranscoding)) + .append("\n"); + sb.append(" enableContentDeletion: ").append(toIndentedString(enableContentDeletion)).append("\n"); + sb.append(" enableContentDeletionFromFolders: ").append(toIndentedString(enableContentDeletionFromFolders)) + .append("\n"); + sb.append(" enableContentDownloading: ").append(toIndentedString(enableContentDownloading)).append("\n"); + sb.append(" enableSyncTranscoding: ").append(toIndentedString(enableSyncTranscoding)).append("\n"); + sb.append(" enableMediaConversion: ").append(toIndentedString(enableMediaConversion)).append("\n"); + sb.append(" enabledDevices: ").append(toIndentedString(enabledDevices)).append("\n"); + sb.append(" enableAllDevices: ").append(toIndentedString(enableAllDevices)).append("\n"); + sb.append(" enabledChannels: ").append(toIndentedString(enabledChannels)).append("\n"); + sb.append(" enableAllChannels: ").append(toIndentedString(enableAllChannels)).append("\n"); + sb.append(" enabledFolders: ").append(toIndentedString(enabledFolders)).append("\n"); + sb.append(" enableAllFolders: ").append(toIndentedString(enableAllFolders)).append("\n"); + sb.append(" invalidLoginAttemptCount: ").append(toIndentedString(invalidLoginAttemptCount)).append("\n"); + sb.append(" loginAttemptsBeforeLockout: ").append(toIndentedString(loginAttemptsBeforeLockout)).append("\n"); + sb.append(" maxActiveSessions: ").append(toIndentedString(maxActiveSessions)).append("\n"); + sb.append(" enablePublicSharing: ").append(toIndentedString(enablePublicSharing)).append("\n"); + sb.append(" blockedMediaFolders: ").append(toIndentedString(blockedMediaFolders)).append("\n"); + sb.append(" blockedChannels: ").append(toIndentedString(blockedChannels)).append("\n"); + sb.append(" remoteClientBitrateLimit: ").append(toIndentedString(remoteClientBitrateLimit)).append("\n"); + sb.append(" authenticationProviderId: ").append(toIndentedString(authenticationProviderId)).append("\n"); + sb.append(" passwordResetProviderId: ").append(toIndentedString(passwordResetProviderId)).append("\n"); + sb.append(" syncPlayAccess: ").append(toIndentedString(syncPlayAccess)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `IsAdministrator` to the URL query string + if (getIsAdministrator() != null) { + joiner.add(String.format("%sIsAdministrator%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsAdministrator())))); + } + + // add `IsHidden` to the URL query string + if (getIsHidden() != null) { + joiner.add(String.format("%sIsHidden%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsHidden())))); + } + + // add `IsDisabled` to the URL query string + if (getIsDisabled() != null) { + joiner.add(String.format("%sIsDisabled%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsDisabled())))); + } + + // add `MaxParentalRating` to the URL query string + if (getMaxParentalRating() != null) { + joiner.add(String.format("%sMaxParentalRating%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxParentalRating())))); + } + + // add `BlockedTags` to the URL query string + if (getBlockedTags() != null) { + for (int i = 0; i < getBlockedTags().size(); i++) { + joiner.add(String.format("%sBlockedTags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getBlockedTags().get(i))))); + } + } + + // add `EnableUserPreferenceAccess` to the URL query string + if (getEnableUserPreferenceAccess() != null) { + joiner.add(String.format("%sEnableUserPreferenceAccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableUserPreferenceAccess())))); + } + + // add `AccessSchedules` to the URL query string + if (getAccessSchedules() != null) { + for (int i = 0; i < getAccessSchedules().size(); i++) { + if (getAccessSchedules().get(i) != null) { + joiner.add(getAccessSchedules().get(i).toUrlQueryString(String.format("%sAccessSchedules%s%s", + prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `BlockUnratedItems` to the URL query string + if (getBlockUnratedItems() != null) { + for (int i = 0; i < getBlockUnratedItems().size(); i++) { + if (getBlockUnratedItems().get(i) != null) { + joiner.add(String.format("%sBlockUnratedItems%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getBlockUnratedItems().get(i))))); + } + } + } + + // add `EnableRemoteControlOfOtherUsers` to the URL query string + if (getEnableRemoteControlOfOtherUsers() != null) { + joiner.add(String.format("%sEnableRemoteControlOfOtherUsers%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableRemoteControlOfOtherUsers())))); + } + + // add `EnableSharedDeviceControl` to the URL query string + if (getEnableSharedDeviceControl() != null) { + joiner.add(String.format("%sEnableSharedDeviceControl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableSharedDeviceControl())))); + } + + // add `EnableRemoteAccess` to the URL query string + if (getEnableRemoteAccess() != null) { + joiner.add(String.format("%sEnableRemoteAccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableRemoteAccess())))); + } + + // add `EnableLiveTvManagement` to the URL query string + if (getEnableLiveTvManagement() != null) { + joiner.add(String.format("%sEnableLiveTvManagement%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableLiveTvManagement())))); + } + + // add `EnableLiveTvAccess` to the URL query string + if (getEnableLiveTvAccess() != null) { + joiner.add(String.format("%sEnableLiveTvAccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableLiveTvAccess())))); + } + + // add `EnableMediaPlayback` to the URL query string + if (getEnableMediaPlayback() != null) { + joiner.add(String.format("%sEnableMediaPlayback%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableMediaPlayback())))); + } + + // add `EnableAudioPlaybackTranscoding` to the URL query string + if (getEnableAudioPlaybackTranscoding() != null) { + joiner.add(String.format("%sEnableAudioPlaybackTranscoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAudioPlaybackTranscoding())))); + } + + // add `EnableVideoPlaybackTranscoding` to the URL query string + if (getEnableVideoPlaybackTranscoding() != null) { + joiner.add(String.format("%sEnableVideoPlaybackTranscoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableVideoPlaybackTranscoding())))); + } + + // add `EnablePlaybackRemuxing` to the URL query string + if (getEnablePlaybackRemuxing() != null) { + joiner.add(String.format("%sEnablePlaybackRemuxing%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnablePlaybackRemuxing())))); + } + + // add `ForceRemoteSourceTranscoding` to the URL query string + if (getForceRemoteSourceTranscoding() != null) { + joiner.add(String.format("%sForceRemoteSourceTranscoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getForceRemoteSourceTranscoding())))); + } + + // add `EnableContentDeletion` to the URL query string + if (getEnableContentDeletion() != null) { + joiner.add(String.format("%sEnableContentDeletion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableContentDeletion())))); + } + + // add `EnableContentDeletionFromFolders` to the URL query string + if (getEnableContentDeletionFromFolders() != null) { + for (int i = 0; i < getEnableContentDeletionFromFolders().size(); i++) { + joiner.add(String.format("%sEnableContentDeletionFromFolders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEnableContentDeletionFromFolders().get(i))))); + } + } + + // add `EnableContentDownloading` to the URL query string + if (getEnableContentDownloading() != null) { + joiner.add(String.format("%sEnableContentDownloading%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableContentDownloading())))); + } + + // add `EnableSyncTranscoding` to the URL query string + if (getEnableSyncTranscoding() != null) { + joiner.add(String.format("%sEnableSyncTranscoding%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableSyncTranscoding())))); + } + + // add `EnableMediaConversion` to the URL query string + if (getEnableMediaConversion() != null) { + joiner.add(String.format("%sEnableMediaConversion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableMediaConversion())))); + } + + // add `EnabledDevices` to the URL query string + if (getEnabledDevices() != null) { + for (int i = 0; i < getEnabledDevices().size(); i++) { + joiner.add(String.format("%sEnabledDevices%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEnabledDevices().get(i))))); + } + } + + // add `EnableAllDevices` to the URL query string + if (getEnableAllDevices() != null) { + joiner.add(String.format("%sEnableAllDevices%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAllDevices())))); + } + + // add `EnabledChannels` to the URL query string + if (getEnabledChannels() != null) { + for (int i = 0; i < getEnabledChannels().size(); i++) { + if (getEnabledChannels().get(i) != null) { + joiner.add(String.format("%sEnabledChannels%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEnabledChannels().get(i))))); + } + } + } + + // add `EnableAllChannels` to the URL query string + if (getEnableAllChannels() != null) { + joiner.add(String.format("%sEnableAllChannels%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAllChannels())))); + } + + // add `EnabledFolders` to the URL query string + if (getEnabledFolders() != null) { + for (int i = 0; i < getEnabledFolders().size(); i++) { + if (getEnabledFolders().get(i) != null) { + joiner.add(String.format("%sEnabledFolders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getEnabledFolders().get(i))))); + } + } + } + + // add `EnableAllFolders` to the URL query string + if (getEnableAllFolders() != null) { + joiner.add(String.format("%sEnableAllFolders%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableAllFolders())))); + } + + // add `InvalidLoginAttemptCount` to the URL query string + if (getInvalidLoginAttemptCount() != null) { + joiner.add(String.format("%sInvalidLoginAttemptCount%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getInvalidLoginAttemptCount())))); + } + + // add `LoginAttemptsBeforeLockout` to the URL query string + if (getLoginAttemptsBeforeLockout() != null) { + joiner.add(String.format("%sLoginAttemptsBeforeLockout%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLoginAttemptsBeforeLockout())))); + } + + // add `MaxActiveSessions` to the URL query string + if (getMaxActiveSessions() != null) { + joiner.add(String.format("%sMaxActiveSessions%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMaxActiveSessions())))); + } + + // add `EnablePublicSharing` to the URL query string + if (getEnablePublicSharing() != null) { + joiner.add(String.format("%sEnablePublicSharing%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnablePublicSharing())))); + } + + // add `BlockedMediaFolders` to the URL query string + if (getBlockedMediaFolders() != null) { + for (int i = 0; i < getBlockedMediaFolders().size(); i++) { + if (getBlockedMediaFolders().get(i) != null) { + joiner.add(String.format("%sBlockedMediaFolders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getBlockedMediaFolders().get(i))))); + } + } + } + + // add `BlockedChannels` to the URL query string + if (getBlockedChannels() != null) { + for (int i = 0; i < getBlockedChannels().size(); i++) { + if (getBlockedChannels().get(i) != null) { + joiner.add(String.format("%sBlockedChannels%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getBlockedChannels().get(i))))); + } + } + } + + // add `RemoteClientBitrateLimit` to the URL query string + if (getRemoteClientBitrateLimit() != null) { + joiner.add(String.format("%sRemoteClientBitrateLimit%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRemoteClientBitrateLimit())))); + } + + // add `AuthenticationProviderId` to the URL query string + if (getAuthenticationProviderId() != null) { + joiner.add(String.format("%sAuthenticationProviderId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAuthenticationProviderId())))); + } + + // add `PasswordResetProviderId` to the URL query string + if (getPasswordResetProviderId() != null) { + joiner.add(String.format("%sPasswordResetProviderId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPasswordResetProviderId())))); + } + + // add `SyncPlayAccess` to the URL query string + if (getSyncPlayAccess() != null) { + joiner.add(String.format("%sSyncPlayAccess%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSyncPlayAccess())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UserPolicy instance; + + public Builder() { + this(new UserPolicy()); + } + + protected Builder(UserPolicy instance) { + this.instance = instance; + } + + public UserPolicy.Builder isAdministrator(Boolean isAdministrator) { + this.instance.isAdministrator = isAdministrator; + return this; + } + + public UserPolicy.Builder isHidden(Boolean isHidden) { + this.instance.isHidden = isHidden; + return this; + } + + public UserPolicy.Builder isDisabled(Boolean isDisabled) { + this.instance.isDisabled = isDisabled; + return this; + } + + public UserPolicy.Builder maxParentalRating(Integer maxParentalRating) { + this.instance.maxParentalRating = maxParentalRating; + return this; + } + + public UserPolicy.Builder blockedTags(List blockedTags) { + this.instance.blockedTags = blockedTags; + return this; + } + + public UserPolicy.Builder enableUserPreferenceAccess(Boolean enableUserPreferenceAccess) { + this.instance.enableUserPreferenceAccess = enableUserPreferenceAccess; + return this; + } + + public UserPolicy.Builder accessSchedules(List accessSchedules) { + this.instance.accessSchedules = accessSchedules; + return this; + } + + public UserPolicy.Builder blockUnratedItems(List blockUnratedItems) { + this.instance.blockUnratedItems = blockUnratedItems; + return this; + } + + public UserPolicy.Builder enableRemoteControlOfOtherUsers(Boolean enableRemoteControlOfOtherUsers) { + this.instance.enableRemoteControlOfOtherUsers = enableRemoteControlOfOtherUsers; + return this; + } + + public UserPolicy.Builder enableSharedDeviceControl(Boolean enableSharedDeviceControl) { + this.instance.enableSharedDeviceControl = enableSharedDeviceControl; + return this; + } + + public UserPolicy.Builder enableRemoteAccess(Boolean enableRemoteAccess) { + this.instance.enableRemoteAccess = enableRemoteAccess; + return this; + } + + public UserPolicy.Builder enableLiveTvManagement(Boolean enableLiveTvManagement) { + this.instance.enableLiveTvManagement = enableLiveTvManagement; + return this; + } + + public UserPolicy.Builder enableLiveTvAccess(Boolean enableLiveTvAccess) { + this.instance.enableLiveTvAccess = enableLiveTvAccess; + return this; + } + + public UserPolicy.Builder enableMediaPlayback(Boolean enableMediaPlayback) { + this.instance.enableMediaPlayback = enableMediaPlayback; + return this; + } + + public UserPolicy.Builder enableAudioPlaybackTranscoding(Boolean enableAudioPlaybackTranscoding) { + this.instance.enableAudioPlaybackTranscoding = enableAudioPlaybackTranscoding; + return this; + } + + public UserPolicy.Builder enableVideoPlaybackTranscoding(Boolean enableVideoPlaybackTranscoding) { + this.instance.enableVideoPlaybackTranscoding = enableVideoPlaybackTranscoding; + return this; + } + + public UserPolicy.Builder enablePlaybackRemuxing(Boolean enablePlaybackRemuxing) { + this.instance.enablePlaybackRemuxing = enablePlaybackRemuxing; + return this; + } + + public UserPolicy.Builder forceRemoteSourceTranscoding(Boolean forceRemoteSourceTranscoding) { + this.instance.forceRemoteSourceTranscoding = forceRemoteSourceTranscoding; + return this; + } + + public UserPolicy.Builder enableContentDeletion(Boolean enableContentDeletion) { + this.instance.enableContentDeletion = enableContentDeletion; + return this; + } + + public UserPolicy.Builder enableContentDeletionFromFolders(List enableContentDeletionFromFolders) { + this.instance.enableContentDeletionFromFolders = enableContentDeletionFromFolders; + return this; + } + + public UserPolicy.Builder enableContentDownloading(Boolean enableContentDownloading) { + this.instance.enableContentDownloading = enableContentDownloading; + return this; + } + + public UserPolicy.Builder enableSyncTranscoding(Boolean enableSyncTranscoding) { + this.instance.enableSyncTranscoding = enableSyncTranscoding; + return this; + } + + public UserPolicy.Builder enableMediaConversion(Boolean enableMediaConversion) { + this.instance.enableMediaConversion = enableMediaConversion; + return this; + } + + public UserPolicy.Builder enabledDevices(List enabledDevices) { + this.instance.enabledDevices = enabledDevices; + return this; + } + + public UserPolicy.Builder enableAllDevices(Boolean enableAllDevices) { + this.instance.enableAllDevices = enableAllDevices; + return this; + } + + public UserPolicy.Builder enabledChannels(List enabledChannels) { + this.instance.enabledChannels = enabledChannels; + return this; + } + + public UserPolicy.Builder enableAllChannels(Boolean enableAllChannels) { + this.instance.enableAllChannels = enableAllChannels; + return this; + } + + public UserPolicy.Builder enabledFolders(List enabledFolders) { + this.instance.enabledFolders = enabledFolders; + return this; + } + + public UserPolicy.Builder enableAllFolders(Boolean enableAllFolders) { + this.instance.enableAllFolders = enableAllFolders; + return this; + } + + public UserPolicy.Builder invalidLoginAttemptCount(Integer invalidLoginAttemptCount) { + this.instance.invalidLoginAttemptCount = invalidLoginAttemptCount; + return this; + } + + public UserPolicy.Builder loginAttemptsBeforeLockout(Integer loginAttemptsBeforeLockout) { + this.instance.loginAttemptsBeforeLockout = loginAttemptsBeforeLockout; + return this; + } + + public UserPolicy.Builder maxActiveSessions(Integer maxActiveSessions) { + this.instance.maxActiveSessions = maxActiveSessions; + return this; + } + + public UserPolicy.Builder enablePublicSharing(Boolean enablePublicSharing) { + this.instance.enablePublicSharing = enablePublicSharing; + return this; + } + + public UserPolicy.Builder blockedMediaFolders(List blockedMediaFolders) { + this.instance.blockedMediaFolders = blockedMediaFolders; + return this; + } + + public UserPolicy.Builder blockedChannels(List blockedChannels) { + this.instance.blockedChannels = blockedChannels; + return this; + } + + public UserPolicy.Builder remoteClientBitrateLimit(Integer remoteClientBitrateLimit) { + this.instance.remoteClientBitrateLimit = remoteClientBitrateLimit; + return this; + } + + public UserPolicy.Builder authenticationProviderId(String authenticationProviderId) { + this.instance.authenticationProviderId = authenticationProviderId; + return this; + } + + public UserPolicy.Builder passwordResetProviderId(String passwordResetProviderId) { + this.instance.passwordResetProviderId = passwordResetProviderId; + return this; + } + + public UserPolicy.Builder syncPlayAccess(SyncPlayUserAccessType syncPlayAccess) { + this.instance.syncPlayAccess = syncPlayAccess; + return this; + } + + /** + * returns a built UserPolicy instance. + * + * The builder is not reusable. + */ + public UserPolicy build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UserPolicy.Builder builder() { + return new UserPolicy.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UserPolicy.Builder toBuilder() { + return new UserPolicy.Builder().isAdministrator(getIsAdministrator()).isHidden(getIsHidden()) + .isDisabled(getIsDisabled()).maxParentalRating(getMaxParentalRating()).blockedTags(getBlockedTags()) + .enableUserPreferenceAccess(getEnableUserPreferenceAccess()).accessSchedules(getAccessSchedules()) + .blockUnratedItems(getBlockUnratedItems()) + .enableRemoteControlOfOtherUsers(getEnableRemoteControlOfOtherUsers()) + .enableSharedDeviceControl(getEnableSharedDeviceControl()).enableRemoteAccess(getEnableRemoteAccess()) + .enableLiveTvManagement(getEnableLiveTvManagement()).enableLiveTvAccess(getEnableLiveTvAccess()) + .enableMediaPlayback(getEnableMediaPlayback()) + .enableAudioPlaybackTranscoding(getEnableAudioPlaybackTranscoding()) + .enableVideoPlaybackTranscoding(getEnableVideoPlaybackTranscoding()) + .enablePlaybackRemuxing(getEnablePlaybackRemuxing()) + .forceRemoteSourceTranscoding(getForceRemoteSourceTranscoding()) + .enableContentDeletion(getEnableContentDeletion()) + .enableContentDeletionFromFolders(getEnableContentDeletionFromFolders()) + .enableContentDownloading(getEnableContentDownloading()) + .enableSyncTranscoding(getEnableSyncTranscoding()).enableMediaConversion(getEnableMediaConversion()) + .enabledDevices(getEnabledDevices()).enableAllDevices(getEnableAllDevices()) + .enabledChannels(getEnabledChannels()).enableAllChannels(getEnableAllChannels()) + .enabledFolders(getEnabledFolders()).enableAllFolders(getEnableAllFolders()) + .invalidLoginAttemptCount(getInvalidLoginAttemptCount()) + .loginAttemptsBeforeLockout(getLoginAttemptsBeforeLockout()).maxActiveSessions(getMaxActiveSessions()) + .enablePublicSharing(getEnablePublicSharing()).blockedMediaFolders(getBlockedMediaFolders()) + .blockedChannels(getBlockedChannels()).remoteClientBitrateLimit(getRemoteClientBitrateLimit()) + .authenticationProviderId(getAuthenticationProviderId()) + .passwordResetProviderId(getPasswordResetProviderId()).syncPlayAccess(getSyncPlayAccess()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UtcTimeResponse.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UtcTimeResponse.java new file mode 100644 index 0000000000000..963c583845e5d --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/UtcTimeResponse.java @@ -0,0 +1,238 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Class UtcTimeResponse. + */ +@JsonPropertyOrder({ UtcTimeResponse.JSON_PROPERTY_REQUEST_RECEPTION_TIME, + UtcTimeResponse.JSON_PROPERTY_RESPONSE_TRANSMISSION_TIME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class UtcTimeResponse { + public static final String JSON_PROPERTY_REQUEST_RECEPTION_TIME = "RequestReceptionTime"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime requestReceptionTime; + + public static final String JSON_PROPERTY_RESPONSE_TRANSMISSION_TIME = "ResponseTransmissionTime"; + @org.eclipse.jdt.annotation.NonNull + private OffsetDateTime responseTransmissionTime; + + public UtcTimeResponse() { + } + + public UtcTimeResponse requestReceptionTime( + @org.eclipse.jdt.annotation.NonNull OffsetDateTime requestReceptionTime) { + this.requestReceptionTime = requestReceptionTime; + return this; + } + + /** + * Gets the UTC time when request has been received. + * + * @return requestReceptionTime + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REQUEST_RECEPTION_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getRequestReceptionTime() { + return requestReceptionTime; + } + + @JsonProperty(JSON_PROPERTY_REQUEST_RECEPTION_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestReceptionTime(@org.eclipse.jdt.annotation.NonNull OffsetDateTime requestReceptionTime) { + this.requestReceptionTime = requestReceptionTime; + } + + public UtcTimeResponse responseTransmissionTime( + @org.eclipse.jdt.annotation.NonNull OffsetDateTime responseTransmissionTime) { + this.responseTransmissionTime = responseTransmissionTime; + return this; + } + + /** + * Gets the UTC time when response has been sent. + * + * @return responseTransmissionTime + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RESPONSE_TRANSMISSION_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getResponseTransmissionTime() { + return responseTransmissionTime; + } + + @JsonProperty(JSON_PROPERTY_RESPONSE_TRANSMISSION_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponseTransmissionTime( + @org.eclipse.jdt.annotation.NonNull OffsetDateTime responseTransmissionTime) { + this.responseTransmissionTime = responseTransmissionTime; + } + + /** + * Return true if this UtcTimeResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UtcTimeResponse utcTimeResponse = (UtcTimeResponse) o; + return Objects.equals(this.requestReceptionTime, utcTimeResponse.requestReceptionTime) + && Objects.equals(this.responseTransmissionTime, utcTimeResponse.responseTransmissionTime); + } + + @Override + public int hashCode() { + return Objects.hash(requestReceptionTime, responseTransmissionTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UtcTimeResponse {\n"); + sb.append(" requestReceptionTime: ").append(toIndentedString(requestReceptionTime)).append("\n"); + sb.append(" responseTransmissionTime: ").append(toIndentedString(responseTransmissionTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `RequestReceptionTime` to the URL query string + if (getRequestReceptionTime() != null) { + joiner.add(String.format("%sRequestReceptionTime%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRequestReceptionTime())))); + } + + // add `ResponseTransmissionTime` to the URL query string + if (getResponseTransmissionTime() != null) { + joiner.add(String.format("%sResponseTransmissionTime%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getResponseTransmissionTime())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private UtcTimeResponse instance; + + public Builder() { + this(new UtcTimeResponse()); + } + + protected Builder(UtcTimeResponse instance) { + this.instance = instance; + } + + public UtcTimeResponse.Builder requestReceptionTime(OffsetDateTime requestReceptionTime) { + this.instance.requestReceptionTime = requestReceptionTime; + return this; + } + + public UtcTimeResponse.Builder responseTransmissionTime(OffsetDateTime responseTransmissionTime) { + this.instance.responseTransmissionTime = responseTransmissionTime; + return this; + } + + /** + * returns a built UtcTimeResponse instance. + * + * The builder is not reusable. + */ + public UtcTimeResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UtcTimeResponse.Builder builder() { + return new UtcTimeResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UtcTimeResponse.Builder toBuilder() { + return new UtcTimeResponse.Builder().requestReceptionTime(getRequestReceptionTime()) + .responseTransmissionTime(getResponseTransmissionTime()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ValidatePathDto.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ValidatePathDto.java new file mode 100644 index 0000000000000..f97986760406b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/ValidatePathDto.java @@ -0,0 +1,274 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Validate path object. + */ +@JsonPropertyOrder({ ValidatePathDto.JSON_PROPERTY_VALIDATE_WRITABLE, ValidatePathDto.JSON_PROPERTY_PATH, + ValidatePathDto.JSON_PROPERTY_IS_FILE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class ValidatePathDto { + public static final String JSON_PROPERTY_VALIDATE_WRITABLE = "ValidateWritable"; + @org.eclipse.jdt.annotation.NonNull + private Boolean validateWritable; + + public static final String JSON_PROPERTY_PATH = "Path"; + @org.eclipse.jdt.annotation.NonNull + private String path; + + public static final String JSON_PROPERTY_IS_FILE = "IsFile"; + @org.eclipse.jdt.annotation.NonNull + private Boolean isFile; + + public ValidatePathDto() { + } + + public ValidatePathDto validateWritable(@org.eclipse.jdt.annotation.NonNull Boolean validateWritable) { + this.validateWritable = validateWritable; + return this; + } + + /** + * Gets or sets a value indicating whether validate if path is writable. + * + * @return validateWritable + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VALIDATE_WRITABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getValidateWritable() { + return validateWritable; + } + + @JsonProperty(JSON_PROPERTY_VALIDATE_WRITABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidateWritable(@org.eclipse.jdt.annotation.NonNull Boolean validateWritable) { + this.validateWritable = validateWritable; + } + + public ValidatePathDto path(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + return this; + } + + /** + * Gets or sets the path. + * + * @return path + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@org.eclipse.jdt.annotation.NonNull String path) { + this.path = path; + } + + public ValidatePathDto isFile(@org.eclipse.jdt.annotation.NonNull Boolean isFile) { + this.isFile = isFile; + return this; + } + + /** + * Gets or sets is path file. + * + * @return isFile + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_IS_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsFile() { + return isFile; + } + + @JsonProperty(JSON_PROPERTY_IS_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsFile(@org.eclipse.jdt.annotation.NonNull Boolean isFile) { + this.isFile = isFile; + } + + /** + * Return true if this ValidatePathDto object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidatePathDto validatePathDto = (ValidatePathDto) o; + return Objects.equals(this.validateWritable, validatePathDto.validateWritable) + && Objects.equals(this.path, validatePathDto.path) + && Objects.equals(this.isFile, validatePathDto.isFile); + } + + @Override + public int hashCode() { + return Objects.hash(validateWritable, path, isFile); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValidatePathDto {\n"); + sb.append(" validateWritable: ").append(toIndentedString(validateWritable)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" isFile: ").append(toIndentedString(isFile)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ValidateWritable` to the URL query string + if (getValidateWritable() != null) { + joiner.add(String.format("%sValidateWritable%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getValidateWritable())))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `IsFile` to the URL query string + if (getIsFile() != null) { + joiner.add(String.format("%sIsFile%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getIsFile())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ValidatePathDto instance; + + public Builder() { + this(new ValidatePathDto()); + } + + protected Builder(ValidatePathDto instance) { + this.instance = instance; + } + + public ValidatePathDto.Builder validateWritable(Boolean validateWritable) { + this.instance.validateWritable = validateWritable; + return this; + } + + public ValidatePathDto.Builder path(String path) { + this.instance.path = path; + return this; + } + + public ValidatePathDto.Builder isFile(Boolean isFile) { + this.instance.isFile = isFile; + return this; + } + + /** + * returns a built ValidatePathDto instance. + * + * The builder is not reusable. + */ + public ValidatePathDto build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ValidatePathDto.Builder builder() { + return new ValidatePathDto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ValidatePathDto.Builder toBuilder() { + return new ValidatePathDto.Builder().validateWritable(getValidateWritable()).path(getPath()) + .isFile(getIsFile()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/VersionInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/VersionInfo.java new file mode 100644 index 0000000000000..20333a076633c --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/VersionInfo.java @@ -0,0 +1,514 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines the MediaBrowser.Model.Updates.VersionInfo class. + */ +@JsonPropertyOrder({ VersionInfo.JSON_PROPERTY_VERSION, VersionInfo.JSON_PROPERTY_VERSION_NUMBER, + VersionInfo.JSON_PROPERTY_CHANGELOG, VersionInfo.JSON_PROPERTY_TARGET_ABI, VersionInfo.JSON_PROPERTY_SOURCE_URL, + VersionInfo.JSON_PROPERTY_CHECKSUM, VersionInfo.JSON_PROPERTY_TIMESTAMP, + VersionInfo.JSON_PROPERTY_REPOSITORY_NAME, VersionInfo.JSON_PROPERTY_REPOSITORY_URL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class VersionInfo { + public static final String JSON_PROPERTY_VERSION = "version"; + @org.eclipse.jdt.annotation.NonNull + private String version; + + public static final String JSON_PROPERTY_VERSION_NUMBER = "VersionNumber"; + @org.eclipse.jdt.annotation.NonNull + private String versionNumber; + + public static final String JSON_PROPERTY_CHANGELOG = "changelog"; + @org.eclipse.jdt.annotation.NonNull + private String changelog; + + public static final String JSON_PROPERTY_TARGET_ABI = "targetAbi"; + @org.eclipse.jdt.annotation.NonNull + private String targetAbi; + + public static final String JSON_PROPERTY_SOURCE_URL = "sourceUrl"; + @org.eclipse.jdt.annotation.NonNull + private String sourceUrl; + + public static final String JSON_PROPERTY_CHECKSUM = "checksum"; + @org.eclipse.jdt.annotation.NonNull + private String checksum; + + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; + @org.eclipse.jdt.annotation.NonNull + private String timestamp; + + public static final String JSON_PROPERTY_REPOSITORY_NAME = "repositoryName"; + @org.eclipse.jdt.annotation.NonNull + private String repositoryName; + + public static final String JSON_PROPERTY_REPOSITORY_URL = "repositoryUrl"; + @org.eclipse.jdt.annotation.NonNull + private String repositoryUrl; + + public VersionInfo() { + } + + @JsonCreator + public VersionInfo(@JsonProperty(JSON_PROPERTY_VERSION_NUMBER) String versionNumber) { + this(); + this.versionNumber = versionNumber; + } + + public VersionInfo version(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + return this; + } + + /** + * Gets or sets the version. + * + * @return version + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@org.eclipse.jdt.annotation.NonNull String version) { + this.version = version; + } + + /** + * Gets the version as a System.Version. + * + * @return versionNumber + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VERSION_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersionNumber() { + return versionNumber; + } + + public VersionInfo changelog(@org.eclipse.jdt.annotation.NonNull String changelog) { + this.changelog = changelog; + return this; + } + + /** + * Gets or sets the changelog for this version. + * + * @return changelog + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHANGELOG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChangelog() { + return changelog; + } + + @JsonProperty(JSON_PROPERTY_CHANGELOG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChangelog(@org.eclipse.jdt.annotation.NonNull String changelog) { + this.changelog = changelog; + } + + public VersionInfo targetAbi(@org.eclipse.jdt.annotation.NonNull String targetAbi) { + this.targetAbi = targetAbi; + return this; + } + + /** + * Gets or sets the ABI that this version was built against. + * + * @return targetAbi + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TARGET_ABI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTargetAbi() { + return targetAbi; + } + + @JsonProperty(JSON_PROPERTY_TARGET_ABI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTargetAbi(@org.eclipse.jdt.annotation.NonNull String targetAbi) { + this.targetAbi = targetAbi; + } + + public VersionInfo sourceUrl(@org.eclipse.jdt.annotation.NonNull String sourceUrl) { + this.sourceUrl = sourceUrl; + return this; + } + + /** + * Gets or sets the source URL. + * + * @return sourceUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SOURCE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceUrl() { + return sourceUrl; + } + + @JsonProperty(JSON_PROPERTY_SOURCE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceUrl(@org.eclipse.jdt.annotation.NonNull String sourceUrl) { + this.sourceUrl = sourceUrl; + } + + public VersionInfo checksum(@org.eclipse.jdt.annotation.NonNull String checksum) { + this.checksum = checksum; + return this; + } + + /** + * Gets or sets a checksum for the binary. + * + * @return checksum + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_CHECKSUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChecksum() { + return checksum; + } + + @JsonProperty(JSON_PROPERTY_CHECKSUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChecksum(@org.eclipse.jdt.annotation.NonNull String checksum) { + this.checksum = checksum; + } + + public VersionInfo timestamp(@org.eclipse.jdt.annotation.NonNull String timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Gets or sets a timestamp of when the binary was built. + * + * @return timestamp + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTimestamp() { + return timestamp; + } + + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimestamp(@org.eclipse.jdt.annotation.NonNull String timestamp) { + this.timestamp = timestamp; + } + + public VersionInfo repositoryName(@org.eclipse.jdt.annotation.NonNull String repositoryName) { + this.repositoryName = repositoryName; + return this; + } + + /** + * Gets or sets the repository name. + * + * @return repositoryName + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REPOSITORY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRepositoryName() { + return repositoryName; + } + + @JsonProperty(JSON_PROPERTY_REPOSITORY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepositoryName(@org.eclipse.jdt.annotation.NonNull String repositoryName) { + this.repositoryName = repositoryName; + } + + public VersionInfo repositoryUrl(@org.eclipse.jdt.annotation.NonNull String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Gets or sets the repository url. + * + * @return repositoryUrl + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REPOSITORY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRepositoryUrl() { + return repositoryUrl; + } + + @JsonProperty(JSON_PROPERTY_REPOSITORY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepositoryUrl(@org.eclipse.jdt.annotation.NonNull String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + } + + /** + * Return true if this VersionInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VersionInfo versionInfo = (VersionInfo) o; + return Objects.equals(this.version, versionInfo.version) + && Objects.equals(this.versionNumber, versionInfo.versionNumber) + && Objects.equals(this.changelog, versionInfo.changelog) + && Objects.equals(this.targetAbi, versionInfo.targetAbi) + && Objects.equals(this.sourceUrl, versionInfo.sourceUrl) + && Objects.equals(this.checksum, versionInfo.checksum) + && Objects.equals(this.timestamp, versionInfo.timestamp) + && Objects.equals(this.repositoryName, versionInfo.repositoryName) + && Objects.equals(this.repositoryUrl, versionInfo.repositoryUrl); + } + + @Override + public int hashCode() { + return Objects.hash(version, versionNumber, changelog, targetAbi, sourceUrl, checksum, timestamp, + repositoryName, repositoryUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VersionInfo {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" versionNumber: ").append(toIndentedString(versionNumber)).append("\n"); + sb.append(" changelog: ").append(toIndentedString(changelog)).append("\n"); + sb.append(" targetAbi: ").append(toIndentedString(targetAbi)).append("\n"); + sb.append(" sourceUrl: ").append(toIndentedString(sourceUrl)).append("\n"); + sb.append(" checksum: ").append(toIndentedString(checksum)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" repositoryName: ").append(toIndentedString(repositoryName)).append("\n"); + sb.append(" repositoryUrl: ").append(toIndentedString(repositoryUrl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format("%sversion%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `VersionNumber` to the URL query string + if (getVersionNumber() != null) { + joiner.add(String.format("%sVersionNumber%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getVersionNumber())))); + } + + // add `changelog` to the URL query string + if (getChangelog() != null) { + joiner.add(String.format("%schangelog%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChangelog())))); + } + + // add `targetAbi` to the URL query string + if (getTargetAbi() != null) { + joiner.add(String.format("%stargetAbi%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTargetAbi())))); + } + + // add `sourceUrl` to the URL query string + if (getSourceUrl() != null) { + joiner.add(String.format("%ssourceUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSourceUrl())))); + } + + // add `checksum` to the URL query string + if (getChecksum() != null) { + joiner.add(String.format("%schecksum%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getChecksum())))); + } + + // add `timestamp` to the URL query string + if (getTimestamp() != null) { + joiner.add(String.format("%stimestamp%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getTimestamp())))); + } + + // add `repositoryName` to the URL query string + if (getRepositoryName() != null) { + joiner.add(String.format("%srepositoryName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRepositoryName())))); + } + + // add `repositoryUrl` to the URL query string + if (getRepositoryUrl() != null) { + joiner.add(String.format("%srepositoryUrl%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRepositoryUrl())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private VersionInfo instance; + + public Builder() { + this(new VersionInfo()); + } + + protected Builder(VersionInfo instance) { + this.instance = instance; + } + + public VersionInfo.Builder version(String version) { + this.instance.version = version; + return this; + } + + public VersionInfo.Builder versionNumber(String versionNumber) { + this.instance.versionNumber = versionNumber; + return this; + } + + public VersionInfo.Builder changelog(String changelog) { + this.instance.changelog = changelog; + return this; + } + + public VersionInfo.Builder targetAbi(String targetAbi) { + this.instance.targetAbi = targetAbi; + return this; + } + + public VersionInfo.Builder sourceUrl(String sourceUrl) { + this.instance.sourceUrl = sourceUrl; + return this; + } + + public VersionInfo.Builder checksum(String checksum) { + this.instance.checksum = checksum; + return this; + } + + public VersionInfo.Builder timestamp(String timestamp) { + this.instance.timestamp = timestamp; + return this; + } + + public VersionInfo.Builder repositoryName(String repositoryName) { + this.instance.repositoryName = repositoryName; + return this; + } + + public VersionInfo.Builder repositoryUrl(String repositoryUrl) { + this.instance.repositoryUrl = repositoryUrl; + return this; + } + + /** + * returns a built VersionInfo instance. + * + * The builder is not reusable. + */ + public VersionInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static VersionInfo.Builder builder() { + return new VersionInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public VersionInfo.Builder toBuilder() { + return new VersionInfo.Builder().version(getVersion()).versionNumber(getVersionNumber()) + .changelog(getChangelog()).targetAbi(getTargetAbi()).sourceUrl(getSourceUrl()).checksum(getChecksum()) + .timestamp(getTimestamp()).repositoryName(getRepositoryName()).repositoryUrl(getRepositoryUrl()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/Video3DFormat.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/Video3DFormat.java new file mode 100644 index 0000000000000..08d9741283af8 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/Video3DFormat.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets Video3DFormat + */ +public enum Video3DFormat { + + HALF_SIDE_BY_SIDE("HalfSideBySide"), + + FULL_SIDE_BY_SIDE("FullSideBySide"), + + FULL_TOP_AND_BOTTOM("FullTopAndBottom"), + + HALF_TOP_AND_BOTTOM("HalfTopAndBottom"), + + MVC("MVC"); + + private String value; + + Video3DFormat(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Video3DFormat fromValue(String value) { + for (Video3DFormat b : Video3DFormat.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/VideoType.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/VideoType.java new file mode 100644 index 0000000000000..d7022cf1cc7fc --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/VideoType.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Enum VideoType. + */ +public enum VideoType { + + VIDEO_FILE("VideoFile"), + + ISO("Iso"), + + DVD("Dvd"), + + BLU_RAY("BluRay"); + + private String value; + + VideoType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static VideoType fromValue(String value) { + for (VideoType b : VideoType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/VirtualFolderInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/VirtualFolderInfo.java new file mode 100644 index 0000000000000..21ad95975ab4f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/VirtualFolderInfo.java @@ -0,0 +1,491 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Used to hold information about a user's list of configured virtual folders. + */ +@JsonPropertyOrder({ VirtualFolderInfo.JSON_PROPERTY_NAME, VirtualFolderInfo.JSON_PROPERTY_LOCATIONS, + VirtualFolderInfo.JSON_PROPERTY_COLLECTION_TYPE, VirtualFolderInfo.JSON_PROPERTY_LIBRARY_OPTIONS, + VirtualFolderInfo.JSON_PROPERTY_ITEM_ID, VirtualFolderInfo.JSON_PROPERTY_PRIMARY_IMAGE_ITEM_ID, + VirtualFolderInfo.JSON_PROPERTY_REFRESH_PROGRESS, VirtualFolderInfo.JSON_PROPERTY_REFRESH_STATUS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class VirtualFolderInfo { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_LOCATIONS = "Locations"; + @org.eclipse.jdt.annotation.NonNull + private List locations; + + public static final String JSON_PROPERTY_COLLECTION_TYPE = "CollectionType"; + @org.eclipse.jdt.annotation.NonNull + private CollectionTypeOptions collectionType; + + public static final String JSON_PROPERTY_LIBRARY_OPTIONS = "LibraryOptions"; + @org.eclipse.jdt.annotation.NonNull + private LibraryOptions libraryOptions; + + public static final String JSON_PROPERTY_ITEM_ID = "ItemId"; + @org.eclipse.jdt.annotation.NonNull + private String itemId; + + public static final String JSON_PROPERTY_PRIMARY_IMAGE_ITEM_ID = "PrimaryImageItemId"; + @org.eclipse.jdt.annotation.NonNull + private String primaryImageItemId; + + public static final String JSON_PROPERTY_REFRESH_PROGRESS = "RefreshProgress"; + @org.eclipse.jdt.annotation.NonNull + private Double refreshProgress; + + public static final String JSON_PROPERTY_REFRESH_STATUS = "RefreshStatus"; + @org.eclipse.jdt.annotation.NonNull + private String refreshStatus; + + public VirtualFolderInfo() { + } + + public VirtualFolderInfo name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public VirtualFolderInfo locations(@org.eclipse.jdt.annotation.NonNull List locations) { + this.locations = locations; + return this; + } + + public VirtualFolderInfo addLocationsItem(String locationsItem) { + if (this.locations == null) { + this.locations = new ArrayList<>(); + } + this.locations.add(locationsItem); + return this; + } + + /** + * Gets or sets the locations. + * + * @return locations + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LOCATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLocations() { + return locations; + } + + @JsonProperty(JSON_PROPERTY_LOCATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocations(@org.eclipse.jdt.annotation.NonNull List locations) { + this.locations = locations; + } + + public VirtualFolderInfo collectionType(@org.eclipse.jdt.annotation.NonNull CollectionTypeOptions collectionType) { + this.collectionType = collectionType; + return this; + } + + /** + * Gets or sets the type of the collection. + * + * @return collectionType + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_COLLECTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CollectionTypeOptions getCollectionType() { + return collectionType; + } + + @JsonProperty(JSON_PROPERTY_COLLECTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCollectionType(@org.eclipse.jdt.annotation.NonNull CollectionTypeOptions collectionType) { + this.collectionType = collectionType; + } + + public VirtualFolderInfo libraryOptions(@org.eclipse.jdt.annotation.NonNull LibraryOptions libraryOptions) { + this.libraryOptions = libraryOptions; + return this; + } + + /** + * Get libraryOptions + * + * @return libraryOptions + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_LIBRARY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LibraryOptions getLibraryOptions() { + return libraryOptions; + } + + @JsonProperty(JSON_PROPERTY_LIBRARY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLibraryOptions(@org.eclipse.jdt.annotation.NonNull LibraryOptions libraryOptions) { + this.libraryOptions = libraryOptions; + } + + public VirtualFolderInfo itemId(@org.eclipse.jdt.annotation.NonNull String itemId) { + this.itemId = itemId; + return this; + } + + /** + * Gets or sets the item identifier. + * + * @return itemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getItemId() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemId(@org.eclipse.jdt.annotation.NonNull String itemId) { + this.itemId = itemId; + } + + public VirtualFolderInfo primaryImageItemId(@org.eclipse.jdt.annotation.NonNull String primaryImageItemId) { + this.primaryImageItemId = primaryImageItemId; + return this; + } + + /** + * Gets or sets the primary image item identifier. + * + * @return primaryImageItemId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryImageItemId() { + return primaryImageItemId; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_IMAGE_ITEM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryImageItemId(@org.eclipse.jdt.annotation.NonNull String primaryImageItemId) { + this.primaryImageItemId = primaryImageItemId; + } + + public VirtualFolderInfo refreshProgress(@org.eclipse.jdt.annotation.NonNull Double refreshProgress) { + this.refreshProgress = refreshProgress; + return this; + } + + /** + * Get refreshProgress + * + * @return refreshProgress + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REFRESH_PROGRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getRefreshProgress() { + return refreshProgress; + } + + @JsonProperty(JSON_PROPERTY_REFRESH_PROGRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRefreshProgress(@org.eclipse.jdt.annotation.NonNull Double refreshProgress) { + this.refreshProgress = refreshProgress; + } + + public VirtualFolderInfo refreshStatus(@org.eclipse.jdt.annotation.NonNull String refreshStatus) { + this.refreshStatus = refreshStatus; + return this; + } + + /** + * Get refreshStatus + * + * @return refreshStatus + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_REFRESH_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRefreshStatus() { + return refreshStatus; + } + + @JsonProperty(JSON_PROPERTY_REFRESH_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRefreshStatus(@org.eclipse.jdt.annotation.NonNull String refreshStatus) { + this.refreshStatus = refreshStatus; + } + + /** + * Return true if this VirtualFolderInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VirtualFolderInfo virtualFolderInfo = (VirtualFolderInfo) o; + return Objects.equals(this.name, virtualFolderInfo.name) + && Objects.equals(this.locations, virtualFolderInfo.locations) + && Objects.equals(this.collectionType, virtualFolderInfo.collectionType) + && Objects.equals(this.libraryOptions, virtualFolderInfo.libraryOptions) + && Objects.equals(this.itemId, virtualFolderInfo.itemId) + && Objects.equals(this.primaryImageItemId, virtualFolderInfo.primaryImageItemId) + && Objects.equals(this.refreshProgress, virtualFolderInfo.refreshProgress) + && Objects.equals(this.refreshStatus, virtualFolderInfo.refreshStatus); + } + + @Override + public int hashCode() { + return Objects.hash(name, locations, collectionType, libraryOptions, itemId, primaryImageItemId, + refreshProgress, refreshStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VirtualFolderInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" locations: ").append(toIndentedString(locations)).append("\n"); + sb.append(" collectionType: ").append(toIndentedString(collectionType)).append("\n"); + sb.append(" libraryOptions: ").append(toIndentedString(libraryOptions)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" primaryImageItemId: ").append(toIndentedString(primaryImageItemId)).append("\n"); + sb.append(" refreshProgress: ").append(toIndentedString(refreshProgress)).append("\n"); + sb.append(" refreshStatus: ").append(toIndentedString(refreshStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Locations` to the URL query string + if (getLocations() != null) { + for (int i = 0; i < getLocations().size(); i++) { + joiner.add(String.format("%sLocations%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getLocations().get(i))))); + } + } + + // add `CollectionType` to the URL query string + if (getCollectionType() != null) { + joiner.add(String.format("%sCollectionType%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getCollectionType())))); + } + + // add `LibraryOptions` to the URL query string + if (getLibraryOptions() != null) { + joiner.add(getLibraryOptions().toUrlQueryString(prefix + "LibraryOptions" + suffix)); + } + + // add `ItemId` to the URL query string + if (getItemId() != null) { + joiner.add(String.format("%sItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getItemId())))); + } + + // add `PrimaryImageItemId` to the URL query string + if (getPrimaryImageItemId() != null) { + joiner.add(String.format("%sPrimaryImageItemId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPrimaryImageItemId())))); + } + + // add `RefreshProgress` to the URL query string + if (getRefreshProgress() != null) { + joiner.add(String.format("%sRefreshProgress%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRefreshProgress())))); + } + + // add `RefreshStatus` to the URL query string + if (getRefreshStatus() != null) { + joiner.add(String.format("%sRefreshStatus%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getRefreshStatus())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private VirtualFolderInfo instance; + + public Builder() { + this(new VirtualFolderInfo()); + } + + protected Builder(VirtualFolderInfo instance) { + this.instance = instance; + } + + public VirtualFolderInfo.Builder name(String name) { + this.instance.name = name; + return this; + } + + public VirtualFolderInfo.Builder locations(List locations) { + this.instance.locations = locations; + return this; + } + + public VirtualFolderInfo.Builder collectionType(CollectionTypeOptions collectionType) { + this.instance.collectionType = collectionType; + return this; + } + + public VirtualFolderInfo.Builder libraryOptions(LibraryOptions libraryOptions) { + this.instance.libraryOptions = libraryOptions; + return this; + } + + public VirtualFolderInfo.Builder itemId(String itemId) { + this.instance.itemId = itemId; + return this; + } + + public VirtualFolderInfo.Builder primaryImageItemId(String primaryImageItemId) { + this.instance.primaryImageItemId = primaryImageItemId; + return this; + } + + public VirtualFolderInfo.Builder refreshProgress(Double refreshProgress) { + this.instance.refreshProgress = refreshProgress; + return this; + } + + public VirtualFolderInfo.Builder refreshStatus(String refreshStatus) { + this.instance.refreshStatus = refreshStatus; + return this; + } + + /** + * returns a built VirtualFolderInfo instance. + * + * The builder is not reusable. + */ + public VirtualFolderInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static VirtualFolderInfo.Builder builder() { + return new VirtualFolderInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public VirtualFolderInfo.Builder toBuilder() { + return new VirtualFolderInfo.Builder().name(getName()).locations(getLocations()) + .collectionType(getCollectionType()).libraryOptions(getLibraryOptions()).itemId(getItemId()) + .primaryImageItemId(getPrimaryImageItemId()).refreshProgress(getRefreshProgress()) + .refreshStatus(getRefreshStatus()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/WakeOnLanInfo.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/WakeOnLanInfo.java new file mode 100644 index 0000000000000..9b8cd4bf12e62 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/WakeOnLanInfo.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Provides the MAC address and port for wake-on-LAN functionality. + */ +@JsonPropertyOrder({ WakeOnLanInfo.JSON_PROPERTY_MAC_ADDRESS, WakeOnLanInfo.JSON_PROPERTY_PORT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class WakeOnLanInfo { + public static final String JSON_PROPERTY_MAC_ADDRESS = "MacAddress"; + @org.eclipse.jdt.annotation.NonNull + private String macAddress; + + public static final String JSON_PROPERTY_PORT = "Port"; + @org.eclipse.jdt.annotation.NonNull + private Integer port; + + public WakeOnLanInfo() { + } + + public WakeOnLanInfo macAddress(@org.eclipse.jdt.annotation.NonNull String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * Gets the MAC address of the device. + * + * @return macAddress + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_MAC_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMacAddress() { + return macAddress; + } + + @JsonProperty(JSON_PROPERTY_MAC_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMacAddress(@org.eclipse.jdt.annotation.NonNull String macAddress) { + this.macAddress = macAddress; + } + + public WakeOnLanInfo port(@org.eclipse.jdt.annotation.NonNull Integer port) { + this.port = port; + return this; + } + + /** + * Gets or sets the wake-on-LAN port. + * + * @return port + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPort() { + return port; + } + + @JsonProperty(JSON_PROPERTY_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPort(@org.eclipse.jdt.annotation.NonNull Integer port) { + this.port = port; + } + + /** + * Return true if this WakeOnLanInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WakeOnLanInfo wakeOnLanInfo = (WakeOnLanInfo) o; + return Objects.equals(this.macAddress, wakeOnLanInfo.macAddress) + && Objects.equals(this.port, wakeOnLanInfo.port); + } + + @Override + public int hashCode() { + return Objects.hash(macAddress, port); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WakeOnLanInfo {\n"); + sb.append(" macAddress: ").append(toIndentedString(macAddress)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MacAddress` to the URL query string + if (getMacAddress() != null) { + joiner.add(String.format("%sMacAddress%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getMacAddress())))); + } + + // add `Port` to the URL query string + if (getPort() != null) { + joiner.add(String.format("%sPort%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPort())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private WakeOnLanInfo instance; + + public Builder() { + this(new WakeOnLanInfo()); + } + + protected Builder(WakeOnLanInfo instance) { + this.instance = instance; + } + + public WakeOnLanInfo.Builder macAddress(String macAddress) { + this.instance.macAddress = macAddress; + return this; + } + + public WakeOnLanInfo.Builder port(Integer port) { + this.instance.port = port; + return this; + } + + /** + * returns a built WakeOnLanInfo instance. + * + * The builder is not reusable. + */ + public WakeOnLanInfo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static WakeOnLanInfo.Builder builder() { + return new WakeOnLanInfo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public WakeOnLanInfo.Builder toBuilder() { + return new WakeOnLanInfo.Builder().macAddress(getMacAddress()).port(getPort()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/XbmcMetadataOptions.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/XbmcMetadataOptions.java new file mode 100644 index 0000000000000..3574d294c4f80 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/XbmcMetadataOptions.java @@ -0,0 +1,362 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * XbmcMetadataOptions + */ +@JsonPropertyOrder({ XbmcMetadataOptions.JSON_PROPERTY_USER_ID, XbmcMetadataOptions.JSON_PROPERTY_RELEASE_DATE_FORMAT, + XbmcMetadataOptions.JSON_PROPERTY_SAVE_IMAGE_PATHS_IN_NFO, + XbmcMetadataOptions.JSON_PROPERTY_ENABLE_PATH_SUBSTITUTION, + XbmcMetadataOptions.JSON_PROPERTY_ENABLE_EXTRA_THUMBS_DUPLICATION }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class XbmcMetadataOptions { + public static final String JSON_PROPERTY_USER_ID = "UserId"; + @org.eclipse.jdt.annotation.NonNull + private String userId; + + public static final String JSON_PROPERTY_RELEASE_DATE_FORMAT = "ReleaseDateFormat"; + @org.eclipse.jdt.annotation.NonNull + private String releaseDateFormat; + + public static final String JSON_PROPERTY_SAVE_IMAGE_PATHS_IN_NFO = "SaveImagePathsInNfo"; + @org.eclipse.jdt.annotation.NonNull + private Boolean saveImagePathsInNfo; + + public static final String JSON_PROPERTY_ENABLE_PATH_SUBSTITUTION = "EnablePathSubstitution"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enablePathSubstitution; + + public static final String JSON_PROPERTY_ENABLE_EXTRA_THUMBS_DUPLICATION = "EnableExtraThumbsDuplication"; + @org.eclipse.jdt.annotation.NonNull + private Boolean enableExtraThumbsDuplication; + + public XbmcMetadataOptions() { + } + + public XbmcMetadataOptions userId(@org.eclipse.jdt.annotation.NonNull String userId) { + this.userId = userId; + return this; + } + + /** + * Get userId + * + * @return userId + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserId() { + return userId; + } + + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@org.eclipse.jdt.annotation.NonNull String userId) { + this.userId = userId; + } + + public XbmcMetadataOptions releaseDateFormat(@org.eclipse.jdt.annotation.NonNull String releaseDateFormat) { + this.releaseDateFormat = releaseDateFormat; + return this; + } + + /** + * Get releaseDateFormat + * + * @return releaseDateFormat + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_RELEASE_DATE_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReleaseDateFormat() { + return releaseDateFormat; + } + + @JsonProperty(JSON_PROPERTY_RELEASE_DATE_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReleaseDateFormat(@org.eclipse.jdt.annotation.NonNull String releaseDateFormat) { + this.releaseDateFormat = releaseDateFormat; + } + + public XbmcMetadataOptions saveImagePathsInNfo(@org.eclipse.jdt.annotation.NonNull Boolean saveImagePathsInNfo) { + this.saveImagePathsInNfo = saveImagePathsInNfo; + return this; + } + + /** + * Get saveImagePathsInNfo + * + * @return saveImagePathsInNfo + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_SAVE_IMAGE_PATHS_IN_NFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSaveImagePathsInNfo() { + return saveImagePathsInNfo; + } + + @JsonProperty(JSON_PROPERTY_SAVE_IMAGE_PATHS_IN_NFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaveImagePathsInNfo(@org.eclipse.jdt.annotation.NonNull Boolean saveImagePathsInNfo) { + this.saveImagePathsInNfo = saveImagePathsInNfo; + } + + public XbmcMetadataOptions enablePathSubstitution( + @org.eclipse.jdt.annotation.NonNull Boolean enablePathSubstitution) { + this.enablePathSubstitution = enablePathSubstitution; + return this; + } + + /** + * Get enablePathSubstitution + * + * @return enablePathSubstitution + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_PATH_SUBSTITUTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnablePathSubstitution() { + return enablePathSubstitution; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_PATH_SUBSTITUTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnablePathSubstitution(@org.eclipse.jdt.annotation.NonNull Boolean enablePathSubstitution) { + this.enablePathSubstitution = enablePathSubstitution; + } + + public XbmcMetadataOptions enableExtraThumbsDuplication( + @org.eclipse.jdt.annotation.NonNull Boolean enableExtraThumbsDuplication) { + this.enableExtraThumbsDuplication = enableExtraThumbsDuplication; + return this; + } + + /** + * Get enableExtraThumbsDuplication + * + * @return enableExtraThumbsDuplication + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_ENABLE_EXTRA_THUMBS_DUPLICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableExtraThumbsDuplication() { + return enableExtraThumbsDuplication; + } + + @JsonProperty(JSON_PROPERTY_ENABLE_EXTRA_THUMBS_DUPLICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableExtraThumbsDuplication( + @org.eclipse.jdt.annotation.NonNull Boolean enableExtraThumbsDuplication) { + this.enableExtraThumbsDuplication = enableExtraThumbsDuplication; + } + + /** + * Return true if this XbmcMetadataOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XbmcMetadataOptions xbmcMetadataOptions = (XbmcMetadataOptions) o; + return Objects.equals(this.userId, xbmcMetadataOptions.userId) + && Objects.equals(this.releaseDateFormat, xbmcMetadataOptions.releaseDateFormat) + && Objects.equals(this.saveImagePathsInNfo, xbmcMetadataOptions.saveImagePathsInNfo) + && Objects.equals(this.enablePathSubstitution, xbmcMetadataOptions.enablePathSubstitution) + && Objects.equals(this.enableExtraThumbsDuplication, xbmcMetadataOptions.enableExtraThumbsDuplication); + } + + @Override + public int hashCode() { + return Objects.hash(userId, releaseDateFormat, saveImagePathsInNfo, enablePathSubstitution, + enableExtraThumbsDuplication); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XbmcMetadataOptions {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" releaseDateFormat: ").append(toIndentedString(releaseDateFormat)).append("\n"); + sb.append(" saveImagePathsInNfo: ").append(toIndentedString(saveImagePathsInNfo)).append("\n"); + sb.append(" enablePathSubstitution: ").append(toIndentedString(enablePathSubstitution)).append("\n"); + sb.append(" enableExtraThumbsDuplication: ").append(toIndentedString(enableExtraThumbsDuplication)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `UserId` to the URL query string + if (getUserId() != null) { + joiner.add(String.format("%sUserId%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getUserId())))); + } + + // add `ReleaseDateFormat` to the URL query string + if (getReleaseDateFormat() != null) { + joiner.add(String.format("%sReleaseDateFormat%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getReleaseDateFormat())))); + } + + // add `SaveImagePathsInNfo` to the URL query string + if (getSaveImagePathsInNfo() != null) { + joiner.add(String.format("%sSaveImagePathsInNfo%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getSaveImagePathsInNfo())))); + } + + // add `EnablePathSubstitution` to the URL query string + if (getEnablePathSubstitution() != null) { + joiner.add(String.format("%sEnablePathSubstitution%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnablePathSubstitution())))); + } + + // add `EnableExtraThumbsDuplication` to the URL query string + if (getEnableExtraThumbsDuplication() != null) { + joiner.add(String.format("%sEnableExtraThumbsDuplication%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getEnableExtraThumbsDuplication())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private XbmcMetadataOptions instance; + + public Builder() { + this(new XbmcMetadataOptions()); + } + + protected Builder(XbmcMetadataOptions instance) { + this.instance = instance; + } + + public XbmcMetadataOptions.Builder userId(String userId) { + this.instance.userId = userId; + return this; + } + + public XbmcMetadataOptions.Builder releaseDateFormat(String releaseDateFormat) { + this.instance.releaseDateFormat = releaseDateFormat; + return this; + } + + public XbmcMetadataOptions.Builder saveImagePathsInNfo(Boolean saveImagePathsInNfo) { + this.instance.saveImagePathsInNfo = saveImagePathsInNfo; + return this; + } + + public XbmcMetadataOptions.Builder enablePathSubstitution(Boolean enablePathSubstitution) { + this.instance.enablePathSubstitution = enablePathSubstitution; + return this; + } + + public XbmcMetadataOptions.Builder enableExtraThumbsDuplication(Boolean enableExtraThumbsDuplication) { + this.instance.enableExtraThumbsDuplication = enableExtraThumbsDuplication; + return this; + } + + /** + * returns a built XbmcMetadataOptions instance. + * + * The builder is not reusable. + */ + public XbmcMetadataOptions build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static XbmcMetadataOptions.Builder builder() { + return new XbmcMetadataOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public XbmcMetadataOptions.Builder toBuilder() { + return new XbmcMetadataOptions.Builder().userId(getUserId()).releaseDateFormat(getReleaseDateFormat()) + .saveImagePathsInNfo(getSaveImagePathsInNfo()).enablePathSubstitution(getEnablePathSubstitution()) + .enableExtraThumbsDuplication(getEnableExtraThumbsDuplication()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/XmlAttribute.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/XmlAttribute.java new file mode 100644 index 0000000000000..23e8dc70d3504 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/generated/legacy/model/XmlAttribute.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.openhab.binding.jellyfin.internal.api.generated.legacy.model; + +import java.util.Objects; +import java.util.StringJoiner; + +import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines the MediaBrowser.Model.Dlna.XmlAttribute. + */ +@JsonPropertyOrder({ XmlAttribute.JSON_PROPERTY_NAME, XmlAttribute.JSON_PROPERTY_VALUE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "OpenAPI Generator") +public class XmlAttribute { + public static final String JSON_PROPERTY_NAME = "Name"; + @org.eclipse.jdt.annotation.NonNull + private String name; + + public static final String JSON_PROPERTY_VALUE = "Value"; + @org.eclipse.jdt.annotation.NonNull + private String value; + + public XmlAttribute() { + } + + public XmlAttribute name(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + return this; + } + + /** + * Gets or sets the name of the attribute. + * + * @return name + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@org.eclipse.jdt.annotation.NonNull String name) { + this.name = name; + } + + public XmlAttribute value(@org.eclipse.jdt.annotation.NonNull String value) { + this.value = value; + return this; + } + + /** + * Gets or sets the value of the attribute. + * + * @return value + */ + @org.eclipse.jdt.annotation.NonNull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@org.eclipse.jdt.annotation.NonNull String value) { + this.value = value; + } + + /** + * Return true if this XmlAttribute object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XmlAttribute xmlAttribute = (XmlAttribute) o; + return Objects.equals(this.name, xmlAttribute.name) && Objects.equals(this.value, xmlAttribute.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XmlAttribute {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sName%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `Value` to the URL query string + if (getValue() != null) { + joiner.add(String.format("%sValue%s=%s", prefix, suffix, + ApiClient.urlEncode(ApiClient.valueToString(getValue())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private XmlAttribute instance; + + public Builder() { + this(new XmlAttribute()); + } + + protected Builder(XmlAttribute instance) { + this.instance = instance; + } + + public XmlAttribute.Builder name(String name) { + this.instance.name = name; + return this; + } + + public XmlAttribute.Builder value(String value) { + this.instance.value = value; + return this; + } + + /** + * returns a built XmlAttribute instance. + * + * The builder is not reusable. + */ + public XmlAttribute build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static XmlAttribute.Builder builder() { + return new XmlAttribute.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public XmlAttribute.Builder toBuilder() { + return new XmlAttribute.Builder().name(getName()).value(getValue()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/generate.sh b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/generate.sh index f353e9d431404..63bd0e45f8d68 100755 --- a/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/generate.sh +++ b/bundles/org.openhab.binding.jellyfin/tools/generate-sources/scripts/generate.sh @@ -53,12 +53,10 @@ fi LATEST=$(curl -sL https://repo.jellyfin.org/releases/openapi/jellyfin-openapi-stable.json | jq -r .info.version) echo -e "ℹ️ - Latest stable Jellyfin API - Version: \033[1m${LATEST}\033[0m" - - -# VERSIONS=("10.8.13" "10.10.7") -# VERSION_ALIAS=("legacy" "current") -VERSIONS=("10.10.7") -VERSION_ALIAS=("current") +VERSIONS=("10.8.13" "10.10.7") +VERSION_ALIAS=("legacy" "current") +# VERSIONS=("10.10.7") +# VERSION_ALIAS=("current") DOCKER_VOLUME_WORK="/work" @@ -81,7 +79,8 @@ for i in "${VERSIONS[@]}"; do FILENAME_YAML=${ROOT}/${OPENAPI_SPECIFICATION_DIR}/yaml/jellyfin-openapi-${i}.yaml mkdir -p logs/endpoints - jq ".paths | to_entries[] | {path: .key, methods: (.value | keys)}" ${FILENAME_JSON} | grep \"path\" >logs/endpoints/${i}-jersey.txt + mkdir -p ${ROOT}/${OPENAPI_SPECIFICATION_DIR}/json/ + mkdir -p ${ROOT}/${OPENAPI_SPECIFICATION_DIR}/yaml/ if [ ! -e "${FILENAME_JSON}" ]; then echo " ⏬ - Downloading OPENAPI definition for Version ${i}" @@ -92,12 +91,14 @@ for i in "${VERSIONS[@]}"; do --no-verbose \ --output-document=${FILENAME_JSON} \ ${URL} || { - rm ${FILENAME_JSON} echo " ❌ Error: Failed to download API definition from ${URL}" + rm ${FILENAME_JSON} exit 1 } fi + jq ".paths | to_entries[] | {path: .key, methods: (.value | keys)}" ${FILENAME_JSON} | grep \"path\" >logs/endpoints/${i}-jersey.txt + if [ ! -e "${FILENAME_YAML}" ]; then echo "⚙️: json ➡️ yaml" From e753f95837c45e003e815bd293b41ad8129dd9f7 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sat, 27 Sep 2025 17:47:19 +0200 Subject: [PATCH 09/38] =?UTF-8?q?=E2=9C=A8=20feat(jellyfin):=20enhance=20s?= =?UTF-8?q?erver=20discovery=20service=20and=20add=20contribution=20guide?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrik Gfeller --- .../org.openhab.binding.jellyfin/.gitignore | 1 + .../CONTRIBUTION.md | 90 +++++++++++++++++++ .../discovery/ServerDiscoveryService.java | 60 ++++++++----- 3 files changed, 128 insertions(+), 23 deletions(-) create mode 100644 bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md diff --git a/bundles/org.openhab.binding.jellyfin/.gitignore b/bundles/org.openhab.binding.jellyfin/.gitignore index b4e6dd92a5fbd..c1704747f336d 100644 --- a/bundles/org.openhab.binding.jellyfin/.gitignore +++ b/bundles/org.openhab.binding.jellyfin/.gitignore @@ -6,3 +6,4 @@ logs /.apt_generated_tests/ # Temporary (wip) .vscode +.direcory \ No newline at end of file diff --git a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md new file mode 100644 index 0000000000000..a3abf0e4132dc --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md @@ -0,0 +1,90 @@ +# Jellyfin Binding Contribution Guide + +This document provides information for developers who want to contribute to the Jellyfin binding for openHAB. + +## Class Diagram + +The following diagram shows the main classes and their relationships within the Jellyfin binding: + +```mermaid +classDiagram + HandlerFactory <|-- BaseThingHandlerFactory + ServerHandler <|-- BaseBridgeHandler + ServerDiscoveryService <|-- AbstractDiscoveryService + ExceptionHandler ..|> ExceptionHandlerType + + HandlerFactory --> ApiClientFactory : uses + ServerHandler --> ApiClient : uses + ServerHandler --> ExceptionHandler : uses + ServerHandler --> Configuration : uses + ServerDiscoveryService --> ServerDiscovery : uses + ServerDiscovery ..> ServerDiscoveryResult : creates + ApiClientFactory ..> ApiClient : creates + HandlerFactory ..> ServerHandler : creates + + class HandlerFactory { + -ApiClientFactory apiClientFactory + +supportsThingType(ThingTypeUID) boolean + +createHandler(Thing) ThingHandler + } + + class ServerHandler { + -Logger logger + -ExceptionHandler exceptionHandler + -ApiClient apiClient + -Configuration configuration + +initialize() + +handleCommand() + +dispose() + } + + class ApiClientFactory { + +createApiClient() ApiClient + } + + class ApiClient { + +authenticateWithToken(String) + } + + class ServerDiscoveryService { + -Logger logger + +startScan() + } + + class ServerDiscovery { + +discoverServers() List + } + + class ExceptionHandlerType { + <> + +handle(Exception) + } + + class ExceptionHandler { + +handle(Exception) + } + + class Configuration { + +String hostname + +int port + +boolean ssl + } +``` + +## Key Components + +1. **HandlerFactory**: Creates thing handlers for the binding. +2. **ServerHandler**: Main bridge handler for Jellyfin servers. +3. **ApiClientFactory**: Creates API client instances. +4. **ApiClient**: Handles communication with the Jellyfin server. +5. **ServerDiscoveryService**: Discovers Jellyfin servers on the network. +6. **ExceptionHandler**: Handles exceptions that occur during binding operation. + +## Development Workflow + +When contributing to this binding, please follow these guidelines: + +1. Make sure your code follows the openHAB code style and conventions. +2. Write unit tests for your changes. +3. Update documentation as needed. +4. Submit a pull request with a clear description of your changes. diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java index a0de9045225c0..157d3744820b2 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java @@ -45,13 +45,17 @@ @NonNullByDefault @Component(service = DiscoveryService.class, immediate = true, configurationPid = "discovery.jellyfin") public class ServerDiscoveryService extends AbstractDiscoveryService { + private static final int DEFAULT_SCAN_TIMEOUT_SECONDS = 60; // Timeout for discovery scan in seconds + private static final boolean DEFAULT_BACKGROUND_SCAN = false; // Disable background scan + private final Logger logger = LoggerFactory.getLogger(ServerDiscoveryService.class); private final ConfigurationAdmin configurationService; @Activate public ServerDiscoveryService(final @Reference ConfigurationAdmin configurationService) throws IllegalArgumentException { - super(Set.of(Constants.THING_TYPE_SERVER), 60, false); + // Use named constants for scan timeout and background scan + super(Set.of(Constants.THING_TYPE_SERVER), DEFAULT_SCAN_TIMEOUT_SECONDS, DEFAULT_BACKGROUND_SCAN); this.configurationService = configurationService; } @@ -63,41 +67,51 @@ protected synchronized void startScan() { List servers = discoverer.discoverServers(); if (!servers.isEmpty()) { - for (ServerDiscoveryResult server : servers) { + servers.parallelStream().forEach(server -> { logger.debug("Server {} @ {}", server.getName(), server.getAddress()); var uid = new ThingUID(Constants.THING_TYPE_SERVER, server.getId()); - var properties = this.getProperties(server); - var resultBuilder = DiscoveryResultBuilder.create(uid).withProperties(properties) - .withRepresentationProperty(Thing.PROPERTY_SERIAL_NUMBER).withLabel(server.getName()) - .withTTL(Constants.DISCOVERY_RESULT_TTL_SEC); + try { + var properties = this.getProperties(server); + var resultBuilder = DiscoveryResultBuilder.create(uid).withProperties(properties) + .withRepresentationProperty(Thing.PROPERTY_SERIAL_NUMBER).withLabel(server.getName()) + .withTTL(Constants.DISCOVERY_RESULT_TTL_SEC); - var result = resultBuilder.build(); + var result = resultBuilder.build(); - this.thingDiscovered(result); - } + this.thingDiscovered(result); + } catch (Exception e) { + logger.warn("Failed to retrieve system info from Jellyfin server at {}: {}", server.getAddress(), + e.getMessage()); + logger.info("Discovered server {} @ {} will be ignored.", server.getName(), server.getAddress()); + } + }); } } - private Map getProperties(ServerDiscoveryResult server) { + /** + * Get properties of the Jellyfin server. + * + * @param server The discovered server + * @return Map of server properties + * @throws ApiException If the API call to get additional server information fails + */ + private Map getProperties(ServerDiscoveryResult server) throws ApiException { Map properties = new HashMap<>(); - try { - var uri = server.getAddress(); - var client = new ApiClient(); - client.updateBaseUri(uri); + var uri = server.getAddress(); + var client = new ApiClient(); + client.updateBaseUri(uri); - var systemApi = new SystemApi(client); - var systemInformation = systemApi.getPublicSystemInfo(); + var systemApi = new SystemApi(client); + var systemInformation = systemApi.getPublicSystemInfo(); - properties.put(Thing.PROPERTY_SERIAL_NUMBER, systemInformation.getId()); - properties.put(Thing.PROPERTY_FIRMWARE_VERSION, systemInformation.getVersion()); - properties.put(Thing.PROPERTY_VENDOR, "https://jellyfin.org"); + properties.put(Thing.PROPERTY_SERIAL_NUMBER, systemInformation.getId()); + properties.put(Thing.PROPERTY_FIRMWARE_VERSION, systemInformation.getVersion()); + properties.put(Thing.PROPERTY_VENDOR, "https://jellyfin.org"); + + properties.put(Constants.ServerProperties.SERVER_URI, uri); - properties.put(Constants.ServerProperties.SERVER_URI, uri); - } catch (ApiException e) { - logger.warn("Unable to get device properties: {}", e); - } return properties; } } From 75f4fbf9caff51a67d86625ebb9ec96274e67a7b Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sun, 28 Sep 2025 12:24:37 +0200 Subject: [PATCH 10/38] Refactor Jellyfin API client: Remove unused classes and interfaces - Deleted ApiClientFactory, HttpClientOptions, HttpMethod, RawResponse, ApiClientException, MissingBaseUrlException, JettyApiClient, JettyApiClientFactory, DiscoveryService, ServerDiscoveryInfo, ClientInfo, DeviceInfo, and ServerVersion classes. - Introduced ClientScanTask for scanning connected client devices on the Jellyfin server. - Updated imports and package structure accordingly. Signed-off-by: Patrik Gfeller --- .../jellyfin/internal/client/Jellyfin._ | 137 ---------- .../internal/client/JellyfinClientFactory._ | 106 -------- .../internal/client/JellyfinOptions._ | 156 ------------ .../internal/client/api/client/ApiClient._ | 155 ------------ .../client/api/client/ApiClientFactory._ | 38 --- .../client/api/client/HttpClientOptions._ | 115 --------- .../internal/client/api/client/HttpMethod._ | 27 -- .../internal/client/api/client/RawResponse._ | 86 ------- .../api/client/exception/ApiClientException._ | 43 ---- .../exception/MissingBaseUrlException._ | 31 --- .../client/api/client/impl/JettyApiClient._ | 237 ------------------ .../api/client/impl/JettyApiClientFactory._ | 48 ---- .../client/discovery/DiscoveryService._ | 94 ------- .../client/discovery/ServerDiscoveryInfo._ | 90 ------- .../internal/client/model/ClientInfo._ | 77 ------ .../internal/client/model/DeviceInfo._ | 78 ------ .../internal/client/model/ServerVersion._ | 161 ------------ .../handler/tasks/ClientScanTask.java | 66 +++++ 18 files changed, 66 insertions(+), 1679 deletions(-) delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/Jellyfin._ delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/JellyfinClientFactory._ delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/JellyfinOptions._ delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/ApiClient._ delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/ApiClientFactory._ delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/HttpClientOptions._ delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/HttpMethod._ delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/RawResponse._ delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/exception/ApiClientException._ delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/exception/MissingBaseUrlException._ delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/impl/JettyApiClient._ delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/impl/JettyApiClientFactory._ delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/discovery/DiscoveryService._ delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/discovery/ServerDiscoveryInfo._ delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/ClientInfo._ delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/DeviceInfo._ delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/ServerVersion._ create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ClientScanTask.java diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/Jellyfin._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/Jellyfin._ deleted file mode 100644 index 7fec0e99feaa2..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/Jellyfin._ +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client; - -import org.openhab.binding.jellyfin.internal.client.api.client.ApiClient; -import org.openhab.binding.jellyfin.internal.client.api.client.HttpClientOptions; -import org.openhab.binding.jellyfin.internal.client.discovery.DiscoveryService; -import org.openhab.binding.jellyfin.internal.client.model.ClientInfo; -import org.openhab.binding.jellyfin.internal.client.model.DeviceInfo; -import org.openhab.binding.jellyfin.internal.client.model.ServerVersion; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Main Jellyfin client class for interacting with Jellyfin servers - * - * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude - * Sonnet 3.7") - */ -public class Jellyfin { - - private final Logger logger = LoggerFactory.getLogger(Jellyfin.class); - private final JellyfinOptions options; - - /** - * Create a new Jellyfin client instance - * - * @param options Configuration options for the client - */ - public Jellyfin(JellyfinOptions options) { - this.options = options; - } - - /** - * Create a new Jellyfin client instance - * - * @param optionsBuilder Builder for configuration options - */ - public Jellyfin(JellyfinOptions.Builder optionsBuilder) { - this(optionsBuilder.build()); - } - - /** - * Get the device information - * - * @return Device information or null if not set - */ - public DeviceInfo getDeviceInfo() { - return options.getDeviceInfo(); - } - - /** - * Get the client information - * - * @return Client information or null if not set - */ - public ClientInfo getClientInfo() { - return options.getClientInfo(); - } - - /** - * Get the discovery service to help with normalizing server addresses and find servers in the local network - * - * @return The discovery service instance - */ - public DiscoveryService getDiscovery() { - // Note: In a real implementation, this would be lazily instantiated - return new DiscoveryService(this); - } - - /** - * Create a new API client instance to use in API services. - * The clientInfo and deviceInfo parameters are required when not passed as option in JellyfinOptions. - * The baseUrl is only required when HTTP calls are made. - * - * @param baseUrl The base URL of the Jellyfin server - * @param accessToken Access token for authentication - * @param clientInfo Client information - * @param deviceInfo Device information - * @param httpClientOptions HTTP client options - * @return A new API client instance - * @throws IllegalArgumentException If required parameters are missing - */ - public ApiClient createApi(String baseUrl, String accessToken, ClientInfo clientInfo, DeviceInfo deviceInfo, - HttpClientOptions httpClientOptions) { - - if (clientInfo == null) { - clientInfo = options.getClientInfo(); - } - - if (deviceInfo == null) { - deviceInfo = options.getDeviceInfo(); - } - - if (clientInfo == null) { - throw new IllegalArgumentException( - "ClientInfo needs to be set when calling createApi() or by providing it when constructing the Jellyfin instance"); - } - - if (deviceInfo == null) { - throw new IllegalArgumentException( - "DeviceInfo needs to be set when calling createApi() or by providing it when constructing the Jellyfin instance"); - } - - return options.getApiClientFactory().create(baseUrl, accessToken, clientInfo, deviceInfo, httpClientOptions); - } - - /** - * Create a new API client with default HTTP options - * - * @param baseUrl The base URL of the Jellyfin server - * @param accessToken Access token for authentication - * @return A new API client instance - */ - public ApiClient createApi(String baseUrl, String accessToken) { - return createApi(baseUrl, accessToken, null, null, new HttpClientOptions()); - } - - /** - * Get the minimum server version expected to work - * - * @return The minimum supported server version - */ - public static ServerVersion getMinimumVersion() { - return new ServerVersion(10, 10, 0, 0); - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/JellyfinClientFactory._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/JellyfinClientFactory._ deleted file mode 100644 index 354e4e4d13d25..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/JellyfinClientFactory._ +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client; - -import java.util.UUID; - -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.util.ssl.SslContextFactory; -import org.openhab.binding.jellyfin.internal.client.api.client.impl.JettyApiClientFactory; -import org.openhab.binding.jellyfin.internal.client.model.ClientInfo; -import org.openhab.binding.jellyfin.internal.client.model.DeviceInfo; -import org.openhab.core.io.net.http.HttpClientFactory; -import org.osgi.service.component.annotations.Activate; -import org.osgi.service.component.annotations.Component; -import org.osgi.service.component.annotations.Reference; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Factory for creating Jellyfin client instances - * - * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude - * Sonnet 3.7") - */ -@Component(service = JellyfinClientFactory.class) -@NonNullByDefault -public class JellyfinClientFactory { - - private final Logger logger = LoggerFactory.getLogger(JellyfinClientFactory.class); - - private static final String CLIENT_NAME = "openHAB"; - private static final String CLIENT_VERSION = "1.0.0"; - private static final String DEVICE_NAME = "openHAB Binding"; - - private final HttpClient httpClient; - - @Activate - public JellyfinClientFactory(@Reference HttpClientFactory httpClientFactory) { - SslContextFactory.Client sslContextFactory = new SslContextFactory.Client(); - sslContextFactory.setEndpointIdentificationAlgorithm(null); - this.httpClient = httpClientFactory.getCommonHttpClient(); - - try { - if (!httpClient.isStarted()) { - httpClient.start(); - } - } catch (Exception e) { - logger.error("Failed to start HTTP client: {}", e.getMessage()); - } - } - - /** - * Create a new Jellyfin client instance - * - * @param deviceId The device ID to use, or null to generate a random one - * @return A new Jellyfin client instance - */ - public Jellyfin createJellyfinClient(String deviceId) { - if (deviceId == null || deviceId.trim().isEmpty()) { - deviceId = UUID.randomUUID().toString(); - } - - ClientInfo clientInfo = new ClientInfo(CLIENT_NAME, CLIENT_VERSION); - DeviceInfo deviceInfo = new DeviceInfo(deviceId, DEVICE_NAME); - - JettyApiClientFactory apiClientFactory = new JettyApiClientFactory(httpClient); - - JellyfinOptions options = new JellyfinOptions.Builder().setClientInfo(clientInfo).setDeviceInfo(deviceInfo) - .setApiClientFactory(apiClientFactory).build(); - - return new Jellyfin(options); - } - - /** - * Create a new Jellyfin client instance with a random device ID - * - * @return A new Jellyfin client instance - */ - public Jellyfin createJellyfinClient() { - return createJellyfinClient(null); - } - - /** - * Clean up resources - */ - public void dispose() { - try { - if (httpClient.isStarted()) { - httpClient.stop(); - } - } catch (Exception e) { - logger.error("Failed to stop HTTP client: {}", e.getMessage()); - } - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/JellyfinOptions._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/JellyfinOptions._ deleted file mode 100644 index 1310918c3c1fe..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/JellyfinOptions._ +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client; - -import java.util.Objects; - -import org.openhab.binding.jellyfin.internal.client.api.client.ApiClientFactory; -import org.openhab.binding.jellyfin.internal.client.model.ClientInfo; -import org.openhab.binding.jellyfin.internal.client.model.DeviceInfo; -import org.openhab.binding.jellyfin.internal.client.model.ServerVersion; - -/** - * Configuration options for the Jellyfin client - * - * @author Patrik Gfeller, Initial contribution (based on Android SDK by Peter Feller) - */ -public class JellyfinOptions { - private final ClientInfo clientInfo; - private final DeviceInfo deviceInfo; - private final ApiClientFactory apiClientFactory; - private final ServerVersion minimumServerVersion; - - /** - * Create a new JellyfinOptions instance - * - * @param clientInfo Client information or null - * @param deviceInfo Device information or null - * @param apiClientFactory Factory for creating API clients - * @param minimumServerVersion Minimum supported server version - */ - public JellyfinOptions(ClientInfo clientInfo, DeviceInfo deviceInfo, ApiClientFactory apiClientFactory, - ServerVersion minimumServerVersion) { - this.clientInfo = clientInfo; - this.deviceInfo = deviceInfo; - this.apiClientFactory = apiClientFactory; - this.minimumServerVersion = minimumServerVersion; - } - - /** - * Get the client information - * - * @return Client information or null if not set - */ - public ClientInfo getClientInfo() { - return clientInfo; - } - - /** - * Get the device information - * - * @return Device information or null if not set - */ - public DeviceInfo getDeviceInfo() { - return deviceInfo; - } - - /** - * Get the API client factory - * - * @return The API client factory - */ - public ApiClientFactory getApiClientFactory() { - return apiClientFactory; - } - - /** - * Get the minimum supported server version - * - * @return The minimum supported server version - */ - public ServerVersion getMinimumServerVersion() { - return minimumServerVersion; - } - - /** - * Builder for JellyfinOptions - */ - public static class Builder { - private ClientInfo clientInfo; - private DeviceInfo deviceInfo; - private ApiClientFactory apiClientFactory; - private ServerVersion minimumServerVersion = Jellyfin.getMinimumVersion(); - - /** - * Create a new builder instance - */ - public Builder() { - } - - /** - * Set the client information - * - * @param clientInfo Client information - * @return This builder for method chaining - */ - public Builder setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Set the device information - * - * @param deviceInfo Device information - * @return This builder for method chaining - */ - public Builder setDeviceInfo(DeviceInfo deviceInfo) { - this.deviceInfo = deviceInfo; - return this; - } - - /** - * Set the API client factory - * - * @param apiClientFactory API client factory - * @return This builder for method chaining - */ - public Builder setApiClientFactory(ApiClientFactory apiClientFactory) { - this.apiClientFactory = apiClientFactory; - return this; - } - - /** - * Set the minimum supported server version - * - * @param minimumServerVersion Minimum supported server version - * @return This builder for method chaining - */ - public Builder setMinimumServerVersion(ServerVersion minimumServerVersion) { - this.minimumServerVersion = minimumServerVersion; - return this; - } - - /** - * Build a JellyfinOptions instance - * - * @return The new JellyfinOptions instance - */ - public JellyfinOptions build() { - Objects.requireNonNull(apiClientFactory, "API client factory must be set"); - Objects.requireNonNull(minimumServerVersion, "Minimum server version must be set"); - - return new JellyfinOptions(clientInfo, deviceInfo, apiClientFactory, minimumServerVersion); - } - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/ApiClient._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/ApiClient._ deleted file mode 100644 index c9640edbd703b..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/ApiClient._ +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client.api.client; - -import java.util.Collections; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import org.openhab.binding.jellyfin.internal.client.api.client.exception.MissingBaseUrlException; -import org.openhab.binding.jellyfin.internal.client.model.ClientInfo; -import org.openhab.binding.jellyfin.internal.client.model.DeviceInfo; - -/** - * Interface for the Jellyfin API client - * - * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude - * Sonnet 3.7") - */ -public abstract class ApiClient { - - /** - * The query parameter to use for access tokens. - */ - public static final String QUERY_ACCESS_TOKEN = "ApiKey"; - - /** - * The recommended value for the accept header. It prefers JSON followed by octet stream and finally - * everything. The "any MIME type" (* / *) is required for some endpoints in the server. - */ - public static final String HEADER_ACCEPT = "application/json, application/octet-stream;q=0.9, */*;q=0.8"; - - /** - * URL to use as base for API endpoints. Should include the protocol and may contain a path. - * - * @return The base URL or null if not set - */ - public abstract String getBaseUrl(); - - /** - * Access token to use for requests. Appended to all requests if set. - * - * @return The access token or null if not set - */ - public abstract String getAccessToken(); - - /** - * Information about the client / application send in all API requests. - * - * @return Client information - */ - public abstract ClientInfo getClientInfo(); - - /** - * Information about the device send in all API requests. Only a single session is allowed per - * device id. - * - * @return Device information - */ - public abstract DeviceInfo getDeviceInfo(); - - /** - * HTTP Options for this ApiClient. - * - * @return HTTP client options - */ - public abstract HttpClientOptions getHttpClientOptions(); - - /** - * Change the authorization values used in this ApiClient instance. - * - * @param baseUrl The new base URL or null - * @param accessToken The new access token or null - * @param clientInfo The new client information - * @param deviceInfo The new device information - */ - public abstract void update(String baseUrl, String accessToken, ClientInfo clientInfo, DeviceInfo deviceInfo); - - /** - * Create a complete URL based on the base URL and given parameters. - * - * @param pathTemplate Path template with optional placeholders - * @param pathParameters Map of path parameters to replace placeholders - * @param queryParameters Map of query parameters to append - * @param ignorePathParameters Whether to ignore path parameters and use the template as-is - * @return The complete URL - * @throws MissingBaseUrlException If the base URL is missing - */ - public String createUrl(String pathTemplate, Map pathParameters, - Map queryParameters, boolean ignorePathParameters) throws MissingBaseUrlException { - - String baseUrl = getBaseUrl(); - if (baseUrl == null) { - throw new MissingBaseUrlException(); - } - - // In a real implementation, you would need to implement URL building logic here - // For this basic example, we'll just append the path to the base URL - return baseUrl + pathTemplate; - } - - /** - * Simplified createUrl variant with default parameters - * - * @param pathTemplate Path template - * @return The complete URL - * @throws MissingBaseUrlException If the base URL is missing - */ - public String createUrl(String pathTemplate) throws MissingBaseUrlException { - return createUrl(pathTemplate, Collections.emptyMap(), Collections.emptyMap(), true); - } - - /** - * Send an API request - * - * @param method HTTP method - * @param pathTemplate Path template - * @param pathParameters Path parameters - * @param queryParameters Query parameters - * @param requestBody Request body object - * @return Future with the raw response - */ - public abstract CompletableFuture request(HttpMethod method, String pathTemplate, - Map pathParameters, Map queryParameters, Object requestBody); - - /** - * Send a GET request - * - * @param pathTemplate Path template - * @return Future with the raw response - */ - public CompletableFuture get(String pathTemplate) { - return request(HttpMethod.GET, pathTemplate, Collections.emptyMap(), Collections.emptyMap(), null); - } - - /** - * Send a POST request - * - * @param pathTemplate Path template - * @param requestBody Request body object - * @return Future with the raw response - */ - public CompletableFuture post(String pathTemplate, Object requestBody) { - return request(HttpMethod.POST, pathTemplate, Collections.emptyMap(), Collections.emptyMap(), requestBody); - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/ApiClientFactory._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/ApiClientFactory._ deleted file mode 100644 index 59de7e3e01778..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/ApiClientFactory._ +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client.api.client; - -import org.openhab.binding.jellyfin.internal.client.model.ClientInfo; -import org.openhab.binding.jellyfin.internal.client.model.DeviceInfo; - -/** - * Factory interface for creating API clients - * - * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude - * Sonnet 3.7") - */ -public interface ApiClientFactory { - - /** - * Create a new API client - * - * @param baseUrl The base URL of the Jellyfin server - * @param accessToken Access token for authentication - * @param clientInfo Client information - * @param deviceInfo Device information - * @param httpClientOptions HTTP client options - * @return A new API client - */ - ApiClient create(String baseUrl, String accessToken, ClientInfo clientInfo, DeviceInfo deviceInfo, - HttpClientOptions httpClientOptions); -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/HttpClientOptions._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/HttpClientOptions._ deleted file mode 100644 index bd16f478340f9..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/HttpClientOptions._ +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client.api.client; - -import java.time.Duration; - -/** - * Configuration options for the Jellyfin API HTTP client - * - * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude - * Sonnet 3.7") - */ -public class HttpClientOptions { - - private boolean followRedirects = true; - private Duration connectTimeout = Duration.ofSeconds(10); - private Duration requestTimeout = Duration.ofSeconds(60); - private Duration socketTimeout = Duration.ofMinutes(5); - - /** - * Creates a new HttpClientOptions with default values - */ - public HttpClientOptions() { - } - - /** - * Check if the client should follow redirects - * - * @return True if redirects should be followed - */ - public boolean isFollowRedirects() { - return followRedirects; - } - - /** - * Set whether the client should follow redirects - * - * @param followRedirects True to follow redirects - * @return This instance for method chaining - */ - public HttpClientOptions setFollowRedirects(boolean followRedirects) { - this.followRedirects = followRedirects; - return this; - } - - /** - * Get the connection timeout duration - * - * @return The connection timeout - */ - public Duration getConnectTimeout() { - return connectTimeout; - } - - /** - * Set the connection timeout duration - * - * @param connectTimeout The connection timeout - * @return This instance for method chaining - */ - public HttpClientOptions setConnectTimeout(Duration connectTimeout) { - this.connectTimeout = connectTimeout; - return this; - } - - /** - * Get the request timeout duration - * - * @return The request timeout - */ - public Duration getRequestTimeout() { - return requestTimeout; - } - - /** - * Set the request timeout duration - * - * @param requestTimeout The request timeout - * @return This instance for method chaining - */ - public HttpClientOptions setRequestTimeout(Duration requestTimeout) { - this.requestTimeout = requestTimeout; - return this; - } - - /** - * Get the socket timeout duration - * - * @return The socket timeout - */ - public Duration getSocketTimeout() { - return socketTimeout; - } - - /** - * Set the socket timeout duration - * - * @param socketTimeout The socket timeout - * @return This instance for method chaining - */ - public HttpClientOptions setSocketTimeout(Duration socketTimeout) { - this.socketTimeout = socketTimeout; - return this; - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/HttpMethod._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/HttpMethod._ deleted file mode 100644 index 1f516700f24f4..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/HttpMethod._ +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client.api.client; - -/** - * Enum representing HTTP methods for the Jellyfin API client - * - * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude - * Sonnet 3.7") - */ -public enum HttpMethod { - GET, - POST, - PUT, - DELETE, - PATCH -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/RawResponse._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/RawResponse._ deleted file mode 100644 index f6c7ddbfb105c..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/RawResponse._ +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client.api.client; - -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.util.Map; - -/** - * Raw API response container - * - * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude - * Sonnet 3.7") - */ -public class RawResponse { - - private final int status; - private final Map headers; - private final ByteBuffer body; - - /** - * Create a new raw response - * - * @param status HTTP status code - * @param headers Response headers - * @param body Response body as ByteBuffer - */ - public RawResponse(int status, Map headers, ByteBuffer body) { - this.status = status; - this.headers = headers; - this.body = body; - } - - /** - * Get the HTTP status code - * - * @return HTTP status code - */ - public int getStatus() { - return status; - } - - /** - * Get the response headers - * - * @return Map of response headers - */ - public Map getHeaders() { - return headers; - } - - /** - * Get the response body as ByteBuffer - * - * @return ByteBuffer containing the response body - */ - public ByteBuffer getBody() { - return body; - } - - /** - * Get the response body as a String using UTF-8 encoding - * - * @return String representation of the body - */ - public String getBodyAsString() { - if (body == null) { - return null; - } - - ByteBuffer duplicate = body.duplicate(); - byte[] bytes = new byte[duplicate.remaining()]; - duplicate.get(bytes); - return new String(bytes, StandardCharsets.UTF_8); - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/exception/ApiClientException._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/exception/ApiClientException._ deleted file mode 100644 index ba2efb952af46..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/exception/ApiClientException._ +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client.api.client.exception; - -/** - * Base exception for all API client exceptions - * - * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude - * Sonnet 3.7") - */ -public class ApiClientException extends Exception { - - private static final long serialVersionUID = 4499822310456934151L; - - /** - * Create a new API client exception - * - * @param message The exception message - */ - public ApiClientException(String message) { - super(message); - } - - /** - * Create a new API client exception - * - * @param message The exception message - * @param cause The cause of the exception - */ - public ApiClientException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/exception/MissingBaseUrlException._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/exception/MissingBaseUrlException._ deleted file mode 100644 index 7da6da766b395..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/exception/MissingBaseUrlException._ +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client.api.client.exception; - -/** - * Exception thrown when the base URL is missing when required - * - * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude - * Sonnet 3.7") - */ -public class MissingBaseUrlException extends ApiClientException { - - private static final long serialVersionUID = -831061596991416260L; - - /** - * Create a new missing base URL exception - */ - public MissingBaseUrlException() { - super("Base URL is missing but required for this operation"); - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/impl/JettyApiClient._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/impl/JettyApiClient._ deleted file mode 100644 index 789f1d5b9ded8..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/impl/JettyApiClient._ +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client.api.client.impl; - -import java.net.URI; -import java.net.URISyntaxException; -import java.nio.ByteBuffer; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionException; - -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.client.api.ContentResponse; -import org.eclipse.jetty.client.api.Request; -import org.eclipse.jetty.client.util.StringContentProvider; -import org.eclipse.jetty.http.HttpHeader; -import org.openhab.binding.jellyfin.internal.client.api.client.ApiClient; -import org.openhab.binding.jellyfin.internal.client.api.client.HttpClientOptions; -import org.openhab.binding.jellyfin.internal.client.api.client.HttpMethod; -import org.openhab.binding.jellyfin.internal.client.api.client.RawResponse; -import org.openhab.binding.jellyfin.internal.client.api.client.exception.MissingBaseUrlException; -import org.openhab.binding.jellyfin.internal.client.model.ClientInfo; -import org.openhab.binding.jellyfin.internal.client.model.DeviceInfo; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Implementation of the Jellyfin API client using Jetty HTTP client - * - * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude - * Sonnet 3.7") - */ -@NonNullByDefault -public class JettyApiClient extends ApiClient { - - private final Logger logger = LoggerFactory.getLogger(JettyApiClient.class); - private final HttpClient httpClient; - - private String baseUrl; - private String accessToken; - private ClientInfo clientInfo; - private DeviceInfo deviceInfo; - private final HttpClientOptions httpClientOptions; - - /** - * Create a new Jetty-based API client - * - * @param httpClient The Jetty HTTP client - * @param baseUrl The base URL of the Jellyfin server - * @param accessToken Access token for authentication - * @param clientInfo Client information - * @param deviceInfo Device information - * @param httpClientOptions HTTP client options - */ - public JettyApiClient(HttpClient httpClient, String baseUrl, String accessToken, ClientInfo clientInfo, - DeviceInfo deviceInfo, HttpClientOptions httpClientOptions) { - this.httpClient = httpClient; - this.baseUrl = baseUrl; - this.accessToken = accessToken; - this.clientInfo = clientInfo; - this.deviceInfo = deviceInfo; - this.httpClientOptions = httpClientOptions; - } - - @Override - public String getBaseUrl() { - return baseUrl; - } - - @Override - public String getAccessToken() { - return accessToken; - } - - @Override - public ClientInfo getClientInfo() { - return clientInfo; - } - - @Override - public DeviceInfo getDeviceInfo() { - return deviceInfo; - } - - @Override - public HttpClientOptions getHttpClientOptions() { - return httpClientOptions; - } - - @Override - public void update(String baseUrl, String accessToken, ClientInfo clientInfo, DeviceInfo deviceInfo) { - this.baseUrl = baseUrl; - this.accessToken = accessToken; - this.clientInfo = clientInfo; - this.deviceInfo = deviceInfo; - } - - @Override - public String createUrl(String pathTemplate, Map pathParameters, - Map queryParameters, boolean ignorePathParameters) throws MissingBaseUrlException { - if (baseUrl == null || baseUrl.isEmpty()) { - throw new MissingBaseUrlException(); - } - - try { - // Simple URL builder for this example - URI uri = new URI(baseUrl).resolve(pathTemplate); - - // Add query parameters if present - if (!queryParameters.isEmpty()) { - StringBuilder sb = new StringBuilder(uri.toString()); - sb.append(uri.toString().contains("?") ? "&" : "?"); - - boolean first = true; - for (Map.Entry entry : queryParameters.entrySet()) { - if (!first) { - sb.append("&"); - } - sb.append(entry.getKey()).append("=").append(entry.getValue()); - first = false; - } - - // Add access token as query param if available - if (accessToken != null && !accessToken.isEmpty()) { - sb.append(first ? "" : "&").append(QUERY_ACCESS_TOKEN).append("=").append(accessToken); - } - - return sb.toString(); - } else if (accessToken != null && !accessToken.isEmpty()) { - // Add just the access token - return uri + (uri.toString().contains("?") ? "&" : "?") + QUERY_ACCESS_TOKEN + "=" + accessToken; - } - - return uri.toString(); - } catch (URISyntaxException e) { - logger.error("Failed to create URL: {}", e.getMessage()); - throw new IllegalArgumentException("Invalid URL template: " + pathTemplate, e); - } - } - - @Override - public CompletableFuture request(HttpMethod method, String pathTemplate, - Map pathParameters, Map queryParameters, Object requestBody) { - - return CompletableFuture.supplyAsync(() -> { - try { - String url = createUrl(pathTemplate, pathParameters, queryParameters, false); - - Request request; - switch (method) { - case GET: - request = httpClient.newRequest(url).method("GET"); - break; - case POST: - request = httpClient.newRequest(url).method("POST"); - break; - case PUT: - request = httpClient.newRequest(url).method("PUT"); - break; - case DELETE: - request = httpClient.newRequest(url).method("DELETE"); - break; - case PATCH: - request = httpClient.newRequest(url).method("PATCH"); - break; - default: - throw new IllegalArgumentException("Unsupported HTTP method: " + method); - } - - // Add common headers - request.header(HttpHeader.ACCEPT, HEADER_ACCEPT); - request.header("X-Emby-Authorization", buildAuthHeader()); - - // Add request body if present - if (requestBody != null) { - if (requestBody instanceof String) { - request.content(new StringContentProvider((String) requestBody), "application/json"); - } else { - // In a real implementation, a JSON serializer would be used here - request.content(new StringContentProvider(requestBody.toString()), "application/json"); - } - } - - // Set timeouts - request.timeout(httpClientOptions.getRequestTimeout().toMillis(), - httpClientOptions.getSocketTimeout().toMillis()); - - // Execute the request - ContentResponse response = request.send(); - - // Create response object - Map headers = new HashMap<>(); - response.getHeaders().forEach(field -> headers.put(field.getName(), field.getValue())); - - ByteBuffer body = ByteBuffer.wrap(response.getContent()); - - return new RawResponse(response.getStatus(), headers, body); - } catch (Exception e) { - throw new CompletionException("Request failed: " + e.getMessage(), e); - } - }); - } - - /** - * Build the authentication header for Jellyfin requests - * - * @return The formatted authorization header value - */ - private String buildAuthHeader() { - StringBuilder sb = new StringBuilder(); - - // MediaBrowser Client="ClientName", Device="DeviceName", DeviceId="DeviceId", Version="Version" - sb.append("MediaBrowser "); - sb.append("Client=\"").append(clientInfo.getName()).append("\", "); - sb.append("Device=\"").append(deviceInfo.getName()).append("\", "); - sb.append("DeviceId=\"").append(deviceInfo.getId()).append("\", "); - sb.append("Version=\"").append(clientInfo.getVersion()).append("\""); - - if (accessToken != null && !accessToken.isEmpty()) { - sb.append(", Token=\"").append(accessToken).append("\""); - } - - return sb.toString(); - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/impl/JettyApiClientFactory._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/impl/JettyApiClientFactory._ deleted file mode 100644 index 74eebc5664a62..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/api/client/impl/JettyApiClientFactory._ +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client.api.client.impl; - -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jetty.client.HttpClient; -import org.openhab.binding.jellyfin.internal.client.api.client.ApiClient; -import org.openhab.binding.jellyfin.internal.client.api.client.ApiClientFactory; -import org.openhab.binding.jellyfin.internal.client.api.client.HttpClientOptions; -import org.openhab.binding.jellyfin.internal.client.model.ClientInfo; -import org.openhab.binding.jellyfin.internal.client.model.DeviceInfo; - -/** - * Factory for creating Jetty-based API clients - * - * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude - * Sonnet 3.7") - */ -@NonNullByDefault -public class JettyApiClientFactory implements ApiClientFactory { - - private final HttpClient httpClient; - - /** - * Create a new Jetty API client factory - * - * @param httpClient The Jetty HTTP client - */ - public JettyApiClientFactory(HttpClient httpClient) { - this.httpClient = httpClient; - } - - @Override - public ApiClient create(String baseUrl, String accessToken, ClientInfo clientInfo, DeviceInfo deviceInfo, - HttpClientOptions httpClientOptions) { - return new JettyApiClient(httpClient, baseUrl, accessToken, clientInfo, deviceInfo, httpClientOptions); - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/discovery/DiscoveryService._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/discovery/DiscoveryService._ deleted file mode 100644 index c4541b100993d..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/discovery/DiscoveryService._ +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client.discovery; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import org.openhab.binding.jellyfin.internal.client.Jellyfin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Service for discovering Jellyfin servers and normalizing server addresses - * - * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude - * Sonnet 3.7") - */ -public class DiscoveryService { - - private final Logger logger = LoggerFactory.getLogger(DiscoveryService.class); - private final Jellyfin jellyfin; - - /** - * Create a new discovery service - * - * @param jellyfin The Jellyfin client instance - */ - public DiscoveryService(Jellyfin jellyfin) { - this.jellyfin = jellyfin; - } - - /** - * Normalize a server URL to ensure it has the correct format - * - * @param url The server URL to normalize - * @return The normalized URL or null if invalid - */ - public String normalizeUrl(String url) { - if (url == null || url.trim().isEmpty()) { - return null; - } - - try { - // Add http:// if no protocol is specified - if (!url.startsWith("http://") && !url.startsWith("https://")) { - url = "http://" + url; - } - - URI uri = new URI(url); - - // Ensure we have a valid hostname or IP - if (uri.getHost() == null || uri.getHost().isEmpty()) { - return null; - } - - // Remove trailing slashes from path - String path = uri.getPath(); - while (path != null && !path.isEmpty() && path.endsWith("/")) { - path = path.substring(0, path.length() - 1); - } - - // Build the normalized URL - return new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), path, uri.getQuery(), - uri.getFragment()).toString(); - } catch (URISyntaxException e) { - logger.debug("Failed to normalize URL: {}", url, e); - return null; - } - } - - /** - * Search for Jellyfin servers on the local network - * - * @return CompletableFuture with list of discovered servers - */ - public CompletableFuture> discoverLocalServers() { - // In a real implementation, this would perform server discovery - // For this example, we'll return an empty list - return CompletableFuture.completedFuture(new ArrayList<>()); - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/discovery/ServerDiscoveryInfo._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/discovery/ServerDiscoveryInfo._ deleted file mode 100644 index 9b3d1007863c6..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/discovery/ServerDiscoveryInfo._ +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client.discovery; - -import java.util.Objects; - -/** - * Information about a discovered Jellyfin server - * - * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude - * Sonnet 3.7") - */ -public class ServerDiscoveryInfo { - - private final String id; - private final String name; - private final String address; - - /** - * Create a new server discovery info instance - * - * @param id The server ID - * @param name The server name - * @param address The server address - */ - public ServerDiscoveryInfo(String id, String name, String address) { - this.id = id; - this.name = name; - this.address = address; - } - - /** - * Get the server ID - * - * @return The server ID - */ - public String getId() { - return id; - } - - /** - * Get the server name - * - * @return The server name - */ - public String getName() { - return name; - } - - /** - * Get the server address - * - * @return The server address - */ - public String getAddress() { - return address; - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - - ServerDiscoveryInfo that = (ServerDiscoveryInfo) o; - return Objects.equals(id, that.id) && Objects.equals(name, that.name) && Objects.equals(address, that.address); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, address); - } - - @Override - public String toString() { - return "ServerDiscoveryInfo{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", address='" + address + '\'' - + '}'; - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/ClientInfo._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/ClientInfo._ deleted file mode 100644 index 00edd427e65e8..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/ClientInfo._ +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client.model; - -import java.util.Objects; - -/** - * The client information is used to identify the client. - * - * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude - * Sonnet 3.7") - */ -public class ClientInfo { - - private final String name; - private final String version; - - /** - * Create a new ClientInfo instance - * - * @param name Name of the client, this should normally not change - * @param version The version of the client - */ - public ClientInfo(String name, String version) { - this.name = name; - this.version = version; - } - - /** - * Get the name of the client - * - * @return The client name - */ - public String getName() { - return name; - } - - /** - * Get the version of the client - * - * @return The client version - */ - public String getVersion() { - return version; - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - - ClientInfo that = (ClientInfo) o; - return Objects.equals(name, that.name) && Objects.equals(version, that.version); - } - - @Override - public int hashCode() { - return Objects.hash(name, version); - } - - @Override - public String toString() { - return "ClientInfo{" + "name='" + name + '\'' + ", version='" + version + '\'' + '}'; - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/DeviceInfo._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/DeviceInfo._ deleted file mode 100644 index 9f6e4504e8440..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/DeviceInfo._ +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client.model; - -import java.util.Objects; - -/** - * The device information is used to identify the device the client application is running on. - * - * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude - * Sonnet 3.7") - */ -public class DeviceInfo { - - private final String id; - private final String name; - - /** - * Create a new DeviceInfo instance - * - * @param id Unique id of the device. Only one user may be authenticated per device. - * It is recommended to generate a unique value for each user in the client. - * @param name Name of the device - */ - public DeviceInfo(String id, String name) { - this.id = id; - this.name = name; - } - - /** - * Get the device id - * - * @return The unique device id - */ - public String getId() { - return id; - } - - /** - * Get the device name - * - * @return The device name - */ - public String getName() { - return name; - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - - DeviceInfo that = (DeviceInfo) o; - return Objects.equals(id, that.id) && Objects.equals(name, that.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - return "DeviceInfo{" + "id='" + id + '\'' + ", name='" + name + '\'' + '}'; - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/ServerVersion._ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/ServerVersion._ deleted file mode 100644 index fe483eece8648..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/client/model/ServerVersion._ +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.client.model; - -import java.util.Comparator; -import java.util.Objects; -import java.util.regex.Pattern; - -/** - * Model to help with Jellyfin server versions. The format is similar to SemVer. - * - * @author Patrik Gfeller, based on Android SDK by Peter Feller - Initial contribution (AI generated code by "Claude - * Sonnet 3.7") - */ -public class ServerVersion implements Comparable { - - private static final Comparator COMPARATOR = Comparator.comparing(ServerVersion::getMajor) - .thenComparing(ServerVersion::getMinor).thenComparing(ServerVersion::getPatch) - .thenComparing(version -> version.getBuild() != null ? version.getBuild() : 0); - - private static final Pattern VERSION_PATTERN = Pattern.compile("^\\d+\\.\\d+\\.\\d+(?:\\.\\d+)?$"); - - private final int major; - private final int minor; - private final int patch; - private final Integer build; - - /** - * Create a new ServerVersion - * - * @param major The major version number - * @param minor The minor version number - * @param patch The patch version number - */ - public ServerVersion(int major, int minor, int patch) { - this(major, minor, patch, null); - } - - /** - * Create a new ServerVersion - * - * @param major The major version number - * @param minor The minor version number - * @param patch The patch version number - * @param build The optional build number - */ - public ServerVersion(int major, int minor, int patch, Integer build) { - this.major = major; - this.minor = minor; - this.patch = patch; - this.build = build; - } - - /** - * Get the major version number - * - * @return The major version number - */ - public int getMajor() { - return major; - } - - /** - * Get the minor version number - * - * @return The minor version number - */ - public int getMinor() { - return minor; - } - - /** - * Get the patch version number - * - * @return The patch version number - */ - public int getPatch() { - return patch; - } - - /** - * Get the build number - * - * @return The build number, or null if not set - */ - public Integer getBuild() { - return build; - } - - @Override - public int compareTo(ServerVersion other) { - return COMPARATOR.compare(this, other); - } - - /** - * Convert version to string. Format is "[major].[minor].[patch].[build]". - * [build] is omitted if null. - * - * @return The formatted version string - */ - @Override - public String toString() { - if (build != null) { - return String.format("%d.%d.%d.%d", major, minor, patch, build); - } else { - return String.format("%d.%d.%d", major, minor, patch); - } - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - - ServerVersion that = (ServerVersion) o; - return major == that.major && minor == that.minor && patch == that.patch && Objects.equals(build, that.build); - } - - @Override - public int hashCode() { - return Objects.hash(major, minor, patch, build); - } - - /** - * Create an instance of ServerVersion from a string. The string must be in the format - * "^\d+\.\d+\.\d+(?:\.\d+)?$". Example: 1.0.0, 10.6.4 or 10.7.0.0 - * - * @param str The version string to parse - * @return A ServerVersion instance, or null if the string couldn't be parsed - */ - public static ServerVersion fromString(String str) { - if (str == null || !VERSION_PATTERN.matcher(str).matches()) { - return null; - } - - String[] parts = str.split("\\."); - - try { - int major = Integer.parseInt(parts[0]); - int minor = Integer.parseInt(parts[1]); - int patch = Integer.parseInt(parts[2]); - Integer build = parts.length > 3 ? Integer.parseInt(parts[3]) : null; - - return new ServerVersion(major, minor, patch, build); - } catch (NumberFormatException e) { - return null; - } - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ClientScanTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ClientScanTask.java new file mode 100644 index 0000000000000..a1772401c157f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ClientScanTask.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.handler.tasks; + +import java.util.List; +import java.util.UUID; +import java.util.function.Consumer; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.jellyfin.internal.api.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.current.DevicesApi; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.DeviceInfoDto; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.DeviceInfoDtoQueryResult; +import org.openhab.binding.jellyfin.internal.types.ExceptionHandlerType; + +/** + * Task for scanning connected client devices on the Jellyfin server + * + * @author Patrik Gfeller - Initial contribution + */ +@NonNullByDefault +public class ClientScanTask implements Runnable { + + private final Consumer> devicesHandler; + private final ExceptionHandlerType exceptionHandler; + private final ApiClient client; + private final UUID userId; + + /** + * Create a new ClientScanTask to scan for connected clients + * + * @param client The API client to use for the scan + * @param userId The user ID to filter clients by + * @param devicesHandler The handler that will process the list of discovered devices + * @param exceptionHandler The handler that will handle any exceptions that occur + */ + public ClientScanTask(ApiClient client, UUID userId, Consumer> devicesHandler, + ExceptionHandlerType exceptionHandler) { + this.devicesHandler = devicesHandler; + this.exceptionHandler = exceptionHandler; + this.client = client; + this.userId = userId; + } + + @Override + public void run() { + try { + var devicesApi = new DevicesApi(client); + DeviceInfoDtoQueryResult devices = devicesApi.getDevices(userId); + + this.devicesHandler.accept(devices.getItems()); + } catch (Exception e) { + this.exceptionHandler.handle(e); + } + } +} \ No newline at end of file From 4ab996f841af8a4bd6e8b073eea7f7526af76d6c Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sun, 28 Sep 2025 17:31:33 +0200 Subject: [PATCH 11/38] =?UTF-8?q?=E2=9C=A8=20feat(jellyfin):=20add=20Users?= =?UTF-8?q?ListTask=20for=20server=20compatibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds a new UsersListTask class that uses direct HTTP requests to retrieve user information from Jellyfin servers. The implementation ensures compatibility with Jellyfin server versions newer than 10.8 by using a more generic approach to fetch user data. Part of the effort to add support for newer Jellyfin server versions as described in issue #17674. Signed-off-by: Patrik Gfeller --- .../internal/handler/tasks/UsersListTask.java | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UsersListTask.java diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UsersListTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UsersListTask.java new file mode 100644 index 0000000000000..9db5b44dc3394 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UsersListTask.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.handler.tasks; + +import java.io.IOException; +import java.net.URI; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.jellyfin.internal.api.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.ApiException; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UserDto; +import org.openhab.binding.jellyfin.internal.types.ExceptionHandlerType; + +import com.fasterxml.jackson.core.type.TypeReference; + +/** + * Task for retrieving available users from the Jellyfin server + * + * @author Patrik Gfeller - Initial contribution + */ +@NonNullByDefault +public class UsersListTask implements Runnable { + + private final Consumer> usersHandler; + private final ExceptionHandlerType exceptionHandler; + private final ApiClient client; + + /** + * Create a new UsersListTask to retrieve information about available users + * + * @param client The API client to use for the request + * @param usersHandler The handler that will process the list of retrieved users + * @param exceptionHandler The handler that will handle any exceptions that occur + */ + public UsersListTask(ApiClient client, Consumer> usersHandler, + ExceptionHandlerType exceptionHandler) { + this.usersHandler = usersHandler; + this.exceptionHandler = exceptionHandler; + this.client = client; + } + + @Override + public void run() { + try { + // Since we couldn't find a direct method in the API, we'll use a direct HTTP request + // to the /Users endpoint which returns a list of users + HttpRequest request = HttpRequest.newBuilder() + .uri(URI.create(client.getBaseUri() + "/Users")) + .header("Accept", "application/json") + .GET() + .build(); + + HttpResponse response = client.getHttpClient() + .send(request, HttpResponse.BodyHandlers.ofString()); + + if (response.statusCode() != 200) { + throw new ApiException(response.statusCode(), "Failed to retrieve users: " + response.body()); + } + + // Parse the response into a list of UserDto objects + List users = client.getObjectMapper().readValue(response.body(), + new TypeReference>() {}); + + // Pass the result to the handler + this.usersHandler.accept(users); + } catch (IOException | InterruptedException e) { + this.exceptionHandler.handle(e); + } catch (Exception e) { + this.exceptionHandler.handle(e); + } + } +} \ No newline at end of file From 54b49d7bef27bb7ed02e83551a0e9d2910d3e498 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sun, 28 Sep 2025 18:06:52 +0200 Subject: [PATCH 12/38] =?UTF-8?q?=E2=9C=A8=20feat(jellyfin):=20implement?= =?UTF-8?q?=20task=20framework=20for=20server=20communication?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change refactors the binding to use a more flexible and extensible task framework for server communication. The implementation includes: - Add AbstractTask base class for all scheduled operations - Implement TaskFactory for creating various task instances - Refactor ConnectionTask to extend AbstractTask - Add placeholder tasks for registration and update operations - Update class diagram in CONTRIBUTION.md to reflect new architecture - Improve ServerHandler to use the new task framework The new task framework will simplify adding support for server versions greater than 10.8 by providing a consistent approach to API operations. Related to: #17674 Signed-off-by: Patrik Gfeller Signed-off-by: Patrik Gfeller --- .../CONTRIBUTION.md | 63 +++++++++++++++-- .../internal/handler/ServerHandler.java | 70 ++++++++----------- .../internal/handler/tasks/AbstractTask.java | 69 ++++++++++++++++++ .../handler/tasks/ConnectionTask.java | 20 +++++- .../handler/tasks/RegistrationTask.java | 62 ++++++++++++++++ .../internal/handler/tasks/TaskFactory.java | 64 +++++++++++++++++ .../internal/handler/tasks/UpdateTask.java | 62 ++++++++++++++++ 7 files changed, 365 insertions(+), 45 deletions(-) create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/AbstractTask.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/RegistrationTask.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UpdateTask.java diff --git a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md index a3abf0e4132dc..1a02e8e440be6 100644 --- a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md +++ b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md @@ -8,20 +8,31 @@ The following diagram shows the main classes and their relationships within the ```mermaid classDiagram + %% Class inheritance relationships HandlerFactory <|-- BaseThingHandlerFactory ServerHandler <|-- BaseBridgeHandler ServerDiscoveryService <|-- AbstractDiscoveryService ExceptionHandler ..|> ExceptionHandlerType + AbstractTask <|-- ConnectionTask + AbstractTask <|-- RegistrationTask + AbstractTask <|-- UpdateTask + AbstractTask <|-- UsersListTask + AbstractTask <|-- ClientScanTask + ApiClient <|-- org.openhab.binding.jellyfin.internal.api.generated.ApiClient + %% Class dependencies and usage relationships HandlerFactory --> ApiClientFactory : uses ServerHandler --> ApiClient : uses ServerHandler --> ExceptionHandler : uses ServerHandler --> Configuration : uses + ServerHandler --> TaskFactory : uses + TaskFactory ..> AbstractTask : creates ServerDiscoveryService --> ServerDiscovery : uses ServerDiscovery ..> ServerDiscoveryResult : creates ApiClientFactory ..> ApiClient : creates HandlerFactory ..> ServerHandler : creates + %% Class definitions with key attributes and methods class HandlerFactory { -ApiClientFactory apiClientFactory +supportsThingType(ThingTypeUID) boolean @@ -33,6 +44,7 @@ classDiagram -ExceptionHandler exceptionHandler -ApiClient apiClient -Configuration configuration + -Map~String,ScheduledFuture~ scheduledTasks +initialize() +handleCommand() +dispose() @@ -44,17 +56,39 @@ classDiagram class ApiClient { +authenticateWithToken(String) + +updateBaseUri(String) } class ServerDiscoveryService { -Logger logger + -ServerDiscovery serverDiscovery +startScan() } class ServerDiscovery { + -int port + -int timeout +discoverServers() List } + class AbstractTask { + <> + -String id + -int startupDelay + -int interval + +getId() String + +getStartupDelay() int + +getInterval() int + +run() + } + + class TaskFactory { + <> + +createConnectionTask(ApiClient, Consumer, ExceptionHandlerType) ConnectionTask + +createRegistrationTask(ApiClient, ExceptionHandlerType) RegistrationTask + +createUpdateTask(ApiClient, ExceptionHandlerType) UpdateTask + } + class ExceptionHandlerType { <> +handle(Exception) @@ -68,6 +102,14 @@ classDiagram +String hostname +int port +boolean ssl + +String path + } + + class BindingConfiguration { + +int discoveryPort + +int discoveryTimeout + +String discoveryMessage + +static getConfiguration(ConfigurationAdmin) BindingConfiguration } ``` @@ -75,10 +117,23 @@ classDiagram 1. **HandlerFactory**: Creates thing handlers for the binding. 2. **ServerHandler**: Main bridge handler for Jellyfin servers. -3. **ApiClientFactory**: Creates API client instances. -4. **ApiClient**: Handles communication with the Jellyfin server. -5. **ServerDiscoveryService**: Discovers Jellyfin servers on the network. -6. **ExceptionHandler**: Handles exceptions that occur during binding operation. +3. **ApiClientFactory**: Creates API client instances for different API versions. +4. **ApiClient**: Handles communication with the Jellyfin server and manages authentication. +5. **ServerDiscoveryService**: Discovers Jellyfin servers on the network using UDP broadcasts. +6. **TaskFactory**: Creates various task instances used for server communication. +7. **AbstractTask**: Base class for all tasks that can be scheduled for execution. +8. **BindingConfiguration**: Contains configuration settings for the binding. +9. **ExceptionHandler**: Handles exceptions that occur during binding operation. + +## API Version Support + +The Jellyfin binding is designed to work with multiple server API versions. +The current implementation supports: + +1. **Current API**: For Jellyfin server versions 10.9.0 and newer (including 10.10.x) + +The API client code is automatically generated from the OpenAPI specifications using the OpenAPI Generator. +This approach allows for easier adaptation to API changes and better maintainability compared to using external SDKs. ## Development Workflow diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index a99479c4dda3b..a29e005328161 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -25,7 +25,9 @@ import org.openhab.binding.jellyfin.internal.api.ApiClient; import org.openhab.binding.jellyfin.internal.api.generated.current.model.SystemInfo; import org.openhab.binding.jellyfin.internal.exceptions.ExceptionHandler; +import org.openhab.binding.jellyfin.internal.handler.tasks.AbstractTask; import org.openhab.binding.jellyfin.internal.handler.tasks.ConnectionTask; +import org.openhab.binding.jellyfin.internal.handler.tasks.TaskFactory; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.ThingStatus; @@ -52,18 +54,7 @@ public class ServerHandler extends BaseBridgeHandler { private final ApiClient apiClient; private final Configuration configuration; - Map> tasks = new HashMap<>(); - - private static class TASKS { - public static final String CONNECT = "Connect"; - public static final String REGISTER = "Registration"; - public static final String POLL = "Update"; - - public static Map delays = Map.ofEntries(Map.entry(TASKS.CONNECT, 0), - Map.entry(TASKS.REGISTER, 5), Map.entry(TASKS.POLL, 10)); - public static Map intervals = Map.ofEntries(Map.entry(TASKS.CONNECT, 10), - Map.entry(TASKS.REGISTER, 1), Map.entry(TASKS.POLL, 10)); - } + Map> scheduledTasks = new HashMap<>(); public ServerHandler(Bridge bridge, ApiClient apiClient) { super(bridge); @@ -129,29 +120,30 @@ private synchronized Runnable initializeHandler() { } private synchronized void startTasks() { - String taskId = TASKS.CONNECT; - Runnable task = null; - - long delay = TASKS.delays.get(taskId); - long interval = TASKS.intervals.get(taskId); - - this.logger.trace("startTasks - [{}, delay: {}s, interval: {}s]", taskId, delay, interval); - Configuration config = this.getConfigAs(Configuration.class); this.apiClient.authenticateWithToken(config.token); - switch (taskId) { - case TASKS.CONNECT -> { - task = new ConnectionTask(this.apiClient, systemInfo -> this.handleConnection(systemInfo), - this.exceptionHandler); - break; - } - } - - if (task != null) { - logger.info("Starting task [{}]", taskId); - this.tasks.put(taskId, this.executeTask(task, delay, interval)); - } + // Create and start the connection task + AbstractTask connectionTask = TaskFactory.createConnectionTask( + this.apiClient, + systemInfo -> this.handleConnection(systemInfo), + this.exceptionHandler + ); + + startTask(connectionTask); + + // Additional tasks can be started here in the future + } + + private synchronized void startTask(AbstractTask task) { + String taskId = task.getId(); + int delay = task.getStartupDelay(); + int interval = task.getInterval(); + + this.logger.trace("Starting task [{}] with delay: {}s, interval: {}s", taskId, delay, interval); + logger.info("Starting task [{}]", taskId); + + this.scheduledTasks.put(taskId, this.scheduleTask(task, delay, interval)); } private Object handleConnection(SystemInfo systemInfo) { @@ -185,21 +177,21 @@ private Object handleConnection(SystemInfo systemInfo) { } private synchronized void stopTasks() { - logger.info("Stopping {} task(s): {}", this.tasks.values().size(), String.join(",", this.tasks.keySet())); + logger.info("Stopping {} task(s): {}", this.scheduledTasks.values().size(), String.join(",", this.scheduledTasks.keySet())); - this.tasks.values().forEach(task -> this.stopTask(task)); - this.tasks.clear(); + this.scheduledTasks.values().forEach(this::stopScheduledTask); + this.scheduledTasks.clear(); } - private synchronized void stopTask(@Nullable ScheduledFuture task) { - if (task == null || task.isCancelled() || task.isDone()) { + private synchronized void stopScheduledTask(@Nullable ScheduledFuture scheduledTask) { + if (scheduledTask == null || scheduledTask.isCancelled() || scheduledTask.isDone()) { return; } - task.cancel(true); + scheduledTask.cancel(true); } - private @Nullable ScheduledFuture executeTask(Runnable task, long initialDelay, long interval) { + private @Nullable ScheduledFuture scheduleTask(Runnable task, long initialDelay, long interval) { return scheduler.scheduleWithFixedDelay(task, initialDelay, interval, TimeUnit.SECONDS); } } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/AbstractTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/AbstractTask.java new file mode 100644 index 0000000000000..f0f672395ad1b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/AbstractTask.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.handler.tasks; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * Abstract base class for all tasks used in the Jellyfin binding. + * Tasks are runnable operations that can be scheduled for execution. + * + * @author Patrik Gfeller - Initial contribution + */ +@NonNullByDefault +public abstract class AbstractTask implements Runnable { + + private final String id; + private final int startupDelay; + private final int interval; + + /** + * Creates a new task with the specified parameters. + * + * @param id The unique identifier of the task + * @param startupDelay The initial delay in seconds before the first execution + * @param interval The interval in seconds between successive executions + */ + protected AbstractTask(String id, int startupDelay, int interval) { + this.id = id; + this.startupDelay = startupDelay; + this.interval = interval; + } + + /** + * Gets the unique identifier of the task. + * + * @return The task identifier + */ + public String getId() { + return id; + } + + /** + * Gets the initial delay in seconds before the first execution of this task. + * + * @return The startup delay in seconds + */ + public int getStartupDelay() { + return startupDelay; + } + + /** + * Gets the interval in seconds between successive executions of this task. + * + * @return The interval in seconds + */ + public int getInterval() { + return interval; + } +} \ No newline at end of file diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ConnectionTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ConnectionTask.java index 2ec13063b4930..8860299010b98 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ConnectionTask.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ConnectionTask.java @@ -20,21 +20,37 @@ import org.openhab.binding.jellyfin.internal.types.ExceptionHandlerType; /** + * A task that establishes a connection to the Jellyfin server and retrieves system information. + * * @author Patrik Gfeller - Initial contribution */ @NonNullByDefault -public class ConnectionTask implements Runnable { +public class ConnectionTask extends AbstractTask { + + /** Task ID for the connection task */ + public static final String TASK_ID = "Connect"; + /** Default startup delay for the connection task in seconds */ + public static final int DEFAULT_STARTUP_DELAY = 0; + /** Default interval for the connection task in seconds */ + public static final int DEFAULT_INTERVAL = 10; private final Consumer acceptedHandler; private final ExceptionHandlerType exceptionHandler; private final ApiClient client; + /** + * Creates a new connection task with default startup delay and interval. + * + * @param client The API client to use for the connection + * @param connectionHandler The handler for the retrieved system info + * @param exceptionHandler The handler for exceptions + */ public ConnectionTask(ApiClient client, Consumer connectionHandler, ExceptionHandlerType exceptionHandler) { + super(TASK_ID, DEFAULT_STARTUP_DELAY, DEFAULT_INTERVAL); this.acceptedHandler = connectionHandler; this.exceptionHandler = exceptionHandler; - this.client = client; } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/RegistrationTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/RegistrationTask.java new file mode 100644 index 0000000000000..0aeff936ef7e0 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/RegistrationTask.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.handler.tasks; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.jellyfin.internal.api.ApiClient; +import org.openhab.binding.jellyfin.internal.types.ExceptionHandlerType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Task for handling registration with the Jellyfin server. + * This is a placeholder for future implementation. + * + * @author Patrik Gfeller - Initial contribution + */ +@NonNullByDefault +public class RegistrationTask extends AbstractTask { + + /** Task ID for the registration task */ + public static final String TASK_ID = "Registration"; + /** Default startup delay for the registration task in seconds */ + public static final int DEFAULT_STARTUP_DELAY = 5; + /** Default interval for the registration task in seconds */ + public static final int DEFAULT_INTERVAL = 1; + + private final Logger logger = LoggerFactory.getLogger(RegistrationTask.class); + private final ApiClient client; + private final ExceptionHandlerType exceptionHandler; + + /** + * Creates a new registration task with default startup delay and interval. + * + * @param client The API client to use for registration + * @param exceptionHandler The handler for exceptions + */ + public RegistrationTask(ApiClient client, ExceptionHandlerType exceptionHandler) { + super(TASK_ID, DEFAULT_STARTUP_DELAY, DEFAULT_INTERVAL); + this.client = client; + this.exceptionHandler = exceptionHandler; + } + + @Override + public void run() { + try { + // TODO: Implement registration logic in future + logger.debug("Registration task not implemented yet"); + } catch (Exception e) { + this.exceptionHandler.handle(e); + } + } +} \ No newline at end of file diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java new file mode 100644 index 0000000000000..7a138d3a644ad --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.handler.tasks; + +import java.util.function.Consumer; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.jellyfin.internal.api.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SystemInfo; +import org.openhab.binding.jellyfin.internal.types.ExceptionHandlerType; + +/** + * Factory for creating tasks used in the Jellyfin binding. + * + * @author Patrik Gfeller - Initial contribution + */ +@NonNullByDefault +public class TaskFactory { + + /** + * Creates a connection task with the specified parameters. + * + * @param client The API client to use for the connection + * @param connectionHandler The handler for the retrieved system info + * @param exceptionHandler The handler for exceptions + * @return A configured connection task + */ + public static ConnectionTask createConnectionTask(ApiClient client, Consumer connectionHandler, + ExceptionHandlerType exceptionHandler) { + return new ConnectionTask(client, connectionHandler, exceptionHandler); + } + + /** + * Creates a registration task with the specified parameters. + * + * @param client The API client to use for registration + * @param exceptionHandler The handler for exceptions + * @return A configured registration task + */ + public static RegistrationTask createRegistrationTask(ApiClient client, ExceptionHandlerType exceptionHandler) { + return new RegistrationTask(client, exceptionHandler); + } + + /** + * Creates an update task with the specified parameters. + * + * @param client The API client to use for updates + * @param exceptionHandler The handler for exceptions + * @return A configured update task + */ + public static UpdateTask createUpdateTask(ApiClient client, ExceptionHandlerType exceptionHandler) { + return new UpdateTask(client, exceptionHandler); + } +} \ No newline at end of file diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UpdateTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UpdateTask.java new file mode 100644 index 0000000000000..708c373ef8cec --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UpdateTask.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.handler.tasks; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.jellyfin.internal.api.ApiClient; +import org.openhab.binding.jellyfin.internal.types.ExceptionHandlerType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Task for polling and updating data from the Jellyfin server. + * This is a placeholder for future implementation. + * + * @author Patrik Gfeller - Initial contribution + */ +@NonNullByDefault +public class UpdateTask extends AbstractTask { + + /** Task ID for the update task */ + public static final String TASK_ID = "Update"; + /** Default startup delay for the update task in seconds */ + public static final int DEFAULT_STARTUP_DELAY = 10; + /** Default interval for the update task in seconds */ + public static final int DEFAULT_INTERVAL = 10; + + private final Logger logger = LoggerFactory.getLogger(UpdateTask.class); + private final ApiClient client; + private final ExceptionHandlerType exceptionHandler; + + /** + * Creates a new update task with default startup delay and interval. + * + * @param client The API client to use for updates + * @param exceptionHandler The handler for exceptions + */ + public UpdateTask(ApiClient client, ExceptionHandlerType exceptionHandler) { + super(TASK_ID, DEFAULT_STARTUP_DELAY, DEFAULT_INTERVAL); + this.client = client; + this.exceptionHandler = exceptionHandler; + } + + @Override + public void run() { + try { + // TODO: Implement polling/update logic in future + logger.debug("Update task not implemented yet"); + } catch (Exception e) { + this.exceptionHandler.handle(e); + } + } +} \ No newline at end of file From 14820600e7c2a4dd31adb70a80081e1ae4e0739e Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Mon, 29 Sep 2025 21:31:48 +0200 Subject: [PATCH 13/38] =?UTF-8?q?=E2=9C=A8=20feat(jellyfin):=20add=20suppo?= =?UTF-8?q?rt=20for=20server=20versions=20>=2010.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Jellyfin binding has been updated to support newer server versions (10.10.x) while dropping support for older versions. Key changes: - Add minimum supported version check (10.10.7) in discovery service - Implement robust version parsing with handling for non-standard formats - Update documentation to reflect new version requirements - Improve code formatting and consistency across classes Fixes: #17674 Signed-off-by: Patrik Gfeller --- .../org.openhab.binding.jellyfin/README.md | 5 +- .../discovery/ServerDiscoveryService.java | 109 +++++++++++++++--- .../internal/handler/ServerHandler.java | 21 ++-- .../internal/handler/tasks/AbstractTask.java | 2 +- .../handler/tasks/ClientScanTask.java | 4 +- .../handler/tasks/RegistrationTask.java | 4 +- .../internal/handler/tasks/TaskFactory.java | 6 +- .../internal/handler/tasks/UpdateTask.java | 4 +- .../internal/handler/tasks/UsersListTask.java | 23 ++-- 9 files changed, 128 insertions(+), 50 deletions(-) diff --git a/bundles/org.openhab.binding.jellyfin/README.md b/bundles/org.openhab.binding.jellyfin/README.md index 5bf5e531b735d..72fc6f1a47e5a 100644 --- a/bundles/org.openhab.binding.jellyfin/README.md +++ b/bundles/org.openhab.binding.jellyfin/README.md @@ -1,8 +1,9 @@ # Jellyfin Binding This is the binding for [Jellyfin](https://jellyfin.org), the volunteer built media solution that puts you in control of your media. -This binding allows you to connect to Jellyfin clients that supports remote control, it's built on top of the official Jellyfin Kotlin SDK. -It is compatible with Jellyfin servers from version `10.8.1`, recommended is `10.8.13`. +This binding allows you to interact with Jellyfin clients that supports remote control. +It is compatible and test with Jellyfin servers from version `10.10.7`. +Earlier versions use a different API and are not supported. ## Binding - Configuration diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java index 157d3744820b2..59feb5eb5791a 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java @@ -47,8 +47,9 @@ public class ServerDiscoveryService extends AbstractDiscoveryService { private static final int DEFAULT_SCAN_TIMEOUT_SECONDS = 60; // Timeout for discovery scan in seconds private static final boolean DEFAULT_BACKGROUND_SCAN = false; // Disable background scan + private static final String MIN_SUPPORTED_VERSION = "10.10.7"; // Minimum supported server version - private final Logger logger = LoggerFactory.getLogger(ServerDiscoveryService.class); + private static final Logger LOG = LoggerFactory.getLogger(ServerDiscoveryService.class); private final ConfigurationAdmin configurationService; @Activate @@ -67,25 +68,32 @@ protected synchronized void startScan() { List servers = discoverer.discoverServers(); if (!servers.isEmpty()) { - servers.parallelStream().forEach(server -> { - logger.debug("Server {} @ {}", server.getName(), server.getAddress()); + for (ServerDiscoveryResult server : servers) { + LOG.debug("Server {} @ {}", server.getName(), server.getAddress()); var uid = new ThingUID(Constants.THING_TYPE_SERVER, server.getId()); try { var properties = this.getProperties(server); - var resultBuilder = DiscoveryResultBuilder.create(uid).withProperties(properties) - .withRepresentationProperty(Thing.PROPERTY_SERIAL_NUMBER).withLabel(server.getName()) - .withTTL(Constants.DISCOVERY_RESULT_TTL_SEC); - - var result = resultBuilder.build(); - - this.thingDiscovered(result); + var version = properties.get(Thing.PROPERTY_FIRMWARE_VERSION).toString(); + if (this.isVersionSupported(version)) { + var resultBuilder = DiscoveryResultBuilder.create(uid).withProperties(properties) + .withRepresentationProperty(Thing.PROPERTY_SERIAL_NUMBER).withLabel(server.getName()) + .withTTL(Constants.DISCOVERY_RESULT_TTL_SEC); + + var result = resultBuilder.build(); + + this.thingDiscovered(result); + } else { + LOG.info("Discovered server {} @ {} will be ignored. Version {} is not supported.", + server.getName(), server.getAddress(), version); + } } catch (Exception e) { - logger.warn("Failed to retrieve system info from Jellyfin server at {}: {}", server.getAddress(), + LOG.warn("Failed to retrieve system info from Jellyfin server at {}: {}", server.getAddress(), e.getMessage()); - logger.info("Discovered server {} @ {} will be ignored.", server.getName(), server.getAddress()); + LOG.info("Discovered server {} @ {} will be ignored.", server.getName(), server.getAddress()); + } - }); + } } } @@ -114,4 +122,79 @@ private Map getProperties(ServerDiscoveryResult server) throws A return properties; } + + /** + * Check if the provided version is equal to or newer than the minimum supported version (10.10.7). + *

+ * If the version string is empty or cannot be parsed as a semantic version, this method will assume the version is + * supported. + * This non-standard behavior is intended to avoid false negatives due to unexpected version formats. + * + * @param version The version string to check + * @return true if the version is equal to or newer than 10.10.7, or if parsing fails; false otherwise + */ + private boolean isVersionSupported(String version) { + if (version == null || version.isEmpty()) { + LOG.warn("Empty version string provided, assuming supported version"); + return true; + } + + try { + // Split version strings into components + String[] currentParts = version.split("\\."); + String[] minParts = MIN_SUPPORTED_VERSION.split("\\."); + + // Parse major version + int currentMajor = currentParts.length > 0 ? parseVersionComponent(currentParts[0]) : 0; + int minMajor = minParts.length > 0 ? Integer.parseInt(minParts[0]) : 0; + + if (currentMajor > minMajor) { + return true; + } else if (currentMajor < minMajor) { + return false; + } + + // Parse minor version + int currentMinor = currentParts.length > 1 ? parseVersionComponent(currentParts[1]) : 0; + int minMinor = minParts.length > 1 ? Integer.parseInt(minParts[1]) : 0; + + if (currentMinor > minMinor) { + return true; + } else if (currentMinor < minMinor) { + return false; + } + + // Parse patch version + int currentPatch = currentParts.length > 2 ? parseVersionComponent(currentParts[2]) : 0; + int minPatch = minParts.length > 2 ? Integer.parseInt(minParts[2]) : 0; + + return currentPatch >= minPatch; + } catch (NumberFormatException e) { + LOG.warn("Failed to parse version '{}' as semantic version: {}. Assuming supported version.", version, + e.getMessage()); + return true; + } + } + + /** + * Parse a version component, handling non-numeric suffixes. + * For example, "8-beta" would return 8. + * + * @param component The version component to parse + * @return The numeric part as an integer + * @throws NumberFormatException If parsing fails + */ + private int parseVersionComponent(String component) { + // Extract numeric part before any non-numeric character + int endIndex = 0; + while (endIndex < component.length() && Character.isDigit(component.charAt(endIndex))) { + endIndex++; + } + + if (endIndex == 0) { + throw new NumberFormatException("No numeric part in version component: " + component); + } + + return Integer.parseInt(component.substring(0, endIndex)); + } } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index a29e005328161..8c62ac14aafbd 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -26,7 +26,6 @@ import org.openhab.binding.jellyfin.internal.api.generated.current.model.SystemInfo; import org.openhab.binding.jellyfin.internal.exceptions.ExceptionHandler; import org.openhab.binding.jellyfin.internal.handler.tasks.AbstractTask; -import org.openhab.binding.jellyfin.internal.handler.tasks.ConnectionTask; import org.openhab.binding.jellyfin.internal.handler.tasks.TaskFactory; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.ChannelUID; @@ -124,25 +123,22 @@ private synchronized void startTasks() { this.apiClient.authenticateWithToken(config.token); // Create and start the connection task - AbstractTask connectionTask = TaskFactory.createConnectionTask( - this.apiClient, - systemInfo -> this.handleConnection(systemInfo), - this.exceptionHandler - ); - + AbstractTask connectionTask = TaskFactory.createConnectionTask(this.apiClient, + systemInfo -> this.handleConnection(systemInfo), this.exceptionHandler); + startTask(connectionTask); - + // Additional tasks can be started here in the future } - + private synchronized void startTask(AbstractTask task) { String taskId = task.getId(); int delay = task.getStartupDelay(); int interval = task.getInterval(); - + this.logger.trace("Starting task [{}] with delay: {}s, interval: {}s", taskId, delay, interval); logger.info("Starting task [{}]", taskId); - + this.scheduledTasks.put(taskId, this.scheduleTask(task, delay, interval)); } @@ -177,7 +173,8 @@ private Object handleConnection(SystemInfo systemInfo) { } private synchronized void stopTasks() { - logger.info("Stopping {} task(s): {}", this.scheduledTasks.values().size(), String.join(",", this.scheduledTasks.keySet())); + logger.info("Stopping {} task(s): {}", this.scheduledTasks.values().size(), + String.join(",", this.scheduledTasks.keySet())); this.scheduledTasks.values().forEach(this::stopScheduledTask); this.scheduledTasks.clear(); diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/AbstractTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/AbstractTask.java index f0f672395ad1b..cef3610ded5a4 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/AbstractTask.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/AbstractTask.java @@ -66,4 +66,4 @@ public int getStartupDelay() { public int getInterval() { return interval; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ClientScanTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ClientScanTask.java index a1772401c157f..71217a0312e41 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ClientScanTask.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ClientScanTask.java @@ -57,10 +57,10 @@ public void run() { try { var devicesApi = new DevicesApi(client); DeviceInfoDtoQueryResult devices = devicesApi.getDevices(userId); - + this.devicesHandler.accept(devices.getItems()); } catch (Exception e) { this.exceptionHandler.handle(e); } } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/RegistrationTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/RegistrationTask.java index 0aeff936ef7e0..ca507c734d096 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/RegistrationTask.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/RegistrationTask.java @@ -33,7 +33,7 @@ public class RegistrationTask extends AbstractTask { public static final int DEFAULT_STARTUP_DELAY = 5; /** Default interval for the registration task in seconds */ public static final int DEFAULT_INTERVAL = 1; - + private final Logger logger = LoggerFactory.getLogger(RegistrationTask.class); private final ApiClient client; private final ExceptionHandlerType exceptionHandler; @@ -59,4 +59,4 @@ public void run() { this.exceptionHandler.handle(e); } } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java index 7a138d3a644ad..6ee213bc1e3eb 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java @@ -39,7 +39,7 @@ public static ConnectionTask createConnectionTask(ApiClient client, Consumer response = client.getHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); - HttpResponse response = client.getHttpClient() - .send(request, HttpResponse.BodyHandlers.ofString()); - if (response.statusCode() != 200) { throw new ApiException(response.statusCode(), "Failed to retrieve users: " + response.body()); } - + // Parse the response into a list of UserDto objects - List users = client.getObjectMapper().readValue(response.body(), - new TypeReference>() {}); - + List users = client.getObjectMapper().readValue(response.body(), + new TypeReference>() { + }); + // Pass the result to the handler this.usersHandler.accept(users); } catch (IOException | InterruptedException e) { @@ -84,4 +81,4 @@ public void run() { this.exceptionHandler.handle(e); } } -} \ No newline at end of file +} From 7be41037ef3f04f2c7e24b898ca9249da5065914 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Tue, 30 Sep 2025 19:37:35 +0200 Subject: [PATCH 14/38] =?UTF-8?q?=E2=9C=A8=20feat(jellyfin):=20enhance=20s?= =?UTF-8?q?erver=20configuration=20handling=20and=20add=20URI-based=20upda?= =?UTF-8?q?tes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrik Gfeller --- .../jellyfin/internal/Configuration.java | 25 ++-- .../internal/handler/ServerHandler.java | 115 ++++++++++++------ 2 files changed, 95 insertions(+), 45 deletions(-) diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Configuration.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Configuration.java index ffc85605cb569..04ec973c4c447 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Configuration.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Configuration.java @@ -12,8 +12,10 @@ */ package org.openhab.binding.jellyfin.internal; +import java.net.URI; +import java.net.URISyntaxException; + import org.eclipse.jdt.annotation.NonNullByDefault; -import org.openhab.core.thing.Thing; /** * The {@link Configuration} class contains fields mapping thing configuration parameters. @@ -57,18 +59,19 @@ public class Configuration { public String userId = ""; /** - * Checks if a configuration exists for the given thing. + * Creates a URI from the configuration information stored in this instance. + * This URI can be used with the API client. * - * @param thing the thing to check the configuration for - * @return true if the configuration is complete, false otherwise + * @return The server URI with scheme, host, port, and path + * @throws URISyntaxException if there is an issue constructing the URI */ - public static boolean configurationExists(Thing thing) { - Configuration config = thing.getConfiguration().as(Configuration.class); - return config != null && !config.hostname.isEmpty(); - } + public URI getServerURI() throws URISyntaxException { + String scheme = ssl ? "https" : "http"; + String cleanPath = path.isEmpty() ? "" : (path.startsWith("/") ? path : "/" + path); - public static boolean tokenExists(Thing thing) { - Configuration config = thing.getConfiguration().as(Configuration.class); - return config != null && !config.token.isEmpty(); + return new URI(scheme, null, // userInfo + hostname, port, cleanPath, null, // query + null // fragment + ); } } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index 8c62ac14aafbd..a52c694ce6749 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -53,7 +53,7 @@ public class ServerHandler extends BaseBridgeHandler { private final ApiClient apiClient; private final Configuration configuration; - Map> scheduledTasks = new HashMap<>(); + private Map> scheduledTasks = new HashMap<>(); public ServerHandler(Bridge bridge, ApiClient apiClient) { super(bridge); @@ -68,49 +68,38 @@ public void initialize() { try { scheduler.execute(initializeHandler()); } catch (Exception e) { - this.logger.warn("{}", e.getMessage()); + this.logger.warn("Exception during initialization: {}", e.getMessage()); + this.exceptionHandler.handle(e); } } @Override public void handleCommand(ChannelUID channelUID, Command command) { + // No channels on the server bridge require command handling. + // This method is intentionally left blank. } @Override public void dispose() { + // No additional cleanup required super.dispose(); } private synchronized Runnable initializeHandler() { return () -> { try { - if (Configuration.configurationExists(this.getThing())) { - var uriObject = new URI(this.configuration.ssl ? "https" : "http", null, // userInfo - this.configuration.hostname, this.configuration.port, this.configuration.path, null, // query - null // fragment - ); - - var uriString = uriObject.toString(); - - this.apiClient.updateBaseUri(uriString); - } else { - var uriString = thing.getProperties().get(Constants.ServerProperties.SERVER_URI); - var uriObject = new URI(uriString); - - this.configuration.hostname = uriObject.getHost(); - this.configuration.port = uriObject.getPort(); - this.configuration.ssl = "https".equalsIgnoreCase(uriObject.getScheme()); - this.configuration.path = uriObject.getPath(); - - this.apiClient.updateBaseUri(uriString); - + // Initialize discovered server + if (thing.getProperties().containsKey(Constants.ServerProperties.SERVER_URI)) { + updateConfiguration(new URI(thing.getProperties().get(Constants.ServerProperties.SERVER_URI))); thing.getProperties().remove(Constants.ServerProperties.SERVER_URI); + } + URI serverUri = this.configuration.getServerURI(); + this.apiClient.updateBaseUri(serverUri.toString()); - logger.info("Creating initial configuration for discovered server at {}:{}", - this.configuration.hostname, this.configuration.port); + if (this.configuration.token != null && !this.configuration.token.isEmpty()) { + this.apiClient.authenticateWithToken(this.configuration.token); + this.startTasks(); } - this.stopTasks(); - this.startTasks(); } catch (Exception e) { this.logger.error("Error during initialization: {}", e.getMessage(), e); this.exceptionHandler.handle(e); @@ -119,9 +108,6 @@ private synchronized Runnable initializeHandler() { } private synchronized void startTasks() { - Configuration config = this.getConfigAs(Configuration.class); - this.apiClient.authenticateWithToken(config.token); - // Create and start the connection task AbstractTask connectionTask = TaskFactory.createConnectionTask(this.apiClient, systemInfo -> this.handleConnection(systemInfo), this.exceptionHandler); @@ -153,15 +139,13 @@ private Object handleConnection(SystemInfo systemInfo) { this.thing.getProperties().put(Constants.ServerProperties.SERVER_VERSION, systemInfo.getVersion()); logger.info(" Product Name: {}", systemInfo.getProductName()); - // Note: getOperatingSystem() is deprecated but still available for logging - @SuppressWarnings("deprecation") - String operatingSystem = systemInfo.getOperatingSystem(); - logger.info(" Operating System: {}", operatingSystem); - logger.info(" Server ID: {}", systemInfo.getId()); logger.info(" Startup Wizard Completed: {}", systemInfo.getStartupWizardCompleted()); logger.info(" Web Socket Port: {}", systemInfo.getWebSocketPortNumber()); + // Update configuration with systemInfo data if available + this.updateConfiguration(systemInfo); + ThingStatusInfo statusInfo = new ThingStatusInfo(ThingStatus.ONLINE, ThingStatusDetail.NONE, ""); this.getThing().setStatusInfo(statusInfo); @@ -191,4 +175,67 @@ private synchronized void stopScheduledTask(@Nullable ScheduledFuture schedul private @Nullable ScheduledFuture scheduleTask(Runnable task, long initialDelay, long interval) { return scheduler.scheduleWithFixedDelay(task, initialDelay, interval, TimeUnit.SECONDS); } + + /** + * Updates configuration from a URI + * + * @param uri The URI containing server information + */ + private void updateConfiguration(URI uri) { + // Track if any config value has changed + boolean configChanged = false; + + // Only update values if they differ from current configuration + if (uri.getHost() != null && !uri.getHost().equals(this.configuration.hostname)) { + this.configuration.hostname = uri.getHost(); + configChanged = true; + } + + if (uri.getPort() > 0 && uri.getPort() != this.configuration.port) { + this.configuration.port = uri.getPort(); + configChanged = true; + } + + if (uri.getScheme() != null) { + boolean newSslValue = "https".equalsIgnoreCase(uri.getScheme()); + if (newSslValue != this.configuration.ssl) { + this.configuration.ssl = newSslValue; + configChanged = true; + } + } + + if (uri.getPath() != null && !uri.getPath().isEmpty() && !uri.getPath().equals(this.configuration.path)) { + this.configuration.path = uri.getPath(); + configChanged = true; + } + + // Only save if something has changed + if (configChanged) { + logger.info("Configuration changed, updating Thing configuration"); + + org.openhab.core.config.core.Configuration config = editConfiguration(); + + config.put("hostname", this.configuration.hostname); + config.put("port", this.configuration.port); + config.put("ssl", this.configuration.ssl); + config.put("path", this.configuration.path); + + updateConfiguration(config); + } else { + logger.debug("No configuration changes needed"); + } + } + + private void updateConfiguration(SystemInfo systemInfo) { + var localAddress = systemInfo.getLocalAddress(); + + if (localAddress != null && !localAddress.isEmpty()) { + try { + updateConfiguration(new URI(localAddress)); + } catch (Exception e) { + logger.debug("Failed to parse local address URI: {}", e.getMessage()); + // Don't use exception handler for debug-level issues + } + } + } } From c816dad498f0e90950401a8d11bc623884440e9a Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Wed, 1 Oct 2025 20:32:57 +0200 Subject: [PATCH 15/38] =?UTF-8?q?=E2=9C=A8=20feat(jellyfin):=20add=20error?= =?UTF-8?q?=20handling=20for=20missing=20access=20token=20and=20update=20c?= =?UTF-8?q?ontribution=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrik Gfeller --- .../CONTRIBUTION.md | 48 +++++++++---------- .../internal/handler/ServerHandler.java | 33 +++++++++++-- .../resources/OH-INF/i18n/jellyfin.properties | 4 ++ .../OH-INF/i18n/jellyfin_it.properties | 3 ++ 4 files changed, 58 insertions(+), 30 deletions(-) diff --git a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md index 1a02e8e440be6..301c2b2cba259 100644 --- a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md +++ b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md @@ -9,16 +9,11 @@ The following diagram shows the main classes and their relationships within the ```mermaid classDiagram %% Class inheritance relationships - HandlerFactory <|-- BaseThingHandlerFactory - ServerHandler <|-- BaseBridgeHandler - ServerDiscoveryService <|-- AbstractDiscoveryService - ExceptionHandler ..|> ExceptionHandlerType AbstractTask <|-- ConnectionTask AbstractTask <|-- RegistrationTask AbstractTask <|-- UpdateTask AbstractTask <|-- UsersListTask AbstractTask <|-- ClientScanTask - ApiClient <|-- org.openhab.binding.jellyfin.internal.api.generated.ApiClient %% Class dependencies and usage relationships HandlerFactory --> ApiClientFactory : uses @@ -26,25 +21,19 @@ classDiagram ServerHandler --> ExceptionHandler : uses ServerHandler --> Configuration : uses ServerHandler --> TaskFactory : uses + ServerDiscoveryService ..> ServerDiscovery : creates + ServerDiscoveryService --> BindingConfiguration : uses TaskFactory ..> AbstractTask : creates - ServerDiscoveryService --> ServerDiscovery : uses ServerDiscovery ..> ServerDiscoveryResult : creates ApiClientFactory ..> ApiClient : creates HandlerFactory ..> ServerHandler : creates %% Class definitions with key attributes and methods class HandlerFactory { - -ApiClientFactory apiClientFactory - +supportsThingType(ThingTypeUID) boolean +createHandler(Thing) ThingHandler } class ServerHandler { - -Logger logger - -ExceptionHandler exceptionHandler - -ApiClient apiClient - -Configuration configuration - -Map~String,ScheduledFuture~ scheduledTasks +initialize() +handleCommand() +dispose() @@ -55,27 +44,25 @@ classDiagram } class ApiClient { + <> +authenticateWithToken(String) +updateBaseUri(String) } class ServerDiscoveryService { - -Logger logger - -ServerDiscovery serverDiscovery +startScan() + -createServerDiscovery() ServerDiscovery } class ServerDiscovery { -int port -int timeout + +ServerDiscovery(int port, int timeout) +discoverServers() List } class AbstractTask { <> - -String id - -int startupDelay - -int interval +getId() String +getStartupDelay() int +getInterval() int @@ -84,14 +71,9 @@ classDiagram class TaskFactory { <> - +createConnectionTask(ApiClient, Consumer, ExceptionHandlerType) ConnectionTask - +createRegistrationTask(ApiClient, ExceptionHandlerType) RegistrationTask - +createUpdateTask(ApiClient, ExceptionHandlerType) UpdateTask - } - - class ExceptionHandlerType { - <> - +handle(Exception) + +createConnectionTask(ApiClient, Consumer, ExceptionHandler) ConnectionTask + +createRegistrationTask(ApiClient, ExceptionHandler) RegistrationTask + +createUpdateTask(ApiClient, ExceptionHandler) UpdateTask } class ExceptionHandler { @@ -103,14 +85,28 @@ classDiagram +int port +boolean ssl +String path + +String token + +getServerURI() URI } class BindingConfiguration { + <> +int discoveryPort +int discoveryTimeout +String discoveryMessage +static getConfiguration(ConfigurationAdmin) BindingConfiguration } + + class ServerDiscoveryResult { + +String id + +String name + +String uri + +String version + } + + class ConnectionTask { + %% Inherits run() from AbstractTask + } ``` ## Key Components diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index a52c694ce6749..be47e049b258a 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -27,6 +27,7 @@ import org.openhab.binding.jellyfin.internal.exceptions.ExceptionHandler; import org.openhab.binding.jellyfin.internal.handler.tasks.AbstractTask; import org.openhab.binding.jellyfin.internal.handler.tasks.TaskFactory; +import org.openhab.binding.jellyfin.internal.i18n.ResourceHelper; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.ThingStatus; @@ -88,17 +89,27 @@ public void dispose() { private synchronized Runnable initializeHandler() { return () -> { try { + URI serverUri = this.configuration.getServerURI(); + // Initialize discovered server if (thing.getProperties().containsKey(Constants.ServerProperties.SERVER_URI)) { - updateConfiguration(new URI(thing.getProperties().get(Constants.ServerProperties.SERVER_URI))); - thing.getProperties().remove(Constants.ServerProperties.SERVER_URI); + serverUri = new URI(thing.getProperties().get(Constants.ServerProperties.SERVER_URI)); + updateConfiguration(serverUri); + } else { + // Add the server URI to the properties for non-discovery results + updateThingProperty(Constants.ServerProperties.SERVER_URI, serverUri.toString()); } - URI serverUri = this.configuration.getServerURI(); + this.apiClient.updateBaseUri(serverUri.toString()); if (this.configuration.token != null && !this.configuration.token.isEmpty()) { this.apiClient.authenticateWithToken(this.configuration.token); this.startTasks(); + } else { + ThingStatusInfo statusInfo = new ThingStatusInfo(ThingStatus.OFFLINE, + ThingStatusDetail.CONFIGURATION_ERROR, + ResourceHelper.getResourceString("error.configuration.no-access-token")); + this.getThing().setStatusInfo(statusInfo); } } catch (Exception e) { this.logger.error("Error during initialization: {}", e.getMessage(), e); @@ -136,7 +147,8 @@ private Object handleConnection(SystemInfo systemInfo) { logger.info(" Local Address: {}", systemInfo.getLocalAddress()); logger.info(" Version: {}", systemInfo.getVersion()); - this.thing.getProperties().put(Constants.ServerProperties.SERVER_VERSION, systemInfo.getVersion()); + // Update properties with server version + updateThingProperty(Constants.ServerProperties.SERVER_VERSION, systemInfo.getVersion()); logger.info(" Product Name: {}", systemInfo.getProductName()); logger.info(" Server ID: {}", systemInfo.getId()); @@ -238,4 +250,17 @@ private void updateConfiguration(SystemInfo systemInfo) { } } } + + /** + * Helper method to update a single Thing property. + * Creates a new properties map with the updated property and calls updateProperties. + * + * @param key The property key + * @param value The property value + */ + private void updateThingProperty(String key, String value) { + Map properties = new HashMap<>(thing.getProperties()); + properties.put(key, value); + updateProperties(properties); + } } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/i18n/jellyfin.properties b/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/i18n/jellyfin.properties index e73210af728a0..b9265e7a271c9 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/i18n/jellyfin.properties +++ b/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/i18n/jellyfin.properties @@ -80,3 +80,7 @@ channel-type.jellyfin.playing-item-type-channel.label = Playing Item Type channel-type.jellyfin.playing-item-type-channel.description = Type of the item currently playing channel-type.jellyfin.send-notification-channel.label = Send Notification channel-type.jellyfin.send-notification-channel.description = Send notification to the client + +# error messages + +error.configuration.no-access-token = No access token configured diff --git a/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/i18n/jellyfin_it.properties b/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/i18n/jellyfin_it.properties index 1adea3f3a4c25..63ba74b79b9af 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/i18n/jellyfin_it.properties +++ b/bundles/org.openhab.binding.jellyfin/src/main/resources/OH-INF/i18n/jellyfin_it.properties @@ -71,3 +71,6 @@ channel-type.jellyfin.playing-item-type-channel.label = Tipo Elemento In Riprodu channel-type.jellyfin.playing-item-type-channel.description = Tipo dell'elemento attualmente in riproduzione channel-type.jellyfin.send-notification-channel.label = Invia Notifica channel-type.jellyfin.send-notification-channel.description = Invia notifica al client + +# error messages +error.configuration.no-access-token = Nessun token di accesso configurato From 0a2272368900bbb566ba05054fe1349f15df1c0f Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Thu, 2 Oct 2025 18:41:37 +0200 Subject: [PATCH 16/38] =?UTF-8?q?=E2=9C=A8=20feat(jellyfin):=20implement?= =?UTF-8?q?=20state=20management=20for=20ServerHandler=20and=20enhance=20i?= =?UTF-8?q?nitialization=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrik Gfeller --- .../internal/handler/ServerHandler.java | 196 ++++++++++++++++-- 1 file changed, 173 insertions(+), 23 deletions(-) diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index be47e049b258a..c4e28489723cb 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -13,6 +13,7 @@ package org.openhab.binding.jellyfin.internal.handler; import java.net.URI; +import java.net.URISyntaxException; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ScheduledFuture; @@ -26,8 +27,8 @@ import org.openhab.binding.jellyfin.internal.api.generated.current.model.SystemInfo; import org.openhab.binding.jellyfin.internal.exceptions.ExceptionHandler; import org.openhab.binding.jellyfin.internal.handler.tasks.AbstractTask; +import org.openhab.binding.jellyfin.internal.handler.tasks.ConnectionTask; import org.openhab.binding.jellyfin.internal.handler.tasks.TaskFactory; -import org.openhab.binding.jellyfin.internal.i18n.ResourceHelper; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.ThingStatus; @@ -49,12 +50,56 @@ */ @NonNullByDefault public class ServerHandler extends BaseBridgeHandler { + + /** + * Enum representing the possible states of the server handler + */ + public enum ServerState { + /** + * Initial state when the handler is created + */ + INITIALIZING, + + /** + * State for a newly discovered server that needs configuration + */ + DISCOVERED, + + /** + * State when server URI is known but no authentication token is available + */ + NEEDS_AUTHENTICATION, + + /** + * State when server is fully configured with URI and token + */ + CONFIGURED, + + /** + * State when server is connected and online + */ + CONNECTED, + + /** + * State when server is in error state + */ + ERROR, + + /** + * State when the handler has been disposed + */ + DISPOSED + } + private final Logger logger = LoggerFactory.getLogger(ServerHandler.class); private final ExceptionHandler exceptionHandler; private final ApiClient apiClient; private final Configuration configuration; - private Map> scheduledTasks = new HashMap<>(); + private ServerState state = ServerState.INITIALIZING; + + private final Map tasks = new HashMap<>(); + private final Map> scheduledTasks = new HashMap<>(); public ServerHandler(Bridge bridge, ApiClient apiClient) { super(bridge); @@ -62,15 +107,78 @@ public ServerHandler(Bridge bridge, ApiClient apiClient) { this.exceptionHandler = new ExceptionHandler(); this.configuration = this.getConfigAs(Configuration.class); this.apiClient = apiClient; + + // Create all tasks in the constructor + this.tasks.put(ConnectionTask.TASK_ID, TaskFactory.createConnectionTask(this.apiClient, + systemInfo -> this.handleConnection(systemInfo), this.exceptionHandler)); + + // Additional tasks can be added here in the future + } + + /** + * Get the current state of the server handler + * + * @return The current state + */ + public ServerState getState() { + return state; + } + + /** + * Set the state of the server handler + * + * @param newState The new state + */ + private synchronized void setState(ServerState newState) { + ServerState oldState = this.state; + this.state = newState; + logger.debug("Server state changed: {} -> {}", oldState, newState); + } + + /** + * Determines the current state based on the available configuration + * + * @return The determined state + */ + private ServerState determineState() { + // If the current state is DISPOSED, return it immediately + if (this.state == ServerState.DISPOSED) { + return ServerState.DISPOSED; + } + + // Check if we have a discovered server + boolean isDiscovered = thing.getProperties().containsKey(Constants.ServerProperties.SERVER_URI); + + // Check if we have authentication token + boolean hasToken = (this.configuration.token != null && !this.configuration.token.isEmpty()); + + try { + URI serverURI = this.configuration.getServerURI(); + if (isDiscovered && !hasToken) { + return ServerState.DISCOVERED; + } else if (serverURI != null && !hasToken) { + return ServerState.NEEDS_AUTHENTICATION; + } else if (serverURI != null && hasToken) { + return ServerState.CONFIGURED; + } + } catch (URISyntaxException e) { + logger.warn("Invalid server URI configuration: {}", e.getMessage()); + this.exceptionHandler.handle(e); + return ServerState.ERROR; + } + + return ServerState.INITIALIZING; } @Override public void initialize() { try { + setState(ServerState.INITIALIZING); scheduler.execute(initializeHandler()); } catch (Exception e) { this.logger.warn("Exception during initialization: {}", e.getMessage()); this.exceptionHandler.handle(e); + setState(ServerState.ERROR); } } @@ -82,50 +190,87 @@ public void handleCommand(ChannelUID channelUID, Command command) { @Override public void dispose() { + // Set state to indicate disposal + setState(ServerState.DISPOSED); // No additional cleanup required super.dispose(); } + /** + * Processes server initialization with a state-driven approach + * + * @return A runnable that handles the initialization process + */ private synchronized Runnable initializeHandler() { return () -> { try { + // Determine the initial state based on configuration + ServerState initialState = determineState(); + setState(initialState); + URI serverUri = this.configuration.getServerURI(); - // Initialize discovered server - if (thing.getProperties().containsKey(Constants.ServerProperties.SERVER_URI)) { - serverUri = new URI(thing.getProperties().get(Constants.ServerProperties.SERVER_URI)); - updateConfiguration(serverUri); - } else { - // Add the server URI to the properties for non-discovery results - updateThingProperty(Constants.ServerProperties.SERVER_URI, serverUri.toString()); + // Step 1: Handle server URI based on state + switch (initialState) { + case DISCOVERED: + // Initialize discovered server - get URI from properties + serverUri = new URI(thing.getProperties().get(Constants.ServerProperties.SERVER_URI)); + updateConfiguration(serverUri); + break; + case INITIALIZING: + case NEEDS_AUTHENTICATION: + case CONFIGURED: + // Add the server URI to the properties for non-discovery results + updateThingProperty(Constants.ServerProperties.SERVER_URI, serverUri.toString()); + break; + case ERROR: + case CONNECTED: + case DISPOSED: + // These states are not applicable during initialization + logger.warn("Unexpected state during initialization: {}", initialState); + break; } + // Step 2: Update API client with server URI for all states this.apiClient.updateBaseUri(serverUri.toString()); - if (this.configuration.token != null && !this.configuration.token.isEmpty()) { - this.apiClient.authenticateWithToken(this.configuration.token); - this.startTasks(); - } else { - ThingStatusInfo statusInfo = new ThingStatusInfo(ThingStatus.OFFLINE, - ThingStatusDetail.CONFIGURATION_ERROR, - ResourceHelper.getResourceString("error.configuration.no-access-token")); - this.getThing().setStatusInfo(statusInfo); + // Step 3: Handle authentication based on state + switch (initialState) { + case CONFIGURED: + // Has token, authenticate and start tasks + this.apiClient.authenticateWithToken(this.configuration.token); + this.startTasks(); + break; + case DISCOVERED: + case NEEDS_AUTHENTICATION: + // No token, set offline with configuration error + ThingStatusInfo statusInfo = new ThingStatusInfo(ThingStatus.OFFLINE, + ThingStatusDetail.CONFIGURATION_ERROR, "@text/error.configuration.no-access-token"); + this.getThing().setStatusInfo(statusInfo); + break; + case INITIALIZING: + case ERROR: + case CONNECTED: + case DISPOSED: + // No specific authentication action for these states + break; } + } catch (Exception e) { this.logger.error("Error during initialization: {}", e.getMessage(), e); this.exceptionHandler.handle(e); + setState(ServerState.ERROR); } }; } private synchronized void startTasks() { - // Create and start the connection task - AbstractTask connectionTask = TaskFactory.createConnectionTask(this.apiClient, - systemInfo -> this.handleConnection(systemInfo), this.exceptionHandler); - - startTask(connectionTask); + // Start all pre-created tasks + for (AbstractTask task : tasks.values()) { + startTask(task); + } - // Additional tasks can be started here in the future + // Additional task starting logic can be added here in the future } private synchronized void startTask(AbstractTask task) { @@ -158,12 +303,17 @@ private Object handleConnection(SystemInfo systemInfo) { // Update configuration with systemInfo data if available this.updateConfiguration(systemInfo); + // Update state to connected + setState(ServerState.CONNECTED); + + // Set thing status to online ThingStatusInfo statusInfo = new ThingStatusInfo(ThingStatus.ONLINE, ThingStatusDetail.NONE, ""); this.getThing().setStatusInfo(statusInfo); this.stopTasks(); } catch (Exception e) { logger.warn("Failed to process system information: {}", e.getMessage(), e); + setState(ServerState.ERROR); } return null; } From fed74f914772f3a810ad1dda1d5467bd38de782d Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Fri, 3 Oct 2025 06:30:15 +0200 Subject: [PATCH 17/38] =?UTF-8?q?=E2=9C=A8=20feat(jellyfin):=20add=20Serve?= =?UTF-8?q?rState=20enum=20to=20represent=20possible=20states=20of=20the?= =?UTF-8?q?=20server=20handler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrik Gfeller --- .../internal/handler/ServerHandler.java | 41 +------------ .../jellyfin/internal/types/ServerState.java | 58 +++++++++++++++++++ 2 files changed, 59 insertions(+), 40 deletions(-) create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/types/ServerState.java diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index c4e28489723cb..88a40c0c8d3c1 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -29,6 +29,7 @@ import org.openhab.binding.jellyfin.internal.handler.tasks.AbstractTask; import org.openhab.binding.jellyfin.internal.handler.tasks.ConnectionTask; import org.openhab.binding.jellyfin.internal.handler.tasks.TaskFactory; +import org.openhab.binding.jellyfin.internal.types.ServerState; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.ThingStatus; @@ -51,46 +52,6 @@ @NonNullByDefault public class ServerHandler extends BaseBridgeHandler { - /** - * Enum representing the possible states of the server handler - */ - public enum ServerState { - /** - * Initial state when the handler is created - */ - INITIALIZING, - - /** - * State for a newly discovered server that needs configuration - */ - DISCOVERED, - - /** - * State when server URI is known but no authentication token is available - */ - NEEDS_AUTHENTICATION, - - /** - * State when server is fully configured with URI and token - */ - CONFIGURED, - - /** - * State when server is connected and online - */ - CONNECTED, - - /** - * State when server is in error state - */ - ERROR, - - /** - * State when the handler has been disposed - */ - DISPOSED - } - private final Logger logger = LoggerFactory.getLogger(ServerHandler.class); private final ExceptionHandler exceptionHandler; private final ApiClient apiClient; diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/types/ServerState.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/types/ServerState.java new file mode 100644 index 0000000000000..e2b511580bd65 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/types/ServerState.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.types; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * Enum representing the possible states of the server handler + * + * @author Patrik Gfeller - Initial contribution + */ +@NonNullByDefault +public enum ServerState { + /** + * Initial state when the handler is created + */ + INITIALIZING, + + /** + * State for a newly discovered server that needs configuration + */ + DISCOVERED, + + /** + * State when server URI is known but no authentication token is available + */ + NEEDS_AUTHENTICATION, + + /** + * State when server is fully configured with URI and token + */ + CONFIGURED, + + /** + * State when server is connected and online + */ + CONNECTED, + + /** + * State when server is in error state + */ + ERROR, + + /** + * State when the handler has been disposed + */ + DISPOSED +} From 1e4a743bf0fa01fa33ae7f4a082b0fe13d0a3c56 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Fri, 3 Oct 2025 07:00:21 +0200 Subject: [PATCH 18/38] refactor(jellyfin): extract task management to stateless utility class - Extract task-related operations from ServerHandler to TaskManager utility class - Implement state-driven task management with getTaskIdsForState() method - Create stateless TaskManager with methods for task lifecycle management: - transitionTasksForState() for state-based task transitions - startTask() and stopTask() for individual task control - stopAllTasks() for cleanup operations - Reduce ServerHandler complexity from 452 to 358 lines (20% reduction) - Improve separation of concerns following Single Responsibility Principle - Maintain thread safety through stateless design pattern - Preserve all existing functionality while improving maintainability This refactoring enables better task management based on server state transitions and provides a cleaner architecture for future task-related enhancements. Signed-off-by: Patrik Gfeller --- .../internal/handler/ServerHandler.java | 59 ++---- .../internal/handler/TaskManager.java | 198 ++++++++++++++++++ 2 files changed, 217 insertions(+), 40 deletions(-) create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManager.java diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index 88a40c0c8d3c1..5c523977954bd 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -17,7 +17,6 @@ import java.util.HashMap; import java.util.Map; import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; @@ -28,7 +27,9 @@ import org.openhab.binding.jellyfin.internal.exceptions.ExceptionHandler; import org.openhab.binding.jellyfin.internal.handler.tasks.AbstractTask; import org.openhab.binding.jellyfin.internal.handler.tasks.ConnectionTask; +import org.openhab.binding.jellyfin.internal.handler.tasks.RegistrationTask; import org.openhab.binding.jellyfin.internal.handler.tasks.TaskFactory; +import org.openhab.binding.jellyfin.internal.handler.tasks.UpdateTask; import org.openhab.binding.jellyfin.internal.types.ServerState; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.ChannelUID; @@ -72,6 +73,9 @@ public ServerHandler(Bridge bridge, ApiClient apiClient) { // Create all tasks in the constructor this.tasks.put(ConnectionTask.TASK_ID, TaskFactory.createConnectionTask(this.apiClient, systemInfo -> this.handleConnection(systemInfo), this.exceptionHandler)); + this.tasks.put(RegistrationTask.TASK_ID, + TaskFactory.createRegistrationTask(this.apiClient, this.exceptionHandler)); + this.tasks.put(UpdateTask.TASK_ID, TaskFactory.createUpdateTask(this.apiClient, this.exceptionHandler)); // Additional tasks can be added here in the future } @@ -85,6 +89,15 @@ public ServerState getState() { return state; } + /** + * Start tasks for the specified server state, stopping any tasks that shouldn't run in that state. + * + * @param serverState The server state to start tasks for + */ + private synchronized void startTasksForState(ServerState serverState) { + TaskManager.transitionTasksForState(serverState, tasks, scheduledTasks, scheduler); + } + /** * Set the state of the server handler * @@ -94,6 +107,9 @@ private synchronized void setState(ServerState newState) { ServerState oldState = this.state; this.state = newState; logger.debug("Server state changed: {} -> {}", oldState, newState); + + // Update running tasks based on the new state + startTasksForState(newState); } /** @@ -198,9 +214,8 @@ private synchronized Runnable initializeHandler() { // Step 3: Handle authentication based on state switch (initialState) { case CONFIGURED: - // Has token, authenticate and start tasks + // Has token, authenticate (tasks will be started by setState) this.apiClient.authenticateWithToken(this.configuration.token); - this.startTasks(); break; case DISCOVERED: case NEEDS_AUTHENTICATION: @@ -225,26 +240,6 @@ private synchronized Runnable initializeHandler() { }; } - private synchronized void startTasks() { - // Start all pre-created tasks - for (AbstractTask task : tasks.values()) { - startTask(task); - } - - // Additional task starting logic can be added here in the future - } - - private synchronized void startTask(AbstractTask task) { - String taskId = task.getId(); - int delay = task.getStartupDelay(); - int interval = task.getInterval(); - - this.logger.trace("Starting task [{}] with delay: {}s, interval: {}s", taskId, delay, interval); - logger.info("Starting task [{}]", taskId); - - this.scheduledTasks.put(taskId, this.scheduleTask(task, delay, interval)); - } - private Object handleConnection(SystemInfo systemInfo) { try { // Log all available server information at INFO level @@ -280,23 +275,7 @@ private Object handleConnection(SystemInfo systemInfo) { } private synchronized void stopTasks() { - logger.info("Stopping {} task(s): {}", this.scheduledTasks.values().size(), - String.join(",", this.scheduledTasks.keySet())); - - this.scheduledTasks.values().forEach(this::stopScheduledTask); - this.scheduledTasks.clear(); - } - - private synchronized void stopScheduledTask(@Nullable ScheduledFuture scheduledTask) { - if (scheduledTask == null || scheduledTask.isCancelled() || scheduledTask.isDone()) { - return; - } - - scheduledTask.cancel(true); - } - - private @Nullable ScheduledFuture scheduleTask(Runnable task, long initialDelay, long interval) { - return scheduler.scheduleWithFixedDelay(task, initialDelay, interval, TimeUnit.SECONDS); + TaskManager.stopAllTasks(scheduledTasks); } /** diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManager.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManager.java new file mode 100644 index 0000000000000..f9f23fd050a0f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManager.java @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.handler; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.jellyfin.internal.handler.tasks.AbstractTask; +import org.openhab.binding.jellyfin.internal.handler.tasks.ConnectionTask; +import org.openhab.binding.jellyfin.internal.handler.tasks.UpdateTask; +import org.openhab.binding.jellyfin.internal.types.ServerState; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Stateless utility class for managing tasks based on server states. + * This class handles all task-related operations including starting, stopping, + * and determining which tasks should run for specific server states. + * + * @author Patrik Gfeller - Initial contribution + */ +@NonNullByDefault +public final class TaskManager { + + private static final Logger logger = LoggerFactory.getLogger(TaskManager.class); + + /** + * Private constructor to prevent instantiation of this utility class. + */ + private TaskManager() { + // Utility class should not be instantiated + } + + /** + * Gets the list of task IDs that should be active for the given server state. + * + * @param serverState The server state to get task IDs for + * @return List of task IDs that should be running for the given state + */ + public static List getTaskIdsForState(ServerState serverState) { + switch (serverState) { + case CONFIGURED: + // When configured but not connected, run connection task to establish connection + return List.of(ConnectionTask.TASK_ID); + case CONNECTED: + // When connected, run update tasks to keep data synchronized + // Note: Connection task stops automatically when successful + return List.of(UpdateTask.TASK_ID); + case DISCOVERED: + // For discovered servers, potentially run registration task in the future + return List.of(); + case NEEDS_AUTHENTICATION: + // Could potentially run registration task to help with authentication + return List.of(); + case INITIALIZING: + case ERROR: + case DISPOSED: + default: + // No tasks should run in these states + return List.of(); + } + } + + /** + * Manages task transitions for a server state change. + * Stops tasks that shouldn't run in the new state and starts tasks that should run. + * + * @param serverState The new server state + * @param availableTasks Map of available tasks by their IDs + * @param scheduledTasks Map of currently scheduled tasks + * @param scheduler The scheduler service to use for task scheduling + */ + public static void transitionTasksForState(ServerState serverState, Map availableTasks, + Map> scheduledTasks, ScheduledExecutorService scheduler) { + List taskIdsToStart = getTaskIdsForState(serverState); + + // Stop any running tasks that are not needed for this state + for (String runningTaskId : List.copyOf(scheduledTasks.keySet())) { + if (!taskIdsToStart.contains(runningTaskId)) { + stopTask(runningTaskId, scheduledTasks); + } + } + + // Start tasks needed for this state + for (String taskId : taskIdsToStart) { + if (!scheduledTasks.containsKey(taskId)) { + startTask(taskId, availableTasks, scheduledTasks, scheduler); + } + } + } + + /** + * Starts a task by its ID. + * + * @param taskId The ID of the task to start + * @param availableTasks Map of available tasks by their IDs + * @param scheduledTasks Map of currently scheduled tasks + * @param scheduler The scheduler service to use for task scheduling + */ + public static void startTask(String taskId, Map availableTasks, + Map> scheduledTasks, ScheduledExecutorService scheduler) { + AbstractTask task = availableTasks.get(taskId); + if (task != null) { + startTask(task, scheduledTasks, scheduler); + } else { + logger.warn("Task with ID '{}' not found", taskId); + } + } + + /** + * Starts a specific task. + * + * @param task The task to start + * @param scheduledTasks Map of currently scheduled tasks + * @param scheduler The scheduler service to use for task scheduling + */ + public static void startTask(AbstractTask task, Map> scheduledTasks, + ScheduledExecutorService scheduler) { + String taskId = task.getId(); + int delay = task.getStartupDelay(); + int interval = task.getInterval(); + + logger.trace("Starting task [{}] with delay: {}s, interval: {}s", taskId, delay, interval); + logger.info("Starting task [{}]", taskId); + + ScheduledFuture scheduledTask = scheduleTask(task, delay, interval, scheduler); + scheduledTasks.put(taskId, scheduledTask); + } + + /** + * Stops a task by its ID. + * + * @param taskId The ID of the task to stop + * @param scheduledTasks Map of currently scheduled tasks + */ + public static void stopTask(String taskId, Map> scheduledTasks) { + ScheduledFuture scheduledTask = scheduledTasks.remove(taskId); + if (scheduledTask != null) { + logger.info("Stopping task [{}]", taskId); + stopScheduledTask(scheduledTask); + } + } + + /** + * Stops all currently running tasks. + * + * @param scheduledTasks Map of currently scheduled tasks + */ + public static void stopAllTasks(Map> scheduledTasks) { + logger.info("Stopping {} task(s): {}", scheduledTasks.values().size(), + String.join(",", scheduledTasks.keySet())); + + scheduledTasks.values().forEach(TaskManager::stopScheduledTask); + scheduledTasks.clear(); + } + + /** + * Schedules a task for execution. + * + * @param task The task to schedule + * @param initialDelay Initial delay in seconds + * @param interval Interval between executions in seconds + * @param scheduler The scheduler service to use + * @return The scheduled future for the task + */ + private static @Nullable ScheduledFuture scheduleTask(Runnable task, long initialDelay, long interval, + ScheduledExecutorService scheduler) { + return scheduler.scheduleWithFixedDelay(task, initialDelay, interval, TimeUnit.SECONDS); + } + + /** + * Stops a scheduled task. + * + * @param scheduledTask The scheduled task to stop + */ + private static void stopScheduledTask(@Nullable ScheduledFuture scheduledTask) { + if (scheduledTask == null || scheduledTask.isCancelled() || scheduledTask.isDone()) { + return; + } + + scheduledTask.cancel(true); + } +} From 654cdd97c8eaa68e0316ba8c6b4139d957eda50d Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Fri, 3 Oct 2025 07:06:47 +0200 Subject: [PATCH 19/38] =?UTF-8?q?=F0=9F=93=9D=20docs(jellyfin):=20update?= =?UTF-8?q?=20class=20diagram=20with=20TaskManager=20architecture?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✨ - Add TaskManager utility class to Mermaid class diagram 📊 - Include ServerState enumeration with state definitions 🔗 - Show new architectural relationships and dependencies: - ServerHandler → TaskManager (task delegation) - ServerHandler → ServerState (state management) - TaskManager → AbstractTask (lifecycle management) - TaskManager → ServerState (state evaluation) 🏗️ - Update Key Components section with new classes 📋 - Add Architecture Overview explaining state-driven design: - State-driven task management workflow - Stateless utility pattern implementation - Clear separation of concerns documentation - Task lifecycle based on server state transitions This documentation update reflects the refactored architecture and helps developers understand the new TaskManager utility class design pattern. --- .../CONTRIBUTION.md | 51 ++++++++++++++++--- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md index 301c2b2cba259..7fee6f7100dfa 100644 --- a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md +++ b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md @@ -21,9 +21,13 @@ classDiagram ServerHandler --> ExceptionHandler : uses ServerHandler --> Configuration : uses ServerHandler --> TaskFactory : uses + ServerHandler --> TaskManager : uses + ServerHandler --> ServerState : uses ServerDiscoveryService ..> ServerDiscovery : creates ServerDiscoveryService --> BindingConfiguration : uses TaskFactory ..> AbstractTask : creates + TaskManager --> AbstractTask : manages + TaskManager --> ServerState : evaluates ServerDiscovery ..> ServerDiscoveryResult : creates ApiClientFactory ..> ApiClient : creates HandlerFactory ..> ServerHandler : creates @@ -37,6 +41,25 @@ classDiagram +initialize() +handleCommand() +dispose() + -transitionToState(ServerState) + } + + class TaskManager { + <> + +static getTaskIdsForState(ServerState) Set~String~ + +static transitionTasksForState(Map, ServerState, ScheduledExecutorService) + +static startTask(Map, String, ScheduledExecutorService) + +static stopTask(Map, String) + +static stopAllTasks(Map) + } + + class ServerState { + <> + INITIALIZING + ONLINE + OFFLINE + ERROR + +getRequiredTasks() Set~String~ } class ApiClientFactory { @@ -112,14 +135,26 @@ classDiagram ## Key Components 1. **HandlerFactory**: Creates thing handlers for the binding. -2. **ServerHandler**: Main bridge handler for Jellyfin servers. -3. **ApiClientFactory**: Creates API client instances for different API versions. -4. **ApiClient**: Handles communication with the Jellyfin server and manages authentication. -5. **ServerDiscoveryService**: Discovers Jellyfin servers on the network using UDP broadcasts. -6. **TaskFactory**: Creates various task instances used for server communication. -7. **AbstractTask**: Base class for all tasks that can be scheduled for execution. -8. **BindingConfiguration**: Contains configuration settings for the binding. -9. **ExceptionHandler**: Handles exceptions that occur during binding operation. +2. **ServerHandler**: Main bridge handler for Jellyfin servers that orchestrates server communication and state management. +3. **TaskManager**: Stateless utility class that manages task lifecycle operations based on server state transitions. +4. **ServerState**: Enumeration defining server states (INITIALIZING, ONLINE, OFFLINE, ERROR) and their required task sets. +5. **ApiClientFactory**: Creates API client instances for different API versions. +6. **ApiClient**: Handles communication with the Jellyfin server and manages authentication. +7. **ServerDiscoveryService**: Discovers Jellyfin servers on the network using UDP broadcasts. +8. **TaskFactory**: Creates various task instances used for server communication. +9. **AbstractTask**: Base class for all tasks that can be scheduled for execution. +10. **BindingConfiguration**: Contains configuration settings for the binding. +11. **ExceptionHandler**: Handles exceptions that occur during binding operation. + +## Architecture Overview + +The binding follows a state-driven architecture where: + +- **ServerHandler** manages the overall server connection lifecycle and delegates task management to the **TaskManager** utility +- **TaskManager** provides stateless operations for starting, stopping, and transitioning tasks based on **ServerState** +- **ServerState** enum defines which tasks should be active for each server state +- Tasks are created by **TaskFactory** and extend **AbstractTask** for scheduled execution +- **ApiClient** provides the communication layer with version-specific implementations ## API Version Support From 4bbef92f60e10f5f6d6cb77fd0993c6e5a54d6a7 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Fri, 3 Oct 2025 07:22:39 +0200 Subject: [PATCH 20/38] Update bundles/org.openhab.binding.jellyfin/.directory Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Patrik Gfeller --- bundles/org.openhab.binding.jellyfin/.directory | 1 - 1 file changed, 1 deletion(-) diff --git a/bundles/org.openhab.binding.jellyfin/.directory b/bundles/org.openhab.binding.jellyfin/.directory index 2b71eb83a21e7..d226fba3bbc85 100644 --- a/bundles/org.openhab.binding.jellyfin/.directory +++ b/bundles/org.openhab.binding.jellyfin/.directory @@ -1,2 +1 @@ [Desktop Entry] -Icon=/home/pgfeller/ownCloud@midas.hopto.org/Dokumente/Linux/Icons/jellyfin.svg From 0540046aa39f40ac1c98039c93e7933fe630b5c6 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Fri, 3 Oct 2025 07:24:01 +0200 Subject: [PATCH 21/38] Update bundles/org.openhab.binding.jellyfin/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Patrik Gfeller --- bundles/org.openhab.binding.jellyfin/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.jellyfin/README.md b/bundles/org.openhab.binding.jellyfin/README.md index 72fc6f1a47e5a..e88fd2d48631d 100644 --- a/bundles/org.openhab.binding.jellyfin/README.md +++ b/bundles/org.openhab.binding.jellyfin/README.md @@ -2,7 +2,7 @@ This is the binding for [Jellyfin](https://jellyfin.org), the volunteer built media solution that puts you in control of your media. This binding allows you to interact with Jellyfin clients that supports remote control. -It is compatible and test with Jellyfin servers from version `10.10.7`. +It is compatible and tested with Jellyfin servers from version `10.10.7`. Earlier versions use a different API and are not supported. ## Binding - Configuration From c8d108fc8ab5dfdf2303d681057ee9fb4078fa87 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Fri, 3 Oct 2025 07:24:32 +0200 Subject: [PATCH 22/38] Update bundles/org.openhab.binding.jellyfin/.gitignore Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Patrik Gfeller --- bundles/org.openhab.binding.jellyfin/.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.jellyfin/.gitignore b/bundles/org.openhab.binding.jellyfin/.gitignore index c1704747f336d..66f52c2681d4d 100644 --- a/bundles/org.openhab.binding.jellyfin/.gitignore +++ b/bundles/org.openhab.binding.jellyfin/.gitignore @@ -6,4 +6,4 @@ logs /.apt_generated_tests/ # Temporary (wip) .vscode -.direcory \ No newline at end of file +.directory \ No newline at end of file From aac020783a3f326353f2d05293c829989ee67b18 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Fri, 3 Oct 2025 18:32:47 +0200 Subject: [PATCH 23/38] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F=20refactor:=20remov?= =?UTF-8?q?e=20unused=20RegistrationTask=20class=20and=20references?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Delete RegistrationTask.java file - Remove import from ServerHandler.java - Remove task creation from ServerHandler constructor - Remove createRegistrationTask method from TaskFactory.java - Update class diagram in CONTRIBUTION.md documentation The RegistrationTask was not being used and its removal simplifies the task management structure. --- .../CONTRIBUTION.md | 2 - .../internal/handler/ServerHandler.java | 3 - .../handler/tasks/RegistrationTask.java | 62 ------------------- .../internal/handler/tasks/TaskFactory.java | 11 ---- 4 files changed, 78 deletions(-) delete mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/RegistrationTask.java diff --git a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md index 7fee6f7100dfa..a0ae649863a6c 100644 --- a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md +++ b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md @@ -10,7 +10,6 @@ The following diagram shows the main classes and their relationships within the classDiagram %% Class inheritance relationships AbstractTask <|-- ConnectionTask - AbstractTask <|-- RegistrationTask AbstractTask <|-- UpdateTask AbstractTask <|-- UsersListTask AbstractTask <|-- ClientScanTask @@ -95,7 +94,6 @@ classDiagram class TaskFactory { <> +createConnectionTask(ApiClient, Consumer, ExceptionHandler) ConnectionTask - +createRegistrationTask(ApiClient, ExceptionHandler) RegistrationTask +createUpdateTask(ApiClient, ExceptionHandler) UpdateTask } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index 5c523977954bd..679f846515b9b 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -27,7 +27,6 @@ import org.openhab.binding.jellyfin.internal.exceptions.ExceptionHandler; import org.openhab.binding.jellyfin.internal.handler.tasks.AbstractTask; import org.openhab.binding.jellyfin.internal.handler.tasks.ConnectionTask; -import org.openhab.binding.jellyfin.internal.handler.tasks.RegistrationTask; import org.openhab.binding.jellyfin.internal.handler.tasks.TaskFactory; import org.openhab.binding.jellyfin.internal.handler.tasks.UpdateTask; import org.openhab.binding.jellyfin.internal.types.ServerState; @@ -73,8 +72,6 @@ public ServerHandler(Bridge bridge, ApiClient apiClient) { // Create all tasks in the constructor this.tasks.put(ConnectionTask.TASK_ID, TaskFactory.createConnectionTask(this.apiClient, systemInfo -> this.handleConnection(systemInfo), this.exceptionHandler)); - this.tasks.put(RegistrationTask.TASK_ID, - TaskFactory.createRegistrationTask(this.apiClient, this.exceptionHandler)); this.tasks.put(UpdateTask.TASK_ID, TaskFactory.createUpdateTask(this.apiClient, this.exceptionHandler)); // Additional tasks can be added here in the future diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/RegistrationTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/RegistrationTask.java deleted file mode 100644 index ca507c734d096..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/RegistrationTask.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2010-2025 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.binding.jellyfin.internal.handler.tasks; - -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.openhab.binding.jellyfin.internal.api.ApiClient; -import org.openhab.binding.jellyfin.internal.types.ExceptionHandlerType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Task for handling registration with the Jellyfin server. - * This is a placeholder for future implementation. - * - * @author Patrik Gfeller - Initial contribution - */ -@NonNullByDefault -public class RegistrationTask extends AbstractTask { - - /** Task ID for the registration task */ - public static final String TASK_ID = "Registration"; - /** Default startup delay for the registration task in seconds */ - public static final int DEFAULT_STARTUP_DELAY = 5; - /** Default interval for the registration task in seconds */ - public static final int DEFAULT_INTERVAL = 1; - - private final Logger logger = LoggerFactory.getLogger(RegistrationTask.class); - private final ApiClient client; - private final ExceptionHandlerType exceptionHandler; - - /** - * Creates a new registration task with default startup delay and interval. - * - * @param client The API client to use for registration - * @param exceptionHandler The handler for exceptions - */ - public RegistrationTask(ApiClient client, ExceptionHandlerType exceptionHandler) { - super(TASK_ID, DEFAULT_STARTUP_DELAY, DEFAULT_INTERVAL); - this.client = client; - this.exceptionHandler = exceptionHandler; - } - - @Override - public void run() { - try { - // TODO: Implement registration logic in future - logger.debug("Registration task not implemented yet"); - } catch (Exception e) { - this.exceptionHandler.handle(e); - } - } -} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java index 6ee213bc1e3eb..9616dcf82f69a 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java @@ -40,17 +40,6 @@ public static ConnectionTask createConnectionTask(ApiClient client, Consumer Date: Fri, 3 Oct 2025 19:41:00 +0200 Subject: [PATCH 24/38] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(jellyfin):?= =?UTF-8?q?=20improve=20task=20management=20architecture=20and=20documenta?= =?UTF-8?q?tion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✨ Features: - 📚 Update architecture documentation with new server states and class relationships - 🔧 Enhance TaskManager API with improved encapsulation 🔧 Improvements: - 🔒 Make internal TaskManager methods private for better encapsulation - 🎯 Simplify ServerHandler by delegating state transitions to TaskManager - 📖 Update class diagrams to reflect current architecture 🏗️ Architecture: - Replace transitionTasksForState with processStateChange for clearer semantics - Remove unused stopTasks method from ServerHandler - Improve method naming and access modifiers in TaskManager --- .../CONTRIBUTION.md | 40 ++++++++++++--- .../internal/handler/ServerHandler.java | 16 +----- .../internal/handler/TaskManager.java | 51 ++++++++++--------- 3 files changed, 59 insertions(+), 48 deletions(-) diff --git a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md index a0ae649863a6c..e86e5eee1a38b 100644 --- a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md +++ b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md @@ -13,6 +13,7 @@ classDiagram AbstractTask <|-- UpdateTask AbstractTask <|-- UsersListTask AbstractTask <|-- ClientScanTask + ExceptionHandlerType <|.. ExceptionHandler %% Class dependencies and usage relationships HandlerFactory --> ApiClientFactory : uses @@ -45,7 +46,7 @@ classDiagram class TaskManager { <> - +static getTaskIdsForState(ServerState) Set~String~ + +static getTaskIdsForState(ServerState) List~String~ +static transitionTasksForState(Map, ServerState, ScheduledExecutorService) +static startTask(Map, String, ScheduledExecutorService) +static stopTask(Map, String) @@ -55,10 +56,12 @@ classDiagram class ServerState { <> INITIALIZING - ONLINE - OFFLINE + DISCOVERED + NEEDS_AUTHENTICATION + CONFIGURED + CONNECTED ERROR - +getRequiredTasks() Set~String~ + DISPOSED } class ApiClientFactory { @@ -93,8 +96,14 @@ classDiagram class TaskFactory { <> - +createConnectionTask(ApiClient, Consumer, ExceptionHandler) ConnectionTask - +createUpdateTask(ApiClient, ExceptionHandler) UpdateTask + +createTask(String taskType, ApiClient, ...) AbstractTask + +createConnectionTask(...) AbstractTask + +createUpdateTask(...) AbstractTask + } + + class ExceptionHandlerType { + <> + +handle(Exception) } class ExceptionHandler { @@ -128,6 +137,20 @@ classDiagram class ConnectionTask { %% Inherits run() from AbstractTask } + + class UpdateTask { + %% Inherits run() from AbstractTask + } + + class UsersListTask { + %% Inherits run() from AbstractTask + %% Available but not currently used + } + + class ClientScanTask { + %% Inherits run() from AbstractTask + %% Available but not currently used + } ``` ## Key Components @@ -135,14 +158,15 @@ classDiagram 1. **HandlerFactory**: Creates thing handlers for the binding. 2. **ServerHandler**: Main bridge handler for Jellyfin servers that orchestrates server communication and state management. 3. **TaskManager**: Stateless utility class that manages task lifecycle operations based on server state transitions. -4. **ServerState**: Enumeration defining server states (INITIALIZING, ONLINE, OFFLINE, ERROR) and their required task sets. +4. **ServerState**: Enumeration defining server states (INITIALIZING, DISCOVERED, NEEDS_AUTHENTICATION, CONFIGURED, CONNECTED, ERROR, DISPOSED) and their required task sets. 5. **ApiClientFactory**: Creates API client instances for different API versions. 6. **ApiClient**: Handles communication with the Jellyfin server and manages authentication. 7. **ServerDiscoveryService**: Discovers Jellyfin servers on the network using UDP broadcasts. 8. **TaskFactory**: Creates various task instances used for server communication. 9. **AbstractTask**: Base class for all tasks that can be scheduled for execution. 10. **BindingConfiguration**: Contains configuration settings for the binding. -11. **ExceptionHandler**: Handles exceptions that occur during binding operation. +11. **ExceptionHandlerType**: Interface defining the contract for exception handling. +12. **ExceptionHandler**: Implementation of ExceptionHandlerType that handles exceptions during binding operation. ## Architecture Overview diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index 679f846515b9b..ddcf1bf357748 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -86,15 +86,6 @@ public ServerState getState() { return state; } - /** - * Start tasks for the specified server state, stopping any tasks that shouldn't run in that state. - * - * @param serverState The server state to start tasks for - */ - private synchronized void startTasksForState(ServerState serverState) { - TaskManager.transitionTasksForState(serverState, tasks, scheduledTasks, scheduler); - } - /** * Set the state of the server handler * @@ -106,7 +97,7 @@ private synchronized void setState(ServerState newState) { logger.debug("Server state changed: {} -> {}", oldState, newState); // Update running tasks based on the new state - startTasksForState(newState); + TaskManager.processStateChange(newState, tasks, scheduledTasks, scheduler); } /** @@ -263,7 +254,6 @@ private Object handleConnection(SystemInfo systemInfo) { ThingStatusInfo statusInfo = new ThingStatusInfo(ThingStatus.ONLINE, ThingStatusDetail.NONE, ""); this.getThing().setStatusInfo(statusInfo); - this.stopTasks(); } catch (Exception e) { logger.warn("Failed to process system information: {}", e.getMessage(), e); setState(ServerState.ERROR); @@ -271,10 +261,6 @@ private Object handleConnection(SystemInfo systemInfo) { return null; } - private synchronized void stopTasks() { - TaskManager.stopAllTasks(scheduledTasks); - } - /** * Updates configuration from a URI * diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManager.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManager.java index f9f23fd050a0f..7cc507424ccfd 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManager.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManager.java @@ -29,8 +29,9 @@ /** * Stateless utility class for managing tasks based on server states. - * This class handles all task-related operations including starting, stopping, - * and determining which tasks should run for specific server states. + * This class handles state-driven task management, automatically starting and stopping + * tasks based on server state transitions. Individual task control is handled internally + * through state transitions only. * * @author Patrik Gfeller - Initial contribution */ @@ -85,51 +86,64 @@ public static List getTaskIdsForState(ServerState serverState) { * @param scheduledTasks Map of currently scheduled tasks * @param scheduler The scheduler service to use for task scheduling */ - public static void transitionTasksForState(ServerState serverState, Map availableTasks, + public static void processStateChange(ServerState serverState, Map availableTasks, Map> scheduledTasks, ScheduledExecutorService scheduler) { List taskIdsToStart = getTaskIdsForState(serverState); // Stop any running tasks that are not needed for this state for (String runningTaskId : List.copyOf(scheduledTasks.keySet())) { if (!taskIdsToStart.contains(runningTaskId)) { - stopTask(runningTaskId, scheduledTasks); + stopTaskInternal(runningTaskId, scheduledTasks); } } // Start tasks needed for this state for (String taskId : taskIdsToStart) { if (!scheduledTasks.containsKey(taskId)) { - startTask(taskId, availableTasks, scheduledTasks, scheduler); + startTaskInternal(taskId, availableTasks, scheduledTasks, scheduler); } } } /** - * Starts a task by its ID. + * Stops all currently running tasks. + * + * @param scheduledTasks Map of currently scheduled tasks + */ + public static void stopAllTasks(Map> scheduledTasks) { + logger.info("Stopping {} task(s): {}", scheduledTasks.values().size(), + String.join(",", scheduledTasks.keySet())); + + scheduledTasks.values().forEach(TaskManager::stopScheduledTask); + scheduledTasks.clear(); + } + + /** + * Starts a task by its ID (internal method for state transitions). * * @param taskId The ID of the task to start * @param availableTasks Map of available tasks by their IDs * @param scheduledTasks Map of currently scheduled tasks * @param scheduler The scheduler service to use for task scheduling */ - public static void startTask(String taskId, Map availableTasks, + private static void startTaskInternal(String taskId, Map availableTasks, Map> scheduledTasks, ScheduledExecutorService scheduler) { AbstractTask task = availableTasks.get(taskId); if (task != null) { - startTask(task, scheduledTasks, scheduler); + startTaskInternal(task, scheduledTasks, scheduler); } else { logger.warn("Task with ID '{}' not found", taskId); } } /** - * Starts a specific task. + * Starts a specific task (internal method for state transitions). * * @param task The task to start * @param scheduledTasks Map of currently scheduled tasks * @param scheduler The scheduler service to use for task scheduling */ - public static void startTask(AbstractTask task, Map> scheduledTasks, + private static void startTaskInternal(AbstractTask task, Map> scheduledTasks, ScheduledExecutorService scheduler) { String taskId = task.getId(); int delay = task.getStartupDelay(); @@ -143,12 +157,12 @@ public static void startTask(AbstractTask task, Map> scheduledTasks) { + private static void stopTaskInternal(String taskId, Map> scheduledTasks) { ScheduledFuture scheduledTask = scheduledTasks.remove(taskId); if (scheduledTask != null) { logger.info("Stopping task [{}]", taskId); @@ -156,19 +170,6 @@ public static void stopTask(String taskId, Map> scheduledTasks) { - logger.info("Stopping {} task(s): {}", scheduledTasks.values().size(), - String.join(",", scheduledTasks.keySet())); - - scheduledTasks.values().forEach(TaskManager::stopScheduledTask); - scheduledTasks.clear(); - } - /** * Schedules a task for execution. * From e8147a1f8e9f66ded82b3aa67bc03dba03eb7c96 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sat, 4 Oct 2025 10:14:40 +0200 Subject: [PATCH 25/38] =?UTF-8?q?feat:=20=E2=9C=A8=20refactor=20task=20sys?= =?UTF-8?q?tem=20to=20support=20Jellyfin=20server=20versions=20>=2010.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔧 Refactor task architecture to extend AbstractTask for better scheduling 🔗 Integrate UsersListTask with proper authentication flow 📋 Add comprehensive users list handling and logging ⚡ Update task intervals and scheduling configuration 📚 Update documentation to reflect new task architecture - Convert ClientScanTask and UsersListTask to extend AbstractTask - Add task IDs, startup delays, and intervals for better control - Implement users list retrieval with detailed logging - Add token authentication in CONFIGURED state - Replace UpdateTask with UsersListTask in CONNECTED state - Update TaskFactory to support UsersListTask creation - Remove outdated architecture references from documentation Addresses issue #17674 for Jellyfin server compatibility Signed-off-by: Patrik Gfeller --- .../CONTRIBUTION.md | 42 ++++--------------- .../internal/handler/ServerHandler.java | 32 ++++++++++++++ .../internal/handler/TaskManager.java | 4 +- .../handler/tasks/ClientScanTask.java | 11 ++++- .../handler/tasks/ConnectionTask.java | 2 +- .../internal/handler/tasks/TaskFactory.java | 15 +++++++ .../internal/handler/tasks/UpdateTask.java | 1 + .../internal/handler/tasks/UsersListTask.java | 11 ++++- 8 files changed, 78 insertions(+), 40 deletions(-) diff --git a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md index e86e5eee1a38b..88178d7db8c7d 100644 --- a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md +++ b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md @@ -13,21 +13,18 @@ classDiagram AbstractTask <|-- UpdateTask AbstractTask <|-- UsersListTask AbstractTask <|-- ClientScanTask - ExceptionHandlerType <|.. ExceptionHandler + %% Class dependencies and usage relationships HandlerFactory --> ApiClientFactory : uses ServerHandler --> ApiClient : uses - ServerHandler --> ExceptionHandler : uses ServerHandler --> Configuration : uses ServerHandler --> TaskFactory : uses ServerHandler --> TaskManager : uses - ServerHandler --> ServerState : uses ServerDiscoveryService ..> ServerDiscovery : creates ServerDiscoveryService --> BindingConfiguration : uses TaskFactory ..> AbstractTask : creates TaskManager --> AbstractTask : manages - TaskManager --> ServerState : evaluates ServerDiscovery ..> ServerDiscoveryResult : creates ApiClientFactory ..> ApiClient : creates HandlerFactory ..> ServerHandler : creates @@ -41,7 +38,6 @@ classDiagram +initialize() +handleCommand() +dispose() - -transitionToState(ServerState) } class TaskManager { @@ -53,17 +49,6 @@ classDiagram +static stopAllTasks(Map) } - class ServerState { - <> - INITIALIZING - DISCOVERED - NEEDS_AUTHENTICATION - CONFIGURED - CONNECTED - ERROR - DISPOSED - } - class ApiClientFactory { +createApiClient() ApiClient } @@ -76,7 +61,6 @@ classDiagram class ServerDiscoveryService { +startScan() - -createServerDiscovery() ServerDiscovery } class ServerDiscovery { @@ -101,15 +85,6 @@ classDiagram +createUpdateTask(...) AbstractTask } - class ExceptionHandlerType { - <> - +handle(Exception) - } - - class ExceptionHandler { - +handle(Exception) - } - class Configuration { +String hostname +int port @@ -158,15 +133,12 @@ classDiagram 1. **HandlerFactory**: Creates thing handlers for the binding. 2. **ServerHandler**: Main bridge handler for Jellyfin servers that orchestrates server communication and state management. 3. **TaskManager**: Stateless utility class that manages task lifecycle operations based on server state transitions. -4. **ServerState**: Enumeration defining server states (INITIALIZING, DISCOVERED, NEEDS_AUTHENTICATION, CONFIGURED, CONNECTED, ERROR, DISPOSED) and their required task sets. -5. **ApiClientFactory**: Creates API client instances for different API versions. -6. **ApiClient**: Handles communication with the Jellyfin server and manages authentication. -7. **ServerDiscoveryService**: Discovers Jellyfin servers on the network using UDP broadcasts. -8. **TaskFactory**: Creates various task instances used for server communication. -9. **AbstractTask**: Base class for all tasks that can be scheduled for execution. -10. **BindingConfiguration**: Contains configuration settings for the binding. -11. **ExceptionHandlerType**: Interface defining the contract for exception handling. -12. **ExceptionHandler**: Implementation of ExceptionHandlerType that handles exceptions during binding operation. +4. **ApiClientFactory**: Creates API client instances for different API versions. +5. **ApiClient**: Handles communication with the Jellyfin server and manages authentication. +6. **ServerDiscoveryService**: Discovers Jellyfin servers on the network using UDP broadcasts. +7. **TaskFactory**: Creates various task instances used for server communication. +8. **AbstractTask**: Base class for all tasks that can be scheduled for execution. +9. **BindingConfiguration**: Contains configuration settings for the binding. ## Architecture Overview diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index ddcf1bf357748..72d5f1b4139c5 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -15,6 +15,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.concurrent.ScheduledFuture; @@ -24,11 +25,13 @@ import org.openhab.binding.jellyfin.internal.Constants; import org.openhab.binding.jellyfin.internal.api.ApiClient; import org.openhab.binding.jellyfin.internal.api.generated.current.model.SystemInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UserDto; import org.openhab.binding.jellyfin.internal.exceptions.ExceptionHandler; import org.openhab.binding.jellyfin.internal.handler.tasks.AbstractTask; import org.openhab.binding.jellyfin.internal.handler.tasks.ConnectionTask; import org.openhab.binding.jellyfin.internal.handler.tasks.TaskFactory; import org.openhab.binding.jellyfin.internal.handler.tasks.UpdateTask; +import org.openhab.binding.jellyfin.internal.handler.tasks.UsersListTask; import org.openhab.binding.jellyfin.internal.types.ServerState; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.ChannelUID; @@ -73,6 +76,8 @@ public ServerHandler(Bridge bridge, ApiClient apiClient) { this.tasks.put(ConnectionTask.TASK_ID, TaskFactory.createConnectionTask(this.apiClient, systemInfo -> this.handleConnection(systemInfo), this.exceptionHandler)); this.tasks.put(UpdateTask.TASK_ID, TaskFactory.createUpdateTask(this.apiClient, this.exceptionHandler)); + this.tasks.put(UsersListTask.TASK_ID, TaskFactory.createUsersListTask(this.apiClient, + users -> this.handleUsersList(users), this.exceptionHandler)); // Additional tasks can be added here in the future } @@ -124,6 +129,7 @@ private ServerState determineState() { } else if (serverURI != null && !hasToken) { return ServerState.NEEDS_AUTHENTICATION; } else if (serverURI != null && hasToken) { + this.apiClient.authenticateWithToken(this.configuration.token); return ServerState.CONFIGURED; } } catch (URISyntaxException e) { @@ -261,6 +267,32 @@ private Object handleConnection(SystemInfo systemInfo) { return null; } + /** + * Handles the retrieved users list from the server + * + * @param users The list of users retrieved from the server + */ + private void handleUsersList(List users) { + try { + logger.info("Retrieved users list from Jellyfin server:"); + logger.info(" Total users: {}", users.size()); + + for (UserDto user : users) { + logger.info(" User: {} (ID: {}, Server: {})", user.getName(), user.getId(), user.getServerName()); + + if (user.getLastLoginDate() != null) { + logger.info(" Last login: {}", user.getLastLoginDate()); + } + if (user.getLastActivityDate() != null) { + logger.info(" Last activity: {}", user.getLastActivityDate()); + } + } + } catch (Exception e) { + logger.warn("Failed to process users list: {}", e.getMessage(), e); + this.exceptionHandler.handle(e); + } + } + /** * Updates configuration from a URI * diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManager.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManager.java index 7cc507424ccfd..bc11cadf386d6 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManager.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManager.java @@ -22,7 +22,7 @@ import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.jellyfin.internal.handler.tasks.AbstractTask; import org.openhab.binding.jellyfin.internal.handler.tasks.ConnectionTask; -import org.openhab.binding.jellyfin.internal.handler.tasks.UpdateTask; +import org.openhab.binding.jellyfin.internal.handler.tasks.UsersListTask; import org.openhab.binding.jellyfin.internal.types.ServerState; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -61,7 +61,7 @@ public static List getTaskIdsForState(ServerState serverState) { case CONNECTED: // When connected, run update tasks to keep data synchronized // Note: Connection task stops automatically when successful - return List.of(UpdateTask.TASK_ID); + return List.of(UsersListTask.TASK_ID); case DISCOVERED: // For discovered servers, potentially run registration task in the future return List.of(); diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ClientScanTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ClientScanTask.java index 71217a0312e41..c80dff593fc3d 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ClientScanTask.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ClientScanTask.java @@ -29,7 +29,14 @@ * @author Patrik Gfeller - Initial contribution */ @NonNullByDefault -public class ClientScanTask implements Runnable { +public class ClientScanTask extends AbstractTask { + + /** Task ID for the client scan task */ + public static final String TASK_ID = "ClientScan"; + /** Default startup delay for the client scan task in seconds */ + public static final int DEFAULT_STARTUP_DELAY = 2; + /** Default interval for the client scan task in seconds */ + public static final int DEFAULT_INTERVAL = 30; private final Consumer> devicesHandler; private final ExceptionHandlerType exceptionHandler; @@ -46,6 +53,8 @@ public class ClientScanTask implements Runnable { */ public ClientScanTask(ApiClient client, UUID userId, Consumer> devicesHandler, ExceptionHandlerType exceptionHandler) { + super(TASK_ID, DEFAULT_STARTUP_DELAY, DEFAULT_INTERVAL); + this.devicesHandler = devicesHandler; this.exceptionHandler = exceptionHandler; this.client = client; diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ConnectionTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ConnectionTask.java index 8860299010b98..9d5c5f12b6811 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ConnectionTask.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/ConnectionTask.java @@ -32,7 +32,7 @@ public class ConnectionTask extends AbstractTask { /** Default startup delay for the connection task in seconds */ public static final int DEFAULT_STARTUP_DELAY = 0; /** Default interval for the connection task in seconds */ - public static final int DEFAULT_INTERVAL = 10; + public static final int DEFAULT_INTERVAL = 30; private final Consumer acceptedHandler; private final ExceptionHandlerType exceptionHandler; diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java index 9616dcf82f69a..4ce259bf8a746 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java @@ -12,11 +12,13 @@ */ package org.openhab.binding.jellyfin.internal.handler.tasks; +import java.util.List; import java.util.function.Consumer; import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.jellyfin.internal.api.ApiClient; import org.openhab.binding.jellyfin.internal.api.generated.current.model.SystemInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UserDto; import org.openhab.binding.jellyfin.internal.types.ExceptionHandlerType; /** @@ -50,4 +52,17 @@ public static ConnectionTask createConnectionTask(ApiClient client, Consumer> usersHandler, + ExceptionHandlerType exceptionHandler) { + return new UsersListTask(client, usersHandler, exceptionHandler); + } } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UpdateTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UpdateTask.java index c38b0d402526d..71400e0fae73d 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UpdateTask.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UpdateTask.java @@ -35,6 +35,7 @@ public class UpdateTask extends AbstractTask { public static final int DEFAULT_INTERVAL = 10; private final Logger logger = LoggerFactory.getLogger(UpdateTask.class); + @SuppressWarnings("unused") // TODO: Will be used when update logic is implemented private final ApiClient client; private final ExceptionHandlerType exceptionHandler; diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UsersListTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UsersListTask.java index 1a8a9d406edab..afa228b7d3ebf 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UsersListTask.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UsersListTask.java @@ -34,7 +34,14 @@ * @author Patrik Gfeller - Initial contribution */ @NonNullByDefault -public class UsersListTask implements Runnable { +public class UsersListTask extends AbstractTask { + + /** Task ID for the users list task */ + public static final String TASK_ID = "UsersList"; + /** Default startup delay for the users list task in seconds */ + public static final int DEFAULT_STARTUP_DELAY = 5; + /** Default interval for the users list task in seconds */ + public static final int DEFAULT_INTERVAL = 60; private final Consumer> usersHandler; private final ExceptionHandlerType exceptionHandler; @@ -49,6 +56,8 @@ public class UsersListTask implements Runnable { */ public UsersListTask(ApiClient client, Consumer> usersHandler, ExceptionHandlerType exceptionHandler) { + super(TASK_ID, DEFAULT_STARTUP_DELAY, DEFAULT_INTERVAL); + this.usersHandler = usersHandler; this.exceptionHandler = exceptionHandler; this.client = client; From a0e55b78c66e8ed6333ff19222b2a5eb5eb24f4b Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sat, 4 Oct 2025 22:14:37 +0200 Subject: [PATCH 26/38] =?UTF-8?q?feat(jellyfin):=20=E2=9C=A8=20add=20custo?= =?UTF-8?q?m=20UUID=20deserializer=20for=20server=20versions=20>=2010.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔧 Implement custom UUID deserializer to handle Jellyfin's 32-character UUID format 📦 Extend ApiClient with custom ObjectMapper configuration 🔗 Update import statements to use custom ApiClient instead of generated one 🛠️ Enhance UsersListTask to properly handle authentication headers 🧪 Add comprehensive test suite for UUID deserialization This change enables compatibility with Jellyfin server versions > 10.8 by: - Creating UuidDeserializer to convert 32-char UUIDs to standard format - Registering custom deserializer in ApiClient's ObjectMapper - Adding proper authentication header handling in HTTP requests - Providing extensive unit and integration tests Fixes #17674 Signed-off-by: Patrik Gfeller --- .../jellyfin/internal/api/ApiClient.java | 48 ++++ .../internal/api/ApiClientFactory.java | 10 +- .../internal/api/util/UuidDeserializer.java | 56 +++++ .../discovery/ServerDiscoveryService.java | 2 +- .../internal/handler/tasks/UsersListTask.java | 12 +- .../internal/api/util/ApiClientUuidTest.java | 78 +++++++ .../util/UuidDeserializerIntegrationTest.java | 206 ++++++++++++++++++ .../api/util/UuidDeserializerTest.java | 106 +++++++++ 8 files changed, 511 insertions(+), 7 deletions(-) create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/util/UuidDeserializer.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/test/java/org/openhab/binding/jellyfin/internal/api/util/ApiClientUuidTest.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/test/java/org/openhab/binding/jellyfin/internal/api/util/UuidDeserializerIntegrationTest.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/test/java/org/openhab/binding/jellyfin/internal/api/util/UuidDeserializerTest.java diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClient.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClient.java index 5203b9984cbe8..9a8357aa4d397 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClient.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClient.java @@ -12,11 +12,59 @@ */ package org.openhab.binding.jellyfin.internal.api; +import java.net.http.HttpClient; +import java.util.UUID; + import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.jellyfin.internal.api.util.UuidDeserializer; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.module.SimpleModule; @NonNullByDefault public class ApiClient extends org.openhab.binding.jellyfin.internal.api.generated.ApiClient { + /** + * Create an instance of ApiClient. + */ + public ApiClient() { + // Use the custom constructor with our ObjectMapper + this(createDefaultHttpClientBuilder(), createDefaultObjectMapper(), "http://localhost"); + } + + /** + * Create an instance of ApiClient. + * + * @param builder Http client builder. + * @param mapper Object mapper. + * @param baseUri Base URI + */ + public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { + super(builder, mapper, baseUri); + } + + /** + * Creates the default ObjectMapper with custom UUID deserializer for Jellyfin compatibility. + * + *

+ * This method extends the generated ApiClient's createDefaultObjectMapper to add a custom + * UUID deserializer that can handle Jellyfin's 32-character UUID format. + *

+ * + * @return ObjectMapper configured for Jellyfin API compatibility + */ + public static ObjectMapper createDefaultObjectMapper() { + // Start with the default configuration from the generated ApiClient + ObjectMapper mapper = org.openhab.binding.jellyfin.internal.api.generated.ApiClient.createDefaultObjectMapper(); + + // Register custom UUID deserializer to handle Jellyfin's 32-character UUID format + SimpleModule uuidModule = new SimpleModule(); + uuidModule.addDeserializer(UUID.class, new UuidDeserializer()); + mapper.registerModule(uuidModule); + + return mapper; + } + /** * Sets the API token for authenticating with the Jellyfin server. * This will add an Authorization header to all outgoing requests. diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClientFactory.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClientFactory.java index da758df7c10e8..a80278f61d4d7 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClientFactory.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClientFactory.java @@ -30,10 +30,12 @@ public ApiClientFactory() { } /** - * Creates a new ApiClient instance configured with the HTTP client factory. - * - * @param baseUrl The base URL for the Jellyfin server - * @return A configured ApiClient instance + * Creates and configures a new instance of {@link ApiClient}. + *

+ * The client is initialized and can be further configured with an HTTP client factory and a base URL. + * Additional configuration steps can be added as needed. + * + * @return a newly created and partially configured {@link ApiClient} instance */ public ApiClient createApiClient() { ApiClient client = new ApiClient(); diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/util/UuidDeserializer.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/util/UuidDeserializer.java new file mode 100644 index 0000000000000..7c3434e40c4e4 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/util/UuidDeserializer.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.util; + +import java.io.IOException; +import java.util.UUID; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; + +/** + * Custom UUID deserializer for Jellyfin API responses. + * + * Jellyfin servers return UUIDs as 32-character strings without hyphens, + * but Jackson's default UUID deserializer expects the standard 36-character + * format with hyphens. This deserializer handles both formats. + * + * @author Patrik Gfeller - Initial contribution + */ +@NonNullByDefault +public class UuidDeserializer extends JsonDeserializer { + + @Override + public @Nullable UUID deserialize(JsonParser parser, DeserializationContext context) throws IOException { + String value = parser.getValueAsString(); + if (value == null || value.isEmpty()) { + return null; + } + + // If the UUID string is 32 characters long (without hyphens), format it properly + if (value.length() == 32 && !value.contains("-")) { + // Format: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + // To: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + String formattedUuid = value.substring(0, 8) + "-" + value.substring(8, 12) + "-" + value.substring(12, 16) + + "-" + value.substring(16, 20) + "-" + value.substring(20); + return UUID.fromString(formattedUuid); + } else { + // Use standard UUID parsing for properly formatted UUIDs + return UUID.fromString(value); + } + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java index 59feb5eb5791a..fbfc19221a1c2 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/discovery/ServerDiscoveryService.java @@ -20,7 +20,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.jellyfin.internal.BindingConfiguration; import org.openhab.binding.jellyfin.internal.Constants; -import org.openhab.binding.jellyfin.internal.api.generated.ApiClient; +import org.openhab.binding.jellyfin.internal.api.ApiClient; import org.openhab.binding.jellyfin.internal.api.generated.ApiException; import org.openhab.binding.jellyfin.internal.api.generated.current.SystemApi; import org.openhab.core.config.discovery.AbstractDiscoveryService; diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UsersListTask.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UsersListTask.java index afa228b7d3ebf..1ae42993e3326 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UsersListTask.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/UsersListTask.java @@ -68,9 +68,17 @@ public void run() { try { // Since we couldn't find a direct method in the API, we'll use a direct HTTP request // to the /Users endpoint which returns a list of users - HttpRequest request = HttpRequest.newBuilder().uri(URI.create(client.getBaseUri() + "/Users")) - .header("Accept", "application/json").GET().build(); + // The API client's interceptoris used to leverage the configured authentication token + HttpRequest.Builder requestBuilder = HttpRequest.newBuilder() + .uri(URI.create(client.getBaseUri() + "/Users")).header("Accept", "application/json").GET(); + // Apply the request interceptor to add authentication headers + Consumer interceptor = client.getRequestInterceptor(); + if (interceptor != null) { + interceptor.accept(requestBuilder); + } + + HttpRequest request = requestBuilder.build(); HttpResponse response = client.getHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); if (response.statusCode() != 200) { diff --git a/bundles/org.openhab.binding.jellyfin/src/test/java/org/openhab/binding/jellyfin/internal/api/util/ApiClientUuidTest.java b/bundles/org.openhab.binding.jellyfin/src/test/java/org/openhab/binding/jellyfin/internal/api/util/ApiClientUuidTest.java new file mode 100644 index 0000000000000..786a3b1457586 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/test/java/org/openhab/binding/jellyfin/internal/api/util/ApiClientUuidTest.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.util; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import org.junit.jupiter.api.Test; +import org.openhab.binding.jellyfin.internal.api.ApiClient; + +import com.fasterxml.jackson.databind.ObjectMapper; + +/** + * Test to verify that the custom ApiClient correctly uses the UUID deserializer + * + * @author Patrik Gfeller - Initial contribution + */ +public class ApiClientUuidTest { + + @Test + public void testApiClientUsesCustomUuidDeserializer() throws Exception { + // Create an ApiClient and get its ObjectMapper + ApiClient client = new ApiClient(); + ObjectMapper mapper = client.getObjectMapper(); + + // Test with a simple JSON containing a 32-character UUID + String jsonWithJellyfinUuid = """ + { + "id": "05e66d53183c4be4986c18d7e12694be", + "name": "test" + } + """; + + // This should work without throwing an exception + TestDto result = mapper.readValue(jsonWithJellyfinUuid, TestDto.class); + + assertNotNull(result); + assertNotNull(result.id); + assertEquals("test", result.name); + // Verify the UUID is correctly converted + assertEquals("05e66d53-183c-4be4-986c-18d7e12694be", result.id.toString()); + } + + @Test + public void testApiClientCreateDefaultObjectMapper() throws Exception { + // Test the static method directly + ObjectMapper mapper = ApiClient.createDefaultObjectMapper(); + + String jsonWithJellyfinUuid = """ + { + "id": "cc89f0df805247a5aab1fe3d27b19183", + "name": "openhab" + } + """; + + TestDto result = mapper.readValue(jsonWithJellyfinUuid, TestDto.class); + + assertNotNull(result); + assertNotNull(result.id); + assertEquals("openhab", result.name); + assertEquals("cc89f0df-8052-47a5-aab1-fe3d27b19183", result.id.toString()); + } + + public static class TestDto { + public java.util.UUID id; + public String name; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/test/java/org/openhab/binding/jellyfin/internal/api/util/UuidDeserializerIntegrationTest.java b/bundles/org.openhab.binding.jellyfin/src/test/java/org/openhab/binding/jellyfin/internal/api/util/UuidDeserializerIntegrationTest.java new file mode 100644 index 0000000000000..b45552497bd04 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/test/java/org/openhab/binding/jellyfin/internal/api/util/UuidDeserializerIntegrationTest.java @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.util; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.util.List; +import java.util.UUID; + +import org.junit.jupiter.api.Test; +import org.openhab.binding.jellyfin.internal.api.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UserDto; + +import com.fasterxml.jackson.core.type.TypeReference; + +/** + * Integration test demonstrating the UUID deserialization fix with actual Jellyfin JSON data + * + * @author Patrik Gfeller - Initial contribution + */ +public class UuidDeserializerIntegrationTest { + + @Test + public void testRealJellyfinUserResponseDeserialization() throws Exception { + // This is the actual JSON response that was causing the deserialization error + String jellyfinUsersResponse = """ + [ + { + "Name": "admin", + "ServerId": "f7873c7a09f94f358321478d31cf3f97", + "Id": "05e66d53183c4be4986c18d7e12694be", + "HasPassword": true, + "HasConfiguredPassword": true, + "HasConfiguredEasyPassword": false, + "EnableAutoLogin": false, + "LastLoginDate": "2024-11-06T00:40:18.8487902Z", + "LastActivityDate": "2024-11-06T00:40:18.8487902Z", + "Configuration": { + "PlayDefaultAudioTrack": true, + "SubtitleLanguagePreference": "", + "DisplayMissingEpisodes": false, + "GroupedFolders": [], + "SubtitleMode": "Default", + "DisplayCollectionsView": false, + "EnableLocalPassword": false, + "OrderedViews": [], + "LatestItemsExcludes": [], + "MyMediaExcludes": [], + "HidePlayedInLatest": true, + "RememberAudioSelections": true, + "RememberSubtitleSelections": true, + "EnableNextEpisodeAutoPlay": true + }, + "Policy": { + "IsAdministrator": true, + "IsHidden": true, + "EnableCollectionManagement": false, + "EnableSubtitleManagement": false, + "EnableLyricManagement": false, + "IsDisabled": false, + "BlockedTags": [], + "AllowedTags": [], + "EnableUserPreferenceAccess": true, + "AccessSchedules": [], + "BlockUnratedItems": [], + "EnableRemoteControlOfOtherUsers": true, + "EnableSharedDeviceControl": true, + "EnableRemoteAccess": true, + "EnableLiveTvManagement": true, + "EnableLiveTvAccess": true, + "EnableMediaPlayback": true, + "EnableAudioPlaybackTranscoding": true, + "EnableVideoPlaybackTranscoding": true, + "EnablePlaybackRemuxing": true, + "ForceRemoteSourceTranscoding": false, + "EnableContentDeletion": true, + "EnableContentDeletionFromFolders": [], + "EnableContentDownloading": true, + "EnableSyncTranscoding": true, + "EnableMediaConversion": true, + "EnabledDevices": [], + "EnableAllDevices": true, + "EnabledChannels": [], + "EnableAllChannels": true, + "EnabledFolders": [], + "EnableAllFolders": true, + "InvalidLoginAttemptCount": 0, + "LoginAttemptsBeforeLockout": -1, + "MaxActiveSessions": 0, + "EnablePublicSharing": true, + "BlockedMediaFolders": [], + "BlockedChannels": [], + "RemoteClientBitrateLimit": 0, + "AuthenticationProviderId": "Jellyfin.Server.Implementations.Users.DefaultAuthenticationProvider", + "PasswordResetProviderId": "Jellyfin.Server.Implementations.Users.DefaultPasswordResetProvider", + "SyncPlayAccess": "CreateAndJoinGroups" + } + }, + { + "Name": "openhab", + "ServerId": "f7873c7a09f94f358321478d31cf3f97", + "Id": "cc89f0df805247a5aab1fe3d27b19183", + "HasPassword": true, + "HasConfiguredPassword": true, + "HasConfiguredEasyPassword": false, + "EnableAutoLogin": false, + "LastLoginDate": "2024-11-06T00:51:53.1062821Z", + "LastActivityDate": "2025-09-26T22:31:40.2025129Z", + "Configuration": { + "PlayDefaultAudioTrack": true, + "SubtitleLanguagePreference": "", + "DisplayMissingEpisodes": false, + "GroupedFolders": [], + "SubtitleMode": "Default", + "DisplayCollectionsView": false, + "EnableLocalPassword": false, + "OrderedViews": [], + "LatestItemsExcludes": [], + "MyMediaExcludes": [], + "HidePlayedInLatest": true, + "RememberAudioSelections": true, + "RememberSubtitleSelections": true, + "EnableNextEpisodeAutoPlay": true + }, + "Policy": { + "IsAdministrator": false, + "IsHidden": true, + "EnableCollectionManagement": false, + "EnableSubtitleManagement": false, + "EnableLyricManagement": false, + "IsDisabled": false, + "BlockedTags": [], + "AllowedTags": [], + "EnableUserPreferenceAccess": true, + "AccessSchedules": [], + "BlockUnratedItems": [], + "EnableRemoteControlOfOtherUsers": true, + "EnableSharedDeviceControl": true, + "EnableRemoteAccess": true, + "EnableLiveTvManagement": true, + "EnableLiveTvAccess": true, + "EnableMediaPlayback": true, + "EnableAudioPlaybackTranscoding": true, + "EnableVideoPlaybackTranscoding": true, + "EnablePlaybackRemuxing": true, + "ForceRemoteSourceTranscoding": false, + "EnableContentDeletion": false, + "EnableContentDeletionFromFolders": [], + "EnableContentDownloading": true, + "EnableSyncTranscoding": true, + "EnableMediaConversion": true, + "EnabledDevices": [], + "EnableAllDevices": true, + "EnabledChannels": [], + "EnableAllChannels": false, + "EnabledFolders": [], + "EnableAllFolders": true, + "InvalidLoginAttemptCount": 0, + "LoginAttemptsBeforeLockout": -1, + "MaxActiveSessions": 0, + "EnablePublicSharing": true, + "BlockedMediaFolders": [], + "BlockedChannels": [], + "RemoteClientBitrateLimit": 0, + "AuthenticationProviderId": "Jellyfin.Server.Implementations.Users.DefaultAuthenticationProvider", + "PasswordResetProviderId": "Jellyfin.Server.Implementations.Users.DefaultPasswordResetProvider", + "SyncPlayAccess": "CreateAndJoinGroups" + } + } + ] + """; + + // Use the actual ApiClient ObjectMapper configuration (which now includes our custom UUID deserializer) + var objectMapper = ApiClient.createDefaultObjectMapper(); + + // This should now work without throwing the UUID deserialization error + List users = objectMapper.readValue(jellyfinUsersResponse, new TypeReference>() { + }); + + assertNotNull(users); + assertEquals(2, users.size()); + + // Verify the first user + UserDto adminUser = users.get(0); + assertEquals("admin", adminUser.getName()); + assertEquals(UUID.fromString("05e66d53-183c-4be4-986c-18d7e12694be"), adminUser.getId()); + assertEquals("f7873c7a09f94f358321478d31cf3f97", adminUser.getServerId()); + + // Verify the second user + UserDto openhabUser = users.get(1); + assertEquals("openhab", openhabUser.getName()); + assertEquals(UUID.fromString("cc89f0df-8052-47a5-aab1-fe3d27b19183"), openhabUser.getId()); + assertEquals("f7873c7a09f94f358321478d31cf3f97", openhabUser.getServerId()); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/test/java/org/openhab/binding/jellyfin/internal/api/util/UuidDeserializerTest.java b/bundles/org.openhab.binding.jellyfin/src/test/java/org/openhab/binding/jellyfin/internal/api/util/UuidDeserializerTest.java new file mode 100644 index 0000000000000..cf1e5eadd8e6b --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/test/java/org/openhab/binding/jellyfin/internal/api/util/UuidDeserializerTest.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.api.util; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.util.UUID; + +import org.junit.jupiter.api.Test; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UserDto; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.module.SimpleModule; + +/** + * Unit tests for {@link UuidDeserializer} + * + * @author Patrik Gfeller - Initial contribution + */ +public class UuidDeserializerTest { + + @Test + public void testDeserializeJellyfinUuidFormat() throws Exception { + // Create ObjectMapper with our custom UUID deserializer and JavaTimeModule + ObjectMapper mapper = new ObjectMapper(); + SimpleModule uuidModule = new SimpleModule(); + uuidModule.addDeserializer(UUID.class, new UuidDeserializer()); + mapper.registerModule(uuidModule); + mapper.registerModule(new com.fasterxml.jackson.datatype.jsr310.JavaTimeModule()); + + // Test JSON from Jellyfin with 32-character UUID (without hyphens) + String jellyfinUserJson = """ + { + "Name": "testuser", + "ServerId": "f7873c7a09f94f358321478d31cf3f97", + "Id": "05e66d53183c4be4986c18d7e12694be", + "HasPassword": true, + "HasConfiguredPassword": true, + "HasConfiguredEasyPassword": false, + "EnableAutoLogin": false, + "LastLoginDate": "2024-11-06T00:40:18.8487902Z", + "LastActivityDate": "2024-11-06T00:40:18.8487902Z", + "Configuration": {}, + "Policy": {} + } + """; + + // This should now work without throwing an exception + UserDto user = mapper.readValue(jellyfinUserJson, UserDto.class); + + assertNotNull(user); + assertEquals("testuser", user.getName()); + + // Verify the UUID was properly parsed + UUID expectedId = UUID.fromString("05e66d53-183c-4be4-986c-18d7e12694be"); + assertEquals(expectedId, user.getId()); + } + + @Test + public void testDeserializeStandardUuidFormat() throws Exception { + // Create ObjectMapper with our custom UUID deserializer and JavaTimeModule + ObjectMapper mapper = new ObjectMapper(); + SimpleModule uuidModule = new SimpleModule(); + uuidModule.addDeserializer(UUID.class, new UuidDeserializer()); + mapper.registerModule(uuidModule); + mapper.registerModule(new com.fasterxml.jackson.datatype.jsr310.JavaTimeModule()); + + // Test JSON with standard 36-character UUID (with hyphens) + String standardUserJson = """ + { + "Name": "testuser", + "ServerId": "f7873c7a-09f9-4f35-8321-478d31cf3f97", + "Id": "05e66d53-183c-4be4-986c-18d7e12694be", + "HasPassword": true, + "HasConfiguredPassword": true, + "HasConfiguredEasyPassword": false, + "EnableAutoLogin": false, + "LastLoginDate": "2024-11-06T00:40:18.8487902Z", + "LastActivityDate": "2024-11-06T00:40:18.8487902Z", + "Configuration": {}, + "Policy": {} + } + """; + + // This should also work (standard format should still be supported) + UserDto user = mapper.readValue(standardUserJson, UserDto.class); + + assertNotNull(user); + assertEquals("testuser", user.getName()); + + // Verify the UUID was properly parsed + UUID expectedId = UUID.fromString("05e66d53-183c-4be4-986c-18d7e12694be"); + assertEquals(expectedId, user.getId()); + } +} From 6e2b1ccc303f0f16e6e03b23a3689fd7c63c3396 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sun, 5 Oct 2025 21:17:07 +0200 Subject: [PATCH 27/38] =?UTF-8?q?docs:=20=F0=9F=93=9A=20add=20AI=20develop?= =?UTF-8?q?ment=20guide=20for=20Jellyfin=20binding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add comprehensive .github/copilot-instructions.md for AI coding agents - Document openHAB bridge/handler architecture patterns - Cover UUID compatibility fixes and generated API layer - Include task management, discovery services, and error handling patterns - Provide build workflows and testing conventions - Reference key files and integration dependencies Signed-off-by: pgfeller --- .../.github/copilot-instructions.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md diff --git a/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md b/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md new file mode 100644 index 0000000000000..bc6e3463c2494 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md @@ -0,0 +1,106 @@ +# Jellyfin Binding for openHAB - AI Development Guide + +## Project Overview +This is an **openHAB binding** for Jellyfin media servers, built as an OSGi bundle in Java 21 following openHAB's addon architecture patterns. The binding enables home automation control of Jellyfin servers and their connected clients through openHAB's Thing/Channel model. + +## Architecture Essentials + +### Core Components Structure +- **Bridge Pattern**: `JellyfinServerHandler` acts as a bridge for discovering and managing multiple `JellyfinClientHandler` instances +- **Handler Factory**: `JellyfinHandlerFactory` extends `BaseThingHandlerFactory` - the standard openHAB pattern for creating Thing handlers +- **Discovery Services**: Auto-discover Jellyfin servers via UDP broadcast (`JellyfinServerDiscoveryService`) and clients via server API (`JellyfinClientDiscoveryService`) +- **API Layer**: Generated Jellyfin API clients in `internal/api/generated/` with custom wrapper in `ApiClient.java` for UUID handling compatibility + +### Thing Type Hierarchy +``` +jellyfin:server (Bridge) -> jellyfin:client (Thing) +``` +- Server bridges authenticate and manage API connections +- Client things represent controllable devices (Android TV, web clients, etc.) +- All Thing types defined in `Constants.java` as `ThingTypeUID` constants + +### Configuration Files Locations +- Thing definitions: `src/main/resources/OH-INF/thing/thing-types.xml` +- Channel definitions: `src/main/resources/OH-INF/thing/thing-types.xml` +- Binding config: `src/main/resources/OH-INF/addon/addon.xml` +- i18n properties: `src/main/resources/OH-INF/i18n/` + +## Critical Development Patterns + +### Handler Implementation +- All handlers extend `BaseBridgeHandler` (servers) or `BaseThingHandler` (clients) +- Use `@NonNullByDefault` annotation consistently across all classes +- Implement async task patterns via `TaskManager` and `AbstractTask` subclasses in `handler/tasks/` +- Bridge handlers must manage child discovery services registration/unregistration + +### API Client Usage +- **UUID Compatibility**: Jellyfin servers return inconsistent UUID formats - custom `UuidDeserializer` handles this in `ApiClient.java` +- **Version Support**: Generated API supports both current (10.10.7+) and legacy versions - check `api/generated/current/` vs `api/generated/legacy/` +- **HTTP Client**: Use injected `HttpClientFactory` for HTTP connections, not direct `HttpClient` instantiation + +### Discovery Service Pattern +```java +@Component(service = DiscoveryService.class, immediate = true) +public class JellyfinServerDiscoveryService extends AbstractDiscoveryService { + // Manual trigger only - no background scanning +} +``` + +### Task Management +- Long-running operations use `TaskManager` with `AbstractTask` implementations +- Connection tasks, update polling, and API calls all follow this pattern +- Tasks handle their own error recovery and state management + +## Build & Test Workflow + +### Build System +- **Maven**: Standard openHAB addon build via `mvn clean install` +- **Quick Build**: Use provided VS Code task "Build" or `.vscode/scripts/build.sh` +- **Java Version**: Requires Java 21 (configured in build script) +- **Dependencies**: Jackson 2.19.0 for JSON processing, standard openHAB core dependencies + +### Testing Patterns +- Unit tests in `src/test/java/` focus on UUID deserialization and API client functionality +- Test files: `ApiClientUuidTest`, `UuidDeserializerTest`, `UuidDeserializerIntegrationTest` +- Use JUnit 5 with openHAB test fixtures + +### Code Generation +- Jellyfin API classes are **generated** from OpenAPI specs (see `logs/endpoints/` for discovered endpoints) +- **Never edit** files in `api/generated/` directly +- Custom logic goes in wrapper classes like `ApiClient.java` and `ApiClientFactory.java` + +## Domain-Specific Conventions + +### Channel Naming +- Use hyphenated lowercase: `playing-item-percentage`, `send-notification` +- Media control channels follow openHAB Player item conventions +- All channel IDs defined as constants in `Constants.java` + +### Authentication Flow +- Server things require `userId` and `token` configuration +- Binding provides web UI at `/jellyfin/` for OAuth-like login assistance +- Authentication state managed in `ServerHandler` with connection tasks + +### Error Handling +- Use `ExceptionHandler` and `ExceptionHandlerType` enum for consistent error categorization +- Bridge status drives child thing status - children go offline when bridge disconnects +- Failed API calls should not crash handlers - log and set appropriate Thing status + +### Media Search Syntax +- Supports prefixed search: ``, `` +- Default behavior: search by name starting with given text +- Implementation in server handler's channel command processing + +## Key Files for Understanding +- `Constants.java` - All binding constants and channel definitions +- `JellyfinHandlerFactory.java` - Entry point and handler creation +- `ServerHandler.java` - Bridge logic and API management +- `ApiClient.java` - Custom API wrapper with UUID fixes +- `TaskManager.java` - Async operation patterns +- `README.md` - User documentation and channel descriptions + +## Integration Dependencies +- **openHAB Core**: Thing management, discovery services, channel types +- **Jellyfin API**: HTTP REST API with JSON responses +- **OSGi**: Bundle lifecycle and dependency injection via `@Component` annotations +- **Jackson**: JSON deserialization with custom UUID handling \ No newline at end of file From dc005bc6c02ef973db12f43d813552fe2460a0f0 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sun, 5 Oct 2025 21:20:26 +0200 Subject: [PATCH 28/38] chore: remove unused .directory file from Jellyfin binding Signed-off-by: Patrik Gfeller --- bundles/org.openhab.binding.jellyfin/.directory | 1 - 1 file changed, 1 deletion(-) delete mode 100644 bundles/org.openhab.binding.jellyfin/.directory diff --git a/bundles/org.openhab.binding.jellyfin/.directory b/bundles/org.openhab.binding.jellyfin/.directory deleted file mode 100644 index d226fba3bbc85..0000000000000 --- a/bundles/org.openhab.binding.jellyfin/.directory +++ /dev/null @@ -1 +0,0 @@ -[Desktop Entry] From 414ba0c1c7ae39e0d70ed8432569fa9e336dc41e Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sun, 5 Oct 2025 21:36:09 +0200 Subject: [PATCH 29/38] =?UTF-8?q?docs:=20=F0=9F=93=9A=20update=20API=20cli?= =?UTF-8?q?ent=20documentation=20for=20clarity=20and=20deprecated=20file?= =?UTF-8?q?=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrik Gfeller --- .../.github/copilot-instructions.md | 1 + .../openhab/binding/jellyfin/internal/api/ApiClientFactory.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md b/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md index bc6e3463c2494..b703699c73f12 100644 --- a/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md +++ b/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md @@ -67,6 +67,7 @@ public class JellyfinServerDiscoveryService extends AbstractDiscoveryService { ### Code Generation - Jellyfin API classes are **generated** from OpenAPI specs (see `logs/endpoints/` for discovered endpoints) - **Never edit** files in `api/generated/` directly +- **Ignore files with `._ suffix** - these are deprecated/backup files and should not be modified - Custom logic goes in wrapper classes like `ApiClient.java` and `ApiClientFactory.java` ## Domain-Specific Conventions diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClientFactory.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClientFactory.java index a80278f61d4d7..4fc46707e2638 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClientFactory.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/api/ApiClientFactory.java @@ -18,7 +18,7 @@ import org.osgi.service.component.annotations.ServiceScope; /** - * JellyfinApiClient is a API client for interacting with the Jellyfin server. + * Factory for creating and configuring {@link ApiClient} instances for Jellyfin server interactions. * * @author Patrik Gfeller - Initial Contribution */ From d262f06577a7a6aa8e7db6bbecbcbd5c4896d9f1 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sun, 5 Oct 2025 21:43:01 +0200 Subject: [PATCH 30/38] refactor: remove redundant logging of server information in handleConnection method Signed-off-by: Patrik Gfeller --- .../jellyfin/internal/handler/ServerHandler.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index 72d5f1b4139c5..e2bb3dff85656 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -236,21 +236,7 @@ private synchronized Runnable initializeHandler() { private Object handleConnection(SystemInfo systemInfo) { try { - // Log all available server information at INFO level - logger.info("Jellyfin Server Information:"); - logger.info(" Server Name: {}", systemInfo.getServerName()); - logger.info(" Local Address: {}", systemInfo.getLocalAddress()); - logger.info(" Version: {}", systemInfo.getVersion()); - - // Update properties with server version - updateThingProperty(Constants.ServerProperties.SERVER_VERSION, systemInfo.getVersion()); - - logger.info(" Product Name: {}", systemInfo.getProductName()); - logger.info(" Server ID: {}", systemInfo.getId()); - logger.info(" Startup Wizard Completed: {}", systemInfo.getStartupWizardCompleted()); - logger.info(" Web Socket Port: {}", systemInfo.getWebSocketPortNumber()); - - // Update configuration with systemInfo data if available + this.updateThingProperty(Constants.ServerProperties.SERVER_VERSION, systemInfo.getVersion()); this.updateConfiguration(systemInfo); // Update state to connected From 7d3490abe69860eeeaa06cccbce785f106f344c5 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sun, 5 Oct 2025 22:39:52 +0200 Subject: [PATCH 31/38] =?UTF-8?q?=E2=9C=A8=20refactor:=20implement=20event?= =?UTF-8?q?-driven=20error=20handling=20architecture?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔄 Replace direct exception handling with Observer pattern: - Add ErrorEventBus for loose coupling between components - Introduce ContextualExceptionHandler for intelligent error categorization - Implement ErrorEventListener interface in ServerHandler - Add ErrorEvent with type, severity, and context information 🚀 Benefits: - Eliminates circular dependencies (Tasks → Handler → EventBus → ServerHandler) - Enables context-aware error handling with different severities - Improves thread safety with CopyOnWriteArrayList - Centralizes error logic while maintaining separation of concerns 🗂️ Renamed EventDrivenExceptionHandler → ContextualExceptionHandler for clarity 📝 Updated documentation: - Class diagram in CONTRIBUTION.md simplified and updated - Copilot instructions reflect new architecture patterns - Architecture overview explains Observer pattern implementation ⚠️ BREAKING CHANGE: ServerHandler now implements ErrorEventListener interface --- .../.github/copilot-instructions.md | 25 ++++-- .../CONTRIBUTION.md | 65 +++++++-------- .../jellyfin/internal/events/ErrorEvent.java | 66 +++++++++++++++ .../internal/events/ErrorEventBus.java | 63 ++++++++++++++ .../ErrorEventListener.java} | 19 ++--- .../ContextualExceptionHandler.java | 82 +++++++++++++++++++ .../internal/handler/ServerHandler.java | 81 ++++++++++++++---- 7 files changed, 333 insertions(+), 68 deletions(-) create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/events/ErrorEvent.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/events/ErrorEventBus.java rename bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/{exceptions/ExceptionHandler.java => events/ErrorEventListener.java} (60%) create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/ContextualExceptionHandler.java diff --git a/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md b/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md index b703699c73f12..5145d04823620 100644 --- a/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md +++ b/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md @@ -33,6 +33,18 @@ jellyfin:server (Bridge) -> jellyfin:client (Thing) - Implement async task patterns via `TaskManager` and `AbstractTask` subclasses in `handler/tasks/` - Bridge handlers must manage child discovery services registration/unregistration +### Event-Driven Error Handling +- **Observer Pattern**: Use `ErrorEventBus` with `ErrorEventListener` for loose coupling between error producers and consumers +- **Strategy Pattern**: `ContextualExceptionHandler` intelligently categorizes exceptions by type and severity +- **Error Events**: All errors are represented as `ErrorEvent` objects with context, type, and severity information +- **No Circular Dependencies**: Tasks → ContextualExceptionHandler → ErrorEventBus → ServerHandler (one-way flow) +- **Thread Safety**: `ErrorEventBus` uses `CopyOnWriteArrayList` for concurrent access + +### Error Classification +- **Error Types**: CONNECTION_ERROR, AUTHENTICATION_ERROR, API_ERROR, CONFIGURATION_ERROR, UNKNOWN_ERROR +- **Error Severities**: WARNING (log only), RECOVERABLE (error state, allow recovery), FATAL (error state, restart required) +- **Context-Aware**: Each task gets its own exception handler with specific context for better debugging + ### API Client Usage - **UUID Compatibility**: Jellyfin servers return inconsistent UUID formats - custom `UuidDeserializer` handles this in `ApiClient.java` - **Version Support**: Generated API supports both current (10.10.7+) and legacy versions - check `api/generated/current/` vs `api/generated/legacy/` @@ -49,15 +61,17 @@ public class JellyfinServerDiscoveryService extends AbstractDiscoveryService { ### Task Management - Long-running operations use `TaskManager` with `AbstractTask` implementations - Connection tasks, update polling, and API calls all follow this pattern -- Tasks handle their own error recovery and state management +- Tasks handle their own error recovery via event-driven exception handlers +- Each task receives a context-specific `ContextualExceptionHandler` ## Build & Test Workflow ### Build System - **Maven**: Standard openHAB addon build via `mvn clean install` -- **Quick Build**: Use provided VS Code task "Build" or `.vscode/scripts/build.sh` +- **Build Verification**: Always use Maven commands for checking modifications and compilation - **Java Version**: Requires Java 21 (configured in build script) - **Dependencies**: Jackson 2.19.0 for JSON processing, standard openHAB core dependencies +- **Note**: Do not use VS Code tasks for build verification - use Maven directly ### Testing Patterns - Unit tests in `src/test/java/` focus on UUID deserialization and API client functionality @@ -83,9 +97,10 @@ public class JellyfinServerDiscoveryService extends AbstractDiscoveryService { - Authentication state managed in `ServerHandler` with connection tasks ### Error Handling -- Use `ExceptionHandler` and `ExceptionHandlerType` enum for consistent error categorization -- Bridge status drives child thing status - children go offline when bridge disconnects -- Failed API calls should not crash handlers - log and set appropriate Thing status +- **Event-Driven Architecture**: Use `ErrorEventBus` and `ErrorEventListener` pattern instead of direct coupling +- **Exception Classification**: `ContextualExceptionHandler` automatically categorizes exceptions by type and severity +- **Context Preservation**: Each exception handler includes context information for better debugging +- **Strategy Pattern**: Different error types and severities trigger different response strategies in listeners ### Media Search Syntax - Supports prefixed search: ``, `` diff --git a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md index 88178d7db8c7d..2c54a1a5df9fa 100644 --- a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md +++ b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md @@ -8,26 +8,29 @@ The following diagram shows the main classes and their relationships within the ```mermaid classDiagram - %% Class inheritance relationships - AbstractTask <|-- ConnectionTask - AbstractTask <|-- UpdateTask - AbstractTask <|-- UsersListTask - AbstractTask <|-- ClientScanTask - + %% Interface implementations + ErrorEventListener <|.. ServerHandler %% Class dependencies and usage relationships HandlerFactory --> ApiClientFactory : uses ServerHandler --> ApiClient : uses - ServerHandler --> Configuration : uses ServerHandler --> TaskFactory : uses ServerHandler --> TaskManager : uses + ServerHandler --> ErrorEventBus : owns ServerDiscoveryService ..> ServerDiscovery : creates ServerDiscoveryService --> BindingConfiguration : uses TaskFactory ..> AbstractTask : creates TaskManager --> AbstractTask : manages ServerDiscovery ..> ServerDiscoveryResult : creates ApiClientFactory ..> ApiClient : creates + HandlerFactory --> ServerHandler : creates + ContextualExceptionHandler --> ErrorEventBus : publishes to + ErrorEventBus --> ErrorEventListener : notifies + TaskFactory --> ContextualExceptionHandler : creates HandlerFactory ..> ServerHandler : creates + EventDrivenExceptionHandler --> ErrorEventBus : publishes to + ErrorEventBus --> ErrorEventListener : notifies + TaskFactory --> EventDrivenExceptionHandler : creates %% Class definitions with key attributes and methods class HandlerFactory { @@ -38,6 +41,7 @@ classDiagram +initialize() +handleCommand() +dispose() + +onErrorEvent(ErrorEvent) } class TaskManager { @@ -64,9 +68,6 @@ classDiagram } class ServerDiscovery { - -int port - -int timeout - +ServerDiscovery(int port, int timeout) +discoverServers() List } @@ -85,20 +86,8 @@ classDiagram +createUpdateTask(...) AbstractTask } - class Configuration { - +String hostname - +int port - +boolean ssl - +String path - +String token - +getServerURI() URI - } - class BindingConfiguration { <> - +int discoveryPort - +int discoveryTimeout - +String discoveryMessage +static getConfiguration(ConfigurationAdmin) BindingConfiguration } @@ -109,22 +98,19 @@ classDiagram +String version } - class ConnectionTask { - %% Inherits run() from AbstractTask - } - - class UpdateTask { - %% Inherits run() from AbstractTask + class ErrorEventListener { + <> + +onErrorEvent(ErrorEvent) } - class UsersListTask { - %% Inherits run() from AbstractTask - %% Available but not currently used + class ErrorEventBus { + +addListener(ErrorEventListener) + +removeListener(ErrorEventListener) + +publishEvent(ErrorEvent) } - class ClientScanTask { - %% Inherits run() from AbstractTask - %% Available but not currently used + class ContextualExceptionHandler { + +handle(Exception) } ``` @@ -132,6 +118,7 @@ classDiagram 1. **HandlerFactory**: Creates thing handlers for the binding. 2. **ServerHandler**: Main bridge handler for Jellyfin servers that orchestrates server communication and state management. + Implements `ErrorEventListener` for event-driven error handling. 3. **TaskManager**: Stateless utility class that manages task lifecycle operations based on server state transitions. 4. **ApiClientFactory**: Creates API client instances for different API versions. 5. **ApiClient**: Handles communication with the Jellyfin server and manages authentication. @@ -139,16 +126,24 @@ classDiagram 7. **TaskFactory**: Creates various task instances used for server communication. 8. **AbstractTask**: Base class for all tasks that can be scheduled for execution. 9. **BindingConfiguration**: Contains configuration settings for the binding. +10. **ErrorEventBus**: Central event bus for error events using the Observer pattern, providing loose coupling between error producers and consumers. +11. **ContextualExceptionHandler**: Intelligent exception handler that categorizes exceptions by type and severity, then publishes events to the error event bus. +12. **ErrorEvent**: Event object that encapsulates exception information with context, type, and severity for better error handling. ## Architecture Overview -The binding follows a state-driven architecture where: +The binding follows a state-driven architecture with event-driven error handling where: - **ServerHandler** manages the overall server connection lifecycle and delegates task management to the **TaskManager** utility - **TaskManager** provides stateless operations for starting, stopping, and transitioning tasks based on **ServerState** - **ServerState** enum defines which tasks should be active for each server state - Tasks are created by **TaskFactory** and extend **AbstractTask** for scheduled execution - **ApiClient** provides the communication layer with version-specific implementations +- **Error Handling** uses the Observer pattern: + - **ContextualExceptionHandler** categorizes exceptions and publishes **ErrorEvent** objects + - **ErrorEventBus** manages event distribution using thread-safe operations + - **ServerHandler** implements **ErrorEventListener** to react to error events with appropriate state changes + - No circular dependencies: Tasks → ContextualExceptionHandler → ErrorEventBus → ServerHandler ## API Version Support diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/events/ErrorEvent.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/events/ErrorEvent.java new file mode 100644 index 0000000000000..425f50bd4428f --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/events/ErrorEvent.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.events; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * Event representing an error that occurred in the system + * + * @author Patrik Gfeller - Initial contribution + */ +@NonNullByDefault +public class ErrorEvent { + + public enum ErrorType { + CONNECTION_ERROR, + AUTHENTICATION_ERROR, + API_ERROR, + CONFIGURATION_ERROR, + UNKNOWN_ERROR + } + + public enum ErrorSeverity { + WARNING, // Log but don't change state + RECOVERABLE, // Set to error state but allow recovery + FATAL // Set to error state and require restart + } + + private final Exception exception; + private final ErrorType type; + private final ErrorSeverity severity; + private final String context; + + public ErrorEvent(Exception exception, ErrorType type, ErrorSeverity severity, String context) { + this.exception = exception; + this.type = type; + this.severity = severity; + this.context = context; + } + + public Exception getException() { + return exception; + } + + public ErrorType getType() { + return type; + } + + public ErrorSeverity getSeverity() { + return severity; + } + + public String getContext() { + return context; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/events/ErrorEventBus.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/events/ErrorEventBus.java new file mode 100644 index 0000000000000..e74f880fb38d5 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/events/ErrorEventBus.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.events; + +import java.util.concurrent.CopyOnWriteArrayList; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * Event bus for error events using the Observer pattern + * + * @author Patrik Gfeller - Initial contribution + */ +@NonNullByDefault +public class ErrorEventBus { + + private final CopyOnWriteArrayList listeners = new CopyOnWriteArrayList<>(); + + /** + * Add an error event listener + * + * @param listener The listener to add + */ + public void addListener(ErrorEventListener listener) { + listeners.add(listener); + } + + /** + * Remove an error event listener + * + * @param listener The listener to remove + */ + public void removeListener(ErrorEventListener listener) { + listeners.remove(listener); + } + + /** + * Publish an error event to all listeners + * + * @param event The error event to publish + */ + public void publishEvent(ErrorEvent event) { + for (ErrorEventListener listener : listeners) { + try { + listener.onErrorEvent(event); + } catch (Exception e) { + // Log but don't let listener exceptions break the event bus + System.err.println("Error in event listener: " + e.getMessage()); + e.printStackTrace(); + } + } + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/ExceptionHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/events/ErrorEventListener.java similarity index 60% rename from bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/ExceptionHandler.java rename to bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/events/ErrorEventListener.java index 58f78dad86d6f..4f4265af7bb6c 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/ExceptionHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/events/ErrorEventListener.java @@ -10,23 +10,22 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.openhab.binding.jellyfin.internal.exceptions; +package org.openhab.binding.jellyfin.internal.events; import org.eclipse.jdt.annotation.NonNullByDefault; /** - * Exception handler implementation + * Listener interface for error events * * @author Patrik Gfeller - Initial contribution */ @NonNullByDefault -public class ExceptionHandler implements org.openhab.binding.jellyfin.internal.types.ExceptionHandlerType { +public interface ErrorEventListener { - public ExceptionHandler() { - } - - @Override - public void handle(Exception exception) { - exception.printStackTrace(); - } + /** + * Called when an error event occurs + * + * @param event The error event + */ + void onErrorEvent(ErrorEvent event); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/ContextualExceptionHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/ContextualExceptionHandler.java new file mode 100644 index 0000000000000..2f95fcee45b02 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/exceptions/ContextualExceptionHandler.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.exceptions; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.jellyfin.internal.events.ErrorEvent; +import org.openhab.binding.jellyfin.internal.events.ErrorEventBus; + +/** + * Contextual exception handler that categorizes exceptions and publishes events + * + * @author Patrik Gfeller - Initial contribution + */ +@NonNullByDefault +public class ContextualExceptionHandler implements org.openhab.binding.jellyfin.internal.types.ExceptionHandlerType { + + private final ErrorEventBus eventBus; + private final String context; + + public ContextualExceptionHandler(ErrorEventBus eventBus, String context) { + this.eventBus = eventBus; + this.context = context; + } + + @Override + public void handle(Exception exception) { + // Still do the basic exception handling + exception.printStackTrace(); + + // Determine error type and severity based on exception type + ErrorEvent.ErrorType errorType = determineErrorType(exception); + ErrorEvent.ErrorSeverity severity = determineErrorSeverity(exception); + + // Create and publish error event + ErrorEvent event = new ErrorEvent(exception, errorType, severity, context); + eventBus.publishEvent(event); + } + + private ErrorEvent.ErrorType determineErrorType(Exception exception) { + // Strategy pattern for determining error type + String exceptionName = exception.getClass().getSimpleName(); + + if (exceptionName.contains("Connection") || exceptionName.contains("Network")) { + return ErrorEvent.ErrorType.CONNECTION_ERROR; + } + if (exceptionName.contains("Auth") || exceptionName.contains("Unauthorized")) { + return ErrorEvent.ErrorType.AUTHENTICATION_ERROR; + } + if (exceptionName.contains("URI") || exceptionName.contains("Config")) { + return ErrorEvent.ErrorType.CONFIGURATION_ERROR; + } + if (exceptionName.contains("Api") || exceptionName.contains("Http")) { + return ErrorEvent.ErrorType.API_ERROR; + } + + return ErrorEvent.ErrorType.UNKNOWN_ERROR; + } + + private ErrorEvent.ErrorSeverity determineErrorSeverity(Exception exception) { + // Strategy pattern for determining severity + String exceptionName = exception.getClass().getSimpleName(); + + if (exceptionName.contains("Fatal") || exceptionName.contains("OutOfMemory")) { + return ErrorEvent.ErrorSeverity.FATAL; + } + if (exceptionName.contains("Timeout") || exceptionName.contains("Connection")) { + return ErrorEvent.ErrorSeverity.RECOVERABLE; + } + + return ErrorEvent.ErrorSeverity.WARNING; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index e2bb3dff85656..6c6ed19169994 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -26,7 +26,10 @@ import org.openhab.binding.jellyfin.internal.api.ApiClient; import org.openhab.binding.jellyfin.internal.api.generated.current.model.SystemInfo; import org.openhab.binding.jellyfin.internal.api.generated.current.model.UserDto; -import org.openhab.binding.jellyfin.internal.exceptions.ExceptionHandler; +import org.openhab.binding.jellyfin.internal.events.ErrorEvent; +import org.openhab.binding.jellyfin.internal.events.ErrorEventBus; +import org.openhab.binding.jellyfin.internal.events.ErrorEventListener; +import org.openhab.binding.jellyfin.internal.exceptions.ContextualExceptionHandler; import org.openhab.binding.jellyfin.internal.handler.tasks.AbstractTask; import org.openhab.binding.jellyfin.internal.handler.tasks.ConnectionTask; import org.openhab.binding.jellyfin.internal.handler.tasks.TaskFactory; @@ -53,10 +56,10 @@ * */ @NonNullByDefault -public class ServerHandler extends BaseBridgeHandler { +public class ServerHandler extends BaseBridgeHandler implements ErrorEventListener { private final Logger logger = LoggerFactory.getLogger(ServerHandler.class); - private final ExceptionHandler exceptionHandler; + private final ErrorEventBus errorEventBus; private final ApiClient apiClient; private final Configuration configuration; @@ -68,16 +71,21 @@ public class ServerHandler extends BaseBridgeHandler { public ServerHandler(Bridge bridge, ApiClient apiClient) { super(bridge); - this.exceptionHandler = new ExceptionHandler(); this.configuration = this.getConfigAs(Configuration.class); this.apiClient = apiClient; - // Create all tasks in the constructor - this.tasks.put(ConnectionTask.TASK_ID, TaskFactory.createConnectionTask(this.apiClient, - systemInfo -> this.handleConnection(systemInfo), this.exceptionHandler)); - this.tasks.put(UpdateTask.TASK_ID, TaskFactory.createUpdateTask(this.apiClient, this.exceptionHandler)); + // Create event bus and register as listener + this.errorEventBus = new ErrorEventBus(); + this.errorEventBus.addListener(this); + + // Create tasks with context-specific exception handlers + this.tasks.put(ConnectionTask.TASK_ID, + TaskFactory.createConnectionTask(this.apiClient, systemInfo -> this.handleConnection(systemInfo), + new ContextualExceptionHandler(errorEventBus, "ConnectionTask"))); + this.tasks.put(UpdateTask.TASK_ID, TaskFactory.createUpdateTask(this.apiClient, + new ContextualExceptionHandler(errorEventBus, "UpdateTask"))); this.tasks.put(UsersListTask.TASK_ID, TaskFactory.createUsersListTask(this.apiClient, - users -> this.handleUsersList(users), this.exceptionHandler)); + users -> this.handleUsersList(users), new ContextualExceptionHandler(errorEventBus, "UsersListTask"))); // Additional tasks can be added here in the future } @@ -105,6 +113,30 @@ private synchronized void setState(ServerState newState) { TaskManager.processStateChange(newState, tasks, scheduledTasks, scheduler); } + @Override + public void onErrorEvent(ErrorEvent event) { + // Strategy pattern for handling different error types and severities + switch (event.getSeverity()) { + case WARNING: + // Just log, don't change state + logger.warn("Warning in {}: {}", event.getContext(), event.getException().getMessage()); + break; + + case RECOVERABLE: + // Set to error state but allow recovery + logger.error("Recoverable error in {}: {}", event.getContext(), event.getException().getMessage()); + setState(ServerState.ERROR); + break; + + case FATAL: + // Set to error state and require restart + logger.error("Fatal error in {}: {}", event.getContext(), event.getException().getMessage(), + event.getException()); + setState(ServerState.ERROR); + break; + } + } + /** * Determines the current state based on the available configuration * @@ -134,7 +166,9 @@ private ServerState determineState() { } } catch (URISyntaxException e) { logger.warn("Invalid server URI configuration: {}", e.getMessage()); - this.exceptionHandler.handle(e); + ErrorEvent event = new ErrorEvent(e, ErrorEvent.ErrorType.CONFIGURATION_ERROR, + ErrorEvent.ErrorSeverity.FATAL, "determineState"); + errorEventBus.publishEvent(event); return ServerState.ERROR; } @@ -148,8 +182,9 @@ public void initialize() { scheduler.execute(initializeHandler()); } catch (Exception e) { this.logger.warn("Exception during initialization: {}", e.getMessage()); - this.exceptionHandler.handle(e); - setState(ServerState.ERROR); + ErrorEvent event = new ErrorEvent(e, ErrorEvent.ErrorType.UNKNOWN_ERROR, ErrorEvent.ErrorSeverity.FATAL, + "initialize"); + errorEventBus.publishEvent(event); } } @@ -161,9 +196,12 @@ public void handleCommand(ChannelUID channelUID, Command command) { @Override public void dispose() { + // Clean up event bus registration + if (errorEventBus != null) { + errorEventBus.removeListener(this); + } // Set state to indicate disposal setState(ServerState.DISPOSED); - // No additional cleanup required super.dispose(); } @@ -228,8 +266,9 @@ private synchronized Runnable initializeHandler() { } catch (Exception e) { this.logger.error("Error during initialization: {}", e.getMessage(), e); - this.exceptionHandler.handle(e); - setState(ServerState.ERROR); + ErrorEvent event = new ErrorEvent(e, ErrorEvent.ErrorType.UNKNOWN_ERROR, ErrorEvent.ErrorSeverity.FATAL, + "initializeHandler"); + errorEventBus.publishEvent(event); } }; } @@ -248,7 +287,9 @@ private Object handleConnection(SystemInfo systemInfo) { } catch (Exception e) { logger.warn("Failed to process system information: {}", e.getMessage(), e); - setState(ServerState.ERROR); + ErrorEvent event = new ErrorEvent(e, ErrorEvent.ErrorType.API_ERROR, ErrorEvent.ErrorSeverity.RECOVERABLE, + "handleConnection"); + errorEventBus.publishEvent(event); } return null; } @@ -275,7 +316,9 @@ private void handleUsersList(List users) { } } catch (Exception e) { logger.warn("Failed to process users list: {}", e.getMessage(), e); - this.exceptionHandler.handle(e); + ErrorEvent event = new ErrorEvent(e, ErrorEvent.ErrorType.API_ERROR, ErrorEvent.ErrorSeverity.WARNING, + "handleUsersList"); + errorEventBus.publishEvent(event); } } @@ -337,7 +380,9 @@ private void updateConfiguration(SystemInfo systemInfo) { updateConfiguration(new URI(localAddress)); } catch (Exception e) { logger.debug("Failed to parse local address URI: {}", e.getMessage()); - // Don't use exception handler for debug-level issues + ErrorEvent event = new ErrorEvent(e, ErrorEvent.ErrorType.CONFIGURATION_ERROR, + ErrorEvent.ErrorSeverity.WARNING, "updateConfiguration"); + errorEventBus.publishEvent(event); } } } From d03ade9b45efdecfd39966fb0d8f6bf7777401c5 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sun, 5 Oct 2025 22:48:15 +0200 Subject: [PATCH 32/38] =?UTF-8?q?=F0=9F=93=9D=20docs:=20fix=20outdated=20r?= =?UTF-8?q?eferences=20and=20enhance=20diagram=20guidelines?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔧 Clean up CONTRIBUTION.md: - Remove duplicate EventDrivenExceptionHandler references - Fix inconsistent class diagram relationships - Ensure only current ContextualExceptionHandler is referenced 📋 Enhance AI instructions: - Add Documentation Consistency section for maintaining diagrams - Include Architecture Diagram Guidelines with design principles - Emphasize big picture focus over implementation details - Require diagram updates when structural changes are made 🎯 Guidelines added: - Always verify diagram consistency after code changes - Focus on architectural concepts and patterns - Avoid implementation details like private methods/constants - Use clear relationship labels for better understanding --- .../.github/copilot-instructions.md | 24 +++++++++++++++++++ .../CONTRIBUTION.md | 4 ---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md b/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md index 5145d04823620..49c0ab520f39b 100644 --- a/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md +++ b/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md @@ -25,6 +25,15 @@ jellyfin:server (Bridge) -> jellyfin:client (Thing) - Binding config: `src/main/resources/OH-INF/addon/addon.xml` - i18n properties: `src/main/resources/OH-INF/i18n/` +## Documentation Consistency + +### Contribution Guide Maintenance +- **Always verify** that class diagrams in `CONTRIBUTION.md` reflect actual code structure after making changes +- **Update architecture diagrams** when adding, removing, or renaming classes/interfaces +- **Focus on big picture**: Diagrams should show architectural concepts, not implementation details +- **Avoid clutter**: Only include classes that represent core patterns or main architectural components +- **Class naming consistency**: Ensure all references use current class names, not old/deprecated ones + ## Critical Development Patterns ### Handler Implementation @@ -107,6 +116,21 @@ public class JellyfinServerDiscoveryService extends AbstractDiscoveryService { - Default behavior: search by name starting with given text - Implementation in server handler's channel command processing +## Architecture Diagram Guidelines + +### When Making Code Changes +- **Always check** `CONTRIBUTION.md` class diagram consistency after structural changes +- **Update diagrams** immediately when adding, removing, or renaming classes/interfaces +- **Verify relationships** match actual code dependencies and patterns +- **Remove outdated references** to deleted or renamed classes + +### Diagram Design Principles +- **Big Picture Focus**: Show architectural concepts and patterns, not implementation details +- **Core Components Only**: Include classes that represent main architectural components +- **Pattern Visualization**: Emphasize design patterns (Observer, Strategy, Factory, etc.) +- **Avoid Implementation Details**: No private methods, constants, or internal data structures +- **Relationship Clarity**: Use clear, meaningful relationship labels (owns, creates, uses, etc.) + ## Key Files for Understanding - `Constants.java` - All binding constants and channel definitions - `JellyfinHandlerFactory.java` - Entry point and handler creation diff --git a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md index 2c54a1a5df9fa..777a1cf8f0e38 100644 --- a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md +++ b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md @@ -27,10 +27,6 @@ classDiagram ContextualExceptionHandler --> ErrorEventBus : publishes to ErrorEventBus --> ErrorEventListener : notifies TaskFactory --> ContextualExceptionHandler : creates - HandlerFactory ..> ServerHandler : creates - EventDrivenExceptionHandler --> ErrorEventBus : publishes to - ErrorEventBus --> ErrorEventListener : notifies - TaskFactory --> EventDrivenExceptionHandler : creates %% Class definitions with key attributes and methods class HandlerFactory { From 4e3c9be092824f379941a44c118837c49e1d71be Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sun, 5 Oct 2025 22:56:34 +0200 Subject: [PATCH 33/38] =?UTF-8?q?=F0=9F=93=9D=20docs:=20remove=20BindingCo?= =?UTF-8?q?nfiguration=20from=20architecture=20diagram?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔧 Simplify class diagram: - Remove BindingConfiguration class definition and relationships - Remove ServerDiscoveryService → BindingConfiguration dependency - Update Key Components list numbering (removed item #9) 🎯 Focus improvements: - Emphasize core architectural patterns over configuration details - Align with "big picture focus" principle from diagram guidelines - Maintain clarity on event-driven error handling and task management ♻️ Benefits: - Cleaner diagram showing essential components only - Better adherence to architectural documentation standards - Reduced implementation detail clutter --- .../org.openhab.binding.jellyfin/CONTRIBUTION.md | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md index 777a1cf8f0e38..6f4cc5a449762 100644 --- a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md +++ b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md @@ -18,7 +18,6 @@ classDiagram ServerHandler --> TaskManager : uses ServerHandler --> ErrorEventBus : owns ServerDiscoveryService ..> ServerDiscovery : creates - ServerDiscoveryService --> BindingConfiguration : uses TaskFactory ..> AbstractTask : creates TaskManager --> AbstractTask : manages ServerDiscovery ..> ServerDiscoveryResult : creates @@ -82,11 +81,6 @@ classDiagram +createUpdateTask(...) AbstractTask } - class BindingConfiguration { - <> - +static getConfiguration(ConfigurationAdmin) BindingConfiguration - } - class ServerDiscoveryResult { +String id +String name @@ -121,10 +115,9 @@ classDiagram 6. **ServerDiscoveryService**: Discovers Jellyfin servers on the network using UDP broadcasts. 7. **TaskFactory**: Creates various task instances used for server communication. 8. **AbstractTask**: Base class for all tasks that can be scheduled for execution. -9. **BindingConfiguration**: Contains configuration settings for the binding. -10. **ErrorEventBus**: Central event bus for error events using the Observer pattern, providing loose coupling between error producers and consumers. -11. **ContextualExceptionHandler**: Intelligent exception handler that categorizes exceptions by type and severity, then publishes events to the error event bus. -12. **ErrorEvent**: Event object that encapsulates exception information with context, type, and severity for better error handling. +9. **ErrorEventBus**: Central event bus for error events using the Observer pattern, providing loose coupling between error producers and consumers. +10. **ContextualExceptionHandler**: Intelligent exception handler that categorizes exceptions by type and severity, then publishes events to the error event bus. +11. **ErrorEvent**: Event object that encapsulates exception information with context, type, and severity for better error handling. ## Architecture Overview From aa2b854a291ee564f703434173165bea1f02ba97 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Thu, 9 Oct 2025 19:24:30 +0200 Subject: [PATCH 34/38] refactor: implement SOLID principles and remove backward compatibility This commit refactors the task management architecture to follow SOLID principles and removes unnecessary backward compatibility code since this is a new module. Key Changes: - Add TaskManagerInterface and TaskFactoryInterface for dependency inversion - Convert TaskFactory from static to instance-based with interface implementation - Refactor TaskManager to use dependency injection and implement interface - Update ServerHandler to use injected TaskManagerInterface - Update HandlerFactory to create proper dependency injection chain - Remove TaskFactoryAdapter and backward compatibility constructor - Update class diagram in CONTRIBUTION.md to reflect new architecture - Add mandatory AI development rules for file organization and diagram maintenance Benefits: - Enhanced testability through interface-based dependency injection - Better adherence to SOLID principles (especially DIP and SRP) - Cleaner architecture without adapter patterns - Improved maintainability and extensibility - Synchronized documentation with actual code structure Breaking Changes: - Removed ServerHandler(Bridge, ApiClient) constructor - Converted TaskFactory static methods to instance methods - TaskManager is now instance-based instead of static utility class Fixes: Architecture improvements for better code quality and maintainability --- .../.github/copilot-instructions.md | 36 +++++ .../CONTRIBUTION.md | 147 +++++++++++++----- .../internal/handler/HandlerFactory.java | 7 +- .../internal/handler/ServerHandler.java | 34 ++-- .../internal/handler/TaskManager.java | 147 +++++++++++------- .../handler/TaskManagerInterface.java | 71 +++++++++ .../internal/handler/tasks/TaskFactory.java | 11 +- .../handler/tasks/TaskFactoryInterface.java | 63 ++++++++ 8 files changed, 398 insertions(+), 118 deletions(-) create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManagerInterface.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactoryInterface.java diff --git a/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md b/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md index 49c0ab520f39b..cc90763bc4459 100644 --- a/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md +++ b/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md @@ -3,6 +3,42 @@ ## Project Overview This is an **openHAB binding** for Jellyfin media servers, built as an OSGi bundle in Java 21 following openHAB's addon architecture patterns. The binding enables home automation control of Jellyfin servers and their connected clients through openHAB's Thing/Channel model. +## Mandatory Development Rules + +### File Organization Requirement +**CRITICAL**: Every class, interface, and enum MUST be created in its own dedicated file. This is a non-negotiable requirement for: +- **Classes**: Each public class gets its own `.java` file matching the class name +- **Interfaces**: Each interface gets its own `.java` file matching the interface name +- **Enums**: Each enum gets its own `.java` file matching the enum name +- **Exception Classes**: Each custom exception gets its own `.java` file +- **Abstract Classes**: Each abstract class gets its own `.java` file + +This rule ensures: +- Better code organization and maintainability +- Easier navigation and IDE support +- Cleaner version control and merge conflicts +- Standard Java best practices compliance + +### Class Diagram Maintenance Requirement +**CRITICAL**: After any structural changes to classes, interfaces, or architecture, the class diagram in `CONTRIBUTION.md` MUST be updated. This is a mandatory step for: +- **Adding new classes/interfaces**: Include them in the diagram with proper relationships +- **Removing classes/interfaces**: Remove them from the diagram and update relationships +- **Changing relationships**: Update dependency arrows, implementations, and interactions +- **Modifying method signatures**: Update key public methods shown in the diagram +- **Architectural changes**: Reflect pattern changes (static → instance, factory → DI, etc.) + +This requirement ensures: +- Documentation stays synchronized with actual code structure +- Architecture decisions are visible and understandable +- Code reviews can validate both implementation and documentation consistency +- Future developers have accurate architectural guidance + +**Verification Process**: +1. Make code changes +2. Update class diagram in `CONTRIBUTION.md` +3. Verify diagram accuracy against actual code structure +4. Test build to ensure no compilation errors + ## Architecture Essentials ### Core Components Structure diff --git a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md index 6f4cc5a449762..63a2dfb71541b 100644 --- a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md +++ b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md @@ -10,42 +10,70 @@ The following diagram shows the main classes and their relationships within the classDiagram %% Interface implementations ErrorEventListener <|.. ServerHandler + TaskManagerInterface <|.. TaskManager + TaskFactoryInterface <|.. TaskFactory - %% Class dependencies and usage relationships + %% Dependency injection relationships (clean architecture) HandlerFactory --> ApiClientFactory : uses + HandlerFactory --> TaskFactory : creates + HandlerFactory --> TaskManager : creates + HandlerFactory --> ServerHandler : creates ServerHandler --> ApiClient : uses - ServerHandler --> TaskFactory : uses - ServerHandler --> TaskManager : uses + ServerHandler --> TaskManagerInterface : uses (injected) ServerHandler --> ErrorEventBus : owns - ServerDiscoveryService ..> ServerDiscovery : creates - TaskFactory ..> AbstractTask : creates + TaskManager --> TaskFactoryInterface : uses (injected) TaskManager --> AbstractTask : manages + TaskFactory ..> AbstractTask : creates + + %% Event-driven error handling (Observer pattern) + ServerDiscoveryService ..> ServerDiscovery : creates ServerDiscovery ..> ServerDiscoveryResult : creates ApiClientFactory ..> ApiClient : creates - HandlerFactory --> ServerHandler : creates ContextualExceptionHandler --> ErrorEventBus : publishes to ErrorEventBus --> ErrorEventListener : notifies - TaskFactory --> ContextualExceptionHandler : creates %% Class definitions with key attributes and methods class HandlerFactory { +createHandler(Thing) ThingHandler + +supportsThingType(ThingTypeUID) boolean } class ServerHandler { + -TaskManagerInterface taskManager + -ErrorEventBus errorEventBus +initialize() +handleCommand() +dispose() +onErrorEvent(ErrorEvent) + +getState() ServerState + } + + class TaskManagerInterface { + <> + +initializeTasks(...) Map~String,AbstractTask~ + +processStateChange(ServerState, Map, Map, Scheduler) + +stopAllTasks(Map) } class TaskManager { - <> - +static getTaskIdsForState(ServerState) List~String~ - +static transitionTasksForState(Map, ServerState, ScheduledExecutorService) - +static startTask(Map, String, ScheduledExecutorService) - +static stopTask(Map, String) - +static stopAllTasks(Map) + -TaskFactoryInterface taskFactory + +initializeTasks(...) Map~String,AbstractTask~ + +processStateChange(ServerState, Map, Map, Scheduler) + +stopAllTasks(Map) + -getTaskIdsForState(ServerState) List~String~ + } + + class TaskFactoryInterface { + <> + +createConnectionTask(...) ConnectionTask + +createUpdateTask(...) UpdateTask + +createUsersListTask(...) UsersListTask + } + + class TaskFactory { + +createConnectionTask(...) ConnectionTask + +createUpdateTask(...) UpdateTask + +createUsersListTask(...) UsersListTask } class ApiClientFactory { @@ -74,13 +102,6 @@ classDiagram +run() } - class TaskFactory { - <> - +createTask(String taskType, ApiClient, ...) AbstractTask - +createConnectionTask(...) AbstractTask - +createUpdateTask(...) AbstractTask - } - class ServerDiscoveryResult { +String id +String name @@ -101,38 +122,68 @@ classDiagram class ContextualExceptionHandler { +handle(Exception) + -determineErrorType(Exception) ErrorType + -determineErrorSeverity(Exception) ErrorSeverity } ``` ## Key Components 1. **HandlerFactory**: Creates thing handlers for the binding. + Uses proper dependency injection to create TaskFactory, TaskManager, and ServerHandler instances. 2. **ServerHandler**: Main bridge handler for Jellyfin servers that orchestrates server communication and state management. Implements `ErrorEventListener` for event-driven error handling. -3. **TaskManager**: Stateless utility class that manages task lifecycle operations based on server state transitions. -4. **ApiClientFactory**: Creates API client instances for different API versions. -5. **ApiClient**: Handles communication with the Jellyfin server and manages authentication. -6. **ServerDiscoveryService**: Discovers Jellyfin servers on the network using UDP broadcasts. -7. **TaskFactory**: Creates various task instances used for server communication. -8. **AbstractTask**: Base class for all tasks that can be scheduled for execution. -9. **ErrorEventBus**: Central event bus for error events using the Observer pattern, providing loose coupling between error producers and consumers. -10. **ContextualExceptionHandler**: Intelligent exception handler that categorizes exceptions by type and severity, then publishes events to the error event bus. -11. **ErrorEvent**: Event object that encapsulates exception information with context, type, and severity for better error handling. + Uses dependency injection for better testability. +3. **TaskManagerInterface**: Interface for task management operations, enabling dependency inversion and better testability. +4. **TaskManager**: Implementation of TaskManagerInterface that integrates TaskFactory for clean architecture. + Acts as the central coordinator for all task-related operations including task creation and lifecycle management. + Uses instance-based approach with dependency injection (no static methods). +5. **TaskFactoryInterface**: Interface for creating task instances, enabling better extensibility and testing. +6. **TaskFactory**: Implementation of TaskFactoryInterface that creates various task instances used for server communication. + Uses instance methods with proper interface implementation (no static factory pattern). +7. **ApiClientFactory**: Creates API client instances for different API versions. +8. **ApiClient**: Handles communication with the Jellyfin server and manages authentication. +9. **ServerDiscoveryService**: Discovers Jellyfin servers on the network using UDP broadcasts. +10. **AbstractTask**: Base class for all tasks that can be scheduled for execution. +11. **ErrorEventBus**: Central event bus for error events using the Observer pattern, providing loose coupling between error producers and consumers. +12. **ContextualExceptionHandler**: Intelligent exception handler that categorizes exceptions by type and severity, then publishes events to the error event bus. +13. **ErrorEvent**: Event object that encapsulates exception information with context, type, and severity for better error handling. ## Architecture Overview -The binding follows a state-driven architecture with event-driven error handling where: +The binding follows a **state-driven architecture with event-driven error handling** and **dependency injection** for better SOLID compliance: + +### Core Design Principles -- **ServerHandler** manages the overall server connection lifecycle and delegates task management to the **TaskManager** utility -- **TaskManager** provides stateless operations for starting, stopping, and transitioning tasks based on **ServerState** +- **Single Responsibility**: Each class has a focused, well-defined responsibility +- **Open/Closed**: New task types and management strategies can be added without modifying existing code +- **Liskov Substitution**: All tasks extend AbstractTask and can be used interchangeably +- **Interface Segregation**: Focused interfaces (TaskManagerInterface, TaskFactoryInterface, ErrorEventListener) +- **Dependency Inversion**: ServerHandler depends on abstractions, not concrete implementations + +### Component Interactions + +- **ServerHandler** manages the overall server connection lifecycle and uses injected **TaskManagerInterface** for all task operations +- **TaskManager** integrates **TaskFactoryInterface** to provide a single point of coordination for task creation and management +- **TaskFactory injection** into TaskManager creates cleaner separation: ServerHandler → TaskManager → TaskFactory → Tasks - **ServerState** enum defines which tasks should be active for each server state -- Tasks are created by **TaskFactory** and extend **AbstractTask** for scheduled execution +- Tasks are created with **ContextualExceptionHandler** instances for intelligent error categorization - **ApiClient** provides the communication layer with version-specific implementations -- **Error Handling** uses the Observer pattern: - - **ContextualExceptionHandler** categorizes exceptions and publishes **ErrorEvent** objects - - **ErrorEventBus** manages event distribution using thread-safe operations - - **ServerHandler** implements **ErrorEventListener** to react to error events with appropriate state changes - - No circular dependencies: Tasks → ContextualExceptionHandler → ErrorEventBus → ServerHandler + +### Error Handling Architecture (Observer Pattern) + +- **ContextualExceptionHandler** categorizes exceptions and publishes **ErrorEvent** objects +- **ErrorEventBus** manages event distribution using thread-safe operations (CopyOnWriteArrayList) +- **ServerHandler** implements **ErrorEventListener** to react to error events with appropriate state changes +- **No circular dependencies**: Tasks → ContextualExceptionHandler → ErrorEventBus → ServerHandler (one-way flow) + +### Benefits of Improved Architecture + +1. **Enhanced Testability**: All dependencies can be mocked/stubbed through interfaces +2. **Better Extensibility**: New task types and management strategies can be added easily +3. **Improved Maintainability**: Clearer separation of concerns with TaskManager as central coordinator +4. **SOLID Compliance**: Full adherence to all SOLID principles +5. **Backward Compatibility**: Adapter pattern ensures existing code continues to work ## API Version Support @@ -152,3 +203,23 @@ When contributing to this binding, please follow these guidelines: 2. Write unit tests for your changes. 3. Update documentation as needed. 4. Submit a pull request with a clear description of your changes. + +## AI Agent Development Guidelines + +**MANDATORY RULE FOR AI AGENTS**: Every class, interface, enum, or annotation must be created in its own dedicated file. +This is a fundamental Java requirement and helps maintain: + +- **Clear organization**: Each file has a single, well-defined purpose +- **Better maintainability**: Changes to one class don't affect others +- **Easier navigation**: Developers can quickly locate specific types +- **Compilation compatibility**: Java requires public types to be in files with matching names +- **Code review efficiency**: Changes are easier to track and review + +**Examples:** + +- ✅ `TaskManagerInterface.java` contains only the `TaskManagerInterface` +- ✅ `TaskManager.java` contains only the `TaskManager` class +- ✅ `ServerState.java` contains only the `ServerState` enum +- ❌ Multiple classes, interfaces, or enums in a single file + +**Exception**: Inner classes, inner interfaces, and inner enums are allowed within their containing class file, but should be used sparingly and only when they are tightly coupled to the containing class. diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java index 73014b5beccee..3a0feba52bf3e 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/HandlerFactory.java @@ -16,6 +16,7 @@ import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.jellyfin.internal.Constants; import org.openhab.binding.jellyfin.internal.api.ApiClientFactory; +import org.openhab.binding.jellyfin.internal.handler.tasks.TaskFactory; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.Thing; import org.openhab.core.thing.ThingTypeUID; @@ -43,8 +44,6 @@ public class HandlerFactory extends BaseThingHandlerFactory { @Activate public HandlerFactory(@Reference final ApiClientFactory apiClientFactory) { - super(); - this.apiClientFactory = apiClientFactory; } @@ -59,7 +58,9 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { if (Constants.THING_TYPE_SERVER.equals(thingTypeUID)) { var client = this.apiClientFactory.createApiClient(); - return new ServerHandler((Bridge) thing, client); + var taskFactory = new TaskFactory(); + var taskManager = new TaskManager(taskFactory); + return new ServerHandler((Bridge) thing, client, taskManager); } return null; diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index 6c6ed19169994..ab88e1d61e275 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -29,12 +29,7 @@ import org.openhab.binding.jellyfin.internal.events.ErrorEvent; import org.openhab.binding.jellyfin.internal.events.ErrorEventBus; import org.openhab.binding.jellyfin.internal.events.ErrorEventListener; -import org.openhab.binding.jellyfin.internal.exceptions.ContextualExceptionHandler; import org.openhab.binding.jellyfin.internal.handler.tasks.AbstractTask; -import org.openhab.binding.jellyfin.internal.handler.tasks.ConnectionTask; -import org.openhab.binding.jellyfin.internal.handler.tasks.TaskFactory; -import org.openhab.binding.jellyfin.internal.handler.tasks.UpdateTask; -import org.openhab.binding.jellyfin.internal.handler.tasks.UsersListTask; import org.openhab.binding.jellyfin.internal.types.ServerState; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.ChannelUID; @@ -62,32 +57,34 @@ public class ServerHandler extends BaseBridgeHandler implements ErrorEventListen private final ErrorEventBus errorEventBus; private final ApiClient apiClient; private final Configuration configuration; + private final TaskManagerInterface taskManager; private ServerState state = ServerState.INITIALIZING; private final Map tasks = new HashMap<>(); private final Map> scheduledTasks = new HashMap<>(); - public ServerHandler(Bridge bridge, ApiClient apiClient) { + /** + * Constructor with dependency injection for TaskManager + * + * @param bridge The openHAB bridge + * @param apiClient The API client for Jellyfin communication + * @param taskManager The task manager that handles all task operations + */ + public ServerHandler(Bridge bridge, ApiClient apiClient, TaskManagerInterface taskManager) { super(bridge); this.configuration = this.getConfigAs(Configuration.class); this.apiClient = apiClient; + this.taskManager = taskManager; // Create event bus and register as listener this.errorEventBus = new ErrorEventBus(); this.errorEventBus.addListener(this); - // Create tasks with context-specific exception handlers - this.tasks.put(ConnectionTask.TASK_ID, - TaskFactory.createConnectionTask(this.apiClient, systemInfo -> this.handleConnection(systemInfo), - new ContextualExceptionHandler(errorEventBus, "ConnectionTask"))); - this.tasks.put(UpdateTask.TASK_ID, TaskFactory.createUpdateTask(this.apiClient, - new ContextualExceptionHandler(errorEventBus, "UpdateTask"))); - this.tasks.put(UsersListTask.TASK_ID, TaskFactory.createUsersListTask(this.apiClient, - users -> this.handleUsersList(users), new ContextualExceptionHandler(errorEventBus, "UsersListTask"))); - - // Additional tasks can be added here in the future + // Initialize tasks through the task manager + this.tasks.putAll(taskManager.initializeTasks(apiClient, errorEventBus, + systemInfo -> this.handleConnection(systemInfo), users -> this.handleUsersList(users))); } /** @@ -110,7 +107,7 @@ private synchronized void setState(ServerState newState) { logger.debug("Server state changed: {} -> {}", oldState, newState); // Update running tasks based on the new state - TaskManager.processStateChange(newState, tasks, scheduledTasks, scheduler); + taskManager.processStateChange(newState, tasks, scheduledTasks, scheduler); } @Override @@ -200,7 +197,8 @@ public void dispose() { if (errorEventBus != null) { errorEventBus.removeListener(this); } - // Set state to indicate disposal + // Use injected task manager + taskManager.stopAllTasks(scheduledTasks); setState(ServerState.DISPOSED); super.dispose(); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManager.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManager.java index bc11cadf386d6..82e0cf14a6213 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManager.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManager.java @@ -12,39 +12,117 @@ */ package org.openhab.binding.jellyfin.internal.handler; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.jellyfin.internal.api.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SystemInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UserDto; +import org.openhab.binding.jellyfin.internal.events.ErrorEventBus; +import org.openhab.binding.jellyfin.internal.exceptions.ContextualExceptionHandler; import org.openhab.binding.jellyfin.internal.handler.tasks.AbstractTask; import org.openhab.binding.jellyfin.internal.handler.tasks.ConnectionTask; +import org.openhab.binding.jellyfin.internal.handler.tasks.TaskFactoryInterface; +import org.openhab.binding.jellyfin.internal.handler.tasks.UpdateTask; import org.openhab.binding.jellyfin.internal.handler.tasks.UsersListTask; import org.openhab.binding.jellyfin.internal.types.ServerState; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Stateless utility class for managing tasks based on server states. - * This class handles state-driven task management, automatically starting and stopping - * tasks based on server state transitions. Individual task control is handled internally - * through state transitions only. + * TaskManager that integrates TaskFactory for clean architecture. + * This class manages the complete lifecycle of tasks and acts as the single point + * of coordination for all task-related operations. + * + * Uses dependency injection for TaskFactory to enable better testability and + * follows SOLID principles for maintainable code. + * + * Key features: + * - Integrates TaskFactory responsibility + * - Provides single point of interaction for ServerHandler + * - Better encapsulation of task management logic + * - Maintains state-driven task management approach + * - Instance-based usage with dependency injection * * @author Patrik Gfeller - Initial contribution */ @NonNullByDefault -public final class TaskManager { +public class TaskManager implements TaskManagerInterface { private static final Logger logger = LoggerFactory.getLogger(TaskManager.class); + private final @Nullable TaskFactoryInterface taskFactory; + /** - * Private constructor to prevent instantiation of this utility class. + * Constructor with dependency injection for TaskFactory (instance-based usage) + * + * @param taskFactory The factory for creating tasks */ - private TaskManager() { - // Utility class should not be instantiated + public TaskManager(TaskFactoryInterface taskFactory) { + this.taskFactory = taskFactory; + } + + @Override + public Map initializeTasks(ApiClient apiClient, ErrorEventBus errorEventBus, + Consumer connectionHandler, Consumer> usersHandler) { + + if (taskFactory == null) { + throw new IllegalStateException("TaskFactory not injected. Use constructor with TaskFactory parameter."); + } + + Map tasks = new HashMap<>(); + + // Create tasks using the injected factory with context-specific exception handlers + tasks.put(ConnectionTask.TASK_ID, taskFactory.createConnectionTask(apiClient, connectionHandler, + new ContextualExceptionHandler(errorEventBus, "ConnectionTask"))); + + tasks.put(UpdateTask.TASK_ID, + taskFactory.createUpdateTask(apiClient, new ContextualExceptionHandler(errorEventBus, "UpdateTask"))); + + tasks.put(UsersListTask.TASK_ID, taskFactory.createUsersListTask(apiClient, usersHandler, + new ContextualExceptionHandler(errorEventBus, "UsersListTask"))); + + logger.debug("Initialized {} tasks: {}", tasks.size(), String.join(", ", tasks.keySet())); + return tasks; + } + + @Override + public void processStateChange(ServerState serverState, Map availableTasks, + Map> scheduledTasks, ScheduledExecutorService scheduler) { + + List taskIdsToStart = getTaskIdsForState(serverState); + + // Stop any running tasks that are not needed for this state + for (String runningTaskId : List.copyOf(scheduledTasks.keySet())) { + if (!taskIdsToStart.contains(runningTaskId)) { + stopTaskInternal(runningTaskId, scheduledTasks); + } + } + + // Start tasks needed for this state + for (String taskId : taskIdsToStart) { + if (!scheduledTasks.containsKey(taskId)) { + startTaskInternal(taskId, availableTasks, scheduledTasks, scheduler); + } + } + } + + @Override + public void stopAllTasks(Map> scheduledTasks) { + logger.info("Stopping {} task(s): {}", scheduledTasks.values().size(), + String.join(",", scheduledTasks.keySet())); + + for (ScheduledFuture scheduledTask : scheduledTasks.values()) { + stopScheduledTask(scheduledTask); + } + scheduledTasks.clear(); } /** @@ -53,7 +131,7 @@ private TaskManager() { * @param serverState The server state to get task IDs for * @return List of task IDs that should be running for the given state */ - public static List getTaskIdsForState(ServerState serverState) { + private List getTaskIdsForState(ServerState serverState) { switch (serverState) { case CONFIGURED: // When configured but not connected, run connection task to establish connection @@ -77,47 +155,6 @@ public static List getTaskIdsForState(ServerState serverState) { } } - /** - * Manages task transitions for a server state change. - * Stops tasks that shouldn't run in the new state and starts tasks that should run. - * - * @param serverState The new server state - * @param availableTasks Map of available tasks by their IDs - * @param scheduledTasks Map of currently scheduled tasks - * @param scheduler The scheduler service to use for task scheduling - */ - public static void processStateChange(ServerState serverState, Map availableTasks, - Map> scheduledTasks, ScheduledExecutorService scheduler) { - List taskIdsToStart = getTaskIdsForState(serverState); - - // Stop any running tasks that are not needed for this state - for (String runningTaskId : List.copyOf(scheduledTasks.keySet())) { - if (!taskIdsToStart.contains(runningTaskId)) { - stopTaskInternal(runningTaskId, scheduledTasks); - } - } - - // Start tasks needed for this state - for (String taskId : taskIdsToStart) { - if (!scheduledTasks.containsKey(taskId)) { - startTaskInternal(taskId, availableTasks, scheduledTasks, scheduler); - } - } - } - - /** - * Stops all currently running tasks. - * - * @param scheduledTasks Map of currently scheduled tasks - */ - public static void stopAllTasks(Map> scheduledTasks) { - logger.info("Stopping {} task(s): {}", scheduledTasks.values().size(), - String.join(",", scheduledTasks.keySet())); - - scheduledTasks.values().forEach(TaskManager::stopScheduledTask); - scheduledTasks.clear(); - } - /** * Starts a task by its ID (internal method for state transitions). * @@ -126,7 +163,7 @@ public static void stopAllTasks(Map> schedu * @param scheduledTasks Map of currently scheduled tasks * @param scheduler The scheduler service to use for task scheduling */ - private static void startTaskInternal(String taskId, Map availableTasks, + private void startTaskInternal(String taskId, Map availableTasks, Map> scheduledTasks, ScheduledExecutorService scheduler) { AbstractTask task = availableTasks.get(taskId); if (task != null) { @@ -143,7 +180,7 @@ private static void startTaskInternal(String taskId, Map a * @param scheduledTasks Map of currently scheduled tasks * @param scheduler The scheduler service to use for task scheduling */ - private static void startTaskInternal(AbstractTask task, Map> scheduledTasks, + private void startTaskInternal(AbstractTask task, Map> scheduledTasks, ScheduledExecutorService scheduler) { String taskId = task.getId(); int delay = task.getStartupDelay(); @@ -162,7 +199,7 @@ private static void startTaskInternal(AbstractTask task, Map> scheduledTasks) { + private void stopTaskInternal(String taskId, Map> scheduledTasks) { ScheduledFuture scheduledTask = scheduledTasks.remove(taskId); if (scheduledTask != null) { logger.info("Stopping task [{}]", taskId); @@ -179,7 +216,7 @@ private static void stopTaskInternal(String taskId, Map scheduleTask(Runnable task, long initialDelay, long interval, + private @Nullable ScheduledFuture scheduleTask(Runnable task, long initialDelay, long interval, ScheduledExecutorService scheduler) { return scheduler.scheduleWithFixedDelay(task, initialDelay, interval, TimeUnit.SECONDS); } @@ -189,7 +226,7 @@ private static void stopTaskInternal(String taskId, Map scheduledTask) { + private void stopScheduledTask(@Nullable ScheduledFuture scheduledTask) { if (scheduledTask == null || scheduledTask.isCancelled() || scheduledTask.isDone()) { return; } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManagerInterface.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManagerInterface.java new file mode 100644 index 0000000000000..4897045692d09 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/TaskManagerInterface.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.handler; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.function.Consumer; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.jellyfin.internal.api.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SystemInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UserDto; +import org.openhab.binding.jellyfin.internal.events.ErrorEventBus; +import org.openhab.binding.jellyfin.internal.types.ServerState; + +/** + * Interface for task management operations. + * This version integrates TaskFactory responsibilities for cleaner architecture. + * TaskManager becomes the central coordinator for all task-related operations. + * + * @author Patrik Gfeller - Refactoring contribution + */ +@NonNullByDefault +public interface TaskManagerInterface { + + /** + * Initializes all required tasks for the server handler. + * Creates tasks using the injected factory and sets up the task registry. + * + * @param apiClient The API client for task operations + * @param errorEventBus The error event bus for exception handling + * @param connectionHandler Handler for connection success events + * @param usersHandler Handler for users list retrieval events + * @return Map of initialized tasks by their IDs + */ + Map initializeTasks(ApiClient apiClient, + ErrorEventBus errorEventBus, Consumer connectionHandler, Consumer> usersHandler); + + /** + * Manages task transitions for a server state change. + * Automatically starts and stops tasks based on the new state. + * + * @param serverState The new server state + * @param availableTasks Map of available tasks by their IDs + * @param scheduledTasks Map of currently scheduled tasks + * @param scheduler The scheduler service to use for task scheduling + */ + void processStateChange(ServerState serverState, + Map availableTasks, + Map> scheduledTasks, ScheduledExecutorService scheduler); + + /** + * Stops all currently running tasks. + * + * @param scheduledTasks Map of currently scheduled tasks + */ + void stopAllTasks(Map> scheduledTasks); +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java index 4ce259bf8a746..fec10985077a7 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactory.java @@ -27,7 +27,7 @@ * @author Patrik Gfeller - Initial contribution */ @NonNullByDefault -public class TaskFactory { +public class TaskFactory implements TaskFactoryInterface { /** * Creates a connection task with the specified parameters. @@ -37,7 +37,8 @@ public class TaskFactory { * @param exceptionHandler The handler for exceptions * @return A configured connection task */ - public static ConnectionTask createConnectionTask(ApiClient client, Consumer connectionHandler, + @Override + public ConnectionTask createConnectionTask(ApiClient client, Consumer connectionHandler, ExceptionHandlerType exceptionHandler) { return new ConnectionTask(client, connectionHandler, exceptionHandler); } @@ -49,7 +50,8 @@ public static ConnectionTask createConnectionTask(ApiClient client, Consumer> usersHandler, + @Override + public UsersListTask createUsersListTask(ApiClient client, Consumer> usersHandler, ExceptionHandlerType exceptionHandler) { return new UsersListTask(client, usersHandler, exceptionHandler); } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactoryInterface.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactoryInterface.java new file mode 100644 index 0000000000000..c49090a658a7a --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/tasks/TaskFactoryInterface.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.handler.tasks; + +import java.util.List; +import java.util.function.Consumer; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.jellyfin.internal.api.ApiClient; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SystemInfo; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UserDto; +import org.openhab.binding.jellyfin.internal.types.ExceptionHandlerType; + +/** + * Interface for creating tasks used in the Jellyfin binding. + * This enables dependency inversion and better testability. + * + * @author Patrik Gfeller - Refactoring contribution + */ +@NonNullByDefault +public interface TaskFactoryInterface { + + /** + * Creates a connection task with the specified parameters. + * + * @param client The API client to use for the connection + * @param connectionHandler The handler for the retrieved system info + * @param exceptionHandler The handler for exceptions + * @return A configured connection task + */ + ConnectionTask createConnectionTask(ApiClient client, Consumer connectionHandler, + ExceptionHandlerType exceptionHandler); + + /** + * Creates an update task with the specified parameters. + * + * @param client The API client to use for updates + * @param exceptionHandler The handler for exceptions + * @return A configured update task + */ + UpdateTask createUpdateTask(ApiClient client, ExceptionHandlerType exceptionHandler); + + /** + * Creates a users list task with the specified parameters. + * + * @param client The API client to use for the users list request + * @param usersHandler The handler for processing the retrieved users list + * @param exceptionHandler The handler for exceptions + * @return A configured users list task + */ + UsersListTask createUsersListTask(ApiClient client, Consumer> usersHandler, + ExceptionHandlerType exceptionHandler); +} From 1dad4363989b5376b42bef50cb5f710fc5a71ce9 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Thu, 9 Oct 2025 22:51:00 +0200 Subject: [PATCH 35/38] Update bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Configuration.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Patrik Gfeller --- .../org/openhab/binding/jellyfin/internal/Configuration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Configuration.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Configuration.java index 04ec973c4c447..bc3fd3c3ea33b 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Configuration.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Configuration.java @@ -18,7 +18,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault; /** - * The {@link Configuration} class contains fields mapping thing configuration parameters. + * Contains configuration parameters for the Jellyfin binding. * * @author Miguel Álvarez - Initial contribution * @author Patrik Gfeller - Adjustments to work independently of the Android SDK and respective runtime From 544757d649357b1b952b87c9a2b7a79cb16229d1 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sat, 11 Oct 2025 22:18:27 +0200 Subject: [PATCH 36/38] refactor: Extract utility classes from ServerHandler for better maintainability Extract complex business logic from ServerHandler into dedicated utility classes: - **UserManager**: Handles user filtering, change detection, and logging - Processes user lists and tracks additions/removals - Filters enabled and visible users using clean predicates - Provides immutable UserChangeResult records - **ConfigurationManager**: Manages configuration updates from URIs and SystemInfo - Analyzes configuration changes with proper comparison logic - Provides immutable ConfigurationUpdate records - Handles URI parsing and SystemInfo extraction - **ServerStateManager**: Handles server state determination and validation - Analyzes server configuration to recommend appropriate states - Validates state transitions with clear business rules - Provides immutable StateAnalysis records with reasoning **Benefits:** - Reduced ServerHandler from 465 to 384 lines while preserving all functionality - Better testability through focused utility classes with single responsibilities - Enhanced maintainability with clear separation of concerns - Improved code organization following SOLID principles - Modern Java 21 features: records, method references, and stream operations **Architecture:** - Updated class diagrams in CONTRIBUTION.md to reflect new modular structure - Added comprehensive architectural documentation with pattern visualization - Updated AI development guidelines for file size and extraction requirements This refactoring maintains backward compatibility while significantly improving code organization and maintainability. --- .../.github/copilot-instructions.md | 51 +++ .../CONTRIBUTION.md | 363 ++++++++++++++---- .../internal/handler/ServerHandler.java | 144 +++---- .../handler/util/ConfigurationManager.java | 158 ++++++++ .../handler/util/ServerStateManager.java | 136 +++++++ .../internal/handler/util/UserManager.java | 152 ++++++++ 6 files changed, 844 insertions(+), 160 deletions(-) create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/util/ConfigurationManager.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/util/ServerStateManager.java create mode 100644 bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/util/UserManager.java diff --git a/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md b/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md index cc90763bc4459..22870a9d6578a 100644 --- a/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md +++ b/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md @@ -39,6 +39,57 @@ This requirement ensures: 3. Verify diagram accuracy against actual code structure 4. Test build to ensure no compilation errors +### Java 21 Modern Development Standards +**MANDATORY**: All code MUST leverage Java 21 language features and best practices for maintainability, readability, and performance: + +#### Stream API and Modern Collection Operations +- **Use `var` keyword** for local variable type inference where it improves readability +- **Prefer `List.of()`, `Set.of()`, `Map.of()`** over mutable collection constructors for immutable collections +- **Use `Collection.toList()`** instead of `collect(Collectors.toList())` for simple conversions +- **Use `Set.copyOf()`** instead of `new HashSet<>(collection)` for defensive copying +- **Leverage method references** (`::methodName`) over lambda expressions where applicable +- **Use `forEach()` with method references** instead of traditional for-loops where appropriate + +#### Modern Control Flow and Pattern Matching +- **Extract complex filtering logic** into separate predicate methods with descriptive names +- **Use switch expressions** (not statements) for cleaner conditional logic where applicable +- **Prefer early returns** and guard clauses to reduce nesting levels +- **Use pattern matching** for instanceof checks where available + +#### Modern null Safety and Optional Handling +- **Use `Optional.ofNullable()`** for null-safe operations +- **Chain Optional operations** (`map()`, `filter()`, `orElse()`) instead of explicit null checks +- **Use null-safe operators** and modern null-checking patterns +- **Avoid unnecessary null checks** when using modern collection factory methods + +#### Code Organization and Readability +- **Keep methods focused** - extract complex operations into well-named helper methods +- **Use descriptive variable names** with `var` for improved readability +- **Prefer composition** over inheritance where applicable +- **Use record classes** for simple data transfer objects where beneficial +- **Minimize mutable state** and prefer immutable data structures + +#### Performance and Memory Efficiency +- **Use parallel streams** only when beneficial (large datasets, CPU-intensive operations) +- **Prefer lazy evaluation** with streams over eager collection operations +- **Use `StringBuilder` or text blocks** for complex string construction +- **Minimize object allocations** in hot paths using modern collection operations + +#### File Size and Code Organization Requirements +- **Maximum file size**: Individual Java files MUST NOT exceed **450 lines** including comments and whitespace +- **Utility class extraction**: When a class approaches the 450-line limit, extract cohesive utility classes following Single Responsibility Principle +- **Recommended extraction targets**: + - Complex business logic into dedicated service/utility classes + - Configuration management into `ConfigurationManager` utility + - User/data processing into specialized manager classes + - State management logic into `StateManager` utilities +- **Extraction guidelines**: + - Each extracted class should have a single, clear responsibility + - Use dependency injection to provide utility classes to main handlers + - Preserve all existing functionality during extraction + - Maintain comprehensive error handling and logging + - Follow existing package structure: `internal.handler.util.*` for utility classes + ## Architecture Essentials ### Core Components Structure diff --git a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md index 63a2dfb71541b..f23059c5176ce 100644 --- a/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md +++ b/bundles/org.openhab.binding.jellyfin/CONTRIBUTION.md @@ -2,37 +2,108 @@ This document provides information for developers who want to contribute to the Jellyfin binding for openHAB. -## Class Diagram +## Architecture Diagrams -The following diagram shows the main classes and their relationships within the Jellyfin binding: +The Jellyfin binding follows a modular architecture with clear separation of concerns. +The following diagrams show different aspects of the system: + +### Architectural Patterns Overview + +This high-level diagram shows the main architectural patterns and design principles: ```mermaid -classDiagram - %% Interface implementations - ErrorEventListener <|.. ServerHandler - TaskManagerInterface <|.. TaskManager - TaskFactoryInterface <|.. TaskFactory +graph TB + %% Main architectural layers + subgraph Framework["OpenHAB Framework Layer"] + OF[openHAB Framework] + TM[Thing Management] + DS[Discovery Services] + end - %% Dependency injection relationships (clean architecture) - HandlerFactory --> ApiClientFactory : uses - HandlerFactory --> TaskFactory : creates - HandlerFactory --> TaskManager : creates + subgraph Binding["Binding Layer - Design Patterns"] + subgraph Factory["Factory Pattern"] + HF[Handler Factory] + TF[Task Factory] + AF[API Factory] + end + + subgraph Bridge["Bridge Pattern"] + SH["Server Handler
Bridge"] + end + + subgraph Strategy["Strategy Pattern"] + UM[User Manager] + CM[Config Manager] + SM[State Manager] + end + + subgraph Observer["Observer Pattern"] + EB[Error Event Bus] + EL[Error Listeners] + end + + subgraph Command["Command Pattern"] + TM2[Task Manager] + AT[Abstract Tasks] + end + end + + subgraph External["External Integration Layer"] + JA[Jellyfin API] + NET[Network Discovery] + end + + %% Pattern relationships + OF --> HF + HF --> SH + HF --> TF + SH --> UM + SH --> CM + SH --> SM + SH --> TM2 + TM2 --> AT + AT --> EB + EB --> EL + SH --> AF + AF --> JA + DS --> NET + + %% Styling for clarity + classDef factory fill:#e1f5fe + classDef bridge fill:#f3e5f5 + classDef strategy fill:#e8f5e8 + classDef observer fill:#fff3e0 + classDef command fill:#fce4ec + + class HF,TF,AF factory + class SH bridge + class UM,CM,SM strategy + class EB,EL observer + class TM2,AT command +``` + +### Core Handler Architecture + +This diagram shows the main handler structure and dependency injection: + +```mermaid +classDiagram + %% Core handler relationships HandlerFactory --> ServerHandler : creates - ServerHandler --> ApiClient : uses + HandlerFactory --> TaskManager : creates + HandlerFactory --> ApiClientFactory : uses + ServerHandler --> TaskManagerInterface : uses (injected) + ServerHandler --> ApiClient : uses ServerHandler --> ErrorEventBus : owns - TaskManager --> TaskFactoryInterface : uses (injected) - TaskManager --> AbstractTask : manages - TaskFactory ..> AbstractTask : creates + ServerHandler --> UserManager : uses + ServerHandler --> ConfigurationManager : uses + ServerHandler --> ServerStateManager : uses - %% Event-driven error handling (Observer pattern) - ServerDiscoveryService ..> ServerDiscovery : creates - ServerDiscovery ..> ServerDiscoveryResult : creates - ApiClientFactory ..> ApiClient : creates - ContextualExceptionHandler --> ErrorEventBus : publishes to - ErrorEventBus --> ErrorEventListener : notifies + %% Key interfaces + TaskManagerInterface <|.. TaskManager + ErrorEventListener <|.. ServerHandler - %% Class definitions with key attributes and methods class HandlerFactory { +createHandler(Thing) ThingHandler +supportsThingType(ThingTypeUID) boolean @@ -41,8 +112,10 @@ classDiagram class ServerHandler { -TaskManagerInterface taskManager -ErrorEventBus errorEventBus + -UserManager userManager + -ConfigurationManager configurationManager + -ServerStateManager serverStateManager +initialize() - +handleCommand() +dispose() +onErrorEvent(ErrorEvent) +getState() ServerState @@ -50,17 +123,82 @@ classDiagram class TaskManagerInterface { <> - +initializeTasks(...) Map~String,AbstractTask~ - +processStateChange(ServerState, Map, Map, Scheduler) + +initializeTasks(...) Map + +processStateChange(...) +stopAllTasks(Map) } +``` + +### Utility Classes Architecture + +This diagram shows the extracted utility classes that handle specific responsibilities: + +```mermaid +classDiagram + %% Utility classes for separation of concerns + ServerHandler --> UserManager : uses + ServerHandler --> ConfigurationManager : uses + ServerHandler --> ServerStateManager : uses + + class UserManager { + +processUsersList(List, List) UserChangeResult + -logAllUsers(List) + -logIncludedUsers(List) + -logUserChanges(List, List, List) + } + + class ConfigurationManager { + +analyzeUriConfiguration(URI, Configuration) ConfigurationUpdate + +analyzeSystemInfoConfiguration(SystemInfo, Configuration) ConfigurationUpdate + +applyConfigurationChanges(Configuration, Map) + } + + class ServerStateManager { + +analyzeServerState(ServerState, Configuration, Thing) StateAnalysis + +isValidStateTransition(ServerState, ServerState) boolean + +getStateDescription(ServerState) String + } + + %% Records for immutable data transfer + class UserChangeResult { + <> + +List~String~ currentUserIds + +List~String~ addedUserIds + +List~String~ removedUserIds + +List~UserDto~ enabledVisibleUsers + } + + class ConfigurationUpdate { + <> + +Map~String,Object~ configMap + +boolean hasChanges + } + + class StateAnalysis { + <> + +ServerState recommendedState + +String reason + +URI serverUri + } +``` + +### Task Management Architecture + +This diagram shows the task management system: + +```mermaid +classDiagram + %% Task management relationships + TaskManager --> TaskFactoryInterface : uses (injected) + TaskManager --> AbstractTask : manages + TaskFactoryInterface <|.. TaskFactory + TaskFactory ..> AbstractTask : creates class TaskManager { -TaskFactoryInterface taskFactory - +initializeTasks(...) Map~String,AbstractTask~ - +processStateChange(ServerState, Map, Map, Scheduler) + +initializeTasks(...) Map + +processStateChange(...) +stopAllTasks(Map) - -getTaskIdsForState(ServerState) List~String~ } class TaskFactoryInterface { @@ -76,6 +214,64 @@ classDiagram +createUsersListTask(...) UsersListTask } + class AbstractTask { + <> + +getId() String + +getStartupDelay() int + +getInterval() int + +run() + } +``` + +### Error Handling Architecture + +This diagram shows the event-driven error handling system: + +```mermaid +classDiagram + %% Error handling (Observer pattern) + AbstractTask --> ContextualExceptionHandler : uses + ContextualExceptionHandler --> ErrorEventBus : publishes to + ErrorEventBus --> ErrorEventListener : notifies + ErrorEventListener <|.. ServerHandler + + class ContextualExceptionHandler { + +handle(Exception) + -determineErrorType(Exception) ErrorType + -determineErrorSeverity(Exception) ErrorSeverity + } + + class ErrorEventBus { + +addListener(ErrorEventListener) + +removeListener(ErrorEventListener) + +publishEvent(ErrorEvent) + } + + class ErrorEventListener { + <> + +onErrorEvent(ErrorEvent) + } + + class ErrorEvent { + +getContext() String + +getException() Exception + +getType() ErrorType + +getSeverity() ErrorSeverity + } +``` + +### Discovery and API Architecture + +This diagram shows the discovery services and API communication: + +```mermaid +classDiagram + %% Discovery and API components + HandlerFactory --> ApiClientFactory : uses + ApiClientFactory ..> ApiClient : creates + ServerDiscoveryService --> ServerDiscovery : uses + ServerDiscovery ..> ServerDiscoveryResult : creates + class ApiClientFactory { +createApiClient() ApiClient } @@ -91,15 +287,7 @@ classDiagram } class ServerDiscovery { - +discoverServers() List - } - - class AbstractTask { - <> - +getId() String - +getStartupDelay() int - +getInterval() int - +run() + +discoverServers() List~ServerDiscoveryResult~ } class ServerDiscoveryResult { @@ -108,50 +296,53 @@ classDiagram +String uri +String version } - - class ErrorEventListener { - <> - +onErrorEvent(ErrorEvent) - } - - class ErrorEventBus { - +addListener(ErrorEventListener) - +removeListener(ErrorEventListener) - +publishEvent(ErrorEvent) - } - - class ContextualExceptionHandler { - +handle(Exception) - -determineErrorType(Exception) ErrorType - -determineErrorSeverity(Exception) ErrorSeverity - } ``` ## Key Components -1. **HandlerFactory**: Creates thing handlers for the binding. - Uses proper dependency injection to create TaskFactory, TaskManager, and ServerHandler instances. +### Core Architecture Components + +1. **HandlerFactory**: Creates thing handlers for the binding using proper dependency injection to create TaskFactory, TaskManager, and ServerHandler instances. + 2. **ServerHandler**: Main bridge handler for Jellyfin servers that orchestrates server communication and state management. - Implements `ErrorEventListener` for event-driven error handling. - Uses dependency injection for better testability. -3. **TaskManagerInterface**: Interface for task management operations, enabling dependency inversion and better testability. -4. **TaskManager**: Implementation of TaskManagerInterface that integrates TaskFactory for clean architecture. - Acts as the central coordinator for all task-related operations including task creation and lifecycle management. - Uses instance-based approach with dependency injection (no static methods). -5. **TaskFactoryInterface**: Interface for creating task instances, enabling better extensibility and testing. -6. **TaskFactory**: Implementation of TaskFactoryInterface that creates various task instances used for server communication. - Uses instance methods with proper interface implementation (no static factory pattern). -7. **ApiClientFactory**: Creates API client instances for different API versions. -8. **ApiClient**: Handles communication with the Jellyfin server and manages authentication. -9. **ServerDiscoveryService**: Discovers Jellyfin servers on the network using UDP broadcasts. -10. **AbstractTask**: Base class for all tasks that can be scheduled for execution. -11. **ErrorEventBus**: Central event bus for error events using the Observer pattern, providing loose coupling between error producers and consumers. -12. **ContextualExceptionHandler**: Intelligent exception handler that categorizes exceptions by type and severity, then publishes events to the error event bus. -13. **ErrorEvent**: Event object that encapsulates exception information with context, type, and severity for better error handling. + Implements `ErrorEventListener` for event-driven error handling and uses utility classes for separation of concerns. + +3. **TaskManagerInterface/TaskManager**: Interface and implementation for task management operations, enabling dependency inversion and better testability. + Acts as the central coordinator for all task-related operations. + +4. **TaskFactoryInterface/TaskFactory**: Interface and implementation for creating task instances, enabling better extensibility and testing using instance methods with proper interface implementation. + +### Utility Classes (Extracted for Better Maintainability) + +1. **UserManager**: Handles user filtering, change detection, and logging. + Processes user lists from the server and tracks additions/removals of enabled and visible users. + +2. **ConfigurationManager**: Manages configuration updates from URIs and SystemInfo. + Analyzes configuration changes and provides immutable configuration update objects. + +3. **ServerStateManager**: Handles server state determination and validation. + Analyzes server configuration to recommend appropriate states and validates state transitions. + +### API and Communication Components + +1. **ApiClientFactory/ApiClient**: Creates and provides API client instances for different server versions. + Handles communication with the Jellyfin server and manages authentication. + +2. **ServerDiscoveryService**: Discovers Jellyfin servers on the network using UDP broadcasts. + +3. **AbstractTask**: Base class for all tasks that can be scheduled for execution. + +### Error Handling Components + +1. **ErrorEventBus**: Central event bus for error events using the Observer pattern, providing loose coupling between error producers and consumers. + +2. **ContextualExceptionHandler**: Intelligent exception handler that categorizes exceptions by type and severity, then publishes events to the error event bus. + +3. **ErrorEvent**: Event object that encapsulates exception information with context, type, and severity for better error handling. ## Architecture Overview -The binding follows a **state-driven architecture with event-driven error handling** and **dependency injection** for better SOLID compliance: +The binding follows a **modular architecture with clean separation of concerns**, **event-driven error handling**, and **dependency injection** for better SOLID compliance: ### Core Design Principles @@ -163,13 +354,24 @@ The binding follows a **state-driven architecture with event-driven error handli ### Component Interactions -- **ServerHandler** manages the overall server connection lifecycle and uses injected **TaskManagerInterface** for all task operations +- **ServerHandler** acts as the main orchestrator, delegating specific responsibilities to utility classes +- **UserManager** processes user lists and tracks changes independently from the main handler logic +- **ConfigurationManager** handles all configuration analysis and updates from various sources +- **ServerStateManager** manages state transitions and validations with clear reasoning - **TaskManager** integrates **TaskFactoryInterface** to provide a single point of coordination for task creation and management - **TaskFactory injection** into TaskManager creates cleaner separation: ServerHandler → TaskManager → TaskFactory → Tasks - **ServerState** enum defines which tasks should be active for each server state - Tasks are created with **ContextualExceptionHandler** instances for intelligent error categorization - **ApiClient** provides the communication layer with version-specific implementations +### Utility Class Benefits + +- **Improved Maintainability**: Each utility class handles a single responsibility (user management, configuration, state management) +- **Better Testability**: Utility classes can be unit tested independently with mock data +- **Reduced File Size**: Main ServerHandler reduced from 465 to 384 lines while maintaining all functionality +- **Enhanced Readability**: Complex logic is extracted into focused, well-named classes +- **SOLID Compliance**: Each utility class follows Single Responsibility Principle + ### Error Handling Architecture (Observer Pattern) - **ContextualExceptionHandler** categorizes exceptions and publishes **ErrorEvent** objects @@ -177,13 +379,14 @@ The binding follows a **state-driven architecture with event-driven error handli - **ServerHandler** implements **ErrorEventListener** to react to error events with appropriate state changes - **No circular dependencies**: Tasks → ContextualExceptionHandler → ErrorEventBus → ServerHandler (one-way flow) -### Benefits of Improved Architecture +### Benefits of Modular Architecture -1. **Enhanced Testability**: All dependencies can be mocked/stubbed through interfaces -2. **Better Extensibility**: New task types and management strategies can be added easily -3. **Improved Maintainability**: Clearer separation of concerns with TaskManager as central coordinator -4. **SOLID Compliance**: Full adherence to all SOLID principles -5. **Backward Compatibility**: Adapter pattern ensures existing code continues to work +1. **Enhanced Testability**: All dependencies can be mocked/stubbed through interfaces, and utility classes can be tested independently +2. **Better Extensibility**: New task types and management strategies can be added easily without affecting core handler logic +3. **Improved Maintainability**: Clear separation of concerns with utility classes handling specific responsibilities +4. **SOLID Compliance**: Full adherence to all SOLID principles with Single Responsibility Principle enforced through utility extraction +5. **Reduced Complexity**: Main handler file reduced from 465 to 384 lines while preserving all functionality +6. **Code Reusability**: Utility classes can potentially be reused across different handlers or components ## API Version Support diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java index ab88e1d61e275..ab9e1d7f146e5 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/ServerHandler.java @@ -13,7 +13,7 @@ package org.openhab.binding.jellyfin.internal.handler; import java.net.URI; -import java.net.URISyntaxException; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -30,6 +30,9 @@ import org.openhab.binding.jellyfin.internal.events.ErrorEventBus; import org.openhab.binding.jellyfin.internal.events.ErrorEventListener; import org.openhab.binding.jellyfin.internal.handler.tasks.AbstractTask; +import org.openhab.binding.jellyfin.internal.handler.util.ConfigurationManager; +import org.openhab.binding.jellyfin.internal.handler.util.ServerStateManager; +import org.openhab.binding.jellyfin.internal.handler.util.UserManager; import org.openhab.binding.jellyfin.internal.types.ServerState; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.ChannelUID; @@ -59,10 +62,16 @@ public class ServerHandler extends BaseBridgeHandler implements ErrorEventListen private final Configuration configuration; private final TaskManagerInterface taskManager; + // Utility classes for better separation of concerns + private final UserManager userManager; + private final ConfigurationManager configurationManager; + private final ServerStateManager serverStateManager; + private ServerState state = ServerState.INITIALIZING; private final Map tasks = new HashMap<>(); private final Map> scheduledTasks = new HashMap<>(); + private final List activeUserIds = new ArrayList<>(); /** * Constructor with dependency injection for TaskManager @@ -78,6 +87,11 @@ public ServerHandler(Bridge bridge, ApiClient apiClient, TaskManagerInterface ta this.apiClient = apiClient; this.taskManager = taskManager; + // Initialize utility classes for better separation of concerns + this.userManager = new UserManager(); + this.configurationManager = new ConfigurationManager(); + this.serverStateManager = new ServerStateManager(); + // Create event bus and register as listener this.errorEventBus = new ErrorEventBus(); this.errorEventBus.addListener(this); @@ -140,36 +154,24 @@ public void onErrorEvent(ErrorEvent event) { * @return The determined state */ private ServerState determineState() { - // If the current state is DISPOSED, return it immediately - if (this.state == ServerState.DISPOSED) { - return ServerState.DISPOSED; - } - - // Check if we have a discovered server - boolean isDiscovered = thing.getProperties().containsKey(Constants.ServerProperties.SERVER_URI); - - // Check if we have authentication token - boolean hasToken = (this.configuration.token != null && !this.configuration.token.isEmpty()); - try { - URI serverURI = this.configuration.getServerURI(); - if (isDiscovered && !hasToken) { - return ServerState.DISCOVERED; - } else if (serverURI != null && !hasToken) { - return ServerState.NEEDS_AUTHENTICATION; - } else if (serverURI != null && hasToken) { + var stateAnalysis = serverStateManager.analyzeServerState(this.state, this.configuration, this.thing); + + if (stateAnalysis.recommendedState() == ServerState.CONFIGURED && stateAnalysis.serverUri() != null) { + // Authenticate with token when moving to CONFIGURED state this.apiClient.authenticateWithToken(this.configuration.token); - return ServerState.CONFIGURED; } - } catch (URISyntaxException e) { - logger.warn("Invalid server URI configuration: {}", e.getMessage()); + + logger.debug("State analysis: {} - {}", stateAnalysis.recommendedState(), stateAnalysis.reason()); + return stateAnalysis.recommendedState(); + + } catch (Exception e) { + logger.warn("Error during state determination: {}", e.getMessage()); ErrorEvent event = new ErrorEvent(e, ErrorEvent.ErrorType.CONFIGURATION_ERROR, ErrorEvent.ErrorSeverity.FATAL, "determineState"); errorEventBus.publishEvent(event); return ServerState.ERROR; } - - return ServerState.INITIALIZING; } @Override @@ -299,19 +301,15 @@ private Object handleConnection(SystemInfo systemInfo) { */ private void handleUsersList(List users) { try { - logger.info("Retrieved users list from Jellyfin server:"); - logger.info(" Total users: {}", users.size()); - - for (UserDto user : users) { - logger.info(" User: {} (ID: {}, Server: {})", user.getName(), user.getId(), user.getServerName()); + // Use UserManager to process users and detect changes + var userChangeResult = userManager.processUsersList(users, activeUserIds); - if (user.getLastLoginDate() != null) { - logger.info(" Last login: {}", user.getLastLoginDate()); - } - if (user.getLastActivityDate() != null) { - logger.info(" Last activity: {}", user.getLastActivityDate()); - } + // Update the tracked list atomically + synchronized (activeUserIds) { + activeUserIds.clear(); + activeUserIds.addAll(userChangeResult.currentUserIds()); } + } catch (Exception e) { logger.warn("Failed to process users list: {}", e.getMessage(), e); ErrorEvent event = new ErrorEvent(e, ErrorEvent.ErrorType.API_ERROR, ErrorEvent.ErrorSeverity.WARNING, @@ -326,62 +324,48 @@ private void handleUsersList(List users) { * @param uri The URI containing server information */ private void updateConfiguration(URI uri) { - // Track if any config value has changed - boolean configChanged = false; + try { + var configUpdate = configurationManager.analyzeUriConfiguration(uri, this.configuration); - // Only update values if they differ from current configuration - if (uri.getHost() != null && !uri.getHost().equals(this.configuration.hostname)) { - this.configuration.hostname = uri.getHost(); - configChanged = true; - } + if (configUpdate.hasChanges()) { + // Apply changes to the current configuration object + configurationManager.applyConfigurationChanges(this.configuration, configUpdate.configMap()); - if (uri.getPort() > 0 && uri.getPort() != this.configuration.port) { - this.configuration.port = uri.getPort(); - configChanged = true; - } + logger.info("Configuration changed, updating Thing configuration"); - if (uri.getScheme() != null) { - boolean newSslValue = "https".equalsIgnoreCase(uri.getScheme()); - if (newSslValue != this.configuration.ssl) { - this.configuration.ssl = newSslValue; - configChanged = true; + org.openhab.core.config.core.Configuration config = editConfiguration(); + configUpdate.configMap().forEach(config::put); + updateConfiguration(config); + } else { + logger.debug("No configuration changes needed"); } - } - - if (uri.getPath() != null && !uri.getPath().isEmpty() && !uri.getPath().equals(this.configuration.path)) { - this.configuration.path = uri.getPath(); - configChanged = true; - } - - // Only save if something has changed - if (configChanged) { - logger.info("Configuration changed, updating Thing configuration"); - - org.openhab.core.config.core.Configuration config = editConfiguration(); - - config.put("hostname", this.configuration.hostname); - config.put("port", this.configuration.port); - config.put("ssl", this.configuration.ssl); - config.put("path", this.configuration.path); - - updateConfiguration(config); - } else { - logger.debug("No configuration changes needed"); + } catch (Exception e) { + logger.warn("Failed to update configuration from URI: {}", e.getMessage(), e); + ErrorEvent event = new ErrorEvent(e, ErrorEvent.ErrorType.CONFIGURATION_ERROR, + ErrorEvent.ErrorSeverity.WARNING, "updateConfiguration"); + errorEventBus.publishEvent(event); } } private void updateConfiguration(SystemInfo systemInfo) { - var localAddress = systemInfo.getLocalAddress(); + try { + var configUpdate = configurationManager.analyzeSystemInfoConfiguration(systemInfo, this.configuration); - if (localAddress != null && !localAddress.isEmpty()) { - try { - updateConfiguration(new URI(localAddress)); - } catch (Exception e) { - logger.debug("Failed to parse local address URI: {}", e.getMessage()); - ErrorEvent event = new ErrorEvent(e, ErrorEvent.ErrorType.CONFIGURATION_ERROR, - ErrorEvent.ErrorSeverity.WARNING, "updateConfiguration"); - errorEventBus.publishEvent(event); + if (configUpdate.hasChanges()) { + // Apply changes to the current configuration object + configurationManager.applyConfigurationChanges(this.configuration, configUpdate.configMap()); + + logger.info("Configuration updated from SystemInfo"); + + org.openhab.core.config.core.Configuration config = editConfiguration(); + configUpdate.configMap().forEach(config::put); + updateConfiguration(config); } + } catch (Exception e) { + logger.debug("Failed to update configuration from SystemInfo: {}", e.getMessage()); + ErrorEvent event = new ErrorEvent(e, ErrorEvent.ErrorType.CONFIGURATION_ERROR, + ErrorEvent.ErrorSeverity.WARNING, "updateConfiguration"); + errorEventBus.publishEvent(event); } } diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/util/ConfigurationManager.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/util/ConfigurationManager.java new file mode 100644 index 0000000000000..7049220c047df --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/util/ConfigurationManager.java @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.handler.util; + +import java.net.URI; +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.jellyfin.internal.Configuration; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.SystemInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Utility class for managing configuration updates from URIs and SystemInfo. + * Encapsulates configuration comparison and update logic. + * + * @author Patrik Gfeller - Extracted from ServerHandler for better maintainability + */ +@NonNullByDefault +public class ConfigurationManager { + + private final Logger logger = LoggerFactory.getLogger(ConfigurationManager.class); + + /** + * Configuration update result containing the updated configuration values + * and whether any changes were detected. + */ + public record ConfigurationUpdate(Map configMap, boolean hasChanges) { + } + + /** + * Analyzes a URI and determines what configuration changes are needed + * compared to the current configuration. + * + * @param uri The URI containing new configuration information + * @param currentConfig The current configuration to compare against + * @return ConfigurationUpdate containing the new configuration map and change status + */ + public ConfigurationUpdate analyzeUriConfiguration(URI uri, Configuration currentConfig) { + var configMap = new HashMap(); + boolean hasChanges = false; + + // Check hostname changes + if (uri.getHost() != null && !uri.getHost().equals(currentConfig.hostname)) { + configMap.put("hostname", uri.getHost()); + hasChanges = true; + logger.debug("Configuration change detected: hostname {} -> {}", currentConfig.hostname, uri.getHost()); + } else { + configMap.put("hostname", currentConfig.hostname); + } + + // Check port changes + if (uri.getPort() > 0 && uri.getPort() != currentConfig.port) { + configMap.put("port", uri.getPort()); + hasChanges = true; + logger.debug("Configuration change detected: port {} -> {}", currentConfig.port, uri.getPort()); + } else { + configMap.put("port", currentConfig.port); + } + + // Check SSL/scheme changes + if (uri.getScheme() != null) { + boolean newSslValue = "https".equalsIgnoreCase(uri.getScheme()); + if (newSslValue != currentConfig.ssl) { + configMap.put("ssl", newSslValue); + hasChanges = true; + logger.debug("Configuration change detected: ssl {} -> {}", currentConfig.ssl, newSslValue); + } else { + configMap.put("ssl", currentConfig.ssl); + } + } else { + configMap.put("ssl", currentConfig.ssl); + } + + // Check path changes + if (uri.getPath() != null && !uri.getPath().isEmpty() && !uri.getPath().equals(currentConfig.path)) { + configMap.put("path", uri.getPath()); + hasChanges = true; + logger.debug("Configuration change detected: path {} -> {}", currentConfig.path, uri.getPath()); + } else { + configMap.put("path", currentConfig.path); + } + + if (hasChanges) { + logger.info("Configuration changes detected from URI analysis"); + } else { + logger.debug("No configuration changes needed from URI analysis"); + } + + return new ConfigurationUpdate(configMap, hasChanges); + } + + /** + * Extracts local address from SystemInfo and creates a URI for configuration analysis. + * + * @param systemInfo The system information from the Jellyfin server + * @param currentConfig The current configuration + * @return ConfigurationUpdate if local address is available, empty result otherwise + */ + public ConfigurationUpdate analyzeSystemInfoConfiguration(SystemInfo systemInfo, Configuration currentConfig) { + var localAddress = systemInfo.getLocalAddress(); + + if (localAddress != null && !localAddress.isEmpty()) { + try { + URI localUri = new URI(localAddress); + logger.debug("Analyzing configuration from SystemInfo local address: {}", localAddress); + return analyzeUriConfiguration(localUri, currentConfig); + } catch (Exception e) { + logger.debug("Failed to parse local address URI from SystemInfo: {}", e.getMessage()); + return new ConfigurationUpdate(Map.of(), false); + } + } + + logger.debug("No local address available in SystemInfo for configuration analysis"); + return new ConfigurationUpdate(Map.of(), false); + } + + /** + * Updates the current configuration object with new values. + * This method modifies the configuration object in place. + * + * @param currentConfig The configuration object to update + * @param configMap The new configuration values + */ + public void applyConfigurationChanges(Configuration currentConfig, Map configMap) { + configMap.forEach((key, value) -> { + switch (key) { + case "hostname": + currentConfig.hostname = (String) value; + break; + case "port": + currentConfig.port = (Integer) value; + break; + case "ssl": + currentConfig.ssl = (Boolean) value; + break; + case "path": + currentConfig.path = (String) value; + break; + default: + logger.warn("Unknown configuration key: {}", key); + break; + } + }); + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/util/ServerStateManager.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/util/ServerStateManager.java new file mode 100644 index 0000000000000..5da7fbebaee78 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/util/ServerStateManager.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.handler.util; + +import java.net.URI; +import java.net.URISyntaxException; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.jellyfin.internal.Configuration; +import org.openhab.binding.jellyfin.internal.Constants; +import org.openhab.binding.jellyfin.internal.types.ServerState; +import org.openhab.core.thing.Thing; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Utility class for managing server state determination and transitions. + * Encapsulates the logic for analyzing configuration and determining appropriate server states. + * + * @author Patrik Gfeller - Extracted from ServerHandler for better maintainability + */ +@NonNullByDefault +public class ServerStateManager { + + private final Logger logger = LoggerFactory.getLogger(ServerStateManager.class); + + /** + * State determination result containing the determined state and any relevant context. + */ + public record StateAnalysis(ServerState recommendedState, String reason, URI serverUri) { + } + + /** + * Analyzes the current configuration and thing properties to determine the appropriate server state. + * + * @param currentState The current server state + * @param configuration The server configuration + * @param thing The openHAB thing representing the server + * @return StateAnalysis containing the recommended state and reasoning + */ + public StateAnalysis analyzeServerState(ServerState currentState, Configuration configuration, Thing thing) { + // If the current state is DISPOSED, return it immediately + if (currentState == ServerState.DISPOSED) { + logger.debug("Server state analysis: DISPOSED state is final"); + return new StateAnalysis(ServerState.DISPOSED, "Server is disposed", null); + } + + // Check if we have a discovered server + boolean isDiscovered = thing.getProperties().containsKey(Constants.ServerProperties.SERVER_URI); + + // Check if we have authentication token + boolean hasToken = (configuration.token != null && !configuration.token.isEmpty()); + + try { + URI serverURI = configuration.getServerURI(); + + if (isDiscovered && !hasToken) { + logger.debug("Server state analysis: Discovered server without token -> DISCOVERED"); + return new StateAnalysis(ServerState.DISCOVERED, "Server discovered but not authenticated", serverURI); + } else if (serverURI != null && !hasToken) { + logger.debug("Server state analysis: Configured server without token -> NEEDS_AUTHENTICATION"); + return new StateAnalysis(ServerState.NEEDS_AUTHENTICATION, "Server configured but missing token", + serverURI); + } else if (serverURI != null && hasToken) { + logger.debug("Server state analysis: Configured server with token -> CONFIGURED"); + return new StateAnalysis(ServerState.CONFIGURED, "Server fully configured with authentication", + serverURI); + } + } catch (URISyntaxException e) { + logger.warn("Invalid server URI configuration during state analysis: {}", e.getMessage()); + return new StateAnalysis(ServerState.ERROR, "Invalid server URI configuration: " + e.getMessage(), null); + } + + logger.debug("Server state analysis: No clear state determined -> INITIALIZING"); + return new StateAnalysis(ServerState.INITIALIZING, "Server configuration incomplete", null); + } + + /** + * Determines if a state transition is valid and safe to perform. + * + * @param fromState The current state + * @param toState The target state + * @return true if the transition is valid, false otherwise + */ + public boolean isValidStateTransition(ServerState fromState, ServerState toState) { + // DISPOSED is a final state + if (fromState == ServerState.DISPOSED) { + return false; + } + + // Any state can transition to ERROR or DISPOSED + if (toState == ServerState.ERROR || toState == ServerState.DISPOSED) { + return true; + } + + // Define valid forward transitions + return switch (fromState) { + case INITIALIZING -> toState == ServerState.DISCOVERED || toState == ServerState.NEEDS_AUTHENTICATION + || toState == ServerState.CONFIGURED; + case DISCOVERED -> toState == ServerState.NEEDS_AUTHENTICATION || toState == ServerState.CONFIGURED; + case NEEDS_AUTHENTICATION -> toState == ServerState.CONFIGURED; + case CONFIGURED -> toState == ServerState.CONNECTED; + case CONNECTED -> toState == ServerState.CONFIGURED || toState == ServerState.NEEDS_AUTHENTICATION; + case ERROR -> true; // Error state can transition to any state for recovery + case DISPOSED -> false; // Already handled above + }; + } + + /** + * Gets a human-readable description of the given server state. + * + * @param state The server state + * @return A descriptive string explaining the state + */ + public String getStateDescription(ServerState state) { + return switch (state) { + case INITIALIZING -> "Server is initializing and analyzing configuration"; + case DISCOVERED -> "Server was discovered but requires authentication setup"; + case NEEDS_AUTHENTICATION -> "Server is configured but needs authentication token"; + case CONFIGURED -> "Server is configured and authenticated, attempting connection"; + case CONNECTED -> "Server is connected and operational"; + case ERROR -> "Server encountered an error and requires attention"; + case DISPOSED -> "Server handler has been disposed and is no longer active"; + }; + } +} diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/util/UserManager.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/util/UserManager.java new file mode 100644 index 0000000000000..dd89ed183ec34 --- /dev/null +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/handler/util/UserManager.java @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.jellyfin.internal.handler.util; + +import java.util.List; +import java.util.Set; +import java.util.function.Predicate; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.jellyfin.internal.api.generated.current.model.UserDto; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Utility class for managing Jellyfin users, including filtering, tracking changes, + * and logging user status. Follows Single Responsibility Principle by separating + * user management concerns from the main handler. + * + * @author Patrik Gfeller - Extracted from ServerHandler for better maintainability + */ +@NonNullByDefault +public class UserManager { + + private final Logger logger = LoggerFactory.getLogger(UserManager.class); + + /** + * User change tracking result containing filtered users and detected changes. + */ + public record UserChangeResult(List currentUserIds, List addedUserIds, List removedUserIds, + List enabledVisibleUsers) { + } + + /** + * Processes a list of users, filters enabled and visible ones, and detects changes + * compared to the previously tracked user list. + * + * @param users The list of users from the server + * @param previousUserIds The previously tracked user IDs for comparison + * @return UserChangeResult containing filtered users and detected changes + */ + public UserChangeResult processUsersList(List users, List previousUserIds) { + logger.info("Retrieved users list from Jellyfin server:"); + logger.info(" Total users: {}", users.size()); + + // Local predicates for user filtering - following Single Responsibility Principle + Predicate isUserEnabled = user -> { + var policy = user.getPolicy(); + if (policy == null) { + return true; // No policy means no restrictions + } + var isDisabled = policy.getIsDisabled(); + return !Boolean.TRUE.equals(isDisabled); + }; + + Predicate isUserVisible = user -> { + var policy = user.getPolicy(); + if (policy == null) { + return true; // No policy means no restrictions + } + var isHidden = policy.getIsHidden(); + return !Boolean.TRUE.equals(isHidden); + }; + + // Debug logging for all users + logAllUsers(users); + + // Filter enabled and visible users using separated predicates + var enabledVisibleUsers = users.stream().filter(isUserEnabled).filter(isUserVisible).toList(); + + var currentUserIds = enabledVisibleUsers.stream().map(user -> user.getId().toString()).toList(); + + logger.info(" Enabled and visible users: {}", enabledVisibleUsers.size()); + + // Log detailed info for included users + logIncludedUsers(enabledVisibleUsers); + + // Detect changes compared to previous user list + var previousUserIdSet = Set.copyOf(previousUserIds); + var newUserIdSet = Set.copyOf(currentUserIds); + + var addedUserIds = newUserIdSet.stream().filter(id -> !previousUserIdSet.contains(id)).toList(); + + var removedUserIds = previousUserIdSet.stream().filter(id -> !newUserIdSet.contains(id)).toList(); + + // Log changes + logUserChanges(users, addedUserIds, removedUserIds); + + return new UserChangeResult(currentUserIds, addedUserIds, removedUserIds, enabledVisibleUsers); + } + + /** + * Logs debug information for all users. + * + * @param users The list of all users + */ + private void logAllUsers(List users) { + users.forEach(user -> { + var policy = user.getPolicy(); + var isDisabled = policy != null ? policy.getIsDisabled() : null; + var isHidden = policy != null ? policy.getIsHidden() : null; + + logger.debug(" User: {} (ID: {}, Disabled: {}, Hidden: {})", user.getName(), user.getId(), isDisabled, + isHidden); + }); + } + + /** + * Logs detailed information for users that were included after filtering. + * + * @param enabledVisibleUsers The list of enabled and visible users + */ + private void logIncludedUsers(List enabledVisibleUsers) { + enabledVisibleUsers.forEach(user -> { + logger.debug(" User included: {} (ID: {})", user.getName(), user.getId()); + if (user.getLastLoginDate() != null) { + logger.debug(" Last login: {}", user.getLastLoginDate()); + } + if (user.getLastActivityDate() != null) { + logger.debug(" Last activity: {}", user.getLastActivityDate()); + } + }); + } + + /** + * Logs user additions and removals. + * + * @param allUsers The complete list of users for name lookup + * @param addedUserIds The list of added user IDs + * @param removedUserIds The list of removed user IDs + */ + private void logUserChanges(List allUsers, List addedUserIds, List removedUserIds) { + // Log added users with their names + addedUserIds.forEach(addedUserId -> { + var userName = allUsers.stream().filter(user -> addedUserId.equals(user.getId().toString())) + .map(UserDto::getName).findFirst().orElse("Unknown"); + logger.info("User added: {} (ID: {})", userName, addedUserId); + }); + + // Log removed users with their IDs + removedUserIds.forEach(removedUserId -> logger.info("User removed: {}", removedUserId)); + } +} From 3d31a477897b2c2de5cbd7deed712b60f7411098 Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sat, 11 Oct 2025 22:36:50 +0200 Subject: [PATCH 37/38] Update bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Constants.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Patrik Gfeller --- .../java/org/openhab/binding/jellyfin/internal/Constants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Constants.java b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Constants.java index bcb7faecc95a5..7f7e8021c5387 100644 --- a/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Constants.java +++ b/bundles/org.openhab.binding.jellyfin/src/main/java/org/openhab/binding/jellyfin/internal/Constants.java @@ -18,7 +18,7 @@ import org.openhab.core.thing.ThingTypeUID; /** - * The {@link Constants} class defines common constants, which are + * The Constants class defines common constants, which are * used across the whole binding. * * @author Miguel Álvarez - Initial contribution From cef3d48c260a8bda23de1a4d70473119851d3aaa Mon Sep 17 00:00:00 2001 From: Patrik Gfeller Date: Sun, 12 Oct 2025 08:33:06 +0200 Subject: [PATCH 38/38] docs(copilot): Add Git operations restrictions and guidelines for AI agents --- .../.github/copilot-instructions.md | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md b/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md index 22870a9d6578a..bae92d1e4872f 100644 --- a/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md +++ b/bundles/org.openhab.binding.jellyfin/.github/copilot-instructions.md @@ -39,6 +39,28 @@ This requirement ensures: 3. Verify diagram accuracy against actual code structure 4. Test build to ensure no compilation errors +### Git Operations and AI Agent Restrictions +**CRITICAL**: AI agents are **PROHIBITED** from performing commit operations. This is a strict security and code governance requirement: + +#### Forbidden GitKraken MCP Operations +- **NEVER use `mcp_gitkraken_git_add_or_commit`** with action "commit" - AI agents must not commit code +- **Analysis and staging only**: AI agents may use git tools for analysis (status, diff, log) but NOT for committing changes +- **Human oversight required**: All commits must be performed by human developers with proper review + +#### Allowed Git Operations for AI Agents +- **Status checking**: `mcp_gitkraken_git_status` to understand current state +- **Diff analysis**: `mcp_gitkraken_git_log_or_diff` to analyze changes +- **Branch operations**: `mcp_gitkraken_git_branch` for branch management (list only, not create) +- **File staging**: `mcp_gitkraken_git_add_or_commit` with action "add" for staging files (preparation only) + +#### Commit Message Generation Only +- AI agents may **suggest commit messages** based on analyzed changes +- AI agents may **prepare staging** for human review +- **Human developers must execute** the actual commit operation +- This ensures proper code review, accountability, and governance + +**Rationale**: Automated commits bypass essential human oversight, code review processes, and accountability measures required for production code changes. + ### Java 21 Modern Development Standards **MANDATORY**: All code MUST leverage Java 21 language features and best practices for maintainability, readability, and performance: